:root {
  color-scheme: dark;
  --bg: #061713;
  --bg-raised: #0a211c;
  --panel: #0d2b25;
  --panel-2: #11372f;
  --panel-3: #17463c;
  --line: rgba(221, 241, 231, 0.13);
  --line-strong: rgba(221, 241, 231, 0.24);
  --text: #f2f7f3;
  --muted: #a9beb5;
  --soft: #d5e2dc;
  --mint: #62e0ad;
  --mint-dark: #1da875;
  --gold: #f2c66f;
  --gold-soft: rgba(242, 198, 111, 0.14);
  --red: #ed6b73;
  --cream: #fffaf0;
  --ink: #18231f;
  --success-bg: rgba(65, 200, 139, 0.13);
  --danger-bg: rgba(237, 107, 115, 0.13);
  --shadow: 0 24px 70px rgba(0, 0, 0, 0.24);
  --radius-xl: 28px;
  --radius-lg: 20px;
  --radius-md: 14px;
  --topbar: 76px;
  font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  min-width: 320px;
  min-height: 100vh;
  background:
    radial-gradient(circle at 80% -10%, rgba(36, 150, 109, 0.13), transparent 34rem),
    var(--bg);
  color: var(--text);
  font-size: 16px;
  line-height: 1.55;
}

button, input { font: inherit; }
button { color: inherit; }
button:focus-visible, input:focus-visible, [tabindex]:focus-visible {
  outline: 3px solid rgba(98, 224, 173, 0.75);
  outline-offset: 3px;
}

h1, h2, h3, p { margin-top: 0; }
h1 { margin-bottom: 0.55rem; font-size: clamp(2rem, 4vw, 3.25rem); line-height: 1.08; letter-spacing: -0.035em; }
h2 { margin-bottom: 0.45rem; font-size: clamp(1.25rem, 2.1vw, 1.65rem); line-height: 1.25; letter-spacing: -0.018em; }
h3 { margin-bottom: 0.35rem; font-size: 1.05rem; line-height: 1.35; }
p { color: var(--muted); }

.skip-link {
  position: fixed;
  left: 1rem;
  top: -4rem;
  z-index: 1000;
  padding: 0.7rem 1rem;
  border-radius: 10px;
  background: var(--cream);
  color: var(--ink);
  transition: top 160ms ease;
}
.skip-link:focus { top: 0.8rem; }

.topbar {
  /* Keep the lesson header in normal flow so it cannot cover the table on scroll. */
  position: static;
  height: var(--topbar);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 2rem;
  border-bottom: 1px solid var(--line);
  background: rgba(6, 23, 19, 0.9);
  backdrop-filter: blur(18px);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.85rem;
  padding: 0;
  border: 0;
  background: none;
  cursor: pointer;
  text-align: left;
}
.brand strong { display: block; font-size: 1.06rem; letter-spacing: 0.06em; }
.brand small { display: block; margin-top: -0.12rem; color: var(--muted); font-size: 0.75rem; }
.brand-mark {
  position: relative;
  display: grid;
  width: 40px;
  height: 46px;
  place-items: center;
  border-radius: 8px;
  background: var(--cream);
  color: var(--red);
  box-shadow: 7px 5px 0 -1px var(--panel-3), 7px 5px 0 0 rgba(255, 255, 255, 0.36);
  transform: rotate(-4deg);
}
.brand-mark span { font-size: 1.2rem; transform: rotate(4deg); }
.topbar-actions { display: flex; align-items: center; gap: 0.75rem; }
.progress-chip, .install-button {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  min-height: 40px;
  padding: 0.5rem 0.85rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.035);
  color: var(--soft);
  font-size: 0.87rem;
}
.install-button { cursor: pointer; }
.install-button:hover { border-color: var(--mint); color: var(--mint); }
.progress-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--mint); box-shadow: 0 0 0 5px rgba(98, 224, 173, 0.1); }

.app-shell { display: grid; grid-template-columns: 252px minmax(0, 1fr); min-height: calc(100vh - var(--topbar)); }
.side-panel {
  position: sticky;
  top: 0;
  height: 100vh;
  display: flex;
  flex-direction: column;
  padding: 1.4rem 1rem 1.1rem;
  border-right: 1px solid var(--line);
  background: rgba(8, 29, 24, 0.58);
}
.side-nav { display: grid; gap: 0.35rem; }
.nav-item {
  display: flex;
  align-items: center;
  gap: 0.8rem;
  width: 100%;
  min-height: 48px;
  padding: 0.65rem 0.8rem;
  border: 1px solid transparent;
  border-radius: 12px;
  background: transparent;
  color: var(--muted);
  font-weight: 600;
  cursor: pointer;
  text-align: left;
}
.nav-item:hover { color: var(--text); background: rgba(255, 255, 255, 0.035); }
.nav-item.is-active { border-color: rgba(98, 224, 173, 0.18); background: rgba(98, 224, 173, 0.1); color: var(--mint); }
.nav-icon { display: grid; width: 30px; height: 30px; place-items: center; border-radius: 9px; background: rgba(255, 255, 255, 0.05); font-size: 1.05rem; }
.nav-item.is-active .nav-icon { background: rgba(98, 224, 173, 0.13); }

.side-progress { margin-top: auto; padding: 1rem; border: 1px solid var(--line); border-radius: var(--radius-md); background: rgba(255, 255, 255, 0.025); }
.side-progress-head { display: flex; justify-content: space-between; align-items: center; color: var(--soft); font-size: 0.86rem; }
.side-progress-head strong { color: var(--mint); }
.progress-track { height: 7px; margin: 0.75rem 0 0.65rem; overflow: hidden; border-radius: 999px; background: rgba(255, 255, 255, 0.07); }
.progress-track span { display: block; width: 0; height: 100%; border-radius: inherit; background: linear-gradient(90deg, var(--mint-dark), var(--mint)); transition: width 350ms ease; }
.side-progress p { margin: 0; font-size: 0.77rem; line-height: 1.5; }
.education-note { display: flex; gap: 0.55rem; margin: 0.9rem 0 0; padding: 0 0.35rem; font-size: 0.72rem; line-height: 1.5; }

main { width: 100%; min-width: 0; }
.view { display: none; width: min(1240px, 100%); margin: 0 auto; padding: 3rem clamp(1.4rem, 4vw, 4.5rem) 5rem; animation: view-in 220ms ease; }
.view.is-active { display: block; }
@keyframes view-in { from { opacity: 0; transform: translateY(7px); } to { opacity: 1; transform: translateY(0); } }

.page-heading { display: flex; align-items: center; justify-content: space-between; gap: 2rem; margin-bottom: 2.2rem; }
.page-heading > div:first-child { max-width: 760px; }
.page-heading p:not(.eyebrow) { max-width: 670px; margin-bottom: 0; font-size: 1.04rem; }
.compact-heading { align-items: flex-end; }
.compact-heading h1 { font-size: clamp(2rem, 3.5vw, 2.85rem); }
.eyebrow, .card-kicker { margin-bottom: 0.5rem; color: var(--mint); font-size: 0.77rem; font-weight: 800; letter-spacing: 0.13em; text-transform: uppercase; }
.panel-card { border: 1px solid var(--line); border-radius: var(--radius-xl); background: linear-gradient(145deg, rgba(17, 55, 47, 0.95), rgba(10, 35, 29, 0.98)); box-shadow: var(--shadow); }

.progress-ring {
  --progress: 0deg;
  flex: 0 0 auto;
  display: grid;
  width: 120px;
  height: 120px;
  place-items: center;
  border-radius: 50%;
  background: conic-gradient(var(--mint) var(--progress), rgba(255, 255, 255, 0.07) 0);
  box-shadow: 0 0 0 10px rgba(98, 224, 173, 0.035);
}
.progress-ring::before { content: ""; grid-area: 1 / 1; width: 93px; height: 93px; border-radius: 50%; background: var(--bg-raised); }
.progress-ring div { z-index: 1; grid-area: 1 / 1; display: grid; text-align: center; }
.progress-ring strong { font-size: 1.5rem; }
.progress-ring span { color: var(--muted); font-size: 0.7rem; }

.home-grid { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(360px, 0.85fr); gap: 1.25rem; }
.continue-card { position: relative; overflow: hidden; padding: 1.8rem; }
.continue-card::after { content: ""; position: absolute; right: -90px; bottom: -100px; width: 260px; height: 260px; border-radius: 50%; background: radial-gradient(circle, rgba(98, 224, 173, 0.15), transparent 68%); pointer-events: none; }
.continue-top, .section-title-row { display: flex; align-items: center; justify-content: space-between; gap: 1rem; }
.status-tag, .difficulty-pill { display: inline-flex; padding: 0.35rem 0.65rem; border-radius: 999px; background: rgba(98, 224, 173, 0.1); color: var(--mint); font-size: 0.75rem; font-weight: 700; }
.time-label { color: var(--muted); font-size: 0.78rem; }
.continue-card .card-kicker { margin-top: 1.6rem; }
.continue-card > p:not(.card-kicker) { max-width: 580px; }
.mini-table { display: flex; align-items: center; gap: 0.42rem; min-height: 84px; margin: 1.2rem 0 1.35rem; padding: 0.8rem 1rem; border: 1px solid rgba(98, 224, 173, 0.17); border-radius: 18px; background: radial-gradient(ellipse at center, rgba(30, 112, 85, 0.35), rgba(4, 25, 20, 0.55)); }
.mini-card { display: grid; width: 47px; height: 64px; place-items: center; border-radius: 8px; background: var(--cream); color: var(--ink); font-size: 1.05rem; font-weight: 900; box-shadow: 0 7px 17px rgba(0, 0, 0, 0.22); }
.mini-card span { font-size: 0.74rem; }
.mini-card.red { color: #cf3f49; }
.mini-card.board { background: rgba(255, 255, 255, 0.075); color: rgba(255, 255, 255, 0.35); border: 1px dashed rgba(255, 255, 255, 0.17); box-shadow: none; }
.table-line { width: 1px; height: 45px; margin: 0 0.35rem; background: var(--line-strong); }

.primary-button, .secondary-button, .text-button, .answer-button, .next-question, .lesson-nav-button {
  min-height: 46px;
  border-radius: 12px;
  border: 1px solid transparent;
  padding: 0.7rem 1rem;
  font-weight: 750;
  cursor: pointer;
  transition: transform 130ms ease, border-color 130ms ease, background 130ms ease;
}
.primary-button { position: relative; z-index: 1; display: inline-flex; align-items: center; justify-content: center; gap: 0.6rem; background: var(--mint); color: #062016; }
.primary-button:hover { transform: translateY(-2px); background: #7be8bd; }
.secondary-button { background: rgba(255, 255, 255, 0.045); border-color: var(--line-strong); color: var(--soft); }
.secondary-button:hover { border-color: var(--mint); color: var(--mint); }
.text-button { min-height: auto; padding: 0.35rem; background: none; color: var(--mint); }
.text-button:hover { text-decoration: underline; }

.warmup-card { padding: 1.5rem; }
.warmup-card .section-title-row { margin-bottom: 1rem; }
.warmup-hands { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 0.65rem; }
.warmup-choice { display: grid; gap: 0.5rem; min-width: 0; padding: 0.9rem 0.75rem; border: 1px solid var(--line); border-radius: 16px; background: rgba(255, 255, 255, 0.025); cursor: pointer; text-align: left; }
.warmup-choice > span:first-child { color: var(--muted); font-size: 0.75rem; }
.warmup-choice strong { font-size: 0.78rem; line-height: 1.4; }
.warmup-choice:hover { border-color: var(--mint); background: rgba(98, 224, 173, 0.06); }
.warmup-choice.is-correct { border-color: var(--mint); background: var(--success-bg); }
.warmup-choice.is-wrong { border-color: var(--red); background: var(--danger-bg); }
.versus { color: var(--muted); font-size: 0.7rem; font-weight: 800; }
.inline-feedback { margin-top: 1rem; min-height: 44px; padding: 0.65rem 0.8rem; border-radius: 11px; background: rgba(255, 255, 255, 0.035); color: var(--muted); font-size: 0.82rem; }
.inline-feedback.success { background: var(--success-bg); color: #a6f2ce; }
.inline-feedback.error { background: var(--danger-bg); color: #ffc2c7; }

.card-row { display: flex; gap: 0.42rem; flex-wrap: wrap; }
.playing-card { position: relative; display: inline-flex; flex: 0 0 auto; width: 62px; height: 86px; flex-direction: column; justify-content: space-between; padding: 0.36rem 0.42rem; border: 1px solid rgba(0, 0, 0, 0.08); border-radius: 9px; background: var(--cream); color: var(--ink); font-weight: 850; line-height: 1; box-shadow: 0 8px 18px rgba(0, 0, 0, 0.22); }
.playing-card.red { color: #ce3945; }
.playing-card .rank { font-size: 1rem; }
.playing-card .suit { align-self: flex-end; font-size: 1.5rem; }
.compact .playing-card { width: 32px; height: 46px; padding: 0.18rem 0.22rem; border-radius: 5px; }
.compact .playing-card .rank { font-size: 0.65rem; }
.compact .playing-card .suit { font-size: 0.82rem; }

.route-section { margin-top: 3rem; }
.route-section > .section-title-row { margin-bottom: 1.2rem; }
.route-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 0.8rem; }
.route-card { position: relative; min-height: 166px; padding: 1.2rem; border: 1px solid var(--line); border-radius: var(--radius-lg); background: rgba(255, 255, 255, 0.025); cursor: pointer; text-align: left; }
.route-card:hover { border-color: var(--line-strong); background: rgba(255, 255, 255, 0.04); transform: translateY(-2px); }
.route-card .route-index { display: inline-grid; width: 30px; height: 30px; place-items: center; margin-bottom: 1rem; border-radius: 9px; background: rgba(255, 255, 255, 0.055); color: var(--muted); font-size: 0.76rem; font-weight: 800; }
.route-card.is-done { border-color: rgba(98, 224, 173, 0.22); }
.route-card.is-done .route-index { background: rgba(98, 224, 173, 0.14); color: var(--mint); }
.route-card h3 { margin-bottom: 0.45rem; }
.route-card p { margin-bottom: 0; font-size: 0.8rem; }
.route-card .done-mark { position: absolute; top: 1rem; right: 1rem; color: var(--mint); font-weight: 800; }
.truth-strip { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1rem; margin-top: 2.5rem; padding: 1.1rem 0; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.truth-strip div { display: grid; gap: 0.15rem; padding: 0.5rem 1rem; border-right: 1px solid var(--line); }
.truth-strip div:last-child { border-right: 0; }
.truth-strip strong { color: var(--gold); font-size: 0.93rem; }
.truth-strip span { color: var(--muted); font-size: 0.78rem; }

/* Lessons */
.lesson-layout { display: grid; grid-template-columns: 280px minmax(0, 1fr); align-items: start; gap: 1.3rem; }
.lesson-list { display: grid; gap: 0.45rem; }
.lesson-list-button { display: grid; grid-template-columns: 36px 1fr auto; align-items: center; gap: 0.65rem; width: 100%; padding: 0.7rem; border: 1px solid transparent; border-radius: 13px; background: transparent; color: var(--muted); cursor: pointer; text-align: left; }
.lesson-list-button:hover { background: rgba(255, 255, 255, 0.035); color: var(--soft); }
.lesson-list-button.is-active { border-color: rgba(98, 224, 173, 0.18); background: rgba(98, 224, 173, 0.09); color: var(--text); }
.lesson-list-button.is-done .lesson-num { background: var(--mint); color: #062016; }
.lesson-num { display: grid; width: 34px; height: 34px; place-items: center; border-radius: 10px; background: rgba(255, 255, 255, 0.055); color: var(--muted); font-size: 0.76rem; font-weight: 800; }
.lesson-list-button strong { font-size: 0.84rem; line-height: 1.4; }
.lesson-list-button small { color: var(--muted); font-size: 0.7rem; }
.lesson-reader { min-height: 620px; padding: clamp(1.5rem, 4vw, 2.6rem); }
.lesson-reader-header { padding-bottom: 1.5rem; border-bottom: 1px solid var(--line); }
.lesson-meta { display: flex; gap: 0.7rem; margin-bottom: 1rem; }
.lesson-meta span { padding: 0.3rem 0.55rem; border-radius: 999px; background: rgba(255, 255, 255, 0.045); color: var(--muted); font-size: 0.72rem; }
.lesson-reader-header h2 { font-size: clamp(1.6rem, 3vw, 2.25rem); }
.lesson-reader-header p { max-width: 720px; margin-bottom: 0; }
.lesson-content { padding: 1.8rem 0 0; }
.lesson-content h3 { margin-top: 1.8rem; color: var(--soft); font-size: 1.18rem; }
.lesson-content > h3:first-child { margin-top: 0; }
.lesson-content p, .lesson-content li { color: var(--muted); }
.lesson-content strong { color: var(--soft); }
.lesson-content ul, .lesson-content ol { display: grid; gap: 0.65rem; padding-left: 1.25rem; }
.lesson-callout { display: grid; grid-template-columns: auto 1fr; gap: 0.9rem; margin: 1.4rem 0; padding: 1rem; border: 1px solid rgba(242, 198, 111, 0.22); border-radius: 15px; background: var(--gold-soft); }
.lesson-callout span { color: var(--gold); font-size: 1.2rem; }
.lesson-callout p { margin: 0; color: #eadfc7; }
.street-mini-flow { display: grid; grid-template-columns: repeat(4, 1fr); gap: 0.55rem; margin: 1rem 0 1.5rem; }
.street-mini-flow div { padding: 0.8rem; border: 1px solid var(--line); border-radius: 12px; background: rgba(255, 255, 255, 0.025); }
.street-mini-flow strong, .street-mini-flow small { display: block; }
.street-mini-flow small { margin-top: 0.25rem; color: var(--muted); }
.comparison-box { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 0.8rem; margin: 1.1rem 0; padding: 1rem; border: 1px solid var(--line); border-radius: 15px; background: rgba(0, 0, 0, 0.12); }
.comparison-box > div { display: grid; gap: 0.55rem; }
.comparison-box > span { color: var(--muted); font-size: 0.74rem; font-weight: 800; }
.lesson-footer { display: flex; justify-content: space-between; gap: 0.75rem; margin-top: 2.2rem; padding-top: 1.4rem; border-top: 1px solid var(--line); }
.lesson-nav-button { background: rgba(255, 255, 255, 0.04); border-color: var(--line); color: var(--soft); }
.lesson-nav-button.complete { margin-left: auto; background: var(--mint); color: #062016; }
.lesson-nav-button:disabled { opacity: 0.38; cursor: not-allowed; }

/* Rankings */
.ranking-list { display: grid; gap: 0.75rem; counter-reset: rank; }
.ranking-card { display: grid; grid-template-columns: 60px minmax(230px, 0.7fr) minmax(230px, 0.9fr) minmax(270px, 1.2fr) 24px; align-items: center; gap: 1.1rem; width: 100%; padding: 1rem 1.1rem; border: 1px solid var(--line); border-radius: 17px; background: rgba(255, 255, 255, 0.025); cursor: pointer; text-align: left; }
.ranking-card:hover, .ranking-card.is-open { border-color: var(--line-strong); background: rgba(255, 255, 255, 0.043); }
.ranking-order { color: var(--gold); font-size: 1.2rem; font-weight: 850; }
.ranking-name strong { display: block; font-size: 1rem; }
.ranking-name small { color: var(--muted); font-size: 0.72rem; }
.ranking-card .compact { flex-wrap: nowrap; }
.ranking-summary { color: var(--muted); font-size: 0.82rem; }
.expand-mark { color: var(--muted); transition: transform 170ms ease; }
.ranking-card.is-open .expand-mark { transform: rotate(45deg); }
.ranking-detail { display: none; grid-column: 2 / -2; padding-top: 0.4rem; color: var(--soft); font-size: 0.86rem; }
.ranking-card.is-open .ranking-detail { display: block; }
.tie-rule { display: grid; grid-template-columns: 100px 1fr; gap: 1.2rem; margin-top: 1.5rem; padding: 1.4rem; }
.rule-number { display: grid; min-height: 74px; place-items: center; border-radius: 14px; background: rgba(242, 198, 111, 0.11); color: var(--gold); font-weight: 850; }
.tie-rule h2 { margin-top: 0.15rem; }
.tie-rule p { margin-bottom: 0; }

/* Practice */
.practice-heading { align-items: center; }
.score-card { display: flex; flex: 0 0 auto; gap: 1.2rem; padding: 0.8rem 1rem; border: 1px solid var(--line); border-radius: 15px; background: rgba(255, 255, 255, 0.025); }
.score-card span { display: grid; color: var(--muted); font-size: 0.7rem; text-align: center; }
.score-card strong { color: var(--text); font-size: 1.1rem; }
.segmented-control { display: inline-flex; gap: 0.25rem; margin-bottom: 1rem; padding: 0.3rem; border: 1px solid var(--line); border-radius: 14px; background: rgba(255, 255, 255, 0.025); }
.segmented-control button { min-width: 100px; min-height: 42px; padding: 0.5rem 0.8rem; border: 0; border-radius: 10px; background: transparent; color: var(--muted); font-weight: 700; cursor: pointer; }
.segmented-control button.is-active { background: var(--panel-3); color: var(--mint); }
.practice-stage { min-height: 550px; padding: clamp(1.4rem, 4vw, 2.4rem); }
.question-top { display: flex; justify-content: space-between; gap: 1rem; margin-bottom: 1.5rem; }
.question-top span { color: var(--muted); font-size: 0.78rem; }
.question-top strong { color: var(--gold); font-size: 0.78rem; }
.question-copy { max-width: 700px; margin-bottom: 1.4rem; }
.question-copy h2 { font-size: clamp(1.5rem, 3vw, 2rem); }
.question-copy p { margin-bottom: 0; }
.question-hand { display: flex; justify-content: center; margin: 1.6rem 0 2rem; }
.question-hand .playing-card { width: clamp(54px, 8vw, 72px); height: clamp(76px, 11vw, 101px); }
.answer-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0.7rem; }
.answer-button { min-height: 56px; background: rgba(255, 255, 255, 0.035); border-color: var(--line); color: var(--soft); text-align: left; }
.answer-button:hover:not(:disabled) { border-color: var(--mint); background: rgba(98, 224, 173, 0.06); }
.answer-button.is-correct { border-color: var(--mint); background: var(--success-bg); color: #b0f3d3; }
.answer-button.is-wrong { border-color: var(--red); background: var(--danger-bg); color: #ffc3c7; }
.answer-button:disabled { cursor: default; }
.explanation { margin-top: 1.2rem; padding: 1rem; border-left: 3px solid var(--mint); border-radius: 0 12px 12px 0; background: rgba(98, 224, 173, 0.07); }
.explanation.error { border-left-color: var(--red); background: rgba(237, 107, 115, 0.07); }
.explanation strong { display: block; margin-bottom: 0.25rem; }
.explanation p { margin-bottom: 0; color: var(--soft); }
.next-question { display: block; margin: 1rem 0 0 auto; background: var(--mint); color: #062016; }
.poker-table { position: relative; max-width: 820px; margin: 1.2rem auto 1.7rem; padding: 1.5rem clamp(1rem, 5vw, 3rem); border: 8px solid #173e35; border-radius: 42% / 24%; background: radial-gradient(ellipse, #17674e 0%, #0e4938 58%, #0a3529 100%); box-shadow: inset 0 0 0 2px rgba(255, 255, 255, 0.09), 0 18px 35px rgba(0, 0, 0, 0.24); }
.board-area { display: grid; justify-content: center; gap: 0.45rem; text-align: center; }
.board-area > span, .player-label { color: rgba(255, 255, 255, 0.72); font-size: 0.74rem; font-weight: 700; }
.board-area .card-row { justify-content: center; flex-wrap: nowrap; }
.player-hands { display: grid; grid-template-columns: 1fr 1fr; gap: clamp(1rem, 8vw, 5rem); margin-top: 1.3rem; }
.player-hand { display: grid; justify-items: center; gap: 0.45rem; }
.player-hand .card-row { flex-wrap: nowrap; }
.winner-answers { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0.65rem; }
.best-hand-summary { display: grid; grid-template-columns: 1fr 1fr; gap: 0.6rem; margin-top: 0.8rem; }
.best-hand-summary div { padding: 0.7rem; border: 1px solid var(--line); border-radius: 11px; color: var(--muted); font-size: 0.8rem; }
.best-hand-summary strong { color: var(--soft); }
.scenario-facts { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0.7rem; margin: 1.2rem 0 1.5rem; }
.scenario-facts div { padding: 0.85rem; border: 1px solid var(--line); border-radius: 13px; background: rgba(255, 255, 255, 0.025); }
.scenario-facts span { display: block; color: var(--muted); font-size: 0.72rem; }
.scenario-facts strong { font-size: 1rem; }

/* Odds */
.odds-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1.1rem; }
.calculator-card { padding: clamp(1.3rem, 3vw, 1.8rem); }
.calculator-heading { display: flex; align-items: center; gap: 0.8rem; margin-bottom: 1.5rem; }
.calculator-heading .card-kicker, .calculator-heading h2 { margin-bottom: 0; }
.step-badge { display: grid; flex: 0 0 auto; width: 40px; height: 40px; place-items: center; border-radius: 12px; background: rgba(98, 224, 173, 0.12); color: var(--mint); font-weight: 850; }
.field-label { display: flex; justify-content: space-between; gap: 1rem; margin-bottom: 0.6rem; color: var(--soft); font-weight: 700; }
.field-label output { color: var(--gold); }
.range-input { width: 100%; accent-color: var(--mint); }
.quick-outs { display: flex; flex-wrap: wrap; gap: 0.45rem; margin: 1rem 0; }
.quick-outs button, .street-toggle button { min-height: 38px; padding: 0.45rem 0.65rem; border: 1px solid var(--line); border-radius: 10px; background: rgba(255, 255, 255, 0.025); color: var(--muted); font-size: 0.76rem; cursor: pointer; }
.quick-outs button.is-active, .street-toggle button.is-active { border-color: rgba(98, 224, 173, 0.35); background: rgba(98, 224, 173, 0.1); color: var(--mint); }
.street-toggle { display: grid; grid-template-columns: 1fr 1fr; gap: 0.5rem; margin: 1.2rem 0; }
.probability-result { display: grid; grid-template-columns: 1fr 1fr; gap: 0.7rem; }
.probability-result div { display: grid; padding: 0.9rem; border-radius: 14px; background: rgba(255, 255, 255, 0.04); }
.probability-result span, .probability-result small { color: var(--muted); font-size: 0.7rem; }
.probability-result strong { margin: 0.15rem 0; color: var(--mint); font-size: 1.55rem; }
.micro-note, .formula-line { margin: 1rem 0 0; font-size: 0.76rem; }
.input-grid { display: grid; gap: 0.8rem; }
.input-grid label { display: grid; grid-template-columns: 1fr 150px; align-items: center; gap: 0.8rem; color: var(--soft); font-size: 0.83rem; }
.number-field { display: grid; grid-template-columns: 1fr auto; align-items: center; overflow: hidden; border: 1px solid var(--line); border-radius: 10px; background: rgba(0, 0, 0, 0.12); }
.number-field input { width: 100%; min-width: 0; padding: 0.55rem 0.35rem 0.55rem 0.65rem; border: 0; outline: 0; background: transparent; color: var(--text); }
.number-field em { padding-right: 0.65rem; color: var(--muted); font-size: 0.7rem; font-style: normal; }
.pot-visual { display: flex; align-items: center; justify-content: center; gap: 0.55rem; margin: 1.1rem 0; padding: 0.8rem; border-radius: 13px; background: rgba(0, 0, 0, 0.11); }
.pot-visual span { color: var(--muted); font-size: 0.73rem; }
.pot-visual strong { display: block; color: var(--soft); font-size: 0.95rem; text-align: center; }
.pot-visual i { color: var(--gold); font-style: normal; }
.decision-result { padding: 0.9rem; border: 1px solid rgba(98, 224, 173, 0.2); border-radius: 14px; background: var(--success-bg); }
.decision-result.is-fold { border-color: rgba(237, 107, 115, 0.24); background: var(--danger-bg); }
.decision-result div { display: flex; align-items: center; justify-content: space-between; gap: 1rem; }
.decision-result div span { color: var(--muted); font-size: 0.76rem; }
.decision-result div strong { color: var(--mint); font-size: 1.35rem; }
.decision-result.is-fold div strong { color: var(--red); }
.decision-result p { margin: 0.5rem 0 0; color: var(--soft); font-size: 0.8rem; }
.concept-section { margin-top: 2.6rem; }
.concept-section > .section-title-row { margin-bottom: 1rem; }
.concept-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 0.8rem; }
.concept-grid article { padding: 1.2rem; border: 1px solid var(--line); border-radius: 17px; background: rgba(255, 255, 255, 0.022); }
.concept-grid article > strong { display: block; margin-bottom: 0.7rem; color: var(--gold); font-size: 1.4rem; }
.concept-grid p { margin-bottom: 0; font-size: 0.8rem; }

/* Cheatsheet */
.street-flow { padding: 1.5rem; }
.street-flow > .section-title-row { margin-bottom: 1.1rem; }
.flow-steps { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); }
.flow-steps article { position: relative; padding: 1rem; border-right: 1px solid var(--line); }
.flow-steps article:last-child { border-right: 0; }
.flow-steps article > span { display: inline-grid; width: 29px; height: 29px; place-items: center; margin-bottom: 0.8rem; border-radius: 9px; background: rgba(98, 224, 173, 0.1); color: var(--mint); font-size: 0.7rem; font-weight: 850; }
.flow-steps p { min-height: 48px; margin-bottom: 0.5rem; font-size: 0.78rem; }
.flow-steps small { color: var(--gold); }
.cheat-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; margin-top: 1rem; }
.cheat-grid > article { padding: 1.5rem; }
.action-list { margin: 1rem 0 0; }
.action-list div { display: grid; grid-template-columns: 125px 1fr; gap: 0.8rem; padding: 0.7rem 0; border-bottom: 1px solid var(--line); }
.action-list div:last-child { border-bottom: 0; }
.action-list dt { color: var(--soft); font-weight: 750; }
.action-list dd { margin: 0; color: var(--muted); font-size: 0.8rem; }
.check-list { display: grid; gap: 0.7rem; margin: 1rem 0 0; padding: 0; list-style: none; }
.check-list li { display: grid; grid-template-columns: 30px 1fr; gap: 0.7rem; }
.check-list li > span { display: grid; width: 28px; height: 28px; place-items: center; border-radius: 8px; background: rgba(242, 198, 111, 0.11); color: var(--gold); font-size: 0.7rem; font-weight: 850; }
.check-list strong { font-size: 0.86rem; }
.check-list p { margin: 0.15rem 0 0; font-size: 0.76rem; }
.mistakes-section { margin-top: 2.6rem; }
.mistakes-section > .section-title-row { margin-bottom: 1rem; }
.mistake-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 0.8rem; }
.mistake-grid article { padding: 1.2rem; border-top: 2px solid var(--line-strong); background: rgba(255, 255, 255, 0.018); }
.mistake-grid article > span { color: var(--red); font-size: 0.72rem; font-weight: 850; }
.mistake-grid h3 { margin-top: 0.65rem; }
.mistake-grid p { margin-bottom: 0; font-size: 0.8rem; }

.mobile-nav { display: none; }
.toast { position: fixed; right: 1.2rem; bottom: 1.2rem; z-index: 100; max-width: 330px; padding: 0.8rem 1rem; border: 1px solid var(--line-strong); border-radius: 12px; background: #153c33; box-shadow: var(--shadow); color: var(--soft); font-size: 0.84rem; opacity: 0; transform: translateY(12px); pointer-events: none; transition: 180ms ease; }
.toast.is-visible { opacity: 1; transform: translateY(0); }

@media (max-width: 1080px) {
  .app-shell { grid-template-columns: 210px minmax(0, 1fr); }
  .home-grid { grid-template-columns: 1fr; }
  .route-grid, .concept-grid, .mistake-grid { grid-template-columns: repeat(2, 1fr); }
  .ranking-card { grid-template-columns: 45px minmax(180px, 0.8fr) minmax(250px, 1fr) 24px; }
  .ranking-summary { display: none; }
  .ranking-detail { grid-column: 2 / -2; }
  .lesson-layout { grid-template-columns: 225px minmax(0, 1fr); }
}

@media (max-width: 820px) {
  :root { --topbar: 66px; }
  body { padding-bottom: calc(68px + env(safe-area-inset-bottom)); }
  .topbar { padding: 0 1rem; }
  .brand small { display: none; }
  .progress-chip { min-height: 36px; padding: 0.4rem 0.7rem; }
  .install-button { display: none !important; }
  .app-shell { display: block; min-height: 0; }
  .side-panel { display: none; }
  .view { padding: 2rem 1rem 3.5rem; }
  .page-heading { align-items: flex-start; }
  .home-heading { display: grid; grid-template-columns: 1fr auto; }
  .home-heading > div:first-child { grid-column: 1 / -1; }
  .home-heading .progress-ring { grid-column: 2; grid-row: 1; display: none; }
  .lesson-layout { grid-template-columns: 1fr; }
  .lesson-list { display: flex; gap: 0.5rem; margin: 0 -1rem; padding: 0 1rem 0.5rem; overflow-x: auto; scrollbar-width: none; }
  .lesson-list::-webkit-scrollbar { display: none; }
  .lesson-list-button { flex: 0 0 190px; }
  .lesson-reader { min-height: auto; }
  .odds-grid, .cheat-grid { grid-template-columns: 1fr; }
  .flow-steps { grid-template-columns: repeat(5, 180px); overflow-x: auto; }
  .street-flow { overflow: hidden; }
  .mobile-nav { position: fixed; left: 0; right: 0; bottom: 0; z-index: 50; display: grid; grid-template-columns: repeat(6, 1fr); min-height: calc(64px + env(safe-area-inset-bottom)); padding: 0.35rem 0.35rem env(safe-area-inset-bottom); border-top: 1px solid var(--line); background: rgba(6, 23, 19, 0.96); backdrop-filter: blur(16px); }
  .mobile-nav button { display: grid; justify-items: center; align-content: center; gap: 0.1rem; border: 0; border-radius: 10px; background: transparent; color: var(--muted); font-size: 0.65rem; cursor: pointer; }
  .mobile-nav button span { font-size: 1rem; }
  .mobile-nav button.is-active { background: rgba(98, 224, 173, 0.08); color: var(--mint); }
  .toast { right: 1rem; bottom: calc(76px + env(safe-area-inset-bottom)); }
}

@media (max-width: 620px) {
  h1 { font-size: 2rem; }
  .page-heading { display: block; margin-bottom: 1.5rem; }
  .page-heading .secondary-button { margin-top: 1rem; }
  .continue-card, .warmup-card, .lesson-reader, .practice-stage, .calculator-card, .cheat-grid > article { border-radius: 20px; }
  .home-grid { gap: 0.8rem; }
  .warmup-hands { grid-template-columns: 1fr; }
  .versus { text-align: center; }
  .route-grid, .concept-grid, .mistake-grid { grid-template-columns: 1fr; }
  .route-card { min-height: 140px; }
  .truth-strip { grid-template-columns: 1fr; }
  .truth-strip div { border-right: 0; border-bottom: 1px solid var(--line); }
  .truth-strip div:last-child { border-bottom: 0; }
  .street-mini-flow { grid-template-columns: repeat(2, 1fr); }
  .comparison-box { grid-template-columns: 1fr; }
  .comparison-box > span { text-align: center; }
  .ranking-card { grid-template-columns: 38px minmax(0, 1fr) 24px; gap: 0.7rem; padding: 0.85rem; }
  .ranking-card .card-row { grid-column: 2 / -1; }
  .ranking-card .compact .playing-card { width: 29px; height: 42px; }
  .ranking-detail { grid-column: 2 / -1; }
  .tie-rule { grid-template-columns: 1fr; }
  .rule-number { min-height: 48px; }
  .practice-heading .score-card { margin-top: 1rem; }
  .score-card { width: 100%; justify-content: space-around; }
  .segmented-control { display: grid; grid-template-columns: repeat(3, 1fr); width: 100%; }
  .segmented-control button { min-width: 0; }
  .answer-grid, .winner-answers { grid-template-columns: 1fr; }
  .question-hand .card-row { flex-wrap: nowrap; gap: 0.25rem; }
  .question-hand .playing-card { width: 49px; height: 70px; }
  .poker-table { margin-inline: -0.5rem; padding: 1.3rem 0.5rem; border-width: 5px; border-radius: 28px; }
  .board-area .playing-card { width: 42px; height: 60px; }
  .player-hand .playing-card { width: 45px; height: 64px; }
  .player-hands { gap: 0.8rem; }
  .best-hand-summary { grid-template-columns: 1fr; }
  .scenario-facts { grid-template-columns: 1fr; }
  .input-grid label { grid-template-columns: 1fr; gap: 0.35rem; }
  .pot-visual { gap: 0.35rem; }
  .probability-result { grid-template-columns: 1fr 1fr; }
  .lesson-footer { flex-wrap: wrap; }
  .lesson-nav-button.complete { order: -1; width: 100%; margin-left: 0; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
}

/* Clear rules and complete training workspaces, extending the original green theme. */
[hidden] { display: none !important; }
button:disabled { cursor: not-allowed; }
.secondary-button:disabled, .primary-button:disabled, .text-button:disabled { opacity: .42; transform: none; }
select { font: inherit; color: var(--text); background: var(--bg-raised); border: 1px solid var(--line-strong); border-radius: 10px; padding: .55rem .8rem; }
select:focus-visible, summary:focus-visible { outline: 3px solid var(--mint); outline-offset: 3px; }
summary { cursor: pointer; color: var(--soft); }
.side-panel { overflow-y: auto; gap: 1rem; }
.side-progress { flex-shrink: 0; }
.refresh-warmup { flex-shrink: 0; font-size: .875rem; }
.warmup-meta { font-size: .875rem; margin-bottom: .8rem; }
.warmup-tie { display: block; width: 100%; margin-top: .75rem; font-size: .875rem; }
.warmup-tie.is-correct { border-color: var(--mint); background: var(--success-bg); }
.warmup-tie.is-wrong { border-color: var(--red); background: var(--danger-bg); }
.warmup-choice strong, .warmup-choice > span:first-child, .inline-feedback { font-size: .875rem; }
.rank-guide { padding: 1.35rem; border: 1px solid var(--line); border-radius: 18px; background: rgba(255,255,255,.025); }
.rank-guide-top { display: grid; grid-template-columns: 40px minmax(0,1fr) auto; gap: .9rem; align-items: center; margin-bottom: 1rem; }
.rank-guide h2 { font-size: 1.3rem; margin-bottom: .35rem; }
.rank-formula { color: var(--gold); font-size: .95rem; }
.rank-guide p { margin: .6rem 0; font-size: 1rem; line-height: 1.75; }
.rank-guide p strong { display: block; color: var(--soft); margin-bottom: .15rem; font-size: .875rem; }
.rank-guide-notes { display: grid; grid-template-columns: 1fr 1fr; gap: 1.3rem; border-top: 1px solid var(--line); margin-top: .8rem; padding-top: .3rem; }
.rank-guide-notes p:last-child strong { color: var(--gold); }
.rank-guide .compact .playing-card { width: 37px; height: 52px; }
.rank-guide .compact .rank { font-size: .875rem; }
.rank-guide .compact .suit { font-size: 1rem; }
.analyzer-top { display: grid; grid-template-columns: 1fr; gap: 1rem; }
.selection-panel, .analyzer-result, .deck-panel { padding: 1.5rem; min-width: 0; }
.muted-count, .selection-hint { color: var(--muted); font-size: .875rem; font-weight: 400; line-height: 1.65; }
.selection-hint { margin: .8rem 0 0; }
.selected-slots { display: flex; flex-wrap: wrap; gap: .6rem; margin-top: 1rem; }
.selected-card { padding: 0; border: 0; background: none; cursor: pointer; }
.selected-card > span:last-child { display: block; color: var(--muted); font-size: .875rem; margin-top: .4rem; }
.empty-card { display: grid; place-items: center; flex: 0 0 auto; width: 62px; height: 86px; border: 1px dashed var(--line-strong); border-radius: 9px; color: var(--muted); font-size: .875rem; }
.playing-card.is-best { outline: 2px solid var(--gold); outline-offset: 2px; }
.analyzer-result h2 { color: var(--mint); font-size: 1.9rem; }
.analyzer-result > p { margin-top: 1rem; margin-bottom: 0; }
.analyzer-result > .card-kicker { margin-top: 0; }
.analyzer-result .hand-description { margin: .4rem 0 1rem; color: var(--soft); }
.result-cards .playing-card { width: 48px; height: 68px; }
.deck-panel { margin-top: 1rem; }
.deck-panel .section-title-row { flex-wrap: wrap; }
.suit-group { margin-top: 1.25rem; }
.suit-group h3 { margin-bottom: .6rem; color: var(--soft); font-size: .875rem; }
.suit-group h3.red-text { color: var(--red); }
.deck-row { display: grid; grid-template-columns: repeat(13,minmax(0,1fr)); gap: .45rem; }
.deck-card { position: relative; min-width: 0; padding: 3px; background: transparent; border: 1px solid transparent; border-radius: 9px; cursor: pointer; }
.deck-card .playing-card { width: 100%; height: auto; min-height: 60px; aspect-ratio: .7; padding: .3rem; }
.deck-card .playing-card .rank { font-size: 1rem; }
.deck-card .playing-card .suit { font-size: 1.25rem; }
.deck-card:not(:disabled):hover { border-color: var(--mint); transform: translateY(-2px); }
.deck-card.is-selected { border-color: var(--gold); background: var(--gold-soft); }
.deck-card:disabled { opacity: .32; }
.pick-mark { position: absolute; right: -3px; top: -5px; display: grid; place-items: center; width: 21px; height: 21px; border-radius: 50%; color: #062016; background: var(--mint); opacity: 0; font-size: .875rem; font-weight: 900; }
.deck-card.is-selected .pick-mark { opacity: 1; background: var(--gold); }
.training-settings { padding: 1.4rem; margin-bottom: 1.2rem; }
.training-settings .section-title-row { flex-wrap: wrap; gap: .5rem; }
.difficulty-field { border: 0; padding: 0; margin: 1rem 0; min-width: 0; }
.difficulty-field legend { font-size: .875rem; margin-bottom: .65rem; color: var(--muted); }
.difficulty-grid { display: grid; grid-template-columns: repeat(4,minmax(0,1fr)); gap: .6rem; }
.difficulty-option { display: flex; flex-direction: column; gap: .5rem; padding: .8rem; border: 1px solid var(--line-strong); border-radius: 12px; cursor: pointer; min-width: 0; }
.difficulty-option.is-selected { border-color: var(--mint); background: var(--success-bg); }
.difficulty-option > span { font-size: .95rem; font-weight: 700; }
.difficulty-option small { color: var(--muted); font-size: .875rem; line-height: 1.55; }
.difficulty-option input { margin: 0; accent-color: var(--mint); }
.difficulty-field:disabled .difficulty-option { cursor: default; opacity: .65; }
.difficulty-field:disabled .is-selected { opacity: 1; }
.training-options { display: flex; flex-wrap: wrap; gap: 1.1rem; align-items: center; }
.training-options label { display: flex; align-items: center; gap: .5rem; font-size: .95rem; }
.hint-switch { cursor: pointer; }
.hint-switch input { width: 19px; height: 19px; accent-color: var(--mint); }
.training-options .primary-button { margin-left: auto; }
.training-rules { margin-top: 1rem; border-top: 1px solid var(--line); padding-top: .85rem; }
.training-rules summary { font-size: .875rem; }
.training-rules p { margin: .8rem 0 0; font-size: .95rem; }
.training-empty { border: 1px dashed var(--line-strong); border-radius: 24px; padding: 2rem; text-align: center; }
.training-empty > span { color: var(--mint); font-size: 2.5rem; }
.training-empty h2 { margin-top: .65rem; }
.training-empty p { max-width: 580px; margin: .75rem auto; }
#trainingArena { scroll-margin-top: 1rem; }
.training-scoreline { display: flex; flex-wrap: wrap; justify-content: space-between; gap: .5rem; color: var(--muted); font-size: .875rem; margin: 1.4rem 0 .75rem; }
.training-table { padding: 1.5rem; border: 6px solid #235747; border-radius: 42px; background: radial-gradient(ellipse at center, #186348, #0a3328 78%); box-shadow: inset 0 0 0 1px rgba(255,255,255,.12),var(--shadow); }
.opponent-seats { display: flex; justify-content: center; flex-wrap: wrap; gap: .8rem; }
.opponent-seat { flex: 1; min-width: 110px; max-width: 180px; padding: .65rem; border: 1px solid rgba(255,255,255,.2); border-radius: 15px; background: rgba(0,15,10,.35); text-align: center; }
.opponent-seat.is-acting { border-color: var(--gold); box-shadow: 0 0 0 2px rgba(242,198,111,.15); }
.seat-label { display: flex; justify-content: center; flex-wrap: wrap; gap: .4rem; align-items: baseline; }
.seat-label span, .seat-stack, .opponent-seat p { font-size: .875rem; color: #c3d9cf; }
.opponent-seat .card-row { justify-content: center; flex-wrap: nowrap; margin: .55rem 0; }
.opponent-seat .compact .playing-card { width: 34px; height: 48px; }
.opponent-seat .compact .rank { font-size: .875rem; }
.opponent-seat p { margin: .25rem 0 0; }
.card-back { justify-content: center; align-items: center; color: #b9d8cb; background: repeating-linear-gradient(45deg,#164a3b,#164a3b 4px,#1c5746 4px,#1c5746 8px); border: 2px solid #9fbcb0; box-shadow: none; }
.card-back > span { font-size: 1.25rem; }
.has-folded { opacity: .65; }
.table-center { display: grid; justify-items: center; gap: 1rem; margin: 1.1rem 0; }
.table-pot { display: flex; align-items: baseline; flex-wrap: wrap; justify-content: center; gap: .5rem; color: #d0e4db; }
.table-pot span, .table-pot small { font-size: .875rem; }
.table-pot strong { color: var(--gold); font-size: 2rem; line-height: 1.2; }
.community-cards { display: flex; justify-content: center; gap: .45rem; max-width: 100%; }
.board-placeholder { color: #bdd1c8; border-color: rgba(255,255,255,.28); background: rgba(0,0,0,.1); }
.street-indicator { display: flex; flex-wrap: wrap; justify-content: center; gap: .4rem; }
.street-indicator span { padding: .2rem .55rem; color: #bfd6ca; font-size: .875rem; border-radius: 6px; }
.street-indicator .is-current { color: var(--gold); background: rgba(242,198,111,.13); }
.hero-seat { display: grid; justify-items: center; gap: .6rem; }
.hero-seat > div:first-child { display: flex; flex-wrap: wrap; gap: .8rem; justify-content: center; align-items: baseline; }
.hero-seat > div:first-child span, .hero-seat p { font-size: .875rem; color: #c5dacf; }
.hero-seat p { margin: 0; }
.hero-seat .playing-card { width: 54px; height: 74px; }
.action-panel { padding: 1.2rem; margin: 1rem 0; border-color: rgba(98,224,173,.3); }
.action-status { display: grid; gap: .3rem; margin-bottom: 1rem; }
.action-status strong { color: var(--mint); font-size: 1.1rem; }
.action-status span { color: var(--muted); font-size: .95rem; }
.training-actions { display: grid; grid-template-columns: 1fr 1fr 1.25fr; gap: .75rem; }
.fold-button { color: #ffb3b9; }
.action-panel > .text-button { display: block; margin-top: .8rem; }
.coach-panel, .review-panel { padding: 1.4rem; margin-top: 1rem; }
.coach-panel .section-title-row { gap: .7rem; flex-wrap: wrap; margin-bottom: 1rem; }
.combination-cards { display: flex; flex-wrap: wrap; gap: .55rem; margin: 1rem 0; }
.combination-cards > div { display: grid; justify-items: center; gap: .55rem; }
.combination-cards .playing-card { width: 46px; height: 65px; }
.combination-cards > div > span:last-child { color: var(--gold); font-size: .875rem; }
.coach-panel p, .review-panel p { line-height: 1.75; }
.coach-advice { padding: .1rem 1rem; border-left: 3px solid var(--mint); background: rgba(98,224,173,.05); margin-top: 1rem; }
.coach-advice p { margin: .65rem 0; }
.improvement-details { border-top: 1px solid var(--line); margin-top: 1rem; padding-top: .8rem; }
.improvement-details > p { margin: .85rem 0; }
.improvement-list { display: grid; gap: .5rem; }
.improvement-list > div { padding: .75rem; background: rgba(255,255,255,.035); border-radius: 9px; }
.improvement-list strong { display: block; color: var(--gold); font-size: .95rem; }
.improvement-list span { display: block; margin-top: .25rem; color: var(--muted); font-size: .875rem; overflow-wrap: anywhere; }
.showdown-grid { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: .8rem; }
.showdown-player { min-width: 0; padding: 1rem; border: 1px solid var(--line); border-radius: 16px; background: rgba(0,0,0,.09); }
.showdown-player.is-winner { border-color: var(--gold); background: rgba(242,198,111,.055); }
.showdown-player .section-title-row { margin-bottom: .65rem; }
.showdown-player .section-title-row > span { font-size: .875rem; color: var(--gold); }
.showdown-player .revealed-hole { display: flex; align-items: center; gap: .7rem; margin-bottom: 1rem; }
.revealed-hole > span { color: var(--muted); font-size: .875rem; }
.showdown-player .compact .rank { font-size: .875rem; }
.showdown-player .combination-cards { gap: .4rem; }
.showdown-player .playing-card { width: 40px; height: 58px; }
.showdown-player .combination-cards > div > span:last-child { font-size: .8rem; }
.showdown-player p { font-size: .95rem; margin-bottom: .5rem; }
.hypothetical-area { padding: 1rem 0; border-bottom: 1px solid var(--line); }
.hypothetical-area h3 { margin-top: 1rem; color: var(--gold); }
.hypothetical-results { margin-top: 1rem; }
.hypothetical-results p { margin: .4rem 0; }
.decision-review { margin-top: 1.5rem; }
.decision-review > p { margin: .5rem 0 1rem; }
.decision-review details { border-top: 1px solid var(--line); padding: .9rem 0; }
.decision-review details:first-of-type { border-top: 0; }
.decision-review summary > span { display: inline-block; color: var(--muted); font-size: .875rem; margin-left: .8rem; }
.review-snapshot { padding: .85rem 0 0; }
.review-snapshot > span { color: var(--muted); font-size: .875rem; }
.review-snapshot p { margin: .5rem 0 0; }
.next-focus { border-radius: 12px; border: 1px solid rgba(98,224,173,.25); padding: 1rem; background: var(--success-bg); }
.next-focus h3 { color: var(--mint); }
.next-focus p { margin-bottom: 0; }
.hand-history { padding: 1rem 1.4rem; margin-top: 1rem; }
.hand-history ol { padding-left: 1.4rem; }
.hand-history li { padding: .3rem 0; color: var(--soft); font-size: .95rem; }
.hand-history li > span { color: var(--muted); font-size: .875rem; margin-right: .5rem; }
@media (min-width: 1320px) {
  .analyzer-top { grid-template-columns: 1.15fr 1fr; align-items: start; }
  .selected-slots { gap: .45rem; }
  .selected-slots .playing-card, .selected-slots .empty-card { width: 48px; height: 68px; }
}
@media (max-width: 1100px) {
  .difficulty-grid { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .deck-row { grid-template-columns: repeat(7,minmax(0,1fr)); }
  .deck-card .playing-card { max-height: 98px; }
  .rank-guide-top { grid-template-columns: 35px minmax(0,1fr); }
  .rank-guide-top > .card-row { grid-column: 2; }
  .showdown-grid { grid-template-columns: 1fr; }
}
@media (max-width: 820px) {
  body { padding-bottom: calc(116px + env(safe-area-inset-bottom)); }
  .mobile-nav { grid-template-columns: repeat(4,minmax(0,1fr)); grid-template-rows: repeat(2,52px); min-height: calc(112px + env(safe-area-inset-bottom)); }
  .mobile-nav button { font-size: .875rem; }
  .mobile-nav button span { font-size: 1rem; line-height: 1; }
  .toast { bottom: calc(124px + env(safe-area-inset-bottom)); }
  .deck-row { grid-template-columns: repeat(13,minmax(0,1fr)); }
  .showdown-grid { grid-template-columns: repeat(2,minmax(0,1fr)); }
}
@media (max-width: 620px) {
  .selection-panel, .analyzer-result, .deck-panel, .training-settings, .coach-panel, .review-panel { padding: 1rem; border-radius: 20px; }
  .selected-slots { gap: .5rem; }
  .selected-slots .playing-card, .selected-slots .empty-card { width: 48px; height: 68px; }
  .deck-row { grid-template-columns: repeat(7,minmax(0,1fr)); gap: .15rem; }
  .deck-card .playing-card { min-height: 54px; }
  .deck-card .playing-card .rank { font-size: .9rem; }
  .deck-card .playing-card .suit { font-size: 1.1rem; }
  .deck-panel .section-title-row { align-items: flex-start; }
  .rank-guide { padding: 1rem; }
  .rank-guide-notes { grid-template-columns: 1fr; gap: .2rem; }
  .rank-guide-top { gap: .6rem; }
  .rank-formula { font-size: .875rem; }
  .training-options { align-items: flex-start; flex-direction: column; gap: 1rem; }
  .training-options .primary-button { margin: 0; width: 100%; }
  .difficulty-option { padding: .65rem; }
  .difficulty-option > span { font-size: .875rem; }
  .training-table { padding: 1rem .65rem; border-radius: 25px; border-width: 4px; }
  .opponent-seats { gap: .5rem; }
  .opponent-seat { flex: 1 1 40%; min-width: 0; max-width: 160px; }
  .table-center { margin: 1.2rem 0; }
  .community-cards { gap: .35rem; }
  .community-cards .playing-card, .community-cards .empty-card { width: 43px; height: 62px; }
  .community-cards .suit { font-size: 1.2rem; }
  .street-indicator { gap: .1rem; }
  .street-indicator span { padding-inline: .4rem; }
  .training-actions { gap: .45rem; grid-template-columns: 1fr 1fr 1.2fr; }
  .training-actions button { padding: .65rem .25rem; font-size: .875rem; }
  .action-panel { padding: 1rem; }
  .showdown-grid { grid-template-columns: 1fr; }
  .showdown-player { padding: .85rem; }
  .showdown-player .combination-cards .playing-card { width: 42px; height: 60px; }
  .decision-review summary > span { display: block; margin: .35rem 0 0 1rem; }
  .hypothetical-cards .playing-card { width: 43px; height: 62px; }
}
@media (prefers-reduced-motion: reduce) {
  .deck-card:not(:disabled):hover { transform: none; }
}

.warmup-choice .compact .playing-card .rank, .warmup-choice .compact .playing-card .suit { font-size: .875rem; }
