
:root {
    color-scheme: dark;
    font: 16px/1.6 "Segoe UI", system-ui, sans-serif;
    --background: #101822;
    --surface: #1a2736;
    --stroke: #344659;
    --text: #f1f6fc;
    --muted: #bac8d8;
    --accent: #8bd4fc;
    --green: #94d6b4;
    --rose: #efa49e;
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }

body {
    min-height: 100vh;
    margin: 0;
    background: radial-gradient(ellipse 820px 450px at 50% 65px, #20394d 0%, transparent 100%), var(--background);
    color: var(--text);
}

h1, h2, p, dl, dd, ul { margin: 0; }
a { color: inherit; }
button, input { font: inherit; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 4px; }

.shell { width: min(1100px, calc(100% - 48px)); margin-inline: auto; }
.site-header { background: #101720; border-bottom: 1px solid #28384a; }
.header-inner { display: flex; justify-content: space-between; align-items: center; gap: 12px; min-height: 72px; }
.brand, .header-link, .back-link, .text-link { text-decoration: none; }
.brand { display: inline-flex; align-items: center; gap: 12px; font-size: .94rem; font-weight: 650; }
.brand-mark {
    display: flex;
    width: 34px;
    height: 34px;
    flex: 0 0 34px;
    align-items: flex-end;
    justify-content: center;
    gap: 3px;
    padding: 8px;
    border: 1px solid #426680;
    border-radius: 9px;
    background: #1d3549;
}
.brand-mark span { width: 4px; height: 8px; border-radius: 2px; background: var(--accent); }
.brand-mark span:nth-child(2) { height: 13px; }
.brand-mark span:nth-child(3) { height: 17px; }
.header-link, .back-link { color: var(--muted); font-size: .9rem; }
.header-link span { margin-left: 4px; }
.header-link:hover, .back-link:hover, .text-link:hover, .text-button:hover { color: white; text-decoration: underline; }

.home { max-width: 800px; padding-block: clamp(72px, 13vh, 150px) 80px; }
.intro { text-align: center; }
.intro h1 { font-size: clamp(2.85rem, 8vw, 6rem); line-height: 1; letter-spacing: -.065em; font-weight: 750; }
.intro h1 span { color: var(--accent); }
.intro p { max-width: 465px; margin: 24px auto 0; color: var(--muted); font-size: clamp(1rem, 2.4vw, 1.13rem); }

.panel { min-width: 0; border: 1px solid var(--stroke); border-radius: 16px; background: var(--surface); }
.search-panel { margin-top: 42px; padding: clamp(16px, 4vw, 28px); box-shadow: 0 25px 65px #080d1580; }
.search-panel label { display: block; margin-bottom: 9px; font-size: .9rem; font-weight: 650; }
.search-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 10px; }
.search-row input {
    width: 100%;
    min-width: 0;
    padding: 12px 14px;
    border: 1px solid #486078;
    border-radius: 9px;
    background: #111a25;
    color: var(--text);
}
.search-row input::placeholder { color: #a2b3c5; }
.search-row [aria-invalid="true"] { border-color: var(--rose); }

.button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 15px;
    padding: 11px 16px;
    border: 1px solid transparent;
    border-radius: 9px;
    font-weight: 700;
    text-decoration: none;
    cursor: pointer;
}
.button-primary { background: var(--accent); color: #132533; }
.button-primary:hover { background: #afe3ff; }
.button-primary:disabled { opacity: .75; cursor: wait; }

.search-meta { display: flex; align-items: baseline; justify-content: space-between; flex-wrap: wrap; gap: 4px 12px; margin-top: 13px; }
.search-meta p, .text-button, .form-error { font-size: .875rem; }
.search-meta p { color: var(--muted); }
.text-button { padding: 0; border: 0; background: none; color: var(--accent); cursor: pointer; }
.form-error { margin-top: 12px; color: var(--rose); }

.results { display: grid; gap: 20px; padding-block: 28px 64px; }
.back-link { justify-self: start; }
.game { display: grid; grid-template-columns: minmax(0, 4fr) minmax(0, 6fr); align-items: center; gap: clamp(18px, 3vw, 32px); padding: clamp(16px, 3vw, 30px); }
.game-cover { overflow: hidden; border: 1px solid var(--stroke); border-radius: 10px; background: #111a25; }
.game-cover img { display: block; width: 100%; height: auto; aspect-ratio: 460 / 215; object-fit: cover; }
.game-info { display: grid; justify-items: start; gap: 11px; min-width: 0; }
.game h1, .error-panel h1 { font-size: clamp(1.85rem, 5vw, 3.15rem); line-height: 1.12; letter-spacing: -.045em; overflow-wrap: anywhere; }
.tags { display: flex; flex-wrap: wrap; gap: 6px; padding: 0; list-style: none; }
.tags li { padding: 2px 9px; border: 1px solid #3b536a; border-radius: 6px; background: #243548; color: #c3dcf0; font-size: .82rem; }
.game-description, .stat-empty { color: var(--muted); overflow-wrap: anywhere; }
.text-link { color: var(--accent); font-size: .86rem; font-weight: 650; }
.review-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; }
.stats-panel, .widget-panel, .summary-panel { padding: clamp(16px, 3vw, 26px); }
.panel h2 { font-size: 1.15rem; line-height: 1.35; font-weight: 680; }
.rating { display: flex; align-items: center; flex-wrap: wrap; gap: 5px 15px; margin-top: 16px; }
.rating strong { color: var(--green); font-size: clamp(2.4rem, 5vw, 3.4rem); line-height: 1.1; letter-spacing: -.055em; }
.rating div { display: grid; }
.rating span, .summary-heading > span { color: var(--muted); font-size: .85rem; }
meter { display: block; width: 100%; height: 12px; margin-block: 15px; appearance: none; }
meter::-webkit-meter-bar { border: 0; border-radius: 6px; background: #513b43; }
meter::-webkit-meter-optimum-value, meter::-webkit-meter-suboptimum-value, meter::-webkit-meter-even-less-good-value { border-radius: 6px; background: var(--green); }
meter::-moz-meter-bar { border-radius: 6px; background: var(--green); }
.counts { display: grid; }
.counts > div { display: flex; justify-content: space-between; gap: 12px; border-top: 1px solid var(--stroke); padding-block: 8px; font-size: .94rem; }
.counts dt { display: flex; align-items: center; gap: 8px; color: var(--muted); }
.counts dd { font-weight: 650; font-variant-numeric: tabular-nums; }
.dot { width: 7px; height: 7px; border-radius: 50%; }
.positive { background: var(--green); }
.negative { background: var(--rose); }
.stat-empty { margin-top: 16px; }
.widget-heading, .summary-heading { display: flex; justify-content: space-between; align-items: baseline; flex-wrap: wrap; gap: 8px 12px; }
.widget-panel iframe { display: block; width: 100%; height: 225px; margin-top: 14px; border: 1px solid var(--stroke); border-radius: 8px; background: #121a25; }
.summary-copy { max-width: 85ch; margin-top: 14px; color: #dce6f1; line-height: 1.8; white-space: pre-wrap; overflow-wrap: anywhere; }

.error-page { padding-block: 62px; }
.error-panel { max-width: 680px; margin-inline: auto; padding: clamp(22px, 5vw, 40px); }
.error-panel p { margin-block: 14px 24px; color: var(--muted); }

@media (max-width: 680px) {
    .game, .review-grid { grid-template-columns: minmax(0, 1fr); }
    .search-row { grid-template-columns: minmax(0, 1fr); }
    .intro-break { display: none; }
}

@media (max-width: 420px) {
    .shell { width: calc(100% - 28px); }
    .brand { gap: 8px; font-size: .81rem; }
    .header-link { font-size: .78rem; }
}

.search-status { margin-top: 10px; color: var(--muted); font-size: .875rem; }
.search-status:empty, .copy-status:empty { display: none; }
.search-results { display: grid; gap: 6px; margin-top: 9px; padding: 0; list-style: none; }
.search-results button {
    display: grid;
    width: 100%;
    grid-template-columns: auto minmax(0, 1fr) auto;
    align-items: center;
    gap: 12px;
    padding: 7px 10px 7px 7px;
    border: 1px solid var(--stroke);
    border-radius: 9px;
    background: #14202d;
    color: var(--text);
    text-align: left;
    cursor: pointer;
}
.search-results button:hover { background: #253a4c; border-color: #54718b; }
.search-results img { width: clamp(64px, 16vw, 92px); height: auto; border-radius: 4px; background: var(--background); }
.search-results b { display: block; overflow-wrap: anywhere; }
.search-results small { display: block; color: var(--muted); }
.search-results button > span:last-child { color: var(--accent); }

.button-secondary { border-color: #44617a; background: #22364a; color: var(--text); }
.button-secondary:hover { background: #30485e; }
.result-actions, .status-actions { display: flex; align-items: center; flex-wrap: wrap; gap: 8px 16px; }
.result-actions > .back-link { margin-right: auto; }
.copy-status { color: var(--accent); font-size: .85rem; }
.error-panel .app-label { margin: 0 0 8px; color: var(--accent); font-size: .88rem; }
.status-actions + .copy-status { margin-top: 10px; display: inline-block; }
.status-actions + .copy-status:empty { display: none; }

.section-note { margin-top: 7px; color: var(--muted); font-size: .9rem; }
.period-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; margin-top: 16px; }
.period { padding: 14px 16px; border: 1px solid var(--stroke); border-radius: 10px; background: #15212f; }
.period h3, .finding-group h3 { margin: 0; font-size: 1rem; }
.period strong { color: var(--green); font-size: 1.85rem; }
.period meter { margin-block: 6px 8px; }
.findings { display: grid; gap: 20px; margin-top: 18px; }
.finding-group + .finding-group { padding-top: 17px; border-top: 1px solid var(--stroke); }
.finding-list { display: grid; gap: 10px; margin-top: 8px; padding-left: 20px; }
.finding-list p { overflow-wrap: anywhere; }
.finding-list details { margin-top: 4px; }
.finding-list summary { width: fit-content; color: var(--accent); font-size: .88rem; cursor: pointer; }
.finding-list blockquote { margin: 8px 0 0; padding: 8px 12px; border-left: 2px solid #486781; background: #15212f; }
.finding-list blockquote p { color: var(--muted); font-size: .9rem; white-space: pre-wrap; }
.finding-list blockquote span.section-note { margin-left: 8px; font-size: .8rem; }
.refresh-form { margin-top: 16px; }

@media (max-width: 540px) {
    .period-grid { grid-template-columns: minmax(0, 1fr); }
}
