:root {
    /* Deep near-black canvas, like a dashboard viewed at night */
    --page-background: #0a0b0f;
    --page-background-alt: #0d0f15;

    /* Header / footer band */
    --felt: #0d0e13;
    --felt-hover: #14161d;

    /* Cards laid on the dark canvas */
    --surface: #14161d;
    --surface-hover: #191c24;
    --surface-muted: #1a1d26;
    --paper: #191b22;

    --text: #edeef2;
    --text-muted: #8e94a3;

    --border: rgb(255 255 255 / 10%);
    --border-strong: rgb(255 255 255 / 18%);

    --accent: #d7a54c;
    --accent-hover: #e8bd6c;
    --accent-soft: rgb(215 165 76 / 14%);

    --success: #45c98a;
    --danger: #f0685f;

    /* Dark, legible text for chips/headers that sit directly on a
       (mostly light/pastel) deck color */
    --ink-on-deck: #14161d;

    /* Hero-banner gradient, echoing a dusk sky */
    --banner-from: #1b2140;
    --banner-via: #2a2354;
    --banner-to: #120f1f;

    --radius: 10px;
    --radius-lg: 16px;
    --shadow: 0 10px 30px rgb(0 0 0 / 45%);
    --shadow-sm: 0 4px 14px rgb(0 0 0 / 35%);
}

* {
    box-sizing: border-box;
}

/* Visually hides content while keeping it in the accessibility tree
   -- for text alternatives on icon-only controls (e.g. the trophy
   icon that replaces the Achievements column header on mobile). */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    margin: -1px;
    padding: 0;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

html {
    font-family:
        "Inter",
        system-ui,
        -apple-system,
        BlinkMacSystemFont,
        "Segoe UI",
        sans-serif;
    line-height: 1.5;
    color: var(--text);
    background: var(--page-background);
    background-image:
        radial-gradient(
            ellipse 900px 500px at 15% -10%,
            rgb(120 110 220 / 10%),
            transparent 60%
        ),
        radial-gradient(
            ellipse 700px 500px at 100% 0%,
            rgb(215 165 76 / 6%),
            transparent 55%
        );
    background-attachment: fixed;
}

body {
    margin: 0;
    color: var(--text);
    background: transparent;
}

a {
    color: var(--accent);
    text-decoration-color: rgb(215 165 76 / 45%);
    transition: color 0.2s ease;
}

a:hover {
    color: var(--accent-hover);
}

h1,
h2,
h3 {
    line-height: 1.2;
    color: var(--text);
    font-family: "Fraunces", Georgia, serif;
    font-optical-sizing: auto;
    font-variant-caps: small-caps;
    letter-spacing: 0.01em;
}

h1 {
    margin-top: 0;
    font-size: 2rem;
    font-weight: 600;
}

h2 {
    font-size: 1.35rem;
    font-weight: 600;
}

h3 {
    font-size: 1.05rem;
    font-weight: 600;
}

/* Numeric displays read like a scoreboard */
.deck-matrix-cell strong,
.interesting-fact strong,
.question-summary-grid strong,
.contributor-count,
.hero-stat strong {
    font-family: "Space Grotesk", "Inter", monospace;
    font-variant-numeric: tabular-nums;
    font-variant-caps: normal;
}

.hero-stat-link {
    color: inherit;
    text-decoration: none;
}

.hero-stat-link:hover span {
    text-decoration: underline;
    text-underline-offset: 2px;
}

/* =========================================
   Header
   ========================================= */

.site-header {
    position: sticky;
    top: 0;
    z-index: 40;

    background: color-mix(in srgb, var(--felt) 92%, transparent);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--border);
}

.site-header-inner {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: 1rem;

    width: min(1200px, calc(100% - 2rem));
    margin: 0 auto;
    padding: 0.9rem 0;
}

.site-title {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    margin: 0;
    font-family: "Fraunces", Georgia, serif;
    font-size: 1.3rem;
    font-weight: 600;
    font-variant-caps: small-caps;
    letter-spacing: 0.02em;
}

.site-logo {
    display: block;
    width: 2rem;
    height: 2rem;
    flex: 0 0 auto;
}

.site-title a {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    color: var(--text);
    text-decoration: none;
}

.site-title a:hover {
    color: var(--accent);
}

/* On narrow screens the full title/button text plus the "Submit a
   Game" pill and burger icon no longer fit on one line, so each
   swaps to a short label instead of wrapping. Both variants are
   always in the markup; only one is shown at a time via display. */
.site-title-short,
.nav-cta-short {
    display: none;
}

@media (max-width: 480px) {
    .site-title-full,
    .nav-cta-full {
        display: none;
    }

    .site-title-short,
    .nav-cta-short {
        display: inline;
    }
}

/* Quick-access links -- a handful of the burger menu's links
   duplicated in the header itself, for screens with enough spare
   width to show them alongside "Submit a Game". The burger menu
   stays exactly as-is (still has the full link list, including
   these) -- this is purely an added shortcut, not a replacement. */
.quick-nav {
    display: none;
}

@media (min-width: 900px) {
    .quick-nav {
        display: flex;
        align-items: center;
        gap: 1.25rem;
        margin-left: auto;
    }

    .quick-nav a {
        color: var(--text-muted);
        font-size: 0.9rem;
        font-weight: 500;
        text-decoration: none;
        white-space: nowrap;
    }

    .quick-nav a:hover {
        color: var(--accent);
    }

    /* .quick-nav now does the job of pushing "Submit a Game" + the
       burger menu to the right edge, so .nav-dropdown-cta's own
       margin-left: auto (still needed below this breakpoint, where
       .quick-nav is hidden) would otherwise open up a second gap
       and split them apart from .quick-nav. The extra
       .site-header-inner qualifier isn't for layout -- it's to
       out-specificity the unconditional ".nav-dropdown-cta" rule
       later in this file, which otherwise wins this exact tie
       (same specificity, later in source order) and silently
       cancels this override. */
    .site-header-inner .nav-dropdown-cta {
        margin-left: 0;
    }
}

/* =========================================
   Burger menu (single menu for all header nav
   links and decks — anchored to the right of
   the header, next to "Submit a Game")
   ========================================= */

.burger-menu {
    position: relative;
}

.burger-menu-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;

    width: 2.35rem;
    height: 2.35rem;

    border-radius: var(--radius);
    list-style: none;
    cursor: pointer;
    color: var(--text);

    transition: background 0.15s ease;
}

.burger-menu-toggle::-webkit-details-marker {
    display: none;
}

.burger-menu-toggle:hover,
.burger-menu[open] .burger-menu-toggle {
    background: var(--surface-hover);
}

.burger-icon,
.burger-icon::before,
.burger-icon::after {
    display: block;
    width: 1.3rem;
    height: 2px;
    border-radius: 2px;
    background: currentColor;
    transition: transform 0.15s ease, opacity 0.15s ease, top 0.15s ease;
}

.burger-icon {
    position: relative;
}

.burger-icon::before,
.burger-icon::after {
    content: "";
    position: absolute;
    left: 0;
}

.burger-icon::before {
    top: -0.42rem;
}

.burger-icon::after {
    top: 0.42rem;
}

/* Morph into an "X" while the menu is open */
.burger-menu[open] .burger-icon {
    background: transparent;
}

.burger-menu[open] .burger-icon::before {
    top: 0;
    transform: rotate(45deg);
}

.burger-menu[open] .burger-icon::after {
    top: 0;
    transform: rotate(-45deg);
}

.burger-menu-panel {
    position: absolute;
    top: calc(100% + 0.65rem);
    right: 0;
    z-index: 5;

    display: flex;
    flex-direction: column;
    gap: 0.1rem;

    min-width: 15rem;
    max-width: min(20rem, 90vw);
    max-height: min(32rem, calc(100vh - 6rem));
    overflow-y: auto;

    padding: 0.85rem;

    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow);
}

.burger-menu-panel a {
    display: flex;
    align-items: center;
    gap: 0.5rem;

    padding: 0.4rem 0.5rem;
    border-radius: var(--radius);

    color: var(--text);
    font-size: 0.9rem;
    font-weight: 500;
    text-decoration: none;
}

.burger-menu-panel a:hover {
    background: var(--surface-hover);
    color: var(--accent);
}

/* Deck links (inside the "Decks" / "Submit a Game" sections) get a
   small color dot, matching their deck's color, so they're visually
   distinct from the plain top-level links above them. */
.burger-menu-panel a[style*="--deck-color"]::before {
    content: "";
    width: 0.55rem;
    height: 0.55rem;
    flex: 0 0 auto;
    border-radius: 50%;
    background: var(--deck-color, var(--accent));
}

.burger-menu-section-title {
    margin: 0.75rem 0 0.15rem;
    padding-top: 0.6rem;

    border-top: 1px solid var(--border);

    color: var(--text-muted);
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
}

.burger-menu-section-title:first-child {
    margin-top: 0;
    padding-top: 0;
    border-top: none;
}

/* Collapsible per-category groups inside the burger menu's "Decks"
   section, so the menu shows one line per category instead of every
   deck flattened into one long list. */
.burger-menu-subgroup {
    margin: 0.1rem 0;
}

.burger-menu-subgroup > summary {
    display: flex;
    align-items: center;
    gap: 0.4rem;

    padding: 0.4rem 0.5rem;
    border-radius: var(--radius);

    color: var(--text);
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    list-style: none;
}

.burger-menu-subgroup > summary::-webkit-details-marker {
    display: none;
}

.burger-menu-subgroup > summary::after {
    content: "";
    margin-left: auto;
    width: 0.4rem;
    height: 0.4rem;
    flex: 0 0 auto;

    border-right: 1.5px solid currentColor;
    border-bottom: 1.5px solid currentColor;
    transform: rotate(45deg) translateY(-2px);
    transition: transform 0.15s ease;
}

.burger-menu-subgroup[open] > summary::after {
    transform: rotate(-135deg) translateY(2px);
}

.burger-menu-subgroup > summary:hover {
    background: var(--surface-hover);
}

.burger-menu-subgroup-panel {
    display: flex;
    flex-direction: column;
    gap: 0.1rem;
    padding-left: 0.75rem;
}

.nav-dropdown-group-title {
    margin: 0.4rem 0 0.15rem;
    color: var(--text-muted);
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

/* =========================================
   "Submit a Game" — stays a standalone pill
   button/dropdown outside the burger menu
   ========================================= */

.nav-dropdown-cta {
    position: relative;
    margin-left: auto;
}

.nav-cta {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;

    padding: 0.4rem 0.85rem;

    background: var(--accent);
    border: 1px solid var(--accent);
    border-radius: 999px;
    list-style: none;

    color: #1a1305;
    font-size: 0.85rem;
    font-weight: 700;
    line-height: 1.2;
    cursor: pointer;

    transition:
        background 0.15s ease,
        border-color 0.15s ease;
}

.nav-cta::-webkit-details-marker {
    display: none;
}

.nav-cta::after {
    content: "";
    width: 0.35rem;
    height: 0.35rem;
    border-right: 1.5px solid #1a1305;
    border-bottom: 1.5px solid #1a1305;
    transform: rotate(45deg) translateY(-2px);
    transition: transform 0.15s ease;
}

.nav-dropdown-cta[open] .nav-cta::after {
    transform: rotate(-135deg) translateY(2px);
}

.nav-dropdown-cta:hover .nav-cta,
.nav-dropdown-cta[open] .nav-cta {
    background: var(--accent-hover);
    border-color: var(--accent-hover);
}

.nav-dropdown-panel {
    position: absolute;
    top: calc(100% + 0.65rem);
    right: 0;
    z-index: 5;

    display: grid;
    /* Narrower minimum column than before -- on a phone-width screen
       the old 11rem minimum only ever fit a single column, leaving
       each short deck name stranded in a much wider cell than it
       needed. This fits two columns on most phones instead. */
    grid-template-columns: repeat(auto-fill, minmax(9rem, 1fr));
    gap: 0 1rem;

    width: max(20rem, 100%);
    max-width: min(34rem, 92vw);
    max-height: 70vh;
    overflow-y: auto;

    padding: 1rem;

    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow);
}

.nav-dropdown-group {
    display: flex;
    flex-direction: column;
    gap: 0.1rem;
    margin-bottom: 0.5rem;
}

.nav-dropdown-panel a {
    display: flex;
    align-items: center;
    gap: 0.5rem;

    padding: 0.3rem 0.4rem;
    border-radius: var(--radius);

    color: var(--text);
    font-size: 0.88rem;
    font-weight: 500;
    text-decoration: none;
}

.nav-dropdown-panel a::before {
    content: "";
    width: 0.55rem;
    height: 0.55rem;
    flex: 0 0 auto;
    border-radius: 50%;
    background: var(--deck-color, var(--accent));
}

.nav-dropdown-panel a:hover {
    background: var(--surface-hover);
    color: var(--accent);
}

/* =========================================
   Layout
   ========================================= */

.site-main {
    width: min(1200px, calc(100% - 2rem));
    margin: 0 auto;
    padding: 2.25rem 0 4rem;
}

.site-footer {
    color: var(--text-muted);
    background: var(--felt);
    border-top: 1px solid var(--border);
    text-align: center;
    padding: 1.75rem 1rem;
    font-size: 0.9rem;
}

.site-footer p {
    margin: 0.35rem 0 0;
    font-size: 0.82rem;
    opacity: 0.75;
}

.site-footer p a {
    color: inherit;
    text-decoration: underline;
}

.site-footer p a:hover {
    color: var(--text);
}

/* =========================================
   Page header
   ========================================= */

.page-header {
    margin-bottom: 1.75rem;
}

.page-header h1 {
    margin-bottom: 0.35rem;
}

.page-header p {
    margin: 0;
    color: var(--text-muted);
    max-width: 46rem;
}

/* =========================================
   Cards
   ========================================= */

.card {
    position: relative;
    isolation: isolate;

    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    padding: 1.5rem;
    margin-bottom: 1.5rem;
    overflow: hidden;
}

/* Mobile gets less horizontal breathing room inside each card -- on
   a narrow screen, .site-main's own 1rem side margin plus the card's
   full 1.5rem padding ate a noticeable chunk of the already-limited
   width before any actual content started. Top/bottom padding is
   left alone; this is specifically about left/right. */
@media (max-width: 600px) {
    .card {
        padding-left: 1rem;
        padding-right: 1rem;
    }
}

/* Signature: a thin bar in the deck's color along the card's top
   edge, like a bookmark tab rather than a corner sticker. .card
   already has overflow: hidden + border-radius: var(--radius-lg), so
   this full-width strip gets clipped to the card's own rounded
   corners for free -- no separate border-radius needed here. */
.card::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;

    background: var(--deck-color, var(--accent));

    opacity: 0.85;
    pointer-events: none;
}

/* =========================================
   Buttons
   ========================================= */

.button,
button,
input[type="submit"] {
    display: inline-block;
    border: 1px solid transparent;
    border-radius: var(--radius);
    padding: 0.65rem 1.05rem;

    background: var(--accent);
    color: #1a1305;

    font: inherit;
    font-weight: 700;
    text-decoration: none;

    cursor: pointer;
    transition:
        background-color 0.2s ease,
        border-color 0.2s ease,
        transform 0.15s ease;
}

.button:hover,
button:hover,
input[type="submit"]:hover {
    background: var(--accent-hover);
    color: #1a1305;
}

.button-secondary {
    background: transparent;
    border: 1px solid var(--border-strong);
    color: var(--text);
}

.button-secondary:hover {
    background: var(--surface-hover);
    border-color: var(--border-strong);
    color: var(--text);
}

/* =========================================
   Forms
   ========================================= */

form p {
    margin: 0 0 1rem;
}

label {
    display: block;
    margin-bottom: 0.35rem;
    font-weight: 600;
    color: var(--text);
}

input,
select,
textarea {
    width: 100%;
    max-width: 32rem;

    padding: 0.65rem 0.75rem;

    background: var(--paper);
    color: var(--text);

    border: 1px solid var(--border-strong);
    border-radius: var(--radius);

    font: inherit;
}

input::placeholder,
textarea::placeholder {
    color: var(--text-muted);
}

input[type="checkbox"],
input[type="radio"] {
    width: auto;
}

input:focus,
select:focus,
textarea:focus {
    border-color: var(--accent);
    outline: 2px solid var(--accent-soft);
}

.helptext {
    display: block;
    margin-top: 0.25rem;
    color: var(--text-muted);
    font-size: 0.9rem;
}

.errorlist {
    margin: 0.25rem 0;
    padding-left: 1.25rem;
    color: var(--danger);
}

/* =========================================
   Tables
   ========================================= */

.table-wrapper,
.matrix-wrapper {
    overflow-x: auto;
}

table {
    width: 100%;
    border-collapse: collapse;
    background: var(--paper);
    border-radius: var(--radius);
    overflow: hidden;
}

th,
td {
    padding: 0.75rem;
    border: 1px solid var(--border);
    text-align: left;
}

thead th {
    background: var(--surface-muted);
    color: var(--accent);
    font-weight: 600;
    border-bottom: 2px solid var(--accent);
    box-shadow: var(--shadow-sm);
}

tbody tr:nth-child(even) {
    background: color-mix(in srgb, var(--surface) 55%, transparent);
}

tbody tr:hover {
    background: var(--surface-hover);
}

/* Tap/click-to-highlight a row (see the scripts in play_list.html
   and contributor_list.html) -- makes it easier to track which row
   you're on while scrolling a wide table horizontally. Same
   specificity as the two rules above, so it needs to come after both
   in source order to reliably win regardless of row parity or hover
   state -- that's the only reason this isn't just folded into
   `tbody tr:hover` above. */
tbody tr.row-highlighted,
tbody tr.row-highlighted:hover {
    background: var(--accent-soft);
}

/* =========================================
   Sortable tables (click a header to sort --
   see the script on the Home page)
   ========================================= */

.sortable-column {
    position: relative;
    padding-right: 1.2rem;
    cursor: pointer;
    user-select: none;
}

.sortable-column:hover {
    color: var(--accent);
}

/* Centered on the cell's full height (not just its first line) via
   top: 50% / translateY, rather than relying on the icon's own
   static position -- that varied with each table's header padding
   and font-size, and on narrow/wrapped headers (2-line labels like
   "Win Rate" on mobile) it could sit on top of the second line
   instead of beside the text. */
.sortable-column::after {
    /* U+FE0E forces text presentation: iOS otherwise renders the
       bare arrow as a grey emoji box. */
    content: "\21C5\FE0E";
    position: absolute;
    top: 50%;
    right: 0.35rem;
    transform: translateY(-50%);
    color: var(--text-muted);
    font-size: 0.75em;
    opacity: 0.6;
}

.sortable-column.sorted-asc::after {
    content: "\2191\FE0E";
    color: var(--accent);
    opacity: 1;
}

.sortable-column.sorted-desc::after {
    content: "\2193\FE0E";
    color: var(--accent);
    opacity: 1;
}

/* =========================================
   Hero / Boss Matrix
   ========================================= */

.matrix-wrapper {
    max-width: 100%;
    overflow-x: auto;
}

.hero-boss-matrix {
    width: auto;
    min-width: 100%;
    border-collapse: collapse;
}

.hero-boss-matrix th,
.hero-boss-matrix td {
    border: 1px solid var(--border);
}

.hero-boss-matrix thead th {
    background: var(--surface-muted);
}

/* Top-left "Hero" header */
.hero-boss-matrix thead th:first-child {
    max-width: 8rem;
    padding: 0.4rem;

    text-align: left;
    white-space: nowrap;
    font-size: 0.8rem;

    writing-mode: horizontal-tb;
    transform: none;
}

/* Rotated boss names. Height is capped rather than sized to the
   longest name — text-overflow handles anything that doesn't fit,
   so one long boss name can't blow up the header band for everyone
   (hover still shows the full name via the title attribute).

   The rotation lives on the inner .matrix-heading-label span, not on
   the <th> itself: some browsers (WebKit in particular) don't
   reliably rotate a table-cell box via `transform`, which can render
   the text mirrored/backwards instead of just rotated. Rotating a
   plain block-level child sidesteps that. */
.hero-boss-matrix thead th:not(:first-child) {
    width: 1.5rem;
    min-width: 1.5rem;
    height: 10.5rem;
    padding: 0.15rem;

    vertical-align: bottom;
    font-size: 0.72rem;
}

.matrix-heading-label {
    display: block;
    width: 100%;
    height: 100%;

    text-align: left;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;

    writing-mode: vertical-rl;
    transform: rotate(180deg);
}

/* Hero names — same capped size + ellipsis treatment as the boss
   column headers, for a consistent, compact look on both axes. */
.hero-boss-matrix tbody th {
    position: sticky;
    left: 0;
    z-index: 1;

    max-width: 8rem;
    height: 1.5rem;
    padding: 0.1rem 0.4rem;

    background: var(--paper);

    text-align: right;
    white-space: nowrap;
    line-height: 1.3rem;
    overflow: hidden;
    text-overflow: ellipsis;
    font-size: 0.72rem;
}

/* Matrix cells — height matches the column width, so cells (and by
   extension the whole row) come out square like the header band. */
.hero-boss-matrix tbody td {
    width: 1.5rem;
    min-width: 1.5rem;
    height: 1.5rem;
    padding: 0.1rem;
    line-height: 1;

    text-align: center;
    vertical-align: middle;
}

/* On small screens, shrink the (rotated, read-only) headers to keep
   the horizontal scroll distance reasonable. Cell size stays as-is —
   an earlier attempt at enlarging cells for bigger touch targets cut
   the number of visible columns too much; the tap-to-tooltip below
   is the mobile accessibility fix instead. */
@media (max-width: 600px) {
    .hero-boss-matrix thead th:first-child {
        max-width: 5.5rem;
        font-size: 0.72rem;
    }

    .hero-boss-matrix thead th:not(:first-child) {
        width: 1.3rem;
        min-width: 1.3rem;
        height: 8rem;
        font-size: 0.65rem;
    }

    .hero-boss-matrix tbody th {
        max-width: 5.5rem;
        font-size: 0.68rem;
    }
}

/* =========================================
   Player Filter — compact, top-right of the page header
   ========================================= */

.matrix-page-header {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem 1.5rem;
    margin-bottom: 0.5rem;
}

.matrix-page-header h1 {
    margin: 0;
}

.matrix-page-header .page-header {
    margin-bottom: 0;
}

/* On Deck Detail, the title now lives in the banner above, so this
   header only holds the player filter -- push it to the right edge
   (matching where it sat before) instead of letting a lone flex
   item fall to the start under justify-content: space-between. */
.deck-page .matrix-page-header .player-filter {
    margin-left: auto;
}

.player-filter {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0;
}

.player-filter input {
    width: 11rem;
    max-width: 11rem;
    padding: 0.35rem 0.6rem;
    font-size: 0.85rem;
}

.player-filter button {
    padding: 0.35rem 0.75rem;
    font-size: 0.85rem;
}

.player-filter a {
    font-size: 0.85rem;
    white-space: nowrap;
}

.player-filter-clear {
    padding: 0.35rem 0.75rem;
}

/* Mobile: Player Aid button and filter share one row; the input
   shrinks to make room. */
@media (max-width: 600px) {
    .deck-page .matrix-page-header {
        flex-wrap: nowrap;
        gap: 0.5rem;
    }

    .deck-page .matrix-page-header .player-filter {
        flex-wrap: nowrap;
        flex: 1 1 auto;
        min-width: 0;
        gap: 0.35rem;
    }

    .deck-page .matrix-page-header .player-filter .field-input,
    .deck-page .matrix-page-header .player-filter input {
        flex: 1 1 0;
        min-width: 0;
        width: auto;
        max-width: none;
    }

    .player-aid-link,
    .player-filter button,
    .player-filter-clear {
        flex: 0 0 auto;
        white-space: nowrap;
    }
}

/* "Player Aid" button: same size as the Filter button beside it. */
.player-aid-link {
    padding: 0.35rem 0.75rem;
    font-size: 0.85rem;
}

/* "Clear" becomes just "×" on mobile -- same full/short swap as the
   Contributors table's "Rank"/"#" and "Achievements"/trophy-glyph
   headers: both labels stay in the DOM, CSS just toggles which one
   is visible. */
.player-filter-clear-short {
    display: none;
}

@media (max-width: 600px) {
    .player-filter-clear-full {
        display: none;
    }

    .player-filter-clear-short {
        display: inline;
    }
}

.submission-filter-bar {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    gap: 0.75rem 1.25rem;
    margin-bottom: 1.5rem;
}

.submission-filter-field {
    display: flex;
    flex-direction: column;
    gap: 0.3rem;
}

.submission-filter-field input,
.submission-filter-field select {
    min-width: 9rem;
    height: 2.15rem;
    padding: 0 0.6rem;
    font-size: 0.85rem;
    line-height: 2.15rem;
}

.submission-filter-field select {
    /* Native <select> rendering ignores our padding/height on some
       browsers unless the built-in appearance is switched off, so
       without this it ends up visibly taller than the text inputs
       next to it. */
    appearance: none;
    -webkit-appearance: none;
    padding-right: 1.75rem;

    background-image:
        linear-gradient(45deg, transparent 50%, var(--text-muted) 50%),
        linear-gradient(135deg, var(--text-muted) 50%, transparent 50%);
    background-position:
        calc(100% - 15px) calc(50% - 2px),
        calc(100% - 10px) calc(50% - 2px);
    background-size: 5px 5px, 5px 5px;
    background-repeat: no-repeat;
}

.submission-filter-actions {
    flex-direction: row;
    align-items: center;
    gap: 0.5rem;
}

.submission-filter-actions button {
    padding: 0.35rem 0.75rem;
    font-size: 0.85rem;
}

/* Mobile: two fields per row instead of one full-width field each. */
@media (max-width: 600px) {
    .submission-filter-bar {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 0.6rem;
    }

    .submission-filter-field input,
    .submission-filter-field select {
        min-width: 0;
        width: 100%;
    }

    .submission-filter-actions {
        grid-column: 1 / -1;
    }
}

/* =========================================
   Statistics
   ========================================= */

/* =========================================
   Deck Grid
   ========================================= */

.deck-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 1rem;
}

.deck-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
    padding: 1.5rem;
}

.deck-card h2,
.deck-card h3 {
    margin-top: 0;
}

/* =========================================
   Django Messages
   ========================================= */

.messages {
    list-style: none;
    padding: 0;
}

.messages li {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem 1rem;
    margin-bottom: 1rem;
    padding: 0.75rem 1rem;

    background: color-mix(in srgb, var(--success) 14%, var(--surface));
    border: 1px solid var(--border);
    border-left: 4px solid var(--success);
    border-radius: var(--radius);
    color: var(--text);
}

/* "Post to BG Stats": BG Stats' own button image. */
.bgstats-button {
    display: inline-flex;
    flex-shrink: 0;
    line-height: 0;
}

.bgstats-button img {
    display: block;
    width: 133px;
    height: auto;
}

.bgstats-button:hover img {
    opacity: 0.85;
}

.play-detail-actions {
    display: flex;
    justify-content: flex-end;
    margin: -0.5rem 0 1rem;
}

/* Hint below the button; the block sits at the right edge on wide
   screens and at the left edge on phones. */
.bgstats-export {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 0.35rem;
    margin-left: auto;
    text-align: right;
}

.bgstats-hint {
    max-width: 24rem;
    color: var(--text-muted);
    font-size: 0.8rem;
    line-height: 1.35;
}

.bgstats-hint a {
    color: var(--accent);
    white-space: nowrap;
}

@media (max-width: 600px) {
    .bgstats-export {
        align-items: flex-start;
        margin-left: 0;
        text-align: left;
    }

    .play-detail-actions {
        justify-content: flex-start;
    }
}

/* Help & FAQ page */
.help-section {
    scroll-margin-top: 5rem;
}

.help-section h2,
.help-section h3 {
    color: var(--accent);
}

.help-section h3 {
    margin: 1.1rem 0 0.35rem;
}

.help-section p,
.help-section li {
    color: var(--text);
    line-height: 1.55;
}

.help-section a {
    color: var(--accent);
}

.site-footer-links {
    margin-top: 0.5rem;
    font-size: 0.85rem;
}

/* =========================================
   Responsive
   ========================================= */

@media (max-width: 800px) {

    .deck-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 500px) {

    .deck-grid {
        grid-template-columns: 1fr;
    }

    .site-main {
        padding-top: 1rem;
    }
}

/* =========================================
   Deck colors in Hero–Boss Matrix
   ========================================= */

/* Boss column headings */
table.hero-boss-matrix thead th.matrix-boss-heading {
    background-color: var(--deck-color);
    color: var(--ink-on-deck);
    cursor: help;
}

/* Hero row headings */
table.hero-boss-matrix tbody th.matrix-hero-heading {
    background-color: var(--deck-color);
    color: var(--ink-on-deck);
    cursor: help;
}

/* Same-deck hero/boss combinations */
table.hero-boss-matrix tbody td.matrix-cell-same-deck {
    background-color: color-mix(
        in srgb,
        var(--deck-color) 22%,
        var(--surface)
    );
}

/* Universal or compatible heroes from another deck */
table.hero-boss-matrix tbody td.matrix-cell-cross-deck {
    background-color: var(--surface);
}

/* Impossible combinations */
table.hero-boss-matrix tbody td.matrix-cell-impossible {
    background-color: color-mix(in srgb, var(--page-background) 60%, black 10%);
}

/* Disable the normal alternating table-row color */
table.hero-boss-matrix tbody tr,
table.hero-boss-matrix tbody tr:nth-child(even) {
    background: transparent;
}

/* =========================================
   Matrix status symbols
   ========================================= */

.matrix-status {
    display: inline-flex;
    align-items: center;
    justify-content: center;

    width: 0.85rem;
    height: 0.85rem;

    border-radius: 30%;
    line-height: 1;
    vertical-align: middle;
}

/* Neutral default for universal/cross-deck cells */
.matrix-status-complete {
    background-color: var(--accent-soft);
    color: var(--accent);
    border: 1px solid var(--accent);

    font-size: 0.7rem;
    font-weight: 700;
}

.matrix-status-empty {
    background: transparent;
    border: 1px solid var(--border-strong);
    opacity: 0.65;
}

/* Deck-colored status symbols inside same-deck cells */
.matrix-cell-same-deck .matrix-status-complete {
    background-color: color-mix(
        in srgb,
        var(--deck-color) 35%,
        var(--surface)
    );

    color: #fff;

    border-color: color-mix(
        in srgb,
        var(--deck-color) 80%,
        white 10%
    );
}

.matrix-cell-same-deck .matrix-status-empty {
    border-color: color-mix(in srgb, var(--deck-color) 45%, var(--border-strong));
}

/* "Best Win Rank" view: played but never won */
.matrix-status-loss {
    background-color: color-mix(in srgb, var(--danger) 16%, transparent);
    color: var(--danger);
    border: 1px solid var(--danger);

    font-size: 0.7rem;
    font-weight: 700;
}

/* Tap-to-show tooltip for the Hero–Boss Matrix (see the script at the
   bottom of hero_boss_matrix.html) — `title` attributes never show on
   tap on touch devices, only on hover, so cells and rotated headers
   are otherwise unreadable on mobile. */
.matrix-tap-tooltip {
    position: fixed;
    z-index: 100;
    max-width: 14rem;

    padding: 0.4rem 0.6rem;

    background: var(--text);
    border-radius: var(--radius);
    box-shadow: var(--shadow);

    color: var(--paper);
    font-size: 0.78rem;
    font-weight: 600;
    line-height: 1.3;
    text-align: center;

    pointer-events: none;
}

/* =========================================
   Hero–Boss Matrix view-mode toggle
   ========================================= */

.matrix-view-toggle {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.15rem 0.75rem;
    margin: 0.75rem 0 1rem;
}

.matrix-view-toggle-label {
    color: var(--text-muted);
    font-size: 0.85rem;
    font-weight: 600;
}

.matrix-view-toggle-option {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;

    color: var(--text);
    font-size: 0.85rem;
    font-weight: 500;
    cursor: pointer;
}

.matrix-view-toggle-option input {
    width: auto;
    max-width: none;
    margin: 0;
    accent-color: var(--accent);
    cursor: pointer;
}

/* Both view's markup is always in the DOM (server renders both at
   once); which one is visible is purely a CSS toggle driven by the
   table's data-view-mode attribute, flipped by the radio buttons'
   change handler in the template. No extra request needed to
   switch views. */
.hero-boss-matrix[data-view-mode="submitted"] .view-rank {
    display: none;
}

.hero-boss-matrix[data-view-mode="rank"] .view-submitted {
    display: none;
}

/* =========================================
   Hero–Boss Matrix completion-by-deck
   ========================================= */

.matrix-completion {
    margin-top: 2.5rem;
}

.matrix-completion .page-header h2 {
    margin-bottom: 0.35rem;
}

.matrix-completion-summary strong {
    font-family: "Space Grotesk", "Inter", monospace;
    font-variant-numeric: tabular-nums;
    color: var(--text);
}

.matrix-completion-summary-percentage {
    color: var(--accent);
    font-weight: 600;
}

/* Same compact size as the deck pills in the Home page's tables
   (.overview-stats-table). Doubled class so it outranks the base
   .deck-pill rule, which is defined later in the file. */
.matrix-completion-fact-pill.deck-pill {
    margin-bottom: 0.5rem;
    padding: 0.08rem 0.35rem;
    font-size: 0.68rem;
}

/* Each deck card shows two stacked metrics -- completion counting
   every possible hero (home + universal + guesting), and completion
   counting only that deck's own home heroes -- each with its own
   label/value row and fill bar underneath. */
.matrix-completion-metric {
    margin-top: 0.5rem;
    display: flex;
    flex-direction: column;
    gap: 0.3rem;
}

.matrix-completion-metric-row {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 0.5rem;
    font-size: 0.8rem;
}

.matrix-completion-metric-label {
    color: var(--text-muted);
}

.matrix-completion-metric-value {
    font-family: "Space Grotesk", "Inter", monospace;
    font-variant-numeric: tabular-nums;
    color: var(--text);
    white-space: nowrap;
}

/* Thin fill bar under each metric row -- same --deck-color already
   flowing into .interesting-fact's tinted background, just reused
   for the fill instead. Both bars share the same color/opacity so
   neither reads as more or less important than the other. */
.matrix-completion-bar {
    display: block;
    height: 4px;
    margin-bottom: 0.35rem;
    border-radius: 999px;
    background: var(--border-strong);
    overflow: hidden;
}

.matrix-completion-bar-fill {
    display: block;
    height: 100%;
    background: var(--deck-color, var(--accent));
    border-radius: 999px;
}

.matrix-completion-bar-last {
    margin-bottom: 0;
}

/* =========================================
   Hero statistics and distribution
   ========================================= */

.hero-statistics-layout {
    display: grid;
    grid-template-columns:
        minmax(0, 1.1fr)
        minmax(20rem, 0.9fr);
    gap: 1.5rem;
    align-items: center;
}

.hero-statistics-table,
.hero-distribution {
    min-width: 0;
}

.hero-distribution h3 {
    margin: 0;
}

@media (max-width: 900px) {
    .hero-statistics-layout {
        grid-template-columns: 1fr;
    }
}

/* Shared collapsible-section pattern for chart-like content that
   sits beside a table on wide screens (side by side with
   .hero-statistics-table / .hero-statistics-table below) but stacks
   underneath it once the layout drops to a single column -- at that
   point it's extra vertical scrolling rather than a free-standing
   column, so it starts collapsed there and opens on tap. On wide
   screens it's kept permanently open instead (see the small script in
   base.html that sets/removes the `open` attribute to match), and the
   summary's toggle affordance is switched off there since there's no
   space problem to collapse away in the first place. Reuses the same
   chevron treatment as achievement_list.html's category groups. */
.collapsible-panel > summary {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.75rem;
    cursor: pointer;
    list-style: none;
}

.collapsible-panel > summary::-webkit-details-marker {
    display: none;
}

.collapsible-panel > summary::after {
    content: "";
    margin-left: auto;
    width: 0.5rem;
    height: 0.5rem;
    flex: 0 0 auto;

    border-right: 1.5px solid currentColor;
    border-bottom: 1.5px solid currentColor;
    transform: rotate(45deg) translateY(-2px);
    transition: transform 0.15s ease;
}

.collapsible-panel[open] > summary::after {
    transform: rotate(-135deg) translateY(2px);
}

@media (min-width: 901px) {
    .collapsible-panel > summary {
        cursor: default;
        pointer-events: none;
    }

    .collapsible-panel > summary::after {
        display: none;
    }
}

/* Deck Distribution "chart" on the Overview page -- a loose cluster
   of circles, one per deck, sized by its share of plays (see
   OverviewService.play_distribution). Standing in for what used to be
   a Plotly pie chart and, briefly, a hand-drawn SVG one -- a wall of
   15+ thin pie slices read as fussy and technical, where a cluster of
   different-sized bubbles is a calmer, more playful way to say
   "some decks get played a lot more than others" at a glance. No
   legend next to it: the Overview table right beside it already shows
   every deck's own color via its deck-pill, so repeating that as a
   list here would just be the same colors twice. */
.play-distribution {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    gap: 0.6rem;
}

.play-distribution-bubble {
    display: flex;
    flex: 0 0 auto;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.15rem;

    border-radius: 50%;
    box-shadow: 0 0 0 1px var(--border-strong);
}

/* Short deck code (e.g. "TMB", set per-deck in the admin) and
   percentage label. The code shows in every bubble no matter how
   small (see short_code in overview.py); the percentage only joins
   it once a bubble is large enough for both (MIN_LABEL_REM). Deck
   colors are mostly light pastels, so white text on a shadow washes
   out -- a small dark pill behind dark text gives reliable contrast
   against any deck color without needing per-bubble contrast
   checks. */
.play-distribution-code,
.play-distribution-percentage {
    color: #1a1a1a;
    font-weight: 700;
    padding: 0.05rem 0.35rem;
    border-radius: 999px;
    background: rgb(255 255 255 / 70%);
    white-space: nowrap;
}

.play-distribution-code {
    font-size: 0.7rem;
    letter-spacing: 0.02em;
}

.play-distribution-percentage {
    font-size: 0.68rem;
    font-weight: 600;
}

.overview-stats-table th,
.overview-stats-table td {
    padding: 0.15rem 0.35rem;
}

.overview-stats-table td {
    font-size: 0.8rem;
}

.overview-stats-table thead th {
    font-size: 0.78rem;
}

.overview-stats-table th:first-child,
.overview-stats-table td:first-child {
    text-align: right;
}

.overview-stats-table th:not(:first-child),
.overview-stats-table td:not(:first-child) {
    text-align: center;
}

.overview-stats-table .numeric-cell {
    font-family: "Space Grotesk", "Inter", monospace;
    font-variant-numeric: tabular-nums;
}

.overview-stats-table tfoot th,
.overview-stats-table tfoot td {
    background: var(--surface-muted);
    border-top: 2px solid var(--border-strong);
    font-weight: 700;
}

/* Bottom-row column totals on the Hero-Boss and Hero-Rank win-rate
   matrices -- a heavier top border sets the summary row apart from
   the individual hero rows above it, same idea as the thicker rule
   .overview-stats-table's own tfoot uses. */
.deck-win-rate-matrix tfoot th,
.deck-win-rate-matrix tfoot td {
    border-top: 2px solid var(--border-strong);
}

.deck-win-rate-matrix tfoot .deck-matrix-corner {
    font-weight: 700;
}

/* Drop the Losses column on small screens -- Games and Win Rate
   already convey the outcome, and losing this column buys the
   remaining ones (especially the deck name) noticeably more room. */
@media (max-width: 600px) {
    .overview-stats-table th:nth-child(4),
    .overview-stats-table td:nth-child(4) {
        display: none;
    }
}

/* "Win Rate" header shortens to "Win %" on narrow screens -- both
   labels stay in the DOM (same pattern as .player-filter-clear-full/
   -short above), CSS just toggles which one is visible, so there's
   no risk of the longer label sneaking back in behind the sort
   arrow's reserved padding on a cramped mobile column. */
.win-rate-heading-short {
    display: none;
}

@media (max-width: 600px) {
    .win-rate-heading-full {
        display: none;
    }

    .win-rate-heading-short {
        display: inline;
    }
}

/* =========================================
   Deck-detail: Hero Statistics table
   ========================================= */

.hero-stats-table th,
.hero-stats-table td {
    padding: 0.35rem 0.55rem;
}

.hero-stats-table td {
    font-size: 0.95rem;
}

.hero-stats-table tbody th {
    font-size: 1rem;
}

.hero-stats-table thead th {
    font-size: 0.9rem;
}

.hero-stats-table th:first-child,
.hero-stats-table td:first-child {
    text-align: right;
}

.hero-stats-table th:not(:first-child),
.hero-stats-table td:not(:first-child) {
    text-align: center;
}

/* =========================================
   Deck-detail: Outcomes table
   ========================================= */

.outcome-table th,
.outcome-table td {
    padding: 0.35rem 0.55rem;
}

.outcome-table td {
    font-size: 0.95rem;
}

.outcome-table tbody th {
    font-size: 1rem;
}

.outcome-table thead th {
    font-size: 0.9rem;
}

.outcome-table th:first-child,
.outcome-table td:first-child {
    text-align: right;
}

.outcome-table th:not(:first-child),
.outcome-table td:not(:first-child) {
    text-align: center;
}

/* =========================================
   Deck Hero–Boss Win-Rate Matrix
   ========================================= */

.deck-win-rate-matrix {
    width: auto;
    min-width: 100%;
    border-collapse: collapse;
}

.deck-win-rate-matrix th,
.deck-win-rate-matrix td {
    border: 1px solid var(--border);
}

.deck-win-rate-matrix thead th {
    font-size: 0.78rem;
}

.deck-win-rate-matrix tbody tr,
.deck-win-rate-matrix tbody tr:nth-child(even) {
    background: transparent;
}

.deck-matrix-corner,
.deck-matrix-hero {
    min-width: 5.5rem;
    padding: 0.15rem 0.35rem;
    background: var(--paper);
    font-size: 0.85rem;
}

/* Just the static "Hero"/"Deck" label, so it's safe to always keep
   on one line. Right-aligned to match .deck-matrix-hero below it --
   the deck-pills in the body are right-aligned, so a left-aligned
   header sat oddly far from the column it was labeling. */
.deck-matrix-corner {
    white-space: nowrap;
    text-align: right;
}

/* Actual hero/deck names, which vary a lot in length -- nowrap here
   let one long name blow out the whole column (and, since the table
   scrolls rather than shrinks, the whole table), which looked
   especially odd on narrow/mobile screens. A max-width plus normal
   wrapping keeps the column a sane size and lets long names break
   onto a second line instead. */
.deck-matrix-hero {
    max-width: 9rem;
    text-align: right;
    white-space: normal;
    overflow-wrap: break-word;
}

/* Neutral header, deliberately not using --deck-color -- these are
   plain column labels (a boss name or a rank number), not something
   that itself belongs to a deck, so a solid deck-colored header
   band would be misleading here. */
.deck-matrix-boss {
    min-width: 3.5rem;
    max-width: 5rem;
    padding: 0.15rem 0.35rem;
    background: var(--paper);
    text-align: center;
    white-space: nowrap;
}

/* Column headers that aren't tied to any single deck (e.g. rank
   numbers on the cross-deck Overview page), so they stay neutral
   instead of picking up --deck-color like .deck-matrix-boss. */
.overview-rank-heading {
    min-width: 1.75rem;
    padding: 0.15rem 0.35rem;
    background: var(--paper);
    text-align: center;
    white-space: nowrap;
}

.deck-matrix-cell {
    min-width: 2.5rem;
    padding: 0.15rem 0.35rem;
    text-align: center;
    vertical-align: middle;
}

.deck-matrix-cell strong,
.deck-matrix-cell small {
    display: block;
}

.deck-matrix-cell strong {
    font-size: 0.8rem;
}

.deck-matrix-cell small {
    margin-top: 0.1rem;
    font-size: 0.64rem;
    opacity: 0.75;
}

/* No submitted combination */
.deck-matrix-cell-no-data {
    background: var(--surface-muted);
    color: var(--text-muted);
}

/* Submitted, but no wins */
.deck-matrix-cell-zero {
    background: color-mix(
        in srgb,
        var(--deck-color) 14%,
        var(--surface)
    );
}

/* 1–39% */
.deck-matrix-cell-low {
    background: color-mix(
        in srgb,
        var(--deck-color) 32%,
        var(--surface)
    );
    color: #fff;
}

/* 40–74% */
.deck-matrix-cell-medium {
    background: color-mix(
        in srgb,
        var(--deck-color) 52%,
        var(--surface)
    );
    color: #fff;
}

/* 75–99% */
.deck-matrix-cell-high {
    background: color-mix(
        in srgb,
        var(--deck-color) 74%,
        var(--surface)
    );
    color: #fff;
}

/* 100% */
.deck-matrix-cell-perfect {
    background: color-mix(
        in srgb,
        var(--deck-color) 92%,
        white 8%
    );
    color: #12131a;
    font-weight: 700;
}

/* Rank (or other combination) that simply doesn't apply to this
   deck — e.g. a rank value another deck has but this one doesn't. */
.deck-matrix-cell-impossible {
    background-color: color-mix(
        in srgb,
        var(--page-background) 60%,
        black 10%
    );
}

/* Legend */

.win-rate-legend {
    display: flex;
    flex-wrap: wrap;
    gap: 0.6rem 0.85rem;
    margin-top: 0.85rem;
    font-size: 0.78rem;
    color: var(--text-muted);
}

.legend-item {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
}

.legend-swatch {
    display: inline-block;
    width: 0.8rem;
    height: 0.8rem;
    border: 1px solid var(--border);
    border-radius: 3px;
}

/* =========================================
   Deck-question statistics
   ========================================= */

/* All/Wins/Losses toggle above the deck-specific stats -- three
   independent pill-shaped buttons with a gap between them (radios
   styled as buttons) rather than one connected track with a shared
   outline. A single track needs either an inner fill's rounded
   corners or a positioned "indicator" pill to line up pixel-for-pixel
   with the track's own rounded ends, which never quite worked out
   the same across browsers (a sliver of the track kept showing
   through at one edge); giving every option its own complete,
   independently-drawn pill sidesteps that entirely -- there's nothing
   left that needs to line up with anything else. All three outcome
   variants are already in the DOM (see .outcome-view-wrapper below);
   this toggle just flips which one is visible, no reload. */
.outcome-toggle {
    display: inline-flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin: 0.75rem 0 1.25rem;
}

.outcome-toggle-option {
    position: relative;

    display: flex;
    align-items: center;
    justify-content: center;

    padding: 0.35rem 0.9rem;
    border: 1px solid var(--border-strong);
    border-radius: 999px;

    font-size: 0.82rem;
    font-weight: 600;
    line-height: 1;
    color: var(--text-muted);

    cursor: pointer;
    user-select: none;

    transition: background-color 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}

.outcome-toggle-option:hover {
    background: var(--surface-hover);
}

/* The radio itself stays in the DOM (for accessibility/keyboard
   support and so :has() below can key off it) but is visually
   replaced by the label's own background/text styling. */
.outcome-toggle-option input {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    opacity: 0;
    clip: rect(0, 0, 0, 0);
}

/* Falls back to --accent when there's no --deck-color in scope (this
   toggle is reused on pages with no single deck to tint it, like the
   Home page) -- without a fallback, var(--deck-color) resolves to
   nothing there and the whole declaration is dropped, leaving the
   checked option with no fill at all. */
.outcome-toggle-option:has(input:checked) {
    background: var(--deck-color, var(--accent));
    border-color: var(--deck-color, var(--accent));
    color: var(--ink-on-deck);
}

@media (max-width: 500px) {
    .outcome-toggle {
        width: 100%;
    }

    .outcome-toggle-option {
        flex: 1 1 0;
    }
}

/* All three outcome variants (all/win/loss) of the deck-specific
   stats grid are rendered into the DOM at once (see
   deck_question_statistics_grid.html, included three times); only
   the one matching data-outcome-view is shown. Same client-side
   toggle pattern as the Hero-Boss Matrix's [data-view-mode]. */
.outcome-view-panel {
    display: none;
}

.outcome-view-wrapper[data-outcome-view="all"] .outcome-view-panel-all,
.outcome-view-wrapper[data-outcome-view="win"] .outcome-view-panel-win,
.outcome-view-wrapper[data-outcome-view="loss"] .outcome-view-panel-loss {
    display: block;
}

/* Same client-side toggle pattern, for the Home page's All/"Last 100"
   window toggle on the Deck Distribution bubble chart -- both windows
   are rendered into the DOM at once (see
   play_distribution_bubbles.html, included twice); only the one
   matching data-window-view is shown. */
.window-view-panel {
    display: none;
}

.window-view-wrapper[data-window-view="all"] .window-view-panel-all,
.window-view-wrapper[data-window-view="recent"] .window-view-panel-recent {
    display: block;
}

.question-statistics-grid {
    display: grid;
    grid-template-columns: repeat(
        2,
        minmax(0, 1fr)
    );
    gap: 1.25rem;
}

.question-statistic {
    min-width: 0;
    padding: 1.25rem;

    background: var(--paper);
    border: 1px solid var(--border);
    border-radius: var(--radius);
}

.question-statistic h3 {
    margin-top: 0;
    margin-bottom: 0.25rem;
}

.question-answer-count {
    margin-top: 0;
    color: var(--text-muted);
    font-size: 0.9rem;
}

.question-summary-grid {
    display: grid;
    grid-template-columns: repeat(
        3,
        minmax(0, 1fr)
    );
    gap: 0.75rem;
    margin-bottom: 1rem;
}

.question-summary-grid > div {
    padding: 0.75rem;
    text-align: center;

    background: color-mix(
        in srgb,
        var(--deck-color) 16%,
        var(--surface)
    );

    border-radius: var(--radius);
}

.question-summary-grid strong,
.question-summary-grid span {
    display: block;
}

.question-summary-grid strong {
    font-size: 1.4rem;
}

.question-summary-grid span {
    color: var(--text-muted);
    font-size: 0.8rem;
}

/* The grid lives on the *list*, not each row -- every row's label/
   track/count needs to land in the same three column tracks so bars
   line up across rows. Putting `display: grid` on each .distribution-
   row instead (as before) made every row its own independent grid,
   so fit-content(6rem) below was sized per row rather than to the
   widest label across the whole list -- fine for a list of same-width
   digits, but "I escaped." vs "I was defeated." ended up with
   differently-sized label columns, and their bars started at
   different x-positions. Each .distribution-row is `display:
   contents` so its children become direct items of this shared grid
   instead of boxes of their own. */
.distribution-list {
    display: grid;
    grid-template-columns:
        fit-content(6rem)
        minmax(8rem, 1fr)
        auto;
    row-gap: 0.55rem;
    column-gap: 0.65rem;
    align-items: center;
}

.distribution-row {
    display: contents;
}

.distribution-label {
    overflow-wrap: anywhere;
    /* Close to the question h3's own size otherwise (both hover
       around 1rem) -- this is detail text under that heading, so it
       should read as clearly secondary, in line with .question-
       answer-count (0.9rem) just above it. */
    font-size: 0.9rem;
}

.distribution-track {
    height: 0.65rem;
    overflow: hidden;

    /* Same track color as the Hero-Boss Matrix's completion bars
       (.matrix-completion-bar) -- var(--surface-muted) was nearly
       indistinguishable from this card's own var(--paper)
       background, so the unfilled part of the bar barely read as a
       track at all. A translucent white wash shows up reliably
       against any card background instead of depending on how close
       two near-black hexes happen to be. */
    background: var(--border-strong);
    border-radius: 999px;
}

.distribution-bar {
    display: block;
    width: var(--bar-percentage, 0%);
    height: 100%;

    background: var(--deck-color);
    border-radius: inherit;

    transition: width 0.25s ease;
}

/* Integer-question distributions (e.g. "how many items did you
   find") get a proper histogram instead of the stacked horizontal
   bars .distribution-list uses for choice questions -- the values are
   an ordered number line, and the *shape* of the distribution (a
   single hump, a long tail, two separate clusters, ...) reads far
   more directly from bars side by side on a shared baseline than from
   a list of bars stacked on top of each other. */
.histogram-wrapper {
    overflow-x: auto;
}

.histogram {
    display: flex;
    align-items: flex-end;
    gap: 0.5rem;
    min-height: 8rem;
}

.histogram-column {
    display: flex;
    flex: 1 1 2.5rem;
    flex-direction: column;
    align-items: center;
    gap: 0.3rem;
    min-width: 2rem;
}

.histogram-count {
    font-size: 0.8rem;
    color: var(--text-muted);
}

/* The track is a fixed-height column that the bar grows up from --
   unlike .distribution-track's width-based bars, a histogram bar's
   *height* is the value being compared, so the track needs a real
   height of its own for --bar-percentage to size the bar against. */
.histogram-track {
    display: flex;
    align-items: flex-end;
    width: 100%;
    height: 6rem;
}

.histogram-bar {
    display: block;
    width: 100%;
    height: var(--bar-percentage, 0%);

    background: var(--deck-color);
    border-radius: 0.2rem 0.2rem 0 0;

    transition: height 0.25s ease;
}

.histogram-label {
    font-size: 0.8rem;
    color: var(--text-muted);
}

/* Ranked-choice questions ("choose ranked") get one stacked bar per
   choice instead of a bare "Choice / Average Position / Selections"
   table -- the average alone can't distinguish "always ranked 2nd"
   from "ranked 1st half the time, last the other half", even though
   those describe very different voting patterns. Each segment is a
   shade of the deck's own color, from full strength at rank 1 down to
   a darkened shade at the last rank (see _darken_hex()/segment_color()
   in statistics.py) -- real shade steps rather than alpha-over-track
   opacity, since opacity differences barely read against the site's
   mostly light/pastel deck colors. The bar's shape shows how
   concentrated or spread out a choice's votes are across ranks at a
   glance. Shares its row/column layout with .distribution-list (label
   | track | number). */
.rank-distribution {
    display: grid;
    grid-template-columns:
        fit-content(9rem)
        minmax(8rem, 1fr)
        auto;
    row-gap: 0.55rem;
    column-gap: 0.65rem;
    align-items: center;
}

.rank-distribution-row {
    display: contents;
}

.rank-distribution-label {
    overflow-wrap: anywhere;
    font-size: 0.9rem;
}

.rank-distribution-track {
    display: flex;
    height: 0.65rem;
    overflow: hidden;

    background: var(--border-strong);
    border-radius: 999px;
}

.rank-distribution-segment {
    display: block;
    height: 100%;

    /* background-color is set inline per segment (a shade of the
       deck color computed in statistics.py), not here. */

    /* Segments are plain siblings in a flex row (rather than
       absolutely positioned, as a stacked bar sometimes is), so a
       segment's own border-radius would show on both edges instead of
       just the bar's outer ones -- inheriting the track's radius and
       relying on the track's own overflow: hidden to clip it keeps a
       rounded pill shape without every internal segment boundary
       looking rounded too. */
    border-radius: inherit;

    transition: width 0.25s ease;
}

/* Even with distinct shades per segment, adjacent ones can still sit
   close together -- a thin dark line at each segment's left edge
   (skipping the very first) gives every segment a crisp boundary
   regardless of how close its shade is to its neighbor's. */
.rank-distribution-segment + .rank-distribution-segment {
    box-shadow: inset 1px 0 0 var(--page-background);
}

/* .rank-legend-swatch reuses .win-rate-legend's swatch layout/spacing
   for the rank/value legend below the bars -- its background color is
   set inline per entry (a shade of the deck color, same scale as
   .rank-distribution-segment above), not here. */

/* Quantity-choices question on the submission form -- one compact
   grid (item rows x quantity columns, radio button per cell) instead
   of a full-width field per item, matching the Google Form this
   mirrors rather than turning into a long vertical list of near-
   identical questions. */
.quantity-grid-table {
    border-collapse: collapse;
}

.quantity-grid-table th,
.quantity-grid-table td {
    padding: 0.35rem 0.6rem;
    border: 1px solid var(--border);
    text-align: center;
}

.quantity-grid-table thead th {
    color: var(--text-muted);
    font-size: 0.8rem;
    font-weight: 600;
}

/* Item name column -- the one column that isn't a quantity value, so
   it reads left-aligned like a row label rather than centered like
   the radio cells next to it. */
.quantity-grid-table tbody th {
    padding-right: 1rem;
    text-align: left;
    font-weight: 400;
}

.quantity-grid-table input[type="radio"] {
    margin: 0;
}

.compact-statistics-table th,
.compact-statistics-table td {
    padding: 0.15rem 0.35rem;
}

.compact-statistics-table td {
    font-size: 0.8rem;
}

.compact-statistics-table thead th {
    font-size: 0.78rem;
}

.compact-statistics-table tbody th {
    font-size: 0.85rem;
}

.compact-statistics-table th:first-child,
.compact-statistics-table td:first-child {
    text-align: right;
}

.compact-statistics-table th:not(:first-child),
.compact-statistics-table td:not(:first-child) {
    text-align: center;
}

.text-answer-list {
    margin-bottom: 0;
    padding-left: 1.25rem;
}

@media (max-width: 900px) {
    .question-statistics-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 500px) {
    /* Long item-choice labels (e.g. "Birch Bark / Birch Bark Armor")
       have no room to breathe in a narrow side-by-side column at
       phone widths -- they wrapped onto 3+ lines instead of the 1-2
       a label this long should need. Below this width, each row
       switches from "label | bar | count" in one line to the label
       getting the *full* row width on its own line, with the bar and
       count sharing the line underneath -- .distribution-row goes
       back to being its own little grid (instead of display: contents
       for shared column tracks, which only matters for the desktop
       one-line layout) so the label can span both of its columns. */
    .distribution-list {
        grid-template-columns: 1fr;
    }

    .distribution-row {
        display: grid;
        grid-template-columns: 1fr auto;
        column-gap: 0.65rem;
        row-gap: 0.35rem;
        align-items: center;
    }

    .distribution-label {
        grid-column: 1 / -1;
    }

    /* Same "label gets the full row width, bar and number share the
       line below" treatment as .distribution-list above, for the same
       reason -- choice names have just as little room to breathe in a
       narrow side-by-side column at phone widths. */
    .rank-distribution {
        grid-template-columns: 1fr;
    }

    .rank-distribution-row {
        display: grid;
        grid-template-columns: 1fr auto;
        column-gap: 0.65rem;
        row-gap: 0.35rem;
        align-items: center;
    }

    .rank-distribution-label {
        grid-column: 1 / -1;
    }

    /* Stays 3-up (Minimum/Average/Maximum belong side by side, not
       stacked) -- just trimmed down so three columns still have room
       to breathe at phone widths. */
    .question-summary-grid {
        gap: 0.5rem;
    }

    .question-summary-grid > div {
        padding: 0.5rem 0.35rem;
    }

    .question-summary-grid strong {
        font-size: 1.1rem;
    }

    .question-summary-grid span {
        font-size: 0.7rem;
    }
}

/* =========================================
   Interesting facts
   ========================================= */

.interesting-facts-grid {
    display: grid;
    grid-template-columns: repeat(
        3,
        minmax(0, 1fr)
    );
    gap: 1rem;
}

.interesting-fact {
    min-width: 0;
    padding: 1rem;

    background: color-mix(
        in srgb,
        var(--deck-color) 14%,
        var(--surface)
    );

    border: 1px solid var(--border);
    border-radius: var(--radius);
}

.interesting-fact-label,
.interesting-fact strong,
.interesting-fact small {
    display: block;
}

.interesting-fact-label {
    margin-bottom: 0.35rem;
    color: var(--text-muted);
    font-size: 0.8rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.interesting-fact strong {
    font-size: 1.2rem;
    overflow-wrap: anywhere;
    color: var(--text);
}

.interesting-fact small {
    margin-top: 0.3rem;
    color: var(--text-muted);
}

@media (max-width: 900px) {
    .interesting-facts-grid {
        grid-template-columns: repeat(
            2,
            minmax(0, 1fr)
        );
    }
}

@media (max-width: 550px) {
    /* Stays 2-up rather than dropping to a single column -- full
       screen-width cards looked oversized for how little text each
       one holds, and two narrower cards per row plus the trimmed
       padding/font-sizes below keep each card's height down too. */
    .interesting-facts-grid {
        grid-template-columns: repeat(
            2,
            minmax(0, 1fr)
        );
        gap: 0.65rem;
    }

    /* Roughly 12-15% flatter across padding, both font sizes, and the
       label/value/note spacing that scales with them. */
    .interesting-fact {
        padding: 0.85rem;
    }

    .interesting-fact-label {
        margin-bottom: 0.3rem;
        font-size: 0.7rem;
    }

    .interesting-fact strong {
        /* Trimmed further than the label/padding above -- long hero
           names (e.g. "Cornflower Witch") wrap onto a second line in
           a narrow 2-up card either way, and a smaller size keeps
           that second line from pushing the card's height up too
           much. */
        font-size: 0.92rem;
    }

    .interesting-fact small {
        margin-top: 0.25rem;
    }
}
/* =========================================
   Neutral deck-detail cards
   ========================================= */

.deck-page .card,
.deck-page .card.deck-accent-card {
    background: var(--surface);
    border: 1px solid var(--border);
}

/* Summary card, styled like the Home page's hero banner in both
   color (gradient + faint grid texture) and layout (heading on the
   left, stats on the right in a single row, rather than stacked) --
   the same flex row/gap/padding as .home-hero, which also makes the
   card noticeably slimmer than the other, block-layout deck-detail
   cards. Needs the extra .card.summary-card specificity to win over
   the plain ".deck-page .card" rule above. */
.deck-page .card.summary-card {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 1.25rem;
    padding: 1.75rem;

    background:
        radial-gradient(
            ellipse 700px 320px at 90% 0%,
            color-mix(in srgb, var(--accent) 18%, transparent),
            transparent 60%
        ),
        linear-gradient(
            135deg,
            var(--banner-from),
            var(--banner-via) 55%,
            var(--banner-to)
        );
    border: 1px solid var(--border);
}

.summary-card-copy {
    max-width: 22rem;
}

@media (max-width: 700px) {
    .deck-page .card.summary-card {
        padding: 1.25rem;
    }
}

.summary-card::after {
    content: "";
    position: absolute;
    inset: 0;
    z-index: -1;
    background-image:
        linear-gradient(rgb(255 255 255 / 4%) 1px, transparent 1px),
        linear-gradient(90deg, rgb(255 255 255 / 4%) 1px, transparent 1px);
    background-size: 42px 42px;
    mask-image: radial-gradient(ellipse 90% 90% at 70% 20%, black, transparent);
}

.deck-title {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.deck-title::before {
    content: "";
    display: inline-block;
    width: 0.6rem;
    height: 2.1rem;
    flex: 0 0 auto;
    border-radius: 999px;
    background: var(--deck-color, var(--accent));
}

/* The deck title lives inside the colored Summary banner now (like
   Home's own h1 inside .home-hero-copy), so it needs the same
   compact white styling instead of the page's default 2rem h1. The
   accent bar is shrunk to match. */
.summary-card-copy .deck-title {
    margin: 0 0 0.35rem;
    font-size: 1.4rem;
    color: #fff;
}

.summary-card-copy .deck-title::before {
    height: 1.5rem;
}


/* =========================================
   Submission list
   ========================================= */

.submission-table {
    min-width: 60rem;
    font-size: 0.85rem;
    /* Both needed for the sticky header below, same as the other
       sticky matrices: `border-collapse: separate` avoids sticky
       rendering glitches collapsed borders can cause, and
       `overflow: visible` cancels the generic `table { overflow:
       hidden; }` rule (rounded corners), which would otherwise make
       the <table> itself the nearest scrolling ancestor instead of
       .matrix-wrapper -- and since the table never scrolls
       internally, sticky would just sit inert. */
    border-collapse: separate;
    border-spacing: 0;
    overflow: visible;
}

.submission-table thead th {
    position: sticky;
    top: 0;
    z-index: 20;
    /* No background-clip: padding-box here -- the header's opaque
       background needs to paint under the cell's own (translucent,
       var(--border)) edge too, otherwise that thin border strip lets
       scrolled-past row content peek through it while scrolling. */
}

.submission-table th,
.submission-table td {
    padding: 0.45rem 0.7rem;
    vertical-align: middle;
}

.submission-table .deck-pill,
.submission-table .outcome-label {
    padding: 0.15rem 0.5rem;
    font-size: 0.76rem;
}

/* Was `.submission-table td:first-child` -- but that broke once the
   Submissions table gained a leading icon-link column (below), since
   the timestamp cell it was meant for is no longer first-child there.
   Named explicitly instead, and reused for the Contributors table's
   row-number column (its actual first cell), so both keep the exact
   same look they had before. */
.submission-table td.submission-time-cell,
.contributor-table td.contributor-rank-cell {
    white-space: nowrap;
    color: var(--text-muted);
}

/* Icon-only "view details" link column on the Submissions table.
   Placed first (rather than after Outcome) so it's visible without
   scrolling the table horizontally on narrow/mobile screens, where
   the later columns already require a horizontal scroll to reach. */
.submission-table th.submission-detail-heading,
.submission-table td.submission-detail-cell {
    width: 1px;
    padding-right: 0.4rem;
    padding-left: 0.6rem;
    text-align: center;
}

.submission-detail-link {
    display: inline-flex;
    color: var(--text-muted);
}

.submission-detail-link:hover,
.submission-detail-link:focus-visible {
    color: var(--accent);
}

.submission-detail-icon {
    width: 1.05rem;
    height: 1.05rem;
    fill: currentColor;
}

.submission-deck-cell {
    white-space: nowrap;
}

/* A pill, matching .outcome-label's shape, filled with the deck's
   true color (same strength as the matrix headers). */
.deck-pill {
    display: inline-block;
    padding: 0.2rem 0.6rem;

    background: var(--deck-color, var(--accent));
    border: 1px solid color-mix(
        in srgb,
        var(--deck-color, var(--accent)) 70%,
        black 20%
    );
    border-radius: 999px;

    color: var(--ink-on-deck);
    font-size: 0.82rem;
    font-weight: 700;
    text-decoration: none;
    white-space: nowrap;
}

.deck-pill:hover {
    color: var(--ink-on-deck);
    filter: brightness(1.08);
}

/* Narrower pills in the Overall Stats and Win Rate by Rank tables,
   to match those tables' otherwise compact cell sizing. */
.overview-stats-table .deck-pill,
.deck-win-rate-matrix .deck-pill {
    padding: 0.08rem 0.35rem;
    font-size: 0.68rem;
}

/* The pill itself keeps `white-space: nowrap` (its base style) even
   though its cell (.deck-matrix-hero) allows wrapping -- a nowrap
   inline-block can't be broken onto a second line by the parent, so
   a long deck name (e.g. "Hoplomachus: Victorum", "Baba Yaga") just
   overflowed the pill sideways into the next column instead of
   respecting the cell's max-width. Capping the pill to the cell's
   own width and truncating with an ellipsis keeps it fully contained
   on any screen size; the full name is still one tap/click away via
   the pill's own link to that deck's page. */
.deck-win-rate-matrix .deck-pill {
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
}

.muted-text {
    color: var(--text-muted);
    font-style: italic;
}

/* Short blurb under a card's h2, explaining what the table below it
   shows -- same muted + italic treatment as .muted-text so it reads
   as a quiet aside rather than competing with the heading or the
   data itself. */
.section-description {
    color: var(--text-muted);
    font-style: italic;
    font-size: 0.9rem;
}

.outcome-label {
    display: inline-block;
    padding: 0.2rem 0.6rem;

    border: 1px solid var(--border);
    border-radius: 999px;

    /* The full outcome text (e.g. "I was defeated before reaching
       the castle") is available on hover via the title attribute -
       the pill itself just shows Win/Loss. On play_detail.html
       there's no title attribute (the full label is shown outright
       instead), so this cursor is overridden back to default there --
       see .play-detail-page .outcome-label below. */
    cursor: help;

    font-size: 0.82rem;
    font-weight: 600;
    white-space: nowrap;
}

.outcome-label-win {
    background: color-mix(
        in srgb,
        var(--success) 18%,
        var(--surface)
    );
    color: var(--success);
    border-color: color-mix(in srgb, var(--success) 55%, var(--border));
}

.outcome-label-loss {
    background: color-mix(
        in srgb,
        var(--danger) 16%,
        var(--surface)
    );
    color: var(--danger);
    border-color: color-mix(in srgb, var(--danger) 55%, var(--border));
}

.pagination {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem 1.25rem;

    margin-top: 1.25rem;
}

.pagination-summary {
    color: var(--text-muted);
    font-size: 0.88rem;
    white-space: nowrap;
}

.pagination-pages {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.35rem;
}

.pagination-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;

    min-width: 2.1rem;
    height: 2.1rem;
    padding: 0 0.5rem;

    background: transparent;
    border: 1px solid var(--border-strong);
    border-radius: var(--radius);
    color: var(--text);

    font-size: 0.88rem;
    font-weight: 600;
    text-decoration: none;

    transition:
        background-color 0.15s ease,
        border-color 0.15s ease;
}

.pagination-link:hover {
    background: var(--surface-hover);
    border-color: var(--border-strong);
    color: var(--text);
}

.pagination-link-current,
.pagination-link-current:hover {
    background: var(--accent);
    border-color: var(--accent);
    color: var(--ink-on-deck);
}

.pagination-ellipsis {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 2.1rem;
    height: 2.1rem;
    color: var(--text-muted);
}

@media (max-width: 600px) {
    .pagination {
        justify-content: center;
        text-align: center;
    }
}

/* =========================================
   Home hero banner
   ========================================= */

.home-hero {
    position: relative;
    overflow: hidden;
    isolation: isolate;

    margin-bottom: 1.5rem;
    padding: 1.75rem;

    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 1.25rem;

    background:
        radial-gradient(
            ellipse 700px 320px at 90% 0%,
            color-mix(in srgb, var(--accent) 18%, transparent),
            transparent 60%
        ),
        linear-gradient(
            135deg,
            var(--banner-from),
            var(--banner-via) 55%,
            var(--banner-to)
        );
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow);
}

.home-hero::after {
    content: "";
    position: absolute;
    inset: 0;
    z-index: -1;
    background-image:
        linear-gradient(rgb(255 255 255 / 4%) 1px, transparent 1px),
        linear-gradient(90deg, rgb(255 255 255 / 4%) 1px, transparent 1px);
    background-size: 42px 42px;
    mask-image: radial-gradient(ellipse 90% 90% at 70% 20%, black, transparent);
}

.home-hero-copy {
    max-width: 22rem;
}

.home-hero-copy h1 {
    margin-bottom: 0.35rem;
    color: #fff;
    font-size: 1.4rem;
}

/* On wide screens there's plenty of spare room in the banner, so
   the heading can afford to be a lot more prominent -- on Home and
   on the Deck Detail summary banner alike. Mobile keeps the compact
   size set above/below, unchanged. */
@media (min-width: 900px) {
    .home-hero-copy,
    .summary-card-copy {
        max-width: 30rem;
    }

    .home-hero-copy h1,
    .summary-card-copy .deck-title {
        font-size: 2.1rem;
    }

    .summary-card-copy .deck-title::before {
        height: 1.9rem;
    }
}

.home-hero-copy p {
    margin: 0;
    color: rgb(255 255 255 / 78%);
    font-size: 0.72rem;
}

.home-hero-stats-wrap {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.home-hero-stats {
    display: flex;
    flex-wrap: wrap;
    gap: 1.05rem 1.6rem;
}

.home-hero-latest {
    margin: 0;
    color: rgb(255 255 255 / 60%);
    font-size: 0.7rem;
}

.home-hero-latest a {
    color: inherit;
    text-decoration: none;
}

.home-hero-latest a:hover {
    text-decoration: underline;
    text-underline-offset: 2px;
}

.home-hero-latest strong {
    color: rgb(255 255 255 / 90%);
    font-weight: 600;
}

.hero-stat {
    display: flex;
    flex-direction: column;
    gap: 0.1rem;
}

.hero-stat strong {
    font-size: 1.33rem;
    color: #fff;
}

.hero-stat span {
    color: rgb(255 255 255 / 65%);
    font-size: 0.58rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

/* The trending-deck stat uses a colored .deck-pill instead of plain
   text — the extra class here (plus .deck-pill) outweighs the
   ".hero-stat strong" rule above, which would otherwise blow the
   pill up to the same huge size as the numeric stats. */
.hero-stat-deck-pill.deck-pill {
    color: var(--ink-on-deck);
    font-size: 0.74rem;
    padding: 0.18rem 0.55rem;
}

@media (max-width: 700px) {
    .home-hero {
        padding: 1.25rem;
    }
}

/* =========================================
   Deck selection home page
   ========================================= */

.deck-category-grid {
    display: grid;
    gap: 1.75rem;
}

.deck-category-card {
    padding: 1.75rem;
}

.deck-category-card > h2 {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin: 0 0 1.5rem;
    padding-bottom: 0.75rem;
    border-bottom: 1px solid var(--border);
}

.deck-category-card > h2::before {
    content: "";
    width: 0.45rem;
    height: 1.5rem;
    flex: 0 0 auto;
    border-radius: 999px;
    background: var(--accent);
}

.deck-category-card .deck-grid {
    grid-template-columns: repeat(auto-fill, minmax(170px, 1fr));
    /* "start", not "stretch": the cards' own aspect-ratio should
       decide their height. Both card children are absolutely
       positioned (no in-flow content), so grid's default stretch
       would otherwise collapse each row to near-zero height. */
    align-items: start;
}

/* Individual deck card — a portrait "poster", so the deck art
   (icon or, once added, a real box-cover photo) can fill almost
   the whole card, like a game box on a shelf. */

.deck-category-card .deck-card {
    position: relative;
    aspect-ratio: 3 / 4;
    min-width: 0;
    overflow: hidden;

    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);

    transition:
        transform 0.16s ease,
        box-shadow 0.16s ease,
        border-color 0.16s ease;
}

.deck-category-card .deck-card:hover {
    transform: translateY(-3px);
    border-color: color-mix(in srgb, var(--deck-color, var(--accent)) 55%, var(--border-strong));
    box-shadow: 0 14px 30px rgb(0 0 0 / 45%);
}

/* =========================================
   Deck card key art
   Prefers a real box-cover photo (see games/deck-art/PROMPTS.md
   for how to add one); falls back to a small original glyph per
   deck (see games_extras.py), colored via currentColor, centered
   on a subtly tinted panel. Either way it fills the whole card.
   ========================================= */

.deck-category-card .deck-card-art {
    position: absolute;
    inset: 0;

    display: flex;
    align-items: center;
    justify-content: center;

    background: color-mix(
        in srgb,
        var(--deck-color, var(--accent)) 14%,
        var(--surface-hover)
    );
}

.deck-card-icon {
    width: 3.5rem;
    height: 3.5rem;
    color: var(--deck-color, var(--accent));
    filter: drop-shadow(0 1px 1px rgb(0 0 0 / 25%));
}

/* Real box-cover photo, once one exists for this deck */
.deck-category-card .deck-card-art.deck-card-art-photo {
    background-color: var(--surface-hover);
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
}

/* Title + actions, anchored over the bottom of the art on a
   dark scrim so they stay legible over any photo or color. */
.deck-category-card .deck-card-content {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 2;

    padding: 2.25rem 0.85rem 0.85rem;

    background: linear-gradient(
        to top,
        rgb(4 5 8 / 88%) 0%,
        rgb(4 5 8 / 70%) 45%,
        transparent 100%
    );
}

.deck-category-card .deck-card h3 {
    margin: 0 0 0.6rem;
    padding: 0;

    color: #fff;
    font-size: 1rem;
    line-height: 1.25;
    text-shadow: 0 1px 3px rgb(0 0 0 / 55%);
}

/* Deck-card buttons */

.deck-card-actions {
    display: grid;
    grid-template-columns: 1fr;
    gap: 0.4rem;
}

.deck-card-actions .button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 0;
    padding: 0.45rem 0.5rem;

    background: transparent;
    border: 1px solid var(--border-strong);
    color: var(--text);

    text-align: center;
    line-height: 1.25;
    font-size: 0.8rem;

    transition:
        background-color 0.16s ease,
        border-color 0.16s ease,
        transform 0.16s ease;
}

/*
Supports all button class names used during development:
- deck-select-button
- deck-action
- deck-card-primary-action
- deck-card-secondary-action
- button-secondary
*/

.deck-card-actions .deck-select-button,
.deck-card-actions .deck-action,
.deck-card-actions .deck-card-primary-action {
    background: var(--deck-color, var(--accent));
    border-color: transparent;
    color: var(--ink-on-deck);
    font-weight: 700;
}

.deck-card-actions .button-secondary,
.deck-card-actions .deck-card-secondary-action {
    background: transparent;
}

.deck-card-actions .button:hover {
    filter: brightness(1.08);
    transform: translateY(-1px);
}

.deck-card-actions .button-secondary:hover,
.deck-card-actions .deck-card-secondary-action:hover {
    background: var(--surface-hover);
    border-color: var(--border-strong);
}

/* Home-page responsive behavior */
/* .deck-category-card .deck-grid uses auto-fill above, so the
   poster count adapts on its own — no manual breakpoints needed. */

@media (max-width: 600px) {
    .deck-category-card {
        padding: 1.25rem;
    }

    .deck-category-card .deck-grid {
        grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    }
}

/* =========================================
   Play submission form
   ========================================= */

.play-form-page,
.play-detail-page {
    width: min(52rem, 100%);
    margin: 0 auto;
}

/* No title attribute on this page's outcome pill (its full label is
   shown outright as a caption instead), so the "hover for more"
   help-cursor from .outcome-label would be misleading here. */
.play-detail-page .outcome-label {
    cursor: default;
}

/* Back link */

.back-link {
    margin: 0 0 1rem;
}

.back-link a {
    font-weight: 600;
    text-decoration: none;
}

.back-link a::before {
    content: "←";
    margin-right: 0.4rem;
}

.back-link a:hover {
    text-decoration: underline;
}

/* Header */

.play-form-header {
    margin-bottom: 1.5rem;
}

.play-form-header h1 {
    margin-bottom: 0.4rem;
}

.play-form-header p {
    margin: 0;
    color: var(--text-muted);
}

/* Main form layout */

.play-form {
    display: grid;
    gap: 1.5rem;
}

/* Form sections */

.play-form-section {
    padding: 1.5rem;

    background: var(--surface);
    border: 1px solid var(--border);
    border-top: 3px solid var(--deck-color, var(--accent));
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
}

.play-form-section h2 {
    margin: 0 0 1.25rem;
    padding-bottom: 0.75rem;

    border-bottom: 1px solid var(--border);

    font-size: 1.2rem;
}

/* Form field grid */

.play-form-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1.15rem 1.25rem;
}

.form-field {
    min-width: 0;
}

.form-field-wide {
    grid-column: 1 / -1;
}

/* Labels */

.form-field label {
    display: block;
    margin-bottom: 0.4rem;
    font-weight: 650;
}

/* Inputs */

.form-field input:not([type="checkbox"]):not([type="radio"]),
.form-field select,
.form-field textarea {
    display: block;
    width: 100%;
    max-width: none;

    padding: 0.7rem 0.8rem;

    background: var(--paper);
    color: var(--text);

    border: 1px solid var(--border-strong);
    border-radius: var(--radius);

    font: inherit;
}

.form-field input:not([type="checkbox"]):not([type="radio"]),
.form-field select {
    min-height: 2.8rem;
}

.form-field select {
    /* Native <select> rendering ignores our padding/height on some
       browsers unless the built-in appearance is switched off, so
       without this it ends up visibly taller than the text inputs
       next to it (same fix already used for .submission-filter-field
       select). */
    appearance: none;
    -webkit-appearance: none;
    padding-right: 2.2rem;

    background-image:
        linear-gradient(45deg, transparent 50%, var(--text-muted) 50%),
        linear-gradient(135deg, var(--text-muted) 50%, transparent 50%);
    background-position:
        calc(100% - 20px) calc(50% - 2px),
        calc(100% - 15px) calc(50% - 2px);
    background-size: 5px 5px, 5px 5px;
    background-repeat: no-repeat;
}

.form-field textarea {
    min-height: 7rem;
    resize: vertical;
}

/* Hero combobox -- the real <select> stays in the DOM (it's what
   actually submits) but is visually replaced by the text input +
   dropdown list built on top of it. */
.hero-combobox select {
    display: none;
}

.hero-combobox-control {
    position: relative;
}

/* Scoped under .hero-combobox (rather than just .hero-combobox-list)
   so this beats the generic ".form-field ul" rule elsewhere, which
   would otherwise win the cascade (it's more specific than a bare
   class selector) and force this into a gapped CSS grid -- and,
   worse, override "display: none" while [hidden] is set, since that
   rule doesn't touch `display` conditionally the way [hidden] needs
   to. */
.hero-combobox .hero-combobox-list {
    display: block;
    position: absolute;
    z-index: 20;
    top: calc(100% + 0.3rem);
    left: 0;
    right: 0;

    max-height: 16rem;
    overflow-y: auto;
    margin: 0;
    padding: 0.35rem 0;

    list-style: none;

    background: var(--paper);
    border: 1px solid var(--border-strong);
    border-radius: var(--radius);
    box-shadow: 0 12px 28px rgb(0 0 0 / 35%);
}

.hero-combobox .hero-combobox-list[hidden] {
    display: none;
}

.hero-combobox .hero-combobox-group-label {
    padding: 0.35rem 0.9rem 0.2rem;

    color: var(--text-muted);
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.hero-combobox .hero-combobox-option {
    padding: 0.3rem 0.9rem;
    cursor: pointer;
}

.hero-combobox .hero-combobox-option:hover,
.hero-combobox .hero-combobox-option:active {
    background: var(--surface-hover);
}

.hero-combobox .hero-combobox-empty {
    padding: 0.5rem 0.9rem;
    color: var(--text-muted);
}

.form-field input:not([type="checkbox"]):not([type="radio"]):hover,
.form-field select:hover,
.form-field textarea:hover {
    border-color: color-mix(
        in srgb,
        var(--deck-color, var(--accent)) 55%,
        var(--border-strong)
    );
}

.form-field input:not([type="checkbox"]):not([type="radio"]):focus,
.form-field select:focus,
.form-field textarea:focus {
    border-color: var(--deck-color, var(--accent));

    outline: 3px solid color-mix(
        in srgb,
        var(--deck-color, var(--accent)) 22%,
        transparent
    );
}

.form-field input[type="checkbox"],
.form-field input[type="radio"] {
    width: 1.1rem;
    height: 1.1rem;
    min-height: 0;
    margin: 0;

    padding: 0;
    flex: 0 0 auto;

    accent-color: var(--deck-color, var(--accent));
}

/* Help and error text */

.form-field .helptext {
    display: block;
    margin-top: 0.4rem;

    color: var(--text-muted);
    font-size: 0.88rem;
}

.form-field .errorlist {
    margin: 0.45rem 0 0;
    padding: 0;

    color: var(--danger);
    font-size: 0.9rem;
    list-style: none;
}

.form-field .errorlist li {
    margin: 0;
}

.quantity-grid-error {
    margin: 0.45rem 0 0;
    color: var(--danger);
    font-size: 0.9rem;
}

/* Form-wide errors */

.form-errors {
    padding: 1rem;

    background: color-mix(
        in srgb,
        var(--danger) 14%,
        var(--surface)
    );

    border: 1px solid var(--danger);
    border-radius: var(--radius);
}

.form-errors .errorlist {
    margin: 0;
}

/* Checkbox and radio question groups */

.form-field ul {
    display: grid;
    gap: 0.55rem;

    margin: 0.5rem 0 0;
    padding: 0;

    list-style: none;
}

.form-field ul li {
    margin: 0;
}

.form-field ul label {
    display: flex;
    align-items: center;
    gap: 0.65rem;

    margin: 0;
    padding: 0.7rem 0.8rem;

    background: var(--paper);
    border: 1px solid var(--border);
    border-radius: var(--radius);

    font-weight: 500;
    cursor: pointer;

    transition:
        border-color 0.15s ease,
        background-color 0.15s ease;
}

.form-field ul label:hover {
    background: color-mix(
        in srgb,
        var(--deck-color, var(--accent)) 10%,
        var(--surface)
    );

    border-color: var(--deck-color, var(--accent));
}

.form-field ul input[type="checkbox"],
.form-field ul input[type="radio"] {
    width: auto;
    min-height: auto;
    margin: 0;
    flex: 0 0 auto;
}

/* Submit actions */

.play-form-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
}

.play-form-actions .button {
    display: inline-flex;
    align-items: center;
    justify-content: center;

    min-width: 9rem;
    min-height: 2.8rem;
}

.play-submit-button {
    background: var(--accent);
    border: 1px solid var(--accent);
    color: #1a1305;
}

.play-submit-button:hover {
    background: var(--accent-hover);
    border-color: var(--accent-hover);
    color: #1a1305;
}

/* Responsive form */

@media (max-width: 650px) {
    .play-form-grid {
        grid-template-columns: 1fr;
    }

    .form-field-wide {
        grid-column: auto;
    }

    .play-form-section {
        padding: 1.15rem;
    }

    .play-form-actions {
        display: grid;
        grid-template-columns: 1fr;
    }

    .play-form-actions .button {
        width: 100%;
    }
}

/* =========================================
   Deck-specific question separation
   ========================================= */

.play-form-question-section .form-field {
    padding-bottom: 1.4rem;
    margin-bottom: 0.25rem;
    border-bottom: 1px solid var(--border);
}

.play-form-question-section .form-field:last-child {
    padding-bottom: 0;
    margin-bottom: 0;
    border-bottom: none;
}

/* Main question labels */

.play-form-question-section .form-field > label {
    margin-bottom: 0.65rem;
    font-size: 1rem;
    font-weight: 650;
    line-height: 1.35;
}

/* =========================================
   Checkbox and radio choices
   ========================================= */

.form-field .choice-list,
.form-field ul {
    display: grid;
    grid-template-columns: 1fr;
    gap: 0.5rem;

    margin: 0;
    padding: 0;

    list-style: none;
}

.form-field .choice-list-two-columns {
    grid-template-columns: repeat(
        2,
        minmax(0, 1fr)
    );
}

.form-field .choice-list li,
.form-field ul li {
    min-width: 0;
    margin: 0;
}

/*
Choice labels must not inherit the bold style
used by the main question label.
*/

.form-field .choice-list label,
.form-field ul label {
    display: flex;
    align-items: flex-start;
    gap: 0.6rem;

    width: 100%;
    margin: 0;
    padding: 0.6rem 0.7rem;

    background: var(--paper);
    border: 1px solid var(--border);
    border-radius: var(--radius);

    color: var(--text);
    font-size: 0.9rem;
    font-weight: 400;
    line-height: 1.35;

    cursor: pointer;

    transition:
        background-color 0.15s ease,
        border-color 0.15s ease;
}

.form-field .choice-list label:hover,
.form-field ul label:hover {
    background: color-mix(
        in srgb,
        var(--deck-color, var(--accent)) 10%,
        var(--surface)
    );

    border-color: var(
        --deck-color,
        var(--accent)
    );
}

.form-field input[type="checkbox"],
.form-field input[type="radio"] {
    width: 1.05rem;
    height: 1.05rem;
    min-height: 0;
    flex: 0 0 auto;

    margin: 0.1rem 0 0;
    padding: 0;

    accent-color: var(
        --deck-color,
        var(--accent)
    );
}

/* Return long choice lists to one column on small screens */

@media (max-width: 700px) {
    .form-field .choice-list-two-columns {
        grid-template-columns: 1fr;
    }
}

/* =========================================
   Achievements
   ========================================= */

.achievement-category-grid {
    display: grid;
    gap: 1.75rem;
}

/* .card's own margin-bottom would stack on top of the grid's gap
   above and nearly double the space between category cards -- the
   grid already spaces them, so drop the redundant margin here. */
.achievement-category {
    margin-bottom: 0;
}

/* The category header is now the <details> toggle itself (see
   achievement_list.html) -- clicking anywhere in this row
   expands/collapses that category's achievement-grid below, instead
   of the deck-pill that used to sit here (redundant with the
   category name, which is usually the deck's name already). */
.achievement-category > summary {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin: 0 0 1.5rem;
    padding-bottom: 0.75rem;
    border-bottom: 1px solid var(--border);

    cursor: pointer;
    list-style: none;
}

.achievement-category > summary::-webkit-details-marker {
    display: none;
}

/* Collapsed: there's no achievement-grid below to lead into anymore,
   so the divider (and the margin that made room for it) is just dead
   air under the title -- drop both so the closed card hugs its
   header instead of keeping a slab of empty space the size of the
   old divider gap. */
.achievement-category:not([open]) > summary {
    margin-bottom: 0;
    padding-bottom: 0;
    border-bottom: none;
}

.achievement-category > summary::before {
    content: "";
    width: 0.45rem;
    height: 1.5rem;
    flex: 0 0 auto;
    border-radius: 999px;
    background: var(--deck-color, var(--accent));
}

.achievement-category > summary h2 {
    margin: 0;
}

/* Expand/collapse chevron, pushed to the far right -- same treatment
   as the burger menu's collapsible deck-category groups (see
   .burger-menu-subgroup > summary::after). */
.achievement-category > summary::after {
    content: "";
    margin-left: auto;
    width: 0.5rem;
    height: 0.5rem;
    flex: 0 0 auto;

    border-right: 1.5px solid currentColor;
    border-bottom: 1.5px solid currentColor;
    transform: rotate(45deg) translateY(-2px);
    transition: transform 0.15s ease;
}

.achievement-category[open] > summary::after {
    transform: rotate(-135deg) translateY(2px);
}

.achievement-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 1rem;
}

.achievement-card {
    position: relative;
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
    min-width: 0;

    padding: 1.1rem 1.2rem;

    background: var(--paper);
    border: 1px solid var(--border);
    border-left: 3px solid var(--deck-color, var(--accent));
    border-radius: var(--radius);

    transition:
        transform 0.15s ease,
        border-color 0.15s ease,
        background-color 0.15s ease;
}

.achievement-card:hover {
    transform: translateY(-2px);
    background: var(--surface-hover);
}

.achievement-card h3 {
    margin: 0;
    font-size: 1rem;
}

.achievement-card p {
    margin: 0;
    color: var(--text-muted);
    font-size: 0.88rem;
    line-height: 1.45;
}

/* Earned-achievement highlight, shown once a player name is entered
   above. Reuses the deck color already flowing into this card via
   --deck-color (set on the .achievement-category section) for
   deck-specific achievements, falling back to the neutral accent for
   universal ones -- same fallback the card's left border already
   uses. */
.achievement-card.earned {
    padding-right: 2.4rem;
    background: color-mix(
        in srgb,
        var(--deck-color, var(--accent)) 12%,
        var(--paper)
    );
    border-color: color-mix(
        in srgb,
        var(--deck-color, var(--accent)) 55%,
        var(--border)
    );
}

.achievement-card-status {
    position: absolute;
    top: 0.9rem;
    right: 0.9rem;

    display: inline-flex;
    align-items: center;
    justify-content: center;

    width: 1.3rem;
    height: 1.3rem;

    background: var(--deck-color, var(--accent));
    color: var(--ink-on-deck);
    border-radius: 999px;

    font-size: 0.75rem;
    font-weight: 700;
    line-height: 1;
}

/* Once a player is entered, dim the achievements they *haven't*
   earned rather than hiding them -- keeps the full list visible
   (still useful as a catalog) while making the earned ones stand
   out at a glance. */
.achievement-grid-filtered .achievement-card:not(.earned) {
    opacity: 0.55;
}

@media (max-width: 900px) {
    .achievement-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 600px) {
    .achievement-grid {
        grid-template-columns: 1fr;
    }
}

/* =========================================
   Contributor table
   ========================================= */

/* Otherwise identical to .submission-table (same class is applied
   alongside this one, in games/contributor_list.html, so font size,
   cell padding, and deck-pill sizing all come from there) -- this
   table just has two more columns, so it needs a bit more room
   before the wrapper's horizontal scroll should kick in. */
.contributor-table td.contributor-last-submission {
    white-space: nowrap;
}

.contributor-table {
    min-width: 70rem;
    /* Both needed for the sticky header below, same as the other
       sticky matrices: `border-collapse: separate` avoids sticky
       rendering glitches collapsed borders can cause, and
       `overflow: visible` cancels the generic `table { overflow:
       hidden; }` rule (rounded corners), which would otherwise make
       the <table> itself the nearest scrolling ancestor instead of
       .matrix-wrapper -- and since the table never scrolls
       internally, sticky would just sit inert. */
    border-collapse: separate;
    border-spacing: 0;
    overflow: visible;
}

.contributor-table thead th {
    position: sticky;
    top: 0;
    z-index: 20;
    /* No background-clip: padding-box here -- see the matching note
       on .submission-table thead th. */
}

/* "Rank" becomes "#" on mobile, where the column has far less room
   to spare -- both labels stay in the DOM, CSS just toggles which
   one is visible so screen readers only ever pick up the one
   actually shown (display: none removes the other from the a11y
   tree too), rather than reaching for JS to swap the text. */
.contributor-rank-header-short {
    display: none;
}

@media (max-width: 600px) {
    .contributor-rank-header-full {
        display: none;
    }

    .contributor-rank-header-short {
        display: inline;
    }

    /* "#" plus a one/two-digit number needs far less room than
       "Rank" did -- shrink the column to fit its content instead of
       whatever share of the (already horizontally-scrolling) table
       it would otherwise claim. Same width: 1px trick the
       Submissions table's icon-link column uses. */
    .contributor-table th.contributor-rank-header,
    .contributor-table td.contributor-rank-cell {
        width: 1px;
    }
}

/* Shared subtle-link treatment: bold weight (rather than the
   site-wide gold link color) marks these as clickable, so the link
   still reads at a glance inside a data table row without the gold
   competing with the rest of the row. Used for the contributor name,
   achievement count, and submission player name links. */
.subtle-link,
.contributor-name a {
    color: inherit;
    font-weight: 700;
    text-decoration: underline;
    text-decoration-color: var(--border-strong);
    text-underline-offset: 0.15em;
}

.subtle-link:hover,
.subtle-link:focus-visible,
.contributor-name a:hover,
.contributor-name a:focus-visible {
    color: var(--accent);
    text-decoration-color: currentColor;
}

/* Plays, Decks, and Achievements are short, scoreboard-style numbers
   -- centering them (header included, via .contributor-count-header)
   reads better than the left alignment every other column keeps,
   which is meant for longer, more varied content. */
.contributor-count {
    text-align: center;
}

.contributor-count-header {
    text-align: center;
}

/* "Achievements" becomes just the trophy glyph on mobile, same
   full/short swap as the Rank column's "Rank"/"#" above -- both stay
   in the DOM, CSS toggles which is visible (and hands screen readers
   the right one), see .sr-only. */
.contributor-achievements-header-short {
    display: none;
    align-items: center;
    justify-content: center;
}

@media (max-width: 600px) {
    .contributor-achievements-header-full {
        display: none;
    }

    .contributor-achievements-header-short {
        display: inline-flex;
    }
}

/* Achievement count is also a link to that contributor's filtered
   achievement page (same pattern as .contributor-name a), with a
   small trophy glyph so the cell reads as clickable at a glance
   rather than looking like the other, non-linked numeric cells. */
.contributor-achievement-link {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    /* Without this, "12 / 43" can break after the "/" once the cell
       is centered and no longer hugs the left edge -- inline-flex
       keeps the icon+text from wrapping onto separate lines, but not
       the text itself from wrapping internally. */
    white-space: nowrap;
}

.contributor-achievement-icon {
    width: 0.9em;
    height: 0.9em;
    flex-shrink: 0;
    fill: currentColor;
    opacity: 0.7;
}

/* Deck/hero/achievement/win highlights read like the site's
   .hero-stat / .interesting-fact patterns -- a bold headline value
   (plain text, or a deck-pill for Most Played Deck) with a smaller
   supporting line underneath, reused here instead of inventing a new
   visual language for the same kind of data. */
.contributor-stat-cell strong,
.contributor-stat-cell small {
    display: block;
}

/* Hero/achievement names can run long (e.g. a hero with a
   slash-separated alternate name), which was wrapping these cells
   onto 2-3 lines each and made every row in the table tall. Capping
   both lines to a single, truncated line keeps every row a
   consistent, compact height -- the full text is still available via
   the title tooltip (achievements) or the linked detail page
   (deck/hero/win). */
.contributor-stat-cell strong,
.contributor-stat-cell small {
    max-width: 14rem;
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
}

.contributor-stat-cell strong {
    font-weight: 600;
}

.contributor-stat-cell small {
    margin-top: 0.2rem;
    color: var(--text-muted);
    font-size: 0.75rem;
}

/* =========================================
   Sticky matrices (frozen header + frozen first column)
   ========================================= */

/* A bounded, both-axis scroll box is what makes the sticky
   header/column CSS below actually stick, and it gives the table a
   visible frame instead of sprawling the full width of its content
   across the page. */
.matrix-wrapper {
    position: relative;
    max-width: 100%;
    max-height: 80vh;
    overflow: auto;
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    background: var(--surface);
    box-shadow: var(--shadow-sm);
}

.hero-boss-matrix {
    width: max-content;
    min-width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    /* Cancels the generic `table { overflow: hidden; }` rule so
       .matrix-wrapper stays the nearest scrolling ancestor for the
       sticky th/td below. */
    overflow: visible;
}

/* Hero-Boss Matrix */
.hero-boss-matrix thead th {
    position: sticky;
    top: 0;
    z-index: 20;
}

.hero-boss-matrix tbody th.matrix-hero-heading {
    position: sticky;
    left: 0;
    z-index: 10;

    /* Same floating-above-scrolled-content effect as the sticky
       column headers' box-shadow (var(--shadow-sm), inherited from
       the generic `thead th` rule) -- but cast to the right instead
       of downward, since this header is pinned on the left edge and
       it's horizontal scrolling that slides matrix cells underneath
       it, not vertical. */
    box-shadow: 4px 0 14px rgb(0 0 0 / 35%);
}

.hero-boss-matrix thead th:first-child {
    position: sticky;
    top: 0;
    left: 0;
    z-index: 30;
    background: var(--surface-muted);
}

/* =========================================
   Error pages (404, 403 -- extend base.html
   normally, unlike 500.html, which is kept
   fully standalone -- see that template)
   ========================================= */

.error-page {
    max-width: 26rem;
    margin: 3rem auto;
    padding: 2.5rem 2rem;
    text-align: center;
}

.error-page-code {
    margin: 0 0 0.5rem;
    color: var(--text-muted);
    font-family: "Space Grotesk", "Inter", monospace;
    font-size: 2.75rem;
    font-weight: 700;
    letter-spacing: 0.02em;
}

.error-page h1 {
    margin: 0 0 0.75rem;
    font-size: 1.5rem;
}

.error-page > p:not(.error-page-code) {
    margin: 0 0 1.5rem;
    color: var(--text-muted);
}

/* =========================================
   Player Aid (per-deck refresher page)
   ========================================= */

.player-aid-subtitle {
    margin: 0.25rem 0 0;
    color: var(--text-muted);
    font-size: 0.95rem;
}

.player-aid-note {
    margin: 0.6rem 0 0;
    color: var(--text-muted);
    font-size: 0.9rem;
    line-height: 1.45;
}

.player-aid-toggle-all {
    margin-left: auto;
}

/* Header buttons: same compact size as the Filter button on the
   deck page. */
.player-aid-page .matrix-page-header .button,
.player-aid-toggle-all {
    padding: 0.35rem 0.75rem;
    font-size: 0.85rem;
}

.player-aid-chapter {
    margin-top: 0.75rem;
    border: 1px solid var(--border, rgba(255, 255, 255, 0.12));
    border-left: 6px solid var(--deck-color, var(--accent));
    border-radius: 0.6rem;
    background: var(--surface-muted);
}

/* Chapter title: a tinted band in the deck color, clearly above the
   phases inside it. */
.player-aid-chapter > summary {
    cursor: pointer;
    padding: 0.4rem 0.9rem;
    font-weight: 700;
    font-size: 1.05rem;
    list-style: none;
    background: color-mix(in srgb, var(--deck-color, var(--accent)) 22%, transparent);
}

.player-aid-chapter > summary {
    border-radius: 0.4rem 0.4rem 0.4rem 0.4rem;
}

.player-aid-chapter[open] > summary {
    border-radius: 0.4rem 0.4rem 0 0;
    border-bottom: 1px solid var(--border-strong);
}

.player-aid-chapter > summary::-webkit-details-marker {
    display: none;
}

.player-aid-chapter > summary::before {
    content: "\25B8";
    display: inline-block;
    margin-right: 0.5rem;
    color: var(--deck-color, var(--accent));
    transition: transform 0.15s;
}

.player-aid-chapter[open] > summary::before {
    transform: rotate(90deg);
}

.player-aid-body {
    padding: 0 0.8rem 0.7rem;
    font-size: 0.92rem;
    line-height: 1.4;
}

/* Nested section inside a chapter (e.g. one phase of the round). */
.player-aid-phase {
    margin: 0.6rem 0;
    border: 1px solid var(--border-strong);
    border-radius: 0.5rem;
    background: var(--page-background-alt);
}

/* Phase title: darker, neutral band so it reads as a level below the
   colored chapter band. */
.player-aid-phase > summary {
    cursor: pointer;
    padding: 0.3rem 0.8rem;
    font-weight: 600;
    list-style: none;
    background: rgb(255 255 255 / 6%);
}

.player-aid-phase > summary {
    border-radius: 0.4rem;
}

.player-aid-phase[open] > summary {
    border-radius: 0.4rem 0.4rem 0 0;
    border-bottom: 1px solid var(--border);
}

.player-aid-phase > summary::-webkit-details-marker {
    display: none;
}

.player-aid-phase > summary::before {
    content: "\25B8";
    display: inline-block;
    margin-right: 0.45rem;
    color: var(--deck-color, var(--accent));
    transition: transform 0.15s;
}

.player-aid-phase[open] > summary::before {
    transform: rotate(90deg);
}

.player-aid-phase > .player-aid-body {
    padding: 0 0.7rem 0.6rem;
}

/* Innermost level: a plain step inside a phase (not collapsible). */
.player-aid-step {
    margin: 0.7rem 0;
    padding-left: 0.5rem;
    border-left: 2px solid var(--border-strong);
}

.player-aid-step-title {
    display: flex;
    align-items: center;
    font-weight: 600;
}

.player-aid-step-body {
    margin-top: 0.15rem;
    padding-left: 1.9rem;
}

/* Level 5: a lighter step nested inside a step. */
.player-aid-substep {
    margin: 0.5rem 0;
    border-left-width: 1px;
}

.player-aid-substep > .player-aid-step-title {
    font-weight: 500;
}

.player-aid-step-body > :first-child {
    margin-top: 0.2rem;
}

.player-aid-figure {
    margin: 0.6rem 0;
}

.player-aid-figure img {
    display: block;
    width: 100%;
    height: auto;
}

.player-aid-body a {
    color: var(--accent);
    text-decoration: underline;
    text-underline-offset: 2px;
}

.player-aid-body a:hover {
    text-decoration-thickness: 2px;
}

.player-aid-body ul {
    margin: 0.3rem 0;
    padding-left: 1.2rem;
}

.player-aid-body li {
    margin: 0.2rem 0;
}

.player-aid-body p {
    margin: 0.4rem 0;
}

.player-aid-body code {
    padding: 0.05rem 0.3rem;
    border-radius: 0.3rem;
    background: rgba(255, 255, 255, 0.08);
}

/* Player Aid extras: facts tiles, numbered phases, callouts, tables, boxes */
.player-aid-facts {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(8.5rem, 1fr));
    gap: 0.6rem;
    margin: 1rem 0 0.5rem;
}

.player-aid-fact {
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
    padding: 0.7rem 0.8rem;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-top: 3px solid var(--deck-color, var(--accent));
    border-radius: 0.6rem;
    background: rgba(255, 255, 255, 0.03);
}

.player-aid-fact strong {
    font-size: 1.6rem;
    line-height: 1.1;
    color: var(--deck-color, var(--accent));
    font-variant-numeric: tabular-nums;
}

.player-aid-fact span {
    font-size: 0.8rem;
    color: var(--text-muted);
}

.player-aid-num {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 1.5rem;
    height: 1.5rem;
    margin-right: 0.55rem;
    border-radius: 50%;
    background: var(--deck-color, var(--accent));
    color: var(--ink-on-deck, #111);
    font-size: 0.8rem;
    font-weight: 800;
    vertical-align: middle;
}

.player-aid-callout {
    margin: 0.7rem 0;
    padding: 0.6rem 0.9rem 0.55rem;
    border-left: 4px solid var(--accent);
    border-radius: 0.4rem;
    background: color-mix(in srgb, var(--accent) 12%, transparent);
}

.player-aid-callout p {
    margin: 0.25rem 0 0;
}

.player-aid-callout-label {
    display: block;
    color: var(--accent);
    font-size: 0.7rem;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.player-aid-errata {
    margin: 0.7rem 0;
    padding: 0.6rem 0.9rem 0.55rem;
    border-left: 4px solid #e0734f;
    border-radius: 0.4rem;
    background: rgba(224, 115, 79, 0.12);
}

.player-aid-errata p {
    margin: 0.25rem 0 0;
}

.player-aid-errata-label {
    display: block;
    color: #e0734f;
    font-size: 0.7rem;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.player-aid-errata-source {
    margin-left: 0.6rem;
    color: var(--text-muted);
    font-weight: 600;
    letter-spacing: 0.02em;
    text-transform: none;
}

.player-aid-faq {
    margin: 0.5rem 0;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 0.5rem;
    background: rgba(255, 255, 255, 0.025);
}

.player-aid-faq > summary {
    padding: 0.6rem 0.8rem;
    font-weight: 600;
    cursor: pointer;
    list-style: none;
}

.player-aid-faq > summary::-webkit-details-marker {
    display: none;
}

.player-aid-faq > summary::before {
    content: "\25B8";
    display: inline-block;
    margin-right: 0.5rem;
    color: var(--accent);
    transition: transform 0.15s;
}

.player-aid-faq[open] > summary {
    color: var(--accent);
}

.player-aid-faq[open] > summary::before {
    transform: rotate(90deg);
}

.player-aid-faq-a {
    padding: 0 0.8rem 0.7rem 2.1rem;
}

.player-aid-faq-a > :first-child {
    margin-top: 0;
}

.player-aid-faq-a p {
    margin: 0.3rem 0;
}

.player-aid-cols {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.7rem;
    margin: 0.5rem 0;
}

.player-aid-box {
    padding: 0.6rem 0.9rem;
    border: 1px solid transparent;
    border-radius: 0.5rem;
}

.player-aid-box p {
    margin: 0.3rem 0;
}

.player-aid-box-win {
    border-color: rgba(80, 190, 120, 0.5);
    background: rgba(80, 190, 120, 0.1);
}

.player-aid-box-loss {
    border-color: rgba(225, 90, 90, 0.5);
    background: rgba(225, 90, 90, 0.1);
}

.player-aid-table-wrap {
    margin: 0.6rem 0;
    overflow-x: auto;
}

.player-aid-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.92rem;
}

.player-aid-table th,
.player-aid-table td {
    padding: 0.4rem 0.7rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    text-align: left;
    vertical-align: top;
}

.player-aid-table th {
    color: var(--accent);
    font-size: 0.78rem;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.player-aid-table tbody tr:nth-child(even) {
    background: rgba(255, 255, 255, 0.025);
}

@media (max-width: 600px) {
    .player-aid-cols {
        grid-template-columns: 1fr;
    }

    .player-aid-body,
    .player-aid-phase > .player-aid-body {
        padding-left: 0.5rem;
        padding-right: 0.5rem;
    }

    .player-aid-chapter {
        border-left-width: 4px;
    }

    .player-aid-step-body {
        padding-left: 0;
    }
}

/* In the Player Aid, game symbols are highlighted in the site's gold
   accent (color-* symbols keep their own colors). */
.player-aid-page .sym {
    color: var(--accent);
}

/* Game symbols in text, e.g. :health: in a Player Aid. Single-color
   glyphs are masks tinted with the surrounding text color; the five
   color-* symbols keep their own colors. Token list: SYMBOLS in
   games/services/player_aid.py. */
.sym {
    display: inline-block;
    width: 1.15em;
    height: 1.15em;
    vertical-align: -0.2em;
    background-color: currentColor;
    -webkit-mask: var(--sym-url) center / contain no-repeat;
    mask: var(--sym-url) center / contain no-repeat;
}

.sym[class*="sym-color-"] {
    background: var(--sym-url) center / contain no-repeat;
    -webkit-mask: none;
    mask: none;
}

.sym-activate-additional-enemy { --sym-url: url("symbols/activate-additional-enemy.dd800f7cd1b2.svg"); }
.sym-after { --sym-url: url("symbols/after.c7806e44e94c.svg"); }
.sym-basic-hit { --sym-url: url("symbols/basic-hit.e075a0865d4c.svg"); }
.sym-color-blue { --sym-url: url("symbols/color-blue.aad6cd5c8248.svg"); }
.sym-color-green { --sym-url: url("symbols/color-green.f0e09324f6a9.svg"); }
.sym-color-purple { --sym-url: url("symbols/color-purple.7c6c027c8837.svg"); }
.sym-color-red { --sym-url: url("symbols/color-red.dda54c18f378.svg"); }
.sym-color-yellow { --sym-url: url("symbols/color-yellow.ad7448ce4343.svg"); }
.sym-crit { --sym-url: url("symbols/crit.1e922a50b17d.svg"); }
.sym-during { --sym-url: url("symbols/during.091e63736aac.svg"); }
.sym-enemy-damage { --sym-url: url("symbols/enemy-damage.38fa7973672e.svg"); }
.sym-enemy-health { --sym-url: url("symbols/enemy-health.f541bc4553b8.svg"); }
.sym-health { --sym-url: url("symbols/health.9a38a5eb52a9.svg"); }
.sym-instant { --sym-url: url("symbols/instant.375b3ed8f956.svg"); }
.sym-miss { --sym-url: url("symbols/miss.a6859c7bcc0d.svg"); }
.sym-ongoing { --sym-url: url("symbols/ongoing.4bb78be83128.svg"); }
.sym-recovery { --sym-url: url("symbols/recovery.4bb0287ce432.svg"); }
.sym-single-use { --sym-url: url("symbols/single-use.b172eeb3216e.svg"); }
.sym-special { --sym-url: url("symbols/special.30c710740dee.svg"); }
.sym-strategy { --sym-url: url("symbols/strategy.7c898aef2e2c.svg"); }
.sym-universal-hero { --sym-url: url("symbols/universal-hero.e910e0eeb5ea.svg"); }
.sym-twrs-gold { --sym-url: url("symbols/twrs-gold.1bb80eb18a90.svg"); }
.sym-twrs-armor { --sym-url: url("symbols/twrs-armor.a4fc15a7136b.svg"); }
.sym-twrs-bolster { --sym-url: url("symbols/twrs-bolster.6f15fb3f4fe9.svg"); }
.sym-twrs-torch { --sym-url: url("symbols/twrs-torch.cd0edd7207fe.svg"); }
.sym-tgr-node { --sym-url: url("symbols/tgr-node.045d85d42423.svg"); }
.sym-twg-north { --sym-url: url("symbols/twg-north.0dc00484530c.svg"); }
.sym-twg-south { --sym-url: url("symbols/twg-south.22bdaddaaa7d.svg"); }
.sym-twg-east { --sym-url: url("symbols/twg-east.a650fed5a056.svg"); }
.sym-twg-west { --sym-url: url("symbols/twg-west.0824649511cf.svg"); }
.sym-twg-wild { --sym-url: url("symbols/twg-wild.c9a0ffd00195.svg"); }
.sym-twg-ambush { --sym-url: url("symbols/twg-ambush.27d2893473d5.svg"); }
.sym-twg-merchant { --sym-url: url("symbols/twg-merchant.8a53a7cb1ea4.svg"); }
.sym-twg-bribe { --sym-url: url("symbols/twg-bribe.067d139259ed.svg"); }
.sym-twg-day { --sym-url: url("symbols/twg-day.506bfebe890b.svg"); }
.sym-twg-night { --sym-url: url("symbols/twg-night.0ac189474f77.svg"); }

/* =========================================
   Submission detail: hero banner
   Banner tinted subtly green (win) or red (loss), fading into the
   site's usual banner colors; "Hero vs. Boss" on the left, deck and
   outcome text on the right.
   ========================================= */

.play-detail-topbar {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-start;
    justify-content: space-between;
    gap: 0.75rem 1rem;
    margin-bottom: 1rem;
}

.play-detail-topbar .back-link {
    margin: 0;
}

.card.play-hero {
    --result-color: var(--success);

    /* Grid rather than a wrapping flex row: a long "Hero vs. Boss"
       title wraps inside its own column instead of pushing the
       deck/outcome column onto a line of its own. */
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    gap: 1rem 1.5rem;
    padding: 1.5rem 1.75rem;

    background:
        linear-gradient(
            100deg,
            color-mix(in srgb, var(--result-color) 22%, var(--banner-from)) 0%,
            var(--banner-via) 60%,
            var(--banner-to) 100%
        );
    border: 1px solid color-mix(in srgb, var(--result-color) 35%, var(--border));
}

.card.play-hero.play-hero-loss {
    --result-color: var(--danger);
}

.play-hero-copy {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    min-width: 0;
}

.play-hero-title {
    margin: 0;
    color: #fff;
    font-size: 1.5rem;
    line-height: 1.2;
    overflow-wrap: anywhere;
}

.play-hero-vs {
    color: rgb(255 255 255 / 55%);
    font-size: 0.7em;
}

.play-hero-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem 1.1rem;
    margin: 0;
    color: rgb(255 255 255 / 75%);
    font-size: 0.95rem;
}

.play-hero-result {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 0.6rem;
    max-width: 16rem;
    text-align: right;
}

.play-hero-outcome {
    margin: 0;
    color: color-mix(in srgb, var(--result-color) 80%, #fff);
    font-size: 0.95rem;
    font-weight: 600;
    line-height: 1.35;
}

/* "First win" milestone tile in the comparison card */
.interesting-fact.play-milestone {
    background: color-mix(in srgb, var(--accent) 16%, var(--surface));
    border-color: color-mix(in srgb, var(--accent) 50%, var(--border));
}

.interesting-fact.play-milestone strong {
    color: var(--accent);
}

@media (max-width: 700px) {
    .card.play-hero {
        grid-template-columns: minmax(0, 1fr);
        padding: 1.25rem;
    }

    .play-hero-title {
        font-size: 1.3rem;
    }

    .play-hero-result {
        align-items: flex-start;
        text-align: left;
    }
}

/* =========================================
   Submission detail: deck-specific answers, styled by question type
   ========================================= */

.answer-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem;
}

.answer-chip {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.2rem 0.65rem;

    background: color-mix(in srgb, var(--deck-color, var(--accent)) 22%, var(--surface));
    border: 1px solid color-mix(in srgb, var(--deck-color, var(--accent)) 45%, var(--border));
    border-radius: 999px;
    color: var(--text);
    font-size: 0.9rem;
    font-weight: 600;
}

.answer-chip-yes {
    background: color-mix(in srgb, var(--success) 18%, transparent);
    border-color: var(--success);
    color: var(--success);
}

.answer-chip-no {
    background: transparent;
    border-color: var(--border-strong);
    color: var(--text-muted);
}

.answer-chip-count {
    padding: 0 0.4rem;
    border-radius: 999px;
    background: rgb(0 0 0 / 30%);
    color: var(--accent);
    font-family: "Space Grotesk", "Inter", monospace;
    font-variant-numeric: tabular-nums;
}

.answer-ranked {
    margin: 0;
    padding: 0;
    list-style: none;
    counter-reset: answer-rank;
}

.answer-ranked li {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin: 0.25rem 0;
    font-weight: 600;
    counter-increment: answer-rank;
}

.answer-ranked li::before {
    content: counter(answer-rank);
    display: inline-flex;
    flex: 0 0 auto;
    align-items: center;
    justify-content: center;
    width: 1.4rem;
    height: 1.4rem;
    border-radius: 50%;
    background: color-mix(in srgb, var(--deck-color, var(--accent)) 35%, var(--surface));
    color: var(--text);
    font-size: 0.75rem;
    font-weight: 700;
}

/* =========================================
   Deck page: Achievements card (reuses the Achievements page cards)
   ========================================= */

.deck-achievements-intro {
    margin: 0 0 1rem;
    color: var(--text-muted);
    font-size: 0.9rem;
}

.deck-achievements-intro a {
    margin-left: 0.4rem;
    color: var(--accent);
    white-space: nowrap;
}

.achievement-share-note {
    color: var(--text-muted);
    font-size: 0.9rem;
}

/* Share of players who earned the achievement */
.achievement-share {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    margin-top: auto;
    padding-top: 0.4rem;
}

.achievement-share-bar {
    flex: 1 1 auto;
    height: 5px;
    border-radius: 999px;
    background: var(--border-strong);
    overflow: hidden;
}

.achievement-share-bar > span {
    display: block;
    height: 100%;
    border-radius: inherit;
    background: var(--deck-color, var(--accent));
}

.achievement-share-value {
    min-width: 2.6rem;
    color: var(--text);
    font-family: "Space Grotesk", "Inter", monospace;
    font-size: 0.85rem;
    font-variant-numeric: tabular-nums;
    font-weight: 700;
    text-align: right;
}

/* =========================================
   Sortable-column padding fix (keep last)
   ========================================= */

/* Several tables tighten their own header padding for compactness
   (.overview-stats-table, .hero-stats-table, .deck-matrix-corner,
   .deck-matrix-boss, .overview-rank-heading, etc.), and those rules
   were winning the cascade over .sortable-column's padding-right
   (either by matching specificity + later source order, or by
   outranking it outright with an element+class selector) -- squeezing
   the sort arrow back into the header text, worst on narrow/mobile
   columns where there's no extra whitespace to absorb the overlap.
   `th.sortable-column` matches or beats every one of those selectors'
   specificity, and staying the last rule in the file settles any tie
   in its favor, so the arrow always keeps its reserved space
   regardless of which table it's sorting. */
th.sortable-column {
    padding-right: 1.2rem;
}
