@import url('../community/coin-flip.css');
/* mudwater.gg design system: 60% near-black, 30% steel/graphite + off-white, 10% red.
   Minimum text size is 16px everywhere. */
@font-face { font-family: Syne; src: url(/assets/fonts/syne.woff2) format('woff2'); font-weight: 500 800; font-display: swap; }
@font-face { font-family: 'Space Mono'; src: url(/assets/fonts/space-mono-400.woff2) format('woff2'); font-weight: 400; font-display: swap; }
@font-face { font-family: 'Space Mono'; src: url(/assets/fonts/space-mono-700.woff2) format('woff2'); font-weight: 700; font-display: swap; }

:root {
  --bg: #0b0c0e; --raise: #101215; --panel: #14161a; --panel-2: #1a1d22; --panel-3: #22262c;
  --line: #23272e; --line-2: #323841;
  --steel: #8a93a0; --text-2: #b9c0ca; --text: #eceef1;
  --red: #e5484d; --red-hi: #ff5f64; --red-soft: rgba(229, 72, 77, .14);
  /* Board sides only: the viewer is always blue. Saturated and paired with labels for colour-blind players. */
  --you: #2f80ff; --opp: #ff2e3c;
  --radius: 16px; --radius-sm: 10px;
  --display: Syne, system-ui, sans-serif;
  --mono: 'Space Mono', ui-monospace, Menlo, monospace;
  --sans: system-ui, -apple-system, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  color-scheme: dark;
}
*, *::before, *::after { box-sizing: border-box; }
* { margin: 0; }
html { -webkit-text-size-adjust: 100%; }
body { min-height: 100vh; display: flex; flex-direction: column; background: var(--bg); color: var(--text); font: 16px/1.5 var(--sans); -webkit-font-smoothing: antialiased; }
img, svg { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
:focus-visible { outline: 2px solid var(--red); outline-offset: 2px; }
[hidden] { display: none !important; }
h1, h2, h3 { font-family: var(--display); font-weight: 700; letter-spacing: -.02em; line-height: 1.1; }
h1 { font-size: clamp(32px, 4vw, 48px); }
h2 { font-size: 24px; }
h3 { font-size: 18px; }
main { flex: 1; width: 100%; max-width: 1280px; margin: 0 auto; padding: 32px 24px 64px; }
.skip { position: absolute; left: -999px; top: 8px; z-index: 100; background: var(--red); color: #fff; padding: 8px 14px; border-radius: 8px; }
.skip:focus { left: 8px; }
.i { width: 20px; height: 20px; flex: none; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.i-lg { width: 28px; height: 28px; }
.mono { font-family: var(--mono); }
.muted { color: var(--steel); }
.red { color: var(--red); }
.nowrap { white-space: nowrap; }
.break { overflow-wrap: anywhere; }
.sr { position: absolute; left: 0; top: 0; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* Shell */
.topbar { position: sticky; top: 0; z-index: 50; background: rgba(11, 12, 14, .84); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); border-bottom: 1px solid var(--line); }
.topbar-in { max-width: 1280px; height: 64px; margin: auto; padding: 0 24px; display: flex; align-items: center; gap: 24px; }
.brand { display: flex; align-items: center; gap: 10px; flex: none; }
.brand img { width: 216px; height: auto; }
.nav { display: flex; gap: 4px; margin: 0 auto; }
.nav a { display: flex; align-items: center; gap: 8px; height: 40px; padding: 0 14px; border-radius: var(--radius-sm); color: var(--steel); font-weight: 600; transition: color .15s, background .15s; }
.nav a:hover { color: var(--text); background: var(--panel); }
.nav a[aria-current=page] { color: var(--text); background: var(--panel-2); }
.nav a[aria-current=page] .i { color: var(--red); }
.nav .narrow { display: none; }
.nav a[aria-disabled=true] { opacity: .55; cursor: default; }
.nav a[aria-disabled=true]:hover { color: var(--steel); background: none; }
.nav .soon { padding: 0 8px; border-radius: 99px; background: var(--panel-3); color: var(--text-2); font: 700 16px var(--mono); }
.nav a:not([aria-disabled]) .soon { display: none; }
.account { display: flex; align-items: center; gap: 8px; flex: none; min-width: 120px; justify-content: flex-end; }
.activity-pill { display: inline-flex; align-items: center; gap: 8px; height: 36px; padding: 0 12px; border-radius: 99px; background: var(--red-soft); color: var(--red-hi); font-weight: 700; white-space: nowrap; }
.account-menu { position: relative; }
.account-menu summary { list-style: none; display: flex; align-items: center; gap: 8px; height: 40px; padding: 0 8px 0 4px; border: 1px solid var(--line); border-radius: 99px; cursor: pointer; }
.account-menu summary::-webkit-details-marker { display: none; }
.account-menu summary:hover { border-color: var(--line-2); }
.account-name { max-width: 140px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 600; }
.account-dropdown { position: absolute; right: 0; top: calc(100% + 8px); min-width: 220px; padding: 8px; background: var(--panel); border: 1px solid var(--line-2); border-radius: 14px; box-shadow: 0 16px 40px #000c; display: grid; gap: 2px; }
.account-dropdown a, .account-dropdown button { display: flex; align-items: center; gap: 10px; width: 100%; padding: 10px 12px; border-radius: 8px; background: none; border: 0; text-align: left; color: var(--text-2); }
.account-dropdown a:hover, .account-dropdown button:hover { background: var(--panel-2); color: var(--text); }
.account-dropdown p:empty { display: none; }
footer { border-top: 1px solid var(--line); }
.footer-in { max-width: 1280px; margin: auto; padding: 28px 24px; display: flex; flex-wrap: wrap; gap: 16px 32px; align-items: center; justify-content: space-between; color: var(--steel); }
.footer-in nav { display: flex; flex-wrap: wrap; gap: 8px 24px; }
.footer-in a:hover { color: var(--text); }
.footer-in .social { gap: 8px; }
.footer-in .social a { display: grid; place-items: center; width: 44px; height: 44px; border-radius: 12px; border: 1px solid var(--line-2); }
.footer-in .social .i { width: 22px; height: 22px; }
.footer-brand { display: flex; align-items: center; gap: 10px; color: var(--text-2); }
.footer-brand img { width: 28px; height: 28px; }

/* Between the phone tab bar and full desktop, the header drops icons, the Soon badge and then names to fit. */
@media (min-width: 861px) and (max-width: 1200px) {
  .nav a { padding: 0 10px; }
  .nav a > .i, .nav .soon { display: none; }
}
@media (min-width: 861px) and (max-width: 1000px) {
  .account-name, .activity-pill span { display: none; }
}

@media (max-width: 860px) {
  /* backdrop-filter would make the header the containing block of the fixed tab bar. */
  .topbar { backdrop-filter: none; -webkit-backdrop-filter: none; background: var(--bg); }
  .topbar-in { gap: 12px; padding: 0 16px; height: 60px; }
  .brand img { width: min(168px, calc(100vw - 164px)); height: auto; }
  .ready-banner { top: 61px; padding: 8px 16px; }
  .ready-banner .grow span { display: none; }
  .ready-banner .btn .i { display: none; }
  .step-panel { grid-template-columns: auto minmax(0, 1fr); }
  .step-panel > :last-child:not(.grow) { grid-column: 1 / -1; justify-self: start; }
  .nav { position: fixed; z-index: 60; left: 0; right: 0; bottom: 0; margin: 0; gap: 0; justify-content: space-around; padding: 6px 4px calc(6px + env(safe-area-inset-bottom)); background: rgba(11, 12, 14, .95); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); border-top: 1px solid var(--line); }
  .nav a { flex: 1; min-width: 0; height: auto; flex-direction: column; gap: 2px; padding: 6px 2px; }
  .nav .soon { display: none; }
  .nav a:hover { background: none; }
  .nav a[aria-current=page] { background: none; }
  .nav .wide { display: none; }
  .nav .narrow { display: inline; }
  body { padding-bottom: calc(68px + env(safe-area-inset-bottom)); }
  main { padding: 20px 16px 48px; }
  .account { min-width: 0; margin-left: auto; }
  .account-name, .activity-pill span { display: none; }
  .activity-pill { padding: 0 10px; }
  .footer-in { padding: 24px 16px; }
}

/* Primitives */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 44px; padding: 0 18px; border-radius: var(--radius-sm); border: 1px solid var(--line-2); background: var(--panel-2); color: var(--text); font-weight: 700; white-space: nowrap; transition: background .15s, border-color .15s, transform .1s; }
.btn:hover { background: var(--panel-3); border-color: #424a55; }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: .45; cursor: default; transform: none; }
.btn.primary { background: var(--red); border-color: var(--red); color: #fff; }
.btn.primary:hover { background: var(--red-hi); border-color: var(--red-hi); }
.btn.ghost { background: transparent; border-color: transparent; color: var(--text-2); }
.btn.ghost:hover { background: var(--panel); color: var(--text); }
.btn.danger { color: var(--red-hi); }
.btn.sm { min-height: 36px; padding: 0 12px; }
.btn.icon { width: 44px; padding: 0; }
.btn.icon.sm { width: 36px; }
.btn.block { width: 100%; }
.link { display: inline-flex; align-items: center; gap: 6px; color: var(--steel); font-weight: 600; }
.link:hover { color: var(--text); }
.player-link { font-weight: 600; }
.player-link:hover { color: var(--red-hi); }
input, select, textarea { min-height: 44px; width: 100%; padding: 10px 14px; background: var(--raise); border: 1px solid var(--line-2); border-radius: var(--radius-sm); }
textarea { min-height: 96px; resize: vertical; }
input::placeholder, textarea::placeholder { color: var(--steel); }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--steel); }
select { appearance: none; -webkit-appearance: none; padding-right: 40px; background: var(--raise) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%238a93a0' stroke-width='2'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E") no-repeat right 12px center / 18px; }
label { display: grid; gap: 6px; color: var(--text-2); font-weight: 600; }
.field-row { display: flex; flex-wrap: wrap; gap: 12px; align-items: end; }
.field-row > * { flex: 1 1 180px; }
.field-row > .btn { flex: 0 0 auto; }
.search { position: relative; }
.search .i { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); color: var(--steel); pointer-events: none; }
.search input { padding-left: 44px; }
.panel { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; }
.panel.flush { padding: 0; overflow: hidden; }
.section { display: grid; grid-template-columns: minmax(0, 1fr); gap: 16px; align-content: start; }
.section-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 36px; }
.section-head h2 { display: flex; align-items: center; gap: 10px; font-size: 20px; }
.section-head h2 .i { color: var(--steel); }
.kicker { font: 700 16px var(--mono); text-transform: uppercase; letter-spacing: .06em; color: var(--steel); }
.page-head { display: flex; flex-wrap: wrap; align-items: end; justify-content: space-between; gap: 16px; margin-bottom: 24px; }
.page-head .count { font: 700 16px var(--mono); color: var(--steel); }
.chip { display: inline-flex; align-items: center; gap: 6px; height: 30px; padding: 0 10px; border-radius: 99px; border: 1px solid var(--line-2); color: var(--text-2); font: 700 16px var(--mono); text-transform: uppercase; letter-spacing: .02em; white-space: nowrap; }
.chip.live { border-color: transparent; background: var(--red-soft); color: var(--red-hi); }
.chip.open { border-color: var(--text-2); color: var(--text); }
.chip.solid { background: var(--panel-3); border-color: transparent; }
.chip .i { width: 16px; height: 16px; }
.dot { width: 8px; height: 8px; border-radius: 50%; background: var(--steel); flex: none; }
.dot.live { background: var(--red); animation: pulse 1.8s infinite; }
.dot.on { background: #e8eaed; box-shadow: 0 0 0 3px rgba(232, 234, 237, .15); }
@keyframes pulse { 0% { box-shadow: 0 0 0 0 rgba(229, 72, 77, .55); } 70% { box-shadow: 0 0 0 7px rgba(229, 72, 77, 0); } 100% { box-shadow: 0 0 0 0 rgba(229, 72, 77, 0); } }
.avatar { width: 32px; height: 32px; flex: none; display: grid; place-items: center; border-radius: 50%; background: var(--panel-3); border: 1px solid var(--line-2); font: 700 16px var(--mono); color: var(--text-2); }
.avatar.lg { width: 72px; height: 72px; font-size: 28px; }
.avatar.me { background: var(--red); border-color: var(--red); color: #fff; }
.bar { height: 8px; border-radius: 99px; background: var(--panel-3); overflow: hidden; }
.bar > i { display: block; height: 100%; border-radius: inherit; background: var(--text-2); }
.bar.red > i { background: var(--red); }
.stat { display: grid; gap: 2px; }
.stat strong { font: 700 clamp(26px, 3vw, 34px)/1.1 var(--mono); letter-spacing: -.03em; }
.stat span { color: var(--steel); }
.stats-strip { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); border: 1px solid var(--line); border-radius: var(--radius); background: var(--panel); }
.stats-strip .stat { padding: 18px 20px; border-left: 1px solid var(--line); }
.stats-strip .stat:first-child { border-left: 0; }
.stats-strip .stat span { display: flex; align-items: center; gap: 8px; }
.tabs { display: flex; gap: 4px; padding: 4px; border: 1px solid var(--line); border-radius: 12px; background: var(--raise); overflow-x: auto; scrollbar-width: none; }
.tabs::-webkit-scrollbar { display: none; }
.tabs a, .tabs button { display: inline-flex; align-items: center; gap: 8px; min-height: 40px; padding: 0 14px; border: 0; border-radius: 9px; background: none; color: var(--steel); font-weight: 700; white-space: nowrap; }
.tabs a:hover, .tabs button:hover { color: var(--text); }
.tabs [aria-current=page], .tabs [aria-selected=true], .tabs [aria-pressed=true] { background: var(--panel-3); color: var(--text); }
.tabs [aria-current=page] .i, .tabs [aria-selected=true] .i { color: var(--red); }
.tabs .count { font: 700 16px var(--mono); color: var(--steel); }
.rows { display: grid; }
.row { display: flex; align-items: center; gap: 12px; min-height: 60px; padding: 10px 16px; border-top: 1px solid var(--line); }
.row:first-child { border-top: 0; }
a.row:hover, button.row:hover { background: var(--panel-2); }
.row .grow { flex: 1; min-width: 0; }
.row .grow > * { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.row .sub { display: block; color: var(--steel); }
.row .go { color: var(--steel); }
a.row:hover .go { color: var(--text); }
button.row { width: 100%; border: 0; border-top: 1px solid var(--line); background: none; text-align: left; }
.empty { display: grid; justify-items: center; gap: 12px; padding: 32px 20px; text-align: center; color: var(--steel); }
.empty .i-lg { color: var(--line-2); }
.status-line { min-height: 24px; color: var(--steel); }
.status-line:empty { display: none; }
.status-line[data-error=true] { color: var(--red-hi); }
.toast { position: fixed; z-index: 90; left: 50%; bottom: 24px; transform: translateX(-50%); max-width: min(560px, calc(100vw - 32px)); padding: 12px 18px; border-radius: 12px; background: var(--panel-3); border: 1px solid var(--line-2); box-shadow: 0 16px 40px #000c; }
.toast:empty { display: none; }
.toast[data-error=true] { border-color: var(--red); }
@media (max-width: 860px) { .toast { bottom: calc(84px + env(safe-area-inset-bottom)); } }
.sk { display: block; border-radius: 10px; background: linear-gradient(90deg, var(--panel) 0, var(--panel-2) 50%, var(--panel) 100%); background-size: 200% 100%; animation: sk 1.3s infinite linear; }
@keyframes sk { to { background-position: -200% 0; } }
.sk-line { height: 16px; }
.sk-btn { width: 120px; height: 40px; border-radius: 99px; }
.sk-num { width: 64px; height: 34px; }
.sk-title { height: 40px; }
.sk-card { height: 180px; border-radius: var(--radius); }
.w-40 { width: 40%; } .w-60 { width: 60%; }
.tbl { width: 100%; border-collapse: collapse; }
.tbl th { text-align: left; padding: 12px 16px; color: var(--steel); font: 700 16px var(--mono); text-transform: uppercase; border-bottom: 1px solid var(--line); white-space: nowrap; }
.tbl th.num, .tbl td.num { text-align: right; }
.tbl td { padding: 10px 16px; border-bottom: 1px solid var(--line); }
.tbl tr:last-child td { border-bottom: 0; }
.tbl tbody tr:hover { background: var(--panel-2); }
.tbl .num { font-family: var(--mono); }
.tbl th button { background: none; border: 0; padding: 0; color: inherit; font: inherit; text-transform: inherit; display: inline-flex; gap: 4px; align-items: center; }
.tbl th button[aria-sort] { color: var(--text); }
.who { display: flex; align-items: center; gap: 10px; min-width: 0; }
.who > span { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rank { width: 28px; font: 700 16px var(--mono); color: var(--steel); text-align: center; flex: none; }
.rank.top { color: var(--red); }
.wl { font: 700 16px var(--mono); white-space: nowrap; }
.wl .l { color: var(--steel); }
.result-chip { display: inline-grid; place-items: center; width: 32px; height: 32px; border-radius: 8px; font: 700 16px var(--mono); background: var(--panel-3); color: var(--steel); flex: none; }
.result-chip.win { background: var(--red-soft); color: var(--red-hi); }
.thumb { aspect-ratio: 300 / 416; width: 100%; height: auto; border-radius: 8px; object-fit: cover; background: var(--panel-2); }
dialog { margin: auto; padding: 0; border: 1px solid var(--line-2); border-radius: 20px; background: var(--panel); color: var(--text); box-shadow: 0 30px 80px #000; max-width: min(960px, calc(100vw - 24px)); max-height: calc(100vh - 24px); }
dialog::backdrop { background: rgba(0, 0, 0, .7); backdrop-filter: blur(4px); }
.dialog-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 16px 20px; border-bottom: 1px solid var(--line); }
.dialog-body { padding: 20px; display: grid; gap: 16px; }
#tip { overflow-wrap: anywhere; position: fixed; z-index: 120; max-width: min(280px, calc(100vw - 16px)); padding: 8px 12px; border-radius: 10px; background: #21252b; border: 1px solid var(--line-2); color: var(--text); font: 16px/1.35 var(--sans); box-shadow: 0 10px 30px #000b; pointer-events: none; opacity: 0; transition: opacity .12s; }
#tip.on { opacity: 1; }
[data-tip] { cursor: help; }
a[data-tip], button[data-tip] { cursor: pointer; }

/* Wallet chooser */
.wallet-chooser { width: min(440px, calc(100vw - 24px)); }
.wallet-options { display: grid; gap: 8px; }
.wallet-option { display: flex; align-items: center; gap: 12px; width: 100%; min-height: 52px; padding: 0 16px; border-radius: 12px; border: 1px solid var(--line-2); background: var(--panel-2); font-weight: 700; text-align: left; }
.wallet-option:hover { border-color: var(--steel); }
.wallet-option img { width: 28px; height: 28px; border-radius: 6px; }
.wallet-links { display: flex; flex-wrap: wrap; gap: 8px; }
.wallet-links a { display: inline-flex; align-items: center; gap: 6px; padding: 8px 12px; border: 1px solid var(--line-2); border-radius: 99px; }

/* Home */
.home { display: grid; grid-template-columns: minmax(0, 1fr); gap: 24px; }
.home-grid { display: grid; grid-template-columns: minmax(0, 1.65fr) minmax(0, 1fr); gap: 24px; align-items: start; }
.featured { position: relative; overflow: hidden; display: grid; gap: 18px; align-content: end; min-height: 320px; padding: 28px; border-radius: 20px; border: 1px solid var(--line); background: var(--panel); isolation: isolate; }
.featured-art { position: absolute; inset: 0; z-index: -1; display: flex; justify-content: flex-end; gap: 12px; padding: 24px; opacity: .55; }
.featured-art img { width: 30%; max-width: 170px; height: auto; align-self: center; border-radius: 10px; transform: rotate(6deg); box-shadow: 0 20px 40px #000c; }
.featured-art img:nth-child(2) { transform: rotate(-4deg) translateY(18px); }
.featured::after { content: ''; position: absolute; inset: 0; z-index: -1; background: linear-gradient(90deg, var(--panel) 30%, rgba(20, 22, 26, .72) 62%, rgba(20, 22, 26, .2)); }
.featured h2 { font-size: clamp(28px, 3.4vw, 40px); max-width: 15ch; }
.event-time { display: block; }
.facts { display: flex; flex-wrap: wrap; gap: 8px 18px; color: var(--text-2); }
.facts > span { display: inline-flex; align-items: center; gap: 8px; }
.facts .i { color: var(--steel); }
.featured .bar { max-width: 320px; }
.featured-foot { display: flex; flex-wrap: wrap; align-items: end; justify-content: space-between; gap: 16px; }
.slots { display: grid; gap: 8px; min-width: 200px; }
.slots strong { font: 700 22px var(--mono); }
.live-card { display: grid; grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr); align-items: center; gap: 10px; padding: 14px 16px; border-top: 1px solid var(--line); }
.live-card:first-child { border-top: 0; }
.live-card.result { grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr) 36px; }
.live-card.result .score { font-size: 16px; }
.live-card .side strong { overflow: hidden; text-overflow: ellipsis; }
.live-card:hover { background: var(--panel-2); }
.live-card .side { display: flex; align-items: center; gap: 8px; min-width: 0; font-weight: 600; }
.live-card .side span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.live-card .side.right { flex-direction: row-reverse; text-align: right; }
.score { font: 700 20px var(--mono); white-space: nowrap; }
.score .vs { color: var(--steel); padding: 0 6px; }
.meta-cards { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 14px; }
.meta-card { display: grid; gap: 8px; align-content: start; }
.meta-card .thumb-wrap { position: relative; }
.meta-card .rank-badge { position: absolute; left: 8px; top: 8px; display: grid; place-items: center; min-width: 30px; height: 30px; padding: 0 6px; border-radius: 8px; background: rgba(11, 12, 14, .86); font: 700 16px var(--mono); }
.meta-card:first-child .rank-badge { background: var(--red); }
.meta-card .name { font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.meta-card .nums { display: flex; justify-content: space-between; font: 700 16px var(--mono); color: var(--text-2); }
.meta-card:hover .thumb { outline: 2px solid var(--line-2); }
.pad { padding: 14px 16px 10px; border-bottom: 1px solid var(--line); }
.pad-box { padding: 14px 16px; }
.home-grid3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 24px; align-items: start; }
.meta-cards .span { grid-column: 1 / -1; }
.insight-tiles.one { grid-template-columns: minmax(0, 1fr); }
.insight-tiles { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.big-num { font: 700 44px/1 var(--mono); letter-spacing: -.04em; }
.big-num small { font-size: 22px; color: var(--steel); }
.family-bars { display: grid; gap: 12px; }
.family-bars > div { display: grid; grid-template-columns: 92px minmax(0, 1fr) 48px; align-items: center; gap: 12px; }
.family-bars span:last-child { font: 700 16px var(--mono); text-align: right; color: var(--text-2); }
.market-strip { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 14px; }
.price { font: 700 18px var(--mono); }
.foil-tag { display: inline-flex; align-items: center; gap: 4px; color: var(--red-hi); }
.foil-tag .i { width: 16px; height: 16px; }
.cheap-rows .row { min-height: 52px; }
.cheap-rows img { width: 32px; border-radius: 4px; }
.empty-meta { display: grid; gap: 12px; padding: 20px; border: 1px dashed var(--line-2); border-radius: var(--radius); }
@media (max-width: 1100px) {
  .meta-cards, .market-strip { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 1100px) { .home-grid3 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 960px) {
  .home-grid, .home-grid3 { grid-template-columns: minmax(0, 1fr); }
  .stats-strip { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .stats-strip .stat:nth-child(4) { border-left: 0; }
  .stats-strip .stat:nth-child(n+4) { border-top: 1px solid var(--line); }
}
@media (max-width: 600px) {
  .stats-strip { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .stats-strip .stat { padding: 14px 16px; }
  .stats-strip .stat:nth-child(odd) { border-left: 0; }
  .stats-strip .stat:nth-child(4) { border-left: 1px solid var(--line); }
  .stats-strip .stat:nth-child(n+3) { border-top: 1px solid var(--line); }
  .stats-strip .stat:last-child { grid-column: 1 / -1; }
  .featured { padding: 20px; min-height: 0; }
  .featured-art { opacity: .3; }
  .live-card .avatar { display: none; }
  .meta-cards, .market-strip { grid-template-columns: none; grid-auto-flow: column; grid-auto-columns: 42%; overflow-x: auto; scroll-snap-type: x mandatory; padding-bottom: 6px; }
  .meta-card { scroll-snap-align: start; }
  .insight-tiles { grid-template-columns: minmax(0, 1fr); }
}

/* Cards */
.filters { position: sticky; top: 64px; z-index: 20; display: grid; gap: 12px; padding: 12px 0; margin-bottom: 16px; background: var(--bg); border-bottom: 1px solid var(--line); }
.filter-line { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.filter-line .search { flex: 1 1 260px; }
.filter-line select { width: auto; }
.chips { display: flex; gap: 8px; overflow-x: auto; scrollbar-width: none; }
.chips::-webkit-scrollbar { display: none; }
.chip-btn { display: inline-flex; align-items: center; gap: 8px; min-height: 40px; padding: 0 14px; border-radius: 99px; border: 1px solid var(--line-2); background: none; color: var(--text-2); font-weight: 600; white-space: nowrap; }
.chip-btn:hover { border-color: var(--steel); color: var(--text); }
.chip-btn[aria-pressed=true] { background: var(--text); border-color: var(--text); color: var(--bg); }
.chip-btn .n { font: 700 16px var(--mono); opacity: .7; }
.card-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(176px, 1fr)); gap: 24px 16px; }
.card-tile { display: grid; grid-template-columns: minmax(0, 1fr); gap: 8px; align-content: start; min-width: 0; padding: 0; border: 0; background: none; text-align: left; }
.card-tile .thumb { transition: transform .2s, box-shadow .2s; }
.card-tile:hover .thumb { transform: translateY(-4px); box-shadow: 0 16px 30px #000b; }
.card-tile .line { display: flex; justify-content: space-between; gap: 8px; align-items: baseline; }
.card-tile .name { font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.card-tile .no { font: 700 16px var(--mono); color: var(--steel); }
.edges-inline { font: 700 16px var(--mono); color: var(--text-2); letter-spacing: .02em; }
.rarity { color: var(--steel); }
.rarity-Legendary { color: var(--red-hi); }
#card-dialog { width: min(960px, calc(100vw - 24px)); }
.card-detail { display: grid; grid-template-columns: minmax(0, 340px) minmax(0, 1fr); gap: 28px; padding: 24px; }
.card-detail .art { display: grid; gap: 12px; align-content: start; width: 100%; }
.card-detail .art img { width: 100%; height: auto; aspect-ratio: 700 / 972; border-radius: 14px; background: var(--panel-2); }
.card-detail .art .tabs { justify-content: center; }
.card-detail .info { display: grid; grid-template-columns: minmax(0, 1fr); gap: 18px; align-content: start; min-width: 0; }
.card-detail h2 { font-size: 30px; margin-top: 4px; }
.compass { display: grid; grid-template-columns: repeat(3, 56px); grid-template-rows: repeat(3, 56px); gap: 4px; }
.compass b { display: grid; place-items: center; border-radius: 10px; background: var(--panel-2); font: 700 22px var(--mono); }
.compass .t { grid-area: 1 / 2; } .compass .l { grid-area: 2 / 1; } .compass .c { grid-area: 2 / 2; background: none; color: var(--steel); font-size: 16px; } .compass .r { grid-area: 2 / 3; } .compass .b { grid-area: 3 / 2; }
.spec { display: flex; align-items: center; gap: 20px; padding: 12px 16px; border-radius: 14px; border: 1px solid var(--line); background: var(--raise); }
.edges { display: grid; grid-template-columns: repeat(3, 34px); grid-template-rows: repeat(3, 34px); gap: 3px; flex: none; }
.edges b, .edges span { display: grid; place-items: center; border-radius: 8px; font: 700 18px var(--mono); }
.edges b { background: var(--panel-3); }
.edges .t { grid-area: 1 / 2; } .edges .l { grid-area: 2 / 1; } .edges .r { grid-area: 2 / 3; } .edges .b { grid-area: 3 / 2; }
.edges .c { grid-area: 2 / 2; color: var(--steel); font-size: 16px; }
.spec-list { flex: 1; display: grid; gap: 6px; min-width: 0; }
.spec-list div { display: flex; justify-content: space-between; gap: 12px; }
.spec-list dt { color: var(--steel); }
.spec-list dd { font-weight: 700; }
.kv { display: grid; grid-template-columns: repeat(auto-fit, minmax(110px, 1fr)); gap: 12px; }
.kv div { display: grid; gap: 2px; }
.kv dt { color: var(--steel); }
.kv dd { font-weight: 700; }
#price-change { font-weight: 700; }
.price-box .tabs button { padding: 0 10px; }
#price-change[data-trend=down] { color: var(--red-hi); }
.price-box { display: grid; grid-template-columns: minmax(0, 1fr); gap: 10px; min-width: 0; padding: 16px; border-radius: 14px; background: var(--raise); border: 1px solid var(--line); }
.price-box .now { display: flex; align-items: baseline; gap: 12px; flex-wrap: wrap; }
.price-box .now strong { font: 700 32px var(--mono); }
.history-chart { display: grid; grid-template-columns: auto minmax(0, 1fr); grid-template-rows: 160px auto; gap: 4px 8px; }
.chart-y-axis { display: flex; flex-direction: column; justify-content: space-between; font: 16px var(--mono); color: var(--steel); }
.history-chart svg { width: 100%; height: 160px; }
.chart-grid { stroke: var(--line); stroke-width: 1; }
.chart-line { fill: none; stroke: var(--red); stroke-width: 2.5; vector-effect: non-scaling-stroke; }
.chart-point { fill: var(--red); }
.chart-dates { grid-column: 2; display: flex; justify-content: space-between; color: var(--steel); font: 16px var(--mono); }
.history-note { color: var(--steel); }
/* Reserve the chart's height so the card panel does not grow when history arrives. */
#price-history { display: grid; align-content: center; min-height: 188px; }
@media (max-width: 760px) {
  .filters { position: static; }
  .card-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px 12px; }
  .card-detail { grid-template-columns: minmax(0, 1fr); gap: 20px; padding: 16px; }
  .card-detail .art { max-width: 240px; justify-self: center; }
}

/* Tournaments */
.event-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(320px, 100%), 1fr)); gap: 16px; }
.event-card { display: grid; gap: 14px; padding: 20px; border-radius: var(--radius); border: 1px solid var(--line); background: var(--panel); transition: border-color .15s, transform .15s; }
.event-card:hover { border-color: var(--line-2); transform: translateY(-2px); }
.event-card { padding-top: 0; overflow: hidden; }
.event-card h3 { font-size: 22px; }
.event-cover { position: relative; height: 128px; margin: 0 -20px; overflow: hidden; background: var(--raise); border-bottom: 1px solid var(--line); }
.event-cover img { position: absolute; top: 18px; width: 92px; height: auto; border-radius: 8px; box-shadow: 0 12px 24px #000b; transition: transform .25s; }
.event-cover img:nth-child(1) { right: 120px; transform: rotate(-10deg); opacity: .7; }
.event-cover img:nth-child(2) { right: 64px; transform: rotate(2deg); z-index: 1; }
.event-cover img:nth-child(3) { right: 12px; transform: rotate(12deg); opacity: .7; }
.event-card:hover .event-cover img:nth-child(1) { transform: rotate(-14deg) translateX(-6px); }
.event-card:hover .event-cover img:nth-child(3) { transform: rotate(16deg) translateX(6px); }
.event-cover::after { content: ''; position: absolute; inset: 0; z-index: 2; background: linear-gradient(90deg, var(--raise) 25%, transparent 75%), linear-gradient(0deg, var(--panel) 0, transparent 40%); }
.event-cover .top { position: absolute; z-index: 3; left: 20px; right: 20px; top: 16px; display: flex; flex-wrap: wrap; gap: 8px; }
.event-card .top { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.event-card .foot { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.champ { display: inline-flex; align-items: center; gap: 8px; font-weight: 700; }
.champ .i { color: var(--red); }
.event-head { display: grid; gap: 14px; padding-bottom: 20px; margin-bottom: 20px; border-bottom: 1px solid var(--line); }
.event-head h1 { font-size: clamp(30px, 4vw, 44px); }
.event-head .top { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 16px; align-items: end; }
.event-actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: end; }
.event-actions form { display: flex; gap: 8px; align-items: end; flex-wrap: wrap; }
.event-actions select { width: auto; min-width: 180px; }
#tournament-join label { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; min-width: 0; max-width: 100%; }
#tournament-join label > span { white-space: nowrap; }
#tournament-join select { min-width: 180px; max-width: 100%; }
.champion-banner { margin-bottom: 16px; display: flex; align-items: center; gap: 14px; padding: 16px 20px; border-radius: var(--radius); background: linear-gradient(90deg, var(--red-soft), transparent); border: 1px solid rgba(229, 72, 77, .35); }
.champion-banner > .i { color: var(--red); width: 28px; height: 28px; }
.champion-banner strong { font: 700 22px var(--display); }
.champion-banner .grow { flex: 1; }
.event-body { display: grid; gap: 20px; margin-top: 20px; }
.bracket-section { display: grid; gap: 12px; }
.bracket-scroll { position: relative; overflow-x: auto; padding: 4px 4px 12px; scroll-snap-type: x proximity; }
.bracket { position: relative; display: flex; gap: 48px; min-width: max-content; }
.bracket-lines { position: absolute; inset: 0; pointer-events: none; overflow: visible; }
.bracket-lines path { fill: none; stroke: var(--line-2); stroke-width: 2; }
.bracket-lines path.done { stroke: #4a525d; }
.round { display: flex; flex-direction: column; width: 230px; scroll-snap-align: start; }
.round-label { height: 32px; font: 700 16px var(--mono); text-transform: uppercase; color: var(--steel); white-space: nowrap; }
.round-matches { flex: 1; display: flex; flex-direction: column; justify-content: space-around; gap: 16px; }
.bmatch { position: relative; display: grid; border-radius: 12px; border: 1px solid var(--line-2); background: var(--panel); overflow: hidden; }
a.bmatch:hover { border-color: var(--steel); }
.bmatch.active { border-color: var(--red); box-shadow: 0 0 0 3px var(--red-soft); }
.bslot { display: flex; align-items: center; gap: 8px; height: 40px; padding: 0 10px; color: var(--text-2); }
.bslot + .bslot { border-top: 1px solid var(--line); }
.bslot .seed { width: 22px; font: 700 16px var(--mono); color: var(--steel); flex: none; }
.bslot .nm { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bslot.tbd .nm { color: var(--steel); }
.bslot.win { color: var(--text); font-weight: 700; box-shadow: inset 3px 0 0 var(--red); }
.bslot.lose { color: var(--steel); }
.bslot .mark { width: 18px; height: 18px; color: var(--red); }
.bslot.hl { background: var(--panel-3); color: var(--text); }
.bmatch .state { position: absolute; right: 8px; top: 50%; transform: translateY(-50%); }
.slot-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 8px; }
.slot-grid > * { display: flex; align-items: center; gap: 10px; min-height: 52px; padding: 0 14px; border-radius: 12px; border: 1px solid var(--line); background: var(--panel); }
.slot-grid .open-slot { border-style: dashed; color: var(--steel); background: none; }
.seed-list { display: grid; grid-template-columns: minmax(0, 1fr); gap: 6px; list-style: none; padding: 0; }
.seed-list li { display: flex; align-items: center; gap: 10px; min-height: 52px; padding: 0 8px 0 12px; border-radius: 12px; border: 1px solid var(--line); background: var(--panel-2); cursor: grab; }
.seed-list li .grow { flex: 1; min-width: 0; font-weight: 600; overflow-wrap: anywhere; }
.seed-list .i { color: var(--steel); }
.prize { white-space: pre-wrap; }
@media (max-width: 760px) {
  .bracket { gap: 28px; }
  .round { width: 200px; }
  .event-actions, .event-actions form { width: 100%; }
  .event-actions select { flex: 1; }
}

/* Match */
.match-top { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 16px; }
.scoreboard { display: grid; grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr); align-items: center; gap: 16px; padding: 18px 20px; border-radius: 20px; border: 1px solid var(--line); background: var(--panel); margin-bottom: 20px; }
.side-card { display: flex; align-items: center; gap: 12px; min-width: 0; padding-bottom: 6px; border-bottom: 3px solid transparent; }
.side-card.t0.turn { border-color: var(--you); }
.side-card.t1.turn { border-color: var(--opp); }
.side-card.right { flex-direction: row-reverse; text-align: right; }
.side-card > div { min-width: 0; max-width: 100%; }
.side-card .who-name { display: block; font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.side-card .sub { color: var(--steel); }
.side-card .pts { font: 700 40px/1 var(--mono); }
.side-card.t0 .pts { color: var(--you); }
.side-card.t1 .pts { color: var(--opp); }
.center-state { display: grid; justify-items: center; gap: 4px; text-align: center; }
.center-state strong { font: 700 18px var(--display); }
.match-layout { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); grid-template-rows: auto 1fr; grid-template-areas: 'board hand' 'side hand'; gap: 24px; align-items: start; }
.match-layout.no-hand { grid-template-columns: minmax(0, 1fr) 360px; grid-template-areas: 'board side' 'board side'; }
.match-board { grid-area: board; } .match-hand { grid-area: hand; display: grid; gap: 12px; } .match-layout .match-side { grid-area: side; }
.board { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; width: 100%; max-width: 560px; margin: 0 auto; padding: 10px; border-radius: 20px; background: var(--raise); border: 1px solid var(--line); }
.sq { position: relative; aspect-ratio: 300 / 416; border-radius: 12px; border: 1px dashed var(--line-2); background: var(--panel); display: grid; place-items: center; overflow: hidden; color: var(--steel); padding: 0; }
.sq img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.sq.o0 { border: 4px solid var(--you); box-shadow: inset 0 0 0 2px rgba(47, 128, 255, .35); }
.sq.o1 { border: 4px solid var(--opp); box-shadow: inset 0 0 0 2px rgba(255, 46, 60, .35); }
.sq-mid { position: relative; z-index: 3; display: grid; justify-items: center; min-width: 46px; padding: 2px 8px 4px; border-radius: 10px; background: rgba(11, 12, 14, .88); line-height: 1.1; }
.sq-mid b { font: 700 24px var(--display); color: var(--text); }
.sq-mid small { font: 700 16px var(--mono); }
.o0 .sq-mid { box-shadow: 0 0 0 2px var(--you); } .o0 .sq-mid small { color: #8ab8ff; }
.o1 .sq-mid { box-shadow: 0 0 0 2px var(--opp); } .o1 .sq-mid small { color: #ff8a92; }
.sq .rockface { position: absolute; top: 8px; }
.sq.legal { border: 2px solid var(--text); background: var(--panel-3); box-shadow: 0 0 0 4px rgba(236, 238, 241, .12); cursor: pointer; animation: glow 1.4s infinite alternate; }
@keyframes glow { to { box-shadow: 0 0 0 7px rgba(236, 238, 241, .05); } }
.sq .n { position: absolute; left: 6px; top: 6px; z-index: 2; font: 700 16px var(--mono); color: var(--steel); }
.sq .rockface { display: grid; justify-items: center; gap: 6px; font: 700 16px var(--mono); color: var(--text-2); }
.sq.o1 .rockface .i { color: var(--opp); }
.sq.o0 .rockface .i { color: var(--you); }
.edge-num { position: absolute; z-index: 2; display: grid; place-items: center; min-width: 26px; height: 26px; padding: 0 4px; border-radius: 7px; background: rgba(11, 12, 14, .86); font: 700 16px var(--mono); color: var(--text); }
.edge-num.t { top: 4px; left: 50%; transform: translateX(-50%); }
.edge-num.b { bottom: 4px; left: 50%; transform: translateX(-50%); }
.edge-num.l { left: 4px; top: 50%; transform: translateY(-50%); }
.edge-num.r { right: 4px; top: 50%; transform: translateY(-50%); }
.card-face { position: relative; display: block; border-radius: 10px; overflow: hidden; }
.card-face .thumb { display: block; border-radius: 0; }
.edge-lv { position: absolute; z-index: 2; top: 50%; left: 50%; transform: translate(-50%, -50%); display: grid; place-items: center; min-width: 30px; height: 26px; padding: 0 5px; border-radius: 7px; background: var(--red); color: #fff; font: 700 16px var(--display); }
.hand { display: grid; grid-template-columns: repeat(auto-fill, minmax(100px, 1fr)); gap: 12px 10px; padding: 6px 2px 0; }
.hand-card { position: relative; display: grid; gap: 4px; padding: 0; border: 0; background: none; text-align: left; border-radius: 10px; }
.hand-card .card-face { outline: 2px solid transparent; outline-offset: 2px; transition: transform .15s, outline-color .15s; }
.hand-card:hover:not(:disabled) .card-face { transform: translateY(-3px); }
.hand-card[aria-pressed=true] .card-face { outline-color: var(--red); transform: translateY(-6px); }
.hand-card:disabled { opacity: .55; cursor: default; }
.hand-card .nm { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.turn-clock { display: inline-flex; align-items: center; gap: 6px; padding: 2px 12px; border-radius: 99px; background: var(--panel-2); font: 700 18px var(--mono); }
.turn-clock[data-warn=true] { background: var(--red); color: #fff; }
.ready-panel { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 16px; padding: 16px 20px; margin-bottom: 16px; border-radius: 16px; border: 1px solid var(--red); background: linear-gradient(90deg, var(--red-soft), transparent); }
.ready-panel .grow { flex: 1; min-width: 200px; }
.ready-banner { position: sticky; top: 65px; z-index: 40; display: flex; align-items: center; gap: 12px; padding: 10px max(16px, calc((100vw - 1232px) / 2)); background: var(--red); color: #fff; }
.ready-banner .grow { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ready-banner .turn-clock { background: rgba(0, 0, 0, .25); }
.ready-banner .btn { background: #fff; border-color: #fff; color: var(--bg); }
.step-panel { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 12px 16px; padding: 14px 18px; margin: 16px 0; border-radius: 16px; border: 1px solid var(--line-2); background: var(--panel); }
.step-panel > .i { color: var(--steel); }
.step-panel.hot { border-color: var(--red); background: linear-gradient(90deg, var(--red-soft), transparent); }
.step-panel.hot > .i { color: var(--red); }
.slot-grid .ok .i { color: var(--text); }
.note { display: flex; align-items: center; gap: 8px; }
.btn.lg { min-height: 52px; padding: 0 28px; font-size: 18px; }
.controls { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.log { display: grid; gap: 0; list-style: none; padding: 0; max-height: 560px; overflow-y: auto; }
.log li { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 4px 10px; padding: 10px 16px; border-top: 1px solid var(--line); }
.log li:first-child { border-top: 0; }
.log .who { grid-column: 2; font-weight: 600; }
.log .what { grid-column: 2; color: var(--text-2); }
.log time { grid-row: 1 / span 2; color: var(--steel); font: 16px var(--mono); min-width: 52px; }
@media (max-width: 960px) {
  .match-layout, .match-layout.no-hand { grid-template-columns: minmax(0, 1fr); grid-template-rows: none; grid-template-areas: 'board' 'hand' 'side'; }
  .hand { grid-template-columns: repeat(auto-fill, minmax(84px, 1fr)); }
}
@media (max-width: 600px) {
  .scoreboard { padding: 14px; gap: 8px; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
  .scoreboard .s1 { grid-column: 2; grid-row: 1; }
  .center-state { grid-column: 1 / -1; grid-row: 2; padding-top: 8px; border-top: 1px solid var(--line); }
  .play-head h1 { display: none; }
  .play-head .tabs { width: 100%; }
  .play-head .tabs a { flex: 1; justify-content: center; padding: 0 8px; }
  .play-head .tabs .i { display: none; }
  .side-card { flex-direction: column; align-items: flex-start; gap: 4px; }
  .side-card.right { flex-direction: column; align-items: flex-end; }
  .side-card .avatar { display: none; }
  .side-card .pts { font-size: 32px; }
  .board { gap: 6px; padding: 6px; }
  .edge-num { min-width: 22px; height: 22px; }
}

/* Play */
.play-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 24px; }
.play-grid { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr); gap: 20px; align-items: start; }
.play-grid > .span { grid-column: 1 / -1; }
.mode-tiles { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.mode-tile { display: grid; gap: 10px; justify-items: start; text-align: left; color: inherit; font: inherit; padding: 24px; border-radius: var(--radius); border: 1px solid var(--line); background: var(--panel); }
.mode-tile:hover { border-color: var(--line-2); }
.mode-tile .i-lg { color: var(--red); }
.invite { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; padding: 14px 16px; border-top: 1px solid var(--line); }
.invite:first-child { border-top: 0; }
.invite form { display: flex; gap: 8px; margin-left: auto; flex-wrap: wrap; }
.invite select { width: auto; min-width: 160px; }
.player-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.player-chip { display: inline-flex; align-items: center; gap: 8px; min-height: 44px; padding: 0 6px 0 6px; border-radius: 99px; border: 1px solid var(--line-2); background: var(--panel-2); }
.player-chip .avatar { width: 30px; height: 30px; }
.player-chip button { border: 0; background: var(--red); color: #fff; border-radius: 99px; width: 32px; height: 32px; display: grid; place-items: center; }
.player-chip > a { padding-right: 6px; }
.deck-layout { display: grid; grid-template-columns: 280px minmax(0, 1fr); gap: 20px; align-items: start; }
.deck-list { display: grid; grid-template-columns: minmax(0, 1fr); gap: 6px; }
.deck-item { display: flex; align-items: center; gap: 6px; }
.deck-item > button:first-child { flex: 1; min-width: 0; overflow: hidden; justify-content: space-between; }
.deck-item > button[aria-current=true] { border-color: var(--text); }
.quota { display: flex; flex-wrap: wrap; gap: 8px; }
.quota span { display: inline-flex; gap: 6px; align-items: center; height: 36px; padding: 0 12px; border-radius: 99px; background: var(--panel-2); font: 700 16px var(--mono); color: var(--text-2); }
.quota span.full { background: var(--text); color: var(--bg); }
.pick-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 14px 10px; }
.pick { position: relative; display: grid; gap: 4px; padding: 0; border: 0; background: none; text-align: left; }
.pick .card-face { transition: opacity .15s, transform .15s; outline: 2px solid transparent; outline-offset: 2px; }
.pick[aria-pressed=true] .card-face { outline-color: var(--red); }
.pick[aria-pressed=true]::after { content: ''; position: absolute; top: 6px; right: 6px; width: 26px; height: 26px; border-radius: 50%; background: var(--red) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='3'%3E%3Cpath d='m5 12 5 5 9-10'/%3E%3C/svg%3E") center / 16px no-repeat; }
.pick:disabled { cursor: default; }
.pick:disabled .card-face { opacity: .3; }
/* Mouse users get a large card with readable numbers; touch keeps the numbers on the tile. */
@media (hover: hover) and (pointer: fine) {
  .pick:hover { z-index: 20; }
  .pick:hover .card-face { opacity: 1; transform: scale(1.8); box-shadow: 0 24px 60px #000d; }
}
.pick .nm { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
@media (max-width: 860px) {
  .play-grid, .deck-layout, .mode-tiles { grid-template-columns: minmax(0, 1fr); }
  .invite form { margin-left: 0; width: 100%; }
  .invite select { flex: 1; }
  .pick-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

/* Players and profile */
.players-tools { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 16px; }
.players-tools .search { flex: 1 1 260px; }
.table-scroll { overflow-x: auto; }
.profile-head { display: flex; flex-wrap: wrap; align-items: center; gap: 20px; margin-bottom: 24px; }
.profile-head .grow { flex: 1 1 200px; min-width: 0; display: grid; gap: 4px; justify-items: start; }
.profile-head h1, .champion-banner strong, .center-state strong { font-family: var(--sans); font-weight: 800; letter-spacing: -.01em; overflow-wrap: anywhere; }
/* Optional social proof shares the Account panel and the player identity line. */
.profile-identity { display: grid; gap: 12px; border-top: 1px solid var(--line); padding-top: 16px; }
.identity-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; }
.identity-head h3 { display: flex; align-items: center; gap: 10px; }
.identity-head h3 .i { color: var(--steel); }
.identity-form { display: grid; gap: 12px; min-width: 0; }
.identity-form .controls { align-items: center; }
.identity-form input { min-width: 0; }
.identity-proof summary { cursor: pointer; color: var(--steel); }
.identity-proof p { margin-top: 10px; padding: 12px; background: var(--raise); border: 1px solid var(--line); border-radius: var(--radius-sm); white-space: pre-wrap; }
.profile-identity .status-line:empty { display: none; }
.twitter-identity { display: inline-flex; align-items: center; gap: 8px; max-width: 100%; color: var(--text-2); font-size: 16px; font-weight: 500; }
.twitter-identity span { overflow-wrap: anywhere; }
a.twitter-identity:hover { color: var(--text); }
.twitter-identity .i { width: 18px; height: 18px; color: #1d9bf0; }
.identity-linked { display: inline-flex; flex-wrap: wrap; align-items: center; gap: 4px 12px; min-width: 0; }
.player-identity { display: grid; gap: 2px; min-width: 0; }
.record { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); margin-bottom: 24px; }
.record .stat:last-child { grid-column: auto; border-left: 1px solid var(--line); }
@media (min-width: 861px) { .record .stat:nth-child(4) { border-top: 0; } }
.two-col { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 20px; align-items: start; }
.profile-account, .binder-panel { margin-top: 24px; }
.collection-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(110px, 1fr)); gap: 12px; }
@media (max-width: 860px) {
  .two-col { grid-template-columns: minmax(0, 1fr); }
  .record { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .record .stat:nth-child(3) { border-left: 0; }
  .record .stat:nth-child(n+3) { border-top: 1px solid var(--line); }
}

/* Learn */
.learn { display: grid; gap: 20px; max-width: 980px; margin: 0 auto; }
.step { display: grid; grid-template-columns: 64px minmax(0, 1fr) minmax(0, 300px); gap: 24px; align-items: center; padding: 24px; border-radius: 20px; border: 1px solid var(--line); background: var(--panel); }
.step-n { font: 700 32px var(--mono); color: var(--red); }
.step h2 { margin-bottom: 8px; }
.step p { color: var(--text-2); }
.step p + p { margin-top: 8px; }
.step .visual { display: grid; place-items: center; }
.mini-board { display: grid; grid-template-columns: repeat(3, 56px); gap: 6px; }
.mini-board i { display: grid; place-items: center; aspect-ratio: 1; border-radius: 10px; border: 1px dashed var(--line-2); font: 700 16px var(--mono); font-style: normal; }
.mini-board i.a { border: 2px solid var(--text); background: var(--panel-3); }
.mini-board i.b { border: 2px solid var(--red); background: var(--red-soft); }
.vs-edge { display: flex; align-items: center; gap: 12px; font: 700 28px var(--mono); }
.vs-edge span { display: grid; place-items: center; width: 72px; height: 96px; border-radius: 12px; border: 2px solid var(--text); background: var(--panel-3); }
.vs-edge span.them { border-color: var(--red); background: var(--red-soft); }
.levels { display: grid; gap: 6px; width: 100%; }
.levels div { display: grid; grid-template-columns: 40px minmax(0, 1fr); gap: 10px; align-items: center; padding: 6px 12px; border-radius: 10px; background: var(--panel-2); }
.levels b { font-family: var(--mono); color: var(--red); }
.families { display: grid; gap: 8px; width: 100%; }
.families span { display: flex; justify-content: center; padding: 10px; border-radius: 10px; background: var(--panel-2); font-weight: 700; }
.learn-cta { display: flex; flex-wrap: wrap; gap: 12px; justify-content: center; padding: 12px 0; }
@media (max-width: 760px) {
  .step { grid-template-columns: minmax(0, 1fr); gap: 16px; padding: 20px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

/* Collection stats: home, Stats page, binder */
.page-tabs { display: inline-flex; margin-bottom: 20px; }
.day-tiles { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.day-tiles .stat { display: grid; gap: 2px; padding: 12px 14px; border-radius: 12px; background: var(--raise); border: 1px solid var(--line); }
.day-tiles strong { font: 700 28px/1.1 var(--mono); }
.day-tiles span { color: var(--steel); }
.pull-mini { display: grid; gap: 8px; }
.pull-mini > div { display: grid; grid-template-columns: minmax(0, 1fr) 76px 76px; align-items: center; gap: 8px; }
.pull-mini .pull-head span { color: var(--steel); font: 700 16px var(--mono); text-align: right; }
.verdict { font: 700 16px var(--mono); text-align: right; }
.verdict.off::after { content: ' •'; color: var(--red-hi); }
.pop { font: 700 18px var(--mono); }
.row img.foil-edge, .rip-cards .foil img { outline: 2px solid var(--text); outline-offset: 1px; }
.rip-row { display: grid; grid-template-columns: 200px minmax(0, 1fr); align-items: center; gap: 16px; padding: 12px 16px; border-bottom: 1px solid var(--line); }
.rip-row:last-child { border-bottom: 0; }
.rip-meta { display: grid; gap: 2px; }
.rip-cards { display: grid; grid-template-columns: repeat(10, minmax(0, 1fr)); gap: 6px; }
.rip-cards img { width: 100%; height: auto; aspect-ratio: 300 / 416; border-radius: 6px; }
.rip-cards .r-Prestige img, .rip-cards .r-Legendary img { outline: 2px solid var(--red); outline-offset: 1px; }
.faction-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.faction-grid .section { gap: 12px; }
.tbl.compact th, .tbl.compact td { padding: 6px 8px; }
.filters.static { position: static; border-bottom: 0; }
.pop-table img { border-radius: 4px; flex: none; }
.pop-table .sub { display: block; color: var(--steel); }
.binder-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(84px, 1fr)); gap: 10px; margin: 12px 0; }
.binder-grid .pick { position: relative; display: block; }
.binder-grid .pick.missing img { filter: grayscale(1); opacity: .3; }
.binder-grid .count { position: absolute; right: 4px; bottom: 4px; display: inline-flex; align-items: center; gap: 2px; padding: 0 6px; border-radius: 6px; background: rgba(11, 12, 14, .88); font-size: 16px; }
.binder-grid .count .i { width: 14px; height: 14px; }
@media (max-width: 760px) {
  .rip-row { grid-template-columns: minmax(0, 1fr); gap: 8px; }
  .rip-cards { grid-template-columns: repeat(5, minmax(0, 1fr)); }
  .faction-grid { grid-template-columns: minmax(0, 1fr); }
}
.stats-body { display: grid; gap: 16px; margin-top: 16px; }
.home-grid3 .featured { gap: 12px; min-height: 0; padding: 20px; }
.home-grid3 .featured h2 { font-size: 24px; }
.home-grid3 .featured .featured-art { display: none; }
@media (max-width: 760px) {
  .rip-meta { display: flex; flex-wrap: wrap; gap: 4px 12px; align-items: baseline; }
}

/* Home hero: next event and the beginner path */
.home-hero { display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); gap: 24px; margin-bottom: 32px; }
.practice-tile { display: grid; gap: 14px; align-content: end; padding: 28px; border-radius: 20px; border: 1px solid var(--line); background: linear-gradient(160deg, var(--panel-2), var(--panel)); transition: border-color .15s; }
.practice-tile:hover { border-color: var(--line-2); }
.practice-tile h2 { font-size: 26px; }
.practice-tile .btn { justify-self: start; }
.ladder-mini { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; padding: 0; list-style: none; }
.ladder-mini li { display: grid; justify-items: center; gap: 2px; padding: 8px 4px; border-radius: 10px; border: 1px solid var(--line-2); color: var(--steel); font-weight: 700; }
.ladder-mini li.done { color: var(--text-2); }
.ladder-mini li.done::after { content: ' ✓'; font-size: 16px; }
.ladder-mini li.on { border-color: var(--red); background: var(--red-soft); color: var(--text); }
button.row { width: 100%; border: 0; border-top: 1px solid var(--line); background: none; color: inherit; text-align: left; font: inherit; cursor: pointer; }

/* Packs and the hover preview */
.pack-dialog { width: min(820px, calc(100vw - 24px)); }
.pack-grid { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 12px; }
.pack-card { display: grid; gap: 6px; margin: 0; min-width: 0; }
.pack-card img { width: 100%; height: auto; aspect-ratio: 300 / 416; border-radius: 8px; }
.pack-card figcaption { display: grid; min-width: 0; }
.pack-card strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pack-card.r-Prestige img, .pack-card.r-Legendary img { outline: 2px solid var(--red); outline-offset: 2px; }
.pack-card.foil img { outline: 2px solid var(--text); outline-offset: 2px; }
.pack-dialog .dialog-body > .btn { justify-self: start; }
.rip-cards span { display: block; }
#card-preview { position: fixed; z-index: 90; width: 260px; height: auto; aspect-ratio: 700 / 972; border-radius: 14px; box-shadow: 0 24px 60px #000d; pointer-events: none; opacity: 0; transition: opacity .12s; }
#card-preview.on { opacity: 1; }
.page-head .muted { margin-top: 4px; }
@media (max-width: 860px) {
  .home-hero { grid-template-columns: minmax(0, 1fr); }
  .pack-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .section-head { flex-wrap: wrap; }
}

/* Series: games won toward a majority, separate from the squares of the current game */
.series-bar { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 12px; padding: 10px 16px; margin-bottom: 12px; border-radius: 14px; border: 1px solid var(--line); background: var(--raise); }
.series-bar .kicker:last-child { text-align: right; }
.series-score { display: flex; align-items: center; gap: 14px; }
.series-score strong { font-size: 26px; }
.pips { display: flex; gap: 6px; }
.pip { width: 14px; height: 14px; border-radius: 50%; border: 2px solid var(--line-2); }
.pip.t0.on { background: var(--you); border-color: var(--you); }
.pip.t1.on { background: var(--opp); border-color: var(--opp); }
.match-side { display: grid; gap: 16px; align-content: start; }
.match-side .row[aria-current] { background: var(--panel-2); }
.round-label .bo, .bslot .wins { font: 700 16px var(--mono); color: var(--steel); }
.bslot .wins { margin-left: auto; min-width: 20px; text-align: right; }
.bslot .wins.win { color: var(--text); }
@media (max-width: 760px) {
  .series-bar { grid-template-columns: minmax(0, 1fr); justify-items: center; text-align: center; }
  .series-bar .kicker:last-child { text-align: center; }
}

/* Card tiles show both finishes' floors; the selected finish is brighter. */
.card-tile .prices { justify-content: flex-start; align-items: center; flex-wrap: wrap; gap: 2px 12px; min-width: 0; }
.price-pair { display: inline-flex; align-items: center; gap: 4px; color: var(--steel); }
.price-pair b { font: 700 16px var(--mono); }
.price-pair.on { color: var(--text); }

/* A large result dialog keeps the arena visible around the player's outcome. */
dialog.outcome { width: min(760px, calc(100vw - 32px)); min-height: min(500px, calc(100dvh - 48px)); max-width: calc(100vw - 32px); max-height: calc(100dvh - 32px); border: 1px solid var(--line-2); border-radius: var(--radius); display: grid; place-items: center; overflow: hidden; background: radial-gradient(circle at 50% 45%, var(--panel-3), var(--bg) 70%); }
dialog.outcome::backdrop { background: rgba(0,0,0,.75); backdrop-filter: blur(5px); }
.outcome-in { position: relative; z-index: 1; display: grid; justify-items: center; gap: 16px; padding: 24px; text-align: center; }
.outcome h2 { max-width: 100%; font: 800 clamp(38px, 9vw, 88px)/1 var(--display); letter-spacing: -.03em; text-transform: uppercase; overflow-wrap: anywhere; }
.outcome p { font: 700 20px var(--mono); color: var(--text-2); }
.outcome .controls { justify-content: center; }
.outcome.win { background: radial-gradient(circle at 50% 45%, rgba(229, 72, 77, .45), var(--bg) 65%); }
.outcome.win h2 { color: #fff; text-shadow: 0 0 40px var(--red-hi), 0 0 90px var(--red); animation: outcome-pop .7s cubic-bezier(.2, 1.6, .4, 1) both; }
.outcome.win .outcome-fx { position: absolute; inset: 0; overflow: hidden; pointer-events: none; }
.outcome.win .outcome-fx::before { content: ""; position: absolute; left: 50%; top: 50%; width: 1600px; height: 1600px; background: repeating-conic-gradient(from 0deg, rgba(255,255,255,.06) 0 6deg, transparent 6deg 18deg); animation: outcome-spin 18s linear infinite; }
.outcome-fx i { position: absolute; top: -20px; left: var(--x); width: 10px; height: 16px; border-radius: 2px; background: var(--red-hi); animation: outcome-fall 2.6s var(--delay) ease-in infinite; }
.outcome-fx i:nth-child(3n) { background: #fff; } .outcome-fx i:nth-child(3n+1) { background: var(--you); }
.outcome.loss h2 { color: var(--steel); animation: outcome-sink 1.4s ease-out both; }
.outcome.loss { background: radial-gradient(circle at 50% 45%, #1a2230, var(--bg) 70%); }
@keyframes outcome-pop { from { transform: scale(.3); opacity: 0; } }
@keyframes outcome-spin { from { transform: translate(-50%, -50%) rotate(0deg); } to { transform: translate(-50%, -50%) rotate(360deg); } }
@keyframes outcome-fall { to { transform: translateY(105vh) rotate(540deg); } }
@keyframes outcome-sink { from { transform: translateY(-40px); opacity: 0; } }
@media (prefers-reduced-motion: reduce) { .outcome h2, .outcome-fx, .outcome-fx::before, .outcome-fx i { animation: none !important; } .outcome-fx i { display: none; } }
dialog.ready-modal { width: 100vw; height: 100dvh; max-width: none; max-height: none; border: 0; border-radius: 0; display: grid; place-items: center; background: radial-gradient(circle at 50% 45%, rgba(229, 72, 77, .35), var(--bg) 65%); }
.ready-modal h2 { font: 800 clamp(40px, 9vw, 88px)/1 var(--display); letter-spacing: -.02em; }
.ready-modal p { font-size: 22px; color: var(--text-2); }
.ready-modal .ready-icon { width: 64px; height: 64px; color: var(--red-hi); }
.ready-modal .turn-clock { font-size: 28px; padding: 6px 20px; }
.coming-soon { justify-items: start; max-width: 640px; padding: 32px; }
.coming-soon > .i { color: var(--red); }
.coming-soon h2 { font-size: clamp(28px, 4vw, 40px); }

.stats-body { grid-template-columns: minmax(0, 1fr); }
.stats-body .table-scroll { min-width: 0; overflow-x: auto; }
.stats-body .table-scroll:focus-visible { outline: 2px solid var(--red-hi); outline-offset: 2px; }
.stats-tabs { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); }
.stats-tabs button { justify-content: center; padding: 10px 8px; }
.stats-views { display: flex; gap: 20px; overflow-x: auto; border-bottom: 1px solid var(--line); margin-top: 12px; }
.stats-views button { flex: none; border: 0; border-bottom: 2px solid transparent; background: none; border-radius: 0; padding: 12px 0; color: var(--steel); font: 600 16px var(--sans); }
.stats-views button[aria-current=page] { border-bottom-color: var(--red); color: var(--text); }
.stats-select select { min-height: 44px; }
.stats-more { justify-self: center; }
.leaderboard-table .sub, .movers-table .sub { display: block; margin-top: 2px; }
.leaderboard-table td, .movers-table td { white-space: nowrap; }
.leaderboard-table .who { min-width: 144px; }
.movers-table { min-width: 780px; }
.movers-table th:first-child, .movers-table td:first-child { width: 212px; }
.movers-table .who { width: 180px; }
.movers-table .who > span { white-space: normal; }
@media (max-width: 600px) {
  .leaderboard-table th, .leaderboard-table td { padding: 10px; }
  .stats-views { gap: 16px; }
}

/* Regular-card market demand uses the collection's rows and table. */
.demand-top { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); grid-auto-flow: column; grid-template-rows: repeat(5, auto); }
.demand-top > :nth-child(6) { border-top: 0; }
.demand-top > :nth-child(n+6) { border-left: 1px solid var(--line); }
.demand-row img, .demand-leader img { flex: none; border-radius: 4px; }
.demand-row .grow > strong { display: block; }
.demand-values { text-align: right; flex: none; }
.demand-values > strong { display: block; font: 700 16px var(--mono); }
.demand-values .sub { margin-top: 4px; }
.demand-leaders { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 12px; }
.demand-leader { display: grid; gap: 10px; align-content: start; padding: 12px; }
.demand-leader-head { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 4px 8px; align-items: baseline; }
.demand-leader-head .mono { font-weight: 700; }
.demand-leader-card { display: flex; align-items: center; gap: 8px; min-height: 48px; }
.demand-leader-card strong { min-width: 0; overflow-wrap: anywhere; }
.demand-table { min-width: 1000px; }
.demand-table th[aria-sort], .movers-table th[aria-sort] { color: var(--text); }
.demand-table td { white-space: nowrap; }
@media (max-width: 1100px) { .demand-leaders { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 960px) {
  .demand-top { grid-template-columns: minmax(0, 1fr); grid-template-rows: none; grid-auto-flow: row; }
  .demand-top > :nth-child(6) { border-top: 1px solid var(--line); }
  .demand-top > :nth-child(n+6) { border-left: 0; }
}
@media (max-width: 600px) {
  .demand-row { display: grid; grid-template-columns: 24px 32px minmax(0, 1fr); gap: 10px; }
  .demand-row .rank { width: 24px; }
  .demand-row img { width: 32px; height: auto; }
  .demand-values { grid-column: 3; text-align: left; }
  .demand-row .grow > * { white-space: normal; }
}

.demand-method p { margin: 14px 0 0; color: var(--steel); max-width: 90ch; }
.demand-method summary { cursor: pointer; font-weight: 700; }

.demand-score { display: inline-flex; align-items: center; gap: 6px; min-height: 40px; padding: 0; background: none; border: 0; color: var(--text); font: 700 16px var(--mono); }
.demand-score .i { width: 16px; height: 16px; color: var(--steel); }
.demand-detail { width: min(680px, calc(100vw - 32px)); padding: 24px; }
.demand-detail .dialog-head { flex-wrap: wrap; gap: 16px; align-items: start; padding: 0 0 16px; margin-bottom: 20px; }
.demand-detail h2 { font-size: 24px; }
.demand-detail p { margin: 12px 0 0; }
.demand-facts { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; margin: 0 0 20px; }
.demand-facts dt { color: var(--steel); }
.demand-facts dd { margin: 4px 0 0; font: 700 16px var(--mono); overflow-wrap: anywhere; }
@media (max-width: 600px) {
  .demand-leaders { grid-template-columns: minmax(0, 1fr); gap: 8px; }
  .demand-leader-card { min-height: 44px; }
  .demand-detail { padding: 16px; }
  .demand-facts { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

/* Optional analytics: visible choices, no overlay over the game, no tiny text. */
.analytics-notice { display: flex; align-items: center; gap: 24px; margin: 20px auto 0; padding: 20px 24px; width: calc(100% - 48px); max-width: 1232px; border: 1px solid var(--line-2); border-radius: var(--radius); background: var(--panel); }
.analytics-copy { flex: 1; min-width: 0; }
.analytics-copy h2 { margin-bottom: 8px; font-size: 20px; }
.analytics-copy p { color: var(--text-2); }
.analytics-copy a, .analytics-privacy a { text-decoration: underline; text-underline-offset: 3px; }
.analytics-actions { display: flex; flex-wrap: wrap; gap: 10px; }
.analytics-actions .btn { white-space: nowrap; }
.analytics-status { margin-top: 8px; }
.analytics-settings { border: 0; padding: 0; background: none; color: inherit; text-align: left; }
.analytics-settings:hover { text-decoration: underline; }
.analytics-privacy { max-width: 900px; }
.analytics-privacy h1 { margin-bottom: 20px; }
.analytics-privacy section { margin-top: 32px; }
.analytics-privacy h2 { margin-bottom: 12px; }
.analytics-privacy p + p { margin-top: 16px; }
@media (max-width: 760px) {
  .analytics-notice { flex-direction: column; align-items: stretch; gap: 16px; width: calc(100% - 32px); padding: 20px; }
  .analytics-actions .btn { flex: 1; }
}

.tournament-resources { display: flex; justify-content: flex-end; margin-bottom: 16px; }
.analytics-privacy .rules-list { padding-left: 24px; margin: 0; }
.analytics-privacy .rules-list li { padding-left: 4px; margin-bottom: 12px; }

#t-root .page-head .controls { max-width: 100%; }

/* Tournament transitions remain visible while players inspect their bracket. */
.tournament-flow { display: flex; margin-bottom: 24px; flex-wrap: wrap; }
.tournament-flow .grow { min-width: min(240px, 100%); }
.tournament-flow .controls { flex-wrap: wrap; }
.checkin-banner { background: var(--red); color: #fff; }
.checkin-banner strong, .checkin-banner .grow > span { display: block; }
.checkin-banner .btn { background: var(--bg); color: var(--text); }
#tournament-banner { flex-wrap: wrap; }
#tournament-banner > .tournament-flow { max-width: 1232px; margin: 16px auto; }
#tournament-banner .grow { min-width: min(230px, 100%); }
.tournament-outcome h2 { font-size: clamp(28px, 7vw, 68px); text-wrap: balance; }
.tournament-outcome .outcome-congrats { display: block; font-size: .75em; line-height: 1.3; }
.tournament-outcome .outcome-in { width: 100%; }
.tournament-outcome .outcome-event { color: var(--steel); font: 400 16px var(--sans); }
.match-board:not([data-viewer-seat="1"]) .coin-flip__face--0 { background: radial-gradient(circle at 35% 25%, #84bbff, #2466bb 65%, #153766); }
.match-board:not([data-viewer-seat="1"]) .coin-flip__face--1 { background: radial-gradient(circle at 35% 25%, #ff8c8e, #b42e38 65%, #6e1b24); }
.tournament-flow .flow-event { display: block; margin-bottom: 4px; color: var(--steel); }
.tournament-flow .flow-opponent { color: #fff; text-decoration: underline; text-underline-offset: 3px; }

/* Readiness keeps the last board visible while making the next start unmissable. */
.scoreboard.is-waiting .turn-clock { font-size: clamp(32px, 5vw, 44px); padding: 6px 18px; }
.ready-state { display: inline-flex; align-items: center; gap: 6px; padding: 5px 9px; margin-top: 6px; border: 1px solid var(--line-2); border-radius: 8px; color: var(--text); font-weight: 700; }
.ready-state[data-ready-state=ready] { background: #163c2b; border-color: #7ecba5; color: #baf2d4; }
.previous-game-label { text-align: center; color: var(--steel); margin-bottom: 10px; font-weight: 700; }
.outcome p { white-space: pre-line; }

@media (max-width: 860px) {
  .topbar-in > .brand { min-width: 0; flex-shrink: 1; }
  .topbar-in > .brand img { max-width: 100%; }
}
