/*
 * Individual scoreboard styles 铭牌版 (nameplate, design C 2.0 「高定镶嵌涂装铭牌」) and 装甲版 (armor, design E 30°
 * 「外切装甲 × 正交内舱」). Drawn by public/js/render-std-plate.js; plan
 * docs/plans/2026-11-21-scoreboard-nameplate-armor-styles.md, design docs/design/scoreboard-nameplate-armor/design.html.
 *
 * Geometry: one 1780 x 209 canvas (bar 64, gap 9, cards 136; fine-tuning 3, owner 2026-11-22: 「卡片好像比旧版要高一点点
 * 可以缩一点点，然后信息条整体粗一点点」, until then bar 54 / cards 146), laid out in canvas px and drawn scaled as a whole by
 * --plate-fit = 192 / 209 about its bottom centre, 48 px above the bottom (owner 2026-11-22: 「缩到和原版一样大」):
 * at 1920 x 1080 about 1635.2 x 192 at y 840-1032, the same top, bottom and centre as 原版's .std-wrapper (1600 x 192,
 * bottom 48 px), 35 px wider; every text is about 8 % smaller with it. Smaller windows multiply a further step
 * (--plate-step, below) into the same scale and keep the 48 px bottom of 原版, so the bottom line always matches and
 * only the height differs there (原版 does not shrink; the plate must, to fit its width). The mobile profile keeps
 * 原版's mobile bottom (24 px). The live app (try-kartdata-live src/board/plate.rs) draws the same box. The top bar has
 * fixed slots (title, round box, pool, leader, track, time); the rail takes the rest, so its length never follows the
 * text (owner 2026-11-21: larger texts, a shorter rail). The round box and the leader badge hug their text inside their
 * slot (fine-tuning 3: no empty dark tail after 「剩 17 图」 or 「领先+40」). The round box, the pool and the leader badge
 * are sized for the longest texts of the match's own format (data-format, StdPlateModel.slotFormat), which does not
 * change during a match. The pool is bound to the rail's start line (fine-tuning 3c), so the round box's slack sits
 * between the box and the pool. The track name is right-aligned next to the time (3c), which keeps its place at the
 * right end. A slot only grows (and the rail gives
 * way) for a text wider than every known one of its format. The track name never moves the rail: its slot is fixed and
 * a wider name shrinks (owner 2026-11-22, replacing his earlier 「赛道名不能伸缩」: 「…再长就赛道字号缩小就好了，这样进度条
 * 可以再长一点点」); the title shrinks too (render-std-plate.js); neither is ever cut.
 *
 * Motion animates transform and opacity only; shadows sit on static layers.
 */

/*
 * Fonts. The mockup's PingFang SC / DIN Alternate exist only on Apple devices; OB PCs run Windows, so the plates ship
 * their own free fonts (scripts/build-plate-fonts.py; licences public/fonts/plate/OFL-*.txt, both SIL OFL 1.1):
 * - Noto Sans SC cut to Latin + GB2312 + kana + the track library. For weight 900 (names, title, track) every other CJK
 *   character is in an extra slice declared first: faces are tried in reverse order, so the base face wins for every
 *   character it has and the slice is fetched only for one it lacks.
 * - Plate DIN Tab: D-DIN with tabular digits (renamed, as the OFL asks of a modified D-DIN), so numbers keep their
 *   width while they change.
 */
@font-face {
    font-family: 'Plate Noto Sans SC';
    src: url('../fonts/plate/noto-sans-sc-900-ext.woff2?v=0f38c42f49806f77') format('woff2');
    font-weight: 900;
    font-display: swap;
    unicode-range: U+2E80-2FDF, U+3400-4DBF, U+4E00-9FFF, U+F900-FAFF, U+20000-3134F;
}

@font-face {
    font-family: 'Plate Noto Sans SC';
    src: url('../fonts/plate/noto-sans-sc-700.woff2?v=bc63f5e828f029e5') format('woff2');
    font-weight: 700;
    font-display: swap;
}

@font-face {
    font-family: 'Plate Noto Sans SC';
    src: url('../fonts/plate/noto-sans-sc-900.woff2?v=22965f42dcabdc87') format('woff2');
    font-weight: 900;
    font-display: swap;
}

@font-face {
    font-family: 'Plate DIN Tab';
    src: url('../fonts/plate/plate-din-tab-700.woff2?v=c86ae552c7b68655') format('woff2');
    font-weight: 700;
    font-display: swap;
}

.plate-wrapper {
    /* THE font choice of both styles (one line each; candidates and the comparison: plan §7). The plates use the
       weights 700 and 900 only (800 resolves to the 900 Chinese and the 700 number face). Chinese inside a number
       element (「22 / 35 图」, 「领跑 349分」) falls through to the Chinese face. */
    --plate-font-ui: 'Plate Noto Sans SC', 'Microsoft YaHei', 'PingFang SC', sans-serif;
    --plate-font-num: 'Plate DIN Tab', 'Plate Noto Sans SC', 'Bahnschrift', 'Microsoft YaHei', sans-serif;
    --plate-ink-950: #0B0F17;
    --plate-ink-900: #151B27;
    --plate-ink-700: #374357;
    --plate-ink-500: #647185;
    --plate-gold: #E5A924;
    --plate-gold-bright: #F7CA49;
    /* Delta tag inks on its stone (WCAG contrast on #F1F4F9): plus 5.0, minus 4.5, zero 4.9. The design's #0B8743
       (4.2) and #8C99AC (2.6) read too faint on a stream, so both are a little deeper. */
    --plate-plus-ink: #08793C;
    --plate-minus-ink: #D91E3A;
    --plate-zero-ink: #5E6B7E;
    --plate-zero-bar: #B8C4D4;
    --plate-delta-stone: #F1F4F9;

    /* Top-bar slots at the sizes of fine-tuning 3 (plan §5; measured in Chromium with the bundled fonts, canvas px).
       Round box, pool and leader badge: the longest texts of the match format (below; the default is the 35-map 千分
       match, 'k1000'): round box 「第 1 / 99 图 | 第1局进行中」 241.5, pool 「1000 / 1000」 116.5, leader 「领跑 999分 ·
       领先+999」 238.7 (装甲版 240.7). Track: 「工厂未完成的第五区」 225 at 25 px / 900 plus 9 (the owner: 「理论上最长的
       应该是工厂 未完成的第五区…留一点点余量，再长就赛道字号缩小就好了」); 42 of the 382 library names are wider and shrink in
       half-px steps (render-std-plate.js fitTrack; the longest, 「[奔跑车手]龙行华夏 龙之都市」, to 17.5 px). Time
       「99:59.999」 102.6. Title: 300 px at 26 px, shrinking to 13 px. */
    --plate-title-slot: 300px;
    --plate-round-slot: 244px;
    --plate-pool-slot: 120px;
    --plate-end-slot: 243px;
    --plate-track-slot: 234px;
    --plate-time-slot: 115px;

    /* The whole-board scale: 原版's height (192 px) over the design's 209 px, times the small-window step. */
    --plate-step: 1;
    --plate-fit: calc(var(--plate-step) * 192 / 209);

    display: none;
    position: absolute;
    left: 50%;
    bottom: 48px;
    z-index: 20;
    width: 1780px;
    flex-direction: column;
    gap: 9px;
    transform: translateX(-50%) scale(var(--plate-fit));
    transform-origin: center bottom;
    font-family: var(--plate-font-ui);
    color: var(--plate-ink-950);
    -webkit-font-smoothing: antialiased;
    user-select: none;
}

body[data-mode="individual"][data-scoreboard-style="nameplate"] .plate-wrapper,
body[data-mode="individual"][data-scoreboard-style="armor"] .plate-wrapper {
    display: flex;
}

/* The other match formats (StdPlateModel.slotFormat). 本场总图数 other than 35: the pool is 「全场总分」 (64; 「9999」
   48.3). 本场总分数 only: round box 「已完成 99 图 | 赛点白热化」 243.7, leader 「终点 999分 · 距终点 999分」 268.9
   (装甲版 270.9). Both: the round box counts maps, the leader badge points. Neither: round box 「第 1 图 | 第1局进行中」
   201.3. The format never changes during a match, so the rail keeps one length. */
.plate-wrapper[data-format="maps"] { --plate-pool-slot: 68px; }
.plate-wrapper[data-format="points"] { --plate-round-slot: 246px; --plate-pool-slot: 68px; --plate-end-slot: 273px; }
.plate-wrapper[data-format="both"] { --plate-pool-slot: 68px; --plate-end-slot: 273px; }
.plate-wrapper[data-format="neither"] { --plate-round-slot: 204px; --plate-pool-slot: 68px; }

/* The first paint waits (hidden) for the plate fonts, at most 1.2 s (render-std-plate.js primeFonts). */
.plate-wrapper.is-fonts-pending {
    visibility: hidden;
}

body[data-mode="individual"][data-scoreboard-style="nameplate"] .std-wrapper,
body[data-mode="individual"][data-scoreboard-style="armor"] .std-wrapper {
    display: none;
}

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

/* Plate DIN Tab has tabular digits built in; no kerning may move them (a rolling total keeps its width). */
.plate-wrapper .num {
    font-family: var(--plate-font-num);
    font-variant-numeric: lining-nums tabular-nums;
    font-feature-settings: "lnum" 1, "tnum" 1;
    font-kerning: none;
}

/* ---------------------------------------------------------------- top bar */

.plate-axis {
    position: relative;
    height: 64px;
    flex-shrink: 0;
}

.plate-axis-shade {
    display: none;
}

.plate-axis-bar {
    position: relative;
    height: 64px;
    padding: 0 18px;
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.96);
    border: 1px solid rgba(15, 23, 42, 0.11);
    box-shadow: 0 12px 30px rgba(11, 15, 23, 0.24);
    display: flex;
    align-items: center;
    gap: 16px;
}

.plate-checker {
    width: 16px;
    height: 16px;
    border-radius: 4px;
    background: conic-gradient(#11151E 90deg, #FFFFFF 90deg 180deg, #11151E 180deg 270deg, #FFFFFF 270deg) 0 0 / 8px 8px;
    border: 1px solid rgba(15, 23, 42, 0.24);
    flex-shrink: 0;
}

.plate-checker.is-small {
    width: 12px;
    height: 12px;
    border-radius: 2px;
    background-size: 6px 6px;
}

.plate-axis-left {
    display: flex;
    align-items: center;
    gap: 11px;
    flex: 0 0 auto;
}

.plate-title-slot {
    display: flex;
    align-items: center;
    flex: 0 0 auto;
    min-width: var(--plate-title-slot);
}

.plate-title {
    font-size: 26px;
    font-weight: 900;
    line-height: 1.2;
    color: var(--plate-ink-950);
    white-space: pre;
}

/* The round box and the pool. The slot is fixed (the format's room), so the rail keeps its length (fine-tuning 3b). The
   box hugs its text at the left; the pool sits at the right, bound to the rail's start line (owner 2026-11-22
   「千分池进度可以跟起跑线的部分绑定。留空没关系」): it ends at the bar's 16 px gap before the start gate whatever the texts,
   and the round box's spare room sits between the box and the pool (3b had the pool follow the box). */
.plate-progress-slot {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    flex: 0 0 auto;
    min-width: calc(var(--plate-round-slot) + 16px + var(--plate-pool-slot));
}

/* The round box shows its texts only (fine-tuning 3d, owner 2026-11-22 「去掉局数框里的进度线吧 就只留文字就好了」: no
   progress line, which was a 3 px edge line until 3c and a 5.5 px gold line in 3c). */
.plate-round-box {
    flex: 0 0 auto;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 4px 11px;
    border-radius: 8px;
    background: var(--plate-ink-900);
    color: #FFFFFF;
}

.plate-round-box[data-phase="in_progress"] { background: #0284C7; }
.plate-round-box[data-phase="waiting"] { background: #334155; }

.plate-round-main {
    font-size: 21px;
    font-weight: 800;
    color: var(--plate-gold-bright);
    white-space: nowrap;
}

.plate-round-box[data-phase="in_progress"] .plate-round-main,
.plate-round-box[data-phase="waiting"] .plate-round-main { color: #FFFFFF; }

.plate-round-sub {
    padding-left: 7px;
    border-left: 1px solid rgba(255, 255, 255, 0.22);
    font-size: 18px;
    font-weight: 700;
    color: #E2E8F0;
    white-space: nowrap;
}

.plate-round-sub:empty { display: none; }
.plate-round-sub.is-final { color: #FCA5A5; font-weight: 900; }

.plate-track-zone {
    flex: 1 1 auto;
    min-width: 0;
    display: flex;
    align-items: center;
    gap: 11px;
}

/* Both lines end at the same place, the rail's start line side (fine-tuning 3c). */
.plate-pool {
    flex: 0 0 auto;
    display: inline-flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 2px;
    line-height: 1.1;
}

/* Legibility (owner 2026-11-21 「整体文字看着吃力」, then 「信息栏的字还能不能稍微再大一点」; fine-tuning 3 「千分池 1000分数那里
   可以再优化一下 有点密集。有点小」): the label 16 px in a darker ink (10.0:1 on the bar) over the value 23 px, with
   room between the two lines (until then 13 / 18 px at line-height 1.05, no gap). */
.plate-pool-k { font-size: 16px; font-weight: 700; color: var(--plate-ink-700); white-space: nowrap; }
.plate-pool-v { font-size: 23px; font-weight: 700; color: var(--plate-ink-900); white-space: nowrap; }

.plate-rail {
    position: relative;
    flex: 1 1 auto;
    min-width: 120px;
    height: 10px;
    border-radius: 999px;
    background: linear-gradient(90deg, #E5EAF1 0%, #D4DDE8 76%, #FDE8A7 100%);
    box-shadow: inset 0 1px 2px rgba(15, 23, 42, 0.12);
}

/* Quarter ticks while the race runs. */
.plate-rail::before {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: 999px;
    background: linear-gradient(90deg,
        transparent 24.8%, rgba(15, 23, 42, 0.16) 24.8%, rgba(15, 23, 42, 0.16) 25.1%, transparent 25.1%,
        transparent 49.8%, rgba(15, 23, 42, 0.16) 49.8%, rgba(15, 23, 42, 0.16) 50.1%, transparent 50.1%,
        transparent 74.8%, rgba(15, 23, 42, 0.16) 74.8%, rgba(15, 23, 42, 0.16) 75.1%, transparent 75.1%);
    transition: opacity 0.3s ease;
}

.plate-rail.is-starting-line::before { opacity: 0.25; }

/* Checkered start gate: at the far left while racing, in front of the 2 x 4 starting grid before round 1. */
.plate-start-gate {
    position: absolute;
    left: 0;
    top: 50%;
    z-index: 2;
    width: 6px;
    height: 28px;
    margin-top: -14px;
    border-radius: 3px;
    background: repeating-linear-gradient(180deg, #11151E 0 4px, #FFFFFF 4px 8px);
    border: 1px solid rgba(15, 23, 42, 0.38);
    transition: transform 0.45s cubic-bezier(0.22, 1, 0.36, 1);
}

.plate-rail.is-starting-line .plate-start-gate { transform: translateX(var(--plate-gate-x, 72px)); }

/* Beads: placed by transform (--x / --y set by render-std-plate.js from the rail's own width), sized by scale. */
.plate-bead {
    position: absolute;
    left: 0;
    top: 0;
    z-index: var(--z, 5);
    width: 26px;
    height: 26px;
    border-radius: 999px;
    background: var(--p-color);
    color: var(--paint-ink);
    border: 2.5px solid #FFFFFF;
    box-shadow: 0 3px 10px rgba(11, 15, 23, 0.30);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    font-weight: 800;
    line-height: 1;
    transform: translate3d(var(--x, 0px), var(--y, 5px), 0) translate(-50%, -50%) scale(calc(var(--bead-scale, 1) * var(--bead-surge, 1)));
    transition: transform 0.95s cubic-bezier(0.22, 1, 0.36, 1);
    will-change: transform;
}

.plate-bead::before {
    content: '';
    position: absolute;
    inset: -3px;
    border-radius: inherit;
    box-shadow: -10px 0 14px var(--p-glow, transparent);
    opacity: 0;
    transition: opacity 0.25s ease;
    pointer-events: none;
}

.plate-bead.is-grid-start { --bead-scale: 0.577; font-size: 0; }
.plate-bead.is-surging { --bead-surge: 1.16; }
/* A bead in a lane (a crowd, std-plate-model.js buildRailLayout) glows on a big gain but keeps its size: its neighbours
   are closer. A bead on the rail grows and may touch a neighbour's rim, never its number. */
.plate-bead.is-surging.is-lane { --bead-surge: 1; }
.plate-bead.is-surging::before { opacity: 1; }

.plate-bead.rank-1 {
    --bead-scale: 1.192;
    border-color: var(--plate-gold);
    box-shadow: 0 0 0 2px #FFFFFF, 0 4px 14px rgba(229, 169, 36, 0.55);
}

.plate-bead.is-light { background: #FFFFFF; color: #0B0F17; border-color: #64748B; }
.plate-bead.is-dark { background: #141821; color: #FFFFFF; border-color: #FFFFFF; }
.plate-bead.rank-1.is-light,
.plate-bead.rank-1.is-dark { border-color: var(--plate-gold); }

/* The leader badge's slot: fixed, so the rail keeps its length; the badge itself hugs its text (fine-tuning 3). */
.plate-end-slot {
    display: flex;
    align-items: center;
    flex: 0 0 auto;
    min-width: var(--plate-end-slot);
}

.plate-end-badge {
    flex: 0 0 auto;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 10px;
    border-radius: 7px;
    background: var(--plate-ink-900);
    color: #FFFFFF;
    font-size: 19px;
    font-weight: 700;
    white-space: nowrap;
}

.plate-end-gap { color: var(--plate-gold-bright); font-size: 18.5px; }
.plate-end-gap:empty { display: none; }

.plate-axis-right {
    display: flex;
    align-items: center;
    gap: 12px;
    flex: 0 0 auto;
    padding-left: 14px;
    border-left: 1px solid rgba(15, 23, 42, 0.12);
}

/* The track name, right-aligned next to the time (owner 2026-11-22 「赛道名字部分需要右对齐，左对齐如果只有5个字或者几个字看起来就
   有点太空了，右对齐最快时间那里会好一些」; the slot's rest sits after the rule; 3b had it left-aligned). The slot never
   changes, so the rail never follows the track: a wider name shrinks in half-px steps until it fits (render-std-plate.js
   fitTrack), never cut (owner 2026-11-22; until then the name kept its size and widened the slot). */
.plate-map {
    flex: 0 0 auto;
    width: var(--plate-track-slot);
    font-size: 25px;
    font-weight: 900;
    line-height: 1.2;
    color: var(--plate-ink-950);
    text-align: right;
    white-space: pre;
}

.plate-time {
    flex: 0 0 auto;
    min-width: var(--plate-time-slot);
    font-size: 25px;
    font-weight: 700;
    color: #0F52BA;
    text-align: right;
    white-space: nowrap;
}

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

.plate-deck {
    position: relative;
    width: 100%;
    height: 136px;
    display: grid;
    grid-template-columns: repeat(var(--plate-columns, 8), minmax(0, 1fr));
    gap: 8px;
}

.plate-card {
    position: relative;
    height: 100%;
    min-width: 0;
    will-change: transform;
}

.plate-card-lift {
    position: absolute;
    inset: 6px 4px 0;
    z-index: -1;
    border-radius: 15px;
    box-shadow: 0 26px 42px rgba(229, 169, 36, 0.44);
    opacity: 0;
    pointer-events: none;
}

.plate-card-body {
    position: relative;
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    overflow: hidden;
}

.plate-card-glint {
    position: absolute;
    inset: 0;
    z-index: 16;
    opacity: 0;
    background: linear-gradient(110deg, transparent 20%, rgba(247, 202, 73, 0.40) 48%, transparent 76%);
    transform: translateX(-125%);
    pointer-events: none;
}

.plate-card-top {
    position: relative;
    display: flex;
    align-items: center;
    min-width: 0;
    flex-shrink: 0;
}

.plate-card-rank {
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}

.plate-card-name {
    /* 2 px below the band centre: the owner saw the name sit higher than the rank (2026-11-21); this puts both on
       one line to the eye (plan §8; 3x crops in the report). `top` moves the glyphs only, never the fit. */
    position: relative;
    top: 2px;
    display: block;
    flex: 1;
    min-width: 0;
    font-weight: 900;
    /* Tall enough for Latin descenders (g, j, y) under Noto Sans SC's metrics: the box clips (overflow: hidden for
       the ellipsis); the box is centred in the band, so the baseline stays where it was. */
    line-height: 1.42;
    color: var(--paint-ink);
    white-space: pre;
    overflow: hidden;
    text-overflow: ellipsis;
}

.plate-card-bot {
    flex: 1;
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 6px;
    min-width: 0;
}

.plate-score {
    display: inline-block;
    position: relative;
    font-size: 68px;
    font-weight: 700;
    letter-spacing: -0.025em;
    line-height: 0.86;
    color: var(--plate-ink-950);
    vertical-align: bottom;
    white-space: nowrap;
}

.plate-score.score-wide { font-size: 59px; }
.plate-score.score-xwide { font-size: 46px; }

/* Delta: the design's 「竖杠石纹微标」 (accent) style, chosen by the owner on 2026-11-21: a recessed stone tag with a
   3.5 px bar in the sign's colour on its left, the sign and number in that colour (no arrow). */
.plate-delta {
    position: relative;
    flex-shrink: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 3px;
    padding: 5px 9px 5px 10px;
    overflow: hidden;
    border-radius: 6px;
    background: var(--plate-delta-stone);
    font-family: var(--plate-font-num);
    font-variant-numeric: lining-nums tabular-nums;
    font-size: 22px;
    font-weight: 700;
    letter-spacing: 0;
    font-kerning: none;
    line-height: 1;
}

.plate-delta::before {
    content: '';
    position: absolute;
    left: 0;
    top: 4px;
    bottom: 4px;
    width: 3.5px;
    border-radius: 999px;
}

.plate-delta.plus { color: var(--plate-plus-ink); }
.plate-delta.plus::before { background: var(--plate-plus-ink); }
.plate-delta.minus { color: var(--plate-minus-ink); }
.plate-delta.minus::before { background: var(--plate-minus-ink); }
.plate-delta.zero { color: var(--plate-zero-ink); }
.plate-delta.zero::before { background: var(--plate-zero-bar); }


body[data-scoreboard-style="armor"] .plate-delta { border-radius: 4px; }

.plate-wrapper[data-show-diff="off"] .plate-delta,
.plate-wrapper[data-pre-race="on"] .plate-delta {
    display: none;
}

/* ---------------------------------------------------------------- 铭牌版 (C 2.0) */

body[data-scoreboard-style="nameplate"] .plate-card-body {
    padding: 6px 6px 12px 6px;
    border-radius: 15px;
    background: linear-gradient(180deg, #FFFFFF 0%, #F5F7FA 100%);
    border: 1px solid rgba(15, 23, 42, 0.11);
    box-shadow: 0 14px 32px rgba(11, 15, 23, 0.26), inset 0 1px 0 #FFFFFF;
}

body[data-scoreboard-style="nameplate"] .plate-card-body::after {
    content: '';
    position: absolute;
    left: 14px;
    right: 14px;
    bottom: 4px;
    height: 4px;
    border-radius: 999px;
    background: var(--p-color);
    opacity: 0.85;
}

body[data-scoreboard-style="nameplate"] .plate-card.is-light .plate-card-body::after { background: #94A3B8; opacity: 0.72; }
body[data-scoreboard-style="nameplate"] .plate-card.is-dark .plate-card-body::after { background: #141821; opacity: 0.92; }

body[data-scoreboard-style="nameplate"] .plate-card-top {
    height: 46px;
    padding: 0 10px 0 8px;
    gap: 8px;
    border-radius: 10px;
    background:
        linear-gradient(168deg, rgba(255, 255, 255, 0.30) 0%, rgba(255, 255, 255, 0.04) 48%, rgba(0, 0, 0, 0.12) 100%),
        var(--p-color);
    box-shadow: 0 4px 12px var(--p-shadow), inset 0 1px 0 rgba(255, 255, 255, 0.38);
}

body[data-scoreboard-style="nameplate"] .plate-card.is-light .plate-card-top {
    background: linear-gradient(160deg, #FFFFFF 0%, #F1F5F9 58%, #E2E8F0 100%);
    border: 1.5px solid #8A99AE;
    box-shadow: 0 3px 10px rgba(15, 23, 42, 0.10), inset 0 1px 0 #FFFFFF;
}

body[data-scoreboard-style="nameplate"] .plate-card.is-dark .plate-card-top {
    background: linear-gradient(148deg, #323A4A 0%, #161B26 52%, #0B0E15 100%);
    box-shadow: 0 4px 12px rgba(11, 15, 23, 0.34), inset 0 1px 0 rgba(255, 255, 255, 0.22);
}

body[data-scoreboard-style="nameplate"] .plate-card-rank {
    width: 28px;
    height: 28px;
    border-radius: 7px;
    background: rgba(11, 15, 23, 0.84);
    color: #FFFFFF;
    font-size: 18px;
    font-weight: 800;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.18);
}

/* A very dark plate (black, or a deep colour such as navy) gets the white rank square, so it stands out from the band. */
body[data-scoreboard-style="nameplate"] .plate-card.is-dark .plate-card-rank,
body[data-scoreboard-style="nameplate"] .plate-card.is-deep .plate-card-rank { background: #FFFFFF; color: #0B0F17; }
body[data-scoreboard-style="nameplate"] .plate-card.is-unranked .plate-card-rank { opacity: 0.72; font-size: 16px; }

/* Names about 10 % larger in fine-tuning 3 (「选手名字的部分 也可以字条稍微大一点点」; until then 25 / 22 / 19 px). */
body[data-scoreboard-style="nameplate"] .plate-card-name { font-size: 27.5px; }
body[data-scoreboard-style="nameplate"] .plate-wrapper[data-name-tier="4"] .plate-card-name { font-size: 24px; }
body[data-scoreboard-style="nameplate"] .plate-wrapper[data-name-tier="5"] .plate-card-name { font-size: 21px; }

/* 4 px above the total (8 px until the 136 px cards): the total keeps its size and its place at the bottom. */
body[data-scoreboard-style="nameplate"] .plate-card-bot { padding: 4px 10px 4px 10px; }

/* ---------------------------------------------------------------- 装甲版 (E 30°) */

/* The bar's drop shadow is drawn once by a static layer of the same 30° shape; the bar itself only clips. */
body[data-scoreboard-style="armor"] .plate-axis-shade {
    display: block;
    position: absolute;
    inset: 0;
    filter: drop-shadow(0 10px 24px rgba(11, 15, 23, 0.24));
    pointer-events: none;
}

body[data-scoreboard-style="armor"] .plate-axis-shade::before {
    content: '';
    position: absolute;
    inset: 0;
    background: rgba(255, 255, 255, 0.96);
    clip-path: polygon(0 0, calc(100% - 17.3px) 0, 100% 30px, 100% 100%, 17.3px 100%, 0 calc(100% - 30px));
}

body[data-scoreboard-style="armor"] .plate-axis-bar {
    padding: 0 26px;
    border: none;
    border-radius: 0;
    background: transparent;
    box-shadow: none;
    clip-path: polygon(0 0, calc(100% - 17.3px) 0, 100% 30px, 100% 100%, 17.3px 100%, 0 calc(100% - 30px));
}

body[data-scoreboard-style="armor"] .plate-round-box,
body[data-scoreboard-style="armor"] .plate-end-badge {
    height: 34px;
    padding: 0 11px;
    border-radius: 4px;
}

/* The card's shadow follows its 30° cuts (drop-shadow on the moving card layer; the deck itself has no filter). */
body[data-scoreboard-style="armor"] .plate-card {
    filter: drop-shadow(0 14px 26px rgba(11, 15, 23, 0.30));
}

body[data-scoreboard-style="armor"] .plate-card-lift { border-radius: 0; }

body[data-scoreboard-style="armor"] .plate-card-body {
    padding: 5px 5px 13px 5px;
    background: linear-gradient(176deg, #FFFFFF 0%, #F5F7FA 72%, #EDF1F7 100%);
    clip-path: polygon(0 0, calc(100% - 16.2px) 0, 100% 28px, 100% 100%, 16.2px 100%, 0 calc(100% - 28px));
}

body[data-scoreboard-style="armor"] .plate-card-body::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 16.2px;
    z-index: 4;
    height: 1.5px;
    background: rgba(255, 255, 255, 0.95);
    pointer-events: none;
}

/* The player's colour strip at the bottom: 9 px (5 px until 2026-11-21; the owner's reference is about 8 px). */
body[data-scoreboard-style="armor"] .plate-card-body::after {
    content: '';
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    height: 9px;
    background: var(--p-color);
    opacity: 0.92;
}

body[data-scoreboard-style="armor"] .plate-card.is-light .plate-card-body::after { background: #94A3B8; opacity: 0.72; }
body[data-scoreboard-style="armor"] .plate-card.is-dark .plate-card-body::after { background: #141821; }

/* The band is the card's own white with a hairline below; only the rank sits on the player's colour, in a tab whose
   right edge slants like the card's cuts (top 58 px, bottom 76 px wide: the owner's reference of 2026-11-21). The
   name is black for every player. */
body[data-scoreboard-style="armor"] .plate-card-top {
    height: 48px;
    padding: 0 18px 0 0;
    gap: 10px;
    background: #FFFFFF;
    box-shadow: inset 0 -1px 0 rgba(15, 23, 42, 0.08);
}

body[data-scoreboard-style="armor"] .plate-card-rank {
    position: relative;
    align-self: stretch;
    width: 76px;
    padding-right: 18px;
    background:
        linear-gradient(168deg, rgba(255, 255, 255, 0.28) 0%, rgba(255, 255, 255, 0.04) 48%, rgba(0, 0, 0, 0.12) 100%),
        var(--p-color);
    clip-path: polygon(0 0, 58px 0, 100% 100%, 0 100%);
    color: var(--paint-ink);
    font-size: 28px;
    font-weight: 800;
    line-height: 1;
}

/* White or silver paint: a light tab with a grey slanted edge (as in the reference). */
body[data-scoreboard-style="armor"] .plate-card.is-light .plate-card-rank {
    background: linear-gradient(160deg, #FFFFFF 0%, #EEF2F7 65%, #E2E8F0 100%);
}

body[data-scoreboard-style="armor"] .plate-card.is-light .plate-card-rank::after {
    content: '';
    position: absolute;
    inset: 0;
    background: #8A99AE;
    clip-path: polygon(55.5px 0, 58px 0, 100% 100%, calc(100% - 2.5px) 100%);
    pointer-events: none;
}

body[data-scoreboard-style="armor"] .plate-card.is-dark .plate-card-rank {
    background: linear-gradient(148deg, #323A4A 0%, #161B26 52%, #0B0E15 100%);
}

body[data-scoreboard-style="armor"] .plate-card.is-unranked .plate-card-rank { font-size: 22px; }
body[data-scoreboard-style="armor"] .plate-card.is-unranked .plate-card-rank-num { opacity: 0.65; }

/* Names about 10 % larger in fine-tuning 3 (until then 28 / 25 / 21 px). */
body[data-scoreboard-style="armor"] .plate-card-name { color: var(--plate-ink-950); font-size: 31px; }
body[data-scoreboard-style="armor"] .plate-wrapper[data-name-tier="4"] .plate-card-name { font-size: 27.5px; }
body[data-scoreboard-style="armor"] .plate-wrapper[data-name-tier="5"] .plate-card-name { font-size: 23px; }

body[data-scoreboard-style="armor"] .plate-card-bot { padding: 4px 10px 4px 12px; }

/* ---------------------------------------------------------------- motion 1 (round updates only) */

/* Delta springs in. */
.plate-delta.anim-pop {
    animation: plateDiffPop 380ms cubic-bezier(0.34, 1.56, 0.64, 1) both;
}

@keyframes plateDiffPop {
    0% { opacity: 0; transform: scale(0.55) translateY(8px); }
    100% { opacity: 1; transform: scale(1) translateY(0); }
}

/* The round winner's card gets one glint. */
.plate-card.anim-glint .plate-card-glint {
    animation: plateGlint 760ms cubic-bezier(0.22, 1, 0.36, 1) forwards;
}

@keyframes plateGlint {
    0% { transform: translateX(-125%); opacity: 0.9; }
    100% { transform: translateX(135%); opacity: 0; }
}

/* Mechanical flip counter: old total rolls up and out, new total rolls in. */
.plate-score.is-rolling {
    height: 0.88em;
    overflow: hidden;
}

.plate-score-track {
    display: flex;
    flex-direction: column;
    animation: plateDrumRoll 480ms cubic-bezier(0.22, 1.18, 0.36, 1) forwards;
}

.plate-score-old,
.plate-score-new {
    display: block;
    height: 0.88em;
    line-height: 0.86;
}

.plate-score-new { color: #0F52BA; }

@keyframes plateDrumRoll {
    0% { transform: translateY(0); }
    100% { transform: translateY(-50%); }
}

/* Lifted arc overtake (the transform itself is driven by render-std-plate.js). */
.plate-card.anim-arc-up { z-index: 14; }
.plate-card.anim-arc-down { z-index: 4; }

.plate-card.anim-arc-up .plate-card-lift {
    animation: plateLiftGlow 720ms cubic-bezier(0.22, 1, 0.36, 1);
}

.plate-card.anim-arc-down .plate-card-body {
    animation: plateArcDip 720ms cubic-bezier(0.22, 1, 0.36, 1);
}

@keyframes plateLiftGlow {
    0%, 100% { opacity: 0; }
    42% { opacity: 1; }
}

@keyframes plateArcDip {
    0%, 100% { opacity: 1; }
    45% { opacity: 0.84; }
}

.plate-card.anim-land .plate-card-body {
    animation: plateLand 210ms cubic-bezier(0.22, 1, 0.36, 1);
}

@keyframes plateLand {
    0% { transform: translateY(0); }
    45% { transform: translateY(3px); }
    100% { transform: translateY(0); }
}

/* An update that is not a round update lands at once (render-std-plate.js sets this for one write). */
.plate-wrapper .plate-no-motion,
.plate-wrapper .plate-no-motion::before {
    transition: none !important;
}

/* 减少动态效果: every update lands at once (render-std-plate.js skips the timed steps too). */
@media (prefers-reduced-motion: reduce) {
    .plate-wrapper *,
    .plate-wrapper *::before,
    .plate-wrapper *::after {
        animation-duration: 0.01ms !important;
        animation-delay: 0ms !important;
        transition-duration: 0.01ms !important;
        transition-delay: 0ms !important;
    }
}

/* ---------------------------------------------------------------- smaller windows: scale the whole canvas */

/* Each step multiplies into --plate-fit (192 / 209); the bottom stays 48 px like 原版's .std-wrapper. */
@media (max-width: 1815px) {
    .plate-wrapper { --plate-step: 0.9; }
}

@media (max-width: 1640px) {
    .plate-wrapper { --plate-step: 0.8; }
}

@media (max-width: 1460px) {
    .plate-wrapper { --plate-step: 0.7; }
}

@media (max-width: 1280px) {
    .plate-wrapper { --plate-step: 0.6; }
}

@media (max-width: 1100px) {
    .plate-wrapper { --plate-step: 0.5; }
}

@media (max-width: 920px) {
    .plate-wrapper { --plate-step: 0.4; }
}

@media (max-width: 740px) {
    .plate-wrapper { --plate-step: 0.3; }
}

@media (max-width: 560px) {
    .plate-wrapper { --plate-step: 0.2; }
}

/* The mobile profile: 原版's mobile bottom (mode-std.css, body[data-profile="mobile"] .std-wrapper). */
body[data-profile="mobile"][data-mode="individual"] .plate-wrapper {
    bottom: 24px;
}
