:root {
  --ink: #1e1230;
  --ink-2: #2d1f47;
  --panel: rgba(30, 18, 48, 0.72);
  --panel-solid: #2a1c44;
  --line: rgba(255, 255, 255, 0.14);
  --cream: #fff7ec;
  --muted: rgba(255, 247, 236, 0.66);
  --sun: #ffcf4a;
  --sun-2: #ffa92e;
  --sun-edge: #c9711a;
  --coral: #ff6b7d;
  --mint: #3ee0a1;
  --sky: #5ad8ff;
  --violet: #9b87ff;
  --r-lg: 28px;
  --r-md: 18px;
  --r-sm: 12px;
  --display: "Baloo 2", "Fredoka", ui-rounded, system-ui, sans-serif;
  --body: "Nunito", ui-rounded, system-ui, sans-serif;
  --safe-t: env(safe-area-inset-top, 0px);
  --safe-b: env(safe-area-inset-bottom, 0px);
  --ease-out: cubic-bezier(.2, .9, .25, 1.15);
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body {
  margin: 0; height: 100%; overflow: hidden;
  background: #120a1f;
  color: var(--cream);
  font-family: var(--body);
  -webkit-font-smoothing: antialiased;
  user-select: none; -webkit-user-select: none;
  touch-action: none; overscroll-behavior: none;
}
button { font: inherit; color: inherit; border: 0; background: none; cursor: pointer; padding: 0; }
[hidden] { display: none !important; }
svg { display: block; }

#app {
  position: fixed; inset: 0;
  display: grid; place-items: center;
  background:
    radial-gradient(1200px 700px at 50% 0%, #3b2463 0%, transparent 60%),
    radial-gradient(900px 600px at 50% 100%, #24143d 0%, transparent 60%),
    #120a1f;
}
#stage {
  position: relative;
  height: 100%;
  aspect-ratio: 62 / 100;
  max-width: 100%;
  container-type: size;
  overflow: hidden;
  background: #ffd9a8;
  box-shadow: 0 0 0 1px rgba(255,255,255,.06), 0 30px 80px rgba(0,0,0,.5);
}
@media (min-aspect-ratio: 62/100) { #stage { border-radius: 0; } }
#game { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.layer { position: absolute; inset: 0; }

/* ---------- primitives ---------- */
.glass {
  background-color: var(--panel);
  background-image: url(art/pattern.svg);
  background-size: 180px 180px;
  backdrop-filter: blur(14px) saturate(140%);
  -webkit-backdrop-filter: blur(14px) saturate(140%);
  border: 1px solid var(--line);
}
.icon-btn {
  width: 48px; height: 48px; border-radius: 16px;
  display: grid; place-items: center;
  transition: transform .12s ease, background .2s;
}
.icon-btn:active { transform: scale(.92); }
.icon-btn svg { width: 22px; height: 22px; }
.chip {
  display: inline-flex; align-items: center; gap: 6px;
  height: 36px; padding: 0 14px 0 10px; border-radius: 999px;
  font: 800 16px/1 var(--display);
}
.chip svg { width: 18px; height: 18px; }
.ic-fish { color: var(--sun); display: inline-grid; }

.btn {
  position: relative; white-space: nowrap;
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 52px; padding: 0 20px; border-radius: var(--r-md);
  font: 800 17px/1 var(--display); letter-spacing: .01em;
  transition: transform .12s ease, box-shadow .12s ease, filter .2s;
}
.btn svg { width: 20px; height: 20px; }
.btn:focus-visible, .icon-btn:focus-visible { outline: 3px solid var(--sky); outline-offset: 3px; }
.btn-primary {
  color: var(--ink);
  background: linear-gradient(180deg, #ffe27a 0%, var(--sun) 45%, var(--sun-2) 100%);
  box-shadow: inset 0 2px 0 rgba(255,255,255,.6), 0 6px 0 var(--sun-edge), 0 14px 24px rgba(201,113,26,.35);
}
.btn-primary:active { transform: translateY(4px); box-shadow: inset 0 2px 0 rgba(255,255,255,.6), 0 2px 0 var(--sun-edge), 0 6px 12px rgba(201,113,26,.3); }
.btn-glass {
  color: var(--cream);
  background: rgba(255,255,255,.1);
  border: 1px solid var(--line);
  box-shadow: 0 4px 0 rgba(0,0,0,.25);
  backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
}
.btn-glass:active { transform: translateY(3px); box-shadow: 0 1px 0 rgba(0,0,0,.25); }
.btn-xl { height: 64px; font-size: 24px; border-radius: 22px; padding: 0 32px; }
.btn-xl svg { width: 24px; height: 24px; }
.btn-square { width: 64px; height: 64px; padding: 0; border-radius: 22px; }
.btn[disabled] { filter: grayscale(.8) brightness(.8); pointer-events: none; }
.dot { position: absolute; top: 8px; right: 8px; width: 9px; height: 9px; border-radius: 50%; background: var(--coral); box-shadow: 0 0 0 2px var(--panel-solid); }

/* ---------- title ---------- */
.screen {
  display: flex; flex-direction: column; align-items: center;
  padding: calc(14px + var(--safe-t)) 18px calc(14px + var(--safe-b));
  overflow-y: auto; overflow-x: hidden;
  animation: fadeIn .35s ease both;
}
.screen::before {
  content: ""; position: absolute; inset: 0; z-index: -1; pointer-events: none;
  background: linear-gradient(180deg, rgba(30,18,48,.0) 0%, rgba(30,18,48,.25) 45%, rgba(30,18,48,.75) 100%);
}
.title-top { width: 100%; display: flex; gap: 8px; align-items: center; }
.title-top .icon-btn, .title-top .btn-cat { margin-left: auto; }
.logo { flex: none; margin: auto 0; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; }
.logo-cat { height: min(230px, 21cqh); width: auto; aspect-ratio: 320/260; margin-bottom: -8px; filter: drop-shadow(0 10px 18px rgba(30,18,48,.25)); }
.logo-word {
  margin: 0; font: 800 clamp(36px, min(13cqw, 7.4cqh), 64px)/0.86 var(--display);
  color: var(--cream); letter-spacing: -.01em;
  display: flex; flex-direction: column; align-items: center;
  text-shadow: 0 3px 0 #c75f4f, 0 6px 0 #8f3a45, 0 14px 22px rgba(40,10,40,.35);
}
.logo-word em { font-style: normal; font-size: .5em; color: var(--sun); margin: 2px 0 -4px; text-shadow: 0 2px 0 #b5641a; }
.logo-tag { margin: 12px 0 0; font: 700 15px/1.3 var(--body); color: rgba(30,18,48,.75); }
.title-best {
  flex: none; margin: min(10px, 1.2cqh) 0; display: inline-flex; align-items: center; gap: 6px;
  font: 700 15px var(--body); color: rgba(30,18,48,.8);
}
.title-best svg { width: 18px; height: 18px; color: #c9711a; }
.title-best b { font: 800 18px var(--display); color: var(--ink); }
.goals {
  flex: none; width: 100%; border-radius: var(--r-lg); padding: 14px 16px 10px;
}
.goals h3 { margin: 0 0 8px; font: 800 13px/1 var(--display); letter-spacing: .12em; text-transform: uppercase; color: var(--muted); display: flex; justify-content: space-between; }
.goal { display: grid; grid-template-columns: 26px 1fr auto; gap: 10px; align-items: center; padding: min(7px, 0.8cqh) 0; }
.goal + .goal { border-top: 1px solid rgba(255,255,255,.07); }
.goal-check { width: 26px; height: 26px; border-radius: 9px; border: 2px solid rgba(255,255,255,.25); display: grid; place-items: center; }
.goal-check svg { width: 16px; height: 16px; }
.goal.done .goal-check { background: var(--mint); border-color: var(--mint); color: var(--ink); }
.goal-text { font: 700 14px/1.25 var(--body); }
.goal-bar { grid-column: 2; height: 5px; border-radius: 3px; background: rgba(255,255,255,.12); overflow: hidden; margin-top: 5px; }
.goal-bar i { display: block; height: 100%; background: var(--sun); border-radius: 3px; transition: width .6s var(--ease-out); }
.goal-reward { font: 800 13px var(--display); color: var(--sun); display: inline-flex; align-items: center; gap: 3px; }
.goal-reward svg { width: 14px; height: 14px; }
.title-actions { flex: none; width: 100%; margin-top: min(14px, 1.6cqh); display: flex; flex-direction: column; gap: min(10px, 1.2cqh); }
.title-actions .btn-xl { width: 100%; }
.title-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(0, 1fr)); gap: 10px; width: 100%; }
.title-row .btn { padding: 0 8px; font-size: 15px; }
.title-hint { flex: none; margin: 8px 0 0; font: 700 12px var(--body); color: var(--muted); letter-spacing: .04em; }

/* ---------- HUD ---------- */
#hud { pointer-events: none; padding: calc(10px + var(--safe-t)) 12px 0; }
#hud button { pointer-events: auto; }
.hud-top { display: grid; grid-template-columns: 48px 1fr auto; align-items: start; gap: 8px; }
.hud-score { text-align: center; line-height: 1; }
.hud-score-num {
  font: 800 44px/1 var(--display); color: #fff; letter-spacing: -.01em;
  text-shadow: 0 2px 0 rgba(30,18,48,.35), 0 0 18px rgba(30,18,48,.25);
  font-variant-numeric: tabular-nums;
}
.hud-score-sub { margin-top: 2px; font: 800 14px var(--display); color: rgba(255,255,255,.92); text-shadow: 0 1px 4px rgba(30,18,48,.5); font-variant-numeric: tabular-nums; }
.hud-fish {
  height: 40px; padding: 0 14px 0 10px; border-radius: 999px;
  display: flex; align-items: center; gap: 6px; font: 800 18px var(--display);
  font-variant-numeric: tabular-nums;
}
.hud-fish svg { width: 20px; height: 20px; }
.hud-fish.pop { animation: pop .25s var(--ease-out); }
.hud-row { margin-top: 10px; display: grid; grid-template-columns: auto 1fr auto; gap: 10px; align-items: center; }
.hud-hearts { display: flex; gap: 2px; }
.hud-hearts span { width: 22px; height: 22px; color: var(--coral); filter: drop-shadow(0 2px 2px rgba(30,18,48,.35)); transition: transform .3s var(--ease-out), opacity .3s; }
.hud-hearts span svg { width: 22px; height: 22px; }
.hud-hearts span.lost { color: rgba(30,18,48,.35); transform: scale(.8); }
.hud-hearts span.shield { color: var(--sky); }
.hud-meter {
  position: relative; height: 18px; border-radius: 999px;
  background: rgba(30,18,48,.45); border: 1px solid rgba(255,255,255,.18); overflow: hidden;
}
.hud-meter-fill {
  position: absolute; inset: 0; width: 0%;
  background: linear-gradient(90deg, #ff7ab8, #ffcf4a, #3ee0a1, #5ad8ff, #9b87ff);
  background-size: 200% 100%;
  transition: width .25s ease;
}
.hud-meter.full .hud-meter-fill { animation: rainbow 1s linear infinite; }
.hud-meter-label { position: absolute; inset: 0; display: grid; place-items: center; font: 800 10px/1 var(--display); letter-spacing: .2em; color: #fff; text-shadow: 0 1px 2px rgba(30,18,48,.7); }
.hud-combo {
  min-width: 52px; height: 30px; padding: 0 10px; border-radius: 10px;
  display: grid; place-items: center;
  font: 800 18px/1 var(--display); color: var(--ink); background: var(--cream);
  box-shadow: 0 3px 0 rgba(30,18,48,.3);
  transition: transform .2s var(--ease-out), background .2s;
}
.hud-combo.hot { background: var(--sun); }
.hud-combo.max { background: linear-gradient(90deg, #ff7ab8, #ffcf4a); }
.hud-combo.bump { animation: pop .3s var(--ease-out); }
.hud-powerups { margin-top: 8px; display: flex; gap: 6px; justify-content: flex-end; }
.pu {
  display: inline-flex; align-items: center; gap: 5px; height: 28px; padding: 0 10px 0 7px; border-radius: 999px;
  font: 800 13px var(--display); background: rgba(30,18,48,.55); border: 1px solid rgba(255,255,255,.15);
}
.pu svg { width: 16px; height: 16px; }
.storm-warn {
  position: absolute; left: 50%; top: calc(132px + var(--safe-t)); transform: translate(-50%, -8px);
  display: inline-flex; align-items: center; gap: 6px;
  padding: 7px 14px; border-radius: 999px;
  background: rgba(255,107,125,.92); color: #fff; font: 800 14px var(--display);
  opacity: 0; transition: opacity .25s, transform .25s;
  box-shadow: 0 6px 16px rgba(255,107,125,.4);
}
.storm-warn svg { width: 16px; height: 16px; }
.storm-warn.on { opacity: 1; transform: translate(-50%, 0); animation: throb .8s ease-in-out infinite; }
.coach {
  position: absolute; left: 16px; right: 16px; bottom: calc(120px + var(--safe-b));
  margin: 0 auto; max-width: 360px; padding: 14px 16px; border-radius: 20px;
  background: rgba(30,18,48,.82); border: 1px solid var(--line);
  backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
  text-align: center; font: 700 15px/1.35 var(--body);
  animation: rise .35s var(--ease-out) both;
}
.coach b { font-family: var(--display); color: var(--sun); font-size: 17px; display: block; margin-bottom: 2px; }
.kbd { display: inline-grid; place-items: center; min-width: 26px; height: 24px; padding: 0 6px; margin: 0 2px; border-radius: 7px; background: rgba(255,255,255,.14); border: 1px solid rgba(255,255,255,.25); border-bottom-width: 3px; font: 800 12px var(--display); vertical-align: 1px; }
.toast {
  position: absolute; left: 50%; top: calc(170px + var(--safe-t)); transform: translateX(-50%);
  display: flex; align-items: center; gap: 10px;
  padding: 10px 16px 10px 10px; border-radius: 16px; white-space: nowrap;
  background: var(--mint); color: var(--ink); font: 800 14px var(--display);
  box-shadow: 0 8px 20px rgba(62,224,161,.35);
  animation: toast 2.6s var(--ease-out) both;
}
.toast i { width: 26px; height: 26px; border-radius: 9px; background: var(--ink); color: var(--mint); display: grid; place-items: center; }
.toast i svg { width: 16px; height: 16px; }
.touch-hint {
  position: absolute; bottom: calc(22px + var(--safe-b)); width: 64px; height: 64px; border-radius: 50%;
  display: grid; place-items: center; color: #fff;
  background: rgba(30,18,48,.22); border: 2px solid rgba(255,255,255,.35);
  opacity: 0; transform: scale(.9); transition: opacity .2s, transform .12s, background .12s;
}
.touch-hint svg { width: 28px; height: 28px; }
.touch-hint.left { left: 20px; } .touch-hint.right { right: 20px; }
.touch-mode .touch-hint { opacity: .55; }
.touch-hint.on { opacity: 1 !important; transform: scale(1.08); background: rgba(255,207,74,.55); }

/* ---------- game over ---------- */
#screen-over { justify-content: center; gap: 18px; background: rgba(18,10,31,.45); }
.over-card { width: 100%; max-width: 420px; border-radius: var(--r-lg); padding: 22px 18px 16px; text-align: center; animation: rise .45s var(--ease-out) both; }
.over-badge {
  display: inline-block; margin-bottom: 6px; padding: 6px 14px; border-radius: 999px;
  background: linear-gradient(90deg, #ff7ab8, #ffcf4a); color: var(--ink); font: 800 14px var(--display); letter-spacing: .04em;
  animation: pop .5s .3s var(--ease-out) both;
}
.over-title { font: 800 15px var(--display); letter-spacing: .14em; text-transform: uppercase; color: var(--muted); }
.over-score { font: 800 64px/1 var(--display); color: #fff; margin: 4px 0 2px; font-variant-numeric: tabular-nums; }
.over-best { font: 700 14px var(--body); color: var(--muted); }
.stat-grid { margin: 16px 0 12px; display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.stat { padding: 10px 6px; border-radius: 14px; background: rgba(255,255,255,.07); }
.stat b { display: block; font: 800 20px/1.1 var(--display); color: #fff; }
.stat span { font: 700 11px var(--body); color: var(--muted); text-transform: uppercase; letter-spacing: .06em; }
.over-goals { text-align: left; }
.over-earn { margin-top: 10px; display: inline-flex; align-items: center; gap: 6px; font: 700 16px var(--body); }
.over-earn b { font: 800 22px var(--display); color: var(--sun); }
.over-earn svg { width: 22px; height: 22px; }
.over-actions { width: 100%; max-width: 420px; display: flex; align-items: flex-end; gap: 12px; animation: rise .45s .1s var(--ease-out) both; }

/* ---------- modal & sheet ---------- */
.modal { display: grid; place-items: center; padding: 20px; background: rgba(18,10,31,.55); animation: fadeIn .2s ease both; }
.modal-card { width: 100%; max-width: 360px; border-radius: var(--r-lg); padding: 22px 18px 18px; display: flex; flex-direction: column; gap: 12px; animation: rise .3s var(--ease-out) both; }
.modal-card h2 { margin: 0 0 4px; text-align: center; font: 800 30px var(--display); }
.settings-list { display: flex; flex-direction: column; gap: 4px; margin-bottom: 4px; }
.toggle-row { display: flex; align-items: center; gap: 12px; min-height: 48px; padding: 4px 4px; font: 700 16px var(--body); }
.toggle-row svg { width: 20px; height: 20px; color: var(--muted); }
.toggle-row span { flex: 1; }
.switch { width: 52px; height: 30px; border-radius: 999px; background: rgba(255,255,255,.18); position: relative; transition: background .2s; flex: none; }
.switch::after { content: ""; position: absolute; top: 3px; left: 3px; width: 24px; height: 24px; border-radius: 50%; background: #fff; box-shadow: 0 2px 4px rgba(0,0,0,.3); transition: transform .25s var(--ease-out); }
.switch[aria-checked="true"] { background: var(--mint); }
.switch[aria-checked="true"]::after { transform: translateX(22px); }

.sheet-wrap { z-index: 5; }
.sheet-scrim { position: absolute; inset: 0; background: rgba(18,10,31,.55); animation: fadeIn .2s ease both; }
.sheet {
  position: absolute; left: 0; right: 0; bottom: 0; max-height: 86%;
  border-radius: 30px 30px 0 0; border-bottom: 0;
  background: rgba(36, 22, 58, 0.94);
  display: flex; flex-direction: column;
  padding-bottom: var(--safe-b);
  animation: sheetUp .35s var(--ease-out) both;
}
.sheet-grab { width: 44px; height: 5px; border-radius: 3px; background: rgba(255,255,255,.25); margin: 10px auto 2px; }
.sheet-head { display: flex; align-items: center; gap: 10px; padding: 6px 12px 10px 20px; }
.sheet-head h2 { margin: 0; flex: 1; font: 800 26px var(--display); }
.sheet-head .chip { background: rgba(255,255,255,.08); }
.sheet-body { overflow-y: auto; padding: 4px 16px 20px; display: flex; flex-direction: column; gap: 10px; touch-action: pan-y; }

.cat-card {
  display: grid; grid-template-columns: 92px 1fr; gap: 12px; align-items: center;
  padding: 10px 14px 10px 10px; border-radius: 22px; text-align: left;
  background: rgba(255,255,255,.06); border: 2px solid transparent;
  transition: border-color .2s, background .2s, transform .12s;
}
.cat-card:active { transform: scale(.98); }
.cat-card.selected { border-color: var(--sun); background: rgba(255,207,74,.1); }
.cat-card img { width: 92px; height: 92px; border-radius: 18px; background: radial-gradient(circle at 50% 40%, rgba(255,255,255,.18), rgba(255,255,255,.03)); }
.cat-card h4 { margin: 0; font: 800 21px/1.1 var(--display); display: flex; align-items: center; gap: 8px; }
.cat-card p { margin: 3px 0 8px; font: 600 13px/1.35 var(--body); color: var(--muted); }
.tag { display: inline-flex; align-items: center; gap: 4px; height: 26px; padding: 0 10px; border-radius: 999px; font: 800 13px var(--display); }
.tag svg { width: 15px; height: 15px; }
.tag-sel { background: var(--sun); color: var(--ink); }
.tag-buy { background: var(--mint); color: var(--ink); }
.tag-lock { background: rgba(255,255,255,.1); color: var(--muted); }
.tag-own { background: rgba(255,255,255,.12); }

.upg-card { padding: 14px; border-radius: 22px; background: rgba(255,255,255,.06); display: grid; grid-template-columns: 44px 1fr auto; gap: 12px; align-items: center; }
.upg-ic { width: 44px; height: 44px; border-radius: 14px; display: grid; place-items: center; background: rgba(155,135,255,.2); color: var(--violet); }
.upg-ic svg { width: 22px; height: 22px; }
.upg-card h4 { margin: 0; font: 800 18px var(--display); }
.upg-card p { margin: 2px 0 6px; font: 600 13px/1.3 var(--body); color: var(--muted); }
.pips { display: flex; gap: 4px; }
.pips i { width: 18px; height: 6px; border-radius: 3px; background: rgba(255,255,255,.15); }
.pips i.on { background: var(--violet); }
.upg-buy { height: 44px; padding: 0 12px; border-radius: 14px; font-size: 15px; min-width: 84px; }
.upg-buy svg { width: 16px; height: 16px; }

#rotate-hint { display: grid; place-items: center; text-align: center; background: var(--ink); font: 800 20px var(--display); padding: 30px; }

@keyframes fadeIn { from { opacity: 0; } }
@keyframes rise { from { opacity: 0; transform: translateY(18px) scale(.98); } }
@keyframes sheetUp { from { transform: translateY(100%); } }
@keyframes pop { 0% { transform: scale(1); } 40% { transform: scale(1.22); } 100% { transform: scale(1); } }
@keyframes throb { 50% { box-shadow: 0 6px 26px rgba(255,107,125,.75); } }
@keyframes rainbow { to { background-position: -200% 0; } }
@keyframes toast { 0% { opacity: 0; transform: translate(-50%, -12px) scale(.9); } 12% { opacity: 1; transform: translate(-50%, 0) scale(1); } 85% { opacity: 1; } 100% { opacity: 0; transform: translate(-50%, -8px); } }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}
@media (max-height: 700px) {
  .logo-cat { height: 17cqh; }
  .btn-xl { height: 56px; font-size: 22px; }
  .title-best { margin: 4px 0 8px; }
  .title-top .chip { height: 32px; }
  .logo-tag { display: none; }
  .goal-bar { margin-top: 3px; height: 4px; }
  .goals h3 { margin-bottom: 4px; }
  .over-card { padding-top: 14px; }
  .over-score { font-size: 52px; }
  .stat { padding: 7px 4px; }
  .title-actions .btn:not(.btn-xl) { height: 46px; }
  .goals { padding: 10px 14px 6px; }
  .goal-text { font-size: 13px; }
  .title-hint { display: none; }
}
@media (max-height: 640px) {
  .logo-cat { width: 150px; }
  .logo-word { font-size: 40px; }
  .goal { padding: 4px 0; }
  .btn-xl { height: 56px; }
}

/* ---------- cat-themed additions ---------- */
@supports not (aspect-ratio: 1) { #stage { width: min(100vw, 62vh); } }
.btn-cat {
  position: relative; flex: none;
  width: 50px; height: 56px; padding-top: 10px;
  display: grid; place-items: center;
  color: var(--ink);
  background: url(art/cat-button.svg) center / 100% 100% no-repeat;
  filter: drop-shadow(0 6px 10px rgba(30,18,48,.28));
  transition: transform .12s ease;
}
.btn-cat svg { width: 22px; height: 22px; }
.btn-cat:active { transform: translateY(3px) scale(.96); }
.btn-cat:focus-visible { outline: 3px solid var(--sky); outline-offset: 2px; border-radius: 16px; }
.btn-cat-lg { width: 64px; height: 72px; padding-top: 12px; }
.btn-cat-lg svg { width: 26px; height: 26px; }
.btn-cat-sm { width: 42px; height: 47px; padding-top: 8px; }
.btn-cat-sm svg { width: 18px; height: 18px; }
#hud .btn-cat { pointer-events: auto; }
.hud-top { grid-template-columns: 50px 1fr auto; }

.btn-cream {
  color: var(--ink);
  background: linear-gradient(180deg, #fffaf2, #ffe9cf);
  box-shadow: inset 0 2px 0 #fff, 0 5px 0 #c98a5a, 0 10px 18px rgba(201,138,90,.3);
}
.btn-cream:active { transform: translateY(3px); box-shadow: inset 0 2px 0 #fff, 0 2px 0 #c98a5a; }
.btn-cream svg { color: #e8475f; }
.mini-stars { font: 800 12px var(--display); padding: 3px 7px; border-radius: 999px; background: var(--ink); color: var(--sun); margin-left: 2px; }

.sheet, .modal-card, .over-card, .intro-card {
  background-color: rgba(36, 22, 58, 0.95);
  background-image: url(art/pattern.svg);
  background-size: 180px 180px;
}
.over-card, .modal-card, .intro-card { position: relative; overflow: hidden; }
.over-card::after, .modal-card::after, .intro-card::after {
  content: ""; position: absolute; top: -10px; right: -6px; width: 110px; height: 110px;
  background: url(art/claw.svg) center / contain no-repeat; opacity: .1; pointer-events: none;
}

.hud-progress { width: 140px; height: 6px; margin: 6px auto 0; border-radius: 3px; background: rgba(30,18,48,.35); overflow: hidden; }
.hud-progress i { display: block; height: 100%; width: 0; border-radius: 3px; background: linear-gradient(90deg, var(--sun), var(--mint)); transition: width .3s; }
#hud-goal { opacity: .75; }

.over-stars { display: flex; justify-content: center; gap: 10px; margin: 12px 0 2px; }
.over-star { display: flex; flex-direction: column; align-items: center; gap: 4px; width: 92px; font: 700 11px/1.2 var(--body); color: var(--muted); }
.over-star i { width: 46px; height: 46px; display: grid; place-items: center; border-radius: 16px; background: rgba(255,255,255,.08); color: rgba(255,255,255,.2); }
.over-star i svg { width: 30px; height: 30px; }
.over-star.on i { background: rgba(255,207,74,.18); color: var(--sun); animation: pop .45s var(--ease-out) both; }
.over-star.on { color: var(--cream); }
.over-actions .btn-xl { flex: 1; }

/* level select */
.level-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.level-card {
  position: relative; text-align: left; border-radius: 20px; overflow: hidden;
  background: rgba(255,255,255,.06); border: 2px solid transparent;
  transition: transform .12s, border-color .2s;
}
.level-card:active { transform: scale(.97); }
.level-card.next { border-color: var(--sun); }
.level-thumb { height: 76px; position: relative; }
.level-thumb::after { content: ""; position: absolute; inset: 0; background: url(art/claw.svg) right -14px top -10px / 70px no-repeat; opacity: .18; }
.level-thumb b { position: absolute; left: 10px; bottom: 8px; font: 800 26px/1 var(--display); color: #fff; text-shadow: 0 2px 6px rgba(30,18,48,.45); }
.level-ramp { position: absolute; left: -10px; right: 30%; bottom: 18px; height: 10px; border-radius: 6px; transform: rotate(-8deg); }
.level-info { padding: 8px 10px 10px; }
.level-info h4 { margin: 0; font: 800 16px/1.15 var(--display); }
.level-info p { margin: 2px 0 6px; font: 700 12px var(--body); color: var(--muted); }
.level-stars { display: flex; gap: 3px; color: rgba(255,255,255,.18); }
.level-stars svg { width: 16px; height: 16px; }
.level-stars .on { color: var(--sun); }
.level-card.locked { opacity: .55; }
.level-card.locked .level-thumb { filter: grayscale(.7) brightness(.7); }
.level-lock { position: absolute; top: 8px; right: 8px; width: 28px; height: 28px; border-radius: 10px; display: grid; place-items: center; background: rgba(30,18,48,.7); }
.level-lock svg { width: 16px; height: 16px; }

/* challenge intro */
.intro-card { width: 100%; max-width: 380px; border-radius: var(--r-lg); padding: 0 0 18px; text-align: center; animation: rise .35s var(--ease-out) both; }
.intro-art { height: 120px; position: relative; display: flex; align-items: flex-start; padding: 12px; }
.intro-art::before { content: ""; position: absolute; left: -20px; right: 20%; bottom: 26px; height: 16px; border-radius: 9px; transform: rotate(-9deg); background: var(--ramp, #7fd17a); box-shadow: 0 10px 0 var(--ramp-body, #b4594a); }
.intro-num { position: relative; padding: 5px 12px; border-radius: 999px; background: rgba(30,18,48,.7); font: 800 13px var(--display); letter-spacing: .06em; }
.intro-kicker { margin-top: 14px; font: 800 12px var(--display); letter-spacing: .2em; text-transform: uppercase; color: var(--sun); }
.intro-card h2 { margin: 2px 0 0; font: 800 34px/1 var(--display); }
.intro-goal { margin: 8px 0 0; font: 700 15px var(--body); }
.intro-goal b { font-family: var(--display); color: var(--mint); font-size: 18px; }
.intro-brief { margin: 4px 18px 0; font: 600 13px/1.4 var(--body); color: var(--muted); }
.intro-stars { margin: 14px 18px 0; display: flex; flex-direction: column; gap: 6px; text-align: left; }
.intro-stars div { display: flex; align-items: center; gap: 10px; padding: 8px 12px; border-radius: 14px; background: rgba(255,255,255,.06); font: 700 14px var(--body); }
.intro-stars svg { width: 18px; height: 18px; color: rgba(255,255,255,.25); flex: none; }
.intro-stars .on svg { color: var(--sun); }
.intro-actions { margin: 16px 18px 0; display: flex; align-items: flex-end; gap: 12px; }
.intro-actions .btn-xl { flex: 1; }
