:root {
  color-scheme: dark;
  --page: #0c131f;
  --panel: #111d2c;
  --panel-deep: #0c1827;
  --line: #2d4055;
  --control: #637e9a;
  --text: #edf4fc;
  --muted: #b6c6d8;
  --accent: #a5ceff;
  --blue: #a8cfff;
  --blue-ink: #081a30;
  --serif: Georgia, Cambria, serif;
  --sans: "Avenir Next", Avenir, "Segoe UI", system-ui, sans-serif;
  font-family: var(--sans);
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
html { scroll-padding-top: 1.25rem; }
body { margin: 0; background: var(--page); color: var(--text); line-height: 1.55; }
a { color: var(--accent); text-underline-offset: .22em; }
a:hover { color: #e8f3ff; }
button, input { font: inherit; }
button { cursor: pointer; }
:focus-visible { outline: 3px solid #c5e1ff; outline-offset: 4px; }
h1, h2, h3, p { margin-top: 0; }
h1, h2 { font-family: var(--serif); font-weight: 400; letter-spacing: -.045em; line-height: 1.02; }
h1 { font-size: clamp(4rem, 8vw, 8rem); margin-bottom: 1.5rem; }
h2 { font-size: clamp(2.45rem, 5vw, 4rem); margin-bottom: .85rem; }
h3 { font-size: 1.3rem; line-height: 1.25; margin-bottom: .6rem; }
p { margin-bottom: .85rem; }
.shell { width: min(1240px, calc(100% - 5rem)); margin-inline: auto; }
.skip { position: fixed; z-index: 2; top: .5rem; left: 1rem; transform: translateY(-180%); background: var(--page); padding: .75rem; }
.skip:focus { transform: none; }

.site-header { background: #0a111c; border-bottom: 1px solid #26364b; }
.header-inner { display: flex; justify-content: space-between; align-items: center; min-height: 73px; gap: 1.25rem; }
.brand { display: inline-flex; align-items: center; gap: .6rem; color: var(--text); font-size: 1.2rem; font-weight: 700; text-decoration: none; white-space: nowrap; letter-spacing: -.035em; }
.brand-mark { display: grid; place-items: center; width: 2.05rem; height: 2.05rem; border: 1px solid #456182; border-radius: .42rem; background: #14263d; color: var(--blue); font-size: 1.4rem; }
.site-header nav, footer nav { display: flex; align-items: center; flex-wrap: wrap; gap: .1rem 1.35rem; }
.site-header nav a, .header-extra, footer nav a { display: inline-flex; align-items: center; min-height: 44px; font-size: .91rem; color: var(--muted); text-decoration: none; }
.site-header nav a:hover, .site-header nav a[aria-current], .header-extra:hover, footer nav a:hover { color: var(--text); text-decoration: underline; }
.header-extra { border: 1px solid var(--control); border-radius: .5rem; padding: .1rem .8rem; white-space: nowrap; }

.hero {
  background: linear-gradient(90deg, #060c16 3%, #060c16 14%, #060c16ef 29%, #060c1600 72%),
    linear-gradient(0deg, #0c131f 0%, #0c131f00 25%),
    #060c16 url("./assets/ess-pa-filt.webp") right 46% / min(100vw, 1160px) auto no-repeat;
  border-bottom: 1px solid #25344a;
}
.hero-inner { min-height: 565px; display: flex; flex-direction: column; justify-content: center; align-items: flex-start; padding-block: 4.1rem; }
.eyebrow { color: var(--accent); font-size: .83rem; line-height: 1.5; text-transform: uppercase; letter-spacing: .14em; font-weight: 750; margin-bottom: .8rem; }
.hero-kicker { display: flex; align-items: center; gap: .6rem; }
.hero-kicker span { width: 1.6rem; height: 1px; background: var(--accent); }
.hero-lede { font-size: 1.17rem; max-width: 34ch; color: #dce8f6; margin-bottom: 1.7rem; }
.actions, .choices { display: flex; flex-wrap: wrap; gap: .6rem; }
.button { min-height: 46px; display: inline-flex; justify-content: center; align-items: center; text-align: center; padding: .57rem 1rem; border: 1px solid transparent; border-radius: .55rem; line-height: 1.3; font-weight: 700; text-decoration: none; }
.primary { background: var(--blue); color: var(--blue-ink); }
.primary:hover { color: var(--blue-ink); background: #d5e8ff; }
.secondary { border-color: var(--control); color: var(--text); background: #101c2a; }
.secondary:hover { background: #243d59; color: #fff; }

.section { padding-block: clamp(3.6rem, 7vw, 6.6rem); }
.section-heading { display: flex; flex-wrap: wrap; align-items: end; justify-content: space-between; gap: 1rem 2rem; margin-bottom: 1.7rem; }
.section-heading p:last-child { color: var(--muted); max-width: 58ch; margin: 0; }
.progress-box { min-width: 12rem; align-self: flex-end; padding: .7rem .95rem; background: #132237; border: 1px solid var(--line); border-radius: .65rem; font-size: .91rem; }
progress { display: block; width: 100%; height: .45rem; appearance: none; margin: .55rem 0 .18rem; border: 0; border-radius: 1rem; background: #334b68; overflow: hidden; }
progress::-webkit-progress-bar { background: #334b68; }
progress::-webkit-progress-value { background: var(--blue); }
progress::-moz-progress-bar { background: var(--blue); }
.notice { border: 1px solid var(--line); padding: 1rem; border-radius: .6rem; }
.workbench, .game-grid { display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); align-items: start; gap: 1.2rem; }
.panel { background: var(--panel); border: 1px solid var(--line); border-radius: 1rem; box-shadow: 0 12px 32px #030a132b; }
.exercise, .exercise-library, .strategy-panel, .game-side { padding: clamp(1rem, 3vw, 1.65rem); }
.exercise-top { display: flex; align-items: center; justify-content: space-between; gap: .65rem; margin-bottom: .7rem; }
.tag { border: 1px solid #55789d; background: #162b46; color: #c3dfff; padding: .16rem .57rem; border-radius: .35rem; font-size: .82rem; font-weight: 700; }
.exercise h3 { font: 400 clamp(1.85rem, 3vw, 2.65rem)/1.12 var(--serif); letter-spacing: -.035em; }
.muted { color: var(--muted); }
.caption { color: var(--muted); font-size: .86rem; }
.felt { background: radial-gradient(ellipse at 50% 38%, #163c49, #0c2634 76%); border: 1px solid #416478; border-radius: .8rem; }
.exercise-felt { padding: .9rem clamp(.75rem, 3vw, 1.3rem) 1.25rem; margin-block: 1.1rem; }
.table-meta { display: flex; flex-wrap: wrap; justify-content: space-between; gap: .15rem 1rem; color: #d9eefe; font-weight: 650; font-size: .86rem; border-bottom: 1px solid #537381; padding-bottom: .6rem; }
.card-area { display: flex; flex-wrap: wrap; align-items: flex-start; gap: .85rem clamp(1.25rem, 4vw, 3rem); padding-top: .7rem; }
.card-area p, .game-board p { margin-bottom: .42rem; color: #d9eefe; }
.cards { display: flex; align-items: center; gap: .3rem; }
.card { width: clamp(2.2rem, 5.7vw, 3.05rem); aspect-ratio: .74; border: 1px solid #fff8; border-radius: .36rem; background: #f6f1e8; color: #112438; box-shadow: 0 3px 7px #020d1680; display: flex; flex-direction: column; justify-content: center; align-items: center; font-weight: 750; font-size: clamp(.96rem, 2.5vw, 1.24rem); line-height: 1.1; }
.card.red { color: #942639; }
.card-symbol { font-size: 1.25em; line-height: 1; }
.card.back { background: repeating-linear-gradient(135deg, #203d64 0 3px, #35577f 3px 5px); outline: 1px solid #a9cfff; outline-offset: -5px; }
.card.placeholder { border: 1px dashed #7893a0; box-shadow: none; background: #0c1a2b48; }
.question { margin-bottom: .65rem; font-weight: 700; }
.choices .button[aria-pressed="true"] { border: 2px solid #a8cfff; box-shadow: inset 0 -2px #a8cfff; }
.feedback { margin-top: 1rem; padding: .85rem 1rem; background: #152941; border: 1px solid #728eab; border-left: 4px solid var(--blue); border-radius: .45rem; }
.feedback strong { display: block; margin-bottom: .2rem; }
.feedback p { margin-block: .35rem 0; }
.exercise-bottom:not(:empty) { display: flex; flex-wrap: wrap; gap: .65rem; }
.exercise-bottom:has(button:not([hidden])) { margin-top: .85rem; }
.filter-row { display: flex; flex-wrap: wrap; gap: .4rem; margin: .75rem 0 1rem; }
.filter-row button { min-height: 42px; padding: .23rem .6rem; background: #0c1827; border: 1px solid var(--control); border-radius: .42rem; color: var(--muted); font-size: .87rem; font-weight: 650; }
.filter-row button[aria-pressed="true"] { background: #243e5e; color: var(--text); border-color: #a8cfff; box-shadow: inset 0 -2px #a8cfff; }
.filter-row button:hover { color: #fff; }
.lesson-list { display: grid; gap: .42rem; max-height: 24rem; overflow-y: auto; scrollbar-color: #6f89a5 #101c2a; padding: .2rem .3rem .2rem .2rem; }
.lesson-list button { display: flex; justify-content: space-between; align-items: center; gap: .5rem; width: 100%; min-height: 51px; border: 1px solid var(--line); border-radius: .5rem; color: var(--text); background: var(--panel-deep); padding: .35rem .65rem; text-align: left; }
.lesson-list button:hover, .lesson-list [aria-current="true"] { background: #223955; border-color: #89b1dd; }
.lesson-list button:focus-visible { outline-offset: -3px; }
.lesson-list strong { display: block; font-size: .92rem; }
.lesson-list .caption { display: block; font-size: .79rem; }
.lesson-status { color: var(--accent); font-size: .78rem; font-weight: 700; }

.strategy-section, .table-section { background: #0a111c; border-block: 1px solid #25344a; }
.strategy-banner {
  display: flex; flex-direction: column; align-items: flex-start; justify-content: center; min-height: 260px; padding: 1.7rem clamp(1.15rem, 4vw, 3rem); margin-bottom: 1.2rem;
  background: linear-gradient(90deg, #07131f 10%, #07131fee 35%, #07131f00 87%),
    #07131f url("./assets/marker-pa-filt.webp") right 49% / auto 194% no-repeat;
  border: 1px solid #35536a; border-radius: 1rem;
}
.strategy-banner p:last-child { color: #d8e9fc; max-width: 45ch; margin-bottom: 0; }
.strategy-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 1.2rem; }
.strategy-panel > p:last-child { margin-bottom: 0; }
.position-content { padding: .75rem .85rem; min-height: 8rem; background: #0c1725; border: 1px solid var(--line); border-radius: .55rem; margin-bottom: .65rem; }
.position-content p { margin-block: .25rem .5rem; color: var(--muted); }
.hand-groups { display: flex; flex-wrap: wrap; gap: .3rem; margin: .15rem 0 0; }
.hand-groups span { background: #1d3450; border: 1px solid #55789d; border-radius: .25rem; padding: .1rem .42rem; font-size: .89rem; font-weight: 650; }
.calc-inputs { display: grid; grid-template-columns: 1fr 1fr; gap: .65rem; }
label { font-size: .88rem; color: var(--muted); font-weight: 650; }
input { display: block; width: 100%; min-height: 44px; padding: .4rem .6rem; margin-top: .28rem; border: 1px solid var(--control); border-radius: .45rem; background: #0c1827; color: var(--text); }
output { display: block; min-height: 6.1rem; padding: .65rem .85rem; margin-block: .8rem .65rem; border: 1px solid #54789f; border-radius: .55rem; background: #162b45; color: #e0edff; }
output strong { display: block; font: 400 2.15rem/1.1 var(--serif); }
output span { font-size: .87rem; }
.concepts { display: grid; grid-template-columns: repeat(3, 1fr); gap: .8rem; margin-top: 1.1rem; }
details { border: 1px solid var(--line); border-radius: .6rem; background: var(--panel-deep); padding: 0 .95rem; }
summary { cursor: pointer; padding-block: .85rem; font-weight: 700; color: var(--text); }
details p, details li { color: var(--muted); }
.format-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: .85rem; }
.format-card { padding: 1.15rem; }
.format-card p { color: var(--muted); margin-bottom: 0; }
.format-icon { color: var(--blue); font-size: 1.5rem; }
.hand-guide { margin-top: 1rem; padding-inline: 1.15rem; }
.rank-list { columns: 2; margin-bottom: 1rem; }
.rank-list li { break-inside: avoid; margin-bottom: .3rem; padding-left: .15rem; }
.rank-list strong { color: var(--text); }
.source-links { display: flex; flex-wrap: wrap; gap: .2rem 1rem; }
.game-felt { padding: 1rem clamp(.85rem, 3vw, 1.6rem); }
.game-seat { display: flex; justify-content: space-between; gap: 1rem; align-items: center; margin-block: .9rem; }
.game-seat p { margin: .12rem 0 0; color: #d9eefe; }
.game-board { display: grid; justify-items: center; padding: .8rem; border-block: 1px solid #537381; }
.game-status { background: #0c1a2b; padding: .65rem; border-radius: .4rem; margin-bottom: 0; }
.game-controls:not([hidden]) { margin-block: .8rem; }
.raise-form { margin-top: .65rem; }
.raise-form div { display: flex; align-items: end; gap: .45rem; }
.raise-form button { flex: 0 0 auto; }
.game-log { color: var(--muted); margin: 0; padding-left: 1.4rem; max-height: 15rem; overflow-y: auto; scrollbar-color: #6f89a5 #101c2a; }
.game-log li { padding-block: .18rem; }
.footer-inner { display: flex; flex-wrap: wrap; justify-content: space-between; gap: .6rem 2rem; padding-block: 1.8rem; }
footer p { margin: .45rem 0 0; }
footer nav { align-self: start; }

@media (max-width: 1000px) {
  .shell { width: calc(100% - 3rem); }
  .hero { background-size: auto, auto, auto 120%; }
  .hero-inner { min-height: 500px; }
  .format-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 740px) {
  .shell { width: calc(100% - 2rem); }
  .header-inner { min-height: auto; padding-top: .45rem; gap: .05rem .65rem; flex-wrap: wrap; }
  .site-header nav { order: 3; width: 100%; gap: .1rem .9rem; }
  .site-header nav a { font-size: .87rem; }
  .header-extra { min-height: 36px; }
  .hero {
    background-image: linear-gradient(90deg, #060c16f6 0%, #060c16d9 40%, #060c1650 100%),
      linear-gradient(0deg, #0c131f 0%, #0c131f00 32%), url("./assets/ess-pa-filt.webp");
    background-size: auto, auto, auto 100%;
    background-position: right center;
  }
  .hero-inner { min-height: 455px; padding-block: 3.2rem 2.5rem; }
  h1 { font-size: clamp(3.5rem, 11vw, 5rem); }
  .hero-lede { font-size: 1.06rem; max-width: 32ch; }
  .workbench, .game-grid, .strategy-grid, .concepts { grid-template-columns: 1fr; }
  .strategy-banner { background-size: auto, auto 160%; }
  .section-heading { margin-bottom: 1.25rem; }
  .lesson-list { max-height: 14rem; }
}
@media (max-width: 450px) {
  .format-grid { grid-template-columns: 1fr; }
  .rank-list { columns: 1; }
  .hero-kicker { font-size: .74rem; }
  .hero .button { font-size: .91rem; }
  .calc-inputs label { font-size: .81rem; }
}

button:disabled { cursor: default; opacity: .65; }
