/* ═══════════════════════════════════════════════
   PLANETA BZZZT! — Landing Page Styles
   Space theme: dark cosmos + neon accents
   ═══════════════════════════════════════════════ */

/* ── Custom Properties ─────────────────────── */
:root {
    --space-black:  #02020f;
    --space-deep:   #07071a;
    --space-mid:    #0d0d2b;
    --space-light:  #12123a;

    --neon-blue:    #00d4ff;
    --neon-purple:  #a855f7;
    --neon-pink:    #f000c8;
    --neon-green:   #39ff14;
    --neon-yellow:  #ffea00;

    --text-primary:   #f1f5f9;
    --text-secondary: rgba(226, 232, 240, 0.7);
    --text-muted:     rgba(226, 232, 240, 0.4);

    --card-bg:     rgba(10, 10, 40, 0.75);
    --card-border: rgba(255, 255, 255, 0.07);

    --radius-sm:  0.5rem;
    --radius-md:  1rem;
    --radius-lg:  1.5rem;
    --radius-xl:  2rem;
    --radius-full: 999px;

    --transition-fast: 0.18s ease;
    --transition-mid:  0.3s ease;
    --transition-slow: 0.5s ease;

    --font-display: 'Orbitron', 'Courier New', monospace;
    --font-body:    'Exo 2', system-ui, -apple-system, sans-serif;
}

/* ── Reset & Base ───────────────────────────── */
*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
    font-size: 16px;
}

body {
    font-family: var(--font-body);
    background: var(--space-black);
    color: var(--text-primary);
    overflow-x: hidden;
    line-height: 1.6;
}

/* ── Starfield Canvas ───────────────────────── */
#stars-canvas {
    position: fixed;
    inset: 0;
    z-index: 0;
    pointer-events: none;
    opacity: 0.9;
}

/* ── Section Shared Styles ──────────────────── */
section {
    position: relative;
    z-index: 1;
}

.section-header {
    text-align: center;
    margin-bottom: 3.5rem;
}

.section-title {
    font-family: var(--font-display);
    font-size: clamp(1.6rem, 4vw, 2.6rem);
    font-weight: 700;
    color: var(--neon-blue);
    text-shadow: 0 0 25px rgba(0, 212, 255, 0.45);
    margin-bottom: 0.75rem;
}

.section-title-purple {
    color: var(--neon-purple);
    text-shadow: 0 0 25px rgba(168, 85, 247, 0.45);
}

.section-subtitle {
    font-size: 1.05rem;
    color: var(--text-secondary);
    font-weight: 300;
}

/* ── Buttons ────────────────────────────────── */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.85rem 2rem;
    border-radius: var(--radius-full);
    font-family: var(--font-body);
    font-size: 1.05rem;
    font-weight: 600;
    letter-spacing: 0.02em;
    text-decoration: none;
    transition: all var(--transition-mid);
    cursor: pointer;
    border: none;
    white-space: nowrap;
}

.btn-primary {
    background: linear-gradient(135deg, var(--neon-blue), #0066ff);
    color: #fff;
    box-shadow: 0 0 25px rgba(0, 212, 255, 0.35);
}
.btn-primary:hover,
.btn-primary:focus-visible {
    transform: translateY(-3px) scale(1.04);
    box-shadow: 0 0 45px rgba(0, 212, 255, 0.6);
    outline: none;
}

.btn-secondary {
    background: rgba(255, 255, 255, 0.04);
    color: var(--text-primary);
    border: 1px solid rgba(255, 255, 255, 0.2);
}
.btn-secondary:hover,
.btn-secondary:focus-visible {
    border-color: rgba(255, 255, 255, 0.6);
    background: rgba(255, 255, 255, 0.1);
    transform: translateY(-2px);
    outline: none;
}

/* ════════════════════════════════════════════
   HERO SECTION
   ════════════════════════════════════════════ */
.hero {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 6rem 1.5rem 4rem;
    background:
        radial-gradient(ellipse 80% 50% at 50% 0%,   rgba(168, 85, 247, 0.12) 0%, transparent 60%),
        radial-gradient(ellipse 60% 40% at 50% 100%, rgba(0, 212, 255, 0.08)  0%, transparent 60%);
}

.hero-content {
    max-width: 760px;
    width: 100%;
}

/* Badge */
.badge {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    background: rgba(168, 85, 247, 0.12);
    border: 1px solid rgba(168, 85, 247, 0.35);
    color: var(--neon-purple);
    padding: 0.35rem 1.1rem;
    border-radius: var(--radius-full);
    font-size: 0.78rem;
    font-family: var(--font-display);
    letter-spacing: 0.08em;
    text-transform: uppercase;
    margin-bottom: 2rem;
}

.badge-dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: var(--neon-purple);
    box-shadow: 0 0 8px var(--neon-purple);
    animation: pulse-dot 1.8s ease-in-out infinite;
}

@keyframes pulse-dot {
    0%, 100% { opacity: 1; transform: scale(1); }
    50%       { opacity: 0.4; transform: scale(0.7); }
}

/* Hero Title */
.hero-title {
    font-family: var(--font-display);
    font-weight: 900;
    line-height: 1.05;
    margin-bottom: 1.5rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.2rem;
}

.planet-anim {
    font-size: clamp(3.5rem, 10vw, 6rem);
    display: block;
    animation: float 3.5s ease-in-out infinite;
    filter: drop-shadow(0 0 20px rgba(168, 85, 247, 0.6));
}

@keyframes float {
    0%, 100% { transform: translateY(0)     rotate(-5deg); }
    50%       { transform: translateY(-18px) rotate(5deg);  }
}

.title-planet {
    font-size: clamp(2.8rem, 9vw, 6rem);
    color: #fff;
    text-shadow: 0 0 30px rgba(255, 255, 255, 0.2);
}

.title-bzzzt {
    font-size: clamp(3.2rem, 11vw, 7.5rem);
    background: linear-gradient(135deg, var(--neon-blue) 0%, var(--neon-purple) 50%, var(--neon-pink) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    animation: glow-text 2.5s ease-in-out infinite alternate;
    background-size: 200% 200%;
    animation: gradient-shift 3s ease infinite alternate, glow-text 2.5s ease-in-out infinite;
}

@keyframes gradient-shift {
    0%   { background-position: 0% 50%; }
    100% { background-position: 100% 50%; }
}

@keyframes glow-text {
    0%   { filter: drop-shadow(0 0 15px rgba(168, 85, 247, 0.7)); }
    50%  { filter: drop-shadow(0 0 35px rgba(0, 212, 255, 0.9)); }
    100% { filter: drop-shadow(0 0 20px rgba(240, 0, 200, 0.8)); }
}

/* Hero Subtitle */
.hero-subtitle {
    font-size: clamp(1rem, 2.5vw, 1.25rem);
    color: var(--text-secondary);
    margin-bottom: 2.5rem;
    font-weight: 300;
    line-height: 1.7;
}

.hero-subtitle strong {
    color: var(--neon-blue);
    font-weight: 600;
}

.hero-event-link {
    color: var(--neon-purple);
    font-weight: 600;
    text-decoration: none;
    border-bottom: 1px solid rgba(168, 85, 247, 0.4);
    transition: color var(--transition-fast), border-color var(--transition-fast);
}
.hero-event-link:hover {
    color: #fff;
    border-color: rgba(255, 255, 255, 0.6);
}

/* CTAs */
.hero-ctas {
    display: flex;
    gap: 1rem;
    justify-content: center;
    flex-wrap: wrap;
    margin-bottom: 3rem;
}

/* Stats Bar */
.stats-bar {
    display: inline-flex;
    align-items: center;
    gap: 1.5rem;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: var(--radius-full);
    padding: 0.75rem 2rem;
    backdrop-filter: blur(12px);
}

.stat {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.1rem;
}

.stat-value {
    font-family: var(--font-display);
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--neon-blue);
}

.stat-label {
    font-size: 0.68rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.06em;
}

.stat-divider {
    width: 1px;
    height: 2rem;
    background: rgba(255, 255, 255, 0.1);
}

/* Scroll hint */
.hero-scroll-hint {
    position: absolute;
    bottom: 2rem;
    left: 50%;
    transform: translateX(-50%);
    font-size: 1.4rem;
    color: var(--text-muted);
    animation: bounce-down 2s ease-in-out infinite;
    cursor: pointer;
}

@keyframes bounce-down {
    0%, 100% { transform: translateX(-50%) translateY(0);   }
    50%       { transform: translateX(-50%) translateY(8px); }
}

/* ════════════════════════════════════════════
   GAMES SECTION
   ════════════════════════════════════════════ */
.games-section {
    padding: 6rem 1.5rem;
    background:
        radial-gradient(ellipse 70% 40% at 50% 50%, rgba(0, 212, 255, 0.05) 0%, transparent 70%);
}

.games-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 2rem;
    max-width: 920px;
    margin: 0 auto;
}

/* ── Game Card ──────────────────────────────── */
.game-card {
    position: relative;
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: var(--radius-xl);
    padding: 2rem 2rem 2.5rem;
    cursor: pointer;
    transition: transform var(--transition-mid), box-shadow var(--transition-mid), border-color var(--transition-mid);
    backdrop-filter: blur(16px);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
    outline: none;
}

.game-card:hover,
.game-card:focus-visible {
    transform: translateY(-10px);
}

.game-card:focus-visible {
    outline: 2px solid var(--neon-blue);
    outline-offset: 3px;
}

/* Glow blob behind card */
.card-glow {
    position: absolute;
    width: 200px;
    height: 200px;
    border-radius: 50%;
    top: -60px;
    right: -60px;
    filter: blur(60px);
    opacity: 0.15;
    transition: opacity var(--transition-mid);
    pointer-events: none;
}
.game-card:hover .card-glow { opacity: 0.3; }

.card-glow-blue   { background: var(--neon-blue); }
.card-glow-purple { background: var(--neon-purple); }

/* Card hover: blue */
.game-card:not(.game-card-featured):hover {
    border-color: rgba(0, 212, 255, 0.4);
    box-shadow: 0 24px 60px rgba(0, 212, 255, 0.15);
}

/* Featured card (3D) */
.game-card-featured {
    border-color: rgba(168, 85, 247, 0.25);
    background: rgba(20, 10, 50, 0.8);
}
.game-card-featured:hover,
.game-card-featured:focus-visible {
    border-color: rgba(168, 85, 247, 0.55);
    box-shadow: 0 24px 60px rgba(168, 85, 247, 0.2);
}

/* Featured ribbon */
.card-featured-ribbon {
    position: absolute;
    top: 1rem;
    right: -0.5rem;
    background: linear-gradient(135deg, var(--neon-purple), var(--neon-pink));
    color: #fff;
    font-size: 0.68rem;
    font-family: var(--font-display);
    font-weight: 700;
    letter-spacing: 0.08em;
    padding: 0.3rem 1rem 0.3rem 0.75rem;
    border-radius: var(--radius-sm) 0 0 var(--radius-sm);
    box-shadow: -3px 3px 12px rgba(168, 85, 247, 0.5);
}

/* Card tag */
.card-tag {
    display: inline-block;
    font-family: var(--font-display);
    font-size: 0.65rem;
    letter-spacing: 0.12em;
    padding: 0.2rem 0.7rem;
    border-radius: var(--radius-full);
    font-weight: 700;
    align-self: flex-start;
}
.card-tag-blue {
    background: rgba(0, 212, 255, 0.1);
    border: 1px solid rgba(0, 212, 255, 0.3);
    color: var(--neon-blue);
}
.card-tag-purple {
    background: rgba(168, 85, 247, 0.1);
    border: 1px solid rgba(168, 85, 247, 0.3);
    color: var(--neon-purple);
}

/* Card visual / preview area */
.card-visual {
    position: relative;
    height: 120px;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.card-planet {
    font-size: 3.5rem;
    position: relative;
    z-index: 2;
    animation: float 3s ease-in-out infinite;
    filter: drop-shadow(0 0 15px rgba(0, 212, 255, 0.5));
}
.card-planet-2d { animation-delay: 0s; }
.card-planet-3d { animation-delay: -1.5s; filter: drop-shadow(0 0 15px rgba(168, 85, 247, 0.6)); }

.card-orbit {
    position: absolute;
    border-radius: 50%;
    border: 1px solid;
    opacity: 0.15;
}
.card-orbit-2d {
    width: 90px; height: 90px;
    border-color: var(--neon-blue);
    animation: spin 8s linear infinite;
}
.card-orbit-3d {
    width: 100px; height: 100px;
    border-color: var(--neon-purple);
    animation: spin 6s linear infinite reverse;
}

@keyframes spin {
    from { transform: rotate(0deg); }
    to   { transform: rotate(360deg); }
}

.card-star {
    position: absolute;
    font-size: 1rem;
    animation: twinkle 2s ease-in-out infinite;
}
.card-star-1 { top: 10%; left: 10%; animation-delay: 0s;    font-size: 0.85rem; }
.card-star-2 { top: 20%; right: 15%; animation-delay: 0.4s; font-size: 0.7rem;  }
.card-star-3 { bottom: 15%; left: 25%; animation-delay: 0.8s; font-size: 0.75rem; }
.card-star-4 { top: 10%; right: 10%; animation-delay: 0.2s; }
.card-star-5 { bottom: 10%; left: 10%; animation-delay: 0.6s; font-size: 0.85rem; }
.card-star-6 { top: 30%; left: 15%; animation-delay: 1s;    font-size: 0.7rem;  }

@keyframes twinkle {
    0%, 100% { opacity: 0.8; transform: scale(1); }
    50%       { opacity: 0.2; transform: scale(0.7); }
}

/* Card body */
.card-body { flex: 1; }

.card-title {
    font-family: var(--font-display);
    font-size: 1.25rem;
    font-weight: 700;
    color: #fff;
    margin-bottom: 0.6rem;
}

.card-desc {
    font-size: 0.9rem;
    color: var(--text-secondary);
    line-height: 1.65;
    margin-bottom: 1rem;
}

.card-features {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 0.3rem;
}

.card-features li {
    font-size: 0.82rem;
    color: var(--text-secondary);
    padding-left: 0.2rem;
}

/* Play button */
.play-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.8rem 1.8rem;
    border-radius: var(--radius-full);
    font-family: var(--font-display);
    font-size: 0.9rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    border: none;
    cursor: pointer;
    transition: all var(--transition-mid);
    align-self: flex-start;
}

.play-btn-blue {
    background: linear-gradient(135deg, var(--neon-blue), #0055dd);
    color: #fff;
    box-shadow: 0 0 20px rgba(0, 212, 255, 0.3);
}
.play-btn-blue:hover {
    box-shadow: 0 0 35px rgba(0, 212, 255, 0.55);
    transform: scale(1.05);
}

.play-btn-purple {
    background: linear-gradient(135deg, var(--neon-purple), var(--neon-pink));
    color: #fff;
    box-shadow: 0 0 20px rgba(168, 85, 247, 0.35);
}
.play-btn-purple:hover {
    box-shadow: 0 0 35px rgba(168, 85, 247, 0.6);
    transform: scale(1.05);
}

/* ════════════════════════════════════════════
   ABOUT SECTION
   ════════════════════════════════════════════ */
.about-section {
    padding: 6rem 1.5rem;
    background:
        linear-gradient(0deg, rgba(168, 85, 247, 0.04) 0%, transparent 100%);
}

.about-content {
    max-width: 1000px;
    margin: 0 auto;
}

.about-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 1.5rem;
    margin-bottom: 3rem;
}

.about-card {
    background: var(--card-bg);
    border: 1px solid rgba(168, 85, 247, 0.12);
    border-radius: var(--radius-lg);
    padding: 2rem 1.5rem;
    text-align: center;
    backdrop-filter: blur(12px);
    transition: transform var(--transition-mid), border-color var(--transition-mid);
}

.about-card:hover {
    transform: translateY(-5px);
    border-color: rgba(168, 85, 247, 0.35);
}

.about-icon {
    font-size: 2.5rem;
    display: block;
    margin-bottom: 1rem;
    filter: drop-shadow(0 0 10px rgba(168, 85, 247, 0.4));
}

.about-card h3 {
    font-family: var(--font-display);
    font-size: 0.95rem;
    color: var(--neon-purple);
    margin-bottom: 0.6rem;
}

.about-card p {
    font-size: 0.88rem;
    color: var(--text-secondary);
    line-height: 1.7;
}

/* Tech stack badges */
.tech-stack {
    display: flex;
    flex-wrap: wrap;
    gap: 0.6rem;
    justify-content: center;
}

.tech-badge {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: var(--text-secondary);
    padding: 0.3rem 0.9rem;
    border-radius: var(--radius-full);
    font-size: 0.78rem;
    font-family: var(--font-display);
    letter-spacing: 0.05em;
    transition: border-color var(--transition-fast), color var(--transition-fast);
}

.tech-badge:hover {
    border-color: rgba(0, 212, 255, 0.4);
    color: var(--neon-blue);
}

/* ════════════════════════════════════════════
   FOOTER
   ════════════════════════════════════════════ */
.site-footer {
    position: relative;
    z-index: 1;
    text-align: center;
    padding: 3rem 1.5rem;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
}

.footer-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.4rem;
}

.footer-logo {
    font-size: 2.5rem;
    animation: float 4s ease-in-out infinite;
    margin-bottom: 0.5rem;
    filter: drop-shadow(0 0 12px rgba(168, 85, 247, 0.5));
}

.footer-title {
    font-family: var(--font-display);
    font-size: 1rem;
    color: var(--text-primary);
}

.footer-sub {
    font-size: 0.82rem;
    color: var(--text-muted);
}

.footer-powered {
    font-size: 0.78rem;
    color: var(--text-muted);
    margin-top: 0.3rem;
}

.footer-powered a {
    color: var(--neon-blue);
    text-decoration: none;
    transition: color var(--transition-fast);
}
.footer-powered a:hover { color: #fff; }

/* ════════════════════════════════════════════
   GAME MODAL
   ════════════════════════════════════════════ */
.modal {
    position: fixed;
    inset: 0;
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    opacity: 0;
    visibility: hidden;
    transition: opacity var(--transition-mid), visibility var(--transition-mid);
}

.modal.active {
    opacity: 1;
    visibility: visible;
}

.modal-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(2, 2, 15, 0.92);
    backdrop-filter: blur(12px);
}

.modal-window {
    position: relative;
    z-index: 1;
    width: min(96vw, 1440px);
    height: min(94vh, 900px);
    background: var(--space-mid);
    border: 1px solid rgba(0, 212, 255, 0.2);
    border-radius: var(--radius-xl);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    box-shadow:
        0 0 0 1px rgba(0, 212, 255, 0.05),
        0 40px 80px rgba(0, 0, 0, 0.7),
        0 0 60px rgba(0, 212, 255, 0.08);
    transform: scale(0.93) translateY(10px);
    transition: transform var(--transition-mid);
}

.modal.active .modal-window {
    transform: scale(1) translateY(0);
}

/* Modal Header */
.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.65rem 1.25rem;
    background: rgba(0, 0, 0, 0.5);
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
    flex-shrink: 0;
}

.modal-title-bar {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.modal-dot {
    width: 11px;
    height: 11px;
    border-radius: 50%;
}
.modal-dot-red    { background: #ff5f57; }
.modal-dot-yellow { background: #ffbd2e; }
.modal-dot-green  { background: #28ca41; }

.modal-game-name {
    font-family: var(--font-display);
    font-size: 0.8rem;
    color: var(--neon-blue);
    margin-left: 0.5rem;
    letter-spacing: 0.04em;
}

.modal-controls {
    display: flex;
    gap: 0.5rem;
    align-items: center;
}

.modal-fullscreen-btn {
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: var(--text-secondary);
    padding: 0.35rem 0.65rem;
    border-radius: var(--radius-sm);
    font-size: 0.9rem;
    cursor: pointer;
    transition: all var(--transition-fast);
}
.modal-fullscreen-btn:hover {
    background: rgba(255, 255, 255, 0.12);
    color: #fff;
}

.modal-close-btn {
    background: rgba(255, 0, 110, 0.12);
    border: 1px solid rgba(255, 0, 110, 0.3);
    color: #ff4d8f;
    padding: 0.35rem 0.9rem;
    border-radius: var(--radius-sm);
    font-family: var(--font-display);
    font-size: 0.72rem;
    cursor: pointer;
    transition: all var(--transition-fast);
    letter-spacing: 0.05em;
}
.modal-close-btn:hover {
    background: rgba(255, 0, 110, 0.25);
    box-shadow: 0 0 15px rgba(255, 0, 110, 0.3);
}

/* Game area */
.modal-game-area {
    flex: 1;
    position: relative;
    background: #000;
    overflow: hidden;
}

/* Loading state */
.game-loader {
    position: absolute;
    inset: 0;
    z-index: 10;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 1.25rem;
    background: var(--space-deep);
}

.loader-rocket {
    font-size: 4rem;
    animation: rocket-orbit 2.5s ease-in-out infinite;
    filter: drop-shadow(0 0 20px rgba(0, 212, 255, 0.6));
}

@keyframes rocket-orbit {
    0%   { transform: translateY(0) rotate(-30deg) scale(1); }
    25%  { transform: translateY(-20px) rotate(0deg) scale(1.1); }
    50%  { transform: translateY(0) rotate(30deg) scale(1); }
    75%  { transform: translateY(-10px) rotate(0deg) scale(1.05); }
    100% { transform: translateY(0) rotate(-30deg) scale(1); }
}

.loader-text {
    font-family: var(--font-display);
    font-size: 1.1rem;
    color: var(--neon-blue);
    letter-spacing: 0.06em;
}

.loader-bar {
    width: 220px;
    height: 3px;
    background: rgba(0, 212, 255, 0.15);
    border-radius: 2px;
    overflow: hidden;
}

.loader-bar-fill {
    height: 100%;
    background: linear-gradient(90deg, transparent, var(--neon-blue), transparent);
    border-radius: 2px;
    animation: loader-sweep 1.8s ease-in-out infinite;
}

@keyframes loader-sweep {
    0%   { width: 0%;   margin-left: 0;    }
    50%  { width: 100%; margin-left: 0;    }
    100% { width: 0%;   margin-left: 100%; }
}

.loader-hint {
    font-size: 0.78rem;
    color: var(--text-muted);
    max-width: 280px;
    text-align: center;
    line-height: 1.5;
}

/* Game iframe */
#game-frame {
    width: 100%;
    height: 100%;
    border: none;
    display: block;
    transition: opacity var(--transition-mid);
}

/* ════════════════════════════════════════════
   RESPONSIVE & MOBILE
   ════════════════════════════════════════════ */

/* ── Touch targets — min 44×44px per WCAG ── */
.btn,
.play-btn,
.modal-close-btn,
.modal-fullscreen-btn,
.game-card {
    touch-action: manipulation; /* eliminates 300ms tap delay */
}

.btn          { min-height: 44px; }
.play-btn     { min-height: 44px; }

/* ── Fix grid overflow on narrow screens ─── */
.games-grid {
    min-width: 0;
}
.game-card {
    min-width: 0;
    word-wrap: break-word;
}

/* ── Tablet (≤ 768px) ───────────────────── */
@media (max-width: 768px) {
    .games-grid {
        grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    }

    .stats-bar {
        gap: 0.75rem;
        padding: 0.6rem 1rem;
    }

    .stat-value { font-size: 1rem; }
}

/* ── Mobile (≤ 640px) ───────────────────── */
@media (max-width: 640px) {
    .hero {
        padding: 4.5rem 1rem 3rem;
    }

    .hero-ctas {
        flex-direction: column;
        align-items: stretch;
        width: 100%;
        max-width: 320px;
        margin-left: auto;
        margin-right: auto;
    }

    .btn {
        justify-content: center;
        width: 100%;
    }

    /* Stats bar wraps gracefully on small screens */
    .stats-bar {
        flex-wrap: wrap;
        justify-content: center;
        gap: 0.5rem 1.25rem;
        padding: 0.75rem 1.25rem;
        width: 100%;
        max-width: 320px;
    }

    .stat-divider { display: none; } /* dividers confusing when wrapped */

    .games-grid {
        grid-template-columns: 1fr;
        max-width: 420px;
        margin-left: auto;
        margin-right: auto;
    }

    /* Keep game card featured ribbon visible */
    .card-featured-ribbon {
        font-size: 0.6rem;
    }

    .about-grid {
        grid-template-columns: 1fr 1fr;
    }

    .about-card {
        padding: 1.5rem 1rem;
    }

    /* Modal: true fullscreen on mobile */
    .modal { padding: 0; }

    .modal-window {
        width: 100vw;
        height: 100dvh;     /* dynamic viewport height — handles browser chrome */
        max-width: none;
        max-height: none;
        border-radius: 0;
        border: none;
    }

    .modal-header {
        padding: 0.5rem 0.75rem;
    }

    .modal-game-name {
        font-size: 0.7rem;
        max-width: 150px;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    /* Bigger close button on mobile */
    .modal-close-btn {
        padding: 0.5rem 1rem;
        font-size: 0.8rem;
        min-height: 40px;
    }

    /* Hide fullscreen btn on mobile (browser handles it) */
    .modal-fullscreen-btn { display: none; }

    /* Loader more compact on mobile */
    .loader-rocket { font-size: 3rem; }
    .loader-text   { font-size: 0.95rem; }
    .loader-hint   { font-size: 0.72rem; }
}

/* ── Small phones (≤ 400px) ─────────────── */
@media (max-width: 400px) {
    .about-grid { grid-template-columns: 1fr; }

    .badge {
        font-size: 0.62rem;
        padding: 0.3rem 0.8rem;
        text-align: center;
    }

    .tech-stack { gap: 0.4rem; }
    .tech-badge { font-size: 0.7rem; }
}

/* ── Safe area insets (notch/home bar) ───── */
@supports (padding: env(safe-area-inset-bottom)) {
    .site-footer {
        padding-bottom: calc(2rem + env(safe-area-inset-bottom));
    }
    .modal-window {
        /* Ensure content clears home indicator */
        padding-bottom: env(safe-area-inset-bottom);
    }
}

/* ── Remove hover effects on touch devices ─ */
@media (hover: none) {
    .game-card:hover,
    .game-card:focus-visible {
        transform: none;
        box-shadow: none;
    }
    .game-card:not(.game-card-featured):hover { border-color: var(--card-border); }
    .game-card-featured:hover { border-color: rgba(168, 85, 247, 0.25); }
    .about-card:hover { transform: none; }
    .btn-primary:hover { transform: none; box-shadow: 0 0 25px rgba(0, 212, 255, 0.35); }
}

/* ── Reduced motion ─────────────────────── */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        transition-duration: 0.01ms !important;
    }
}

