/* DrafterPro app shell + page layouts. */

/* Top bar */
.topbar {
  position: sticky; top: 0; z-index: 10; height: var(--topbar-h);
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 var(--s4);
  border-bottom: 1px solid var(--border);
  background: rgba(11, 14, 20, .72); backdrop-filter: blur(14px);
}
.brand { font: 700 var(--fs-lg)/1 var(--font-display); letter-spacing: -.02em; display: flex; align-items: center; gap: 8px; }
.brand-mark { color: var(--gold); font-size: 14px; }
.brand-accent { color: var(--gold); }
.topnav { display: flex; gap: var(--s5); font-size: var(--fs-sm); color: var(--text-dim); }
.topnav a { transition: color var(--dur-1); }
.topnav a:hover { color: var(--text); }

/* View container + entrance animation */
.view { max-width: var(--maxw); margin: 0 auto; padding: var(--s5) var(--s3) var(--s8); }
@keyframes viewin { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
.view-page { display: contents; }                 /* per-navigation wrapper: no box, children lay out as if direct */
.view-page > * { animation: viewin var(--dur-3) var(--ease) both; }

/* Home hero */
.hero { text-align: center; padding: var(--s8) 0 var(--s6); }
.hero .kicker { color: var(--gold); font: 600 var(--fs-sm)/1 var(--font-ui); letter-spacing: .2em; text-transform: uppercase; }
.hero h1 { font-size: var(--fs-3xl); line-height: 1.02; margin-top: var(--s4); }
.hero h1 .accent { color: var(--gold); }
.hero p.tag { color: var(--text-dim); font-size: var(--fs-lg); margin: var(--s4) auto 0; max-width: 620px; }

/* Panel */
.panel {
  background: linear-gradient(180deg, var(--surface), var(--bg-elev));
  border: 1px solid var(--border); border-radius: var(--r4);
  padding: var(--s6); box-shadow: var(--shadow-2);
}
.panel h2 { font-size: var(--fs-lg); margin-bottom: var(--s5); }

/* Set picker */
.set-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(124px, 1fr)); gap: var(--s3); }
.set-tile {
  padding: var(--s5) var(--s4); border-radius: var(--r3);
  border: 1px solid var(--border); background: var(--surface-2);
  text-align: center; cursor: pointer; color: var(--text);
  font: 700 var(--fs-xl)/1 var(--font-display); text-transform: uppercase; letter-spacing: .04em;
  transition: transform var(--dur-2) var(--ease), border-color var(--dur-2), background var(--dur-2), box-shadow var(--dur-2);
}
.set-tile:hover { border-color: var(--border-2); transform: translateY(-3px); }
.set-tile[aria-selected="true"] { border-color: var(--gold); background: var(--gold-soft); color: var(--gold); box-shadow: var(--glow-gold); }
.set-tile small { display: block; margin-top: 8px; font: 500 var(--fs-xs)/1 var(--font-ui); color: var(--text-mute); letter-spacing: 0; text-transform: none; }
.skeleton.set-tile { height: 78px; }

/* Difficulty tier picker */
.tier-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(96px, 1fr)); gap: var(--s2); }
.tier-tile { padding: 12px 8px; border-radius: var(--r2); border: 1px solid var(--border); background: var(--surface-2); color: var(--text-dim); cursor: pointer; text-transform: capitalize; font: 700 var(--fs-sm)/1 var(--font-display); letter-spacing: .02em; transition: transform var(--dur-1) var(--ease), border-color var(--dur-1), box-shadow var(--dur-1), color var(--dur-1); }
.tier-tile:hover { transform: translateY(-2px); color: var(--text); }
.tier-tile[data-tier="bronze"][aria-selected="true"]   { border-color: #c08457; color: #d9a06b; box-shadow: 0 0 0 1px #c0845780; }
.tier-tile[data-tier="silver"][aria-selected="true"]   { border-color: #aab4c2; color: #c6cfdb; box-shadow: 0 0 0 1px #aab4c280; }
.tier-tile[data-tier="gold"][aria-selected="true"]     { border-color: var(--gold); color: var(--gold); box-shadow: var(--glow-gold); }
.tier-tile[data-tier="platinum"][aria-selected="true"] { border-color: #6fd6c8; color: #8fe3d6; box-shadow: 0 0 0 1px #6fd6c880; }
.tier-tile[data-tier="diamond"][aria-selected="true"]  { border-color: var(--blue); color: var(--blue); box-shadow: 0 0 0 1px #7cc0ff80; }
.tier-tile[data-tier="mythic"][aria-selected="true"]   { border-color: var(--red); color: #ff9a7d; box-shadow: 0 0 0 1px #ef717380; }
.tier-hint { text-align: center; color: var(--text-mute); font-size: var(--fs-xs); margin-top: var(--s2); min-height: 14px; }

/* Play-mode cards */
.mode-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: var(--s3); }
@media (max-width: 460px) { .mode-row { grid-template-columns: 1fr; } }
.mode-card {
  position: relative;
  text-align: left; padding: var(--s5); border-radius: var(--r3); border: 1px solid var(--border);
  background: var(--surface-2); color: var(--text); cursor: pointer;
  display: grid; grid-template-rows: auto auto 1fr auto; gap: 6px; min-height: 132px;
  transition: transform var(--dur-2) var(--ease), border-color var(--dur-2), box-shadow var(--dur-2);
}
.mode-card:hover:not(.is-disabled) { transform: translateY(-3px); }
.mode-card.is-disabled { opacity: .5; cursor: not-allowed; }
.mode-card.loading { opacity: .7; cursor: progress; }
.mode-mark { font-size: 26px; line-height: 1; }
.mode-title { font: 700 var(--fs-lg)/1 var(--font-display); }
.mode-desc { font-size: var(--fs-sm); color: var(--text-dim); }
.mode-go { font: 700 var(--fs-sm)/1 var(--font-display); color: var(--text-mute); align-self: end; }
.mode-card.compete:hover:not(.is-disabled) { border-color: var(--gold); box-shadow: var(--glow-gold); }
.mode-card.compete:hover:not(.is-disabled) .mode-go { color: var(--gold); }
.mode-card.training:hover:not(.is-disabled) { border-color: var(--blue); box-shadow: 0 0 0 1px #7cc0ff55, 0 10px 30px #7cc0ff22; }
.mode-card.training:hover:not(.is-disabled) .mode-go { color: var(--blue); }
.mode-card.sealed:hover:not(.is-disabled) { border-color: #5fd1bd; box-shadow: 0 0 0 1px #5fd1bd55, 0 10px 30px #3fae9a22; }
.mode-card.sealed:hover:not(.is-disabled) .mode-go { color: #5fd1bd; }
/* Hover tip — shows on hover/focus even while a card is aria-disabled (pre set-pick), so modes are learnable. */
.mode-tip {
  position: absolute; left: 10px; right: 10px; bottom: calc(100% + 8px);
  background: #1c2027; color: var(--text); border: 1px solid var(--border-2); border-radius: 10px;
  padding: 9px 11px; font: 500 var(--fs-xs)/1.45 var(--font-ui); text-align: left;
  box-shadow: 0 14px 34px rgba(0, 0, 0, .5);
  opacity: 0; transform: translateY(5px); pointer-events: none;
  transition: opacity var(--dur-2) var(--ease), transform var(--dur-2) var(--ease); z-index: 30;
}
.mode-card:hover .mode-tip, .mode-card:focus-visible .mode-tip { opacity: 1; transform: translateY(0); }

/* Training diff blocks */
.diff-block { margin-top: var(--s5); }
.topcards.diffcards { flex-wrap: wrap; }
.topcards.diffcards .card-tile { width: 92px; }
.diff-block.ai-only .section-h { color: var(--green); }

.actions { display: flex; gap: var(--s3); align-items: center; justify-content: center; margin-top: var(--s6); flex-wrap: wrap; }
.seed-input { width: 168px; }
.form-status { margin-top: var(--s4); text-align: center; min-height: 18px; font-size: var(--fs-sm); }

/* ---- Draft room ---- */
.draft-hud { display: flex; align-items: center; gap: var(--s4); flex-wrap: wrap; margin-bottom: var(--s5); }
.draft-hud .where { font: 600 var(--fs-lg)/1 var(--font-display); white-space: nowrap; }
.draft-hud .where b { color: var(--gold); font-weight: 600; }
.draft-hud .where .sep { color: var(--text-mute); margin: 0 7px; }
.progress { flex: 1 1 160px; min-width: 120px; height: 6px; background: var(--surface-2); border-radius: var(--r-pill); overflow: hidden; }
.progress > i { display: block; height: 100%; width: 0; background: linear-gradient(90deg, var(--gold), var(--gold-2)); transition: width var(--dur-3) var(--ease); }
.draft-tools { display: flex; gap: var(--s2); align-items: center; }
.toggle {
  display: inline-flex; align-items: center; gap: 8px; cursor: pointer;
  font: 600 var(--fs-sm)/1 var(--font-ui); color: var(--text-dim);
  background: var(--surface-2); border: 1px solid var(--border-2); border-radius: var(--r-pill); padding: 9px 15px;
  transition: color var(--dur-1), border-color var(--dur-1), background var(--dur-1);
}
.toggle .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--text-mute); transition: all var(--dur-1); }
.toggle[aria-pressed="true"] { color: var(--gold); border-color: var(--gold); background: var(--gold-soft); }
.toggle[aria-pressed="true"] .dot { background: var(--gold); box-shadow: 0 0 8px var(--gold); }

/* Auto Build in progress — the toggle's dot spins and the deck panel shows it's working. */
.toggle.loading { color: var(--gold); border-color: var(--gold); cursor: progress; }
.toggle.loading .dot { box-sizing: border-box; background: transparent; border: 2px solid var(--gold-soft); border-top-color: var(--gold); box-shadow: none; animation: spin .7s linear infinite; }
.deck-building { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 12px; padding: 52px 16px; color: var(--text-dim); font: 600 var(--fs-sm)/1 var(--font-ui); }
.deck-building .spinner { width: 30px; height: 30px; border-radius: 50%; border: 3px solid var(--gold-soft); border-top-color: var(--gold); animation: spin .7s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* Segmented control (e.g. group by Color | Mana) */
.tool-label { font: 600 var(--fs-xs)/1 var(--font-ui); color: var(--text-mute); text-transform: uppercase; letter-spacing: .04em; }
.seg { display: inline-flex; border: 1px solid var(--border-2); border-radius: var(--r-pill); overflow: hidden; }
.seg-btn { background: var(--surface-2); color: var(--text-dim); border: none; padding: 8px 15px; font: 600 var(--fs-sm)/1 var(--font-ui); cursor: pointer; transition: color var(--dur-1), background var(--dur-1); }
.seg-btn + .seg-btn { border-left: 1px solid var(--border-2); }
.seg-btn[aria-pressed="true"] { background: var(--gold-soft); color: var(--gold); }
.seg-btn:hover:not([aria-pressed="true"]) { color: var(--text); }

.pack-grid { display: grid; gap: var(--s4); grid-template-columns: repeat(auto-fill, minmax(132px, 1fr)); }
@media (min-width: 880px) { .pack-grid { grid-template-columns: repeat(7, 1fr); } }

/* card-tile is a <button>; reset native chrome (visual comes from the .card-tile component rules) */
.card-tile { appearance: none; -webkit-appearance: none; padding: 0; margin: 0; font: inherit; color: inherit; }
.card-tile .ph {
  position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; padding: 8px;
  font: 600 var(--fs-xs)/1.3 var(--font-ui); color: var(--text-dim); text-align: center; background: var(--surface-2);
}
.card-tile img { position: absolute; inset: 0; opacity: 0; transition: opacity var(--dur-2) var(--ease); }
.card-tile.loaded img { opacity: 1; }
.card-tile .scoretag {
  position: absolute; left: 0; right: 0; bottom: 0; padding: 7px 9px; text-align: left;
  font: 700 calc(var(--fs-sm) + 1px)/1 var(--font-display); color: #fff;
  background: linear-gradient(0deg, rgba(0,0,0,.85), rgba(0,0,0,.05));
}
/* Saved win rate, bottom-right, on the scoretag's gradient. Fluo yellow, with a dark shadow so it stays
   legible over any card art. Same tiny font bump as the score so the two corners match. */
.card-tile .wrtag {
  position: absolute; right: 0; bottom: 0; padding: 7px 9px;
  font: 700 calc(var(--fs-sm) + 1px)/1 var(--font-display); color: #eaff00;
  text-shadow: 0 1px 3px rgba(0,0,0,.95), 0 0 2px rgba(0,0,0,.8);
}
.card-tile .cbadge { position: absolute; top: 6px; left: 6px; }
.card-tile .rec-flag { position: absolute; top: 5px; right: 8px; color: var(--green); font-size: 16px; text-shadow: 0 1px 4px rgba(0,0,0,.7); }
.card-tile.rec { border-color: var(--green); box-shadow: 0 0 0 1px var(--green), var(--shadow-2); }
.card-tile.rec:hover { box-shadow: 0 0 0 1px var(--green), var(--shadow-3); }
.card-tile:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; }
/* Instant feedback the moment you click a card (before the next pack arrives) */
.card-tile.picking { transform: translateY(-6px) scale(1.04); border-color: var(--gold); box-shadow: var(--glow-gold); z-index: 3; }

/* Pool rail */
.pool-rail { margin-top: var(--s6); border-top: 1px solid var(--border); padding-top: var(--s4); }
.pool-rail h3 { margin: 0 0 var(--s3); font: 600 var(--fs-sm)/1 var(--font-ui); letter-spacing: .04em; text-transform: uppercase; color: var(--text-dim); }
.pool-rail h3 span { color: var(--gold); }
.pool-strip { display: flex; gap: var(--s2); overflow-x: auto; padding-bottom: var(--s2); scrollbar-width: thin; }
.pool-strip .mini { position: relative; flex: 0 0 auto; width: 52px; aspect-ratio: 63/88; border-radius: var(--r1); overflow: hidden; border: 1px solid var(--border); background: var(--surface-2); }
.pool-strip .mini img { width: 100%; height: 100%; object-fit: cover; display: block; }
.pool-empty { color: var(--text-mute); font-size: var(--fs-sm); }

/* Hover zoom — a fixed, GPU-composited floating preview. Positioned once per card (no per-move work). */
.card-zoom {
  position: fixed; top: 0; left: 0; z-index: 60; width: 300px; aspect-ratio: 63/88;
  border-radius: var(--r3); overflow: hidden; background: var(--surface-2);
  border: 1px solid var(--border-2); box-shadow: var(--shadow-3); pointer-events: none;
  opacity: 0; transform: translate3d(var(--zx, 0px), var(--zy, 0px), 0) scale(.94); transform-origin: center;
  transition: opacity var(--dur-2) var(--ease), transform var(--dur-2) var(--ease); will-change: transform, opacity;
}
.card-zoom.show { opacity: 1; transform: translate3d(var(--zx, 0px), var(--zy, 0px), 0) scale(1); }
.card-zoom img { width: 100%; height: 100%; object-fit: cover; display: block; }

/* ---- Deck builder (Arena-like: pool zone + sticky deck panel) ---- */
/* title + group toggle clustered on the left */
.builder-head { display: flex; align-items: center; justify-content: flex-start; gap: var(--s5); margin-bottom: var(--s5); flex-wrap: wrap; }
.builder-head h1 { font-size: var(--fs-xl); }
.builder-head .group-ctrl { display: inline-flex; align-items: center; gap: var(--s3); }
.deck-actions-row { display: grid; grid-template-columns: 1fr 1fr; gap: var(--s2); }
.deck-actions-row .toggle, .deck-actions-row .btn { width: 100%; justify-content: center; }
.builder { display: grid; grid-template-columns: 1fr 340px; gap: var(--s5); align-items: start; }
@media (max-width: 900px) { .builder { grid-template-columns: 1fr; } }

/* Pool toolbar: instant search + sort + color/type filter chips. Stacks into rows; wraps gracefully. */
.pool-toolbar { display: flex; flex-direction: column; gap: var(--s3); margin-bottom: var(--s4); }
.tb-row { display: flex; align-items: center; justify-content: space-between; gap: var(--s3) var(--s4); flex-wrap: wrap; }
.tb-search { display: flex; align-items: center; gap: var(--s3); flex: 1 1 260px; min-width: 0; }
.tb-sort { display: inline-flex; align-items: center; gap: var(--s3); }
.tb-filters { display: flex; align-items: center; gap: var(--s2) var(--s4); flex-wrap: wrap; }
.filter-chips { display: inline-flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.fchip {
  background: var(--surface-2); border: 1px solid var(--border-2); border-radius: var(--r-pill);
  color: var(--text-dim); padding: 6px 12px; font: 600 var(--fs-xs)/1 var(--font-ui); cursor: pointer;
  display: inline-flex; align-items: center; gap: 6px; transition: color var(--dur-1), border-color var(--dur-1), background var(--dur-1);
}
.fchip:hover { color: var(--text); border-color: var(--text-mute); }
.fchip[aria-pressed="true"] { color: var(--text); border-color: var(--gold); background: var(--gold-soft); }
.fchip.pip-chip { padding: 6px 9px; }
.fchip.pip-chip .pip { width: 14px; height: 14px; opacity: .55; transition: opacity var(--dur-1); }
.fchip.pip-chip:hover .pip, .fchip.pip-chip[aria-pressed="true"] .pip { opacity: 1; }
.fchip.pip-chip[aria-pressed="true"] { background: var(--surface-3, var(--surface-2)); border-color: var(--text); box-shadow: inset 0 0 0 1px var(--text-mute); }
.fchip.clear-filters { color: var(--text-mute); border-style: dashed; margin-left: auto; }
.fchip.clear-filters:hover { color: var(--text); border-color: var(--text-mute); border-style: solid; }
.pool-search {
  flex: 1 1 auto; min-width: 0; max-width: 340px;
  background: var(--surface-2); border: 1px solid var(--border-2); border-radius: var(--r-pill);
  color: var(--text); padding: 8px 14px; font: 500 var(--fs-sm)/1 var(--font-ui);
  transition: border-color var(--dur-1), box-shadow var(--dur-1);
}
.pool-search::placeholder { color: var(--text-mute); }
.pool-search:focus { outline: none; border-color: var(--gold); box-shadow: 0 0 0 3px var(--gold-soft); }
.pool-count { font: 600 var(--fs-xs)/1 var(--font-ui); color: var(--text-mute); white-space: nowrap; }
.card-tile.is-hidden, .cmc-group.is-hidden { display: none; }
.pool-zone .cmc-group { margin-bottom: var(--s5); }
.pool-zone h4 { display: flex; align-items: center; gap: 7px; font: 600 var(--fs-sm)/1 var(--font-ui); letter-spacing: .03em; color: var(--text-dim); margin: 0 0 var(--s3); text-transform: uppercase; }
.pool-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(94px, 1fr)); gap: var(--s3); }
.card-tile.picked { border-color: var(--green); }
.card-tile.picked::before { content: ""; position: absolute; inset: 0; z-index: 1; background: rgba(11,14,20,.6); }
.card-tile.picked::after { content: "✓"; position: absolute; top: 5px; right: 7px; z-index: 2; color: var(--green); font: 700 16px/1 var(--font-display); text-shadow: 0 1px 4px rgba(0,0,0,.85); }

.deck-panel { position: sticky; top: calc(var(--topbar-h) + 16px); background: linear-gradient(180deg, var(--surface), var(--bg-elev)); border: 1px solid var(--border); border-radius: var(--r4); padding: var(--s5); box-shadow: var(--shadow-2); }
.deck-head { display: flex; align-items: center; justify-content: space-between; gap: var(--s2); margin-bottom: var(--s3); }
.deck-head h3 { font: 600 var(--fs-sm)/1 var(--font-ui); text-transform: uppercase; letter-spacing: .05em; color: var(--text-dim); margin: 0; }
.deck-head .toggle { padding: 6px 11px; }
.deck-panel .count { font: 700 var(--fs-2xl)/1 var(--font-display); color: var(--text); }
.deck-panel .count.ok { color: var(--gold); }
.deck-panel .count small { font: 500 var(--fs-xs)/1 var(--font-ui); color: var(--text-mute); }
.deck-hint { color: var(--text-mute); font-size: var(--fs-xs); margin-top: 5px; }

.curve { display: flex; align-items: flex-end; gap: 6px; height: 86px; margin: var(--s4) 0; }
.curve .bar { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: flex-end; gap: 4px; height: 100%; }
.curve .bar .n { font: 600 var(--fs-xs)/1 var(--font-ui); color: var(--text-dim); height: 12px; }
.curve .bar i { width: 100%; border-radius: 4px 4px 0 0; background: linear-gradient(180deg, var(--gold), var(--gold-2)); transition: height var(--dur-3) var(--ease); }
.curve .bar .cmc { font: 600 var(--fs-xs)/1 var(--font-ui); color: var(--text-mute); }

.colorbar { display: flex; gap: var(--s4); flex-wrap: wrap; margin: var(--s3) 0 var(--s4); }
.colorbar .cc { display: inline-flex; align-items: center; gap: 6px; font: 600 var(--fs-sm)/1 var(--font-ui); color: var(--text-dim); }

.decklist { margin-top: var(--s3); max-height: 36vh; overflow: auto; scrollbar-width: thin; }
.decklist .grp { font: 600 var(--fs-xs)/1 var(--font-ui); text-transform: uppercase; letter-spacing: .04em; color: var(--text-mute); margin: var(--s3) 0 4px; }
.decklist .row { display: flex; align-items: center; gap: 8px; padding: 5px 8px; border-radius: var(--r1); cursor: pointer; font-size: var(--fs-sm); }
.decklist .row:hover { background: var(--surface-2); }
.decklist .row .nm { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.decklist .row .rm { flex: 0 0 auto; color: var(--text-mute); font-size: var(--fs-xs); }
.decklist .row:hover .rm { color: var(--red); }

/* Mana-cost icons */
.mana { display: inline-flex; gap: 2px; flex: 0 0 auto; }
.ms { width: 15px; height: 15px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center;
  font: 700 9px/1 var(--font-ui); color: #0b0e14; box-shadow: inset 0 0 0 1px rgba(0,0,0,.28); }
.ms.w { background: var(--w); } .ms.u { background: var(--u); } .ms.b { background: var(--b); }
.ms.r { background: var(--r); } .ms.g { background: var(--g); } .ms.c { background: var(--col); }
.ms.gen { background: var(--surface-3); color: var(--text-dim); box-shadow: inset 0 0 0 1px var(--border-2); }

/* Basic-land steppers */
.lands-edit { margin: var(--s4) 0 var(--s2); border-top: 1px solid var(--border); padding-top: var(--s3); }
.lands-edit-h { display: flex; align-items: center; justify-content: space-between; font: 600 var(--fs-xs)/1 var(--font-ui); text-transform: uppercase; letter-spacing: .04em; color: var(--text-mute); margin-bottom: var(--s2); }
.auto-lands {
  background: var(--gold-soft); color: var(--gold); border: 1px solid #d9a94e55; border-radius: var(--r-pill);
  padding: 4px 11px; font: 700 var(--fs-xs)/1 var(--font-ui); letter-spacing: .02em; cursor: pointer;
  text-transform: none; transition: background var(--dur-1), box-shadow var(--dur-1);
}
.auto-lands:hover { background: var(--gold); color: #1a1206; box-shadow: var(--glow-gold); }
.land-row { display: flex; align-items: center; gap: 8px; padding: 3px 0; color: var(--text-dim); font-size: var(--fs-sm); }
.land-row.on { color: var(--text); }
.land-row .ln { flex: 1; }
.stepper { display: inline-flex; align-items: center; gap: 0; border: 1px solid var(--border-2); border-radius: var(--r-pill); overflow: hidden; }
.st-btn { background: var(--surface-2); color: var(--text); border: none; width: 26px; height: 24px; font: 700 14px/1 var(--font-ui); cursor: pointer; transition: background var(--dur-1); }
.st-btn:hover:not([disabled]) { background: #24365e; }
.st-btn[disabled] { opacity: .4; cursor: default; }
.st-n { min-width: 22px; text-align: center; font: 600 var(--fs-sm)/1 var(--font-display); }

.deck-actions { margin-top: var(--s5); display: flex; flex-direction: column; gap: var(--s2); }

/* ---- Grade reveal ---- */
.reveal { max-width: 860px; margin: 0 auto; }
.grade-hero { text-align: center; padding: var(--s7) 0 var(--s5); }
.grade-letter { font: 700 96px/1 var(--font-display); letter-spacing: -.04em; color: var(--text-mute); }
.grade-letter[data-tier^="S"] { color: var(--tier-s); } .grade-letter[data-tier^="A"] { color: var(--tier-a); }
.grade-letter[data-tier^="B"] { color: var(--tier-b); } .grade-letter[data-tier^="C"] { color: var(--tier-c); }
.grade-letter[data-tier^="D"], .grade-letter[data-tier^="F"] { color: var(--tier-df); }
.grade-total { font: 600 var(--fs-xl)/1 var(--font-display); color: var(--text-dim); margin-top: var(--s2); }
.grade-total b { color: var(--text); }
.grade-sub { color: var(--text-dim); font-size: var(--fs-lg); margin-top: var(--s3); display: flex; align-items: center; justify-content: center; gap: 10px; flex-wrap: wrap; }

.section-h { font: 600 var(--fs-sm)/1 var(--font-ui); text-transform: uppercase; letter-spacing: .05em; color: var(--text-mute); margin: var(--s6) 0 var(--s3); }
.components { display: grid; gap: 10px; }
.comp { display: grid; grid-template-columns: 150px 1fr 52px; gap: 12px; align-items: center; }
.comp .lab { font: 600 var(--fs-sm)/1.2 var(--font-ui); }
.comp .lab small { display: block; color: var(--text-mute); font-weight: 500; font-size: var(--fs-xs); margin-top: 2px; }
.comp .track { height: 9px; background: var(--surface-2); border-radius: var(--r-pill); overflow: hidden; }
.comp .track i { display: block; height: 100%; width: 0; border-radius: inherit; background: linear-gradient(90deg, var(--blue), var(--gold)); transition: width var(--dur-3) var(--ease); }
.comp .val { font: 700 var(--fs-sm)/1 var(--font-display); color: var(--text-dim); text-align: right; }

.gates { display: flex; gap: var(--s2); flex-wrap: wrap; }
.gate { display: inline-flex; align-items: center; gap: 7px; padding: 6px 12px; border-radius: var(--r-pill); border: 1px solid var(--border-2); font-size: var(--fs-xs); color: var(--text-dim); background: var(--surface-2); }
.gate b { color: var(--text); font-family: var(--font-display); }
.gate.good { border-color: var(--green); color: var(--green); } .gate.good b { color: var(--green); }
.gate.warn { border-color: var(--gold); color: var(--gold); } .gate.warn b { color: var(--gold); }
.gate.bad  { border-color: var(--red);  color: var(--red);  } .gate.bad b  { color: var(--red); }

/* Standout cards (3, centered) above the breakdown */
.topcards-wrap { margin: var(--s6) 0 var(--s4); }
.section-h.center { text-align: center; }
.topcards { display: flex; gap: var(--s4); justify-content: center; margin-top: var(--s3); }
.topcards .card-tile { width: 120px; flex: 0 0 auto; }
.topcards-action { text-align: center; margin-top: var(--s4); }

.vs { display: grid; grid-template-columns: 1fr auto 1fr; gap: var(--s4); align-items: stretch; }
/* 1st place: a single centered deck box (no opponent). */
.vs.solo { grid-template-columns: minmax(0, 320px); justify-content: center; }
.vs .side { text-align: center; padding: var(--s5) var(--s4); border: 1px solid var(--border); border-radius: var(--r3); background: var(--surface); }
.vs .side.win { border-color: var(--gold); box-shadow: var(--glow-gold); }
/* The champion block is a link → opens its deck in a new tab; "see deck" appears on hover */
.vs a.side { cursor: pointer; position: relative; transition: transform var(--dur-2) var(--ease), border-color var(--dur-2), box-shadow var(--dur-2); }
.vs a.side:hover { transform: translateY(-3px); border-color: var(--gold); box-shadow: var(--glow-gold); }
.vs .side .seedeck { display: block; margin-top: 8px; font-size: var(--fs-xs); color: var(--gold); opacity: 0; transition: opacity var(--dur-2) var(--ease); }
.vs a.side:hover .seedeck { opacity: 1; }
.vs .side .who { font: 600 var(--fs-sm)/1 var(--font-ui); color: var(--text-dim); text-transform: uppercase; letter-spacing: .04em; }
.vs .side .g { font: 700 var(--fs-2xl)/1 var(--font-display); margin: var(--s2) 0; }
.vs .side .arch { font-size: var(--fs-xs); color: var(--text-mute); }
.vs .mid { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; color: var(--text-mute); font: 600 var(--fs-sm)/1 var(--font-display); }
.vs .mid .delta { color: var(--gold); }
.overlap { text-align: center; color: var(--text-mute); font-size: var(--fs-xs); margin-top: var(--s3); }

.export { margin-top: var(--s4); }
.export textarea { width: 100%; height: 150px; font: 500 var(--fs-xs)/1.5 ui-monospace, Menlo, monospace; resize: vertical; }
.export .btn { margin-top: var(--s2); }
.cta { display: flex; justify-content: center; align-items: center; gap: var(--s3); margin-top: var(--s7); flex-wrap: wrap; }

/* ---- Swiss tournament ---- */
.tourney { max-width: 820px; margin: 0 auto; }
.tourney-hero { text-align: center; padding: var(--s7) 0 var(--s5); }
.tourney-hero .crown { font-size: 56px; line-height: 1; filter: drop-shadow(0 6px 20px rgba(240,198,116,.4)); }
.tourney-hero h1 { font-size: var(--fs-2xl); margin-top: var(--s2); }
.tourney-hero .place { color: var(--gold); }
.tourney-hero .champ { color: var(--text-dim); font-size: var(--fs-lg); margin-top: var(--s3); }
.tourney-hero .champ b { color: var(--text); }

.bracket { display: grid; gap: var(--s4); }
.round { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r3); padding: var(--s4) var(--s5); }
.round .rh { font: 600 var(--fs-xs)/1 var(--font-ui); text-transform: uppercase; letter-spacing: .05em; color: var(--text-mute); margin-bottom: var(--s2); }
.match { display: flex; align-items: center; gap: var(--s3); padding: 8px 8px; border-top: 1px solid var(--border); font-size: var(--fs-sm); }
.match:first-of-type { border-top: none; }
.match.mine { background: var(--gold-soft); border-radius: var(--r1); }
.match .w { color: var(--green); font-weight: 600; flex: 1 1 0; min-width: 0; }
.match .def { color: var(--text-mute); font-size: var(--fs-xs); flex: 0 0 auto; }
.match .l { color: var(--text-dim); flex: 1 1 0; min-width: 0; }
.match .sc { flex: 0 0 auto; font: 700 var(--fs-sm)/1 var(--font-display); color: var(--text); background: var(--surface-2); border: 1px solid var(--border-2); border-radius: var(--r-pill); padding: 4px 11px; }

.standings-tbl { width: 100%; border-collapse: collapse; margin-top: var(--s3); }
.standings-tbl th { text-align: left; font: 600 var(--fs-xs)/1 var(--font-ui); text-transform: uppercase; letter-spacing: .04em; color: var(--text-mute); padding: 8px 10px; border-bottom: 1px solid var(--border); }
.standings-tbl td { padding: 10px; border-bottom: 1px solid var(--border); font-size: var(--fs-sm); color: var(--text-dim); }
.standings-tbl td.deck { color: var(--text); }
.standings-tbl .rankcol { width: 40px; font: 700 var(--fs-sm)/1 var(--font-display); color: var(--text-mute); }
.standings-tbl tr.you td { background: var(--gold-soft); }
.standings-tbl tr.you td.deck { color: var(--gold); font-weight: 600; }
.standings-tbl tr.you .rankcol { color: var(--gold); }

/* ---- Tournament: animated, match-by-match reveal ---- */
.tourney { position: relative; }
.skip-btn { position: absolute; top: 0; right: 0; z-index: 3; }
.tourney-hero .kicker { color: var(--gold); font: 600 var(--fs-sm)/1 var(--font-ui); letter-spacing: .18em; text-transform: uppercase; }
.tourney-hero .crown { font-size: 56px; line-height: 1; filter: drop-shadow(0 6px 20px rgba(240,198,116,.4)); }
.crown.drop { animation: crowndrop 720ms var(--ease) both; }
@keyframes crowndrop { 0% { transform: translateY(-46px) scale(.4); opacity: 0; } 60% { transform: translateY(6px) scale(1.12); opacity: 1; } 100% { transform: none; } }

/* generic reveal-in (rounds, headings, hero lines) */
.reveal-in { opacity: 0; transform: translateY(10px); transition: opacity var(--dur-3) var(--ease), transform var(--dur-3) var(--ease); }
.reveal-in.in { opacity: 1; transform: none; }

/* a match as a row: [winner-side] [BO3 game pips] [other-side] [score] */
.tmatch { display: grid; grid-template-columns: 1fr auto 1fr 56px; align-items: center; gap: 12px; padding: 11px 8px; border-top: 1px solid var(--border); }
.tmatch:first-of-type { border-top: none; }
.tmatch.mine { background: var(--gold-soft); border-radius: var(--r1); }
.tmatch:not(.mine) { opacity: .68; }                              /* AI-only matches: less focus */
.tmatch .c { font-size: var(--fs-sm); color: var(--text-dim); min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tmatch .c.left { text-align: right; }
.tmatch .c.wondim { color: var(--text); }                         /* other-match winner: subtle, no color, no bold */
.tmatch.mine .c.win  { color: var(--green); font-weight: 700; }   /* YOU won — green, only for you */
.tmatch.mine .c.loss { color: var(--red);   font-weight: 700; }   /* YOU lost — red, only for you */
.tmatch .bo3 { display: flex; gap: 5px; justify-content: center; min-width: 54px; }
.gp { width: 11px; height: 11px; border-radius: 50%; background: var(--surface-3); transform: scale(.3); opacity: 0; transition: transform 180ms var(--ease), opacity 160ms; }
.gp.lit { transform: scale(1); opacity: 1; }
.tmatch.mine .gp.won  { background: var(--green); box-shadow: 0 0 9px rgba(134,217,143,.55); }  /* green/red only for you */
.tmatch.mine .gp.lost { background: var(--red); }
.tmatch:not(.mine) .gp.won  { background: var(--text-mute); }     /* neutral pips for other matches */
.tmatch:not(.mine) .gp.lost { background: var(--surface-3); }
.tmatch .sc { text-align: right; font: 700 var(--fs-sm)/1 var(--font-display); color: var(--text); opacity: 0; transition: opacity 220ms; }
.tmatch .sc.show { opacity: 1; }

/* standings rows cascade in (opacity only — transforms on <tr> are unreliable) */
.standings-tbl .srow { opacity: 0; transition: opacity var(--dur-3) var(--ease); }
.standings-tbl .srow.in { opacity: 1; }

/* Sealed grade-leaderboard: a deck's grade letter as a compact gold chip in the Grade column. */
.grade-chip { display: inline-block; min-width: 30px; text-align: center; padding: 2px 7px; border-radius: 6px; background: var(--gold-soft); color: var(--gold); font: 700 var(--fs-sm)/1.2 var(--font-display); }

/* ---- Single deck view (a rival's / the champion's list, in its own tab) ---- */
.deckview { max-width: var(--maxw); margin: 0 auto; }
.deckview-head { margin-bottom: var(--s5); }
.deckview-head h1 { font-size: var(--fs-xl); }
.deckview-head .grade-sub { justify-content: flex-start; margin-top: var(--s2); }

/* Stub pages (pre-Phase placeholders) */
.stub { text-align: center; padding: var(--s8) 0; }
.stub .badge { margin-bottom: var(--s4); }
.stub h1 { font-size: var(--fs-2xl); }
.stub p.tag { color: var(--text-dim); font-size: var(--fs-lg); margin: var(--s3) 0; }
.stub code { background: var(--surface-2); padding: 2px 8px; border-radius: var(--r1); color: var(--gold); font-size: var(--fs-sm); }
.stub .btn { margin-top: var(--s5); }

/* ---- Tier list (per-set ranked table + taxonomy side panel) ---- */
.tl-head { display: flex; align-items: center; justify-content: space-between; gap: var(--s4); margin-bottom: var(--s3); flex-wrap: wrap; }
.tl-head h1 { font-size: var(--fs-2xl); }
.tl-controls { display: flex; align-items: center; gap: var(--s3); }
.tl-select { background: var(--surface-2); color: var(--text); border: 1px solid var(--border-2); border-radius: var(--r2); padding: 10px 12px; font: 600 var(--fs-sm)/1 var(--font-ui); cursor: pointer; }
.tl-controls input { padding: 10px 14px; }
.tl-count { font-size: var(--fs-sm); color: var(--text-mute); white-space: nowrap; }

.tl-filters { display: flex; gap: var(--s5); flex-wrap: wrap; align-items: center; padding: 0 0 var(--s4); border-bottom: 1px solid var(--border); margin-bottom: var(--s4); }
.tl-fgroup { display: flex; align-items: center; gap: var(--s2); }
.tl-flabel { font: 700 var(--fs-xs)/1 var(--font-ui); text-transform: uppercase; letter-spacing: .08em; color: var(--text-mute); }
.tl-pillrow { display: inline-flex; gap: 4px; }
.tl-pill { background: var(--surface-2); border: 1px solid var(--border); color: var(--text-dim); border-radius: var(--r-pill); padding: 5px 11px; font: 600 var(--fs-xs)/1 var(--font-ui); cursor: pointer; transition: color var(--dur-1), background var(--dur-1), border-color var(--dur-1); }
.tl-pill:hover { color: var(--text); }
.tl-pill[aria-pressed="true"] { background: var(--gold-soft); border-color: var(--gold-2); color: var(--gold); }
.tl-colorpill { display: inline-flex; align-items: center; padding: 6px 10px; }
.tl-cl { color: var(--text-mute); font-size: 13px; line-height: 1; }

.tl-main { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: var(--s5); align-items: start; }
.tl-table { min-width: 0; border: 1px solid var(--border); border-radius: var(--r3); background: var(--surface); }
.tl-row { display: grid; grid-template-columns: 52px 58px 96px minmax(0, 1fr) 86px 96px 58px 58px; align-items: center; gap: var(--s2); padding: 0 var(--s3); height: 34px; border-bottom: 1px solid var(--border); }
.tl-row:last-child { border-bottom: 0; border-bottom-left-radius: var(--r3); border-bottom-right-radius: var(--r3); }
.tl-h { position: sticky; top: var(--topbar-h); z-index: 5; background: var(--bg-elev); border-bottom: 1px solid var(--border-2); border-top-left-radius: var(--r3); border-top-right-radius: var(--r3); }
.tl-h .tl-c { font: 700 var(--fs-xs)/1 var(--font-ui); text-transform: uppercase; letter-spacing: .06em; color: var(--text-mute); }
.tl-body .tl-row { transition: background var(--dur-1); }
.tl-body .tl-row:hover, .tl-body .tl-row.on { background: var(--surface-2); }
.tl-body .tl-row { cursor: pointer; }
/* Pinned rows: a gold tint + a solid gold left rail (inset shadow so it never shifts the grid). The
   .pinned.on rule outranks the plain .on hover, so a pinned row stays visibly gold while highlighted. */
.tl-body .tl-row.pinned { background: var(--gold-soft); box-shadow: inset 3px 0 0 var(--gold); }
.tl-body .tl-row.pinned:hover, .tl-body .tl-row.pinned.on { background: rgba(240, 198, 116, .24); }
/* Full-width group labels in the body ("📌 Pinned · N", "All cards") — separate the pinned block. */
.tl-group { display: flex; align-items: center; justify-content: space-between; gap: var(--s2); padding: 6px var(--s3); font: 700 var(--fs-xs)/1 var(--font-ui); text-transform: uppercase; letter-spacing: .06em; color: var(--text-mute); background: var(--bg-elev); border-bottom: 1px solid var(--border); }
.tl-group .tl-clear { cursor: pointer; background: none; border: 0; color: var(--gold); font: inherit; text-transform: none; letter-spacing: 0; padding: 0 2px; }
.tl-group .tl-clear:hover { text-decoration: underline; }
.tl-c { min-width: 0; overflow: hidden; }
.tl-c.c2, .tl-c.c6, .tl-c.c7 { text-align: right; }
.tl-c.c0, .tl-c.c1, .tl-c.c4 { text-align: center; }
.tl-rank { color: var(--text-mute); font-size: var(--fs-xs); font-variant-numeric: tabular-nums; }
.tl-wr { font-weight: 700; font-size: var(--fs-sm); font-variant-numeric: tabular-nums; }
.tl-wr small { color: var(--text-mute); font-weight: 600; font-size: 9px; letter-spacing: .04em; margin-left: 4px; }
.tl-name { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-weight: 500; }
.tl-rarity { color: var(--text-dim); font-size: var(--fs-sm); white-space: nowrap; }
.tl-num { color: var(--text-dim); font-size: var(--fs-sm); font-variant-numeric: tabular-nums; }
.tl-pips { display: inline-flex; gap: 3px; justify-content: center; }
.t-s { color: var(--tier-s); } .t-a { color: var(--tier-a); } .t-b { color: var(--tier-b); }
.t-c { color: var(--tier-c); } .t-df { color: var(--tier-df); } .t-none { color: var(--text-mute); }

.tl-panel { position: sticky; top: calc(var(--topbar-h) + 16px); background: linear-gradient(180deg, var(--surface), var(--bg-elev)); border: 1px solid var(--border); border-radius: var(--r4); padding: var(--s4); box-shadow: var(--shadow-2); max-height: calc(100vh - var(--topbar-h) - 32px); overflow-y: auto; }
.tl-art { aspect-ratio: 63 / 88; border-radius: var(--r3); overflow: hidden; background: var(--surface-2); margin-bottom: var(--s4); display: flex; align-items: center; justify-content: center; }
.tl-art img { width: 100%; height: 100%; object-fit: contain; display: none; }
.tl-art.on img { display: block; }
.tl-tax-head h3 { font-size: var(--fs-lg); margin-bottom: var(--s2); }
.tl-tax-meta { display: flex; align-items: center; gap: var(--s2); flex-wrap: wrap; font-size: var(--fs-sm); font-weight: 700; margin-bottom: var(--s2); }
.tl-tax-meta .muted { font-weight: 500; }
.tl-sec { margin-top: var(--s3); }
.tl-sec h4 { font: 700 var(--fs-xs)/1 var(--font-ui); text-transform: uppercase; letter-spacing: .07em; color: var(--text-mute); margin: 0 0 6px; }
.tl-chips { display: flex; flex-wrap: wrap; gap: 5px; }
.tl-chips .chip { padding: 3px 9px; }
.tl-axis { font-variant: small-caps; }
.tl-down { background: rgba(239, 113, 115, .14); border-color: rgba(239, 113, 115, .5); color: var(--red); }
.tl-meta { font-size: var(--fs-xs); margin-top: 4px; }
.tl-aff { display: flex; flex-wrap: wrap; gap: 6px; }
.tl-affchip { display: inline-flex; align-items: center; gap: 7px; background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--r-pill); padding: 3px 9px 3px 11px; font-size: var(--fs-xs); font-weight: 700; }
.tl-affchip i { width: 34px; height: 6px; border-radius: 3px; background: linear-gradient(90deg, var(--gold) var(--p, 0%), var(--surface-3) var(--p, 0%)); }
.tl-ev { margin-top: var(--s3); font-size: var(--fs-xs); }
.tl-ev summary { cursor: pointer; color: var(--text-mute); font-weight: 700; text-transform: uppercase; letter-spacing: .07em; }
.tl-evrow { color: var(--text-dim); margin-top: 5px; line-height: 1.4; }
.tl-evrow b { color: var(--text-mute); font-weight: 600; }
.tl-notax, .tl-empty { margin-top: var(--s4); font-size: var(--fs-sm); }
.tl-skel { height: 34px; border-radius: 0; }

@media (max-width: 900px) {
  .tl-main { grid-template-columns: 1fr; }
  .tl-panel { position: relative; top: 0; max-height: none; order: -1; }
}

/* ---- Landing choice cards (reuse .mode-card; just the hover accents) ---- */
.mode-card.solo:hover:not([disabled]) { border-color: var(--gold); box-shadow: var(--glow-gold); }
.mode-card.solo:hover:not([disabled]) .mode-go { color: var(--gold); }
.mode-card.lobby:hover:not([disabled]) { border-color: var(--blue); box-shadow: 0 0 0 1px #7cc0ff55, 0 10px 30px #7cc0ff22; }
.mode-card.lobby:hover:not([disabled]) .mode-go { color: var(--blue); }

/* ---- Lobby (multiplayer home) ---- */
.lobby-head { display: flex; align-items: baseline; justify-content: space-between; gap: var(--s4); margin-bottom: var(--s3); }
.lobby-head h2 { margin-bottom: 0; }
.lobby-live { display: inline-flex; align-items: center; gap: 7px; font: 700 var(--fs-xs)/1 var(--font-ui); letter-spacing: .14em; text-transform: uppercase; color: var(--text-mute); }
.live-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--green); box-shadow: 0 0 8px var(--green); animation: lpulse 2s ease-in-out infinite; }
@keyframes lpulse { 0%, 100% { opacity: 1; } 50% { opacity: .35; } }
.lobby-sub { color: var(--text-dim); font-size: var(--fs-sm); margin: 0 0 var(--s5); }
.lobby-sub.muted { color: var(--text-mute); }

/* Big Leaderboard CTA at the top of the lobby */
.lobby-cta { display: flex; justify-content: center; margin-top: var(--s5); }
.lb-cta {
  display: inline-flex; align-items: center; gap: var(--s4); padding: var(--s3) var(--s6) var(--s3) var(--s4);
  border-radius: var(--r3); text-decoration: none; color: #2a1d05;
  background: linear-gradient(135deg, #ffd884, var(--gold)); border: 1px solid #d9a94e;
  box-shadow: var(--glow-gold); transition: transform var(--dur-2) var(--ease), box-shadow var(--dur-2);
}
.lb-cta:hover { transform: translateY(-2px); box-shadow: 0 0 0 1px var(--gold), 0 14px 36px rgba(240,198,116,.4); }
.lb-cta-ico { display: inline-flex; }
.lb-cta-tx { display: flex; flex-direction: column; gap: 3px; line-height: 1; }
.lb-cta-tx b { font: 800 var(--fs-lg)/1 var(--font-display); }
.lb-cta-sub { font: 600 var(--fs-xs)/1 var(--font-ui); color: #5a4205; }

/* Lobby CTAs sit side by side (Quick Play + Leaderboard); wrap on narrow screens. */
.lobby-cta { gap: var(--s4); flex-wrap: wrap; align-items: stretch; }

/* Quick Play — a prominent green CTA next to the Leaderboard. */
.qp-wrap { display: flex; flex-direction: column; align-items: center; gap: var(--s2); }
.qp-cta {
  appearance: none; cursor: pointer; display: inline-flex; align-items: center; gap: var(--s4);
  padding: var(--s3) var(--s6) var(--s3) var(--s4); border-radius: var(--r3); color: #07260f;
  background: linear-gradient(135deg, #a8f0bd, var(--green)); border: 1px solid #3fae6a;
  box-shadow: 0 0 0 1px rgba(134, 217, 143, .4), 0 10px 30px rgba(46, 204, 113, .25);
  transition: transform var(--dur-2) var(--ease), box-shadow var(--dur-2);
}
.qp-cta:hover:not(:disabled) { transform: translateY(-2px); box-shadow: 0 0 0 1px var(--green), 0 14px 36px rgba(46, 204, 113, .4); }
.qp-cta:disabled { opacity: .7; cursor: progress; }
.qp-ico { font-size: 24px; line-height: 1; }
.qp-tx { display: flex; flex-direction: column; gap: 3px; line-height: 1; text-align: left; }
.qp-tx b { font: 800 var(--fs-lg)/1 var(--font-display); }
.qp-sub { font: 600 var(--fs-xs)/1 var(--font-ui); color: #0c4a22; }
.qp-note { font-size: var(--fs-xs); color: var(--text-dim); text-align: center; max-width: 280px; display: none; }
.qp-note.show { display: block; }
.qp-note.err-note { color: var(--red); }
.qp-note a { color: var(--gold); }

/* Filter bar — chip groups (reusing .fchip), a "showing X of Y" line + a Clear button when active. */
.lobby-filters {
  display: flex; align-items: center; gap: var(--s2) var(--s5); flex-wrap: wrap;
  margin-bottom: var(--s4); padding-bottom: var(--s4); border-bottom: 1px solid var(--border);
}
.lobby-filters .filter-chips { gap: 6px; }
.lf-label { font: 700 var(--fs-xs)/1 var(--font-ui); letter-spacing: .06em; text-transform: uppercase; color: var(--text-mute); margin-right: 2px; }
.lf-meta { display: inline-flex; align-items: center; gap: var(--s3); margin-left: auto; }
.lf-showing { font: 600 var(--fs-xs)/1 var(--font-ui); color: var(--text-mute); white-space: nowrap; }

/* Tables grid — inviting state-aware cards */
.lobby-tables { display: grid; grid-template-columns: repeat(auto-fill, minmax(264px, 1fr)); gap: var(--s5); }
.lobby-card-sk { height: 320px; border-radius: var(--r4); }
.lobby-empty { grid-column: 1 / -1; text-align: center; padding: var(--s8) var(--s4); color: var(--text-mute); }
.lobby-empty-ico { font-size: 40px; margin-bottom: var(--s3); opacity: .85; }

.lobby-card {
  appearance: none; text-align: left; cursor: pointer; padding: 0; overflow: hidden;
  display: flex; flex-direction: column; color: var(--text);
  background: linear-gradient(180deg, var(--surface), var(--bg-elev));
  border: 1px solid var(--border); border-radius: var(--r4); box-shadow: var(--shadow-2);
  transition: transform var(--dur-2) var(--ease), border-color var(--dur-2), box-shadow var(--dur-2);
}
.lobby-card:hover { transform: translateY(-4px); border-color: var(--border-2); box-shadow: var(--shadow-3); }
.lobby-card.st-open:hover { border-color: var(--gold); box-shadow: 0 0 0 1px var(--gold-soft), 0 18px 48px rgba(240, 198, 116, .16); }

.lc-stage { position: relative; padding: var(--s4) var(--s4) var(--s2); background: radial-gradient(120% 90% at 50% -10%, rgba(240, 198, 116, .07), transparent 68%); }
.lc-stage .table-asset { width: 188px; max-width: 78%; margin: 0 auto; }
.lc-status { position: absolute; top: 12px; right: 12px; font: 800 var(--fs-xs)/1 var(--font-ui); letter-spacing: .08em; text-transform: uppercase; padding: 5px 10px; border-radius: var(--r-pill); }
.lc-status.st-open     { background: rgba(134, 217, 143, .16); color: var(--green); box-shadow: inset 0 0 0 1px rgba(134, 217, 143, .45); }
.lc-status.st-filling  { background: var(--gold-soft); color: var(--gold); box-shadow: inset 0 0 0 1px rgba(240, 198, 116, .45); }
.lc-status.st-drafting,
.lc-status.st-building  { background: rgba(124, 192, 255, .15); color: var(--blue); box-shadow: inset 0 0 0 1px rgba(124, 192, 255, .4); }
.lc-status.st-playing  { background: rgba(162, 148, 196, .18); color: #b9a9e0; box-shadow: inset 0 0 0 1px rgba(162, 148, 196, .45); }
.lc-status.st-done     { background: var(--surface-3); color: var(--text-dim); box-shadow: inset 0 0 0 1px var(--border-2); }

/* Activity ticker — a continuous marquee of live lobby events (forming / drafting / winners). Edge-faded
   via a mask; rebuilt only when the feed changes (see lobby.js) so the scroll never jitters on poll. */
.lobby-ticker {
  overflow: hidden;
  margin-top: var(--s5);
  border: 1px solid var(--border);
  border-radius: var(--r-pill);
  background: linear-gradient(180deg, var(--surface), var(--bg-elev));
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 5%, #000 95%, transparent);
  mask-image: linear-gradient(90deg, transparent, #000 5%, #000 95%, transparent);
}
.lobby-ticker:empty { display: none; }
.ticker-track {
  display: inline-flex;
  align-items: center;
  white-space: nowrap;
  padding-block: 11px;
  animation: ticker-scroll linear infinite;
  will-change: transform;
}
.tick-item { font: 600 var(--fs-sm)/1 var(--font-ui); color: var(--text-dim); margin-right: var(--s7); }
@keyframes ticker-scroll { from { transform: translateX(0); } to { transform: translateX(-50%); } }
@media (prefers-reduced-motion: reduce) { .ticker-track { animation: none; } }

.lc-body { padding: 0 var(--s4) var(--s4); display: flex; flex-direction: column; gap: var(--s2); }
.lc-top { display: flex; align-items: center; justify-content: space-between; gap: var(--s3); }
.lc-name { font: 700 var(--fs-lg)/1.1 var(--font-display); }
.tag-chip { font: 700 var(--fs-xs)/1 var(--font-ui); padding: 4px 9px; border-radius: var(--r-pill); border: 1px solid var(--border-2); white-space: nowrap; color: var(--text-dim); }
.tag-chip.tier-bronze { color: #cf9a5e; border-color: #c0845766; background: rgba(192, 132, 87, .10); }
.tag-chip.tier-silver { color: #c8ccd1; border-color: #aab4c266; background: rgba(170, 180, 194, .10); }
.tag-chip.tier-gold   { color: var(--gold); border-color: #d9a94e66; background: var(--gold-soft); }
/* Sealed-table badge — a distinct teal accent so the mode reads apart from the gold/tier chips. */
.tag-chip.mode-sealed { color: #5fd1bd; border-color: #3fae9a66; background: rgba(63, 174, 154, .10); }
.lc-sub { display: flex; align-items: center; justify-content: space-between; gap: var(--s2); }
.lc-meta { color: var(--text-mute); font-size: var(--fs-sm); letter-spacing: .04em; text-transform: uppercase; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lc-when { color: var(--text-mute); font-size: var(--fs-xs); white-space: nowrap; flex: 0 0 auto; }
.lc-fill { display: flex; align-items: center; gap: var(--s3); margin-top: 2px; }
.lc-bar { flex: 1; height: 7px; background: var(--surface-2); border-radius: var(--r-pill); overflow: hidden; box-shadow: inset 0 0 0 1px var(--border); }
.lc-bar > i { display: block; height: 100%; border-radius: inherit; background: linear-gradient(90deg, var(--gold-2), var(--gold)); transition: width var(--dur-3) var(--ease); }
.lc-seats { font: 800 var(--fs-sm)/1 var(--font-display); color: var(--text-dim); min-width: 36px; text-align: right; }
.lc-cta { display: flex; align-items: center; gap: 6px; margin-top: var(--s2); font: 700 var(--fs-md)/1 var(--font-ui); color: var(--text-dim); }
.lc-arrow { transition: transform var(--dur-2) var(--ease); }
.lobby-card.st-open .lc-cta { color: var(--gold); }
.lobby-card.st-done .lc-cta { color: var(--text-mute); }
.lobby-card:hover .lc-arrow { transform: translateX(4px); }
.table-asset { position: relative; width: 100%; aspect-ratio: 4 / 3; image-rendering: pixelated; }
.table-wood {
  position: absolute; inset: 16% 8%; border-radius: 3px;
  background: repeating-linear-gradient(90deg, #8a5a2b 0 13px, #7c4f25 13px 15px);
  border: 4px solid #2f1c0e;
  box-shadow: inset 0 0 0 2px #a4703a, inset 0 -7px 0 rgba(0,0,0,.28), 0 4px 0 #241208;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
  text-align: center; padding: var(--s3);
}
.lobby-card.st-open:hover .table-wood { border-color: var(--gold); }
.table-name { font: 700 var(--fs-sm)/1.1 var(--font-display); color: #fff4e0; text-shadow: 1px 1px 0 #2f1c0e; }
.table-type { font-size: var(--fs-xs); color: #f0d9b5; }
.table-set { font: 700 var(--fs-xs)/1 var(--font-ui); letter-spacing: .06em; color: #ffe1ad; text-shadow: 1px 1px 0 #2f1c0e; }
.table-count { font: 800 var(--fs-md)/1 var(--font-display); color: #ffd479; text-shadow: 1px 1px 0 #2f1c0e; margin-top: 2px; }
.table-status { margin-top: 3px; font: 700 9px/1 var(--font-ui); letter-spacing: .08em; padding: 3px 7px; border-radius: 3px; }
.table-status.open { background: #2f7d4f; color: #d8ffe6; }
.table-status.started { background: #b6862a; color: #fff3d6; }
.table-status.done { background: #4a3b2a; color: #d8c6ad; }
.seat {
  position: absolute; width: 15%; height: 15%; transform: translate(-50%, -50%); border-radius: 2px;
  background: #6b4423; border: 3px solid #2f1c0e; box-shadow: inset 0 0 0 2px #855a2e, 0 2px 0 #241208;
}
.seat.filled { background: #d29a4a; box-shadow: inset 0 0 0 2px #f0c277, 0 0 7px rgba(255,180,90,.65), 0 2px 0 #241208; }

/* Table (join) page — a flex column so the result panel + table view sit at even distances. */
.table-layout { display: flex; flex-direction: column; gap: var(--s5); margin-top: var(--s4); }

/* The "feast": a wooden tabletop ringed by chairs (3 top / 1 each side / 3 bottom), each chair showing
   its seated player + rank, with the action button on the table. */
.feast-wrap { display: flex; justify-content: center; }
.feast:not(.roster) {
  display: grid; gap: var(--s3); width: 100%; max-width: 760px;
  grid-template-columns: 1fr 1.7fr 1fr;
  grid-template-areas:
    "s0 s1 s2"
    "s7 tt s3"
    "s6 s5 s4";
}
.fseat {
  display: flex; flex-direction: column; align-items: center; justify-content: flex-start; gap: 3px;
  padding: var(--s3) var(--s2); min-height: 96px; border-radius: var(--r2); text-align: center;
  background: var(--surface-2); border: 1px solid var(--border);
  transition: border-color var(--dur-2), box-shadow var(--dur-2), transform var(--dur-2) var(--ease);
}
.fseat.filled { background: var(--surface-3); }
.fseat.empty { border-style: dashed; opacity: .65; }
.fseat.mine { border-color: #2ecc71; box-shadow: 0 0 0 2px #2ecc71, 0 0 18px rgba(46,204,113,.35); }
.fseat-nm { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font: 600 var(--fs-sm)/1.15 var(--font-ui); color: var(--text); }
.fseat-nm.muted { color: var(--text-mute); font-weight: 500; }
.fseat-tier { font-size: var(--fs-xs); font-weight: 700; text-transform: capitalize; }
.fseat-you { font: 800 9px/1 var(--font-ui); letter-spacing: .12em; color: #2ecc71; }
.chair-ico { line-height: 0; } .chair-svg { display: block; }
/* The tabletop in the middle. */
.feast-table {
  grid-area: tt; align-self: stretch;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px;
  border-radius: 6px; padding: var(--s4) var(--s3);
  background: repeating-linear-gradient(90deg, #8a5a2b 0 14px, #7c4f25 14px 16px);
  border: 4px solid #2f1c0e;
  box-shadow: inset 0 0 0 2px #a4703a, inset 0 -8px 0 rgba(0,0,0,.28), 0 4px 0 #241208;
}
.feast-action { margin-top: var(--s3); width: 100%; }
.feast-action .btn { width: 100%; }
.seat-actions { display: flex; flex-direction: column; align-items: center; gap: var(--s2); }
.seat-actions .btn { width: 100%; }
.seated-note { font-size: var(--fs-xs); color: var(--text-mute); text-align: center; }

/* Bigger-pod roster (>8 seats): the wooden ring doesn't scale, so render a compact responsive grid of
   seat chips with the tabletop stacked on top. */
.feast.roster { display: flex; flex-direction: column; gap: var(--s4); width: 100%; max-width: 760px; }
.feast.roster .feast-table { align-self: stretch; }
.roster-head { font: 700 var(--fs-sm)/1 var(--font-ui); color: var(--text-dim); text-align: center; letter-spacing: .04em; text-transform: uppercase; }
.roster-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: var(--s2); }
.rseat {
  display: flex; align-items: center; gap: var(--s2); min-width: 0;
  padding: var(--s2) var(--s3); border-radius: var(--r2);
  background: var(--surface-2); border: 1px solid var(--border);
}
.rseat.filled { background: var(--surface-3); }
.rseat.empty { border-style: dashed; opacity: .6; }
.rseat.mine { border-color: #2ecc71; box-shadow: 0 0 0 1px #2ecc71, 0 0 12px rgba(46, 204, 113, .3); }
.rseat-n { flex: 0 0 auto; width: 22px; font: 700 var(--fs-xs)/1 var(--font-display); color: var(--text-mute); text-align: right; }
.rseat-nm { flex: 1 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font: 600 var(--fs-sm)/1.15 var(--font-ui); color: var(--text); }
.rseat-nm.muted { color: var(--text-mute); font-weight: 500; }
.rseat-tier { flex: 0 0 auto; font-size: var(--fs-xs); font-weight: 700; text-transform: capitalize; }
.rseat-you { flex: 0 0 auto; font: 800 9px/1 var(--font-ui); letter-spacing: .1em; color: #2ecc71; }

/* Bigger-pod size pill stamped on the wooden tabletop (lobby card asset) instead of the 8-stool ring. */
.table-size-pill {
  position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%);
  font: 800 var(--fs-sm)/1 var(--font-display); color: #fff4e0; text-shadow: 1px 1px 0 #2f1c0e;
  padding: 5px 12px; border-radius: var(--r-pill); white-space: nowrap;
  background: rgba(47, 28, 14, .55); box-shadow: inset 0 0 0 1px rgba(255, 225, 173, .5);
}

/* Leaderboard — op.gg-style ranked ladder (its own page) */
.ladder { display: flex; flex-direction: column; gap: 4px; }
.ladder-row {
  display: grid; grid-template-columns: 52px 150px 1fr 84px 168px; gap: var(--s3); align-items: center;
  padding: var(--s3) var(--s4); border-radius: var(--r2); background: var(--surface-2); border: 1px solid var(--border);
}
.ladder-row.h { background: none; border: 0; padding: 0 var(--s4) var(--s2); color: var(--text-mute); font: 600 var(--fs-xs)/1 var(--font-ui); text-transform: uppercase; letter-spacing: .04em; }
.ladder-rank { text-align: center; font: 700 var(--fs-md)/1 var(--font-display); color: var(--text-mute); }
.ladder-rank.top { font-size: var(--fs-lg); }
.ladder-tier { font: 700 var(--fs-md)/1 var(--font-ui); text-transform: capitalize; }
.ladder-name { font: 600 var(--fs-md)/1 var(--font-ui); color: var(--text); }
.ladder-num { font: 700 var(--fs-md)/1 var(--font-display); }
.ladder-num.elo { color: var(--gold); }
.wr { display: flex; align-items: center; gap: 8px; }
.wr-bar { flex: 1; height: 8px; border-radius: 6px; background: var(--red); overflow: hidden; }
.wr-bar > i { display: block; height: 100%; background: var(--green); }
.wr-txt { font-size: var(--fs-xs); color: var(--text-dim); white-space: nowrap; }
.tier-bronze { color: #cf9a5e; } .tier-silver { color: #c8ccd1; } .tier-gold { color: #f0c674; }
.tier-platinum { color: #6fd3c4; } .tier-diamond { color: #87c3ff; } .tier-mythic { color: #ff7bc2; }

/* Narrow screens: stack the table on top, then the chairs two-per-row. */
@media (max-width: 560px) {
  .feast:not(.roster) {
    grid-template-columns: 1fr 1fr;
    grid-template-areas: "tt tt" "s0 s1" "s2 s3" "s4 s5" "s6 s7";
  }
}
@media (max-width: 680px) { .ladder-row { grid-template-columns: 36px 76px 1fr 56px 110px; } }

/* ---- Tournament podium (finished table) — steps rise + crown drops, staggered bronze→silver→gold ---- */
.podium { display: flex; align-items: flex-end; justify-content: center; gap: var(--s4); min-height: 280px; margin: var(--s6) 0 var(--s4); }
.pod-place { display: flex; flex-direction: column; align-items: center; width: 132px; max-width: 30vw; }
.pod-info { text-align: center; margin-bottom: var(--s3); opacity: 0; transform: translateY(12px); animation: pod-info var(--dur-3) var(--ease) forwards; }
.pod-medal { font-size: 30px; line-height: 1; }
.pod-crown { font-size: 38px; line-height: 1; filter: drop-shadow(0 6px 16px rgba(240, 198, 116, .5)); animation: pod-crown-drop 640ms var(--ease) 900ms both; }
.pod-name { font: 700 var(--fs-md)/1.15 var(--font-display); color: var(--text); margin-top: 4px; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pod-sub { font-size: var(--fs-xs); color: var(--text-dim); text-transform: capitalize; }
.pod-elo { font: 700 var(--fs-sm)/1 var(--font-display); color: var(--gold); margin-top: 2px; }
.pod-step { width: 100%; border-radius: var(--r2) var(--r2) 0 0; display: flex; justify-content: center; transform: scaleY(0); transform-origin: bottom; animation: pod-rise 520ms var(--ease) forwards; box-shadow: inset 0 2px 0 rgba(255, 255, 255, .25); }
.pod-rank-num { font: 800 var(--fs-2xl)/1 var(--font-display); color: rgba(0, 0, 0, .42); margin-top: 10px; }
.p1 .pod-step { height: 156px; background: linear-gradient(180deg, #ffe08a, #f0c674); }
.p2 .pod-step { height: 112px; background: linear-gradient(180deg, #eef1f5, #c8ccd1); }
.p3 .pod-step { height: 82px;  background: linear-gradient(180deg, #e7b079, #cf9a5e); }
.p3 .pod-step { animation-delay: 60ms; }  .p3 .pod-info { animation-delay: 260ms; }
.p2 .pod-step { animation-delay: 320ms; } .p2 .pod-info { animation-delay: 520ms; }
.p1 .pod-step { animation-delay: 580ms; } .p1 .pod-info { animation-delay: 800ms; }
.podium-cta { display: flex; justify-content: center; margin-top: var(--s2); }
@keyframes pod-rise { from { transform: scaleY(0); } to { transform: scaleY(1); } }
@keyframes pod-info { to { opacity: 1; transform: none; } }
@keyframes pod-crown-drop {
  0%   { opacity: 0; transform: translateY(-26px) rotate(-12deg); }
  60%  { opacity: 1; transform: translateY(4px) rotate(3deg); }
  100% { transform: translateY(0) rotate(0); }
}
@media (prefers-reduced-motion: reduce) {
  .pod-step, .pod-info, .pod-crown { animation: none; transform: none; opacity: 1; }
}
@media (max-width: 560px) { .pod-place { width: 98px; } .pod-rank-num { font-size: var(--fs-xl); } }

/* Finished-table result panel: the podium, the see-deck CTA, then the full field — coherently spaced. */
.result-panel { width: 100%; max-width: 680px; margin: 0 auto; } /* gap on .table-layout handles spacing */
.podium-cta { display: flex; justify-content: center; margin-top: var(--s4); }
.placings { display: flex; flex-direction: column; gap: 4px; margin-top: var(--s3); }
.placing-row { display: grid; grid-template-columns: 44px 1fr auto auto; gap: var(--s4); align-items: center; padding: var(--s2) var(--s4); border-radius: var(--r2); background: var(--surface-2); }
.placing-rank { color: var(--text-mute); font: 700 var(--fs-sm)/1 var(--font-display); }
.placing-name { font: 600 var(--fs-md)/1 var(--font-ui); color: var(--text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.placing-tier { text-transform: capitalize; font-weight: 700; font-size: var(--fs-sm); }
.placing-elo { font: 700 var(--fs-md)/1 var(--font-display); color: var(--text); white-space: nowrap; }
/* ELO delta badge — green up, red down (the new number itself tweens via JS). */
.elo-delta { font-size: var(--fs-xs); font-weight: 700; color: var(--text-mute); }
.elo-up { color: var(--green); }
.elo-down { color: var(--red); }

/* Back link pinned to the top-left of a view (first child, outside the centered hero). */
.back-top { display: inline-flex; align-items: center; margin-bottom: var(--s4); }

/* Inline golden-trophy icon (replaces the 🏆 emoji). */
.trophy-ico { display: inline-flex; vertical-align: -0.18em; line-height: 0; }
.trophy-svg { display: block; filter: drop-shadow(0 1px 1.5px rgba(0, 0, 0, .35)); }

/* Onboarding — first-run nickname picker (P5 auth). */
.onboard { max-width: 460px; margin: 0 auto; display: flex; flex-direction: column; gap: var(--s4); }
.onboard-input { width: 100%; }
.onboard-hint { color: var(--text-mute); }
.onboard-status { min-height: 1.2em; font: 600 var(--fs-sm)/1.2 var(--font-ui); }
.onboard-status.ok { color: var(--green); }
.onboard-status.warn { color: var(--red); }
.onboard-status.muted { color: var(--text-mute); }

/* Arena Live — the read-only, log-driven draft coach (localhost tool). Reuses .pack-grid / .card-tile /
   .pool-rail from the draft room; the rules below are just its own chrome. */
.live-head { display: flex; align-items: baseline; gap: var(--s3); flex-wrap: wrap; margin-bottom: var(--s4); }
.live-head h1 { margin: 0; }
/* A "watching Arena" pulse (reuses .live-dot from the lobby). */
.live-badge { display: inline-flex; align-items: center; gap: 7px; font: 700 var(--fs-xs)/1 var(--font-ui); text-transform: uppercase; letter-spacing: .06em; color: var(--text-mute); }

/* Non-drafting states: waiting / can't-find-Arena / set-not-installed — one centered card. */
.live-status { max-width: 560px; margin: 8vh auto 0; text-align: center; background: linear-gradient(180deg, var(--surface), var(--bg-elev)); border: 1px solid var(--border); border-radius: var(--r4); padding: var(--s6) var(--s5); box-shadow: var(--shadow-2); }
.live-status-ico { font-size: 44px; line-height: 1; margin-bottom: var(--s3); }
.live-status h2 { margin: 0 0 var(--s2); }
.live-steps { text-align: left; max-width: 440px; margin: var(--s4) auto 0; display: flex; flex-direction: column; gap: var(--s2); color: var(--text-dim); font-size: var(--fs-sm); padding-left: 1.2em; }

/* Recommendation callout above the live pack. */
.live-rec { border: 1px solid var(--gold); background: var(--gold-soft); border-radius: var(--r3); padding: var(--s3) var(--s4); margin-bottom: var(--s4); }
.live-rec-lead { display: flex; align-items: center; gap: var(--s2); flex-wrap: wrap; }
.live-rec-lead .rec-flag { color: var(--gold); font-size: var(--fs-lg); }
.live-rec-name { font: 700 var(--fs-lg)/1 var(--font-display); color: var(--text); }
.live-rec-why { margin: var(--s2) 0 0; padding-left: 1.2em; color: var(--text-dim); font-size: var(--fs-sm); display: flex; flex-direction: column; gap: 2px; }

/* Completed-draft grade banner + deck. */
.live-grade { display: flex; align-items: center; gap: var(--s4); margin-bottom: var(--s3); }
.live-grade-letter { font: 800 40px/1 var(--font-display); color: var(--gold); }
.live-grade-total { font: 700 var(--fs-xl)/1 var(--font-display); color: var(--text); }
.live-tools { display: flex; align-items: center; gap: var(--s2); margin: 0 0 var(--s3); flex-wrap: wrap; }
.live-tools .tool-label { font: 600 var(--fs-xs)/1 var(--font-ui); text-transform: uppercase; letter-spacing: .06em; color: var(--text-mute); }
.live-deck { display: flex; flex-direction: column; gap: var(--s3); }
.live-deck .grp-h { margin: var(--s3) 0 2px; }
.live-sb { margin-top: var(--s5); }
.live-exwrap { margin-top: var(--s4); }
.live-exwrap summary { cursor: pointer; color: var(--text-dim); font-weight: 600; }
.live-export { width: 100%; margin-top: var(--s2); font-family: var(--font-mono, monospace); font-size: var(--fs-sm); background: var(--surface-2); color: var(--text); border: 1px solid var(--border); border-radius: var(--r2); padding: var(--s3); resize: vertical; }
.onboard .btn-primary { align-self: flex-start; }

/* Top-nav auth (P5c): compact login button / user chip / logout, right-aligned in the bar. */
.topnav { align-items: center; }
.nav-login, .nav-logout { padding: 6px 12px; font-size: var(--fs-sm); }
.nav-user { display: inline-flex; align-items: baseline; gap: 7px; font: 600 var(--fs-sm)/1 var(--font-ui); }
.nav-name { color: var(--text); }            /* white name; the tier color falls to the rank below */
.nav-rank { font-size: var(--fs-xs); font-weight: 700; text-transform: capitalize; }
.nav-user { text-decoration: none; }
.nav-user:hover .nav-name { color: var(--gold); }

/* Profile (P5d): the player's account stats. */
.profile { max-width: 560px; margin: 0 auto; }
.profile-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: var(--s4); }
.profile-stat { background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--r2); padding: var(--s4); }
.profile-stat-label { font: 700 var(--fs-xs)/1 var(--font-ui); text-transform: uppercase; letter-spacing: .07em; color: var(--text-mute); margin-bottom: 6px; }
.profile-stat-value { font: 700 var(--fs-lg)/1 var(--font-display); color: var(--text); }
.profile-rank { margin-top: var(--s4); text-align: center; }

/* Leaderboard "You" highlight (P5d). */
.ladder-row.me { border-color: var(--gold); box-shadow: 0 0 0 1px var(--gold-soft); background: var(--gold-soft); }
.you-badge { margin-left: 8px; padding: 1px 7px; border-radius: var(--r-pill); background: var(--gold); color: #2a1d05; font: 800 var(--fs-xs)/1.4 var(--font-ui); vertical-align: middle; }

/* Admin console (URL-only /admin). */
.admin-hero { padding: var(--s7) 0 var(--s5); }
.admin-select {
  background: var(--surface-2); color: var(--text);
  border: 1px solid var(--border-2); border-radius: var(--r2);
  padding: 11px 14px; font: 500 var(--fs-sm)/1 var(--font-ui);
}
.admin-select:focus { outline: none; border-color: var(--gold); box-shadow: 0 0 0 3px var(--gold-soft); }
.admin-input { min-width: 0; }

/* One-off status banner after an action. */
.admin-banner { margin: 0 0 var(--s5); padding: 12px 16px; border-radius: var(--r2); border: 1px solid var(--border-2); font: 500 var(--fs-sm)/1.4 var(--font-ui); }
.admin-banner.ok { border-color: #3fae9a66; background: rgba(63, 174, 154, .10); color: #7fe0cd; }
.admin-banner.err { border-color: #c0576966; background: rgba(192, 87, 105, .12); color: #f0a0ac; }
.admin-banner.pending { color: var(--text-dim); }

/* Add / fetch a set. */
.admin-add { margin-bottom: var(--s5); }
.admin-form { display: flex; flex-wrap: wrap; align-items: flex-end; gap: var(--s4); }
.admin-field { display: flex; flex-direction: column; gap: 6px; }
.admin-flabel { font: 700 var(--fs-xs)/1 var(--font-ui); text-transform: uppercase; letter-spacing: .07em; color: var(--text-mute); }

/* Per-set inspector cards. */
.admin-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(360px, 1fr)); gap: var(--s4); }
.admin-skel { height: 220px; border-radius: var(--r4); }
.admin-set.uninstalled { opacity: .82; border-style: dashed; }
.admin-set-head { display: flex; align-items: center; justify-content: space-between; gap: var(--s3); margin-bottom: var(--s4); }
.admin-set-head h2 { margin: 0; font: 700 var(--fs-xl)/1 var(--font-display); }
.admin-tag { font: 700 var(--fs-xs)/1 var(--font-ui); text-transform: uppercase; letter-spacing: .06em; padding: 4px 9px; border-radius: var(--r-pill); border: 1px solid var(--border-2); }
.admin-tag.on { color: var(--green); border-color: #3fae9a66; background: rgba(63, 174, 154, .10); }
.admin-tag.off { color: var(--text-mute); }

.admin-stats { display: grid; grid-template-columns: repeat(2, 1fr); gap: var(--s2) var(--s4); margin-bottom: var(--s4); }
.admin-stat { display: flex; justify-content: space-between; gap: var(--s3); padding: 8px 10px; background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--r2); }
.admin-slabel { color: var(--text-mute); font: 600 var(--fs-xs)/1.4 var(--font-ui); text-transform: uppercase; letter-spacing: .05em; }
.admin-stat strong { font: 700 var(--fs-sm)/1.4 var(--font-display); color: var(--text); }

.admin-disk { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-bottom: var(--s4); }
.admin-chip { font: 600 var(--fs-xs)/1 var(--font-ui); padding: 5px 9px; border-radius: var(--r-pill); border: 1px solid var(--border-2); color: var(--text-dim); }

.admin-actions { display: flex; flex-wrap: wrap; align-items: flex-end; gap: var(--s3); border-top: 1px solid var(--border); padding-top: var(--s4); }
.admin-actions .btn { flex: 0 0 auto; }
.admin-stub { max-width: 520px; margin: 0 auto; }
