:root {
    --bg: #08101f;
    --bg-soft: #0f1b30;
    --panel: #12203a;
    --panel-soft: #1a2945;
    --panel-light: #f8fafc;
    --surface: #ffffff;
    --text: #edf2f7;
    --text-soft: #c8d4e5;
    --ink: #08111f;
    --muted-ink: #55657d;
    --yellow: #facc15;
    --yellow-soft: #fde68a;
    --green: #34d399;
    --green-soft: #bbf7d0;
    --blue: #7dd3fc;
    --blue-soft: #d7f2ff;
    --pink: #f9a8d4;
    --red: #fb7185;
    --red-soft: #ffe0e5;
    --border: #000000;
    --shadow: 4px 4px 0 #000;
    --focus: 3px solid #0b5fff;
    --radius: 0;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
html, body { margin: 0; padding: 0; }
body {
    min-height: 100vh;
    font-family: Arial, Helvetica, sans-serif;
    color: var(--text);
    background:
        radial-gradient(circle at top left, rgba(52, 211, 153, .14), transparent 28%),
        radial-gradient(circle at bottom right, rgba(250, 204, 21, .15), transparent 32%),
        var(--bg);
}
body::before {
    content: "";
    position: fixed;
    inset: 0;
    background-image:
        linear-gradient(to right, rgba(255,255,255,.06) 1px, transparent 1px),
        linear-gradient(to bottom, rgba(255,255,255,.06) 1px, transparent 1px);
    background-size: 24px 24px;
    opacity: .22;
    pointer-events: none;
}

a { color: inherit; }
button, input, select, textarea { font: inherit; }
button, input, select {
    min-height: 50px;
}
button:focus-visible,
input:focus-visible,
select:focus-visible,
a:focus-visible {
    outline: var(--focus);
    outline-offset: 2px;
}

.skip-link {
    position: absolute;
    left: 14px;
    top: -100px;
    z-index: 9999;
    background: #fff;
    color: #000;
    border: 4px solid #000;
    box-shadow: var(--shadow);
    padding: 12px 16px;
    font-weight: 900;
    text-transform: uppercase;
    letter-spacing: .08em;
}
.skip-link:focus {
    top: 14px;
}

.page-shell {
    width: min(1560px, calc(100% - 32px));
    margin: 0 auto;
    padding: 18px 0 36px;
    position: relative;
    z-index: 1;
}

.panel {
    border: 4px solid var(--border);
    box-shadow: var(--shadow);
}
.panel-yellow { background: var(--yellow); color: #000; }
.panel-green { background: var(--green-soft); color: #000; }
.panel-blue { background: var(--blue-soft); color: #000; }
.panel-dark { background: var(--panel); color: var(--text); }
.panel-light { background: var(--panel-light); color: #000; }

.hero {
    padding: 30px;
}
.hero-badges,
.hero-actions,
.mode-buttons,
.detail-pills,
.tag-row,
.status-pills,
.stats-row,
.question-topline,
.quiz-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
}
.hero-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.55fr) minmax(360px, .95fr);
    gap: 24px;
    margin-top: 22px;
    align-items: start;
}
.hero-copy-wrap {
    display: grid;
    gap: 16px;
    align-content: start;
}
.eyebrow,
.section-label {
    margin: 0;
    font-size: 12px;
    font-weight: 900;
    text-transform: uppercase;
    letter-spacing: .22em;
}
.section-label { color: var(--blue); }
.section-label-muted { color: var(--muted-ink); }
.section-accent { color: var(--yellow); }
.hero h1 {
    margin: 0;
    font-size: clamp(36px, 5.6vw, 74px);
    line-height: .94;
    text-transform: uppercase;
    max-width: 12ch;
}
.hero-copy {
    margin: 0;
    max-width: 72ch;
    line-height: 1.85;
    font-size: 17px;
    font-weight: 700;
}
.hero-copy-large {
    font-size: 18px;
}
.chip,
.detail-pill,
.type-chip {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 46px;
    border: 4px solid var(--border);
    background: #fff;
    color: #000;
    padding: 10px 14px;
    font-size: 12px;
    line-height: 1.2;
    font-weight: 900;
    text-transform: uppercase;
    letter-spacing: .13em;
}
.chip-dark { background: var(--panel); color: var(--green); }
.detail-pill-yellow { background: var(--yellow); }

.btn {
    border: 4px solid var(--border);
    background: #fff;
    color: #000;
    box-shadow: var(--shadow);
    padding: 12px 18px;
    font-weight: 900;
    text-transform: uppercase;
    letter-spacing: .12em;
    cursor: pointer;
    transition: transform .12s ease, background-color .18s ease, box-shadow .18s ease;
}
.btn:hover { transform: translate(-1px, -1px); box-shadow: 6px 6px 0 #000; }
.btn:active { transform: translate(2px, 2px); box-shadow: 2px 2px 0 #000; }
.btn-dark { background: var(--panel); color: #fff; }
.btn.is-active { background: var(--panel); color: #fff; }
.compact-action { align-self: end; }

.radar-box {
    display: grid;
    gap: 16px;
    border: 4px solid var(--border);
    background: rgba(16, 24, 42, .9);
    padding: 22px;
    box-shadow: var(--shadow);
}
.radar-title {
    margin: 4px 0 0;
    font-size: clamp(30px, 3vw, 42px);
    font-weight: 900;
    line-height: 1;
}
.radar-copy {
    margin: 0;
    line-height: 1.8;
    font-size: 16px;
    color: var(--text-soft);
    font-weight: 700;
}
.pixel-orb {
    display: grid;
    grid-template-columns: repeat(8, 14px);
    gap: 2px;
    padding: 10px;
    border: 4px solid #000;
    background: #08111f;
    width: fit-content;
}
.pixel-orb span {
    width: 14px;
    height: 14px;
    display: block;
    background: #334155;
}
.pixel-orb span.on { background: var(--green); }

.stats-row {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 14px;
}
.stat-card,
.game-stat {
    border: 4px solid #000;
    padding: 16px;
    background: #fff;
    color: #000;
}
.stat-card span,
.game-stat span {
    display: block;
    font-size: 12px;
    font-weight: 900;
    text-transform: uppercase;
    letter-spacing: .14em;
}
.stat-card strong,
.game-stat strong {
    display: block;
    margin-top: 8px;
    font-size: clamp(32px, 4vw, 42px);
    line-height: 1;
}

.main-grid {
    display: grid;
    grid-template-columns: minmax(280px, .8fr) minmax(0, 1.5fr);
    gap: 22px;
    margin-top: 22px;
}
.sidebar {
    display: grid;
    gap: 18px;
    align-content: start;
}
.sidebar .panel { padding: 20px; }
.feature-list {
    margin: 0;
    padding-left: 20px;
    display: grid;
    gap: 12px;
    line-height: 1.75;
    color: var(--text-soft);
    font-weight: 700;
}
.sidebar p,
.section-copy,
.knowledge-copy,
.explore-card p,
.explore-detail p,
.empty-state p {
    margin: 0;
    line-height: 1.8;
    font-size: 16px;
    font-weight: 700;
}
.small-note {
    color: var(--text-soft);
    font-size: 14px;
}
.game-stats {
    display: grid;
    gap: 12px;
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.app-panel {
    padding: 24px;
}
.app-head {
    display: flex;
    justify-content: space-between;
    align-items: start;
    gap: 18px;
    margin-bottom: 22px;
}
.app-head h2,
.section-intro h3 {
    margin: 6px 0 0;
    font-size: clamp(30px, 3.2vw, 46px);
    line-height: 1;
    text-transform: uppercase;
}
.mode-section { display: none; }
.mode-section.active { display: block; }
.hidden { display: none !important; }
.empty-state {
    border: 4px dashed #000;
    background: #eef2f7;
    padding: 22px;
    margin-bottom: 18px;
}
.empty-state h3 {
    margin: 0 0 10px;
    font-size: clamp(26px, 3vw, 34px);
    text-transform: uppercase;
}

.section-intro {
    display: flex;
    justify-content: space-between;
    align-items: start;
    gap: 18px;
    margin-bottom: 18px;
}
.status-pills .detail-pill strong {
    margin-left: 8px;
}

.quiz-settings,
.filters-grid {
    display: grid;
    gap: 14px;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    margin-bottom: 18px;
}
.filters-grid {
    grid-template-columns: minmax(0, 1.6fr) repeat(2, minmax(220px, .65fr));
}
.field {
    display: flex;
    flex-direction: column;
    gap: 8px;
    border: 4px solid #000;
    background: #fff;
    padding: 14px 16px;
    box-shadow: var(--shadow);
    min-height: 88px;
}
.compact-field { min-height: 84px; }
.field span {
    font-size: 12px;
    font-weight: 900;
    text-transform: uppercase;
    letter-spacing: .14em;
    color: var(--muted-ink);
}
.field input,
.field select {
    width: 100%;
    border: 0;
    background: transparent;
    color: #000;
    font-size: 16px;
    font-weight: 700;
    min-height: 42px;
}
.field-wide { grid-column: auto; }

.quiz-layout,
.explore-layout {
    display: grid;
    gap: 22px;
    grid-template-columns: minmax(320px, .86fr) minmax(0, 1.14fr);
}
.quiz-question-box,
.explore-detail {
    border: 4px solid #000;
    background: #0f172a;
    color: #fff;
    padding: 24px;
}
.quiz-question-box {
    display: grid;
    gap: 18px;
    align-content: start;
}
.question-topline {
    justify-content: space-between;
    align-items: center;
}
.question-prompt {
    margin: 0;
    font-size: 18px;
    line-height: 1.6;
    font-weight: 800;
    color: var(--text-soft);
}
.quiz-tld {
    margin: 0;
    font-size: clamp(72px, 10vw, 132px);
    line-height: .88;
    font-weight: 900;
    letter-spacing: -.06em;
}
.clue-box {
    border: 4px solid #000;
    background: #1e293b;
    padding: 16px;
}
.quiz-hint {
    margin: 0;
    color: #dbe5f2;
    line-height: 1.8;
}
.quiz-side {
    display: grid;
    gap: 14px;
    align-content: start;
}
.feedback-banner {
    border: 4px solid #000;
    padding: 14px 16px;
    font-weight: 900;
    line-height: 1.6;
}
.feedback-banner.neutral { background: #eef2f7; color: #0f172a; }
.feedback-banner.success { background: var(--green-soft); color: #0f172a; }
.feedback-banner.error { background: var(--red-soft); color: #0f172a; }
.quiz-answers {
    display: grid;
    gap: 14px;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
}
.answer-btn {
    min-height: 96px;
    border: 4px solid #000;
    background: #fff;
    color: #000;
    padding: 16px 14px;
    text-align: left;
    font-size: 16px;
    font-weight: 900;
    text-transform: uppercase;
    letter-spacing: .06em;
    cursor: pointer;
    transition: transform .12s ease, background-color .18s ease, box-shadow .18s ease;
}
.answer-btn:hover { background: #fef3c7; transform: translate(-2px, -2px); box-shadow: 6px 6px 0 #000; }
.answer-btn.correct { background: #4ade80; }
.answer-btn.wrong { background: var(--red); }
.answer-btn:disabled { cursor: default; }
.knowledge-box {
    border: 4px solid #000;
    background: #e2e8f0;
    color: #000;
    padding: 18px;
}
.knowledge-pills { margin-bottom: 12px; }
.knowledge-copy { color: #223147; }
.tag-row {
    margin-top: 12px;
}
.tag {
    display: inline-flex;
    align-items: center;
    border: 2px solid currentColor;
    padding: 7px 10px;
    font-size: 11px;
    font-weight: 900;
    text-transform: uppercase;
    letter-spacing: .11em;
}

.explore-layout {
    grid-template-columns: minmax(0, 1fr) minmax(340px, .95fr);
    align-items: start;
}

.explore-toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
    margin: 0 0 18px;
    padding: 16px 18px;
    border: 4px solid #000;
    background: #e8eef6;
}
.toolbar-copy {
    color: #223147;
    margin: 0;
    font-size: 15px;
    line-height: 1.7;
    font-weight: 700;
}
.pagination-controls {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}
.explore-list-shell {
    min-height: 0;
}

.explore-list {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(290px, 1fr));
    gap: 14px;
    align-content: start;
}
.explore-card {
    border: 4px solid #000;
    background: #fff;
    color: #000;
    padding: 18px;
    text-align: left;
    cursor: pointer;
    min-height: 220px;
    display: grid;
    gap: 10px;
    align-content: start;
}
.explore-card:hover { background: #dbeafe; transform: translate(-2px, -2px); box-shadow: 6px 6px 0 #000; }
.explore-card.active { background: var(--yellow); box-shadow: var(--shadow); }
.explore-card-head {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    align-items: start;
}
.explore-card .tld {
    font-size: 40px;
    line-height: .94;
    font-weight: 900;
    text-transform: uppercase;
}
.explore-card .answer,
.explore-card .meta {
    font-size: 12px;
    font-weight: 900;
    text-transform: uppercase;
    letter-spacing: .12em;
}
.explore-card .answer {
    color: #0f172a;
}
.explore-card .meta { color: #475569; }
.explore-card p {
    color: #334155;
    display: -webkit-box;
    -webkit-line-clamp: 4;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.explore-detail {
    display: grid;
    gap: 14px;
    position: sticky;
    top: 18px;
    max-height: calc(100vh - 40px);
    overflow: auto;
}
.explore-detail .tld-big {
    margin: 0;
    font-size: clamp(58px, 7vw, 96px);
    line-height: .9;
    font-weight: 900;
}
.explore-detail .detail-answer {
    margin: 0;
    font-size: 22px;
    font-weight: 900;
    text-transform: uppercase;
    letter-spacing: .08em;
}
.detail-grid {
    display: grid;
    gap: 12px;
    grid-template-columns: repeat(2, minmax(0, 1fr));
}
.detail-meta-box,
.sub-box {
    border: 4px solid #000;
    background: #1e293b;
    color: #fff;
    padding: 14px;
}
.detail-meta-box span {
    display: block;
    color: #9fb0c7;
    font-size: 12px;
    font-weight: 900;
    text-transform: uppercase;
    letter-spacing: .14em;
    margin-bottom: 6px;
}
.detail-meta-box strong {
    display: block;
    font-size: 17px;
    line-height: 1.5;
}
.empty-card {
    border: 4px dashed #000;
    background: #eef2f7;
    padding: 18px;
    color: #0f172a;
}
.footer-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 12px;
    margin-top: 22px;
    padding: 18px 20px;
}
.footer-bar strong {
    text-transform: uppercase;
    letter-spacing: .12em;
}
code {
    background: rgba(0,0,0,.08);
    padding: 2px 6px;
}

@media (max-width: 1280px) {
    .main-grid,
    .hero-grid,
    .quiz-layout,
    .explore-layout {
        grid-template-columns: 1fr;
    }
    .explore-detail {
        position: static;
    }
}

@media (max-width: 980px) {
    .quiz-settings,
    .filters-grid,
    .stats-row,
    .game-stats,
    .detail-grid {
        grid-template-columns: 1fr 1fr;
    }
    .section-intro,
    .app-head,
    .explore-toolbar {
        flex-direction: column;
        align-items: start;
    }
}

@media (max-width: 720px) {
    .explore-detail {
        max-height: none;
    }

    .page-shell {
        width: min(100% - 16px, 1560px);
    }
    .hero,
    .app-panel,
    .sidebar .panel,
    .footer-bar,
    .radar-box,
    .quiz-question-box,
    .explore-detail {
        padding: 16px;
    }
    .quiz-settings,
    .filters-grid,
    .stats-row,
    .game-stats,
    .detail-grid {
        grid-template-columns: 1fr;
    }
    .hero h1 {
        max-width: none;
    }
    .hero-copy,
    .hero-copy-large,
    .sidebar p,
    .feature-list,
    .section-copy,
    .knowledge-copy,
    .explore-card p,
    .explore-detail p {
        font-size: 15px;
    }
    .quiz-answers,
    .explore-list {
        grid-template-columns: 1fr;
    }
}

@media (prefers-reduced-motion: reduce) {
    html { scroll-behavior: auto; }
    *, *::before, *::after {
        animation: none !important;
        transition: none !important;
    }
}


body.is-loaded .hero,
body.is-loaded .radar-box,
body.is-loaded .app-panel,
body.is-loaded .footer-bar {
    animation: rise-in .6s cubic-bezier(.2,.8,.2,1) both;
}
body.is-loaded .hero { animation-delay: .05s; }
body.is-loaded .radar-box { animation-delay: .12s; }
body.is-loaded .app-panel { animation-delay: .18s; }
body.is-loaded .footer-bar { animation-delay: .24s; }

.js-enhanced .reveal-item {
    opacity: 0;
    transform: translateY(20px);
}
.js-enhanced .reveal-item.is-visible {
    opacity: 1;
    transform: translateY(0);
    transition: opacity .45s ease, transform .45s ease;
}

.pixel-orb {
    animation: orb-float 4.6s ease-in-out infinite;
}
.pixel-orb span.on {
    animation: pixel-blink 2.4s steps(2, end) infinite;
    animation-delay: var(--pulse-delay, 0ms);
}

.quiz-question-box,
.knowledge-box,
.explore-detail,
.feedback-banner,
.clue-box,
.sub-box,
.detail-meta-box,
.stat-card,
.game-stat,
.explore-toolbar,
.explore-card,
.answer-btn {
    will-change: transform, opacity;
}

.swap-in {
    animation: swap-in .36s cubic-bezier(.2,.9,.25,1) both;
}

.pulse-in {
    animation: pulse-in .4s cubic-bezier(.2,.9,.25,1) both;
}

.stagger-in {
    animation: card-in .42s cubic-bezier(.2,.85,.2,1) both;
    animation-delay: var(--delay, 0ms);
}

.feedback-banner.success {
    box-shadow: var(--shadow), 0 0 0 4px rgba(52,211,153,.12);
}
.feedback-banner.error {
    box-shadow: var(--shadow), 0 0 0 4px rgba(251,113,133,.12);
}

.explore-detail {
    scrollbar-width: thin;
}
.explore-detail::-webkit-scrollbar {
    width: 10px;
}
.explore-detail::-webkit-scrollbar-thumb {
    background: rgba(255,255,255,.22);
    border: 2px solid transparent;
}

@keyframes rise-in {
    from { opacity: 0; transform: translateY(18px); }
    to { opacity: 1; transform: translateY(0); }
}
@keyframes card-in {
    from { opacity: 0; transform: translateY(16px) scale(.98); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}
@keyframes swap-in {
    from { opacity: .3; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}
@keyframes pulse-in {
    0% { transform: scale(.97); opacity: .65; }
    60% { transform: scale(1.02); opacity: 1; }
    100% { transform: scale(1); }
}
@keyframes pixel-blink {
    0%, 100% { filter: brightness(1); }
    50% { filter: brightness(1.35); }
}
@keyframes orb-float {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-3px); }
}
