/* ============================================
   CSS CUSTOM PROPERTIES
   ============================================ */
:root {
    --sky: #5c94fc;
    --sky-deep: #3c6edc;
    --ground-top: #c8a060;
    --ground: #e09c40;
    --brick: #c84c0c;
    --brick-light: #fc9838;
    --brick-dark: #a43000;
    --pipe-green: #00a800;
    --pipe-dark: #005800;
    --pipe-light: #48d848;
    --coin-gold: #f8b800;
    --coin-light: #f8d878;
    --coin-dark: #a85000;
    --fire-red: #f83800;
    --fire-orange: #fc7460;
    --text-white: #fcfcfc;
    --text-shadow: #000;
    --underground: #0c0c3c;
    --underground-brick: #604020;
    --castle-gray: #747474;
    --castle-dark: #383838;
    --star-yellow: #f8d878;
    --hud-bg: #000;
    --font: 'Press Start 2P', monospace;
}

/* ============================================
   RESET & BASE
   ============================================ */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

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

body {
    font-family: var(--font);
    background: var(--hud-bg);
    color: var(--text-white);
    overflow-x: hidden;
    -webkit-font-smoothing: none;
    -moz-osx-font-smoothing: unset;
}

img {
    max-width: 100%;
    display: block;
    image-rendering: auto;
}

a {
    color: inherit;
    text-decoration: none;
}

button {
    font-family: var(--font);
    cursor: pointer;
    border: none;
    background: none;
    color: inherit;
}

/* ============================================
   CONTAINER
   ============================================ */
.container {
    width: 100%;
    max-width: 1100px;
    margin-left: auto;
    margin-right: auto;
}

/* Scanline CRT overlay */
body::after {
    content: '';
    position: fixed;
    inset: 0;
    background: repeating-linear-gradient(
            0deg,
            transparent,
            transparent 2px,
            rgba(0, 0, 0, 0.03) 2px,
            rgba(0, 0, 0, 0.03) 4px
    );
    pointer-events: none;
    z-index: 9999;
    transition: opacity 0.3s;
}
body.no-scanlines::after {
    opacity: 0;
}

/* ============================================
   SCROLL REVEAL
   ============================================ */
.reveal {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.7s ease, transform 0.7s ease;
}

.reveal.visible {
    opacity: 1;
    transform: translateY(0);
}

/* ============================================
   LOADING SCREEN
   ============================================ */
.loading-screen {
    position: fixed;
    inset: 0;
    background: #000;
    z-index: 10000;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    transition: opacity 0.5s;
}

.loading-screen.hidden {
    opacity: 0;
    pointer-events: none;
}

.loading-text {
    font-size: 14px;
    color: var(--text-white);
    margin-bottom: 24px;
    letter-spacing: 3px;
}

.loading-bar-bg {
    width: 240px;
    height: 20px;
    border: 4px solid var(--text-white);
    background: #000;
}

.loading-bar-fill {
    height: 100%;
    background: var(--pipe-green);
    width: 0%;
    transition: width 0.1s;
}

/* ============================================
   HUD / HEADER
   ============================================ */
.hud {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 100;
    background: var(--hud-bg);
    border-bottom: 4px solid #303030;
    padding: 12px 24px;
    display: grid;
    grid-template-columns: 1fr 1fr;
    align-items: center;
    font-size: 11px;
    letter-spacing: 1px;
}

.hud-left {
    display: flex;
    align-items: center;
    gap: 24px;
}

.hud-coins {
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--coin-gold);
}

.hud-coin-icon {
    width: 20px;
    image-rendering: pixelated;
    animation: coinSpin 2s ease-in-out infinite;
    flex-shrink: 0;
}

.hud-right {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 16px;
}

.hud-heart {
    width: 22px;
    height: 20px;
    cursor: pointer;
    transition: transform 0.2s;
    position: relative;
}

.hud-heart::before {
    content: '';
    position: absolute;
    width: 22px;
    height: 20px;
    background: var(--fire-red);
    clip-path: polygon(
            0% 35%, 5% 20%, 15% 10%, 25% 5%, 35% 5%, 45% 10%, 50% 20%,
            55% 10%, 65% 5%, 75% 5%, 85% 10%, 95% 20%, 100% 35%,
            95% 55%, 75% 75%, 50% 100%, 25% 75%, 5% 55%
    );
}

.hud-heart:hover {
    transform: scale(1.3);
}

@keyframes coinSpin {
    0%, 100% {
        transform: scaleX(1);
    }
    50% {
        transform: scaleX(0.2);
    }
}

/* ============================================
   HERO SECTION — WORLD 1-1
   ============================================ */
.hero {
    background-color: var(--sky);
    min-height: 100vh;
    padding-top: 60px;
    display: flex;
    flex-direction: column;
    position: relative;
    overflow: hidden;
}

.hero::before,
.files-section::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 300%;
    height: 100%;
    z-index: 1;
    pointer-events: none;
    background: radial-gradient(ellipse 120px 50px at 5% 15%, rgba(255, 255, 255, 0.85) 0%, transparent 100%),
    radial-gradient(ellipse 80px 35px at 8% 14%, rgba(255, 255, 255, 0.9) 0%, transparent 100%),
    radial-gradient(ellipse 100px 40px at 18% 30%, rgba(255, 255, 255, 0.8) 0%, transparent 100%),
    radial-gradient(ellipse 60px 28px at 20% 28%, rgba(255, 255, 255, 0.85) 0%, transparent 100%),
    radial-gradient(ellipse 140px 55px at 35% 20%, rgba(255, 255, 255, 0.8) 0%, transparent 100%),
    radial-gradient(ellipse 90px 38px at 38% 18%, rgba(255, 255, 255, 0.9) 0%, transparent 100%),
    radial-gradient(ellipse 110px 45px at 52% 35%, rgba(255, 255, 255, 0.75) 0%, transparent 100%),
    radial-gradient(ellipse 70px 30px at 55% 33%, rgba(255, 255, 255, 0.85) 0%, transparent 100%),
    radial-gradient(ellipse 130px 50px at 70% 12%, rgba(255, 255, 255, 0.8) 0%, transparent 100%),
    radial-gradient(ellipse 85px 36px at 73% 10%, rgba(255, 255, 255, 0.9) 0%, transparent 100%),
    radial-gradient(ellipse 100px 42px at 88% 28%, rgba(255, 255, 255, 0.8) 0%, transparent 100%),
    radial-gradient(ellipse 65px 30px at 90% 26%, rgba(255, 255, 255, 0.85) 0%, transparent 100%);
    animation: cloudsDrift 60s linear infinite;
}

@keyframes cloudsDrift {
    0% {
        transform: translateX(0);
    }
    100% {
        transform: translateX(-33.333%);
    }
}

.hero-content {
    flex: 1;
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: center;
    padding: 40px 24px 20px;
    position: relative;
    z-index: 2;
    gap: clamp(24px, 4vw, 64px);
}

.hero-left {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    text-align: left;
    flex: 1;
    max-width: 480px;
}

.hero-left .sf-stats {
    margin: 0 0 32px;
}

.hero-right {
    display: flex;
    flex-direction: column;
    align-items: center;
    flex-shrink: 0;
}

.hero-title {
    font-size: clamp(18px, 4.5vw, 42px);
    color: var(--text-white);
    text-shadow: 4px 0 0 #000, -4px 0 0 #000,
    0 4px 0 #000, 0 -4px 0 #000,
    4px 4px 0 #000;
    margin-bottom: 20px;
    line-height: 1.6;
}

/* Street Fighter stat bars */
.sf-stats {
    width: clamp(240px, 32vw, 360px);
    margin: 0 auto 32px;
}

.sf-stat-row {
    display: flex;
    flex-direction: column;
    gap: 4px;
    margin-bottom: 8px;
}

.sf-stat-label {
    font-size: clamp(6px, 1vw, 9px);
    color: var(--text-white);
    text-shadow: 2px 2px 0 #000;
    letter-spacing: 1px;
}

.sf-stat-track {
    width: 100%;
    height: 14px;
    background: #1a1a1a;
    border: 2px solid #505050;
    position: relative;
    overflow: hidden;
    box-shadow: inset 0 0 0 1px #000;
}

.sf-stat-fill {
    height: 100%;
    width: 0%;
    background: repeating-linear-gradient(
            90deg,
            var(--coin-gold) 0px,
            var(--coin-gold) 6px,
            #c88800 6px,
            #c88800 8px
    );
    box-shadow: inset 0 -2px 0 rgba(0, 0, 0, 0.3), inset 0 2px 0 rgba(255, 255, 255, 0.2);
    animation: sfBarFill 1.2s ease-out forwards;
    animation-delay: var(--bar-delay, 0s);
}


@keyframes sfBarFill {
    from {
        width: 0%;
    }
    to {
        width: var(--bar-width);
    }
}

/* TV frame */
.hero-tv-area {
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 24px;
}

.tv-frame {
    width: clamp(260px, 35vw, 450px);
    background: #383838;
    border: 8px solid #505050;
    box-shadow: inset 0 0 0 4px #282828, 8px 8px 0 rgba(0, 0, 0, 0.3);
    border-radius: 8px;
    cursor: pointer;
    transition: transform 0.2s;
}

.tv-frame:hover {
    transform: scale(1.02);
}

.tv-screen {
    position: relative;
    overflow: hidden;
    background: #1a1a1a;
    aspect-ratio: 4/3;
}

.tv-screen img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    image-rendering: pixelated;
}

.tv-play {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.35);
    transition: background 0.3s;
    z-index: 3;
}

.tv-frame:hover .tv-play {
    background: rgba(0, 0, 0, 0.15);
}

.tv-play-btn {
    width: 60px;
    height: 60px;
    background: var(--fire-red);
    clip-path: polygon(20% 10%, 20% 90%, 85% 50%);
    transition: transform 0.2s;
}

.tv-frame:hover .tv-play-btn {
    transform: scale(1.2);
}

.tv-label {
    text-align: center;
    padding: 8px;
    font-size: 8px;
    color: #a0a0a0;
    background: #303030;
    letter-spacing: 1px;
}

/* TV photo auto-cycle with pixel dissolve */
.tv-screen img.tv-img-back {
    position: absolute;
    top: 0;
    left: 0;
    z-index: 0;
}

.tv-screen img.tv-img-front {
    position: absolute;
    top: 0;
    left: 0;
    z-index: 1;
}

.tv-canvas {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 2;
    pointer-events: none;
    display: none;
    image-rendering: pixelated;
}


/* Start button */
.start-btn {
    font-size: clamp(12px, 2vw, 18px);
    color: var(--text-white);
    padding: 16px 48px;
    animation: blink 1.2s step-start infinite;
    letter-spacing: 2px;
    display: inline-block;
}

@keyframes blink {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0;
    }
}

.start-btn:hover {
    animation: none;
    color: var(--coin-gold);
}

/* ============================================
   ABOUT SECTION — UNDERGROUND
   ============================================ */
.about {
    padding: 80px 24px 0;
    position: relative;
    overflow: hidden;
}

/* ---- ABOUT SCENE LAYOUT ---- */
.about-scene {
    max-width: 820px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    align-items: center;
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.6s ease, transform 0.6s ease;
}

.about-scene.visible {
    opacity: 1;
    transform: translateY(0);
}

/* ---- PLAIN WORLD LABEL ---- */
.world-label-plain {
    font-size: clamp(12px, 2vw, 18px);
    color: var(--text-white);
    letter-spacing: 4px;
}

/* ---- CHARACTER + PIPE + COINS ---- */
.about-character-wrap {
    display: flex;
    align-items: flex-end;
    justify-content: center;
    gap: clamp(16px, 4vw, 40px);
    position: relative;
    margin-top: 28px;
}

.about-character-pipe {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.about-coins-side {
    display: flex;
    align-items: flex-end;
    padding-bottom: 8px;
}

.deco-coins-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 30px;
    margin-bottom: 50px;
}

.about-character {
    position: relative;
    z-index: 2;
    transform: translateY(100%);
    opacity: 0;
}

.about-character.risen {
    transform: translateY(0);
    opacity: 1;
    transition: transform 1s cubic-bezier(0.22, 1, 0.36, 1), opacity 0.4s ease;
}

.about-character img {
    width: clamp(80px, 14vw, 120px);
    height: auto;
    image-rendering: pixelated;
    display: block;
}

.about-pipe {
    position: relative;
    z-index: 3;
    margin-top: -4px;
}

.about-pipe-img {
    width: clamp(100px, 18vw, 160px);
    image-rendering: pixelated;
    display: block;
    transform: rotate(180deg);
}

/* ---- RPG DIALOGUE BOX ---- */
.rpg-dialogue {
    width: 100%;
    max-width: 700px;
    opacity: 0;
    transform: scale(0.9);
}

.rpg-dialogue.active {
    opacity: 1;
    transform: scale(1);
    transition: opacity 0.4s ease 0.6s, transform 0.4s ease 0.6s;
}

.rpg-dialogue-header {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    position: relative;
    top: 3px;
    z-index: 2;
    padding: 0 16px;
}

.rpg-dialogue-name {
    display: inline-block;
    background: var(--text-white);
    color: #000;
    font-size: clamp(9px, 1.3vw, 12px);
    padding: 6px 16px;
    border: 3px solid #000;
    border-bottom: none;
}

.rpg-dialogue-box {
    background: var(--text-white);
    color: #000;
    border: 3px solid #000;
    box-shadow: 4px 4px 0 rgba(0, 0, 0, 0.3);
    padding: clamp(20px, 3vw, 32px);
    position: relative;
    min-height: clamp(140px, 22vw, 190px);
    display: flex;
    flex-direction: column;
    cursor: pointer;
}

/* Triangle notch pointing down */
.rpg-dialogue-box::after {
    content: '';
    position: absolute;
    bottom: -14px;
    left: 50%;
    transform: translateX(-50%);
    width: 0;
    height: 0;
    border-left: 14px solid transparent;
    border-right: 14px solid transparent;
    border-top: 14px solid var(--text-white);
}

.rpg-dialogue-box::before {
    content: '';
    position: absolute;
    bottom: -18px;
    left: 50%;
    transform: translateX(-50%);
    width: 0;
    height: 0;
    border-left: 16px solid transparent;
    border-right: 16px solid transparent;
    border-top: 16px solid #000;
    z-index: -1;
}

.rpg-dialogue-text {
    font-size: clamp(10px, 1.5vw, 14px);
    line-height: 2.4;
    color: #000;
    flex: none;
    height: 9.6em; /* 4 lines × 2.4 line-height */
}

.rpg-dialogue-text .hl {
    color: var(--fire-red);
}

/* Controls — inside the box */
.rpg-dialogue-controls {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 20px;
    margin-top: 12px;
    border-top: 2px solid rgba(0, 0, 0, 0.1);
    padding-top: 10px;
}

.rpg-btn {
    background: none;
    border: 3px solid rgba(0, 0, 0, 0.15);
    color: rgba(0, 0, 0, 0.3);
    font-family: var(--font);
    font-size: 14px;
    padding: 6px 12px;
    cursor: pointer;
    transition: all 0.15s;
}

.rpg-btn:hover {
    border-color: #000;
    color: #000;
}

.rpg-btn:disabled {
    opacity: 0.15;
    cursor: default;
}

.rpg-btn:disabled:hover {
    border-color: rgba(0, 0, 0, 0.15);
    color: rgba(0, 0, 0, 0.3);
}

.rpg-dialogue-counter {
    font-size: clamp(8px, 1.2vw, 11px);
    color: rgba(0, 0, 0, 0.3);
}

/* CTA button — in header, top-right */
.rpg-dialogue-cta {
    opacity: 0;
    transform: translateY(4px);
    pointer-events: none;
    transition: opacity 0.4s ease, transform 0.4s ease;
}

.rpg-dialogue-cta.show {
    opacity: 1;
    transform: translateY(0);
    pointer-events: auto;
}

.rpg-cta-btn {
    display: inline-block;
    font-size: clamp(8px, 1.2vw, 11px);
    padding: 6px 16px;
    background: var(--coin-gold);
    color: #000;
    border: 3px solid #000;
    border-bottom: none;
    cursor: pointer;
    text-transform: uppercase;
    letter-spacing: 2px;
    text-decoration: none;
    animation: rpgCtaPulse 2s ease-in-out infinite;
    transition: all 0.15s;
}

.rpg-cta-btn:hover {
    background: var(--fire-red);
    color: var(--text-white);
    animation: none;
}

@keyframes rpgCtaPulse {
    0%, 100% { box-shadow: 0 0 0 0 rgba(248, 184, 0, 0.4); }
    50% { box-shadow: 0 0 12px 2px rgba(248, 184, 0, 0.3); }
}

/* ============================================
   ACHIEVEMENTS — QUESTION BLOCKS
   ============================================ */
.achievements {
    background: #09241b;
    padding: 80px 24px 120px;
    position: relative;
}

.achievements-inner {
    max-width: 1000px;
}

.achievements-title {
    font-size: clamp(18px, 3.5vw, 32px);
    color: var(--star-yellow);
    text-align: center;
    margin-bottom: 56px;
    text-shadow: 3px 3px 0 rgba(0, 0, 0, 0.8);
}

.achievements-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: clamp(16px, 3vw, 40px);
    justify-items: center;
}

/* ---- Question Block Wrap ---- */
.qblock-wrap {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 16px;
    width: 100%;
    max-width: 200px;
}

/* ---- The Block Itself ---- */
.qblock {
    width: clamp(80px, 12vw, 120px);
    height: clamp(80px, 12vw, 120px);
    position: relative;
    cursor: pointer;
    transform-origin: center bottom;
}

.qblock-face {
    width: 100%;
    height: 100%;
    background:
        /* Inner border highlight */
        linear-gradient(180deg, var(--coin-light) 0%, var(--coin-gold) 8%, var(--coin-gold) 92%, var(--coin-dark) 100%);
    border: 4px solid #000;
    box-shadow:
        inset 4px 4px 0 rgba(255, 255, 255, 0.3),
        inset -4px -4px 0 rgba(0, 0, 0, 0.25),
        6px 6px 0 rgba(0, 0, 0, 0.4);
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    transition: transform 0.1s;
}

/* Brick pattern overlay */
.qblock-face::before {
    content: '';
    position: absolute;
    inset: 6px;
    border: 3px solid var(--coin-dark);
    pointer-events: none;
}

/* Corner rivets */
.qblock-face::after {
    content: '';
    position: absolute;
    inset: 0;
    background:
        radial-gradient(circle 4px at 10px 10px, var(--coin-dark) 50%, transparent 51%),
        radial-gradient(circle 4px at calc(100% - 10px) 10px, var(--coin-dark) 50%, transparent 51%),
        radial-gradient(circle 4px at 10px calc(100% - 10px), var(--coin-dark) 50%, transparent 51%),
        radial-gradient(circle 4px at calc(100% - 10px) calc(100% - 10px), var(--coin-dark) 50%, transparent 51%);
    pointer-events: none;
}

.qblock-q {
    font-size: clamp(28px, 5vw, 48px);
    color: #000;
    text-shadow: 2px 2px 0 rgba(255, 255, 255, 0.3);
    font-weight: bold;
    position: relative;
    z-index: 1;
    animation: qBlockPulse 2s ease-in-out infinite;
}

@keyframes qBlockPulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.08); }
}

/* Hover — block wiggles */
.qblock:not(.hit):hover .qblock-face {
    transform: translateY(-4px);
}

.qblock:not(.hit):hover .qblock-q {
    animation: qBlockPulse 0.4s ease-in-out infinite;
}

/* ---- Hit State ---- */
.qblock.hit .qblock-face {
    background: linear-gradient(180deg, #8a7040 0%, #6a5530 8%, #6a5530 92%, #4a3a20 100%);
    box-shadow:
        inset 4px 4px 0 rgba(255, 255, 255, 0.1),
        inset -4px -4px 0 rgba(0, 0, 0, 0.3),
        6px 6px 0 rgba(0, 0, 0, 0.4);
}

.qblock.hit .qblock-face::before {
    border-color: #4a3a20;
}

.qblock.hit .qblock-face::after {
    background:
        radial-gradient(circle 4px at 10px 10px, #4a3a20 50%, transparent 51%),
        radial-gradient(circle 4px at calc(100% - 10px) 10px, #4a3a20 50%, transparent 51%),
        radial-gradient(circle 4px at 10px calc(100% - 10px), #4a3a20 50%, transparent 51%),
        radial-gradient(circle 4px at calc(100% - 10px) calc(100% - 10px), #4a3a20 50%, transparent 51%);
}

.qblock.hit .qblock-q {
    display: none;
}

/* Icon revealed after hit */
.qblock-icon {
    font-size: clamp(24px, 4vw, 40px);
    position: relative;
    z-index: 1;
    display: none;
    animation: iconPopIn 0.4s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
}

.qblock.hit .qblock-icon {
    display: block;
}

@keyframes iconPopIn {
    0% {
        transform: scale(0) rotate(-20deg);
        opacity: 0;
    }
    60% {
        transform: scale(1.3) rotate(5deg);
        opacity: 1;
    }
    100% {
        transform: scale(1) rotate(0deg);
        opacity: 1;
    }
}

.qblock.hit {
    cursor: default;
}

/* ---- Secret Block — looks like a plain brick ---- */
.qblock-secret .qblock-face {
    background: linear-gradient(180deg, var(--brick-light) 0%, var(--brick) 8%, var(--brick) 92%, var(--brick-dark) 100%);
    box-shadow:
        inset 4px 4px 0 rgba(255, 255, 255, 0.15),
        inset -4px -4px 0 rgba(0, 0, 0, 0.3),
        6px 6px 0 rgba(0, 0, 0, 0.4);
}

.qblock-secret .qblock-face::before {
    border-color: var(--brick-dark);
}

.qblock-secret .qblock-face::after {
    background:
        radial-gradient(circle 4px at 10px 10px, var(--brick-dark) 50%, transparent 51%),
        radial-gradient(circle 4px at calc(100% - 10px) 10px, var(--brick-dark) 50%, transparent 51%),
        radial-gradient(circle 4px at 10px calc(100% - 10px), var(--brick-dark) 50%, transparent 51%),
        radial-gradient(circle 4px at calc(100% - 10px) calc(100% - 10px), var(--brick-dark) 50%, transparent 51%);
}

.qblock-secret .qblock-q {
    display: none;
}

/* Secret block hit — golden flash */
.qblock-secret.hit .qblock-face {
    animation: secretFlash 0.6s ease-out;
}

@keyframes secretFlash {
    0% { box-shadow: inset 0 0 0 0 rgba(248, 184, 0, 0.8), 6px 6px 0 rgba(0,0,0,0.4); }
    30% { box-shadow: inset 0 0 40px 10px rgba(248, 184, 0, 0.6), 6px 6px 0 rgba(0,0,0,0.4); }
    100% { box-shadow: inset 4px 4px 0 rgba(255,255,255,0.1), inset -4px -4px 0 rgba(0,0,0,0.3), 6px 6px 0 rgba(0,0,0,0.4); }
}

/* ---- Bounce Animation ---- */
.qblock.bounce {
    animation: qBlockBounce 0.35s cubic-bezier(0.22, 1, 0.36, 1);
}

@keyframes qBlockBounce {
    0% { transform: translateY(0); }
    30% { transform: translateY(-24px); }
    50% { transform: translateY(-24px); }
    100% { transform: translateY(0); }
}

/* ---- Coin Fly-out ---- */
.qblock-coin-fx {
    position: absolute;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    pointer-events: none;
    opacity: 0;
    z-index: 10;
}

.qblock-coin-fx .qblock-coin-img {
    width: clamp(28px, 4vw, 40px);
    image-rendering: pixelated;
}

.qblock.hit .qblock-coin-fx {
    animation: coinFlyOut 0.7s cubic-bezier(0.22, 1, 0.36, 1) forwards;
}

@keyframes coinFlyOut {
    0% {
        opacity: 1;
        transform: translateX(-50%) translateY(0) rotate(0deg);
    }
    40% {
        opacity: 1;
        transform: translateX(-50%) translateY(-80px) rotate(180deg);
    }
    70% {
        opacity: 1;
        transform: translateX(-50%) translateY(-60px) rotate(360deg);
    }
    100% {
        opacity: 0;
        transform: translateX(-50%) translateY(-90px) rotate(360deg);
    }
}

/* ---- Achievement Label ---- */
.qblock-label {
    font-size: clamp(7px, 1.1vw, 10px);
    color: var(--text-white);
    text-align: center;
    line-height: 2;
    max-width: 200px;
    opacity: 0;
    transform: translateY(8px);
    transition: opacity 0.4s ease, transform 0.4s ease;
    min-height: 3.2em;
}

.qblock-wrap.unlocked .qblock-label {
    opacity: 1;
    transform: translateY(0);
}

/* ---- Stagger reveal delays ---- */
.qblock-wrap:nth-child(1) { transition-delay: 0s; }
.qblock-wrap:nth-child(2) { transition-delay: 0.07s; }
.qblock-wrap:nth-child(3) { transition-delay: 0.14s; }
.qblock-wrap:nth-child(4) { transition-delay: 0.21s; }
.qblock-wrap:nth-child(5) { transition-delay: 0.28s; }
.qblock-wrap:nth-child(6) { transition-delay: 0.35s; }
.qblock-wrap:nth-child(7) { transition-delay: 0.42s; }
.qblock-wrap:nth-child(8) { transition-delay: 0.49s; }

/* ============================================
   PIPE + PIRANHA DECORATIONS
   ============================================ */
.pipe-deco {
    position: relative;
    display: inline-block;
}

.pipe-deco .pipe-img {
    width: 64px;
    height: auto;
    image-rendering: pixelated;
    position: relative;
    z-index: 3;
}

/* Standing pipes (game-over): flip so wide lip is at top */
.game-over-pipes .pipe-img {
    transform: scaleY(-1);
}

/* Hanging pipes (transitions): piranha flipped 180deg, comes out from bottom */
.pipe-deco .piranha-img {
    width: 32px;
    position: absolute;
    bottom: -8px;
    left: 50%;
    transform: translateX(-50%) rotate(180deg) translateY(20px);
    image-rendering: pixelated;
    z-index: 1;
    animation: piranhaHang 8s ease-in-out infinite;
}

@keyframes piranhaHang {
    0%, 18%, 100% {
        transform: translateX(-50%) rotate(180deg) translateY(20px);
    }
    25%, 35% {
        transform: translateX(-50%) rotate(180deg) translateY(-35px);
    }
    42%, 100% {
        transform: translateX(-50%) rotate(180deg) translateY(20px);
    }
}

/* Standing pipes (game-over): piranha right-side up, comes out from top */
.game-over-pipes .piranha-img {
    top: -8px;
    bottom: auto;
    transform: translateX(-50%) translateY(20px);
    animation: piranhaStand 8s ease-in-out infinite;
}

@keyframes piranhaStand {
    0%, 18%, 100% {
        transform: translateX(-50%) translateY(20px);
    }
    25%, 35% {
        transform: translateX(-50%) translateY(-35px);
    }
    42%, 100% {
        transform: translateX(-50%) translateY(20px);
    }
}

/* ============================================
   DECORATIVE MARIO COINS (non-collectible)
   ============================================ */
.deco-coins-row {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: clamp(24px, 5vw, 48px);
    padding: 8px 0;
}

.deco-coin {
    width: clamp(28px, 4vw, 40px);
    height: auto;
    image-rendering: pixelated;
    animation: decoCoinBob 1.5s ease-in-out infinite;
}

.deco-coin:nth-child(2) {
    animation-delay: -0.25s;
}

.deco-coin:nth-child(3) {
    animation-delay: -0.5s;
}

.deco-coin:nth-child(4) {
    animation-delay: -0.75s;
}

.deco-coin:nth-child(5) {
    animation-delay: -1.0s;
}

.deco-coin:nth-child(6) {
    animation-delay: -0.15s;
}

.deco-coin:nth-child(7) {
    animation-delay: -0.4s;
}

.deco-coin:nth-child(8) {
    animation-delay: -0.65s;
}

.deco-coin:nth-child(9) {
    animation-delay: -0.9s;
}

.deco-coin:nth-child(10) {
    animation-delay: -1.15s;
}

.deco-coin:nth-child(11) {
    animation-delay: -0.35s;
}

.deco-coin:nth-child(12) {
    animation-delay: -0.6s;
}

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

/* ============================================
   FILES SECTION
   ============================================ */
.files-section {
    background-color: var(--sky);
    padding: 80px 24px 20px;
    min-height: 100dvh;
    position: relative;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
}

.files-section::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: -5%;
    right: -5%;
    height: 30%;
    z-index: 0;
    pointer-events: none;
    background: radial-gradient(ellipse 60% 80px at 15% 0%, #8bd860 0%, transparent 100%),
    radial-gradient(ellipse 50% 100px at 45% 0%, #7ec850 0%, transparent 100%),
    radial-gradient(ellipse 70% 90px at 75% 0%, #8bd860 0%, transparent 100%),
    radial-gradient(ellipse 40% 70px at 95% 0%, #7ec850 0%, transparent 100%),
    linear-gradient(180deg, transparent 0%, #5ba832 20%, #4a9228 100%);
}

.files-inner {
    height: 100%;
    text-align: center;
    position: relative;
    z-index: 2;
}

.files-grid {
    display: flex;
    justify-content: center;
    gap: clamp(24px, 5vw, 64px);
    flex-wrap: wrap;
    margin-bottom: 40px;
}

.folder {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    cursor: pointer;
    transition: transform 0.2s;
    padding: 16px;
}

.folder:hover {
    transform: translateY(-8px);
}

.folder-icon {
    width: 120px;
    height: 105px;
    background: var(--coin-gold);
    position: relative;
    border-radius: 0 4px 4px 4px;
    box-shadow: inset -4px -4px 0 rgba(0, 0, 0, 0.2),
    inset 4px 4px 0 rgba(255, 255, 255, 0.3),
    4px 4px 0 rgba(0, 0, 0, 0.2);
}

.folder-icon::before {
    content: '';
    position: absolute;
    top: -18px;
    left: 0;
    width: 50px;
    height: 18px;
    background: var(--coin-gold);
    border-radius: 4px 4px 0 0;
    box-shadow: inset 4px 4px 0 rgba(255, 255, 255, 0.3);
}

#systemFolder {
    opacity: 0.4;
}

.folder-icon.system {
    background: #4080f8;
}

.folder-icon.system::before {
    background: #4080f8;
}

.folder-label {
    font-size: clamp(9px, 1.4vw, 13px);
    color: var(--text-white);
    text-shadow: 2px 2px 0 rgba(0, 0, 0, 0.3);
    text-align: center;
    max-width: 160px;
    line-height: 1.6;
}

/* Ground row (generic + files section) */
.ground-row {
    width: calc(100% + 48px);
    margin-left: -24px;
    margin-bottom: 0;
    height: 64px;
    background: url('../images/ground.svg') repeat-x bottom;
    background-size: auto 64px;
    image-rendering: pixelated;
    position: relative;
    z-index: 2;
}

/* Section dividers */
.section-divider {
    background: #000;
}

.section-divider--centered {
    text-align: center;
    padding: 32px 0 0;
}

.coins-divider {
    padding: 60px 0 0;
}

.coins-divider--small {
    padding: 24px 0 0;
}

.coins-divider--tight {
    padding: 16px 0 0;
}

/* ============================================
   CLIENTS SECTION — NES GAME SELECT STYLE
   ============================================ */
.clients-section {
    padding: 20px 24px 100px;
    position: relative;
    overflow: hidden;
    background: url('../images/dendy_bg.webp') center center / cover no-repeat;
    background-color: #1a0a2e;
}

/* Pixel-art seagulls */
.seagull {
    position: absolute;
    width: 20px;
    height: 8px;
    top: 15%;
    z-index: 0;
    animation: seagullFly 12s linear infinite;
    image-rendering: pixelated;
}

.seagull::before,
.seagull::after {
    content: '';
    position: absolute;
    background: #1a0a2e;
    width: 8px;
    height: 2px;
    top: 0;
}

.seagull::before {
    left: 0;
    transform-origin: right center;
    animation: seagullWingLeft 0.6s steps(2) infinite;
}

.seagull::after {
    right: 0;
    transform-origin: left center;
    animation: seagullWingRight 0.6s steps(2) infinite;
}

.seagull--2 { top: 10%; animation-duration: 15s; animation-delay: -3s; }
.seagull--2::before, .seagull--2::after { width: 6px; }
.seagull--3 { top: 20%; animation-duration: 10s; animation-delay: -7s; }
.seagull--4 { top: 8%; animation-duration: 18s; animation-delay: -5s; }
.seagull--4::before, .seagull--4::after { width: 5px; }
.seagull--5 { top: 25%; animation-duration: 14s; animation-delay: -10s; }

@keyframes seagullFly {
    from { left: -30px; }
    to { left: calc(100% + 30px); }
}

@keyframes seagullWingLeft {
    0%, 100% { transform: rotate(-25deg); }
    50% { transform: rotate(15deg); }
}

@keyframes seagullWingRight {
    0%, 100% { transform: rotate(25deg); }
    50% { transform: rotate(-15deg); }
}

.clients-inner {
    max-width: 700px;
}

.clients-title {
    font-size: clamp(18px, 3.5vw, 32px);
    color: var(--text-white);
    text-align: center;
    margin-top: 40px;
    margin-bottom: 48px;
    text-shadow: 3px 3px 0 rgba(248, 184, 0, 0.3);
}

.clients-list {
    border: 4px solid #4040a0;
    background: rgba(10, 10, 42, 0.85);
    padding: clamp(16px, 3vw, 32px);
    max-height: 560px;
    overflow-y: auto;
    box-shadow: 0 0 0 4px #000, 0 0 60px rgba(64, 64, 160, 0.15);
    backdrop-filter: blur(2px);
}

/* Custom scrollbar */
.clients-list::-webkit-scrollbar {
    width: 12px;
}

.clients-list::-webkit-scrollbar-track {
    background: #0a0a2a;
}

.clients-list::-webkit-scrollbar-thumb {
    background: #4040a0;
    border: 2px solid #0a0a2a;
}

.client-row {
    display: flex;
    align-items: baseline;
    gap: 16px;
    padding: 6px 8px;
    font-size: clamp(8px, 1.3vw, 12px);
    line-height: 2;
    transition: background 0.15s, color 0.15s;
    cursor: default;
    color: #b0b0d0;
}

.client-row:hover {
    background: rgba(64, 64, 160, 0.2);
    color: var(--coin-gold);
}

.client-num {
    color: #5050a0;
    font-size: clamp(7px, 1vw, 10px);
    flex-shrink: 0;
    min-width: 40px;
}

.client-row:hover .client-num {
    color: var(--coin-dark);
}

.client-name {
    white-space: nowrap;
}

/* Selector arrow */
.client-row::before {
    content: '';
    width: 0;
    height: 0;
    border-top: 5px solid transparent;
    border-bottom: 5px solid transparent;
    border-left: 8px solid transparent;
    transition: border-color 0.15s;
    flex-shrink: 0;
}

.client-row:hover::before {
    border-left-color: var(--coin-gold);
}

/* ============================================
   CONTACT SECTION
   ============================================ */
.contact-section {
    background: linear-gradient(180deg, #0c0c1e 0%, #080818 100%);
    padding: 80px 24px;
    position: relative;
}

.contact-inner {
    max-width: 640px;
    text-align: center;
}

.contact-title {
    font-size: clamp(18px, 3.5vw, 28px);
    color: var(--text-white);
    margin-bottom: 32px;
    text-shadow: 3px 3px 0 rgba(0, 0, 0, 0.8);
}

.contact-info {
    margin-bottom: 32px;
}

.contact-line {
    font-size: clamp(9px, 1.4vw, 13px);
    color: rgba(252, 252, 252, 0.8);
    line-height: 2.2;
    margin-bottom: 4px;
}

.contact-line a {
    color: var(--coin-gold);
    transition: color 0.2s;
}

.contact-line a:hover {
    color: var(--coin-light);
}

.contact-form-inline {
    max-width: 400px;
    margin: 0 auto 40px;
}

.pixel-input {
    width: 100%;
    font-family: var(--font);
    font-size: 10px;
    padding: 14px 16px;
    background: #0a0a1a;
    border: 4px solid #2a2a50;
    color: var(--text-white);
    margin-bottom: 12px;
    outline: none;
    transition: border-color 0.2s;
}

.pixel-input:focus {
    border-color: var(--coin-gold);
}

.pixel-input::placeholder {
    color: rgba(252, 252, 252, 0.25);
}

.pixel-checkbox {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    margin-bottom: 20px;
    text-align: left;
    cursor: pointer;
}

.pixel-checkbox input[type="checkbox"] {
    width: 18px;
    height: 18px;
    appearance: none;
    background: #1a1a3a;
    border: 3px solid #4040a0;
    cursor: pointer;
    flex-shrink: 0;
    position: relative;
    margin-top: 1px;
}

.pixel-checkbox input[type="checkbox"]:checked {
    background: var(--pipe-green);
    border-color: var(--pipe-dark);
}

.pixel-checkbox input[type="checkbox"]:checked::after {
    content: '';
    position: absolute;
    inset: 2px;
    background: var(--pipe-light);
    clip-path: polygon(20% 50%, 40% 70%, 80% 25%, 85% 30%, 40% 80%, 15% 55%);
}

.pixel-checkbox span {
    font-size: 7px;
    color: rgba(252, 252, 252, 0.5);
    line-height: 1.8;
}

.pixel-checkbox a {
    color: var(--coin-gold);
    text-decoration: underline;
}

.pixel-btn {
    font-family: var(--font);
    font-size: clamp(10px, 1.5vw, 14px);
    padding: 16px 40px;
    background: var(--fire-red);
    color: var(--text-white);
    border: 4px solid #c02800;
    cursor: pointer;
    text-transform: uppercase;
    letter-spacing: 2px;
    transition: all 0.15s;
    box-shadow: inset -4px -4px 0 rgba(0, 0, 0, 0.3),
    inset 4px 4px 0 rgba(255, 255, 255, 0.2),
    4px 4px 0 rgba(0, 0, 0, 0.5);
}

.pixel-btn:hover {
    background: #ff5020;
    transform: translateY(-2px);
}

.pixel-btn:active {
    transform: translateY(2px);
    box-shadow: inset -4px -4px 0 rgba(0, 0, 0, 0.3),
    inset 4px 4px 0 rgba(255, 255, 255, 0.2),
    2px 2px 0 rgba(0, 0, 0, 0.5);
}

/* Requisites */
.requisites {
    margin-top: 48px;
    text-align: center;
}

.requisites-title {
    font-size: clamp(12px, 2vw, 18px);
    color: var(--text-white);
    margin-bottom: 24px;
}

.requisites-block {
    background: rgba(255, 255, 255, 0.03);
    border: 3px solid rgba(255, 255, 255, 0.08);
    padding: clamp(16px, 3vw, 28px);
    text-align: left;
    max-width: 540px;
    margin: 0 auto;
    position: relative;
}

.req-copy-btn {
    display: block;
    width: 100%;
    background: rgba(255, 255, 255, 0.06);
    border: 2px solid rgba(255, 255, 255, 0.15);
    color: rgba(252, 252, 252, 0.5);
    font-family: var(--font);
    font-size: 7px;
    padding: 8px 12px;
    cursor: pointer;
    transition: all 0.2s;
    text-align: center;
    margin-bottom: 16px;
}

.req-copy-btn:hover {
    border-color: var(--coin-gold);
    color: var(--coin-gold);
    background: rgba(248, 184, 0, 0.08);
}

.req-copy-btn.copied {
    border-color: var(--pipe-green);
    color: var(--pipe-light);
    background: rgba(0, 168, 0, 0.1);
}

.requisites-block p {
    font-size: clamp(6px, 1vw, 9px);
    line-height: 2.4;
    color: rgba(252, 252, 252, 0.45);
    word-break: break-word;
}

.requisites-block .req-name {
    color: rgba(252, 252, 252, 0.7);
    font-size: clamp(7px, 1.1vw, 10px);
    margin-bottom: 12px;
}

/* ============================================
   GAME OVER SECTION
   ============================================ */
.game-over {
    position: relative;
    padding: 80px 24px 0;
    text-align: center;
    overflow: hidden;
    min-height: 600px;
}

.game-over-title {
    font-size: clamp(28px, 7vw, 64px);
    color: var(--coin-gold);
    text-shadow: 4px 4px 0 #000,
    0 0 20px rgba(248, 184, 0, 0.35),
    0 0 60px rgba(248, 184, 0, 0.12);
    margin-bottom: 48px;
    letter-spacing: 6px;
    position: relative;
    z-index: 5;
    animation: gameOverPulse 3s ease-in-out infinite;
}

@keyframes gameOverPulse {
    0%, 100% {
        text-shadow: 4px 4px 0 #000, 0 0 20px rgba(248, 184, 0, 0.35), 0 0 60px rgba(248, 184, 0, 0.12);
    }
    50% {
        text-shadow: 4px 4px 0 #000, 0 0 30px rgba(248, 184, 0, 0.5), 0 0 80px rgba(248, 184, 0, 0.2);
    }
}

.game-over-character {
    position: relative;
    display: inline-block;
    z-index: 6;
    margin-bottom: -4px;
    vertical-align: bottom;
}

.game-over-character img {
    width: clamp(90px, 15vw, 120px);
    height: auto;
    image-rendering: pixelated;
}

.speech-bubble {
    display: inline-block;
    background: var(--text-white);
    color: #000;
    font-size: clamp(7px, 1.1vw, 10px);
    padding: 14px 18px;
    line-height: 2;
    max-width: 320px;
    text-align: left;
    border: 3px solid #000;
    box-shadow: 4px 4px 0 rgba(0, 0, 0, 0.3);
    margin-bottom: 16px;
    position: relative;
    z-index: 5;
}

.speech-bubble::after {
    content: '';
    position: absolute;
    bottom: -10px;
    left: 50%;
    transform: translateX(-50%);
    width: 0;
    height: 0;
    border-left: 10px solid transparent;
    border-right: 10px solid transparent;
    border-top: 10px solid var(--text-white);
}

.speech-bubble::before {
    content: '';
    position: absolute;
    bottom: -14px;
    left: 50%;
    transform: translateX(-50%);
    width: 0;
    height: 0;
    border-left: 12px solid transparent;
    border-right: 12px solid transparent;
    border-top: 12px solid #000;
}

.game-over-restart {
    display: inline-block;
    font-size: clamp(10px, 1.5vw, 14px);
    color: var(--coin-gold);
    margin: 16px 0 32px;
    animation: blink 1.5s step-start infinite;
    cursor: pointer;
}

.game-over-restart:hover {
    animation: none;
    color: var(--text-white);
}

.game-over-bottom {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-end;
    padding: 0 3%;
    margin-top: 60px;
}

.game-over-ground-bar {
    width: calc(100% + 48px);
    margin-left: -24px;
    height: 64px;
    background: url('../images/ground.svg') repeat-x bottom;
    background-size: auto 64px;
    image-rendering: pixelated;
}

.game-over-pipes {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    padding: 0 5%;
    z-index: 3;
    pointer-events: none;
}

/* ============================================
   FOOTER
   ============================================ */
.footer {
    background: var(--hud-bg);
    padding: 24px;
    text-align: center;
    border-top: 4px solid #303030;
}

.footer p {
    font-size: 8px;
    color: rgba(252, 252, 252, 0.3);
    line-height: 2;
}

.footer a {
    color: var(--coin-gold);
}

/* Credits */
.credits-link-wrap {
    text-align: center;
    padding: 12px 0 24px;
}

.credits-link {
    color: var(--coin-gold);
    font-size: 10px;
    text-decoration: none;
}

/* ============================================
   COLLECTIBLE COINS (World transitions)
   ============================================ */
.deco-coin.collectible {
    width: clamp(36px, 5vw, 52px);
    cursor: pointer;
    filter: drop-shadow(0 0 8px rgba(248, 184, 0, 0.5));
    transition: transform 0.3s, opacity 0.3s;
}

.deco-coin.collectible:hover {
    transform: translateY(-8px) scale(1.15);
    filter: drop-shadow(0 0 14px rgba(248, 184, 0, 0.8));
}

.deco-coin.collectible.collected {
    transform: scale(2) translateY(-20px);
    opacity: 0;
    pointer-events: none;
}

.coin-collect-fx {
    position: fixed;
    font-family: var(--font);
    font-size: 18px;
    color: var(--coin-gold);
    text-shadow: 2px 2px 0 #000;
    pointer-events: none;
    z-index: 250;
    animation: coinCollectAnim 1s ease-out forwards;
}

@keyframes coinCollectAnim {
    0% {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
    50% {
        opacity: 1;
        transform: translateY(-40px) scale(1.3);
    }
    100% {
        opacity: 0;
        transform: translateY(-80px) scale(0.8);
    }
}

@keyframes coinFloat {
    0%, 100% {
        transform: translateY(0);
    }
    50% {
        transform: translateY(-12px);
    }
}

/* ============================================
   MODALS
   ============================================ */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.85);
    z-index: 200;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 24px;
    opacity: 0;
    transition: opacity 0.3s;
}

.modal-overlay.active {
    display: flex;
    opacity: 1;
}

.modal-box {
    background: #1a1a2e;
    border: 6px solid var(--text-white);
    box-shadow: 0 0 0 6px #000, inset 0 0 0 3px rgba(255, 255, 255, 0.1);
    max-width: 90vw;
    max-height: 90vh;
    overflow-y: auto;
    position: relative;
    animation: modalEnter 0.3s ease-out;
}

@keyframes modalEnter {
    from {
        transform: scale(0.9) translateY(20px);
        opacity: 0;
    }
    to {
        transform: scale(1) translateY(0);
        opacity: 1;
    }
}

.modal-close {
    position: absolute;
    top: 8px;
    right: 8px;
    width: 32px;
    height: 32px;
    background: var(--fire-red);
    color: var(--text-white);
    font-size: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 10;
    border: 2px solid #c02800;
    transition: background 0.2s;
}

.modal-close:hover {
    background: #ff5020;
}

.modal-content {
    padding: clamp(16px, 3vw, 32px);
}

.modal-title {
    font-size: clamp(10px, 2vw, 16px);
    color: var(--coin-gold);
    margin-bottom: 20px;
    line-height: 1.8;
    padding-right: 40px;
}

.modal-box--video {
    width: 90vw;
    max-width: 860px;
}

.modal-box--gallery {
    width: 90vw;
    max-width: 1000px;
}

.modal-content--compact {
    padding: 8px;
}

/* Video */
.video-container {
    position: relative;
    width: 100%;
    max-width: 800px;
    aspect-ratio: 16/9;
}

.video-container iframe {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    border: none;
}

/* Gallery */
.gallery-modal .modal-box {
    width: 90vw;
    max-width: 1000px;
    background: #0a0a0a;
}

.gallery-viewport {
    position: relative;
    width: 100%;
    overflow: hidden;
}

.gallery-track {
    display: flex;
    transition: transform 0.4s ease;
}

.gallery-slide {
    min-width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 8px;
}

.gallery-slide img {
    max-height: 70vh;
    max-width: 100%;
    object-fit: contain;
    border: 4px solid #303030;
}

.gallery-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 48px;
    height: 48px;
    background: rgba(0, 0, 0, 0.7);
    color: var(--text-white);
    font-size: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 5;
    border: 3px solid rgba(255, 255, 255, 0.3);
    transition: all 0.2s;
}

.gallery-nav:hover {
    background: rgba(0, 0, 0, 0.9);
    border-color: var(--coin-gold);
}

.gallery-prev {
    left: 8px;
}

.gallery-next {
    right: 8px;
}

.gallery-counter {
    text-align: center;
    padding: 12px;
    font-size: 10px;
    color: rgba(252, 252, 252, 0.5);
}

/* Prize modal */
.prize-modal .modal-box {
    max-width: 480px;
    text-align: center;
}

.prize-star {
    font-size: 48px;
    margin-bottom: 16px;
    animation: coinFloat 2s ease-in-out infinite;
}

.prize-title {
    font-size: clamp(10px, 2vw, 16px);
    color: var(--coin-gold);
    line-height: 2;
    margin-bottom: 16px;
}

.prize-desc {
    font-size: clamp(8px, 1.2vw, 11px);
    color: rgba(252, 252, 252, 0.6);
    margin-bottom: 24px;
    line-height: 1.8;
}

.prize-email-input {
    max-width: 300px;
    margin: 0 auto 16px;
}

.prize-submit-btn {
    background: var(--coin-gold);
    border-color: var(--coin-dark);
    color: #000;
}

/* Quote (love) modal */
.quote-modal .modal-box {
    max-width: 700px;
    text-align: center;
    background: repeating-linear-gradient(
            0deg,
            #8c5010 0px, #8c5010 30px,
            #7c4408 30px, #7c4408 32px
    );
    border-color: var(--coin-gold);
}

.quote-modal .modal-box::before {
    content: '';
    position: absolute;
    inset: 0;
    background: repeating-linear-gradient(
            90deg,
            transparent 0px, transparent 30px,
            rgba(0, 0, 0, 0.1) 30px, rgba(0, 0, 0, 0.1) 32px
    );
    pointer-events: none;
}

.quote-modal .modal-content {
    position: relative;
    z-index: 1;
    padding: 48px 32px;
}

.quote-text {
    font-size: clamp(12px, 2.5vw, 20px);
    line-height: 2.2;
    color: var(--text-white);
    text-shadow: 3px 3px 0 rgba(0, 0, 0, 0.5);
    margin-bottom: 24px;
}

.quote-author {
    font-size: clamp(9px, 1.3vw, 13px);
    color: var(--coin-light);
}

/* Blue screen */
.bluescreen-overlay {
    position: fixed;
    inset: 0;
    background: #0000aa;
    z-index: 300;
    display: none;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 40px;
    text-align: center;
    cursor: pointer;
}

.bluescreen-overlay.active {
    display: flex;
}

.bsod-title {
    background: #a0a0a0;
    color: #0000aa;
    padding: 4px 16px;
    font-size: clamp(12px, 2vw, 18px);
    margin-bottom: 32px;
}

.bsod-text {
    font-size: clamp(9px, 1.5vw, 14px);
    line-height: 2.2;
    max-width: 600px;
    margin-bottom: 32px;
}

.bsod-hint {
    font-size: 9px;
    color: rgba(252, 252, 252, 0.5);
    animation: blink 1.5s step-start infinite;
}

/* Form error */
.form-error {
    display: none;
    text-align: center;
    padding: 12px;
    margin-top: 12px;
    color: var(--fire-red);
    font-size: 10px;
    line-height: 2;
}

.form-error.active {
    display: block;
}

/* Form success */
.form-success {
    display: none;
    text-align: center;
    padding: 20px;
}

.form-success.active {
    display: block;
}

.form-success-icon {
    font-size: 48px;
    margin-bottom: 16px;
    animation: coinFloat 2s ease-in-out infinite;
}

.form-success-text {
    font-size: 12px;
    color: var(--pipe-light);
    line-height: 2;
}

/* ============================================
   RESPONSIVE
   ============================================ */
@media (max-width: 768px) {
    .game-over-ground-bar {
        height: 48px;
        background-size: auto 48px;
    }

    .game-over-character img {
        width: clamp(80px, 20vw, 120px);
    }

    .deco-coin {
        width: clamp(20px, 4vw, 32px);
    }

    .hud {
        padding: 10px 12px;
        font-size: 8px;
        grid-template-columns: 1fr 1fr;
    }

    .hud-left {
        gap: 12px;
    }


    .hud-right {
        justify-self: end;
    }

    .hud-coin-icon {
        width: 16px;
    }

    .hero-content {
        flex-direction: column;
        padding: 30px 16px 20px;
        text-align: center;
    }

    .hero-left {
        align-items: center;
        text-align: center;
        max-width: none;
        order: 2;
    }

    .hero-right {
        width: 100%;
        order: 1;
    }

    .hero-left .sf-stats {
        margin: 0 auto 24px;
    }

    .tv-frame {
        max-width: 450px;
        margin: 0 auto;
    }

    .sf-stats {
        width: 90%;
        max-width: 300px;
    }

    .sf-stat-label {
        font-size: 6px;
    }

    .sf-stat-track {
        height: 12px;
    }

    .about {
        padding: 60px 16px 0;
    }

    .rpg-dialogue-box {
        min-height: 150px;
    }

    .about-character-wrap {
        gap: 6px;
    }

    .deco-coins-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: clamp(8px, 3vw, 16px);
    }

    .achievements {
        padding: 60px 16px;
    }

    .achievements-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 28px 16px;
    }

    .qblock-wrap.unlocked .qblock-label {
        font-size: 9px;
    }

    .files-section {
        padding: 60px 16px 20px;
    }

    .files-grid {
        flex-direction: column;
        align-items: center;
    }

    .ground-row {
        height: 48px;
        background-size: auto 48px;
        width: calc(100% + 32px);
        margin-left: -16px;
    }

    .clients-section {
        padding: 16px 16px 60px 16px;
    }

    .clients-list {
        max-height: 400px;
    }

    .pipe-deco img.pipe-img {
        width: 48px;
    }

    .pipe-deco img.piranha-img {
        width: 24px;
    }

    .game-over-pipes .piranha-img {
        animation: piranhaStandMobile 8s ease-in-out infinite;
    }

    @keyframes piranhaStandMobile {
        0%, 18%, 100% {
            transform: translateX(-50%) translateY(20px);
        }
        25%, 35% {
            transform: translateX(-50%) translateY(-10px);
        }
        42%, 100% {
            transform: translateX(-50%) translateY(20px);
        }
    }
}

@media (max-width: 480px) {
    .hud {
        font-size: 7px;
        padding: 8px;
    }

    .hero-title {
        line-height: 2;
    }

    .folder-icon {
        width: 90px;
        height: 78px;
    }

    .folder-icon::before {
        width: 38px;
        height: 14px;
        top: -14px;
    }

    .client-row {
        gap: 8px;
    }

    .client-num {
        min-width: 30px;
    }

    .achievements-grid {
        gap: 20px 12px;
    }

    .qblock {
        width: 68px;
        height: 68px;
    }

    .qblock-label {
        font-size: 7px;
    }
}
