/*
 * The day's board.
 *
 * Draw-sheet layout: a dark canvas, a colour-banded table header, tall white
 * rows separated by hairlines, large round portraits, and numeric columns that
 * line up down the page.
 *
 * The band uses the club red rather than the green of the reference sheet —
 * the navbar is already red, and a third strong colour would fight it. Swap
 * --band if a different accent is wanted.
 */

/*
 * The palette, on the board and on the dialogs alike. The modals are siblings
 * of .board, not descendants — custom properties inherit downwards only, so
 * tokens declared on .board alone would be undefined inside them.
 */
.board,
.modal {
    --canvas: #0b0d10;
    --band: #e02424;
    --band-edge: #f6b8b8;
    --surface: #ffffff;
    --ink: #16202e;
    --muted: #6b7280;
    --line: #e9ecf1;
    --wash: #f7f8fa;
    --win: #1a7f47;
    --loss: #d92d20;
    --gold: #d99a10;
}

.board {
    /* The site navbar is fixed-top and 60px tall, so the board has to clear it
     * or the masthead slides underneath. */
    --nav-clearance: 76px;

    max-width: 1180px;
    margin: 0 auto;
    padding: var(--nav-clearance) 20px 72px;
    color: #fff;
}

/* The board owns the page background. The colour is repeated literally
 * because custom properties inherit downwards only — --canvas is declared on
 * .board, so an ancestor selector cannot read it. */
html:has(.board),
body:has(.board) {
    background: #0b0d10;
}

/* ---------- Masthead ---------- */

.board-masthead {
    padding: 20px 0 22px;
}

.board-masthead__title {
    margin: 0;
    font-size: 34px;
    font-weight: 800;
    letter-spacing: 0.01em;
    text-transform: uppercase;
    color: #fff;
    line-height: 1.1;
}

.board-masthead__meta {
    margin: 8px 0 0;
    font-size: 14px;
    color: #98a2b3;
}

.board-masthead__sep { margin: 0 9px; color: #3a4150; }

/* ---------- The day's particulars ---------- */

/*
 * A row of small labelled facts under the masthead. Wraps rather than scrolls,
 * and each fact keeps its label with its value, so a narrow screen stacks them
 * in pairs instead of orphaning a number from what it means.
 */
.board-facts {
    display: flex;
    flex-wrap: wrap;
    gap: 10px 28px;
    margin: 16px 0 0;
}

.board-fact { min-width: 0; }

.board-fact__key {
    font-size: 10.5px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: #6b7280;
}

.board-fact__value {
    margin: 2px 0 0;
    font-size: 15px;
    font-weight: 700;
    color: #fff;
    font-variant-numeric: tabular-nums;
}

/* The unit sits back from the figure — it is the same size either way, so
 * weight and colour are what separate them. */
.board-fact__unit {
    margin-left: 4px;
    font-size: 11.5px;
    font-weight: 400;
    color: #98a2b3;
}

/* Says plainly how the cost column is arrived at. */
.board-masthead__formula {
    margin: 14px 0 0;
    font-size: 12.5px;
    line-height: 1.6;
    color: #98a2b3;
}

.board-masthead__aside { color: #6b7280; }

.board-pill {
    display: inline-block;
    margin-left: 12px;
    font-size: 11.5px;
    font-weight: 700;
    padding: 4px 11px;
    border-radius: 999px;
    color: #fff;
    background: var(--band);
    vertical-align: 3px;
}

/* ---------- Headline figures ---------- */

/*
 * One row of six, like the masthead facts above it.
 *
 * They sit below the standouts and read as context for them, so they are scaled
 * down to suit: a supporting block rather than the headline it was when it ran
 * full width across the top.
 */
.board-summary { margin: 0 0 26px; text-align: center; }

/* Sized well below .board-section__title on purpose — this caption labels a
 * supporting block and should not compete with the real section headings that
 * follow it. */
.board-summary__title {
    margin: 0 0 7px;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: #98a2b3;
}

/* Columns sized to their content, not 1fr — equal fractions stretched the
 * cells to fill the block and pushed the figures far apart from one another. */
.board-stats {
    display: grid;
    grid-template-columns: repeat(6, auto);
    justify-content: center;
    gap: 26px;
}

/* No card around each figure — the same flat label-over-value pairing the
 * masthead facts use, so the two blocks read as one family. */
.board-stat { min-width: 0; }

.board-stat__label {
    display: block;
    font-size: 10.5px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    line-height: 1.3;
    color: #6b7280;
}

.board-stat__value {
    display: block;
    margin-top: 2px;
    font-size: 17px;
    font-weight: 800;
    color: #fff;
    line-height: 1.15;
    font-variant-numeric: tabular-nums;
    letter-spacing: 0.01em;
}

.board-stat--accent .board-stat__value { color: #ff6b6b; }

/* ---------- Sections ---------- */

.board-section { margin-bottom: 34px; }

.board-section__head {
    margin-bottom: 14px;
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 16px;
    flex-wrap: wrap;
}

.board-section__title {
    margin: 0;
    font-size: 20px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.01em;
    color: #fff;
}

.board-section__note {
    margin: 4px 0 0;
    font-size: 12.5px;
    color: #98a2b3;
    text-transform: none;
    font-weight: 400;
}

/* ---------- Search ---------- */

.board-search { position: relative; flex: 0 1 280px; }

.board-search i {
    position: absolute;
    left: 13px;
    top: 50%;
    transform: translateY(-50%);
    color: #6b7280;
    font-size: 14px;
    pointer-events: none;
}

.board-search input {
    width: 100%;
    padding: 9px 13px 9px 36px;
    font-size: 14px;
    border: 1px solid #262d38;
    border-radius: 8px;
    background: #14181f;
    color: #fff;
}

.board-search input::placeholder { color: #6b7280; }

.board-search input:focus {
    outline: none;
    border-color: var(--band);
    box-shadow: 0 0 0 3px rgba(224, 36, 36, 0.15);
}

/* ---------- Highlights ---------- */

/* Feature panel for the day's leader. The only portrait on file is the
 * thumbnail, so it doubles as the backdrop — blown up, blurred and washed
 * down, which stands in for the action shot a profile banner would carry. */
.mvp-hero {
    position: relative;
    border-radius: 14px;
    overflow: hidden;
    margin-bottom: 14px;
    min-height: 210px;
    background: #101722;
}

.mvp-hero__backdrop {
    position: absolute;
    inset: 0;
    background-size: cover;
    background-position: center 22%;
    filter: blur(14px) saturate(1.15);
    transform: scale(1.15);
}

.mvp-hero__wash {
    position: absolute;
    inset: 0;
    background: linear-gradient(105deg,
        rgba(12, 18, 28, 0.94) 0%,
        rgba(12, 18, 28, 0.86) 44%,
        rgba(12, 18, 28, 0.55) 100%);
}

.mvp-hero__body {
    position: relative;
    padding: 26px 30px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    gap: 22px;
    min-height: 210px;
}

.mvp-hero__identity {
    display: flex;
    align-items: center;
    gap: 22px;
    min-width: 0;
}

.mvp-hero__portrait {
    width: 112px;
    height: 112px;
    border-radius: 50%;
    object-fit: cover;
    border: 4px solid #fff;
    flex: 0 0 auto;
    background: #223;
}

.mvp-hero__names { min-width: 0; }

.mvp-hero__name {
    display: block;
    font-size: 40px;
    font-weight: 800;
    line-height: 1.05;
    color: #fff;
    text-decoration: none;
    text-transform: uppercase;
    letter-spacing: -0.01em;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.mvp-hero__name:hover { text-decoration: underline; }

.mvp-hero__alias {
    display: block;
    font-size: 24px;
    font-weight: 300;
    color: #dfe4ec;
    line-height: 1.2;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* Names the rest of a tied top score, since only one portrait fits above. */
.mvp-hero__shared {
    display: block;
    margin-top: 4px;
    font-size: 14px;
    font-weight: 600;
    color: #f5c542;
}

.mvp-hero__level {
    display: inline-block;
    margin-top: 10px;
    padding: 3px 11px;
    border-radius: 6px;
    background: rgba(255, 255, 255, 0.12);
    font-size: 13px;
    font-weight: 600;
    color: #e8edf5;
}

.mvp-hero .board-medal { display: inline-flex; }

/* Figures along the bottom, as on a profile banner. */
.mvp-hero__stats {
    display: flex;
    gap: 44px;
    flex-wrap: wrap;
}

.mvp-hero__stat-label {
    display: block;
    font-size: 12.5px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: #fff;
}

.mvp-hero__stat-value {
    display: block;
    font-size: 34px;
    font-weight: 800;
    line-height: 1.1;
    color: #fff;
    font-variant-numeric: tabular-nums;
}

.mvp-hero__stat-sub {
    display: block;
    font-size: 11.5px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    color: #aab3c2;
}

.board-highlights {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
}

/* Runner-up cards sit on the dark canvas, so they are panels rather than
 * white cards — same treatment as the headline figures above. */
.board-highlight {
    position: relative;
    background: #14181f;
    border: 1px solid #222833;
    border-radius: 12px;
    padding: 22px 10px 15px;
    text-align: center;
}

.board-highlight__avatar {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    object-fit: cover;
    display: block;
    margin: 0 auto 10px;
    background: #222833;
    border: 2px solid #2b3340;
}

.board-highlight__name {
    display: block;
    font-size: 14px;
    font-weight: 700;
    color: #fff;
    text-decoration: none;
    line-height: 1.3;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.board-highlight__name:hover { text-decoration: underline; }

.board-highlight__figure {
    margin-top: 6px;
    font-size: 20px;
    font-weight: 800;
    color: #35d07f;
    font-variant-numeric: tabular-nums;
}

.board-highlight__sub {
    font-size: 11.5px;
    color: #98a2b3;
    font-variant-numeric: tabular-nums;
}

/* ---------- Placing badges ---------- */

/* Gold, silver, bronze, then slate for fourth. */
.board-medal {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 3px 9px;
    border-radius: 999px;
    font-size: 11.5px;
    font-weight: 800;
    line-height: 1.4;
    white-space: nowrap;
}

.board-medal i { font-size: 11px; }

.board-medal--1 { background: rgba(217, 154, 16, 0.16); color: #f0b429; }
.board-medal--2 { background: rgba(163, 174, 191, 0.16); color: #c3ccd9; }
.board-medal--3 { background: rgba(180, 111, 60, 0.18); color: #d08b52; }
.board-medal--4 { background: rgba(120, 134, 155, 0.16); color: #98a2b3; }

/* On a card the badge straddles the top edge. */
.board-highlight .board-medal {
    position: absolute;
    top: -11px;
    left: 50%;
    transform: translateX(-50%);
    border: 1px solid #222833;
    background-color: #171c24;
}

/* On the feature panel it sits above the name. */
.mvp-hero .board-medal {
    margin-bottom: 10px;
    font-size: 12.5px;
    padding: 4px 12px;
    background: rgba(217, 154, 16, 0.2);
    color: #f5c542;
}

/* ---------- Draw table ---------- */

.board-table {
    border-radius: 14px;
    overflow: hidden;
    background: var(--surface);
}

/* Shared column geometry between the header and the rows. */
.board-thead,
.board-row {
    display: grid;
    grid-template-columns:
        10px            /* accent stripe */
        64px            /* marker */
        minmax(0, 1fr)  /* player */
        104px           /* level */
        104px           /* score */
        124px           /* record */
        86px            /* matches */
        150px;          /* payment */
    align-items: center;
}

.board-thead {
    background: var(--band);
    color: #fff;
    font-size: 13px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.02em;
}

.board-thead > * { padding: 15px 8px; }
.board-thead__stripe { padding: 0; }
.board-thead__num { text-align: center; }

.board-row {
    border-bottom: 1px solid var(--line);
    background: var(--surface);
    color: var(--ink);
}

.board-row:last-child { border-bottom: none; }
.board-row:hover { background: var(--wash); }

/* The green edge of the reference sheet, in the club colour. */
.board-row__stripe {
    align-self: stretch;
    background: var(--band-edge);
}

.board-row__marker {
    padding: 20px 8px;
    text-align: center;
    font-size: 15px;
    font-weight: 700;
    color: var(--muted);
    font-variant-numeric: tabular-nums;
}

.board-row__trophy {
    display: block;
    font-size: 20px;
    line-height: 1;
}

.board-row__trophy-label {
    display: block;
    font-size: 9px;
    font-weight: 800;
    color: var(--gold);
    letter-spacing: 0.04em;
    margin-top: 2px;
}

/* Player cell: portrait, then given name over surname as in a draw sheet. */
.board-row__player {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 14px 8px;
    min-width: 0;
}

.board-row__avatar {
    width: 66px;
    height: 66px;
    border-radius: 50%;
    object-fit: cover;
    flex: 0 0 auto;
    background: var(--wash);
}

.board-row__names { min-width: 0; }

.board-row__alias {
    display: block;
    font-size: 14px;
    color: var(--muted);
    line-height: 1.35;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.board-row__name {
    display: block;
    font-size: 17px;
    font-weight: 800;
    color: var(--ink);
    text-decoration: none;
    line-height: 1.25;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.board-row__name:hover { text-decoration: underline; }

.board-row__meta {
    margin-top: 4px;
    font-size: 12.5px;
    color: var(--muted);
    display: flex;
    align-items: center;
    gap: 7px;
    flex-wrap: wrap;
}

.board-status { display: inline-flex; align-items: center; gap: 5px; font-weight: 600; }

/* Fortune-wheel prizes won today (วงล้อนำโชค), under the player's name. */
.board-row__prizes { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 6px; }
.board-prize {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    max-width: 100%;
    padding: 3px 9px;
    border: 1px solid #f1d58a;
    border-radius: 999px;
    background: #fff8e1;
    color: #8a5a00;
    font-size: 12px;
    font-weight: 800;
    line-height: 1.3;
    overflow-wrap: anywhere;
}

.board-status::before {
    content: "";
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: currentColor;
}

.board-status--playing { color: var(--win); }
.board-status--paid { color: #2563eb; }
.board-status--resting { color: #98a2b3; }
.board-row__dot { color: var(--line); }

/* Level is a single badge — the chip carries the label, so it is not repeated
 * as separate text beside it. */
.board-row__level {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 8px;
}

.board-level-chip {
    min-width: 46px;
    padding: 5px 10px;
    border-radius: 6px;
    background: var(--band);
    color: #fff;
    font-size: 12.5px;
    font-weight: 800;
    letter-spacing: 0.02em;
    text-align: center;
    flex: 0 0 auto;
}

.board-cell {
    padding: 8px;
    text-align: center;
    font-variant-numeric: tabular-nums;
}

.board-cell__score {
    font-size: 17px;
    font-weight: 700;
    color: var(--ink);
}

.board-cell__delta {
    display: block;
    font-size: 12px;
    font-weight: 700;
    margin-top: 2px;
}

.board-cell__delta--up { color: var(--win); }
.board-cell__delta--down { color: var(--loss); }
.board-cell__delta--flat { color: var(--muted); }

.board-record { display: flex; gap: 5px; justify-content: center; }

.board-record__cell {
    min-width: 32px;
    padding: 4px 0;
    border-radius: 5px;
    background: var(--wash);
    font-size: 14px;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
    /*
     * Centred in its own right, not by inheritance. The chip is a fixed-width
     * tinted box, so its digit has to sit in the middle of it wherever the row
     * is — and the narrow layout switches the row to text-align: left, which
     * left every number hugging the left edge of its chip.
     */
    text-align: center;
}

.board-record__cell--win { color: var(--win); }
.board-record__cell--loss { color: var(--loss); }

.board-cell__matches { font-size: 16px; font-weight: 700; }
.board-cell__sub { display: block; font-size: 11.5px; color: var(--muted); margin-top: 2px; }

.board-row__pay { padding: 8px; text-align: center; }

.board-cost { font-size: 15px; font-weight: 700; font-variant-numeric: tabular-nums; }

.board-actions { display: flex; gap: 6px; justify-content: center; margin-top: 7px; }

.board-btn {
    font-size: 11.5px;
    font-weight: 700;
    padding: 5px 10px;
    border-radius: 6px;
    border: 1px solid var(--line);
    background: var(--surface);
    color: var(--ink);
    cursor: pointer;
    line-height: 1.4;
}

.board-btn:hover { border-color: var(--band); color: var(--band); }
/* Slip uploaded: a green, filled chip with a check, so it reads as done at a
   glance rather than as one more button. */
.board-btn--done {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    white-space: nowrap;
    color: #fff;
    background: var(--win);
    border-color: var(--win);
}
.board-btn--done:hover { background: #156a3b; border-color: #156a3b; color: #fff; }
.board-btn--done .bi { font-size: 12px; }

/* ---------- Fortune-wheel prizes (วงล้อนำโชค) ---------- */
/* Winner cards on the dark canvas, like the MVP runners-up, with a gold edge. */
.board-prizes__grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 12px;
    margin: 0;
    padding: 0;
    list-style: none;
}
.board-prize-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    min-width: 0;
    padding: 16px 10px 14px;
    border: 1px solid rgba(255, 210, 63, 0.35);
    border-radius: 12px;
    background: linear-gradient(180deg, rgba(255, 210, 63, 0.1), #14181f 70%);
    text-align: center;
}
.board-prize-card__avatar {
    display: block;
    width: 56px;
    height: 56px;
    border: 2px solid #ffd23f;
    border-radius: 50%;
    object-fit: cover;
    background: #1d222b;
}
.board-prize-card__name {
    max-width: 100%;
    overflow: hidden;
    color: #fff;
    font-size: 14px;
    font-weight: 800;
    text-decoration: none;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.board-prize-card__name:hover { text-decoration: underline; }
.board-prize-card__prize {
    max-width: 100%;
    padding: 3px 9px;
    border-radius: 999px;
    background: #ffd23f;
    color: #14171c;
    font-size: 12px;
    font-weight: 800;
    line-height: 1.3;
    overflow-wrap: anywhere;
}
.board-prize-card__event { color: #98a2b3; font-size: 11px; overflow-wrap: anywhere; }

/*
 * The Thai QR Payment mark stands in for the word "QR".
 *
 * The logo carries its own navy field, so the chip is the image itself rather
 * than the image sitting inside a bordered button — a navy block inside a
 * bordered box reads as two chips. Height is matched to the sibling button so
 * the pair still lines up.
 */
.board-btn--qr {
    padding: 0;
    border: 0;
    background: none;
    line-height: 0;
    border-radius: 5px;
    overflow: hidden;
}

.board-btn--qr img {
    display: block;
    height: 27px;
    width: auto;
}

/* The base rule colours a border and text this button no longer has. */
.board-btn--qr:hover {
    outline: 2px solid var(--band);
    outline-offset: 1px;
}

.board-empty {
    padding: 34px 16px;
    text-align: center;
    color: var(--muted);
    font-size: 14px;
    background: var(--surface);
}

.board-modal__player { font-size: 14px; color: var(--muted); margin-bottom: 10px; }
.board-qr { width: 74%; max-width: 300px; }

/* ---------- Player summary dialog ----------
 *
 * A dark card rather than a Bootstrap dialog: it is meant to be screenshotted
 * and shared, so it carries the board's canvas, the club red on the header
 * band, and the player's portrait faded in behind the name. Type is small
 * throughout — the card earns its space from the match list, not the figures.
 */

.summary-modal .modal-content {
    background: var(--canvas);
    color: #fff;
    border: 1px solid #1c2028;
    border-radius: 14px;
    overflow: hidden;
}

.summary-modal .modal-header {
    background: var(--band);
    border-bottom: 0;
    padding: 9px 16px;
}

.summary-modal .modal-title {
    font-size: 12px;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.summary-modal .modal-body { padding: 0 0 4px; }

.summary-modal .modal-footer {
    border-top: 1px solid #1c2028;
    padding: 9px 14px;
}

.summary-modal .board-btn {
    background: none;
    color: #fff;
    border-color: #2b323d;
}

.summary-modal .board-btn:hover { border-color: var(--band); color: var(--band-edge); }
.summary-modal .board-btn:disabled { opacity: 0.55; }
.summary-modal .board-empty { background: none; }

/* ---- Backdrop and hero ---- */

/* The portrait backs everything above the match list, not just the hero band,
 * so it runs down behind the figures and dissolves there. Nothing clips it —
 * the fade is what ends it, so there is no hard edge to see.
 *
 * The min-height is what gives a portrait-shaped photo room to be shown whole;
 * without it the block is only as tall as the type and the picture has to
 * shrink to almost nothing to fit. */
.summary-upper { position: relative; min-height: 218px; }

.summary-backdrop { position: absolute; inset: 0; pointer-events: none; }

/* contain, not cover: cover filled the panel by cropping into the photo, which
 * cut off the top of people's heads. The whole picture is shown instead, sat
 * against the right edge with the type to its left.
 *
 * Showing it whole means its own rectangle has edges. They are hidden by
 * laying black over the picture — solid at the edges, clear in the middle —
 * rather than by masking the picture transparent. Masking thinned it to a grey
 * ghost of itself; an overlay leaves it at full strength where it shows and
 * carries it into the canvas everywhere else.
 */
.summary-backdrop__image {
    position: absolute;
    inset: 0 0 0 26%;
    background-size: contain;
    background-position: right center;
    background-repeat: no-repeat;
    /* Sits back behind the figures rather than competing with them. The black
     * overlay below still does the edge blending — this only sets how present
     * the picture is, so it is the one number to change to taste. */
    opacity: 0.5;
}

/* The black laid over it. The ellipse blends the picture's own edges into the
 * canvas on every side; the linear keeps the left dark enough for the type to
 * read against, whatever the photograph happens to be. */
.summary-backdrop__wash {
    position: absolute;
    inset: 0;
    background:
        linear-gradient(90deg, var(--canvas) 22%, rgba(11, 13, 16, 0.55) 48%, rgba(11, 13, 16, 0) 76%),
        radial-gradient(ellipse 78% 88% at 64% 44%,
            rgba(11, 13, 16, 0) 30%, rgba(11, 13, 16, 0.45) 62%, var(--canvas) 86%),
        linear-gradient(180deg, rgba(11, 13, 16, 0) 62%, rgba(11, 13, 16, 0.6) 86%, var(--canvas) 100%);
}

.summary-hero {
    position: relative;
    padding: 18px 18px 14px;
}

.summary-hero__body { position: relative; }

.summary-hero__eyebrow {
    display: block;
    font-size: 9.5px;
    font-weight: 800;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--band-edge);
}

.summary-hero__name {
    margin: 3px 0 0;
    font-size: 24px;
    font-weight: 800;
    line-height: 1.15;
}

.summary-hero__alias { display: block; font-size: 11px; color: #98a2b3; }

.summary-hero__tags { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 9px; }

.summary-tag {
    font-size: 9.5px;
    font-weight: 700;
    letter-spacing: 0.03em;
    padding: 3px 7px;
    border-radius: 5px;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.12);
}

.summary-tag--delta { color: var(--band-edge); border-color: rgba(224, 36, 36, 0.4); }
.summary-tag--prize { color: #ffd23f; border-color: rgba(255, 210, 63, 0.45); background: rgba(255, 210, 63, 0.1); }

/* ---- Figures ---- */

.summary-figures {
    position: relative;
    display: grid;
    grid-template-columns: repeat(8, 1fr);
    padding: 0 12px 14px;
    border-bottom: 1px solid #1c2028;
}

.summary-figure { text-align: center; min-width: 0; padding: 0 2px; }

.summary-figure__value {
    display: block;
    font-size: 17px;
    font-weight: 800;
    line-height: 1.2;
    font-variant-numeric: tabular-nums;
}

.summary-figure__value--win { color: #4ade80; }
.summary-figure__value--loss { color: #f87171; }

.summary-figure__label {
    display: block;
    margin-top: 1px;
    font-size: 9px;
    font-weight: 700;
    letter-spacing: 0.03em;
    color: #98a2b3;
}

/* ---- Match rows ---- */

.summary-label {
    margin: 14px 0 6px;
    padding: 0 18px;
    font-size: 9.5px;
    font-weight: 800;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: #98a2b3;
}

.summary-matches {
    list-style: none;
    margin: 0;
    padding: 0 14px;
    /* Every match is shown, so a long day scrolls inside the card rather than
     * pushing the share button off a phone screen. */
    max-height: 44vh;
    overflow-y: auto;
}

/* One row per match: our pair, the divider, their pair, then the particulars.
 * The winning pair is marked rather than the row being labelled — except on a
 * draw, where there is no winner and the divider says so. */
.summary-row {
    display: grid;
    /* Fixed middle and meta columns, not auto: with auto they took their width
     * from their own contents, so a row carrying game scores pushed its two
     * pairs inward and the middles no longer lined up down the list. */
    grid-template-columns: 1fr 58px 1fr 76px;
    align-items: center;
    gap: 8px;
    padding: 7px 9px;
    min-height: 46px;
    border-radius: 8px;
    border-left: 3px solid transparent;
    background: #101317;
}

.summary-row + .summary-row { margin-top: 5px; }

.summary-row--win { border-left-color: #4ade80; }
.summary-row--loss { border-left-color: #f87171; }
.summary-row--draw { border-left-color: #cbd5e1; }
.summary-row--pending { border-left-color: #6b7280; }

/* Empty on a decided match — the tick carries that. It holds the column open
 * so both pairs keep their place either way. */
.summary-row__mid {
    font-size: 9.5px;
    font-weight: 800;
    letter-spacing: 0.04em;
    text-align: center;
    color: #cbd5e1;
}

.summary-row--pending .summary-row__mid { color: #98a2b3; font-weight: 700; }

.summary-row__meta {
    font-size: 8.5px;
    color: #6b7280;
    text-align: right;
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
}

.summary-row__score { display: block; font-size: 10px; font-weight: 700; color: #cbd5e1; }

.summary-team {
    display: flex;
    align-items: center;
    gap: 7px;
    min-width: 0;
}

/* The opposing pair mirrors ours, so the two sides read outward from the
 * divider in the middle. */
.summary-team:not(.summary-team--mine) { flex-direction: row-reverse; text-align: right; }

.summary-team__faces { display: flex; flex: 0 0 auto; }

.summary-team__face {
    width: 22px;
    height: 22px;
    border-radius: 50%;
    object-fit: cover;
    border: 1.5px solid #101317;
}

.summary-team__face + .summary-team__face { margin-left: -7px; }

.summary-team__names { display: flex; flex-direction: column; min-width: 0; }

/* Name and level on one line. The level is a fixed-width chip so the names
 * beside it still line up down the list. */
.summary-team__line {
    display: flex;
    align-items: baseline;
    gap: 5px;
    min-width: 0;
}

.summary-team:not(.summary-team--mine) .summary-team__line { flex-direction: row-reverse; }

.summary-team__level {
    flex: 0 0 auto;
    font-size: 8.5px;
    font-weight: 800;
    letter-spacing: 0.03em;
    padding: 1px 4px;
    border-radius: 3px;
    color: #98a2b3;
    background: rgba(255, 255, 255, 0.07);
}

.summary-team.is-winner .summary-team__level { color: #cbd5e1; background: rgba(255, 255, 255, 0.12); }

/*
 * Weight means one thing only: this pair won. It used to mean two — the
 * winning pair was bold and so was the player themselves, which left their own
 * name bold in matches they had lost, reading as though they had won it.
 *
 * So the player is marked by shade alone, and bold is left to the result.
 */
.summary-team__name {
    font-size: 10.5px;
    line-height: 1.35;
    font-weight: 400;
    color: #7d8796;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* The player whose card this is, a shade up from their partner — never bold. */
.summary-team__name.is-self { color: #aab3c0; }

.summary-team.is-winner .summary-team__name { color: #e8f7ee; font-weight: 700; }
.summary-team.is-winner .summary-team__name.is-self { color: #fff; }

/* A fixed slot whether or not it holds a tick, so the names of the two pairs
 * stay in the same columns from row to row. */
.summary-team__tick {
    flex: 0 0 12px;
    font-size: 11px;
    font-weight: 800;
    line-height: 1;
    color: #4ade80;
    text-align: center;
}

.summary-none { margin: 0; padding: 18px; text-align: center; font-size: 12px; color: #6b7280; }

.summary-season {
    margin: 10px 0 0;
    padding: 10px 18px 4px;
    border-top: 1px solid #1c2028;
    font-size: 10.5px;
    color: #98a2b3;
}

/* Lives under the player's name rather than in the cost column — it is about
 * their day, not their bill. Sized down to sit beneath the status line. */
.board-btn--summary {
    margin-top: 6px;
    padding: 3px 9px;
    font-size: 10.5px;
    border-color: rgba(224, 36, 36, 0.45);
    color: var(--band);
}

.board-btn--summary:hover { background: rgba(224, 36, 36, 0.1); }
.board-btn--summary i { margin-right: 2px; }

@media (max-width: 560px) {
    /* Eight figures will not fit a phone; two rows of four do. */
    .summary-figures { grid-template-columns: repeat(4, 1fr); gap: 10px 0; }
    .summary-hero__name { font-size: 20px; }
    /* The particulars drop to their own line so the two pairs keep the width. */
    /* Tighter than the desktop rule: the level chips took width off the names,
     * so the middle and the gaps give some of it back. */
    .summary-row { grid-template-columns: 1fr 38px 1fr; gap: 4px; padding: 7px 6px; }
    .summary-team { gap: 5px; }
    .summary-team__level { font-size: 8px; padding: 1px 3px; }
    .summary-row__meta { grid-column: 1 / -1; text-align: left; }
    .summary-team__name { font-size: 10px; }
}

/* ---------- Narrow screens ---------- */

@media (max-width: 1080px) {
    /* Drop the columns a phone cannot fit; their figures move under the name. */
    .board-thead { display: none; }

    /* Marker and level sit beside the portrait; the four figures pair up
     * two-to-a-line so a row stays about a thumb tall. */
    .board-row {
        grid-template-columns: 8px 1fr 1fr;
        row-gap: 0;
        padding: 4px 0;
    }

    .board-row__marker {
        grid-column: 2;
        text-align: left;
        padding: 12px 14px 0;
    }

    .board-row__level {
        grid-column: 3;
        justify-content: flex-end;
        padding: 12px 14px 0;
    }

    .board-row__player { grid-column: 2 / -1; padding: 8px 14px; }

    .board-row__score  { grid-column: 2; }
    .board-row__record { grid-column: 3; }
    .board-row__matches { grid-column: 2; }
    .board-row__pay    { grid-column: 3; }

    .board-row__score,
    .board-row__record,
    .board-row__matches,
    .board-row__pay {
        padding: 0 14px 10px;
        text-align: left;
    }
    .board-record { justify-content: flex-start; }
    .board-actions { justify-content: flex-start; }

    /* Label the loose figures, since the header is gone. */
    .board-row__score::before,
    .board-row__record::before,
    .board-row__matches::before,
    .board-row__pay::before {
        display: block;
        font-size: 10.5px;
        font-weight: 800;
        text-transform: uppercase;
        letter-spacing: 0.04em;
        color: var(--muted);
        margin-bottom: 3px;
    }

    .board-row__score::before { content: "สมรรถนะ"; }
    .board-row__record::before { content: "ชนะ / เสมอ / แพ้"; }
    .board-row__matches::before { content: "แมชท์"; }
    .board-row__pay::before { content: "ค่าใช้จ่าย"; }
}

@media (max-width: 720px) {
    /* The hero drops to a stacked card; the figures sit three across so they
     * stay on one line rather than wrapping awkwardly. */
    .mvp-hero__body { padding: 20px 18px; gap: 18px; }
    .mvp-hero__identity { gap: 15px; }
    .mvp-hero__portrait { width: 78px; height: 78px; border-width: 3px; }
    .mvp-hero__name { font-size: 26px; }
    .mvp-hero__alias { font-size: 17px; }
    .mvp-hero__shared { font-size: 12px; }
    .mvp-hero__stats { gap: 0; display: grid; grid-template-columns: repeat(3, 1fr); }
    .mvp-hero__stat-value { font-size: 24px; }
    .mvp-hero__stat-label { font-size: 10.5px; letter-spacing: 0.03em; }
    .mvp-hero__stat-sub { font-size: 10px; }
}

@media (max-width: 560px) {
    /* Keep the navbar clearance — a padding shorthand here would reset it. */
    .board { padding: var(--nav-clearance) 12px 48px; }
    .board-masthead { padding-top: 14px; }
    .board-masthead__title { font-size: 24px; }
    /* Six across still has to fit a phone — the gap is what gives, not the row. */
    .board-stats { gap: 15px; }
    .board-highlights { grid-template-columns: repeat(3, 1fr); gap: 8px; }
    .board-highlight { padding: 14px 6px 12px; }
    .board-highlight__avatar { width: 48px; height: 48px; }
    .board-highlight__name { font-size: 12.5px; }
    .board-row__avatar { width: 54px; height: 54px; }
    .board-row__name { font-size: 15px; }
}

/* ---------- Today's ranking ---------- */

.board-toolbar { display: flex; justify-content: flex-end; margin: 2px 0 6px; }
.board-rank-btn {
    display: inline-flex; gap: 8px; align-items: center;
    padding: 10px 17px; border: 0; border-radius: 999px;
    background: var(--band); color: #fff; font-size: 14px; font-weight: 800;
    cursor: pointer; box-shadow: 0 6px 18px rgba(224, 36, 36, 0.28);
}
.board-rank-btn:hover { background: #c11f1f; }
.board-rank-btn i { font-size: 15px; }

/* Tab bar between the header and the list — segmented control on the white
 * modal surface. */
.board-rank__tabs {
    display: flex; gap: 6px; padding: 12px 16px 0;
}
.board-rank__tab {
    flex: 1 1 0; padding: 9px 10px; border: 1px solid var(--line);
    border-radius: 10px; background: var(--wash); color: var(--muted);
    font-size: 13px; font-weight: 800; cursor: pointer;
}
.board-rank__tab:hover { color: var(--ink); border-color: #d3d8df; }
.board-rank__tab.is-active {
    background: var(--band); border-color: var(--band); color: #fff;
}

/* The dialog list sits on the white modal surface, like the QR/slip dialogs. */
.board-rank__note { margin: 0 0 12px; color: var(--muted); font-size: 12.5px; font-weight: 600; }
.board-rank { list-style: none; margin: 0; padding: 0; }
.board-rank__row {
    display: flex; gap: 12px; align-items: center;
    padding: 10px 2px; border-bottom: 1px solid var(--line);
}
.board-rank__row:last-child { border-bottom: 0; }
.board-rank__place {
    flex: 0 0 auto; display: grid; place-items: center;
    width: 28px; height: 28px; border-radius: 50%;
    background: var(--wash); color: var(--ink); font-size: 13px; font-weight: 850;
}
.board-rank__place--1 { background: #fdf1d1; color: #a5760a; }
.board-rank__place--2 { background: #eceef1; color: #5b6472; }
.board-rank__place--3 { background: #f6e2d2; color: #a4632a; }
.board-rank__place--none { background: transparent; color: var(--muted); }
/* Players short of the match cut-off: listed, unplaced, visibly secondary. */
.board-rank__group {
    margin: 18px 0 4px; padding-top: 12px; border-top: 1px solid var(--line);
    color: var(--muted); font-size: 12.5px; font-weight: 800;
}
.board-rank__row--unranked .board-rank__face img { opacity: .75; }
.board-rank__face { flex: 0 0 auto; }
.board-rank__face img {
    display: block; width: 40px; height: 40px;
    border-radius: 50%; object-fit: cover; background: var(--wash);
}
.board-rank__id { flex: 1 1 auto; min-width: 0; }
.board-rank__name {
    display: block; color: var(--ink); font-size: 14.5px; font-weight: 800;
    text-decoration: none; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.board-rank__name:hover { color: var(--band); }
.board-rank__meta { display: block; margin-top: 2px; color: var(--muted); font-size: 12px; }
.board-rank__figures { flex: 0 0 auto; text-align: right; }
.board-rank__delta { display: block; font-size: 15px; font-weight: 850; }
.board-rank__delta--up { color: var(--win); }
.board-rank__delta--down { color: var(--loss); }
.board-rank__delta--flat { color: var(--muted); }
.board-rank__score { display: block; margin-top: 1px; color: var(--muted); font-size: 11px; }
