:root {
    --bg-top: #071420;
    --bg-bottom: #030c14;
    --panel: #102536;
    --panel-soft: #163247;
    --panel-alt: #0b1b28;
    --border: #75f0dc;
    --border-deep: #183e50;
    --text-main: #f4f1d0;
    --text-soft: #9ec1ce;
    --accent-gold: #ffca6d;
    --accent-coral: #ff8c69;
    --accent-green: #9df59c;
    --accent-red: #ff7f90;
    --shadow-dark: rgba(0, 0, 0, 0.4);
}

* {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    margin: 0;
    min-height: 100vh;
    color: var(--text-main);
    font-family: "VT323", monospace;
    background:
        radial-gradient(circle at 15% 10%, rgba(255, 140, 105, 0.14), transparent 24%),
        radial-gradient(circle at 85% 12%, rgba(117, 240, 220, 0.14), transparent 20%),
        radial-gradient(circle at 50% 80%, rgba(255, 202, 109, 0.1), transparent 28%),
        linear-gradient(180deg, var(--bg-top) 0%, var(--bg-bottom) 100%);
    background-attachment: fixed;
    image-rendering: pixelated;
}

body::before,
body::after {
    content: "";
    position: fixed;
    inset: 0;
    pointer-events: none;
}

body::before {
    background: linear-gradient(
        180deg,
        rgba(255, 255, 255, 0.04) 0,
        rgba(255, 255, 255, 0.04) 2px,
        transparent 2px,
        transparent 6px
    );
    opacity: 0.18;
}

body::after {
    background-image:
        radial-gradient(circle, rgba(255, 255, 255, 0.5) 1px, transparent 1.5px),
        radial-gradient(circle, rgba(255, 202, 109, 0.35) 1px, transparent 2px);
    background-size: 56px 56px, 92px 92px;
    background-position: 0 0, 22px 18px;
    opacity: 0.12;
}

.main-shell {
    position: relative;
    z-index: 1;
    padding-top: 32px;
    padding-bottom: 72px;
}

.arcade-frame {
    background: linear-gradient(180deg, rgba(16, 37, 54, 0.92), rgba(11, 27, 40, 0.92));
    border: 4px solid var(--border);
    box-shadow:
        0 0 0 4px #07121c,
        0 0 0 8px var(--border-deep),
        16px 16px 0 var(--shadow-dark);
}

.hero-panel,
.countdown-panel,
.info-panel,
.event-card {
    position: relative;
    overflow: hidden;
}

.hero-panel {
    padding: 28px;
}

.hero-panel::after {
    content: "";
    position: absolute;
    width: 240px;
    height: 240px;
    top: -64px;
    right: -44px;
    opacity: 0.22;
    background:
        repeating-linear-gradient(
            45deg,
            var(--accent-coral) 0 16px,
            transparent 16px 24px,
            var(--accent-gold) 24px 40px,
            transparent 40px 52px
        );
    border-radius: 50%;
}

.eyebrow,
.progress-copy,
.mission-chip,
.unlock-chip,
.screen-label,
.screen-sub,
.digit-label,
.time-badge {
    font-family: "Press Start 2P", cursive;
}

.eyebrow {
    font-size: 0.68rem;
    line-height: 1.6;
    color: var(--accent-gold);
    text-transform: uppercase;
}

.hero-title,
.panel-title {
    font-family: "Press Start 2P", cursive;
    line-height: 1.35;
    text-transform: uppercase;
    text-shadow: 4px 4px 0 rgba(2, 8, 12, 0.7);
}

.hero-title {
    font-size: clamp(1.8rem, 4vw, 3.2rem);
    margin-bottom: 1rem;
}

.hero-title span {
    display: block;
    margin-top: 14px;
    color: var(--accent-coral);
}

.hero-text,
.panel-copy,
.schedule-row p,
.event-copy {
    font-size: 1.55rem;
    line-height: 1.15;
    color: var(--text-soft);
}

.hero-text strong {
    color: var(--text-main);
}

.stat-chip {
    display: inline-flex;
    flex-direction: column;
    gap: 6px;
    padding: 14px 16px;
    min-width: 148px;
    background: rgba(6, 16, 24, 0.55);
    border: 3px solid rgba(255, 202, 109, 0.45);
    box-shadow: inset -6px -6px 0 rgba(0, 0, 0, 0.22);
}

.stat-chip strong {
    font-family: "Press Start 2P", cursive;
    font-size: 0.58rem;
    color: var(--accent-gold);
}

.stat-chip span {
    font-size: 1.3rem;
}

.console-card {
    padding: 18px;
    background: rgba(6, 16, 24, 0.72);
    border: 4px solid rgba(255, 202, 109, 0.6);
    box-shadow: inset 0 0 0 4px rgba(255, 255, 255, 0.05);
}

.console-screen {
    display: flex;
    flex-direction: column;
    justify-content: center;
    min-height: 220px;
    padding: 18px;
    text-align: center;
    background:
        radial-gradient(circle at 50% 20%, rgba(157, 245, 156, 0.16), transparent 45%),
        linear-gradient(180deg, #182f22 0%, #0f1d16 100%);
    border: 4px solid #6bb96b;
    box-shadow: inset 0 0 0 4px rgba(0, 0, 0, 0.28);
}

.screen-label {
    font-size: 0.58rem;
    color: #c5fbc5;
    margin-bottom: 12px;
}

.screen-big {
    font-family: "Press Start 2P", cursive;
    font-size: clamp(1.8rem, 5vw, 3rem);
    color: #e7ffe7;
    text-shadow: 4px 4px 0 rgba(8, 18, 10, 0.5);
}

.screen-sub {
    font-size: 0.56rem;
    color: #bde7bd;
    margin-top: 14px;
}

.progress-copy {
    margin-top: 16px;
    font-size: 0.58rem;
    line-height: 1.8;
    color: var(--accent-green);
    text-align: center;
}

.panel-top,
.info-panel {
    padding: 24px;
}

.countdown-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 16px;
    padding: 0 24px 24px;
}

.digit-box {
    display: flex;
    flex-direction: column;
    justify-content: center;
    min-height: 132px;
    padding: 16px 12px;
    text-align: center;
    background: linear-gradient(180deg, rgba(20, 50, 71, 0.92), rgba(9, 22, 32, 0.92));
    border: 4px solid #305a70;
    box-shadow: inset -8px -8px 0 rgba(0, 0, 0, 0.22);
}

.digit-value {
    font-family: "Press Start 2P", cursive;
    font-size: clamp(1.4rem, 4vw, 2.4rem);
    color: var(--accent-gold);
    text-shadow: 3px 3px 0 rgba(0, 0, 0, 0.35);
}

.digit-label {
    margin-top: 10px;
    font-size: 0.54rem;
    line-height: 1.7;
    color: var(--text-soft);
    text-transform: uppercase;
}

.pixel-divider {
    height: 8px;
    background:
        repeating-linear-gradient(
            90deg,
            var(--accent-coral) 0 18px,
            transparent 18px 26px,
            var(--accent-gold) 26px 42px,
            transparent 42px 48px
        );
}

.schedule-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: grid;
    gap: 18px;
}

.schedule-row {
    display: flex;
    align-items: flex-start;
    gap: 14px;
}

.schedule-row strong {
    display: block;
    margin-bottom: 4px;
    font-size: 1.35rem;
    color: var(--text-main);
}

.time-badge {
    flex: 0 0 auto;
    min-width: 106px;
    padding: 12px 10px;
    text-align: center;
    font-size: 0.56rem;
    line-height: 1.6;
    color: #081019;
    background: var(--accent-gold);
    box-shadow: 4px 4px 0 rgba(0, 0, 0, 0.25);
}

.event-card {
    padding: 22px;
    min-height: 100%;
    transition:
        transform 0.25s steps(4),
        border-color 0.25s ease,
        filter 0.25s ease;
}

.event-card:hover {
    transform: translateY(-6px);
}

.event-card.locked {
    filter: saturate(0.78);
}

.event-card.unlocked {
    border-color: var(--accent-green);
}

.event-card.just-unlocked {
    animation: card-pop 0.55s steps(5);
}

.event-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 18px;
}

.mission-chip,
.event-status,
.unlock-chip {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    line-height: 1.5;
    text-transform: uppercase;
}

.mission-chip {
    padding: 8px 10px;
    font-size: 0.52rem;
    color: #081019;
    background: var(--accent-coral);
    box-shadow: 4px 4px 0 rgba(0, 0, 0, 0.2);
}

.event-status {
    padding: 8px 10px;
    min-width: 116px;
    font-size: 0.5rem;
    color: #fff;
}

.event-status.is-locked {
    background: #5b3346;
}

.event-status.is-live {
    background: #224b37;
}

.event-title {
    margin-bottom: 12px;
    font-family: "Press Start 2P", cursive;
    font-size: 1rem;
    line-height: 1.5;
    text-transform: uppercase;
}

.event-copy {
    min-height: 118px;
}

.event-footer {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.unlock-chip {
    width: fit-content;
    padding: 10px 12px;
    font-size: 0.5rem;
    color: var(--accent-gold);
    background: rgba(0, 0, 0, 0.28);
    border: 3px solid rgba(255, 202, 109, 0.26);
}

.event-trigger {
    width: 100%;
}

.event-trigger[disabled] {
    cursor: not-allowed;
    opacity: 0.68;
}

.event-trigger:not([disabled]) {
    animation: ready-pulse 1.6s steps(5) infinite;
}

.swal2-popup.arcade-popup {
    background: #0d2030;
    color: var(--text-main);
    border: 4px solid var(--accent-coral);
    border-radius: 0;
    box-shadow:
        0 0 0 4px #081019,
        0 0 0 8px #5b3346,
        18px 18px 0 rgba(0, 0, 0, 0.4);
}

.swal2-title.arcade-title {
    font-family: "Press Start 2P", cursive;
    font-size: 1rem !important;
    line-height: 1.6 !important;
    text-transform: uppercase;
}

.swal2-html-container.arcade-html {
    font-family: "VT323", monospace !important;
    font-size: 1.6rem !important;
    line-height: 1.15 !important;
    color: var(--text-soft) !important;
}

.swal2-popup.toast-popup {
    background: #0e2334 !important;
    color: var(--text-main) !important;
    border: 4px solid var(--accent-green) !important;
    border-radius: 0 !important;
}

.swal2-title.toast-title {
    font-family: "Press Start 2P", cursive;
    font-size: 0.75rem !important;
    line-height: 1.6 !important;
}

.swal2-html-container.toast-html {
    font-family: "VT323", monospace !important;
    font-size: 1.4rem !important;
    line-height: 1.1 !important;
}

@keyframes ready-pulse {
    0%,
    100% {
        transform: translateY(0);
    }
    50% {
        transform: translateY(-3px);
    }
}

@keyframes card-pop {
    0% {
        transform: scale(0.96);
    }
    50% {
        transform: scale(1.03);
    }
    100% {
        transform: scale(1);
    }
}

@media (max-width: 991.98px) {
    .hero-panel::after {
        width: 180px;
        height: 180px;
    }

    .countdown-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .event-copy {
        min-height: auto;
    }
}

@media (max-width: 575.98px) {
    .main-shell {
        padding-top: 18px;
        padding-bottom: 36px;
    }

    .hero-panel,
    .countdown-panel,
    .info-panel,
    .event-card {
        padding: 18px;
    }

    .panel-top,
    .info-panel {
        padding: 0;
    }

    .countdown-grid {
        padding: 0;
        margin-top: 18px !important;
    }

    .digit-box {
        min-height: 108px;
    }

    .schedule-row {
        flex-direction: column;
    }

    .time-badge {
        min-width: 0;
    }

    .event-head {
        flex-direction: column;
        align-items: flex-start;
    }
}
