:root {
  font-family: Inter, "Segoe UI", "Yu Gothic UI", system-ui, sans-serif;
  color: #f5f5f5;
  background: #121212;
  font-synthesis: none;
  font-size: 15px;
  --panel: #1e1e1e;
  --line: #303030;
  --muted: #a5a5a5;
  --accent: #a2e6ad;
}
* { box-sizing: border-box; }
body { margin: 0; }
button { font: inherit; color: inherit; }
button { cursor: pointer; }
button:disabled { cursor: default; }
button:focus-visible, a:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
[hidden] { display: none !important; }
.frame { width: min(1680px, 100% - 32px); margin: auto; }
.top { background: #181818; border-bottom: 1px solid var(--line); }
.top-inner { height: 40px; display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.brand { color: #f6f7fa; text-decoration: none; font-size: 14px; font-weight: 720; display: flex; align-items: center; gap: 8px; white-space: nowrap; }
.brand-icon { width: 24px; height: 24px; border-radius: 5px; background: #edc775; color: #302510; display: grid; place-items: center; font-size: 18px; line-height: 1; }
.game-format { color: var(--muted); font-size: 11px; }
.game-format b { font-weight: inherit; }
.local { color: var(--muted); font-size: 12px; }
.local i { display: inline-block; width: 7px; height: 7px; background: #62e45a; border-radius: 50%; margin-right: 5px; }
main { padding: 8px 0 10px; }
h2, p { margin: 0; }
.panel { background: var(--panel); border: 1px solid var(--line); border-radius: 9px; min-width: 0; }
.filters { display: flex; align-items: center; gap: 22px; padding: 7px 11px 8px; flex-wrap: wrap; }
.filter-group { display: flex; align-items: center; gap: 7px; min-width: 0; }
.filter-label { color: var(--muted); font-size: 11px; white-space: nowrap; }
.mobile-settings-toggle { display: none; }
.segments { display: inline-flex; gap: 2px; padding: 2px; border: 1px solid #3a3a3a; background: #171717; border-radius: 6px; }
.segments button { border: 0; border-radius: 4px; padding: 4px 10px; background: transparent; font-size: 12px; color: var(--muted); white-space: nowrap; }
.segments button:hover { color: #fff; }
.segments button[aria-pressed="true"] { background: #414141; color: #f5f5f5; font-weight: 650; }
.spot { margin-top: 7px; padding: 6px 9px 4px; }
h2 { font-size: 14px; font-weight: 700; }
.positions { display: flex; gap: 6px; overflow-x: auto; padding: 2px 0 6px; scrollbar-width: thin; scrollbar-color: #535762 #191c22; }
.decision-card { flex: 0 0 clamp(108px, 10vw, 132px); min-height: 88px; padding: 4px; background: #222; border: 1px solid #343434; border-radius: 5px; }
.decision-card[aria-current="step"] { background: #242824; border-color: #a2e6ad; box-shadow: inset 0 0 0 1px #a2e6ad; }
.decision-heading { display: flex; justify-content: space-between; gap: 6px; width: 100%; padding: 2px 4px; border: 0; border-radius: 4px; background: transparent; text-align: left; font-size: 13px; font-weight: 700; line-height: 1.1; }
.decision-heading .remaining-stack { color: var(--muted); font-variant-numeric: tabular-nums; }
.decision-card[aria-current="step"] .decision-heading, .decision-card[aria-current="step"] .remaining-stack { color: #b2efbc; }
.decision-actions { display: grid; }
.decision-action { width: 100%; color: var(--muted); text-align: left; background: transparent; border: 0; border-radius: 4px; padding: 1px 4px; font-size: 12px; line-height: 1.05; }
.decision-card[aria-current="step"] .decision-action, .decision-action[aria-pressed="true"] { color: #f5f6f8; }
.decision-action[aria-pressed="true"], .decision-action:hover, .decision-heading:hover { background: #414141; }
.positions button:focus-visible { outline-offset: -2px; }
.strategy { margin-top: 7px; }
.panel-heading { padding: 6px 11px; display: flex; gap: 8px; align-items: center; justify-content: space-between; border-bottom: 1px solid var(--line); }
.panel-heading span { color: var(--muted); font-size: 12px; }
.chart-heading { flex-wrap: wrap; }
.ev-status { margin: 9px 12px 0; color: var(--muted); font-size: 12px; }
.matrix-wrap { margin: 8px; position: relative; }
.matrix { display: grid; grid-template-columns: repeat(13, minmax(0, 1fr)); gap: 1px; background: #121212; }
.hand { border: 1px solid transparent; border-radius: 0; display: grid; place-items: center; padding: 0; min-width: 0; aspect-ratio: 1.75; background: #1e1e1e; color: #f5f5f5; font-size: clamp(11px, 1.3vw, 19px); font-weight: 500; letter-spacing: -.04em; }
.hand:disabled { background: #1e1e1e; color: #4e4e4e; }
.hand:not(:disabled) { text-shadow: 0 1px 2px #111; }
.hand[aria-pressed="true"], .hand:hover:not(:disabled) { border-color: #f9f9ff; z-index: 1; }
.hand-with-ev { display: flex; flex-direction: column; justify-content: space-between; align-items: stretch; padding: 4px 7px; text-align: left; }
.cell-ev { text-align: right; font-size: .77em; font-weight: 600; font-variant-numeric: tabular-nums; }
.empty { position: absolute; inset: 0; display: grid; place-items: center; text-align: center; pointer-events: none; background: #12121238; }
.empty > div { display: grid; gap: 5px; padding: 14px 22px; background: #1e1e1ef5; border: 1px solid #4b4b4b; border-radius: 7px; box-shadow: 0 4px 22px #0004; }
.empty strong { font-size: 15px; }
.empty span { color: #c3c8d5; font-size: 12px; }
.action-overview { padding: 6px 8px 7px; border-bottom: 1px solid var(--line); }
.overview-heading { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; margin-bottom: 4px; color: var(--muted); font-size: 11px; }
#hand-caption { color: #e9ebf1; font-weight: 600; font-variant-numeric: tabular-nums; }
.action-cards { display: grid; grid-template-columns: repeat(var(--action-count, 3), minmax(0, 1fr)); gap: 6px; }
.action-cards > .note { grid-column: 1 / -1; }
.action-card { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; column-gap: 8px; min-width: 0; padding: 5px 10px; border-radius: 4px; color: #f5f5f5; text-shadow: 0 1px 3px #0009; font-variant-numeric: tabular-nums; }
.action-label { margin: 0; font-size: clamp(12px, 1.1vw, 16px); font-weight: 650; }
.action-total { display: flex; align-items: baseline; justify-content: space-between; gap: 9px; }
.action-rate { font-size: clamp(24px, 2.5vw, 34px); font-weight: 720; line-height: 1.05; letter-spacing: -.035em; }
.action-combos { color: #ffffffe0; font-size: 12px; text-align: right; }
.action-hand { grid-column: 1 / -1; display: flex; flex-wrap: wrap; justify-content: space-between; align-items: baseline; gap: 3px 8px; margin-top: 3px; padding-top: 3px; border-top: 1px solid #ffffff40; font-size: 11px; }
.hand-frequency { font-weight: 600; }
.detail-ev { color: #ffffffe0; }
.action-bar { display: flex; overflow: hidden; height: 15px; margin-top: 4px; border-radius: 3px; background: #262a33; }
.action-bar-segment { flex: none; height: 100%; }
.source-note { margin-top: 7px; }
.note { padding: 3px 1px; color: var(--muted); font-size: 12px; line-height: 1.55; }
@media (min-width: 900px) and (min-height: 650px) {
  body { height: 100dvh; overflow: hidden; display: grid; grid-template-rows: 41px minmax(0, 1fr); }
  main.frame { display: grid; grid-template-rows: auto auto minmax(0, 1fr); gap: 7px; min-height: 0; height: 100%; margin: 0 auto; }
  .spot, .strategy { margin-top: 0; }
  .strategy { display: flex; flex-direction: column; min-height: 0; }
  .chart-heading, .action-overview, .ev-status { flex: none; }
  .matrix-wrap { flex: 1; min-height: 0; }
  .matrix { height: 100%; grid-template-rows: repeat(13, minmax(0, 1fr)); container-type: size; }
  .hand { aspect-ratio: auto; min-height: 0; font-size: clamp(9px, min(1.3vw, 3cqh), 19px); line-height: 1.1; }
  .hand-with-ev { padding: 1px 5px; }
}
@media (min-width: 900px) and (min-height: 650px) and (max-height: 700px) {
  .hand { font-size: 8.5px; }
}
@media (max-width: 1200px) {
  .action-cards:has(.action-card:nth-child(4)) .action-combos { display: none; }
}
@media (max-width: 850px) {
  .frame { width: calc(100% - 24px); }
  .game-format { display: none; }
}
@media (max-width: 560px) {
  .frame { width: calc(100% - 18px); }
  main { padding-top: 7px; }
  .filters { gap: 10px 14px; }
  .matrix-wrap { margin: 6px; }
  .matrix { gap: 1px; }
  .hand { aspect-ratio: 1.04; }
  .hand-with-ev { padding: 2px; }
  .action-overview { padding: 9px 6px; }
  .action-card { display: block; padding: 8px 7px; }
  .action-label { font-size: 11px; }
  .action-total { flex-wrap: wrap; gap: 3px; }
  .action-rate { font-size: clamp(17px, 5vw, 28px); }
  .action-combos, .action-hand { font-size: 10px; }
  .action-bar { height: 18px; }
  .overview-heading { font-size: 11px; }
}

@media (max-width: 700px) {
  .filters { gap: 10px; }
  .mobile-settings-toggle { display: flex; align-items: center; justify-content: space-between; gap: 12px; width: 100%; min-height: 36px; padding: 2px 0; border: 0; background: transparent; text-align: left; }
  .mobile-settings-toggle span { min-width: 0; font-size: 13px; line-height: 1.5; color: #d2d2d2; }
  .mobile-settings-toggle b { flex: none; padding: 7px 10px; border: 1px solid #555; border-radius: 5px; font-size: 14px; }
  .filters.settings-collapsed > .filter-group, .filters.settings-collapsed > .quiz-settings { display: none; }
  .filters .segments button { min-height: 34px; font-size: 13px; }
}
