/* ------------------------------------------------------------------
   Two Months of Us
   Shape rule: surfaces 18px, bingo cells 10px, every button a pill.
   One accent (calm blue), one theme per OS setting.
------------------------------------------------------------------- */

:root {
  --bg: #f3f7fb;
  --bg-glow: #dbe7f4;
  --surface: #fbfdff;
  --surface-2: #e9f0f7;
  --ink: #172335;
  --ink-2: #4d5d73;
  --ink-3: #6f7f95;
  --line: rgb(23 35 53 / 0.09);
  --line-strong: rgb(23 35 53 / 0.17);
  --accent: #3a679e;
  --accent-press: #305889;
  --accent-ink: #f6f9fd;
  --accent-soft: #e0eaf6;
  --shadow: 0 1px 0 rgb(255 255 255 / 0.8) inset, 0 12px 30px -18px rgb(30 60 110 / 0.3);

  --ease-out: cubic-bezier(0.23, 1, 0.32, 1);
  --ease-in-out: cubic-bezier(0.77, 0, 0.175, 1);
  --ease-drawer: cubic-bezier(0.32, 0.72, 0, 1);

  --r-surface: 18px;
  --r-cell: 10px;

  --font-display: "Cormorant Garamond", "Iowan Old Style", Georgia, serif;
  --font-ui: "Manrope", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;

  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0e1520;
    --bg-glow: #182a42;
    --surface: #152030;
    --surface-2: #1b2839;
    --ink: #e9eff7;
    --ink-2: #a4b3c7;
    --ink-3: #8090a6;
    --line: rgb(233 239 247 / 0.09);
    --line-strong: rgb(233 239 247 / 0.17);
    --accent: #8db3e2;
    --accent-press: #7aa2d4;
    --accent-ink: #0c1a2c;
    --accent-soft: #1e3150;
    --shadow: 0 1px 0 rgb(255 255 255 / 0.04) inset, 0 12px 30px -20px rgb(0 0 0 / 0.6);
  }
}

/* ---------- Base ---------- */

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  -webkit-tap-highlight-color: transparent;
  -webkit-text-size-adjust: 100%;
  overscroll-behavior: none;
  background: var(--bg);
}

body {
  margin: 0;
  min-height: 100dvh;
  background:
    radial-gradient(120% 60% at 100% 0%, var(--bg-glow) 0%, transparent 55%),
    radial-gradient(90% 50% at 0% 100%, var(--bg-glow) 0%, transparent 60%),
    var(--bg);
  background-attachment: fixed;
  color: var(--ink);
  font-family: var(--font-ui);
  font-size: 16px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

body.sheet-open {
  overflow: hidden;
}

.grain {
  position: fixed;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  opacity: 0.05;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='160' height='160'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/></filter><rect width='100%' height='100%' filter='url(%23n)'/></svg>");
}

button,
a,
[role="button"] {
  touch-action: manipulation;
  user-select: none;
  -webkit-user-select: none;
  -webkit-touch-callout: none;
}

a {
  color: inherit;
  text-decoration: none;
}

button {
  font: inherit;
  color: inherit;
  background: none;
  border: 0;
  padding: 0;
  cursor: pointer;
}

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}

h1,
h2,
h3,
p {
  margin: 0;
}

.app {
  position: relative;
  z-index: 2;
  max-width: 480px;
  margin: 0 auto;
  padding: calc(var(--safe-top) + 12px) 16px calc(var(--safe-bottom) + 28px);
  min-height: 100dvh;
}

.display {
  font-family: var(--font-display);
  font-weight: 500;
  letter-spacing: -0.01em;
  line-height: 1.05;
}

.muted {
  color: var(--ink-2);
}

/* ---------- Buttons ---------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 52px;
  padding: 0 22px;
  border-radius: 999px;
  font-size: 15px;
  font-weight: 600;
  white-space: nowrap;
  transition: transform 140ms var(--ease-out), background-color 160ms ease;
}

.btn:active {
  transform: scale(0.97);
}

.btn i {
  font-size: 18px;
}

.btn-primary {
  background: var(--accent);
  color: var(--accent-ink);
}

.btn-primary:active {
  background: var(--accent-press);
}

.btn-quiet {
  background: var(--surface);
  color: var(--ink);
  box-shadow: inset 0 0 0 1px var(--line-strong);
}

.btn-text {
  min-height: 44px;
  padding: 0 12px;
  color: var(--ink-2);
  font-weight: 600;
}

.btn-block {
  width: 100%;
}

.icon-btn {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border-radius: 999px;
  background: var(--surface);
  box-shadow: inset 0 0 0 1px var(--line);
  font-size: 19px;
  transition: transform 140ms var(--ease-out);
}

.icon-btn:active {
  transform: scale(0.94);
}

/* ---------- Entrance ---------- */

.rise {
  animation: rise 640ms var(--ease-out) both;
  animation-delay: calc(var(--i, 0) * 70ms);
}

@keyframes rise {
  from {
    opacity: 0;
    transform: translateY(14px);
  }
}

/* ---------- Landing ---------- */

.landing {
  min-height: calc(100svh - var(--safe-top) - var(--safe-bottom) - 40px);
  display: flex;
  flex-direction: column;
  gap: 36px;
  padding-top: 2vh;
}

/* Centre the greeting in the space above the game cards. */
.landing > div {
  margin-block: auto;
}

.landing-names {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-display);
  font-style: italic;
  font-size: 19px;
  font-weight: 500;
  color: var(--ink-2);
}

.landing-names i {
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent);
  font-size: 14px;
  font-style: normal;
  animation: beat 2.6s var(--ease-in-out) 900ms 2;
}

@keyframes beat {
  0%, 30%, 100% { transform: scale(1); }
  12% { transform: scale(1.16); }
  22% { transform: scale(0.96); }
}

.landing h1 {
  margin-top: 22px;
  font-size: clamp(60px, 17.5vw, 80px);
  line-height: 0.94;
  letter-spacing: -0.025em;
  word-spacing: -0.04em;
  text-wrap: balance;
}

.landing h1 em {
  color: var(--accent);
  font-style: italic;
  padding-right: 0.04em;
}

.letter {
  margin-top: 28px;
  padding-left: 18px;
  border-left: 2px solid var(--accent-soft);
  max-width: 34ch;
}

.letter p {
  font-size: 16px;
  line-height: 1.65;
  color: var(--ink-2);
  text-wrap: pretty;
}

.letter p + p {
  margin-top: 12px;
}

.letter .greet {
  font-family: var(--font-display);
  font-style: italic;
  font-size: 23px;
  font-weight: 500;
  line-height: 1.25;
  color: var(--ink);
}

.letter .sign {
  font-weight: 600;
  color: var(--ink);
}

.choices {
  display: grid;
  gap: 12px;
}

.choices-label {
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.02em;
  color: var(--ink-3);
}

.choice-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.choice {
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 28px;
  min-height: 164px;
  padding: 16px;
  border-radius: var(--r-surface);
  background: var(--surface);
  box-shadow: inset 0 0 0 1px var(--line), var(--shadow);
  transition: transform 160ms var(--ease-out);
}

.choice:first-child {
  background: var(--accent);
  color: var(--accent-ink);
  box-shadow: var(--shadow);
}

.choice:active {
  transform: scale(0.97);
}

.choice-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
}

.choice-icon {
  display: grid;
  place-items: center;
  width: 46px;
  height: 46px;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent);
  font-size: 24px;
}

.choice:first-child .choice-icon {
  background: rgb(255 255 255 / 0.16);
  color: var(--accent-ink);
}

.choice-arrow {
  color: var(--ink-3);
  font-size: 18px;
  transform: rotate(-45deg);
}

.choice:first-child .choice-arrow {
  color: var(--accent-ink);
  opacity: 0.7;
}

.choice-title {
  display: block;
  font-family: var(--font-display);
  font-size: 30px;
  font-weight: 600;
  line-height: 1;
  letter-spacing: -0.01em;
}

.choice-sub {
  display: block;
  margin-top: 6px;
  font-size: 13px;
  font-weight: 500;
  color: var(--ink-2);
}

.choice:first-child .choice-sub {
  color: var(--accent-ink);
  opacity: 0.75;
}

/* ---------- Top bar ---------- */

.topbar {
  position: sticky;
  top: 0;
  z-index: 5;
  display: grid;
  grid-template-columns: 42px 1fr auto;
  align-items: center;
  gap: 12px;
  margin: calc(-1 * (var(--safe-top) + 12px)) -16px 0;
  padding: calc(var(--safe-top) + 10px) 16px 10px;
  background: color-mix(in srgb, var(--bg) 78%, transparent);
  -webkit-backdrop-filter: blur(18px) saturate(160%);
  backdrop-filter: blur(18px) saturate(160%);
  border-bottom: 1px solid transparent;
  transition: border-color 200ms ease;
}

.topbar.scrolled {
  border-bottom-color: var(--line);
}

.topbar-title {
  font-size: 15px;
  font-weight: 600;
  text-align: center;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.score-pill {
  display: inline-flex;
  align-items: baseline;
  gap: 4px;
  min-height: 42px;
  padding: 0 16px;
  border-radius: 999px;
  background: var(--accent);
  color: var(--accent-ink);
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  align-items: center;
  transition: transform 140ms var(--ease-out);
}

.score-pill:active {
  transform: scale(0.96);
}

.score-pill small {
  font-size: 12px;
  font-weight: 600;
  opacity: 0.85;
}

.score-pill .num {
  display: inline-block;
}

.score-pill .num.bump {
  animation: bump 360ms var(--ease-out);
}

@keyframes bump {
  40% { transform: translateY(-2px) scale(1.14); }
}

/* ---------- Picker ---------- */

.picker {
  padding-top: 8vh;
}

.picker h1 {
  font-size: clamp(44px, 12.5vw, 56px);
}

.picker .lede {
  margin-top: 14px;
  color: var(--ink-2);
  max-width: 32ch;
}

.names {
  display: grid;
  gap: 12px;
  margin-top: 40px;
}

.name {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  width: 100%;
  padding: 24px 22px;
  border-radius: var(--r-surface);
  background: var(--surface);
  box-shadow: inset 0 0 0 1px var(--line), var(--shadow);
  text-align: left;
  transition: transform 160ms var(--ease-out);
}

.name:active {
  transform: scale(0.98);
}

.name-text {
  font-family: var(--font-display);
  font-size: 38px;
  font-weight: 600;
  line-height: 1;
}

.name-tag {
  font-size: 12px;
  font-weight: 600;
  color: var(--accent);
  background: var(--accent-soft);
  padding: 5px 10px;
  border-radius: 999px;
}

/* ---------- Game ---------- */

.game-head {
  padding: 22px 2px 20px;
}

.game-head h1 {
  font-size: 44px;
}

.game-head h1 em {
  font-style: italic;
  color: var(--accent);
}

.game-head p {
  margin-top: 6px;
  font-size: 14px;
  color: var(--ink-2);
}

.section {
  margin-top: 34px;
}

.section:first-of-type {
  margin-top: 0;
}

.section-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
  padding: 0 2px;
}

.section-head h2 {
  font-family: var(--font-display);
  font-size: 30px;
  font-weight: 600;
  line-height: 1;
}

.section-head .meta {
  font-size: 13px;
  font-weight: 600;
  color: var(--ink-2);
  font-variant-numeric: tabular-nums;
}

/* Bingo */

.board {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 5px;
  padding: 6px;
  border-radius: var(--r-surface);
  background: var(--surface-2);
  box-shadow: inset 0 0 0 1px var(--line);
}

.cell {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 4px;
  align-items: center;
  justify-content: center;
  min-height: 88px;
  padding: 8px 3px 7px;
  border-radius: var(--r-cell);
  background: var(--surface);
  box-shadow: inset 0 0 0 1px var(--line);
  color: var(--ink);
  font-size: 11.5px;
  font-weight: 600;
  line-height: 1.2;
  letter-spacing: -0.01em;
  text-align: center;
  hyphens: auto;
  -webkit-hyphens: auto;
  overflow-wrap: break-word;
  transition:
    transform 140ms var(--ease-out),
    background-color 220ms ease,
    color 220ms ease,
    box-shadow 220ms ease;
}

.cell:active {
  transform: scale(0.94);
}

.cell .heart {
  position: absolute;
  top: 5px;
  right: 5px;
  font-size: 10px;
  opacity: 0;
  transform: scale(0.6);
  transition: opacity 200ms ease, transform 260ms var(--ease-out);
}

.who {
  font-size: 8.5px;
  font-weight: 700;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--ink-3);
  line-height: 1;
}

.who.us {
  color: var(--accent);
}

.cell.on .who {
  color: var(--accent-ink);
  opacity: 0.75;
}

.cell.on {
  background: var(--accent);
  color: var(--accent-ink);
  box-shadow: none;
}

.cell.on .heart {
  opacity: 1;
  transform: scale(1);
}

.cell.free {
  flex-direction: column;
  gap: 2px;
  background: var(--accent-soft);
  color: var(--accent);
  box-shadow: none;
  cursor: default;
}

.cell.free:active {
  transform: none;
}

.cell.free i {
  font-size: 22px;
}

.cell.free span {
  font-family: var(--font-display);
  font-style: italic;
  font-size: 15px;
}

.cell.win {
  animation: win 900ms var(--ease-out) both;
  animation-delay: calc(var(--k, 0) * 60ms);
}

@keyframes win {
  0% { transform: scale(1); }
  35% { transform: scale(1.07); box-shadow: 0 0 0 3px var(--accent-soft); }
  100% { transform: scale(1); }
}

.board.dealing .cell {
  animation: deal 520ms var(--ease-out) both;
  animation-delay: calc(var(--d, 0) * 16ms);
}

@keyframes deal {
  from {
    opacity: 0;
    transform: translateY(8px) scale(0.96);
  }
}

/* Side quests */

.quests {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 8px;
}

.quest {
  display: grid;
  grid-template-columns: auto 1fr;
  align-items: start;
  gap: 12px;
  padding: 14px 14px 14px 12px;
  border-radius: var(--r-surface);
  background: var(--surface);
  box-shadow: inset 0 0 0 1px var(--line);
  transition: background-color 220ms ease;
}

.quest.done {
  background: var(--accent-soft);
  box-shadow: none;
}

.check {
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  margin-top: 1px;
  border-radius: 999px;
  box-shadow: inset 0 0 0 1.5px var(--line-strong);
  color: transparent;
  font-size: 15px;
  transition: transform 140ms var(--ease-out), background-color 200ms ease, color 200ms ease, box-shadow 200ms ease;
}

.check:active {
  transform: scale(0.9);
}

.quest.done .check {
  background: var(--accent);
  color: var(--accent-ink);
  box-shadow: none;
}

.quest-body {
  display: block;
  width: 100%;
  min-height: 32px;
  text-align: left;
}

.quest-text {
  display: block;
  font-size: 15px;
  font-weight: 500;
  line-height: 1.4;
  filter: blur(6px);
  opacity: 0.75;
  transition: filter 260ms var(--ease-out), opacity 260ms ease;
}

.quest.open .quest-text {
  filter: none;
  opacity: 1;
}

.quest.done.open .quest-text {
  text-decoration: line-through;
  text-decoration-color: var(--accent);
  text-decoration-thickness: 1.5px;
}

.quest-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 6px;
  font-size: 12px;
  font-weight: 600;
  color: var(--ink-3);
}

.quest-meta i {
  font-size: 14px;
}

.tier {
  padding: 2px 8px;
  border-radius: 999px;
  background: var(--surface-2);
  color: var(--ink-2);
  text-transform: capitalize;
}

.tier.hard {
  background: var(--accent-soft);
  color: var(--accent);
}

.quest.done .tier {
  background: var(--surface);
}

/* Power-ups */

.powers {
  display: grid;
  gap: 8px;
}

.power {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 14px;
  width: 100%;
  padding: 16px 16px 16px 14px;
  border-radius: var(--r-surface);
  background: var(--surface);
  box-shadow: inset 0 0 0 1px var(--line), var(--shadow);
  text-align: left;
  transition: transform 160ms var(--ease-out), opacity 220ms ease;
}

.power:active {
  transform: scale(0.98);
}

.power-icon {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border-radius: 999px;
  background: var(--accent);
  color: var(--accent-ink);
  font-size: 19px;
}

.power-text {
  font-size: 15px;
  font-weight: 600;
  line-height: 1.35;
}

.power-note {
  display: block;
  margin-top: 4px;
  font-size: 13px;
  font-weight: 500;
  color: var(--ink-2);
  font-style: italic;
}

.power-state {
  font-size: 12px;
  font-weight: 600;
  color: var(--ink-3);
}

.power.used {
  box-shadow: inset 0 0 0 1px var(--line);
}

.power.used .power-icon {
  background: var(--surface-2);
  color: var(--ink-3);
}

.power.used .power-text {
  color: var(--ink-2);
}

/* Footer actions */

.actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-top: 40px;
}

.foot-note {
  margin-top: 18px;
  text-align: center;
  font-size: 13px;
  color: var(--ink-3);
}

/* States */

.state {
  padding: 18vh 4px 0;
}

.state h1 {
  font-size: 40px;
}

.state p {
  margin-top: 12px;
  color: var(--ink-2);
  max-width: 34ch;
}

.state code {
  font-size: 13px;
  padding: 2px 6px;
  border-radius: 6px;
  background: var(--surface-2);
}

.state .btn {
  margin-top: 28px;
}

.skeleton-board {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 5px;
  padding: 6px;
  margin-top: 88px;
  border-radius: var(--r-surface);
  background: var(--surface-2);
}

.skeleton-board span {
  height: 84px;
  border-radius: var(--r-cell);
  background: var(--surface);
  animation: breathe 1.4s ease-in-out infinite alternate;
}

@keyframes breathe {
  to { opacity: 0.5; }
}

/* ---------- Sheet ---------- */

.sheet-root {
  position: fixed;
  inset: 0;
  z-index: 20;
}

.sheet-root[hidden] {
  display: none;
}

.sheet-backdrop {
  position: absolute;
  inset: 0;
  background: rgb(10 18 32 / 0.42);
  opacity: 0;
  transition: opacity 260ms ease;
}

.sheet {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  max-width: 480px;
  max-height: 86dvh;
  margin: 0 auto;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 10px 20px calc(var(--safe-bottom) + 20px);
  border-radius: 26px 26px 0 0;
  background: var(--surface);
  box-shadow: 0 -10px 40px -10px rgb(0 0 0 / 0.25);
  transform: translateY(100%);
  transition: transform 260ms var(--ease-out);
}

.sheet-root.open .sheet-backdrop {
  opacity: 1;
}

.sheet-root.open .sheet {
  transform: translateY(0);
  transition: transform 460ms var(--ease-drawer);
}

.sheet-grabber {
  position: sticky;
  top: -10px;
  height: 30px;
  margin: -10px -20px 8px;
  touch-action: none;
  cursor: grab;
}

.sheet-grabber::before {
  content: "";
  position: absolute;
  left: 50%;
  top: 12px;
  width: 38px;
  height: 5px;
  margin-left: -19px;
  border-radius: 999px;
  background: var(--line-strong);
}

.sheet h2 {
  font-family: var(--font-display);
  font-size: 28px;
  font-weight: 600;
  line-height: 1.05;
}

.sheet .sheet-sub {
  margin-top: 8px;
  color: var(--ink-2);
  font-size: 15px;
}

.sheet-actions {
  display: grid;
  gap: 8px;
  margin-top: 24px;
}

.field {
  display: grid;
  gap: 8px;
  margin-top: 22px;
}

.field label {
  font-size: 14px;
  font-weight: 600;
}

.field .help {
  font-size: 13px;
  color: var(--ink-2);
}

.field textarea {
  width: 100%;
  min-height: 92px;
  padding: 12px 14px;
  border: 0;
  border-radius: 14px;
  background: var(--bg);
  box-shadow: inset 0 0 0 1px var(--line-strong);
  color: var(--ink);
  font: inherit;
  font-size: 16px;
  line-height: 1.45;
  resize: none;
}

.field textarea::placeholder {
  color: var(--ink-3);
}

.field textarea:focus {
  outline: none;
  box-shadow: inset 0 0 0 2px var(--accent);
}

/* History list */

.history {
  list-style: none;
  margin: 20px 0 0;
  padding: 0;
  display: grid;
  gap: 8px;
}

.history-item {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: 12px;
  width: 100%;
  padding: 14px 16px;
  border-radius: 14px;
  background: var(--bg);
  box-shadow: inset 0 0 0 1px var(--line);
  text-align: left;
  transition: transform 140ms var(--ease-out);
}

.history-item:active {
  transform: scale(0.98);
}

.history-item.current {
  box-shadow: inset 0 0 0 1.5px var(--accent);
}

.history-item strong {
  display: block;
  font-size: 15px;
}

.history-item span {
  display: block;
  margin-top: 2px;
  font-size: 13px;
  color: var(--ink-2);
}

.history-item .pts {
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  color: var(--ink);
  text-align: right;
}

/* Tally */

.tally {
  margin-top: 20px;
  display: grid;
  gap: 2px;
}

.tally-row {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 0;
  font-size: 15px;
  font-variant-numeric: tabular-nums;
}

.tally-row + .tally-row {
  border-top: 1px solid var(--line);
}

.tally-row.total {
  margin-top: 6px;
  padding-top: 14px;
  border-top: 1.5px solid var(--line-strong);
  font-weight: 700;
  font-size: 17px;
}

.tally-notes {
  margin-top: 22px;
}

.tally-notes h3 {
  font-size: 14px;
  font-weight: 600;
  margin-bottom: 8px;
}

.tally-notes p {
  font-size: 14px;
  color: var(--ink-2);
  padding: 10px 14px;
  border-radius: 12px;
  background: var(--bg);
  margin-top: 6px;
}

.tally-notes p b {
  color: var(--ink);
  font-weight: 600;
}

/* ---------- Toast ---------- */

.toast {
  position: fixed;
  left: 50%;
  bottom: calc(var(--safe-bottom) + 24px);
  z-index: 30;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 11px 18px;
  border-radius: 999px;
  background: var(--ink);
  color: var(--bg);
  font-size: 14px;
  font-weight: 600;
  white-space: nowrap;
  pointer-events: none;
  opacity: 0;
  transform: translate(-50%, 12px) scale(0.96);
  transition: opacity 200ms ease, transform 200ms var(--ease-out);
}

.toast.show {
  opacity: 1;
  transform: translate(-50%, 0) scale(1);
  transition: opacity 260ms ease, transform 420ms var(--ease-drawer);
}

.toast i {
  color: var(--accent);
  font-size: 16px;
}

/* ---------- View transitions ---------- */

::view-transition-old(root) {
  animation: vt-out 180ms ease both;
}

::view-transition-new(root) {
  animation: vt-in 320ms var(--ease-out) both;
}

@keyframes vt-out {
  to { opacity: 0; }
}

@keyframes vt-in {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
}

/* ---------- Hover (pointer devices only) ---------- */

@media (hover: hover) and (pointer: fine) {
  .choice:hover,
  .name:hover,
  .power:hover {
    box-shadow: inset 0 0 0 1px var(--line-strong), var(--shadow);
  }
  .cell:not(.on):not(.free):hover {
    background: var(--accent-soft);
  }
}

/* ---------- Reduced motion ---------- */

@media (prefers-reduced-motion: reduce) {
  .rise,
  .board.dealing .cell,
  .cell.win,
  .landing-names i,
  .score-pill .num.bump {
    animation: none;
  }
  .sheet,
  .sheet-root.open .sheet {
    transition: none;
  }
  .toast,
  .toast.show {
    transform: translate(-50%, 0);
  }
  ::view-transition-old(root),
  ::view-transition-new(root) {
    animation: none;
  }
}
