:root {
    --bg-color: #050505;
    --accent: #FFD700;
    --text: #ffffff;
    --font-pixel: 'Press Start 2P', cursive;
    --font-title: 'Montserrat', sans-serif;
    --font-body: 'Roboto', sans-serif;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

.pixel-text,
h1,
.retro-btn {
    font-family: 'Press Start 2P', cursive;
    -webkit-font-smoothing: none;
    text-rendering: optimizeSpeed;
}

#player-input {
    font-family: 'Press Start 2P', cursive !important;
    background: transparent;
    border: none;
    border-bottom: 2px solid var(--accent);
    color: #fff;
    font-size: 0.9rem;
    padding: 10px;
    text-align: center;
    text-transform: uppercase;
    outline: none;
}

.instructions-pc,
.instructions-mobile {
    font-size: 0.45rem;
    letter-spacing: 2px;
    line-height: 1.8;
    margin-top: 25px;
    color: #888;
    text-align: center;
    max-width: 80%;
}

.instructions-pc {
    display: block;
}

.instructions-mobile {
    display: none;
    color: var(--accent);
    animation: blinker 1.5s infinite;
}

body {
    background-color: var(--bg-color);
    color: var(--text);
    width: 100vw;
    height: 100dvh;
    overflow: hidden;
    font-family: var(--font-body);
    display: flex;
    flex-direction: column;
    overscroll-behavior: none;
}

.container {
    width: 100%;
    height: 100%;
    max-width: 800px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    background: #0f0f0f;
    box-shadow: 0 0 50px rgba(0, 0, 0, 0.5);
    position: relative;
}

#game-wrapper {
    flex: 1;
    display: flex;
    flex-direction: column;
    position: relative;
    border-bottom: 2px solid var(--accent);
    min-height: 0;
}

.game-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 15px;
    background: #000;
    border-bottom: 1px solid #333;
    height: 40px;
    flex-shrink: 0;
    z-index: 5;
}

.hud-item {
    font-size: 0.5rem;
    color: var(--accent);
}

.canvas-container {
    flex: 1;
    position: relative;
    overflow: hidden;
    background: #111;
    background: linear-gradient(rgba(18, 16, 16, 0) 50%, rgba(0, 0, 0, 0.25) 50%), linear-gradient(90deg, rgba(255, 0, 0, 0.06), rgba(0, 255, 0, 0.02), rgba(0, 0, 255, 0.06));
    background-size: 100% 2px, 3px 100%;
}

canvas {
    display: block;
    width: 100%;
    height: 100%;
    image-rendering: pixelated;
}

.bottom-panel {
    flex-shrink: 0;
    background: #1a1a1a;
    z-index: 20;
    position: relative;
    overflow: visible !important;
    border-top: 1px solid var(--accent);
}

.fixed-base {
    background: #1a1a1a;
    position: relative;
    z-index: 25;
    padding-bottom: 15px;
}

#panel-collapsible-content {
    position: absolute;
    bottom: 100%;
    left: 0;
    width: 100%;
    background: rgba(26, 26, 26, 0.98);
    backdrop-filter: blur(10px);
    border-top: 2px solid var(--accent);
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.4s ease-out;
    z-index: 30;
}

.bottom-panel:not(.minimized) #panel-collapsible-content {
    max-height: 75vh;
    overflow-y: auto;
    box-shadow: 0 -10px 50px rgba(0, 0, 0, 0.8);
}

.handle-container {
    width: 100%;
    display: flex;
    justify-content: center;
    background: #1a1a1a;
    padding-top: 5px;
}

#toggle-panel-btn {
    width: 100%;
    height: 25px;
    background: transparent;
    border: none;
    color: var(--accent);
    cursor: pointer;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 1rem;
    transition: background 0.2s;
}

#toggle-panel-btn:hover {
    background: rgba(255, 255, 255, 0.05);
}

#toggle-panel-btn i {
    transition: transform 0.3s ease;
}

.bottom-panel.minimized #toggle-panel-btn i {
    transform: rotate(0deg);
}

.bottom-panel:not(.minimized) #toggle-panel-btn i {
    transform: rotate(180deg);
}

.content-padding {
    padding: 20px;
}

.panel-header-fixed {
    padding: 5px 0 10px 0;
    background: #1a1a1a;
}

.fixed-actions {
    padding: 0 20px;
}

.info-title {
    font-family: var(--font-title);
    font-weight: 800;
    color: #fff;
    font-size: 0.8rem;
    text-align: center;
    margin: 0;
}

.actions-row {
    display: flex;
    gap: 10px;
}

.btn {
    flex: 1;
    padding: 12px 5px;
    text-decoration: none;
    font-family: var(--font-title);
    font-weight: 700;
    font-size: 0.7rem;
    text-transform: uppercase;
    text-align: center;
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: 0.2s;
    white-space: nowrap;
}

.btn-primary {
    background: var(--accent);
    color: #000;
    border: 1px solid var(--accent);
}

.btn-outline {
    border: 1px solid #555;
    color: #fff;
    background: transparent;
}

.btn-icon {
    flex: 0;
    padding: 0 15px;
    background: #25D366;
    color: #fff;
    font-size: 1.2rem;
    border: none;
}

.info-text {
    font-size: 0.85rem;
    color: #bbb;
    text-align: center;
    margin-bottom: 15px;
}

.projects-area {
    background: rgba(0, 0, 0, 0.3);
    padding: 15px;
    border: 1px solid #333;
    border-radius: 6px;
}

.projects-grid {
    display: grid;
    gap: 12px;
    grid-template-columns: repeat(auto-fill, minmax(110px, 1fr));
}

.project-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 8px;
    background: #222;
    padding: 15px 10px;
    text-decoration: none;
    border: 1px solid #444;
    border-radius: 6px;
    position: relative;
    transition: all 0.2s;
}

.project-card span {
    font-family: var(--font-body);
    font-size: 0.7rem;
    color: #fff;
    text-align: center;
    font-weight: 600;
    letter-spacing: 0.5px;
    line-height: 1.3;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    width: 100%;
}

.project-card i {
    font-size: 1.3rem;
    color: var(--accent);
    margin-bottom: 2px;
}

.project-card:hover {
    background: #333;
    border-color: var(--accent);
    transform: translateY(-2px);
}

.mini-icon {
    position: absolute;
    top: 5px;
    right: 5px;
    font-size: 0.5rem !important;
    color: #666 !important;
}

.divider {
    height: 1px;
    background: #333;
    width: 100%;
    margin: 15px 0;
}

footer {
    text-align: center;
    font-size: 0.6rem;
    color: #555;
    font-family: var(--font-title);
    text-transform: uppercase;
    margin-top: 5px;
}

.overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.95);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    z-index: 10;
    text-align: center;
    padding: 20px;
}

.overlay h1 {
    font-size: 1.5rem;
    margin-bottom: 20px;
    color: var(--accent);
    line-height: 1.5;
}

.input-group {
    margin-bottom: 25px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    width: 100%;
    max-width: 250px;
}

.blink {
    animation: blinker 1s linear infinite;
}

@keyframes blinker {
    50% {
        opacity: 0;
    }
}

#btn-pause-toggle {
    background: transparent;
    border: 1px solid #333;
    color: #fff;
    width: 30px;
    height: 30px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}

@media (max-width: 480px) {
    .actions-row {
        flex-wrap: wrap;
    }

    .btn-icon {
        flex: 1;
    }
}

@media (hover: none) and (pointer: coarse) {
    .instructions-pc {
        display: none;
    }

    .instructions-mobile {
        display: block;
    }
}