/* Layout: à esquerda a mesa (controles → mesa → baralho, cabe numa tela);
   à direita a análise fixa com veredito no topo e abas. */
:root {
  --bg: #0b1110;
  --bg-2: #101917;
  --panel: #141c1a;
  --panel-2: #1a2421;
  --panel-3: #212d29;
  --line: #24302c;
  --line-2: #33423c;
  --text: #eeeadf;
  --text-2: #c9cfc9;
  --muted: #8b9a93;
  --gold: #dcb75e;
  --gold-2: #f1d58f;
  --gold-ink: #1d1609;
  --felt-1: #2f8560;
  --felt-2: #19553b;
  --felt-3: #0f3826;
  --rail-1: #4a3524;
  --rail-2: #21160d;
  --card: #fbf8f0;
  --card-2: #efe9db;
  --card-edge: #d8d0bd;

  --s-spades: #18181b;
  --s-hearts: #cf2e3a;
  --s-diamonds: #2463c9;
  --s-clubs: #1d7f48;

  --a-fold: #e5636a;
  --a-check: #a3b0aa;
  --a-call: #5fb0ee;
  --a-bet: #4ccd8e;
  --a-allin: #eebd52;

  --ok: #4ccd8e;
  --warn: #eebd52;
  --hot: #f08a56;
  --bad: #e5636a;

  --f-display: "Barlow Condensed", "Arial Narrow", "Roboto Condensed", sans-serif;
  --f-body: "Manrope", "Segoe UI", system-ui, -apple-system, sans-serif;
  --f-mono: "JetBrains Mono", ui-monospace, "SF Mono", Menlo, monospace;

  --radius: 14px;
  --radius-sm: 9px;
  --header-h: 66px;
  --table-h: clamp(200px, calc(100vh - 590px), 380px);
  --card-w: clamp(26px, calc(var(--table-h) * 0.155), 56px);
  --pick-w: clamp(34px, calc((100vh - 400px) / 11), 46px);
  color-scheme: dark;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { margin: 0; }
body {
  background:
    radial-gradient(900px 500px at 25% -10%, rgba(47, 133, 96, 0.13), transparent 60%),
    radial-gradient(700px 500px at 100% 0%, rgba(220, 183, 94, 0.06), transparent 60%),
    var(--bg);
  background-attachment: fixed;
  color: var(--text);
  font-family: var(--f-body);
  font-size: 14px;
  line-height: 1.5;
  min-height: 100vh;
  padding-inline: 20px;
  padding-block: 0 20px;
}
button, input, select { font: inherit; color: inherit; }
h1, h2, h3 { margin: 0; font-weight: 600; }
p { margin: 0; }
kbd {
  font-family: var(--f-mono);
  font-size: 10.5px;
  background: var(--panel-3);
  border: 1px solid var(--line-2);
  border-bottom-width: 2px;
  border-radius: 4px;
  padding: 0 5px;
  margin-inline: 1px;
  color: var(--text-2);
}
.btn kbd { background: rgba(0,0,0,.12); border-color: rgba(0,0,0,.2); color: inherit; }
.muted { color: var(--muted); }
.small { font-size: 12px; }
:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; }
.help {
  display: inline-grid; place-items: center;
  width: 15px; height: 15px; border-radius: 50%;
  font-size: 10px; font-weight: 800;
  background: var(--panel-3); color: var(--muted);
  cursor: help; vertical-align: 1px;
}

/* ============ Top bar ============ */
.topbar {
  position: sticky; top: 0; z-index: 30;
  height: var(--header-h);
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 20px;
  margin-inline: -20px;
  padding-inline: 20px;
  background: rgba(11, 17, 16, 0.86);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--line);
}
.brand { display: flex; align-items: center; gap: 12px; }
.brand-mark {
  width: 40px; height: 40px;
  display: grid; place-items: center;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, var(--gold-2), var(--gold) 55%, #94742a);
  color: var(--gold-ink);
  font-size: 20px;
  box-shadow: inset 0 0 0 3px rgba(0,0,0,.18), 0 0 0 3px rgba(220,183,94,.15), 0 0 0 4px rgba(220,183,94,.35);
}
.brand h1 { font-family: var(--f-display); font-size: 25px; letter-spacing: .05em; text-transform: uppercase; line-height: 1; }
.brand p { color: var(--muted); font-size: 12px; margin-top: 2px; }

.stage-track {
  justify-self: center;
  list-style: none;
  display: flex;
  margin: 0;
  padding: 4px;
  gap: 2px;
  border-radius: 999px;
  background: var(--panel);
  border: 1px solid var(--line);
}
.stage-track li {
  display: grid;
  justify-items: center;
  padding: 3px 16px;
  border-radius: 999px;
  color: var(--muted);
  line-height: 1.1;
  transition: background .25s, color .25s;
}
.stage-track b { font-family: var(--f-display); text-transform: uppercase; letter-spacing: .06em; font-size: 15px; font-weight: 600; }
.stage-track small { font-size: 9.5px; opacity: .8; }
.stage-track li.done { color: var(--text-2); }
.stage-track li.done b::before { content: "✓ "; color: var(--ok); }
.stage-track li.current { background: var(--gold); color: var(--gold-ink); }
.stage-track li.current b { font-weight: 700; }

.topbar-actions { display: flex; align-items: center; gap: 8px; }
.session-stat { font-size: 12px; color: var(--muted); padding-inline: 6px; white-space: nowrap; }
.btn {
  border: 1px solid var(--line-2);
  background: var(--panel-2);
  border-radius: 999px;
  padding: 8px 16px;
  cursor: pointer;
  font-weight: 700;
  white-space: nowrap;
  transition: background .15s, border-color .15s, transform .1s;
}
.btn:hover { border-color: var(--muted); }
.btn:active { transform: translateY(1px); }
.btn.primary { background: var(--gold); border-color: var(--gold); color: var(--gold-ink); }
.btn.primary:hover { background: var(--gold-2); }
.btn.ghost { background: transparent; }
.btn.small { padding: 4px 12px; font-size: 12px; }

/* ============ Layout ============ */
.layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(360px, 440px);
  gap: 20px;
  margin-top: 16px;
  align-items: start;
}
.play { display: grid; gap: 12px; min-width: 0; }
.panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

/* ============ Controles ============ */
.controls {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 12px;
  align-items: flex-start;
  padding: 10px 14px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}
.ctl { display: grid; gap: 5px; min-width: 0; }
.ctl-label { font-size: 11px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .06em; display: flex; gap: 5px; align-items: center; }
.ctl-note { font-size: 11px; color: var(--muted); min-height: 0; }
.ctl input, .ctl select {
  height: 34px;
  background: var(--panel-2);
  border: 1px solid var(--line-2);
  border-radius: var(--radius-sm);
  padding: 0 10px;
  font-size: 14px;
}
.ctl input { width: 68px; font-family: var(--f-mono); }
.ctl select { width: 168px; cursor: pointer; }
.ctl select#playersSel { width: 128px; }
.ctl input:focus, .ctl select:focus { border-color: var(--gold); outline: none; }
.input-unit { display: flex; gap: 6px; align-items: center; }

.seg { display: flex; gap: 3px; padding: 3px; background: var(--panel-2); border: 1px solid var(--line-2); border-radius: var(--radius-sm); }
.seg button {
  min-width: 28px;
  height: 26px;
  padding: 0 7px;
  border-radius: 6px;
  border: none;
  background: transparent;
  cursor: pointer;
  font-weight: 700;
  font-size: 13px;
  color: var(--text-2);
}
.seg button:hover { background: var(--panel-3); }
.seg button[aria-checked="true"] { background: var(--gold); color: var(--gold-ink); }
.seg.mini button { height: 26px; font-size: 12px; min-width: 26px; }
#betQuick button { color: var(--text); font-size: 14px; }
.stepper { display: flex; align-items: center; gap: 6px; height: 34px; }
.stepper button {
  width: 30px; height: 30px;
  border-radius: 8px;
  border: 1px solid var(--line-2);
  background: var(--panel-2);
  cursor: pointer;
  font-size: 17px;
  line-height: 1;
}
.stepper button:hover { border-color: var(--muted); }
.stepper output { font-family: var(--f-mono); font-size: 17px; min-width: 22px; text-align: center; font-weight: 700; }

/* ============ Mesa ============ */
.table-wrap { padding: 38px 64px 52px; }
.table {
  position: relative;
  width: min(100%, calc(var(--table-h) * 2.15));
  aspect-ratio: 2.15 / 1;
  margin-inline: auto;
  border-radius: 999px;
  background: linear-gradient(170deg, var(--rail-1), var(--rail-2));
  padding: 14px;
  box-shadow:
    0 40px 70px -20px rgba(0,0,0,.7),
    inset 0 2px 0 rgba(255,255,255,.07),
    inset 0 -3px 6px rgba(0,0,0,.4),
    0 0 0 1px #0a0705;
}
.felt {
  position: relative;
  height: 100%;
  border-radius: 999px;
  background:
    radial-gradient(ellipse at 50% 38%, var(--felt-1) 0%, var(--felt-2) 58%, var(--felt-3) 100%);
  box-shadow: inset 0 0 0 2px rgba(220,183,94,.32), inset 0 0 0 9px rgba(0,0,0,.08), inset 0 0 60px rgba(0,0,0,.5);
  display: grid;
  grid-template-rows: auto auto auto;
  align-content: center;
  justify-items: center;
  gap: clamp(3px, calc(var(--table-h) * 0.03), 10px);
}
.pot {
  font-family: var(--f-mono);
  font-size: 12px;
  font-weight: 700;
  background: rgba(0,0,0,.38);
  padding: 3px 12px;
  border-radius: 999px;
  color: #f4e6bd;
  display: flex; gap: 6px; align-items: center;
}
.pot::before {
  content: ""; width: 10px; height: 10px; border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, var(--gold-2), var(--gold));
  box-shadow: 0 0 0 2px rgba(0,0,0,.25);
}
.board-area { display: grid; gap: 3px; justify-items: center; }
.board, .board-labels {
  display: grid;
  grid-template-columns: repeat(5, var(--card-w));
  gap: 6px;
}
.board-labels span {
  font-size: 9.5px;
  text-transform: uppercase;
  letter-spacing: .14em;
  color: rgba(255,255,255,.42);
  text-align: center;
  font-weight: 700;
}
.board-labels span:first-child { grid-column: 1 / 4; border-top: 1px solid rgba(255,255,255,.15); padding-top: 2px; }
.board-labels span:not(:first-child) { border-top: 1px solid rgba(255,255,255,.15); padding-top: 2px; }
.hero-area { display: grid; justify-items: center; gap: 4px; }
.hero-hand { display: flex; gap: 6px; --card-w: clamp(30px, calc(var(--table-h) * 0.18), 64px); }
.hero-label {
  font-size: 12px;
  font-weight: 800;
  color: var(--gold-ink);
  background: var(--gold);
  padding: 2px 10px;
  border-radius: 999px;
  white-space: nowrap;
}

/* Cartas */
.card {
  width: var(--card-w);
  aspect-ratio: 5 / 7;
  border-radius: calc(var(--card-w) * 0.12);
  position: relative;
  border: none;
  padding: 0;
  cursor: pointer;
  transition: transform .15s, box-shadow .15s;
}
.card.face {
  background: linear-gradient(170deg, #fff, var(--card) 45%, var(--card-2));
  box-shadow: 0 4px 10px rgba(0,0,0,.45), inset 0 0 0 1px var(--card-edge);
  animation: deal .25s ease-out;
  overflow: hidden;
}
.card .corner {
  position: absolute;
  display: grid;
  justify-items: center;
  line-height: .9;
  font-family: var(--f-display);
  font-weight: 700;
}
.card .corner .r { font-size: calc(var(--card-w) * 0.34); letter-spacing: -.02em; }
.card .corner .s { font-size: calc(var(--card-w) * 0.22); }
.card .corner.tl { top: 6%; left: 8%; }
.card .corner.br { bottom: 6%; right: 8%; transform: rotate(180deg); }
.card .pip {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  font-size: calc(var(--card-w) * 0.52);
  line-height: 1;
}
.card.empty {
  background: rgba(0,0,0,.2);
  border: 1.5px dashed rgba(255,255,255,.25);
  color: rgba(255,255,255,.45);
  font-size: 10px;
  font-weight: 700;
  display: grid;
  place-items: center;
  text-transform: uppercase;
  letter-spacing: .06em;
}
.card.active {
  border: 2px solid var(--gold);
  background: rgba(220,183,94,.12);
  animation: pulse 1.6s ease-in-out infinite;
}
.card.face.active { box-shadow: 0 0 0 3px var(--gold), 0 4px 10px rgba(0,0,0,.45); }
.card:hover { transform: translateY(-3px); }
.hero-hand .card:nth-child(1) { transform: rotate(-5deg) translateY(2px); }
.hero-hand .card:nth-child(2) { transform: rotate(5deg) translateY(2px); }
.hero-hand .card:hover { transform: translateY(-3px); }

.suit-s { color: var(--s-spades); }
.suit-h { color: var(--s-hearts); }
.suit-d { color: var(--s-diamonds); }
.suit-c { color: var(--s-clubs); }

@keyframes deal { from { transform: translateY(-14px) rotate(-4deg) scale(.9); opacity: 0; } to { opacity: 1; } }
@keyframes pulse { 50% { box-shadow: 0 0 0 5px rgba(220,183,94,.12), 0 0 22px rgba(220,183,94,.55); } }

/* Assentos */
.seats { position: absolute; inset: 0; pointer-events: none; }
.seat {
  position: absolute;
  transform: translate(-50%, -50%);
  pointer-events: auto;
  display: grid;
  justify-items: center;
  gap: 3px;
  border: none;
  background: none;
  cursor: pointer;
  padding: 0;
  transition: left .5s cubic-bezier(.4,.1,.2,1), top .5s cubic-bezier(.4,.1,.2,1);
}
.seat .avatar {
  position: relative;
  width: 50px; height: 50px;
  border-radius: 50%;
  display: grid; place-items: center;
  background: linear-gradient(180deg, #27322e, #141b18);
  border: 2px solid var(--line-2);
  font-family: var(--f-display);
  font-weight: 700;
  font-size: 15px;
  box-shadow: 0 8px 16px rgba(0,0,0,.5);
  transition: border-color .15s, transform .15s;
}
.seat:hover .avatar { border-color: var(--gold); transform: scale(1.06); }
.seat .tag {
  font-size: 9.5px; color: var(--muted);
  text-transform: uppercase; letter-spacing: .1em;
  white-space: nowrap;
  background: rgba(11,17,16,.7);
  padding: 0 6px;
  border-radius: 4px;
}
.seat.hero .avatar {
  width: 56px; height: 56px;
  background: radial-gradient(circle at 35% 30%, var(--gold-2), var(--gold) 60%, #94742a);
  color: var(--gold-ink);
  border-color: var(--gold-2);
  box-shadow: 0 0 0 4px rgba(220,183,94,.2), 0 8px 16px rgba(0,0,0,.5);
}
.seat.hero .tag { color: var(--gold-2); font-weight: 800; }
.seat.top { grid-auto-flow: row; }
.seat.top .tag { order: -1; }
.seat .marker {
  position: absolute;
  top: -5px; right: -9px;
  width: 21px; height: 21px;
  border-radius: 50%;
  font-family: var(--f-body);
  font-size: 9px;
  font-weight: 800;
  display: grid; place-items: center;
  box-shadow: 0 2px 4px rgba(0,0,0,.5);
}
.marker.dealer { background: #fbf8f0; color: #111; font-size: 11px; }
.marker.sb { background: var(--s-diamonds); color: #fff; }
.marker.bb { background: var(--s-hearts); color: #fff; }

.hint-row { display: flex; justify-content: center; align-items: center; gap: 10px; flex-wrap: wrap; margin-top: -6px; min-height: 24px; }
.hint { text-align: center; color: var(--text-2); }
.hint strong { color: var(--gold-2); }

/* ============ Baralho ============ */
.deck { padding: 12px 16px 14px; display: grid; gap: 10px; }
.deck-head { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.deck-head h2, .block h3 {
  font-family: var(--f-display);
  text-transform: uppercase;
  letter-spacing: .1em;
  font-size: 14px;
  color: var(--muted);
}
.picker { display: grid; gap: 5px; justify-content: center; }
.picker-row { display: grid; grid-template-columns: repeat(13, var(--pick-w)); gap: 5px; }
.pick {
  aspect-ratio: 5 / 6.2;
  border-radius: 7px;
  border: none;
  background: linear-gradient(170deg, #fff, var(--card) 50%, var(--card-2));
  box-shadow: inset 0 0 0 1px var(--card-edge), 0 2px 4px rgba(0,0,0,.35);
  cursor: pointer;
  display: grid;
  align-content: center;
  justify-items: center;
  line-height: 1;
  gap: 2px;
  transition: transform .12s, opacity .15s, box-shadow .12s;
  min-width: 0;
  position: relative;
}
.pick .r { font-family: var(--f-display); font-weight: 700; font-size: calc(var(--pick-w) * 0.42); }
.pick .s { font-size: calc(var(--pick-w) * 0.32); }
.pick:hover:not(:disabled) { transform: translateY(-3px); box-shadow: inset 0 0 0 2px var(--gold), 0 6px 10px rgba(0,0,0,.4); }
.pick:disabled { opacity: .14; cursor: not-allowed; }
.pick.mine, .pick.onboard { opacity: 1; }
.pick.mine { box-shadow: inset 0 0 0 2px var(--gold), 0 0 0 2px rgba(220,183,94,.3); }
.pick.onboard { opacity: .5; }
.pick.mine::after, .pick.onboard::after {
  position: absolute; bottom: 2px; left: 50%; transform: translateX(-50%);
  font-size: 7px; font-weight: 800; letter-spacing: .04em; line-height: 1.3;
  padding: 0 3px; border-radius: 3px;
}
.pick.mine::after { content: "VOCÊ"; background: var(--gold); color: var(--gold-ink); }
.pick.onboard::after { content: "MESA"; background: var(--felt-2); color: #fff; }

/* ============ Análise ============ */
.analysis-col {
  position: sticky;
  top: calc(var(--header-h) + 16px);
  height: calc(100vh - var(--header-h) - 36px);
  min-height: 0;
}
.analysis {
  height: 100%;
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-height: 0;
}
.analysis.loading .verdict, .analysis.loading .meters { opacity: .6; transition: opacity .2s; }

.verdict {
  --c: var(--a-check);
  flex: none;
  border-radius: var(--radius);
  padding: 16px 18px;
  display: grid;
  gap: 8px;
  border: 1px solid color-mix(in srgb, var(--c) 50%, transparent);
  background:
    linear-gradient(120deg, color-mix(in srgb, var(--c) 22%, var(--panel)) 0%, var(--panel) 75%);
  position: relative;
  overflow: hidden;
}
.verdict::after {
  content: "";
  position: absolute; inset: 0 auto 0 0; width: 4px;
  background: var(--c);
}
.verdict.FOLD { --c: var(--a-fold); }
.verdict.CHECK { --c: var(--a-check); }
.verdict.CALL { --c: var(--a-call); }
.verdict.BET, .verdict.RAISE, .verdict.WIN { --c: var(--a-bet); }
.verdict.ALLIN { --c: var(--a-allin); }
.verdict.WAIT { --c: var(--gold); }
.verdict-top { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.eyebrow { font-size: 11px; text-transform: uppercase; letter-spacing: .14em; color: var(--muted); font-weight: 700; }
.conf {
  font-size: 11px; font-weight: 700;
  padding: 2px 9px; border-radius: 999px;
  background: rgba(255,255,255,.08); color: var(--text-2);
  display: flex; gap: 5px; align-items: center;
}
.conf i { display: inline-flex; gap: 2px; }
.conf i span { width: 5px; height: 10px; border-radius: 2px; background: rgba(255,255,255,.18); }
.conf i span.on { background: var(--c); }
.verdict .action-row { display: flex; align-items: baseline; gap: 12px; flex-wrap: wrap; }
.verdict .action {
  font-family: var(--f-display);
  font-size: 42px; font-weight: 700; line-height: .95;
  color: var(--c);
  text-transform: uppercase;
}
.verdict .sizing {
  font-family: var(--f-mono); font-size: 13px; font-weight: 700;
  padding: 3px 9px; border-radius: 6px;
  background: rgba(0,0,0,.28);
}
.verdict .summary { font-size: 14.5px; line-height: 1.5; color: var(--text); }
.verdict details { font-size: 13px; color: var(--text-2); }
.verdict summary { cursor: pointer; color: var(--muted); font-size: 12px; font-weight: 700; list-style: none; }
.verdict summary::-webkit-details-marker { display: none; }
.verdict summary::before { content: "▸ "; }
.verdict details[open] summary::before { content: "▾ "; }
.verdict ul { margin: 6px 0 0; padding-left: 18px; display: grid; gap: 3px; }

.meters { flex: none; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.meter {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 10px 10px 12px;
  display: grid;
  gap: 5px;
  justify-items: center;
  align-content: start;
  text-align: center;
  min-width: 0;
}
.meter .label { font-size: 10.5px; text-transform: uppercase; letter-spacing: .1em; color: var(--muted); font-weight: 700; display: flex; gap: 4px; align-items: center; }
.meter .value { font-family: var(--f-display); font-size: 24px; font-weight: 700; line-height: 1.05; }
.meter .sub { font-size: 11px; color: var(--muted); line-height: 1.3; }
.ring { width: 64px; height: 64px; }
.ring circle { fill: none; stroke-width: 7; }
.ring .track { stroke: var(--line-2); }
.ring .fill { stroke-linecap: round; transition: stroke-dashoffset .5s ease, stroke .3s; transform: rotate(-90deg); transform-origin: 50% 50%; }
.ring text { fill: var(--text); font-family: var(--f-display); font-weight: 700; font-size: 20px; }
.gauge { width: 100%; height: 7px; background: var(--line-2); border-radius: 999px; overflow: hidden; margin-top: 4px; }
.gauge > span { display: block; height: 100%; border-radius: inherit; transition: width .5s ease; }

/* Abas */
.tabs-wrap {
  flex: 1 1 auto;
  min-height: 0;
  display: flex;
  flex-direction: column;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
}
.tabs {
  flex: none;
  display: flex;
  gap: 2px;
  padding: 6px 6px 0;
  border-bottom: 1px solid var(--line);
  overflow-x: auto;
  scrollbar-width: none;
}
.tabs button {
  border: none;
  background: none;
  padding: 8px 12px 9px;
  font-weight: 700;
  font-size: 13px;
  color: var(--muted);
  cursor: pointer;
  border-bottom: 2px solid transparent;
  white-space: nowrap;
}
.tabs button:hover { color: var(--text); }
.tabs button[aria-selected="true"] { color: var(--gold-2); border-bottom-color: var(--gold); }
.tab-body { flex: 1 1 auto; min-height: 0; overflow-y: auto; padding: 4px 16px 16px; scrollbar-width: thin; }

.block { display: grid; gap: 8px; padding-block: 14px; border-bottom: 1px solid var(--line); }
.block:last-child { border-bottom: none; }
.block p { color: var(--text-2); }
.kv { display: grid; grid-template-columns: auto 1fr; gap: 5px 14px; align-items: baseline; margin: 0; }
.kv dt { color: var(--muted); font-size: 12px; }
.kv dd { margin: 0; font-weight: 700; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip {
  font-size: 12px;
  padding: 3px 10px;
  border-radius: 999px;
  background: var(--panel-2);
  border: 1px solid var(--line-2);
  color: var(--text-2);
}
.chip.good { border-color: color-mix(in srgb, var(--ok) 55%, transparent); color: var(--ok); background: color-mix(in srgb, var(--ok) 8%, transparent); }
.chip.warn { border-color: color-mix(in srgb, var(--warn) 55%, transparent); color: var(--warn); background: color-mix(in srgb, var(--warn) 8%, transparent); }
.chip.bad { border-color: color-mix(in srgb, var(--bad) 55%, transparent); color: var(--bad); background: color-mix(in srgb, var(--bad) 8%, transparent); }

.win-status { display: flex; gap: 12px; align-items: center; }
.win-badge {
  flex: none;
  width: 42px; height: 42px;
  border-radius: 50%;
  display: grid; place-items: center;
  font-size: 18px; font-weight: 800;
  border: 2px solid var(--line-2);
}
.win-badge.garantida, .win-badge.nuts, .win-badge.favorito { border-color: var(--ok); color: var(--ok); background: color-mix(in srgb, var(--ok) 10%, transparent); }
.win-badge.leve { border-color: var(--warn); color: var(--warn); background: color-mix(in srgb, var(--warn) 10%, transparent); }
.win-badge.atras { border-color: var(--bad); color: var(--bad); background: color-mix(in srgb, var(--bad) 10%, transparent); }
.wlt { display: flex; height: 8px; border-radius: 999px; overflow: hidden; background: var(--line-2); }
.wlt span { height: 100%; }
.wlt-legend { display: flex; gap: 14px; font-size: 12px; color: var(--muted); flex-wrap: wrap; }
.dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; margin-right: 5px; vertical-align: 0; }

.dist { display: grid; gap: 5px; }
.dist-row { display: grid; grid-template-columns: 104px 1fr 50px; gap: 8px; align-items: center; font-size: 12.5px; }
.dist-row .name { color: var(--text-2); }
.dist-row.now .name { color: var(--gold-2); font-weight: 800; }
.dist-row.zero { opacity: .45; }
.dist-row .gauge { height: 10px; margin: 0; }
.dist-row .pct { font-family: var(--f-mono); text-align: right; font-variant-numeric: tabular-nums; }

.odds-compare { position: relative; height: 24px; border-radius: 6px; background: var(--line-2); overflow: hidden; }
.odds-compare .eq { position: absolute; inset: 0 auto 0 0; transition: width .5s; }
.odds-compare .need { position: absolute; top: 0; bottom: 0; width: 3px; background: #fff; box-shadow: 0 0 0 1px rgba(0,0,0,.6); }
.odds-legend { display: flex; justify-content: space-between; font-size: 12px; color: var(--muted); gap: 8px; flex-wrap: wrap; }
.odds-legend b { color: var(--text); font-family: var(--f-mono); }

.outs-group { display: grid; grid-template-columns: 120px 1fr; gap: 8px; align-items: start; font-size: 12.5px; }
.outs-group .name { font-weight: 700; color: var(--text-2); }
.outs-group .name small { color: var(--muted); font-weight: 600; }
.mini-cards { display: flex; flex-wrap: wrap; gap: 3px; }
.mini {
  font-family: var(--f-mono);
  font-size: 11px;
  font-weight: 700;
  background: var(--card);
  border-radius: 4px;
  padding: 1px 4px;
  line-height: 1.3;
}

.tips { margin: 0; padding-left: 18px; display: grid; gap: 6px; color: var(--text-2); }

/* Range 13x13 */
.range-head { display: flex; justify-content: space-between; align-items: center; gap: 8px; flex-wrap: wrap; }
.range-grid { display: grid; grid-template-columns: repeat(13, minmax(0, 1fr)); gap: 2px; }
.range-grid span {
  aspect-ratio: 1;
  display: grid; place-items: center;
  font-size: 9px;
  font-family: var(--f-mono);
  border-radius: 3px;
  background: var(--panel-2);
  color: #5c6b65;
  min-width: 0;
  overflow: hidden;
}
.range-grid span.in { background: color-mix(in srgb, var(--a-bet) 62%, var(--panel)); color: #062014; font-weight: 700; }
.range-grid span.me { outline: 2px solid var(--gold-2); outline-offset: -1px; color: #fff; background: #7d6221; }
.range-grid span.me.in { background: var(--gold); color: var(--gold-ink); }
.range-legend { font-size: 12px; color: var(--muted); display: flex; gap: 12px; flex-wrap: wrap; align-items: center; }
.sw { display: inline-block; width: 10px; height: 10px; border-radius: 2px; margin-right: 4px; vertical-align: -1px; }

/* Histórico */
.history-list { display: grid; gap: 6px; }
.history-item {
  display: grid;
  grid-template-columns: 44px auto minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  padding: 8px 10px;
  border-radius: 8px;
  background: var(--panel-2);
  font-size: 12.5px;
}
.history-item .pos { font-family: var(--f-display); font-weight: 700; letter-spacing: .04em; color: var(--gold-2); font-size: 15px; }
.history-item .act { font-weight: 800; }

/* Glossário */
.gloss { display: grid; gap: 10px; margin: 0; }
.gloss dt { font-weight: 800; color: var(--gold-2); }
.gloss dd { margin: 2px 0 0; color: var(--text-2); }

.empty-note { color: var(--muted); font-size: 13px; }
.error-box { border: 1px solid var(--bad); color: var(--bad); border-radius: var(--radius); padding: 12px 14px; background: color-mix(in srgb, var(--bad) 10%, var(--panel)); }
.steps { margin: 4px 0 0; padding-left: 20px; display: grid; gap: 4px; color: var(--text-2); }
.steps li.done { color: var(--muted); text-decoration: line-through; }

.footer { color: var(--muted); font-size: 11.5px; text-align: center; margin: 18px auto 0; max-width: 80ch; }

/* ============ Responsivo ============ */
@media (max-width: 1180px) {
  :root { --table-h: clamp(220px, 34vw, 360px); }
  .layout { grid-template-columns: minmax(0, 1fr); }
  .analysis-col { position: static; height: auto; }
  .analysis { height: auto; }
  .tabs-wrap { overflow: visible; }
  .tab-body { overflow: visible; }
  .topbar { grid-template-columns: auto 1fr auto; }
}
@media (max-width: 860px) {
  .topbar { height: auto; grid-template-columns: 1fr auto; padding-block: 10px; row-gap: 8px; }
  .stage-track { grid-column: 1 / -1; grid-row: 2; justify-self: stretch; justify-content: space-between; }
  .stage-track li { padding: 3px 8px; }
  .stage-track small { display: none; }
  .session-stat { display: none; }
  .analysis-col { top: auto; }
}
@media (max-width: 640px) {
  :root { --table-h: 46vw; --pick-w: calc((100vw - 24px - 26px - 12 * 3px) / 13); }
  body { padding-inline: 12px; }
  .topbar { margin-inline: -12px; padding-inline: 12px; }
  .brand p { display: none; }
  .btn kbd { display: none; }
  .table-wrap { padding: 30px 22px 44px; }
  .table { aspect-ratio: 1.55 / 1; width: 100%; padding: 9px; }
  .seat .avatar { width: 36px; height: 36px; font-size: 12px; }
  .seat.hero .avatar { width: 42px; height: 42px; }
  .seat .tag { display: none; }
  .seat.hero .tag { display: block; }
  .board, .board-labels { gap: 4px; }
  :root { --card-w: calc((100vw - 120px) / 5 * 0.62); }
  .hero-hand { --card-w: 44px; }
  .picker-row { gap: 3px; }
  .picker { gap: 3px; }
  .deck { padding: 10px; }
  .deck-head .muted { display: none; }
  .controls { gap: 10px 12px; padding: 12px; }
  .ctl select { min-width: 0; width: 100%; }
  .ctl-bet { grid-column: 1 / -1; }
  .meters { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) minmax(0, 1fr); gap: 6px; }
  .meter { padding: 8px 4px; }
  .meter .value { font-size: 18px; }
  .ring { width: 52px; height: 52px; }
  .verdict .action { font-size: 34px; }
  .outs-group { grid-template-columns: 1fr; gap: 4px; }
  .history-item { grid-template-columns: 40px minmax(0, 1fr) auto; }
  .history-item .hcards { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
