/* Finish My Sentence: game styles. Builds on /assets/brand.css tokens. */

html { overflow-x: hidden; }
body { overflow-x: clip; }
html.passing, html.passing body { overflow: hidden; }

.shell {
  position: relative; z-index: 1;
  max-width: 600px; margin: 0 auto; min-height: 100dvh;
  display: flex; flex-direction: column;
  padding: max(8px, env(safe-area-inset-top)) max(16px, env(safe-area-inset-right)) 0 max(16px, env(safe-area-inset-left));
}
.app { flex: 1; display: flex; flex-direction: column; min-width: 0; }
.screen {
  flex: 1; display: flex; flex-direction: column; gap: 16px; min-width: 0;
  animation: screen-in .38s var(--ease-bounce) both;
}
@keyframes screen-in { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }

.actions {
  position: sticky; bottom: 0; z-index: 5; align-self: stretch;
  margin-top: auto; padding: 16px 0 max(16px, env(safe-area-inset-bottom));
  background: linear-gradient(to bottom, rgba(240, 234, 229, 0), var(--beige) 18px);
}
.btn-big { min-height: 60px; font-size: 19px; border-radius: 999px; }
.btn .btn-sub { font-weight: 500; }
.small { font-size: 14px; }
.big-h { font-size: clamp(28px, 8vw, 38px); font-weight: 800; letter-spacing: -.03em; line-height: 1.05; }
.title { font-size: clamp(40px, 12vw, 58px); font-weight: 800; letter-spacing: -.04em; line-height: .95; }
.lede { font-size: 17px; color: var(--muted); }
:focus-visible { outline: 3px solid var(--blue-hover); outline-offset: 3px; }
h1:focus, h2:focus, p:focus { outline: none; }

/* desktop-only floating brand icons */
.deco { display: none; }
@media (min-width: 980px) {
  .deco { display: block; position: fixed; inset: 0; pointer-events: none; z-index: 0; overflow: hidden; }
  .deco img { position: absolute; width: 110px; animation: bob 7s ease-in-out infinite; }
  .deco-1 { left: 7%; top: 18%; transform: rotate(-10deg); }
  .deco-2 { right: 8%; top: 14%; width: 90px; animation-delay: -2s; }
  .deco-3 { left: 11%; top: 58%; width: 96px; animation-delay: -4s; }
  .deco-4 { right: 11%; top: 52%; width: 124px; animation-delay: -1s; }
  .deco-5 { left: 4%; bottom: 6%; width: 80px; animation-delay: -3s; }
  .deco-6 { right: 5%; bottom: 8%; width: 92px; animation-delay: -5s; }
}
@keyframes bob { 0%, 100% { translate: 0 0; rotate: -4deg; } 50% { translate: 0 -14px; rotate: 5deg; } }

/* ------------------------------------------------------------ avatars & pills */
.avatar {
  width: 40px; height: 40px; flex: none; border-radius: 50%; border: var(--bd);
  background: var(--pc, var(--yellow)); display: inline-grid; place-items: center;
  font-weight: 800; font-size: 18px; line-height: 1; color: #000;
}
.avatar.sm { width: 28px; height: 28px; font-size: 13px; }
.avatar.lg { width: 60px; height: 60px; font-size: 26px; box-shadow: 3px 3px 0 #000; }
.avatar.xl { width: 96px; height: 96px; font-size: 44px; box-shadow: var(--shadow); }

.fmt-pill {
  display: inline-flex; align-items: center; gap: 6px; padding: 3px 12px 3px 3px;
  border: var(--bd); border-radius: 999px; background: #fff; font-size: 13px; font-weight: 700; white-space: nowrap;
}
.fmt-pill img { width: 24px; height: 24px; }

/* ------------------------------------------------------------ HUD */
.hud { display: flex; flex-direction: column; gap: 10px; margin-bottom: 14px; }
.hud[hidden] { display: none; }
.hud-top { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) 48px; gap: 8px; align-items: center; }
.score-chip {
  display: flex; align-items: center; gap: 6px; min-width: 0; min-height: 44px;
  background: var(--pc, #fff); border: var(--bd); border-radius: 999px; padding: 4px 5px 4px 14px; box-shadow: 2px 2px 0 #000;
}
.score-chip.bump { animation: bump .5s var(--ease-bounce); }
.score-chip.bump .sc-num { background: var(--yellow); }
@keyframes bump { 40% { transform: scale(1.1) rotate(-2deg); } }
.sc-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 700; font-size: 15px; }
.sc-num {
  flex: none; min-width: 34px; height: 32px; display: grid; place-items: center; padding: 0 6px;
  font-size: 18px; font-weight: 800; font-variant-numeric: tabular-nums; line-height: 1;
  background: #fff; border: var(--bd); border-radius: 999px; transition: background .4s;
}
.hud-progress { display: flex; align-items: center; gap: 10px; padding: 0 2px; }
.hud-compact { flex-direction: row; align-items: center; gap: 12px; margin-bottom: 6px; }
.hud-compact .hud-top { display: contents; }
.hud-compact .score-chip { display: none; }
.hud-compact .hud-progress { flex: 1; order: -1; min-width: 0; }
.hud-compact .icon-btn { width: 44px; height: 44px; }
.hud-round { font-size: 13px; font-weight: 800; white-space: nowrap; letter-spacing: .02em; }
.hud-round small { font-size: 12px; font-weight: 600; color: var(--muted); }
.dots { display: flex; gap: 4px; flex: 1; }
.dots i { flex: 1; height: 8px; max-width: 34px; border-radius: 99px; border: 1.5px solid #000; background: #fff; }
.dots i.done { background: #000; }
.dots i.now { background: var(--yellow); }
.icon-btn {
  width: 48px; height: 48px; border-radius: 50%; border: var(--bd); background: #fff; box-shadow: 2px 2px 0 #000;
  display: grid; place-items: center; cursor: pointer; padding: 0; color: var(--yellow); touch-action: manipulation;
}
.icon-btn[aria-pressed="true"] { background: var(--yellow-soft); }
.icon-btn:active { transform: translate(2px, 2px); box-shadow: none; }

/* ------------------------------------------------------------ setup */
.setup { gap: 18px; }
.hero { display: flex; flex-direction: column; gap: 10px; padding-top: 4px; }
.hero-art { position: relative; height: 104px; }
.bubble-art {
  position: absolute; background: #fff; border: var(--bd); border-radius: 22px; padding: 8px 14px;
  font-weight: 700; font-size: 15px; box-shadow: 3px 3px 0 #000; white-space: nowrap;
}
.bubble-art.b1 { left: 0; top: 8px; background: var(--blue-soft); rotate: -3deg; animation: float-a 5s ease-in-out infinite; }
.bubble-art.b2 { left: 34%; top: 62px; background: var(--pink); rotate: 3deg; animation: float-a 5s ease-in-out infinite -2.5s; }
.bubble-art::after {
  content: ''; position: absolute; bottom: -9px; left: 22px; width: 14px; height: 14px; background: inherit;
  border-right: var(--bd); border-bottom: var(--bd); transform: rotate(45deg);
}
.hero-icon { position: absolute; right: 0; top: 6px; width: 92px; animation: wiggle 4s ease-in-out infinite; }
@keyframes float-a { 0%, 100% { translate: 0 0; } 50% { translate: 0 -5px; } }
@keyframes wiggle { 0%, 100% { rotate: -6deg; } 50% { rotate: 6deg; } }
.hl { position: relative; white-space: nowrap; z-index: 0; }
.hl::before {
  content: ''; position: absolute; left: -4px; right: -6px; bottom: .1em; height: .34em; z-index: -1;
  background: var(--pink); border-radius: 8px; rotate: -1.5deg;
}

.resume { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; background: var(--blue-soft); }

.setup-form { display: flex; flex-direction: column; gap: 14px; box-shadow: var(--shadow); }
.names { display: flex; flex-direction: column; gap: 6px; }
.amp { align-self: center; font-weight: 800; font-size: 22px; line-height: 1; }
.name-field {
  display: flex; align-items: center; gap: 12px; padding: 8px 16px 8px 8px; min-height: 64px;
  border: var(--bd); border-radius: 999px; background: #fff; cursor: text;
}
.name-field:focus-within { box-shadow: 0 0 0 4px var(--pc); }
.name-field .avatar { width: 46px; height: 46px; font-size: 20px; }
.nf-text { display: flex; flex-direction: column; flex: 1; min-width: 0; }
.nf-label { font-size: 12px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); }
.name-field input {
  font: 700 20px/1.2 var(--font); border: 0; padding: 0; margin: 0; background: transparent; width: 100%; min-width: 0; color: #000;
  outline: none;
}
.name-field input::placeholder { color: #000; opacity: .38; }
.link-btn {
  align-self: center; display: inline-flex; align-items: center; gap: 8px; min-height: 48px; padding: 6px 14px;
  background: none; border: 0; font-weight: 700; font-size: 15px; cursor: pointer; text-decoration: underline; text-underline-offset: 3px;
  touch-action: manipulation;
}
.lengths { border: 0; padding: 0; margin: 0; min-width: 0; }
.lengths legend { padding: 0; margin-bottom: 8px; }
.seg { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.seg-opt { position: relative; cursor: pointer; }
.seg-opt input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; }
.seg-opt span {
  display: flex; flex-direction: column; align-items: center; justify-content: center; min-height: 60px; padding: 6px;
  border: var(--bd); border-radius: 18px; background: #fff; text-align: center; line-height: 1.15; transition: transform .12s var(--ease-bounce);
}
.seg-opt b { font-size: 16px; }
.seg-opt small { font-size: 12px; color: var(--muted); font-weight: 600; }
.seg-opt input:checked + span { background: var(--yellow); box-shadow: 3px 3px 0 #000; transform: translate(-1px, -1px); }
.seg-opt input:checked + span small { color: #000; }
.seg-opt input:focus-visible + span { outline: 3px solid var(--blue-hover); outline-offset: 3px; }

.switch { display: flex; align-items: center; gap: 12px; min-height: 48px; cursor: pointer; font-weight: 600; position: relative; }
.switch input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.switch-track { width: 54px; height: 32px; border: var(--bd); border-radius: 99px; background: #fff; position: relative; flex: none; transition: background .2s; }
.switch-track span { position: absolute; top: 3px; left: 3px; width: 22px; height: 22px; border-radius: 50%; background: #000; transition: transform .2s var(--ease-bounce); }
.switch input:checked + .switch-track { background: var(--blue); }
.switch input:checked + .switch-track span { transform: translateX(22px); background: #fff; border: 2px solid #000; }
.switch input:focus-visible + .switch-track { outline: 3px solid var(--blue-hover); outline-offset: 3px; }
.switch small { font-weight: 500; }

.how { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.how li { display: flex; align-items: center; gap: 12px; font-size: 15px; line-height: 1.35; }
.how img { width: 44px; height: 44px; flex: none; }

/* ------------------------------------------------------------ coin flip + intro + halftime */
.coin, .intro, .halftime { text-align: center; align-items: center; }
.coin > *, .halftime > * { max-width: 100%; }
.coin-wrap { perspective: 600px; padding-top: 12px; }
.coin-face { animation: coin 1.1s cubic-bezier(.2, .8, .3, 1.2) both; }
@keyframes coin { from { transform: rotateY(1080deg) translateY(-30px) scale(.6); } to { transform: none; } }
.coin .lede { max-width: 34ch; }
.tipcard { display: flex; align-items: center; gap: 12px; text-align: left; background: var(--yellow-soft); width: 100%; padding: 14px 16px; }
.tipcard img { width: 48px; height: 48px; flex: none; }
.tipcard p { font-size: 15px; line-height: 1.4; }

.intro { justify-content: center; }
.intro-card {
  width: 100%; display: flex; flex-direction: column; align-items: center; gap: 14px; padding: 34px 20px 24px;
  margin-top: 14px; position: relative; background: #fff;
}
.intro-card::before {
  content: ''; position: absolute; inset: 0 0 auto 0; height: 76px; border-radius: calc(var(--r) - 2px) calc(var(--r) - 2px) 0 0;
  background: var(--pc); border-bottom: var(--bd);
}
.intro-card .avatar.xl { position: relative; animation: pop-in .5s var(--ease-bounce) both; }
.round-tag {
  position: absolute; top: -16px; left: 50%; translate: -50% 0; z-index: 2; background: var(--yellow); border: var(--bd);
  border-radius: 999px; padding: 4px 16px; font-weight: 800; font-size: 15px; white-space: nowrap; box-shadow: 2px 2px 0 #000;
}
.lookaway { font-size: 17px; max-width: 32ch; }
.intro-fmt { display: flex; align-items: center; gap: 10px; font-size: 14px; flex-wrap: wrap; justify-content: center; }
@keyframes pop-in { from { transform: scale(.4); opacity: 0; } to { transform: none; opacity: 1; } }

.ht-card { display: flex; flex-direction: column; align-items: center; gap: 12px; text-align: center; width: 100%; margin-top: 30px; position: relative; padding-top: 48px; }
.ht-icon { width: 76px; position: absolute; top: -38px; left: 50%; translate: -50% 0; animation: wiggle 3s ease-in-out infinite; }
.timer { position: relative; width: 132px; height: 132px; margin: 4px 0; }
.timer svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.timer circle { fill: none; stroke-width: 12; }
.t-bg { stroke: var(--pink-soft); }
.t-fg { stroke: var(--pink); stroke-dasharray: 100; stroke-dashoffset: 0; stroke-linecap: round; }
.timer::after { content: ''; position: absolute; inset: 0; border-radius: 50%; border: var(--bd); pointer-events: none; }
.timer::before { content: ''; position: absolute; inset: 22px; border-radius: 50%; border: var(--bd); background: #fff; }
.t-num { position: absolute; inset: 0; display: grid; place-items: center; font-weight: 800; font-size: 34px; font-variant-numeric: tabular-nums; }
.timer.done .t-num { font-size: 22px; animation: pop-in .4s var(--ease-bounce); }

/* ------------------------------------------------------------ speech bubble */
.role-row { display: flex; align-items: center; justify-content: space-between; gap: 8px; flex-wrap: wrap; }
.role-row { flex-wrap: nowrap; }
.role-chip {
  display: inline-flex; align-items: center; gap: 6px; padding: 3px 12px 3px 3px; border: var(--bd); border-radius: 999px;
  background: var(--pc); font-weight: 700; font-size: 13px; min-width: 0; white-space: nowrap;
}
.role-chip > span:last-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.role-chip .avatar { background: #fff; }

.bubble {
  position: relative; background: #fff; border: var(--bd); border-radius: var(--r-lg);
  padding: 30px 20px 22px; box-shadow: var(--shadow); margin: 12px 0 10px;
}
.bubble::after {
  content: ''; position: absolute; left: 38px; bottom: -11px; width: 20px; height: 20px; background: #fff;
  border-right: var(--bd); border-bottom: var(--bd); transform: rotate(45deg); border-bottom-right-radius: 4px;
}
.bubble-tag {
  position: absolute; top: -17px; left: 16px; display: inline-flex; align-items: center; gap: 6px; max-width: calc(100% - 32px);
  padding: 3px 14px 3px 3px; border: var(--bd); border-radius: 999px; background: var(--pc); font-weight: 700; font-size: 14px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.bubble-tag .avatar { background: #fff; }
.bubble-text { font-size: clamp(22px, 6.4vw, 28px); font-weight: 700; line-height: 1.25; letter-spacing: -.015em; }
.bubble.small { padding: 26px 18px 16px; }
.bubble.small .bubble-text { font-size: 19px; }
.scale-note { display: block; font-size: 13px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); margin-bottom: 4px; }
.blank-line { color: var(--muted); letter-spacing: -.05em; }
.hint { font-size: 15px; font-weight: 600; color: var(--muted); text-align: center; }

/* builder sentence slots */
.sentence { line-height: 1.75; }
.slot {
  display: inline-flex; align-items: center; justify-content: center; vertical-align: middle;
  min-width: 96px; min-height: 46px; margin: 2px 0; padding: 4px 12px;
  border: 2px dashed #000; border-radius: 14px; background: var(--beige);
  font: inherit; font-size: .82em; line-height: 1.15; letter-spacing: 0; text-align: center; cursor: pointer; touch-action: manipulation;
  transition: background .15s, transform .15s var(--ease-bounce);
}
.slot.active { border-style: solid; background: var(--yellow-soft); box-shadow: 0 0 0 3px var(--yellow); }
.slot.filled { border-style: solid; background: var(--pc, var(--orange)); }
.slot.filled.active { box-shadow: 0 0 0 3px #000; }
.slot.pop { animation: pop-in .35s var(--ease-bounce); }
.slot.static { cursor: default; min-width: 0; min-height: 0; padding: 1px 10px; margin: 2px 0; background: var(--yellow-soft); font-size: .92em; }
.slot.static.judged.match { background: #c9f0c1; }
.slot.static.judged.match::after { content: '✓'; margin-left: 6px; font-weight: 800; }
.slot.static.judged.nomatch { background: var(--beige); }

.tray-label { display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px; }
.tray-dots { display: flex; gap: 6px; }
.tray-dots i { width: 12px; height: 12px; border-radius: 50%; border: 2px solid #000; background: #fff; }
.tray-dots i.on { background: var(--yellow); }
.tray-dots i.done { background: #000; }
.chips { display: flex; flex-wrap: wrap; gap: 10px; }
.chip {
  min-height: 48px; padding: 10px 16px; border: var(--bd); border-radius: 999px; background: #fff; cursor: pointer;
  font-weight: 600; font-size: 16px; line-height: 1.2; box-shadow: 2px 2px 0 #000; touch-action: manipulation;
  transition: transform .12s var(--ease-bounce), box-shadow .12s, background .15s; animation: chip-in .3s var(--ease-bounce) both;
}
.chip:nth-child(2) { animation-delay: .03s; } .chip:nth-child(3) { animation-delay: .06s; } .chip:nth-child(4) { animation-delay: .09s; }
.chip:nth-child(5) { animation-delay: .12s; } .chip:nth-child(6) { animation-delay: .15s; }
@keyframes chip-in { from { opacity: 0; transform: translateY(8px) scale(.9); } }
.chip:active { transform: translate(2px, 2px); box-shadow: none; }
.chip[aria-pressed="true"] { background: var(--pc); }

/* multiple choice */
.options { display: flex; flex-direction: column; gap: 10px; }
.opt {
  display: flex; align-items: center; gap: 12px; width: 100%; min-height: 60px; padding: 8px 14px 8px 8px; text-align: left;
  border: var(--bd); border-radius: 20px; background: #fff; box-shadow: 3px 3px 0 #000; cursor: pointer;
  font-weight: 600; font-size: 17px; line-height: 1.25; touch-action: manipulation;
  transition: transform .12s var(--ease-bounce), box-shadow .12s, background .15s;
}
.opt-letter { width: 40px; height: 40px; flex: none; border-radius: 50%; border: var(--bd); display: grid; place-items: center; font-weight: 800; background: var(--beige); }
.opt[aria-pressed="true"] { background: var(--pc); transform: translate(2px, 2px); box-shadow: 1px 1px 0 #000; }
.opt[aria-pressed="true"] .opt-letter { background: #000; color: #fff; }
.opt:active { transform: translate(3px, 3px); box-shadow: none; }

/* this or that */
.tot { position: relative; display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.tot-opt {
  min-height: 160px; padding: 16px 12px; border: var(--bd); border-radius: 28px; background: #fff; box-shadow: var(--shadow); cursor: pointer;
  font-weight: 800; font-size: clamp(19px, 5.4vw, 24px); line-height: 1.15; letter-spacing: -.02em; touch-action: manipulation;
  transition: transform .15s var(--ease-bounce), box-shadow .15s, background .15s;
}
.tot-opt:nth-of-type(1) { rotate: -1.5deg; }
.tot-opt:nth-of-type(2) { rotate: 1.5deg; }
.tot-opt[aria-pressed="true"] { background: var(--pc); transform: translate(3px, 3px) scale(1.02); box-shadow: 1px 1px 0 #000; }
.tot-opt:active { transform: translate(4px, 4px); box-shadow: none; }
.tot-or {
  position: absolute; left: 50%; top: 50%; translate: -50% -50%; z-index: 2; width: 46px; height: 46px; border-radius: 50%;
  border: var(--bd); background: var(--yellow); display: grid; place-items: center; font-weight: 800; font-size: 16px; pointer-events: none;
}

/* true / false */
.tf { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.tf-opt {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; min-height: 150px; padding: 14px 8px;
  border: var(--bd); border-radius: 28px; background: #fff; box-shadow: var(--shadow); cursor: pointer; touch-action: manipulation;
  transition: transform .15s var(--ease-bounce), box-shadow .15s, background .15s;
}
.tf-opt svg { width: 46px; height: 46px; padding: 6px; border: var(--bd); border-radius: 50%; background: var(--beige); }
.tf-opt b { font-size: 24px; font-weight: 800; }
.tf-opt small { font-size: 14px; color: var(--muted); font-weight: 600; }
.tf-opt[aria-pressed="true"] { background: var(--pc); transform: translate(3px, 3px); box-shadow: 1px 1px 0 #000; }
.tf-opt[aria-pressed="true"] small { color: #000; }
.tf-opt[aria-pressed="true"] svg { background: #fff; }
.tf-opt:active { transform: translate(4px, 4px); box-shadow: none; }

/* 1–10 slider */
.slider-wrap { display: flex; flex-direction: column; gap: 6px; }
.slider-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.slider-readout { display: flex; flex-direction: column; align-items: center; line-height: 1; flex: 1; min-width: 0; text-align: center; }
.slider-readout b { font-size: 64px; font-weight: 800; letter-spacing: -.05em; font-variant-numeric: tabular-nums; }
.slider-readout span { font-weight: 700; font-size: 16px; min-height: 1.3em; margin-top: 4px; }
.slider-readout.bump b { animation: bump .3s var(--ease-bounce); }
.slider { position: relative; height: 68px; margin: 0 28px; touch-action: pan-y; cursor: pointer; --pct: 44.44%; -webkit-user-select: none; user-select: none; }
.slider:focus-visible { outline: none; }
.slider:focus-visible .slider-thumb { outline: 3px solid var(--blue-hover); outline-offset: 3px; }
.slider-track { position: absolute; left: 0; right: 0; top: 50%; height: 18px; translate: 0 -50%; border: var(--bd); border-radius: 99px; background: #fff; }
.slider-fill { position: absolute; left: 0; top: 0; bottom: 0; width: var(--pct); background: var(--pc); border-radius: 99px; transition: width .15s var(--ease-bounce); }
.slider-track i { position: absolute; top: 50%; width: 4px; height: 4px; border-radius: 50%; background: #000; translate: -50% -50%; }
.slider-thumb {
  position: absolute; top: 50%; left: var(--pct); width: 56px; height: 56px; translate: -50% -50%;
  border: var(--bd); border-radius: 50%; background: var(--yellow); box-shadow: var(--shadow);
  display: grid; place-items: center; font-weight: 800; font-size: 22px; transition: left .15s var(--ease-bounce), scale .15s;
}
.slider.dragging .slider-thumb { scale: 1.1; }
.slider.dragging .slider-thumb, .slider.dragging .slider-fill { transition: none; }
.slider-ends { display: flex; justify-content: space-between; gap: 12px; font-size: 14px; font-weight: 600; color: var(--muted); }
.slider-ends span:last-child { text-align: right; }
.slider-ends b { color: #000; }
.step-btn {
  width: 52px; height: 52px; border-radius: 50%; border: var(--bd); background: #fff; box-shadow: 2px 2px 0 #000;
  font-size: 26px; font-weight: 700; line-height: 1; cursor: pointer; touch-action: manipulation; flex: none;
}
.step-btn:active { transform: translate(2px, 2px); box-shadow: none; }

.lock { background: var(--pc); }

/* ------------------------------------------------------------ pass the phone */
.pass {
  position: fixed; inset: 0; z-index: 100; overflow-y: auto; overscroll-behavior: contain;
  display: grid; place-items: center; text-align: center;
  padding: max(24px, env(safe-area-inset-top)) max(20px, env(safe-area-inset-right)) max(24px, env(safe-area-inset-bottom)) max(20px, env(safe-area-inset-left));
  background-color: var(--pc);
  background-image: radial-gradient(rgba(0, 0, 0, .13) 2px, transparent 2.5px);
  background-size: 26px 26px;
  animation: pass-in .35s ease-out both;
}
@keyframes pass-in { from { opacity: 0; } }
.pass-inner {
  width: 100%; max-width: 420px; display: flex; flex-direction: column; align-items: center; gap: 16px;
  background: var(--beige); border: var(--bd); border-radius: var(--r-lg); box-shadow: var(--shadow-lg); padding: 28px 20px 22px;
  animation: screen-in .45s var(--ease-bounce) both .05s;
}
.pass-lock { width: 84px; height: 84px; border-radius: 50%; border: var(--bd); background: var(--yellow); display: grid; place-items: center; margin-top: -70px; box-shadow: var(--shadow); animation: wiggle 2.4s ease-in-out infinite; }
.pass-lock svg { width: 52px; height: 52px; }
.pass-h { font-size: clamp(26px, 7.4vw, 34px); font-weight: 800; letter-spacing: -.03em; }
.pass-h span { display: inline-block; font-size: 1.3em; background: var(--pc); border: var(--bd); border-radius: 18px; padding: 0 14px; margin-top: 8px; rotate: -2deg; overflow-wrap: anywhere; }
.pass-hands { display: flex; align-items: center; gap: 10px; }
.pass-hands svg { animation: nudge 1.2s ease-in-out infinite; }
.pass-h span.long { font-size: 1em; padding: 2px 12px; }
@keyframes nudge { 50% { translate: 8px 0; } }
.pass-sub { font-size: 16px; color: var(--muted); max-width: 32ch; }
.hold {
  position: relative; overflow: hidden; isolation: isolate;
  -webkit-user-select: none; user-select: none; -webkit-touch-callout: none; touch-action: none;
}
.hold-fill { position: absolute; inset: 0; z-index: -1; background: var(--yellow); transform: scaleX(var(--p, 0)); transform-origin: left center; }
.hold.holding { transform: translate(4px, 4px); box-shadow: 0 0 0 #000; }
.hold.full { animation: bump .35s var(--ease-bounce); }
.hold-label { pointer-events: none; }

/* ------------------------------------------------------------ reveal */
.reveal { gap: 14px; }
.reveal > .kicker { margin-bottom: -4px; }
.rv-grid { display: grid; gap: 12px; }
.rv-grid.two { grid-template-columns: 1fr 1fr; }
.rv-card {
  position: relative; border: var(--bd); border-radius: var(--r); background: #fff; padding: 14px; min-height: 124px;
  display: flex; flex-direction: column; gap: 8px; text-align: left; box-shadow: var(--shadow); min-width: 0;
}
.rv-label { display: flex; align-items: center; gap: 6px; font-size: 13px; font-weight: 700; color: var(--muted); line-height: 1.2; }
.rv-text { font-size: 21px; font-weight: 800; line-height: 1.2; letter-spacing: -.01em; }
.rv-big { font-size: 54px; font-weight: 800; line-height: 1; letter-spacing: -.04em; margin: auto 0; }
.rv-big small { font-size: 18px; color: var(--muted); letter-spacing: 0; }
.rv-word { font-size: 38px; }
.rv-sentence { font-size: 19px; font-weight: 700; line-height: 1.6; }
.rv-grid.two .rv-card { align-items: center; text-align: center; }
.rv-grid.two .rv-label { flex-direction: column; justify-content: center; text-align: center; gap: 4px; }
.rv-grid.two .rv-text { font-size: 19px; margin: auto 0; }

.flip-slot { display: flex; flex-direction: column; min-width: 0; }
.flip-slot > * { flex: 1; }
.flip-front {
  position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px;
  min-height: 124px; padding: 14px 10px; border: var(--bd); border-radius: var(--r); box-shadow: var(--shadow); cursor: pointer;
  background-color: var(--pc); background-image: radial-gradient(rgba(255, 255, 255, .55) 2.5px, transparent 3px); background-size: 20px 20px;
  font: inherit; color: #000; text-align: center; touch-action: manipulation; animation: tease 1.8s ease-in-out infinite;
}
.flip-front:active { transform: translate(3px, 3px); box-shadow: 1px 1px 0 #000; }
@keyframes tease { 0%, 100% { rotate: 0deg; } 15% { rotate: -1.8deg; } 30% { rotate: 1.8deg; } 45% { rotate: 0deg; } }
.ff-logo { width: 64px; background: #fff; border: var(--bd); border-radius: 999px; padding: 3px 9px; box-sizing: content-box; }
.ff-q { font-size: 34px; font-weight: 800; line-height: 1; width: 50px; height: 50px; border-radius: 50%; display: grid; place-items: center; background: #fff; border: var(--bd); }
.ff-cta { font-weight: 800; font-size: 14px; background: #fff; border: var(--bd); border-radius: 999px; padding: 4px 12px; line-height: 1.2; }
.flip-slot { perspective: 800px; }
.flip-slot.flip-out > * { animation: flip-out .23s ease-in forwards; }
.flip-slot.flip-in > * { animation: flip-in .45s var(--ease-bounce) both; }
@keyframes flip-out { to { transform: rotateY(90deg) scale(1.04); } }
@keyframes flip-in { from { transform: rotateY(-90deg) scale(1.04); } to { transform: none; } }
.rv-grid.two .flip-slot .rv-card { align-items: center; text-align: center; }
.reveal-hint { text-align: center; font-weight: 700; color: var(--muted); font-size: 15px; animation: float-a 2s ease-in-out infinite; }

.numline { position: relative; height: 96px; margin: 0 20px; opacity: 0; transition: opacity .4s; }
.numline.show { opacity: 1; }
.nl-track { position: absolute; left: -18px; right: -18px; top: 32px; height: 32px; border: var(--bd); border-radius: 99px; background: #fff; }
.nl-tick { position: absolute; top: 32px; height: 32px; width: 20px; translate: -50% 0; display: grid; place-items: center; font-size: 12px; font-weight: 700; }
.nl-mark {
  position: absolute; translate: -50% 0; width: 32px; height: 32px; border-radius: 50%; border: var(--bd); background: var(--pc);
  display: grid; place-items: center; font-weight: 800; font-size: 14px; box-shadow: 2px 2px 0 #000;
}
.nl-mark.guess { top: 0; }
.nl-mark.answer { bottom: 0; }
.numline.show .nl-mark { animation: pop-in .45s var(--ease-bounce) both; }
.numline.show .nl-mark.answer { animation-delay: .15s; }

.verdict {
  display: flex; align-items: center; gap: 16px; padding: 16px; border: var(--bd); border-radius: var(--r); box-shadow: var(--shadow);
  background: #fff; animation: verdict-in .5s var(--ease-bounce) both;
}
.verdict[hidden] { display: none; }
.verdict.perfect { background: var(--yellow-soft); }
.verdict.close { background: var(--blue-soft); }
.verdict.miss { background: var(--pink-soft); }
.verdict h3 { font-size: 26px; font-weight: 800; letter-spacing: -.03em; margin-bottom: 4px; }
.verdict p { font-size: 16px; line-height: 1.4; }
.verdict p.small { font-size: 13px; margin-top: 6px; }
.stamp {
  flex: none; width: 76px; height: 76px; border-radius: 50%; border: var(--bd); display: grid; place-items: center;
  font-size: 26px; font-weight: 800; letter-spacing: -.04em; background: var(--yellow); box-shadow: 3px 3px 0 #000; rotate: -10deg;
  animation: stamp .55s var(--ease-bounce) both .1s;
}
.verdict.close .stamp { background: var(--blue); }
.verdict.miss .stamp { background: var(--pink); }
@keyframes verdict-in { from { opacity: 0; transform: translateY(16px) scale(.96); } }
@keyframes stamp { from { transform: scale(2.2); opacity: 0; } }

/* ------------------------------------------------------------ end */
.end { gap: 20px; }
.end-head { position: relative; text-align: center; display: flex; flex-direction: column; gap: 10px; align-items: center; padding-top: 10px; }
.end-confetti { position: absolute; inset: -10px -16px auto; width: calc(100% + 32px); max-width: none; height: 120%; object-fit: cover; z-index: -1; opacity: .9; }
.end-head .title { font-size: clamp(34px, 10vw, 50px); }
.end-head .lede { max-width: 36ch; }
.scoreboard { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.sb-card { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 4px; padding: 16px 10px; min-width: 0; }
.sb-name { font-weight: 800; font-size: 18px; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; margin-top: 4px; }
.sb-score b { font-size: 40px; font-weight: 800; letter-spacing: -.04em; line-height: 1; }
.sb-score small { font-size: 16px; color: var(--muted); font-weight: 700; }
.sb-bar { width: 100%; height: 12px; border: var(--bd); border-radius: 99px; background: var(--beige); overflow: hidden; margin: 4px 0; }
.sb-bar i { display: block; height: 100%; background: var(--pc); border-right: 2px solid #000; animation: grow 1s var(--ease-bounce) both .3s; }
.sb-bar i[style*="width:0%"] { border-right: 0; }
@keyframes grow { from { width: 0; } }
.sb-award { font-weight: 800; font-size: 14px; background: var(--yellow); border: var(--bd); border-radius: 999px; padding: 2px 10px; margin-top: 4px; line-height: 1.3; }
.sb-line { font-size: 13px; color: var(--muted); line-height: 1.35; }

.cert {
  position: relative; background: #fff; border: var(--bd); border-radius: var(--r-lg); box-shadow: var(--shadow-lg);
  padding: 26px 22px 22px; text-align: center; display: flex; flex-direction: column; align-items: center; gap: 6px;
  animation: cert-in .7s var(--ease-bounce) both .2s;
}
.cert::before { content: ''; position: absolute; inset: 9px; border: 2px dashed rgba(0, 0, 0, .35); border-radius: calc(var(--r-lg) - 8px); pointer-events: none; }
@keyframes cert-in { from { opacity: 0; transform: translateY(24px) rotate(-3deg) scale(.95); } }
.cert-corner { position: absolute; width: 56px; top: 16px; }
.cert-corner.c1 { left: 16px; rotate: -12deg; }
.cert-corner.c2 { right: 16px; rotate: 12deg; }
.cert-logo { width: 170px; margin: -6px 0 2px; }
.cert-small { font-size: 15px; color: var(--muted); }
.cert-names { font-size: clamp(24px, 7vw, 32px); font-weight: 800; letter-spacing: -.03em; line-height: 1.1; overflow-wrap: anywhere; }
.cert-names span { color: var(--orange); }
.cert-title {
  font-size: clamp(28px, 8.6vw, 40px); font-weight: 800; letter-spacing: -.035em; line-height: 1.05; margin: 6px 0 4px;
  background: var(--pink); border: var(--bd); border-radius: 18px; padding: 6px 16px; rotate: -1.5deg; box-shadow: 3px 3px 0 #000;
}
.cert-why { font-size: 15px; max-width: 34ch; line-height: 1.4; }
.cert-meter { display: inline-flex; align-items: center; gap: 10px; margin-top: 8px; border: var(--bd); border-radius: 999px; padding: 4px 6px 4px 14px; font-weight: 700; font-size: 14px; }
.cert-meter b { background: var(--yellow); border: var(--bd); border-radius: 999px; padding: 0 10px; font-size: 16px; }
.cert-foot { display: grid; grid-template-columns: 1fr auto 1fr; align-items: end; gap: 10px; width: 100%; margin-top: 14px; }
.cert-foot > div { display: flex; flex-direction: column; align-items: center; gap: 2px; min-width: 0; }
.cert-line { font-weight: 700; font-size: 13px; border-bottom: 2px solid #000; padding-bottom: 4px; width: 100%; min-height: 34px; display: flex; align-items: flex-end; justify-content: center; line-height: 1.2; }
.cert-sig { width: 100%; max-width: 120px; height: 34px; border-bottom: 2px solid #000; padding-bottom: 2px; }
.cert-foot small { font-size: 11px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.cert-seal { width: 58px; }

.facts ul { list-style: none; margin: 10px 0 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.facts li { display: flex; gap: 10px; align-items: flex-start; font-size: 15px; line-height: 1.4; }
.facts li .avatar { margin-top: 1px; }
.facts .q { color: var(--muted); }
.facts b { font-weight: 800; }

.end-actions { display: flex; flex-direction: column; gap: 12px; position: static; background: none; padding: 4px 0 0; margin-top: 0; }
.end > .facts { margin-bottom: max(24px, env(safe-area-inset-bottom)); }
.end-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.end-row .btn { padding: 12px 10px; font-size: 16px; }

/* ------------------------------------------------------------ confetti */
.confetti { position: fixed; inset: 0; width: 100%; height: 100%; pointer-events: none; z-index: 200; }

/* ------------------------------------------------------------ phones: keep each step on one screen */
@media (max-width: 699px) {
  .screen { gap: 12px; }
  .screen.input { gap: 10px; }
  .bubble { margin: 14px 0 8px; padding: 26px 18px 18px; }
  .hint { font-size: 14px; }
  .tot-opt, .tf-opt { min-height: 132px; }
  .chips { gap: 8px; }
  .chip { padding: 9px 14px; font-size: 15.5px; }
}
@media (max-width: 699px) and (max-height: 720px) {
  .site-header { padding-bottom: 10px; }
  .bubble { margin: 12px 0 6px; }
  .bubble-text { font-size: 21px; }
  .tot-opt, .tf-opt { min-height: 112px; }
  .tf-opt svg { width: 38px; height: 38px; }
  .slider-readout b { font-size: 54px; }
  .opt { min-height: 52px; }
  .options { gap: 8px; }
  .actions { padding-top: 12px; }
  .btn-big { min-height: 56px; }
}

/* ------------------------------------------------------------ small phones */
@media (max-width: 360px) {
  .hero-icon { display: none; }
  .bubble-art { font-size: 14px; }
  .tot-opt, .tf-opt { min-height: 130px; }
  .rv-big { font-size: 44px; }
  .scoreboard { gap: 8px; }
}

/* ------------------------------------------------------------ desktop niceties */
@media (min-width: 700px) {
  .shell { padding-top: max(18px, env(safe-area-inset-top)); }
  .names { flex-direction: row; align-items: center; }
  .names .name-field { flex: 1; min-width: 0; }
  .how { flex-direction: row; gap: 14px; }
  .how li { flex: 1; flex-direction: column; text-align: center; }
  .shell { max-width: 640px; }
  .screen { gap: 18px; justify-content: center; padding-bottom: 32px; }
  .actions { margin-top: 6px; padding-top: 14px; }
  .bubble-text { font-size: 30px; }
  .bubble.small .bubble-text { font-size: 22px; }
  .tot-opt, .tf-opt { min-height: 180px; }
  .hint { font-size: 16px; }
  .chip { font-size: 17px; }
}

/* ------------------------------------------------------------ short landscape phones */
@media (max-height: 500px) {
  .site-header { padding-bottom: 8px; }
  .hud { gap: 6px; margin-bottom: 8px; }
  .screen, .screen.input { gap: 10px; padding-bottom: 0; justify-content: flex-start; }
  .hero-art { display: none; }
  .bubble { margin: 12px 0 6px; padding: 24px 18px 14px; }
  .bubble-text { font-size: 21px; }
  .bubble.small .bubble-text { font-size: 18px; }
  .tot-opt, .tf-opt { min-height: 96px; }
  .tf-opt svg { width: 36px; height: 36px; }
  .options { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
  .opt { min-height: 52px; }
  .slider-readout b { font-size: 46px; }
  .intro-card { gap: 8px; padding: 26px 20px 16px; }
  .intro-card::before { height: 56px; }
  .avatar.xl { width: 64px; height: 64px; font-size: 30px; }
  .coin-wrap { padding-top: 0; }
  .actions { padding-top: 10px; padding-bottom: max(10px, env(safe-area-inset-bottom)); }
  .btn-big { min-height: 52px; }
  .pass { place-items: start center; }
  .pass-inner { gap: 10px; margin-top: 44px; padding: 20px 20px 16px; }
  .pass-hands, .pass-sub { display: none; }
  .pass-lock { width: 64px; height: 64px; margin-top: -52px; }
  .pass-lock svg { width: 40px; height: 40px; }
  .ht-card { gap: 8px; }
  .timer { width: 104px; height: 104px; }
  .timer::before { inset: 18px; }
  .t-num { font-size: 28px; }
}

/* ------------------------------------------------------------ delight layer */
.history-nod {
  display: flex; align-items: center; gap: 10px; font-size: 14px; line-height: 1.35; font-weight: 600;
  background: #fff; border: var(--bd); border-radius: 18px; padding: 8px 12px 8px 8px; box-shadow: 2px 2px 0 #000; rotate: -.6deg;
}
.history-nod img { width: 36px; height: 36px; flex: none; }

.bubble-art.swap { animation: bubble-swap .5s var(--ease-bounce) both, float-a 5s ease-in-out infinite .5s; }
.bubble-art.b2.out { animation: bubble-out .22s ease-in forwards; }
@keyframes bubble-swap { from { opacity: 0; transform: scale(.6) translateY(6px); } }
@keyframes bubble-out { to { opacity: 0; transform: scale(.7); } }
.hl::before { transform-origin: left center; animation: hl-swipe .6s var(--ease-bounce) both .35s; }
@keyframes hl-swipe { from { transform: scaleX(0); } }
.link-btn.spin svg { animation: dice .5s var(--ease-bounce); }
@keyframes dice { from { transform: rotate(-200deg) scale(.6); } }
.avatar.pop { animation: pop-in .4s var(--ease-bounce); }

.score-chip { position: relative; }
.score-chip .crown {
  position: absolute; left: 6px; top: -13px; rotate: -18deg; transform: scale(0); transform-origin: 50% 100%;
  transition: transform .35s var(--ease-bounce); pointer-events: none;
}
.score-chip.lead .crown { transform: scale(1); }
.float-pts {
  position: absolute; right: 2px; top: -6px; z-index: 3; pointer-events: none;
  font-weight: 800; font-size: 15px; background: var(--yellow); border: var(--bd); border-radius: 999px; padding: 0 8px; line-height: 1.5;
  animation: float-up 1.2s ease-out forwards;
}
@keyframes float-up { 0% { opacity: 0; transform: translateY(8px) scale(.6); } 20% { opacity: 1; transform: translateY(-6px) scale(1.1); } 100% { opacity: 0; transform: translateY(-30px) scale(1); } }

.opt.picked, .tot-opt.picked, .tf-opt.picked { animation: squish .35s var(--ease-bounce); }
@keyframes squish { 0% { scale: 1; } 35% { scale: .94 1.04; } 70% { scale: 1.03 .98; } 100% { scale: 1; } }
.lock.ready-pop { animation: ready-pop .5s var(--ease-bounce); }
@keyframes ready-pop { 0% { transform: scale(.96); } 45% { transform: scale(1.04) rotate(-1deg); } 100% { transform: none; } }

.flip-front.drumroll { animation: drumroll .56s linear both; }
@keyframes drumroll {
  0%, 100% { transform: none; } 10% { transform: translate(-2px, 1px) rotate(-1.5deg); } 20% { transform: translate(2px, -1px) rotate(1.5deg); }
  30% { transform: translate(-3px, 0) rotate(-2deg); } 40% { transform: translate(3px, 1px) rotate(2deg); } 50% { transform: translate(-3px, -1px) rotate(-2.5deg); }
  60% { transform: translate(3px, 0) rotate(2.5deg); } 70% { transform: translate(-4px, 1px) rotate(-3deg) scale(1.02); } 80% { transform: translate(4px, -1px) rotate(3deg) scale(1.04); }
  90% { transform: scale(1.06); }
}
.streak {
  display: inline-block; margin-top: 8px; font-weight: 800; font-size: 14px !important; line-height: 1.3 !important;
  background: var(--yellow); border: var(--bd); border-radius: 12px; padding: 3px 10px; rotate: -1deg;
  animation: pop-in .45s var(--ease-bounce) both .35s;
}
.verdict.miss .stamp { animation: stamp .55s var(--ease-bounce) both .1s, wobble 1.2s ease-in-out .7s; }
@keyframes wobble { 25% { rotate: -18deg; } 50% { rotate: -2deg; } 75% { rotate: -14deg; } }
.cert-title.stamped { animation: cert-stamp .5s var(--ease-bounce) both; }
@keyframes cert-stamp { 0% { opacity: 0; transform: scale(1.7) rotate(6deg); } 60% { opacity: 1; } 100% { transform: none; } }
.cert-seal { animation: seal-spin 1s var(--ease-bounce) both .6s; }
@keyframes seal-spin { from { transform: rotate(-180deg) scale(.3); opacity: 0; } }

@media (prefers-reduced-motion: reduce) {
  .bubble-art.swap, .bubble-art.b2.out, .flip-front.drumroll, .float-pts { animation: none !important; }
  .float-pts { display: none; }
  .deco img, .hero-icon, .bubble-art, .pass-lock, .flip-front, .reveal-hint, .pass-hands svg, .ht-icon { animation: none !important; }
}

.ht-card .btn[disabled] { opacity: 1; background: var(--pink-soft); box-shadow: none; transform: translate(4px, 4px); }

/* ------------------------------------------------------------ QA pass: tap targets, long names, sticky bars */
.site-header .back { min-height: 44px; }
.big-h, .title, .pass-h, .rv-card, .lookaway, .cert-names { overflow-wrap: anywhere; }
.pass { grid-template-columns: minmax(0, 1fr); }
.pass-inner { min-width: 0; justify-self: center; }
/* halftime: the timer button must never sit under a pinned bar */
.halftime .actions { position: static; background: none; padding-top: 4px; }
/* setup: the start button sits right after the options instead of pinned over them */
.setup .setup-actions { position: static; background: none; margin-top: 0; padding: 0; }
.setup > :last-child { margin-bottom: max(24px, env(safe-area-inset-bottom)); }

/* ------------------------------------------------------------ mode toggle (couple / co-worker) */
.modes { border: 0; padding: 0; margin: 0; min-width: 0; }
.modes legend { padding: 0; margin-bottom: 8px; }
.mode-seg { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.mode-opt { position: relative; cursor: pointer; display: flex; }
.mode-opt input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; }
.mode-opt > span {
  flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; min-height: 96px;
  padding: 10px 8px; border: var(--bd); border-radius: 22px; background: #fff; text-align: center; line-height: 1.15;
  box-shadow: 2px 2px 0 #000; transition: transform .14s var(--ease-bounce), box-shadow .14s, background .15s;
}
.mode-opt b { font-size: 17px; font-weight: 800; letter-spacing: -.01em; }
.mode-opt small { font-size: 13px; font-weight: 600; color: var(--muted); }
.mode-opt svg { margin-bottom: 2px; }
.mode-opt.m-couple input:checked + span { background: var(--pink); }
.mode-opt.m-coworker input:checked + span { background: var(--blue); }
.mode-opt input:checked + span { box-shadow: var(--shadow); transform: translate(-2px, -2px) rotate(-1deg); }
.mode-opt.m-coworker input:checked + span { transform: translate(-2px, -2px) rotate(1deg); }
.mode-opt input:checked + span small { color: #000; }
.mode-opt input:checked + span svg { animation: pop-in .4s var(--ease-bounce); }
.mode-opt input:focus-visible + span { outline: 3px solid var(--blue-hover); outline-offset: 3px; }
.mode-opt:active > span { transform: translate(2px, 2px); box-shadow: none; }

/* ------------------------------------------------------------ player list */
.form-kicker { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.count-pill { font-size: 12px; letter-spacing: .06em; background: var(--yellow); border: var(--bd); border-radius: 999px; padding: 2px 10px; }
.name-row { display: flex; align-items: center; gap: 8px; min-width: 0; }
.name-row .name-field { flex: 1; min-width: 0; }
.names-work { gap: 8px; }
.names-work .name-field { min-height: 56px; padding: 6px 14px 6px 6px; gap: 10px; }
.names-work .name-field .avatar { width: 40px; height: 40px; font-size: 18px; }
.names-work .name-field input { font-size: 18px; }
.names-work .nf-label { font-size: 11px; }
.rm-btn {
  flex: none; width: 44px; height: 44px; border-radius: 50%; border: var(--bd); background: #fff; display: grid; place-items: center;
  cursor: pointer; padding: 0; box-shadow: 2px 2px 0 #000; touch-action: manipulation;
}
.rm-btn:active { transform: translate(2px, 2px); box-shadow: none; }
.rm-btn:focus-visible, .add-btn:focus-visible { outline: 3px solid var(--blue-hover); outline-offset: 3px; }
.add-btn {
  display: flex; align-items: center; justify-content: center; gap: 8px; width: 100%; min-height: 52px; padding: 8px 16px;
  border: 2px dashed #000; border-radius: 999px; background: var(--beige); font: inherit; font-weight: 800; font-size: 16px;
  cursor: pointer; touch-action: manipulation; color: #000;
}
.add-btn span { font-size: 24px; line-height: 1; }
.add-btn small { font-weight: 600; color: var(--muted); font-size: 13px; }
.add-btn:active { background: var(--yellow-soft); }
.full-note { text-align: center; }

/* ------------------------------------------------------------ co-worker HUD: a scrollable standings strip */
.hud-top.many { grid-template-columns: minmax(0, 1fr) 48px; }
.standings {
  display: flex; gap: 8px; min-width: 0; overflow-x: auto; overscroll-behavior-x: contain; scrollbar-width: none;
  padding: 14px 6px 6px 2px; margin: -14px 0 -6px -2px; scroll-padding: 0 8px;
}
.standings::-webkit-scrollbar { display: none; }
.score-chip.mini { flex: none; max-width: 10.5em; padding-left: 12px; }
.score-chip.mini .sc-name { font-size: 14px; }
.score-chip.mini .sc-num { min-width: 30px; height: 30px; font-size: 16px; }

/* ------------------------------------------------------------ co-worker intro + guess extras */
.handoff {
  align-self: center; display: inline-flex; align-items: center; gap: 8px; max-width: 100%;
  background: var(--yellow); border: var(--bd); border-radius: 999px; padding: 4px 16px 4px 4px; box-shadow: 2px 2px 0 #000;
  font-size: 16px; font-weight: 600; animation: pop-in .45s var(--ease-bounce) both; rotate: -1deg;
}
.handoff > span:last-child { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.handoff .avatar { background: var(--pc); }
.intro-fmt { row-gap: 8px; }
.guesser-note {
  display: inline-flex; align-items: center; gap: 6px; padding: 3px 12px 3px 3px; border: var(--bd); border-radius: 999px;
  background: #fff; font-size: 13px; font-weight: 700; max-width: 100%;
}
.guesser-note > span:last-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.table-note { display: block; margin-top: 4px; font-size: 13px; font-weight: 700; color: #000; }

/* ------------------------------------------------------------ co-worker leaderboard */
.leaderboard { padding: 16px; }
.leaderboard ol { list-style: none; margin: 10px 0 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.leaderboard li { display: flex; align-items: flex-start; gap: 10px; padding: 10px 12px 10px 10px; border: var(--bd); border-radius: 18px; background: #fff; }
.leaderboard li.first { background: var(--yellow-soft); box-shadow: 3px 3px 0 #000; }
.lb-place { width: 26px; height: 26px; flex: none; display: grid; place-items: center; margin-top: 7px; border-radius: 50%; background: #000; color: #fff; font-weight: 800; font-size: 13px; }
.leaderboard li.first .lb-place { background: var(--yellow); color: #000; border: var(--bd); }
.lb-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 4px; }
.lb-top { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; }
.lb-name { font-weight: 800; font-size: 17px; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lb-score { flex: none; }
.lb-score b { font-size: 24px; font-weight: 800; letter-spacing: -.03em; font-variant-numeric: tabular-nums; }
.lb-score small { font-size: 13px; color: var(--muted); font-weight: 700; }
.leaderboard .sb-bar { margin: 0; height: 10px; }
.lb-award { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; margin-top: 2px; }
.lb-award .sb-award { margin: 0; font-size: 12px; }
.lb-award .sb-line { font-size: 13px; }
.cert-names.many { font-size: clamp(19px, 5.4vw, 24px); line-height: 1.2; }

@media (min-width: 700px) {
  .names:not(.names-work) .name-row { flex: 1; min-width: 0; }
  .names-work { display: grid; grid-template-columns: 1fr 1fr; gap: 10px 12px; }
  .names-work .add-btn, .names-work .full-note { grid-column: 1 / -1; }
}

/* ------------------------------------------------------------ short phones: answer/guess screens go into focus mode */
@media (max-width: 699px) and (max-height: 760px) {
  html.in-round .site-header { display: none; }
  html.in-round .shell { padding-top: max(12px, env(safe-area-inset-top)); }
  .chip { min-height: 44px; padding: 8px 14px; }
  .setup .hero-art { height: 84px; }
  .setup .hero-art .hero-icon { width: 76px; }
  .setup .bubble-art.b2 { top: 48px; }
}
@media (max-height: 500px) {
  html.in-round .site-header { display: none; }
  .mode-opt > span { min-height: 64px; flex-direction: row; gap: 8px; }
  .mode-opt small { display: none; }
}
@media (max-width: 360px) {
  .mode-opt b { font-size: 15px; }
  .mode-opt small { font-size: 12px; }
}
