/* ============================================
   chrono.games - Styles
   Time-warped arcade portal
   ============================================ */

/* --- CSS Custom Properties --- */
:root {
    --midnight-arcade: #1a1032;
    --cabinet-black: #0d0a1a;
    --neon-magenta: #ff2d95;
    --temporal-cyan: #00e5ff;
    --coin-gold: #ffd700;
    --phosphor-white: #e8e6e1;
    --fog-gray: #8a8b99;
    --paradox-red: #ff3333;
    --warp-green: #39ff14;
    --vapor-violet: #7b2ff7;
    --sunset-peach: #ff6b6b;

    --gradient-primary: linear-gradient(135deg, #7b2ff7, #ff2d95, #ff6b6b);

    --font-display: 'Bungee', cursive;
    --font-mono: 'Share Tech Mono', monospace;
    --font-body: 'Nunito', sans-serif;
    --font-pixel: 'Silkscreen', cursive;

    --spring-ease: cubic-bezier(0.34, 1.56, 0.64, 1);

    --hex-size: 280px;
}

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

html {
    scroll-behavior: smooth;
    overflow-x: hidden;
}

body {
    background-color: var(--cabinet-black);
    color: var(--phosphor-white);
    font-family: var(--font-body);
    font-size: 16px;
    line-height: 1.65;
    overflow-x: hidden;
    min-height: 100vh;
}

body.time-frozen * {
    animation-play-state: paused !important;
}

body.time-reversed * {
    animation-direction: reverse !important;
}

/* --- CRT Scanline Overlay --- */
#scanline-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 9999;
    background: repeating-linear-gradient(
        to bottom,
        transparent 0px,
        transparent 2px,
        rgba(0, 0, 0, 0.04) 2px,
        rgba(0, 0, 0, 0.04) 3px
    );
    animation: scanline-scroll 8s linear infinite;
}

@keyframes scanline-scroll {
    from { background-position-y: 0; }
    to { background-position-y: 60px; }
}

/* --- Boot Screen --- */
#boot-screen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: #000;
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: opacity 0.8s ease;
}

#boot-screen.cracking {
    animation: crack-open 1s ease-in-out forwards;
}

#boot-screen.hidden {
    opacity: 0;
    pointer-events: none;
    display: none;
}

@keyframes crack-open {
    0% {
        clip-path: circle(100% at 50% 50%);
        opacity: 1;
    }
    100% {
        clip-path: circle(0% at 50% 50%);
        opacity: 0;
    }
}

#boot-text {
    font-family: var(--font-mono);
    color: var(--warp-green);
    font-size: 18px;
    text-align: center;
    text-shadow: 0 0 8px var(--warp-green);
    white-space: pre-wrap;
    max-width: 600px;
    line-height: 1.8;
}

#boot-cursor {
    animation: blink-cursor 530ms step-end infinite;
}

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

/* --- Viewport Sections --- */
.viewport-section {
    min-height: 100vh;
    padding: 60px 40px;
    position: relative;
    overflow: hidden;
}

/* --- Section 1: Boot Sequence / Timeline Strip --- */
#boot-sequence {
    background: var(--midnight-arcade);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 40px;
    position: relative;
}

#timeline-strip {
    width: 100%;
    max-width: 1200px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: relative;
    padding: 30px 0;
    opacity: 0;
    transform: translateX(-100px);
    transition: opacity 0.6s var(--spring-ease), transform 0.6s var(--spring-ease);
}

#timeline-strip.visible {
    opacity: 1;
    transform: translateX(0);
}

#timeline-strip::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 0;
    right: 0;
    height: 2px;
    background: var(--gradient-primary);
    transform: translateY(-50%);
}

#playhead {
    position: absolute;
    top: 0;
    left: 0;
    width: 2px;
    height: 100%;
    background: var(--neon-magenta);
    box-shadow: 0 0 10px var(--neon-magenta), 0 0 20px var(--neon-magenta);
    transition: left 0.1s linear;
    z-index: 2;
}

.era-marker {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    position: relative;
    z-index: 1;
    cursor: pointer;
    transition: transform 0.28s var(--spring-ease);
}

.era-marker:hover {
    transform: scale(1.1);
}

.era-marker::before {
    content: '';
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: var(--temporal-cyan);
    box-shadow: 0 0 12px var(--temporal-cyan);
    transition: background 0.3s, box-shadow 0.3s;
}

.era-marker:hover::before {
    background: var(--neon-magenta);
    box-shadow: 0 0 20px var(--neon-magenta);
}

.era-year {
    font-family: var(--font-display);
    font-size: clamp(1.2rem, 3vw, 2rem);
    color: var(--phosphor-white);
    text-shadow: 2px 2px 0 var(--neon-magenta), -2px -2px 0 var(--temporal-cyan);
    letter-spacing: 0.1em;
}

.era-label {
    font-family: var(--font-mono);
    font-size: 12px;
    color: var(--fog-gray);
    letter-spacing: 0.15em;
    text-transform: uppercase;
}

#hero-title {
    font-family: var(--font-display);
    font-size: clamp(2rem, 8vw, 6rem);
    letter-spacing: 0.15em;
    text-transform: uppercase;
    color: var(--phosphor-white);
    text-shadow:
        2px 2px 0 #ff00ff,
        4px 4px 0 #00ffff,
        0 0 40px rgba(255, 45, 149, 0.4);
    text-align: center;
    opacity: 0;
    transform: scale(0);
    transition: opacity 0.6s var(--spring-ease), transform 0.6s var(--spring-ease);
}

#hero-title.visible {
    opacity: 1;
    transform: scale(1);
}

.title-dot {
    color: var(--neon-magenta);
    text-shadow: 0 0 20px var(--neon-magenta);
}

#hero-subtitle {
    font-family: var(--font-mono);
    font-size: clamp(0.9rem, 2vw, 1.2rem);
    color: var(--coin-gold);
    text-shadow: 0 0 8px var(--coin-gold);
    letter-spacing: 0.2em;
    text-align: center;
    opacity: 0;
    transition: opacity 0.6s 0.3s;
}

#hero-subtitle.visible {
    opacity: 1;
}

/* --- Section Countdown --- */
.section-countdown {
    position: absolute;
    top: 20px;
    right: 40px;
    z-index: 10;
}

.countdown-digit {
    font-family: var(--font-mono);
    font-size: 48px;
    color: var(--paradox-red);
    text-shadow: 0 0 15px var(--paradox-red);
    display: inline-block;
    background: var(--cabinet-black);
    padding: 8px 16px;
    border: 2px solid var(--paradox-red);
    min-width: 70px;
    text-align: center;
}

.countdown-digit.done {
    color: var(--warp-green);
    text-shadow: 0 0 15px var(--warp-green);
    border-color: var(--warp-green);
}

/* --- Section Titles --- */
.section-title {
    font-family: var(--font-display);
    font-size: clamp(1.5rem, 4vw, 3rem);
    letter-spacing: 0.15em;
    text-transform: uppercase;
    color: var(--phosphor-white);
    text-shadow: 2px 2px 0 #ff00ff, 4px 4px 0 #00ffff;
    text-align: center;
    margin-bottom: 50px;
}

/* --- Section 2-4: Arcade Floor (Hex Grid) --- */
#arcade-floor {
    background: var(--midnight-arcade);
    padding-top: 80px;
}

#hex-grid {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 16px;
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
    animation: hex-grid-breathe 4s ease-in-out infinite;
}

@keyframes hex-grid-breathe {
    0%, 100% { gap: 16px; }
    50% { gap: 22px; }
}

.hex-cell {
    width: var(--hex-size);
    height: calc(var(--hex-size) * 1.1547);
    clip-path: polygon(50% 0%, 100% 25%, 100% 75%, 50% 100%, 0% 75%, 0% 25%);
    background: var(--cabinet-black);
    position: relative;
    cursor: pointer;
    transition: transform 0.28s var(--spring-ease), box-shadow 0.28s var(--spring-ease);
    opacity: 0;
    transform: scale(0);
}

.hex-cell.revealed {
    opacity: 1;
    transform: scale(1);
}

.hex-cell::before {
    content: '';
    position: absolute;
    inset: 3px;
    clip-path: polygon(50% 0%, 100% 25%, 100% 75%, 50% 100%, 0% 75%, 0% 25%);
    background: linear-gradient(180deg, rgba(123, 47, 247, 0.15), var(--cabinet-black));
    z-index: 0;
}

.hex-cell:hover {
    transform: scale(1.08) translateY(-12px);
    filter: drop-shadow(0 0 20px rgba(255, 45, 149, 0.5));
    z-index: 10;
}

.hex-cell:nth-child(even) {
    margin-top: 50px;
}

.hex-inner {
    position: absolute;
    inset: 8px;
    clip-path: polygon(50% 0%, 100% 25%, 100% 75%, 50% 100%, 0% 75%, 0% 25%);
    background: linear-gradient(180deg, rgba(123, 47, 247, 0.2) 0%, var(--cabinet-black) 100%);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 40px 20px;
    text-align: center;
    overflow: hidden;
    transition: background 0.28s;
}

.hex-cell:hover .hex-inner {
    background: linear-gradient(180deg, rgba(255, 45, 149, 0.2) 0%, rgba(0, 229, 255, 0.1) 100%);
}

.hex-icon {
    width: 60px;
    height: 60px;
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.28s var(--spring-ease), opacity 0.28s;
}

.hex-cell:hover .hex-icon {
    transform: scale(0.7);
    opacity: 0.5;
}

.hex-content {
    opacity: 0;
    transform: translateY(10px);
    transition: opacity 0.28s var(--spring-ease), transform 0.28s var(--spring-ease);
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 50px 24px;
    text-align: center;
}

.hex-cell:hover .hex-content {
    opacity: 1;
    transform: translateY(0);
}

.hex-title {
    font-family: var(--font-display);
    font-size: 14px;
    letter-spacing: 0.1em;
    color: var(--neon-magenta);
    text-shadow: 0 0 8px var(--neon-magenta);
    margin-bottom: 6px;
}

.hex-desc {
    font-family: var(--font-body);
    font-size: 13px;
    color: var(--phosphor-white);
    line-height: 1.4;
    margin-bottom: 8px;
}

.hex-tag {
    font-family: var(--font-mono);
    font-size: 10px;
    color: var(--temporal-cyan);
    letter-spacing: 0.15em;
    text-transform: uppercase;
    padding: 4px 10px;
    border: 1px solid var(--temporal-cyan);
    display: inline-block;
}

/* --- Hex Cell Icons (CSS-only) --- */
.clock-mini {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: 3px solid var(--temporal-cyan);
    position: relative;
    box-shadow: 0 0 10px var(--temporal-cyan);
}

.clock-mini::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 2px;
    height: 14px;
    background: var(--phosphor-white);
    transform-origin: bottom center;
    transform: translate(-50%, -100%) rotate(0deg);
    animation: clock-mini-spin 4s linear infinite;
}

.clock-mini::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 2px;
    height: 10px;
    background: var(--neon-magenta);
    transform-origin: bottom center;
    transform: translate(-50%, -100%) rotate(90deg);
    animation: clock-mini-spin 12s linear infinite;
}

@keyframes clock-mini-spin {
    to { transform: translate(-50%, -100%) rotate(360deg); }
}

.loop-icon {
    width: 40px;
    height: 40px;
    border: 3px solid var(--neon-magenta);
    border-top-color: transparent;
    border-radius: 50%;
    animation: loop-spin 1.5s linear infinite;
    box-shadow: 0 0 10px var(--neon-magenta);
}

@keyframes loop-spin {
    to { transform: rotate(360deg); }
}

.fracture-icon {
    width: 40px;
    height: 40px;
    position: relative;
}

.fracture-icon::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 0;
    width: 100%;
    height: 3px;
    background: var(--vapor-violet);
    box-shadow: 0 0 10px var(--vapor-violet);
    transform: translateY(-50%);
}

.fracture-icon::after {
    content: '';
    position: absolute;
    top: 20%;
    left: 50%;
    width: 60%;
    height: 3px;
    background: var(--paradox-red);
    box-shadow: 0 0 10px var(--paradox-red);
    transform: rotate(30deg);
}

.rush-icon {
    width: 0;
    height: 0;
    border-left: 24px solid var(--warp-green);
    border-top: 16px solid transparent;
    border-bottom: 16px solid transparent;
    filter: drop-shadow(0 0 8px var(--warp-green));
    animation: rush-pulse 0.8s ease-in-out infinite alternate;
}

@keyframes rush-pulse {
    to { transform: translateX(5px); opacity: 0.6; }
}

.hunter-icon {
    width: 40px;
    height: 40px;
    border: 3px solid var(--coin-gold);
    transform: rotate(45deg);
    box-shadow: 0 0 10px var(--coin-gold);
    position: relative;
}

.hunter-icon::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 12px;
    height: 12px;
    background: var(--coin-gold);
    transform: translate(-50%, -50%);
    border-radius: 50%;
}

.eater-icon {
    width: 40px;
    height: 40px;
    background: conic-gradient(
        var(--cabinet-black) 0deg 40deg,
        var(--coin-gold) 40deg 320deg,
        var(--cabinet-black) 320deg
    );
    border-radius: 50%;
    box-shadow: 0 0 10px var(--coin-gold);
    animation: eater-chomp 0.6s ease-in-out infinite alternate;
}

@keyframes eater-chomp {
    from { clip-path: polygon(50% 50%, 100% 0%, 100% 100%, 0% 100%, 0% 0%); }
    to { clip-path: polygon(50% 50%, 100% 15%, 100% 100%, 0% 100%, 0% 15%); }
}

.deja-icon {
    width: 40px;
    height: 40px;
    position: relative;
}

.deja-icon::before,
.deja-icon::after {
    content: '';
    position: absolute;
    width: 28px;
    height: 28px;
    border: 3px solid var(--vapor-violet);
    border-radius: 50%;
}

.deja-icon::before {
    top: 0;
    left: 0;
    opacity: 0.5;
}

.deja-icon::after {
    bottom: 0;
    right: 0;
    border-color: var(--neon-magenta);
    box-shadow: 0 0 10px var(--neon-magenta);
}

.infinite-icon {
    width: 50px;
    height: 24px;
    position: relative;
}

.infinite-icon::before,
.infinite-icon::after {
    content: '';
    position: absolute;
    width: 24px;
    height: 24px;
    border: 3px solid var(--temporal-cyan);
    border-radius: 50%;
    box-shadow: 0 0 8px var(--temporal-cyan);
}

.infinite-icon::before { left: 0; }
.infinite-icon::after { right: 0; }

.sight-icon {
    width: 44px;
    height: 28px;
    border: 3px solid var(--warp-green);
    border-radius: 50%;
    position: relative;
    box-shadow: 0 0 10px var(--warp-green);
}

.sight-icon::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 12px;
    height: 12px;
    background: var(--warp-green);
    border-radius: 50%;
    transform: translate(-50%, -50%);
}

/* --- Section 5: Paradox Gallery --- */
#paradox-gallery {
    background: var(--cabinet-black);
    padding-top: 80px;
    min-height: 100vh;
}

#gallery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 40px;
    max-width: 1100px;
    margin: 0 auto;
    padding: 20px;
}

.artifact-card {
    background: var(--midnight-arcade);
    border: 1px solid rgba(138, 139, 153, 0.3);
    padding: 30px;
    position: relative;
    transform: rotate(var(--rotate, 0deg));
    transition: transform 0.28s var(--spring-ease), box-shadow 0.28s;
}

.artifact-card:hover {
    transform: rotate(0deg) scale(1.05);
    box-shadow: 0 0 30px rgba(255, 45, 149, 0.3);
    border-color: var(--neon-magenta);
}

.artifact-timestamp {
    font-family: var(--font-mono);
    font-size: 32px;
    color: var(--temporal-cyan);
    text-shadow: 0 0 10px var(--temporal-cyan);
    margin-bottom: 16px;
    animation: timestamp-glitch 3s steps(1) infinite;
}

@keyframes timestamp-glitch {
    0%, 30% { opacity: 1; }
    31% { opacity: 0.5; transform: translateX(2px); }
    32% { opacity: 1; transform: translateX(0); }
    60%, 62% { opacity: 0.8; }
    63% { opacity: 1; }
}

.artifact-body h3 {
    font-family: var(--font-display);
    font-size: 16px;
    letter-spacing: 0.1em;
    color: var(--neon-magenta);
    text-shadow: 0 0 6px var(--neon-magenta);
    margin-bottom: 10px;
}

.artifact-body p {
    font-family: var(--font-body);
    font-size: 15px;
    color: var(--fog-gray);
    line-height: 1.6;
}

/* --- Section 6: Clock Tower --- */
#clock-tower {
    background: var(--midnight-arcade);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 30px;
    padding-top: 80px;
}

#clock-container {
    position: relative;
    width: min(80vw, 500px);
    height: min(80vw, 500px);
}

#clock-face {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    border: 4px solid var(--temporal-cyan);
    box-shadow:
        0 0 30px rgba(0, 229, 255, 0.3),
        inset 0 0 30px rgba(0, 229, 255, 0.1);
    position: relative;
    background: var(--cabinet-black);
    cursor: pointer;
    transition: border-radius 2s ease;
}

#clock-face.melting {
    border-radius: 45% 55% 60% 40% / 50% 40% 60% 50%;
}

#clock-center-dot {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 12px;
    height: 12px;
    background: var(--neon-magenta);
    border-radius: 50%;
    transform: translate(-50%, -50%);
    z-index: 10;
    box-shadow: 0 0 8px var(--neon-magenta);
}

.clock-hand {
    position: absolute;
    bottom: 50%;
    left: 50%;
    transform-origin: bottom center;
    transform: translateX(-50%);
    border-radius: 2px;
}

#hour-hand {
    width: 4px;
    height: 25%;
    background: var(--phosphor-white);
    z-index: 3;
}

#minute-hand {
    width: 3px;
    height: 35%;
    background: var(--temporal-cyan);
    box-shadow: 0 0 6px var(--temporal-cyan);
    z-index: 4;
}

#second-hand {
    width: 2px;
    height: 40%;
    background: var(--neon-magenta);
    box-shadow: 0 0 8px var(--neon-magenta);
    z-index: 5;
}

.clock-number {
    position: absolute;
    font-family: var(--font-display);
    font-size: clamp(14px, 2vw, 22px);
    color: var(--phosphor-white);
    text-shadow: 0 0 6px rgba(232, 230, 225, 0.5);
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    top: 50%;
    left: 50%;
    --angle: calc((var(--i) * 30) * 1deg);
    --radius: 42%;
    transform: translate(-50%, -50%)
               rotate(var(--angle))
               translateY(calc(var(--radius) * -1))
               rotate(calc(var(--angle) * -1));
}

#clock-ring-text {
    position: absolute;
    top: -30px;
    left: -30px;
    right: -30px;
    bottom: -30px;
    animation: ring-rotate 30s linear infinite;
}

#clock-ring-text svg {
    width: 100%;
    height: 100%;
}

#clock-ring-text text {
    font-family: var(--font-mono);
    font-size: 12px;
    fill: var(--fog-gray);
    letter-spacing: 0.15em;
}

@keyframes ring-rotate {
    to { transform: rotate(360deg); }
}

#clock-instruction {
    font-family: var(--font-mono);
    font-size: 14px;
    color: var(--fog-gray);
    letter-spacing: 0.2em;
    animation: instruction-pulse 2s ease-in-out infinite;
}

@keyframes instruction-pulse {
    0%, 100% { opacity: 0.5; }
    50% { opacity: 1; color: var(--temporal-cyan); }
}

/* --- Footer: Insert Coin --- */
#insert-coin-footer {
    background: linear-gradient(180deg, var(--midnight-arcade), var(--cabinet-black));
    padding: 30px 40px;
    border-top: 2px solid var(--neon-magenta);
    box-shadow: 0 -4px 20px rgba(255, 45, 149, 0.2);
}

#footer-cabinet {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    max-width: 1200px;
    margin: 0 auto;
    flex-wrap: wrap;
}

#player-indicators {
    display: flex;
    gap: 16px;
}

.player-light {
    font-family: var(--font-pixel);
    font-size: 16px;
    padding: 8px 16px;
    border: 2px solid var(--fog-gray);
    color: var(--fog-gray);
    transition: color 0.3s, border-color 0.3s;
}

#p1-light {
    animation: p1-blink 1.5s step-end infinite;
}

#p2-light {
    animation: p2-blink 2s step-end infinite;
}

@keyframes p1-blink {
    0%, 60% { color: var(--temporal-cyan); border-color: var(--temporal-cyan); box-shadow: 0 0 10px var(--temporal-cyan); }
    61%, 100% { color: var(--fog-gray); border-color: var(--fog-gray); box-shadow: none; }
}

@keyframes p2-blink {
    0%, 40% { color: var(--neon-magenta); border-color: var(--neon-magenta); box-shadow: 0 0 10px var(--neon-magenta); }
    41%, 100% { color: var(--fog-gray); border-color: var(--fog-gray); box-shadow: none; }
}

#marquee-strip {
    flex: 1;
    min-width: 200px;
    overflow: hidden;
    position: relative;
    height: 30px;
    background: var(--cabinet-black);
    border: 1px solid var(--fog-gray);
}

#marquee-content {
    position: absolute;
    white-space: nowrap;
    font-family: var(--font-mono);
    font-size: 13px;
    color: var(--coin-gold);
    text-shadow: 0 0 6px var(--coin-gold);
    line-height: 30px;
    animation: marquee-scroll 20s linear infinite;
}

@keyframes marquee-scroll {
    from { transform: translateX(100%); }
    to { transform: translateX(-100%); }
}

#credit-display {
    font-family: var(--font-mono);
    font-size: 18px;
    color: var(--coin-gold);
    text-shadow: 0 0 8px var(--coin-gold);
    letter-spacing: 0.15em;
    padding: 8px 16px;
    border: 2px solid var(--coin-gold);
    background: var(--cabinet-black);
}

/* --- Floating Coin Slot --- */
#coin-slot {
    position: fixed;
    bottom: 80px;
    right: 30px;
    width: 70px;
    height: 100px;
    background: linear-gradient(180deg, #333, #1a1a1a);
    border: 2px solid var(--fog-gray);
    border-radius: 8px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 8px;
    cursor: pointer;
    z-index: 1000;
    transition: transform 0.28s var(--spring-ease), box-shadow 0.28s;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.5);
}

#coin-slot:hover {
    transform: scale(1.08);
    box-shadow: 0 0 20px rgba(255, 215, 0, 0.4);
    border-color: var(--coin-gold);
}

#coin-slit {
    width: 36px;
    height: 4px;
    background: var(--cabinet-black);
    border: 1px solid var(--coin-gold);
    box-shadow: 0 0 8px var(--coin-gold);
    border-radius: 2px;
}

#coin-label {
    font-family: var(--font-pixel);
    font-size: 8px;
    color: var(--fog-gray);
    text-align: center;
    line-height: 1.3;
    letter-spacing: 0.1em;
}

#coin-drop {
    position: absolute;
    top: -30px;
    left: 50%;
    transform: translateX(-50%);
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: var(--coin-gold);
    box-shadow: 0 0 10px var(--coin-gold);
    opacity: 0;
}

#coin-drop.dropping {
    animation: coin-fall 0.4s ease-in forwards;
}

@keyframes coin-fall {
    0% { top: -30px; opacity: 1; }
    80% { top: 30px; opacity: 1; }
    100% { top: 35px; opacity: 0; }
}

.coin-flash {
    animation: coin-flash-anim 0.3s ease-out;
}

@keyframes coin-flash-anim {
    0% { box-shadow: 0 0 0 0 var(--coin-gold); }
    50% { box-shadow: 0 0 40px 20px var(--coin-gold); }
    100% { box-shadow: 0 4px 20px rgba(0, 0, 0, 0.5); }
}

/* --- Pixel Dust --- */
#pixel-dust-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 9998;
}

.pixel-dust {
    position: absolute;
    pointer-events: none;
    animation: pixel-float 1.5s ease-out forwards;
}

@keyframes pixel-float {
    0% {
        opacity: 1;
        transform: translateY(0) translateX(0);
    }
    100% {
        opacity: 0;
        transform: translateY(-80px) translateX(var(--drift, 20px));
    }
}

/* --- Hex Cell Highlight on Coin --- */
.hex-highlight {
    animation: hex-pulse-highlight 1s ease-in-out 3;
}

@keyframes hex-pulse-highlight {
    0%, 100% { filter: none; }
    50% { filter: drop-shadow(0 0 30px var(--coin-gold)) brightness(1.3); }
}

/* --- Easter Egg Grid Rearrange --- */
#hex-grid.rearranged {
    flex-direction: column;
    align-items: center;
}

#hex-grid.rearranged .hex-cell {
    margin-top: 0 !important;
}

/* --- Responsive --- */
@media (max-width: 900px) {
    :root {
        --hex-size: 200px;
    }

    .viewport-section {
        padding: 40px 20px;
    }

    #footer-cabinet {
        flex-direction: column;
        align-items: stretch;
        text-align: center;
    }

    #player-indicators {
        justify-content: center;
    }

    #clock-container {
        width: min(90vw, 400px);
        height: min(90vw, 400px);
    }
}

@media (max-width: 600px) {
    :root {
        --hex-size: 160px;
    }

    .section-title {
        font-size: clamp(1.2rem, 5vw, 2rem);
    }

    #coin-slot {
        width: 56px;
        height: 80px;
        bottom: 70px;
        right: 16px;
    }

    .countdown-digit {
        font-size: 32px;
        padding: 4px 10px;
        min-width: 50px;
    }
}
