/* Yahtzee table. Cobalt felt, a white score pad printed in blue, pencil marks, ivory dice. */
:root {
  --felt: #2437c4;
  --felt-deep: #1b2a9e;
  --felt-line: rgba(255, 255, 255, 0.18);
  --paper: #fffef9;
  --ink: #131a4a;
  --pencil: #33364a;
  --rule: #aab4f0;
  --red: #e5382c;
  --hi: #ffd23f;
  --on-felt: #ffffff;
  --on-felt-soft: #c9d0ff;
  --die: 58px;
  --ui: 'Bricolage Grotesque', 'Avenir Next', 'Segoe UI', system-ui, sans-serif;
  --hand: 'Caveat', 'Bradley Hand', 'Segoe Print', cursive;
  --radius: 18px;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  min-height: 100dvh;
  font-family: var(--ui);
  font-size: 1rem;
  line-height: 1.45;
  color: var(--on-felt);
  background:
    radial-gradient(1200px 700px at 15% -10%, #3349e0 0%, transparent 60%),
    radial-gradient(900px 600px at 110% 110%, #16207f 0%, transparent 55%),
    var(--felt);
  background-attachment: fixed;
}
h1, h2, h3, p, ol, ul { margin: 0; }
ol, ul { padding: 0; list-style: none; }
button, input, select { font: inherit; color: inherit; }
button { cursor: pointer; }
button:disabled { cursor: default; }
:focus-visible { outline: 3px solid var(--hi); outline-offset: 2px; }
.muted { color: var(--on-felt-soft); }
.small { font-size: 0.85rem; }

/* ---------- top bar ---------- */
.top {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: max(14px, env(safe-area-inset-top)) clamp(14px, 4vw, 40px) 10px;
}
.brand { display: flex; align-items: center; gap: 10px; color: inherit; text-decoration: none; font-weight: 800; font-size: 1.2rem; letter-spacing: -0.02em; }
.brand svg { width: 30px; height: 30px; transform: rotate(-8deg); }
.tabs { display: flex; gap: 2px; padding: 3px; border-radius: 999px; background: rgba(10, 16, 80, 0.35); }
.tabs a { padding: 7px 14px; border-radius: 999px; color: var(--on-felt-soft); text-decoration: none; font-weight: 600; font-size: 0.95rem; }
.tabs a[aria-current='page'] { background: var(--paper); color: var(--ink); }
@media (max-width: 520px) {
  .brand span { display: none; }
  .tabs a { padding: 7px 12px; }
}

main { padding: 8px clamp(10px, 4vw, 40px) 60px; max-width: 1280px; margin: 0 auto; }
.loading { padding: 40px 0; color: var(--on-felt-soft); }

/* ---------- buttons, inputs ---------- */
.btn {
  border: 2px solid var(--felt-line); background: transparent; color: var(--on-felt);
  padding: 9px 16px; border-radius: 999px; font-weight: 650; line-height: 1.2;
}
.btn:hover:not(:disabled) { border-color: #fff; }
.btn.primary {
  background: var(--hi); color: var(--ink); border-color: var(--ink);
  box-shadow: 0 4px 0 var(--ink); transition: transform 0.08s, box-shadow 0.08s;
}
.btn.primary:active:not(:disabled) { transform: translateY(3px); box-shadow: 0 1px 0 var(--ink); }
.btn.primary:disabled { background: #cfd4f5; color: #5b6296; box-shadow: none; border-color: transparent; }
.btn.big { padding: 13px 26px; font-size: 1.1rem; font-weight: 750; }
.btn.quiet { border-color: transparent; padding: 8px 10px; color: var(--on-felt-soft); text-decoration: underline; text-underline-offset: 3px; font-weight: 550; }
.btn.quiet:hover:not(:disabled) { color: #fff; border-color: transparent; }
.btn.quiet:disabled { opacity: 0.4; text-decoration: none; }
.btnrow { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.input, .select {
  width: 100%; min-height: 44px; padding: 8px 12px; border-radius: 12px; border: 2px solid var(--rule);
  background: #fff; color: var(--ink); font-weight: 600; font-size: 1rem;
}
.select { appearance: none; padding-right: 36px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 8'%3E%3Cpath d='M1 1.5l5 5 5-5' fill='none' stroke='%23131a4a' stroke-width='2' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 12px center; background-size: 12px; }
.seg { display: inline-flex; padding: 3px; border-radius: 999px; background: #e3e7fb; }
.seg button { white-space: nowrap; border: 0; background: transparent; color: #4b528a; padding: 6px 13px; border-radius: 999px; font-weight: 650; font-size: 0.92rem; }
.seg button.on { background: var(--ink); color: #fff; }

/* ---------- avatars ---------- */
.avatar {
  flex: none; display: inline-grid; place-items: center; width: 34px; height: 34px; border-radius: 50%;
  font-weight: 800; color: var(--ink); box-shadow: 0 0 0 2px var(--ink);
}
.avatar svg { width: 62%; height: 62%; display: block; fill: currentColor; }
.avatar.sm { width: 26px; height: 26px; font-size: 0.8rem; box-shadow: 0 0 0 1.5px var(--ink); }
.avatar.lg { width: 46px; height: 46px; font-size: 1.25rem; }

/* ---------- setup ---------- */
.setup { max-width: 640px; margin: 0 auto; padding-top: clamp(10px, 4vh, 40px); display: grid; gap: 18px; }
.setup-head h1 { font-size: clamp(2.3rem, 9vw, 4rem); line-height: 0.95; letter-spacing: -0.04em; font-weight: 800; }
.setup-head p { margin-top: 12px; color: var(--on-felt-soft); max-width: 46ch; font-size: 1.05rem; }
.seats { background: var(--paper); color: var(--ink); border-radius: var(--radius); box-shadow: 0 6px 0 rgba(8, 12, 70, 0.35); overflow: hidden; }
.seat { display: flex; align-items: center; gap: 14px; padding: 14px 16px; }
.seat + .seat { border-top: 1.5px solid var(--rule); }
.seat-main { flex: 1; min-width: 0; display: grid; gap: 8px; justify-items: start; }
.seat .muted { color: #5b6296; }
.seat .remove { color: #5b6296; }
.seat .remove:hover { color: var(--red) !important; }
.btn.add { justify-self: start; border-style: dashed; }
.option { display: grid; gap: 8px; justify-items: start; }
.option h2 { font-size: 1rem; font-weight: 700; }
.option.two { grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 18px; }
.option.two > div { display: grid; gap: 8px; justify-items: start; }
.start { justify-self: start; margin-top: 6px; }
@media (max-width: 520px) {
  .seat { gap: 10px; padding: 12px; }
  .seat .remove { padding: 8px 2px; font-size: 0.85rem; }
  .seat .avatar.lg { width: 38px; height: 38px; }
  .start { justify-self: stretch; }
}

/* ---------- game layout ---------- */
.game { display: grid; grid-template-columns: minmax(0, 1fr) 380px; gap: 28px; align-items: start; position: relative; }
.side { position: sticky; top: 14px; display: grid; gap: 16px; }
.padwrap { min-width: 0; }
.padtools { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin-top: 14px; }
.spend { margin-left: auto; font-size: 0.85rem; }

/* ---------- the score pad ---------- */
.pad-scroll {
  position: relative; overflow-x: auto; background: var(--paper); border-radius: 6px 6px 14px 14px;
  border-top: 14px solid var(--red);
  box-shadow: 0 2px 0 #dfe2f2, 0 5px 0 #c9cdea, 0 8px 0 #b3b9e0, 0 22px 30px rgba(6, 10, 60, 0.35);
}
.pad { width: 100%; border-collapse: separate; border-spacing: 0; color: var(--ink); }
.pad th, .pad td { border-bottom: 1.5px solid var(--rule); border-left: 1.5px solid var(--rule); padding: 0; height: 44px; }
.pad tr > :first-child { border-left: 0; }
.pad thead th { padding: 12px 6px 9px; vertical-align: bottom; border-bottom: 2.5px solid var(--felt); font-size: 0.9rem; font-weight: 700; min-width: 64px; }
.pad thead th.pcol { text-align: center; }
.pad thead .avatar { display: grid; margin: 0 auto 5px; }
.pad thead .pname { display: block; line-height: 1.1; overflow-wrap: anywhere; }
.pad thead .wins { display: block; font-weight: 550; font-size: 0.75rem; color: #5b6296; }
.pad thead .corner { text-align: left; padding-left: 14px; font-weight: 600; color: #5b6296; font-size: 0.85rem; }
.pad tbody th {
  position: sticky; left: 0; z-index: 1; background: var(--paper); text-align: left; padding: 4px 10px 4px 14px;
  font-weight: 650; white-space: nowrap; width: 1%;
}
.pad .hint { display: block; font-weight: 450; font-size: 0.74rem; color: #6b73a8; line-height: 1.1; }
.pad .lbl.short { display: none; }
.pad .cell { text-align: center; font-family: var(--hand); font-weight: 700; font-size: 1.75rem; line-height: 1; color: var(--pencil); min-width: 58px; }
.pad .cell.zero { color: #9aa0bf; }
.pad .pcol.active { background: linear-gradient(rgba(255, 210, 63, 0.38), rgba(255, 210, 63, 0.38)); }
.pad thead th.active { box-shadow: inset 0 -4px 0 var(--hi); }
.cellbtn { display: block; width: 100%; height: 100%; min-height: 43px; border: 0; background: transparent; font: inherit; color: inherit; padding: 0; }
.cell.open .cellbtn:hover, .cell.filled .cellbtn:hover { background: rgba(36, 55, 196, 0.08); }
.cell.open.active .cellbtn { background-image: radial-gradient(circle, rgba(19, 26, 74, 0.28) 1.6px, transparent 2px); background-size: 9px 9px; background-repeat: repeat-x; background-position: center 72%; }
.cell.ghost .cellbtn { color: var(--felt); opacity: 0.6; }
.cell.ghost .cellbtn:hover { opacity: 1; background: rgba(255, 210, 63, 0.6); }
.cell.just { animation: penned 1.4s ease-out; }
@keyframes penned { 0%, 35% { background-color: var(--hi); box-shadow: inset 0 0 0 3px var(--ink); } 100% { background-color: transparent; box-shadow: inset 0 0 0 3px transparent; } }
.row-sum th, .row-sum td { background: #f1f3fd; border-bottom-color: var(--felt); }
.pad .row-sum th { background: #f1f3fd; }
.row-sum .need { font-family: var(--ui); font-size: 0.72rem; font-weight: 550; color: #6b73a8; }
.row-sum .earned { color: var(--red); }
.row-sum.total th, .row-sum.total td { border-bottom: 0; height: 54px; }
.row-sum.total .cell { font-size: 2.1rem; }
.row-sum.total .lead { display: inline-block; padding: 0 10px; border: 2.5px solid var(--red); border-radius: 50% 45% 52% 48%; transform: rotate(-4deg); }
.row-sum.bonus td { border-bottom-width: 2.5px; }
.row-sum.bonus th { border-bottom-width: 2.5px; }

/* ---------- tray ---------- */
.tray {
  background: var(--felt-deep); border: 1.5px solid var(--felt-line); border-radius: 22px; padding: 18px;
  display: grid; gap: 14px; box-shadow: inset 0 2px 22px rgba(4, 8, 60, 0.45);
}
.turnhead { display: flex; align-items: center; gap: 12px; }
.turnwho { display: grid; line-height: 1.2; }
.turnwho strong { font-size: 1.2rem; font-weight: 750; letter-spacing: -0.01em; }
.turnwho .muted { font-size: 0.86rem; }
.bubble {
  position: relative; background: var(--paper); color: var(--ink); border-radius: 16px; padding: 11px 15px;
  font-weight: 550; font-size: 1.05rem; line-height: 1.3; min-height: 46px; justify-self: start; max-width: 100%;
  margin-left: 6px;
}
.bubble::before { content: ''; position: absolute; left: 14px; top: -8px; width: 16px; height: 16px; background: inherit; transform: rotate(45deg); border-radius: 3px; }
.bubble.error { background: #ffe1dd; color: #7a130b; }
.bubble.hintb { background: #e3e7fb; }
.typing { display: inline-flex; gap: 5px; align-items: center; height: 22px; }
.typing i { width: 8px; height: 8px; border-radius: 50%; background: var(--ink); animation: blink 1.1s infinite; }
.typing i:nth-child(2) { animation-delay: 0.18s; }
.typing i:nth-child(3) { animation-delay: 0.36s; }
@keyframes blink { 0%, 80%, 100% { opacity: 0.2; transform: translateY(0); } 40% { opacity: 1; transform: translateY(-3px); } }
.instruction { color: var(--on-felt-soft); font-size: 1rem; }
.instruction.small { font-size: 0.85rem; }

.dice { display: flex; justify-content: space-between; gap: 6px; padding: 16px 4px 8px; }
.die { position: relative; width: var(--die); height: var(--die); border: 0; background: transparent; padding: 0; perspective: 500px; border-radius: 16%; transition: transform 0.2s; }
.die.blank .cube { opacity: 0.16; }
.die-shadow { position: absolute; left: 8%; right: 8%; bottom: -12px; height: 9px; border-radius: 50%; background: rgba(3, 6, 50, 0.5); filter: blur(4px); transition: transform 0.2s, opacity 0.2s; }
.cube { position: absolute; inset: 0; transform-style: preserve-3d; transform: translateZ(calc(var(--die) / -2)); transition: transform 0.8s cubic-bezier(0.2, 0.75, 0.25, 1); }
.face {
  position: absolute; inset: 0; border-radius: 16%; background: #fffdf3; box-shadow: inset 0 0 0 1.5px #d9d5c3, inset 0 -6px 10px rgba(120, 110, 70, 0.14);
  display: grid; grid-template: repeat(3, 1fr) / repeat(3, 1fr); padding: 15%; gap: 4%; backface-visibility: hidden;
}
.face i.pip { background: var(--ink); border-radius: 50%; width: 82%; height: 82%; place-self: center; }
.face.f1 i.pip { background: var(--red); width: 100%; height: 100%; }
.f1 { transform: rotateY(0deg) translateZ(calc(var(--die) / 2)); }
.f6 { transform: rotateY(180deg) translateZ(calc(var(--die) / 2)); }
.f2 { transform: rotateY(90deg) translateZ(calc(var(--die) / 2)); }
.f5 { transform: rotateY(-90deg) translateZ(calc(var(--die) / 2)); }
.f3 { transform: rotateX(90deg) translateZ(calc(var(--die) / 2)); }
.f4 { transform: rotateX(-90deg) translateZ(calc(var(--die) / 2)); }
.die.tumble { animation: hop 0.8s cubic-bezier(0.3, 0, 0.3, 1) var(--delay, 0ms) backwards; }
@keyframes hop { 0% { transform: translateY(0); } 30% { transform: translateY(-26px) rotate(-6deg); } 62% { transform: translateY(0); } 78% { transform: translateY(-7px); } 100% { transform: translateY(0); } }
.die.held { transform: translateY(-12px); }
.die.held .face { box-shadow: inset 0 0 0 3.5px var(--hi), inset 0 -6px 10px rgba(120, 110, 70, 0.14); background: #fff6cf; }
.die.held .die-shadow { transform: scale(0.8) translateY(10px); opacity: 0.6; }
.die.held::after { content: 'kept'; position: absolute; left: 0; right: 0; bottom: -30px; text-align: center; font-size: 0.72rem; font-weight: 700; color: var(--hi); }
.die:not(:disabled):hover .face { box-shadow: inset 0 0 0 3px var(--hi), inset 0 -6px 10px rgba(120, 110, 70, 0.14); }
.tray .dice { margin-bottom: 14px; }

.over { display: grid; gap: 14px; }
.over-line { font-size: 1.7rem; font-weight: 800; letter-spacing: -0.02em; line-height: 1.1; }
.ranks { display: grid; gap: 6px; }
.ranks li { display: flex; align-items: center; gap: 10px; }
.ranks b { margin-left: auto; font-family: var(--hand); font-size: 1.6rem; line-height: 1; }

/* ---------- table talk ---------- */
.talk { border-radius: 22px; padding: 16px 18px; background: rgba(10, 16, 80, 0.28); }
.talk h2 { font-size: 0.95rem; font-weight: 700; color: var(--on-felt-soft); margin-bottom: 10px; }
.talk-list { display: grid; gap: 12px; max-height: 44vh; overflow-y: auto; }
.talk-list li { display: flex; gap: 10px; align-items: flex-start; }
.talk-list .tbody { min-width: 0; }
.talk-list .say { font-weight: 550; line-height: 1.3; }
.talk-list .say::before { content: '“'; }
.talk-list .say::after { content: '”'; }
.talk-list .did { font-size: 0.84rem; color: var(--on-felt-soft); }
.talk-list .who { font-weight: 700; color: #fff; }
.talk-list .loss { margin-left: 8px; padding: 1px 7px; border-radius: 999px; background: rgba(229, 56, 44, 0.9); color: #fff; font-size: 0.74rem; font-weight: 700; white-space: nowrap; }
.talk-list .empty { color: var(--on-felt-soft); font-size: 0.9rem; }
.talk-list .divider { justify-content: center; font-size: 0.8rem; font-weight: 700; color: var(--on-felt-soft); border-top: 1px solid var(--felt-line); padding-top: 10px; }

/* ---------- score entry sheet ---------- */
.sheet-wrap { position: fixed; inset: 0; z-index: 40; background: rgba(8, 12, 60, 0.55); display: grid; place-items: center; padding: 16px; }
.sheet { width: min(460px, 100%); background: var(--paper); color: var(--ink); border-radius: 22px; padding: 18px; display: grid; gap: 14px; box-shadow: 0 20px 60px rgba(0, 0, 0, 0.4); }
.sheet-head { display: flex; justify-content: space-between; gap: 10px; align-items: flex-start; }
.sheet h3 { font-size: 1.3rem; font-weight: 800; letter-spacing: -0.02em; line-height: 1.15; }
.sheet .muted, .sheet .btn.quiet { color: #5b6296; }
.sheet .btn.quiet:hover { color: var(--ink) !important; }
.chips { display: grid; grid-template-columns: repeat(auto-fill, minmax(54px, 1fr)); gap: 8px; }
.chip { min-height: 50px; border-radius: 14px; border: 2px solid var(--rule); background: #fff; font-family: var(--hand); font-weight: 700; font-size: 1.7rem; line-height: 1; color: var(--pencil); }
.chip:hover { border-color: var(--felt); }
.chip.on { background: var(--hi); border-color: var(--ink); }
.chip.wide { grid-column: span 1; font-size: 1.4rem; }
@media (max-width: 600px) {
  .sheet-wrap { place-items: end center; padding: 0; }
  .sheet { width: 100%; border-radius: 22px 22px 0 0; padding-bottom: max(18px, env(safe-area-inset-bottom)); }
}

.stamp {
  position: fixed; left: 50%; top: 42%; z-index: 60; pointer-events: none; font-weight: 800; font-size: clamp(3rem, 14vw, 7rem);
  letter-spacing: -0.04em; color: var(--red); background: var(--paper); padding: 0 0.25em; border: 0.08em solid var(--red); border-radius: 0.2em;
  animation: stamp 1.9s cubic-bezier(0.2, 1.4, 0.3, 1) both;
}
@keyframes stamp {
  0% { transform: translate(-50%, -50%) rotate(-9deg) scale(3); opacity: 0; }
  14% { transform: translate(-50%, -50%) rotate(-9deg) scale(1); opacity: 1; }
  80% { transform: translate(-50%, -50%) rotate(-9deg) scale(1); opacity: 1; }
  100% { transform: translate(-50%, -50%) rotate(-9deg) scale(1.06); opacity: 0; }
}
.toast { position: fixed; left: 50%; top: 18px; transform: translateX(-50%); z-index: 70; background: var(--ink); color: #fff; padding: 9px 16px; border-radius: 999px; font-weight: 600; font-size: 0.92rem; transition: opacity 0.4s; }
.toast.out { opacity: 0; }

/* ---------- small screens: the tray docks to the bottom edge ---------- */
@media (max-width: 920px) {
  :root { --die: clamp(44px, 13.5vw, 58px); }
  main { padding-bottom: 20px; }
  .game { grid-template-columns: minmax(0, 1fr); gap: 16px; padding-bottom: 290px; }
  .side { position: static; }
  .tray {
    position: fixed; left: 0; right: 0; bottom: 0; z-index: 20; border-radius: 22px 22px 0 0; border-width: 1.5px 0 0;
    padding: 12px 16px max(14px, env(safe-area-inset-bottom)); gap: 10px; box-shadow: 0 -10px 30px rgba(4, 8, 60, 0.5);
  }
  .tray .dice { padding-top: 14px; margin-bottom: 12px; max-width: 420px; width: 100%; justify-self: center; }
  .tray .btnrow { justify-content: center; }
  .tray .btn.big { flex: 1; max-width: 340px; }
  .avatar.lg { width: 38px; height: 38px; font-size: 1.05rem; }
  .turnwho strong { font-size: 1.05rem; }
  .bubble { font-size: 0.98rem; padding: 9px 13px; min-height: 0; }
  .instruction.small { display: none; }
  .pad .lbl.full { display: none; }
  .pad .lbl.short { display: inline; }
  .pad .hint { display: none; }
  .pad tbody th { padding: 4px 8px 4px 10px; font-size: 0.92rem; }
  .pad th, .pad td { height: 40px; }
  .cellbtn { min-height: 39px; }
  .pad .cell { min-width: 50px; font-size: 1.6rem; }
  .pad thead th { min-width: 50px; font-size: 0.8rem; padding: 10px 3px 7px; }
  .talk-list { max-height: none; }
}
@media (min-width: 921px) and (max-height: 760px) { .talk-list { max-height: 30vh; } }

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

/* ---------- benchmark ---------- */
.bm { max-width: 1060px; margin: 0 auto; display: grid; gap: 22px; padding-top: clamp(10px, 4vh, 36px); }
.bm-head h1 { font-size: clamp(2.1rem, 7.5vw, 3.8rem); line-height: 0.97; letter-spacing: -0.04em; font-weight: 800; max-width: 16ch; }
.bm-head p { margin-top: 14px; color: var(--on-felt-soft); max-width: 62ch; font-size: 1.08rem; }
.bm-head.sub { margin-top: 26px; }
.bm-head.sub h1 { font-size: clamp(1.8rem, 6vw, 3rem); }
.devflag { background: var(--hi); color: var(--ink); font-weight: 700; padding: 8px 14px; border-radius: 10px; justify-self: start; }
.bm-sheet { background: var(--paper); color: var(--ink); border-radius: 6px 6px 16px 16px; border-top: 10px solid var(--red); padding: clamp(16px, 3vw, 28px); box-shadow: 0 6px 0 rgba(8, 12, 70, 0.35); min-width: 0; }
.bm-sheet h2 { font-size: 1.5rem; font-weight: 800; letter-spacing: -0.02em; }
.bm-sheet .intro { margin: 6px 0 18px; color: #4b528a; max-width: 70ch; }
.bm-name { display: inline-flex; align-items: center; gap: 9px; min-width: 0; text-align: left; }
.bm-name > span:last-child { display: grid; line-height: 1.15; min-width: 0; }
.bm-name b { font-weight: 700; white-space: nowrap; }
.bm-name small { color: #6b73a8; font-size: 0.76rem; font-weight: 500; }
.scrollx { overflow-x: auto; margin: 0 calc(clamp(16px, 3vw, 28px) * -1); padding: 0 clamp(16px, 3vw, 28px); }

.board { display: grid; }
.board li { display: grid; grid-template-columns: 26px 190px minmax(0, 1fr); gap: 6px 14px; align-items: center; padding: 12px 0; border-top: 1.5px solid var(--rule); }
.board li:first-child { border-top: 0; }
.board .rank { font-family: var(--hand); font-size: 1.7rem; font-weight: 700; color: var(--pencil); line-height: 1; text-align: center; }
.track { position: relative; height: 26px; background: #edf0fc; border-radius: 6px; margin-right: 34px; }
.track .fill { position: absolute; left: 0; top: 0; bottom: 0; background: var(--felt); border-radius: 6px 3px 3px 6px; }
.track .ref { position: absolute; top: -4px; bottom: -4px; width: 2px; background: var(--ink); opacity: 0.55; z-index: 1; }
.track .whisk { position: absolute; top: 50%; height: 3px; margin-top: -1.5px; background: var(--hi); box-shadow: 0 0 0 1px var(--ink); border-radius: 2px; z-index: 2; min-width: 3px; }
.track .val { position: absolute; top: 50%; transform: translate(8px, -50%); font-weight: 800; font-size: 0.95rem; z-index: 3; padding-left: 10px; }
.stats { grid-column: 3; display: flex; flex-wrap: wrap; gap: 2px 20px; margin: 0; font-size: 0.82rem; color: #4b528a; }
.stats div { display: flex; gap: 5px; }
.stats dt { font-weight: 500; }
.stats dd { margin: 0; font-weight: 750; color: var(--ink); }

.bm-table { border-collapse: collapse; width: 100%; font-size: 0.92rem; }
.bm-table th, .bm-table td { padding: 8px 10px; border-bottom: 1.5px solid var(--rule); text-align: left; vertical-align: middle; }
.bm-table thead th { font-weight: 700; font-size: 0.8rem; color: #4b528a; border-bottom: 2.5px solid var(--felt); vertical-align: bottom; line-height: 1.2; }
.bm-table thead small { display: block; font-weight: 500; }
.bm-table .num { text-align: right; font-variant-numeric: tabular-nums; }
.bm-table tbody th { font-weight: 500; white-space: nowrap; position: sticky; left: 0; background: var(--paper); z-index: 1; }
.bm-table .refrow th, .bm-table .refrow td { background: #f1f3fd; font-weight: 650; }
.sizes td b { display: block; font-size: 1.05rem; }
.sizes td small { color: #3d4479; font-size: 0.76rem; }
.heat td, .heat thead th.num { text-align: center; min-width: 56px; }
.heat td { font-weight: 600; }
.habits thead th { min-width: 78px; }

.legend { display: flex; flex-wrap: wrap; gap: 6px 18px; margin-bottom: 14px; font-size: 0.86rem; font-weight: 600; }
.legend li { display: flex; align-items: center; gap: 7px; }
.legend i { width: 14px; height: 14px; border-radius: 4px; }
.lossbars { display: grid; gap: 8px; }
.lossbars li { display: grid; grid-template-columns: 200px minmax(0, 1fr); gap: 12px; align-items: center; }
.stack { display: flex; align-items: center; height: 24px; gap: 2px; padding-right: 44px; }
.stack span { height: 100%; border-radius: 3px; min-width: 0; }
.stack b { margin-left: 8px; font-size: 0.92rem; font-weight: 800; white-space: nowrap; }

.moments { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 14px; }
.moments li { border: 1.5px solid var(--rule); border-radius: 14px; padding: 14px; display: grid; gap: 8px; align-content: start; }
.mo-head { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.mo-loss { background: var(--red); color: #fff; font-weight: 750; font-size: 0.82rem; padding: 2px 9px; border-radius: 999px; white-space: nowrap; }
.mo-ctx { font-size: 0.82rem; color: #4b528a; }
.mo-say { font-family: var(--hand); font-size: 1.45rem; line-height: 1.1; color: var(--pencil); }
.mo-did { font-size: 0.9rem; }
.minidice { display: inline-flex; gap: 5px; }
.md { width: 30px; height: 30px; border-radius: 7px; border: 2px solid var(--ink); display: grid; place-items: center; font-style: normal; font-weight: 800; background: #fff; }
.md.on { background: var(--hi); }
.insights { display: grid; gap: 12px; max-width: 74ch; }
.insights li { padding-left: 18px; position: relative; }
.insights li::before { content: ''; position: absolute; left: 0; top: 0.5em; width: 8px; height: 8px; border-radius: 2px; background: var(--red); transform: rotate(45deg); }
.method { display: grid; gap: 10px; max-width: 74ch; color: #2b3166; }
@media (max-width: 720px) {
  .board li { grid-template-columns: 22px minmax(0, 1fr); }
  .board .track, .board .stats { grid-column: 1 / -1; }
  .lossbars li { grid-template-columns: minmax(0, 1fr); gap: 4px; }
  .bm-name b { white-space: normal; }
}
