:root {
  --bg: #fcf4dd;
  --panel: rgba(255, 251, 240, 0.88);
  --panel-border: rgba(113, 72, 24, 0.16);
  --text: #21170e;
  --muted: #715c46;
  --accent: #ff8b2b;
  --accent-dark: #d46208;
  --accent-soft: #ffd166;
  --blue: #118ab2;
  --grass: #78c264;
  --grass-dark: #4d8c2d;
  --danger: #c94b41;
  --ink: #462519;
}

* {
  box-sizing: border-box;
}

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

body {
  font-family: "Avenir Next", "Trebuchet MS", sans-serif;
  color: var(--text);
  background:
    radial-gradient(circle at top left, rgba(255, 209, 102, 0.52), transparent 30%),
    radial-gradient(circle at top right, rgba(201, 75, 65, 0.18), transparent 24%),
    linear-gradient(180deg, #fff7df 0%, var(--bg) 100%);
}

.app {
  min-height: 100vh;
  display: grid;
  align-content: start;
  gap: 22px;
  width: min(920px, calc(100vw - 32px));
  margin: 0 auto;
  padding: 28px 0 40px;
}

.hero,
.game-card,
.ending-card,
.overlay-card {
  position: relative;
  border: 2px solid var(--panel-border);
  border-radius: 28px;
  background: var(--panel);
  box-shadow: 0 22px 50px rgba(107, 73, 18, 0.12);
  backdrop-filter: blur(12px);
}

.hero::after {
  content: "100 PATHS";
  position: absolute;
  top: 18px;
  right: 22px;
  color: rgba(70, 37, 25, 0.16);
  font-family: "Marker Felt", "Arial Black", sans-serif;
  font-size: clamp(1.2rem, 4vw, 2rem);
  transform: rotate(-9deg);
}

.hero-tools { display:flex; align-items:center; justify-content:space-between; gap:16px; }
.language-select, .settings-select { min-height:42px; border:1px solid var(--panel-border); border-radius:12px; padding:0 12px; background:#fffaf0; color:var(--text); font:inherit; font-weight:700; }
.action-link { display:inline-flex; align-items:center; justify-content:center; text-decoration:none; }
.settings-help { margin:-4px 0 4px; color:var(--muted); font-size:.88rem; line-height:1.45; }

@media (max-width: 620px) {
  .hero-tools { align-items:flex-start; }
  .language-select { max-width:132px; }
  .actions > * { flex:1 1 42%; }
}

.hero,
.ending-card,
.overlay-card {
  padding: 24px 28px;
}

.game-card {
  padding: 24px;
}

.eyebrow,
.label {
  margin: 0 0 8px;
  text-transform: uppercase;
  letter-spacing: 0.16em;
  font-size: 0.76rem;
  font-weight: 800;
  color: var(--blue);
}

h1,
h2,
.progress-pill,
.primary-button,
.player,
.object {
  font-family: "Marker Felt", "Arial Black", sans-serif;
  letter-spacing: 0.03em;
}

h1 {
  margin: 0;
  font-size: clamp(2.8rem, 8vw, 5rem);
  line-height: 0.95;
}

h2 {
  margin: 0 0 10px;
  font-size: 1.7rem;
}

.intro {
  margin: 12px 0 0;
  max-width: 42rem;
  color: var(--muted);
  font-size: 1.05rem;
}

.status-row {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 18px;
}

.stat {
  padding: 14px 12px;
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.7);
  border: 1px solid rgba(111, 63, 14, 0.1);
}

.stat strong {
  display: block;
  font-size: 1.05rem;
  line-height: 1.35;
  color: var(--ink);
}

.stat small {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  font-weight: 700;
}

.playfield-shell {
  padding: 14px;
  border-radius: 28px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.48), rgba(255, 255, 255, 0.2));
}

.playfield {
  position: relative;
  height: 360px;
  overflow: hidden;
  border-radius: 24px;
  border: 2px solid rgba(113, 72, 24, 0.14);
  background:
    linear-gradient(180deg, #93dcff 0%, #d8f6ff 55%, #fff0ca 56%, #ffe7a0 100%);
  outline: none;
}

.playfield.show-basement .basement {
  opacity: 1;
  transform: translateY(0);
}

.playfield.show-sewers .sewers {
  opacity: 1;
  transform: translateY(0);
}

.playfield.show-corner-obby .corner-obby {
  opacity: 1;
  transform: translateY(0);
}

.playfield.basement-mode .ground,
.playfield.sewer-mode .ground,
.playfield.basement-mode .tree,
.playfield.sewer-mode .tree,
.playfield.basement-mode .shrub,
.playfield.sewer-mode .shrub,
.playfield.basement-mode .pit,
.playfield.sewer-mode .pit,
.playfield.basement-mode .door,
.playfield.sewer-mode .door,
.playfield.basement-mode .sign,
.playfield.sewer-mode .sign,
.playfield.basement-mode .spawn-plate,
.playfield.sewer-mode .spawn-plate,
.playfield.sewer-mode .sewer-pit {
  opacity: 0.18;
}

.sky,
.sun,
.cloud,
.ground {
  position: absolute;
}

.sun {
  top: 26px;
  right: 42px;
  width: 86px;
  height: 86px;
  border-radius: 50%;
  background: radial-gradient(circle, #fff7c2 0%, #ffd166 58%, #ffb347 100%);
  box-shadow: 0 0 50px rgba(255, 209, 102, 0.7);
}

.cloud {
  width: 110px;
  height: 34px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.78);
}

.cloud::before,
.cloud::after {
  content: "";
  position: absolute;
  border-radius: 50%;
  background: inherit;
}

.cloud::before {
  width: 42px;
  height: 42px;
  left: 14px;
  top: -18px;
}

.cloud::after {
  width: 52px;
  height: 52px;
  right: 14px;
  top: -24px;
}

.cloud-a {
  top: 70px;
  left: 88px;
}

.cloud-b {
  top: 46px;
  left: 300px;
  transform: scale(0.84);
}

.tree,
.tree-canopy,
.tree-trunk,
.invisible-ladder,
.corner-obby,
.red-plate {
  position: absolute;
}

.corner-obby {
  left: 12px;
  bottom: 86px;
  width: 138px;
  height: 138px;
  z-index: 2;
  opacity: 0;
  transform: translateY(12px);
  transition:
    opacity 180ms ease,
    transform 180ms ease;
  pointer-events: none;
}

.obby-step {
  position: absolute;
  width: 34px;
  height: 14px;
  border-radius: 10px;
  background: linear-gradient(180deg, #9cd6ff 0%, #3d88c0 100%);
  box-shadow: inset 0 -3px 0 rgba(0, 0, 0, 0.14);
}

.step-1 {
  left: 0;
  bottom: 0;
}

.step-2 {
  left: 20px;
  bottom: 24px;
}

.step-3 {
  left: 44px;
  bottom: 48px;
}

.step-4 {
  left: 72px;
  bottom: 72px;
}

.step-5 {
  left: 100px;
  bottom: 98px;
}

.obby-flag {
  position: absolute;
  right: 0;
  top: 6px;
  width: 24px;
  height: 34px;
  border-left: 4px solid #6b3e1f;
}

.obby-flag::after {
  content: "";
  position: absolute;
  left: 4px;
  top: 2px;
  width: 18px;
  height: 12px;
  background: linear-gradient(180deg, #ff7a7a 0%, #d53a3a 100%);
  clip-path: polygon(0 0, 100% 20%, 0 100%);
}

.red-plate {
  right: 20px;
  top: 88px;
  width: 42px;
  height: 14px;
  border-radius: 999px;
  background: linear-gradient(180deg, #ffb2aa 0%, #c92c24 100%);
  box-shadow:
    inset 0 -3px 0 rgba(0, 0, 0, 0.18),
    0 3px 8px rgba(111, 18, 18, 0.22);
  pointer-events: auto;
}

.tree {
  z-index: 2;
  left: 470px;
  bottom: 74px;
  width: 122px;
  height: 170px;
  pointer-events: none;
}

.tree-canopy {
  border-radius: 50%;
  background:
    radial-gradient(circle at 36% 34%, #9ee57b 0 22%, transparent 23%),
    radial-gradient(circle at 62% 28%, #7fca59 0 24%, transparent 25%),
    radial-gradient(circle at 28% 58%, #6fb14d 0 26%, transparent 27%),
    radial-gradient(circle at 66% 60%, #5f983f 0 28%, transparent 29%),
    radial-gradient(circle at 48% 46%, #7cc856 0 34%, transparent 35%);
}

.canopy-back {
  top: 0;
  left: 4px;
  width: 112px;
  height: 96px;
  filter: brightness(0.94);
}

.tree-trunk {
  left: 45px;
  bottom: 0;
  width: 28px;
  height: 108px;
  border-radius: 16px 16px 8px 8px;
  background:
    linear-gradient(90deg, #8a5229 0%, #6b3e1f 48%, #5a3318 100%);
  box-shadow: inset -5px 0 0 rgba(0, 0, 0, 0.12);
}

.invisible-ladder {
  inset: 12px 7px 10px;
  border-left: 2px solid rgba(255, 255, 255, 0.08);
  border-right: 2px solid rgba(255, 255, 255, 0.08);
  opacity: 0.42;
}

.invisible-ladder span {
  position: absolute;
  left: 1px;
  right: 1px;
  height: 2px;
  background: rgba(255, 255, 255, 0.1);
}

.invisible-ladder span:nth-child(1) {
  top: 10px;
}

.invisible-ladder span:nth-child(2) {
  top: 24px;
}

.invisible-ladder span:nth-child(3) {
  top: 38px;
}

.invisible-ladder span:nth-child(4) {
  top: 52px;
}

.invisible-ladder span:nth-child(5) {
  top: 66px;
}

.canopy-front {
  top: 18px;
  left: 0;
  width: 122px;
  height: 98px;
}

.ground {
  left: 0;
  right: 0;
  bottom: 0;
  height: 88px;
  background:
    linear-gradient(180deg, var(--grass) 0%, var(--grass-dark) 100%);
}

.ground::before {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  top: -14px;
  height: 22px;
  background:
    radial-gradient(circle at 10px 12px, #97df7d 0 10px, transparent 11px) 0 0 / 32px 22px repeat-x;
}

.sewer-pit {
  left: 82px;
  bottom: 64px;
  width: 68px;
  height: 20px;
  border-radius: 18px 18px 10px 10px;
  background:
    radial-gradient(circle at 50% 20%, rgba(112, 128, 132, 0.42) 0 18%, transparent 19%),
    linear-gradient(180deg, #6f7a5b 0%, #39412e 100%);
  box-shadow:
    inset 0 4px 0 rgba(255, 255, 255, 0.08),
    inset 0 -5px 0 rgba(0, 0, 0, 0.2);
}

.object,
.player {
  position: absolute;
  border: none;
  padding: 0;
  background: transparent;
  cursor: pointer;
}

.basement {
  position: absolute;
  inset: auto 18px 18px 18px;
  height: 132px;
  z-index: 1;
  opacity: 0;
  transform: translateY(18px);
  transition:
    opacity 180ms ease,
    transform 180ms ease;
}

.sewers,
.sewer-backdrop,
.sewer-secret,
.sewer-object {
  position: absolute;
}

.sewers {
  inset: 0;
  z-index: 5;
  opacity: 0;
  transform: translateY(18px);
  transition:
    opacity 180ms ease,
    transform 180ms ease;
  pointer-events: none;
}

.playfield.sewer-mode .sewers {
  pointer-events: auto;
}

.sewer-backdrop {
  inset: 132px 0 0;
  background:
    radial-gradient(circle at 20% 20%, rgba(156, 182, 95, 0.18), transparent 18%),
    radial-gradient(circle at 74% 44%, rgba(82, 118, 66, 0.18), transparent 20%),
    linear-gradient(180deg, #596145 0%, #333626 22%, #202316 100%);
  border-top: 6px solid rgba(17, 23, 14, 0.36);
}

.sewer-backdrop::before {
  content: "";
  position: absolute;
  inset: 18px 22px 20px;
  border-radius: 22px 22px 0 0;
  background:
    repeating-linear-gradient(
      90deg,
      rgba(255, 255, 255, 0.04) 0 10px,
      rgba(0, 0, 0, 0.04) 10px 20px
    );
  opacity: 0.5;
}

.sewer-exit {
  left: 38px;
  bottom: 34px;
  width: 72px;
  height: 112px;
  border-radius: 16px;
  background: linear-gradient(180deg, #707b68 0%, #454d3d 100%);
  box-shadow: inset 0 -6px 0 rgba(0, 0, 0, 0.2);
  color: #eef4d7;
  font-size: 0.72rem;
}

.sewer-exit span {
  position: absolute;
  inset: 12px 8px auto;
}

.sewer-exit::before {
  content: "";
  position: absolute;
  left: 18px;
  right: 18px;
  top: 28px;
  height: 4px;
  background: rgba(228, 240, 212, 0.66);
  box-shadow:
    0 18px 0 rgba(228, 240, 212, 0.66),
    0 36px 0 rgba(228, 240, 212, 0.66),
    0 54px 0 rgba(228, 240, 212, 0.66);
}

.rat {
  left: 198px;
  bottom: 54px;
  width: 52px;
  height: 28px;
  border-radius: 18px 18px 14px 14px;
  background: linear-gradient(180deg, #867a77 0%, #514646 100%);
  box-shadow: inset 0 -3px 0 rgba(0, 0, 0, 0.16);
}

.rat::before {
  content: "";
  position: absolute;
  right: -14px;
  top: 12px;
  width: 18px;
  height: 4px;
  border-radius: 999px;
  background: #d8a4aa;
  transform: rotate(12deg);
}

.rat::after {
  content: "";
  position: absolute;
  left: 10px;
  top: -6px;
  width: 12px;
  height: 10px;
  border-radius: 60% 60% 0 0;
  background: #756765;
  box-shadow: 12px 0 0 #756765;
}

.rat-key {
  left: 250px;
  bottom: 54px;
  width: 26px;
  height: 12px;
  border-radius: 999px;
  background: linear-gradient(180deg, #f7df84 0%, #c49a2d 100%);
  box-shadow: inset 0 -2px 0 rgba(0, 0, 0, 0.14);
}

.rat-key::before {
  content: "";
  position: absolute;
  left: -6px;
  top: 1px;
  width: 10px;
  height: 10px;
  border: 3px solid #e7c45d;
  border-radius: 50%;
}

.rat-key::after {
  content: "";
  position: absolute;
  right: 4px;
  top: 8px;
  width: 8px;
  height: 8px;
  border-right: 3px solid #b9871e;
  border-bottom: 3px solid #b9871e;
}

.rat-sword {
  left: 252px;
  bottom: 42px;
  width: 56px;
  height: 12px;
  opacity: 0;
  pointer-events: none;
  transform: translateX(-10px) rotate(-18deg);
  transition:
    opacity 160ms ease,
    transform 160ms ease;
}

.rat-sword::before {
  content: "";
  position: absolute;
  left: 0;
  top: 4px;
  width: 42px;
  height: 4px;
  border-radius: 999px;
  background: linear-gradient(180deg, #e8edf3 0%, #9ea8b6 100%);
}

.rat-sword::after {
  content: "";
  position: absolute;
  right: 0;
  top: 0;
  width: 16px;
  height: 12px;
  border-radius: 4px;
  background: linear-gradient(180deg, #8e4a2d 0%, #5e2f1c 100%);
  box-shadow: -6px 0 0 #d4b35e;
}

.playfield.rat-key-taken .rat-key {
  opacity: 0;
  pointer-events: none;
}

.playfield.rat-armed .rat-sword {
  opacity: 1;
  pointer-events: auto;
  transform: translateX(0) rotate(-8deg);
}

.playfield.rat-sword-taken .rat-sword {
  opacity: 0;
  pointer-events: none;
}

.keith-jail {
  left: 322px;
  bottom: 34px;
  width: 124px;
  height: 128px;
  border-radius: 18px;
  background:
    linear-gradient(180deg, rgba(182, 194, 178, 0.18) 0%, rgba(47, 51, 42, 0.32) 100%),
    linear-gradient(180deg, #626f61 0%, #394037 100%);
  box-shadow: inset 0 -8px 0 rgba(0, 0, 0, 0.18);
  color: #eef4d7;
}

.keith-jail::before {
  content: "";
  position: absolute;
  inset: 14px 16px 18px;
  background:
    repeating-linear-gradient(
      90deg,
      rgba(221, 230, 213, 0.9) 0 6px,
      transparent 6px 18px
    );
  opacity: 0.9;
}

.jail-bars,
.keith-label {
  position: absolute;
  z-index: 1;
}

.jail-bars {
  inset: 0;
}

.keith-label {
  left: 18px;
  bottom: 14px;
}

.sewer-secret {
  right: 34px;
  bottom: 22px;
  width: 148px;
  height: 144px;
  opacity: 0;
  transform: translateX(18px);
  transition:
    opacity 180ms ease,
    transform 180ms ease;
  pointer-events: none;
}

.playfield.keith-freed .sewer-secret {
  opacity: 1;
  transform: translateX(0);
  pointer-events: auto;
}

.dirty-cheese {
  left: 18px;
  bottom: 30px;
  width: 64px;
  height: 48px;
  border-radius: 16px 12px 20px 12px;
  background:
    radial-gradient(circle at 24% 32%, rgba(134, 84, 31, 0.28) 0 12%, transparent 13%),
    radial-gradient(circle at 66% 68%, rgba(122, 68, 29, 0.32) 0 14%, transparent 15%),
    linear-gradient(180deg, #d7b856 0%, #9b7b24 100%);
  box-shadow: inset 0 -4px 0 rgba(0, 0, 0, 0.14);
}

.cheese-piece {
  left: 74px;
  bottom: 54px;
  width: 26px;
  height: 20px;
  border-radius: 12px 10px 12px 8px;
  background:
    radial-gradient(circle at 34% 38%, rgba(135, 92, 24, 0.22) 0 18%, transparent 19%),
    linear-gradient(180deg, #f2d26f 0%, #c49a2d 100%);
  box-shadow: inset 0 -2px 0 rgba(0, 0, 0, 0.12);
  opacity: 0;
  transform: translateY(8px);
  pointer-events: none;
  transition:
    opacity 160ms ease,
    transform 160ms ease;
}

.money-bag {
  width: 36px;
  height: 42px;
  border-radius: 44% 44% 38% 38%;
  background: linear-gradient(180deg, #a56a38 0%, #6f4421 100%);
  box-shadow: inset 0 -4px 0 rgba(0, 0, 0, 0.16);
  opacity: 0;
  transform: translateY(8px);
  pointer-events: none;
  transition:
    opacity 160ms ease,
    transform 160ms ease;
}

.money-bag::before {
  content: "";
  position: absolute;
  left: 10px;
  right: 10px;
  top: -6px;
  height: 12px;
  border-radius: 999px;
  background: #cfb15a;
}

.money-bag::after {
  content: "$";
  position: absolute;
  inset: 12px 0 0;
  text-align: center;
  color: #f9e6a4;
  font-weight: 900;
  font-size: 1rem;
}

.playfield.cheese-spawned .cheese-piece {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}

.general-money-bag {
  left: 430px;
  bottom: 164px;
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}

.hungry-ball,
.hungry-face {
  position: absolute;
}

.hungry-ball {
  left: 474px;
  bottom: 86px;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background:
    radial-gradient(circle at 34% 30%, rgba(255, 255, 255, 0.9) 0 12%, transparent 13%),
    linear-gradient(180deg, #ffe384 0%, #d89e18 100%);
  box-shadow:
    inset 0 -4px 0 rgba(0, 0, 0, 0.14),
    0 4px 8px rgba(0, 0, 0, 0.12);
  transition:
    transform 220ms ease,
    width 220ms ease,
    height 220ms ease,
    left 220ms linear,
    bottom 220ms linear;
}

.hungry-ball::before,
.hungry-ball::after {
  content: "";
  position: absolute;
  top: 14px;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: #2d2316;
}

.hungry-ball::before {
  left: 13px;
}

.hungry-ball::after {
  right: 13px;
}

.hungry-face {
  left: 12px;
  bottom: 10px;
  width: 20px;
  height: 8px;
  border-bottom: 3px solid #2d2316;
  border-radius: 0 0 14px 14px;
}

.playfield.ball-fed .hungry-ball {
  box-shadow:
    inset 0 -4px 0 rgba(0, 0, 0, 0.14),
    0 0 16px rgba(255, 209, 102, 0.44);
}

.playfield.ball-insane .hungry-ball {
  width: 66px;
  height: 66px;
  transform: rotate(-8deg) scale(1.05);
  background:
    radial-gradient(circle at 34% 30%, rgba(255, 255, 255, 0.95) 0 12%, transparent 13%),
    linear-gradient(180deg, #ffb36b 0%, #d14a14 100%);
}

.playfield.ball-insane .hungry-face {
  left: 16px;
  bottom: 13px;
  width: 30px;
  height: 10px;
  border-bottom-width: 4px;
}

.skull {
  right: 14px;
  bottom: 26px;
  width: 52px;
  height: 58px;
  border-radius: 48% 48% 42% 42%;
  background: linear-gradient(180deg, #efefe4 0%, #c6c5bc 100%);
  box-shadow: inset 0 -4px 0 rgba(0, 0, 0, 0.12);
}

.skull::before,
.skull::after {
  content: "";
  position: absolute;
  top: 18px;
  width: 10px;
  height: 12px;
  border-radius: 50%;
  background: #2f2c2a;
}

.skull::before {
  left: 12px;
}

.skull::after {
  right: 12px;
}

.playfield.keith-freed .keith-jail {
  transform: translateX(-18px);
}

.basement-backdrop {
  position: absolute;
  inset: 0;
  border-radius: 22px;
  background:
    linear-gradient(180deg, rgba(56, 46, 39, 0.98) 0%, rgba(32, 23, 17, 0.98) 100%);
  box-shadow: inset 0 10px 0 rgba(255, 255, 255, 0.04);
}

.basement-object {
  position: absolute;
  z-index: 2;
  border: none;
  padding: 0;
  background: transparent;
  color: #f7efe2;
  cursor: pointer;
  font: inherit;
}

.basement-sign {
  left: 18px;
  top: 18px;
  width: 122px;
  height: 40px;
  border-radius: 14px;
  background: linear-gradient(180deg, #836245 0%, #5f432c 100%);
  box-shadow: inset 0 -4px 0 rgba(0, 0, 0, 0.18);
}

.basement-sign span {
  position: absolute;
  inset: 10px 0 0;
  text-align: center;
  font-size: 0.92rem;
}

.lever {
  left: 170px;
  top: 18px;
  width: 64px;
  height: 64px;
}

.lever::before {
  content: "";
  position: absolute;
  left: 21px;
  top: 34px;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: linear-gradient(180deg, #c3cad8 0%, #7f8796 100%);
}

.lever-stick {
  position: absolute;
  left: 31px;
  top: 8px;
  width: 6px;
  height: 34px;
  border-radius: 6px;
  background: linear-gradient(180deg, #ff6b6b 0%, #8f2f2f 100%);
  transform-origin: bottom center;
  transition: transform 160ms ease;
}

.playfield.lever-pulled .lever-stick {
  transform: rotate(34deg);
}

.basement-door {
  top: 18px;
  width: 120px;
  height: 84px;
  border-radius: 18px 18px 10px 10px;
  background: linear-gradient(180deg, #6f4b2d 0%, #412513 100%);
  box-shadow: inset -8px 0 0 rgba(0, 0, 0, 0.18);
}

.basement-door span {
  position: absolute;
  inset: 26px 10px 0;
  text-align: center;
  font-size: 0.8rem;
  line-height: 1.2;
}

.key-door {
  left: 274px;
}

.all-endings-door {
  left: 410px;
}

.stuck-chair {
  right: 22px;
  bottom: 18px;
  width: 110px;
  height: 66px;
  border-radius: 18px 18px 12px 12px;
  background:
    linear-gradient(180deg, #b84d43 0%, #7f261f 100%);
  box-shadow:
    inset 0 -8px 0 rgba(0, 0, 0, 0.16),
    0 6px 0 rgba(63, 22, 18, 0.9);
}

.stuck-chair span {
  position: absolute;
  inset: 20px 8px 0;
  text-align: center;
  font-size: 0.9rem;
}

.player {
  z-index: 4;
  width: 62px;
  height: 62px;
  left: 60px;
  bottom: 64px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background:
    radial-gradient(circle at 34% 30%, rgba(255, 255, 255, 0.9) 0 10px, transparent 11px),
    linear-gradient(180deg, #ffb454 0%, #ff7a00 100%);
  box-shadow:
    inset 0 -10px 0 rgba(0, 0, 0, 0.12),
    0 8px 18px rgba(0, 0, 0, 0.14);
  transition:
    left 120ms linear,
    bottom 120ms ease-out,
    transform 120ms ease;
}

.player.ball-cheese {
  background:
    radial-gradient(circle at 34% 30%, rgba(255, 255, 255, 0.9) 0 10px, transparent 11px),
    linear-gradient(180deg, #ffd861 0%, #f5b800 100%);
}

.player.ball-apple {
  background:
    radial-gradient(circle at 34% 30%, rgba(255, 255, 255, 0.9) 0 10px, transparent 11px),
    linear-gradient(180deg, #ff8a77 0%, #d63636 100%);
}

.player.ball-grape {
  background:
    radial-gradient(circle at 34% 30%, rgba(255, 255, 255, 0.9) 0 10px, transparent 11px),
    linear-gradient(180deg, #b78cff 0%, #6f45c9 100%);
}

.outer-face,
.inner-ball,
.outer-eyes,
.inner-eyes,
.outer-smile,
.inner-frown {
  position: absolute;
}

.outer-face {
  inset: 0;
  border-radius: 50%;
}

.outer-eyes {
  top: 19px;
  left: 18px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #21170e;
  box-shadow: 18px 0 0 #21170e;
}

.outer-smile {
  left: 18px;
  bottom: 13px;
  width: 26px;
  height: 13px;
  border-bottom: 4px solid #21170e;
  border-radius: 0 0 18px 18px;
}

.inner-ball {
  top: 21px;
  left: 22px;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background:
    radial-gradient(circle at 36% 32%, rgba(255, 255, 255, 0.9) 0 4px, transparent 5px),
    linear-gradient(180deg, #8ec5ff 0%, #4f7dd8 100%);
  box-shadow:
    inset 0 -4px 0 rgba(0, 0, 0, 0.16),
    0 1px 4px rgba(0, 0, 0, 0.16);
}

.inner-eyes {
  top: 7px;
  left: 5px;
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: #13233e;
  box-shadow: 9px 0 0 #13233e;
}

.inner-frown {
  left: 5px;
  bottom: 5px;
  width: 14px;
  height: 8px;
  border-top: 3px solid #13233e;
  border-radius: 12px 12px 0 0;
}

.player.jumping {
  transform: translateY(-6px) rotate(-4deg);
}

.player.stuck {
  transform: translateY(0) scale(0.92);
}

.spawn-plate {
  z-index: 2;
  left: 286px;
  bottom: 70px;
  width: 86px;
  height: 20px;
  border-radius: 999px;
  background:
    linear-gradient(180deg, #d7dbe3 0%, #8d96a7 100%);
  box-shadow:
    inset 0 -4px 0 rgba(0, 0, 0, 0.18),
    0 4px 8px rgba(0, 0, 0, 0.12);
}

.spawn-plate-core {
  position: absolute;
  left: 24px;
  right: 24px;
  top: 4px;
  bottom: 5px;
  border-radius: 999px;
  background:
    linear-gradient(180deg, rgba(130, 234, 255, 0.95) 0%, rgba(69, 164, 219, 0.95) 100%);
  opacity: 0.86;
}

.green-line {
  z-index: 2;
  left: 78px;
  bottom: 90px;
  width: 12px;
  height: 94px;
  border-radius: 999px;
  background: linear-gradient(180deg, #9cff87 0%, #33b84d 100%);
  box-shadow:
    0 0 12px rgba(81, 214, 100, 0.32),
    inset 0 -3px 0 rgba(0, 0, 0, 0.12);
  opacity: 0;
  pointer-events: none;
}

.playfield.corner-mode .green-line {
  opacity: 1;
  pointer-events: auto;
}

.trophy {
  z-index: 3;
  width: 56px;
  height: 76px;
  right: 104px;
  bottom: 74px;
  border-radius: 10px 10px 20px 20px;
  background:
    radial-gradient(circle at 50% 24%, #fff5c8 0 12px, transparent 13px),
    linear-gradient(180deg, #ffe08a 0%, #f2b32f 100%);
  box-shadow: inset 0 -10px 0 rgba(0, 0, 0, 0.12);
}

.trophy::before,
.trophy::after {
  content: "";
  position: absolute;
  top: 12px;
  width: 14px;
  height: 22px;
  border: 5px solid #f2b32f;
  border-radius: 16px;
}

.trophy::before {
  left: -10px;
  border-right: none;
}

.trophy::after {
  right: -10px;
  border-left: none;
}

.trophy.tipped {
  transform: rotate(82deg);
  transform-origin: bottom center;
  right: 126px;
  bottom: 60px;
}

.door {
  width: 72px;
  height: 122px;
  left: 18px;
  bottom: 74px;
  border-radius: 18px 18px 8px 8px;
  background: linear-gradient(180deg, #74421f 0%, #4a240d 100%);
  box-shadow: inset -10px 0 0 rgba(0, 0, 0, 0.16);
}

.door::after {
  content: "";
  position: absolute;
  width: 10px;
  height: 10px;
  right: 12px;
  top: 60px;
  border-radius: 50%;
  background: #ffd166;
}

.sign {
  width: 78px;
  height: 74px;
  left: 146px;
  bottom: 118px;
  color: #fff;
  border-radius: 14px;
  background: linear-gradient(180deg, #ff7a00 0%, #d95f00 100%);
  box-shadow: 0 10px 0 #9c4704;
}

.sign span {
  position: absolute;
  inset: 22px 0 0;
  display: block;
  text-align: center;
  font-size: 1.35rem;
}

.sign::after {
  content: "";
  position: absolute;
  left: 32px;
  top: 70px;
  width: 12px;
  height: 60px;
  background: #7c532d;
}

.shrub {
  width: 82px;
  height: 54px;
  right: 256px;
  bottom: 74px;
  border-radius: 28px;
  background:
    radial-gradient(circle at 18px 20px, #99d768 0 16px, transparent 17px),
    radial-gradient(circle at 40px 16px, #8ccd5e 0 18px, transparent 19px),
    radial-gradient(circle at 62px 22px, #79b74a 0 18px, transparent 19px);
}

.pit {
  width: 92px;
  height: 22px;
  right: 12px;
  bottom: 60px;
  border-radius: 999px 999px 14px 14px;
  background: linear-gradient(180deg, #5f3819 0%, #2f1809 100%);
  box-shadow: inset 0 8px 10px rgba(0, 0, 0, 0.26);
}

.controls-bar,
.ball-roster,
.actions,
.ending-card-header {
  display: flex;
  gap: 10px;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
}

.controls-bar {
  margin-top: 16px;
}

.ball-roster {
  margin-top: 14px;
}

.ball-chip {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  border-radius: 999px;
  border: 1px solid rgba(31, 24, 15, 0.12);
  background: rgba(255, 255, 255, 0.66);
  color: var(--ink);
}

.ball-chip.active {
  border-color: rgba(255, 122, 0, 0.34);
  background: rgba(255, 232, 183, 0.76);
}

.ball-chip-dot {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  box-shadow: inset 0 -2px 0 rgba(0, 0, 0, 0.14);
}

.cheese-dot {
  background: linear-gradient(180deg, #ffd861 0%, #f5b800 100%);
}

.apple-dot {
  background: linear-gradient(180deg, #ff8a77 0%, #d63636 100%);
}

.grape-dot {
  background: linear-gradient(180deg, #b78cff 0%, #6f45c9 100%);
}

.actions {
  margin-top: 18px;
}

.secondary-button,
.primary-button {
  border-radius: 999px;
  padding: 12px 18px;
  font: inherit;
  font-weight: 800;
  cursor: pointer;
}

.secondary-button {
  border: 1px solid rgba(31, 24, 15, 0.14);
  background: rgba(255, 255, 255, 0.76);
  color: var(--text);
}

.primary-button {
  border: none;
  background: linear-gradient(180deg, #ffb454 0%, var(--accent) 60%, var(--accent-dark) 100%);
  color: white;
  box-shadow: inset 0 -8px 0 rgba(0, 0, 0, 0.12);
}

.control-button {
  min-width: 92px;
}

.danger-button {
  color: var(--danger);
}

.message {
  min-height: 2.2em;
  margin: 18px 0 0;
  text-align: center;
  color: var(--muted);
  font-size: 1.05rem;
  font-weight: 700;
}

.ending-card-header {
  justify-content: space-between;
  margin-bottom: 12px;
}

.progress-pill {
  display: inline-flex;
  align-items: center;
  padding: 8px 12px;
  border-radius: 999px;
  background: rgba(255, 209, 102, 0.35);
  color: #6f430e;
  font-size: 0.95rem;
}

.ending-list {
  display: grid;
  gap: 10px;
  padding: 0;
  margin: 0;
  list-style: none;
}

.ending-item {
  padding: 14px 16px;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.72);
  border: 1px solid rgba(111, 63, 14, 0.08);
}

.ending-item strong,
.ending-item span {
  display: block;
}

.ending-item span {
  margin-top: 4px;
  color: var(--muted);
}

.ending-item.locked {
  opacity: 0.72;
}

.ending-item.summary {
  background: rgba(255, 209, 102, 0.18);
}

.overlay {
  position: fixed;
  inset: 0;
  z-index: 12;
  display: grid;
  place-items: center;
  padding: 20px;
  background: rgba(24, 16, 8, 0.44);
  backdrop-filter: blur(8px);
}

.overlay.hidden {
  display: none;
}

.overlay-card {
  width: min(520px, 100%);
  text-align: center;
}

.settings-card {
  text-align: left;
}

.settings-list {
  display: grid;
  gap: 14px;
  margin: 18px 0 22px;
}

.settings-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 14px 16px;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.68);
  border: 1px solid rgba(111, 63, 14, 0.08);
  color: var(--ink);
  font-weight: 800;
}

.settings-toggle {
  min-width: 82px;
}

.settings-select {
  border: 1px solid rgba(31, 24, 15, 0.14);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.92);
  color: var(--text);
  padding: 10px 14px;
  font: inherit;
  font-weight: 800;
}

.burst-layer {
  position: fixed;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
}

.burst {
  position: absolute;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  animation: burst-fall 900ms ease-out forwards;
}

@keyframes burst-fall {
  0% {
    transform: translate3d(0, 0, 0) scale(1);
    opacity: 1;
  }

  100% {
    transform: translate3d(var(--x-shift), var(--y-shift), 0) scale(0.2);
    opacity: 0;
  }
}

@media (max-width: 720px) {
  .app {
    padding: 18px 0 34px;
  }

  .hero,
  .game-card,
  .ending-card,
  .overlay-card {
    border-radius: 24px;
  }

  .status-row {
    grid-template-columns: 1fr;
  }

  .playfield {
    height: 300px;
  }

  .sun {
    right: 22px;
    width: 68px;
    height: 68px;
  }
}
