@font-face {
  font-family: 'Familjen Grotesk';
  src: url('fonts/familjen.woff2') format('woff2');
  font-weight: 500 700;
  font-display: swap;
}
@font-face {
  font-family: 'Atkinson Hyperlegible Next';
  src: url('fonts/atkinson.woff2') format('woff2');
  font-weight: 400 700;
  font-display: swap;
}
/* Atkinson slashes its zero, which reads like code in money and percentages.
   Digits and the signs around them come from Familjen instead. */
@font-face {
  font-family: 'Trainer Digits';
  src: url('fonts/familjen.woff2') format('woff2');
  font-weight: 500 700;
  font-display: swap;
  unicode-range: U+0025, U+002B, U+002C, U+002D, U+002E, U+002F, U+0030-0039, U+003A, U+00D7, U+00F7, U+20AC;
}

:root {
  --bg: #0f1012;
  --ink: #08090a;
  --surface: #17181b;
  --surface-2: #1e2024;
  --surface-3: #26282d;
  --line: #26282d;
  --line-2: #34373d;
  --text: #f2f0ea;
  --muted: #a3a6ad;
  --faint: #8b8f97;
  --accent: #e3a93b;
  --accent-press: #c99331;
  --accent-ink: #1b1406;
  --good: #3fb67a;
  --good-bg: #13291e;
  --bad: #e0584f;
  --bad-bg: #2e1614;
  --felt: #1a3830;
  --felt-line: #2b5044;
  --card-face: #f4f2ec;
  --card-ink: #16171a;
  --suit-red: #c8392f;
  --suit-dark: #16171a;
  --suit-blue: #1f5fa8;
  --suit-green: #1d7a4c;
  --radius: 14px;
  --radius-sm: 10px;
  --head: 'Familjen Grotesk', ui-sans-serif, system-ui, sans-serif;
  --body: 'Trainer Digits', 'Atkinson Hyperlegible Next', ui-sans-serif, system-ui, sans-serif;
  --tabbar: 58px;
  --sat: env(safe-area-inset-top, 0px);
  --sab: env(safe-area-inset-bottom, 0px);
  --sal: env(safe-area-inset-left, 0px);
  --sar: env(safe-area-inset-right, 0px);
  --ease: cubic-bezier(.2, .8, .2, 1);
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body {
  margin: 0;
  min-height: 100dvh;
  background: var(--bg);
  color: var(--text);
  font: 400 1rem/1.5 var(--body);
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
  overscroll-behavior-y: none;
}
h1, h2, h3 { font-family: var(--head); font-weight: 650; letter-spacing: -0.015em; line-height: 1.15; margin: 0; }
p { margin: 0; }
button, input { font: inherit; color: inherit; }
button { cursor: pointer; touch-action: manipulation; }
a { color: inherit; }
svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; flex: none; }
.sprite { display: none; }
.num { font-variant-numeric: tabular-nums; }
.streak-count, .ring-label, .drill-score, .counter, .play-meta .score, .result-score, .due-count, .spot-acc, .seg button, .answer, .fb-verdict { font-family: var(--head); }
.q-card:focus { outline: none; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.noscript { padding: 24px; }

/* Shell: tab bar on phones, sidebar on desktop */
.shell { min-height: 100dvh; }
.view {
  padding: calc(var(--sat) + 14px) calc(var(--sar) + 16px) calc(var(--tabbar) + var(--sab) + 20px) calc(var(--sal) + 16px);
  outline: none;
  max-width: 560px;
  margin-inline: auto;
}
.nav {
  position: fixed;
  z-index: 20;
  inset: auto 0 0 0;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  padding: 4px calc(var(--sar) + 8px) calc(var(--sab) + 4px) calc(var(--sal) + 8px);
  background: rgba(15, 16, 18, .9);
  -webkit-backdrop-filter: blur(18px) saturate(1.4);
  backdrop-filter: blur(18px) saturate(1.4);
  border-top: 1px solid var(--line);
}
.brand { display: none; }
.nav-link {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  min-height: 50px;
  justify-content: center;
  text-decoration: none;
  color: var(--faint);
  font-size: 0.6875rem;
  font-weight: 600;
  letter-spacing: .01em;
  border-radius: var(--radius-sm);
  transition: color .15s;
}
.nav-link svg { width: 21px; height: 21px; }
.nav-link[aria-current='page'] { color: var(--accent); }
.nav-link[aria-current='page'] svg { stroke-width: 2.1; }
.nav-link:active { background: var(--surface); }
body.focus .nav { display: none; }
body.focus .view { padding-bottom: calc(var(--sab) + 14px); }

@media (min-width: 900px) {
  .shell { display: grid; grid-template-columns: 228px 1fr; }
  .nav {
    position: sticky;
    top: 0;
    height: 100dvh;
    display: flex;
    flex-direction: column;
    gap: 4px;
    padding: 22px 14px;
    background: var(--bg);
    border-top: 0;
    border-right: 1px solid var(--line);
    -webkit-backdrop-filter: none;
    backdrop-filter: none;
  }
  .brand { display: flex; align-items: center; gap: 10px; padding: 2px 10px 20px; text-decoration: none; }
  .brand-mark { display: grid; place-items: center; width: 32px; height: 32px; border-radius: 9px; background: var(--surface-2); border: 1px solid var(--line); color: var(--accent); }
  .brand-mark svg { width: 19px; height: 19px; }
  .brand-name { font-family: var(--head); font-weight: 650; font-size: 1rem; }
  .nav-link { flex-direction: row; justify-content: flex-start; gap: 12px; min-height: 44px; padding: 0 12px; font-size: 0.9375rem; font-weight: 500; letter-spacing: 0; color: var(--muted); }
  .nav-link:hover { color: var(--text); background: var(--surface); }
  .nav-link[aria-current='page'] { color: var(--text); background: var(--surface-2); }
  .nav-link[aria-current='page'] svg { color: var(--accent); }
  .view { padding: 32px 32px 44px; max-width: 780px; margin-inline: auto; width: 100%; }
  body.focus .shell { grid-template-columns: 1fr; }
  body.focus .view { max-width: 600px; margin-inline: auto; padding: 26px 24px 32px; }
}

/* Headings */
.page-head { display: flex; align-items: end; justify-content: space-between; gap: 12px; margin-block-end: 14px; }
.page-head h1 { font-size: 1.625rem; }
.page-sub { color: var(--muted); font-size: 0.875rem; margin-block-start: 3px; }
.section-title { font-family: var(--body); font-size: 0.75rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--faint); margin-block: 20px 8px; }

/* Cards */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px; }
.stack > * + * { margin-block-start: 10px; }

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 48px;
  padding: 0 18px;
  border-radius: 999px;
  border: 1px solid var(--line-2);
  background: var(--surface-2);
  font-weight: 700;
  font-size: 0.9375rem;
  text-decoration: none;
  transition: transform .12s var(--ease), background .15s, border-color .15s;
  user-select: none;
  -webkit-user-select: none;
}
.btn:active { transform: scale(.97); background: var(--surface-3); }
.btn svg { width: 19px; height: 19px; }
.btn-primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.btn-primary:active { background: var(--accent-press); border-color: var(--accent-press); }
.btn-block { display: flex; width: 100%; }
.btn-quiet { background: transparent; border-color: transparent; color: var(--muted); min-height: 44px; font-weight: 500; }
.btn-quiet:active { background: var(--surface); }
.btn-danger { color: var(--bad); }
.btn[disabled] { opacity: .45; pointer-events: none; }
@media (hover: hover) {
  .btn:hover { border-color: var(--faint); }
  .btn-primary:hover { background: #ebb551; border-color: #ebb551; }
  .btn-quiet:hover { color: var(--text); border-color: transparent; background: var(--surface); }
}
.icon-btn { display: grid; place-items: center; width: 44px; height: 44px; border-radius: 50%; border: 1px solid var(--line); background: var(--surface); }
.chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 44px;
  padding: 0 16px;
  border-radius: 999px;
  border: 1px solid var(--line-2);
  background: transparent;
  color: var(--text);
  font-size: 0.875rem;
  transition: transform .12s var(--ease), background .15s;
}
.chip:active { transform: scale(.97); background: var(--surface); }
.chip svg { width: 17px; height: 17px; color: var(--accent); }

/* Home: one compact streak block */
.streak { display: grid; grid-template-columns: 1fr auto; gap: 12px; align-items: center; }
.streak-main { display: flex; align-items: center; gap: 12px; min-width: 0; }
.flame { display: grid; place-items: center; width: 40px; height: 40px; border-radius: 12px; background: #2a2114; color: var(--accent); flex: none; }
.flame svg { width: 24px; height: 24px; fill: rgba(227, 169, 59, .18); }
.flame.cold { background: var(--surface-2); color: var(--faint); }
.flame.cold svg { fill: none; }
.streak-count { font-size: 1.5rem; font-weight: 700; line-height: 1.05; }
.streak-none { font-family: var(--head); font-size: 1.0625rem; font-weight: 650; line-height: 1.2; }
.streak-label { color: var(--muted); font-size: 0.8125rem; margin-block-start: 1px; }
.freezes { display: inline-flex; align-items: center; gap: 4px; color: #8fc3e6; font-size: 0.75rem; margin-block-start: 3px; }
.freezes svg { width: 14px; height: 14px; }
.goal { display: flex; flex-direction: column; align-items: center; gap: 2px; flex: none; }
.ring { position: relative; width: 44px; height: 44px; }
.ring svg { width: 44px; height: 44px; transform: rotate(-90deg); stroke-width: 7; }
.ring .track { stroke: var(--surface-3); }
.ring .fill { stroke: var(--accent); transition: stroke-dashoffset .6s var(--ease); }
.ring .fill.done { stroke: var(--good); }
.ring-label { position: absolute; inset: 0; display: grid; place-items: center; font-size: 0.75rem; font-weight: 700; }
.goal-text { color: var(--faint); font-size: 0.6875rem; line-height: 1.2; }
.week { display: grid; grid-template-columns: repeat(7, 1fr); gap: 3px; margin-block-start: 12px; padding-block-start: 10px; border-top: 1px solid var(--line); }
.day { display: flex; flex-direction: column; align-items: center; gap: 5px; font-size: 0.6875rem; color: var(--faint); }
.dot { width: 9px; height: 9px; border-radius: 50%; background: var(--surface-3); }
.day.on .dot { background: var(--accent); }
.day.today { color: var(--text); font-weight: 700; }
.day.today:not(.on) .dot { background: transparent; box-shadow: inset 0 0 0 2px var(--accent); }
.home-actions { display: grid; gap: 8px; margin-block-start: 10px; justify-items: stretch; }
.home-actions .btn-primary { width: 100%; min-height: 52px; font-size: 1rem; }
.home-actions .chip { justify-content: center; }

.drills { display: grid; gap: 8px; }
.drill {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 12px;
  width: 100%;
  min-height: 72px;
  text-align: left;
  padding: 10px 14px;
  border-radius: var(--radius);
  border: 1px solid var(--line);
  background: var(--surface);
  transition: transform .12s var(--ease), border-color .15s, background .15s;
}
button.drill:active { transform: scale(.985); background: var(--surface-2); }
@media (hover: hover) { button.drill:hover { border-color: var(--line-2); } }
.drill-icon { display: grid; place-items: center; width: 40px; height: 40px; border-radius: 11px; background: var(--surface-2); border: 1px solid var(--line); color: var(--accent); flex: none; }
.drill-icon svg { width: 20px; height: 20px; }
.drill-name, .drill-sub, .drill-score, .drill-score-label, .choice-name, .choice-sub, .row-name, .row-sub { display: block; }
.drill-name { font-family: var(--head); font-size: 1.0625rem; font-weight: 650; }
.drill-sub { color: var(--muted); font-size: 0.8125rem; margin-block-start: 1px; }
.drill-side { text-align: right; flex: none; }
.drill-score { font-size: 1.0625rem; font-weight: 700; }
.drill-score-label { color: var(--faint); font-size: 0.6875rem; }
.drill.soon .drill-name { color: var(--muted); }
.drill.soon .drill-sub { color: var(--faint); }
.drill.soon .drill-icon { color: var(--faint); }
.soon-tag { display: inline-block; font-size: 0.6875rem; font-weight: 700; color: var(--muted); border: 1px solid var(--line-2); border-radius: 999px; padding: 2px 9px; }
@media (min-width: 900px) {
  .home-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; align-items: start; }
  .home-grid .home-actions { margin-block-start: 0; }
  .home-grid .home-actions .btn-primary { min-height: 56px; }
  .drills { grid-template-columns: repeat(3, 1fr); gap: 12px; }
  .drill { grid-template-columns: auto 1fr; grid-template-rows: auto auto; align-content: start; min-height: 150px; padding: 16px; gap: 10px 12px; }
  .drill-icon { grid-column: 1; grid-row: 1; }
  .drill-side { grid-column: 2; grid-row: 1; align-self: center; }
  .drill-text { grid-column: 1 / -1; grid-row: 2; align-self: end; }
}

/* Sheets and dialogs */
.backdrop { position: fixed; inset: 0; z-index: 40; background: rgba(0, 0, 0, .55); opacity: 0; transition: opacity .2s; }
.backdrop.in { opacity: 1; }
.sheet {
  position: fixed;
  z-index: 41;
  left: 0;
  right: 0;
  bottom: 0;
  max-height: calc(100dvh - var(--sat) - 20px);
  overflow-y: auto;
  overscroll-behavior: contain;
  background: var(--surface);
  border-top: 1px solid var(--line-2);
  border-radius: 20px 20px 0 0;
  padding: 8px calc(var(--sar) + 18px) calc(var(--sab) + 16px) calc(var(--sal) + 18px);
  transform: translateY(100%);
  transition: transform .26s var(--ease);
  outline: none;
}
.sheet.in { transform: none; }
.sheet::before { content: ''; display: block; width: 34px; height: 4px; border-radius: 3px; background: var(--line-2); margin: 0 auto 12px; }
.sheet h2 { font-size: 1.3125rem; }
.sheet .lede { color: var(--muted); font-size: 0.875rem; margin-block: 4px 12px; }
.sheet-actions { display: grid; gap: 8px; margin-block-start: 14px; }
.sheet-actions.two { grid-template-columns: 1fr 1fr; }
@media (min-width: 700px) {
  .sheet { left: 50%; right: auto; bottom: 50%; width: min(460px, calc(100vw - 48px)); border: 1px solid var(--line-2); border-radius: 18px; padding: 22px; transform: translate(-50%, calc(50% + 20px)); opacity: 0; transition: transform .2s var(--ease), opacity .18s; }
  .sheet.in { transform: translate(-50%, 50%); opacity: 1; }
  .sheet::before { display: none; }
  .sheet.wide { width: min(640px, calc(100vw - 48px)); }
}

/* Topic picker: chips, then the two ways to play */
.topics { display: flex; flex-wrap: wrap; gap: 6px; margin-block: 10px 4px; }
.topic {
  min-height: 44px;
  padding: 0 14px;
  border-radius: 999px;
  border: 1px solid var(--line-2);
  background: var(--surface-2);
  color: var(--muted);
  font-size: 0.875rem;
  font-weight: 600;
  transition: background .15s, border-color .15s, color .15s;
}
.topic[aria-checked='true'] { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.topic:active { transform: scale(.97); }
.topic-note { color: var(--faint); font-size: 0.8125rem; min-height: 2.4em; margin-block-start: 8px; }

.choice-list { display: grid; gap: 6px; margin-block: 10px 4px; }
.choice {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 48px;
  padding: 8px 14px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--line);
  background: var(--surface-2);
  text-align: left;
}
.choice[aria-checked='true'] { border-color: var(--accent); background: #251f15; }
.choice-name { font-weight: 700; font-size: 0.9375rem; }
.choice-sub { color: var(--muted); font-size: 0.8125rem; }
.choice-best { color: var(--faint); font-size: 0.75rem; white-space: nowrap; }
.radio { width: 18px; height: 18px; border-radius: 50%; border: 2px solid var(--line-2); flex: none; }
.choice[aria-checked='true'] .radio { border-color: var(--accent); box-shadow: inset 0 0 0 4px var(--surface-2); background: var(--accent); }

/* A round */
.play { display: flex; flex-direction: column; gap: 10px; min-height: calc(100dvh - var(--sat) - var(--sab) - 30px); }
.play-top { display: grid; grid-template-columns: 40px 1fr auto; align-items: center; gap: 12px; }
.close-btn { display: grid; place-items: center; width: 44px; min-width: 44px; height: 44px; margin-inline-start: -2px; border-radius: 50%; border: 0; background: transparent; color: var(--muted); }
.close-btn:active { background: var(--surface-2); }
.close-btn:hover { color: var(--text); }
.bar { height: 5px; border-radius: 3px; background: var(--surface-3); overflow: hidden; }
.bar > i { display: block; height: 100%; width: 100%; border-radius: inherit; background: var(--accent); transform-origin: left; transition: transform .3s var(--ease); }
.bar.timer > i { transition: none; }
.bar.low > i { background: var(--bad); }
.counter { font-size: 0.875rem; font-weight: 600; min-width: 44px; text-align: right; }
.counter.low { color: var(--bad); }
.play-meta { display: flex; justify-content: space-between; align-items: center; gap: 10px; color: var(--faint); font-size: 0.6875rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; }
.play-meta .score { color: var(--text); letter-spacing: 0; text-transform: none; font-size: 0.875rem; font-weight: 600; white-space: nowrap; margin-inline-start: auto; }
.chart-btn { display: grid; place-items: center; width: 44px; height: 44px; margin-block: -12px; border: 0; border-radius: 50%; background: transparent; color: var(--accent); }
.chart-btn:active { background: var(--surface-2); }
.chart-btn svg { width: 19px; height: 19px; }
.chart-btn[hidden] { display: none; }
.combo { color: var(--accent); }
.q-card { padding: 14px 16px; }
.q-prompt { font-family: var(--head); font-size: 1.1875rem; font-weight: 600; line-height: 1.3; letter-spacing: -0.005em; }
.q-ask { color: var(--muted); margin-block-start: 6px; font-size: 0.9375rem; }
.answers { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.answers.three { grid-template-columns: repeat(3, 1fr); }
.answers.two { grid-template-columns: 1fr 1fr; }
.answer {
  position: relative;
  min-height: 60px;
  padding: 0 8px;
  border-radius: var(--radius);
  border: 1.5px solid var(--line-2);
  background: var(--surface);
  font-size: 1.25rem;
  font-weight: 600;
  transition: transform .1s var(--ease), background .15s, border-color .15s, opacity .2s;
  user-select: none;
  -webkit-user-select: none;
}
.answer .key { position: absolute; top: 5px; left: 8px; font-size: 0.625rem; color: var(--faint); display: none; }
@media (hover: hover) and (pointer: fine) {
  .answer .key { display: block; }
  .answer:hover { border-color: var(--faint); background: var(--surface-2); }
}
.answer:active { transform: scale(.97); }
.answer.right { border-color: var(--good); background: var(--good-bg); color: #bff0d4; }
.answer.wrong { border-color: var(--bad); background: var(--bad-bg); color: #ffc9c4; }
.answer.dim { opacity: .38; }
.answer .mark { position: absolute; top: 50%; right: 8px; width: 22px; height: 22px; margin-top: -11px; border-radius: 50%; display: grid; place-items: center; }
.answer .mark svg { width: 14px; height: 14px; stroke-width: 2.8; }
.answer.right .mark { background: var(--good); color: #06150d; }
.answer.wrong .mark { background: var(--bad); color: #1d0705; }
.answers.words .answer { font-family: var(--head); font-size: 1.0625rem; }
.flash-good { animation: pop .3s var(--ease); }
@keyframes pop { 50% { transform: scale(1.03); } }

/* The spot: one reusable picture for every drill */
.spot-view { flex: 1 1 auto; display: flex; align-items: center; justify-content: center; min-height: 120px; }
/* Cards and labels are fixed sizes on a percentage layout, so a narrower box makes them collide. Draw the same picture smaller instead. */
.play.answered .felt { zoom: .7; }
.play.answered .prizes { margin-block-start: 10px; }
.play.answered .prize { font-size: 0.625rem; }
.play.answered .spot-view { min-height: 0; }
.felt {
  position: relative;
  width: 100%;
  max-width: 400px;
  border-radius: var(--radius);
  background: transparent;
  border: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
}
.felt.plain { background: transparent; border: 0; padding: 0; }
.pile-label { font-size: 0.625rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--faint); }
.pile-label { font-size: 0.625rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--faint); }
.pile-amt { font-family: var(--head); font-size: 1.125rem; font-weight: 700; }
.pile-amt.bet { color: var(--accent); }
.chips { display: flex; flex-direction: column-reverse; align-items: center; height: 20px; justify-content: flex-start; color: #7fa7c9; }
.chips.bet { color: var(--accent); }
.chip-mark {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: currentColor;
  box-shadow: inset 0 0 0 2px rgba(10, 11, 13, .55), inset 0 0 0 4px currentColor, 0 1px 1px rgba(0, 0, 0, .5);
}
.chip-mark + .chip-mark { margin-block-end: -14px; }

/* Playing cards */
.hand { display: flex; gap: 5px; }
.hand.board { gap: 4px; }
.pcard {
  position: relative;
  width: 34px;
  height: 48px;
  border-radius: 5px;
  background: var(--card-face);
  color: var(--card-ink);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1px;
  line-height: 1;
  box-shadow: 0 1px 2px rgba(0, 0, 0, .5);
}
.pcard.sm { width: 27px; height: 38px; }
.pcard .r { font-family: var(--head); font-size: 1.125rem; font-weight: 700; line-height: 1; }
.pcard .r.two { font-size: 0.9375rem; letter-spacing: -.04em; }
.pcard.sm .r { font-size: 0.9375rem; }
.pcard.sm .r.two { font-size: 0.8125rem; }
.pcard .suit { width: 13px; height: 13px; fill: currentColor; stroke: none; }
.pcard.sm .suit { width: 10px; height: 10px; }
.pcard.h, .pcard.d { color: var(--suit-red); }
.pcard.s, .pcard.c { color: var(--suit-dark); }
body.fourcolour .pcard.d, body.fourcolour .flip-face.d { color: var(--suit-blue); }
body.fourcolour .pcard.c, body.fourcolour .flip-face.c { color: var(--suit-green); }
.pcard.back { background: var(--surface-3); box-shadow: none; }
.back-art { width: 62%; height: 68%; border-radius: 3px; border: 1px solid #3d4149; background: #2b2e34; }
.board-row { display: flex; flex-direction: column; align-items: center; }
.hand-label { font-size: 0.625rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--faint); text-align: center; margin-block-end: 3px; }

/* A card with two faces, used by the splash and the code slots */
.flip { display: inline-block; width: 34px; height: 48px; perspective: 500px; }
.flip-in { position: relative; display: block; width: 100%; height: 100%; transform-style: preserve-3d; transform: rotateY(180deg); transition: transform .34s var(--ease); }
.flip.up .flip-in, .splash .flip .flip-in, .gate-mark .flip .flip-in { transform: none; }
.flip-face {
  position: absolute;
  inset: 0;
  border-radius: 5px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1px;
  line-height: 1;
  -webkit-backface-visibility: hidden;
  backface-visibility: hidden;
  background: var(--card-face);
  color: var(--card-ink);
  box-shadow: 0 1px 2px rgba(0, 0, 0, .5);
}
.flip-face.back { transform: rotateY(180deg); background: var(--surface-3); box-shadow: none; }
.flip-face .r { font-family: var(--head); font-size: 1.25rem; font-weight: 700; }
.flip-face .r.two { font-size: 1rem; }
.flip-face .suit { width: 13px; height: 13px; fill: currentColor; stroke: none; }
.flip-face.h, .flip-face.d { color: var(--suit-red); }
.flip-face.s, .flip-face.c { color: var(--suit-dark); }

/* Seats around the table */
.seats { position: relative; width: 100%; aspect-ratio: 1.35; }
.seats.n9 { aspect-ratio: 1.25; }
.oval { position: absolute; inset: 11% 8%; border-radius: 50%; background: var(--surface-2); border: 1px solid var(--line-2); }
.mid { position: absolute; left: 50%; top: 45%; transform: translate(-50%, -50%); display: flex; flex-direction: column; align-items: center; gap: 6px; white-space: nowrap; }
.mid-pot-line { display: flex; align-items: center; gap: 7px; }
.mid-pot-line .chips { height: 14px; }
.mid-pot-line .chip-mark { width: 14px; height: 14px; box-shadow: inset 0 0 0 2px rgba(10, 11, 13, .55), inset 0 0 0 3px currentColor; }
.mid-pot-line .chip-mark + .chip-mark { margin-block-end: -10px; }
.seat-bet { position: absolute; display: flex; align-items: center; gap: 5px; }
.bet-amt { font-family: var(--head); font-size: 0.75rem; font-weight: 700; color: var(--accent); }
.seat-bet .chips.pot { color: #7fa7c9; }
.seat-bet .chips { height: 14px; }
.seat-bet .chip-mark { width: 14px; height: 14px; box-shadow: inset 0 0 0 2px rgba(10, 11, 13, .55), inset 0 0 0 3px currentColor; }
.seat-bet .chip-mark + .chip-mark { margin-block-end: -10px; }
.seat-betline { display: flex; align-items: center; gap: 4px; margin-block-start: 1px; }
.seat-betline .chips { height: 12px; }
.seat-betline .chips.pot { color: #7fa7c9; }
.seat-betline .chip-mark { width: 12px; height: 12px; box-shadow: inset 0 0 0 2px rgba(10, 11, 13, .55), inset 0 0 0 3px currentColor; }
.seat-betline .chip-mark + .chip-mark { margin-block-end: -9px; }
.seat-betline .bet-amt { font-size: 0.6875rem; }
.hero-hand { position: absolute; left: 50%; top: 71%; transform: translate(-50%, -50%); }
.seats.n9 .hero-hand { top: 69%; }
.prizes { display: flex; flex-direction: column; align-items: center; gap: 3px; margin-block-start: 16px; }
.prize-row { display: flex; flex-wrap: wrap; justify-content: center; gap: 4px 8px; }
.prize { font-family: var(--head); font-size: 0.6875rem; font-weight: 600; color: var(--muted); }
.felt.cards-only { max-width: 420px; border: 1px solid var(--line); background: var(--surface); border-radius: var(--radius); padding: 12px; gap: 12px; }
.seat {
  position: absolute;
  z-index: 1;
  transform: translate(-50%, -50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1px;
  padding: 3px 6px;
  border-radius: 8px;
  background: var(--surface-2);
  border: 1px solid var(--line-2);
  min-width: 42px;
}
.seat-name { font-size: 0.625rem; font-weight: 700; color: var(--muted); letter-spacing: .02em; }
.seat-stack { font-family: var(--head); font-size: 0.6875rem; font-weight: 700; color: var(--text); }
.seat.folded { opacity: .38; }
.seat.hero { background: #2a2114; border-color: var(--accent); }
.seat .hand { margin-block-end: 2px; gap: 3px; }
.seat.hero { padding-top: 4px; }
.seat.hero .seat-name { color: var(--accent); }
.seat.acted { border-color: var(--bad); }
.seat-act { font-size: 0.5625rem; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; color: var(--bad); }
.seat.hero .seat-act { color: var(--accent); }
.seat-d { position: absolute; top: -7px; right: -7px; width: 16px; height: 16px; border-radius: 50%; background: var(--card-face); color: var(--card-ink); font-size: 0.5rem; font-weight: 700; display: grid; place-items: center; font-family: var(--head); }
.mid-pot { font-family: var(--head); font-size: 0.8125rem; font-weight: 700; color: var(--text); background: var(--bg); border: 1px solid var(--line); border-radius: 999px; padding: 3px 11px; }

/* Inline feedback: the question and the answers stay visible */
.fb {
  max-height: 32vh;
  overflow-y: auto;
  overscroll-behavior: contain;
  border-radius: var(--radius);
  border: 1px solid var(--line-2);
  border-left: 3px solid var(--bad);
  background: var(--surface-2);
  padding: 10px 12px;
  animation: fbin .18s var(--ease);
}
.fb.is-right { border-left-color: var(--good); }
@keyframes fbin { from { opacity: 0; transform: translateY(6px); } }
.fb-head { display: flex; align-items: center; gap: 8px; }
.fb-icon { display: grid; place-items: center; width: 22px; height: 22px; border-radius: 50%; background: var(--bad); color: #1d0705; flex: none; }
.fb-icon svg { width: 14px; height: 14px; stroke-width: 2.8; }
.fb.is-right .fb-icon { background: var(--good); color: #06150d; }
.fb-verdict { font-size: 1rem; font-weight: 650; }
.fb-why { margin-block-start: 6px; font-size: 0.875rem; line-height: 1.45; color: var(--text); }
.fb-note { margin-block-start: 6px; font-size: 0.8125rem; line-height: 1.45; color: var(--muted); }
.fb-more { margin-block-start: 8px; }
.fb-more .btn { min-height: 40px; font-size: 0.8125rem; padding: 0 14px; }
.play-next { display: grid; margin-block-start: 8px; }
/* On a short phone the reason can push Next under the fold. Keep it in reach. */
@media (max-width: 899px) {
  .play-next { position: sticky; bottom: 0; z-index: 2; background: var(--bg); padding-block: 8px; margin-block-end: -8px; }
}
@media (max-width: 899px) and (max-height: 720px) {
  .play.answered .felt { zoom: .6; }
}
.fb-slot:empty { display: none; }
.spot-view:empty { display: none; }
.mid-note { font-size: 0.6875rem; color: var(--muted); }
.sheet-foot { color: var(--faint); font-size: 0.8125rem; margin-block-start: 12px; }
.play-next .btn { min-height: 52px; font-size: 1rem; }

@media (min-width: 900px) {
  .play { min-height: auto; }
  .answer { min-height: 66px; }
  .spot-view { min-height: 150px; }
  .felt, .seats { max-width: 480px; }
  .play.answered .felt { zoom: .75; }
}

/* Results */
.result-hero { text-align: center; padding: 18px 16px; }
.result-kicker { color: var(--muted); font-family: var(--body); font-size: 0.875rem; font-weight: 500; letter-spacing: 0; }
.result-score { font-size: 3rem; font-weight: 700; line-height: 1.05; margin-block: 4px 2px; }
.result-score small { font-size: 1.375rem; color: var(--faint); font-weight: 600; }
.result-line { color: var(--muted); font-size: 0.875rem; }
.badge { display: inline-flex; align-items: center; gap: 6px; margin-block-start: 10px; padding: 5px 12px; border-radius: 999px; background: #2a2114; color: var(--accent); font-weight: 700; font-size: 0.8125rem; }
.badge svg { width: 15px; height: 15px; }
.milestone svg { animation: flicker 1.2s var(--ease) 2; }
@keyframes flicker { 30% { transform: scale(1.25) rotate(-6deg); } 60% { transform: scale(.95); } }
.result-actions { display: grid; gap: 8px; margin-block-start: 12px; }
@media (min-width: 700px) {
  .result-actions { grid-template-columns: 1fr 1fr; }
  .result-actions .btn-quiet { grid-column: 1 / -1; }
}
.misses { border-radius: var(--radius); border: 1px solid var(--line); background: var(--surface); overflow: hidden; }
.missrow {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: 10px;
  width: 100%;
  min-height: 56px;
  padding: 9px 14px;
  background: transparent;
  border: 0;
  text-align: left;
}
.missrow + .missrow, .missbody + .missrow { border-top: 1px solid var(--line); }
.missrow:active { background: var(--surface-2); }
.missrow > span:first-child { min-width: 0; }
.miss-q { display: block; font-size: 0.875rem; font-weight: 600; line-height: 1.35; }
.miss-a { display: block; color: var(--muted); font-size: 0.8125rem; margin-block-start: 3px; }
.miss-a .bad { color: var(--bad); }
.miss-a .good { color: var(--good); }
.missrow .chev { color: var(--faint); width: 17px; height: 17px; transition: transform .18s var(--ease); }
.missrow[aria-expanded='true'] .chev { transform: rotate(90deg); }
.missbody { padding: 0 14px 12px; color: var(--muted); font-size: 0.8125rem; line-height: 1.5; }
.empty { color: var(--muted); text-align: center; font-size: 0.875rem; padding: 20px 16px; }

/* Leaks */
.due-card { display: grid; gap: 10px; }
.due-head { display: flex; align-items: baseline; gap: 8px; }
.due-count { font-size: 1.875rem; font-weight: 700; line-height: 1; }
.spot { display: grid; grid-template-columns: 1fr auto; gap: 6px 10px; align-items: center; padding: 10px 14px; }
.spot + .spot { border-top: 1px solid var(--line); }
.spot-name { font-weight: 600; font-size: 0.875rem; }
.spot-meta { color: var(--faint); font-size: 0.75rem; }
.spot-acc { font-size: 1rem; font-weight: 700; text-align: right; }
.spot-acc.low { color: var(--bad); }
.spot-acc.mid { color: var(--accent); }
.spot-acc.high { color: var(--good); }
.spot .bar { grid-column: 1 / -1; height: 4px; }
.spot .bar > i { background: var(--good); }
.spot .bar.low > i { background: var(--bad); }
.spot .bar.mid > i { background: var(--accent); }
.spot .btn { min-height: 44px; padding: 0 14px; font-size: 0.8125rem; grid-column: 2; grid-row: 1 / span 2; }
.spot.has-btn { grid-template-columns: 1fr auto auto; }
.spot.has-btn .bar { grid-column: 1 / 3; }
.spot.has-btn .btn { grid-column: 3; grid-row: 1 / span 3; }
.list-card { padding: 0; overflow: hidden; }

/* Settings */
.row { display: flex; align-items: center; justify-content: space-between; gap: 14px; min-height: 54px; padding: 8px 14px; }
.row + .row { border-top: 1px solid var(--line); }
.row-text { min-width: 0; }
.row-name { font-weight: 600; font-size: 0.9375rem; }
.row-sub { color: var(--faint); font-size: 0.8125rem; }
button.row { width: 100%; background: transparent; border: 0; text-align: left; }
button.row:active { background: var(--surface-2); }
button.row:hover { background: var(--surface-2); }
.row .chev { color: var(--faint); width: 17px; height: 17px; }
.switch { position: relative; width: 52px; height: 44px; border: 0; background: transparent; flex: none; }
.switch::before { content: ''; position: absolute; top: 8px; left: 2px; width: 48px; height: 28px; border-radius: 14px; background: var(--surface-3); transition: background .2s; }
.switch::after { content: ''; position: absolute; top: 11px; left: 5px; width: 22px; height: 22px; border-radius: 50%; background: #d9d7d0; transition: transform .2s var(--ease); }
.switch[aria-checked='true']::before { background: var(--good); }
.switch[aria-checked='true']::after { transform: translateX(20px); background: #fff; }
.seg { display: inline-grid; grid-auto-flow: column; gap: 3px; padding: 3px; border-radius: 11px; background: var(--surface-3); flex: none; }
.seg button { min-width: 44px; min-height: 44px; border-radius: 9px; border: 0; background: transparent; color: var(--muted); font-weight: 700; font-size: 0.875rem; }
.seg button[aria-checked='true'] { background: var(--surface); color: var(--text); box-shadow: 0 0 0 1px var(--line-2); }
.about { color: var(--muted); font-size: 0.875rem; line-height: 1.55; padding: 14px; }
.about p + p { margin-block-start: 8px; }
.version { color: var(--faint); font-size: 0.75rem; text-align: center; margin-block-start: 18px; }
textarea.paste { width: 100%; min-height: 104px; border-radius: var(--radius-sm); border: 1px solid var(--line-2); background: var(--bg); color: var(--text); font: 1rem/1.4 var(--body); padding: 10px; resize: vertical; }

/* Choosing a language */
.langrow { display: flex; flex-wrap: wrap; gap: 10px; margin-block: 12px 4px; }
.langcard { display: flex; flex-direction: column; align-items: center; gap: 7px; min-height: 44px; padding: 10px 14px; border-radius: var(--radius); border: 1px solid var(--line-2); background: var(--surface-2); color: var(--text); flex: 1 1 0; }
.langcard:active { transform: scale(.98); }
.langname { font-family: var(--head); font-size: 0.9375rem; font-weight: 650; }
.langsearch { width: 100%; min-height: 44px; border-radius: var(--radius-sm); border: 1px solid var(--line-2); background: var(--bg); color: var(--text); font: 1rem/1.3 var(--body); padding: 0 12px; }
.langlist { display: grid; gap: 4px; max-height: 42dvh; overflow-y: auto; overscroll-behavior: contain; margin-block-start: 8px; }
.langrowitem { display: flex; align-items: center; justify-content: space-between; gap: 10px; min-height: 48px; padding: 8px 14px; border-radius: var(--radius-sm); border: 1px solid var(--line); background: var(--surface-2); text-align: left; }
.langrowitem[aria-selected='true'] { border-color: var(--accent); }
.langrowitem:active { background: var(--surface-3); }
.langrowitem[hidden] { display: none; }
.langnote { color: var(--faint); font-size: 0.75rem; }
.sheet.tall { max-height: calc(100dvh - var(--sat) - 12px); }

/* Our two fonts only carry the basic latin letters, so other writing uses the phone's own font. */
/* system-ui already resolves to the phone's own face, so no named webfont is needed here. */
:root { --sys: system-ui, -apple-system, 'Segoe UI', sans-serif; }
html[data-script='latinext'], html[data-script='cyrillic'] { --head: var(--sys); --body: var(--sys); }
html[data-script='devanagari'] { --head: 'Noto Sans Devanagari', 'Devanagari Sangam MN', 'Nirmala UI', var(--sys); --body: 'Noto Sans Devanagari', 'Devanagari Sangam MN', 'Nirmala UI', var(--sys); }
html[data-script='cjk'] { --head: 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', 'Noto Sans CJK SC', var(--sys); --body: 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', 'Noto Sans CJK SC', var(--sys); }

/* The 13x13 chart */
.chart { display: grid; grid-template-columns: repeat(13, 1fr); gap: 1px; width: 100%; }
.cell { aspect-ratio: 1; display: grid; place-items: center; border-radius: 2px; background: var(--surface-3); color: var(--faint); font-size: 0.5rem; font-weight: 700; font-family: var(--head); line-height: 1; overflow: hidden; }
.cell.raise { background: #6d3a34; color: #ffd9d4; }
.cell.call { background: #2f5a45; color: #cdf0de; }
.cell.fold { background: var(--surface-2); color: #6b6f77; }
.cell.asked { outline: 2px solid var(--accent); outline-offset: -2px; color: #fff; }
.chart-key { display: flex; flex-wrap: wrap; gap: 10px; margin-block-start: 10px; font-size: 0.75rem; color: var(--muted); }
.chart-key span { display: inline-flex; align-items: center; gap: 5px; }
.swatch { width: 11px; height: 11px; border-radius: 3px; }
.swatch.raise { background: #6d3a34; }
.swatch.call { background: #2f5a45; }
.swatch.fold { background: var(--surface-2); }
@media (min-width: 400px) { .cell { font-size: 0.5625rem; } }
@media (min-width: 700px) { .cell { font-size: 0.6875rem; } }

/* Install steps */
.steps { display: grid; gap: 10px; margin-block-start: 6px; padding: 0; list-style: none; counter-reset: s; }
.steps li { display: flex; gap: 10px; align-items: center; font-size: 0.9375rem; }
.steps li::before { counter-increment: s; content: counter(s); display: grid; place-items: center; width: 26px; height: 26px; border-radius: 50%; background: var(--surface-2); border: 1px solid var(--line-2); font-weight: 700; font-size: 0.8125rem; flex: none; }
.steps svg { width: 19px; height: 19px; color: var(--accent); vertical-align: -4px; }

/* Toast */
.toast {
  position: fixed;
  z-index: 60;
  left: 50%;
  bottom: calc(var(--tabbar) + var(--sab) + 14px);
  transform: translate(-50%, 20px);
  max-width: calc(100vw - 32px);
  padding: 10px 16px;
  border-radius: 13px;
  background: #2b2d33;
  border: 1px solid var(--line-2);
  color: var(--text);
  font-size: 0.875rem;
  opacity: 0;
  pointer-events: none;
  transition: opacity .2s, transform .2s var(--ease);
  display: flex;
  align-items: center;
  gap: 10px;
}
.toast.in { opacity: 1; transform: translate(-50%, 0); pointer-events: auto; }
.toast button { border: 0; background: transparent; color: var(--accent); font-weight: 700; min-height: 44px; min-width: 44px; padding: 0 8px; }
body.focus .toast { top: calc(var(--sat) + 10px); bottom: auto; transform: translate(-50%, -20px); }
body.focus .toast.in { transform: translate(-50%, 0); }
@media (min-width: 900px) { body:not(.focus) .toast { bottom: 22px; } }

/* Screen change */
.enter { animation: enter .2s var(--ease); }
@keyframes enter { from { opacity: 0; transform: translateY(6px); } }
.q-enter { animation: qenter .18s var(--ease); }
@keyframes qenter { from { opacity: 0; transform: translateX(10px); } }

/* Splash: two cards land and turn over, then the app is there */
.splash {
  position: fixed;
  inset: 0;
  z-index: 90;
  background: var(--ink);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 16px;
  pointer-events: none;
  animation: splashout .2s var(--ease) .46s forwards;
}
.splash.calm { animation: splashout .2s linear .2s forwards; }
@keyframes splashout { to { opacity: 0; visibility: hidden; } }
.splash-cards { display: flex; gap: 8px; }
.splash-cards .flip { animation: dealin .24s var(--ease) backwards; }
.splash-cards .flip:nth-child(2) { animation-delay: .07s; }
@keyframes dealin { from { transform: translate(-44px, 22px) rotate(-14deg); opacity: 0; } }
.splash .flip .flip-in { animation: turnover .26s var(--ease) .18s backwards; }
.splash-cards .flip:nth-child(2) .flip-in { animation-delay: .25s; }
@keyframes turnover { from { transform: rotateY(180deg); } }
.splash-word, .gate-word {
  font-family: var(--head);
  font-weight: 700;
  letter-spacing: .18em;
  text-transform: uppercase;
  font-size: 0.875rem;
  color: var(--muted);
}
.splash-word { animation: wordin .22s var(--ease) .3s backwards; }
@keyframes wordin { from { opacity: 0; transform: translateY(6px); } }
.splash.calm .splash-cards .flip, .splash.calm .flip-in, .splash.calm .splash-word { animation: none; }
.splash.calm .flip-in { transform: none; }

/* The code gate */
.gate { position: fixed; inset: 0; z-index: 80; background: var(--surface); display: flex; flex-direction: column; overflow: hidden; }
.gate-block {
  position: absolute;
  left: 0;
  right: 0;
  top: 0;
  height: 100%;
  background: var(--ink);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: height .58s var(--ease), border-radius .58s var(--ease);
  z-index: 2;
}
.gate-mark { display: flex; flex-direction: column; align-items: center; gap: 14px; transition: transform .58s var(--ease); }
.gate-mark .flip { animation: dealin .24s var(--ease) backwards; }
.gate-mark .flip:nth-child(2) { animation-delay: .07s; }
.gate-mark .flip .flip-in { animation: turnover .26s var(--ease) .18s backwards; }
.gate-mark .splash-cards .flip:nth-child(2) .flip-in { animation-delay: .25s; }
.gate.open .gate-block { height: 25%; border-bottom-left-radius: 50% 44%; border-bottom-right-radius: 50% 44%; }
.gate.open .gate-mark { flex-direction: row; gap: 10px; align-items: center; }
.gate.open .gate-mark .flip { width: 22px; height: 31px; }
.gate.open .gate-mark .flip-face .r { font-size: 0.8125rem; }
.gate.open .gate-mark .flip-face .suit { width: 9px; height: 9px; }
.gate.sweep .gate-block { height: 100%; border-bottom-left-radius: 0; border-bottom-right-radius: 0; transition: height .4s var(--ease), border-radius .4s var(--ease); }
.gate.sweep .gate-mark { opacity: 0; transition: opacity .2s; }
.gate-body {
  position: relative;
  z-index: 1;
  margin-top: 0;
  padding-top: 36dvh;
  width: 100%;
  max-width: 420px;
  margin-inline: auto;
  padding-inline: calc(var(--sar) + 22px) calc(var(--sal) + 22px);
  padding-bottom: calc(var(--sab) + 24px);
}
.gate-body > * { opacity: 0; transform: translateY(8px); transition: opacity .3s var(--ease), transform .3s var(--ease); }
.gate.open .gate-body > * { opacity: 1; transform: none; }
.gate.open .gate-body > *:nth-child(1) { transition-delay: .18s; }
.gate.open .gate-body > *:nth-child(2) { transition-delay: .25s; }
.gate.open .gate-body > *:nth-child(3) { transition-delay: .32s; }
.gate.open .gate-body > *:nth-child(4) { transition-delay: .39s; }
.gate.sweep .gate-body { opacity: 0; transition: opacity .2s; }
.gate h1 { font-size: 1.4375rem; }
.gate-lede { color: var(--muted); font-size: 0.875rem; margin-block-start: 6px; }
.gate-field { margin-block-start: 18px; }
.gate-label { display: block; font-size: 0.75rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--faint); margin-block-end: 8px; }
.code-wrap { position: relative; border-radius: var(--radius); }
.code-foot { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-block-start: 10px; }
.code-slots { display: flex; gap: 6px; justify-content: space-between; }
.code-slots .flip { flex: 1 1 0; height: 54px; max-width: 46px; }
.code-input {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
  padding: 0;
  background: transparent;
  color: transparent;
  caret-color: transparent;
  font: 700 1rem/1 var(--head);
  letter-spacing: 1em;
  text-align: center;
  opacity: 0;
}
.code-wrap:focus-within .flip.next .flip-face.back { box-shadow: 0 0 0 2px var(--accent); }
.paste-btn { min-height: 44px; padding: 0 16px; font-size: 0.875rem; flex: none; }
.code-foot .gate-msg { margin-block-start: 0; flex: 1 1 auto; }
.gate.shake .code-slots { animation: shake .4s var(--ease); }
@keyframes shake { 20% { transform: translateX(-7px); } 45% { transform: translateX(6px); } 70% { transform: translateX(-4px); } }
.gate-msg { color: var(--bad); font-size: 0.875rem; margin-block-start: 10px; min-height: 1.4em; }
.gate-go { margin-block-start: 14px; display: flex; justify-content: center; }
.gate-go .btn { width: 100%; min-height: 52px; transition: width .3s var(--ease); overflow: hidden; }
.go-chip { display: none; width: 22px; height: 22px; border-radius: 50%; border: 3px dashed currentColor; background: rgba(27, 20, 6, .9); }
.gate.busy .gate-go .btn { width: 68px; }
.gate.busy .go-label { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
.gate.busy .go-chip { display: block; animation: spinchip .9s linear infinite; }
@keyframes spinchip { to { transform: rotate(360deg); } }
.gate-foot { color: var(--faint); font-size: 0.8125rem; margin-block-start: 14px; }
@media (min-width: 700px) {
  .gate-body { max-width: 380px; padding-top: 40dvh; padding-bottom: 0; }
  .gate.open .gate-block { height: 30%; border-bottom-left-radius: 50% 38%; border-bottom-right-radius: 50% 38%; }
}
.gate.calm .gate-block, .gate.calm .gate-mark, .gate.calm .flip, .gate.calm .flip-in, .gate.calm .gate-body > * { animation: none; transition: opacity .15s; }
.gate.calm .flip-in { transform: none; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
  .gate-block, .gate.open .gate-block { transition: none; }
}

@media (max-width: 359px) {
  .page-head h1 { font-size: 1.375rem; }
  .q-prompt { font-size: 1.0625rem; }
  .answer { font-size: 1.0625rem; }
  .streak { grid-template-columns: 1fr; }
  .goal { justify-self: start; }
  .pcard { width: 30px; height: 42px; }
}
