/* ==========================================================================
   Games page — Arcade Neón (Prometheos)
   ========================================================================== */

.nav-link.active {
    color: var(--neon-cyan);
}
.nav-link.active::after { width: 100%; }

.games-hero {
    padding: 150px 0 40px;
    text-align: center;
    position: relative;
}
.games-hero .section-title { margin-bottom: 18px; }
.games-hero-text {
    max-width: 680px;
    margin: 0 auto;
    color: var(--text-secondary);
    font-size: 1.05rem;
    line-height: 1.8;
}

.games-section { padding-top: 30px; }

.games-layout {
    display: grid;
    grid-template-columns: 300px 1fr;
    gap: 28px;
    align-items: start;
}

/* ---------- Game menu ---------- */
.games-menu {
    display: flex;
    flex-direction: column;
    gap: 14px;
    position: sticky;
    top: 92px;
    max-height: calc(100vh - 120px);
    overflow-y: auto;
    padding-right: 6px;
    scrollbar-width: thin;
    scrollbar-color: rgba(0, 229, 255, 0.35) transparent;
}
.games-menu::-webkit-scrollbar { width: 8px; }
.games-menu::-webkit-scrollbar-track { background: transparent; }
.games-menu::-webkit-scrollbar-thumb {
    background: rgba(0, 229, 255, 0.25);
    border-radius: 100px;
}
.games-menu::-webkit-scrollbar-thumb:hover { background: rgba(0, 229, 255, 0.45); }
.game-card {
    display: flex;
    align-items: center;
    gap: 16px;
    text-align: left;
    padding: 16px 18px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    color: var(--text-primary);
    font-family: inherit;
    transition: var(--transition);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    position: relative;
    overflow: hidden;
}
.game-card::before {
    content: '';
    position: absolute;
    left: 0; top: 0; bottom: 0;
    width: 3px;
    background: linear-gradient(var(--neon-cyan), var(--neon-violet));
    opacity: 0;
    transition: var(--transition);
}
.game-card:hover {
    transform: translateX(4px);
    border-color: rgba(0, 229, 255, 0.4);
    box-shadow: 0 0 30px rgba(0, 229, 255, 0.14);
}
.game-card.active {
    border-color: rgba(0, 229, 255, 0.5);
    box-shadow: 0 0 34px rgba(0, 229, 255, 0.2);
}
.game-card.active::before { opacity: 1; }
.game-card-icon {
    width: 46px; height: 46px;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 12px;
    background: rgba(0, 229, 255, 0.08);
    border: 1px solid rgba(0, 229, 255, 0.25);
    color: var(--neon-cyan);
    font-size: 1.15rem;
    box-shadow: inset 0 0 16px rgba(0, 229, 255, 0.12);
}
.game-card.active .game-card-icon {
    background: rgba(0, 229, 255, 0.16);
    color: #fff;
    box-shadow: 0 0 20px rgba(0, 229, 255, 0.35);
}
.game-card-body { display: flex; flex-direction: column; }
.game-card-body strong { font-family: 'Orbitron', sans-serif; font-size: 0.92rem; letter-spacing: 0.5px; }
.game-card-body small { color: var(--text-muted); font-size: 0.76rem; }

/* ---------- Stage ---------- */
.game-stage {
    display: flex;
    flex-direction: column;
    gap: 14px;
}
.game-hud {
    display: flex;
    align-items: center;
    gap: 18px;
    flex-wrap: wrap;
    padding: 12px 18px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
}
.hud-name {
    font-family: 'Orbitron', sans-serif;
    font-size: 0.9rem;
    color: var(--neon-cyan);
    text-shadow: 0 0 12px rgba(0, 229, 255, 0.5);
    margin-right: auto;
}
.hud-stat {
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.8rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 1px;
}
.hud-stat b {
    color: var(--text-primary);
    font-size: 1rem;
    margin-left: 4px;
}

.game-canvas-wrap {
    position: relative;
    border-radius: var(--radius-lg);
    overflow: hidden;
    border: 1px solid rgba(0, 229, 255, 0.25);
    box-shadow: 0 0 50px rgba(0, 229, 255, 0.12), inset 0 0 60px rgba(0, 0, 0, 0.5);
    background: #03060c;
    line-height: 0;
}
#gameCanvas {
    display: block;
    width: 100%;
    height: auto;
    aspect-ratio: 3 / 2;
    touch-action: none;
}

.game-overlay {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 14px;
    text-align: center;
    padding: 24px;
    background: radial-gradient(circle at 50% 40%, rgba(4, 8, 18, 0.75), rgba(3, 6, 12, 0.94));
    backdrop-filter: blur(4px);
    line-height: 1.5;
    z-index: 5;
}
.game-overlay.hidden { display: none; }
.game-overlay h3 {
    font-family: 'Orbitron', sans-serif;
    font-size: clamp(1.4rem, 4vw, 2.1rem);
    text-shadow: 0 0 24px rgba(0, 229, 255, 0.4);
}
.game-overlay p {
    color: var(--text-secondary);
    max-width: 420px;
    font-size: 0.95rem;
}

.game-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 26px;
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.82rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: #03060c;
    background: linear-gradient(120deg, var(--neon-cyan), var(--neon-violet));
    border: none;
    border-radius: 100px;
    font-weight: 700;
    transition: var(--transition);
    box-shadow: 0 0 24px rgba(0, 229, 255, 0.4);
}
.game-btn:hover { transform: translateY(-2px); box-shadow: 0 0 40px rgba(0, 229, 255, 0.6); }
.game-btn.ghost {
    background: rgba(0, 229, 255, 0.06);
    color: var(--neon-cyan);
    border: 1px solid rgba(0, 229, 255, 0.3);
    box-shadow: none;
}
.game-btn.ghost:hover { background: rgba(0, 229, 255, 0.12); box-shadow: 0 0 20px rgba(0, 229, 255, 0.25); }

.game-bar {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}
.game-hint {
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.72rem;
    color: var(--text-muted);
    margin-left: auto;
}

/* ---------- Touch pad ---------- */
.touch-pad {
    display: none;
    grid-template-columns: repeat(3, 56px);
    grid-template-rows: repeat(3, 56px);
    justify-content: center;
    gap: 8px;
    margin-top: 6px;
}
.touch-pad button {
    background: rgba(0, 229, 255, 0.08);
    border: 1px solid rgba(0, 229, 255, 0.3);
    border-radius: 14px;
    color: var(--neon-cyan);
    font-size: 1.1rem;
    transition: var(--transition);
}
.touch-pad button:active { background: rgba(0, 229, 255, 0.25); transform: scale(0.94); }
.touch-pad button[data-dir="up"] { grid-column: 2; grid-row: 1; }
.touch-pad button[data-dir="left"] { grid-column: 1; grid-row: 2; }
.touch-pad button[data-dir="down"] { grid-column: 2; grid-row: 2; }
.touch-pad button[data-dir="right"] { grid-column: 3; grid-row: 2; }

@media (max-width: 900px) {
    .games-layout { grid-template-columns: 1fr; }
    .games-menu {
        position: static;
        flex-direction: row;
        overflow-x: auto;
        overflow-y: hidden;
        max-height: none;
        padding-bottom: 6px;
    }
    .game-card { min-width: 240px; }
}

@media (hover: none), (pointer: coarse) {
    .touch-pad { display: grid; }
    .game-hint { display: none; }
}
