/*
 * HTG admin console. Visual language follows houseythegame.com:
 * ink background, gold accents and hairlines, Cinzel display type, Inter text.
 * Fonts are served from /admin/assets/fonts (SIL Open Font License 1.1).
 */

@font-face {
    font-family: "Cinzel";
    font-style: normal;
    font-weight: 500 800;
    font-display: swap;
    src: url("fonts/cinzel-latin.woff2") format("woff2");
    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: "Cinzel";
    font-style: normal;
    font-weight: 500 800;
    font-display: swap;
    src: url("fonts/cinzel-latin-ext.woff2") format("woff2");
    unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
    font-family: "Inter";
    font-style: normal;
    font-weight: 400 800;
    font-display: swap;
    src: url("fonts/inter-latin.woff2") format("woff2");
    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: "Inter";
    font-style: normal;
    font-weight: 400 800;
    font-display: swap;
    src: url("fonts/inter-latin-ext.woff2") format("woff2");
    unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

:root {
    /* Brand (houseythegame.com) */
    --gold: #d8b66a;
    --gold-light: #f2dca0;
    --gold-deep: #8f7540;
    --gold-soft: rgba(216, 182, 106, 0.12);
    --gold-faint: rgba(216, 182, 106, 0.06);
    --line: rgba(216, 182, 106, 0.23);
    --ink: #0d0d0e;

    /* Surfaces */
    --bg: #0d0d0e;
    --sidebar-bg: #111112;
    --panel: #171719;
    --panel-2: #1b1b1d;
    --panel-3: #222225;
    --well: #101011;
    --hair: rgba(255, 255, 255, 0.08);
    --hair-strong: rgba(255, 255, 255, 0.14);

    /* Text */
    --text: #faf8f1;
    --text-2: #d5d0c4;
    --muted: #b8b5ad;
    --faint: #85827a;

    /* Status, tuned for the dark background */
    --success: #6cc68f;
    --success-soft: rgba(108, 198, 143, 0.13);
    --warning: #e9b14f;
    --warning-soft: rgba(233, 177, 79, 0.14);
    --danger: #ec7468;
    --danger-solid: #c9483d;
    --danger-soft: rgba(236, 116, 104, 0.13);
    --info: #7db8e0;
    --info-soft: rgba(125, 184, 224, 0.13);

    --focus: 0 0 0 3px rgba(216, 182, 106, 0.3);
    --shadow: 0 12px 40px rgba(0, 0, 0, 0.35);
    --shadow-lg: 0 24px 60px rgba(0, 0, 0, 0.6);
    --radius: 16px;
    --radius-md: 12px;
    --radius-sm: 9px;
    --sidebar: 248px;
    --display: "Cinzel", Georgia, "Times New Roman", serif;
    --font: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
    --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;
    color-scheme: dark;
}

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

html, body { margin: 0; padding: 0; }

body {
    min-height: 100vh;
    background:
        radial-gradient(ellipse at 85% -10%, rgba(180, 139, 56, 0.12), transparent 40%),
        radial-gradient(ellipse at 0% 100%, rgba(255, 255, 255, 0.025), transparent 40%),
        var(--bg);
    background-attachment: fixed;
    color: var(--text);
    font: 14px/1.55 var(--font);
    -webkit-font-smoothing: antialiased;
}

/* Gold strip across the top, as on the site */
body::before {
    content: "";
    position: fixed;
    inset: 0 0 auto 0;
    height: 3px;
    z-index: 50;
    background: linear-gradient(90deg, var(--gold-deep), var(--gold-light), var(--gold-deep));
}

a { color: var(--gold-light); text-decoration: none; }
a:hover { color: var(--gold); }
h1, h2, h3, h4 { margin: 0; font-family: var(--display); font-weight: 700; line-height: 1.2; color: var(--text); }
p { margin: 0; }
code, .mono { font-family: var(--mono); font-size: 12.5px; }
.muted { color: var(--muted); }
.faint { color: var(--faint); }
.small { font-size: 12.5px; }
.nowrap { white-space: nowrap; }
.num { font-variant-numeric: tabular-nums; }
.right { text-align: right; }
.gold { color: var(--gold-light); }
.hidden { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
::selection { background: rgba(216, 182, 106, 0.35); color: var(--text); }

:focus-visible { outline: none; box-shadow: var(--focus); border-radius: var(--radius-sm); }

.eyebrow {
    display: flex;
    align-items: center;
    gap: 10px;
    color: var(--gold);
    text-transform: uppercase;
    font-size: 11px;
    font-weight: 800;
    letter-spacing: 0.22em;
}
.eyebrow::before { content: ""; width: 24px; height: 1px; background: var(--gold); }

/* ---------- Shell ---------- */

.shell { display: flex; min-height: 100vh; }

.sidebar {
    position: fixed;
    inset: 0 auto 0 0;
    width: var(--sidebar);
    padding-top: 3px;
    background: var(--sidebar-bg);
    border-right: 1px solid var(--hair);
    display: flex;
    flex-direction: column;
    z-index: 30;
}

.brand {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 18px 18px 16px;
    color: var(--text);
    border-bottom: 1px solid var(--hair);
}
.brand:hover { color: var(--text); }
.brand img { width: 44px; height: 44px; object-fit: contain; flex: none; filter: drop-shadow(0 6px 12px rgba(0, 0, 0, 0.5)); }
.brand-name { display: block; font-family: var(--display); font-weight: 800; letter-spacing: 0.07em; font-size: 16px; line-height: 1.15; }
.brand-sub { display: block; color: var(--gold); font: 700 9px var(--font); letter-spacing: 0.2em; margin-top: 5px; text-transform: uppercase; }

.nav { flex: 1; overflow-y: auto; padding: 6px 12px 18px; }
.nav-group { margin-top: 18px; }
.nav-group-title {
    padding: 0 10px 6px;
    font-size: 10px;
    font-weight: 800;
    color: var(--faint);
    text-transform: uppercase;
    letter-spacing: 0.2em;
}
.nav-link {
    position: relative;
    display: flex;
    align-items: center;
    gap: 11px;
    padding: 8px 12px;
    border-radius: 10px;
    color: #e1ded5;
    font-weight: 500;
    font-size: 13.5px;
}
.nav-link:hover { background: rgba(255, 255, 255, 0.04); color: var(--gold-light); }
.nav-link.active { background: var(--gold-soft); color: var(--gold-light); box-shadow: inset 0 0 0 1px var(--line); }
.nav-link svg { width: 17px; height: 17px; flex: none; opacity: 0.85; }
.nav-link.active svg { color: var(--gold); opacity: 1; }

.sidebar-footer {
    border-top: 1px solid var(--hair);
    padding: 12px 14px;
    display: flex;
    align-items: center;
    gap: 10px;
}
.avatar {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    background: var(--gold-soft);
    border: 1px solid var(--line);
    color: var(--gold-light);
    display: grid;
    place-items: center;
    font-weight: 700;
    font-size: 12.5px;
    flex: none;
    overflow: hidden;
}
.avatar img { width: 100%; height: 100%; object-fit: cover; }
.avatar-lg { width: 60px; height: 60px; font-size: 20px; font-family: var(--display); }
.who { min-width: 0; flex: 1; }
.who-name { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.who-role { font-size: 10px; color: var(--gold); letter-spacing: 0.16em; text-transform: uppercase; font-weight: 700; }

.main { flex: 1; margin-left: var(--sidebar); min-width: 0; }

.topbar {
    position: sticky;
    top: 0;
    z-index: 20;
    display: flex;
    align-items: center;
    gap: 12px;
    height: 60px;
    padding: 3px 32px 0;
    background: rgba(13, 13, 14, 0.91);
    backdrop-filter: blur(14px);
    border-bottom: 1px solid var(--hair);
}
.topbar .menu-btn { display: none; }
.crumbs { display: flex; align-items: center; gap: 8px; color: var(--faint); font-size: 13px; min-width: 0; }
.crumbs a { color: var(--muted); }
.crumbs a:hover { color: var(--gold-light); }
.crumbs .sep { color: var(--gold-deep); }
.crumbs .current { color: var(--text); font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.topbar-spacer { flex: 1; }
.clock { color: var(--muted); font-size: 12.5px; font-variant-numeric: tabular-nums; }
.clock b { color: var(--gold-light); font-weight: 600; }

.content { padding: 28px 32px 72px; max-width: 1340px; }

.scrim { display: none; }

@media (max-width: 960px) {
    .sidebar { transform: translateX(-100%); transition: transform 0.2s ease; box-shadow: var(--shadow-lg); }
    .shell.nav-open .sidebar { transform: none; }
    .shell.nav-open .scrim { display: block; position: fixed; inset: 0; background: rgba(0, 0, 0, 0.55); z-index: 25; }
    .main { margin-left: 0; }
    .topbar .menu-btn { display: inline-flex; }
    .topbar { padding: 3px 16px 0; }
    .content { padding: 20px 16px 56px; }
    .clock { display: none; }
}

/* ---------- Page header ---------- */

.page-head {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 24px;
    flex-wrap: wrap;
}
.page-head .eyebrow { margin-bottom: 10px; }
.page-title { font-size: clamp(24px, 2.6vw, 32px); letter-spacing: -0.01em; }
.page-sub { color: var(--muted); margin-top: 6px; max-width: 680px; }
.page-actions { display: flex; gap: 10px; flex-wrap: wrap; }
.title-row { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }

/* ---------- Buttons (pill, as on the site) ---------- */

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    height: 36px;
    padding: 0 17px;
    border-radius: 999px;
    border: 1px solid var(--line);
    background: transparent;
    color: var(--text);
    font: inherit;
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
    white-space: nowrap;
    transition: background 0.15s, border-color 0.15s, color 0.15s, transform 0.15s;
}
.btn:hover { border-color: var(--gold); color: var(--gold-light); text-decoration: none; }
.btn:disabled { opacity: 0.5; cursor: not-allowed; transform: none; }
.btn svg { width: 16px; height: 16px; }
.btn-primary { background: var(--gold); border-color: var(--gold); color: #16130c; font-weight: 800; }
.btn-primary:hover { background: var(--gold-light); border-color: var(--gold-light); color: #16130c; transform: translateY(-1px); }
.btn-danger { background: var(--danger-solid); border-color: var(--danger-solid); color: #fff; }
.btn-danger:hover { background: #dd5a4e; border-color: #dd5a4e; color: #fff; }
.btn-danger-ghost { color: var(--danger); border-color: rgba(236, 116, 104, 0.35); }
.btn-danger-ghost:hover { color: #ff9a90; border-color: var(--danger); background: var(--danger-soft); }
.btn-ghost { border-color: transparent; }
.btn-ghost:hover { background: rgba(255, 255, 255, 0.05); border-color: transparent; }
.btn-sm { height: 29px; padding: 0 12px; font-size: 12.5px; }
.btn-icon { width: 36px; padding: 0; }
.btn-group { display: inline-flex; gap: 8px; flex-wrap: wrap; }

/* ---------- Forms ---------- */

.field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.field-label { font-size: 12px; font-weight: 700; color: var(--text-2); letter-spacing: 0.02em; }
.field-hint { font-size: 12px; color: var(--faint); }
.field-error { font-size: 12.5px; color: var(--danger); }

.input, .select, .textarea {
    width: 100%;
    height: 38px;
    padding: 0 12px;
    border: 1px solid var(--hair-strong);
    border-radius: 10px;
    background: var(--well);
    color: var(--text);
    font: inherit;
}
.select { appearance: none; padding-right: 32px; background-image: linear-gradient(45deg, transparent 50%, var(--gold) 50%), linear-gradient(135deg, var(--gold) 50%, transparent 50%); background-position: calc(100% - 17px) 16px, calc(100% - 12px) 16px; background-size: 5px 5px; background-repeat: no-repeat; }
.select option { background: var(--panel); color: var(--text); }
.textarea { height: auto; min-height: 88px; padding: 10px 12px; resize: vertical; }
.input::placeholder, .textarea::placeholder { color: var(--faint); }
.input:hover, .select:hover, .textarea:hover { border-color: rgba(216, 182, 106, 0.35); }
.input:focus, .select:focus, .textarea:focus { outline: none; border-color: var(--gold); box-shadow: var(--focus); }
.input:disabled, .select:disabled, .textarea:disabled { opacity: 0.55; }
.input[type="number"] { font-variant-numeric: tabular-nums; }
.input[type="datetime-local"], .input[type="date"] { color-scheme: dark; }

.check { display: inline-flex; align-items: center; gap: 9px; cursor: pointer; font-weight: 500; color: var(--text-2); }
.check input { width: 16px; height: 16px; accent-color: var(--gold); }

.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px 18px; }
.form-grid .span-2 { grid-column: 1 / -1; }
@media (max-width: 640px) { .form-grid { grid-template-columns: 1fr; } }

.form-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 20px; }

.filters {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    align-items: flex-end;
    padding: 14px;
    margin-bottom: 16px;
    border: 1px solid var(--hair);
    border-radius: var(--radius-md);
    background: rgba(23, 23, 25, 0.6);
}
.filters .field { width: auto; }
.filters .grow { flex: 1 1 260px; }
.filters .input, .filters .select { min-width: 150px; }

/* ---------- Cards and layout ---------- */

.card {
    background: linear-gradient(145deg, var(--panel-2), #141415);
    border: 1px solid var(--hair);
    border-radius: var(--radius);
    min-width: 0;
}
.card + .card { margin-top: 18px; }
.card.feature { border-color: var(--line); background: radial-gradient(ellipse at top, rgba(216, 182, 106, 0.08), transparent 70%), var(--panel); }
.card-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 16px 20px;
    border-bottom: 1px solid var(--hair);
    flex-wrap: wrap;
}
.card-title { font-size: 16px; letter-spacing: 0.01em; }
.card-sub { color: var(--faint); font-size: 12.5px; margin-top: 3px; font-family: var(--font); }
.card-body { padding: 18px 20px; }
.card-body.flush { padding: 0; }
.card-foot { padding: 12px 20px; border-top: 1px solid var(--hair); }

.grid { display: grid; gap: 18px; align-items: start; }
.grid > .card, .stack > .card { margin-top: 0; }
.grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid-side { grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); }
.stack { display: flex; flex-direction: column; gap: 18px; }
.row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.spacer { flex: 1; }
@media (max-width: 1100px) { .grid-3 { grid-template-columns: repeat(2, minmax(0, 1fr)); } .grid-side { grid-template-columns: 1fr; } }
@media (max-width: 720px) { .grid-2, .grid-3 { grid-template-columns: 1fr; } }

.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(165px, 1fr)); gap: 14px; margin-bottom: 18px; }
.stat {
    display: block;
    position: relative;
    padding: 18px 18px 16px;
    border: 1px solid var(--hair);
    border-radius: var(--radius);
    background: linear-gradient(145deg, var(--panel-2), #141415);
    color: inherit;
    overflow: hidden;
}
a.stat:hover { border-color: var(--line); color: inherit; }
.stat-icon {
    width: 34px;
    height: 34px;
    border-radius: 10px;
    background: var(--gold-soft);
    border: 1px solid var(--line);
    color: var(--gold-light);
    display: grid;
    place-items: center;
    font-size: 16px;
    margin-bottom: 14px;
}
.stat-label { font-size: 10.5px; color: var(--gold); font-weight: 800; letter-spacing: 0.16em; text-transform: uppercase; }
.stat-value { font-size: 26px; font-weight: 700; margin-top: 6px; font-variant-numeric: tabular-nums; letter-spacing: -0.02em; color: var(--text); }
.stat-hint { font-size: 12.5px; color: var(--muted); margin-top: 2px; }
.stat.tone-danger { border-color: rgba(236, 116, 104, 0.45); }
.stat.tone-danger .stat-value { color: var(--danger); }
.stat.tone-warning { border-color: rgba(233, 177, 79, 0.45); }
.stat.tone-warning .stat-value { color: var(--warning); }

.kv { display: grid; grid-template-columns: minmax(110px, 44%) 1fr; gap: 10px 16px; margin: 0; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; min-width: 0; overflow-wrap: anywhere; color: var(--text); }

/* ---------- Tables ---------- */

.table-wrap { overflow-x: auto; }
.table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.table th {
    text-align: left;
    font-size: 10.5px;
    font-weight: 800;
    color: var(--gold);
    text-transform: uppercase;
    letter-spacing: 0.14em;
    padding: 12px 16px;
    border-bottom: 1px solid var(--line);
    background: rgba(13, 13, 14, 0.5);
    white-space: nowrap;
}
.table td { padding: 12px 16px; border-bottom: 1px solid rgba(255, 255, 255, 0.06); vertical-align: middle; color: var(--text-2); }
.table tr:last-child td { border-bottom: none; }
.table tr.clickable { cursor: pointer; }
.table tr.clickable:hover td { background: var(--gold-faint); }
.table .right { text-align: right; }
.cell-main { font-weight: 600; color: var(--text); }
.cell-sub { font-size: 12px; color: var(--faint); }
.person { display: flex; align-items: center; gap: 10px; min-width: 0; }
.amount-credit { color: var(--success); font-weight: 700; }
.amount-debit { color: var(--danger); font-weight: 700; }

.pagination {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 12px 16px;
    border-top: 1px solid var(--hair);
    color: var(--muted);
    font-size: 13px;
    flex-wrap: wrap;
}

/* ---------- Badges ---------- */

.badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    height: 23px;
    padding: 0 10px;
    border-radius: 999px;
    font-size: 11.5px;
    font-weight: 700;
    letter-spacing: 0.02em;
    background: rgba(255, 255, 255, 0.06);
    color: var(--text-2);
    border: 1px solid rgba(255, 255, 255, 0.08);
    white-space: nowrap;
}
.badge::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.badge.plain::before { display: none; }
.badge.success { background: var(--success-soft); color: var(--success); border-color: rgba(108, 198, 143, 0.25); }
.badge.warning { background: var(--warning-soft); color: var(--warning); border-color: rgba(233, 177, 79, 0.28); }
.badge.danger { background: var(--danger-soft); color: var(--danger); border-color: rgba(236, 116, 104, 0.28); }
.badge.info { background: var(--info-soft); color: var(--info); border-color: rgba(125, 184, 224, 0.25); }
.badge.accent { background: var(--gold-soft); color: var(--gold-light); border-color: var(--line); }

/* ---------- Tabs ---------- */

.tabs { display: flex; gap: 6px; border-bottom: 1px solid var(--hair); margin-bottom: 18px; overflow-x: auto; }
.tab {
    background: none;
    border: none;
    border-bottom: 2px solid transparent;
    padding: 10px 14px;
    font: inherit;
    font-weight: 700;
    font-size: 13px;
    color: var(--muted);
    cursor: pointer;
    white-space: nowrap;
}
.tab:hover { color: var(--gold-light); }
.tab.active { color: var(--gold-light); border-bottom-color: var(--gold); }

/* ---------- Alerts and states ---------- */

.alert {
    display: flex;
    gap: 10px;
    align-items: flex-start;
    padding: 14px 16px;
    border-radius: var(--radius-md);
    border: 1px solid var(--line);
    background: linear-gradient(120deg, rgba(216, 182, 106, 0.08), rgba(216, 182, 106, 0.015));
    margin-bottom: 18px;
    color: var(--text-2);
}
.alert.warning { background: var(--warning-soft); border-color: rgba(233, 177, 79, 0.35); }
.alert.danger { background: var(--danger-soft); border-color: rgba(236, 116, 104, 0.35); }
.alert.info { background: var(--info-soft); border-color: rgba(125, 184, 224, 0.3); }
.alert.success { background: var(--success-soft); border-color: rgba(108, 198, 143, 0.3); }
.alert-title { font-weight: 700; color: var(--text); }

.state { padding: 52px 16px; text-align: center; color: var(--muted); }
.state-title { color: var(--text); font-family: var(--display); font-size: 17px; margin-bottom: 6px; }
.state .btn { margin-top: 16px; }

.skeleton {
    height: 14px;
    border-radius: 6px;
    background: linear-gradient(90deg, var(--panel-2), var(--panel-3), var(--panel-2));
    background-size: 200% 100%;
    animation: shimmer 1.2s infinite;
}
.skeleton + .skeleton { margin-top: 12px; }
@keyframes shimmer { from { background-position: 200% 0; } to { background-position: -200% 0; } }

/* ---------- Dialog ---------- */

dialog.modal {
    width: min(580px, calc(100vw - 32px));
    max-height: calc(100vh - 48px);
    padding: 0;
    border: 1px solid var(--line);
    border-radius: 18px;
    background: var(--panel);
    color: var(--text);
    box-shadow: var(--shadow-lg);
}
dialog.modal.wide { width: min(840px, calc(100vw - 32px)); }
dialog.modal::backdrop { background: rgba(5, 5, 6, 0.72); backdrop-filter: blur(3px); }
.modal-form { display: flex; flex-direction: column; max-height: calc(100vh - 48px); }
.modal-head { padding: 20px 22px 0; }
.modal-title { font-size: 19px; }
.modal-desc { color: var(--muted); margin-top: 6px; }
.modal-body { padding: 18px 22px; overflow-y: auto; }
.modal-foot { display: flex; justify-content: flex-end; gap: 10px; padding: 14px 22px; border-top: 1px solid var(--hair); }

.secret {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 14px;
    border-radius: var(--radius-sm);
    background: var(--well);
    border: 1px dashed var(--gold);
    color: var(--gold-light);
    font-family: var(--mono);
    font-size: 15px;
    word-break: break-all;
}

pre.json {
    margin: 0;
    padding: 12px 14px;
    border-radius: var(--radius-sm);
    background: var(--well);
    border: 1px solid var(--hair);
    color: var(--text-2);
    font-family: var(--mono);
    font-size: 12px;
    max-height: 320px;
    overflow: auto;
    white-space: pre-wrap;
    word-break: break-word;
}

/* ---------- Toasts ---------- */

.toasts {
    position: fixed;
    right: 18px;
    bottom: 18px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    z-index: 100;
    max-width: min(440px, calc(100vw - 36px));
}
.toast {
    padding: 12px 16px 12px 14px;
    border-radius: 12px;
    background: #1a1916;
    border: 1px solid var(--line);
    border-left: 3px solid var(--gold);
    color: #e9e1cc;
    box-shadow: var(--shadow);
    font-weight: 500;
}
.toast.danger { border-left-color: var(--danger); border-color: rgba(236, 116, 104, 0.35); }
.toast.success { border-left-color: var(--success); }

/* ---------- Charts ---------- */

.chart { width: 100%; height: 170px; display: block; }
.chart .bar { transition: opacity 0.15s; }
.chart .bar:hover { opacity: 0.75; }
.chart .axis { fill: var(--faint); font-size: 10px; font-family: var(--font); }
.chart .grid-line { stroke: rgba(255, 255, 255, 0.06); stroke-width: 1; }
.chart-empty { padding: 36px 12px; text-align: center; color: var(--faint); font-size: 13px; }

/* Line chart: SVG for the marks (scaled), HTML for text and dots (never distorted). */
.lc { position: relative; }
.lc-plot { position: absolute; left: 44px; right: 12px; top: 8px; bottom: 24px; outline: none; cursor: crosshair; touch-action: pan-y; }
.lc-plot:focus-visible { box-shadow: var(--focus); border-radius: 6px; }
.lc svg { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; }
.lc .grid-line { stroke: rgba(255, 255, 255, 0.07); stroke-width: 1; vector-effect: non-scaling-stroke; }
.lc .lc-line { fill: none; stroke: var(--gold); stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; vector-effect: non-scaling-stroke; }
.lc .lc-area { fill: var(--gold); opacity: 0.1; }
.lc-ytick { position: absolute; left: 0; width: 36px; text-align: right; transform: translateY(-50%); font-size: 10px; color: var(--faint); font-variant-numeric: tabular-nums; }
.lc-xtick { position: absolute; bottom: 0; transform: translateX(-50%); font-size: 10px; color: var(--faint); white-space: nowrap; font-variant-numeric: tabular-nums; }
.lc-xtick.first { transform: none; }
.lc-xtick.last { transform: translateX(-100%); }
.lc-dot { position: absolute; width: 8px; height: 8px; border-radius: 50%; background: var(--gold); box-shadow: 0 0 0 2px var(--panel); transform: translate(-50%, -50%); pointer-events: none; }
.lc-end { position: absolute; transform: translate(-100%, -170%); font-size: 11.5px; font-weight: 700; color: var(--text); white-space: nowrap; pointer-events: none; }
.lc-cross { position: absolute; top: 0; bottom: 0; width: 1px; background: rgba(255, 255, 255, 0.3); pointer-events: none; display: none; }
.lc-hover { display: none; background: var(--gold-light); }
.lc-tip { position: absolute; top: 0; z-index: 2; min-width: 130px; padding: 8px 11px; border-radius: 10px; background: #1f1e1b; border: 1px solid var(--line); box-shadow: var(--shadow); pointer-events: none; display: none; font-size: 12px; color: var(--text-2); }
.lc-tip b { display: block; font-size: 15px; color: var(--text); font-weight: 700; }
.lc-tip .key { display: inline-block; width: 12px; height: 2px; border-radius: 1px; background: var(--gold); vertical-align: middle; margin-right: 6px; }
.lc-tip .muted { color: var(--faint); }
.lc.hovering .lc-cross, .lc.hovering .lc-tip, .lc.hovering .lc-hover { display: block; }
.lc.hovering .lc-end { opacity: 0.25; }

/* Small multiples: one chart per measure, same time axis. */
.multiples { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 18px; }
.multiples .multiple-title { font-size: 12px; font-weight: 700; color: var(--text-2); }
.multiples .multiple-sub { font-size: 11.5px; color: var(--faint); }
@media (max-width: 1100px) { .multiples { grid-template-columns: 1fr; } }
.refetching { opacity: 0.55; transition: opacity 0.2s; pointer-events: none; }

/* ---------- Meters ---------- */

.meters { display: grid; gap: 18px; }
.meter-head { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; margin-bottom: 7px; }
.meter-label { color: var(--text-2); font-weight: 600; }
.meter-value { display: inline-flex; align-items: center; gap: 8px; color: var(--text); font-weight: 700; }
.meter-track { height: 8px; border-radius: 4px; background: rgba(216, 182, 106, 0.14); overflow: hidden; }
.meter-fill { height: 100%; border-radius: 4px; background: var(--gold); }
.meter-warning .meter-track { background: var(--warning-soft); }
.meter-warning .meter-fill { background: var(--warning); }
.meter-danger .meter-track { background: var(--danger-soft); }
.meter-danger .meter-fill { background: var(--danger); }
.meter-hint { font-size: 12px; color: var(--faint); margin-top: 6px; }

.share { display: inline-flex; align-items: center; gap: 8px; min-width: 120px; }
.share .num { white-space: nowrap; }
.share-track { flex: 1; min-width: 60px; height: 6px; border-radius: 3px; background: rgba(216, 182, 106, 0.14); overflow: hidden; }
.share-track span { display: block; height: 100%; border-radius: 3px; background: var(--gold); }
@media (max-width: 720px) {
    .share { min-width: 0; }
    .share-track { min-width: 28px; }
}

/* ---------- Live feed ---------- */

.live {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    height: 34px;
    padding: 0 13px;
    border-radius: 999px;
    border: 1px solid var(--hair-strong);
    color: var(--muted);
    font-size: 12.5px;
    font-weight: 600;
    white-space: nowrap;
}
.live::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--faint); }
.live.on { color: var(--success); border-color: rgba(108, 198, 143, 0.35); }
.live.on::before { background: var(--success); animation: live-pulse 2s infinite; }
.live.wait { color: var(--warning); border-color: rgba(233, 177, 79, 0.35); }
.live.wait::before { background: var(--warning); }
@keyframes live-pulse {
    0% { box-shadow: 0 0 0 0 rgba(108, 198, 143, 0.55); }
    70% { box-shadow: 0 0 0 7px rgba(108, 198, 143, 0); }
    100% { box-shadow: 0 0 0 0 rgba(108, 198, 143, 0); }
}
.table tr.is-new td { animation: row-new 2.6s ease-out; }
@keyframes row-new { from { background: rgba(216, 182, 106, 0.2); } to { background: transparent; } }
.cell-tags { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 4px; }
.headline { font-size: 26px; font-weight: 700; color: var(--text); letter-spacing: -0.02em; line-height: 1.15; }
.headline small { font-size: 13px; font-weight: 600; color: var(--muted); letter-spacing: 0; margin-left: 6px; }
.section-title { font: 700 10.5px var(--font); color: var(--gold); letter-spacing: 0.16em; text-transform: uppercase; margin: 26px 0 12px; }
pre.json.stack { max-height: 360px; }

/* ---------- Numbers board ---------- */

.board { display: grid; grid-template-columns: repeat(10, minmax(0, 1fr)); gap: 5px; }
.board span {
    display: grid;
    place-items: center;
    height: 30px;
    border-radius: 8px;
    background: var(--well);
    border: 1px solid var(--hair);
    color: var(--faint);
    font-size: 12.5px;
    font-variant-numeric: tabular-nums;
}
.board span.on { background: var(--gold); border-color: var(--gold); color: #17130b; font-weight: 800; }
.board span.last { box-shadow: 0 0 0 2px var(--panel), 0 0 0 4px var(--gold-light); }

/* A player's Tambola ticket (3 x 9) with called numbers highlighted, like the board above. */
.ticket { display: grid; grid-template-columns: repeat(9, minmax(0, 1fr)); gap: 4px; }
.ticket span {
    display: grid;
    place-items: center;
    height: 30px;
    border-radius: 6px;
    background: var(--well);
    border: 1px solid var(--hair);
    font-size: 12.5px;
    font-variant-numeric: tabular-nums;
}
.ticket span.blank { background: transparent; border-style: dashed; }
.ticket span.on { background: var(--gold); border-color: var(--gold); color: #17130b; font-weight: 800; }
.ticket span.last { box-shadow: 0 0 0 2px var(--panel), 0 0 0 4px var(--gold-light); }
.ticket-head { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-bottom: 8px; }
.code-match + .code-match { border-top: 1px solid var(--hair); padding-top: 12px; margin-top: 12px; }

/* ---------- Prize rule editor ---------- */

.rule-lines { display: flex; flex-direction: column; gap: 10px; }
.rule-line { display: grid; grid-template-columns: minmax(0, 2fr) minmax(90px, 1fr) minmax(70px, 0.7fr) auto; gap: 10px; align-items: end; }
@media (max-width: 640px) { .rule-line { grid-template-columns: 1fr 1fr; } }

.day-inputs { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 10px; }
@media (max-width: 720px) { .day-inputs { grid-template-columns: repeat(4, minmax(0, 1fr)); } }

/* ---------- Plan cards ---------- */

.plan-card .plan-price { font-family: var(--display); font-size: 26px; color: var(--gold-light); }
.plan-card .plan-price small { font-family: var(--font); font-size: 12.5px; color: var(--muted); }
.plan-card.popular { border-color: var(--line); }

/* ---------- Sign-in ---------- */

.auth-page {
    position: relative;
    min-height: 100vh;
    display: grid;
    place-items: center;
    padding: 32px 16px;
    overflow: hidden;
}
.auth-page::after {
    content: "";
    position: absolute;
    inset: 0;
    pointer-events: none;
    background-image: linear-gradient(rgba(216, 182, 106, 0.035) 1px, transparent 1px), linear-gradient(90deg, rgba(216, 182, 106, 0.035) 1px, transparent 1px);
    background-size: 48px 48px;
    mask-image: linear-gradient(to bottom, black, transparent 80%);
}
.auth-card {
    position: relative;
    z-index: 1;
    width: min(420px, 100%);
    padding: 34px 30px 28px;
    border-radius: 22px;
    border: 1px solid var(--line);
    background: radial-gradient(ellipse at top, rgba(216, 182, 106, 0.1), transparent 70%), #151515;
    box-shadow: var(--shadow-lg);
}
.auth-emblem { display: grid; place-items: center; margin-bottom: 18px; position: relative; height: 120px; }
.auth-emblem::before {
    content: "";
    position: absolute;
    width: 118px;
    height: 118px;
    border-radius: 50%;
    border: 1px solid rgba(216, 182, 106, 0.27);
    box-shadow: 0 0 0 14px rgba(216, 182, 106, 0.025), 0 0 0 30px rgba(216, 182, 106, 0.02);
}
.auth-emblem img { position: relative; width: 104px; height: auto; filter: drop-shadow(0 14px 24px rgba(0, 0, 0, 0.65)); }
.auth-card .eyebrow { justify-content: center; }
.auth-card .eyebrow::before { display: none; }
.auth-card h1 { font-size: 26px; text-align: center; margin: 10px 0 6px; }
.auth-card .lead { text-align: center; color: var(--muted); }
.auth-card form { display: flex; flex-direction: column; gap: 16px; margin-top: 24px; }
.auth-card .btn { height: 42px; }
.auth-foot { margin-top: 20px; font-size: 11.5px; color: var(--faint); text-align: center; }

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