/* poker-replays.com â€” mobile-first base
   Design tokens up top; mobile styles are the default; desktop tweaks
   are progressive-enhancement inside min-width media queries. */

:root {
    --bg: #0f1216;
    --surface: #171b21;
    --surface-2: #1f242c;
    --text: #e7ebf0;
    --muted: #9aa4b1;
    --accent: #ffcc66;         /* warm gold â€” subtle trim, not a paint job */
    --accent-ink: #1a1206;     /* dark ink for text ON accent */
    --accent-soft: rgba(255, 204, 102, .18); /* wash for hover/borders */
    --border: #2a2f38;
    --radius: 8px;
    --max-w: 1100px;
    --font-body: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen, Ubuntu, sans-serif;

    /* Type scale â€” everything downstream references these so a single tweak
       rescales the whole UI. All in rem so it respects user browser zoom. */
    --fs-xs:  0.75rem;   /* 12px â€” meta labels, badges */
    --fs-sm:  0.8125rem; /* 13px â€” nav items, table headers */
    --fs-md:  0.9375rem; /* 15px â€” body links, buttons */
    --fs-base:1rem;      /* 16px â€” body */
    --fs-lg:  1.125rem;  /* 18px â€” card titles */
    --fs-xl:  1.375rem;  /* 22px â€” h2 mobile */
    --fs-2xl: 1.75rem;   /* 28px â€” h1 mobile / h2 desktop */
    --fs-3xl: 2.125rem;  /* 34px â€” h1 desktop */

    /* Compact chrome heights â€” big enough to be touch-friendly but not chunky */
    --tap:    2.5rem;    /* 40px â€” nav/button min height */
    --tap-sm: 2rem;      /* 32px â€” dense controls */
}

/* Scrollbars in the site's own colours: thin, dark track, border-coloured thumb. */
html { scrollbar-width: thin; scrollbar-color: var(--border) var(--bg); }
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 5px; border: 2px solid var(--bg); }
::-webkit-scrollbar-thumb:hover { background: var(--muted); }


* { box-sizing: border-box; }
html {
    -webkit-text-size-adjust: 100%;
    /* 16px root; use rem downstream and it scales with user zoom */
    font-size: 100%;
}
body {
    margin: 0;
    min-height: 100vh;
    min-height: 100dvh;
    display: flex;
    flex-direction: column;
    font-family: var(--font-body);
    font-size: var(--fs-base);
    line-height: 1.55;
    color: var(--text);
    background: var(--bg);
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
}
img, video, canvas { max-width: 100%; height: auto; display: block; }
a { color: var(--accent); text-decoration: none; }
a:hover, a:focus { text-decoration: underline; }
h1, h2, h3 { line-height: 1.2; margin: 0 0 .5em; font-weight: 700; letter-spacing: -0.005em; }
h1 { font-size: var(--fs-2xl); }
h2 { font-size: var(--fs-xl); }
h3 { font-size: var(--fs-lg); }
p { margin: 0 0 1em; }
code { background: var(--surface-2); padding: 0 .3em; border-radius: 4px; font-size: .9em; font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace; }

.container {
    width: 100%;
    max-width: var(--max-w);
    margin: 0 auto;
    padding: 0 1rem;
}
/* Give the layout more breathing room on large screens â€” bigger cards,
   bigger replayer, side-by-side content on the tournament page. */
@media (min-width: 1440px) { :root { --max-w: 1360px; } }
@media (min-width: 1680px) { :root { --max-w: 1520px; } }

.skip-link {
    position: absolute;
    left: -9999px;
}
.skip-link:focus {
    left: 1rem; top: 1rem;
    background: var(--accent); color: var(--accent-ink);
    padding: .5rem 1rem; border-radius: var(--radius);
    z-index: 100;
}

/* ---------- Site header â€” single row, never wraps ---------- */
.site-header {
    background: var(--surface);
    border-bottom: 1px solid var(--border);
    padding: .5rem 0;
}
.site-header .container {
    display: flex;
    align-items: center;
    gap: .5rem;
    flex-wrap: nowrap;      /* never wrap â€” everything shares one line */
    min-width: 0;
}
.brand {
    font-weight: 700;
    font-size: var(--fs-lg);
    color: var(--text);
    letter-spacing: -0.01em;
    flex-shrink: 0;
    margin-right: 1rem;      /* room between the logo and the first nav item (MTTs) */
}
.primary-nav {
    display: flex;
    gap: .125rem;
    flex: 1 1 auto;
    min-width: 0;
    overflow-x: auto;
    scrollbar-width: none;              /* hide chrome so it looks like a plain nav */
}
.primary-nav::-webkit-scrollbar { display: none; }
.primary-nav a {
    display: inline-flex;
    align-items: center;
    padding: 0 .625rem;
    min-height: var(--tap);
    font-size: var(--fs-sm);
    color: var(--text);
    border-radius: 6px;
    white-space: nowrap;
    line-height: 1;
}
.primary-nav a:hover { background: var(--surface-2); text-decoration: none; }
.nav-admin { color: var(--accent) !important; }

.account-nav { display: flex; align-items: center; gap: .25rem; flex-shrink: 0; }
.account-nav a {
    color: var(--text);
    padding: 0 .625rem;
    min-height: var(--tap);
    display: inline-flex; align-items: center;
    font-size: var(--fs-sm);
    border-radius: 6px;
    white-space: nowrap;
}
.account-nav a:hover { background: var(--surface-2); text-decoration: none; }
.account-nav .btn { color: var(--accent-ink); }
/* Login is a plain link and Join an accent pill right after it: without a gap of their own they read as one stuck-together control. */
.account-nav a + a.btn { margin-left: .5rem; }
/* The Register button is an accent button inside the account nav, and the
   nav's own hover (a dark surface) used to win over it: dark text on a dark
   pill. It hovers like every other .btn â€” a touch brighter, still accent. */
.account-nav a.btn:hover { background: var(--accent); color: var(--accent-ink); filter: brightness(1.1); }
.account-hello {
    color: var(--muted);
    font-size: var(--fs-sm);
    padding: 0 .25rem;
    white-space: nowrap;
    max-width: 10rem;
    overflow: hidden;
    text-overflow: ellipsis;
}
.btn-link {
    background: transparent; border: 0; color: var(--text); cursor: pointer;
    padding: 0 .625rem; min-height: var(--tap); font: inherit; font-size: var(--fs-sm);
    border-radius: 6px; white-space: nowrap; line-height: 1;
}
.btn-link:hover { background: var(--surface-2); }
/* On very narrow screens: hide the greeting to save room; account buttons stay */
@media (max-width: 520px) {
    .account-nav { gap: .5rem; }
    .account-nav a + a.btn { margin-left: .75rem; }
    .account-hello { display: none; }
    .brand { font-size: var(--fs-md); }
}

body > main.container { flex: 1 0 auto; }
body > .site-header, body > .site-footer, body > .as-seen { flex-shrink: 0; }
main.container { padding-top: 1.5rem; padding-bottom: 3rem; }

.hero {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.5rem;
    margin-bottom: 1.5rem;
}
.hero h1 { font-size: 1.75rem; }
.hero .lede { color: var(--muted); font-size: 1.05rem; }

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: var(--accent);
    color: var(--accent-ink);
    padding: 0 1rem;
    min-height: var(--tap);
    border-radius: 6px;
    font-weight: 600;
    font-size: var(--fs-sm);
    line-height: 1;
    white-space: nowrap;
    border: 0;
    cursor: pointer;
}
.btn:hover { text-decoration: none; filter: brightness(1.1); }
.btn-small { min-height: var(--tap-sm); padding: 0 .75rem; font-size: var(--fs-sm); }
.btn-ghost { background: transparent; border: 1px solid var(--border); color: var(--text); }
.btn-ghost:hover { background: var(--surface-2); filter: none; }

.placeholder {
    background: var(--surface);
    border: 1px dashed var(--border);
    border-radius: var(--radius);
    padding: 1rem 1.25rem;
    color: var(--muted);
}

.error-page { padding: 2rem 0; }
.site-footer {
    border-top: 1px solid var(--border);
    padding: 1rem 0;
    color: var(--muted);
    font-size: var(--fs-sm);
    margin-top: 3rem;
}
.footer-inner {
    display: flex;
    align-items: center;
    gap: .75rem 1.25rem;
    flex-wrap: wrap;   /* only wraps if it truly can't fit */
}
.footer-nav { display: flex; gap: .125rem; flex-wrap: nowrap; }
.footer-nav a {
    color: var(--text);
    padding: .25rem .5rem;
    border-radius: 4px;
    font-size: var(--fs-sm);
    white-space: nowrap;
}
.footer-nav a:hover { background: var(--surface); text-decoration: none; }
.footer-copy { margin: 0; font-size: var(--fs-sm); }
.footer-copy .muted { display: inline; }
@media (max-width: 520px) {
    .footer-copy .muted { display: block; margin-top: .15rem; }
}

/* ---------- Institutional / static pages ---------- */
.static-page { max-width: 720px; margin: 0 auto; padding: 1rem 0 2rem; }
.static-page header { margin-bottom: 1.5rem; }
/* About / Contact: the chip logo sits beside the title and lede. */
.static-page header.has-logo { display: grid; grid-template-columns: auto 1fr; column-gap: 1.1rem; align-items: center; }
.static-page header.has-logo .static-logo { grid-row: 1 / span 2; width: 72px; height: 72px; }
.static-page header.has-logo h1 { align-self: end; margin-bottom: .25rem; }
.static-page header.has-logo .lede { align-self: start; }
@media (max-width: 480px) { .static-page header.has-logo { column-gap: .8rem; } .static-page header.has-logo .static-logo { width: 52px; height: 52px; } }
.static-page h1 { margin-bottom: .5rem; }
.static-page .lede { color: var(--muted); font-size: 1.1rem; margin: 0 0 .5rem; }
.static-page h2 { margin: 1.75rem 0 .5rem; font-size: 1.25rem; }
.static-page ul { padding-left: 1.25rem; }
.static-page li { margin: .35rem 0; }
.static-page a:not(.btn) { color: var(--accent); }
/* The About page runs the full content width, like the listing pages; on wide screens its sections sit in two columns so
   the lines stay readable. */
.static-page-wide { max-width: none; }
.brand-domain { white-space: nowrap; }
@media (min-width: 1000px) {
    .static-columns { column-count: 2; column-gap: 3.5rem; }
    .static-columns > h2:first-child { margin-top: 0; }
    .static-columns h2 { break-after: avoid; }
    .static-columns p, .static-columns li { break-inside: avoid; }
}
.contact-grid { display: grid; gap: 1rem; grid-template-columns: 1fr; margin-bottom: 1.5rem; }
@media (min-width: 720px) { .contact-grid { grid-template-columns: repeat(3, 1fr); } }
.contact-card {
    background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
    padding: 1rem 1.25rem;
}
.contact-card h2 { margin: 0 0 .35rem; font-size: 1.05rem; }
.contact-card p { margin: 0 0 .4rem; }
.link-list { list-style: none; padding: 0; }

@media (min-width: 720px) {
    h1 { font-size: 2.25rem; }
    h2 { font-size: 1.6rem; }
    .site-header .container { flex-wrap: nowrap; }
}

/* ---------- Admin ---------- */
.admin-shell { padding: 0; }
.nav-admin { color: var(--accent) !important; }
.admin-nav {
    display: flex; gap: .25rem;
    background: var(--surface-2);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: .25rem;
    margin-bottom: 1.25rem;
    /* Horizontal scroll on mobile so the tab bar never wraps or squishes */
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: thin;
}
.admin-nav::-webkit-scrollbar { height: 6px; }
.admin-nav::-webkit-scrollbar-thumb { background: var(--border); border-radius: 3px; }
.admin-nav a {
    display: inline-flex; align-items: center; padding: .5rem .85rem; min-height: 44px;
    color: var(--text); border-radius: 6px; white-space: nowrap; font-size: .95rem;
}
.admin-nav a:hover { background: var(--surface); text-decoration: none; }
.admin-nav a.is-active { background: var(--surface); color: var(--accent); }
.stat-grid-6 { grid-template-columns: repeat(2, 1fr); }
@media (min-width: 720px)  { .stat-grid-6 { grid-template-columns: repeat(3, 1fr); } }
@media (min-width: 1080px) { .stat-grid-6 { grid-template-columns: repeat(6, 1fr); } }
.admin-panel {
    background: var(--surface); border: 1px solid var(--border);
    border-radius: var(--radius); padding: 1rem 1.25rem; margin-top: 1rem;
}
.panel-head { display: flex; align-items: baseline; justify-content: space-between; margin-bottom: .5rem; gap: 1rem; }
.panel-head h2 { margin: 0; font-size: 1.1rem; }
.panel-more { color: var(--muted); font-size: .9rem; }
.admin-split { display: grid; gap: 1rem; grid-template-columns: 1fr; margin-top: 1rem; }
@media (min-width: 900px) { .admin-split { grid-template-columns: 1fr 1fr; } }
.plain-list { list-style: none; padding: 0; margin: 0; }
.plain-list li { padding: .5rem 0; border-bottom: 1px solid var(--border); }
.plain-list li:last-child { border-bottom: 0; }
.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.chart-wrap { color: var(--accent); }
.signup-chart { width: 100%; height: auto; display: block; }
.chart-axis { display: flex; justify-content: space-between; font-size: .8rem; margin-top: .25rem; }
.inline-search {
    display: flex; gap: .5rem; align-items: center; margin: 0 0 1rem; flex-wrap: wrap;
}
.inline-search input[type=search] {
    flex: 1; min-width: 200px;
    background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
    color: var(--text); padding: .5rem .75rem; min-height: 44px; font: inherit;
}
.badge-user    { background: #1e3a8a; color: #bfdbfe; }
.badge-admin   { background: #7f1d1d; color: #fecaca; }
.badge-basic   { background: #134e4a; color: #99f6e4; }
.badge-pro     { background: #14532d; color: #bbf7d0; }
.badge-partner { background: #581c87; color: #e9d5ff; }
.badge-google  { background: #78350f; color: #fde68a; }
.badge-email   { background: #164e63; color: #a5f3fc; }
.badge-unverified { background: #7c2d12; color: #fed7aa; }
.admin-tags { display: flex; flex-wrap: wrap; gap: .25rem; }
.admin-flag { width: 20px; height: 14px; border-radius: 2px; object-fit: cover; vertical-align: -2px; box-shadow: 0 0 0 1px rgba(255,255,255,.12); margin-right: .25rem; }
.dashboard-tournament-row { display: flex; align-items: center; gap: .5rem; }
.dashboard-tournament-row .admin-t-icon { flex-shrink: 0; }
.form-inline-grid {
    display: grid; gap: .75rem; grid-template-columns: 1fr;
}
@media (min-width: 720px) { .form-inline-grid { grid-template-columns: 1fr 1fr; } }
.form-inline-grid .filter-actions { grid-column: 1 / -1; }

/* ---------- CMS (public) ---------- */
.post-grid {
    display: grid; gap: 1rem;
    grid-template-columns: 1fr;
}
@media (min-width: 640px) { .post-grid { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 1000px) { .post-grid { grid-template-columns: repeat(3, 1fr); } }
.post-card {
    background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
    overflow: hidden;
    display: flex; flex-direction: column;
    height: 100%;
}
.post-card:hover { border-color: #3a4150; }
.post-card-link { color: var(--text); display: flex; flex-direction: column; height: 100%; }
.post-card-link:hover { text-decoration: none; }
.post-card-thumb {
    aspect-ratio: 16/9;
    background: linear-gradient(135deg, #1b2028, #262c36);
    display: flex; align-items: center; justify-content: center;
    overflow: hidden;
    flex-shrink: 0;
}
.post-card-thumb img { width: 100%; height: 100%; object-fit: cover; }
.post-card-body {
    padding: .85rem 1rem 1rem;
    display: flex; flex-direction: column; flex: 1 1 auto;
    gap: .35rem;
}
.post-card-meta { color: var(--muted); font-size: .8rem; text-transform: uppercase; letter-spacing: .05em; }
.post-card-title {
    font-size: 1.05rem; margin: 0; line-height: 1.3;
    display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical;
    overflow: hidden;
    min-height: calc(2 * 1.3em);
}
.post-card-excerpt {
    color: var(--muted); font-size: .9rem; margin: 0;
    display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical;
    overflow: hidden;
}
.post-card-byline {
    color: var(--muted); font-size: .8rem;
    margin-top: auto;
    padding-top: .5rem;
    border-top: 1px solid var(--border);
}

.post-article { max-width: 900px; margin: 0 auto; padding: 1rem 0; }
@media (min-width: 1440px) {
    .post-article { max-width: 1120px; }
    .post-article .post-body { font-size: 1.125rem; }
}
@media (min-width: 1920px) {
    .post-article { max-width: 1200px; }
}
.post-head { margin-bottom: 1.25rem; }
.post-meta { color: var(--accent); font-size: .85rem; text-transform: uppercase; letter-spacing: .05em; margin-bottom: .5rem; }
.post-head h1 { font-size: 2rem; margin: 0 0 .35rem; }
.post-lede { color: var(--muted); font-size: 1.05rem; margin: 0 0 .75rem; }
.post-byline { display: flex; align-items: center; gap: .5rem; color: var(--muted); font-size: .95rem; margin: 0; }
.byline-avatar { border-radius: 50%; }
.post-hero { margin: 1.5rem -1rem; }
.post-hero img { width: 100%; height: auto; border-radius: var(--radius); }
.post-body { font-size: 1.05rem; line-height: 1.7; }
.post-body h2 { margin: 1.75rem 0 .65rem; font-size: 1.4rem; padding-left: .6rem; border-left: 3px solid var(--accent); }
.post-body h3 { margin: 1.5rem 0 .5rem; font-size: 1.2rem; }
.post-body p, .post-body ul, .post-body ol { margin: 0 0 1em; }
.post-body img { max-width: 100%; height: auto; border-radius: var(--radius); margin: 1rem 0; }
.post-body blockquote { border-left: 3px solid var(--accent); padding: .25rem 1rem; margin: 1.25rem 0; color: var(--muted); font-style: italic; }
.post-body a { color: var(--accent); }
/* A series' key facts. */
.post-body .post-facts { list-style: none; margin: 0 0 1rem; padding: .6rem .85rem; background: var(--surface); border: 1px solid var(--border); border-left: 3px solid var(--accent); border-radius: var(--radius); font-size: .92rem; line-height: 1.5; }
.post-body .post-facts li { margin: 0; }
.post-body .post-facts strong { color: var(--accent); font-weight: 600; }
/* Tables never scroll sideways: text cells wrap, numeric cells stay on one line, and on a
   phone a .stack table turns each row into a compact card of label/value pairs. */
.post-body .table-wrap { margin: 0 0 1rem; }
.post-body table { width: 100%; border-collapse: collapse; font-size: .82rem; line-height: 1.3; }
.post-body th, .post-body td { text-align: left; padding: .35rem .45rem; border-bottom: 1px solid var(--border); vertical-align: top; }
.post-body th { color: var(--accent); font-weight: 600; white-space: nowrap; border-bottom: 2px solid var(--accent-soft); background: var(--surface); }
.post-body tbody tr:nth-child(even) { background: rgba(255,255,255,.025); }
.post-body td.pos { color: #86efac; }
.post-body td.neg { color: #fca5a5; }
.post-body th.num, .post-body td.num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.post-body .table-note { text-align: right; font-size: .8rem; color: var(--muted); margin: -.6rem 0 1rem; }
@media (min-width: 900px) {
  .post-body .table-block.wide { width: min(1040px, calc(100vw - 3rem)); margin-left: 50%; transform: translateX(-50%); }
}
@media (max-width: 899px) {
  .post-body table.stack, .post-body table.stack tbody { display: block; }
  .post-body table.stack thead { display: none; }
  .post-body table.stack tr { display: grid; grid-template-columns: 1fr 1fr; gap: .1rem .9rem; padding: .5rem .65rem; margin: 0 0 .45rem; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); }
  .post-body table.stack td { display: block; border: 0; padding: 0; white-space: normal; }
  .post-body table.stack td:first-child { grid-column: 1 / -1; font-weight: 600; font-size: .88rem; margin-bottom: .25rem; color: var(--accent); }
  .post-body table.stack td.num { display: flex; justify-content: space-between; gap: .5rem; text-align: right; }
  .post-body table.stack td.num::before { content: attr(data-label); color: var(--muted); text-align: left; }
}
/* A collapsible aside, and the glossary inside it. */
.post-body details.note-card { background: var(--surface); border: 1px solid var(--border); border-left: 3px solid var(--accent); border-radius: var(--radius); padding: .55rem .85rem; margin: 0 0 1rem; }
.post-body details.note-card summary { cursor: pointer; font-weight: 600; font-size: .95rem; color: var(--accent); }
.post-body details.note-card[open] summary { margin-bottom: .4rem; }
.post-body details.note-card p:last-child { margin-bottom: 0; }
.post-body details.note-card dl { margin: 0; font-size: .88rem; line-height: 1.45; }
.post-body details.note-card dt { font-weight: 600; margin-top: .45rem; color: var(--text); }
.post-body details.note-card dd { margin: .05rem 0 0; color: var(--muted); }

.author-grid { display: grid; gap: 1rem; grid-template-columns: 1fr; }
@media (min-width: 640px) { .author-grid { grid-template-columns: repeat(2, 1fr); } }
.author-tile { display: flex; gap: 1rem; padding: 1rem; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); color: var(--text); }
.author-tile:hover { text-decoration: none; border-color: #3a4150; }
.author-avatar { border-radius: 50%; }
.author-avatar-placeholder { width: 80px; height: 80px; border-radius: 50%; background: var(--surface-2); display: flex; align-items: center; justify-content: center; font-size: 2rem; font-weight: 700; color: var(--muted); }
.author-name { font-weight: 700; }
.author-blurb { font-size: .9rem; margin: .25rem 0 0; }

.author-head { display: flex; gap: 1.25rem; align-items: flex-start; margin: 1rem 0 2rem; flex-wrap: wrap; }
.author-avatar-lg { border-radius: 50%; flex-shrink: 0; }
.author-bio { color: var(--text); }
.author-bio p { margin: 0 0 .5em; }
.author-links a { color: var(--muted); }

/* ---------- Admin CMS editor ---------- */
.post-form-grid { display: grid; gap: 1rem; grid-template-columns: 1fr; }
.post-image-option { margin: 0 0 1rem; }
.post-image-option label { display: flex; align-items: center; gap: .55rem; min-height: 44px; cursor: pointer; font-weight: 600; }
.post-image-option input[type="checkbox"] { width: 18px; height: 18px; margin: 0; flex: 0 0 auto; accent-color: var(--accent); }
.post-image-option p { margin: .2rem 0 0 1.675rem; color: var(--muted); font-size: .85rem; line-height: 1.45; }
@media (min-width: 900px) { .post-form-grid { grid-template-columns: 2fr 1fr; } }
.post-form textarea {
    background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
    color: var(--text); font: inherit; padding: .5rem .75rem; width: 100%;
}
.post-form input[type=text], .post-form select { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); color: var(--text); font: inherit; padding: .5rem .75rem; min-height: 44px; width: 100%; }
.editor { border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); padding: 0; margin: 1rem 0; }
.editor-toolbar { display: flex; gap: .5rem; justify-content: space-between; padding: .5rem; border-bottom: 1px solid var(--border); flex-wrap: wrap; }
.editor-tools, .editor-modes { display: flex; gap: .25rem; flex-wrap: wrap; }
.editor-tools button, .editor-modes button {
    background: var(--surface-2); border: 1px solid var(--border); color: var(--text);
    padding: .35rem .6rem; border-radius: 6px; cursor: pointer; font: inherit; min-height: 34px;
}
.editor-tools button:hover, .editor-modes button:hover { background: var(--bg); }
.editor-modes button.is-active { background: var(--accent); color: var(--accent-ink); border-color: transparent; }
.editor-visual { min-height: 320px; padding: 1rem; outline: none; }
.editor-visual:focus { background: rgba(255,255,255,0.02); }
.editor-visual h2 { margin: 1rem 0 .5rem; }
.editor-visual blockquote { border-left: 3px solid var(--accent); padding-left: 1rem; color: var(--muted); margin: 1rem 0; }
.editor-html { min-height: 320px; padding: 1rem; font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace; font-size: 13px; line-height: 1.5; border: 0; background: transparent; color: var(--text); outline: none; resize: vertical; }

.flash {
    padding: .75rem 1rem; border-radius: var(--radius);
    margin-bottom: 1rem; border: 1px solid var(--border);
    background: var(--surface);
}
.flash-success { border-color: #14532d; background: #052e16; color: #bbf7d0; }
.flash-error   { border-color: #7f1d1d; background: #2a0808; color: #fecaca; }

.stat-grid { display: grid; gap: .75rem; grid-template-columns: repeat(2, 1fr); margin-bottom: 1.5rem; }
@media (min-width: 720px) { .stat-grid { grid-template-columns: repeat(4, 1fr); } }
.stat {
    background: var(--surface); border: 1px solid var(--border);
    border-radius: var(--radius); padding: 1rem; display: flex; flex-direction: column; gap: .25rem;
}
.stat-num { font-size: 1.75rem; font-weight: 700; }
.stat-label { color: var(--muted); font-size: .9rem; }

.form { display: flex; flex-direction: column; gap: 1rem; max-width: 480px; }
/* "Continue with Google" on the sign-in and register pages: Google's own
   white button with the four-colour mark, then a hairline "or" before the
   email form. Shown only while auth.google is configured (AuthController). */
.btn-google {
    width: 100%; max-width: 480px; gap: .6rem;
    background: #fff; color: #1f1f1f; border: 1px solid #dadce0; font-weight: 500;
}
.btn-google:hover { background: #f3f4f6; filter: none; }
.btn-google svg { width: 18px; height: 18px; flex: none; }
.auth-or {
    display: flex; align-items: center; gap: .75rem; max-width: 480px; margin: 1rem 0;
    color: var(--muted); font-size: var(--fs-sm);
}
.auth-or::before, .auth-or::after { content: ''; flex: 1; border-top: 1px solid var(--border); }
.field { display: flex; flex-direction: column; gap: .3rem; }
.field > span { color: var(--muted); font-size: .9rem; }
.field input[type=file],
.field input[type=email],
.field input[type=password],
.field input[type=text],
.field select { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: .5rem .75rem; color: var(--text); font: inherit; min-height: 44px; }
.field small.error { color: #fca5a5; font-size: .8rem; }

.auth-shell { max-width: 460px; margin: 2rem auto; padding: 0 1rem; }
.auth-shell h1 { margin-bottom: .5rem; }
.auth-alt { margin-top: 1rem; text-align: center; }

.page-header { display: flex; align-items: center; justify-content: space-between; gap: 1rem; flex-wrap: wrap; }
.inline-form { display: inline; }

.table { width: 100%; border-collapse: collapse; font-size: .9rem; overflow-x: auto; display: block; }
@media (min-width: 720px) { .table { display: table; } }
.table th, .table td { padding: .5rem .6rem; text-align: left; border-bottom: 1px solid var(--border); vertical-align: top; }
.table th { color: var(--muted); font-weight: 600; }
.nowrap { white-space: nowrap; }
.error-cell { color: #fca5a5; font-family: monospace; font-size: .85rem; max-width: 30ch; overflow-wrap: anywhere; }
.badge { display: inline-block; padding: .1rem .5rem; border-radius: 999px; font-size: .8rem; background: var(--surface-2); color: var(--muted); }
.badge-pending { background: #422006; color: #fdba74; }
.badge-processing { background: #082f49; color: #7dd3fc; }
.badge-done { background: #052e16; color: #86efac; }
.badge-error { background: #2a0808; color: #fca5a5; }
.muted { color: var(--muted); }

/* ---------- Sections + cards ---------- */
.section { margin: 2rem 0; }
.section[data-video-views]:first-child { margin-top: 0; }
.section-head { display: flex; align-items: baseline; justify-content: space-between; margin-bottom: 1rem; }
.section-more { color: var(--muted); font-size: .95rem; white-space: nowrap; }

.card-grid {
    display: grid;
    gap: 1rem;
    grid-template-columns: 1fr;
}
@media (min-width: 560px)  { .card-grid { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 900px)  { .card-grid { grid-template-columns: repeat(3, 1fr); } }
@media (min-width: 1200px) { .card-grid { grid-template-columns: repeat(4, 1fr); } }
@media (min-width: 1500px) { .card-grid { grid-template-columns: repeat(5, 1fr); } }

/* ---------- Card rail (mobile horizontal scroll â†’ desktop grid) ---------- */
.card-rail {
    display: grid;
    gap: 1rem;
    grid-auto-flow: column;
    grid-auto-columns: 78%;   /* peek at the next card */
    overflow-x: auto;
    overflow-y: hidden;
    scroll-snap-type: x mandatory;
    -webkit-overflow-scrolling: touch;
    padding: .25rem .25rem 1rem;
    margin: 0 -1rem;
    padding-left: 1rem;
    padding-right: 1rem;
    scrollbar-width: thin;
    scrollbar-color: var(--border) transparent;
}
.card-rail::-webkit-scrollbar { height: 6px; }
.card-rail::-webkit-scrollbar-thumb { background: var(--border); border-radius: 3px; }
.card-rail > * { scroll-snap-align: start; }

/* Featured sites: the rooms we hold replays for, busiest first, each a chip
   that filters the archive down to that room. Scrolls on a phone, wraps on a
   wide screen â€” a chip is small enough that a second row beats a scrollbar. */
.site-section { margin-bottom: 1.25rem; }
.site-rail {
    display: flex;
    gap: .45rem;
    overflow-x: auto;
    margin: 0 -1rem;
    padding: .15rem 1rem .55rem;
    scrollbar-width: thin;
    scrollbar-color: var(--border) transparent;
}
.site-rail::-webkit-scrollbar { height: 6px; }
.site-rail::-webkit-scrollbar-thumb { background: var(--border); border-radius: 3px; }
.site-chip {
    display: flex;
    align-items: center;
    gap: .45rem;
    flex: 0 0 auto;
    padding: .3rem .7rem .3rem .3rem;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 999px;
    color: var(--text);
}
.site-chip:hover { border-color: var(--accent); background: var(--surface-2); text-decoration: none; }
/* The marks are room favicons: some transparent, some on their own disc. The
   tile behind them evens that out so one bright logo doesn't shout. */
.site-chip-mark { width: 30px; height: 30px; flex: 0 0 auto; border-radius: 50%; background: var(--surface-2); object-fit: contain; padding: 3px; }
.site-chip-name { font-size: .82rem; font-weight: 600; white-space: nowrap; }
@media (min-width: 900px) {
    .site-rail { flex-wrap: wrap; overflow: visible; margin: 0; padding: .15rem 0 0; }
}
@media (min-width: 560px)  { .card-rail { grid-auto-columns: 46%; } }
@media (min-width: 900px) {
    .card-rail {
        overflow: visible;
        grid-auto-flow: initial;
        grid-auto-columns: initial;
        grid-template-columns: repeat(4, 1fr);
        scroll-snap-type: none;
        margin: 0;
        padding: 0;
    }
}
@media (min-width: 1200px) { .card-rail { grid-template-columns: repeat(4, 1fr); } }
@media (min-width: 900px) {
    .card-rail-3 { grid-template-columns: repeat(3, 1fr) !important; }
}

/* ---------- Home split (main content + trending sidebar) ---------- */
.home-split {
    display: grid;
    gap: 1.5rem;
    margin-top: 2rem;
    grid-template-columns: 1fr;
}
.home-split .section { margin-top: 0; }
@media (min-width: 960px) {
    .home-split {
        grid-template-columns: minmax(0, 2fr) minmax(0, 1fr);
        align-items: start;
    }
}
.home-split-side {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1rem 1.25rem;
}
.trending-list {
    list-style: none; padding: 0; margin: 0;
    display: flex; flex-direction: column; gap: .5rem;
}
.trending-list li {
    display: grid;
    grid-template-columns: auto 1fr auto;
    align-items: center;
    gap: .75rem;
    padding: .5rem 0;
    border-bottom: 1px solid var(--border);
}
.trending-list li:last-child { border-bottom: 0; }
.trending-rank {
    display: inline-flex; align-items: center; justify-content: center;
    width: 26px; height: 26px; border-radius: 50%;
    background: var(--surface-2); color: var(--muted);
    font-size: .8rem; font-weight: 700;
    font-variant-numeric: tabular-nums;
    flex-shrink: 0;
}
.trending-title {
    color: var(--text);
    font-size: .95rem;
    line-height: 1.3;
    overflow: hidden; text-overflow: ellipsis; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical;
}
.trending-views { font-size: .8rem; white-space: nowrap; }

.card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
    transition: transform .1s ease, border-color .1s ease;
    display: flex;
    flex-direction: column;
    height: 100%;
}
.card:hover { transform: translateY(-1px); border-color: #3a4150; }
.card-link { display: flex; flex-direction: column; color: var(--text); height: 100%; }
.card-link:hover { text-decoration: none; }
.card-thumb {
    position: relative;
    aspect-ratio: 16/9;
    background: linear-gradient(135deg, #1b2028, #262c36);
    display: flex; align-items: center; justify-content: center;
    overflow: hidden;
    flex-shrink: 0;
}
.card-thumb img { width: 100%; height: 100%; object-fit: cover; }
.card-thumb-placeholder { color: #3f4756; font-size: 1.75rem; letter-spacing: .4em; }
.card-duration {
    position: absolute; right: .5rem; bottom: .5rem;
    background: rgba(0,0,0,.7); color: #fff; padding: .1rem .4rem;
    border-radius: 4px; font-size: .8rem; font-variant-numeric: tabular-nums;
}
.card-draft-pill {
    position: absolute; left: .5rem; top: .5rem;
    background: rgba(255, 204, 102, .95); color: #1a1a1a;
    padding: .1rem .5rem; border-radius: 4px;
    font-size: .72rem; font-weight: 700; letter-spacing: .05em;
    text-transform: uppercase;
}

/* Card body reserves fixed space for each slot so cards line up regardless of
   title length. Winner row is pinned to the bottom via margin-top:auto. */
.card-body {
    padding: .75rem 1rem 1rem;
    display: flex;
    flex-direction: column;
    flex: 1 1 auto;
    gap: .4rem;
    min-height: 0;
}
.card-title {
    font-size: 1rem;
    margin: 0;
    line-height: 1.3;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    /* Reserve exactly two lines so short titles don't pull the meta rows up */
    min-height: calc(2 * 1.3em);
}
.card-series {
    color: var(--muted);
    font-size: .85rem;
    display: flex;
    align-items: center;
    gap: .35rem;
    flex-wrap: wrap;
    min-width: 0;

    white-space: normal;
    min-height: 1.2em;
}
.card-series-name { min-width: 0; max-width: 100%; overflow-wrap: anywhere; }

.site-icon { width: 16px; height: 16px; display: inline-block; vertical-align: middle; border-radius: 3px; flex-shrink: 0; }
.site-tag { display: inline-flex; align-items: center; gap: .35rem; }
.card-meta {
    display: flex;
    gap: .5rem .75rem;
    flex-wrap: wrap;
    color: var(--muted);
    font-size: .85rem;
    min-height: 1.2em;
}
.card-meta span { white-space: nowrap; }
.card-winner {
    color: var(--text);
    font-size: .9rem;
    margin-top: auto;
    padding-top: .5rem;
    border-top: 1px solid var(--border);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.card-winner strong { font-weight: 600; }

/* ---------- Filter bar ---------- */
/* A slim row under the heading: page size on the left, the Filters link on
   the right. The panel below slides open on the grid-row trick (0fr -> 1fr),
   which animates to the panel's own height without a magic max-height. While
   closed its contents are invisible to the tab order too. */
.list-tools {
    display: flex; align-items: center; justify-content: space-between; gap: 1rem;
    margin: .25rem 0 .5rem; font-size: .85rem; color: var(--muted);
}
.page-size { display: flex; align-items: center; gap: .35rem; }
.page-size a, .page-size-on {
    display: inline-flex; align-items: center; justify-content: center;
    min-width: 1.9rem; padding: .05rem .35rem; border-radius: 5px; line-height: 1.5;
}
.page-size a { color: var(--text); }
.page-size a:hover { background: var(--surface-2); text-decoration: none; }
.page-size-on { color: var(--accent); font-weight: 600; }
.filter-toggle {
    display: inline-flex; align-items: center; gap: .35rem; margin-left: auto;
    padding: .2rem .1rem; background: none; border: 0; color: var(--accent);
    font: inherit; font-size: .85rem; font-weight: 600; cursor: pointer;
}
.filter-toggle:hover { text-decoration: underline; }
.filter-count {
    display: inline-flex; align-items: center; justify-content: center;
    min-width: 1.25rem; height: 1.25rem; padding: 0 .3rem; border-radius: 999px;
    background: var(--accent); color: var(--accent-ink, #111); font-size: .7rem;
}
.filter-caret { font-size: .8rem; transition: transform .2s ease; }
.filter-toggle[aria-expanded=true] .filter-caret { transform: rotate(180deg); }
.filter-panel { display: grid; grid-template-rows: 0fr; transition: grid-template-rows .25s ease; }
.filter-panel.is-open { grid-template-rows: 1fr; }
.filter-panel-inner { min-height: 0; overflow: hidden; visibility: hidden; transition: visibility 0s .25s; }
.filter-panel.is-open .filter-panel-inner { visibility: visible; transition-delay: 0s; }
/* The picker menu opens over the cards below; while the panel is open the
   inner box must not clip it. */
.filter-panel.is-open .filter-panel-inner { overflow: visible; }
.filter-bar {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    margin: 0 0 1.25rem;
    display: grid; gap: .75rem;
    padding: 1rem;
    grid-template-columns: 1fr;
}
@media (min-width: 560px) { .filter-bar { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 900px) { .filter-bar { grid-template-columns: repeat(4, 1fr); } }
.filter { display: flex; flex-direction: column; gap: .3rem; }
.filter > span { color: var(--muted); font-size: .85rem; }
.filter select, .filter input[type=search] {
    background: var(--bg); border: 1px solid var(--border); border-radius: var(--radius);
    color: var(--text); padding: .5rem .75rem; min-height: 44px; font: inherit;
    width: 100%;
    -webkit-appearance: none;
}
.filter input[type=search] { min-width: 0; }
@media (min-width: 900px) { .filter-wide { grid-column: span 2; } }
.filter-actions {
    grid-column: 1 / -1;
    display: flex; gap: .5rem; flex-wrap: wrap;
    padding-top: .25rem;
}

.result-count { color: var(--muted); font-size: .9rem; }

/* ---------- Pagination ---------- */
.pagination {
    display: flex; align-items: center; justify-content: space-between; gap: .75rem;
    margin: 2rem 0 1rem; padding-top: 1rem; border-top: 1px solid var(--border);
    flex-wrap: wrap;
}
.pagination a { text-decoration: none; }
.page-btn {
    display: inline-flex; align-items: center;
    padding: .5rem .85rem; min-height: 40px;
    border: 1px solid var(--border); border-radius: var(--radius);
    color: var(--text); background: transparent;
    font-size: .9rem; white-space: nowrap;
}
.page-btn:hover { background: var(--surface); }
.page-btn-disabled { opacity: .35; pointer-events: none; }
.page-list {
    display: flex; align-items: center; gap: .25rem;
    list-style: none; padding: 0; margin: 0;
    flex-wrap: wrap; justify-content: center; flex: 1 1 auto;
}
.page-num {
    display: inline-flex; align-items: center; justify-content: center;
    min-width: 40px; height: 40px; padding: 0 .5rem;
    border: 1px solid transparent; border-radius: var(--radius);
    color: var(--text); font-variant-numeric: tabular-nums; font-size: .9rem;
}
.page-num:hover { background: var(--surface); border-color: var(--border); }
.page-num.is-current {
    background: var(--accent); color: var(--accent-ink);
    font-weight: 600; cursor: default;
}
.page-gap {
    display: inline-flex; align-items: center; justify-content: center;
    min-width: 24px; color: var(--muted); font-size: .9rem;
}
@media (max-width: 480px) {
    .pagination { gap: .5rem; }
    .page-btn { padding: .5rem .65rem; font-size: .85rem; }
    .page-num { min-width: 34px; height: 34px; font-size: .85rem; }
}

/* ---------- Breadcrumbs ---------- */
.breadcrumbs { color: var(--muted); font-size: .9rem; margin-bottom: 1rem; }
.breadcrumbs a { color: var(--muted); }
.breadcrumbs span { margin: 0 .25rem; color: #4a5361; }

/* ---------- Tournament detail ---------- */
.tournament-head h1 { margin-bottom: .25rem; }
.tournament-sub { color: var(--muted); display: flex; gap: .75rem; flex-wrap: wrap; align-items: center; }
.pill {
    display: inline-block; padding: .15rem .6rem; border-radius: 999px;
    background: var(--surface-2); color: var(--text); font-size: .8rem;
    border: 1px solid var(--border);
}
.pill-accent { background: rgba(34,197,94,.15); color: var(--accent); border-color: rgba(34,197,94,.3); }
.pill:hover { text-decoration: none; background: var(--surface); }

.replayer-mount {
    /* Match the replayer's own body background so the iframe pre-load and
       any brief post-load flashes never show white. */
    background: #05080b;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    margin: 1rem 0 1.5rem;
    overflow: hidden;
    /* No min-height â€” the replayer posts its actual content height back and
       the iframe is sized to match. A fixed floor left a large empty gap under
       the game area (esp. when the embedded topbar is hidden for readers). */
}
.replayer-iframe {
    width: 100%;
    /* Aspect-ratio provides a sensible initial height before the postMessage
       from the replayer arrives, then postMessage sets an explicit height. */
    aspect-ratio: 16 / 9;
    border: 0;
    display: block;
    background: #05080b;
    color-scheme: dark;
}
.replayer-placeholder { text-align: center; color: var(--muted); padding: 1rem; }
.replayer-placeholder code { background: var(--surface-2); padding: .1rem .3rem; }

.tournament-stats .stat-grid { grid-template-columns: repeat(2, 1fr); }
@media (min-width: 720px) { .tournament-stats .stat-grid { grid-template-columns: repeat(4, 1fr); } }
.tournament-description { margin: 1rem 0; color: var(--text); }

/* Large-screen tournament show layout: the wider --max-w already gives
   the stats grid + description more room to breathe. Keep the section
   stack full-width â€” earlier attempts at pushing stats into a right-side
   sidebar made every card feel right-aligned when descriptions were
   short or empty. */

.results-table .num { text-align: right; font-variant-numeric: tabular-nums; }
.results-table th.num { text-align: right; }
/* Bounty events: prize, bounties, total. The total is the number the reader
   came for, so it is the emphasised one; the parts sit beside it in muted. */
.results-table.has-bounty td.num { color: var(--muted); }
.results-table.has-bounty td.col-total { color: var(--text); font-weight: 600; }
.results-table.has-bounty th.col-total { color: var(--text); }
.row-winner td { background: rgba(34,197,94,.06); }
.country {
    display: inline-block; margin-left: .35rem;
    padding: 0 .35rem; border: 1px solid var(--border); border-radius: 4px;
    color: var(--muted); font-size: .75rem; letter-spacing: .05em;
}

/* ---------- Player detail ---------- */
.player-head h1 { margin-bottom: .25rem; }

/* ---------- Home hero tweak ---------- */
.hero .cta { display: flex; gap: .5rem; flex-wrap: wrap; }
.tags { margin: 1.5rem 0; display: flex; gap: .5rem; flex-wrap: wrap; align-items: center; }
.tags h2 { margin: 0 .5rem 0 0; font-size: 1rem; color: var(--muted); font-weight: 500; }

/* ---------- Twin hero cards (homepage) ---------- */
.hero-twin {
    display: grid;
    gap: 1rem;
    margin-bottom: 2rem;
    grid-template-columns: 1fr;
}
@media (min-width: 760px) { .hero-twin { grid-template-columns: 1fr 1fr; } }
.hero-card {
    display: flex; flex-direction: column; gap: .5rem;
    padding: 1.5rem 1.5rem 1.25rem;
    border-radius: var(--radius);
    border: 1px solid var(--border);
    background: var(--surface);
    color: var(--text);
    text-decoration: none;
    transition: transform .1s ease, border-color .1s ease, background .1s ease;
    position: relative;
    overflow: hidden;
    isolation: isolate;
}
.hero-card::before {
    content: "";
    position: absolute; inset: 0;
    background: radial-gradient(ellipse at top left, rgba(255,255,255,.05), transparent 60%);
    pointer-events: none;
    z-index: -1;
}
a.hero-card:hover { text-decoration: none; transform: translateY(-1px); }
.hero-card-eyebrow {
    font-size: .75rem; font-weight: 700; letter-spacing: .1em;
    text-transform: uppercase;
    color: var(--muted);
}
.hero-card-title { margin: 0; font-size: 1.4rem; line-height: 1.2; }
@media (min-width: 760px) { .hero-card-title { font-size: 1.55rem; } }
.hero-card-lede { color: var(--muted); font-size: 1rem; margin: 0; }
.hero-card-cta { margin-top: .5rem; font-weight: 600; }

.hero-card-mtt { border-color: rgba(34,197,94,.25); }
.hero-card-mtt .hero-card-eyebrow,
.hero-card-mtt .hero-card-cta { color: #34d399; }
a.hero-card-mtt:hover { border-color: rgba(34,197,94,.55); }

.hero-card-cash { border-color: rgba(255,204,102,.25); }
.hero-card-cash .hero-card-eyebrow,
.hero-card-cash .hero-card-cta { color: var(--accent); }
a.hero-card-cash:hover { border-color: rgba(255,204,102,.55); }

/* ---------- Cash card differentiator ---------- */
.card-cash { border-color: rgba(255,204,102,.2); }
.card-cash .card-title { color: #e7ebf0; min-height: calc(2 * 1.3em); }
.card-thumb-cash {
    background: linear-gradient(135deg, #201a10, #2f2617);
}
.card-badge {
    position: absolute; top: .5rem; left: .5rem;
    background: rgba(255,204,102,.85); color: var(--accent-ink);
    padding: .1rem .5rem; border-radius: 4px; font-size: .7rem;
    letter-spacing: .05em; text-transform: uppercase; font-weight: 700;
}
.card-cash .card-link[aria-disabled="true"] { cursor: not-allowed; }
.card-winner .positive { color: var(--accent); }
.card-winner .negative { color: #f87171; }

.soon-badge {
    display: inline-block;
    margin-left: .5rem;
    padding: .1rem .55rem;
    border-radius: 999px;
    background: rgba(255,204,102,.15);
    color: var(--accent);
    font-size: .7rem;
    font-weight: 700;
    letter-spacing: .08em;
    text-transform: uppercase;
    vertical-align: middle;
}

/* ---------- Admin: tournament editor ---------- */
.admin-page-head {
    display: flex; justify-content: space-between; align-items: center;
    gap: 1rem; margin: 1rem 0;
}
.admin-page-head h1 { margin: 0; }
.admin-form { display: grid; gap: 1rem; }
.admin-fieldset {
    border: 1px solid var(--border); border-radius: 8px; padding: 1rem;
    display: grid; gap: .75rem;
}
.admin-fieldset > legend { padding: 0 .35rem; color: var(--muted); font-size: .85rem; letter-spacing: .05em; text-transform: uppercase; }
.admin-form label { display: grid; gap: .35rem; font-size: .9rem; color: var(--muted); }
.admin-form label > input,
.admin-form label > select,
.admin-form label > textarea {
    background: var(--surface); color: var(--text); border: 1px solid var(--border);
    border-radius: 6px; padding: .55rem .65rem; font: inherit;
}
.admin-form label.checkbox {
    grid-template-columns: auto 1fr; align-items: center; gap: .5rem; color: var(--text);
}
.form-grid { display: grid; gap: .75rem; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); }
.checkbox-grid { display: grid; gap: .35rem; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); border: 1px dashed var(--border); border-radius: 6px; padding: .75rem; }
.admin-form-actions { display: flex; gap: .5rem; margin-top: .5rem; }
.admin-section { margin-top: 2rem; padding-top: 1.5rem; border-top: 1px solid var(--border); }
.admin-section h2 { margin: 0 0 .5rem; }
.inline-form { display: flex; align-items: end; gap: .75rem; flex-wrap: wrap; margin: .75rem 0; }
.inline-form label { display: grid; gap: .35rem; font-size: .9rem; color: var(--muted); }
.og-preview { margin: 1rem 0; }
.admin-table-wrap { overflow-x: auto; }
.admin-table th, .admin-table td { padding: .5rem .6rem; border-bottom: 1px solid var(--border); }
.admin-table .num { text-align: right; font-variant-numeric: tabular-nums; }
.admin-table .small { font-size: .78rem; }
.btn-danger { background: rgba(248,113,113,.15); color: #f87171; border: 1px solid rgba(248,113,113,.35); }
.btn-danger:hover { background: rgba(248,113,113,.28); }

/* ---------- Tournament page: admin edit + spoiler guard ---------- */
.edit-link {
    display: inline-block; margin-left: .5rem; padding: .1rem .5rem;
    border: 1px solid var(--border); border-radius: 4px;
    color: var(--muted); font-size: .7rem; letter-spacing: .05em; text-transform: uppercase;
    vertical-align: middle; text-decoration: none;
}
.edit-link:hover { color: var(--text); border-color: var(--accent); }
/* The heading with its reveal button directly beneath it, not pushed to the
   far edge of the section where it read as belonging to something else. */
.results-head {
    display: flex; flex-direction: column; align-items: flex-start;
    gap: .5rem; margin-bottom: .75rem;
}
.results-head h2 { margin: 0; }
.results-reveal { flex-shrink: 0; }
.spoiler-warning { margin: 0 0 .75rem; }
[data-spoiler="hidden"] .results-table {
    filter: blur(10px);
    pointer-events: none;
    user-select: none;
}
[data-spoiler="shown"] .results-table { filter: none; pointer-events: auto; user-select: auto; }

/* ---------- Back-to-top link (subtle, end of content) ---------- */
.back-to-top {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: .35rem;
    margin: 2.5rem auto 1rem;
    padding: .5rem 1rem;
    min-height: var(--tap-sm);
    border: 1px solid var(--border);
    border-radius: 999px;
    color: var(--muted);
    background: transparent;
    font-size: var(--fs-sm);
    letter-spacing: .02em;
    text-decoration: none;
    width: max-content;
    /* Center inside the main container without disturbing the previous block */
    display: flex; margin-left: auto; margin-right: auto;
    transition: color .15s ease, border-color .15s ease, background .15s ease;
}
.back-to-top:hover,
.back-to-top:focus-visible {
    color: var(--text);
    border-color: var(--accent);
    background: var(--surface);
    text-decoration: none;
    outline: none;
}
/* Smoother than an instant jump when the browser supports it. Users who
   prefer reduced motion get the default hash-navigation jump. */
@media (prefers-reduced-motion: no-preference) {
    html { scroll-behavior: smooth; }
}

/* The poker-chip logo that sits in front of the brand wordmark. */
.brand {
    display: inline-flex;
    align-items: center;
    gap: .5rem;
}
.brand-mark {
    width: 1.75em;
    height: 1.75em;
    flex-shrink: 0;
    object-fit: contain;
}

/* Bulk-select toolbar on admin index tables */
.bulk-toolbar {
    display: flex; align-items: center; gap: .75rem;
    margin: .75rem 0;
    padding: .5rem .75rem;
    background: var(--accent-soft);
    border: 1px solid rgba(255,204,102,.35);
    border-radius: 6px;
    color: var(--text);
    font-size: var(--fs-sm);
}
.bulk-toolbar[hidden] { display: none; }
.bulk-count { color: var(--muted); }
.bulk-count #bulkCount { color: var(--text); font-weight: 700; }
.admin-table td input[type="checkbox"],
.admin-table th input[type="checkbox"] { cursor: pointer; }

/* Admin: draft-preview banner + dropdown icon slot */
.admin-preview-banner {
    display: flex; align-items: center; gap: .75rem; flex-wrap: wrap;
    margin: 1rem 0;
    padding: .6rem 1rem;
    background: var(--accent-soft);
    border: 1px solid rgba(255,204,102,.35);
    border-radius: 6px;
    color: var(--text);
    font-size: var(--fs-sm);
}
.admin-preview-banner strong { color: var(--accent); }
.admin-form label { position: relative; }
.select-icon {
    position: absolute;
    right: .55rem; bottom: .55rem;
    pointer-events: none;
    line-height: 0;
}
.select-icon img { border-radius: 3px; }
.admin-form label:has(.select-icon) select { padding-right: 2rem; }

/* Recent-tournaments row on the admin dashboard */
.dashboard-tournament-row {
    display: flex; align-items: center; gap: .5rem;
    padding: .35rem 0;
    border-bottom: 1px solid var(--border);
}
.dashboard-tournament-row a:first-child { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dashboard-tournament-row .edit-link { flex-shrink: 0; margin-left: auto; }

/* Admin-only rails (drafts on homepage) */
.admin-only-section {
    border: 1px dashed rgba(255,204,102,.35);
    border-radius: var(--radius);
    padding: 1rem;
    background: rgba(255,204,102,.04);
}
.admin-only-tag {
    display: inline-block; margin-left: .35rem; padding: .05rem .45rem;
    background: var(--accent-soft); color: var(--accent);
    border-radius: 4px; font-size: .65rem; letter-spacing: .08em; text-transform: uppercase;
    vertical-align: middle;
}
.admin-only-note { margin: -.25rem 0 .75rem; font-size: var(--fs-sm); }

/* Admin: compact tournament list (mobile-first) */
.check-all-toolbar {
    display: inline-flex; align-items: center; gap: .5rem;
    margin: .25rem 0 .5rem;
    color: var(--muted); font-size: var(--fs-sm);
    cursor: pointer;
}
.check-all-inline { display: inline-flex; align-items: center; gap: .4rem; cursor: pointer; }
.check-all-inline input { cursor: pointer; }
.admin-t-list {
    list-style: none; margin: 0; padding: 0;
    border: 1px solid var(--border); border-radius: 6px;
    background: var(--surface);
}
.admin-t-row {
    display: grid;
    grid-template-columns: auto 20px minmax(0, 1fr) auto;
    gap: .55rem;
    align-items: center;
    padding: .5rem .6rem;
    border-bottom: 1px solid var(--border);
}
.admin-t-row:last-child { border-bottom: 0; }
.admin-t-row:hover { background: rgba(255,255,255,.02); }
.admin-t-row input[type="checkbox"] { cursor: pointer; }
.admin-t-icon { border-radius: 3px; flex-shrink: 0; }
.admin-t-icon-empty { display: inline-block; width: 20px; height: 20px; border-radius: 3px; background: var(--surface-2); }
.admin-t-body { min-width: 0; }
.admin-t-title {
    display: flex; align-items: center; gap: .4rem;
    font-size: var(--fs-md); font-weight: 600;
}
.admin-t-title a {
    color: var(--text);
    overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
    min-width: 0;
}
.admin-t-title a:hover { color: var(--accent); text-decoration: none; }
.pill-draft {
    background: var(--accent-soft); color: var(--accent);
    padding: .05rem .4rem; border-radius: 4px;
    font-size: .65rem; letter-spacing: .06em; text-transform: uppercase; font-weight: 700;
}
.admin-t-meta {
    display: flex; flex-wrap: wrap; gap: .35rem .75rem;
    margin-top: .15rem;
    font-size: .78rem; color: var(--text);
}
.admin-t-meta > span { white-space: nowrap; }
.admin-t-actions { display: flex; align-items: center; gap: .25rem; }
.admin-t-action {
    display: inline-flex; align-items: center; justify-content: center;
    width: 28px; height: 28px;
    border: 1px solid var(--border); border-radius: 6px;
    color: var(--muted); text-decoration: none;
}
.admin-t-action:hover { color: var(--accent); border-color: var(--accent); text-decoration: none; }

/* Tighter meta on very narrow screens */
@media (max-width: 480px) {
    .admin-t-row { grid-template-columns: auto 20px minmax(0, 1fr); }
    .admin-t-actions { grid-column: 3; justify-content: flex-end; margin-top: .25rem; }
    .admin-t-meta { gap: .25rem .5rem; }
}

/* Card body: brand line under the title â€” icon + brand name + optional
   series, kept on a single line with a nowrap so it never breaks awkwardly.
   The site icon already existed as .site-icon; these rules just tighten
   the lockup around the wordmark and the middot separator. */
.card-series .site-icon { flex-shrink: 0; vertical-align: -3px; }
.card-brand { font-weight: 600; color: var(--text); }
.card-dot   { color: var(--muted); margin: 0 .15rem; }

/* Admin: homepage layout editor */
.homepage-columns {
    display: grid;
    gap: 1.5rem;
    grid-template-columns: 1fr;
    margin: 1rem 0 2rem;
}
@media (min-width: 900px) {
    .homepage-columns { grid-template-columns: 1fr 1fr; }
}
.homepage-col h2 { margin: 0 0 .25rem; font-size: var(--fs-lg); }
.homepage-col .small { margin: 0 0 .5rem; }
.homepage-list {
    list-style: none; margin: 0; padding: .35rem;
    background: var(--surface); border: 1px solid var(--border); border-radius: 8px;
    min-height: 120px;
}
.homepage-row {
    display: grid; grid-template-columns: 18px 18px 1fr auto;
    gap: .55rem; align-items: center;
    padding: .5rem .55rem;
    margin: .2rem 0;
    background: var(--bg);
    border: 1px solid var(--border); border-radius: 6px;
    cursor: grab;
    user-select: none;
}
.homepage-row.dragging { opacity: .4; }
.homepage-row:hover { border-color: var(--accent); }
.drag-handle { color: var(--muted); letter-spacing: -1px; font-weight: 700; }
.homepage-icon, .homepage-icon-empty {
    width: 18px; height: 18px; border-radius: 3px; flex-shrink: 0;
}
.homepage-icon-empty { background: var(--surface-2); }
.homepage-body { min-width: 0; }
.homepage-title { font-size: var(--fs-md); font-weight: 600; }
.homepage-title a { color: var(--text); }
.homepage-title a:hover { color: var(--accent); text-decoration: none; }
.homepage-meta {
    display: flex; flex-wrap: wrap; gap: .35rem .6rem;
    margin-top: .1rem; font-size: .75rem; color: var(--muted);
}
.row-action {
    padding: 0 .5rem; min-width: 28px; min-height: 28px;
    font-size: 1rem; line-height: 1;
}
.homepage-empty {
    padding: 1.25rem .75rem;
    text-align: center; color: var(--muted); font-style: italic;
    border: 1px dashed var(--border); border-radius: 6px;
    margin: .35rem 0;
}

/* ---- Results table ------------------------------------------------------- */
/*
 * The money columns were right-aligned against the full width of the page, so a
 * four-entry final table put the position on the far left and the winnings on
 * the far right with a hand's breadth of nothing between. The player column
 * takes the slack instead and everything else hugs its content.
 */
.results-table { width: auto; min-width: min(520px, 100%); max-width: min(760px, 100%); }
.results-table .col-player { width: 100%; }
.results-table .real-name { display: block; font-size: .8em; color: var(--muted, #8a8f98); line-height: 1.25; }
.results-table th.num, .results-table td.num { text-align: right; white-space: nowrap; }
.results-table th.num:first-child, .results-table td.num:first-child { text-align: right; width: 1%; padding-right: 14px; }

/* One column for the flag, held open whether or not we know the country, so the
   column stays a column. */
.results-table .col-flag { width: 1%; padding-right: 10px; }
.results-table .flag {
  display: block; width: 20px; height: 14px; border-radius: 2px;
  object-fit: cover; box-shadow: 0 0 0 1px rgba(255, 255, 255, .12);
}
.results-table .flag-none { box-shadow: none; background: rgba(255, 255, 255, .05); border-radius: 2px; }

/* ---- Cards --------------------------------------------------------------- */
.card-tags { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 7px; }
.pill-sm { font-size: 10.5px; padding: 2px 8px; }

/* Tag tones. The strongest claim reads strongest: "All hole cards" is why
   someone clicks, "Final table" is the site's gold â€” the same colour as the
   mark on the felt. */
.pill-reveal { background: rgba(34, 197, 94, .16); color: #4ade80; border-color: rgba(34, 197, 94, .38); }
.pill-game, .pill-game-nlhe { background: rgba(125, 160, 215, .12); color: #a9c1e8; border-color: rgba(125, 160, 215, .32); font-weight: 600; letter-spacing: .02em; }
/* One colour per game (the homepage lists mix them): NLHE blue, PLO green, PLO8 purple, PLO5 orange, NLO teal, PLH pink, limit games sand. */
.pill-game-plo  { background: rgba(70, 190, 120, .13);  color: #86d9a5; border-color: rgba(70, 190, 120, .34);  font-weight: 600; letter-spacing: .02em; }
.pill-game-plo8 { background: rgba(160, 120, 230, .14); color: #c6a8f0; border-color: rgba(160, 120, 230, .36); font-weight: 600; letter-spacing: .02em; }
.pill-game-plo5 { background: rgba(240, 150, 70, .14);  color: #f0b27a; border-color: rgba(240, 150, 70, .36);  font-weight: 600; letter-spacing: .02em; }
.pill-game-nlo  { background: rgba(60, 190, 190, .13);  color: #7dd6d6; border-color: rgba(60, 190, 190, .34);  font-weight: 600; letter-spacing: .02em; }
.pill-game-plh  { background: rgba(235, 120, 165, .13); color: #f0a0c0; border-color: rgba(235, 120, 165, .34); font-weight: 600; letter-spacing: .02em; }
.pill-game-lhe, .pill-game-lo { background: rgba(215, 190, 100, .12); color: #e6d17a; border-color: rgba(215, 190, 100, .32); font-weight: 600; letter-spacing: .02em; }
.pill-final  { background: rgba(215, 173, 92, .15); color: #e8c07d; border-color: rgba(215, 173, 92, .38); }
/* Members-only replay: the padlock tag. The lock is drawn with a mask so it takes the pill's colour. */
.pill-deal { background: rgba(59, 130, 246, .14); color: #93c5fd; border-color: rgba(59, 130, 246, .4); }
.deal-note { margin: 0 0 .75rem; padding: .55rem .8rem; border: 1px solid rgba(59, 130, 246, .35); border-radius: var(--radius); background: rgba(59, 130, 246, .08); font-size: var(--fs-sm); }
.pill-members { background: rgba(139, 92, 246, .16); color: #c4b5fd; border-color: rgba(139, 92, 246, .45); display: inline-flex; align-items: center; gap: .3em; }   /* violet, so it is not mistaken for the gold Final table pill; the lock stays gold */
/* Icon only (preview cards): the lock alone, a little tighter. */
.pill-members:empty { gap: 0; padding-left: .45em; padding-right: .45em; }
.pill-members::before { content: ""; width: .95em; height: .95em; background: #f2c75c; flex: none;
    -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M12 1a5 5 0 0 0-5 5v3H6a2 2 0 0 0-2 2v10a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V11a2 2 0 0 0-2-2h-1V6a5 5 0 0 0-5-5zm-3 8V6a3 3 0 0 1 6 0v3H9z'/%3E%3C/svg%3E") center / contain no-repeat;
            mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M12 1a5 5 0 0 0-5 5v3H6a2 2 0 0 0-2 2v10a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V11a2 2 0 0 0-2-2h-1V6a5 5 0 0 0-5-5zm-3 8V6a3 3 0 0 1 6 0v3H9z'/%3E%3C/svg%3E") center / contain no-repeat; }
/* Above the table of a members-only replay, for a visitor: always visible, phone included. */
.members-banner { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin: 0 0 10px; padding: 10px 14px; border-radius: 12px;
    border: 1px solid rgba(232, 184, 74, .5); background: linear-gradient(90deg, rgba(232, 184, 74, .14), rgba(232, 184, 74, .04)); }
.members-banner-lock { width: 20px; height: 20px; fill: #f2c75c; flex: none; }
.members-banner-text { flex: 1 1 240px; font-size: 14px; line-height: 1.4; }
.members-banner-actions { display: flex; align-items: center; gap: 12px; flex: none; }
.members-banner-login { font-weight: 700; font-size: 14px; color: #f2c75c; text-decoration: underline; }
@media (max-width: 560px) { .members-banner { padding: 10px 12px; } .members-banner-actions { width: 100%; } }
.members-banner.is-hot { animation: members-hot 1.1s ease-in-out 3; }
@keyframes members-hot { 0%, 100% { box-shadow: 0 0 0 0 rgba(232, 184, 74, 0); } 50% { box-shadow: 0 0 0 6px rgba(232, 184, 74, .35), 0 0 26px rgba(232, 184, 74, .45); } }
/* About page: the tier list. */
.about-tiers { list-style: none; padding: 0; margin: .75rem 0; display: grid; gap: .6rem; }
.about-tiers li { padding: .7rem .9rem; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); line-height: 1.5; }
.about-tiers .tier-badge { margin: 0 .5rem 0 0; }
/* Account page: the membership card. */
.tier-badge-lg { font-size: 15px; padding: 3px 14px; margin-left: 0; }
.tier-card-line { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin: 6px 0 10px; }
.tier-card-gold { border-color: rgba(255, 210, 74, .45); }
.tier-card-silver { border-color: rgba(200, 208, 218, .4); }
.tier-card-bronze { border-color: rgba(205, 127, 50, .4); }
.tier-perks { margin: 0; padding-left: 1.2em; line-height: 1.7; }
.tier-perks .is-off { opacity: .65; }
/* Download bar under the table: active for Gold members, a teaser for everyone else. */
.dl-bar { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin: 10px 0 4px; }
.btn-locked { opacity: .7; cursor: not-allowed; display: inline-flex; align-items: center; gap: 8px; }
/* A member's tier (account page, admin). */
.tier-badge { display: inline-block; padding: 1px 9px; border-radius: 999px; font-size: 12px; font-weight: 700; letter-spacing: .3px; border: 1px solid transparent; margin-left: .5em; }
.tier-bronze { background: rgba(205, 127, 50, .18); color: #e0a066; border-color: rgba(205, 127, 50, .5); }
.tier-silver { background: rgba(200, 208, 218, .16); color: #d3d9e0; border-color: rgba(200, 208, 218, .5); }
.tier-gold   { background: rgba(255, 210, 74, .16); color: #ffd24a; border-color: rgba(255, 210, 74, .55); }

/* ---- Description editor: HTML · Visual · Preview -------------------------- */
.desc-field { display: grid; gap: 6px; }
.desc-bar { display: flex; align-items: center; justify-content: space-between; gap: 8px; flex-wrap: wrap; }
.desc-tabs { display: flex; gap: 4px; }
.desc-tab {
  padding: 4px 12px; border-radius: 999px; cursor: pointer; font-size: 12px; font-weight: 700;
  background: var(--surface-2); color: var(--text); border: 1px solid var(--border);
}
.desc-tab.on { background: var(--accent-soft); color: var(--accent); border-color: rgba(255, 204, 102, .45); }
/* Where the caret is, as a path: div.intro â€º p â€º strong. Only in Visual. */
.desc-crumb { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 11px; color: var(--muted); min-height: 1em; }
.desc-field:not([data-desc-mode="visual"]) .desc-crumb,
.desc-field:not([data-desc-mode="visual"]) .desc-tools,
.desc-field:not([data-desc-mode="visual"]) .desc-pop { display: none; }
.desc-tools { display: flex; flex-wrap: wrap; gap: 6px; }
.desc-tg { display: inline-flex; gap: 1px; border: 1px solid var(--border); border-radius: 6px; overflow: hidden; background: var(--surface-2); }
.desc-tg button {
  min-width: 32px; height: 30px; padding: 0 8px; border: 0; background: transparent; color: var(--text);
  font: inherit; font-size: 12px; cursor: pointer; line-height: 1;
}
.desc-tg button:hover { background: var(--accent-soft); color: var(--accent); }
.desc-pop {
  display: grid; gap: 6px; padding: 8px 10px; border: 1px solid rgba(255, 204, 102, .45); border-radius: 8px;
  background: var(--surface);
}
/* The display rules above would otherwise beat the hidden attribute. */
.desc-pop[hidden], .desc-pop-row[hidden], .desc-pane[hidden] { display: none; }
.desc-pop-row { display: flex; flex-wrap: wrap; gap: 8px 12px; align-items: end; }
.desc-pop-row label { display: grid; gap: 3px; font-size: 12px; color: var(--muted); flex: 1 1 140px; }
.desc-pop-row input { background: var(--surface-2); color: var(--text); border: 1px solid var(--border); border-radius: 6px; padding: 6px 8px; font: inherit; font-size: 13px; }
.desc-pop-tag { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 12px; color: var(--accent); flex: 1 1 100%; }
.desc-pop-actions { display: flex; gap: 6px; }
.desc-hint { margin: 0; font-size: 11.5px; color: var(--muted); }
.desc-hint code { font-size: 11px; }
.desc-field textarea {
  width: 100%; min-height: 220px; resize: vertical; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 13px; line-height: 1.55;
  background: var(--surface); color: var(--text); border: 1px solid var(--border); border-radius: 8px; padding: 10px 12px;
}
.desc-visual, .desc-preview {
  min-height: 220px; padding: 12px 14px; border-radius: 8px; line-height: 1.55;
  background: var(--surface); border: 1px solid var(--border);
}
.desc-visual:focus { outline: none; border-color: rgba(255, 204, 102, .55); }
.desc-visual > :first-child, .desc-preview > :first-child { margin-top: 0; }
.desc-visual > :last-child, .desc-preview > :last-child { margin-bottom: 0; }
/* Structure made visible while editing: a div or span shows its outline and
   its class, so a wrapper is never an invisible thing you cannot find again. */
.desc-visual div { position: relative; padding: 8px 10px; margin: 6px 0; border: 1px dashed rgba(255, 204, 102, .35); border-radius: 6px; }
.desc-visual div::before, .desc-visual span::after {
  content: attr(class); font: 600 10px/1 ui-monospace, SFMono-Regular, Menlo, monospace; color: var(--accent); opacity: .8;
}
.desc-visual div::before { position: absolute; top: -7px; left: 8px; padding: 0 4px; background: var(--surface); }
.desc-visual span { outline: 1px dotted rgba(255, 204, 102, .5); border-radius: 3px; }
.desc-visual span::after { margin-left: 3px; vertical-align: super; }
.desc-visual div[id]::before { content: attr(class) " #" attr(id); }
.desc-visual div:not([class]):not([id])::before { content: "div"; color: var(--muted); }
.desc-visual span:not([class])::after { content: none; }

/* ---- Dismissible page intro ---------------------------------------------- */
.page-intro {
  position: relative; margin: 0 0 18px; padding: 16px 44px 16px 18px;
  background: var(--surface-2); border: 1px solid var(--line, #2a3142);
  border-left: 3px solid var(--accent); border-radius: 10px;
}
.page-intro p { margin: 0 0 8px; font-size: 15px; line-height: 1.6; }
.page-intro p:last-child { margin-bottom: 0; font-size: 13.5px; }
.page-intro-close {
  position: absolute; top: 8px; right: 10px;
  background: none; border: 0; color: var(--muted); cursor: pointer;
  font-size: 20px; line-height: 1; padding: 2px 6px; border-radius: 6px;
}
.page-intro-close:hover { color: var(--text); background: rgba(255, 255, 255, .06); }
/* The brand doubles as the homepage h1; it must not inherit heading sizing. */
.brand-h1 { margin: 0; font-size: inherit; font-weight: inherit; line-height: inherit; display: inline-flex; }

/* Attribution sits opposite the copyright rather than trailing it, so neither
   reads as a continuation of the other. Wraps underneath on a narrow screen. */
.footer-copy { display: flex; flex-wrap: wrap; align-items: baseline; gap: 8px; }
.footer-powered { margin-left: auto; font-size: 12px; color: var(--muted); }
.footer-powered a { color: inherit; }
.footer-powered a:hover { color: var(--text); }


/* ---- Narrow screens: the description introduces the replay ------------------
 * On a wide screen the description sits beside the stats card, below the table,
 * and reads as a caption. Stacked on a phone that puts it after a tall replayer
 * and a control bar, so the first thing about the tournament arrives last â€”
 * you scroll past the whole player to find out what you are watching.
 *
 * `display: contents` on the row lifts the description and the stats card into
 * the article's own flex flow, so the description can be ordered above the
 * player without moving the stats with it or touching the markup. Only the two
 * moved elements get an order; everything else stays at 0 and therefore in
 * document order.
 */
@media (max-width: 720px) {
  article.tournament { display: flex; flex-direction: column; }
  .tournament-head { order: -2; }
  .tournament-info-row { display: contents; }
  .tournament-description { order: -1; margin-bottom: 14px; }
}

/* ---- Admin: tournament editor (tf-*) ------------------------------------
   Mobile first: one column of compact fields, checkboxes as one line with
   their words, sections as flat blocks with a small heading. Wider screens
   only add columns. Nothing here floats away from what it labels: a field is
   ONE label element holding its caption and its control. */
.tf-head { display: flex; align-items: flex-start; justify-content: space-between; gap: .75rem; margin: .75rem 0 1rem; }
.tf-head h1 { margin: 0; font-size: var(--fs-xl); line-height: 1.15; }
.tf-head-sub { display: flex; align-items: center; gap: .6rem; margin-top: .25rem; font-size: var(--fs-sm); flex-wrap: wrap; }
.tf-status { font-size: 11px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; padding: 2px 8px; border-radius: 999px; border: 1px solid var(--border); color: var(--muted); }
.tf-status.is-live { color: #4ade80; border-color: rgba(34, 197, 94, .38); background: rgba(34, 197, 94, .12); }
.tf { display: grid; gap: .75rem; }
.tf-sec { padding: .75rem; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); display: grid; gap: .6rem; }
.tf-sec-head { display: flex; flex-direction: column; gap: .15rem; }
.tf-h { margin: 0; font-size: var(--fs-xs); font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.tf-h3 { margin: 0; font-size: var(--fs-md); }
.tf-sub { font-size: var(--fs-sm); }
.tf-grid { display: grid; gap: .5rem; grid-template-columns: repeat(2, minmax(0, 1fr)); }
.tf-grid-tight { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.tf-f { display: grid; gap: .2rem; min-width: 0; position: relative; }
.tf-l { font-size: 11.5px; color: var(--muted); line-height: 1.2; display: flex; gap: .35rem; align-items: baseline; flex-wrap: wrap; }
.tf-l small { font-size: 10.5px; opacity: .8; }
.tf-l a { color: var(--accent); }
.tf-f > input, .tf-f > select, .tf-f > textarea {
    width: 100%; min-width: 0; box-sizing: border-box;
    background: var(--surface-2); color: var(--text); border: 1px solid var(--border);
    border-radius: 6px; padding: .45rem .55rem; font: inherit; font-size: 14px;
}
.tf-f > input:focus, .tf-f > select:focus, .tf-f > textarea:focus { outline: none; border-color: rgba(255, 204, 102, .55); }
.tf-f > input[type="file"] { padding: .3rem; font-size: 13px; color: var(--muted); }
/* The browser's "Choose file" button, drawn as one of ours. */
.tf-f > input[type="file"]::file-selector-button {
    margin-right: .6rem; padding: .3rem .7rem; border-radius: 6px; cursor: pointer;
    border: 1px solid var(--border); background: var(--surface); color: var(--text);
    font: inherit; font-size: 12.5px; font-weight: 600;
}
.tf-f > input[type="file"]::file-selector-button:hover { border-color: var(--accent); color: var(--accent); }
.tf-f-wide { flex: 1 1 320px; }
.tf-f .select-icon { bottom: .5rem; right: 1.6rem; }
.tf-f:has(.select-icon) select { padding-right: 2.6rem; }
/* Checkboxes: box and words on one line, the hint under the words. */
.tf-checks { display: grid; gap: .35rem; }
.tf-check { display: grid; grid-template-columns: auto 1fr; align-items: start; gap: .5rem; font-size: 14px; color: var(--text); cursor: pointer; }
.tf-check input { margin: 3px 0 0; width: 16px; height: 16px; accent-color: var(--accent); }
.tf-check small { display: block; font-size: 11.5px; color: var(--muted); line-height: 1.3; }
.tf-check-inline { align-self: end; padding-bottom: .45rem; }
/* Category chips: a checkbox that reads as a pill and lights when on. */
.tf-chips { display: flex; flex-wrap: wrap; gap: .35rem; margin-top: .2rem; }
.tf-chip { position: relative; cursor: pointer; }
.tf-chip input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.tf-chip span { display: inline-block; padding: 4px 10px; border-radius: 999px; border: 1px solid var(--border); background: var(--surface-2); font-size: 12.5px; color: var(--text); }
.tf-chip input:checked + span { background: var(--accent-soft); color: var(--accent); border-color: rgba(255, 204, 102, .45); }
.tf-chip input:focus-visible + span { outline: 2px solid var(--accent); outline-offset: 1px; }
/* The save row stays reachable on a long phone page. */
.tf-actions {
    position: sticky; bottom: 0; z-index: 3; display: flex; align-items: center; gap: .5rem;
    padding: .6rem 0; margin: 0 -.25rem; background: linear-gradient(to top, var(--bg) 70%, transparent);
}
.tf-actions .tf-delete { margin-left: auto; }
.tf-actions-plain { position: static; background: none; padding: 0; margin: 0; }
.tf-span2 { grid-column: 1 / -1; }
.tf-og { display: grid; gap: .6rem; }
.tf-og-img { max-width: 100%; width: 360px; border: 1px solid var(--border); border-radius: 6px; }
.tf-og-forms { display: grid; gap: .5rem; }
.tf-inline { display: flex; align-items: end; gap: .5rem; flex-wrap: wrap; }
.tf-inline .tf-f { flex: 1 1 200px; }
.tf-player { margin-top: .25rem; }
.tf-table th, .tf-table td { padding: .4rem .5rem; font-size: 13px; white-space: nowrap; }
@media (min-width: 560px) {
    .tf-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
    .tf-grid-tight { grid-template-columns: repeat(4, minmax(0, 1fr)); }
    .tf-sec { padding: .9rem 1rem; }
    .tf-checks { grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: .35rem 1.25rem; }
    .tf-og { grid-template-columns: auto 1fr; align-items: start; }
}
@media (min-width: 900px) {
    .tf-head h1 { font-size: var(--fs-2xl); }
    .tf-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
    .tf-grid-tight { grid-template-columns: repeat(8, minmax(0, 1fr)); }
    .tf-sec-head { flex-direction: row; align-items: baseline; justify-content: space-between; gap: 1rem; }
}

/* Edit tournament: what the replayer's Table setup published, and the way to it. */
.skin-summary { display: flex; align-items: center; justify-content: space-between; gap: 1rem; flex-wrap: wrap; margin: .75rem 0; padding: .6rem .8rem; border: 1px solid var(--border); border-radius:8px; }
.skin-summary strong { display: block; margin-bottom: .15rem; }

/* ---------- Tournament page on a phone: tight and compact ----------
   The desktop type scale ran unchanged onto a 390px screen: a 28px title in
   three lines, a breadcrumb wrapping under it, stat cards with 28px numbers
   and a rem of padding each, a 16px description. Everything here is relative
   (rem, em, clamp against the viewport width) so it tracks the screen and
   the reader's zoom, and it stops at 720px where the desktop layout takes
   over. */
@media (max-width: 719px) {
    main.container { padding-top: .75rem; padding-bottom: 2rem; }
    .breadcrumbs {
        font-size: .75rem; margin-bottom: .5rem;
        display: flex; align-items: center; min-width: 0; white-space: nowrap;
    }
    .breadcrumbs a { flex: none; }
    .breadcrumbs span { flex: none; margin: 0 .3rem; }
    /* The current page's own name runs out in an ellipsis rather than
       wrapping the trail onto a second line: the title is the next thing on
       the page. */
    .breadcrumbs span[aria-current] { flex: 0 1 auto; margin: 0; overflow: hidden; text-overflow: ellipsis; }
    .tournament-head h1 {
        font-size: clamp(1.0625rem, .8rem + 1.8vw, 1.375rem);
        line-height: 1.25; margin-bottom: .3rem;
    }
    .tournament-sub { font-size: .8rem; gap: .5rem; }
    .tournament-sub .pill { font-size: .7rem; padding: .1rem .5rem; }
    .tournament-description { margin: .5rem 0 .6rem; font-size: .8125rem; line-height: 1.45; }
    .tournament-description p { margin-bottom: .5em; }
    .replayer-mount { margin: .5rem 0 .75rem; }
    /* The stat cards in one row of three (buy-in, prize pool, entrants), each
       a small plate: number then label, both sized to the card. */
    .tournament-stats .stat-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: .5rem; margin-bottom: .75rem; }
    .tournament-stats .stat { padding: .5rem .6rem; gap: .05rem; min-width: 0; border-radius: .5rem; }
    .tournament-stats .stat-num { font-size: clamp(.875rem, .7rem + 1.1vw, 1.125rem); line-height: 1.2; overflow-wrap: anywhere; }
    .tournament-stats .stat-label { font-size: .625rem; letter-spacing: .03em; text-transform: uppercase; }
    .results-head { margin-bottom: .4rem; }
    .results-head h2 { font-size: 1.0625rem; }
    .results-table { font-size: .8rem; min-width: 100%; }
    .results-table th, .results-table td { padding: .28rem .4rem; }
    .results-table .flag { width: 16px; height: 11px; }
    .tags { margin: .75rem 0; gap: .35rem; }
    .tags h2 { font-size: .8125rem; }
    .tags .pill { font-size: .7rem; }
}

/* ---- Tournament list: the site icon picker ---- */
/* The picker is styled like the selects beside it, with the room's mark in
   front of each name; the menu opens over the cards below. */
.icon-select { position: relative; }
.icon-select-btn {
    display: flex; align-items: center; gap: .5rem; width: 100%; min-height: 44px;
    padding: .5rem .75rem; background: var(--bg); border: 1px solid var(--border); border-radius: var(--radius);
    color: var(--text); font: inherit; cursor: pointer; text-align: left;
}
.icon-select-label { flex: 1 1 auto; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.icon-select-caret { color: var(--muted); font-size: .8rem; }
.icon-select-img { width: 18px; height: 18px; border-radius: 4px; flex: none; }
.icon-select-none { display: inline-block; }
.icon-select-menu {
    position: absolute; z-index: 30; top: calc(100% + 4px); left: 0; right: 0;
    max-height: 320px; overflow-y: auto; padding: .25rem;
    background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
    box-shadow: 0 8px 24px rgba(0, 0, 0, .35);
}
.icon-select-menu [role=option] {
    display: flex; align-items: center; gap: .5rem; width: 100%; padding: .45rem .6rem;
    background: none; border: 0; border-radius: 6px; color: var(--text); font: inherit; cursor: pointer; text-align: left;
}
.icon-select-menu [role=option]:hover, .icon-select-menu [role=option][aria-selected=true] { background: var(--surface-2); }
.icon-select-name { flex: 1 1 auto; }
.icon-select-n { color: var(--muted); font-size: .85rem; }

/* Homepage tour and room discovery, above the introductory cards. */
.home-brands { margin-top: 1.25rem; }
.home-brands .section-head h2 { font-size: 1.1rem; }
.home-brands-grid { display: grid; grid-auto-flow: column; grid-auto-columns: 165px; gap: .65rem; overflow-x: auto; padding: 3px 3px .75rem; scroll-snap-type: x proximity; }
.home-brand { scroll-snap-align: start; min-width: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: .65rem; padding: 1rem .75rem; border: 1px solid var(--border); border-radius: 12px; background: linear-gradient(145deg, #212731, var(--surface)); color: var(--text); }
.home-brand:hover, .home-brand:focus-visible { border-color: var(--accent); background: var(--surface-2); text-decoration: none; }
.home-brand:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
.home-brand-tour { border-color: #54452e; background: linear-gradient(145deg, #2b251c, var(--surface)); }
.home-brand-art { width: 100%; height: 76px; display: flex; align-items: center; justify-content: center; gap: .5rem; }
.home-brand-icon { width: 56px; height: 56px; object-fit: contain; }
.home-brand-logo { width: 100%; max-width: 190px; height: 64px; object-fit: contain; }
.home-brand-wcoop img { width: 48px; height: 57px; object-fit: contain; }
.home-brand-wcoop strong { font-size: clamp(1.1rem, 2.2vw, 1.65rem); font-style: italic; letter-spacing: -.06em; }
.home-brand-caption { min-height: 2.6em; display: flex; align-items: center; text-align: center; font-size: .75rem; line-height: 1.3; font-weight: 600; color: var(--muted); }
@media (min-width: 640px) { .home-brands-grid { grid-auto-flow: row; grid-auto-columns: auto; grid-template-columns: repeat(3, minmax(0, 1fr)); overflow: visible; padding: 3px; } }
@media (min-width: 960px) { .home-brands-grid { grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); } }
@media (min-width: 1440px) {
    .home-brands-grid { grid-template-columns: repeat(10, minmax(0, 1fr)); gap: .5rem; }
    .home-brand { gap: .5rem; padding: .75rem .5rem; }
    .home-brand-art { height: 60px; }
    .home-brand-icon { width: 44px; height: 44px; }
    .home-brand-logo { height: 52px; }
    .home-brand-caption { font-size: .72rem; }
}

/* Recent winners stay horizontally scrollable at every viewport width. */
.winner-controls { display: flex; gap: .4rem; }
.winner-controls[hidden] { display: none; }
.winner-scroll { width: 36px; height: 36px; border: 1px solid var(--border); border-radius: 50%; background: var(--surface); color: var(--text); cursor: pointer; font-size: 1.15rem; }
.winner-scroll:hover { border-color: var(--accent); }
.winner-scroll:disabled { opacity: .3; cursor: default; }
.winner-rail { display: flex; gap: .85rem; overflow-x: auto; padding: .2rem .1rem .8rem; scroll-snap-type: x proximity; scrollbar-width: thin; }
.winner-card { display: flex; align-items: center; gap: .85rem; flex: 0 0 310px; padding: 1rem; border: 1px solid var(--border); border-radius: 12px; background: var(--surface); color: var(--text); text-decoration: none; scroll-snap-align: start; }
.winner-card:hover { border-color: var(--accent); background: var(--surface-2); text-decoration: none; }
.winner-avatar-wrap { position: relative; display: flex; align-items: center; justify-content: center; flex: 0 0 56px; height: 56px; border: 2px solid var(--accent); border-radius: 50%; background: var(--surface-2); }
.winner-avatar { width: 100%; height: 100%; object-fit: cover; border-radius: 50%; }
.winner-site-icon { position: absolute; right: -4px; bottom: -3px; width: 24px; height: 24px; padding: 3px; border-radius: 50%; background: var(--surface); object-fit: contain; border: 1px solid var(--border); }
.winner-info { display: flex; flex-direction: column; gap: .3rem; min-width: 0; }
.winner-name { display: flex; align-items: center; gap: .35rem; font-weight: 700; overflow-wrap: anywhere; }
.winner-amount { color: var(--accent); font-size: var(--fs-md); font-weight: 700; font-variant-numeric: tabular-nums; }
.winner-tournament { color: var(--muted); font-size: var(--fs-xs); line-height: 1.4; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.winner-card:focus-visible, .winner-scroll:focus-visible, .winner-rail:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
@media (max-width: 400px) { .winner-card { flex-basis: 280px; } }

.winner-trophy { color: var(--accent); width: 36px; height: 36px; }

/* Homepage rows remain swipeable on touch and draggable with a mouse. */
[data-drag-scroll] { cursor: grab; user-select: none; }
[data-drag-scroll] a { cursor: inherit; }
[data-drag-scroll] img { -webkit-user-drag: none; }
[data-drag-scroll].is-dragging { cursor: grabbing; scroll-snap-type: none; scroll-behavior: auto; }
.home-card-rail:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
@media (min-width: 900px) {
    .home-card-rail { grid-auto-flow: column; grid-template-columns: none; grid-auto-columns: calc((100% - 3rem) / 4); overflow-x: auto; overflow-y: hidden; scroll-snap-type: x proximity; padding: .25rem .25rem 1rem; }
}

@media (min-width: 900px) {
    .winner-avatar-wrap { flex-basis: 68px; height: 68px; }
    .winner-trophy { width: 42px; height: 42px; }
}

.winner-flag { width: 16px; height: 12px; flex: 0 0 16px; object-fit: cover; border-radius: 2px; }

/* Full-width homepage publication strip; two equal sets make the loop seamless. */
.as-seen { width:100%; margin-top:2rem; padding:1.4rem 0 1.8rem; border-top:1px solid var(--border); border-bottom:1px solid var(--border); background:var(--surface); }
.as-seen-header { position:relative; display:flex; align-items:center; justify-content:center; min-height:2rem; margin-bottom:1rem; }
.as-seen-header h2 { margin:0; color:var(--muted); font-size:.75rem; font-weight:800; letter-spacing:.14em; text-transform:uppercase; }
.as-seen-viewport { overflow:hidden; }
.as-seen-track { display:flex; width:max-content; animation:as-seen-scroll var(--as-seen-duration,55s) linear infinite; }
.as-seen-set { display:flex; flex-shrink:0; align-items:center; justify-content:space-around; gap:3rem; padding: .5rem 1.5rem; min-width:100vw; }
.as-seen-link { display:flex; flex-shrink:0; align-items:center; gap:.75rem; color:var(--muted); font-size:.95rem; font-weight:650; white-space:nowrap; text-decoration:none; }
.as-seen-link img { width:32px; height:32px; object-fit:contain; border-radius:5px; }
.as-seen-link:hover { color:var(--text); text-decoration:none; }
.as-seen-link:focus-visible { outline:2px solid var(--accent); outline-offset:4px; }
.as-seen:has(.as-seen-viewport:hover) .as-seen-track, .as-seen:has(.as-seen-viewport:focus-within) .as-seen-track { animation-play-state:paused; }
@keyframes as-seen-scroll { to { transform:translateX(-50%); } }
@media (prefers-reduced-motion:reduce) {
    .as-seen-track { animation:none; width:100%; }
    .as-seen-set { width:100%; min-width:0; flex-wrap:wrap; justify-content:center; gap:1.5rem 2rem; }
    .as-seen-set[aria-hidden] { display:none; }
}
.as-seen-editor { max-width:none; }
.as-seen-editor-settings, .as-seen-editor-fields { display:grid; gap:1rem; grid-template-columns:1fr; }
.as-seen-editor-settings { margin:1rem 0; }
.as-seen-editor-row { min-width:0; margin:0 0 1rem; padding:1rem; border:1px solid var(--border); border-radius:var(--radius); }
.as-seen-editor-row legend { padding:0 .4rem; color:var(--muted); font-size:.8rem; }
.as-seen-editor .field { min-width:0; }
.as-seen-editor input:not([type=checkbox]) { width:100%; min-width:0; min-height:2.5rem; padding:.55rem .7rem; border:1px solid var(--border); border-radius:6px; color:var(--text); background:var(--surface-2); font:inherit; }
.as-seen-editor input:focus-visible { outline:2px solid var(--accent); outline-offset:2px; }
.as-seen-editor-actions { display:flex; align-items:center; flex-wrap:wrap; gap:1rem; margin-top:.75rem; }
.as-seen-editor-actions label { display:flex; align-items:center; gap:.4rem; }
@media (min-width:760px) {
    .as-seen-editor-settings { grid-template-columns:2fr 1fr; }
    .as-seen-editor-fields { grid-template-columns:1fr 1.4fr 1.6fr; }
}

/* Replayer seats: keep each seat's card row the height of a dealt hand even when it is
   empty (before the deal, after a fold), so the seat never changes shape and the avatar
   stays put behind where the cards sit (.seat raises it above the player's own min-height,
   whose stylesheet loads after this one). --sc-card is the player's card width; 1.5x it
   covers every deck's card height (GG 1.46, pt5 1.32). Five and six cards use two rows. */
.pt5-replayer .seat .seat-cards { min-height: calc(var(--sc-card, 46px) * 1.5); }
.pt5-replayer .seat .seat-cards.cards-5,
.pt5-replayer .seat .seat-cards.cards-6 { min-height: calc(var(--sc-card, 23px) * 3 + 2px); }
/* Desktop, partypoker and BetOnline (Chico): their round avatars rest on the player box instead of
   rising high over the cards (the player places them 36px above the card row), which left a wide
   gap once a player folds or shows no cards. Other sets keep the player's own placement: WPN's
   portraits are positioned differently. */
@media (min-width: 900px) {
    .pt5-replayer .seat > .seat-avatar[src*="/avatar-sets/partypoker/"],
    .pt5-replayer .seat > .seat-avatar[src*="/avatar-sets/chico/"] { top: -18px !important; }
}

/* Series and operator pages (/series, /operators and their pages). */
.crumbs { font-size: 13px; color: var(--muted); margin: 4px 0 10px; }
.crumbs a { color: var(--muted); }
.crumbs a:hover { color: var(--text); }
.collection-lede { margin: 0 0 16px; font-size: 15px; line-height: 1.6; }
.collection-hero { display: block; margin: 0 0 16px; border-radius: var(--radius); overflow: hidden; background: var(--surface); }
.collection-hero img { display: block; width: 100%; height: auto; }
.collection-head h1 { display: flex; align-items: center; gap: 12px; }
.collection-logo {
  flex: none; width: 40px; height: 40px; border-radius: 10px; background: var(--logo-bg, transparent);
  object-fit: contain;
}
@media (min-width: 640px) { .collection-logo { width: 48px; height: 48px; } }
.collection-head { border-bottom: 3px solid var(--brand, var(--accent)); padding-bottom: 10px; margin-bottom: 14px; }
.collection-related { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 0 0 18px; }
.collection-related-label { font-size: 13px; color: var(--muted); margin-right: 2px; }
.collection-chip {
  --brand-c: var(--brand, var(--accent));
  display: inline-flex; align-items: center; gap: 7px; padding: 5px 12px 5px 6px;
  background: color-mix(in srgb, var(--brand-c) 22%, var(--surface));
  border: 1px solid color-mix(in srgb, var(--brand-c) 60%, transparent); border-radius: 999px;
  font-size: 13.5px; font-weight: 600; color: var(--text); text-decoration: none;
}
.collection-chip img { width: 18px; height: 18px; border-radius: 5px; background: var(--logo-bg, transparent); object-fit: contain; }
.collection-chip span { color: var(--muted); font-size: 12px; font-weight: 400; }
.collection-chip:hover { background: color-mix(in srgb, var(--brand-c) 38%, var(--surface)); text-decoration: none; }

/* Hub tiles: each in its brand's colour. */
.collection-grid { list-style: none; margin: 0 0 20px; padding: 0; display: grid; gap: 12px; grid-template-columns: 1fr; }
@media (min-width: 560px) { .collection-grid { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 900px) { .collection-grid { grid-template-columns: repeat(3, 1fr); } }
.collection-tile {
  --brand-c: var(--brand, var(--accent));
  position: relative; display: flex; align-items: center; gap: 14px; height: 100%; padding: 16px;
  background: var(--surface); border: 1px solid var(--border); border-radius: 12px;
  color: var(--text); text-decoration: none; overflow: hidden;
  transition: transform .15s ease, box-shadow .15s ease, border-color .15s ease;
}
.collection-tile:hover {
  text-decoration: none; transform: translateY(-2px); border-color: var(--brand-c);
  box-shadow: 0 8px 22px rgba(0, 0, 0, .35);
}
.collection-tile-logo {
  flex: none; display: grid; place-items: center; width: 52px; height: 52px; border-radius: 12px; background: var(--logo-bg, transparent);
}
.collection-tile-logo img { width: 48px; height: 48px; object-fit: contain; }
.collection-tile-logo span { font-size: 24px; font-weight: 800; color: var(--brand-c); }
.collection-tile-body { display: flex; flex-direction: column; gap: 3px; min-width: 0; flex: 1; }
.collection-tile-name { font-weight: 700; font-size: 16.5px; line-height: 1.25; }
.collection-tile-meta { font-size: 13px; color: color-mix(in srgb, var(--text) 70%, transparent); }
.collection-tile-count { flex: none; display: flex; flex-direction: column; align-items: flex-end; font-size: 11px; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; }
.collection-tile-count strong { font-size: 24px; line-height: 1; color: #fff; letter-spacing: 0; }
.collection-more { margin: 18px 0 0; font-size: 14px; color: var(--muted); }
.collection-more + .collection-related { margin-top: 1.5rem; }

/* Series hub: one collapsible panel per site (native <details>). */
.collection-groups { display: flex; flex-direction: column; gap: 12px; margin: 0 0 20px; }
.collection-group { border: 1px solid var(--border); border-radius: 12px; background: color-mix(in srgb, var(--surface) 60%, transparent); }
.collection-group > summary {
  display: flex; align-items: center; gap: 12px; padding: 12px 14px; cursor: pointer; list-style: none;
  border-radius: 12px; user-select: none;
}
.collection-group > summary::-webkit-details-marker { display: none; }
.collection-group > summary:hover { background: var(--surface-2); }
.collection-group > summary:focus-visible { outline: 2px solid var(--brand, var(--accent)); outline-offset: 2px; }
.collection-group-logo { flex: none; display: grid; place-items: center; width: 32px; height: 32px; }
.collection-group-logo img { width: 32px; height: 32px; object-fit: contain; }
.collection-group-name { font-weight: 700; font-size: 17px; }
.collection-group-meta { margin-left: auto; font-size: 13px; color: var(--muted); white-space: nowrap; }
.collection-group-caret { flex: none; width: 10px; height: 10px; border-right: 2px solid var(--muted); border-bottom: 2px solid var(--muted); transform: rotate(45deg) translateY(-3px); transition: transform .2s ease; }
.collection-group[open] > summary .collection-group-caret { transform: rotate(-135deg) translateY(-2px); }
.collection-group[open] > summary { border-bottom: 1px solid var(--border); border-radius: 12px 12px 0 0; }
.collection-group .collection-grid { margin: 0; padding: 12px; }
.collection-group-more { display: inline-block; margin: 0 14px 12px; font-size: 13.5px; }
/* Phones: tighter tiles, so an opened site stays short. */
@media (max-width: 639px) {
  .collection-group .collection-grid { gap: 8px; padding: 10px; }
  .collection-group .collection-tile { padding: 10px 12px; gap: 10px; }
  .collection-group .collection-tile-logo { display: none; }  /* the panel header has it */
  .collection-group .collection-tile-name { font-size: 15px; }
  .collection-group .collection-tile-count strong { font-size: 19px; }
  .collection-group-meta { font-size: 12px; }
}


/* ---------- Language switcher ---------- */
.lang-switch { position: relative; }
.lang-switch summary {
    list-style: none;
    display: inline-flex; align-items: center; gap: .35rem;
    min-height: var(--tap);
    padding: 0 .625rem;
    font-size: var(--fs-sm);
    color: var(--text);
    border-radius: 6px;
    cursor: pointer;
    white-space: nowrap;
    user-select: none;
}
.lang-switch summary::-webkit-details-marker { display: none; }
.lang-switch summary:hover, .lang-switch[open] summary { background: var(--surface-2); }
.lang-switch .lang-globe { flex-shrink: 0; opacity: .8; }
.lang-menu {
    position: absolute; right: 0; top: 100%; z-index: 30;
    list-style: none; margin: .25rem 0 0; padding: .25rem;
    min-width: 11rem;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: 0 8px 24px rgba(0, 0, 0, .35);
}
.lang-menu a { display: block; width: 100%; box-sizing: border-box; }
.lang-menu a[aria-current] { color: var(--accent); font-weight: 600; }
.footer-langs { display: flex; flex-wrap: wrap; gap: .125rem; flex-basis: 100%; }
.footer-langs a {
    color: var(--muted);
    padding: .25rem .5rem;
    border-radius: 4px;
    font-size: var(--fs-sm);
}
.footer-langs a:hover { background: var(--surface); text-decoration: none; color: var(--text); }
.footer-langs a[aria-current] { color: var(--text); font-weight: 600; }

/* ---------- Admin: translation tabs and chips ---------- */
.lang-tabs { display: flex; flex-wrap: wrap; gap: .25rem; margin: 0 0 1rem; border-bottom: 1px solid var(--border); padding-bottom: .5rem; }
.lang-tab { padding: .35rem .7rem; border-radius: 6px; color: var(--text); font-size: var(--fs-sm); border: 1px solid transparent; }
.lang-tab:hover { background: var(--surface-2); text-decoration: none; }
.lang-tab.is-active { border-color: var(--accent); color: var(--accent); }
.lang-state-published { color: #6fcf97; }
.lang-state-draft { color: var(--accent); }
.lang-state-missing { color: var(--muted); }
.lang-state-stale { color: #f2994a; }
.lang-chip { display: inline-block; min-width: 1.9rem; text-align: center; padding: .1rem .3rem; margin-right: .15rem; border-radius: 4px; font-size: var(--fs-xs); border: 1px solid var(--border); color: var(--muted); }
.lang-chip:hover { text-decoration: none; background: var(--surface-2); }
.lang-chip-published { color: #6fcf97; border-color: #6fcf97; }
.lang-chip-draft { color: var(--accent); border-color: var(--accent); }
.lang-chip.is-stale { color: #f2994a; border-color: #f2994a; }

/* ---------- Admin: tournaments list (tabs, filters, summary) ---------- */
.admin-tabs { display: flex; gap: .25rem; margin: 0 0 .75rem; border-bottom: 1px solid var(--border); }
.admin-tabs a { padding: .45rem .8rem; color: var(--text); font-size: var(--fs-sm); border-bottom: 2px solid transparent; margin-bottom: -1px; }
.admin-tabs a:hover { text-decoration: none; background: var(--surface-2); }
.admin-tabs a.is-active { color: var(--accent); border-bottom-color: var(--accent); }
.admin-filters { display: grid; grid-template-columns: repeat(auto-fill, minmax(8.5rem, 1fr)); gap: .6rem .75rem; align-items: end; margin: 0 0 .75rem; padding: .75rem; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); }
.admin-filters label { display: flex; flex-direction: column; gap: .25rem; font-size: var(--fs-xs); color: var(--muted); min-width: 0; }
.admin-filters select, .admin-filters input[type="search"] { width: 100%; max-width: none; }
.admin-filters .af-search { grid-column: 1 / -1; }
.admin-filters .af-actions { display: flex; gap: .35rem; align-self: end; }
.admin-summary { margin: 0 0 .5rem; color: var(--muted); font-size: var(--fs-sm); }
.admin-t-meta-2 { margin-top: .15rem; font-size: var(--fs-xs); }
.admin-t-meta .warn, .admin-t-meta-2 .warn { color: #f2994a; }
.admin-t-langs { margin-left: auto; white-space: nowrap; }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ---------- Language flags (assets/img/lang-flags, 3:2) ---------- */
.lang-flag {
    width: 20px; height: 14px;
    flex-shrink: 0;
    border-radius: 2px;
    object-fit: cover;
    box-shadow: 0 0 0 1px rgba(255, 255, 255, .16);
    vertical-align: -2px;
}
.lang-menu a { display: flex; align-items: center; gap: .55rem; }

/* ---------- Homepage spotlight ---------- */
/* A homepage module, not a replay page: one bordered card with a compact feature panel (picture, then its
   details and its own button) and a dense list of the latest tournaments. The picture is deliberately modest
   on wide screens so the list, the real content, stays in view. */
.spotlight {
    display: grid; grid-template-columns: minmax(0, 1fr);
    margin-bottom: 1.5rem;
    background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
    overflow: hidden;
}
.spotlight > *, .spotlight-stage, .spotlight-panel > * { min-width: 0; }
.spotlight-panel { display: grid; grid-template-columns: minmax(0, 1fr); }
.spotlight-panel[hidden] { display: none; }
.spotlight-media { position: relative; }
.spotlight-shot { display: block; position: relative; overflow: hidden; aspect-ratio: 1200 / 630; background: #0b0e12; }
.spotlight-shot img { display: block; width: 100%; height: 100%; object-fit: cover; }
/* A snapshot of the opening table sits in a dark margin (about 15% each side, 4% top and bottom):
   crop to the table and scale a touch so the frame is all table. */
.spotlight-shot.is-table { aspect-ratio: 1.6 / 1; }
.spotlight-shot.is-table img { transform: scale(1.05); }
.spotlight-shot-empty { display: grid; place-items: center; height: 100%; color: #3f4756; font-size: 2rem; letter-spacing: .4em; }
.spotlight-info { display: grid; grid-template-columns: minmax(0, 1fr); gap: .4rem; align-content: start; padding: .65rem 1rem .8rem; }
.spotlight-info > * { min-width: 0; }
/* A long title wraps and is cut at two lines (the full name is on the page it links to). */
.spotlight-title { margin: 0; font-size: var(--fs-lg); line-height: 1.25; min-width: 0; overflow-wrap: anywhere;
    display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.spotlight-title a { color: var(--text); }
.spotlight-title a:hover { color: var(--accent); text-decoration: none; }
/* The watch button sits on the picture, centred, the way a video's play button does: a dark glass pill with the accent
   play icon, which fills in on hover. Quiet enough not to shout, clear enough to be the thing to press. */
.spotlight-cta {
    position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%);
    display: inline-flex; align-items: center; gap: .6rem; white-space: nowrap;
    padding: .45rem 1.15rem .45rem .5rem;
    background: rgba(11, 14, 18, .78);
    -webkit-backdrop-filter: blur(4px); backdrop-filter: blur(4px);
    border: 1px solid rgba(255, 204, 102, .65);
    border-radius: 999px;
    box-shadow: 0 6px 20px rgba(0, 0, 0, .45);
    color: #fff; font-weight: 700; font-size: var(--fs-md); line-height: 1;
    transition: background-color .15s, border-color .15s, color .15s, transform .15s;
}
.spotlight-cta:hover, .spotlight-cta:focus-visible { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); text-decoration: none; transform: translate(-50%, -50%) scale(1.04); }
.spotlight-cta:focus-visible { outline: 2px solid var(--text); outline-offset: 3px; }
.spotlight-cta-icon { width: 1.9rem; height: 1.9rem; flex-shrink: 0; }
.spotlight-cta-icon circle { fill: var(--accent); transition: fill .15s; }
.spotlight-cta-icon path { fill: var(--accent-ink); transition: fill .15s; }
.spotlight-cta:hover .spotlight-cta-icon circle, .spotlight-cta:focus-visible .spotlight-cta-icon circle { fill: var(--accent-ink); }
.spotlight-cta:hover .spotlight-cta-icon path, .spotlight-cta:focus-visible .spotlight-cta-icon path { fill: var(--accent); }
.spotlight-sub { display: flex; flex-wrap: wrap; align-items: center; gap: .3rem .9rem; min-width: 0; max-width: 100%; }
.spotlight-sub .card-series, .spotlight-sub .card-tags { margin: 0; }
.spotlight-sub .card-series { flex-wrap: wrap; min-width: 0; }
.spotlight-sub .card-series-name, .spotlight-sub .card-brand { overflow-wrap: anywhere; }
.spotlight-facts { display: flex; flex-wrap: wrap; gap: .1rem .6rem; margin: 0; }
.spotlight-facts div { display: flex; flex-direction: column; }
.spotlight-facts dt { font-size: .6875rem; color: var(--muted); text-transform: uppercase; letter-spacing: .02em; line-height: 1.3; }
.spotlight-facts dd { margin: 0; font-weight: 700; font-size: .875rem; line-height: 1.3; }
.spotlight-more { display: flex; flex-direction: column; min-height: 0; border-top: 1px solid var(--border); }
.spotlight-more-label { margin: 0; padding: .55rem 1rem .3rem; font-size: var(--fs-xs); color: var(--muted); text-transform: uppercase; letter-spacing: .04em; }
.spotlight-list { list-style: none; margin: 0; padding: 0; overflow-y: auto; max-height: 16rem; overscroll-behavior: contain; }
.spotlight-list li { border-top: 1px solid var(--border); }
.spotlight-list li.is-active { background: var(--surface-2); box-shadow: inset 3px 0 0 var(--accent); }
.spotlight-list li { display: flex; align-items: stretch; }
.spotlight-row-link { display: flex; flex: 1 1 auto; align-items: center; gap: .7rem; padding: .55rem 1rem; color: var(--text); min-width: 0; }
.spotlight-row-link:hover, .spotlight-row-link:focus-visible { background: var(--surface-2); text-decoration: none; }
.spotlight-row-link:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }
/* Its own play button: straight to the replay (on a phone the feature panel is out of sight down here). */
.spotlight-row-play { display: flex; align-items: center; justify-content: center; flex: 0 0 auto; padding: 0 .9rem 0 .35rem; }
.spotlight-row-play svg { width: 2.2rem; height: 2.2rem; display: block; transition: transform .15s; }
/* A quiet ring with an accent triangle (seven solid yellow discs down a list would shout); it fills in on hover. */
.spotlight-row-play circle { fill: rgba(255, 204, 102, .1); stroke: rgba(255, 204, 102, .6); stroke-width: 1.2; transition: fill .15s, stroke .15s; }
.spotlight-row-play path { fill: var(--accent); transition: fill .15s; }
.spotlight-row-play:hover svg, .spotlight-row-play:focus-visible svg { transform: scale(1.08); }
.spotlight-row-play:hover circle, .spotlight-row-play:focus-visible circle { fill: var(--accent); stroke: var(--accent); }
.spotlight-row-play:hover path, .spotlight-row-play:focus-visible path { fill: var(--accent-ink); }
.spotlight-row-play:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }
@media (max-width: 899px) { .spotlight-row-arrow { display: none; } .spotlight-row-link { padding-right: .4rem; } }
.spotlight-row-icon { flex-shrink: 0; width: 24px; height: 24px; border-radius: 5px; }
.spotlight-row-icon-empty { display: grid; place-items: center; background: var(--surface-2); color: #3f4756; font-size: .8rem; }
.spotlight-row-main { display: grid; gap: .1rem; min-width: 0; flex: 1 1 auto; }
.spotlight-row-text { display: grid; gap: .2rem; min-width: 0; }
.spotlight-row-tags { display: flex; flex-wrap: wrap; gap: .25rem; }
.spotlight-row-tags .pill { font-size: .625rem; padding: 1px 6px; line-height: 1.35; }
.spotlight-row-title { overflow-wrap: anywhere; font-weight: 600; font-size: var(--fs-md); line-height: 1.3; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.spotlight-row-meta { display: flex; flex-wrap: wrap; gap: 0 .75rem; font-size: var(--fs-xs); color: var(--muted); line-height: 1.4; }
.spotlight-row-arrow { flex-shrink: 0; color: var(--muted); font-size: 1.3rem; line-height: 1; }
.spotlight-row-link:hover .spotlight-row-title, .spotlight-row-link:hover .spotlight-row-arrow, .spotlight-list li.is-active .spotlight-row-arrow { color: var(--accent); }
/* A phone-only button under the widget: on a phone the heading's link is easy to miss. */
.spotlight-all {
    display: flex; align-items: center; justify-content: center;
    min-height: var(--tap);
    margin: -.75rem 0 1.5rem;
    padding: 0 1rem;
    background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
    color: var(--text); font-weight: 600; font-size: var(--fs-md);
}
.spotlight-all:hover, .spotlight-all:focus-visible { background: var(--surface-2); color: var(--accent); text-decoration: none; }
/* Wide screens: the feature panel is half the card (picture, then its details and button). The other half is the list:
   ten rows that share the panel's height, each with the title and just the buy-in and date. */
@media (min-width: 900px) {
    .spotlight { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); margin-bottom: 2rem; }
    .spotlight-all { display: none; }
    .spotlight-stage { border-right: 1px solid var(--border); }
    .spotlight-facts { gap: .1rem 1.1rem; }
    .spotlight-facts dd { font-size: var(--fs-md); }
    .spotlight-facts dt { font-size: var(--fs-xs); letter-spacing: .04em; }
    .spotlight-more { border-top: 0; }
    .spotlight-more-label { padding: .7rem 1.1rem .45rem; }
    /* The list never makes the card taller than the feature panel: it fills the column, its rows share the height,
       and it scrolls only if the rows cannot fit. */
    .spotlight-list { flex: 1 1 0; min-height: 0; max-height: none; display: flex; flex-direction: column; }
    .spotlight-list li { flex: 1 1 auto; min-height: 2.9rem; }
    .spotlight-list li:first-child { border-top: 0; }
    .spotlight-row-link { padding: .4rem 1.1rem; }
    .spotlight-row-play { display: none; }
    .spotlight-row-title { white-space: normal; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
    .spotlight-row-main { flex-direction: row; display: flex; align-items: center; gap: 1rem; }
    .spotlight-row-text { flex: 1 1 auto; min-width: 0; }
    .spotlight-row-meta { flex: 0 0 auto; flex-direction: column; align-items: flex-end; gap: .05rem; text-align: right; white-space: nowrap; }
}

/* Admin > Real names. Controls are styled explicitly: an unstyled search field is the browser's light
   default, which put faint theme text on white. color-scheme keeps the native bits (dropdown, clear x) dark. */
.rn-filters { display: flex; flex-wrap: wrap; gap: .5rem; align-items: center; margin: 0 0 1rem; color-scheme: dark; }
.rn-filters input[type="search"], .rn-filters select {
    background: var(--surface-2); color: var(--text); border: 1px solid var(--border); border-radius: 6px;
    padding: .5rem .7rem; min-height: 40px; font: inherit; font-size: var(--fs-sm, .9rem);
}
.rn-filters input[type="search"] { flex: 1 1 16rem; min-width: 0; }
.rn-filters input[type="search"]::placeholder { color: var(--muted); opacity: 1; }
.rn-filters input[type="search"]:focus, .rn-filters select:focus { outline: 2px solid var(--accent); outline-offset: 1px; border-color: var(--accent); }
.rn-filters select option { background: var(--surface-2); color: var(--text); }
.rn-table .rn-country { white-space: nowrap; width: 1%; }
.rn-table .rn-country .flag { vertical-align: -2px; margin-right: .3rem; border-radius: 2px; }
.rn-table .rn-network { white-space: nowrap; }
.rn-table .rn-network .site-icon { vertical-align: -3px; margin-right: .4rem; }
.rn-table .rn-act { width: 1%; text-align: right; white-space: nowrap; }
.rn-table .rn-name { font-weight: 600; white-space: nowrap; }
.rn-table .rn-screen { overflow-wrap: anywhere; }
.rn-table tr.rn-first td { border-top: 1px solid var(--border); }
.rn-table tr.rn-more td { border-top-color: transparent; }
.rn-table tbody tr:hover td { background: var(--surface-2); }
.rn-range { margin: .75rem 0 0; font-size: .85rem; }

/* A textarea in a .field was the browser's light default (white box, faint text). */
.field textarea { background: var(--surface-2); color: var(--text); border: 1px solid var(--border); border-radius: var(--radius); padding: .5rem .75rem; font: inherit; font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace; font-size: .9rem; line-height: 1.5; width: 100%; resize: vertical; color-scheme: dark; }
.field textarea::placeholder, .field input::placeholder { color: var(--muted); opacity: 1; }
.field textarea:focus, .field input:focus { outline: 2px solid var(--accent); outline-offset: 1px; }

/* Admin > Real names > edit. Mobile first: one column, compact cards, large tap targets; two columns from 640px. */
.rn-form { display: grid; gap: .75rem; max-width: 44rem; color-scheme: dark; }
.rn-title { font-size: 1.25rem; margin: 0 0 .5rem; }
.rn-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: .75rem; display: grid; gap: .5rem; min-width: 0; }
.rn-h2 { font-size: .8rem; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); margin: 0; font-weight: 600; }
.rn-label { font-size: .8rem; color: var(--muted); display: block; margin-bottom: .2rem; }
.rn-input { background: var(--surface-2); color: var(--text); border: 1px solid var(--border); border-radius: 8px; padding: .55rem .7rem; min-height: 44px; font: inherit; width: 100%; box-sizing: border-box; }
.rn-input::placeholder { color: var(--muted); opacity: 1; }
.rn-input:focus, .rn-site:focus-visible, .rn-chip-x:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
select.rn-input option { background: var(--surface-2); color: var(--text); }
.rn-two { display: grid; gap: .5rem; }
.rn-country-pick { display: flex; align-items: center; gap: .5rem; }
.rn-country-pick .flag { flex: none; border-radius: 2px; }
.rn-chips { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: .4rem; }
.rn-chip { display: inline-flex; align-items: center; gap: .45rem; background: var(--surface-2); border: 1px solid var(--border); border-radius: 999px; padding: .2rem .25rem .2rem .55rem; max-width: 100%; }
.rn-chip img { flex: none; }
.rn-chip-text { display: flex; flex-direction: column; line-height: 1.15; min-width: 0; }
.rn-chip-text small { color: var(--muted); font-size: .68rem; }
.rn-chip-text strong { font-weight: 600; font-size: .9rem; overflow-wrap: anywhere; }
.rn-chip-x { flex: none; width: 32px; height: 32px; border-radius: 50%; border: 0; background: transparent; color: var(--muted); font-size: 1.2rem; line-height: 1; cursor: pointer; }
.rn-chip-x:hover { background: var(--border); color: var(--text); }
.rn-empty { margin: 0; font-size: .85rem; }
.rn-add { display: grid; gap: .5rem; border-top: 1px solid var(--border); padding-top: .6rem; }
.rn-sites { display: grid; grid-template-columns: repeat(auto-fill, minmax(5.2rem, 1fr)); gap: .35rem; }
.rn-site { display: flex; flex-direction: column; align-items: center; gap: .2rem; padding: .45rem .25rem; min-height: 56px; background: var(--surface-2); color: var(--muted); border: 1px solid var(--border); border-radius: 8px; font: inherit; font-size: .68rem; line-height: 1.1; text-align: center; cursor: pointer; }
.rn-site img { display: block; }
.rn-site-initial { width: 20px; height: 20px; display: grid; place-items: center; border-radius: 50%; background: var(--border); color: var(--text); font-size: .7rem; font-weight: 700; }
.rn-site.is-on { color: var(--text); border-color: var(--accent); box-shadow: inset 0 0 0 1px var(--accent); }
.rn-add-row { display: flex; gap: .5rem; }
.rn-add-row .rn-input { flex: 1 1 auto; min-width: 0; }
.rn-add-btn { flex: none; min-height: 44px; }
.rn-msg { margin: 0; font-size: .85rem; color: var(--accent); }
.rn-actions { display: flex; gap: 1rem; align-items: center; }
.rn-actions .btn { min-height: 44px; padding-inline: 1.5rem; }
.rn-delete { margin-top: 1.25rem; }
@media (min-width: 640px) {
    .rn-card { padding: 1rem; }
    .rn-two { grid-template-columns: 1fr 1fr; }
    .rn-sites { grid-template-columns: repeat(auto-fill, minmax(6.2rem, 1fr)); }
    .rn-site { flex-direction: row; justify-content: flex-start; gap: .45rem; padding: .4rem .55rem; min-height: 40px; font-size: .78rem; text-align: left; }
}

.rn-chip-avatar { border-radius: 50%; object-fit: cover; background: var(--surface); flex: none; }
.rn-table .rn-avatar { width: 28px; height: 28px; border-radius: 50%; object-fit: cover; vertical-align: middle; margin-right: .4rem; background: var(--surface-2); }

/* ---------- Admin user analytics ---------- */
.an-range { display: flex; gap: .4rem; flex-wrap: wrap; align-items: center; }
.an-range input[type=date] { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); color: var(--text); padding: .35rem .5rem; font: inherit; }
.an-range .btn.is-active { background: var(--accent); color: #0b0f14; }
.an-chart { color: #3b82f6; }
.an-kpis { grid-template-columns: repeat(2, 1fr); }
@media (min-width: 720px)  { .an-kpis { grid-template-columns: repeat(4, 1fr); } }
.delta { display: inline-block; margin-left: .35rem; padding: 0 .35rem; border-radius: 4px; font-size: .75rem; font-weight: 600; background: rgba(245,158,11,.18); color: #fcd34d; }
.delta-up { background: rgba(34,197,94,.18); color: #86efac; }
.delta-down { background: rgba(239,68,68,.18); color: #fca5a5; }
.an-chart { width: 100%; height: auto; display: block; }
.an-axis { font-size: 7.5px; fill: currentColor; opacity: .55; }
.an-h3 { margin: 0 0 .5rem; font-size: .9rem; color: var(--muted); font-weight: 600; }
.an-bars + .an-h3 { margin-top: 1rem; }
.an-split-3 { display: grid; gap: 1.25rem; grid-template-columns: 1fr; }
@media (min-width: 900px) { .an-split-3 { grid-template-columns: repeat(3, 1fr); } }
.an-gap { margin-top: 1.25rem; padding-top: 1rem; border-top: 1px solid var(--border); }
.an-bars { list-style: none; margin: 0; padding: 0; display: grid; gap: .45rem; }
.an-bars li { display: grid; grid-template-columns: minmax(0, 9.5rem) 1fr auto; gap: .6rem; align-items: center; font-size: .9rem; }
.an-bar-label { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.an-bar-track { height: .55rem; background: rgba(148,163,184,.15); border-radius: 999px; overflow: hidden; }
.an-bar-fill { display: block; height: 100%; background: #3b82f6; border-radius: 999px; }
.an-bar-fill.is-good { background: #22c55e; }
.an-bar-fill.is-warn { background: #f59e0b; }
.an-bar-fill.is-bad  { background: #ef4444; }
.an-bar-num { font-variant-numeric: tabular-nums; white-space: nowrap; }
.an-note { font-size: .85rem; margin: .6rem 0 0; }
.an-heat td { text-align: center; }
.an-heat-na { background: transparent; }
.an-scroll { max-height: 22rem; overflow: auto; }

/* Admin form controls are dark like the rest of the theme. Left unstyled, browsers draw selects and search/date
   fields white, and color-scheme keeps their native parts (dropdown arrow, clear x, date picker) dark too. */
.admin-shell { color-scheme: dark; }
.admin-shell input[type="search"], .admin-shell input[type="text"], .admin-shell input[type="date"],
.admin-shell input[type="number"], .admin-shell input[type="email"], .admin-shell select, .admin-shell textarea {
    background: var(--surface-2); color: var(--text); border: 1px solid var(--border); border-radius: 6px;
    padding: .45rem .65rem; min-height: 38px; font: inherit; font-size: var(--fs-sm, .9rem);
}
.admin-shell textarea { min-height: 0; }
.admin-shell input::placeholder, .admin-shell textarea::placeholder { color: var(--muted); opacity: 1; }
.admin-shell input[type="search"]:focus, .admin-shell input[type="text"]:focus, .admin-shell input[type="date"]:focus,
.admin-shell input[type="number"]:focus, .admin-shell input[type="email"]:focus, .admin-shell select:focus, .admin-shell textarea:focus {
    outline: 2px solid var(--accent); outline-offset: 1px; border-color: var(--accent);
}
.admin-shell select option { background: var(--surface-2); color: var(--text); }
.admin-shell input[type="checkbox"], .admin-shell input[type="radio"] { accent-color: var(--accent); }

/* Type tags: the generic .badge rule further down the file would otherwise repaint them all the same grey. */
.badge.badge-user    { background: #1e3a8a; color: #bfdbfe; }
.badge.badge-admin   { background: #7f1d1d; color: #fecaca; }
.badge.badge-basic   { background: #134e4a; color: #99f6e4; }
.badge.badge-pro     { background: #14532d; color: #bbf7d0; }
.badge.badge-partner { background: #581c87; color: #e9d5ff; }
.badge.badge-google  { background: #78350f; color: #fde68a; }
.badge.badge-email   { background: #164e63; color: #a5f3fc; }
.badge.badge-unverified { background: #7c2d12; color: #fed7aa; }

/* Admin density. The six dashboard cards sit on one row (the later .stat-grid rule was winning with four columns,
   wrapping them onto two), and cards, panels and tables use less padding. */
.admin-shell .stat-grid.stat-grid-6 { grid-template-columns: repeat(2, 1fr); }
@media (min-width: 640px)  { .admin-shell .stat-grid.stat-grid-6 { grid-template-columns: repeat(3, 1fr); } }
@media (min-width: 960px)  { .admin-shell .stat-grid.stat-grid-6 { grid-template-columns: repeat(6, 1fr); } }
.admin-shell .stat-grid { gap: .5rem; margin-bottom: .75rem; }
.admin-shell .stat { padding: .5rem .75rem; gap: 0; border-radius: 8px; }
.admin-shell .stat-num { font-size: 1.3rem; line-height: 1.25; }
.admin-shell .stat-label { font-size: .78rem; }
.admin-shell h1 { font-size: 1.4rem; margin: .25rem 0 .6rem; }
.admin-shell .admin-panel { padding: .65rem .9rem; margin-top: .65rem; }
.admin-shell .panel-head { margin-bottom: .35rem; }
.admin-shell .panel-head h2 { font-size: 1rem; }
.admin-shell .admin-split { gap: .65rem; margin-top: .65rem; }
.admin-shell .table th, .admin-shell .table td { padding: .35rem .55rem; }
.admin-shell .dashboard-tournament-row { padding: .25rem 0; }
.admin-shell .an-kpis { grid-template-columns: repeat(2, 1fr); }
@media (min-width: 720px)  { .admin-shell .an-kpis { grid-template-columns: repeat(4, 1fr); } }
@media (min-width: 1180px) { .admin-shell .an-kpis { grid-template-columns: repeat(8, 1fr); } }

/* Admin > Users */
.stats-row { display: flex; flex-wrap: wrap; gap: .4rem; margin: 0 0 .65rem; }
.stat-chip { display: inline-flex; align-items: center; gap: .35rem; padding: .25rem .65rem; border-radius: 999px; border: 1px solid var(--border);
    background: var(--surface); color: var(--text); font-size: .82rem; text-decoration: none; }
.stat-chip:hover { text-decoration: none; border-color: currentColor; }
.stat-chip strong { font-variant-numeric: tabular-nums; }
.stat-chip.chip-good   { color: #86efac; border-color: rgba(34,197,94,.35); }
.stat-chip.chip-warn   { color: #fdba74; border-color: rgba(245,158,11,.4); }
.stat-chip.chip-bad    { color: #fca5a5; border-color: rgba(239,68,68,.4); }
.stat-chip.chip-blue   { color: #93c5fd; border-color: rgba(59,130,246,.4); }
.stat-chip.chip-purple { color: #d8b4fe; border-color: rgba(168,85,247,.4); }
.badge.badge-dnc { background: #7f1d1d; color: #fecaca; font-weight: 700; letter-spacing: .03em; margin-left: .35rem; }
.badge.badge-yes { background: #14532d; color: #bbf7d0; }
.users-table .user-name { font-size: .78rem; }
.users-table .google-icon { vertical-align: -2px; margin-right: .15rem; }
.src-dot { margin-left: .3rem; padding: 0 .3rem; border-radius: 4px; font-size: .68rem; background: rgba(59,130,246,.2); color: #93c5fd; }
.check-inline { display: inline-flex; align-items: center; gap: .5rem; font-size: .9rem; }

/* Admin: the country stays on one line; sign-up method is an icon, not a tag. */
.admin-country { display: inline-flex; align-items: center; gap: .3rem; white-space: nowrap; }
.admin-country .admin-flag { display: inline-block; margin-right: 0; vertical-align: baseline; }
/* A globe stands for a country we do not know: same box as a flag. */
.admin-globe { width: 20px; height: 16px; flex: none; color: var(--muted); vertical-align: -3px; }
.signup-icon { display: inline-flex; align-items: center; justify-content: center; width: 22px; height: 22px; border-radius: 50%; background: rgba(255,255,255,.08); }
.signup-email { color: #67e8f9; }
.admin-tick { text-align: center; color: #4ade80; font-weight: 700; }

/* Account cog in the header (replaces the "Hi, name" text). */
.account-nav a.account-cog { padding: 0; width: var(--tap); justify-content: center; color: var(--muted); }
.account-nav a.account-cog:hover { color: var(--text); }

/* Preferences page: one centred column of cards, comfortable on a phone. */
.prefs { max-width: 640px; margin: 0 auto; padding: .5rem 0 2.5rem; }
.prefs-head h1 { margin: 0 0 .25rem; }
.prefs-who { margin: 0 0 1.25rem; font-size: var(--fs-md); overflow-wrap: anywhere; }
.prefs-via { display: inline-block; margin-left: .5rem; padding: .05rem .5rem; border: 1px solid var(--border); border-radius: 999px; font-size: var(--fs-xs); }
.prefs-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 1.1rem 1.1rem 1.2rem; margin-bottom: 1rem; }
.prefs-card h2 { margin: 0 0 .85rem; font-size: var(--fs-lg); }
.prefs-card h2.prefs-sub { margin-top: 1.4rem; padding-top: 1.1rem; border-top: 1px solid var(--border); }
.prefs-card .field { margin-bottom: .85rem; }
.prefs-card .field input:disabled { opacity: .65; }
.prefs-pair { display: grid; gap: .85rem; grid-template-columns: 1fr; }
@media (min-width: 560px) { .prefs-pair { grid-template-columns: 1fr 1fr; } }
.prefs-actions { margin-top: 1rem; }
.prefs-actions .btn { width: 100%; }
@media (min-width: 560px) { .prefs-actions .btn { width: auto; min-width: 9rem; } }
.prefs-switch { display: flex; align-items: flex-start; gap: .85rem; cursor: pointer; position: relative; }
.prefs-switch input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.prefs-switch-track { flex: none; width: 46px; height: 26px; margin-top: .1rem; border-radius: 999px; background: var(--surface-2); border: 1px solid var(--border); position: relative; transition: background .15s; }
.prefs-switch-track::after { content: ""; position: absolute; top: 2px; left: 2px; width: 20px; height: 20px; border-radius: 50%; background: var(--muted); transition: transform .15s, background .15s; }
.prefs-switch input:checked + .prefs-switch-track { background: var(--accent-soft); border-color: var(--accent); }
.prefs-switch input:checked + .prefs-switch-track::after { transform: translateX(20px); background: var(--accent); }
.prefs-switch input:focus-visible + .prefs-switch-track { outline: 2px solid var(--accent); outline-offset: 2px; }
.prefs-switch-text { display: flex; flex-direction: column; gap: .2rem; min-width: 0; }
.prefs-switch-text small { font-size: var(--fs-sm); line-height: 1.4; }
.prefs-danger { border-color: #7f1d1d; }
.prefs-danger h2 { color: #fca5a5; }
.prefs-danger summary { list-style: none; cursor: pointer; display: inline-flex; }
.prefs-danger summary::-webkit-details-marker { display: none; }
.btn-danger-outline { background: transparent; border: 1px solid #b91c1c; color: #fca5a5; }
.btn-danger-outline:hover { background: #2a0808; }
.btn-danger { background: #b91c1c; color: #fff; border-color: #b91c1c; }
.btn-danger:hover { filter: brightness(1.12); }
.prefs-delete { margin-top: 1rem; }
.prefs-signout { text-align: center; margin-top: .5rem; }
.prefs-card.form, .prefs-delete { max-width: none; }
/* Wide screens: two balanced columns instead of one narrow strip (mobile first: below 900px it stays one column, 640px).
   CSS columns, so the cards flow down the page and the two sides come out level whatever each card's height; the heading,
   notice, membership card and sign-out link run across both. */
@media (min-width: 900px) {
    .prefs { max-width: 1040px; column-count: 2; column-gap: 1.25rem; }
    .prefs > .prefs-head, .prefs > .flash, .prefs > .prefs-wide, .prefs > .prefs-signout { column-span: all; }
    .prefs > .prefs-card { break-inside: avoid; }
}
@media (min-width: 1500px) { .prefs { max-width: 1240px; column-gap: 1.5rem; } }
/* A card that folds away (the password form): the heading is the toggle, with a chevron. */
.prefs-fold > summary { list-style: none; cursor: pointer; display: flex; align-items: center; justify-content: space-between; gap: .75rem; }
.prefs-fold > summary::-webkit-details-marker { display: none; }
.prefs-fold > summary h2 { margin: 0; }
.prefs-fold > summary::after { content: ""; width: .6rem; height: .6rem; flex: none; border-right: 2px solid var(--muted); border-bottom: 2px solid var(--muted); transform: rotate(45deg); transition: transform .15s; }
.prefs-fold[open] > summary::after { transform: rotate(-135deg); }
.prefs-fold[open] > summary { margin-bottom: .85rem; }
.prefs-pair .field { min-width: 0; }
.prefs-card select, .prefs-card input[type=text], .prefs-card input[type=email] { width: 100%; box-sizing: border-box; }

.prefs-country-pick { position: relative; display: block; }
.prefs-country-pick .prefs-flag { position: absolute; left: .75rem; top: 50%; transform: translateY(-50%); width: 22px; height: 16px; border-radius: 2px; object-fit: cover; box-shadow: 0 0 0 1px rgba(255,255,255,.14); pointer-events: none; }
.prefs-country-pick .prefs-flag:not([hidden]) + select { padding-left: 2.6rem; }

/* Account menu: the cog opens Preferences, Admin (admin users only) and Sign out. */
.account-menu { position: relative; }
.account-menu summary.account-cog {
    list-style: none; display: inline-flex; align-items: center; justify-content: center;
    width: var(--tap); min-height: var(--tap); border-radius: 6px; cursor: pointer;
    color: var(--muted); user-select: none;
}
.account-menu summary.account-cog::-webkit-details-marker { display: none; }
.account-menu summary.account-cog:hover, .account-menu[open] summary.account-cog { color: var(--text); background: var(--surface-2); }
.account-menu-list {
    position: absolute; right: 0; top: 100%; z-index: 30;
    list-style: none; margin: .25rem 0 0; padding: .25rem; min-width: 11rem;
    background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
    box-shadow: 0 8px 24px rgba(0, 0, 0, .35);
}
.account-menu-list a, .account-menu-list button {
    display: flex; align-items: center; width: 100%; box-sizing: border-box;
    min-height: var(--tap); padding: 0 .75rem; border: 0; border-radius: 6px;
    background: transparent; color: var(--text); font: inherit; font-size: var(--fs-sm);
    text-align: left; cursor: pointer; white-space: nowrap;
}
.account-menu-list a:hover, .account-menu-list button:hover { background: var(--surface-2); text-decoration: none; }
.account-menu-list form { margin: 0; }

/* Phone held upright: the chip alone is the brand (the words stay for screen readers),
   and the homepage "See all" beside the Latest replays heading goes (the MTTs tab is one tap away). */
@media (orientation: portrait) and (max-width: 719px) {
    .brand-text { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
}
@media (max-width: 719px) {
    .section-more-desktop { display: none; }
}

/* Phones: logo, MTTs/News/Features, language, account all stay on ONE row. The padding
   tightens and the language code drops (the flag stays) so the three links fit beside
   the controls; on the narrowest screens the Register button yields to Sign in
   (the sign-in page offers Register). Checked at 320-390px in every language. */
@media (max-width: 719px) {
    .site-header .container { gap: .125rem; }
    .brand { margin-right: 0; }
    .primary-nav a { padding: 0 .4rem; }
    .account-nav { gap: 0; }
    .account-nav a { padding: 0 .4rem; }
    .lang-switch summary { padding: 0 .3rem; }
    .lang-switch .lang-code { display: none; }
    .account-nav a.btn { padding: 0 .55rem; }
}
@media (max-width: 379px) {
    .account-nav a.btn { display: none; }
}
/* The footer links may wrap (the social icons used to push the page wider than the screen). */
.footer-nav { flex-wrap: wrap; }

/* Phone held upright: the "Cash game sessions - coming soon" card is hidden for now
   (it only shows to signed-out visitors; the MTT card above it stays). */
@media (orientation: portrait) and (max-width: 719px) {
    .hero-card-cash { display: none; }
}

/* Autosuggest under the tournament and player search fields (assets/js/suggest.js). */
.suggest { position: relative; }
.suggest-menu {
    position: absolute; z-index: 40; top: calc(100% + 2px); left: 0; right: 0; margin: 0; padding: .25rem; list-style: none;
    max-height: 340px; overflow-y: auto; background: var(--surface); border: 1px solid var(--border);
    border-radius: var(--radius); box-shadow: 0 8px 24px rgba(0, 0, 0, .35);
}
.suggest-menu[hidden] { display: none; }
.suggest-menu li { display: flex; align-items: center; gap: .5rem; padding: .45rem .6rem; border-radius: 6px; cursor: pointer; color: var(--text); }
.suggest-menu li[aria-selected=true], .suggest-menu li:hover { background: var(--surface-2); }
.suggest-icon { width: 18px; height: 18px; border-radius: 4px; flex: none; }
.suggest-icon-none { display: inline-block; }
.suggest-label { flex: 1 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.suggest-label mark { background: none; color: var(--accent); font-weight: 700; }
.suggest-sub, .suggest-n { color: var(--muted); font-size: .85rem; flex: none; }

.spotlight-widget-head { display:flex; align-items:center; justify-content:space-between; flex-wrap:wrap; gap:.5rem; padding:.7rem 1rem; border-bottom:1px solid var(--border); }
.spotlight-widget-head .spotlight-more-label { margin:0; padding:0; }
.video-tabs { display:flex; flex-wrap:wrap; gap:.35rem; }
.spotlight-widget-head .video-tabs .btn { min-height:32px; padding:.3rem .65rem; font-size:var(--fs-xs); }
.video-tabs [aria-selected="true"] { background:var(--accent); color:var(--bg); border-color:var(--accent); }
[data-video-view][hidden] { display:none !important; }

/* Member administration and recorded player portraits. */
.users-table .user-name { font-size: .9rem; font-weight: 600; }
.users-table .user-name a { color: #f5a24b; }
.users-table .user-email { color: #a4abb8; font-size: .78rem; overflow-wrap: anywhere; }
.users-table .user-language { display: inline-block; color: #9ecbff; background: #203348; border-radius: 4px; padding: 1px 5px; font-size: .7rem; margin-top: 4px; }
.player-portrait { border-radius: 50%; object-fit: cover; float: left; margin: 0 18px 12px 0; }
.player-head::after { content: ''; display: block; clear: both; }
.members-overview, .members-replays { display: grid; gap: 16px; margin-bottom: 20px; }
.members-overview > *, .members-replays > * { min-width: 0; }
.members-tiers { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.members-preview { display: flex; flex-wrap: wrap; align-items: end; gap: 12px; }
.members-preview input { width: 120px; }
.members-replay { border: 1px solid var(--border, #303744); padding: 16px; border-radius: 10px; display: flex; flex-direction: column; align-items: start; gap: 12px; }
.members-replay .panel-head { width: 100%; margin: 0; }
.members-replay h3 { margin: 0; overflow-wrap: anywhere; }
.members-replay > .btn { margin-top: auto; }
@media (min-width: 700px) { .members-replays { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (min-width: 1000px) { .members-overview { grid-template-columns: 1fr 1fr; } .members-replays { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (min-width: 1500px) { .members-replays { grid-template-columns: repeat(4, minmax(0, 1fr)); } }

.share-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin: 24px 0 0; padding-top: 20px; border-top: 1px solid var(--border); }
.share-actions .share-button { flex: 1 1 calc(50% - 10px); min-height: 44px; gap: 8px; padding: 8px 16px; background: var(--surface); font: inherit; font-size: var(--fs-sm); font-weight: 600; }
.share-button svg { width: 20px; height: 20px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; color: var(--accent); }
.share-whatsapp svg { color: #25d366; }
.share-telegram svg { color: #38b5ed; }
.share-actions .share-button:hover { background: var(--surface-2); border-color: var(--accent); }
.share-actions .share-button:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
.share-actions [data-share-status] { flex-basis: 100%; color: var(--muted); font-size: var(--fs-sm); overflow-wrap: anywhere; }
.share-actions [data-share-status]:empty { display: none; }
@media (min-width: 600px) { .share-actions .share-button { flex: 0 0 auto; } }

/* Player profiles and discovery share the site's warm accent and compact cards. */
.player-profile { display: flex; align-items: center; flex-wrap: wrap; gap: 18px; padding: 24px; margin-bottom: 20px; border: 1px solid var(--border); border-radius: 12px; background: linear-gradient(135deg, var(--surface-2), var(--surface)); }
.player-profile::after { display: none; }
.player-portrait-frame { width: 96px; height: 96px; flex: none; display: grid; place-items: center; border-radius: 50%; background: var(--bg); border: 2px solid var(--accent-soft); overflow: hidden; }
.player-profile .player-portrait { width: 100%; height: 100%; float: none; margin: 0; object-fit: contain; }
.player-identity { flex: 1; min-width: 0; }
.player-identity h1 { overflow-wrap: anywhere; font-size: clamp(1.5rem, 4vw, 2.2rem); margin: 4px 0 8px; }
.player-identity p { margin: 0 0 8px; }
.player-network { color: var(--accent); font-size: var(--fs-sm); font-weight: 600; }
.country-badge { display: inline-flex; align-items: center; gap: 8px; color: var(--muted); font-size: var(--fs-sm); }
.country-badge img { display: block; object-fit: contain; flex: none; }
.player-actions { display: flex; flex-wrap: wrap; gap: 10px; width: 100%; }
.player-actions .btn { flex: 1; min-height: 44px; }
.player-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.player-stats .stat { min-width: 0; padding: 16px; }
.player-stats .stat-num { font-size: clamp(1.1rem, 3vw, 1.65rem); overflow-wrap: anywhere; color: var(--accent); }
.player-results-scroll { overflow-x: auto; border: 1px solid var(--border); border-radius: var(--radius); }
.player-results { margin: 0; min-width: 620px; }
.player-results .player-tournament { min-width: 220px; }
.player-tournament > a { font-weight: 600; }
.player-tournament .muted { display: block; font-size: var(--fs-sm); }
.finish-badge { display: inline-flex; gap: 5px; padding: 3px 9px; border-radius: 6px; background: var(--surface-2); }
.finish-win { color: var(--accent); background: var(--accent-soft); }
.player-search { padding: 18px; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); }
.result-count { display: inline-block; margin-left: 6px; padding: 2px 8px; border-radius: 12px; background: var(--surface-2); color: var(--text); }
.player-directory { display: grid; grid-template-columns: minmax(0, 1fr); gap: 12px; }
.player-card { display: flex; align-items: center; gap: 12px; padding: 16px; color: var(--text); border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); transition: border-color .15s, background .15s; }
.player-card:hover { border-color: var(--accent); background: var(--surface-2); text-decoration: none; }
.player-card:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
.player-card-avatar { width: 56px; height: 56px; flex: none; object-fit: contain; border-radius: 50%; background: var(--bg); }
.player-card-info { display: grid; gap: 5px; flex: 1; min-width: 0; }
.player-card-info strong { overflow-wrap: anywhere; }
.player-card-info .muted { font-size: var(--fs-sm); }
.player-card-arrow { color: var(--accent); }
@media (min-width: 640px) { .player-directory { grid-template-columns: repeat(2, minmax(0, 1fr)); } .player-portrait-frame { width: 112px; height: 112px; } }
@media (min-width: 800px) { .player-actions { width: auto; flex-direction: column; } .player-stats { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
@media (min-width: 1100px) { .player-directory { grid-template-columns: repeat(3, minmax(0, 1fr)); } }

/* Compact search controls within the shared page container. */
.admin-filters.player-search { grid-template-columns: minmax(0, 1fr); gap: 12px; padding: 16px; }
.admin-filters.player-search .af-search { grid-column: auto; }
.player-search input[type="search"], .player-search select { display: block; width: 100%; min-width: 0; min-height: 44px; padding: 9px 12px; border: 1px solid #596575; border-radius: var(--radius); background: var(--bg); color: var(--text); caret-color: var(--accent); font: inherit; font-size: 16px; color-scheme: dark; }
.player-search input[type="search"]::placeholder { color: var(--muted); opacity: 1; }
.player-search select option { background: var(--surface); color: var(--text); }
.player-search input[type="search"]:focus, .player-search select:focus { outline: 2px solid var(--accent); outline-offset: 2px; border-color: var(--accent); }
.player-search .btn { min-height: 44px; }
@media (min-width: 600px) { .admin-filters.player-search { grid-template-columns: minmax(12rem, 20rem) minmax(10rem, 15rem); justify-content: start; } .player-search .btn { justify-self: start; } }
@media (min-width: 900px) { .admin-filters.player-search { grid-template-columns: minmax(12rem, 20rem) minmax(10rem, 15rem) max-content; } }

.player-card-network { display: flex; align-items: center; gap: 6px; }
.player-card-network img { flex: none; object-fit: contain; border-radius: 3px; }
@media (min-width: 1440px) { .player-directory { grid-template-columns: repeat(4, minmax(0, 1fr)); } }

.player-card-avatar[src*="/assets/img/brand/"] { padding: 9px; border: 1px solid var(--border); }
.player-profile .player-portrait[src*="/assets/img/brand/"] { padding: 16px; }

.player-card-avatar[src*="/site-icons/"] { padding: 9px; border: 1px solid var(--border); }
.player-profile .player-portrait[src*="/site-icons/"] { padding: 16px; }

.player-search .suggest { min-width: 0; }
.player-search .suggest-menu { width: 100%; min-width: 0; max-height: 320px; overflow-y: auto; }
.player-search .suggest-menu li { min-height: 44px; white-space: normal; }
.player-suggestion-text { display: grid; gap: 3px; min-width: 0; overflow-wrap: anywhere; }
.player-suggestion-text small { color: var(--muted); font-size: var(--fs-xs); }

.account-menu-list a, .account-menu-list button { gap: 9px; }
.account-menu-icon { width: 16px; height: 16px; flex: none; color: var(--accent); }

.results-table-scroll { width: 100%; max-width: 100%; overflow-x: auto; background: #101822; border: 1px solid #304052; border-radius: 10px; }
.results-table-scroll .results-table { display: table; width: 100%; min-width: 0; max-width: none; margin: 0; color: #e7edf5; font-size: 14px; }
.results-table-scroll .results-table .col-player { width: 100%; }
.results-table-scroll .results-table th, .results-table-scroll .results-table td { padding: 6px 10px; border-bottom-color: #304052; vertical-align: middle; }
.results-table-scroll .results-table thead th { color: #aebdce; background: #172332; }
.results-table-scroll .results-table tfoot th { color: #e7edf5; background: #172332; border-bottom: 0; }
.results-table-scroll .results-table tbody tr:last-child td { border-bottom: 0; }
.results-table-scroll .results-table a:not(.btn) { color: #b8d9ff; }
@media (max-width: 640px) { .results-table-scroll .results-table { font-size: .8rem; } .results-table-scroll .results-table th, .results-table-scroll .results-table td { padding: 4px 8px; } }
.results-table .col-follow { width: 1%; text-align: center; padding-left: 8px; }
.results-table th.col-follow { white-space: nowrap; }
.results-table .follow-player-btn { min-height: 26px; gap: 5px; padding: 3px 7px; color: #b8d9ff; background: #1b2d43; border: 1px solid #3c6088; border-radius: 4px; font-size: .75rem; }
.results-table .follow-player-btn:hover { color: #fff; background: #274564; border-color: #6a9bc9; filter: none; }
.results-table .follow-player-btn:focus-visible { outline: 2px solid #8abcf0; outline-offset: -3px; }
.follow-player-btn svg { flex: none; }
@media (max-width: 640px) { .results-table .col-follow { padding-left: 6px; } }

.results-table tbody tr:nth-child(even):not(.row-winner) > td { background: rgba(255, 255, 255, .035); }
.results-table tbody tr:nth-child(odd):not(.row-winner) > td { background: rgba(255, 255, 255, .012); }
.results-table tbody tr.row-winner > td { background: rgba(34, 197, 94, .09); }

.tournament-structure-card { padding: 16px 18px; margin-bottom: 20px; background: #101822; color: #e7edf5; border: 1px solid #304052; border-radius: 10px; }
.tournament-structure-card h2, .tournament-structure-card h3 { margin: 0 0 10px; color: #65d6c4; font-size: 1rem; }
.tournament-structure-card ul { margin: 0; padding: 0; list-style: none; }
.tournament-structure-card li { display: grid; grid-template-columns: minmax(90px, .85fr) minmax(0, 1.15fr); gap: 10px; padding: 7px 0; border-bottom: 1px solid #263647; font-size: var(--fs-sm); overflow-wrap: anywhere; }
.tournament-structure-card li:last-child { border-bottom: 0; padding-bottom: 0; }
.tournament-structure-card strong { color: #aebdce; font-weight: 500; }
/* A shared grid keeps the tables and summary aligned across the available width. */
.tournament-details { display: contents; }
.metadata-download { flex: none; }
.metadata-download .btn { display: inline-flex; align-items: center; gap: 6px; padding: 5px 9px; font-size: .8rem; color: #b8d9ff; background: #1b2d43; border: 1px solid #3c6088; }
.tournament-info-row .tournament-description { margin-bottom: 12px; }
.tournament-info-row .tournament-description p:last-child { margin-bottom: 0; }
/* One shared panel for Info / Payouts, Results and Final table ICM. */
.tournament-results-tabs { padding: 24px; background: #101822; color: #e7edf5; border: 1px solid #304052; border-radius: 12px; }
.tournament-results-tabs #final-table-icm .study-icm { padding: 0; min-height: 0; border: 0; border-radius: 0; background: transparent; }
.tournament-results-tabs > .results > .results-head { margin-top: 0; }
.tournament-results-tabs > .results > .results-head h2 { margin-top: 0; }
@media (max-width: 600px) { .tournament-results-tabs { padding: 14px; } }

.tournament-metadata { display: flex; flex-wrap: wrap; align-items: flex-start; gap: 12px 24px; margin-bottom: 16px; padding-bottom: 16px; border-bottom: 1px solid #304052; }
.tournament-metadata > .tournament-description { flex: 1 1 28rem; min-width: 0; margin: 0; }
.metadata-download .btn { max-width: 100%; white-space: normal; text-align: left; }
.tournament-metadata > .tournament-description p:first-child { margin-top: 0; }
.tournament-metadata > .tournament-description p:last-child { margin-bottom: 0; }

/* Portal wrappers inherit the panel surface, not the poker table canvas. */
.tournament-results-tabs > #results-study-tabs.pt5-replayer,
.tournament-results-tabs > #final-table-icm.pt5-replayer { background: transparent; }



.results-info-layout { display: grid; grid-template-columns: minmax(0, 1fr); gap: 16px; align-items: start; }
.results-info-table { min-width: 0; }
.results-info-table .results-head { margin: 0 0 10px; }
.results-info-table .results-head h2 { margin: 0; font-size: 1rem; }
.results-info-layout .tournament-structure-card { width: 100%; max-width: 460px; margin: 0; }
.results-info-layout .tournament-stats { min-width: 0; }
.results-info-layout .stat-grid { grid-template-columns: minmax(0, 1fr); margin: 0; }
@media (min-width: 1100px) {
  .results-info-layout { grid-template-columns: minmax(0, 1fr) 340px; }
}
