@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&family=Space+Grotesk:wght@500;600&family=Syne+Mono&display=swap');

:root {
  color-scheme: light;
  --page-bg: #f6f7fb;
  --page-bg-alt: #eef1f6;
  --surface: #ffffff;
  --surface-alt: #f3f5fa;
  --surface-soft: #eaedf4;
  --surface-strong: #dde3ee;
  --text: #111827;
  --muted: #64718a;
  --muted-soft: #7c869d;
  --border: #d9e0eb;
  --border-strong: #c5cedd;
  --accent: #111111;
  --accent-soft: #1f2937;
  --accent-contrast: #ffffff;
  --focus-ring: rgba(17, 17, 17, 0.35);
  --radius-sm: 12px;
  --radius-md: 18px;
  --radius-lg: 26px;
  --shadow-sm: 0 10px 24px rgba(15, 23, 42, 0.06);
  --shadow-md: 0 28px 46px rgba(15, 23, 42, 0.09);
  --shadow-lg: 0 48px 96px rgba(15, 23, 42, 0.12);
  --header-bg: rgba(255, 255, 255, 0.94);
  --header-bg-solid: rgba(255, 255, 255, 0.96);
  --header-border: transparent;
  --header-border-strong: var(--border);
  --header-shadow: 0 18px 34px rgba(15, 23, 42, 0.08);
  --footer-bg: rgba(255, 255, 255, 0.92);
  --footer-border: var(--border);
  --font-sans: 'Inter', 'Helvetica Neue', Arial, sans-serif;
  --font-display: 'Space Grotesk', 'Inter', 'Helvetica Neue', Arial, sans-serif;
  --font-mono: 'JetBrains Mono', 'SFMono-Regular', Menlo, Consolas, monospace;
  --fs-0: 0.75rem;
  --fs-1: 0.875rem;
  --fs-2: 1rem;
  --fs-3: 1.125rem;
  --fs-4: 1.5rem;
  --fs-5: clamp(2.15rem, 3vw, 2.85rem);
  --transition: 160ms ease;
  --gutter: 32px;
  --z-tooltip: 9999;

  /* Legacy tokens kept for replay + specialty UI */
  --bg: var(--page-bg);
  --bg-2: #ffffff;
  --surface-2: var(--surface-alt);
  --surface-3: var(--surface-soft);
  --overlay: rgba(255, 255, 255, 0.92);
  --slate-3: var(--surface-alt);
  --slate-4: var(--surface-soft);
  --slate-5: var(--surface-soft);
  --slate-7: #ced6e2;
  --slate-8: #c0c9d8;
  --slate-12: #111827;
  --glass-1: rgba(255, 255, 255, 0.72);
  --glass-2: rgba(255, 255, 255, 0.6);
  --glass-3: rgba(255, 255, 255, 0.52);
  --glass-soft: rgba(255, 255, 255, 0.4);
  --glass-strong: rgba(255, 255, 255, 0.82);
  --line: var(--border);
  --divider: var(--border);
  --primary: #111111;
  --primary-2: #1f2937;
  --primary-3: #334155;
  --accent-2: #1f2937;
  --accent-3: #2563eb;
  --link: var(--accent);
  --warn: #2563eb;
  --ok: #0f766e;
  --bad: #dc2626;
  --ok-9: #158f86;
  --ok-11: #0f766e;
  --warn-9: #1d4ed8;
  --warn-11: #2563eb;
  --err-9: #be123c;
  --err-11: #f43f5e;
  --ring: 0 0 0 4px rgba(17, 17, 17, 0.22);
  --card-darkBg: #0f172a;
  --card-lightBg: #ffffff;
  --card-darkRed: #e11d48;
  --card-lightRed: #fb7185;
  --card-darkBlk: #111827;
  --card-lightBlk: #9ca3af;
  --card-w: 140px;
  --card-h: 196px;
}

:root[data-theme='dark'],
:root.theme-dark {
  color-scheme: dark;
  --page-bg: #080d17;
  --page-bg-alt: #111a2b;
  --surface: #151e30;
  --surface-alt: #1b2640;
  --surface-soft: #23304d;
  --surface-strong: #2c3a5a;
  --text: #f3f6ff;
  --muted: #9aa6c7;
  --muted-soft: #8894b5;
  --border: #24314c;
  --border-strong: #313f61;
  --accent: #8db7ff;
  --accent-soft: #5f8ddc;
  --accent-contrast: #050b16;
  --focus-ring: rgba(141, 183, 255, 0.45);
  --shadow-sm: 0 10px 30px rgba(2, 6, 16, 0.55);
  --shadow-md: 0 28px 58px rgba(2, 6, 16, 0.58);
  --shadow-lg: 0 48px 112px rgba(2, 6, 16, 0.6);
  --header-bg: rgba(8, 13, 23, 0.9);
  --header-bg-solid: rgba(11, 18, 32, 0.94);
  --header-border: rgba(36, 49, 76, 0.65);
  --header-border-strong: rgba(49, 63, 97, 0.85);
  --header-shadow: 0 18px 34px rgba(2, 6, 16, 0.65);
  --footer-bg: rgba(8, 13, 23, 0.88);
  --footer-border: rgba(49, 63, 97, 0.75);
  --bg: var(--page-bg);
  --bg-2: var(--surface);
  --surface-2: var(--surface-alt);
  --surface-3: var(--surface-soft);
  --overlay: rgba(8, 13, 23, 0.88);
  --slate-3: #1a2338;
  --slate-4: #202a42;
  --slate-5: #263454;
  --slate-7: #334062;
  --slate-8: #3c4a6f;
  --slate-12: #f3f6ff;
  --glass-1: rgba(18, 26, 45, 0.72);
  --glass-2: rgba(18, 26, 45, 0.58);
  --glass-3: rgba(18, 26, 45, 0.45);
  --glass-soft: rgba(24, 34, 56, 0.35);
  --glass-strong: rgba(10, 18, 34, 0.82);
  --line: var(--border);
  --divider: var(--border);
  --primary: #8db7ff;
  --primary-2: #5f8ddc;
  --primary-3: #3c5fa8;
  --accent-2: #5f8ddc;
  --accent-3: #3b82f6;
  --link: var(--accent);
  --warn: #3b82f6;
  --ok: #34d399;
  --bad: #f87171;
  --ok-9: #22c55e;
  --ok-11: #16a34a;
  --warn-9: #2563eb;
  --warn-11: #1d4ed8;
  --err-9: #f43f5e;
  --err-11: #e11d48;
  --ring: 0 0 0 4px rgba(141, 183, 255, 0.32);
  --card-darkBg: #0b1220;
  --card-lightBg: #1d2944;
  --card-darkRed: #f87171;
  --card-lightRed: #fda4af;
  --card-darkBlk: #0b1220;
  --card-lightBlk: #94a3c2;
}

@media (max-width: 720px) {
  :root {
    --gutter: 24px;
    --fs-0: 0.72rem;
    --fs-1: 0.82rem;
    --fs-2: 0.97rem;
    --fs-3: 1.08rem;
    --fs-4: 1.4rem;
  }
}

@media (max-width: 640px) {
  :root {
    --shadow-sm: none;
    --shadow-md: none;
    --shadow-lg: none;
  }
}

@media (max-width: 480px) {
  :root {
    --gutter: 20px;
    --fs-0: 0.68rem;
    --fs-1: 0.78rem;
    --fs-2: 0.94rem;
    --fs-3: 1.02rem;
    --fs-4: 1.3rem;
  }
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
  background: var(--page-bg);
  color: var(--text);
  font-family: var(--font-sans);
  font-size: var(--fs-2);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

body {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  overflow-x: hidden;
}

body.has-open-mobile-nav {
  overflow: hidden;
}

@media (max-width: 720px) {
  body.has-open-mobile-nav::before {
    content: '';
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.35);
    backdrop-filter: blur(2px);
    z-index: 15;
  }
}

body.force-portrait {
  overflow: hidden;
}

@media (orientation: landscape) and (max-width: 1024px) {
  body.force-portrait {
    position: relative;
  }
  body.force-portrait::after {
    content: 'Rotate your device for the best PokerBench experience';
    position: fixed;
    inset: 0;
    z-index: 20000;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 32px;
    text-align: center;
    font-size: 1.1rem;
    font-weight: 600;
    line-height: 1.4;
    color: var(--text);
    background: var(--surface);
  }
  :root[data-theme='dark'] body.force-portrait::after,
  :root.theme-dark body.force-portrait::after {
    color: var(--text);
    background: var(--surface);
  }
  body.force-portrait > * {
    pointer-events: none;
    user-select: none;
  }
}

img,
svg,
video,
canvas {
  display: block;
  max-width: 100%;
}

a {
  color: var(--accent);
  text-decoration: none;
  transition: color var(--transition);
}

a:hover {
  color: var(--accent-soft);
}

button,
input,
select,
textarea {
  font: inherit;
  color: inherit;
}

button {
  background: none;
  border: none;
  cursor: pointer;
}

.visually-hidden {
  position: absolute !important;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

:focus-visible {
  outline: 3px solid var(--focus-ring);
  outline-offset: 3px;
  border-radius: 6px;
}

h1,
h2,
h3,
h4 {
  margin: 0;
  font-family: var(--font-display);
  letter-spacing: -0.01em;
}

h1 {
  font-size: var(--fs-5);
  line-height: 1.1;
}

h2 {
  font-size: var(--fs-4);
  line-height: 1.2;
}

h3 {
  font-size: var(--fs-3);
  line-height: 1.3;
  font-weight: 600;
}

p {
  margin: 1rem 0;
}

.muted {
  color: var(--muted);
}

.mono {
  font-family: var(--font-mono);
  font-size: var(--fs-1);
}

.sub {
  display: block;
  margin-top: 0.25rem;
  font-size: var(--fs-1);
  color: var(--muted);
}

.page-content {
  flex: 1 0 auto;
  padding: 48px 0 96px;
  overflow-x: hidden;
}

.wrap,
.wrap--wide {
  width: min(1280px, calc(100vw - 48px));
  margin: 0 auto;
  display: grid;
  gap: var(--gutter);
}

.wrap--wide {
  width: min(1480px, calc(100vw - 56px));
}

.row {
  display: grid;
  gap: 24px;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
}

.stack {
  display: grid;
  gap: 18px;
}

.cluster {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
}

@media (max-width: 960px) {
  .page-content {
    padding: 32px 0 72px;
  }
  .wrap,
  .wrap--wide {
    width: min(100%, calc(100vw - 32px));
  }
  .topnav {
    width: min(100%, calc(100vw - 32px));
    grid-template-columns: auto auto;
    justify-content: space-between;
    align-items: start;
    justify-items: stretch;
    gap: 12px 16px;
    padding: 14px 0 10px;
  }
  .topnav > .brand {
    justify-self: start;
  }
  .topnav__links {
    grid-column: 1 / -1;
    justify-content: flex-start;
  }
  .topnav__actions {
    justify-content: flex-end;
    justify-self: end;
  }
  .elo-card__filters {
    flex-direction: column;
    align-items: stretch;
  }
  .filter-group {
    width: 100%;
  }
  .elo-card__filters .sort-control {
    width: 100%;
    justify-content: space-between;
  }
}

@media (max-width: 720px) {
  .topnav.topnav--collapsible {
    position: relative;
    width: min(100%, calc(100vw - 24px));
    grid-template-columns: 1fr auto;
    align-items: center;
    gap: 12px 16px;
    padding: 12px 0 14px;
  }
  .topnav.topnav--collapsible > .brand {
    justify-self: start;
  }
  .topnav.topnav--collapsible .topnav__actions {
    justify-self: end;
    gap: 8px;
  }
  .topnav.topnav--collapsible .topnav__toggle {
    display: inline-flex;
  }
  .topnav.topnav--collapsible .topnav__links {
    position: absolute;
    top: calc(100% + 12px);
    left: 0;
    right: 0;
    margin: 0;
    padding: 16px;
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 8px;
    border-radius: var(--radius-md);
    border: 1px solid var(--border);
    background: var(--surface);
    box-shadow: var(--shadow-md);
    max-height: calc(100vh - 120px);
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    z-index: 30;
    transition: opacity var(--transition), transform var(--transition), visibility var(--transition);
  }
  .topnav.topnav--collapsible .topnav__links::before,
  .topnav.topnav--collapsible .topnav__links::after {
    display: none;
  }
  .topnav.topnav--collapsible .topnav__links[data-menu-open="false"] {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transform: translateY(-8px);
  }
  .topnav.topnav--collapsible .topnav__links[data-menu-open="true"],
  .topnav.topnav--collapsible .topnav__links:not([data-menu-open]) {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
    transform: translateY(0);
  }
  .topnav.topnav--collapsible .topnav__links .pill {
    width: 100%;
    justify-content: flex-start;
    font-size: var(--fs-2);
    padding: 0.7rem 1rem;
  }
  .topnav.topnav--collapsible .topnav__links .nav-link__icon {
    width: 1.1rem;
    height: 1.1rem;
  }
  .topnav.topnav--collapsible .brand {
    gap: 10px;
  }
  .topnav.topnav--collapsible .brand__text {
    font-size: 1rem;
  }
  .topnav.topnav--collapsible .logo-badge--sm {
    width: 36px;
    height: 36px;
    border-radius: 11px;
  }
}

@media (max-width: 640px) {
  .wrap,
  .wrap--wide {
    width: min(100%, calc(100vw - 24px));
    gap: 24px;
    overflow-x: hidden;
  }
  .topnav {
    width: min(100%, calc(100vw - 24px));
  }
  .row {
    grid-template-columns: 1fr;
  }
  .topnav__actions {
    gap: 8px;
  }
  .nav-link__icon {
    width: 1rem;
    height: 1rem;
  }
  .page-content {
    padding: 28px 0 64px;
  }
  .card {
    padding: 24px;
  }
  .card--compact {
    padding: 18px 20px;
  }
  .card__body {
    gap: 18px;
  }
  .table th,
  .table td,
  .lb-table th,
  .lb-table td,
  .matrix-table th,
  .matrix-table td {
    padding: 12px 14px;
  }
  .site-header {
    background: var(--header-bg-solid);
    backdrop-filter: none;
    box-shadow: none;
    border-bottom: 1px solid var(--header-border-strong);
  }
  .site-header--shadow {
    box-shadow: none;
  }
  .site-footer {
    padding: 12px 0 16px;
    backdrop-filter: none;
  }
  .site-footer__inner {
    width: min(100%, calc(100vw - 24px));
    gap: 10px;
    justify-items: center;
  }
  .site-footer__brand span:last-child {
    display: none;
  }
  .site-footer .site-footer__nav {
    width: 100%;
    justify-content: center;
    gap: 10px;
    display: flex;
    flex-wrap: nowrap;
    overflow-x: auto;
    scrollbar-width: none;
    -ms-overflow-style: none;
  }
  .site-footer .site-footer__nav::-webkit-scrollbar {
    display: none;
  }
  .site-footer .site-footer__nav a {
    width: 44px;
    height: 44px;
    border-radius: 14px;
    padding: 0;
    border: 1px solid var(--border);
    background: var(--surface);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: var(--muted);
    position: relative;
    transition: border-color var(--transition), color var(--transition);
  }
  .site-footer .site-footer__nav a::before {
    content: '';
    width: 20px;
    height: 20px;
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;
  }
  .site-footer .site-footer__nav a:hover {
    color: var(--accent);
    border-color: var(--border-strong);
  }
  .site-footer .site-footer__nav a .site-footer__label {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    clip-path: inset(50%);
    white-space: nowrap;
    border: 0;
  }
  .site-footer .site-footer__nav a[href*="leaderboard"]::before {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24'%3E%3Cpath stroke='currentColor' stroke-width='2' stroke-linecap='round' stroke-linejoin='round' d='M4 20h16M6 20V10m6 10V4m6 16v-7'/%3E%3C/svg%3E");
  }
  .site-footer .site-footer__nav a[href*="matrix"]::before {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24'%3E%3Cpath stroke='currentColor' stroke-width='2' stroke-linejoin='round' d='M5 5h6v6H5zM13 5h6v6h-6zM5 13h6v6H5zM13 13h6v6h-6z'/%3E%3C/svg%3E");
  }
  .site-footer .site-footer__nav a[href*="history"]::before {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24'%3E%3Cpath stroke='currentColor' stroke-width='2' stroke-linecap='round' stroke-linejoin='round' d='M21 12a9 9 0 1 1-18 0 9 9 0 0 1 18 0Zm-9-5v6l3 2'/%3E%3C/svg%3E");
  }
  .site-footer .site-footer__nav a[href*="about"]::before {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24'%3E%3Cpath stroke='currentColor' stroke-width='2' stroke-linecap='round' stroke-linejoin='round' d='M12 7h.01M12 10v7m0-13a9 9 0 1 0 0 18 9 9 0 0 0 0-18Z'/%3E%3C/svg%3E");
  }
  .site-footer .site-footer__nav a[href*="github"]::before {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24'%3E%3Cpath stroke='currentColor' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round' d='M9 19c-4 1.5-4-2.5-6-3m12 3v-2.7a3.4 3.4 0 0 0-1-2.6c3 0 6-1.5 6-6a4.5 4.5 0 0 0-.9-2.8 4.2 4.2 0 0 0-.1-2.8s-1-.3-3.2 1.2a11.2 11.2 0 0 0-5.8 0C7.8 2.8 6.8 3.1 6.8 3.1a4.2 4.2 0 0 0-.1 2.8A4.5 4.5 0 0 0 5.8 8c0 4.5 3 6 6 6a3.4 3.4 0 0 0-1 2.6V19'/%3E%3C/svg%3E");
  }
  :root[data-theme='dark'] .site-footer .site-footer__nav a,
  :root.theme-dark .site-footer .site-footer__nav a {
    color: var(--text);
    border-color: rgba(141, 183, 255, 0.35);
  }
  .site-footer__actions {
    flex-direction: row;
    gap: 8px;
    align-items: center;
  }
  .site-footer__social {
    width: 40px;
    height: 40px;
    padding: 0.4rem;
    border-radius: 12px;
  }
  .site-footer__social span,
  .site-footer__copy {
    display: none;
  }
  .lb-card__header {
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 12px;
  }
  .lb-card__header > * {
    width: 100%;
  }
  .lb-card__header-actions {
    width: 100%;
    justify-content: center;
  }
  .sort-control {
    width: auto;
    margin: 0 auto;
    justify-content: center;
    flex-wrap: nowrap;
    gap: 10px;
    padding: 6px 12px;
    background: var(--surface);
    border-color: var(--border);
    border-radius: var(--radius-sm);
    box-shadow: none;
  }
  .sort-control__label {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    width: auto;
    margin: 0;
    text-align: center;
    font-size: var(--fs-0);
    letter-spacing: 0.14em;
    text-transform: uppercase;
  }
  .sort-control__label .inline-tip--persistent {
    display: none;
  }
  .sort-control button {
    flex: 0 1 auto;
    min-width: 0;
    padding: 0.45rem 1.1rem;
  }
  .sort-control select {
    flex: 0 1 auto;
    width: auto;
  }
  .lb-card__body {
    gap: 16px;
  }
  .lb-table {
    margin-inline: auto;
    width: 100%;
    table-layout: fixed;
  }
  .lb-table col {
    width: auto !important;
  }
  .lb-table-wrap {
    overflow-x: hidden;
  }
  .lb-table th,
  .lb-table td {
    text-align: center;
  }
  .lb-table th.lb-col-model,
  .lb-table td.lb-col-model {
    text-align: left;
  }
  .lb-model {
    justify-content: center;
    text-align: center;
    flex-wrap: wrap;
    gap: 8px;
  }
  .lb-model .name {
    white-space: normal;
    overflow: visible;
    text-overflow: clip;
    word-break: break-word;
  }
  .lb-org {
    justify-content: center;
  }
  .inline-tip:not(.inline-tip--persistent) {
    display: none;
  }
  .inline-tip.inline-tip--persistent {
    display: inline-flex;
  }
  .bot-page__header {
    flex-direction: column;
    align-items: flex-start;
    text-align: left;
    gap: 8px;
  }
  .bot-page__header #sub {
    text-align: left;
  }
  #meta {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 6px 14px;
  }
  #meta > div:nth-child(2n) {
    font-size: var(--fs-1);
  }
  .bot-matches {
    table-layout: auto;
  }
  .bot-matches th,
  .bot-matches td {
    white-space: normal;
    padding: 10px 12px;
  }
  .bot-matches th.cell-label,
  .bot-matches td.cell-label,
  .bot-matches th.cell-start,
  .bot-matches td.cell-start,
  .bot-matches th.cell-end,
  .bot-matches td.cell-end,
  .bot-matches th.cell-check,
  .bot-matches td.cell-check,
  .bot-matches th.cell-call,
  .bot-matches td.cell-call,
  .bot-matches th.cell-raise,
  .bot-matches td.cell-raise,
  .bot-matches th.cell-fold,
  .bot-matches td.cell-fold {
    display: none;
  }
  #botMatchesCard {
    display: none;
  }
  .playstyle-card {
    padding: 18px;
    gap: 16px;
    box-shadow: none;
  }
  .playstyle-card__header {
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
  }
  .playstyle-card__hint {
    font-size: var(--fs-0);
  }
  .playstyle-card__badge {
    width: 100%;
    justify-content: center;
  }
  .playstyle-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
  }
  .playstyle-grid__cell {
    min-height: 64px;
  }
  .playstyle-card__stats {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .replay-page .page-content {
    padding: 20px 0 48px;
  }
  .replay-layout {
    flex-direction: column;
    align-items: stretch;
  }
  .card--stage {
    padding: 18px;
    gap: 18px;
    border-radius: var(--radius-md);
    box-shadow: none;
  }
  .stage-toolbar {
    gap: 16px;
  }
  .stage-controls {
    padding: 16px;
    gap: 12px;
    border-radius: var(--radius-md);
  }
  .stage-control {
    padding: 12px 14px;
    box-shadow: none;
  }
  .stage-summary {
    padding: 16px;
    border-radius: var(--radius-md);
    gap: 12px;
  }
  .stage-summary__item {
    padding: 12px;
  }
  .stage-summary__value--log {
    font-size: var(--fs-1);
  }
  .stage-table {
    gap: 18px;
  }
  .seat-card {
    padding: 18px;
    border-radius: var(--radius-md);
    box-shadow: none;
  }
  .board-display__surface {
    padding: 16px;
    min-height: calc((var(--card-h) * 2) + 60px);
  }
  .board-display__cards {
    row-gap: 16px;
  }
  .stage-table__caption {
    font-size: var(--fs-1);
    padding: 14px 16px;
  }
  .replay-controls {
    gap: 12px;
  }
  .replay-control {
    padding: 12px 14px;
  }
}

@media (max-width: 520px) {
  .brand__text {
    display: none;
  }
  .logo-badge--sm {
    width: 34px;
    height: 34px;
  }
  .topnav__actions {
    justify-content: flex-end;
  }
  .topnav.topnav--collapsible .topnav__toggle .nav-link__label,
  .topnav.topnav--collapsible .nav-settings .nav-link__label {
    display: none;
  }
  .topnav.topnav--collapsible .topnav__links {
    padding: 14px;
  }
}

@media (max-width: 480px) {
  .page-content {
    padding: 22px 0 48px;
  }
  .card {
    padding: 20px;
  }
  .card--compact {
    padding: 16px 18px;
  }
  .card__body {
    gap: 16px;
  }
  .table th,
  .table td,
  .lb-table th,
  .lb-table td,
  .matrix-table th,
  .matrix-table td {
    padding: 10px 12px;
  }
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  background: var(--header-bg);
  backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--header-border);
  opacity: 1;
  transition: transform 220ms ease, opacity 220ms ease, box-shadow 220ms ease, background-color 220ms ease,
    border-color 220ms ease;
}

.site-header--shadow {
  background: var(--header-bg-solid);
  border-color: var(--header-border-strong);
  box-shadow: var(--header-shadow);
}

.site-header--hidden {
  transform: translateY(-120%);
  opacity: 0;
  pointer-events: none;
}

.topnav {
  width: min(1340px, calc(100vw - 56px));
  margin: 0 auto;
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 20px;
  padding: 18px 0;
}

.topnav__links {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: center;
}

.topnav__actions {
  position: relative;
  display: flex;
  align-items: center;
  gap: 12px;
}

.topnav__toggle {
  display: none;
  align-items: center;
  gap: 0.4rem;
  font-weight: 600;
}

.topnav__toggle svg {
  transition: transform var(--transition);
}

@media (min-width: 960px) {
  .topnav__toggle {
    display: none !important;
  }
}

.topnav--menu-open .topnav__toggle svg {
  transform: rotate(90deg);
}

.nav-link__icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.1rem;
  height: 1.1rem;
  color: currentColor;
}

.nav-link__icon svg {
  display: block;
  width: 100%;
  height: 100%;
  stroke: currentColor;
  stroke-width: 1.75;
  stroke-linecap: round;
  stroke-linejoin: round;
  fill: none;
}

.nav-link__label {
  display: inline-flex;
  align-items: center;
  line-height: 1;
}

.nav-settings {
  position: relative;
  font-weight: 600;
  padding-inline: 1rem;
}

.nav-settings__panel {
  position: absolute;
  top: calc(100% + 14px);
  right: 0;
  width: min(320px, calc(100vw - 32px));
  padding: 18px;
  border-radius: 18px;
  border: 1px solid var(--border);
  background: var(--surface);
  box-shadow: var(--shadow-md);
  display: grid;
  gap: 16px;
  z-index: 25;
  opacity: 0;
  transform: translateY(-6px) scale(0.96);
  transform-origin: top right;
  pointer-events: none;
  transition: opacity 180ms ease, transform 180ms ease;
}

.topnav__actions.is-open .nav-settings__panel {
  opacity: 1;
  transform: translateY(0) scale(1);
  pointer-events: auto;
}

@media (max-width: 640px) {
  .nav-settings {
    padding-inline: 0.85rem;
  }
  .nav-settings__panel {
    position: fixed;
    top: calc(env(safe-area-inset-top, 0px) + 72px);
    left: 16px;
    right: 16px;
    width: auto;
    max-height: calc(100vh - env(safe-area-inset-top, 0px) - env(safe-area-inset-bottom, 0px) - 96px);
    overflow-y: auto;
    overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch;
    padding-bottom: calc(18px + env(safe-area-inset-bottom, 0px));
    transform: translateY(-8px) scale(0.96);
    transform-origin: top center;
    z-index: 40;
  }
  .topnav__actions.is-open .nav-settings__panel {
    transform: translateY(0) scale(1);
  }
}

.topnav__actions.is-open .nav-settings {
  background: rgba(17, 17, 17, 0.08);
  border-color: rgba(17, 17, 17, 0.18);
}

:root[data-theme='dark'] .topnav__actions.is-open .nav-settings,
:root.theme-dark .topnav__actions.is-open .nav-settings {
  background: rgba(141, 183, 255, 0.16);
  border-color: rgba(141, 183, 255, 0.28);
}

.topnav--menu-open .topnav__toggle {
  background: rgba(17, 17, 17, 0.08);
  border-color: rgba(17, 17, 17, 0.18);
}

:root[data-theme='dark'] .topnav--menu-open .topnav__toggle,
:root.theme-dark .topnav--menu-open .topnav__toggle {
  background: rgba(141, 183, 255, 0.16);
  border-color: rgba(141, 183, 255, 0.28);
}

.nav-settings__section {
  display: grid;
  gap: 10px;
}

.nav-settings__section h3 {
  margin: 0;
  font-size: var(--fs-1);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}

.nav-settings__row {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 0.7rem 0.85rem;
  border-radius: 12px;
  background: var(--surface-alt);
  border: 1px solid var(--border);
  color: var(--muted);
  cursor: pointer;
  transition: background var(--transition), border-color var(--transition), color var(--transition), box-shadow var(--transition);
}

.nav-settings__row:not([disabled]):hover,
.nav-settings__row:not([disabled]):focus-visible {
  background: var(--surface);
  border-color: var(--border-strong);
  box-shadow: inset 0 0 0 1px var(--border-strong);
}

.nav-settings__row[disabled] {
  cursor: not-allowed;
  opacity: 0.6;
}

.nav-settings__row.is-off .nav-settings__label {
  color: var(--muted);
}

.nav-settings__row.is-off .nav-settings__hint {
  color: var(--muted-soft);
}

.nav-settings__label {
  font-weight: 600;
  color: var(--text);
}

.nav-settings__hint {
  font-size: var(--fs-0);
  color: var(--muted);
}

.nav-settings__shortcuts {
  margin: 0;
  padding: 2px 0;
  display: grid;
  gap: 10px;
  list-style: none;
}

.nav-settings__shortcuts > div {
  display: grid;
  grid-template-columns: auto 1fr;
  align-items: center;
  gap: 12px;
  padding: 0.7rem 0.85rem;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: var(--surface-alt);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.05);
  transition: background var(--transition), border-color var(--transition), box-shadow var(--transition);
}

.nav-settings__shortcuts > div:hover,
.nav-settings__shortcuts > div:focus-within {
  background: var(--surface);
  border-color: var(--border-strong);
  box-shadow: inset 0 0 0 1px var(--border-strong);
}

.nav-settings__shortcuts dt {
  margin: 0;
  font-family: var(--font-mono);
  font-size: 0.85rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  padding: 0.28rem 0.6rem;
  border-radius: 10px;
  background: var(--surface);
  border: 1px solid var(--border-strong);
  color: var(--text);
  box-shadow: 0 2px 4px rgba(17, 17, 17, 0.08);
  white-space: nowrap;
}

.nav-settings__shortcuts dd {
  margin: 0;
  font-size: var(--fs-0);
  color: var(--muted);
  text-align: right;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 14px;
  font-weight: 600;
  color: var(--text);
}

.brand__text {
  font-family: var(--font-display);
  letter-spacing: -0.02em;
  font-size: 1.1rem;
}

.logo-badge {
  width: 48px;
  height: 48px;
  border-radius: 16px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--surface-alt);
  border: 1px solid var(--border);
  box-shadow: 0 6px 18px rgba(15, 23, 42, 0.08);
  transition: transform var(--transition);
}

.logo-badge img {
  width: 70%;
  height: auto;
}

:root[data-theme='dark'] .logo-badge img[src$="pokerBenchlogo.svg"],
:root.theme-dark .logo-badge img[src$="pokerBenchlogo.svg"] {
  filter: brightness(0) invert(1);
}

.brand:hover .logo-badge {
  transform: scale(1.04);
}

.topnav__links .pill {
  padding: 0.55rem 1rem;
  font-weight: 600;
}

.topnav__links .pill .nav-link__label {
  font-size: var(--fs-1);
}

.topnav__links .nav-link,
.topnav__actions .nav-link {
  color: var(--muted);
}

.topnav__links .nav-link:hover,
.topnav__links .nav-link:focus-visible,
.topnav__actions .nav-link:hover,
.topnav__actions .nav-link:focus-visible {
  color: var(--accent);
}

.logo-badge--sm {
  width: 40px;
  height: 40px;
  border-radius: 12px;
}

.logo-badge--md {
  width: 56px;
  height: 56px;
}

.logo-badge--lg {
  width: 80px;
  height: 80px;
}

.pill,
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  border-radius: 999px;
  padding: 0.55rem 1.2rem;
  font-weight: 500;
  line-height: 1.1;
  transition: transform var(--transition), background var(--transition), color var(--transition), border-color var(--transition), box-shadow var(--transition);
}

.pill {
  border: 1px solid transparent;
  color: var(--muted);
  background: transparent;
}

.pill:hover {
  color: var(--accent);
  background: rgba(17, 17, 17, 0.06);
}

.pill.active,
.pill[aria-current="page"] {
  color: var(--accent);
  background: rgba(17, 17, 17, 0.08);
  border-color: rgba(17, 17, 17, 0.28);
}

.pill.accent {
  background: linear-gradient(135deg, #2563eb 0%, #4f46e5 100%);
  color: #ffffff;
  border-color: transparent;
  box-shadow: 0 12px 24px rgba(79, 70, 229, 0.25);
}

.pill.accent:hover {
  background: linear-gradient(135deg, #1d4ed8 0%, #4338ca 100%);
  color: #ffffff;
}

.pill.ghost {
  color: var(--accent);
  border-color: var(--border);
  background: transparent;
}

.pill.warn {
  border-color: rgba(22, 163, 74, 0.32);
  background: rgba(34, 197, 94, 0.18);
  color: #166534;
}

.pill.ok {
  border-color: rgba(250, 204, 21, 0.42);
  background: rgba(250, 204, 21, 0.2);
  color: #92400e;
}

.replay-page .pill.accent {
  background: linear-gradient(135deg, #111111 0%, #1f1f1f 100%);
  color: #ffffff;
  border-color: transparent;
  box-shadow: 0 14px 26px rgba(17, 17, 17, 0.24);
}

.replay-page .pill.accent:hover {
  background: linear-gradient(135deg, #1f1f1f 0%, #111111 100%);
  color: #ffffff;
}

:root[data-theme='dark'] .pill:hover,
:root.theme-dark .pill:hover {
  background: rgba(255, 255, 255, 0.08);
}

:root[data-theme='dark'] .pill.active,
:root[data-theme='dark'] .pill[aria-current="page"],
:root.theme-dark .pill.active,
:root.theme-dark .pill[aria-current="page"] {
  background: rgba(255, 255, 255, 0.12);
  border-color: rgba(141, 183, 255, 0.28);
}

:root[data-theme='dark'] .pill.ghost,
:root.theme-dark .pill.ghost {
  border-color: rgba(148, 163, 184, 0.32);
}

:root[data-theme='dark'] .pill.warn,
:root.theme-dark .pill.warn {
  border-color: rgba(34, 197, 94, 0.32);
  background: rgba(34, 197, 94, 0.2);
  color: #86efac;
}

:root[data-theme='dark'] .pill.ok,
:root.theme-dark .pill.ok {
  border-color: rgba(250, 204, 21, 0.32);
  background: rgba(250, 204, 21, 0.2);
  color: #fde68a;
}

:root[data-theme='dark'] .replay-page .pill.accent,
:root.theme-dark .replay-page .pill.accent {
  background: linear-gradient(135deg, #2563eb 0%, #1e3a8a 100%);
  color: #f8fafc;
  box-shadow: 0 14px 26px rgba(2, 6, 16, 0.5);
}

:root[data-theme='dark'] .replay-page .pill.accent:hover,
:root.theme-dark .replay-page .pill.accent:hover {
  background: linear-gradient(135deg, #1d4ed8 0%, #1e3a8a 100%);
}

.replay-page .pill.ghost {
  border-color: rgba(17, 24, 39, 0.12);
  color: var(--accent);
  background: rgba(17, 24, 39, 0.04);
}

.replay-page .pill.warn {
  border-color: rgba(34, 197, 94, 0.32);
  background: rgba(34, 197, 94, 0.18);
  color: #14532d;
}

.replay-page .pill.ok {
  border-color: rgba(234, 179, 8, 0.3);
  background: rgba(234, 179, 8, 0.22);
  color: #854d0e;
}

:root[data-theme='dark'] .replay-page .pill.warn,
:root.theme-dark .replay-page .pill.warn {
  border-color: rgba(34, 197, 94, 0.28);
  background: rgba(34, 197, 94, 0.22);
  color: #bbf7d0;
}

:root[data-theme='dark'] .replay-page .pill.ok,
:root.theme-dark .replay-page .pill.ok {
  border-color: rgba(234, 179, 8, 0.34);
  background: rgba(234, 179, 8, 0.24);
  color: #fde68a;
}

.select-pill {
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
  border-radius: 999px;
  border: 1px solid var(--border);
  padding: 0.55rem 2.9rem 0.55rem 1rem;
  font-size: var(--fs-1);
  font-weight: 500;
  color: var(--text);
  background: var(--surface);
  cursor: pointer;
  line-height: 1.1;
  transition: border-color var(--transition), box-shadow var(--transition), background var(--transition);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.6);
  background-image: none;
}

:root[data-theme='dark'] .select-pill,
:root.theme-dark .select-pill {
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08);
}

.select-pill:hover {
  border-color: var(--accent);
}

.select-pill:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 4px rgba(17, 17, 17, 0.08);
}

:root[data-theme='dark'] .select-pill:focus,
:root.theme-dark .select-pill:focus {
  box-shadow: 0 0 0 4px rgba(141, 183, 255, 0.25);
}

.select-pill::-ms-expand {
  display: none;
}

.select-pill__wrap {
  position: relative;
  display: inline-flex;
  align-items: center;
}

.select-pill__wrap::after {
  content: '';
  position: absolute;
  pointer-events: none;
  right: 0.8rem;
  top: 50%;
  width: 12px;
  height: 8px;
  transform: translateY(-50%);
  background-image: url("data:image/svg+xml,%3Csvg width='12' height='8' viewBox='0 0 12 8' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M1.5 1.5L6 6.5L10.5 1.5' stroke='%23111827' stroke-width='1.5' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-size: contain;
}

:root[data-theme='dark'] .select-pill__wrap::after,
:root.theme-dark .select-pill__wrap::after {
  background-image: url("data:image/svg+xml,%3Csvg width='12' height='8' viewBox='0 0 12 8' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M1.5 1.5L6 6.5L10.5 1.5' stroke='%23f3f6ff' stroke-width='1.5' stroke-linecap='round'/%3E%3C/svg%3E");
}

.select-pill__wrap select {
  width: 100%;
}

.select-pill--condensed {
  padding: 0.45rem 2.4rem 0.45rem 0.85rem;
  font-size: var(--fs-1);
}

.btn {
  border: 1px solid var(--accent);
  background: var(--accent);
  color: var(--accent-contrast);
  font-weight: 600;
}

.btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 16px 32px rgba(17, 17, 17, 0.16);
}

.btn.ghost {
  background: transparent;
  color: var(--accent);
  border-color: var(--border);
  box-shadow: none;
}

.btn.ghost:hover {
  border-color: var(--accent);
  background: rgba(17, 17, 17, 0.06);
}

.card {
  background: var(--surface);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  padding: 28px;
  box-shadow: var(--shadow-sm);
  transition: transform var(--transition), box-shadow var(--transition);
}

.card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.card--compact {
  padding: 20px 24px;
  gap: 12px;
}

.card--header-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  flex-wrap: wrap;
}

.card__header {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 16px;
}

.card__body {
  display: grid;
  gap: 20px;
}

.hero {
  display: grid;
  gap: 32px;
  padding: 40px;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  background: var(--surface);
  box-shadow: var(--shadow-md);
}

.hero__grid {
  display: grid;
  gap: 32px;
}

@media (min-width: 960px) {
  .hero__grid {
    grid-template-columns: 1.15fr 1fr;
    align-items: start;
  }
}

.hero__intro {
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.hero__brand {
  display: flex;
  align-items: center;
  gap: 20px;
}

.hero__eyebrow {
  text-transform: uppercase;
  font-size: var(--fs-0);
  letter-spacing: 0.24em;
  color: var(--muted);
}

.hero__title {
  font-size: clamp(2.2rem, 3vw, 3rem);
  line-height: 1.05;
}

.hero__cta {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.hero__stats {
  display: grid;
  gap: 20px;
  padding: 24px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
  background: var(--surface-alt);
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
}

.hero__stat {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.hero__label {
  font-size: var(--fs-0);
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--muted);
}

.hero__value {
  font-size: var(--fs-3);
  font-weight: 600;
}

.kvs {
  display: grid;
  gap: 14px;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
}

.kvs-grid {
  display: grid;
  gap: 18px;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
}

#meta {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 8px 16px;
  align-items: center;
}

#meta > div:nth-child(2n - 1) {
  font-size: var(--fs-0);
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--muted);
}

#meta > div:nth-child(2n) {
  font-weight: 600;
}

.kvs-item {
  padding: 16px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
  background: var(--surface-alt);
}

.kvs-label {
  font-size: var(--fs-0);
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--muted);
}

.kvs-value {
  font-weight: 600;
}

.mini-kv {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 14px 16px;
  border-radius: var(--radius-sm);
  background: var(--surface-alt);
  border: 1px solid var(--border);
}

.mini-kv__label {
  font-size: var(--fs-0);
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--muted);
}

.mini-kv__value {
  font-weight: 600;
}

.lb-card__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  flex-wrap: wrap;
}

.lb-card__body {
  display: grid;
  gap: 20px;
}

.lb-card__header-actions {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.compare-toggle {
  border-color: var(--border);
  background: var(--surface-alt);
  color: var(--muted);
  padding-inline: 1rem;
}

.compare-toggle:hover {
  color: var(--accent);
  border-color: var(--border-strong);
  background: rgba(17, 24, 39, 0.04);
}

.compare-toggle__icon {
  width: 18px;
  height: 18px;
  border-radius: 999px;
  border: 2px solid currentColor;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  position: relative;
  transition: background var(--transition), border-color var(--transition);
}

.compare-toggle__icon::after {
  content: '';
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: transparent;
  transition: background var(--transition);
}

.compare-toggle.is-active {
  color: var(--accent-3);
  background: rgba(37, 99, 235, 0.14);
  border-color: rgba(37, 99, 235, 0.3);
  box-shadow: 0 10px 24px rgba(37, 99, 235, 0.12);
}

.compare-toggle.is-active .compare-toggle__icon {
  border-color: var(--accent-3);
}

.compare-toggle.is-active .compare-toggle__icon::after {
  background: var(--accent-3);
}

.compare-layout {
  display: grid;
  gap: 20px;
}

.compare-layout--matrix {
  gap: 24px;
}

.compare-layout__main {
  min-width: 0;
}

@media (min-width: 1120px) {
  .compare-layout {
    align-items: start;
    grid-template-columns: minmax(0, 1fr);
  }

  .lb-card.is-compare-mode .compare-layout,
  .compare-layout--matrix {
    grid-template-columns: minmax(0, 1fr) minmax(320px, 400px);
  }
}

.compare-layout--matrix .compare-drawer {
  align-self: start;
}

@media (min-width: 1120px) {
  .compare-layout--matrix .compare-drawer {
    position: sticky;
    top: 20px;
  }
}

.compare-drawer {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
  padding: 22px 24px;
  display: grid;
  gap: 18px;
}

.compare-drawer[hidden] {
  display: none !important;
}

.compare-drawer__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.compare-drawer__eyebrow {
  font-size: var(--fs-0);
  text-transform: uppercase;
  letter-spacing: 0.22em;
  color: var(--muted);
  margin-bottom: 4px;
}

.compare-drawer__title {
  margin: 0;
  font-size: var(--fs-3);
}

.compare-drawer__close {
  border: none;
  background: transparent;
  color: var(--muted);
  width: 32px;
  height: 32px;
  border-radius: var(--radius-sm);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 1.4rem;
  cursor: pointer;
  transition: background var(--transition), color var(--transition);
}

.compare-drawer__close:hover {
  background: var(--surface-alt);
  color: var(--accent);
}

.compare-drawer__body {
  display: grid;
  gap: 18px;
}

.compare-drawer__status {
  font-size: var(--fs-1);
  color: var(--muted);
}

.compare-drawer__status p {
  margin: 0;
}

.compare-drawer__status p + p {
  margin-top: 6px;
}

.compare-drawer__summary {
  display: grid;
  gap: 18px;
}

.compare-drawer__pair {
  display: grid;
  gap: 12px;
}

@media (min-width: 540px) {
  .compare-drawer__pair {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    align-items: stretch;
  }
}

.compare-drawer__versus {
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: var(--fs-1);
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.24em;
}

.compare-drawer__bot-card {
  background: var(--surface-alt);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 14px 16px;
  display: grid;
  gap: 6px;
  min-width: 0;
}

.compare-drawer__bot-name {
  font-weight: 600;
  font-size: var(--fs-2);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.compare-drawer__bot-meta {
  font-size: var(--fs-1);
  color: var(--muted);
}

.compare-drawer__bot-metric {
  display: flex;
  align-items: baseline;
  gap: 8px;
  color: var(--muted);
  font-size: var(--fs-1);
}

.compare-drawer__bot-metric strong {
  font-size: var(--fs-3);
  font-weight: 600;
  color: var(--text);
}

.compare-drawer__stat-grid {
  display: grid;
  gap: 12px;
}

@media (min-width: 540px) {
  .compare-drawer__stat-grid {
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  }
}

.compare-drawer__stat {
  background: var(--surface-alt);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 14px 16px;
  display: grid;
  gap: 4px;
}

.compare-drawer__stat-label {
  font-size: var(--fs-1);
  color: var(--muted);
  font-weight: 500;
}

.compare-drawer__stat-value {
  font-weight: 600;
  font-size: var(--fs-2);
}

.compare-drawer__stat-meta {
  font-size: var(--fs-1);
  color: var(--muted);
}

.compare-drawer__matches {
  display: grid;
  gap: 12px;
}

.compare-drawer__section-title {
  font-size: var(--fs-1);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.16em;
  color: var(--muted);
}

.compare-drawer__match-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 10px;
}

.compare-drawer__match {
  display: grid;
  gap: 10px;
  padding: 12px 14px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--surface-alt);
  transition: border-color var(--transition), box-shadow var(--transition), transform var(--transition);
  color: inherit;
  text-decoration: none;
}

.compare-drawer__match:hover {
  border-color: var(--border-strong);
  box-shadow: var(--shadow-sm);
  transform: translateY(-2px);
  color: inherit;
}

.compare-drawer__match-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  font-size: var(--fs-1);
  color: var(--muted);
}

.compare-drawer__match-date,
.compare-drawer__match-hands {
  line-height: 1.4;
  font-variant-numeric: tabular-nums;
}

.compare-drawer__match-line {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  font-weight: 500;
}

.compare-drawer__match-name {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.compare-drawer__chips {
  font-variant-numeric: tabular-nums;
  font-weight: 600;
}

.compare-drawer__chips--positive {
  color: #15803d;
}

.compare-drawer__chips--negative {
  color: #b91c1c;
}

.compare-drawer__chips--neutral {
  color: var(--muted);
}

.compare-drawer__empty {
  font-size: var(--fs-1);
  color: var(--muted);
  border: 1px dashed var(--border);
  border-radius: var(--radius-sm);
  padding: 16px;
  background: var(--surface-alt);
  text-align: center;
}

.compare-select {
  display: none;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--muted);
  cursor: pointer;
  transition: background var(--transition), border-color var(--transition), color var(--transition), box-shadow var(--transition);
}

.compare-select:focus-visible {
  outline: none;
  box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.22);
}

.compare-select__icon {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  border: 2px solid currentColor;
  display: inline-block;
  position: relative;
}

.lb-card.is-compare-mode .compare-select {
  display: inline-flex;
}

.lb-card.is-compare-mode .lb-model {
  gap: 10px;
}

.compare-select:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.compare-select.is-selected {
  background: rgba(37, 99, 235, 0.14);
  border-color: rgba(37, 99, 235, 0.34);
  color: var(--accent-3);
  box-shadow: 0 6px 18px rgba(37, 99, 235, 0.16);
}

.compare-select.is-selected .compare-select__icon {
  border-color: currentColor;
  background: currentColor;
}

.compare-select.is-selected .compare-select__icon::after {
  content: '';
  position: absolute;
  inset: 2px;
  border-radius: 50%;
  background: var(--accent-contrast);
}

.lb-row.is-selectable {
  cursor: pointer;
}

.lb-row.is-selected {
  background: rgba(37, 99, 235, 0.08);
}

.lb-row.is-selected:hover {
  background: rgba(37, 99, 235, 0.12);
}

.sort-control {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 8px;
  border-radius: var(--radius-md);
  background: var(--surface-alt);
  border: 1px solid var(--border);
}

:root[data-theme='dark'] .sort-control,
:root.theme-dark .sort-control {
  background: rgba(13, 20, 33, 0.85);
  border: 1px solid rgba(71, 89, 128, 0.55);
  box-shadow: 0 12px 28px rgba(2, 6, 16, 0.55);
}

.sort-control__label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: var(--fs-1);
  font-weight: 500;
  color: var(--muted);
  margin-right: 6px;
}

.sort-control select {
  border: none;
  background: transparent;
  font-weight: 600;
  font-size: var(--fs-1);
  color: var(--accent);
  padding: 0.25rem 0.35rem;
  cursor: pointer;
}

.sort-control select:focus {
  outline: none;
}

.sort-control button {
  border-radius: 999px;
  padding: 0.35rem 0.95rem;
  font-weight: 500;
  color: var(--muted);
  background: transparent;
  transition: background var(--transition), color var(--transition), box-shadow var(--transition);
}

.sort-control button.active {
  background: var(--surface);
  color: var(--accent);
  box-shadow: 0 4px 12px rgba(15, 23, 42, 0.12);
}

:root[data-theme='dark'] .sort-control button.active,
:root.theme-dark .sort-control button.active {
  background: rgba(33, 51, 82, 0.9);
  color: var(--accent);
  box-shadow: 0 4px 12px rgba(2, 6, 16, 0.45);
}

.page-elo .sort-control {
  background: rgba(255, 255, 255, 0.7);
  border: 1px solid rgba(15, 23, 42, 0.08);
  box-shadow: 0 12px 28px rgba(15, 23, 42, 0.12);
  backdrop-filter: blur(6px);
}

:root[data-theme='dark'] .page-elo .sort-control,
:root.theme-dark .page-elo .sort-control {
  background: rgba(13, 20, 33, 0.88);
  border: 1px solid rgba(71, 89, 128, 0.6);
  box-shadow: 0 12px 28px rgba(2, 6, 16, 0.55);
}

.page-elo .sort-control select {
  padding: 0.35rem 1.1rem;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.92);
  border: 1px solid rgba(15, 23, 42, 0.1);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.35);
}

:root[data-theme='dark'] .page-elo .sort-control select,
:root.theme-dark .page-elo .sort-control select {
  background: rgba(13, 20, 33, 0.95);
  border: 1px solid rgba(71, 89, 128, 0.6);
  box-shadow: inset 0 0 0 1px rgba(141, 183, 255, 0.12);
  color: var(--accent);
}

.page-elo .sort-control select:hover {
  border-color: rgba(59, 130, 246, 0.45);
}

:root[data-theme='dark'] .page-elo .sort-control select:hover,
:root.theme-dark .page-elo .sort-control select:hover {
  border-color: rgba(141, 183, 255, 0.55);
}

.table,
.lb-table,
.matrix-table {
  width: 100%;
  border-collapse: collapse;
  background: transparent;
  font-variant-numeric: tabular-nums;
}

.table th,
.table td,
.lb-table th,
.lb-table td,
.matrix-table th,
.matrix-table td {
  padding: 14px 18px;
  border-bottom: 1px solid var(--border);
  text-align: left;
  font-size: var(--fs-2);
}

.matrix-table {
  --matrix-scale: 1;
  table-layout: fixed;
}

.matrix-table th,
.matrix-table td {
  padding: clamp(4px, calc(14px * var(--matrix-scale)), 14px) clamp(6px, calc(18px * var(--matrix-scale)), 18px);
  border-bottom: 1px solid var(--border);
  text-align: left;
  font-size: clamp(0.55rem, calc(var(--fs-2) * var(--matrix-scale)), var(--fs-2));
}

.matrix-table--sm { --matrix-scale: 0.9; }
.matrix-table--xs { --matrix-scale: 0.78; }
.matrix-table--xxs { --matrix-scale: 0.66; }
.matrix-table--nano { --matrix-scale: 0.58; }
.matrix-table--micro { --matrix-scale: 0.5; }
.matrix-table--ultra { --matrix-scale: 0.46; }

.table th,
.lb-table thead th,
.matrix-table th {
  font-size: var(--fs-1);
  font-weight: 600;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.table tbody tr:hover td,
.lb-table tbody tr:hover td,
.matrix-table tbody tr:hover td {
  background: var(--surface-alt);
}

.num {
  text-align: right;
  font-variant-numeric: tabular-nums;
}

.table th.sortable,
.lb-table thead th.sortable,
.matrix-table th.sortable {
  position: relative;
  cursor: pointer;
  user-select: none;
  padding-right: 32px;
  transition: color var(--transition);
}

.table th.sortable:hover,
.lb-table thead th.sortable:hover,
.matrix-table th.sortable:hover {
  color: var(--accent);
}

.table th.sortable::after,
.lb-table thead th.sortable::after,
.matrix-table th.sortable::after {
  content: '';
  position: absolute;
  right: 12px;
  top: 50%;
  width: 8px;
  height: 8px;
  border-right: 2px solid currentColor;
  border-bottom: 2px solid currentColor;
  opacity: 0.25;
  transform: translateY(-60%) rotate(-45deg);
  transition: opacity var(--transition), transform var(--transition), color var(--transition);
}

.table th.sortable[data-dir="asc"]::after,
.lb-table thead th.sortable[data-dir="asc"]::after,
.matrix-table th.sortable[data-dir="asc"]::after {
  opacity: 0.9;
  transform: translateY(-40%) rotate(135deg);
}

.table th.sortable[data-dir="desc"]::after,
.lb-table thead th.sortable[data-dir="desc"]::after,
.matrix-table th.sortable[data-dir="desc"]::after {
  opacity: 0.9;
  transform: translateY(-60%) rotate(-45deg);
}

.lb-row {
  cursor: pointer;
  transition: background var(--transition);
}

.lb-model {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.lb-model .name {
  color: inherit;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.lb-model .name:hover {
  text-decoration: underline;
  text-underline-offset: 2px;
}

.org-icon {
  width: 22px;
  height: 22px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--surface-alt);
  border: 1px solid var(--border);
}

.org-icon img,
.org-icon svg {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.org-icon--dot {
  background: var(--accent);
}

.lb-org {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--muted);
  font-size: var(--fs-1);
}

.lb-org .txt {
  white-space: nowrap;
}

.lb-preview {
  display: grid;
  gap: 12px;
}

.lb-preview__row {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 16px;
  padding: 16px 18px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
  background: var(--surface-alt);
  transition: transform var(--transition), border-color var(--transition);
}

.lb-preview__row:hover {
  transform: translateY(-2px);
  border-color: var(--accent);
}

.lb-preview__rank {
  width: 40px;
  height: 40px;
  border-radius: 999px;
  display: grid;
  place-items: center;
  font-weight: 600;
  color: var(--surface);
  background: var(--accent);
}

.lb-preview__name {
  font-weight: 600;
  font-size: var(--fs-3);
}

.lb-preview__org {
  font-size: var(--fs-1);
  color: var(--muted);
}

.lb-preview__elo {
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

.empty-state {
  padding: 20px;
  border: 1px dashed var(--border);
  border-radius: var(--radius-md);
  background: var(--surface-alt);
  color: var(--muted);
  text-align: center;
  font-size: var(--fs-1);
}

.participants-grid {
  display: grid;
  gap: 18px;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
}

.participant {
  display: flex;
  flex-direction: column;
  gap: 16px;
  padding: 20px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
  background: var(--surface-alt);
}

.participant__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.participant__model {
  font-weight: 600;
}

.participant__company {
  font-size: var(--fs-1);
  color: var(--muted);
}

.participant__meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.participant__tag {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 6px 10px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--surface);
  font-size: var(--fs-1);
}

.mix-grid {
  display: grid;
  gap: 16px;
}

.mix-row {
  display: grid;
  grid-template-columns: auto 1fr;
  align-items: center;
  gap: 12px;
}

.mix-row__legend {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 600;
}

.mix-dot {
  width: 12px;
  height: 12px;
  border-radius: 999px;
  background: var(--accent);
}

.mix-row__title {
  font-size: var(--fs-1);
  color: var(--muted);
}

.bar {
  position: relative;
  width: 100%;
  height: 10px;
  border-radius: 999px;
  background: var(--surface-alt);
  overflow: hidden;
}

.bar::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, var(--accent) 0%, rgba(17, 17, 17, 0.4) 100%);
}

.table-wrap,
.lb-table-wrap {
  width: 100%;
  overflow-x: auto;
}

@media (max-width: 720px) {
  .lb-table-wrap {
    overflow-x: visible;
  }

  .lb-table col.lb-col-org,
  .lb-table col.lb-col-hands,
  .lb-table col.lb-col-acc,
  .lb-table col.lb-col-net,
  .lb-table col.lb-col-updated {
    display: none;
  }

  .lb-table col.lb-col-model,
  .lb-table col.lb-col-win {
    width: auto !important;
  }

  .lb-table th.lb-col-org,
  .lb-table th.lb-col-hands,
  .lb-table th.lb-col-acc,
  .lb-table th.lb-col-net,
  .lb-table th.lb-col-updated,
  .lb-table td.lb-col-org,
  .lb-table td.lb-col-hands,
  .lb-table td.lb-col-acc,
  .lb-table td.lb-col-net,
  .lb-table td.lb-col-updated {
    display: none;
  }

  .lb-table td.lb-col-win .sub {
    display: none;
  }
}

.matrix-card {
  position: relative;
  padding-top: 32px;
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.matrix-card__body {
  margin-top: 0;
}

.matrix-cell {
  position: relative;
  cursor: pointer;
  transition: transform 140ms ease, box-shadow 140ms ease;
}

@media (max-width: 720px) {
  .matrix-table td.matrix-cell,
  .matrix-table td.matrix-diag {
    color: transparent;
  }
}

.matrix-cell:hover,
.matrix-cell:focus-visible {
  transform: translate3d(0, -1px, 0);
  box-shadow: inset 0 0 0 2px rgba(17, 17, 17, 0.18);
}

.matrix-cell:focus-visible {
  outline: none;
}

.matrix-cell.matrix-cell--active {
  box-shadow: inset 0 0 0 2px var(--accent);
}

.matrix-tooltip {
  position: fixed;
  z-index: var(--z-tooltip);
  display: grid;
  gap: 6px;
  min-width: 220px;
  padding: 14px 18px;
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.96);
  box-shadow: 0 20px 40px rgba(15, 23, 42, 0.22);
  color: var(--text);
  pointer-events: none;
  opacity: 0;
  transform: translate3d(0, 6px, 0) scale(0.98);
  transition: opacity 140ms ease, transform 140ms ease;
  backdrop-filter: blur(18px);
}

:root[data-theme='dark'] .matrix-tooltip,
:root.theme-dark .matrix-tooltip {
  background: rgba(11, 18, 32, 0.92);
  border: 1px solid rgba(71, 89, 128, 0.55);
  box-shadow: 0 20px 40px rgba(2, 6, 16, 0.58);
  color: var(--text);
}

.matrix-tooltip.visible {
  opacity: 1;
  transform: translate3d(0, 0, 0) scale(1);
}

.matrix-tooltip__matchup {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 600;
  font-size: var(--fs-2);
}

.matrix-tooltip__model {
  white-space: nowrap;
}

.matrix-tooltip__versus {
  font-size: var(--fs-1);
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.16em;
}

.matrix-tooltip__stat {
  font-weight: 600;
}

.matrix-tooltip__meta {
  font-size: var(--fs-1);
  color: var(--muted);
}

@media (max-width: 720px) {
  .matrix-tooltip {
    min-width: 200px;
    padding: 12px 14px;
  }

  .matrix-tooltip__matchup {
    flex-wrap: wrap;
    gap: 6px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .matrix-cell,
  .matrix-tooltip {
    transition: none !important;
    transform: none !important;
  }
}

.matrix-table .matrix-sticky {
  position: sticky;
  left: 0;
  z-index: 3;
  background: var(--surface);
}

.matrix-table thead th.matrix-sticky {
  z-index: 4;
}

.matrix-table tbody tr:hover th.matrix-sticky {
  background: var(--surface-alt);
}

.matrix-table th.matrix-sticky {
  min-width: clamp(110px, calc(200px * var(--matrix-scale)), 220px);
  width: clamp(120px, calc(240px * var(--matrix-scale)), 260px);
  box-shadow: 4px 0 12px rgba(15, 23, 42, 0.08);
}


.matrix-table th.rot {
  writing-mode: vertical-rl;
  transform: rotate(180deg);
  white-space: nowrap;
  text-align: center;
}

.matrix-diag {
  text-align: center;
  color: var(--muted);
  background: transparent !important;
}

.table-compact {
  width: 100%;
  border-collapse: collapse;
}

.table-compact th,
.table-compact td {
  padding: 10px 12px;
}

.table-compact tbody tr + tr {
  border-top: 1px solid var(--border);
}

.num-box {
  font-weight: 600;
}

.num-sub {
  font-size: var(--fs-1);
  color: var(--muted);
}

.bot-page__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.bot-page__header h1 {
  margin: 0;
}

.bot-matches {
  width: 100%;
  table-layout: fixed;
}

.bot-matches th,
.bot-matches td {
  white-space: nowrap;
}

.site-footer {
  margin-top: auto;
  padding: 32px 0;
  border-top: 1px solid var(--footer-border);
  background: var(--footer-bg);
  backdrop-filter: blur(12px);
}

.site-footer__inner {
  width: min(1200px, calc(100vw - 48px));
  margin: 0 auto;
  display: grid;
  gap: 16px;
  align-items: center;
  justify-items: center;
  text-align: center;
}

@media (min-width: 720px) {
  .site-footer__inner {
    grid-template-columns: auto 1fr auto;
    justify-items: start;
    text-align: left;
  }
}

.site-footer__brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-weight: 600;
  color: var(--text);
}

.site-footer__nav {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  justify-content: center;
}

@media (min-width: 720px) {
  .site-footer__nav {
    justify-content: flex-start;
  }
}

.site-footer__nav a {
  font-size: var(--fs-1);
  color: var(--muted);
  transition: color var(--transition);
}

.site-footer__nav a:hover {
  color: var(--accent);
}

.site-footer__actions {
  display: flex;
  flex-direction: column;
  gap: 8px;
  align-items: center;
}

@media (min-width: 720px) {
  .site-footer__actions {
    align-items: flex-end;
  }
}

.site-footer__social {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 0.35rem 0.75rem;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  font-size: var(--fs-1);
  font-weight: 600;
  transition: background var(--transition), border-color var(--transition), color var(--transition), box-shadow var(--transit
ion);
}

.site-footer__social:hover {
  color: var(--accent);
  border-color: var(--border-strong);
  box-shadow: 0 12px 26px rgba(15, 23, 42, 0.08);
}

.site-footer__social svg {
  width: 1rem;
  height: 1rem;
}

.site-footer__copy {
  margin: 0;
  font-size: var(--fs-1);
  color: var(--muted);
}

:root[data-theme='dark'] .site-footer__brand .logo-badge,
:root.theme-dark .site-footer__brand .logo-badge {
  background: rgba(21, 31, 51, 0.85);
  border-color: rgba(71, 89, 128, 0.5);
  box-shadow: 0 6px 18px rgba(2, 6, 16, 0.45);
}

:root[data-theme='dark'] .site-footer__social,
:root.theme-dark .site-footer__social {
  background: rgba(15, 23, 42, 0.82);
  border-color: rgba(71, 89, 128, 0.55);
  color: var(--text);
  box-shadow: 0 12px 26px rgba(2, 6, 16, 0.5);
}

:root[data-theme='dark'] .site-footer__social:hover,
:root.theme-dark .site-footer__social:hover {
  border-color: rgba(141, 183, 255, 0.5);
  color: var(--accent);
  box-shadow: 0 12px 26px rgba(2, 6, 16, 0.6);
}

/* ---------- Elo page ------------------------------------------------ */

.page-elo .card.elo-card {
  position: relative;
  overflow: hidden;
  padding: 32px 34px;
  background: var(--surface);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-lg);
}

.page-elo .card.elo-card::before {
  content: none;
}

.page-elo .card.elo-card::after {
  content: none;
}

@media (max-width: 720px) {
  .page-elo .card.elo-card {
    padding: 26px;
  }
}

.elo-card {
  display: grid;
  gap: 28px;
}

.elo-card__header {
  display: grid;
  gap: 24px;
  padding-bottom: 22px;
  border-bottom: 1px solid rgba(15, 23, 42, 0.1);
}

:root[data-theme='dark'] .elo-card__header,
:root.theme-dark .elo-card__header {
  border-bottom-color: rgba(71, 89, 128, 0.45);
}


.elo-card__heading {
  display: flex;
  align-items: center;
  gap: 16px;
}

.elo-card__intro {
  display: grid;
  gap: 8px;
  color: var(--muted);
}

.elo-card__filters {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: flex-start;
  gap: 16px 20px;
}

.elo-card__filters > * {
  flex-shrink: 0;
}

.elo-card__filters #ratingMetricControl,
.elo-card__filters .sort-control {
  align-self: flex-start;
}

.elo-card__filters label.sort-control {
  margin-left: auto;
}

.elo-card__filters .filter-group {
  flex: 1 1 100%;
  width: 100%;
  min-width: 0;
}

.filter-select-control {
  display: none;
  width: 100%;
  margin-left: 0;
}

.filter-select-control select {
  width: 100%;
}

.page-elo .topnav__links .pill {
  padding-left: 1.35rem;
  padding-right: 1.35rem;
}

.page-elo .filter-chip {
  min-width: 120px;
  justify-content: center;
  padding-left: 1.1rem;
  padding-right: 1.1rem;
}

@media (max-width: 720px) {
  .elo-card__filters {
    justify-content: flex-start;
  }

  .elo-card__filters .sort-control {
    margin-left: 0;
  }

  .page-elo .filter-group {
    display: none;
  }

  .filter-select-control {
    display: inline-flex;
  }
}

.filter-group {
  display: grid;
  gap: 10px;
  min-width: 240px;
  padding: 12px 16px;
  border-radius: var(--radius-md);
  background: rgba(255, 255, 255, 0.72);
  border: 1px solid rgba(15, 23, 42, 0.08);
  backdrop-filter: blur(6px);
}

:root[data-theme='dark'] .filter-group,
:root.theme-dark .filter-group {
  background: rgba(11, 18, 32, 0.85);
  border: 1px solid rgba(71, 89, 128, 0.55);
  box-shadow: inset 0 1px 0 rgba(141, 183, 255, 0.12);
}

.filter-group__label {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: var(--fs-1);
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}

.filter-group__label svg {
  width: 1.1rem;
  height: 1.1rem;
  stroke: currentColor;
  stroke-width: 1.6;
  stroke-linecap: round;
  stroke-linejoin: round;
  fill: none;
}

.filter-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
}

.filter-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 0.4rem 0.9rem;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--muted);
  font-size: var(--fs-1);
  font-weight: 600;
  cursor: pointer;
  appearance: none;
  transition: background var(--transition), color var(--transition), border-color var(--transition), box-shadow var(--transitio
n);
}

.filter-chip:hover {
  color: var(--accent);
  border-color: var(--border-strong);
  box-shadow: 0 12px 26px rgba(15, 23, 42, 0.08);
}

:root[data-theme='dark'] .filter-chip:hover,
:root.theme-dark .filter-chip:hover {
  border-color: rgba(141, 183, 255, 0.5);
  box-shadow: 0 12px 26px rgba(2, 6, 16, 0.5);
  color: var(--accent);
}

.filter-chip:focus-visible {
  outline: none;
  border-color: rgba(59, 130, 246, 0.48);
  box-shadow: 0 0 0 4px rgba(59, 130, 246, 0.18), 0 12px 26px rgba(15, 23, 42, 0.08);
  color: var(--accent);
}

:root[data-theme='dark'] .filter-chip:focus-visible,
:root.theme-dark .filter-chip:focus-visible {
  border-color: rgba(141, 183, 255, 0.6);
  box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.35), 0 12px 26px rgba(2, 6, 16, 0.55);
  color: var(--accent);
}

.filter-chip.active {
  background: linear-gradient(135deg, rgba(59, 130, 246, 0.16) 0%, rgba(59, 130, 246, 0.06) 100%);
  color: var(--accent);
  border-color: rgba(59, 130, 246, 0.4);
  box-shadow: 0 16px 34px rgba(59, 130, 246, 0.16);
}

:root[data-theme='dark'] .filter-chip.active,
:root.theme-dark .filter-chip.active {
  background: linear-gradient(135deg, rgba(37, 99, 235, 0.32) 0%, rgba(30, 64, 175, 0.68) 100%);
  color: #e0f2fe;
  border-color: rgba(59, 130, 246, 0.55);
  box-shadow: 0 16px 34px rgba(2, 6, 16, 0.6);
}

.filter-chip__content {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.filter-chip__dot {
  width: 8px;
  height: 8px;
  border-radius: 999px;
  background: currentColor;
  opacity: 0.5;
}

.filter-chip img,
.filter-chip .org-icon {
  width: 28px;
  height: 28px;
  border-radius: 999px;
  background: var(--surface-alt);
  padding: 4px;
  box-shadow: inset 0 0 0 1px rgba(15, 23, 42, 0.08);
}

:root[data-theme='dark'] .filter-chip img,
:root.theme-dark .filter-chip img,
:root[data-theme='dark'] .filter-chip .org-icon,
:root.theme-dark .filter-chip .org-icon {
  background: rgba(21, 31, 51, 0.85);
  box-shadow: inset 0 0 0 1px rgba(71, 89, 128, 0.45);
}

.filter-chip__text {
  white-space: nowrap;
}

.filter-indicator {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 0.45rem 1rem;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--muted);
  font-size: var(--fs-1);
  font-weight: 600;
  transition: background var(--transition), border-color var(--transition), color var(--transition), box-shadow var(--transition);
  backdrop-filter: blur(6px);
}

:root[data-theme='dark'] .filter-indicator,
:root.theme-dark .filter-indicator {
  background: rgba(15, 23, 42, 0.78);
  border-color: rgba(71, 89, 128, 0.5);
  color: var(--muted);
}

.filter-indicator::before {
  content: '';
  width: 10px;
  height: 10px;
  border-radius: 999px;
  background: currentColor;
  opacity: 0.45;
}

:root[data-theme='dark'] .filter-indicator::before,
:root.theme-dark .filter-indicator::before {
  background: var(--accent);
  opacity: 0.8;
}

.filter-indicator.is-active {
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.14) 0%, rgba(59, 130, 246, 0.1) 100%);
  border-color: rgba(99, 102, 241, 0.45);
  color: var(--accent);
  box-shadow: 0 16px 34px rgba(99, 102, 241, 0.16);
}

@media (max-width: 640px) {
  .page-elo .sort-control {
    background: var(--surface);
    border: 1px solid var(--border);
    box-shadow: none;
    backdrop-filter: none;
  }
  :root[data-theme='dark'] .page-elo .sort-control,
  :root.theme-dark .page-elo .sort-control {
    background: var(--surface);
    border-color: var(--border);
    box-shadow: none;
    backdrop-filter: none;
  }
  .sort-control button.active {
    box-shadow: none;
  }
  :root[data-theme='dark'] .sort-control button.active,
  :root.theme-dark .sort-control button.active {
    box-shadow: none;
  }
  .filter-group,
  .filter-indicator {
    background: var(--surface);
    border: 1px solid var(--border);
    backdrop-filter: none;
    box-shadow: none;
  }
  :root[data-theme='dark'] .filter-group,
  :root.theme-dark .filter-group,
  :root[data-theme='dark'] .filter-indicator,
  :root.theme-dark .filter-indicator {
    background: var(--surface);
    border-color: var(--border);
    backdrop-filter: none;
    box-shadow: none;
  }
  .filter-indicator.is-active {
    box-shadow: none;
  }
  .matrix-tooltip {
    backdrop-filter: none;
    box-shadow: none;
  }
  :root[data-theme='dark'] .matrix-tooltip,
  :root.theme-dark .matrix-tooltip {
    backdrop-filter: none;
    box-shadow: none;
  }
  body.has-open-mobile-nav::before {
    backdrop-filter: none;
  }
}

.elo-card__body {
  position: relative;
  display: grid;
  gap: 20px;
}

.elo-chart {
  position: relative;
  width: 100%;
  height: auto;
  border-radius: var(--radius-lg);
}

.elo-chart__mobile-message {
  display: none;
  padding: 14px 16px;
  border-radius: var(--radius-md);
  border: 1px dashed var(--border);
  background: rgba(59, 130, 246, 0.08);
  color: var(--muted);
  text-align: center;
  font-size: var(--fs-1);
  font-weight: 500;
}

:root[data-theme='dark'] .elo-chart__mobile-message,
:root.theme-dark .elo-chart__mobile-message {
  background: rgba(30, 64, 175, 0.2);
  border-color: rgba(148, 163, 184, 0.35);
}

.elo-chart::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: var(--surface);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
  backdrop-filter: none;
  pointer-events: none;
}

.elo-chart svg {
  position: relative;
  display: block;
  width: 100%;
  height: auto;
  border-radius: inherit;
  z-index: 1;
}

.elo-chart .chart-tooltip {
  z-index: var(--z-tooltip);
}

.elo-bars {
  display: grid;
  gap: 18px;
  margin-top: 22px;
}

@media (max-width: 720px) {
  .page-elo .elo-chart {
    display: none;
  }

  .page-elo .elo-chart__mobile-message {
    display: block;
  }
}

.elo-bars__item {
  position: relative;
  display: grid;
  gap: 12px;
  padding: 18px 20px 20px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
  background: var(--surface);
  box-shadow: var(--shadow-sm);
}

.elo-bars__item::after {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: inherit;
  pointer-events: none;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.26);
}

.elo-bars__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.elo-bars__label {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.elo-bars__label .org-icon,
.elo-bars__label img {
  width: 38px;
  height: 38px;
  border-radius: 14px;
  background: var(--surface-alt);
  padding: 6px;
  box-shadow: inset 0 0 0 1px rgba(15, 23, 42, 0.08);
}

.elo-bars__text {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.elo-bars__model {
  font-weight: 600;
  color: var(--text);
}

.elo-bars__company {
  font-size: var(--fs-0);
  color: var(--muted);
}

.elo-bars__meta {
  display: flex;
  align-items: baseline;
  gap: 12px;
}

.elo-bars__value {
  font-family: var(--font-mono);
  font-weight: 600;
  font-size: var(--fs-2);
  color: var(--text);
}

.elo-bars__delta {
  font-family: var(--font-mono);
  font-size: var(--fs-0);
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.elo-bars__delta.is-positive {
  color: var(--ok);
}

.elo-bars__delta.is-negative {
  color: var(--bad);
}

.elo-bars__delta.is-neutral {
  color: var(--muted);
}

.elo-bars__matches {
  font-size: var(--fs-0);
  color: var(--muted);
}

.elo-bars__bar {
  position: relative;
  height: 12px;
  border-radius: 999px;
  background: rgba(148, 163, 184, 0.22);
  overflow: hidden;
}

.elo-bars__fill {
  position: absolute;
  inset: 0;
  width: 0;
  border-radius: inherit;
  background: linear-gradient(135deg, rgba(59, 130, 246, 0.18) 0%, rgba(59, 130, 246, 0.45) 55%, rgba(59, 130, 246, 0.85) 100%);
}

.elo-bars__item[role='listitem'] {
  list-style: none;
}

@media (max-width: 720px) {
  .elo-bars__header {
    align-items: flex-start;
    flex-direction: column;
  }

  .elo-bars__meta {
    align-self: stretch;
  }
}


.chart-crosshair {
  stroke: rgba(15, 23, 42, 0.24);
  stroke-width: 1.4;
  stroke-dasharray: 6 6;
  transition: opacity var(--transition);
}

.chart-marker {
  fill: #ffffff;
  stroke-width: 2.2;
  filter: drop-shadow(0 6px 14px rgba(15, 23, 42, 0.18));
}

.chart-tooltip {
  position: absolute;
  pointer-events: none;
  min-width: 240px;
  background: var(--surface);
  border: 1px solid rgba(15, 23, 42, 0.08);
  border-radius: var(--radius-md);
  padding: 16px 18px;
  box-shadow: 0 24px 50px rgba(15, 23, 42, 0.16);
  font-size: var(--fs-1);
  opacity: 0;
  transform: translateY(10px);
  transition: opacity var(--transition), transform var(--transition);
  z-index: var(--z-tooltip);
}

.chart-tooltip.visible {
  opacity: 1;
  transform: translateY(0);
}

.chart-tooltip__time {
  font-weight: 600;
  margin-bottom: 10px;
  color: var(--text);
}

.chart-tooltip__series {
  display: grid;
  gap: 10px;
}

.chart-tooltip__row {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 12px;
}

.chart-tooltip__label {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.chart-bullet {
  width: 10px;
  height: 10px;
  border-radius: 999px;
  background: currentColor;
  box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.9);
}

.chart-tooltip__text {
  display: grid;
  gap: 2px;
}

.chart-tooltip__model {
  font-weight: 600;
  color: var(--text);
}

.chart-tooltip__company {
  font-size: var(--fs-0);
  color: var(--muted);
}

.chart-tooltip__value {
  display: grid;
  justify-items: end;
  gap: 4px;
}

.chart-tooltip__elo {
  font-family: var(--font-mono);
  font-weight: 600;
  color: var(--text);
}

.chart-tooltip__delta {
  font-size: var(--fs-0);
  font-weight: 600;
}

.chart-tooltip__delta.positive {
  color: var(--ok);
}

.chart-tooltip__delta.negative {
  color: var(--bad);
}

.chart-tooltip__delta.neutral {
  color: var(--muted);
}

.cards {
  display: flex;
  gap: 16px;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  perspective: 1000px;
}

#board,
#sb_hole,
#bb_hole {
  min-height: var(--card-h);
}

#sb_hole,
#bb_hole {
  margin-top: 12px;
}

#sb_hole {
  justify-content: flex-start;
}

#bb_hole {
  justify-content: flex-end;
}

.cards--hole {
  justify-content: flex-start;
}

#bb_hole.cards--hole {
  justify-content: flex-end;
}

.cardx {
  --corner-pad: 12px;
  --rank-size: 26px;
  --glyph-size: 3.2em;
  --tilt: 0deg;
  --card-front-bg: linear-gradient(180deg, #ffffff 0%, #eef1f7 100%);
  --card-front-border: rgba(15, 23, 42, 0.14);
  --card-front-color: #111827;
  --card-back-bg: linear-gradient(155deg, #1f2937 0%, #0f172a 52%, #1c1f3a 100%);
  --card-back-pattern: rgba(96, 165, 250, 0.28);
  --card-back-shine: rgba(148, 163, 184, 0.18);
  --card-glyph: '';
  width: var(--card-w);
  height: var(--card-h);
  border-radius: 20px;
  border: 1px solid rgba(15, 23, 42, 0.08);
  position: relative;
  display: grid;
  place-items: center;
  font-family: var(--font-display);
  font-weight: 600;
  letter-spacing: 0.015em;
  color: var(--card-front-color);
  transform-style: preserve-3d;
  transform: rotateY(var(--tilt));
  transition: transform 320ms ease;
  box-shadow: 0 24px 52px rgba(15, 23, 42, 0.2);
  background: transparent;
}

:root[data-theme='dark'] .cardx,
:root.theme-dark .cardx {
  --card-front-bg: linear-gradient(180deg, #20304b 0%, #151f33 100%);
  --card-front-border: rgba(141, 183, 255, 0.3);
  --card-front-color: #f3f6ff;
  --card-back-bg: linear-gradient(155deg, #1d4ed8 0%, #1e3a8a 56%, #0b1220 100%);
  --card-back-pattern: rgba(96, 165, 250, 0.22);
  --card-back-shine: rgba(148, 197, 255, 0.26);
  box-shadow: 0 24px 52px rgba(2, 6, 16, 0.45);
}

.cardx .face {
  position: absolute;
  inset: 0;
  border-radius: 20px;
  backface-visibility: hidden;
  display: grid;
  place-items: center;
  overflow: hidden;
}

.cardx .front {
  background: var(--card-front-bg);
  color: inherit;
  transform: rotateY(180deg);
  border: 1px solid var(--card-front-border);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.85), inset 0 -2px 10px rgba(15, 23, 42, 0.1);
}

.cardx .back {
  background: var(--card-back-bg);
  border: 1px solid rgba(255, 255, 255, 0.18);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.16);
}

.cardx .back::before {
  content: '';
  position: absolute;
  inset: 10px;
  border-radius: 16px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  box-shadow: inset 0 0 18px rgba(15, 23, 42, 0.45);
  opacity: 0.75;
}

.cardx .back::after {
  content: '';
  position: absolute;
  inset: -6px;
  background:
    radial-gradient(circle at 24% 26%, var(--card-back-shine) 0%, transparent 55%),
    radial-gradient(circle at 74% 72%, rgba(59, 130, 246, 0.24) 0%, transparent 58%),
    repeating-linear-gradient(135deg, transparent 0, transparent 16px, var(--card-back-pattern) 16px, var(--card-back-pattern) 28px);
  opacity: 0.55;
  mix-blend-mode: screen;
}

.cardx.flip {
  --tilt: 180deg;
}

.cardx .num-box {
  position: absolute;
  font-size: var(--rank-size);
  padding: var(--corner-pad);
  line-height: 1;
  font-weight: 700;
  color: var(--card-front-color);
}

.cardx .num-box.top {
  top: 0;
  left: 0;
}

.cardx .num-box.bottom {
  bottom: 0;
  right: 0;
  transform: rotate(180deg);
}

.cardx .num-box.suit::after {
  display: block;
  font-size: 0.62em;
  margin-top: 3px;
  content: var(--card-glyph, '');
}

.cardx .suit {
  font-size: var(--glyph-size);
  color: currentColor;
  text-shadow: 0 14px 32px rgba(15, 23, 42, 0.26);
}

:root[data-theme='dark'] .cardx .suit,
:root.theme-dark .cardx .suit {
  text-shadow: 0 14px 32px rgba(2, 6, 16, 0.45);
}

.cardx .suit::after {
  content: var(--card-glyph, '');
}

.spade {
  color: #111827;
}

.heart,
.diamond {
  color: #dc2626;
}

.club {
  color: #15803d;
}

:root[data-theme='dark'] .spade,
:root.theme-dark .spade {
  color: #dbe5ff;
}

:root[data-theme='dark'] .heart,
:root[data-theme='dark'] .diamond,
:root.theme-dark .heart,
:root.theme-dark .diamond {
  color: #fda4af;
}

:root[data-theme='dark'] .club,
:root.theme-dark .club {
  color: #4ade80;
}

.cardx.spade {
  --card-front-bg: linear-gradient(180deg, #ffffff 0%, #e2e8f0 100%);
  --card-front-border: rgba(15, 23, 42, 0.18);
  --card-front-color: #111827;
  --card-glyph: '\2660';
}

.cardx.heart {
  --card-front-bg: linear-gradient(180deg, #fff5f5 0%, #fee2e2 100%);
  --card-front-border: rgba(248, 113, 113, 0.3);
  --card-front-color: #b91c1c;
  --card-glyph: '\2665';
}

.cardx.diamond {
  --card-front-bg: linear-gradient(180deg, #fff7fb 0%, #ffe4e6 100%);
  --card-front-border: rgba(251, 113, 133, 0.3);
  --card-front-color: #b91c1c;
  --card-glyph: '\2666';
}

.cardx.club {
  --card-front-bg: linear-gradient(180deg, #f4fff8 0%, #dcfce7 100%);
  --card-front-border: rgba(22, 163, 74, 0.28);
  --card-front-color: #047857;
  --card-glyph: '\\2663';
}

:root[data-theme='dark'] .cardx.spade,
:root.theme-dark .cardx.spade {
  --card-front-bg: linear-gradient(180deg, #1d2840 0%, #131c2f 100%);
  --card-front-border: rgba(141, 183, 255, 0.34);
  --card-front-color: #dee7ff;
}

:root[data-theme='dark'] .cardx.heart,
:root.theme-dark .cardx.heart {
  --card-front-bg: linear-gradient(180deg, #36111f 0%, #250b16 100%);
  --card-front-border: rgba(248, 113, 113, 0.36);
  --card-front-color: #fda4af;
}

:root[data-theme='dark'] .cardx.diamond,
:root.theme-dark .cardx.diamond {
  --card-front-bg: linear-gradient(180deg, #351428 0%, #230c18 100%);
  --card-front-border: rgba(251, 113, 133, 0.34);
  --card-front-color: #fbb6ce;
}

:root[data-theme='dark'] .cardx.club,
:root.theme-dark .cardx.club {
  --card-front-bg: linear-gradient(180deg, #123321 0%, #0c2216 100%);
  --card-front-border: rgba(34, 197, 94, 0.28);
  --card-front-color: #86efac;
}

.cardx.cardx--placeholder {
  --card-glyph: '';
  display: block;
  place-items: stretch;
  padding: 0;
  background: transparent;
  border: 1px dashed rgba(148, 163, 184, 0.42);
  box-shadow: none;
  transform: none;
  transition: none;
  pointer-events: none;
  opacity: 0.7;
}

.cardx.cardx--placeholder .cardx__placeholder {
  width: 100%;
  height: 100%;
  border-radius: 18px;
  background: linear-gradient(135deg, rgba(148, 163, 184, 0.24) 0%, rgba(148, 163, 184, 0.12) 100%);
  border: 1px dashed rgba(148, 163, 184, 0.38);
}

:root[data-theme='dark'] .cardx.cardx--placeholder,
:root.theme-dark .cardx.cardx--placeholder {
  border-color: rgba(148, 163, 184, 0.28);
}

:root[data-theme='dark'] .cardx.cardx--placeholder .cardx__placeholder,
:root.theme-dark .cardx.cardx--placeholder .cardx__placeholder {
  background: linear-gradient(135deg, rgba(148, 163, 184, 0.18) 0%, rgba(148, 163, 184, 0.08) 100%);
  border-color: rgba(148, 163, 184, 0.26);
}

body.replay-theme {
  --card-w: 112px;
  --card-h: 162px;
}

@media (max-width: 1080px) {
  body.replay-theme {
    --card-w: 102px;
    --card-h: 148px;
  }
}

@media (max-width: 720px) {
  body.replay-theme {
    --card-w: 88px;
    --card-h: 126px;
  }
}

@media (max-width: 540px) {
  body.replay-theme {
    --card-w: clamp(62px, 32vw, 74px);
    --card-h: clamp(92px, 46vw, 108px);
  }
}

.dealer {
  width: 26px;
  height: 26px;
  border-radius: 999px;
  display: grid;
  place-items: center;
  background: var(--accent);
  color: var(--surface);
  font-size: var(--fs-1);
  font-weight: 600;
}

.sb-zone .dealer,
.bb-zone .dealer {
  position: absolute;
  top: -14px;
  left: 24px;
  box-shadow: 0 10px 24px rgba(250, 204, 21, 0.4);
}

#bbZone .dealer {
  left: auto;
  right: 24px;
}

.dealer-move {
  animation: dealerHop 320ms ease;
}

@keyframes dealerHop {
  from {
    transform: scale(0.8);
    opacity: 0;
  }
  to {
    transform: scale(1);
    opacity: 1;
  }
}

.match-legend__item {
  display: flex;
  align-items: center;
  gap: 10px;
}

.match-legend__details {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  font-size: var(--fs-1);
  color: var(--muted);
}

.match-legend__slot {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.match-legend__swatch {
  width: 10px;
  height: 10px;
  border-radius: 999px;
  background: var(--accent);
}

.match-legend__text {
  font-size: var(--fs-1);
  color: var(--muted);
}

/* ---------- About page ---------------------------------------------- */

.about-hero {
  display: grid;
  gap: 20px;
}

.about-hero__eyebrow {
  text-transform: uppercase;
  font-size: var(--fs-0);
  letter-spacing: 0.22em;
  color: var(--muted);
}

.about-hero__lede {
  font-size: 1.2rem;
  color: var(--muted);
}

.about-hero__metrics {
  display: grid;
  gap: 16px;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
}

.about-inline-kv {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.about-inline-kv__item {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 12px 14px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--surface);
}

.about-inline-kv__label {
  font-size: var(--fs-0);
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--muted);
}

.about-inline-kv__value {
  font-weight: 600;
}

.about-grid {
  display: grid;
  gap: 24px;
}

.about-grid--columns {
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
}

.about-section {
  display: grid;
  gap: 18px;
}

.about-block {
  padding: 24px;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  background: var(--surface);
}

.about-block__title {
  font-size: var(--fs-3);
  font-weight: 600;
}

.about-metric {
  display: grid;
  gap: 6px;
}

.about-metric__label {
  font-weight: 600;
}

.about-metric__caption {
  color: var(--muted);
  font-size: var(--fs-1);
}

.about-steps {
  display: grid;
  gap: 16px;
}

.about-list {
  padding-left: 20px;
  color: var(--muted);
}

/* ---------- Misc utilities ------------------------------------------ */

.bb-zone .muted,
.sb-zone .muted {
  color: var(--muted);
}

.inline-tip {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  vertical-align: middle;
  width: 22px;
  height: 22px;
  margin-left: 8px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--surface-alt);
  color: var(--accent);
  font-size: 0.75rem;
  font-weight: 600;
  line-height: 1;
  transition: background var(--transition), border-color var(--transition), color var(--transition), box-shadow var(--transition);
}

.inline-tip:hover,
.inline-tip:focus-visible {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--accent-contrast);
  box-shadow: 0 0 0 3px rgba(17, 17, 17, 0.1);
}

.inline-tip::after {
  content: attr(data-tip);
  position: absolute;
  bottom: calc(100% + 14px);
  left: 50%;
  transform: translate(-50%, 6px);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
  color: var(--text);
  font-size: var(--fs-1);
  line-height: 1.45;
  box-shadow: var(--shadow-sm);
  opacity: 0;
  pointer-events: none;
  width: max-content;
  max-width: 280px;
  text-align: left;
  transition: opacity var(--transition), transform var(--transition);
  z-index: var(--z-tooltip);
  background-clip: padding-box;
}

.inline-tip::before {
  content: '';
  position: absolute;
  bottom: calc(100% + 4px);
  left: 50%;
  width: 14px;
  height: 14px;
  transform: translate(-50%, 10px) rotate(45deg);
  background: var(--surface);
  border-left: 1px solid var(--border);
  border-top: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--transition), transform var(--transition);
  z-index: var(--z-tooltip);
}

.inline-tip:hover::after,
.inline-tip:hover::before,
.inline-tip:focus-visible::after,
.inline-tip:focus-visible::before {
  opacity: 1;
}

.inline-tip:hover::after,
.inline-tip:focus-visible::after {
  transform: translate(-50%, 0);
}

.inline-tip:hover::before,
.inline-tip:focus-visible::before {
  transform: translate(-50%, 2px) rotate(45deg);
}

body.tooltips-disabled .inline-tip {
  display: none;
}

.inline-tip.inline-tip--persistent {
  width: 20px;
  height: 20px;
  font-size: 0.7rem;
}

.tooltip-pop {
  position: absolute;
  display: none;
  min-width: 240px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 14px;
  box-shadow: var(--shadow-md);
  font-size: var(--fs-1);
  color: var(--text);
  z-index: var(--z-tooltip);
}

.tooltip-pop.show {
  display: block;
}

.tooltip-pop .title {
  font-weight: 700;
  margin-bottom: 6px;
}

.tooltip-pop .body {
  color: var(--muted);
}

.tooltip-pop .close {
  position: absolute;
  top: 8px;
  right: 10px;
  background: transparent;
  border: none;
  font-size: 1.1rem;
  cursor: pointer;
  color: var(--muted);
}

.tooltip-pop .close:hover {
  color: var(--accent);
}

.call {
  color: var(--ok);
}

.raise {
  color: var(--accent);
}

.fold {
  color: var(--bad);
}

.check {
  color: var(--muted);
}

.table .pill,
.lb-table .pill {
  padding: 0.35rem 0.8rem;
  font-size: var(--fs-1);
}

.top,
.bottom {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.controls {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
}

.controls .btn,
.controls .pill {
  font-size: var(--fs-1);
}

.group {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--surface-alt);
  padding: 4px;
}

.group .pill {
  padding: 0.35rem 0.8rem;
}

.playstyle-card {
  display: grid;
  gap: 18px;
  padding: 22px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
  background: var(--surface);
  box-shadow: var(--shadow-sm);
}

.playstyle-card__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.playstyle-card__header-text {
  display: grid;
  gap: 4px;
}

.playstyle-card__label {
  font-size: var(--fs-1);
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--muted);
}

.playstyle-card__hint {
  font-size: var(--fs-1);
  color: var(--muted);
}

.playstyle-card__badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 0.4rem 0.85rem;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--surface-alt);
  font-size: var(--fs-1);
  font-weight: 600;
  color: var(--muted);
  transition: background var(--transition), color var(--transition), border-color var(--transition), box-shadow var(--transition);
}

:root[data-theme='dark'] .playstyle-card__badge,
:root.theme-dark .playstyle-card__badge {
  background: rgba(15, 23, 42, 0.78);
  border-color: rgba(71, 89, 128, 0.5);
  color: var(--muted);
  box-shadow: 0 12px 30px rgba(2, 6, 16, 0.45);
}

:root[data-theme='dark'] .filter-chip,
:root.theme-dark .filter-chip {
  background: rgba(15, 23, 42, 0.78);
  border-color: rgba(71, 89, 128, 0.5);
  color: var(--muted);
}

.playstyle-card[data-style='LAG'] .playstyle-card__badge {
  background: rgba(56, 189, 248, 0.16);
  color: #0f172a;
  border-color: rgba(56, 189, 248, 0.45);
  box-shadow: 0 12px 30px rgba(56, 189, 248, 0.18);
}

:root[data-theme='dark'] .playstyle-card[data-style='LAG'] .playstyle-card__badge,
:root.theme-dark .playstyle-card[data-style='LAG'] .playstyle-card__badge {
  background: rgba(56, 189, 248, 0.24);
  color: #e0f2fe;
  border-color: rgba(56, 189, 248, 0.55);
  box-shadow: 0 12px 30px rgba(13, 94, 160, 0.48);
}

.playstyle-card[data-style='TAG'] .playstyle-card__badge {
  background: rgba(168, 85, 247, 0.18);
  color: #3b0764;
  border-color: rgba(168, 85, 247, 0.45);
  box-shadow: 0 12px 30px rgba(168, 85, 247, 0.18);
}

:root[data-theme='dark'] .playstyle-card[data-style='TAG'] .playstyle-card__badge,
:root.theme-dark .playstyle-card[data-style='TAG'] .playstyle-card__badge {
  background: rgba(168, 85, 247, 0.26);
  color: #f3e8ff;
  border-color: rgba(168, 85, 247, 0.55);
  box-shadow: 0 12px 30px rgba(88, 28, 135, 0.48);
}

.playstyle-card[data-style='FISH'] .playstyle-card__badge {
  background: rgba(249, 115, 22, 0.16);
  color: #7c2d12;
  border-color: rgba(249, 115, 22, 0.45);
  box-shadow: 0 12px 30px rgba(249, 115, 22, 0.18);
}

:root[data-theme='dark'] .playstyle-card[data-style='FISH'] .playstyle-card__badge,
:root.theme-dark .playstyle-card[data-style='FISH'] .playstyle-card__badge {
  background: rgba(249, 115, 22, 0.24);
  color: #ffedd5;
  border-color: rgba(249, 115, 22, 0.55);
  box-shadow: 0 12px 30px rgba(124, 45, 18, 0.45);
}

.playstyle-card[data-style='NIT'] .playstyle-card__badge {
  background: rgba(34, 197, 94, 0.18);
  color: #064e3b;
  border-color: rgba(34, 197, 94, 0.45);
  box-shadow: 0 12px 30px rgba(34, 197, 94, 0.18);
}

:root[data-theme='dark'] .playstyle-card[data-style='NIT'] .playstyle-card__badge,
:root.theme-dark .playstyle-card[data-style='NIT'] .playstyle-card__badge {
  background: rgba(34, 197, 94, 0.24);
  color: #bbf7d0;
  border-color: rgba(34, 197, 94, 0.55);
  box-shadow: 0 12px 30px rgba(14, 116, 67, 0.45);
}

.playstyle-card[data-style='N/A'] .playstyle-card__badge {
  background: var(--surface-alt);
  color: var(--muted);
  border-color: var(--border);
  box-shadow: none;
}

:root[data-theme='dark'] .playstyle-card[data-style='N/A'] .playstyle-card__badge,
:root.theme-dark .playstyle-card[data-style='N/A'] .playstyle-card__badge {
  background: rgba(21, 31, 51, 0.78);
  border-color: rgba(71, 89, 128, 0.5);
  color: var(--muted);
}

.playstyle-card__grid {
  display: grid;
  gap: 16px;
}

.style-grid {
  position: relative;
  display: grid;
  grid-template-columns: repeat(2, minmax(120px, 1fr));
  gap: 14px;
  padding: 18px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
  background: linear-gradient(135deg, rgba(15, 23, 42, 0.04) 0%, rgba(15, 23, 42, 0.02) 100%);
}

.style-grid::after {
  content: '';
  position: absolute;
  inset: 12px;
  border-radius: 18px;
  border: 1px dashed rgba(15, 23, 42, 0.08);
  pointer-events: none;
}

.playstyle-grid__cell {
  position: relative;
  display: grid;
  gap: 6px;
  align-items: flex-start;
  justify-items: flex-start;
  padding: 16px;
  border-radius: 18px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--muted);
  font-size: var(--fs-1);
  text-align: left;
  transition: transform var(--transition), box-shadow var(--transition), border-color var(--transition), background var(--transition), color var(--transition);
}

:root[data-theme='dark'] .playstyle-grid__cell,
:root.theme-dark .playstyle-grid__cell {
  background: rgba(15, 23, 42, 0.78);
  border-color: rgba(71, 89, 128, 0.5);
  color: var(--muted);
}

.playstyle-grid__cell:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-sm);
  color: var(--text);
}

:root[data-theme='dark'] .playstyle-grid__cell:hover,
:root.theme-dark .playstyle-grid__cell:hover {
  box-shadow: var(--shadow-sm);
  color: var(--text);
}

.playstyle-grid__cell:focus-visible {
  outline-offset: 4px;
}

.playstyle-grid__cell[data-style='LAG'] {
  --ps-color: rgba(56, 189, 248, 0.18);
  --ps-border: rgba(56, 189, 248, 0.5);
  --ps-accent: #0f172a;
}

:root[data-theme='dark'] .playstyle-grid__cell[data-style='LAG'],
:root.theme-dark .playstyle-grid__cell[data-style='LAG'] {
  --ps-color: rgba(56, 189, 248, 0.32);
  --ps-border: rgba(56, 189, 248, 0.55);
  --ps-accent: #e0f2fe;
}

.playstyle-grid__cell[data-style='TAG'] {
  --ps-color: rgba(168, 85, 247, 0.2);
  --ps-border: rgba(168, 85, 247, 0.5);
  --ps-accent: #3b0764;
}

:root[data-theme='dark'] .playstyle-grid__cell[data-style='TAG'],
:root.theme-dark .playstyle-grid__cell[data-style='TAG'] {
  --ps-color: rgba(168, 85, 247, 0.32);
  --ps-border: rgba(168, 85, 247, 0.55);
  --ps-accent: #f3e8ff;
}

.playstyle-grid__cell[data-style='FISH'] {
  --ps-color: rgba(249, 115, 22, 0.18);
  --ps-border: rgba(249, 115, 22, 0.48);
  --ps-accent: #7c2d12;
}

:root[data-theme='dark'] .playstyle-grid__cell[data-style='FISH'],
:root.theme-dark .playstyle-grid__cell[data-style='FISH'] {
  --ps-color: rgba(249, 115, 22, 0.3);
  --ps-border: rgba(249, 115, 22, 0.52);
  --ps-accent: #ffedd5;
}

.playstyle-grid__cell[data-style='NIT'] {
  --ps-color: rgba(34, 197, 94, 0.2);
  --ps-border: rgba(34, 197, 94, 0.5);
  --ps-accent: #065f46;
}

:root[data-theme='dark'] .playstyle-grid__cell[data-style='NIT'],
:root.theme-dark .playstyle-grid__cell[data-style='NIT'] {
  --ps-color: rgba(34, 197, 94, 0.32);
  --ps-border: rgba(34, 197, 94, 0.55);
  --ps-accent: #bbf7d0;
}

.playstyle-grid__cell.is-active {
  border-color: var(--ps-border, var(--accent));
  background: linear-gradient(135deg, var(--ps-color, rgba(15, 23, 42, 0.06)) 0%, rgba(255, 255, 255, 0.92) 70%);
  box-shadow: 0 18px 36px rgba(15, 23, 42, 0.12);
  color: var(--ps-accent, var(--text));
}

:root[data-theme='dark'] .playstyle-grid__cell.is-active,
:root.theme-dark .playstyle-grid__cell.is-active {
  background: linear-gradient(135deg, var(--ps-color, rgba(31, 45, 76, 0.45)) 0%, rgba(9, 14, 24, 0.92) 70%);
  border-color: var(--ps-border, rgba(141, 183, 255, 0.5));
  box-shadow: 0 18px 36px rgba(2, 6, 16, 0.55);
  color: var(--ps-accent, var(--accent));
}

.playstyle-grid__cell.is-active .playstyle-grid__abbr {
  color: var(--ps-accent, var(--accent));
}

.playstyle-grid__cell.is-active .playstyle-grid__text {
  color: rgba(15, 23, 42, 0.7);
}

:root[data-theme='dark'] .playstyle-grid__cell.is-active .playstyle-grid__text,
:root.theme-dark .playstyle-grid__cell.is-active .playstyle-grid__text {
  color: rgba(226, 232, 255, 0.82);
}

.playstyle-grid__abbr {
  font-family: var(--font-display);
  font-size: 1.15rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text);
}

:root[data-theme='dark'] .playstyle-grid__cell.is-active .playstyle-grid__abbr,
:root.theme-dark .playstyle-grid__cell.is-active .playstyle-grid__abbr {
  color: var(--ps-accent, var(--accent));
}

.playstyle-grid__text {
  font-size: var(--fs-1);
  color: var(--muted);
}

.playstyle-card__stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: 12px;
}

.playstyle-card__stat {
  display: grid;
  gap: 4px;
}

.playstyle-card__stat dt {
  font-size: var(--fs-0);
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--muted);
}

.playstyle-card__stat dd {
  margin: 0;
  font-weight: 600;
  font-family: var(--font-mono);
  font-size: var(--fs-1);
}

.stacks {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

.live-scoreboard {
  display: grid;
  gap: 8px;
  margin-bottom: 16px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border);
  font-variant-numeric: tabular-nums;
}

.live-scoreboard__row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
}

.live-scoreboard__label {
  font-size: var(--fs-1);
  color: var(--muted);
}

.live-scoreboard__values {
  display: flex;
  align-items: baseline;
  gap: 12px;
  font-variant-numeric: tabular-nums;
}

.live-scoreboard__bank {
  font-weight: 600;
}

.live-scoreboard__delta {
  min-width: 4ch;
  text-align: right;
  color: var(--muted);
  transition: color var(--transition);
}

.live-scoreboard__delta--up {
  color: var(--ok);
}

.live-scoreboard__delta--down {
  color: var(--bad);
}

.log {
  font-size: var(--fs-1);
  color: var(--muted);
}

.page-history .history-hero {
  position: relative;
  display: flex;
  align-items: center;
  gap: 20px;
  padding: 28px;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
}

.page-history .history-hero::after {
  content: none;
}

.page-history .history-hero__logo {
  position: relative;
  width: 72px;
  height: 72px;
  border-radius: 24px;
  display: grid;
  place-items: center;
  background: var(--surface);
  border: 1px solid rgba(15, 23, 42, 0.08);
  box-shadow: 0 16px 32px rgba(15, 23, 42, 0.1);
  transition: transform var(--transition), box-shadow var(--transition);
}

.page-history .history-hero__logo:hover {
  transform: translateY(-4px);
  box-shadow: 0 20px 40px rgba(15, 23, 42, 0.16);
}

.page-history .history-hero__logo img {
  width: 56%;
}

.page-history .history-hero__body {
  position: relative;
  display: grid;
  gap: 8px;
}

.page-history .history-hero__body .muted {
  color: var(--muted);
}

.page-history .history-table {
  background: var(--surface);
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
  padding: 20px 24px 24px;
  display: grid;
  gap: 18px;
}

.history-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px 16px;
}

.history-toolbar__group {
  display: flex;
  align-items: center;
  gap: 10px;
}

.history-toolbar__group--status {
  margin-left: auto;
}

.history-toolbar__label {
  font-size: var(--fs-0);
  text-transform: uppercase;
  font-weight: 600;
  letter-spacing: 0.08em;
  color: var(--muted);
}

.history-select {
  appearance: none;
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 0.45rem 2.2rem 0.45rem 0.9rem;
  font-size: var(--fs-1);
  font-weight: 500;
  color: var(--accent);
  background: var(--surface-alt) no-repeat right 12px center / 12px;
  background-image: url('data:image/svg+xml,%3csvg xmlns="http://www.w3.org/2000/svg" width="12" height="12" viewBox="0 0 12 12" fill="none" stroke="%2344516a" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"%3e%3cpath d="M3 5l3 3 3-3"/%3e%3c/svg%3e');
  transition: border-color var(--transition), background-color var(--transition), color var(--transition);
  min-width: 180px;
}

.history-select:hover {
  border-color: var(--border-strong);
  background-color: var(--surface-soft);
}

.history-toolbar__toggle {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--surface-alt);
  padding: 0.45rem 0.95rem;
  font-size: var(--fs-1);
  font-weight: 600;
  color: var(--accent);
  transition: background var(--transition), border-color var(--transition), color var(--transition);
}

.history-toolbar__toggle:hover {
  background: var(--surface-soft);
  border-color: var(--border-strong);
}

.history-toolbar__icon svg {
  width: 14px;
  height: 14px;
  fill: currentColor;
  transition: transform var(--transition);
}

.history-toolbar__toggle[data-dir="asc"] .history-toolbar__icon svg {
  transform: rotate(180deg);
}

.history-table__cell {
  padding: 16px 18px;
  vertical-align: top;
  background: var(--surface);
  border-right: 1px solid var(--border);
}

@media (max-width: 720px) {
  .history-toolbar {
    align-items: stretch;
  }

  .history-toolbar__group,
  .history-toolbar__group--status {
    margin-left: 0;
    width: 100%;
    justify-content: flex-start;
    flex-direction: column;
    align-items: flex-start;
    gap: 6px;
  }

  .history-toolbar__toggle {
    width: 100%;
    justify-content: center;
  }

  .history-select {
    width: 100%;
  }
}

.history-date {
  display: grid;
  gap: 4px;
}

.history-date__primary {
  font-weight: 600;
  color: var(--text);
}

.history-date__secondary {
  font-size: var(--fs-0);
  color: var(--muted);
}

.page-history .history-table table {
  width: 100%;
  border-collapse: collapse;
  border-spacing: 0;
}

.page-history .history-table thead th {
  background: var(--surface-alt);
  border-bottom: 1px solid var(--border);
  border-right: 1px solid var(--border);
  padding: 12px 18px;
}

.page-history .history-table thead th:last-child {
  border-right: none;
}

.page-history .history-table tbody tr {
  transition: background var(--transition);
}

.page-history .history-table tbody tr:nth-child(even) td {
  background: var(--surface-alt);
}

.page-history .history-table tbody tr:hover td {
  background: var(--surface-soft);
}

.page-history .history-table tbody tr td:last-child {
  border-right: none;
}

.page-history .history-table tbody tr:last-child td {
  border-bottom: none;
}

.history-models {
  display: flex;
  align-items: baseline;
  gap: 8px;
  flex-wrap: wrap;
  font-weight: 600;
}

.history-models__vs {
  font-size: var(--fs-0);
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--muted);
}

.history-blinds {
  font-family: var(--font-mono);
  font-weight: 600;
}

.history-status {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 0.25rem 0.7rem;
  border-radius: 999px;
  font-size: var(--fs-0);
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  background: var(--surface-alt);
  color: var(--muted);
}

.history-status__dot {
  width: 8px;
  height: 8px;
  border-radius: 999px;
  background: currentColor;
}

.history-status--live {
  background: rgba(34, 197, 94, 0.14);
  color: #15803d;
}

.history-status--done {
  background: rgba(17, 24, 39, 0.12);
  color: #1f2937;
}

:root[data-theme='dark'] .history-status--done,
:root.theme-dark .history-status--done {
  background: rgba(148, 163, 184, 0.22);
  color: #e2e8f0;
}

.history-status--mobile {
  display: none;
}

.history-table__actions {
  text-align: right;
}

.history-actions {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: flex-end;
}

.history-actions .pill {
  flex: 0 0 auto;
}

.page-history .pill.accent {
  background: linear-gradient(135deg, #111827 0%, #1f2937 100%);
  color: var(--accent-contrast);
  border-color: rgba(15, 23, 42, 0.22);
  box-shadow: 0 12px 26px rgba(15, 23, 42, 0.22);
}

.page-history .pill.accent:hover {
  background: linear-gradient(135deg, #0f172a 0%, #111827 100%);
}

.history-table__cell--empty {
  text-align: center;
  padding: 36px 18px;
  color: var(--muted);
  font-style: italic;
}

@media (max-width: 720px) {
  .history-status--mobile {
    display: inline-flex;
  }

  .history-status--desktop {
    display: none;
  }

  .page-history .history-table thead th.history-col-ended,
  .page-history .history-table thead th.history-col-blinds,
  .page-history .history-table thead th.history-col-start,
  .page-history .history-table thead th.history-col-pairs,
  .page-history .history-table tbody td.history-col-ended,
  .page-history .history-table tbody td.history-col-blinds,
  .page-history .history-table tbody td.history-col-start,
  .page-history .history-table tbody td.history-col-pairs {
    display: none;
  }

  .history-actions {
    justify-content: flex-start;
  }

  .history-table__actions {
    text-align: left;
  }
}

/* ---------- Reduced motion ------------------------------------------ */

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

/* ---------- Replay 2.0 layout ------------------------------------- */
.replay-page {
  background: var(--page-bg);
}

.replay-page .page-content {
  padding-top: 72px;
}

.replay-intro-card {
  display: grid;
  gap: 20px;
}

.replay-intro {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 18px;
}

.replay-intro__field {
  display: grid;
  gap: 8px;
  min-width: 220px;
}

.replay-intro__downloads {
  display: grid;
  gap: 6px;
}

.replay-intro__downloads-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.replay-intro__players {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  margin-left: auto;
}

.replay-intro__meta {
  font-size: var(--fs-1);
  color: var(--muted);
  font-weight: 500;
}
.replay-intro__bluffs {
  flex: 1 1 100%;
  border-top: 1px solid var(--border);
  padding-top: 12px;
}

.replay-bluff-heading {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0 0 12px;
}

.replay-bluff-table {
  width: 100%;
  border-collapse: collapse;
  font-size: var(--fs-1);
}

.replay-bluff-table th,
.replay-bluff-table td {
  padding: 6px 8px;
  text-align: left;
  border-bottom: 1px solid var(--border);
}

.replay-bluff-table th {
  color: var(--muted);
  font-weight: 600;
}

.replay-bluff-tags {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.replay-bluff-pill {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  border-radius: var(--radius-pill);
  background: var(--surface-alt);
  font-size: 0.75rem;
  color: var(--muted);
}


.replay-layout {
  display: flex;
  justify-content: center;
}

.card--stage {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 32px;
  padding: 32px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
  overflow: hidden;
}

:root[data-theme='dark'] .card--stage,
:root.theme-dark .card--stage {
  background: radial-gradient(140% 140% at 50% -20%, rgba(96, 165, 250, 0.15) 0%, rgba(27, 40, 64, 0.92) 42%, rgba(9, 14, 26, 0.94) 100%);
  border: 1px solid rgba(92, 126, 194, 0.52);
  box-shadow: 0 36px 92px rgba(2, 8, 22, 0.75);
}

.card--stage::before {
  display: none;
}

.card--stage > * {
  position: relative;
  z-index: 1;
}

.stage-toolbar {
  display: grid;
  gap: 24px;
}

@media (min-width: 1080px) {
  .stage-toolbar {
    grid-template-columns: minmax(0, 7fr) minmax(260px, 3fr);
    align-items: stretch;
  }
}

.stage-controls {
  display: grid;
  gap: 18px;
  padding: 22px 24px;
  border-radius: var(--radius-lg);
  border: 1px solid rgba(148, 163, 184, 0.24);
  background: rgba(255, 255, 255, 0.9);
  box-shadow: 0 16px 34px rgba(15, 23, 42, 0.12);
  backdrop-filter: blur(6px);
}

:root[data-theme='dark'] .stage-controls,
:root.theme-dark .stage-controls {
  background: linear-gradient(180deg, rgba(23, 35, 57, 0.9) 0%, rgba(14, 22, 38, 0.92) 100%);
  border: 1px solid rgba(92, 126, 194, 0.5);
  box-shadow: 0 24px 52px rgba(2, 8, 22, 0.65);
}

@media (min-width: 720px) {
  .stage-controls {
    padding: 24px 28px;
  }
}

@media (max-width: 640px) {
  .stage-controls {
    background: var(--surface);
    border: 1px solid var(--border);
    box-shadow: none;
    backdrop-filter: none;
  }
  :root[data-theme='dark'] .stage-controls,
  :root.theme-dark .stage-controls {
    background: var(--surface);
    border-color: var(--border);
    box-shadow: none;
    backdrop-filter: none;
  }
}

.stage-controls__primary {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.stage-controls__status {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.stage-controls__label {
  font-size: var(--fs-0);
  letter-spacing: 0.16em;
  text-transform: uppercase;
  font-weight: 600;
  color: var(--muted);
}

.stage-controls__secondary {
  display: grid;
  gap: 16px;
}

@media (min-width: 720px) {
  .stage-controls__secondary {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

.stage-control {
  padding: 18px 20px;
  border-radius: var(--radius-md);
  border: 1px solid rgba(148, 163, 184, 0.18);
  background: rgba(255, 255, 255, 0.94);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.65);
}

:root[data-theme='dark'] .stage-control,
:root.theme-dark .stage-control {
  background: rgba(24, 37, 62, 0.88);
  border: 1px solid rgba(103, 139, 207, 0.52);
  box-shadow: inset 0 1px 0 rgba(173, 205, 255, 0.14);
}

.stage-control--timeline {
  grid-column: 1 / -1;
  padding: 20px 22px;
}

.stage-controls__status .pill {
  padding: 0.35rem 0.9rem;
  font-size: var(--fs-0);
}

.stage-summary {
  display: grid;
  gap: 18px;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  padding: 22px 24px;
  border-radius: var(--radius-lg);
  border: 1px solid rgba(148, 163, 184, 0.2);
  background: rgba(248, 250, 252, 0.72);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.7);
}

:root[data-theme='dark'] .stage-summary,
:root.theme-dark .stage-summary {
  background: linear-gradient(180deg, rgba(21, 32, 52, 0.88) 0%, rgba(14, 22, 36, 0.88) 100%);
  border: 1px solid rgba(98, 132, 202, 0.48);
  box-shadow: inset 0 1px 0 rgba(173, 205, 255, 0.12);
}

.stage-summary__item {
  display: grid;
  gap: 6px;
}

.stage-summary__label {
  font-size: var(--fs-0);
  letter-spacing: 0.16em;
  text-transform: uppercase;
  font-weight: 600;
}

.stage-summary__value {
  font-family: var(--font-display);
  font-size: var(--fs-3);
  font-weight: 600;
  color: var(--accent);
}

.stage-summary__item--log {
  grid-column: 1 / -1;
}

.stage-summary__value--log {
  font-family: var(--font-sans);
  font-size: var(--fs-1);
  font-weight: 500;
  color: var(--muted);
  line-height: 1.5;
  min-height: 1.5em;
}

.stage-table {
  display: grid;
  gap: 28px;
}

@media (min-width: 1080px) {
  .stage-table {
    grid-template-columns: minmax(260px, 1fr) minmax(340px, 1.35fr) minmax(260px, 1fr);
    align-items: stretch;
  }
}

.stage-seat {
  min-height: 100%;
}

.seat-card {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 16px;
  padding: 24px;
  border-radius: var(--radius-lg);
  border: 1px solid rgba(148, 163, 184, 0.2);
  background: rgba(255, 255, 255, 0.96);
  box-shadow: 0 22px 44px rgba(15, 23, 42, 0.12);
  transition: transform 180ms ease, box-shadow 180ms ease, border-color 180ms ease;
}

:root[data-theme='dark'] .seat-card,
:root.theme-dark .seat-card {
  background: linear-gradient(180deg, rgba(20, 30, 50, 0.94) 0%, rgba(11, 18, 32, 0.94) 100%);
  border: 1px solid rgba(96, 134, 204, 0.55);
  box-shadow: 0 30px 64px rgba(2, 8, 22, 0.72);
}

.seat-card--active {
  transform: translateY(-6px);
  border-color: rgba(34, 197, 94, 0.4);
  box-shadow: 0 26px 52px rgba(34, 197, 94, 0.2);
}

.seat-card--winner {
  border-color: rgba(250, 204, 21, 0.6);
  box-shadow: 0 0 0 2px rgba(250, 204, 21, 0.3), 0 28px 56px rgba(250, 204, 21, 0.2);
}

.seat-card__header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
  order: 0;
}

.seat-card__identity {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.seat-card__role {
  font-size: var(--fs-0);
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--muted);
  font-weight: 600;
}

.seat-card__name {
  font-family: var(--font-display);
  font-size: var(--fs-3);
  color: var(--accent);
}

.seat-card__dealer {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: linear-gradient(135deg, #0f172a 0%, #1f2937 100%);
  color: #f8fafc;
  font-weight: 600;
  font-size: var(--fs-1);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.18), 0 12px 24px rgba(15, 23, 42, 0.22);
}

.seat-card__cards {
  order: 1;
  display: grid;
  gap: 12px;
  justify-items: stretch;
}

.seat-card__cards .cards {
  justify-content: center;
}

.seat-card[data-seat="sb"] .seat-card__cards .cards {
  justify-content: flex-start;
}

.seat-card[data-seat="bb"] .seat-card__cards .cards {
  justify-content: flex-end;
}

.seat-card__cards #sb_hole,
.seat-card__cards #bb_hole {
  margin-top: 0;
}

.seat-card__cards-text {
  font-family: var(--font-mono);
  font-size: var(--fs-1);
  color: var(--muted);
  text-align: center;
}

.seat-card[data-seat="sb"] .seat-card__cards-text {
  text-align: left;
}

.seat-card[data-seat="bb"] .seat-card__cards-text {
  text-align: right;
}

.seat-card__stacks {
  order: 2;
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  align-items: baseline;
  justify-content: space-between;
  font-family: var(--font-mono);
  font-size: var(--fs-1);
  color: var(--muted);
}

.seat-card__stack {
  font-size: var(--fs-2);
  font-weight: 600;
  color: var(--accent);
}

.seat-card__delta {
  font-size: var(--fs-1);
}

.seat-card__delta.positive,
.seat-card__ev-delta.positive {
  color: #15803d;
}

.seat-card__delta.negative,
.seat-card__ev-delta.negative {
  color: #b91c1c;
}

.seat-card__ev {
  order: 3;
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 16px 18px;
  border-radius: var(--radius-md);
  border: 1px solid rgba(148, 163, 184, 0.18);
  background: rgba(248, 250, 252, 0.82);
}

:root[data-theme='dark'] .seat-card__ev,
:root.theme-dark .seat-card__ev {
  background: linear-gradient(180deg, rgba(23, 35, 57, 0.88) 0%, rgba(14, 22, 38, 0.88) 100%);
  border: 1px solid rgba(100, 138, 208, 0.45);
  box-shadow: inset 0 1px 0 rgba(173, 205, 255, 0.12);
}

.seat-card__ev-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
}

.seat-card__ev-title {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.seat-card__ev-title > span:first-child {
  font-size: var(--fs-0);
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--muted);
  font-weight: 600;
}

.seat-card__ev-amount {
  font-family: var(--font-mono);
  font-size: var(--fs-2);
  font-weight: 600;
  color: var(--accent);
}

.ev-meter {
  --ev-pct: 50%;
  position: relative;
  width: 100%;
  height: 10px;
  border-radius: 999px;
  background: rgba(148, 163, 184, 0.22);
  overflow: hidden;
}

.ev-meter__fill {
  position: absolute;
  inset: 0;
  width: var(--ev-pct);
  border-radius: inherit;
  background: linear-gradient(135deg, #16a34a 0%, #0f766e 100%);
  transition: width 200ms ease;
}

.seat-card[data-seat="bb"] .ev-meter__fill {
  background: linear-gradient(135deg, #f97316 0%, #fb923c 100%);
}

.seat-card__ev-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-family: var(--font-mono);
  font-size: var(--fs-1);
  color: var(--muted);
}

.stage-table__center {
  display: grid;
  gap: 24px;
  align-content: center;
  justify-items: center;
  padding: 0 12px;
  min-height: calc(var(--card-h) + 160px);
}

.board-display {
  display: grid;
  gap: 12px;
  justify-items: center;
}

.board-display__surface {
  position: relative;
  width: min(640px, 100%);
  padding: 28px 32px;
  border-radius: 26px;
  border: 1px solid rgba(148, 163, 184, 0.22);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.95) 0%, rgba(243, 246, 252, 0.92) 100%);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.7), 0 26px 52px rgba(15, 23, 42, 0.18);
  min-height: calc((var(--card-h) * 2) + 110px);
}

:root[data-theme='dark'] .board-display__surface,
:root.theme-dark .board-display__surface {
  background: radial-gradient(120% 160% at 50% -28%, rgba(91, 143, 255, 0.32) 0%, rgba(40, 58, 94, 0) 55%), linear-gradient(180deg, rgba(18, 30, 52, 0.95) 0%, rgba(9, 16, 30, 0.95) 100%);
  border: 1px solid rgba(102, 140, 214, 0.5);
  box-shadow: inset 0 1px 0 rgba(173, 205, 255, 0.16), 0 32px 72px rgba(2, 8, 22, 0.72);
}

.board-display__cards {
  position: relative;
  z-index: 1;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  align-content: center;
  column-gap: 18px;
  row-gap: 24px;
  width: min(100%, calc((var(--card-w) * 3) + (18px * 2)));
  margin: 0 auto;
}

.board-display__cards::after {
  content: none;
}

.board-display__label {
  font-family: var(--font-mono);
  font-size: var(--fs-1);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
}

@media (max-width: 1200px) {
  .card--stage {
    width: 100%;
    padding: 28px 24px;
    gap: 28px;
  }

  .stage-table {
    gap: 24px;
  }

  .stage-table__center {
    padding: 0;
  }

  .board-display__surface {
    padding: 24px 26px;
    min-height: calc((var(--card-h) * 2) + 90px);
  }
}

@media (max-width: 900px) {
  .replay-layout {
    width: 100%;
    justify-content: center;
  }

  .card--stage {
    width: 100%;
    padding: 24px 20px;
    gap: 24px;
  }

  .stage-table {
    gap: 20px;
  }

  .board-display__surface {
    padding: 20px 18px;
  }

  .board-display__cards {
    column-gap: 14px;
    row-gap: 20px;
    width: min(100%, calc((var(--card-w) * 3) + (14px * 2)));
  }
}

.stage-table__caption {
  width: min(460px, 100%);
  text-align: center;
  font-family: var(--font-display);
  font-size: var(--fs-2);
  font-weight: 600;
  color: var(--accent);
  padding: 18px 22px;
  border-radius: var(--radius-md);
  border: 1px solid rgba(148, 163, 184, 0.18);
  background: rgba(248, 250, 252, 0.9);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.7);
}

:root[data-theme='dark'] .stage-table__caption,
:root.theme-dark .stage-table__caption {
  background: linear-gradient(180deg, rgba(23, 35, 57, 0.9) 0%, rgba(14, 22, 36, 0.9) 100%);
  border: 1px solid rgba(100, 138, 208, 0.48);
  box-shadow: inset 0 1px 0 rgba(173, 205, 255, 0.14);
}

.stage-insights {
  display: grid;
  gap: 16px;
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

@media (max-width: 1024px) {
  .stage-insights {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 640px) {
  .stage-insights {
    grid-template-columns: minmax(0, 1fr);
  }
}

.insight {
  display: grid;
  gap: 6px;
  padding: 16px 18px;
  border-radius: var(--radius-md);
  border: 1px solid rgba(148, 163, 184, 0.22);
  background: rgba(255, 255, 255, 0.88);
  min-height: 80px;
}

:root[data-theme='dark'] .insight,
:root.theme-dark .insight {
  background: linear-gradient(180deg, rgba(21, 32, 52, 0.88) 0%, rgba(14, 22, 36, 0.9) 100%);
  border: 1px solid rgba(98, 132, 202, 0.45);
}

:root[data-theme='dark'] .board-display__label,
:root.theme-dark .board-display__label {
  color: rgba(191, 205, 241, 0.88);
}

:root[data-theme='dark'] .stage-controls__label,
:root.theme-dark .stage-controls__label {
  color: rgba(188, 202, 236, 0.82);
}

:root[data-theme='dark'] .stage-summary__label,
:root.theme-dark .stage-summary__label {
  color: rgba(185, 199, 233, 0.8);
}

:root[data-theme='dark'] .stage-summary__value,
:root.theme-dark .stage-summary__value {
  color: #9cc5ff;
}

:root[data-theme='dark'] .seat-card__cards-text,
:root.theme-dark .seat-card__cards-text {
  color: rgba(191, 205, 241, 0.78);
}

:root[data-theme='dark'] .seat-card__stacks,
:root.theme-dark .seat-card__stacks {
  color: rgba(191, 205, 241, 0.78);
}

:root[data-theme='dark'] .ev-meter,
:root.theme-dark .ev-meter {
  background: rgba(82, 118, 186, 0.38);
}

:root[data-theme='dark'] .ev-meter__fill,
:root.theme-dark .ev-meter__fill {
  box-shadow: 0 0 16px rgba(37, 99, 235, 0.45);
}

:root[data-theme='dark'] .seat-card[data-seat="bb"] .ev-meter__fill,
:root.theme-dark .seat-card[data-seat="bb"] .ev-meter__fill {
  box-shadow: 0 0 16px rgba(249, 115, 22, 0.38);
}

.table .pill.accent {
  font-weight: 600;
  letter-spacing: 0.02em;
}

:root[data-theme='dark'] .table .pill.accent,
:root.theme-dark .table .pill.accent {
  background: linear-gradient(135deg, #4f83ff 0%, #6366f1 100%);
  color: #f8fbff;
  border-color: rgba(110, 149, 219, 0.52);
  box-shadow: 0 20px 38px rgba(29, 63, 135, 0.55);
}

.insight.is-empty {
  opacity: 0.65;
}

.insight__label {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: var(--fs-0);
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--muted);
  font-weight: 600;
}

.insight__label .inline-tip {
  margin-left: 0;
}

.insight__value {
  font-family: var(--font-mono);
  font-size: var(--fs-2);
  font-weight: 600;
  color: var(--accent);
}

.stage-banner {
  text-align: center;
  font-family: var(--font-display);
  font-size: var(--fs-2);
  color: var(--muted);
  min-height: 1.6em;
}

.replay-controls {
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.replay-controls__buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.replay-controls__buttons .pill {
  min-width: 96px;
  justify-content: center;
}

.replay-control-btn {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  transition: transform 160ms ease, box-shadow 160ms ease;
}

.replay-control-btn::after {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: radial-gradient(circle at 50% 50%, rgba(255, 255, 255, 0.5) 0%, rgba(255, 255, 255, 0) 65%);
  opacity: 0;
  transform: scale(0.6);
  transition: opacity 320ms ease, transform 320ms ease;
  pointer-events: none;
  mix-blend-mode: screen;
}

.replay-control-btn.is-pressing {
  transform: translateY(1px) scale(0.96);
  box-shadow: 0 14px 28px rgba(15, 23, 42, 0.18);
}

:root[data-theme='dark'] .replay-control-btn.is-pressing,
:root.theme-dark .replay-control-btn.is-pressing {
  box-shadow: 0 14px 28px rgba(2, 6, 16, 0.55);
}

.replay-control-btn.did-press::after {
  opacity: 0.55;
  transform: scale(1.25);
}

@media (prefers-reduced-motion: reduce) {
  .replay-control-btn,
  .replay-control-btn::after {
    transition: none !important;
  }
}

.replay-controls__row {
  display: grid;
  gap: 18px;
}

@media (min-width: 720px) {
  .replay-controls__row {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

.replay-control {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 18px 20px;
  border-radius: var(--radius-md);
  border: 1px solid rgba(148, 163, 184, 0.24);
  background: rgba(255, 255, 255, 0.92);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.6);
}

:root[data-theme='dark'] .replay-control,
:root.theme-dark .replay-control {
  background: rgba(13, 20, 33, 0.88);
  border: 1px solid rgba(71, 89, 128, 0.5);
  box-shadow: inset 0 1px 0 rgba(141, 183, 255, 0.08);
}

.replay-control__label {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  font-size: var(--fs-1);
  color: var(--muted);
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.replay-control__range {
  --progress: 0.0;
  appearance: none;
  width: 100%;
  height: 8px;
  border-radius: 999px;
  background: linear-gradient(90deg, #16a34a 0%, #16a34a calc(var(--progress) * 100%), rgba(148, 163, 184, 0.32) calc(var(--progress) * 100%), rgba(148, 163, 184, 0.32) 100%);
  outline: none;
  accent-color: #16a34a;
}

:root[data-theme='dark'] .replay-control__range,
:root.theme-dark .replay-control__range {
  background: linear-gradient(90deg, #4ade80 0%, #4ade80 calc(var(--progress) * 100%), rgba(71, 89, 128, 0.5) calc(var(--progress) * 100%), rgba(71, 89, 128, 0.5) 100%);
  accent-color: #4ade80;
}

.replay-control__range::-webkit-slider-runnable-track {
  appearance: none;
  height: 8px;
  border-radius: 999px;
  background: linear-gradient(90deg, #16a34a 0%, #16a34a calc(var(--progress) * 100%), rgba(148, 163, 184, 0.32) calc(var(--progress) * 100%), rgba(148, 163, 184, 0.32) 100%);
}

.replay-control__range::-webkit-slider-thumb {
  appearance: none;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #16a34a;
  box-shadow: 0 0 0 4px rgba(22, 163, 74, 0.18);
  border: none;
  margin-top: -5px;
}

.replay-control__range::-moz-range-track {
  height: 8px;
  border-radius: 999px;
  background: rgba(148, 163, 184, 0.32);
}

.replay-control__range::-moz-range-progress {
  height: 8px;
  border-radius: 999px;
  background: #16a34a;
}

.replay-control__range::-moz-range-thumb {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #16a34a;
  border: none;
  box-shadow: 0 0 0 4px rgba(22, 163, 74, 0.18);
}

.replay-control__hint {
  align-self: flex-end;
  font-family: var(--font-mono);
  font-size: var(--fs-1);
  color: var(--muted);
}

.replay-control--timeline {
  gap: 14px;
}

.replay-control__timeline-meta {
  display: flex;
  justify-content: space-between;
  font-size: var(--fs-1);
  color: var(--muted);
}

@media (max-width: 1080px) {
  .card--stage {
    padding: 28px 24px;
  }

  .stage-toolbar {
    grid-template-columns: minmax(0, 1fr);
  }
}

@media (max-width: 960px) {
  .stage-table {
    grid-template-columns: minmax(0, 1fr);
    gap: 24px;
  }
}

@media (max-width: 540px) {
  .stage-table {
    gap: 18px;
  }
  .seat-card {
    padding: 20px;
    gap: 12px;
  }
  .seat-card__header {
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
  }
  .seat-card__name {
    font-size: clamp(1.35rem, 6vw, var(--fs-3));
  }
  .seat-card__dealer {
    align-self: flex-start;
  }
  .seat-card__cards {
    justify-items: center;
  }
  .seat-card__cards .cards {
    justify-content: center !important;
    flex-wrap: nowrap;
    gap: 12px;
  }
  .seat-card__cards-text {
    text-align: center;
  }
  .seat-card__stacks {
    gap: 10px;
    justify-content: space-between;
  }
  .seat-card__ev {
    padding: 12px;
    border-radius: var(--radius-md);
  }
  .seat-card__ev-head {
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
  }
  .seat-card__ev-meta {
    flex-direction: column;
    align-items: flex-start;
    gap: 4px;
  }
  .cardx .suit.main {
    display: none;
  }
  .cardx .num-box.bottom {
    display: none;
  }
  .cardx .num-box.top {
    top: 50%;
    left: 50%;
    padding: 0;
    transform: translate(-50%, -55%);
    font-size: clamp(1.4rem, 12vw, 2rem);
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    line-height: 1;
  }
  .cardx .num-box.top.suit::after {
    display: block;
    font-size: clamp(0.85rem, 7vw, 1.2rem);
    content: var(--card-glyph, '');
  }
}

  .board-display__surface {
    padding: 24px;
  }
}

@media (max-width: 720px) {
  .stage-controls {
    padding: 20px;
  }

  .stage-summary {
    padding: 20px;
  }

  .stage-table__center {
    order: -1;
    width: 100%;
    min-height: calc(var(--card-h) + 140px);
  }

  .stage-table__caption {
    width: 100%;
  }
}

