:root {
  --ink: #2a1533;
  --cream: #fff4e2;
  --cream-2: #ffe7c4;
  --orange: #ffb13a;
  --pink: #ff4f8b;
  --gold: #ffe36b;
  --mint: #7dff8a;
  --frost: #7fe3ff;
  --frenzy: #ff8a3a;
  --double: #ffd84a;
  --font-display: "Lilita One", "Arial Rounded MT Bold", system-ui, sans-serif;
  --font-body: "Nunito", system-ui, -apple-system, sans-serif;
  --safe-t: env(safe-area-inset-top, 0px);
  --safe-r: env(safe-area-inset-right, 0px);
  --safe-b: env(safe-area-inset-bottom, 0px);
  --safe-l: env(safe-area-inset-left, 0px);
  --outline: 0 3px 0 var(--ink), 2px 2px 0 var(--ink), -2px 2px 0 var(--ink), 2px -2px 0 var(--ink), -2px -2px 0 var(--ink), 0 -2px 0 var(--ink), 2px 0 0 var(--ink), -2px 0 0 var(--ink);
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  width: 100%;
  height: 100%;
  overflow: hidden;
  background: #160b2e;
  color: var(--cream);
  font-family: var(--font-body);
  overscroll-behavior: none;
  touch-action: none;
  -webkit-user-select: none;
  user-select: none;
  -webkit-touch-callout: none;
  -webkit-tap-highlight-color: transparent;
}

body { position: fixed; inset: 0; }

canvas#game {
  position: fixed;
  inset: 0;
  display: block;
  touch-action: none;
  cursor: crosshair;
}

#ui { position: fixed; inset: 0; pointer-events: none; }

[hidden] { display: none !important; }

/* ---------- Buttons ---------- */
.btn {
  pointer-events: auto;
  font-family: var(--font-display);
  font-size: 22px;
  letter-spacing: 0.5px;
  color: var(--ink);
  background: var(--cream);
  border: 3px solid var(--ink);
  border-radius: 999px;
  padding: 12px 26px;
  box-shadow: 0 5px 0 var(--ink);
  cursor: pointer;
  transition: transform 0.08s ease, box-shadow 0.08s ease, background 0.15s;
  touch-action: manipulation;
}
.btn:active { transform: translateY(4px); box-shadow: 0 1px 0 var(--ink); }
.btn.primary { background: var(--orange); }
.btn.danger { background: #ff8a8a; margin-top: 10px; }
.btn.small { font-size: 17px; padding: 9px 18px; box-shadow: 0 4px 0 var(--ink); }
.btn:focus-visible, .icon-btn:focus-visible, .tab:focus-visible { outline: 3px solid var(--gold); outline-offset: 3px; }

.icon-btn {
  pointer-events: auto;
  width: 46px;
  height: 46px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  border: 3px solid var(--ink);
  background: var(--cream);
  color: var(--ink);
  fill: var(--ink);
  box-shadow: 0 4px 0 var(--ink);
  font-family: var(--font-display);
  font-size: 20px;
  cursor: pointer;
  touch-action: manipulation;
}
.icon-btn:active { transform: translateY(3px); box-shadow: 0 1px 0 var(--ink); }

/* ---------- HUD ---------- */
.hud {
  position: absolute;
  top: 0; left: 0; right: 0;
  padding: calc(12px + var(--safe-t)) calc(16px + var(--safe-r)) 0 calc(16px + var(--safe-l));
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: start;
  gap: 10px;
}
.hud-score { justify-self: start; }
.score-row { display: flex; align-items: center; gap: 8px; }
.score-icon { width: clamp(42px, 7vmin, 62px); height: clamp(42px, 7vmin, 62px); filter: drop-shadow(0 3px 0 rgba(0,0,0,0.45)); }
.score {
  font-family: var(--font-display);
  font-size: clamp(40px, 7vmin, 64px);
  line-height: 1;
  color: var(--gold);
  text-shadow: var(--outline), 0 6px 0 var(--ink);
  transform-origin: left center;
}
.score.bump { animation: bump 0.18s ease-out; }
@keyframes bump { 40% { transform: scale(1.14); } 100% { transform: scale(1); } }
.best {
  margin-top: 4px;
  font-family: var(--font-display);
  font-size: 16px;
  color: var(--cream);
  text-shadow: var(--outline);
  opacity: 0.9;
}
.powers { display: flex; flex-direction: column; gap: 6px; align-items: center; padding-top: 6px; }
.chip {
  position: relative;
  min-width: 140px;
  padding: 5px 14px 9px;
  border: 3px solid var(--ink);
  border-radius: 14px;
  font-family: var(--font-display);
  font-size: 16px;
  text-align: center;
  color: var(--ink);
  box-shadow: 0 3px 0 var(--ink);
  overflow: hidden;
}
.chip i { position: absolute; left: 0; bottom: 0; height: 5px; background: var(--ink); opacity: 0.55; width: 100%; transform-origin: left; }
.chip[data-power="frost"] { background: var(--frost); }
.chip[data-power="frenzy"] { background: var(--frenzy); }
.chip[data-power="double"] { background: var(--double); }

.hud-right { justify-self: end; display: flex; align-items: center; gap: 12px; }
.timer {
  min-width: 82px;
  text-align: center;
  font-family: var(--font-display);
  font-size: 34px;
  line-height: 1;
  padding: 6px 14px 8px;
  border-radius: 16px;
  background: rgba(42, 21, 51, 0.55);
  border: 3px solid var(--ink);
  color: var(--cream);
  text-shadow: var(--outline);
}
.timer.urgent { color: #ff6a5a; animation: pulse 0.5s ease-in-out infinite alternate; }
.timer.frozen { color: var(--frost); }
@keyframes pulse { to { transform: scale(1.1); } }
.strikes { display: flex; gap: 6px; }
.strikes b {
  width: 38px; height: 38px;
  display: grid; place-items: center;
  font-family: var(--font-display);
  font-size: 36px;
  color: rgba(255, 244, 226, 0.35);
  text-shadow: var(--outline);
}
.strikes b::before { content: "✕"; }
.strikes b.hit { color: #ff4a4a; animation: bump 0.25s ease-out; }

/* ---------- Menu ---------- */
.screen { position: absolute; inset: 0; }
.menu {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: calc(14px + var(--safe-t)) 16px calc(16px + var(--safe-b));
}
.logo {
  margin: 0;
  font-family: var(--font-display);
  font-weight: 400;
  font-size: clamp(54px, 13vmin, 128px);
  line-height: 0.92;
  letter-spacing: 2px;
  text-align: center;
  transform: rotate(-4deg);
  filter: drop-shadow(0 8px 0 rgba(10, 4, 24, 0.5));
}
.logo span { display: inline-block; text-shadow: 0 5px 0 var(--ink), 4px 4px 0 var(--ink), -4px 4px 0 var(--ink), 4px -4px 0 var(--ink), -4px -4px 0 var(--ink), 0 -4px 0 var(--ink), 4px 0 0 var(--ink), -4px 0 0 var(--ink), 0 10px 0 var(--ink); }
.logo { position: relative; }
.logo .l1 { color: var(--orange); animation: wobble 3s ease-in-out infinite; }
.logo .l2 { color: #ff3b30; margin-left: 0.25em; animation: wobble 3s ease-in-out infinite 0.4s; }
/* Blade slash across the title. */
.logo::after {
  content: "";
  position: absolute;
  left: -6%;
  right: -6%;
  top: 52%;
  height: 7px;
  border-radius: 7px;
  background: linear-gradient(90deg, rgba(255,255,255,0), #fff 25%, #c8f4ff 75%, rgba(255,255,255,0));
  box-shadow: 0 0 14px rgba(160, 230, 255, 0.95);
  transform: rotate(-9deg);
  animation: slash 3.4s ease-out infinite;
}
@keyframes slash {
  0% { clip-path: inset(0 100% 0 0); opacity: 1; }
  10% { clip-path: inset(0 0 0 0); opacity: 1; }
  28% { clip-path: inset(0 0 0 100%); opacity: 0.9; }
  29%, 100% { opacity: 0; }
}
@keyframes wobble { 50% { transform: translateY(-4px) rotate(2deg); } }
.hint {
  margin: 10px 0 0;
  font-family: var(--font-display);
  font-size: 20px;
  color: var(--cream);
  text-shadow: var(--outline);
  animation: breathe 1.6s ease-in-out infinite alternate;
}
@keyframes breathe { to { opacity: 0.55; } }
.grow { flex: 1; }
.short { display: none; }
.menu-bar {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
}
.seeds-pill {
  position: absolute;
  top: calc(14px + var(--safe-t));
  right: calc(16px + var(--safe-r));
  font-family: var(--font-display);
  font-size: 18px;
  padding: 6px 14px;
  border-radius: 999px;
  background: rgba(42, 21, 51, 0.6);
  border: 3px solid var(--ink);
  color: var(--mint);
  text-shadow: var(--outline);
}

/* ---------- Modals ---------- */
.modal {
  pointer-events: auto;
  display: grid;
  place-items: center;
  padding: calc(16px + var(--safe-t)) calc(16px + var(--safe-r)) calc(16px + var(--safe-b)) calc(16px + var(--safe-l));
  background: rgba(16, 6, 30, 0.55);
  backdrop-filter: blur(3px);
  -webkit-backdrop-filter: blur(3px);
  animation: fadein 0.2s ease-out;
}
@keyframes fadein { from { opacity: 0; } }
.card {
  width: min(460px, 100%);
  max-height: 100%;
  overflow: auto;
  -webkit-overflow-scrolling: touch;
  touch-action: pan-y;
  background: var(--cream);
  color: var(--ink);
  border: 4px solid var(--ink);
  border-radius: 26px;
  box-shadow: 0 10px 0 var(--ink);
  padding: 22px 24px 26px;
  text-align: center;
  animation: pop 0.32s cubic-bezier(.2, 1.5, .4, 1);
}
.card.narrow { width: min(380px, 100%); }
.card.wide { width: min(720px, 100%); text-align: left; }
@keyframes pop { from { transform: scale(0.8) translateY(20px); opacity: 0; } }
.card h2 { margin: 0 0 14px; font-family: var(--font-display); font-weight: 400; font-size: 34px; }
.card h3 { margin: 0 0 6px; font-family: var(--font-display); font-weight: 400; font-size: 22px; }
.card-head { display: flex; align-items: center; justify-content: space-between; }
.card-head h2 { margin: 0; }
.icon-btn.close { width: 40px; height: 40px; font-size: 18px; }
.sub { font-size: 15px; opacity: 0.75; margin: 8px 0 14px; }
.col { display: flex; flex-direction: column; gap: 12px; }
.row { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; margin-top: 18px; }

/* Results */
.res-title { font-family: var(--font-display); font-size: 40px; line-height: 1; color: var(--pink); text-shadow: 0 3px 0 var(--ink); }
.res-mode { font-weight: 800; font-size: 15px; text-transform: uppercase; letter-spacing: 2px; opacity: 0.7; margin-top: 6px; }
.res-score { font-family: var(--font-display); font-size: 84px; line-height: 1.05; color: var(--orange); text-shadow: var(--outline), 0 7px 0 var(--ink); margin-top: 6px; }
.res-best { font-family: var(--font-display); font-size: 18px; min-height: 22px; }
.res-best.new { color: #e0167a; animation: bump 0.4s ease-out 2; }
.res-bonus { list-style: none; margin: 12px 0 0; padding: 0; }
.res-bonus li {
  display: flex; justify-content: space-between;
  font-weight: 800; font-size: 16px;
  padding: 6px 12px; margin: 4px 0;
  background: var(--cream-2); border: 2px solid var(--ink); border-radius: 12px;
  animation: slidein 0.3s ease-out both;
}
.res-bonus li b { font-family: var(--font-display); font-weight: 400; color: #c25a00; }
@keyframes slidein { from { transform: translateX(-20px); opacity: 0; } }
.res-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-top: 14px; }
.res-stats div { background: #fff; border: 2px solid var(--ink); border-radius: 12px; padding: 6px 4px; font-size: 12px; font-weight: 800; text-transform: uppercase; opacity: 0.9; }
.res-stats div b { display: block; font-family: var(--font-display); font-weight: 400; font-size: 24px; text-transform: none; }
.res-seeds { margin-top: 12px; font-family: var(--font-display); font-size: 18px; color: #1f8a3a; }
.res-unlock { margin-top: 8px; padding: 8px; border-radius: 12px; background: var(--gold); border: 2px solid var(--ink); font-weight: 800; }

/* Collection */
.tabs { display: flex; gap: 8px; margin-bottom: 14px; }
.tab {
  font-family: var(--font-display); font-size: 18px;
  padding: 7px 18px; border-radius: 999px;
  border: 3px solid var(--ink); background: transparent; color: var(--ink);
  cursor: pointer;
}
.tab.on { background: var(--ink); color: var(--cream); }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; }
.grid.list { grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); }
.item {
  position: relative;
  border: 3px solid var(--ink);
  border-radius: 16px;
  background: #fff;
  overflow: hidden;
  cursor: pointer;
  text-align: center;
  box-shadow: 0 4px 0 var(--ink);
  padding: 0 0 8px;
  font: inherit;
  color: var(--ink);
}
.item { display: flex; flex-direction: column; align-items: center; justify-content: flex-start; }
.item canvas { display: block; width: 100%; height: 86px; background: #1b1035; flex: none; }
.item .nm { font-family: var(--font-display); font-size: 18px; margin-top: 6px; }
.item .st { font-size: 12px; font-weight: 800; text-transform: uppercase; opacity: 0.7; }
.item.on { outline: 4px solid var(--orange); outline-offset: -1px; }
.item.locked canvas { filter: grayscale(1) brightness(0.45); }
.item.locked .st { color: #b0204a; opacity: 1; }

/* Settings */
.card.settings { width: min(440px, 100%); text-align: left; }
.card.settings .btn.danger { display: block; margin: 18px auto 0; }

/* Stats: KPI tiles + meter lists */
.stats { margin-top: 12px; padding-top: 14px; border-top: 2px dashed rgba(42, 21, 51, 0.25); }
.stats h3 { margin: 0 0 10px; }
.stats h4 { margin: 16px 0 4px; font-size: 12px; font-weight: 800; letter-spacing: 1px; text-transform: uppercase; opacity: 0.7; }
.kpis { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.kpi { display: flex; flex-direction: column; gap: 2px; padding: 8px 10px; background: #fff; border: 2px solid var(--ink); border-radius: 14px; }
.kpi .kl { font-size: 12px; font-weight: 800; opacity: 0.7; }
.kpi .kv { font-family: var(--font-display); font-size: 28px; line-height: 1.05; font-variant-numeric: tabular-nums; }
.cap { margin: 0 0 8px; font-size: 12px; opacity: 0.7; }
.meters { display: grid; gap: 9px; }
.meter-row { display: grid; grid-template-columns: 70px 1fr auto; align-items: center; gap: 10px; font-size: 14px; font-weight: 800; }
.meter-row .mb { position: relative; height: 10px; border-radius: 999px; background: #f7d9b5; overflow: hidden; }
.meter-row .mb i { display: block; height: 100%; border-radius: 999px; background: #cf6a08; }
.meter-row .mf { min-width: 72px; text-align: right; font-variant-numeric: tabular-nums; }
.meter-row .mf small { font-weight: 700; opacity: 0.6; }
.next { margin: 10px 0 0; font-size: 13px; font-weight: 700; }
.toggle { display: flex; align-items: center; gap: 12px; padding: 10px 4px; font-weight: 800; font-size: 18px; cursor: pointer; text-align: left; }
.toggle input { appearance: none; -webkit-appearance: none; width: 52px; height: 30px; border-radius: 999px; border: 3px solid var(--ink); background: #d9c9b0; position: relative; flex: none; cursor: pointer; transition: background 0.15s; }
.toggle input::after { content: ""; position: absolute; top: 2px; left: 2px; width: 20px; height: 20px; border-radius: 50%; background: var(--ink); transition: transform 0.15s; }
.toggle input:checked { background: var(--mint); }
.toggle input:checked::after { transform: translateX(22px); }

/* How to */
.howto { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 16px; margin-top: 12px; }
.how-block p { font-size: 15px; line-height: 1.4; margin: 0 0 8px; }
.c-arcade { color: #c25a00; }
.c-classic { color: #c4161f; }
.c-zen { color: #2f7d1c; }
.credit { margin: 18px 0 0; padding-top: 12px; border-top: 2px dashed rgba(42, 21, 51, 0.25); font-size: 14px; font-weight: 800; text-align: center; }
.credit a { color: #b5420f; text-decoration-thickness: 2px; text-underline-offset: 3px; pointer-events: auto; }
.dot { display: inline-block; width: 14px; height: 14px; border-radius: 50%; border: 2px solid var(--ink); margin-right: 6px; vertical-align: -2px; }
.dot.frost { background: var(--frost); }
.dot.frenzy { background: var(--frenzy); }
.dot.double { background: var(--double); }

/* Menu: icon buttons and skill badge */
.btn.small.icon { width: 42px; height: 42px; padding: 0; display: inline-grid; place-items: center; }
.btn .badge { display: inline-grid; place-items: center; min-width: 20px; height: 20px; margin-left: 6px; padding: 0 5px; border-radius: 999px; background: #ff3b30; color: #fff; font-size: 13px; border: 2px solid var(--ink); vertical-align: 1px; }
.seeds-pill { display: flex; align-items: center; gap: 8px; }
.seeds-pill .lv { color: var(--gold); }
.seeds-pill .xpbar { width: 54px; height: 8px; border-radius: 999px; background: rgba(255, 244, 226, 0.25); overflow: hidden; }
.seeds-pill .xpbar i { display: block; height: 100%; background: var(--gold); border-radius: 999px; }

/* Skills */
.skill-top { display: flex; gap: 16px; align-items: stretch; margin: 10px 0 14px; }
.lv-block { flex: 1; }
.lv-row { display: flex; justify-content: space-between; align-items: baseline; font-weight: 800; }
.lv-row b { font-family: var(--font-display); font-weight: 400; font-size: 24px; }
.lv-row span { font-size: 14px; opacity: 0.75; font-variant-numeric: tabular-nums; }
.mb.big { position: relative; height: 12px; margin: 6px 0; border-radius: 999px; background: #f7d9b5; overflow: hidden; }
.mb.big i { display: block; height: 100%; border-radius: 999px; background: #cf6a08; }
.pts { display: flex; flex-direction: column; align-items: center; justify-content: center; min-width: 84px; padding: 6px 12px; border: 3px solid var(--ink); border-radius: 16px; background: var(--gold); box-shadow: 0 4px 0 var(--ink); }
.pts b { font-family: var(--font-display); font-weight: 400; font-size: 34px; line-height: 1; }
.pts span { font-size: 12px; font-weight: 800; text-transform: uppercase; }
.skill-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 10px; }
.skill { display: flex; flex-direction: column; gap: 6px; padding: 12px; border: 3px solid var(--ink); border-radius: 16px; background: #fff; box-shadow: 0 4px 0 var(--ink); }
.skill .sk-head { display: flex; align-items: center; gap: 10px; }
.skill .sk-icon { flex: none; width: 38px; height: 38px; border-radius: 50%; border: 3px solid var(--ink); display: grid; place-items: center; font-size: 20px; background: var(--cream-2); }
.skill.maxed .sk-icon { background: var(--gold); }
.skill .sk-name { font-family: var(--font-display); font-size: 18px; line-height: 1.1; }
.skill .pips { display: flex; gap: 4px; margin-top: 3px; }
.skill .pips i { width: 16px; height: 6px; border-radius: 3px; background: #ead9c0; }
.skill .pips i.on { background: #cf6a08; }
.skill .sk-now { font-size: 13px; font-weight: 800; min-height: 18px; }
.skill .sk-next { font-size: 12px; opacity: 0.7; min-height: 16px; }
.skill .btn { align-self: flex-start; font-size: 15px; padding: 6px 14px; box-shadow: 0 3px 0 var(--ink); }
.skill .btn:disabled { opacity: 0.45; cursor: default; transform: none; }

/* Smoothie order card (HUD) */
.order { display: flex; align-items: center; gap: 8px; padding: 6px 10px 6px 12px; border: 3px solid var(--ink); border-radius: 16px; background: var(--cream); color: var(--ink); box-shadow: 0 4px 0 var(--ink); }
.order .on { font-family: var(--font-display); font-size: 15px; line-height: 1; white-space: nowrap; }
.order .oi { display: flex; align-items: center; gap: 2px; padding: 2px 6px 2px 2px; border-radius: 12px; background: #fff; border: 2px solid var(--ink); }
.order .oi img { width: 30px; height: 30px; }
.order .oi b { font-family: var(--font-display); font-weight: 400; font-size: 17px; font-variant-numeric: tabular-nums; }
.order .oi.done { background: #c9f7d0; }
.order.fresh { animation: pop 0.35s cubic-bezier(.2, 1.5, .4, 1); }

/* Mini games */
.games-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 12px; margin-top: 12px; }
.game-card { display: flex; flex-direction: column; gap: 8px; padding: 14px; border: 3px solid var(--ink); border-radius: 18px; background: #fff; box-shadow: 0 5px 0 var(--ink); }
.game-card h3 { margin: 0; }
.game-card .gd { font-size: 14px; line-height: 1.4; margin: 0; }
.game-card .gm { display: flex; flex-wrap: wrap; gap: 6px; }
.game-card .tag { padding: 3px 10px; border-radius: 999px; border: 2px solid var(--ink); background: var(--cream-2); font-size: 12px; font-weight: 800; }
.game-card .tag.good { background: #c9f7d0; }
.game-card .rule { padding: 6px 10px; border-radius: 12px; background: var(--cream); border: 2px dashed rgba(42, 21, 51, 0.35); font-size: 13px; }
.game-card .rule b { display: block; font-family: var(--font-display); font-weight: 400; font-size: 16px; }
.game-card .btn { align-self: flex-start; margin-top: 4px; }
.game-card.locked { opacity: 0.6; }

/* Results: daily */
.res-daily { margin-top: 10px; padding: 8px 10px; border-radius: 12px; border: 2px solid var(--ink); font-weight: 800; background: var(--cream-2); }
.res-daily.win { background: #c9f7d0; }

/* Results XP */
.res-xp { margin-top: 12px; text-align: left; }
.res-xp .lv-row b { font-size: 18px; }
.res-xp .lvup { margin-top: 6px; padding: 6px 10px; border-radius: 12px; background: var(--gold); border: 2px solid var(--ink); font-weight: 800; text-align: center; animation: bump 0.4s ease-out 2; }

/* Collection blade stats */
.item .perk { font-size: 12px; font-weight: 700; padding: 2px 10px 0; line-height: 1.3; min-height: 32px; }
.item .fingers { display: inline-block; margin-top: 4px; padding: 2px 8px; border-radius: 999px; background: var(--cream-2); border: 2px solid var(--ink); font-size: 12px; font-weight: 800; }
.chip.shield { background: #c9f7ff; padding-bottom: 6px; }

/* First-tap gate and sound hint */
.tap-gate {
  pointer-events: auto;
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 14px;
  padding: 16px;
  background: rgba(12, 6, 22, 0.55);
  animation: fadein 0.25s ease-out;
  z-index: 5;
}
.tap-gate .btn { font-size: 34px; padding: 18px 44px; box-shadow: 0 7px 0 var(--ink); animation: breathe-btn 1.4s ease-in-out infinite alternate; }
.tap-gate p { margin: 0; font-weight: 800; font-size: 15px; color: var(--cream); text-shadow: var(--outline); }
@keyframes breathe-btn { to { transform: scale(1.06); } }
.sound-hint {
  pointer-events: auto;
  position: absolute;
  left: calc(14px + var(--safe-l));
  bottom: calc(14px + var(--safe-b));
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 14px;
  border-radius: 999px;
  border: 3px solid var(--ink);
  background: var(--gold);
  color: var(--ink);
  font-family: var(--font-display);
  font-size: 16px;
  box-shadow: 0 4px 0 var(--ink);
  cursor: pointer;
  z-index: 4;
  animation: pop 0.3s cubic-bezier(.2, 1.5, .4, 1);
}

/* Toast */
.toast {
  position: absolute;
  left: 50%;
  bottom: calc(22px + var(--safe-b));
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 8px 20px 10px;
  border-radius: 18px;
  border: 3px solid var(--ink);
  background: var(--gold);
  color: var(--ink);
  box-shadow: 0 5px 0 var(--ink);
  animation: toastin 0.35s cubic-bezier(.2, 1.5, .4, 1);
  white-space: nowrap;
}
.toast b { font-family: var(--font-display); font-weight: 400; font-size: 20px; }
.toast span { font-weight: 800; font-size: 13px; }
.toast.out { animation: toastout 0.3s ease-in forwards; }
@keyframes toastin { from { transform: translate(-50%, 30px) scale(0.8); opacity: 0; } }
@keyframes toastout { to { transform: translate(-50%, 20px); opacity: 0; } }

/* Home screen tip */
.tip {
  pointer-events: auto;
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 12px;
  max-width: min(560px, 100%);
  padding: 8px 8px 8px 16px;
  border-radius: 16px;
  background: rgba(42, 21, 51, 0.8);
  border: 2px solid rgba(255, 244, 226, 0.4);
  font-size: 14px;
  font-weight: 800;
}
.icon-btn.tiny { width: 30px; height: 30px; font-size: 13px; border-width: 2px; box-shadow: 0 2px 0 var(--ink); flex: none; }

/* Trophies */
.trophy {
  display: flex; align-items: center; gap: 12px;
  border: 3px solid var(--ink); border-radius: 16px; background: #fff;
  padding: 10px 12px; box-shadow: 0 4px 0 var(--ink);
}
.trophy .medal {
  flex: none; width: 44px; height: 44px; border-radius: 50%;
  border: 3px solid var(--ink); display: grid; place-items: center;
  font-family: var(--font-display); font-size: 20px;
  background: var(--gold);
}
.trophy.locked { opacity: 0.55; }
.trophy.locked .medal { background: #d9c9b0; }
.trophy .tn { font-family: var(--font-display); font-size: 17px; }
.trophy .td { font-size: 13px; font-weight: 800; opacity: 0.75; }
.res-trophy { margin-top: 8px; padding: 8px; border-radius: 12px; background: #c9f7d0; border: 2px solid var(--ink); font-weight: 800; }

@media (max-width: 700px) {
  .seeds-pill { position: static; margin-top: 8px; font-size: 15px; padding: 4px 12px; }
  .btn.small { font-size: 14px; padding: 7px 12px; box-shadow: 0 3px 0 var(--ink); }
  .menu-bar { gap: 6px; }
  .tip { font-size: 12px; }
  .long { display: none; }
  .short { display: inline; }
  .order .oi img { width: 24px; height: 24px; }
  .order .on { display: none; }
  .hud { padding-left: calc(10px + var(--safe-l)); padding-right: calc(10px + var(--safe-r)); }
  .timer { min-width: 64px; font-size: 26px; padding: 4px 10px 6px; }
  .chip { min-width: 110px; font-size: 13px; }
  .icon-btn { width: 40px; height: 40px; }
}

@media (max-width: 480px) {
  #fsBtn { display: none; }
}

@media (max-height: 520px) {
  .logo { font-size: clamp(40px, 15vmin, 80px); }
  .hint { font-size: 16px; margin-top: 4px; }
  .btn.small { font-size: 15px; padding: 7px 14px; }
  .card { padding: 14px 18px 18px; }
  .res-score { font-size: 56px; }
}

@media (prefers-reduced-motion: reduce) {
  .logo span, .logo::after, .hint, .timer.urgent, .tap-gate .btn { animation: none; }
}
