/* ============================================================
   Doudizhu Scoreboard — styles  (matches tangbryan.github.io theme)

   Brand chrome (the violet/cyan gradient) and data colour are kept apart on
   purpose. Seat colours are positional and come from store.js, where they were
   searched rather than chosen; the 地主 gold marks a role, never a person. No
   number on this page is identified by colour alone.
   ============================================================ */

:root {
    --bg: #0b0b0f;
    --bg-elev: #121218;
    --surface: #15151d;
    --surface-2: #1c1c26;
    --border-solid: #272733;
    --text: #f4f4f6;
    --text-dim: #a3a3b2;
    --text-faint: #6b6b7b;

    --accent: #a78bfa;
    --accent-2: #22d3ee;
    --gradient: linear-gradient(115deg, #a78bfa 0%, #22d3ee 55%, #34d399 100%);

    --good: #22b06b;
    --bad: #d9544a;
    --warn: #d9a441;
    --grid: #242430;

    /* the subject's own materials: felt, and the gold of a 地主 seal */
    --felt: #143a2c;
    --felt-rim: #0e2a20;
    --gold: #e8b44a;
    --gold-dim: #8a5f14;

    --font-display: 'Space Grotesk', system-ui, sans-serif;
    --font-sans: 'Inter', system-ui, -apple-system, sans-serif;
    --font-mono: 'JetBrains Mono', ui-monospace, monospace;
    --font-cn: 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', 'Noto Sans SC', var(--font-sans);

    --radius: 16px;
    --radius-sm: 10px;
    --maxw: 1140px;
    --ease: cubic-bezier(0.22, 1, 0.36, 1);
}

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

body {
    background: var(--bg);
    color: var(--text);
    font-family: var(--font-sans);
    font-size: 16px;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    overflow-x: hidden;
    min-height: 100vh;
}

a { color: inherit; text-decoration: none; }
.hidden { display: none !important; }
.muted { color: var(--text-dim); }
.small { font-size: .82rem; }
.good { color: var(--good); }
.bad { color: var(--bad); }

.grad {
    background: var(--gradient);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}

:focus-visible {
    outline: 2px solid var(--accent-2);
    outline-offset: 2px;
    border-radius: 4px;
}

/* ambient background */
.grain {
    position: fixed; inset: 0; z-index: 0; pointer-events: none; opacity: .035;
    background-image: repeating-linear-gradient(0deg, #fff 0 1px, transparent 1px 3px);
}
.glow {
    position: fixed; z-index: 0; pointer-events: none; border-radius: 50%;
    filter: blur(120px); opacity: .16;
}
.glow-1 { width: 460px; height: 460px; background: var(--accent); top: -160px; left: -120px; }
.glow-2 { width: 420px; height: 420px; background: var(--good); bottom: -180px; right: -140px; }

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

.dd-header {
    position: sticky; top: 0; z-index: 20;
    display: flex; align-items: center; gap: 1.25rem; flex-wrap: wrap;
    padding: .9rem clamp(1rem, 4vw, 2.5rem);
    background: rgba(11, 11, 15, .82);
    backdrop-filter: blur(14px);
    border-bottom: 1px solid var(--border-solid);
}
.back-link { color: var(--text-dim); font-size: .88rem; transition: color .2s var(--ease); }
.back-link:hover { color: var(--text); }
.dd-brand { display: flex; align-items: center; gap: .55rem; font-family: var(--font-display); font-weight: 600; }
.dd-logo {
    display: grid; place-items: center;
    width: 28px; height: 28px; border-radius: 7px;
    background: linear-gradient(150deg, var(--gold), #b8862c);
    color: #2a1c05; font-family: var(--font-cn); font-size: .95rem; font-weight: 700;
}
.dd-tabs { display: flex; gap: .25rem; margin-left: auto; background: var(--surface); padding: .25rem; border-radius: 999px; border: 1px solid var(--border-solid); }
.tab {
    border: 0; background: transparent; color: var(--text-dim); cursor: pointer;
    font-family: var(--font-sans); font-size: .86rem; font-weight: 500;
    padding: .42rem 1rem; border-radius: 999px; transition: all .2s var(--ease);
}
.tab:hover { color: var(--text); }
.tab.is-active { background: var(--surface-2); color: var(--text); box-shadow: inset 0 0 0 1px var(--border-solid); }

.dd-main { position: relative; z-index: 1; max-width: var(--maxw); margin: 0 auto; padding: clamp(1rem, 3vw, 2rem) clamp(1rem, 4vw, 2.5rem) 4rem; }
.view { display: flex; flex-direction: column; gap: 1.25rem; }

.dd-footer {
    position: relative; z-index: 1; max-width: var(--maxw); margin: 0 auto;
    padding: 0 clamp(1rem, 4vw, 2.5rem) 3rem; color: var(--text-faint); font-size: .8rem;
}

/* ---------------- panels ---------------- */

.panel {
    background: var(--surface);
    border: 1px solid var(--border-solid);
    border-radius: var(--radius);
    padding: clamp(1rem, 2.5vw, 1.5rem);
}
.panel-head { display: flex; align-items: center; justify-content: space-between; gap: 1rem; margin-bottom: .75rem; }
.panel-title { font-family: var(--font-display); font-size: 1.02rem; font-weight: 600; letter-spacing: -.01em; }
.panel-head .panel-title { margin-bottom: 0; }
.panel > .panel-title { margin-bottom: .5rem; }
.panel-sub { font-weight: 400; color: var(--text-dim); font-size: .86rem; }
.empty { color: var(--text-faint); font-size: .9rem; padding: .75rem 0; }

.play-grid { display: grid; grid-template-columns: minmax(0, 1.3fr) minmax(300px, .7fr); gap: 1.25rem; }
@media (max-width: 900px) { .play-grid { grid-template-columns: 1fr; } }

/* ============================================================
   The table — the one place this page raises its voice.
   ============================================================ */

.table-host { display: block; }
.dd-table { width: 100%; height: auto; display: block; font-family: var(--font-sans); }

.dd-kitty { transition: transform .5s var(--ease); }
.dd-kitty[data-claimed="yes"] { filter: drop-shadow(0 0 9px rgba(232, 180, 74, .35)); }
.dd-kitty-mark { font-family: var(--font-cn); font-size: 17px; font-weight: 700; }

/* seats */
.dd-seat-disc { fill: #1b1b25; }
.dd-seat-ring { fill: none; stroke: var(--seat-color); stroke-width: 2.5; opacity: .9; }
.dd-seat-name { font-size: 15px; font-weight: 500; fill: var(--text); }
.dd-seat-score { font-family: var(--font-mono); font-size: 15px; fill: var(--text-dim); }

/* the seated players */
.dd-fig-body { stroke: rgba(0, 0, 0, .28); stroke-width: 1; }
.dd-figure { transform-box: fill-box; transform-origin: center; }

/* The pose previews with the rest of the draft, but the celebration is earned:
   the hop only runs once the round is actually recorded. */
.dd-seat[data-phase="result"] .dd-figure[data-outcome="win"] { animation: dd-cheer .52s var(--ease) 3; }
@keyframes dd-cheer {
    0%, 100% { transform: translateY(0); }
    40% { transform: translateY(-5px); }
}

/* The loser does not need to be animated to read as beaten — the seat is
   already dimmed, so a small slump is enough. */
.dd-figure[data-outcome="lose"] { transform: translateY(3px); }
.dd-figure[data-outcome="lose"] .dd-eye { transform: scaleY(.45); transform-box: fill-box; transform-origin: center; }

.dd-seat-halo {
    fill: none; stroke: var(--gold); stroke-width: 2; opacity: .5;
    stroke-dasharray: 5 7;
    transform-box: fill-box; transform-origin: center;
    animation: dd-spin 22s linear infinite;
}
@keyframes dd-spin { to { transform: rotate(360deg); } }

.dd-seal rect { fill: #1b1b25; stroke: var(--border-solid); stroke-width: 1; }
.dd-seal text { font-family: var(--font-cn); font-size: 12px; font-weight: 700; fill: var(--text-faint); }
.dd-seal[data-role="landlord"] rect { fill: var(--gold); stroke: #f2cd7e; }
.dd-seal[data-role="landlord"] text { fill: #2a1c05; }

/* the winning side lifts; the losing side recedes */
.dd-seat[data-won="yes"] .dd-seat-disc { fill: #23231f; }
.dd-seat[data-won="yes"] .dd-seat-ring { stroke-width: 3.5; opacity: 1; }
.dd-seat[data-won="no"] { opacity: .5; }
.dd-seat[data-phase="result"][data-won="yes"] .dd-seat-ring { animation: dd-pulse 1.1s var(--ease) 2; }
@keyframes dd-pulse {
    0%, 100% { stroke-width: 3.5; }
    45% { stroke-width: 6.5; }
}

.dd-seat-delta { font-family: var(--font-mono); font-size: 18px; font-weight: 500; }
.dd-seat-delta[data-dir="up"] { fill: var(--good); }
.dd-seat-delta[data-dir="down"] { fill: var(--bad); }
/* Drafting shows the delta flat and dim — it has not happened yet. Recording
   is when it moves. */
.dd-seat[data-phase="draft"] .dd-seat-delta { opacity: .55; }
.dd-seat[data-phase="result"] .dd-seat-delta { animation: dd-float .7s var(--ease) both; }
@keyframes dd-float {
    from { opacity: 0; transform: translateY(14px); }
    to { opacity: 1; transform: translateY(0); }
}

/* the multiplier chain */
.dd-chain-sub { font-size: 15px; fill: var(--text-dim); }
.dd-chain-none { font-family: var(--font-cn); font-size: 26px; font-weight: 600; fill: var(--text-dim); }
.dd-chain-x { font-family: var(--font-mono); font-size: 13px; fill: var(--text-faint); }
.dd-chain-eq { font-family: var(--font-mono); font-size: 16px; fill: var(--text-faint); }
.dd-chain-total { font-family: var(--font-display); font-size: 27px; font-weight: 700; fill: var(--text); }
.dd-chain-capped { font-size: 12px; fill: var(--warn); }

.dd-chip rect { fill: rgba(11, 11, 15, .55); stroke: rgba(255, 255, 255, .14); stroke-width: 1; }
/* No font-size here: it is set inline from the constant table.js measures the
   chip widths with, so the two can never drift apart. */
.dd-chip-label { font-family: var(--font-cn); fill: var(--text-dim); }
.dd-chip-value { font-family: var(--font-mono); fill: var(--text); }
.dd-chip[data-kind="base"] rect { stroke: rgba(167, 139, 250, .5); }
.dd-chip[data-kind="bomb"] rect { fill: rgba(217, 84, 74, .16); stroke: rgba(217, 84, 74, .55); }
.dd-chip[data-kind="bomb"] .dd-chip-label { fill: #f0a49c; }
.dd-chip[data-kind="rocket"] rect { fill: rgba(34, 211, 238, .14); stroke: rgba(34, 211, 238, .5); }
.dd-chip[data-kind="rocket"] .dd-chip-label { fill: #8fe6f5; }
.dd-chip[data-kind="spring"] rect,
.dd-chip[data-kind="antiSpring"] rect { fill: rgba(34, 176, 107, .16); stroke: rgba(34, 176, 107, .55); }
.dd-chip[data-kind="spring"] .dd-chip-label,
.dd-chip[data-kind="antiSpring"] .dd-chip-label { fill: #7bdcac; }

/* On a recorded round the chain assembles left to right, so you read the
   multiplier the way it was earned. */
.dd-chain[data-phase="result"] .dd-chip {
    animation: dd-flip .34s var(--ease) both;
    animation-delay: calc(var(--i) * 90ms);
    transform-box: fill-box; transform-origin: center;
}
@keyframes dd-flip {
    from { opacity: 0; transform: scale(.6) rotateX(70deg); }
    to { opacity: 1; transform: scale(1) rotateX(0); }
}
.dd-chain[data-phase="result"] .dd-chain-total { animation: dd-pop .45s var(--ease) 420ms both; transform-box: fill-box; transform-origin: center; }
@keyframes dd-pop { from { opacity: 0; transform: scale(.5); } to { opacity: 1; transform: scale(1); } }

/* ---------------- the round form ---------------- */

.field { margin-bottom: .9rem; }
.field-label { display: block; font-size: .76rem; text-transform: uppercase; letter-spacing: .07em; color: var(--text-faint); margin-bottom: .4rem; }

.chip-row { display: flex; gap: .4rem; flex-wrap: wrap; }
.chip-row-wrap { gap: .45rem; }

.chip {
    font-family: var(--font-sans); font-size: .86rem; font-weight: 500;
    color: var(--text-dim); cursor: pointer;
    background: var(--surface-2); border: 1px solid var(--border-solid);
    padding: .42rem .85rem; border-radius: 999px;
    transition: all .18s var(--ease);
}
.chip:hover { color: var(--text); border-color: #3a3a4a; }
.chip[data-active="yes"] {
    color: var(--text);
    border-color: var(--chip-color, var(--accent));
    background: color-mix(in srgb, var(--chip-color, var(--accent)) 16%, var(--surface-2));
    box-shadow: inset 0 0 0 1px var(--chip-color, var(--accent));
}
.chip[data-gold="yes"][data-active="yes"] {
    border-color: var(--gold); box-shadow: inset 0 0 0 1px var(--gold);
    background: color-mix(in srgb, var(--gold) 16%, var(--surface-2));
}

.stepper { display: flex; align-items: center; gap: .45rem; flex-wrap: wrap; }
.stepper-value { font-family: var(--font-mono); font-size: 1.05rem; min-width: 1.6rem; text-align: center; }

.stake-readout {
    display: flex; align-items: baseline; gap: .6rem; flex-wrap: wrap;
    margin: 1rem 0 .9rem; padding: .7rem .9rem;
    background: var(--bg-elev); border: 1px solid var(--border-solid); border-radius: var(--radius-sm);
}
.stake-readout.is-ready { border-color: rgba(167, 139, 250, .45); }
.stake-label { font-size: .74rem; text-transform: uppercase; letter-spacing: .07em; color: var(--text-faint); }
.stake-value { font-family: var(--font-display); font-size: 1.5rem; font-weight: 700; }
.stake-note { flex: 1 1 100%; }

.form-actions { display: flex; gap: .5rem; flex-wrap: wrap; margin-top: .5rem; }

/* ---------------- buttons ---------------- */

.btn {
    font-family: var(--font-sans); font-size: .88rem; font-weight: 500;
    color: var(--text); cursor: pointer;
    background: var(--surface-2); border: 1px solid var(--border-solid);
    padding: .5rem 1rem; border-radius: var(--radius-sm);
    transition: all .18s var(--ease);
}
.btn:hover:not(:disabled) { border-color: #3f3f52; background: #23232e; }
.btn:disabled { opacity: .4; cursor: not-allowed; }
.btn-primary { background: var(--accent); border-color: var(--accent); color: #16102b; font-weight: 600; }
.btn-primary:hover:not(:disabled) { background: #b9a1fb; border-color: #b9a1fb; }
.btn-ghost { background: transparent; }
.btn-danger { color: var(--bad); border-color: rgba(217, 84, 74, .35); background: transparent; }
.btn-danger:hover:not(:disabled) { background: rgba(217, 84, 74, .12); border-color: var(--bad); }
.btn-link { background: none; border: none; color: var(--accent); padding: 0; text-decoration: underline; }
.btn-sm { padding: .35rem .75rem; font-size: .82rem; }
.btn-tiny { padding: .25rem .6rem; font-size: .76rem; }
.btn-step { padding: .3rem .7rem; font-family: var(--font-mono); }

.input {
    font-family: var(--font-sans); font-size: .9rem; color: var(--text);
    background: var(--bg-elev); border: 1px solid var(--border-solid);
    padding: .5rem .75rem; border-radius: var(--radius-sm); width: 100%;
}
.input:focus { outline: none; border-color: var(--accent); }
.input-num { width: 6rem; }
.add-row { display: flex; gap: .5rem; margin: .75rem 0 1rem; }
.add-row .input { max-width: 16rem; }

/* ---------------- stats, tables ---------------- */

.stat-strip { display: flex; gap: 1.75rem; flex-wrap: wrap; margin-bottom: 1.1rem; }
.stat { display: flex; flex-direction: column; }
.stat-label { font-size: .72rem; text-transform: uppercase; letter-spacing: .07em; color: var(--text-faint); }
.stat-value { font-family: var(--font-display); font-size: 1.35rem; font-weight: 600; line-height: 1.25; }
.stat-note { font-size: .74rem; color: var(--text-faint); }

.table-scroll { overflow-x: auto; margin: 0 -.4rem; padding: 0 .4rem; }
table.data { width: 100%; border-collapse: collapse; font-size: .87rem; white-space: nowrap; }
table.data th, table.data td { padding: .5rem .6rem; text-align: left; border-bottom: 1px solid var(--grid); }
table.data th { font-size: .72rem; text-transform: uppercase; letter-spacing: .06em; color: var(--text-faint); font-weight: 500; }
table.data td.num, table.data th.num { text-align: right; font-family: var(--font-mono); }
table.data th.num { font-family: var(--font-sans); }
table.data tbody tr:last-child td { border-bottom: 0; }
table.data tbody tr:hover { background: rgba(255, 255, 255, .022); }
table.data .score { font-weight: 500; }
tr.is-redeal td:not(:last-child) { opacity: .55; }
.row-actions { display: flex; gap: .3rem; justify-content: flex-end; }

.dot { display: inline-block; width: 9px; height: 9px; border-radius: 50%; background: var(--c); vertical-align: middle; }
.role-seal {
    display: inline-block; font-family: var(--font-cn); font-size: .68rem; font-weight: 700;
    background: var(--gold); color: #2a1c05; padding: .05rem .3rem; border-radius: 4px; vertical-align: middle;
}
.badge { font-size: .72rem; font-weight: 500; padding: .15rem .55rem; border-radius: 999px; border: 1px solid var(--border-solid); color: var(--text-dim); }
.badge-gold { border-color: rgba(232, 180, 74, .5); color: var(--gold); background: rgba(232, 180, 74, .1); }
.badge-live { border-color: rgba(34, 176, 107, .5); color: var(--good); background: rgba(34, 176, 107, .1); }

.chain-inline { display: inline-flex; gap: .25rem; }
.chain-tag { font-family: var(--font-cn); font-size: .72rem; padding: .05rem .38rem; border-radius: 5px; border: 1px solid var(--border-solid); color: var(--text-dim); }
.chain-tag[data-kind="bomb"] { border-color: rgba(217, 84, 74, .45); color: #f0a49c; }
.chain-tag[data-kind="rocket"] { border-color: rgba(34, 211, 238, .45); color: #8fe6f5; }
.chain-tag[data-kind="spring"], .chain-tag[data-kind="antiSpring"] { border-color: rgba(34, 176, 107, .45); color: #7bdcac; }

.matrix th:first-child { color: var(--text-dim); font-weight: 500; text-transform: none; letter-spacing: 0; font-size: .84rem; }
.matrix tbody th { font-weight: 500; font-size: .87rem; color: var(--text); text-transform: none; letter-spacing: 0; }
.cell-self { color: var(--text-faint); }
.cell-rate { font-weight: 500; }

/* ---------------- chart ---------------- */

.chart-host { margin-top: .25rem; }
.dd-chart-wrap { position: relative; }
.dd-chart { width: 100%; height: auto; display: block; touch-action: pan-y; }
.dd-grid { stroke: var(--grid); stroke-width: 1; }
.dd-axis-zero { stroke: #3a3a4a; stroke-width: 1.25; }
.dd-tick { font-family: var(--font-mono); font-size: 11px; fill: var(--text-faint); }
.dd-series-label { font-family: var(--font-mono); font-size: 12px; font-weight: 500; }
.dd-hair-line { stroke: rgba(255, 255, 255, .28); stroke-width: 1; stroke-dasharray: 3 4; }
.dd-hair { transition: opacity .15s var(--ease); }
.dd-readout {
    display: flex; gap: .9rem; flex-wrap: wrap; align-items: center;
    min-height: 1.4rem; font-size: .8rem; color: var(--text-dim);
}
.dd-readout-round { font-family: var(--font-mono); color: var(--text-faint); }
.dd-readout-item { font-family: var(--font-mono); }
.dd-readout-item::before {
    content: ''; display: inline-block; width: 8px; height: 8px; border-radius: 50%;
    background: var(--c); margin-right: .35rem; vertical-align: middle;
}

/* ---------------- roster ---------------- */

.roster { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: .75rem; }
.roster-card { background: var(--bg-elev); border: 1px solid var(--border-solid); border-radius: var(--radius-sm); padding: .85rem; display: flex; flex-direction: column; gap: .7rem; }
.roster-card.is-archived { opacity: .55; }
.roster-top { display: flex; align-items: center; gap: .6rem; }
.avatar {
    display: grid; place-items: center; width: 36px; height: 36px; border-radius: 50%;
    background: var(--surface-2); border: 1px solid var(--border-solid);
    font-family: var(--font-display); font-weight: 600; font-size: .9rem;
}
.roster-id { display: flex; flex-direction: column; min-width: 0; }
.roster-name { font-weight: 500; }
.roster-stats { display: flex; gap: 1rem; }
.mini-stat { display: flex; flex-direction: column; }
.mini-label { font-size: .68rem; text-transform: uppercase; letter-spacing: .06em; color: var(--text-faint); }
.mini-value { font-family: var(--font-mono); font-size: .92rem; }
.roster-actions { display: flex; gap: .35rem; margin-top: auto; }

/* ---------------- matches ---------------- */

.match-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: .75rem; }
.match-card { background: var(--bg-elev); border: 1px solid var(--border-solid); border-radius: var(--radius-sm); padding: .85rem; display: flex; flex-direction: column; gap: .6rem; }
.match-card[data-status="active"] { border-color: rgba(34, 176, 107, .35); }
.match-head { display: flex; align-items: center; justify-content: space-between; gap: .5rem; }
.match-date { font-weight: 500; font-size: .9rem; }
.match-rows { display: flex; flex-direction: column; gap: .25rem; }
.match-row { display: flex; align-items: center; gap: .5rem; font-size: .87rem; }
.match-row[data-rank="1"] .match-name { font-weight: 600; }
.match-name { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.match-score { font-family: var(--font-mono); }
.match-actions { display: flex; gap: .35rem; margin-top: auto; }

.final-strip { display: flex; flex-direction: column; gap: .4rem; margin-top: .8rem; }
.final-row { display: flex; align-items: center; gap: .55rem; }
.final-name { flex: 1; }
.final-score { font-family: var(--font-mono); font-size: 1.05rem; }

/* ---------------- rules ---------------- */

.rules-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: .9rem; margin-top: .9rem; align-items: start; }
.rules-flags { margin-top: 1.1rem; padding-top: 1.1rem; border-top: 1px solid var(--grid); }
.rule { display: flex; flex-direction: column; gap: .3rem; }

.switch { display: flex; align-items: center; gap: .5rem; cursor: pointer; }
.switch input { position: absolute; opacity: 0; width: 0; height: 0; }
.switch-track {
    position: relative; width: 38px; height: 22px; border-radius: 999px; flex: none;
    background: var(--surface-2); border: 1px solid var(--border-solid); transition: all .18s var(--ease);
}
.switch-thumb {
    position: absolute; top: 2px; left: 2px; width: 16px; height: 16px; border-radius: 50%;
    background: var(--text-faint); transition: all .18s var(--ease);
}
.switch input:checked + .switch-track { background: color-mix(in srgb, var(--accent) 30%, var(--surface-2)); border-color: var(--accent); }
.switch input:checked + .switch-track .switch-thumb { left: 18px; background: var(--accent); }
.switch input:focus-visible + .switch-track { outline: 2px solid var(--accent-2); outline-offset: 2px; }
.switch-label { font-size: .86rem; }

/* ---------------- modal + toast ---------------- */

.modal-root {
    position: fixed; inset: 0; z-index: 60; display: grid; place-items: center;
    background: rgba(6, 6, 10, .72); backdrop-filter: blur(6px); padding: 1rem;
}
.modal-card {
    background: var(--surface); border: 1px solid var(--border-solid); border-radius: var(--radius);
    padding: 1.35rem; width: min(520px, 100%); max-height: 85vh; overflow-y: auto;
    animation: dd-rise .22s var(--ease) both;
}
@keyframes dd-rise { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: none; } }
.modal-title { font-family: var(--font-display); font-size: 1.1rem; font-weight: 600; margin-bottom: .75rem; }
.modal-body { margin-bottom: 1.1rem; }
.modal-form { display: flex; flex-direction: column; gap: .6rem; }
.modal-actions { display: flex; gap: .5rem; justify-content: flex-end; }

.toast {
    position: fixed; left: 50%; bottom: 1.5rem; z-index: 80;
    transform: translate(-50%, 140%);
    background: var(--surface-2); border: 1px solid var(--border-solid); border-radius: 999px;
    padding: .55rem 1.15rem; font-size: .87rem; box-shadow: 0 12px 32px rgba(0, 0, 0, .5);
    transition: transform .3s var(--ease), opacity .3s var(--ease); opacity: 0; pointer-events: none;
}
.toast.is-open { transform: translate(-50%, 0); opacity: 1; }
.toast.bad { border-color: rgba(217, 84, 74, .5); color: #f0a49c; }

/* ---------------- motion ---------------- */

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: .001ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: .001ms !important;
    }
}

@media (max-width: 600px) {
    .dd-tabs { margin-left: 0; width: 100%; justify-content: space-between; }
    .stat-strip { gap: 1.1rem; }
    .panel { padding: .9rem; }
}

/*
 * The table is one SVG scaled to its container, so on a phone every label
 * shrinks with it — at 390px the seat names land around 7px. These sizes are
 * in viewBox units and only apply where the graphic is small, which is why
 * they look oversized in the source and correct on screen. The chain chips are
 * deliberately left alone: their widths are measured in JS.
 */
@media (max-width: 760px) {
    .dd-seat-name { font-size: 25px; }
    .dd-seat-score { font-size: 25px; }
    .dd-seat-delta { font-size: 28px; }
    .dd-seal text { font-size: 15px; }
    .dd-chain-sub { font-size: 24px; }
    .dd-chain-total { font-size: 38px; }
    .dd-chain-none { font-size: 36px; }
    .dd-chain-eq { font-size: 22px; }
    .dd-kitty-mark { font-size: 20px; }
}
