/* The app's look (Views.swift) as plain CSS: the felt, the cards, the
   tiles, the info column. Always dark, like the app. */
:root {
  color-scheme: dark;
  --felt-top: rgb(23 56 41);
  --felt-bottom: rgb(13 31 23);
  --ink: #f2f4f3;
  --secondary: rgb(235 240 245 / 0.62);
  --tertiary: rgb(235 240 245 / 0.34);
  --quaternary: rgb(235 240 245 / 0.2);
  --panel: rgb(255 255 255 / 0.05);
  --line: rgb(255 255 255 / 0.15);
  --orange: #ff9f0a;
  --red: #ff453a;
  --green: #30d158;
  --card-top: rgb(237 242 255);
  --card-bottom: rgb(191 209 242);
  --card-ink: rgb(26 38 89);
  --pc-w: 66px; --pc-h: 94px;
  --pcs-w: 52px; --pcs-h: 74px;
  --prize-w: 108px; --prize-h: 148px;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { margin: 0; min-height: 100%; }
body {
  color: var(--ink); background: linear-gradient(var(--felt-top), var(--felt-bottom)) fixed;
  font: 13px/1.35 -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", Roboto, sans-serif;
  -webkit-font-smoothing: antialiased; font-variant-numeric: tabular-nums;
}
h1, h2, h3, h4, p { margin: 0; }
.muted { color: var(--secondary); }
.faint { color: var(--tertiary); }
.small { font-size: 12px; }
.tiny { font-size: 10px; }
.ink { color: var(--ink); }
.grow { flex: 1; }
.dot { display: inline-block; width: 10px; height: 10px; border-radius: 50%; flex: none; }
.icon { display: inline-block; vertical-align: -2px; }

/* --- controls --------------------------------------------------------- */
button {
  font: inherit; color: var(--ink); cursor: pointer; border-radius: 7px;
  padding: 4px 11px; border: 0.5px solid rgb(255 255 255 / 0.18); background: rgb(255 255 255 / 0.1);
  box-shadow: 0 1px 1px rgb(0 0 0 / 0.2);
}
button:hover:not(:disabled) { background: rgb(255 255 255 / 0.17); }
button:disabled { opacity: 0.4; cursor: default; }
button:focus-visible, select:focus-visible, input:focus-visible, summary:focus-visible { outline: 2px solid var(--orange); outline-offset: 2px; }
button.primary { background: var(--orange); border-color: transparent; color: #fff; font-weight: 600; }
button.primary:hover:not(:disabled) { background: #ffb340; }
button.big { font-size: 15px; padding: 7px 26px; }
button.small { font-size: 11px; padding: 3px 9px; }
button.plain { background: none; border: 0; box-shadow: none; padding: 2px; color: var(--secondary); }
button.danger-text { color: #ff6961; }
button.danger { background: var(--red); border-color: transparent; color: #fff; font-weight: 600; }
select, input[type=text] {
  font: inherit; color: var(--ink); background: rgb(0 0 0 / 0.25);
  border: 0.5px solid rgb(255 255 255 / 0.2); border-radius: 6px; padding: 4px 6px;
}

.switch { display: inline-flex; align-items: center; gap: 5px; font-size: 11px; cursor: pointer; user-select: none; }
.switch input { position: absolute; opacity: 0; width: 0; height: 0; }
.switch .track { width: 24px; height: 14px; border-radius: 7px; background: rgb(255 255 255 / 0.2); position: relative; transition: background 0.15s; flex: none; }
.switch .track::after { content: ""; position: absolute; top: 1.5px; left: 1.5px; width: 11px; height: 11px; border-radius: 50%; background: #fff; transition: transform 0.15s; box-shadow: 0 1px 2px rgb(0 0 0 / 0.4); }
.switch input:checked + .track { background: #0a84ff; }
.switch input:checked + .track::after { transform: translateX(10px); }
.switch input:focus-visible + .track { outline: 2px solid var(--orange); outline-offset: 2px; }

/* --- boot, dialog, stamp --------------------------------------------- */
.boot { position: fixed; inset: 0; display: grid; place-items: center; font-size: 56px; animation: breathe 1.4s ease-in-out infinite; }
.boot.failed { font-size: 15px; animation: none; color: var(--secondary); padding: 16px; text-align: center; }
@keyframes breathe { 50% { opacity: 0.4; transform: scale(0.94); } }
.dialog { position: fixed; inset: 0; background: rgb(0 0 0 / 0.5); display: grid; place-items: center; z-index: 100; padding: 16px; }
.dialog-box { background: #26302b; border: 0.5px solid var(--line); border-radius: 14px; padding: 20px; width: min(340px, 100%); box-shadow: 0 20px 50px rgb(0 0 0 / 0.5); text-align: center; }
.dialog-box h3 { font-size: 15px; margin-bottom: 6px; }
.dialog-box p { color: var(--secondary); font-size: 12px; }
.dialog-buttons { display: flex; gap: 8px; justify-content: center; margin-top: 16px; }
.stamp { position: fixed; right: 8px; bottom: 3px; font-size: 9px; color: var(--tertiary); pointer-events: none; }

/* --- setup ------------------------------------------------------------- */
.setup { display: flex; flex-direction: column; align-items: center; gap: 22px; padding: 30px 16px; text-align: center; }
.hero { display: flex; flex-direction: column; align-items: center; gap: 6px; }
.hero-bird { font-size: 56px; line-height: 1.1; }
.hero h1 { font: 800 38px/1.1 ui-serif, Georgia, "Times New Roman", serif; }
.tabs { display: flex; padding: 2px; border-radius: 8px; background: rgb(0 0 0 / 0.25); width: min(420px, 100%); }
.tabs button { flex: 1; border: 0; background: none; box-shadow: none; padding: 3px 8px; border-radius: 6px; }
.tabs button.selected { background: rgb(255 255 255 / 0.2); box-shadow: 0 1px 2px rgb(0 0 0 / 0.3); }
.setup-card { width: min(560px, 100%); padding: 20px; border-radius: 16px; background: rgb(255 255 255 / 0.06); display: flex; flex-direction: column; gap: 14px; text-align: left; }
.setup-row, .bot-row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.setup-label { width: 110px; }
.avatar-picker { font-size: 16px; padding: 1px 4px; }
.name-field { width: 160px; }
.stepper { display: inline-flex; align-items: center; gap: 8px; }
.stepper button { padding: 0 9px; font-size: 15px; line-height: 20px; }
.stepper b { width: 18px; text-align: center; }
.bot-name { width: 110px; display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; overflow: hidden; }
.bot-row select { flex: 1 1 100px; min-width: 0; }
.setup-start { display: flex; justify-content: center; padding-top: 4px; }

/* --- the game screen: play column + info column ----------------------- */
.game { display: grid; grid-template-columns: minmax(0, 1fr) auto; height: 100dvh; }
.play { display: flex; flex-direction: column; min-width: 0; min-height: 0; }
.topbar { display: flex; gap: 10px; padding: 8px 12px; border-bottom: 0.5px solid var(--line); position: relative; z-index: 2; }
.stage { flex: 1; min-height: 0; display: flex; flex-direction: column; overflow: auto; }

.player-tile { flex: 1; min-width: 0; position: relative; padding: 8px; border-radius: 10px; background: var(--panel); border: 1.5px solid var(--c); display: flex; flex-direction: column; gap: 5px; }
.tile-head { display: flex; align-items: center; gap: 7px; }
.tile-name { display: flex; flex-direction: column; min-width: 0; flex: 1; }
.tile-name b { font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tile-name small { font-size: 9px; color: var(--secondary); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.avatar { width: 26px; height: 26px; flex: none; border-radius: 50%; display: grid; place-items: center; font-size: 14px; background: var(--fill); box-shadow: inset 0 0 0 1.5px var(--c); }
.score { display: flex; flex-direction: column; align-items: flex-end; line-height: 1.05; }
.score b { font-size: 19px; }
.score b.negative { color: var(--red); }
.score small { font-size: 7px; color: var(--tertiary); letter-spacing: 0.02em; }
.hand-text { font: 500 10px/1.35 ui-monospace, "SF Mono", Menlo, monospace; color: var(--secondary); min-height: 2.7em; }
.hand-text.closed { font-style: italic; font-weight: 400; color: var(--quaternary); }
.won-prizes { display: flex; flex-wrap: wrap; gap: 3px; min-height: 30px; align-items: flex-start; }
.won-prizes.none { font-size: 9px; color: var(--quaternary); align-items: center; }

/* --- the table ---------------------------------------------------------- */
.table-view { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 18px; padding: 0 16px; }
.filler { flex: 1; min-height: 4px; }
.table-row { display: flex; align-items: center; justify-content: center; gap: 26px; flex-wrap: wrap; }
.bots-group { display: flex; gap: 14px; }
.table-col { display: flex; flex-direction: column; align-items: center; gap: 6px; }
.col-label { font-size: 12px; font-weight: 700; white-space: nowrap; }
.col-label.stake { color: var(--orange); }
.prize-fan { position: relative; height: var(--prize-h); }
.prize-fan .prize-card { position: absolute; left: 50%; top: 0; margin-left: calc(var(--prize-w) / -2); transform-origin: 50% 90%; }
.deck-left { font-size: 9px; color: var(--tertiary); white-space: nowrap; }
.status { min-height: 72px; display: flex; flex-direction: column; align-items: center; gap: 10px; text-align: center; }
.status p { font-size: 13px; }
.result { font-size: 18px; font-weight: 600; max-width: 640px; }

/* --- cards --------------------------------------------------------------- */
.prize-card {
  width: var(--prize-w); height: var(--prize-h); border-radius: 14px; flex: none;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px;
  box-shadow: 0 4px 16px rgb(0 0 0 / 0.45);
}
.prize-card.mouse { background: linear-gradient(rgb(250 209 89), rgb(230 158 38)); color: #000; }
.prize-card.vulture { background: linear-gradient(rgb(166 38 38), rgb(102 13 26)); color: #fff; }
.prize-card .face { font-size: 36px; line-height: 1; }
.prize-card .value { font-size: 30px; font-weight: 900; line-height: 1; }
.prize-card .caption { font-size: 7px; font-weight: 700; opacity: 0.65; text-align: center; white-space: pre-line; }

.tiny-prize { width: 22px; height: 30px; border-radius: 4px; display: flex; flex-direction: column; align-items: center; justify-content: center; line-height: 1; box-shadow: 0 1px 1px rgb(0 0 0 / 0.4); }
.tiny-prize span { font-size: 8px; }
.tiny-prize b { font-size: 9px; font-weight: 900; }
.tiny-prize.mouse { background: linear-gradient(rgb(250 209 89), rgb(230 158 38)); color: #000; }
.tiny-prize.vulture { background: linear-gradient(rgb(166 38 38), rgb(102 13 26)); color: #fff; }

.playing-card {
  width: var(--pc-w); height: var(--pc-h); border-radius: 9px; position: relative; flex: none;
  display: grid; place-items: center; padding: 0; border: 0;
  background: linear-gradient(rgb(237 242 255), rgb(191 209 242)); color: var(--card-ink);
  box-shadow: 0 2px 6px rgb(0 0 0 / 0.4);
}
.playing-card .big { font-size: 26px; font-weight: 700; }
.playing-card .corner { position: absolute; font-size: 10px; font-weight: 700; opacity: 0.55; line-height: 1; }
.playing-card .corner.tl { top: 5px; left: 5px; }
.playing-card .corner.br { bottom: 5px; right: 5px; transform: rotate(180deg); }
.playing-card.small { width: var(--pcs-w); height: var(--pcs-h); border-radius: 7px; }
.playing-card.small .big { font-size: 20px; }
.playing-card.small .corner { font-size: 8px; }
.playing-card.small .corner.tl { top: 3px; left: 3px; }
.playing-card.small .corner.br { bottom: 3px; right: 3px; }
.playing-card.highlighted { box-shadow: 0 0 0 3px var(--orange), 0 4px 16px rgb(0 0 0 / 0.5); }
.playing-card.faded { opacity: 0.8; }
button.playing-card { cursor: pointer; transition: transform 0.12s; }
button.playing-card:hover:not(:disabled) { transform: translateY(-5px); background: linear-gradient(#fff, rgb(205 220 246)); }
button.playing-card:disabled { opacity: 0.45; }

.card-back {
  width: var(--pc-w); height: var(--pc-h); border-radius: 9px; flex: none; display: grid; place-items: center;
  background: linear-gradient(135deg, var(--c), var(--c2)); box-shadow: inset 0 0 0 1.5px var(--edge), 0 2px 6px rgb(0 0 0 / 0.4);
}
.card-back span { font-size: 20px; opacity: 0.5; }
.card-back.thinking { animation: breathe 1s ease-in-out infinite; }
.empty-slot { width: var(--pc-w); height: var(--pc-h); border-radius: 9px; border: 1.5px dashed rgb(255 255 255 / 0.35); display: grid; place-items: center; font-size: 22px; color: rgb(255 255 255 / 0.35); }
.flip { animation: flip 0.45s cubic-bezier(0.3, 1.4, 0.6, 1) both; }
@keyframes flip { from { transform: perspective(400px) rotateY(90deg) scale(0.9); } }

/* --- speech bubbles ------------------------------------------------------- */
.bubble-anchor { position: absolute; left: 50%; width: 0; display: flex; justify-content: center; z-index: 5; pointer-events: none; }
.bubble-anchor.below { top: 100%; align-items: flex-start; }
.bubble-anchor.above { bottom: 100%; align-items: flex-end; height: 0; }
.bubble-anchor .bubble { pointer-events: auto; }
.bubble { position: relative; filter: drop-shadow(0 2px 4px rgb(0 0 0 / 0.35)); }
.bubble-text, .bubble-input {
  width: 146px; padding: 5px 8px; border-radius: 8px; text-align: center;
  font-size: 10px; font-weight: 500; color: rgb(0 0 0 / 0.85); background: rgb(255 255 255 / 0.92);
  box-shadow: inset 0 0 0 1.5px var(--c);
}
.bubble::before { content: ""; position: absolute; left: 50%; margin-left: -6px; border: 6px solid transparent; }
.bubble.tail-top { margin-top: 7px; }
.bubble.tail-top::before { bottom: 100%; border-bottom: 7px solid rgb(255 255 255 / 0.92); border-top: 0; }
.bubble.tail-bottom { margin-bottom: 7px; }
.bubble.tail-bottom::before { top: 100%; border-top: 7px solid rgb(255 255 255 / 0.92); border-bottom: 0; }
.bubble.input .bubble-input { background: rgb(255 255 255 / 0.12); color: var(--ink); box-shadow: none; outline: 1.2px dashed var(--c); outline-offset: -1px; border: 0; }
.bubble.input::before { border-top-color: rgb(255 255 255 / 0.12); }
.bubble.input:focus-within .bubble-input, .bubble.input .bubble-input:not(:placeholder-shown) { background: rgb(255 255 255 / 0.92); color: rgb(0 0 0 / 0.85); outline: 1.5px solid var(--c); }
.bubble.input:focus-within::before { border-top-color: rgb(255 255 255 / 0.92); }
.bubble-input::placeholder { color: rgb(255 255 255 / 0.55); }
.bubble.input:focus-within .bubble-input::placeholder { color: rgb(0 0 0 / 0.35); }
.pop { animation: pop 0.35s cubic-bezier(0.3, 1.5, 0.6, 1) both; }
@keyframes pop { from { opacity: 0; transform: scale(0.6); } }

/* --- your panel ----------------------------------------------------------- */
.human-panel { position: relative; margin: 0 10px 10px; padding: 10px; border-radius: 12px; background: var(--panel); border: 1.5px solid rgb(89 204 242 / 0.45); display: flex; flex-direction: column; gap: 8px; z-index: 3; }
.panel-head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.hint-line { font-size: 11px; color: var(--orange); }
.hand { display: flex; gap: 6px; justify-content: center; flex-wrap: wrap; }
.hand-slot { display: flex; flex-direction: column; align-items: center; gap: 2px; }
.hint-pct { font-size: 8px; font-weight: 500; color: var(--secondary); }
.hint-pct.best { color: var(--orange); font-weight: 700; }
.panel-foot { display: flex; align-items: center; gap: 8px; }
.panel-foot .tile-name { flex: none; }

/* --- the info column ----------------------------------------------------- */
.sidebar { width: 310px; overflow-y: auto; padding: 10px; background: rgb(0 0 0 / 0.15); border-left: 0.5px solid var(--line); display: flex; flex-direction: column; gap: 12px; }
.side-head { margin-bottom: -6px; }
.game.side-off .topbar { padding-right: 44px; }
.sidebar-show { position: fixed; top: 6px; right: 6px; border-radius: 50%; padding: 6px; background: rgb(0 0 0 / 0.4); border: 0; color: var(--secondary); z-index: 10; line-height: 0; }
.side-card { padding: 10px; border-radius: 10px; background: var(--panel); display: flex; flex-direction: column; gap: 8px; }
.side-title { display: flex; justify-content: space-between; align-items: baseline; font-size: 11px; }
.side-title b { color: var(--secondary); font-size: 12px; }
.round-row { display: flex; align-items: center; gap: 6px; font-size: 11px; }
.round-row .rn { width: 24px; }
.prize-chip { width: 26px; text-align: center; font-weight: 700; border-radius: 3px; padding: 1px 0; }
.prize-chip.mouse { background: rgb(255 159 10 / 0.35); }
.prize-chip.vulture { background: rgb(255 69 58 / 0.4); }
.plays { display: inline-flex; gap: 2px; }
.strategy { display: flex; flex-direction: column; gap: 5px; padding: 2px 0; }
.strategy-head { display: flex; align-items: center; gap: 5px; white-space: nowrap; }
.strategy-head .label { min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.strategy-head .grow, .strategy-head b, .strategy-head .muted { flex: none; }
.strategy-head .grow { flex: 1 0 0; }
.strategy-head b { font-size: 12px; }
.chips { display: grid; grid-template-columns: repeat(auto-fill, minmax(52px, 1fr)); gap: 4px; }
.chip { display: inline-flex; gap: 3px; align-items: baseline; padding: 2px 5px; border-radius: 4px; background: var(--bg); box-shadow: inset 0 0 0 1px transparent; }
.chip b { color: var(--c); font-size: 11px; }
.chip span { font-size: 9px; color: var(--secondary); }
.chip.chosen { box-shadow: inset 0 0 0 1px var(--c); }
details.info { position: relative; display: inline-block; }
details.info summary { list-style: none; cursor: pointer; color: var(--secondary); line-height: 0; }
details.info summary::-webkit-details-marker { display: none; }
.popover { position: absolute; z-index: 20; top: 18px; left: -120px; width: min(320px, calc(100vw - 32px)); padding: 14px; border-radius: 12px; background: #2a3430; border: 0.5px solid var(--line); box-shadow: 0 12px 36px rgb(0 0 0 / 0.55); display: flex; flex-direction: column; gap: 8px; font-size: 12px; }
.popover h4 { font-size: 14px; }
.popover dl { display: grid; grid-template-columns: auto 1fr; gap: 3px 10px; margin: 0; padding-bottom: 8px; border-bottom: 0.5px solid var(--line); }
.popover dt { color: var(--secondary); }
.popover dd { margin: 0; }
.popover p { color: var(--secondary); }
details.rules summary { cursor: pointer; font-size: 12px; color: var(--secondary); }
details.rules p { margin-top: 6px; }

/* --- the finish view ------------------------------------------------------ */
.finish { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 24px; padding: 30px 16px; text-align: center; }
.finish h2 { font-size: 30px; }
.finish .headline { font-size: 20px; }
.final-board { padding: 20px; border-radius: 14px; background: rgb(255 255 255 / 0.06); display: flex; flex-direction: column; gap: 8px; max-width: 100%; }
.final-row { display: flex; align-items: center; gap: 10px; }
.final-name { width: 130px; text-align: left; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.final-score { width: 44px; text-align: right; }
.final-prizes { display: flex; gap: 3px; flex-wrap: wrap; }

/* --- narrower screens ------------------------------------------------------ */
@media (max-width: 900px) {
  .game { grid-template-columns: minmax(0, 1fr); height: auto; min-height: 100dvh; }
  .play { min-height: 100dvh; }
  .sidebar { width: auto; border-left: 0; border-top: 0.5px solid var(--line); }
}
@media (max-width: 640px) {
  :root { --pc-w: 42px; --pc-h: 60px; --pcs-w: 40px; --pcs-h: 58px; --prize-w: 76px; --prize-h: 106px; }
  .deck-left { white-space: normal; width: var(--prize-w); text-align: center; }
  .table-view .playing-card .big { font-size: 18px; }
  .table-view .playing-card .corner { font-size: 8px; }
  .card-back span { font-size: 15px; }
  .prize-card .caption { font-size: 6px; }
  .topbar { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
  .table-row { gap: 10px; }
  .bots-group { gap: 6px; }
  .col-label { font-size: 10px; }
  .stamp { display: none; }
  .prize-card .face { font-size: 28px; }
  .prize-card .value { font-size: 24px; }
  .playing-card .big { font-size: 20px; }
  .playing-card.small .big { font-size: 16px; }
  .hand { gap: 4px; }
  .result { font-size: 15px; }
  .panel-head .muted.small { display: none; }
  .hero h1 { font-size: 30px; }
  .setup-label, .bot-name { width: 100%; }
}

/* --- step 3/4: database, profiles, coach, arena, replay ------------------- */
button.link { background: none; border: 0; box-shadow: none; padding: 1px 3px; color: var(--orange); font-size: 11px; }
button.link:hover:not(:disabled) { background: none; text-decoration: underline; }
button.link.faint { color: var(--tertiary); }
button.teal { background: #30b0c7; }
button.teal:hover:not(:disabled) { background: #4cc4d9; }
.orange { color: var(--orange); }
.good { color: var(--green); }
.setup-body { width: min(620px, 100%); display: flex; justify-content: center; }
.setup-body > .setup-card { width: 100%; }
.segmented { display: inline-flex; padding: 2px; border-radius: 7px; background: rgb(0 0 0 / 0.25); }
.segmented button { border: 0; background: none; box-shadow: none; padding: 2px 9px; border-radius: 5px; font-size: 12px; }
.segmented button.selected { background: rgb(255 255 255 / 0.2); }
.roster-row { display: flex; align-items: center; gap: 6px; }
.roster-row .bot-row { flex: 1; }
.small-select { font-size: 11px; padding: 2px 4px; }
.spinner { display: inline-block; width: 10px; height: 10px; border-radius: 50%; border: 2px solid var(--tertiary); border-top-color: var(--orange); animation: spin 0.8s linear infinite; vertical-align: -1px; }
@keyframes spin { to { transform: rotate(360deg); } }

.profile-card { padding: 10px; border-radius: 10px; background: rgb(255 255 255 / 0.04); display: flex; flex-direction: column; gap: 6px; }
.profile-head { display: flex; justify-content: space-between; gap: 10px; flex-wrap: wrap; font-size: 12px; }
details.coach summary { cursor: pointer; color: var(--orange); font-weight: 700; font-size: 12px; }
details.coach > div, details.coach > p { margin-top: 6px; }
.coach-results { display: flex; flex-direction: column; gap: 4px; }
.coach-headline { color: var(--orange); font-weight: 700; font-size: 11px; }
.blunder button.link { font-size: 10px; }

.setup-card.db { gap: 10px; }
.db-scroll { max-height: min(460px, 60vh); overflow-y: auto; display: flex; flex-direction: column; gap: 16px; padding-right: 4px; }
.db-section { display: flex; flex-direction: column; gap: 6px; }
.db-head { display: flex; align-items: center; gap: 8px; font-size: 12px; }
.db-head b { font-size: 12px; }
.db-row { padding: 4px 10px; border-radius: 8px; background: rgb(255 255 255 / 0.04); }
.db-row > summary { display: flex; align-items: center; gap: 8px; cursor: pointer; font-size: 12px; list-style: none; flex-wrap: wrap; min-height: 26px; }
.db-row > summary::-webkit-details-marker { display: none; }
.db-row > summary::before { content: "›"; color: var(--tertiary); transition: transform 0.15s; display: inline-block; width: 8px; }
.db-row[open] > summary::before { transform: rotate(90deg); }
.rank { width: 30px; color: var(--secondary); font-size: 12px; }
.rank.first { color: var(--orange); }
.trophy { width: 20px; text-align: center; }
.rating { color: var(--orange); }
.date { white-space: nowrap; }
.star { color: var(--tertiary); }
.star.on { color: #ffd60a; }
.db-detail { display: flex; flex-direction: column; gap: 4px; padding: 6px 0 4px 16px; font-size: 11px; }
.db-detail p { font-size: 10px; }
.db-detail hr { border: 0; border-top: 0.5px solid var(--line); width: 100%; margin: 4px 0; }
.db-detail-foot { display: flex; align-items: center; gap: 8px; margin-top: 4px; }
.db-foot { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; border-top: 0.5px solid var(--line); padding-top: 10px; }
.empty { padding: 8px 0; }
details.info.right .popover { left: auto; right: -8px; }
.popover code { font-size: 11px; color: var(--ink); }

.table-scroll { overflow-x: auto; max-width: 100%; }
.grid-table { border-collapse: collapse; font-size: 11px; }
.grid-table th, .grid-table td { padding: 3px 7px; text-align: left; white-space: nowrap; }
.grid-table th { font-size: 10px; color: var(--secondary); }
.grid-table .num { text-align: right; font-variant-numeric: tabular-nums; }
.grid-table.cross th, .grid-table.cross td { text-align: center; }
.grid-table.cross th.left { text-align: left; }
.grid-table td.lead { color: rgb(48 209 88 / 0.9); }
.grid-table td.trail { color: rgb(255 69 58 / 0.85); }
.grid-table td.best { color: var(--orange); font-weight: 700; }

.arena-screen { min-height: 100dvh; }
.arena { display: flex; flex-direction: column; align-items: center; gap: 20px; padding: 30px 16px; text-align: center; }
.arena h2 { font-size: 30px; }
.arena-progress { display: flex; flex-direction: column; align-items: center; gap: 6px; }
.arena-progress b { font-size: 15px; }
.arena-progress progress { width: min(440px, 90vw); accent-color: var(--orange); }
.panel-box { padding: 14px 18px; border-radius: 14px; background: rgb(255 255 255 / 0.06); }
.standings { font-size: 13px; }
.standings th { font-size: 11px; }
.standings td, .standings th { padding: 5px 9px; }
.who { display: inline-flex; align-items: center; gap: 6px; }
.arena-grids { display: flex; gap: 16px; flex-wrap: wrap; justify-content: center; max-width: 100%; }

.transport-slot { display: flex; align-items: center; justify-content: center; }
.transport {
  display: inline-flex; align-items: center; gap: 12px; padding: 10px 16px; border-radius: 999px; white-space: nowrap;
  background: rgb(20 30 26 / 0.55); backdrop-filter: blur(14px) saturate(1.3); -webkit-backdrop-filter: blur(14px) saturate(1.3);
  box-shadow: inset 0 0 0 2px rgb(255 159 10 / 0.55), 0 6px 24px rgb(0 0 0 / 0.55);
}
.transport-title { display: inline-flex; align-items: center; gap: 4px; color: var(--orange); font-weight: 700; font-size: 12px; }
.tgroup { display: inline-flex; align-items: center; gap: 4px; }
.tbtn { background: none; border: 0; box-shadow: none; padding: 0; width: 22px; height: 18px; display: inline-grid; place-items: center; color: var(--ink); border-radius: 4px; }
.tbtn:hover:not(:disabled) { background: rgb(255 255 255 / 0.12); }
.tbtn.tplay { color: var(--orange); }
.tbtn.on { color: var(--orange); }
.tbtn:not(.on):not(.tplay) { color: var(--ink); }
.dots { display: inline-flex; align-items: center; gap: 3px; }
.rdot { width: 6px; height: 6px; padding: 0; border: 0; box-shadow: none; border-radius: 3px; background: rgb(255 255 255 / 0.15); transition: width 0.2s; }
.rdot.past { background: rgb(255 255 255 / 0.55); }
.rdot.current { width: 14px; background: var(--orange); }
.rdot:hover { background: rgb(255 255 255 / 0.8); }
.counter { font-size: 12px; color: var(--secondary); }
.speed { display: inline-flex; align-items: center; gap: 4px; font-size: 10px; color: var(--secondary); }
.speed span { filter: grayscale(1); opacity: 0.7; }
.speed input { width: 80px; accent-color: var(--orange); }
.tdivider { width: 1px; height: 14px; background: var(--line); }
.verdict { display: inline-flex; align-items: center; gap: 4px; padding: 5px 12px; border-radius: 999px; background: rgb(0 0 0 / 0.25); color: var(--orange); font-size: 13px; }
.verdict.good { color: var(--green); }
.hand-slot.dim .playing-card { opacity: 0.6; }
.hint-pct.good { color: var(--green); font-weight: 700; }
.hand-text b.played { text-decoration: underline; }
.link-row { background: none; border: 0; box-shadow: none; padding: 1px 0; width: 100%; text-align: left; color: var(--ink); border-radius: 4px; }
.link-row:hover { background: rgb(255 255 255 / 0.06); }
.finish-buttons { display: flex; gap: 12px; align-items: center; }
.saved { display: flex; flex-direction: column; align-items: center; gap: 4px; }
.saved .best { color: var(--orange); font-size: 15px; }

@media (max-width: 640px) {
  .transport { gap: 8px; padding: 8px 10px; flex-wrap: wrap; justify-content: center; border-radius: 18px; white-space: normal; }
  .speed input { width: 60px; }
  .db-row > summary { gap: 6px; }
  .roster-row { align-items: flex-start; }
}
