/* Reuse the project’s self-hosted Newsreader subsets; load only matching glyphs. */
@font-face {
    font-family: "Newsreader";
    src: url("../../__shared/fonts/Newsreader/newsreader-vietnamese-wght-normal.ccb816c95425.woff2") format("woff2-variations");
    font-weight: 200 800;
    font-style: normal;
    font-display: swap;
    unicode-range: U+0102-0103, U+0110-0111, U+0128-0129, U+0168-0169, U+01A0-01A1, U+01AF-01B0, U+0300-0301, U+0303-0304, U+0308-0309, U+0323, U+0329, U+1EA0-1EF9, U+20AB;
}

@font-face {
    font-family: "Newsreader";
    src: url("../../__shared/fonts/Newsreader/newsreader-latin-ext-wght-normal.b55601316b0e.woff2") format("woff2-variations");
    font-weight: 200 800;
    font-style: normal;
    font-display: swap;
    unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

@font-face {
    font-family: "Newsreader";
    src: url("../../__shared/fonts/Newsreader/newsreader-latin-wght-normal.175a37868200.woff2") format("woff2-variations");
    font-weight: 200 800;
    font-style: normal;
    font-display: swap;
    unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

@font-face {
    font-family: "Newsreader";
    src: url("../../__shared/fonts/Newsreader/newsreader-vietnamese-wght-italic.1f5b5d0053f6.woff2") format("woff2-variations");
    font-weight: 200 800;
    font-style: italic;
    font-display: swap;
    unicode-range: U+0102-0103, U+0110-0111, U+0128-0129, U+0168-0169, U+01A0-01A1, U+01AF-01B0, U+0300-0301, U+0303-0304, U+0308-0309, U+0323, U+0329, U+1EA0-1EF9, U+20AB;
}

@font-face {
    font-family: "Newsreader";
    src: url("../../__shared/fonts/Newsreader/newsreader-latin-ext-wght-italic.8185bcbe839e.woff2") format("woff2-variations");
    font-weight: 200 800;
    font-style: italic;
    font-display: swap;
    unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

@font-face {
    font-family: "Newsreader";
    src: url("../../__shared/fonts/Newsreader/newsreader-latin-wght-italic.94402255a099.woff2") format("woff2-variations");
    font-weight: 200 800;
    font-style: italic;
    font-display: swap;
    unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

:root {
    --app-header-height: 48px;
    --app-brand-icon-size: 24px;
    --app-header-padding: 12px;
    --app-header-caption: 400 10px/1.4 var(--site-typeface);
    --site-typeface: "Newsreader", serif;
    --detail-typeface: "Atkinson Hyperlegible Next", sans-serif;
    --account-panel-padding: 8px;
    --account-title-font: 600 26px/1.2 var(--site-typeface);
    --account-section-font: 600 20px/1.3 var(--site-typeface);
    --account-name-font: 600 18px/1.3 var(--site-typeface);
    --primary-hover-bg: color-mix(in srgb, var(--gold) 90%, var(--text));
    --primary-disabled-bg: var(--surface-hi);
    --primary-disabled-text: var(--text-dim);
    color-scheme: dark;
    --bg: #191b1d;
    --surface: #25292c;
    --surface-hi: #343b3f;
    --border: #485054;
    --control-border: #7d8588;
    --text: #eee7dd;
    --text-dim: #b9bbb7;
    --p1: #8ebfe9;
    --p2: #efa296;
    --p3: #c6a2f0;
    --p4: #76d6bb;
    --p1-dim: color-mix(in srgb, var(--p1) 20%, transparent);
    --p2-dim: color-mix(in srgb, var(--p2) 20%, transparent);
    --rogue: #899b85;
    --gold: #d49a73;
    --gold-dim: color-mix(in srgb, var(--gold) 8%, transparent);
    --success: #9bcea6;
    --danger: #f0a096;
}

body {
    font-family: var(--site-typeface);
    background: var(--bg);
    color: var(--text);
    min-height: 100vh;
    cursor: default;
}

/* Controls behave like interface chrome; prose and editable text remain copyable. */
:is(button, summary, [role="button"], [role="tab"], .btn-primary, .btn-secondary, .btn-danger, .mode-card, .map-card-select, .map-card, .rival-card) {
    -webkit-user-select: none;
    user-select: none;
}
:is(button, summary, [role="button"], [role="tab"], a) { cursor: pointer; }
button:disabled, :is(input, select):disabled, [aria-disabled="true"] { cursor: default; }
:is(input[type="checkbox"], input[type="radio"], select):not(:disabled) { cursor: pointer; }
:is(p, li, dt, dd, td, th, blockquote, pre) { cursor: auto; }
:is(button, summary, [role="button"], [role="tab"], .btn-primary, .btn-secondary, .btn-danger, .mode-card, .map-card-select) :where(*) { cursor: inherit; }
:is(input, textarea, [contenteditable]:not([contenteditable="false"])) {
    -webkit-user-select: text;
    user-select: text;
}
:is(input:not([type]), input[type="text"], input[type="email"], input[type="password"], input[type="search"], input[type="url"], input[type="tel"], input[type="number"], textarea, [contenteditable]:not([contenteditable="false"])) { cursor: text; }

/* ── Buttons ────────────────────────────────────────────────────────────────── */

.btn-primary {
    display: block;
    width: 100%;
    padding: 14px;
    background: var(--gold);
    color: var(--bg);
    border: none;
    font-family: var(--site-typeface);
    font-size: 1rem;
    font-weight: bold;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    cursor: pointer;
    transition: background 0.15s, transform 0.1s;
}

.btn-primary:hover:not(:disabled) {
    background: var(--primary-hover-bg);
}

.btn-primary:active {
    transform: scale(0.98);
}

.btn-primary:disabled {
    background: var(--primary-disabled-bg);
    color: var(--primary-disabled-text);
    cursor: default;
    transform: none;
}

.btn-secondary {
    display: inline-block;
    padding: 8px 20px;
    background: transparent;
    color: var(--text-dim);
    border: 1px solid var(--control-border);
    font-family: var(--site-typeface);
    font-size: 0.85rem;
    cursor: pointer;
    transition: border-color 0.15s, color 0.15s;
}

.btn-secondary:hover {
    border-color: var(--text-dim);
    color: var(--text);
}

/* ── Form elements ───────────────────────────────────────────────────────────── */

input[type="text"],
select {
    width: 100%;
    padding: 10px 12px;
    background: var(--surface-hi);
    border: 1px solid var(--control-border);
    color: var(--text);
    font-family: var(--site-typeface);
    font-size: 0.95rem;
    outline: none;
    transition: border-color 0.15s;
}

input[type="text"]:focus,
select:focus {
    border-color: var(--gold);
}

select option {
    background: var(--surface-hi);
}

label {
    display: block;
    font-size: 0.75rem;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--text-dim);
    margin-bottom: 6px;
}

/* ── Utility ─────────────────────────────────────────────────────────────────── */

.hidden { display: none !important; }

.error-msg {
    color: var(--danger);
    font-size: 0.85rem;
    text-align: center;
    margin-top: 12px;
}

.divider {
    border: none;
    border-top: 1px solid var(--border);
    margin: 16px 0;
}

/* ── Player colours ──────────────────────────────────────────────────────────── */

.p1-text { color: var(--p1); }
.p2-text { color: var(--p2); }
.rogue-text { color: var(--rogue); }
.gold-text { color: var(--gold); }

/* One dismissal control for all map panels. Hover-only details need none. */
:is(#region-info-section,#map-order-menu,#map-order-composer,#campaign-replay-controls,#trial-overlay,#game-notices,#campaign-guide,.confirmation-dialog) .map-dismiss {
    position:absolute; right:4px; top:4px; display:grid; place-items:center;
    width:28px; height:28px; min-width:28px; min-height:28px; padding:0; margin:0;
    background:transparent; color:var(--text-dim); border:0; border-radius:4px;
    font:22px/1 var(--site-typeface); cursor:pointer;
}
#campaign-replay-controls .map-dismiss { position:static; flex-shrink:0; }
:is(#region-info-section,#map-order-menu,#map-order-composer,#campaign-replay-controls,#trial-overlay,#game-notices,#campaign-guide,.confirmation-dialog) .map-dismiss:hover { background:var(--surface-hi); color:var(--text); }
@media (any-pointer:coarse) {
    :is(#region-info-section,#map-order-menu,#map-order-composer,#campaign-replay-controls,#trial-overlay,#game-notices,#campaign-guide,.confirmation-dialog) .map-dismiss { width:44px; height:44px; }
}

/* Practical information outside gameplay uses the site's self-hosted sans face.
   Names, descriptions, headings, navigation and primary actions remain Newsreader. */
:is(.welcome-page, .summary-page) :is(
    .campaign-metadata, .subscription-facts, .subscription-note,
    .campaign-allowance, .map-region-count, #selected-map-summary,
    #kingdom-preview, .difficulty-help, .starting-facts dt,
    .form-group > label, .account-form label, .restore-campaign label,
    .helptext, .errorlist, .error-msg, [role="alert"], #restore-status,
    .save-explainer,
    .billing-disclosure, .account-note, .account-notice,
    .homepage-features, .player-account-label, .summary-stats
) {
    font-family: var(--detail-typeface);
}
:is(.welcome-page, .summary-page) :is(.campaign-metadata, .subscription-facts, .campaign-allowance, .map-region-count, .summary-stats) {
    font-variant-numeric: tabular-nums;
}
:is(.welcome-page, .summary-page) #game-notices {
    font-family: var(--detail-typeface);
}

/* Native anchor scrolling adds no JavaScript animation work. */
@media (prefers-reduced-motion:no-preference) {
    html { scroll-behavior:smooth; }
}

/* Account page titles share one hierarchy across tabs and wizard steps. */
.account-tab-title { margin:0; color:var(--gold); font:var(--account-title-font); }

/* Local visual preferences; Copper is the default when none is saved. */
:root[data-site-theme="navy-brass"] { color-scheme:dark; --bg:#121b28; --surface:#1d2a3a; --surface-hi:#2b3b4e; --border:#40516a; --control-border:#788995; --text:#f0e9db; --text-dim:#b2beca; --gold:#d6b56d; }
:root[data-site-theme="forest-parchment"] { color-scheme:dark; --bg:#141e19; --surface:#202d25; --surface-hi:#304137; --border:#445749; --control-border:#7e8c7d; --text:#eee8d7; --text-dim:#b8c2b7; --gold:#cdb77d; --p1:#8ebfe9; --p2:#efa296; --p3:#c6a2f0; --p4:#76d6bb; --rogue:#899b85; --success:#9bcea6; --danger:#f0a096; }
:root[data-site-theme="black"] { color-scheme:dark; --bg:#000000; --surface:#000000; --surface-hi:#141414; --border:#333333; --control-border:#777777; --text:#f0e9db; --text-dim:#bdbdbd; --gold:#d6b56d; }
:root[data-site-theme="maroon"] { color-scheme:dark; --bg:#1c1116; --surface:#2a1b22; --surface-hi:#3b2831; --border:#5a414c; --control-border:#947984; --text:#f1e7dc; --text-dim:#c4b4bb; --gold:#d5b779; }
.theme-picker { display:flex; align-items:center; gap:8px; margin:0; color:var(--text-dim); font:12px/1.4 var(--detail-typeface); letter-spacing:0; text-transform:none; }
.theme-picker[hidden] { display:none; }
.theme-picker select { width:auto; min-width:0; max-width:100%; min-height:32px; padding:4px 6px; border:1px solid transparent; border-radius:4px; background:transparent; color:inherit; font:inherit; cursor:pointer; }
.theme-picker select:hover { color:var(--text); border-color:var(--border); }
.theme-picker select option { background:var(--surface); color:var(--text); }
@media(any-pointer:coarse) { .theme-picker select { min-height:44px; } }
