:root {
  color-scheme: light;
  font-family: "Trebuchet MS", "Arial Rounded MT Bold", Arial, sans-serif;
  --ink: #252844;
  --muted: #667085;
  --sky: #bceeff;
  --grass: #78d48b;
  --strawberry: #f36f8f;
  --berry-deep: #b64667;
  --mint: #6bd2bd;
  --cream: #fff9ed;
  --butter: #ffd96d;
  --table: #d98d43;
  --table-dark: #9e5b2c;
  --panel: #fffdf7;
  --shadow: 0 18px 36px rgba(37, 40, 68, 0.17);
}

* {
  box-sizing: border-box;
}

html,
body {
  min-height: 100%;
}

body {
  margin: 0;
  color: var(--ink);
  background:
    linear-gradient(180deg, #8fdaf5 0%, #d7f7ff 48%, #a7df9e 49%, #6ec783 100%);
  overflow-x: hidden;
}

button {
  font: inherit;
}

.app {
  min-height: 100vh;
  padding: 18px;
  display: grid;
  place-items: center;
}

.home-shell,
.game-shell,
.bus-shell,
.egg-shell,
.ttt-shell,
.steal-shell,
.runner-shell,
.bowling-shell {
  width: min(1180px, 100%);
  display: grid;
  gap: 14px;
}

.home-shell[hidden],
.game-shell[hidden],
.bus-shell[hidden],
.egg-shell[hidden],
.ttt-shell[hidden],
.steal-shell[hidden],
.runner-shell[hidden],
.bowling-shell[hidden] {
  display: none;
}

.home-header {
  min-height: 78px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 10px 12px;
  background: rgba(255, 253, 247, 0.92);
  border: 2px solid rgba(37, 40, 68, 0.12);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.game-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  justify-content: center;
  gap: 18px;
}

.game-card {
  min-height: 430px;
  display: grid;
  grid-template-rows: 1fr auto auto;
  place-items: center;
  gap: 10px;
  padding: 28px 20px;
  color: var(--ink);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.92), rgba(255, 253, 247, 0.96)),
    #ffffff;
  border: 3px solid rgba(37, 40, 68, 0.12);
  border-radius: 8px;
  box-shadow: var(--shadow), 0 9px 0 rgba(37, 40, 68, 0.14);
  cursor: pointer;
  touch-action: manipulation;
}

.game-card:active {
  transform: translateY(6px);
  box-shadow: var(--shadow), 0 3px 0 rgba(37, 40, 68, 0.14);
}

.game-card:focus-visible {
  outline: 5px solid rgba(45, 108, 223, 0.35);
  outline-offset: 3px;
}

.game-card-art {
  width: min(320px, 86%);
  aspect-ratio: 1 / 0.82;
  display: grid;
  place-items: center;
  background:
    radial-gradient(circle at 35% 28%, rgba(255, 255, 255, 0.75), transparent 24%),
    linear-gradient(180deg, #d7f7ff 0%, #f7fdff 54%, #bde8a8 55%, #82cf8d 100%);
  border: 3px solid rgba(37, 40, 68, 0.12);
  border-radius: 8px;
  box-shadow: inset 0 0 0 8px rgba(255, 255, 255, 0.28);
}

.game-card-art svg {
  width: 92%;
  height: 92%;
  filter: drop-shadow(0 8px 10px rgba(37, 40, 68, 0.16));
}

.bus-icon {
  background:
    linear-gradient(180deg, #bceeff 0%, #f7fdff 52%, #c7d2df 53%, #8e98a8 100%);
}

.egg-icon {
  background:
    radial-gradient(circle at 74% 24%, #ffd96d 0 13%, transparent 14%),
    linear-gradient(180deg, #bceeff 0%, #f7fdff 50%, #bde8a8 51%, #77c984 100%);
}

.ttt-icon {
  background:
    radial-gradient(circle at 20% 20%, rgba(255, 217, 109, 0.8), transparent 18%),
    linear-gradient(180deg, #e8f3ff 0%, #ffffff 48%, #cef2e9 49%, #8edacb 100%);
}

.steal-icon {
  background:
    radial-gradient(circle at 80% 18%, rgba(255, 217, 109, 0.75), transparent 18%),
    linear-gradient(180deg, #d7f7ff 0%, #fffdf7 50%, #e8b875 51%, #c6813a 100%);
}

.runner-icon {
  position: relative;
  overflow: hidden;
  background:
    radial-gradient(circle at 17% 18%, rgba(255, 217, 109, 0.94) 0 14%, transparent 15%),
    linear-gradient(180deg, #bceeff 0%, #f7fdff 48%, #bde8a8 49%, #72c985 100%);
}

.runner-icon::before {
  content: "";
  position: absolute;
  top: 18%;
  right: 11%;
  width: 74px;
  height: 28px;
  background:
    radial-gradient(circle at 18px 20px, #ffffff 0 18px, transparent 19px),
    radial-gradient(circle at 39px 13px, #ffffff 0 23px, transparent 24px),
    radial-gradient(circle at 61px 20px, #ffffff 0 17px, transparent 18px);
  opacity: 0.9;
}

.runner-icon-track {
  position: absolute;
  left: 7%;
  right: 7%;
  bottom: 14%;
  z-index: 1;
  height: 45%;
  overflow: hidden;
  background:
    linear-gradient(90deg, rgba(255, 255, 255, 0.28) 0 2px, transparent 2px 42px),
    linear-gradient(180deg, #ffbd82 0%, #ed8062 100%);
  background-size: 42px 100%, auto;
  border: 4px solid #9e5b2c;
  border-radius: 8px 8px 20px 20px;
  box-shadow: inset 0 0 0 6px rgba(255, 255, 255, 0.14), 0 10px 0 rgba(37, 40, 68, 0.12);
}

.runner-icon-track::before {
  content: "";
  position: absolute;
  left: 5%;
  right: 10%;
  top: 48%;
  height: 5px;
  background: repeating-linear-gradient(90deg, #fffdf7 0 18px, transparent 18px 34px);
  border-radius: 999px;
}

.runner-icon-finish {
  position: absolute;
  right: 12%;
  bottom: 14%;
  z-index: 4;
  width: 18px;
  height: 48%;
  background: repeating-linear-gradient(45deg, #fffdf7 0 8px, #252844 8px 16px);
  border: 3px solid rgba(37, 40, 68, 0.74);
  border-radius: 8px;
  box-shadow: 0 7px 10px rgba(37, 40, 68, 0.2);
}

.runner-icon-boy,
.runner-icon-monster {
  position: absolute;
  z-index: 3;
  object-fit: contain;
  filter: drop-shadow(0 8px 8px rgba(37, 40, 68, 0.24));
}

.runner-icon-boy {
  left: 15%;
  bottom: 18%;
  width: 32%;
  height: 58%;
}

.runner-icon-monster {
  left: 47%;
  bottom: 18%;
  width: 34%;
  height: 64%;
}

.bowling-icon {
  background:
    radial-gradient(circle at 18% 18%, rgba(255, 217, 109, 0.82), transparent 17%),
    linear-gradient(180deg, #d7f7ff 0%, #ffffff 46%, #d8e5f2 47%, #9fafc3 100%);
}

.game-card-title {
  min-height: 36px;
  font-size: clamp(1.25rem, 2vw, 1.75rem);
  font-weight: 900;
  text-align: center;
}

.game-card-badge {
  min-height: 34px;
  display: inline-grid;
  place-items: center;
  padding: 6px 12px;
  color: #2d6cdf;
  background: #ffffff;
  border: 2px solid rgba(45, 108, 223, 0.2);
  border-radius: 8px;
  font-weight: 900;
}

.auth-area {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  min-width: 0;
}

.auth-area span {
  color: var(--muted);
  font-weight: 900;
  text-align: right;
}

.auth-button {
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 16px;
  color: #ffffff;
  background: #2d6cdf;
  border: 0;
  border-radius: 8px;
  box-shadow: 0 7px 0 #1f4d9e;
  font-weight: 900;
  cursor: pointer;
}

.auth-button[hidden] {
  display: none;
}

.auth-button.secondary {
  color: var(--ink);
  background: #ffffff;
  border: 2px solid rgba(37, 40, 68, 0.14);
  box-shadow: 0 7px 0 rgba(37, 40, 68, 0.12);
}

.auth-button:active {
  transform: translateY(5px);
  box-shadow: 0 2px 0 #1f4d9e;
}

.auth-button.secondary:active {
  box-shadow: 0 2px 0 rgba(37, 40, 68, 0.12);
}

.auth-button:focus-visible {
  outline: 5px solid rgba(45, 108, 223, 0.35);
  outline-offset: 3px;
}

.auth-gate {
  position: fixed;
  inset: 0;
  z-index: 30;
  display: grid;
  place-items: center;
  padding: 18px;
  background: rgba(37, 40, 68, 0.38);
}

.auth-gate[hidden] {
  display: none;
}

.auth-gate-panel {
  width: min(440px, 100%);
  display: grid;
  gap: 14px;
  padding: 24px;
  color: var(--ink);
  background: var(--panel);
  border: 2px solid rgba(37, 40, 68, 0.14);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.auth-gate-panel h2 {
  margin: 0;
  font-size: clamp(1.35rem, 5vw, 2rem);
}

.auth-gate-panel p {
  margin: 0;
  color: var(--muted);
  font-weight: 900;
  line-height: 1.45;
}

.auth-gate-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.topbar {
  min-height: 72px;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto auto auto;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  background: rgba(255, 253, 247, 0.92);
  border: 2px solid rgba(37, 40, 68, 0.12);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.brand-mark {
  width: 58px;
  height: 58px;
  display: grid;
  place-items: center;
  background:
    linear-gradient(180deg, #ffffff, #fff7dc);
  border: 3px solid rgba(37, 40, 68, 0.14);
  border-radius: 8px;
  flex: 0 0 auto;
  box-shadow: inset 0 0 0 4px rgba(255, 255, 255, 0.42), 0 8px 0 rgba(37, 40, 68, 0.1);
}

.brand-mark svg {
  width: 50px;
  height: 50px;
}

.brand-copy {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.brand-copy > span {
  color: var(--muted);
  font-size: 0.95rem;
  font-weight: 900;
  line-height: 1;
}

h1 {
  margin: 0;
  font-size: 1.65rem;
  line-height: 1;
}

.home-legal {
  display: grid;
  grid-template-columns: auto repeat(3, minmax(0, auto));
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 12px;
  background: rgba(255, 253, 247, 0.9);
  border: 2px solid rgba(37, 40, 68, 0.12);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.legal-title {
  color: var(--muted);
  font-weight: 900;
  white-space: nowrap;
}

.legal-link {
  min-height: 52px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  padding: 8px 14px;
  color: var(--ink);
  background: #ffffff;
  border: 2px solid rgba(37, 40, 68, 0.12);
  border-radius: 8px;
  font-weight: 900;
  text-decoration: none;
  box-shadow: 0 7px 0 rgba(37, 40, 68, 0.1);
}

.legal-link svg {
  width: 24px;
  height: 24px;
  color: #2d6cdf;
  flex: 0 0 auto;
}

.contact-link svg {
  color: #2f7c5f;
}

.legal-link:active {
  transform: translateY(5px);
  box-shadow: 0 2px 0 rgba(37, 40, 68, 0.1);
}

.legal-link:focus-visible {
  outline: 5px solid rgba(45, 108, 223, 0.35);
  outline-offset: 3px;
}

.score-card {
  min-width: 112px;
  min-height: 52px;
  display: grid;
  grid-template-columns: auto auto;
  place-items: center;
  gap: 8px;
  padding: 8px 12px;
  background: #ffffff;
  border: 2px solid rgba(37, 40, 68, 0.12);
  border-radius: 8px;
}

.score-card span {
  color: var(--muted);
  font-size: 0.95rem;
}

.score-card strong {
  min-width: 74px;
  font-size: 1.55rem;
  line-height: 1;
  color: #2f7c5f;
  text-align: right;
}

.bus-topbar {
  grid-template-columns: auto minmax(0, 1fr) auto auto auto;
}

.bus-score-card strong {
  min-width: 40px;
}

.bus-stage {
  position: relative;
  display: grid;
  gap: 12px;
  min-height: clamp(500px, calc(100vh - 250px), 650px);
  padding: 14px;
  overflow: hidden;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.7), rgba(255, 255, 255, 0) 40%),
    linear-gradient(180deg, #d7f7ff 0%, #eef9ff 48%, #b9dfb2 49%, #78c685 100%);
  border: 2px solid rgba(37, 40, 68, 0.12);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.bus-question-panel {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  padding: 14px;
  background: rgba(255, 253, 247, 0.94);
  border: 2px solid rgba(37, 40, 68, 0.12);
  border-radius: 8px;
  box-shadow: 0 12px 24px rgba(37, 40, 68, 0.12);
}

.route-chip,
.streak-chip {
  min-height: 72px;
  display: grid;
  place-items: center;
  gap: 2px;
  padding: 8px 14px;
  color: #ffffff;
  background: #f2553f;
  border: 2px solid rgba(37, 40, 68, 0.12);
  border-radius: 8px;
  box-shadow: 0 7px 0 #b73628;
}

.route-chip span,
.streak-chip span {
  font-size: 0.82rem;
  font-weight: 900;
}

.route-chip strong,
.streak-chip strong {
  font-size: clamp(1.55rem, 4vw, 2.35rem);
  line-height: 1;
}

.streak-chip {
  min-width: 94px;
  color: var(--ink);
  background: #ffd96d;
  box-shadow: 0 7px 0 #cda544;
}

.question-copy {
  display: grid;
  gap: 4px;
  min-width: 0;
}

.question-copy span {
  color: var(--muted);
  font-weight: 900;
}

.question-copy strong {
  font-size: clamp(1.15rem, 3vw, 1.8rem);
  line-height: 1.1;
}

.egg-topbar {
  grid-template-columns: auto minmax(0, 1fr) auto auto auto;
}

.egg-score-card strong {
  min-width: 40px;
}

.egg-stage {
  position: relative;
  min-height: clamp(500px, calc(100vh - 250px), 650px);
  overflow: hidden;
  background:
    radial-gradient(circle at 78% 15%, #ffd96d 0 44px, transparent 45px),
    linear-gradient(180deg, #bceeff 0%, #ebfbff 48%, #b9dfb2 49%, #67bd76 100%);
  border: 2px solid rgba(37, 40, 68, 0.12);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.egg-sky,
.egg-field {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.egg-cloud {
  position: absolute;
  width: 156px;
  height: 52px;
  background: rgba(255, 255, 255, 0.88);
  border: 2px solid rgba(37, 40, 68, 0.08);
  border-radius: 8px;
}

.egg-cloud::before,
.egg-cloud::after {
  content: "";
  position: absolute;
  bottom: 17px;
  background: inherit;
  border: inherit;
  border-bottom: 0;
  border-radius: 8px 8px 0 0;
}

.egg-cloud::before {
  left: 20px;
  width: 54px;
  height: 44px;
}

.egg-cloud::after {
  right: 18px;
  width: 62px;
  height: 56px;
}

.cloud-a {
  top: 58px;
  left: 8%;
}

.cloud-b {
  top: 102px;
  right: 10%;
  transform: scale(0.82);
}

.egg-field {
  z-index: 3;
}

.hen-wrap {
  position: absolute;
  left: var(--hen-x, 50%);
  top: var(--hen-y, 73%);
  z-index: 6;
  width: min(360px, 55%);
  transform: translate(-50%, -50%);
  transform-origin: center bottom;
  transition: left 260ms ease, top 260ms ease;
  filter: drop-shadow(0 13px 12px rgba(37, 40, 68, 0.2));
}

.hen-wrap.laying {
  animation: henLayBounce 260ms ease;
}

.hen-art {
  display: block;
  width: 100%;
  height: auto;
  transform-origin: center;
  transition: transform 180ms ease;
}

.hen-wrap.facing-left .hen-art {
  transform: scaleX(-1);
}

.laid-egg {
  position: absolute;
  z-index: 5;
  width: 54px;
  height: 54px;
  transform: translate(-50%, -50%) scale(0.8);
  animation: eggPop 320ms cubic-bezier(.2,.85,.26,1.2) forwards;
  filter: drop-shadow(0 7px 5px rgba(37, 40, 68, 0.16));
}

.laid-egg svg {
  width: 100%;
  height: 100%;
}

.egg-final-score {
  position: absolute;
  inset: 0;
  z-index: 12;
  display: grid;
  place-items: center;
  padding: 20px;
  background: rgba(255, 253, 247, 0.62);
}

.egg-final-score[hidden] {
  display: none;
}

.egg-actions {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
}

.egg-lay-button {
  min-height: 76px;
  grid-template-columns: 42px 58px auto;
}

.egg-lay-button:disabled {
  opacity: 0.55;
  cursor: default;
  transform: none;
}

.egg-action-icon svg {
  width: 54px;
  height: 54px;
}

.ttt-topbar {
  grid-template-columns: auto minmax(0, 1fr) auto auto auto;
}

.ttt-move-card strong {
  min-width: 48px;
}

.ttt-stage {
  position: relative;
  min-height: clamp(500px, calc(100vh - 250px), 650px);
  display: grid;
  grid-template-columns: minmax(250px, 0.44fr) minmax(360px, 0.56fr);
  align-items: center;
  gap: 18px;
  padding: 18px;
  overflow: hidden;
  background:
    radial-gradient(circle at 12% 18%, rgba(255, 217, 109, 0.72) 0 52px, transparent 53px),
    linear-gradient(180deg, #bceeff 0%, #ebfbff 48%, #c8efdf 49%, #82cf8d 100%);
  border: 2px solid rgba(37, 40, 68, 0.12);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.ttt-stage::before {
  content: "";
  position: absolute;
  inset: auto -8% -18% -8%;
  height: 42%;
  background:
    radial-gradient(ellipse at 50% 0%, rgba(255, 253, 247, 0.48), transparent 58%),
    repeating-linear-gradient(112deg, rgba(47, 124, 95, 0.16) 0 10px, transparent 10px 22px);
  pointer-events: none;
}

.ttt-side-panel,
.ttt-board {
  position: relative;
  z-index: 2;
}

.ttt-side-panel {
  display: grid;
  gap: 14px;
}

.ttt-status {
  min-height: 112px;
  display: grid;
  place-items: center;
  padding: 18px;
  color: var(--ink);
  background: rgba(255, 253, 247, 0.95);
  border: 2px solid rgba(37, 40, 68, 0.12);
  border-radius: 8px;
  box-shadow: 0 12px 24px rgba(37, 40, 68, 0.12);
  font-size: clamp(1.2rem, 3vw, 1.85rem);
  font-weight: 900;
  line-height: 1.12;
  text-align: center;
}

.ttt-player-list {
  display: grid;
  gap: 10px;
}

.ttt-player-chip {
  min-height: 72px;
  display: grid;
  grid-template-columns: 54px minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  background: rgba(255, 255, 255, 0.94);
  border: 2px solid rgba(37, 40, 68, 0.12);
  border-radius: 8px;
  box-shadow: 0 7px 0 rgba(37, 40, 68, 0.1);
}

.ttt-player-chip.active {
  background: #fff6cc;
  border-color: rgba(158, 91, 44, 0.34);
  box-shadow: 0 7px 0 #d6ad45;
}

.ttt-player-chip strong,
.ttt-player-chip em {
  font-size: clamp(1.1rem, 2.4vw, 1.42rem);
  font-style: normal;
  font-weight: 900;
}

.ttt-player-chip em {
  min-width: 42px;
  color: #2f7c5f;
  text-align: right;
}

.ttt-mini-piece {
  width: 46px;
  height: 46px;
  display: grid;
  place-items: center;
  border: 2px solid rgba(37, 40, 68, 0.12);
  border-radius: 8px;
  background: #ffffff;
}

.ttt-mini-piece::before {
  content: "";
  width: 30px;
  height: 30px;
  display: block;
  background: currentColor;
}

.ttt-mini-piece.star {
  color: #d99c1b;
}

.ttt-mini-piece.star::before {
  clip-path: polygon(50% 0, 61% 34%, 98% 36%, 68% 57%, 79% 92%, 50% 71%, 21% 92%, 32% 57%, 2% 36%, 39% 34%);
}

.ttt-mini-piece.heart {
  color: #f36f8f;
}

.ttt-mini-piece.heart::before {
  clip-path: polygon(50% 91%, 15% 58%, 7% 36%, 15% 18%, 34% 14%, 50% 29%, 66% 14%, 85% 18%, 93% 36%, 85% 58%);
}

.ttt-mini-piece.moon {
  color: #2f9a96;
}

.ttt-mini-piece.moon::before {
  clip-path: polygon(78% 4%, 55% 8%, 36% 21%, 27% 43%, 35% 66%, 55% 82%, 82% 82%, 66% 95%, 43% 98%, 19% 88%, 5% 66%, 7% 40%, 22% 18%, 48% 5%);
}

.ttt-board {
  width: min(100%, 540px);
  aspect-ratio: 1;
  justify-self: center;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  padding: 14px;
  background: rgba(37, 40, 68, 0.88);
  border: 4px solid rgba(37, 40, 68, 0.18);
  border-radius: 8px;
  box-shadow: 0 18px 32px rgba(37, 40, 68, 0.22);
}

.ttt-cell {
  width: 100%;
  aspect-ratio: 1;
  display: grid;
  place-items: center;
  padding: 8px;
  color: var(--ink);
  background: #fffdf7;
  border: 0;
  border-radius: 8px;
  box-shadow: inset 0 -7px 0 rgba(37, 40, 68, 0.1);
  cursor: pointer;
  touch-action: manipulation;
}

.ttt-cell:not(:disabled):hover,
.ttt-cell:not(:disabled):focus-visible {
  outline: 5px solid rgba(45, 108, 223, 0.34);
  outline-offset: -5px;
}

.ttt-cell:not(:disabled):active {
  transform: translateY(4px);
  box-shadow: inset 0 -3px 0 rgba(37, 40, 68, 0.1);
}

.ttt-cell:disabled {
  cursor: default;
}

.ttt-cell.filled {
  animation: tttPiecePop 240ms cubic-bezier(.2,.85,.26,1.18);
}

.ttt-cell.star {
  background: #fff6cc;
}

.ttt-cell.heart {
  background: #fff1f5;
}

.ttt-cell.moon {
  background: #eafffb;
}

.ttt-cell.winning {
  outline: 7px solid rgba(255, 217, 109, 0.82);
  outline-offset: -7px;
  animation: tttWinPulse 780ms ease-in-out infinite alternate;
}

.ttt-piece {
  width: 74%;
  height: 74%;
  display: block;
  filter: drop-shadow(0 8px 8px rgba(37, 40, 68, 0.16));
}

.ttt-piece.star {
  color: #d99c1b;
}

.ttt-piece.heart {
  color: #f36f8f;
}

.ttt-piece.moon {
  color: #2f9a96;
}

.ttt-final {
  position: absolute;
  inset: 0;
  z-index: 10;
  display: grid;
  place-items: center;
  padding: 20px;
  background: rgba(255, 253, 247, 0.54);
}

.ttt-final[hidden] {
  display: none;
}

.steal-topbar {
  grid-template-columns: auto minmax(0, 1fr) auto auto auto auto;
}

.steal-score-card strong {
  min-width: 44px;
}

.steal-stage {
  position: relative;
  min-height: clamp(500px, calc(100vh - 250px), 650px);
  overflow: hidden;
  background:
    radial-gradient(circle at 14% 18%, rgba(255, 217, 109, 0.9) 0 44px, transparent 45px),
    linear-gradient(180deg, #bceeff 0%, #ecfbff 46%, #ffe7be 47%, #d99c56 100%);
  border: 2px solid rgba(37, 40, 68, 0.12);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.steal-stage.monster-watching {
  background:
    radial-gradient(circle at 14% 18%, rgba(255, 217, 109, 0.9) 0 44px, transparent 45px),
    linear-gradient(180deg, #ffd7df 0%, #fff4f4 46%, #ffe7be 47%, #d99c56 100%);
}

.steal-alert {
  position: absolute;
  top: 18px;
  left: 50%;
  z-index: 12;
  min-width: min(360px, calc(100% - 36px));
  min-height: 62px;
  display: grid;
  place-items: center;
  padding: 10px 18px;
  color: var(--ink);
  background: rgba(255, 253, 247, 0.94);
  border: 2px solid rgba(37, 40, 68, 0.14);
  border-radius: 8px;
  box-shadow: 0 10px 22px rgba(37, 40, 68, 0.14);
  transform: translateX(-50%);
  font-size: clamp(1.1rem, 3vw, 1.7rem);
  font-weight: 900;
  text-align: center;
}

.monster-watching .steal-alert {
  color: #b73628;
  background: #fff1f5;
}

.steal-table {
  position: absolute;
  left: 8%;
  right: 8%;
  bottom: 80px;
  z-index: 4;
  height: 116px;
  background:
    linear-gradient(180deg, #e8a556, #c97b32);
  border: 5px solid #9e5b2c;
  border-radius: 8px;
  box-shadow: 0 16px 0 rgba(74, 45, 32, 0.18);
}

.steal-table::before {
  content: "";
  position: absolute;
  left: 8%;
  right: 8%;
  top: 20px;
  height: 12px;
  background: rgba(255, 253, 247, 0.34);
  border-radius: 999px;
}

.steal-table::after {
  content: "";
  position: absolute;
  left: 13%;
  right: 13%;
  bottom: -54px;
  height: 54px;
  background:
    linear-gradient(90deg, #9e5b2c 0 26px, transparent 26px calc(100% - 26px), #9e5b2c calc(100% - 26px));
}

.steal-kid {
  --steal-growth: 0;
  position: absolute;
  left: 29%;
  bottom: 118px;
  z-index: 6;
  width: min(250px, 34%);
  min-width: 150px;
  display: grid;
  justify-items: center;
  transform: translateX(-50%) scale(calc(1 + var(--steal-growth)));
  transform-origin: center bottom;
  transition: transform 220ms ease;
  filter: drop-shadow(0 13px 12px rgba(37, 40, 68, 0.18));
}

.steal-kid-face {
  position: relative;
  z-index: 3;
  width: 74%;
  aspect-ratio: 1;
  overflow: hidden;
  background: #fff9ed;
  border: 5px solid var(--ink);
  border-radius: 50%;
}

.steal-kid-face img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
}

.steal-kid-body {
  width: 72%;
  height: 92px;
  margin-top: -18px;
  background: #6bd2bd;
  border: 5px solid var(--ink);
  border-radius: 42% 42% 36% 36%;
}

.steal-kid-mouth {
  position: absolute;
  top: 38%;
  width: 28px;
  height: 13px;
  z-index: 4;
  border-bottom: 5px solid #252844;
  border-radius: 0 0 999px 999px;
}

.steal-eating-hand {
  position: absolute;
  left: 51%;
  top: 37%;
  z-index: 7;
  width: min(128px, 45%);
  aspect-ratio: 1 / 1.6;
  display: block;
  opacity: 0;
  transform: translate(62px, 62px) rotate(-18deg) scale(0.58);
  transform-origin: 65% 80%;
  pointer-events: none;
}

.steal-eating-hand img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: contain;
}

.steal-kid-name {
  margin-top: -12px;
  padding: 6px 12px;
  z-index: 5;
  color: var(--ink);
  background: #ffffff;
  border: 2px solid rgba(37, 40, 68, 0.16);
  border-radius: 8px;
  font-weight: 900;
}

.steal-kid.eating .steal-kid-mouth {
  height: 24px;
  border: 5px solid #252844;
  border-top: 0;
  background: #f36f8f;
}

.steal-kid.eating {
  animation: stealEatBounce 640ms ease;
}

.steal-kid.eating .steal-eating-hand {
  opacity: 1;
  transform: translate(-12px, -18px) rotate(-7deg) scale(0.72);
  animation: stealHandFeed 640ms ease-in-out;
}

.steal-kid.caught {
  animation: stealCaughtShake 320ms ease;
}

.steal-kid.smelly .steal-kid-face {
  filter: hue-rotate(70deg) saturate(1.45);
}

.steal-monster {
  position: absolute;
  right: 11%;
  bottom: 118px;
  z-index: 7;
  width: min(270px, 34%);
  min-width: 160px;
  display: grid;
  justify-items: center;
  transition: transform 280ms ease, filter 280ms ease;
  transform-origin: center bottom;
  filter: drop-shadow(0 15px 12px rgba(37, 40, 68, 0.22));
}

.steal-monster-photo {
  position: relative;
  width: 100%;
  display: block;
}

.steal-monster-photo img {
  width: 100%;
  display: block;
}

.steal-monster-back-image {
  display: none;
}

.steal-monster.away {
  transform: translateY(7px) scale(1.02) rotate(-1deg);
}

.steal-monster.away .steal-monster-front-image {
  display: none;
}

.steal-monster.away .steal-monster-back-image {
  display: block;
  filter: saturate(0.98) brightness(0.98);
}

.steal-monster.watching {
  transform: translateY(-4px) scale(1.08) rotate(2deg);
}

.steal-monster.watching .steal-monster-front-image {
  display: block;
}

.steal-monster.watching .steal-monster-back-image {
  display: none;
}

.steal-monster.watching .steal-monster-photo::after {
  content: "";
  position: absolute;
  inset: 19% 23% auto 23%;
  height: 18px;
  background:
    radial-gradient(circle at 28% 50%, rgba(255, 255, 255, 0.95) 0 4px, #f2553f 5px 8px, transparent 9px),
    radial-gradient(circle at 72% 50%, rgba(255, 255, 255, 0.95) 0 4px, #f2553f 5px 8px, transparent 9px);
  filter: drop-shadow(0 0 9px #f2553f);
  pointer-events: none;
}

.steal-monster-back {
  margin-top: -10px;
  padding: 7px 12px;
  color: #ffffff;
  background: #2f7c5f;
  border: 2px solid rgba(37, 40, 68, 0.16);
  border-radius: 8px;
  font-weight: 900;
}

.steal-monster.watching .steal-monster-back {
  color: #ffffff;
  background: #b73628;
}

.steal-icecream {
  position: absolute;
  left: 51%;
  bottom: 154px;
  z-index: 8;
  width: 86px;
  height: 86px;
  display: grid;
  place-items: center;
  transform: translateX(-50%);
}

.steal-icecream svg,
.steal-icecream img {
  width: 86px;
  height: 86px;
  filter: drop-shadow(0 8px 8px rgba(37, 40, 68, 0.16));
}

.steal-effects {
  position: absolute;
  inset: 0;
  z-index: 11;
  pointer-events: none;
}

.steal-snack-effect {
  position: absolute;
  left: 51%;
  bottom: 172px;
  width: 70px;
  height: 70px;
  display: grid;
  place-items: center;
  animation: stealSnackPop 720ms ease-out forwards;
  animation-delay: var(--effect-delay, 0ms);
  opacity: 0;
}

.steal-durian-effect {
  left: 67%;
  width: 88px;
  height: 88px;
  animation-name: stealDurianToss;
}

.steal-snack-effect svg,
.steal-snack-effect img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.steal-final {
  position: absolute;
  inset: 0;
  z-index: 14;
  display: grid;
  place-items: center;
  padding: 20px;
  background: rgba(255, 253, 247, 0.58);
}

.steal-final[hidden] {
  display: none;
}

.steal-actions {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
}

.steal-eat-button {
  min-height: 76px;
  grid-template-columns: 42px 58px auto;
}

.steal-eat-button:disabled {
  opacity: 0.55;
  cursor: default;
  transform: none;
}

.steal-eat-button [data-item-icon] svg,
.steal-eat-button [data-item-icon] img {
  width: 54px;
  height: 54px;
}

.runner-topbar {
  grid-template-columns: auto minmax(0, 1fr) auto auto auto auto;
}

.runner-score-card strong {
  min-width: 54px;
}

.runner-stage {
  position: relative;
  min-height: clamp(500px, calc(100vh - 250px), 650px);
  overflow: hidden;
  isolation: isolate;
  background:
    radial-gradient(circle at 15% 16%, rgba(255, 217, 109, 0.94) 0 46px, transparent 47px),
    linear-gradient(180deg, #bceeff 0%, #f7fdff 40%, #d9f2b6 41%, #72c985 100%);
  border: 2px solid rgba(37, 40, 68, 0.12);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.runner-stage::before,
.runner-stage::after {
  content: "";
  position: absolute;
  top: 62px;
  z-index: 0;
  width: 128px;
  height: 38px;
  background:
    radial-gradient(circle at 24px 25px, #ffffff 0 22px, transparent 23px),
    radial-gradient(circle at 61px 16px, #ffffff 0 30px, transparent 31px),
    radial-gradient(circle at 101px 24px, #ffffff 0 23px, transparent 24px);
  opacity: 0.82;
}

.runner-stage::before {
  left: 12%;
}

.runner-stage::after {
  right: 12%;
  top: 88px;
}

.runner-status {
  position: absolute;
  top: 18px;
  left: 50%;
  z-index: 9;
  min-width: min(430px, calc(100% - 36px));
  min-height: 62px;
  display: grid;
  place-items: center;
  padding: 10px 18px;
  color: var(--ink);
  background: rgba(255, 253, 247, 0.95);
  border: 2px solid rgba(37, 40, 68, 0.14);
  border-radius: 8px;
  box-shadow: 0 10px 22px rgba(37, 40, 68, 0.14);
  transform: translateX(-50%);
  font-size: clamp(1rem, 2.6vw, 1.45rem);
  font-weight: 900;
  text-align: center;
}

.runner-track {
  position: absolute;
  inset: 204px 6% 44px 6%;
  z-index: 2;
  display: grid;
  grid-template-rows: 1fr 1fr;
  gap: 22px;
}

.runner-track::before {
  content: "";
  position: absolute;
  left: 3%;
  right: 3%;
  top: -24px;
  height: 24px;
  background:
    linear-gradient(135deg, var(--strawberry) 0 50%, transparent 51%) 0 0 / 44px 24px repeat-x,
    linear-gradient(225deg, var(--butter) 0 50%, transparent 51%) 22px 0 / 44px 24px repeat-x;
  border-top: 4px solid rgba(37, 40, 68, 0.18);
  opacity: 0.9;
  pointer-events: none;
}

.runner-lane {
  position: relative;
  overflow: visible;
  background:
    linear-gradient(90deg, rgba(255, 255, 255, 0.28) 0 2px, transparent 2px 56px),
    linear-gradient(180deg, #ffc183 0%, #ef8468 100%);
  background-size: 56px 100%, auto;
  border: 5px solid #9e5b2c;
  border-radius: 8px 8px 30px 30px;
  box-shadow: inset 0 0 0 7px rgba(255, 255, 255, 0.14), 0 12px 0 rgba(37, 40, 68, 0.1);
}

.runner-lane::before {
  content: "";
  position: absolute;
  left: 6%;
  right: 8%;
  top: 50%;
  height: 5px;
  background: repeating-linear-gradient(90deg, #fffdf7 0 28px, transparent 28px 52px);
  border-radius: 999px;
  opacity: 0.84;
}

.runner-lane::after {
  content: "";
  position: absolute;
  left: 10px;
  top: 10px;
  bottom: 10px;
  width: 12px;
  background: var(--mint);
  border: 3px solid rgba(37, 40, 68, 0.18);
  border-radius: 999px;
}

.boy-lane {
  border-color: #6a8fdb;
  background:
    linear-gradient(90deg, rgba(255, 255, 255, 0.28) 0 2px, transparent 2px 56px),
    linear-gradient(180deg, #ffc987 0%, #ed8669 100%);
}

.monster-lane {
  border-color: #c85f7a;
  background:
    linear-gradient(90deg, rgba(255, 255, 255, 0.28) 0 2px, transparent 2px 56px),
    linear-gradient(180deg, #ffb884 0%, #ec775f 100%);
}

.monster-lane::after {
  background: var(--strawberry);
}

.runner-progress {
  position: absolute;
  left: 6%;
  right: 8%;
  bottom: 14px;
  z-index: 2;
  height: 14px;
  overflow: hidden;
  background: rgba(255, 253, 247, 0.62);
  border: 2px solid rgba(37, 40, 68, 0.16);
  border-radius: 999px;
}

.runner-progress span {
  display: block;
  width: 0;
  height: 100%;
  background: linear-gradient(90deg, #6bd2bd, #2d6cdf);
  border-radius: inherit;
  transition: width 140ms ease;
}

.monster-progress span {
  background: linear-gradient(90deg, #ffd96d, #f36f8f);
}

.runner-finish {
  position: absolute;
  right: 9.2%;
  top: 204px;
  bottom: 44px;
  z-index: 6;
  width: 26px;
  background:
    repeating-linear-gradient(45deg, #fffdf7 0 13px, #252844 13px 26px);
  border: 3px solid rgba(37, 40, 68, 0.62);
  border-radius: 8px;
  box-shadow: 0 10px 18px rgba(37, 40, 68, 0.18);
}

.runner-racer {
  position: absolute;
  left: 8%;
  bottom: 32px;
  z-index: 5;
  width: min(178px, 22%);
  min-width: 118px;
  display: grid;
  justify-items: center;
  transform: translateX(-50%);
  transform-origin: center bottom;
  transition: left 120ms ease;
  filter: drop-shadow(0 12px 12px rgba(0, 0, 0, 0.22));
}

.runner-racer::before {
  content: "";
  position: absolute;
  top: 51%;
  z-index: 1;
  width: 86%;
  height: 16px;
  background: var(--butter);
  border: 4px solid var(--ink);
  border-radius: 999px;
  transform: rotate(-9deg);
}

.runner-monster-racer::before {
  background: #ffbdd0;
  transform: rotate(8deg);
}

.runner-face {
  position: relative;
  z-index: 3;
  width: 78%;
  aspect-ratio: 1;
  overflow: hidden;
  background: #fff9ed;
  border: 5px solid var(--ink);
  border-radius: 50%;
  box-shadow: inset 0 -8px 0 rgba(37, 40, 68, 0.08);
}

.runner-face img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
  object-position: center 20%;
}

.monster-face {
  border-radius: 32%;
  background: #fff1f5;
}

.runner-monster-racer .runner-face img {
  object-fit: cover;
  object-position: 50% 14%;
}

.runner-body {
  position: relative;
  z-index: 2;
  width: 66%;
  height: 60px;
  margin-top: -13px;
  background:
    radial-gradient(circle at 50% 18%, rgba(255, 255, 255, 0.3) 0 16%, transparent 17%),
    linear-gradient(180deg, #6bd2bd 0%, #2d6cdf 100%);
  border: 5px solid var(--ink);
  border-radius: 34% 34% 44% 44%;
}

.monster-body {
  background:
    radial-gradient(circle at 50% 18%, rgba(255, 255, 255, 0.3) 0 16%, transparent 17%),
    linear-gradient(180deg, #f36f8f 0%, #a84cc2 100%);
}

.runner-body::before,
.runner-body::after {
  content: "";
  position: absolute;
  bottom: -14px;
  width: 34%;
  height: 19px;
  background: #fff9ed;
  border: 4px solid var(--ink);
  border-radius: 999px;
}

.runner-body::before {
  left: 10%;
  transform: rotate(20deg);
}

.runner-body::after {
  right: 10%;
  transform: rotate(-22deg);
}

.runner-name {
  margin-top: 10px;
  padding: 7px 12px;
  z-index: 4;
  max-width: 100%;
  color: var(--ink);
  background: rgba(255, 253, 247, 0.96);
  border: 2px solid rgba(37, 40, 68, 0.16);
  border-radius: 8px;
  font-weight: 900;
  text-align: center;
  overflow-wrap: anywhere;
}

.runner-racer.running {
  animation: runnerStride 170ms ease;
}

.runner-racer.winner .runner-name {
  background: #ffd96d;
}

.runner-racer.winner .runner-face {
  box-shadow: 0 0 0 7px rgba(255, 217, 109, 0.52), inset 0 -8px 0 rgba(37, 40, 68, 0.08);
}

.runner-final {
  position: absolute;
  inset: 0;
  z-index: 14;
  display: grid;
  place-items: center;
  padding: 20px;
  background: rgba(255, 253, 247, 0.58);
}

.runner-final[hidden] {
  display: none;
}

.runner-controls {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.runner-run-button {
  min-height: 82px;
  grid-template-columns: 36px minmax(74px, auto) minmax(0, auto);
}

.runner-run-button:disabled {
  opacity: 0.55;
  cursor: default;
  transform: none;
}

.runner-key {
  min-width: 74px;
  min-height: 42px;
  display: inline-grid;
  place-items: center;
  padding: 6px 10px;
  color: var(--ink);
  background: #ffffff;
  border: 2px solid rgba(37, 40, 68, 0.14);
  border-radius: 8px;
  font-size: 0.9rem;
  font-weight: 900;
  text-align: center;
}

.monster-run-button .runner-key {
  color: #8c243d;
  background: #fff1f5;
}

.bowling-topbar {
  grid-template-columns: auto minmax(0, 1fr) auto auto auto;
}

.bowling-score-card strong {
  min-width: 48px;
}

.bowling-stage {
  position: relative;
  min-height: clamp(500px, calc(100vh - 250px), 650px);
  overflow: hidden;
  background:
    radial-gradient(circle at 14% 16%, rgba(255, 217, 109, 0.9) 0 44px, transparent 45px),
    linear-gradient(180deg, #bceeff 0%, #f7fdff 40%, #e8eef6 41%, #abb8c8 100%);
  border: 2px solid rgba(37, 40, 68, 0.12);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.bowling-stage::before,
.bowling-stage::after {
  content: "";
  position: absolute;
  top: 72px;
  width: 126px;
  height: 36px;
  background:
    radial-gradient(circle at 24px 24px, #ffffff 0 22px, transparent 23px),
    radial-gradient(circle at 60px 16px, #ffffff 0 29px, transparent 30px),
    radial-gradient(circle at 98px 24px, #ffffff 0 22px, transparent 23px);
  opacity: 0.78;
}

.bowling-stage::before {
  left: 10%;
}

.bowling-stage::after {
  right: 9%;
  top: 112px;
}

.bowling-status {
  position: absolute;
  top: 18px;
  left: 50%;
  z-index: 9;
  min-width: min(430px, calc(100% - 36px));
  min-height: 62px;
  display: grid;
  place-items: center;
  padding: 10px 18px;
  color: var(--ink);
  background: rgba(255, 253, 247, 0.95);
  border: 2px solid rgba(37, 40, 68, 0.14);
  border-radius: 8px;
  box-shadow: 0 10px 22px rgba(37, 40, 68, 0.14);
  transform: translateX(-50%);
  font-size: clamp(1rem, 2.6vw, 1.45rem);
  font-weight: 900;
  text-align: center;
}

.bowling-lane {
  position: absolute;
  left: 8%;
  right: 8%;
  bottom: 42px;
  top: 106px;
  overflow: hidden;
  background:
    linear-gradient(90deg, transparent 0 15%, rgba(255, 255, 255, 0.32) 15% 17%, transparent 17% 83%, rgba(255, 255, 255, 0.32) 83% 85%, transparent 85%),
    repeating-linear-gradient(180deg, rgba(255, 255, 255, 0.14) 0 18px, transparent 18px 56px),
    linear-gradient(180deg, #f1c57f, #d68a43);
  border: 5px solid #9e5b2c;
  border-radius: 8px 8px 36px 36px;
  box-shadow: inset 0 0 0 8px rgba(255, 255, 255, 0.12), 0 18px 0 rgba(74, 45, 32, 0.14);
}

.bowling-lane::before {
  content: "";
  position: absolute;
  left: 20%;
  right: 20%;
  top: 12px;
  height: 72px;
  background: linear-gradient(180deg, rgba(37, 40, 68, 0.16), transparent);
  border-radius: 50% 50% 12px 12px;
}

.bowling-pins {
  position: absolute;
  left: 50%;
  top: 42px;
  z-index: 4;
  width: min(310px, 58%);
  height: 176px;
  transform: translateX(-50%);
}

.bowling-pin {
  position: absolute;
  width: 42px;
  height: 98px;
  background:
    linear-gradient(180deg, transparent 0 30px, #f36f8f 30px 40px, transparent 40px),
    linear-gradient(180deg, #ffffff, #fff7e4);
  border: 4px solid var(--ink);
  border-radius: 50% 50% 42% 42%;
  box-shadow: inset 0 9px 0 rgba(255, 255, 255, 0.7), 0 8px 9px rgba(37, 40, 68, 0.18);
  transform-origin: center bottom;
  transition: transform 280ms ease, opacity 260ms ease;
}

.bowling-pin::before {
  content: "";
  position: absolute;
  left: 50%;
  top: 9px;
  width: 20px;
  height: 13px;
  background: #fffdf7;
  border: 3px solid var(--ink);
  border-radius: 50%;
  transform: translateX(-50%);
}

.bowling-pin[data-pin="0"] {
  left: calc(50% - 21px);
  top: 0;
}

.bowling-pin[data-pin="1"] {
  left: calc(38% - 21px);
  top: 54px;
}

.bowling-pin[data-pin="2"] {
  left: calc(62% - 21px);
  top: 54px;
}

.bowling-pin[data-pin="3"] {
  left: calc(26% - 21px);
  top: 108px;
}

.bowling-pin[data-pin="4"] {
  left: calc(50% - 21px);
  top: 108px;
}

.bowling-pin[data-pin="5"] {
  left: calc(74% - 21px);
  top: 108px;
}

.bowling-pin.knocked {
  opacity: 0.78;
  transform: translate(var(--pin-fall-x, 18px), 24px) rotate(var(--pin-fall-rotation, 64deg));
}

.bowling-pin[data-pin="0"].knocked,
.bowling-pin[data-pin="4"].knocked {
  --pin-fall-x: -16px;
  --pin-fall-rotation: -70deg;
}

.bowling-pin[data-pin="2"].knocked,
.bowling-pin[data-pin="5"].knocked {
  --pin-fall-x: 26px;
  --pin-fall-rotation: 72deg;
}

.bowling-ball {
  position: absolute;
  left: 50%;
  bottom: 24px;
  z-index: 5;
  width: 92px;
  height: 92px;
  background:
    radial-gradient(circle at 36% 30%, #ffffff 0 4px, transparent 5px),
    radial-gradient(circle at 52% 25%, #ffffff 0 4px, transparent 5px),
    radial-gradient(circle at 51% 42%, #ffffff 0 4px, transparent 5px),
    radial-gradient(circle at 32% 28%, rgba(255, 255, 255, 0.48), transparent 28%),
    linear-gradient(135deg, #2d6cdf, #6bd2bd);
  border: 5px solid var(--ink);
  border-radius: 50%;
  box-shadow: 0 14px 0 rgba(37, 40, 68, 0.16);
  transform: translateX(-50%);
}

.bowling-ball.rolling {
  animation: bowlingRoll 760ms ease-in forwards;
}

.bowling-final {
  position: absolute;
  inset: 0;
  z-index: 14;
  display: grid;
  place-items: center;
  padding: 20px;
  background: rgba(255, 253, 247, 0.62);
}

.bowling-final[hidden] {
  display: none;
}

.bowling-actions {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
}

.bowling-roll-button {
  min-height: 82px;
  grid-template-columns: 42px 58px auto;
}

.bowling-roll-button:disabled {
  opacity: 0.55;
  cursor: default;
  transform: none;
}

.bowling-ball-icon {
  width: 50px;
  height: 50px;
  display: inline-block;
  background:
    radial-gradient(circle at 36% 30%, #ffffff 0 3px, transparent 4px),
    radial-gradient(circle at 52% 25%, #ffffff 0 3px, transparent 4px),
    radial-gradient(circle at 51% 42%, #ffffff 0 3px, transparent 4px),
    linear-gradient(135deg, #2d6cdf, #6bd2bd);
  border: 3px solid var(--ink);
  border-radius: 50%;
}

.bus-answer-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.bus-answer-button {
  min-height: 112px;
  padding: 12px;
  color: var(--ink);
  background: rgba(255, 255, 255, 0.96);
  border: 2px solid rgba(37, 40, 68, 0.14);
  border-radius: 8px;
  box-shadow: 0 7px 0 rgba(37, 40, 68, 0.12);
  cursor: pointer;
  text-align: left;
}

.bus-answer-button strong {
  display: block;
  margin-bottom: 6px;
  font-size: clamp(1.12rem, 2.4vw, 1.38rem);
  line-height: 1.14;
}

.bus-answer-button span {
  color: var(--muted);
  font-size: clamp(1rem, 2vw, 1.16rem);
  line-height: 1.18;
  font-weight: 900;
}

.bus-answer-button.correct {
  border-color: rgba(47, 124, 95, 0.5);
  background: #ecfff7;
}

.bus-answer-button.wrong {
  border-color: rgba(182, 70, 103, 0.5);
  background: #fff1f5;
}

.bus-answer-button:disabled {
  cursor: default;
}

.bus-answer-button:focus-visible {
  outline: 5px solid rgba(45, 108, 223, 0.35);
  outline-offset: 3px;
}

.bus-answer-button:active:not(:disabled) {
  transform: translateY(5px);
  box-shadow: 0 2px 0 rgba(37, 40, 68, 0.12);
}

.bus-result-card {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(260px, 0.65fr);
  align-items: stretch;
  gap: 12px;
  min-height: 220px;
}

.bus-result-card[hidden] {
  display: none;
}

.bus-photo-wrap {
  position: relative;
  min-height: 220px;
  overflow: hidden;
  background: #252844;
  border: 2px solid rgba(37, 40, 68, 0.16);
  border-radius: 8px;
  box-shadow: 0 12px 24px rgba(37, 40, 68, 0.16);
}

.bus-photo-wrap img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
}

.bus-sign-overlay {
  position: absolute;
  top: 25%;
  right: 12%;
  width: min(230px, 32%);
  min-height: 72px;
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 2px 8px;
  align-items: center;
  padding: 8px 12px;
  color: #ffffff;
  background: rgba(17, 24, 34, 0.86);
  border: 2px solid rgba(255, 255, 255, 0.28);
  border-radius: 8px;
  text-shadow: 0 0 8px rgba(255, 255, 255, 0.85);
}

.bus-sign-overlay span {
  font-size: 0.88rem;
  font-weight: 900;
}

.bus-sign-overlay strong {
  grid-row: span 2;
  font-size: clamp(1.55rem, 4vw, 3.1rem);
  line-height: 0.9;
}

.bus-sign-overlay em {
  grid-column: 1 / -1;
  font-size: clamp(0.74rem, 1.8vw, 1.05rem);
  font-style: normal;
  font-weight: 900;
  line-height: 1.1;
}

.bus-result-copy {
  display: grid;
  align-content: center;
  gap: 8px;
  padding: 18px;
  background: rgba(255, 253, 247, 0.94);
  border: 2px solid rgba(37, 40, 68, 0.12);
  border-radius: 8px;
}

.bus-result-copy span {
  color: #2f7c5f;
  font-weight: 900;
}

.bus-result-copy strong {
  font-size: clamp(1.05rem, 2.4vw, 1.5rem);
  line-height: 1.18;
}

.route-feedback {
  position: absolute;
  top: 20px;
  right: 20px;
  z-index: 8;
  width: 104px;
  height: 104px;
  display: grid;
  place-items: center;
  pointer-events: none;
  opacity: 0;
  transform: scale(0.8);
}

.route-feedback svg {
  width: 100%;
  height: 100%;
  filter: drop-shadow(0 12px 16px rgba(37, 40, 68, 0.24));
}

.route-feedback.show {
  animation: feedbackPop 850ms ease both;
}

.thumb-burst {
  position: absolute;
  inset: 0;
  z-index: 12;
  display: grid;
  place-items: center;
  background: rgba(37, 40, 68, 0.18);
  pointer-events: none;
}

.thumb-burst[hidden] {
  display: none;
}

.thumb-panel {
  width: min(340px, calc(100% - 40px));
  display: grid;
  place-items: center;
  gap: 8px;
  padding: 22px;
  color: var(--ink);
  background: rgba(255, 253, 247, 0.97);
  border: 3px solid #ffd96d;
  border-radius: 8px;
  box-shadow: var(--shadow);
  animation: finalPop 420ms ease both;
}

.thumb-panel svg {
  width: 138px;
  height: 138px;
}

.thumb-panel strong {
  font-size: clamp(1.45rem, 5vw, 2.4rem);
}

.bus-final-score {
  position: absolute;
  inset: 0;
  z-index: 10;
  display: grid;
  place-items: center;
  padding: 20px;
  background: rgba(255, 253, 247, 0.76);
}

.bus-final-score[hidden] {
  display: none;
}

.bus-actions {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
}

.bus-next-button {
  min-height: 72px;
  grid-template-columns: 42px auto;
}

.bus-next-button:disabled {
  opacity: 0.55;
  cursor: default;
  transform: none;
}

.round-action {
  min-height: 52px;
  min-width: 116px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 0 16px;
  color: #ffffff;
  border: 0;
  border-radius: 8px;
  background: #2d6cdf;
  box-shadow: 0 8px 0 #1f4d9e;
  cursor: pointer;
}

.round-action svg {
  width: 24px;
  height: 24px;
}

.round-action:active {
  transform: translateY(5px);
  box-shadow: 0 3px 0 #1f4d9e;
}

.home-action {
  min-width: 108px;
  background: #2f7c5f;
  box-shadow: 0 8px 0 #1f5742;
}

.home-action:active {
  box-shadow: 0 3px 0 #1f5742;
}

.settings-action {
  min-width: 120px;
  color: var(--ink);
  background: #ffd96d;
  box-shadow: 0 8px 0 #cda544;
}

.settings-action:active {
  box-shadow: 0 3px 0 #cda544;
}

.reset-action {
  color: var(--ink);
  background: #ffffff;
  border: 2px solid rgba(37, 40, 68, 0.12);
  box-shadow: 0 8px 0 rgba(37, 40, 68, 0.18);
}

.reset-action:active {
  box-shadow: 0 3px 0 rgba(37, 40, 68, 0.18);
}

.stage {
  position: relative;
  height: clamp(470px, calc(100vh - 250px), 590px);
  min-height: 0;
  overflow: hidden;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.38), rgba(255, 255, 255, 0) 28%),
    linear-gradient(180deg, var(--sky) 0%, #ecfbff 62%, var(--grass) 63%, #66bd79 100%);
  border: 2px solid rgba(37, 40, 68, 0.12);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.wall {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.cloud {
  position: absolute;
  display: block;
  width: 160px;
  height: 54px;
  background: #ffffff;
  border: 2px solid rgba(37, 40, 68, 0.08);
  border-radius: 8px;
  opacity: 0.8;
}

.cloud::before,
.cloud::after {
  content: "";
  position: absolute;
  bottom: 18px;
  background: inherit;
  border: inherit;
  border-bottom: 0;
  border-radius: 8px 8px 0 0;
}

.cloud::before {
  left: 22px;
  width: 56px;
  height: 46px;
}

.cloud::after {
  right: 20px;
  width: 64px;
  height: 58px;
}

.cloud-one {
  top: 64px;
  left: 8%;
}

.cloud-two {
  top: 92px;
  right: 9%;
  transform: scale(0.88);
}

.garland {
  position: absolute;
  top: 24px;
  left: 50%;
  width: min(620px, 68%);
  height: 42px;
  transform: translateX(-50%);
  background:
    linear-gradient(135deg, transparent 49%, rgba(37, 40, 68, 0.22) 50%, transparent 51%) 0 0 / 38px 28px repeat-x,
    linear-gradient(225deg, transparent 49%, rgba(37, 40, 68, 0.22) 50%, transparent 51%) 0 0 / 38px 28px repeat-x;
}

.table-rail {
  position: absolute;
  left: -4%;
  right: -4%;
  bottom: 52px;
  height: 158px;
  background:
    repeating-linear-gradient(90deg, rgba(255, 240, 186, 0.18) 0 14px, transparent 14px 74px),
    linear-gradient(180deg, #e8a556, var(--table));
  border-top: 9px solid #f3c774;
  box-shadow: inset 0 8px 0 rgba(255, 255, 255, 0.25), 0 -10px 26px rgba(37, 40, 68, 0.12);
  border-radius: 50% 50% 0 0 / 22% 22% 0 0;
  z-index: 3;
}

.drop-zone {
  position: absolute;
  inset: 0;
  z-index: 8;
  pointer-events: none;
}

.friend-row {
  position: absolute;
  left: 4%;
  right: 4%;
  bottom: 24px;
  z-index: 5;
  display: grid;
  grid-template-columns: minmax(0, 0.9fr) minmax(220px, 1.18fr) minmax(0, 0.9fr);
  align-items: end;
  gap: 12px;
}

.friend {
  --feed-count: 0;
  position: relative;
  min-height: 320px;
  display: grid;
  place-items: end center;
  padding: 0 10px 8px;
  color: var(--ink);
  background: transparent;
  border: 0;
  border-radius: 8px;
  cursor: pointer;
  touch-action: manipulation;
}

.friend:focus-visible,
.push-button:focus-visible,
.round-action:focus-visible,
.monster-button:focus-visible,
.icon-close-button:focus-visible,
.field-label input:focus-visible,
.field-label select:focus-visible,
.photo-field input:focus-visible {
  outline: 5px solid rgba(45, 108, 223, 0.35);
  outline-offset: 3px;
}

.friend::after {
  content: "";
  position: absolute;
  left: 10%;
  right: 10%;
  bottom: 14px;
  height: 18px;
  background: rgba(37, 40, 68, 0.14);
  border-radius: 50%;
  filter: blur(3px);
  z-index: -1;
}

.friend:hover,
.friend:focus-visible {
  background: rgba(255, 255, 255, 0.18);
}

.friend.wrong-pick {
  animation: wrongShake 260ms ease;
}

.friend.munch .character-art {
  animation: munchBounce 520ms ease;
}

.friend.smelly .boy-art {
  animation: smellyWobble 520ms ease-in-out infinite;
}

.friend.smelly .boy-art img {
  filter: drop-shadow(0 9px 11px rgba(37, 40, 68, 0.2)) saturate(1.18) hue-rotate(42deg);
}

.friend.spicy .character-art {
  animation: spicyShake 380ms ease-in-out infinite;
  filter: saturate(1.4) drop-shadow(0 0 12px rgba(242, 85, 63, 0.34));
}

.friend.spicy .character-art::after {
  content: "";
  position: absolute;
  left: 50%;
  top: 12%;
  width: 40px;
  height: 52px;
  transform: translate(-50%, -50%);
  background:
    radial-gradient(circle at 50% 70%, #ffd96d 0 22%, transparent 23%),
    linear-gradient(180deg, #f2553f 0%, #ff9f43 72%, transparent 73%);
  clip-path: polygon(50% 0, 72% 31%, 94% 22%, 79% 61%, 100% 100%, 50% 80%, 0 100%, 21% 61%, 6% 22%, 28% 31%);
  opacity: 0.9;
  pointer-events: none;
}

.character-art {
  display: block;
  position: relative;
  transform-origin: center bottom;
  transform: scale(calc(1 + var(--feed-count) * 0.028));
  transition: transform 260ms ease;
}

.character-art svg {
  width: min(228px, 100%);
  height: auto;
  display: block;
  overflow: visible;
  filter: drop-shadow(0 8px 10px rgba(37, 40, 68, 0.18));
}

.belly {
  transform-box: fill-box;
  transform-origin: center bottom;
  transform: scaleX(calc(1 + var(--feed-count) * 0.055)) scaleY(calc(1 + var(--feed-count) * 0.025));
  transition: transform 260ms ease;
}

.boy-art {
  width: min(312px, 100%);
  max-height: 360px;
  overflow: visible;
}

.boy-art img {
  display: block;
  width: 100%;
  height: auto;
  filter: drop-shadow(0 9px 11px rgba(37, 40, 68, 0.2));
  pointer-events: none;
  user-select: none;
}

.matching-token {
  position: absolute;
  top: 4px;
  right: 16px;
  width: 70px;
  height: 70px;
  display: grid;
  place-items: center;
  background: rgba(255, 255, 255, 0.92);
  border: 2px solid rgba(37, 40, 68, 0.12);
  border-radius: 8px;
  box-shadow: 0 8px 14px rgba(37, 40, 68, 0.12);
  z-index: 9;
}

.matching-token svg,
.matching-token img {
  width: 54px;
  height: 54px;
  object-fit: contain;
}

.friend-name {
  position: absolute;
  left: 50%;
  bottom: 0;
  transform: translate(-50%, 52%);
  min-width: 96px;
  padding: 8px 12px;
  color: var(--ink);
  background: rgba(255, 255, 255, 0.96);
  border: 2px solid rgba(37, 40, 68, 0.12);
  border-radius: 8px;
  font-weight: 800;
  text-align: center;
  box-shadow: 0 8px 14px rgba(37, 40, 68, 0.12);
}

.mouth {
  position: absolute;
  width: 12px;
  height: 12px;
  pointer-events: none;
}

.bunny-mouth {
  left: 50%;
  top: 42%;
}

.boy-mouth {
  left: 50%;
  top: 31%;
}

.kitten-mouth {
  left: 50%;
  top: 42%;
}

.falling-item {
  position: absolute;
  left: 50%;
  top: -110px;
  width: 98px;
  height: 98px;
  display: grid;
  place-items: center;
  transform: translate(-50%, -50%);
  filter: drop-shadow(0 11px 10px rgba(37, 40, 68, 0.2));
  animation: itemDrop var(--drop-duration, 4300ms) linear forwards;
  will-change: top, transform;
}

.falling-item svg,
.falling-item img,
.bonus-feed-item svg,
.bonus-feed-item img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.monster-button {
  position: absolute;
  left: var(--monster-x, 50%);
  top: var(--monster-y, 23%);
  z-index: 19;
  width: 206px;
  min-height: 250px;
  display: grid;
  place-items: center;
  gap: 6px;
  padding: 0;
  color: var(--ink);
  background: transparent;
  border: 0;
  border-radius: 0;
  box-shadow: none;
  cursor: default;
  transform: translate(-50%, -50%) scale(0.82);
  pointer-events: none;
  touch-action: none;
}

.monster-button[hidden] {
  display: none;
}

.monster-button.show {
  animation: monsterPop 520ms cubic-bezier(.2,.85,.26,1.18) both;
}

.monster-button:active {
  transform: translate(-50%, calc(-50% + 5px)) scale(0.96);
  box-shadow: 0 5px 0 rgba(37, 40, 68, 0.18);
}

.monster-visitor {
  position: absolute;
  z-index: 22;
  width: 266px;
  min-height: 330px;
  display: grid;
  place-items: center;
  gap: 4px;
  padding: 0;
  color: var(--ink);
  background: transparent;
  border: 0;
  border-radius: 0;
  box-shadow: none;
  transform: translate(-50%, -50%) scale(0.9);
  pointer-events: none;
}

.monster-photo-wrap {
  position: relative;
  display: block;
  width: 100%;
  filter: drop-shadow(0 14px 14px rgba(37, 40, 68, 0.24));
}

.monster-button .monster-photo-wrap {
  width: 190px;
  animation: monsterMischief 1350ms ease-in-out infinite;
}

.monster-visitor .monster-photo-wrap {
  width: 252px;
}

.monster-image {
  display: block;
  width: 100%;
  height: auto;
  pointer-events: none;
  user-select: none;
}

.monster-visitor.feeding .monster-image {
  animation: monsterForceFeed 240ms ease-in-out;
}

.monster-visitor.feeding-bunny.feeding .monster-image {
  animation-name: monsterForceFeedLeft;
}

.monster-visitor.feeding-kitten.feeding .monster-image {
  animation-name: monsterForceFeedRight;
}

.monster-feed-point {
  position: absolute;
  left: 52%;
  top: 38%;
  width: 18px;
  height: 18px;
  transform: translate(-50%, -50%);
  pointer-events: none;
}

.monster-label {
  display: block;
  padding: 5px 9px;
  color: var(--ink);
  background: rgba(255, 255, 255, 0.94);
  border: 2px solid rgba(37, 40, 68, 0.14);
  border-radius: 8px;
  font-size: 1rem;
  font-weight: 900;
  line-height: 1;
  box-shadow: 0 5px 9px rgba(37, 40, 68, 0.13);
}

.monster-visitor .monster-label {
  margin-top: -12px;
  font-size: 1.08rem;
}

.bonus-feed-item {
  position: absolute;
  z-index: 21;
  width: 74px;
  height: 74px;
  display: grid;
  place-items: center;
  filter: drop-shadow(0 8px 9px rgba(37, 40, 68, 0.19));
  pointer-events: none;
}

.bonus-feed-item.item-chilli {
  width: 178px;
  height: 178px;
  filter: drop-shadow(0 11px 10px rgba(126, 35, 26, 0.28));
}

.smell-puff {
  position: absolute;
  z-index: 23;
  min-width: 72px;
  padding: 7px 9px;
  color: #245735;
  font-size: 0.86rem;
  font-weight: 900;
  text-align: center;
  background: #bde66f;
  border: 3px solid #5f8f34;
  border-radius: 8px;
  box-shadow: 0 8px 14px rgba(37, 40, 68, 0.14);
  transform: translate(-50%, -50%);
  pointer-events: none;
  animation: smellFloat 940ms ease-out forwards;
}

.spicy-puff {
  position: absolute;
  z-index: 24;
  min-width: 68px;
  padding: 7px 10px;
  color: #7b1f14;
  font-size: 0.92rem;
  font-weight: 900;
  text-align: center;
  background: #ffd96d;
  border: 3px solid #f2553f;
  border-radius: 8px;
  box-shadow: 0 8px 14px rgba(126, 35, 26, 0.18);
  transform: translate(-50%, -50%);
  pointer-events: none;
  animation: spicyFloat 860ms ease-out forwards;
}

.falling-item.route {
  z-index: 16;
  animation: none;
}

.falling-item.missed {
  animation: missedPop 280ms ease forwards;
}

.feedback-signal {
  position: absolute;
  left: 50%;
  top: 26%;
  z-index: 18;
  width: 96px;
  height: 96px;
  display: grid;
  place-items: center;
  pointer-events: none;
  opacity: 0;
  transform: translate(-50%, -50%) scale(0.6);
}

.feedback-signal svg {
  width: 92px;
  height: 92px;
}

.feedback-signal.show {
  animation: signalPop 620ms ease forwards;
}

.final-score {
  position: absolute;
  inset: 0;
  z-index: 24;
  display: grid;
  place-items: center;
  padding: 20px;
  background: rgba(255, 253, 247, 0.62);
}

.final-score[hidden] {
  display: none;
}

.final-score-panel {
  width: min(420px, 92%);
  min-height: 230px;
  display: grid;
  place-items: center;
  gap: 10px;
  padding: 28px 20px;
  color: var(--ink);
  text-align: center;
  background: #ffffff;
  border: 4px solid #ffd96d;
  border-radius: 8px;
  box-shadow: 0 18px 38px rgba(37, 40, 68, 0.24);
  animation: finalPop 480ms cubic-bezier(.2,.85,.26,1.2);
}

.final-score-panel span {
  color: #2d6cdf;
  font-size: 1.35rem;
  font-weight: 900;
}

.final-score-panel strong {
  color: #2f7c5f;
  font-size: clamp(3rem, 8vw, 5.4rem);
  line-height: 0.95;
}

.final-score-panel em {
  color: var(--muted);
  font-size: 1.05rem;
  font-style: normal;
  font-weight: 800;
}

.settings-modal {
  position: fixed;
  inset: 0;
  z-index: 80;
  display: grid;
  place-items: center;
  padding: 18px;
  background: rgba(37, 40, 68, 0.46);
}

.settings-modal[hidden] {
  display: none;
}

.settings-panel {
  width: min(760px, 100%);
  max-height: min(92vh, 760px);
  overflow: auto;
  display: grid;
  gap: 14px;
  padding: 18px;
  color: var(--ink);
  background: #fffdf7;
  border: 4px solid #ffd96d;
  border-radius: 8px;
  box-shadow: 0 26px 58px rgba(37, 40, 68, 0.32);
}

.settings-panel-head {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
}

.settings-panel h2,
.settings-panel h3 {
  margin: 0;
  line-height: 1;
}

.settings-panel h2 {
  font-size: 1.45rem;
}

.settings-panel h3 {
  font-size: 1.02rem;
}

.icon-close-button {
  width: 48px;
  height: 48px;
  display: grid;
  place-items: center;
  color: var(--ink);
  background: #ffffff;
  border: 2px solid rgba(37, 40, 68, 0.14);
  border-radius: 8px;
  box-shadow: 0 6px 0 rgba(37, 40, 68, 0.14);
  cursor: pointer;
}

.icon-close-button svg {
  width: 24px;
  height: 24px;
}

.icon-close-button:active {
  transform: translateY(4px);
  box-shadow: 0 2px 0 rgba(37, 40, 68, 0.14);
}

.settings-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 0.82fr);
  gap: 12px;
}

.settings-section {
  display: grid;
  gap: 12px;
  align-content: start;
  padding: 14px;
  background: #ffffff;
  border: 2px solid rgba(37, 40, 68, 0.12);
  border-radius: 8px;
}

.field-label,
.photo-field {
  display: grid;
  gap: 7px;
  color: var(--ink);
  font-weight: 900;
}

.field-label input,
.field-label select {
  width: 100%;
  min-height: 48px;
  padding: 9px 11px;
  color: var(--ink);
  background: #fffdf7;
  border: 2px solid rgba(37, 40, 68, 0.16);
  border-radius: 8px;
  font: inherit;
}

.photo-field {
  cursor: pointer;
}

.photo-field img {
  width: 100%;
  aspect-ratio: 1 / 1;
  object-fit: contain;
  background:
    linear-gradient(135deg, rgba(255, 217, 109, 0.18), rgba(107, 210, 189, 0.16)),
    #fffdf7;
  border: 2px dashed rgba(37, 40, 68, 0.22);
  border-radius: 8px;
  padding: 10px;
}

.photo-field input {
  width: 100%;
  min-height: 46px;
  padding: 8px;
  color: var(--ink);
  background: #fffdf7;
  border: 2px solid rgba(37, 40, 68, 0.16);
  border-radius: 8px;
  font: inherit;
  font-weight: 800;
}

.settings-status {
  min-height: 24px;
  margin: 0;
  color: var(--muted);
  font-size: 0.96rem;
  font-weight: 900;
}

.settings-status.is-error {
  color: #9e2d22;
}

.settings-status.is-success {
  color: #2f7c5f;
}

.settings-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 10px;
}

.spark {
  position: absolute;
  width: 12px;
  height: 18px;
  background: var(--spark-color, #ffd96d);
  border-radius: 3px;
  z-index: 17;
  pointer-events: none;
  animation: sparkFly 720ms ease-out forwards;
}

.push-controls {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.push-button {
  min-height: 96px;
  display: grid;
  grid-template-columns: 36px 58px auto;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 10px;
  color: var(--ink);
  background: rgba(255, 253, 247, 0.96);
  border: 2px solid rgba(37, 40, 68, 0.13);
  border-radius: 8px;
  box-shadow: 0 8px 0 rgba(37, 40, 68, 0.18);
  cursor: pointer;
  touch-action: manipulation;
}

.push-button:active {
  transform: translateY(5px);
  box-shadow: 0 3px 0 rgba(37, 40, 68, 0.18);
}

.push-button .arrow-icon {
  width: 34px;
  height: 34px;
  color: #2d6cdf;
}

.push-button [data-item-icon] svg,
.push-button [data-item-icon] img {
  width: 54px;
  height: 54px;
  object-fit: contain;
}

.push-button span:last-child {
  min-width: 76px;
  font-weight: 800;
  font-size: 1.08rem;
  text-align: left;
}

@keyframes itemDrop {
  from {
    top: -110px;
    transform: translate(-50%, -50%) scale(0.82) rotate(-7deg);
  }
  55% {
    transform: translate(-50%, -50%) scale(1) rotate(5deg);
  }
  to {
    top: 67%;
    transform: translate(-50%, -50%) scale(1.04) rotate(0deg);
  }
}

@keyframes missedPop {
  to {
    opacity: 0;
    transform: translate(-50%, -50%) scale(0.45) rotate(12deg);
  }
}

@keyframes signalPop {
  0% {
    opacity: 0;
    transform: translate(-50%, -50%) scale(0.55);
  }
  24%,
  70% {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1);
  }
  100% {
    opacity: 0;
    transform: translate(-50%, -50%) scale(0.9);
  }
}

@keyframes feedbackPop {
  0% {
    opacity: 0;
    transform: scale(0.55) rotate(-8deg);
  }
  22%,
  72% {
    opacity: 1;
    transform: scale(1) rotate(0deg);
  }
  100% {
    opacity: 0;
    transform: scale(0.86) rotate(4deg);
  }
}

@keyframes wrongShake {
  0%,
  100% {
    transform: translateX(0);
  }
  30% {
    transform: translateX(-9px);
  }
  65% {
    transform: translateX(9px);
  }
}

@keyframes munchBounce {
  0%,
  100% {
    transform: scale(calc(1 + var(--feed-count) * 0.028));
  }
  38% {
    transform: scale(calc(1.08 + var(--feed-count) * 0.028));
  }
}

@keyframes smellyWobble {
  0%,
  100% {
    transform: scale(calc(1 + var(--feed-count) * 0.028)) rotate(0deg);
  }
  30% {
    transform: scale(calc(1.04 + var(--feed-count) * 0.028)) rotate(-2deg);
  }
  65% {
    transform: scale(calc(1.04 + var(--feed-count) * 0.028)) rotate(2deg);
  }
}

@keyframes spicyShake {
  0%,
  100% {
    transform: scale(calc(1 + var(--feed-count) * 0.028)) rotate(0deg);
  }
  25% {
    transform: scale(calc(1.03 + var(--feed-count) * 0.028)) rotate(-2deg);
  }
  50% {
    transform: scale(calc(1.05 + var(--feed-count) * 0.028)) rotate(2deg);
  }
  75% {
    transform: scale(calc(1.03 + var(--feed-count) * 0.028)) rotate(-1deg);
  }
}

@keyframes monsterPop {
  0% {
    opacity: 0;
    transform: translate(-50%, -50%) scale(0.55) rotate(-8deg);
  }
  68% {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1.05) rotate(3deg);
  }
  100% {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1) rotate(0deg);
  }
}

@keyframes monsterMischief {
  0%,
  100% {
    transform: translateY(0) scale(1) rotate(-1deg);
  }
  50% {
    transform: translateY(-9px) scale(1.03) rotate(1deg);
  }
}

@keyframes monsterForceFeed {
  0%,
  100% {
    transform: translateY(0) scale(1) rotate(0deg);
  }
  50% {
    transform: translateY(18px) scale(1.08) rotate(0deg);
  }
}

@keyframes monsterForceFeedLeft {
  0%,
  100% {
    transform: translate(0, 0) scale(1) rotate(0deg);
  }
  50% {
    transform: translate(-18px, 18px) scale(1.08) rotate(-5deg);
  }
}

@keyframes monsterForceFeedRight {
  0%,
  100% {
    transform: translate(0, 0) scale(1) rotate(0deg);
  }
  50% {
    transform: translate(18px, 18px) scale(1.08) rotate(5deg);
  }
}

@keyframes smellFloat {
  0% {
    opacity: 0;
    transform: translate(-50%, -35%) scale(0.74);
  }
  20% {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1);
  }
  100% {
    opacity: 0;
    transform: translate(-50%, -115%) scale(0.86);
  }
}

@keyframes spicyFloat {
  0% {
    opacity: 0;
    transform: translate(-50%, -35%) scale(0.72) rotate(-6deg);
  }
  20% {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1.06) rotate(3deg);
  }
  100% {
    opacity: 0;
    transform: translate(-50%, -125%) scale(0.86) rotate(8deg);
  }
}

@keyframes sparkFly {
  from {
    opacity: 1;
    transform: translate(-50%, -50%) rotate(0deg);
  }
  to {
    opacity: 0;
    transform: translate(calc(-50% + var(--spark-x)), calc(-50% + var(--spark-y))) rotate(110deg);
  }
}

@keyframes henLayBounce {
  0%,
  100% {
    transform: translate(-50%, -50%) translateY(0) rotate(0deg);
  }
  42% {
    transform: translate(-50%, -50%) translateY(-10px) rotate(-2deg);
  }
  72% {
    transform: translate(-50%, -50%) translateY(3px) rotate(2deg);
  }
}

@keyframes eggPop {
  0% {
    opacity: 0;
    transform: translate(-50%, -50%) scale(0.32) rotate(-8deg);
  }
  72% {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1.08) rotate(4deg);
  }
  100% {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1) rotate(0deg);
  }
}

@keyframes tttPiecePop {
  0% {
    transform: scale(0.78);
  }
  70% {
    transform: scale(1.04);
  }
  100% {
    transform: scale(1);
  }
}

@keyframes tttWinPulse {
  from {
    transform: scale(1);
  }
  to {
    transform: scale(1.03);
  }
}

@keyframes stealEatBounce {
  0%,
  100% {
    transform: translateX(-50%) scale(calc(1 + var(--steal-growth)));
  }
  34%,
  68% {
    transform: translateX(-50%) translateY(-10px) scale(calc(1.04 + var(--steal-growth)));
  }
}

@keyframes stealHandFeed {
  0% {
    transform: translate(72px, 70px) rotate(-22deg) scale(0.5);
  }
  18% {
    transform: translate(28px, 24px) rotate(-15deg) scale(0.62);
  }
  48%,
  78% {
    transform: translate(-12px, -18px) rotate(-7deg) scale(0.72);
  }
  100% {
    transform: translate(34px, 24px) rotate(-16deg) scale(0.58);
  }
}

@keyframes stealCaughtShake {
  0%,
  100% {
    transform: translateX(-50%) scale(calc(1 + var(--steal-growth)));
  }
  25% {
    transform: translateX(calc(-50% - 10px)) rotate(-4deg) scale(calc(1 + var(--steal-growth)));
  }
  75% {
    transform: translateX(calc(-50% + 10px)) rotate(4deg) scale(calc(1 + var(--steal-growth)));
  }
}

@keyframes stealSnackPop {
  0% {
    opacity: 0;
    transform: translate(-50%, 18px) scale(0.4) rotate(-8deg);
  }
  45% {
    opacity: 1;
    transform: translate(-50%, -28px) scale(1.08) rotate(5deg);
  }
  100% {
    opacity: 0;
    transform: translate(-50%, -68px) scale(0.8) rotate(16deg);
  }
}

@keyframes stealDurianToss {
  0% {
    opacity: 0;
    transform: translate(0, -12px) scale(0.4) rotate(-12deg);
  }
  25% {
    opacity: 1;
    transform: translate(-70px, -54px) scale(1) rotate(10deg);
  }
  100% {
    opacity: 0;
    transform: translate(-185px, 18px) scale(0.72) rotate(28deg);
  }
}

@keyframes runnerStride {
  0%,
  100% {
    transform: translateX(-50%) translateY(0) rotate(0);
  }
  50% {
    transform: translateX(-50%) translateY(-10px) rotate(-2deg);
  }
}

@keyframes bowlingRoll {
  0% {
    bottom: 24px;
    transform: translateX(-50%) scale(1) rotate(0deg);
  }
  70% {
    bottom: 56%;
    transform: translateX(-50%) scale(0.72) rotate(420deg);
  }
  100% {
    bottom: 68%;
    transform: translateX(-50%) scale(0.56) rotate(680deg);
  }
}

@keyframes finalPop {
  from {
    opacity: 0;
    transform: scale(0.82) translateY(18px);
  }
  to {
    opacity: 1;
    transform: scale(1) translateY(0);
  }
}

@media (max-width: 820px) {
  .app {
    padding: 10px;
  }

  .home-header {
    align-items: flex-start;
    flex-direction: column;
  }

  .auth-area {
    width: 100%;
    justify-content: space-between;
  }

  .home-legal {
    grid-template-columns: 1fr;
    justify-items: stretch;
  }

  .legal-title {
    text-align: center;
  }

  .legal-link {
    justify-content: flex-start;
  }

  .topbar {
    grid-template-columns: auto 1fr auto;
  }

  .bus-topbar,
  .egg-topbar,
  .ttt-topbar,
  .steal-topbar,
  .runner-topbar,
  .bowling-topbar {
    grid-template-columns: auto minmax(0, 1fr) auto auto;
  }

  .topbar .round-action.primary {
    grid-column: 1 / -1;
    width: 100%;
  }

  .home-action {
    min-width: 92px;
    padding-inline: 12px;
  }

  .game-grid {
    grid-template-columns: 1fr;
  }

  .game-card {
    min-height: 300px;
    padding: 20px 14px;
  }

  .game-card-art {
    width: min(260px, 84%);
  }

  .bus-stage,
  .egg-stage,
  .ttt-stage,
  .steal-stage,
  .runner-stage,
  .bowling-stage {
    min-height: 570px;
    padding: 12px;
  }

  .bowling-lane {
    left: 5%;
    right: 5%;
  }

  .bowling-pins {
    width: min(280px, 70%);
  }

  .runner-track {
    inset: 110px 4% 42px 4%;
  }

  .runner-racer {
    width: min(140px, 24%);
    min-width: 96px;
  }

  .runner-finish {
    top: 110px;
    right: 7.4%;
  }

  .ttt-stage {
    grid-template-columns: 1fr;
    align-items: stretch;
  }

  .ttt-board {
    width: min(100%, 480px);
  }

  .steal-kid {
    left: 30%;
    width: min(210px, 42%);
  }

  .steal-monster {
    right: 5%;
    width: min(240px, 43%);
  }

  .steal-icecream {
    left: 52%;
  }

  .hen-wrap {
    width: min(300px, 70%);
  }

  .bus-question-panel {
    grid-template-columns: 1fr;
  }

  .route-chip,
  .streak-chip {
    min-height: 64px;
  }

  .bus-answer-grid,
  .bus-result-card {
    grid-template-columns: 1fr;
  }

  .bus-sign-overlay {
    top: 18%;
    right: 8%;
    width: min(220px, 42%);
  }

  h1 {
    font-size: 1.25rem;
  }

  .score-card {
    min-width: 94px;
  }

  .stage {
    height: clamp(390px, calc(100vh - 270px), 540px);
  }

  .friend-row {
    left: 2%;
    right: 2%;
    bottom: 30px;
    gap: 2px;
    grid-template-columns: minmax(88px, 0.82fr) minmax(140px, 1.12fr) minmax(88px, 0.82fr);
  }

  .friend {
    min-height: 270px;
    padding-inline: 2px;
  }

  .character-art svg {
    width: 158px;
  }

  .boy-art {
    width: 220px;
  }

  .matching-token {
    top: 22px;
    right: 6px;
    width: 54px;
    height: 54px;
  }

  .matching-token svg,
  .matching-token img {
    width: 42px;
    height: 42px;
  }

  .friend-name {
    min-width: 74px;
    padding: 7px 8px;
    font-size: 0.95rem;
  }

  .push-controls {
    gap: 8px;
  }

  .runner-controls {
    grid-template-columns: 1fr;
  }

  .push-button {
    min-height: 92px;
    grid-template-columns: 1fr;
    grid-template-rows: 24px 46px 20px;
    gap: 3px;
    padding: 8px 4px;
  }

  .push-button .arrow-icon {
    width: 24px;
    height: 24px;
    justify-self: center;
  }

  .push-button [data-item-icon] svg,
  .push-button [data-item-icon] img {
    width: 46px;
    height: 46px;
  }

  .push-button span:last-child {
    min-width: 0;
    font-size: 0.95rem;
    text-align: center;
  }

  .settings-panel {
    max-height: 90vh;
  }

  .settings-grid {
    grid-template-columns: 1fr;
  }

  .falling-item {
    width: 84px;
    height: 84px;
  }

  .monster-button,
  .monster-visitor {
    width: 158px;
    min-height: 196px;
  }

  .monster-visitor {
    width: 200px;
    min-height: 250px;
  }

  .monster-button .monster-photo-wrap {
    width: 150px;
  }

  .monster-visitor .monster-photo-wrap {
    width: 196px;
  }

  .bonus-feed-item {
    width: 58px;
    height: 58px;
  }

  .bonus-feed-item.item-chilli {
    width: 132px;
    height: 132px;
  }
}

@media (max-width: 520px) {
  .brand-mark {
    width: 48px;
    height: 48px;
  }

  .brand-mark svg {
    width: 42px;
    height: 42px;
  }

  .home-header {
    min-height: 66px;
  }

  .auth-area {
    align-items: stretch;
    flex-direction: column;
  }

  .auth-area span {
    text-align: left;
  }

  .auth-button {
    width: 100%;
  }

  .legal-link {
    min-height: 48px;
    padding-inline: 12px;
    overflow-wrap: anywhere;
  }

  .topbar {
    gap: 8px;
  }

  .home-action {
    min-width: 48px;
    padding-inline: 10px;
  }

  .home-action span {
    display: none;
  }

  .settings-action {
    min-width: 48px;
    padding-inline: 10px;
  }

  .settings-action span {
    display: none;
  }

  .settings-panel {
    padding: 14px;
  }

  .settings-actions {
    display: grid;
    grid-template-columns: 1fr;
  }

  .game-card {
    min-height: 250px;
  }

  .game-card-art {
    width: min(220px, 86%);
  }

  .bus-topbar,
  .egg-topbar,
  .ttt-topbar,
  .steal-topbar,
  .runner-topbar,
  .bowling-topbar {
    grid-template-columns: auto 1fr;
  }

  .bus-topbar .score-card,
  .egg-topbar .score-card,
  .ttt-topbar .score-card,
  .steal-topbar .score-card,
  .runner-topbar .score-card,
  .bowling-topbar .score-card {
    grid-template-columns: 1fr;
    min-width: 78px;
    min-height: 48px;
    gap: 2px;
  }

  .bus-topbar .score-card strong,
  .egg-topbar .score-card strong,
  .ttt-topbar .score-card strong,
  .steal-topbar .score-card strong,
  .runner-topbar .score-card strong {
    min-width: 0;
    font-size: 1.25rem;
    line-height: 1.18;
    text-align: center;
  }

  .bowling-topbar .score-card strong {
    min-width: 0;
    font-size: 1.25rem;
    line-height: 1.18;
    text-align: center;
  }

  .runner-topbar h1,
  .runner-topbar .score-card span,
  .steal-topbar h1,
  .steal-topbar .score-card span,
  .bowling-topbar h1,
  .bowling-topbar .score-card span {
    line-height: 1.18;
  }

  .bus-stage,
  .egg-stage,
  .ttt-stage,
  .steal-stage,
  .runner-stage,
  .bowling-stage {
    min-height: 620px;
    padding: 10px;
  }

  .bowling-status {
    top: 10px;
    min-height: 52px;
    padding: 8px 12px;
  }

  .bowling-lane {
    left: 3%;
    right: 3%;
    top: 92px;
    bottom: 30px;
  }

  .bowling-pins {
    top: 34px;
    width: min(240px, 82%);
    height: 160px;
  }

  .bowling-pin {
    width: 34px;
    height: 80px;
    border-width: 3px;
  }

  .bowling-pin[data-pin="0"],
  .bowling-pin[data-pin="4"] {
    left: calc(50% - 17px);
  }

  .bowling-pin[data-pin="1"] {
    left: calc(38% - 17px);
    top: 46px;
  }

  .bowling-pin[data-pin="2"] {
    left: calc(62% - 17px);
    top: 46px;
  }

  .bowling-pin[data-pin="3"] {
    left: calc(26% - 17px);
    top: 92px;
  }

  .bowling-pin[data-pin="4"] {
    top: 92px;
  }

  .bowling-pin[data-pin="5"] {
    left: calc(74% - 17px);
    top: 92px;
  }

  .bowling-ball {
    width: 74px;
    height: 74px;
  }

  .runner-status {
    top: 10px;
    min-height: 52px;
    padding: 8px 12px;
  }

  .runner-track {
    inset: 92px 3% 32px 3%;
    gap: 14px;
  }

  .runner-lane {
    border-width: 3px;
  }

  .runner-racer {
    width: min(124px, 28%);
    min-width: 86px;
    bottom: 28px;
  }

  .runner-racer::before {
    top: 49%;
    height: 12px;
    border-width: 3px;
  }

  .runner-face {
    border-width: 4px;
  }

  .runner-body {
    height: 46px;
    border-width: 4px;
  }

  .runner-body::before,
  .runner-body::after {
    bottom: -11px;
    height: 15px;
    border-width: 3px;
  }

  .runner-name {
    margin-top: 8px;
    padding: 5px 8px;
    font-size: 0.82rem;
  }

  .runner-finish {
    top: 92px;
    right: 6.8%;
    bottom: 32px;
    width: 20px;
  }

  .runner-run-button {
    grid-template-columns: 30px minmax(70px, auto) minmax(0, 1fr);
    min-height: 76px;
  }

  .runner-key {
    min-width: 70px;
    font-size: 0.8rem;
  }

  .steal-alert {
    top: 10px;
    min-height: 52px;
    padding: 8px 12px;
  }

  .steal-table {
    left: 2%;
    right: 2%;
    bottom: 66px;
    height: 104px;
  }

  .steal-kid {
    left: 27%;
    bottom: 102px;
    min-width: 122px;
    width: 40%;
  }

  .steal-kid-body {
    height: 70px;
  }

  .steal-kid-name {
    font-size: 0.86rem;
  }

  .steal-monster {
    right: 0;
    bottom: 104px;
    min-width: 126px;
    width: 42%;
  }

  .steal-monster-back {
    font-size: 0.82rem;
  }

  .steal-icecream {
    left: 53%;
    bottom: 130px;
    width: 66px;
    height: 66px;
  }

  .steal-icecream svg,
  .steal-icecream img {
    width: 66px;
    height: 66px;
  }

  .ttt-side-panel {
    gap: 10px;
  }

  .ttt-status {
    min-height: 84px;
    padding: 12px;
  }

  .ttt-player-chip {
    grid-template-columns: 44px minmax(0, 1fr) auto;
    min-height: 58px;
    gap: 8px;
  }

  .ttt-mini-piece {
    width: 38px;
    height: 38px;
  }

  .ttt-mini-piece::before {
    width: 25px;
    height: 25px;
  }

  .ttt-board {
    gap: 8px;
    padding: 10px;
  }

  .egg-cloud {
    display: none;
  }

  .hen-wrap {
    width: min(260px, 78%);
  }

  .laid-egg {
    width: 44px;
    height: 44px;
  }

  .bus-question-panel {
    padding: 10px;
  }

  .question-copy strong {
    font-size: 1.08rem;
  }

  .bus-answer-button {
    min-height: 104px;
    padding: 10px;
  }

  .bus-answer-button strong {
    font-size: 1.08rem;
  }

  .bus-answer-button span {
    font-size: 0.98rem;
  }

  .bus-photo-wrap {
    min-height: 190px;
  }

  .bus-sign-overlay {
    top: 14%;
    right: 6%;
    width: min(190px, 48%);
    min-height: 56px;
    padding: 6px 8px;
  }

  .bus-result-copy {
    padding: 12px;
  }

  .route-feedback {
    top: 12px;
    right: 12px;
    width: 82px;
    height: 82px;
  }

  .stage {
    height: clamp(380px, calc(100vh - 260px), 500px);
  }

  .cloud {
    display: none;
  }

  .table-rail {
    height: 136px;
  }

  .friend-row {
    bottom: 26px;
  }

  .friend {
    min-height: 238px;
  }

  .character-art svg {
    width: 130px;
  }

  .boy-art {
    width: 184px;
  }

  .matching-token {
    width: 46px;
    height: 46px;
  }

  .matching-token svg,
  .matching-token img {
    width: 36px;
    height: 36px;
  }

  .friend-name {
    font-size: 0.86rem;
  }

  .monster-button,
  .monster-visitor {
    width: 134px;
    min-height: 172px;
  }

  .monster-visitor {
    width: 168px;
    min-height: 216px;
  }

  .monster-button .monster-photo-wrap {
    width: 126px;
  }

  .monster-visitor .monster-photo-wrap {
    width: 160px;
  }

  .monster-label,
  .smell-puff,
  .spicy-puff {
    font-size: 0.78rem;
  }

  .bonus-feed-item.item-chilli {
    width: 116px;
    height: 116px;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    scroll-behavior: auto !important;
    transition-duration: 0.001ms !important;
  }
}
