/* BIRDIE BASH
 *
 * The look: sticker-style panels, thick ink outlines, and big squishy buttons,
 * in the spirit of Fall Guys and Overcooked. Everything chunky, everything
 * slightly too bouncy.
 */

:root {
  --ink: #24163a;
  --paper: #fffaf0;
  --cream: #fff1d0;
  --pink: #ff5fa2;
  --yellow: #ffc93c;
  --blue: #4cb4ff;
  --green: #8ee04e;
  --purple: #a06bff;
  --orange: #ff8a3d;
  --red: #ff4a55;
  --team-a: #ff5fa2;
  --team-b: #4cb4ff;
  --display: 'Lilita One', 'Arial Black', Impact, sans-serif;
  --body: 'Fredoka', 'Trebuchet MS', system-ui, sans-serif;
  --safe-t: env(safe-area-inset-top, 0px);
  --safe-b: env(safe-area-inset-bottom, 0px);
  --safe-l: env(safe-area-inset-left, 0px);
  --safe-r: env(safe-area-inset-right, 0px);
}

*, *::before, *::after { box-sizing: border-box; }

html, body {
  margin: 0;
  height: 100%;
  overflow: hidden;
  background: #8fd6ff;
  font-family: var(--body);
  color: var(--ink);
  -webkit-font-smoothing: antialiased;
  -webkit-user-select: none;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
  touch-action: none;
}

body.playing #scene { cursor: crosshair; }
.xhair { position: absolute; left: 50%; top: 50%; width: 34px; height: 34px; margin: -17px 0 0 -17px; border: 4px solid #fff; border-radius: 50%; box-shadow: 0 0 0 3px var(--ink), inset 0 0 0 3px var(--ink); opacity: 0.9; }
.xhair i { position: absolute; left: 50%; top: 50%; width: 6px; height: 6px; margin: -3px 0 0 -3px; border-radius: 50%; background: #fff; box-shadow: 0 0 0 2px var(--ink); }
#scene {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
  outline: none;
}

[hidden] { display: none !important; }

button { font-family: inherit; color: inherit; cursor: pointer; }

/* Fat outlined display text. Stroke sits behind the fill so letters stay bold. */
.chunky {
  font-family: var(--display);
  color: #fff;
  letter-spacing: 0.02em;
  -webkit-text-stroke: 0.14em var(--ink);
  paint-order: stroke fill;
  text-shadow: 0 0.07em 0 var(--ink);
}

/* ─── boot ─────────────────────────────────────────────────────────── */

.boot-fail, .loading {
  position: fixed;
  inset: 0;
  z-index: 60;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 18px;
  background: linear-gradient(#4fb6ff, #bfe8ff 70%, #fff1d6);
  text-align: center;
  padding: 24px;
}
.boot-fail h1 { font-size: clamp(36px, 8vw, 72px); margin: 0; }
.boot-fail p { max-width: 420px; font-size: 18px; font-weight: 500; }
.boot-fail a { color: var(--ink); font-weight: 600; }
.loading { transition: opacity 0.5s ease; }
.loading.done { opacity: 0; pointer-events: none; }
.loading-mark { font-size: clamp(44px, 10vw, 96px); animation: bob 1.4s ease-in-out infinite; }
.loading-bar {
  width: min(320px, 70vw);
  height: 18px;
  border: 4px solid var(--ink);
  border-radius: 99px;
  background: #fff;
  overflow: hidden;
  box-shadow: 0 4px 0 var(--ink);
}
.loading-bar span {
  display: block;
  height: 100%;
  width: 8%;
  background: repeating-linear-gradient(-45deg, var(--pink) 0 12px, #ff8fc0 12px 24px);
  transition: width 0.25s ease;
}
.loading-note { font-weight: 600; font-size: 17px; opacity: 0.8; }

@keyframes bob {
  0%, 100% { transform: translateY(0) rotate(var(--r, 0deg)); }
  50% { transform: translateY(-9px) rotate(var(--r, 0deg)); }
}
@keyframes pop-in {
  0% { transform: scale(0.4); opacity: 0; }
  60% { transform: scale(1.12); opacity: 1; }
  100% { transform: scale(1); }
}

/* ─── buttons ──────────────────────────────────────────────────────── */

.big, .ghost {
  border: 4px solid var(--ink);
  border-radius: 20px;
  font-family: var(--display);
  letter-spacing: 0.03em;
  padding: 12px 26px;
  transition: transform 0.08s ease, box-shadow 0.08s ease, filter 0.15s;
}
.big {
  font-size: 30px;
  color: #fff;
  background: linear-gradient(#9cec5b, #5cc43a);
  box-shadow: 0 7px 0 var(--ink), inset 0 4px 0 rgba(255, 255, 255, 0.4);
  -webkit-text-stroke: 5px var(--ink);
  paint-order: stroke fill;
  text-shadow: 0 3px 0 var(--ink);
}
.big.small { font-size: 22px; padding: 8px 22px; }
.ghost {
  font-size: 19px;
  background: var(--paper);
  box-shadow: 0 5px 0 var(--ink);
}
.big:hover, .ghost:hover { transform: translateY(-2px); filter: brightness(1.06); }
.big:active { transform: translateY(5px); box-shadow: 0 2px 0 var(--ink), inset 0 4px 0 rgba(255, 255, 255, 0.4); }
.ghost:active { transform: translateY(4px); box-shadow: 0 1px 0 var(--ink); }
.big:focus-visible, .ghost:focus-visible, .seg button:focus-visible, .icon-btn:focus-visible { outline: 4px solid #fff; outline-offset: 2px; }

.icon-btn {
  width: 46px;
  height: 46px;
  border: 4px solid var(--ink);
  border-radius: 16px;
  background: var(--paper);
  box-shadow: 0 4px 0 var(--ink);
  display: grid;
  place-items: center;
  padding: 0;
  transition: transform 0.08s, box-shadow 0.08s;
}
.icon-btn:active { transform: translateY(3px); box-shadow: 0 1px 0 var(--ink); }
.ico { display: block; width: 22px; height: 22px; background: var(--ink); }
.ico-pause { -webkit-mask: linear-gradient(90deg, #000 0 36%, transparent 36% 64%, #000 64%) center / 100% 100% no-repeat; mask: linear-gradient(90deg, #000 0 36%, transparent 36% 64%, #000 64%) center / 100% 100% no-repeat; border-radius: 3px; }
.ico-sound {
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M3 9v6h4l5 4V5L7 9H3zm13.5 3a4.5 4.5 0 0 0-2.5-4v8a4.5 4.5 0 0 0 2.5-4zM14 3.2v2.1a7 7 0 0 1 0 13.4v2.1a9 9 0 0 0 0-17.6z'/%3E%3C/svg%3E") center / contain no-repeat;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M3 9v6h4l5 4V5L7 9H3zm13.5 3a4.5 4.5 0 0 0-2.5-4v8a4.5 4.5 0 0 0 2.5-4zM14 3.2v2.1a7 7 0 0 1 0 13.4v2.1a9 9 0 0 0 0-17.6z'/%3E%3C/svg%3E") center / contain no-repeat;
}
.muted .ico-sound {
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M3 9v6h4l5 4V5L7 9H3zm13.6 3 2.7-2.7-1.4-1.4-2.7 2.7-2.7-2.7-1.4 1.4 2.7 2.7-2.7 2.7 1.4 1.4 2.7-2.7 2.7 2.7 1.4-1.4z'/%3E%3C/svg%3E") center / contain no-repeat;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M3 9v6h4l5 4V5L7 9H3zm13.6 3 2.7-2.7-1.4-1.4-2.7 2.7-2.7-2.7-1.4 1.4 2.7 2.7-2.7 2.7 1.4 1.4 2.7-2.7 2.7 2.7 1.4-1.4z'/%3E%3C/svg%3E") center / contain no-repeat;
}

/* ─── HUD ──────────────────────────────────────────────────────────── */

.hud { position: fixed; inset: 0; pointer-events: none; z-index: 10; }
.hud button { pointer-events: auto; }

.scoreboard {
  position: absolute;
  top: calc(12px + var(--safe-t));
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  align-items: stretch;
  gap: 0;
  filter: drop-shadow(0 6px 0 rgba(36, 22, 58, 0.5));
}
.scoreboard .team {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 6px 18px;
  background: var(--paper);
  border: 4px solid var(--ink);
  min-width: 150px;
}
.scoreboard .team.a { border-radius: 22px 0 0 22px; justify-content: flex-start; }
.scoreboard .team.b { border-radius: 0 22px 22px 0; justify-content: flex-end; }
.scoreboard .who { font-family: var(--display); font-size: 20px; letter-spacing: 0.04em; }
.scoreboard .pts {
  font-family: var(--display);
  font-size: 44px;
  line-height: 1;
  min-width: 34px;
  text-align: center;
  color: #fff;
  -webkit-text-stroke: 7px var(--ink);
  paint-order: stroke fill;
}
.scoreboard .team.a .pts { margin-left: auto; }
.scoreboard .team.b .pts { margin-right: auto; }
.scoreboard .pts.bump { animation: pop-in 0.4s ease; }
.swatch { width: 22px; height: 22px; border-radius: 50%; border: 3px solid var(--ink); background: var(--team-a); flex: none; }
.scoreboard .mid {
  background: var(--ink);
  color: #fff;
  padding: 6px 14px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  min-width: 108px;
}
.scoreboard .first { font-family: var(--display); font-size: 15px; letter-spacing: 0.06em; }
.scoreboard .serve { display: flex; align-items: center; gap: 6px; font-size: 11px; font-weight: 700; letter-spacing: 0.1em; opacity: 0.95; }
.scoreboard .dot { width: 12px; height: 12px; border-radius: 50%; border: 2px solid #fff; opacity: 0.25; }
.scoreboard .dot.on { opacity: 1; background: var(--yellow); border-color: var(--yellow); box-shadow: 0 0 10px var(--yellow); }

.rally {
  position: absolute;
  top: calc(86px + var(--safe-t));
  left: 50%;
  transform: translateX(-50%);
  font-family: var(--display);
  font-size: 22px;
  padding: 3px 16px;
  color: var(--ink);
  background: var(--yellow);
  border: 3px solid var(--ink);
  border-radius: 99px;
  box-shadow: 0 4px 0 var(--ink);
}
.rally.hot { background: linear-gradient(#ffb03c, #ff6a2b); color: #fff; -webkit-text-stroke: 4px var(--ink); paint-order: stroke fill; animation: bob 0.5s ease-in-out infinite; }

.stack {
  position: absolute;
  left: 50%;
  top: 27%;
  transform: translate(-50%, -50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  text-align: center;
}
.countdown { font-size: clamp(80px, 15vw, 160px); line-height: 1; animation: pop-in 0.45s ease; }
.toast { animation: pop-in 0.4s ease; }
.toast-main { font-size: clamp(40px, 7.5vw, 84px); line-height: 1; transform: rotate(-3deg); }
.toast-main.super { font-size: clamp(34px, 5.6vw, 64px); }
.toast-main.good { color: #b8ff7a; }
.toast-main.bad { color: #ff9a9a; }
.toast-main.super { color: var(--yellow); }
.toast-main.fire { color: #ffb347; }
.toast-main.curve { color: #d3b0ff; }
.toast-main.frost { color: #aee9ff; }
.toast-sub {
  font-family: var(--display);
  font-size: clamp(18px, 3vw, 28px);
  color: #fff;
  background: var(--ink);
  padding: 4px 18px;
  border-radius: 99px;
  letter-spacing: 0.03em;
}
.toast-sub:empty { display: none; }

.bl {
  position: absolute;
  left: calc(16px + var(--safe-l));
  bottom: calc(16px + var(--safe-b));
  display: flex;
  flex-direction: column;
  gap: 10px;
  width: min(250px, 44vw);
}
.meter, .dashbar {
  position: relative;
  height: 30px;
  border: 4px solid var(--ink);
  border-radius: 99px;
  background: rgba(255, 250, 240, 0.9);
  overflow: hidden;
  box-shadow: 0 4px 0 var(--ink);
}
.dashbar { height: 22px; width: 62%; }
.meter-fill, .dash-fill {
  position: absolute;
  inset: 0 auto 0 0;
  width: 0%;
  background: repeating-linear-gradient(-45deg, #ff8a3d 0 10px, #ffb26a 10px 20px);
  transition: width 0.12s linear;
}
.dash-fill { background: repeating-linear-gradient(-45deg, var(--blue) 0 10px, #8fd3ff 10px 20px); }
.meter-label, .dashbar span {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  font-family: var(--display);
  font-size: 15px;
  letter-spacing: 0.08em;
  color: #fff;
  -webkit-text-stroke: 4px var(--ink);
  paint-order: stroke fill;
}
.dashbar span { font-size: 12px; -webkit-text-stroke: 3.5px var(--ink); }
.meter.ready { animation: bob 0.6s ease-in-out infinite; }
.meter.ready .meter-fill { background: repeating-linear-gradient(-45deg, #ffd23f 0 10px, #fff08a 10px 20px); }
.meter.armed .meter-fill { background: repeating-linear-gradient(-45deg, var(--arm, #ff6a2b) 0 10px, #fff 10px 20px); animation: flash-bg 0.3s linear infinite; }
.dashbar.cool { opacity: 0.75; }
.charge {
  position: absolute; left: 50%; bottom: calc(26px + var(--safe-b)); transform: translateX(-50%);
  width: min(260px, 50vw); height: 24px; border: 4px solid var(--ink); border-radius: 99px;
  background: rgba(255, 250, 240, 0.9); overflow: hidden; box-shadow: 0 4px 0 var(--ink);
}
.charge #charge-fill { position: absolute; inset: 0 auto 0 0; width: 0; background: repeating-linear-gradient(-45deg, #8ee04e 0 10px, #c4f58f 10px 20px); }
.charge.hot #charge-fill { background: repeating-linear-gradient(-45deg, #ff4a55 0 10px, #ff8a8a 10px 20px); }
.charge span { position: absolute; inset: 0; display: grid; place-items: center; font-family: var(--display); font-size: 13px; letter-spacing: 0.08em; color: #fff; -webkit-text-stroke: 3.5px var(--ink); paint-order: stroke fill; }
@keyframes flash-bg { 50% { filter: brightness(1.35); } }

.hint {
  position: absolute;
  left: 50%;
  top: calc(96px + var(--safe-t));
  transform: translateX(-50%);
  max-width: min(560px, calc(100vw - 32px));
  min-width: 220px;
  text-align: center;
  font-weight: 600;
  font-size: 17px;
  line-height: 1.3;
  padding: 10px 18px;
  background: var(--paper);
  border: 4px solid var(--ink);
  border-radius: 20px;
  box-shadow: 0 5px 0 var(--ink);
  animation: pop-in 0.35s ease;
}

.pops { position: absolute; inset: 0; overflow: hidden; }
.pop {
  position: absolute;
  left: 0; top: 0;
  font-family: var(--display);
  font-size: 30px;
  white-space: nowrap;
  color: #fff;
  -webkit-text-stroke: 7px var(--ink);
  paint-order: stroke fill;
  will-change: transform, opacity;
}
.pop.perfect { color: var(--yellow); font-size: 38px; }
.pop.smash { color: #ff9a3c; font-size: 36px; }
.pop.super { color: #ffe27a; font-size: 40px; }
.pop.in { color: #b8ff7a; font-size: 28px; }
.pop.out { color: #ff8a8a; font-size: 34px; }
.pop.net { color: #cfe6ff; }
.pop.meh { color: #d9d2ea; font-size: 22px; -webkit-text-stroke: 5px var(--ink); }

.flash { position: absolute; inset: 0; opacity: 0; pointer-events: none; }
.flash.smash { background: radial-gradient(circle at center, transparent 45%, rgba(255, 180, 60, 0.42) 100%); animation: flash 0.3s ease-out; }
.flash.super { background: radial-gradient(circle at center, rgba(255, 255, 255, 0.08) 25%, rgba(255, 140, 60, 0.38) 100%); animation: flash 0.38s ease-out; }
.flash.good { background: radial-gradient(circle at center, transparent 50%, rgba(142, 224, 78, 0.5) 100%); animation: flash 0.6s ease-out; }
.flash.bad { background: radial-gradient(circle at center, transparent 50%, rgba(255, 74, 85, 0.45) 100%); animation: flash 0.6s ease-out; }
@keyframes flash { 0% { opacity: 1; } 100% { opacity: 0; } }

.tr {
  position: absolute;
  top: calc(12px + var(--safe-t));
  right: calc(12px + var(--safe-r));
  display: flex;
  gap: 10px;
}

/* ─── touch controls ───────────────────────────────────────────────── */

.touch { position: fixed; inset: 0; z-index: 11; pointer-events: none; }
.stick {
  position: absolute;
  left: calc(26px + var(--safe-l));
  bottom: calc(26px + var(--safe-b));
  width: 150px; height: 150px;
  border-radius: 50%;
  background: rgba(255, 250, 240, 0.35);
  border: 4px solid rgba(36, 22, 58, 0.55);
  pointer-events: auto;
  touch-action: none;
}
.stick-knob {
  position: absolute;
  left: 50%; top: 50%;
  width: 66px; height: 66px;
  margin: -33px 0 0 -33px;
  border-radius: 50%;
  background: var(--paper);
  border: 4px solid var(--ink);
  box-shadow: 0 4px 0 var(--ink);
}
.tbtns {
  position: absolute;
  right: calc(18px + var(--safe-r));
  bottom: calc(18px + var(--safe-b));
  width: 250px; height: 220px;
  pointer-events: none;
}
.tb {
  position: absolute;
  border: 4px solid var(--ink);
  border-radius: 50%;
  font-family: var(--display);
  color: #fff;
  -webkit-text-stroke: 4px var(--ink);
  paint-order: stroke fill;
  pointer-events: auto;
  touch-action: none;
  box-shadow: 0 5px 0 var(--ink);
}
.tb:active { transform: translateY(4px); box-shadow: 0 1px 0 var(--ink); }
.tb.swing { right: 0; bottom: 0; width: 120px; height: 120px; font-size: 24px; background: var(--pink); }
.tb.jump { right: 126px; bottom: 6px; width: 84px; height: 84px; font-size: 17px; background: var(--blue); }
.tb.dash { right: 6px; bottom: 126px; width: 84px; height: 84px; font-size: 17px; background: var(--green); }
.tb.sup { right: 96px; bottom: 112px; width: 88px; height: 88px; font-size: 16px; background: var(--orange); animation: bob 0.6s ease-in-out infinite; }

/* ─── menus ────────────────────────────────────────────────────────── */

.screen { position: fixed; inset: 0; z-index: 30; }
.menu {
  display: flex;
  align-items: center;
  padding: calc(18px + var(--safe-t)) 5vw calc(18px + var(--safe-b)) calc(4vw + var(--safe-l));
  pointer-events: none;
}
.back-pill {
  position: absolute;
  top: calc(14px + var(--safe-t));
  right: 76px;
  pointer-events: auto;
  font-weight: 700;
  font-size: 16px;
  text-decoration: none;
  color: var(--ink);
  background: var(--paper);
  border: 4px solid var(--ink);
  border-radius: 99px;
  padding: 6px 16px;
  box-shadow: 0 4px 0 var(--ink);
}
.back-pill:hover { transform: translateY(-1px); }
.menu-mute { position: absolute; top: calc(14px + var(--safe-t)); right: calc(14px + var(--safe-r)); pointer-events: auto; }

.menu-card {
  pointer-events: auto;
  width: min(500px, 100%);
  max-height: calc(100vh - 36px - var(--safe-t) - var(--safe-b));
  overflow-y: auto;
  overscroll-behavior: contain;
  touch-action: pan-y;
  padding: 16px 26px 26px;
  background: var(--cream);
  border: 5px solid var(--ink);
  border-radius: 34px;
  box-shadow: 0 10px 0 var(--ink), 0 24px 50px rgba(36, 22, 58, 0.35);
  scrollbar-width: thin;
  scrollbar-color: var(--ink) transparent;
  animation: pop-in 0.5s ease;
}

.logo {
  margin: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  line-height: 0.92;
  font-family: var(--display);
  font-weight: 400;
}
.logo .word { display: flex; justify-content: center; }
.logo i {
  font-style: normal;
  font-size: clamp(40px, min(8.5vw, 10.5vh), 78px);
  color: var(--c);
  -webkit-text-stroke: 11px var(--ink);
  paint-order: stroke fill;
  text-shadow: 0 6px 0 var(--ink);
  display: inline-block;
  transform: rotate(var(--r));
  animation: bob 2.2s ease-in-out infinite;
  animation-delay: var(--d);
}
.tagline {
  margin: 6px 0 12px;
  text-align: center;
  font-weight: 600;
  font-size: 17px;
  opacity: 0.8;
}

.field { margin-bottom: 11px; }
.field > label {
  display: block;
  font-family: var(--display);
  font-size: 15px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  margin: 0 0 6px 4px;
  opacity: 0.75;
}
.seg { display: flex; gap: 8px; }
.seg button {
  flex: 1;
  font-family: var(--display);
  font-size: 20px;
  padding: 8px 6px;
  background: #fff;
  border: 4px solid var(--ink);
  border-radius: 16px;
  box-shadow: 0 4px 0 var(--ink);
  transition: transform 0.08s, box-shadow 0.08s, background 0.12s;
}
.seg button:hover { transform: translateY(-2px); }
.seg button[aria-pressed='true'] {
  background: var(--yellow);
  transform: translateY(3px);
  box-shadow: 0 1px 0 var(--ink);
}
.blurb { margin: 8px 4px 0; font-size: 14.5px; font-weight: 500; opacity: 0.8; min-height: 1.3em; }

.supers { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.supers button {
  text-align: left;
  background: #fff;
  border: 4px solid var(--ink);
  border-radius: 16px;
  box-shadow: 0 4px 0 var(--ink);
  padding: 8px 10px 9px;
  display: flex;
  flex-direction: column;
  gap: 2px;
  transition: transform 0.08s, box-shadow 0.08s, background 0.12s;
}
.supers b { font-family: var(--display); font-weight: 400; font-size: 18px; }
.supers small { font-size: 12px; line-height: 1.2; font-weight: 500; opacity: 0.8; }
.supers button:hover { transform: translateY(-2px); }
.supers button[aria-pressed='true'] { transform: translateY(3px); box-shadow: 0 1px 0 var(--ink); }
.supers button[data-val='fire'][aria-pressed='true'] { background: #ffd2a8; }
.supers button[data-val='curve'][aria-pressed='true'] { background: #e5d4ff; }
.supers button[data-val='frost'][aria-pressed='true'] { background: #c9f0ff; }

.swatches { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 10px; }
.sw {
  width: 38px; height: 38px;
  border-radius: 50%;
  border: 4px solid var(--ink);
  background: var(--c);
  box-shadow: 0 3px 0 var(--ink);
  padding: 0;
  transition: transform 0.1s;
}
.sw:hover { transform: translateY(-2px) scale(1.06); }
.sw[aria-pressed='true'] { transform: translateY(2px) scale(1.1); box-shadow: 0 0 0 4px #fff, 0 0 0 8px var(--ink); }
.hatpick { display: flex; align-items: center; justify-content: center; gap: 14px; }
.hatpick #hat-name { font-family: var(--display); font-size: 22px; min-width: 130px; text-align: center; }
.chev {
  width: 42px; height: 42px;
  border-radius: 14px;
  border: 4px solid var(--ink);
  background: #fff;
  box-shadow: 0 4px 0 var(--ink);
  display: grid; place-items: center;
  padding: 0;
}
.chev span { width: 0; height: 0; border: 8px solid transparent; border-right: 12px solid var(--ink); border-left: 0; }
.chev.next span { border-left: 12px solid var(--ink); border-right: 0; }
.chev:active { transform: translateY(3px); box-shadow: 0 1px 0 var(--ink); }

.actions {
  position: sticky;
  bottom: -26px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin: 8px -26px -26px;
  padding: 12px 26px 22px;
  background: linear-gradient(rgba(255, 241, 208, 0), var(--cream) 30%);
}
.actions .big { flex: 1; }

/* ─── modals ───────────────────────────────────────────────────────── */

.modal {
  display: grid;
  place-items: center;
  background: rgba(36, 22, 58, 0.5);
  backdrop-filter: blur(3px);
  padding: 16px;
  z-index: 40;
}
.modal#how { z-index: 50; }
.panel {
  background: var(--cream);
  border: 5px solid var(--ink);
  border-radius: 32px;
  box-shadow: 0 10px 0 var(--ink);
  padding: 22px 28px 26px;
  text-align: center;
  animation: pop-in 0.35s ease;
  max-height: calc(100vh - 32px);
  overflow-y: auto;
  touch-action: pan-y;
}
.panel h2 { margin: 0 0 14px; font-size: 54px; line-height: 1; transform: rotate(-2deg); }
.panel.narrow { width: min(400px, 100%); }
.stackbtns { display: flex; flex-direction: column; gap: 12px; margin-top: 14px; }

.how { width: min(820px, 100%); text-align: left; }
.how h2 { text-align: center; }
.how-grid { display: grid; grid-template-columns: 1fr 1.15fr; gap: 24px; margin-bottom: 18px; }
.how .row { display: flex; align-items: center; gap: 12px; margin-bottom: 10px; font-weight: 500; font-size: 16px; }
.how .kc { display: flex; align-items: center; gap: 4px; flex: 0 0 168px; flex-wrap: wrap; }
.touch-note { display: none; }
.touch-device .touch-note { display: block; }
.how .kc i { font-style: normal; font-size: 13px; opacity: 0.6; }
kbd {
  font-family: var(--display);
  font-size: 15px;
  background: #fff;
  border: 3px solid var(--ink);
  border-bottom-width: 5px;
  border-radius: 9px;
  padding: 1px 8px;
  min-width: 30px;
  text-align: center;
}
.how h3 { font-family: var(--display); font-weight: 400; font-size: 20px; margin: 0 0 2px; }
.how p { margin: 0 0 10px; font-size: 15px; line-height: 1.38; font-weight: 500; }
.how .green { color: #2d9a1f; }
.how .red { color: #d62f3c; }
.how .big { display: block; margin: 0 auto; }

.over-score { font-family: var(--display); font-size: 70px; line-height: 1; margin: 2px 0 4px; }
.over-quip { font-weight: 600; font-size: 18px; opacity: 0.85; margin-bottom: 12px; min-height: 1.3em; }
.stats { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; text-align: left; }
.stat {
  background: #fff;
  border: 3px solid var(--ink);
  border-radius: 14px;
  padding: 6px 12px;
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 8px;
  font-weight: 600;
  font-size: 14px;
}
.stat b { font-family: var(--display); font-weight: 400; font-size: 24px; }

/* ─── small screens ────────────────────────────────────────────────── */

@media (max-width: 860px) {
  .menu { justify-content: center; padding: calc(64px + var(--safe-t)) 14px 14px; align-items: flex-start; }
  .menu-card { max-height: calc(100vh - 78px - var(--safe-t) - var(--safe-b)); padding: 16px 18px 20px; }
  .how-grid { grid-template-columns: 1fr; gap: 10px; }
  .back-pill { right: auto; left: calc(14px + var(--safe-l)); }
  .hint { max-width: calc(100vw - 32px); top: calc(84px + var(--safe-t)); font-size: 15px; }
  .scoreboard .team { min-width: 0; padding: 4px 12px; gap: 6px; }
  .scoreboard .who { display: none; }
  .scoreboard .pts { font-size: 38px; }
  .scoreboard .mid { min-width: 88px; }
  .bl { bottom: calc(190px + var(--safe-b)); left: calc(14px + var(--safe-l)); width: min(190px, 40vw); }
}
@media (max-height: 560px) {
  .menu-card { padding: 12px 18px 16px; }
  .logo i { font-size: 44px; }
  .tagline { margin: 4px 0 8px; font-size: 14px; }
  .field { margin-bottom: 8px; }
  .panel h2 { font-size: 40px; }
  .hint { top: calc(80px + var(--safe-t)); }
  .bl { bottom: calc(10px + var(--safe-b)); }
}
@media (max-width: 860px) and (max-height: 560px) {
  .menu { padding-top: calc(56px + var(--safe-t)); }
  .hint { top: calc(76px + var(--safe-t)); max-width: min(520px, calc(100vw - 32px)); }
  .bl { bottom: calc(190px + var(--safe-b)); }
}
@media (prefers-reduced-motion: reduce) {
  .logo i, .loading-mark, .meter.ready, .tb.sup, .rally.hot { animation: none; }
  .menu-card, .panel, .toast, .countdown, .hint { animation: none; }
}

/* Short landscape phones: settings in two columns so more of them are visible. */
@media (max-height: 560px) and (min-width: 600px) {
  .menu-card {
    width: min(780px, 100%);
    display: grid;
    grid-template-columns: 1fr 1fr;
    column-gap: 20px;
    align-content: start;
    padding: 10px 20px 20px;
  }
  .menu-card > .logo, .menu-card > .tagline, .menu-card > .actions, .menu-card > .field.wide { grid-column: 1 / -1; }
  .logo { flex-direction: row; justify-content: center; gap: 16px; }
  .logo i { font-size: 36px; -webkit-text-stroke: 8px var(--ink); }
  .tagline { display: none; }
  .blurb { display: none; }
  .field { margin-bottom: 6px; }
  .field > label { font-size: 13px; margin-bottom: 3px; }
  .seg button, .supers button { padding: 5px 4px; font-size: 17px; border-width: 3px; }
  .supers b { font-size: 16px; }
  .swatches { margin-bottom: 4px; flex-wrap: nowrap; }
  .sw { width: 30px; height: 30px; border-width: 3px; }
  .hatpick { margin-top: -34px; margin-left: auto; width: 44%; }
  .hatpick #hat-name { font-size: 18px; min-width: 90px; }
  .chev { width: 34px; height: 34px; }
  .actions { margin: 0 -20px -20px; padding: 8px 20px 14px; bottom: -20px; }
  .big { font-size: 24px; padding: 8px 20px; }
  .ghost { font-size: 16px; padding: 8px 14px; }
}

/* Narrow portrait phones. */
@media (max-width: 520px) {
  .swatches { flex-wrap: nowrap; justify-content: space-between; }
  .sw { width: min(38px, 10.4vw); height: min(38px, 10.4vw); }
  .actions .ghost { font-size: 16px; padding: 10px 12px; white-space: nowrap; }
  .scoreboard .first { font-size: 11px; text-align: center; line-height: 1.05; }
  .scoreboard .mid { min-width: 76px; padding: 4px 8px; }
  .scoreboard .team { padding: 3px 10px; gap: 5px; }
  .scoreboard .pts { font-size: 32px; min-width: 24px; }
  .swatch { width: 18px; height: 18px; }
  .icon-btn { width: 38px; height: 38px; border-radius: 12px; border-width: 3px; }
  .tr { gap: 6px; top: calc(60px + var(--safe-t)); right: calc(10px + var(--safe-r)); }
  .rally { top: calc(74px + var(--safe-t)); font-size: 17px; }
  .hint { top: calc(106px + var(--safe-t)); }
  .panel h2 { font-size: 42px; }
}

.tour-badge { position: absolute; top: calc(86px + var(--safe-t)); left: 50%; transform: translateX(-50%); font-family: var(--display); font-size: 15px; letter-spacing: 0.08em; color: #fff; background: var(--ink); padding: 3px 14px; border-radius: 99px; white-space: nowrap; }
.wind { position: absolute; top: calc(122px + var(--safe-t)); left: 50%; transform: translateX(-50%); font-family: var(--display); font-size: 17px; letter-spacing: 0.1em; color: #fff; -webkit-text-stroke: 4px var(--ink); paint-order: stroke fill; opacity: calc(0.45 + var(--m, 0.5) * 0.55); }
.wind b { font-weight: 400; }

/* ─── modes, tour ──────────────────────────────────────────────────── */
.menu-card[data-mode='tour'] .quick-only { display: none; }
.menu-card[data-mode='quick'] .tour-only { display: none; }
.seg.modes button { font-size: 18px; }
.seg.four button { font-size: 16px; padding: 8px 2px; }
.seg.six { display: grid; grid-template-columns: repeat(3, 1fr); }
.seg.six button { font-size: 16px; padding: 8px 2px; }
.tour-blurb { margin: 0; padding: 10px 14px; background: #fff; border: 3px solid var(--ink); border-radius: 16px; font-size: 15px; opacity: 1; line-height: 1.35; }
/* ─── the bash tour ────────────────────────────────────────────────── */
.tourscr { display: grid; place-items: center; padding: 14px; background: rgba(36, 22, 58, 0.62); backdrop-filter: blur(4px); z-index: 40; overflow-y: auto; }
.tour-wrap { width: min(1060px, 100%); }
.tpanel {
  --rc: #c9d3e6;
  background: var(--cream); border: 5px solid var(--ink); border-radius: 30px; box-shadow: 0 10px 0 var(--ink);
  padding: 16px 22px 22px; text-align: left; animation: pop-in 0.3s ease;
  max-height: calc(100vh - 28px); overflow-y: auto; overscroll-behavior: contain; touch-action: pan-y;
}
.tpanel h4 { margin: 14px 0 8px; font-family: var(--display); font-weight: 400; font-size: 20px; letter-spacing: 0.03em; }
.tpanel h4 small { font-family: var(--body); font-size: 13px; font-weight: 600; opacity: 0.7; margin-left: 6px; }
.tpanel h2 { text-align: center; }
.thead { display: flex; align-items: center; gap: 14px; margin-bottom: 8px; }
.tt b { display: block; font-family: var(--display); font-weight: 400; font-size: 32px; line-height: 1; }
.tt small { display: block; font-weight: 600; opacity: 0.75; font-size: 14px; margin-top: 5px; max-width: 520px; }
.tstat { margin-left: auto; display: flex; align-items: center; gap: 12px; font-family: var(--display); }
.hearts { display: inline-flex; gap: 2px; }
.hearts i { font-style: normal; font-size: 26px; line-height: 1; }
.hearts i.full { color: #ff4a55; -webkit-text-stroke: 4px var(--ink); paint-order: stroke fill; }
.hearts i.empty { color: #b9a9cf; }
.coins { background: #fff; border: 3px solid var(--ink); border-radius: 99px; padding: 1px 12px; font-size: 20px; white-space: nowrap; }
.tmini { border: 3px solid var(--ink); background: var(--paper); border-radius: 99px; padding: 4px 14px; font-family: var(--display); font-size: 16px; box-shadow: 0 3px 0 var(--ink); }
.tmini:hover { transform: translateY(-1px); }
.tmini:active { transform: translateY(2px); box-shadow: 0 1px 0 var(--ink); }
.tbtn {
  border: 4px solid var(--ink); border-radius: 20px; font-family: var(--display); letter-spacing: 0.03em; padding: 10px 26px; font-size: 26px; color: #fff;
  background: linear-gradient(#9cec5b, #5cc43a); box-shadow: 0 6px 0 var(--ink), inset 0 4px 0 rgba(255, 255, 255, 0.4);
  -webkit-text-stroke: 5px var(--ink); paint-order: stroke fill; text-shadow: 0 3px 0 var(--ink); transition: transform 0.08s, box-shadow 0.08s, filter 0.15s;
}
.tbtn:hover { transform: translateY(-2px); filter: brightness(1.06); }
.tbtn:active { transform: translateY(5px); box-shadow: 0 1px 0 var(--ink), inset 0 4px 0 rgba(255, 255, 255, 0.4); }
.tfoot { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 16px; }
.tfoot.center { justify-content: center; }
.tbest { font-weight: 600; font-size: 14px; opacity: 0.75; }
[aria-disabled='true'] { opacity: 0.45; cursor: not-allowed; }
.lostnote { margin: 0 0 8px; padding: 6px 14px; background: #ffe0e0; border: 3px solid var(--ink); border-radius: 14px; font-weight: 700; }
.banner { margin: 4px 0 10px; padding: 8px 18px; background: var(--yellow); border: 4px solid var(--ink); border-radius: 16px; font-family: var(--display); font-size: 24px; box-shadow: 0 4px 0 var(--ink); transform: rotate(-0.6deg); animation: pop-in 0.4s ease; }
.banner b { background: var(--ink); color: #fff; padding: 0 10px; border-radius: 99px; margin-right: 8px; font-weight: 400; }
.banner small { display: block; font-family: var(--body); font-weight: 600; font-size: 14px; }

/* start screen */
.tcont { display: flex; align-items: center; gap: 12px; padding: 10px 14px; margin: 6px 0 4px; background: #fff; border: 4px solid var(--ink); border-radius: 18px; }
.tcont > div { margin-right: auto; }
.tcont b { display: block; font-family: var(--display); font-weight: 400; font-size: 22px; }
.tcont small { font-weight: 600; opacity: 0.75; }
.kits { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 10px; }
.kit { background: #fff; border: 4px solid var(--ink); border-radius: 18px; padding: 10px 10px 12px; display: flex; flex-direction: column; align-items: center; gap: 3px; text-align: center; box-shadow: 0 4px 0 var(--ink); transition: transform 0.1s; }
.kit:hover { transform: translateY(-3px); }
.kit.on { background: #fff6c8; outline: 4px solid var(--yellow); outline-offset: 2px; }
.kit .ic { font-size: 34px; line-height: 1; }
.kit b { font-family: var(--display); font-weight: 400; font-size: 20px; }
.kit small { font-size: 13px; font-weight: 500; line-height: 1.25; opacity: 0.85; }
.kit .kp { font-size: 16px; }
.kit.locked { background: #e6dff0; }
.heats { display: flex; gap: 8px; }
.heat { width: 46px; height: 46px; border: 4px solid var(--ink); border-radius: 14px; background: #fff; font-family: var(--display); font-size: 22px; box-shadow: 0 4px 0 var(--ink); }
.heat.on { background: var(--orange); color: #fff; -webkit-text-stroke: 4px var(--ink); paint-order: stroke fill; }
.heatinfo { margin: 8px 0 0; font-weight: 500; font-size: 15px; }

/* the route */
.rwrap { display: grid; grid-template-columns: minmax(0, 1.75fr) minmax(250px, 1fr); gap: 16px; align-items: stretch; margin: 6px 0 4px; }
.mapbox { background: #fff; border: 4px solid var(--ink); border-radius: 22px; padding: 6px 10px 10px; background-image: radial-gradient(rgba(36, 22, 58, 0.09) 2px, transparent 2.5px); background-size: 22px 22px; }
.routesvg { width: 100%; height: auto; display: block; overflow: visible; }
.edge { fill: none; stroke: var(--ink); stroke-width: 4; stroke-linecap: round; opacity: 0.22; stroke-dasharray: 3 11; }
.edge.live { opacity: 1; stroke-dasharray: none; }
.edge.done { opacity: 0.6; stroke: #2d9a1f; stroke-dasharray: none; }
.node { cursor: pointer; outline: none; }
.node .halo { fill: transparent; }
.node .body { fill: #fff; stroke: var(--ink); stroke-width: 5; transition: transform 0.12s; transform-box: fill-box; transform-origin: center; }
.node.t-elite .body { fill: #ff9a9a; }
.node.t-boss .body { fill: var(--yellow); stroke-width: 6; }
.node.t-shop .body { fill: #b8ff7a; }
.node.t-rest .body { fill: #8fe8e0; }
.node.t-event .body { fill: #dcc8ff; }
.node .gl { text-anchor: middle; pointer-events: none; font-family: 'Apple Color Emoji', 'Segoe UI Emoji', 'Noto Color Emoji', sans-serif; }
.node .tick { fill: #2d9a1f; font-family: var(--display); font-size: 30px; stroke: var(--ink); stroke-width: 3px; paint-order: stroke fill; pointer-events: none; }
.node:not(.reach):not(.done) { opacity: 0.5; }
.node.done { opacity: 0.55; }
.node.reach .halo { fill: rgba(255, 201, 60, 0.6); animation: halo 1.1s ease-in-out infinite; transform-box: fill-box; transform-origin: center; }
.node.reach:hover .body, .node.reach:focus-visible .body { transform: scale(1.1); }
.node.sel .body { stroke-width: 8; }
@keyframes halo { 0%, 100% { transform: scale(0.92); opacity: 0.8; } 50% { transform: scale(1.12); opacity: 1; } }
.legend { display: flex; flex-wrap: wrap; gap: 4px 14px; justify-content: center; font-size: 12px; font-weight: 700; opacity: 0.7; margin-top: 2px; }
.tinfo { background: #fff; border: 4px solid var(--ink); border-radius: 22px; padding: 12px 16px 14px; display: flex; flex-direction: column; align-items: flex-start; gap: 4px; }
.tinfo b { font-family: var(--display); font-weight: 400; font-size: 26px; line-height: 1.05; }
.tinfo .sub { font-weight: 700; opacity: 0.7; font-size: 14px; }
.tinfo p { margin: 4px 0 0; font-weight: 500; font-size: 15px; line-height: 1.3; }
.tinfo p.aside { opacity: 0.65; font-size: 13px; }
.tinfo .tbtn { margin-top: auto; align-self: stretch; font-size: 22px; padding: 8px 14px; }
.tinfo.elite { background: #ffe9e9; }
.tinfo.boss { background: #ffd9d9; }
.tinfo .locked-note { margin-top: auto; font-weight: 700; opacity: 0.6; }
.ibig { font-size: 52px; line-height: 1; }
.tags { display: flex; flex-wrap: wrap; gap: 6px; margin: 4px 0; }
.tag { font-family: var(--display); font-size: 14px; letter-spacing: 0.06em; background: var(--ink); color: #fff; padding: 1px 10px; border-radius: 99px; }
.tag.hot { background: #b3202c; }

/* perks, chips and cards */
.build { margin-top: 12px; }
.build h4 { margin: 0 0 6px; }
.tchips { display: flex; flex-wrap: wrap; gap: 6px; }
.tchips .none { font-weight: 500; opacity: 0.6; font-size: 14px; }
.chip { font-weight: 700; font-size: 13px; background: #fff; border: 3px solid var(--ink); border-left: 9px solid var(--rc); border-radius: 99px; padding: 1px 10px; }
.chip em { font-style: normal; opacity: 0.6; }
.pinfo { margin-top: 8px; padding: 6px 12px; background: #fff; border: 3px solid var(--ink); border-left: 9px solid var(--rc); border-radius: 12px; }
.pinfo span { font-size: 12px; font-weight: 700; opacity: 0.6; }
.pinfo p { margin: 2px 0 0; font-size: 14px; font-weight: 500; }
.r-common { --rc: #c9d3e6; } .r-rare { --rc: #6fc3ff; } .r-epic { --rc: #c58bff; } .r-relic { --rc: #ffd24a; } .r-curse { --rc: #ff7a7a; }
.tcards { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; margin: 12px 0 6px; }
.tcards.three { margin: 6px 0 0; }
.tcards.one { grid-template-columns: minmax(0, 260px); justify-content: center; }
.tcard {
  position: relative; background: #fff; border: 4px solid var(--ink); border-radius: 22px; padding: 30px 12px 14px; box-shadow: 0 6px 0 var(--ink);
  display: flex; flex-direction: column; align-items: center; gap: 5px; text-align: center; transition: transform 0.1s, box-shadow 0.1s; overflow: hidden;
}
.tcard .rar { position: absolute; left: 0; right: 0; top: 0; padding: 2px 0; background: var(--rc); border-bottom: 3px solid var(--ink); font-family: var(--display); font-size: 14px; letter-spacing: 0.1em; text-transform: uppercase; }
.tcard:hover { transform: translateY(-5px) rotate(-1deg); }
.tcard:active { transform: translateY(3px); box-shadow: 0 2px 0 var(--ink); }
.tcard .ic { font-size: 48px; line-height: 1; }
.tcard b { font-family: var(--display); font-weight: 400; font-size: 23px; line-height: 1.05; }
.tcard small { font-size: 14px; font-weight: 500; line-height: 1.3; opacity: 0.85; }
.tcard .own { font-size: 12px; font-weight: 700; color: #2d9a1f; }
.tcard .price { margin-top: 4px; font-family: var(--display); font-size: 20px; background: var(--yellow); border: 3px solid var(--ink); border-radius: 99px; padding: 0 14px; }
.tcard .price.poor { background: #e6dff0; }
.tcard.sold { opacity: 0.4; pointer-events: none; }
.tcard.dim { opacity: 0.6; }
.tpanel.relic { background: linear-gradient(#fff3c2, var(--cream)); }
.earned { margin: 2px 0 0; font-family: var(--display); font-size: 22px; }
.earned small { font-family: var(--body); font-size: 13px; font-weight: 600; opacity: 0.7; }
.svc { display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; margin-top: 10px; }
.svcb { display: flex; align-items: center; gap: 8px; background: #fff; border: 4px solid var(--ink); border-radius: 16px; padding: 6px 14px; box-shadow: 0 4px 0 var(--ink); font-family: var(--display); font-size: 17px; }
.svcb span { font-size: 24px; }
.svcb b { font-weight: 400; }
.svcb em { font-style: normal; background: var(--yellow); border: 3px solid var(--ink); border-radius: 99px; padding: 0 10px; }
.svcb:hover { transform: translateY(-2px); }

/* versus */
.vsrow { display: grid; grid-template-columns: minmax(0, 1fr) auto minmax(0, 1.6fr); gap: 12px; align-items: stretch; margin: 8px 0; }
.vs { align-self: center; font-family: var(--display); font-size: 44px; color: #fff; -webkit-text-stroke: 8px var(--ink); paint-order: stroke fill; transform: rotate(-6deg); }
.side { position: relative; background: #fff; border: 4px solid var(--ink); border-radius: 22px; padding: 26px 14px 12px; display: flex; flex-direction: column; gap: 8px; }
.side .who { position: absolute; left: 14px; top: -14px; background: var(--ink); color: #fff; font-family: var(--display); letter-spacing: 0.08em; padding: 1px 14px; border-radius: 99px; font-size: 15px; }
.side.you { align-items: center; text-align: center; }
.ystats { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; width: 100%; }
.ystats span { background: var(--cream); border: 3px solid var(--ink); border-radius: 12px; padding: 2px 6px; display: flex; justify-content: space-between; font-weight: 700; font-size: 14px; }
.ystats em { font-style: normal; opacity: 0.65; }
.foe { display: flex; gap: 12px; align-items: flex-start; }
.foe .fi { font-size: 40px; line-height: 1; }
.foe b { font-family: var(--display); font-weight: 400; font-size: 24px; line-height: 1; display: block; }
.foe em { font-style: normal; font-weight: 800; font-size: 13px; opacity: 0.6; display: block; letter-spacing: 0.04em; text-transform: uppercase; }
.foe small { display: block; font-weight: 500; font-size: 14px; margin-top: 2px; }
.tipline { margin: 4px 0 0; font-weight: 600; font-size: 14px; color: #2b6f16; }
.tipline i { font-style: normal; font-family: var(--display); background: #b8ff7a; border: 2px solid var(--ink); border-radius: 8px; padding: 0 6px; margin-right: 4px; color: var(--ink); }
.quip { margin: 6px 0 2px; font-family: var(--display); font-size: 20px; text-align: center; }
.tpanel.versus.boss { background: linear-gradient(#ffc9c9, #ffeaea); }
.tpanel.versus.elite { background: linear-gradient(#ffe0e0, var(--cream)); }

.minibean { position: relative; width: 56px; height: 72px; margin: 2px 0 4px; background: var(--bc, #ff5fa2); border: 4px solid var(--ink); border-radius: 30px 30px 24px 24px; box-shadow: inset -9px -9px 0 rgba(0, 0, 0, 0.13), 0 4px 0 var(--ink); }
.minibean::before, .minibean::after { content: ''; position: absolute; top: 18px; width: 14px; height: 17px; border: 3px solid var(--ink); border-radius: 50%; background: radial-gradient(circle at 62% 62%, var(--ink) 0 3px, #fff 3.5px); }
.minibean::before { left: 7px; }
.minibean::after { right: 7px; }

/* rest and events */
.restrow { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 2.2fr); gap: 16px; margin-top: 8px; }
.bigopt { background: #fff; border: 4px solid var(--ink); border-radius: 22px; padding: 18px 14px; box-shadow: 0 6px 0 var(--ink); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; text-align: center; }
.bigopt .ic { font-size: 56px; }
.bigopt b { font-family: var(--display); font-weight: 400; font-size: 26px; }
.bigopt small { font-weight: 500; font-size: 14px; }
.bigopt:hover { transform: translateY(-4px); }
.trainbox h4 { margin-top: 0; }
.tpanel.event { text-align: center; }
.tpanel.event .thead { text-align: left; }
.evtext { margin: 6px auto 12px; max-width: 640px; font-weight: 600; font-size: 18px; line-height: 1.35; }
.choices { display: flex; flex-direction: column; gap: 10px; max-width: 640px; margin: 0 auto; }
.choice { background: #fff; border: 4px solid var(--ink); border-radius: 18px; padding: 10px 16px; box-shadow: 0 5px 0 var(--ink); text-align: left; transition: transform 0.1s; }
.choice:hover { transform: translateY(-3px); }
.choice b { font-family: var(--display); font-weight: 400; font-size: 22px; display: block; }
.choice small { font-weight: 500; font-size: 14px; opacity: 0.8; }
.tpanel.over { text-align: center; max-width: 760px; margin: 0 auto; }
.tpanel.over .stats { grid-template-columns: repeat(3, 1fr); text-align: left; margin-top: 10px; }
.tpanel.over.won h2 { color: #b8ff7a; }
.tpanel.over.lost h2 { color: #ffb0b0; }
.unlocks { margin: 12px 0 0; padding: 8px 14px; background: #fff6c8; border: 3px solid var(--ink); border-radius: 14px; text-align: left; }
.unlocks ul { margin: 4px 0 0; padding-left: 20px; font-weight: 600; }
.tpanel.over .build { text-align: left; }
@media (max-width: 760px) {
  .tpanel { padding: 12px 12px 18px; border-radius: 24px; }
  .tt b { font-size: 24px; }
  .thead { flex-wrap: wrap; }
  .rwrap, .restrow, .vsrow { grid-template-columns: 1fr; }
  .mapbox { overflow-x: auto; touch-action: pan-x pan-y; }
  .routesvg { min-width: 560px; }
  .tcards { grid-template-columns: 1fr; }
  .tcard { flex-direction: row; text-align: left; padding: 30px 12px 12px; flex-wrap: wrap; }
  .tcard .ic { font-size: 34px; }
  .vs { justify-self: center; font-size: 34px; }
  .tpanel.over .stats { grid-template-columns: 1fr 1fr; }
}
.tb.soft { right: 176px; bottom: 100px; width: 78px; height: 78px; font-size: 16px; background: var(--yellow); }
