* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; overflow: hidden; background: #1d1430; }
body { font-family: "Trebuchet MS", "Segoe UI", system-ui, sans-serif; color: #fffefa; touch-action: none; user-select: none; -webkit-user-select: none; }
canvas { display: block; position: fixed; inset: 0; }

/* start.ng player card (from the start.ng docs) */
.startng-card { position: fixed; top: 16px; left: 16px; z-index: 5; display: flex; align-items: center; gap: 12px;
  padding: 8px 16px 8px 8px; border-radius: 999px; background: #292a23; color: #fffefa; font-family: sans-serif;
  box-shadow: 0 4px 16px rgba(0,0,0,.3); max-width: calc(100vw - 32px); }
.startng-card img { width: 48px; height: 48px; border-radius: 50%; background: #d8fd71; flex: none; }
.startng-card b { display: block; font-size: 16px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 40vw; }
.startng-card span { font-size: 12px; opacity: .7; }
.startng-card button { margin-left: 8px; border: 0; border-radius: 999px; padding: 6px 12px; background: #d8fd71; color: #292a23; font-weight: 700; cursor: pointer; }

.hud { position: fixed; top: 16px; right: 16px; z-index: 4; text-align: right; text-shadow: 0 2px 0 rgba(0,0,0,.35); pointer-events: none; }
.hud-score { font-size: 44px; font-weight: 900; line-height: 1; color: #ffd166; }
.hud-score small { font-size: 14px; margin-left: 6px; color: #fffefa; opacity: .85; }
.hud-row { margin-top: 6px; display: flex; gap: 12px; justify-content: flex-end; align-items: center; font-size: 15px; }
.hud-streak b { color: #d8fd71; }

.mute { position: fixed; bottom: 14px; right: 14px; z-index: 6; width: 42px; height: 42px; border-radius: 50%; border: 0;
  background: rgba(41,42,35,.75); color: #fff; font-size: 18px; cursor: pointer; }

.quit { position: fixed; bottom: 14px; left: 14px; z-index: 6; height: 42px; padding: 0 16px; border-radius: 999px; border: 0;
  background: rgba(41,42,35,.75); color: #fff; font-size: 15px; font-weight: 700; cursor: pointer; }
.quit[hidden] { display: none; }
.home-link { display: block; margin-top: 14px; font-size: 14px; color: #d8fd71; }
.link-btn { margin-top: 12px; border: 0; background: none; color: #d8fd71; font-size: 15px; text-decoration: underline; cursor: pointer; }
.panel { position: fixed; z-index: 3; left: 50%; top: 50%; transform: translate(-50%, -50%);
  width: min(420px, calc(100vw - 32px)); max-height: calc(100vh - 110px); overflow-y: auto;
  margin-top: 30px; padding: 24px 22px; border-radius: 24px; text-align: center;
  background: rgba(41,42,35,.92); box-shadow: 0 12px 40px rgba(0,0,0,.45); border: 2px solid #ffd166; }
.panel[hidden], .hud[hidden], .startng-card[hidden] { display: none; }
h1 { margin: 0 0 8px; font-size: 40px; line-height: 1; color: #ffd166; letter-spacing: .5px; }
h1 span { color: #ff7a45; }
.over-title { color: #ff7a45; }
.lede { margin: 8px 0 14px; font-size: 16px; line-height: 1.4; }
.legend { list-style: none; padding: 0; margin: 0 0 10px; display: grid; gap: 6px; font-size: 15px; text-align: left; justify-content: center; }
.dot { display: inline-block; width: 16px; height: 16px; border-radius: 50%; vertical-align: -3px; margin-right: 6px; }
.dot.puff { background: radial-gradient(circle at 35% 35%, #f6c26b, #b8651b); }
.dot.gold { background: radial-gradient(circle at 35% 35%, #fff6b0, #f0b400); box-shadow: 0 0 8px #ffd700; }
.dot.pepper { background: radial-gradient(circle at 35% 35%, #ff6b5b, #c0150a); }
.controls { font-size: 13px; opacity: .75; margin: 6px 0 16px; }
.big { border: 0; border-radius: 999px; padding: 14px 44px; font-size: 20px; font-weight: 800; cursor: pointer;
  background: #d8fd71; color: #292a23; box-shadow: 0 4px 0 #8fb33a; }
.big:active { transform: translateY(3px); box-shadow: 0 1px 0 #8fb33a; }
.result { display: flex; justify-content: center; gap: 28px; margin: 14px 0 6px; }
.result b { display: block; font-size: 42px; color: #ffd166; line-height: 1; }
.result small { font-size: 13px; opacity: .8; }
.save-msg { min-height: 20px; font-size: 14px; margin: 8px 0 14px; color: #d8fd71; }
.save-msg a { color: #d8fd71; }
.board-wrap { margin-top: 18px; text-align: left; }
.board-wrap h2 { font-size: 15px; margin: 0 0 6px; opacity: .85; text-transform: uppercase; letter-spacing: 1px; }
.board { margin: 0; padding: 0; list-style: none; font-size: 14px; }
.board li { display: flex; gap: 8px; padding: 6px 10px; border-radius: 10px; }
.board li:nth-child(odd) { background: rgba(255,255,255,.05); }
.board li.me { background: rgba(216,253,113,.18); outline: 1px solid #d8fd71; }
.board .rank { width: 26px; opacity: .7; }
.board .who { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.board .swatch { display: inline-block; width: 10px; height: 10px; border-radius: 50%; margin-right: 6px; }
.board .muted { opacity: .6; justify-content: center; }

@media (max-width: 480px) {
  .startng-card { top: 10px; left: 10px; padding: 5px 12px 5px 5px; gap: 8px; }
  .startng-card img { width: 36px; height: 36px; }
  .startng-card b { font-size: 14px; max-width: 30vw; }
  .hud { top: 10px; right: 10px; }
  .hud-score { font-size: 34px; }
  h1 { font-size: 34px; }
}

/* levels */
.hud-level { margin-top: 4px; font-size: 14px; font-weight: 700; color: #fffefa; opacity: .9; }
.level-num { margin: 0 0 4px; font-size: 13px; letter-spacing: 1.5px; text-transform: uppercase; color: #d8fd71; }
.story { display: flex; gap: 12px; align-items: flex-start; text-align: left; margin: 14px 0 10px; }
.story img { width: 52px; height: 52px; border-radius: 50%; background: #d8fd71; flex: none; }
.bubble { position: relative; flex: 1; background: #fffefa; color: #292a23; border-radius: 14px; padding: 10px 14px; }
.bubble b { display: block; font-size: 13px; color: #7a4e1d; margin-bottom: 2px; }
.bubble p { margin: 0; font-size: 15px; line-height: 1.4; }
.level-goal { font-weight: 700; color: #ffd166; margin: 10px 0 4px; }
.level-bonus { color: #ff9a9a; font-weight: 700; margin: 4px 0; }
.level-bonus[hidden] { display: none; }
.level-panel .big { margin-top: 12px; }
.final-city { margin: 6px 0 0; font-size: 15px; }

/* coins, shop, city picker */
.start-in { margin: 4px 0 6px; font-size: 13px; opacity: .8; }
.city-picker { display: flex; flex-wrap: wrap; gap: 6px; justify-content: center; margin-bottom: 14px; }
.chip { border: 1px solid rgba(255,255,255,.25); background: transparent; color: #fffefa; border-radius: 999px; padding: 6px 12px; font-size: 13px; cursor: pointer; }
.chip.on { background: #ffd166; color: #292a23; border-color: #ffd166; font-weight: 700; }
.chip:disabled { opacity: .45; cursor: not-allowed; }
.shop-btn { margin-top: 12px; border: 2px solid #ffd166; background: transparent; color: #ffd166; border-radius: 999px; padding: 8px 18px; font-size: 15px; font-weight: 700; cursor: pointer; }
.wallet { margin: 4px 0 10px; font-size: 16px; }
.wallet b { color: #ffd166; }
.shop-h { font-size: 13px; text-transform: uppercase; letter-spacing: 1px; opacity: .85; margin: 14px 0 6px; text-align: left; }
.shop-note { font-size: 12px; opacity: .7; margin: 0 0 8px; text-align: left; }
.shop-row { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 12px; text-align: left; }
.shop-row:nth-child(odd) { background: rgba(255,255,255,.05); }
.shop-row.on { outline: 1px solid #d8fd71; background: rgba(216,253,113,.1); }
.flav { width: 30px; height: 30px; border-radius: 50%; flex: none; }
.shop-txt { flex: 1; min-width: 0; }
.shop-txt b { display: block; font-size: 15px; }
.shop-txt small { font-size: 12px; opacity: .75; }
.buy { flex: none; border: 0; border-radius: 999px; padding: 7px 12px; background: #d8fd71; color: #292a23; font-weight: 800; cursor: pointer; min-width: 74px; }
.buy:disabled { background: rgba(255,255,255,.15); color: rgba(255,255,255,.6); cursor: default; }
.shop-panel .big { margin: 16px 0 8px; }
.level-coins { color: #ffd166; font-weight: 700; margin: 4px 0; }
.level-coins[hidden] { display: none; }
