/* Angry Blocks — UI stylesheet. Tokens and component recipes: docs/design-system.md */

@font-face {
  font-family: 'Pixelify Sans';
  font-style: normal;
  font-weight: 400 700;
  font-display: swap;
  src: url('fonts/PixelifySans.woff2') format('woff2');
}

:root {
  --cream: #FFF3D6; --cream-2: #F2DFB5;
  --ink: #2B1B10; --ink-2: #4A2A12;
  --gold: #F7B234; --gold-2: #E08A0C; --gold-3: #FFD86B;
  --teal: #2BA3A0; --teal-2: #1C6F6D;
  --red: #D9342B; --red-2: #8F1F19;
  --slime: #79D64C; --slime-2: #4E9A2E;
  --wood: #A8672D; --wood-2: #5E3A17;
  --stone-ui: #8D8F93; --stone-ui-2: #5A5C60;
  --star: #FFC93C; --star-off: rgba(43, 27, 16, .25);
  --dim: rgba(20, 12, 8, .55);
  --sky-top: #4FB3F0; --sky-horizon: #CDEFFF;
  --display: 'Pixelify Sans', ui-rounded, -apple-system, 'SF Pro Rounded', 'Segoe UI', Roboto, sans-serif;
  --body: ui-rounded, -apple-system, 'SF Pro Rounded', 'Segoe UI', Roboto, sans-serif;
  --sat: env(safe-area-inset-top, 0px); --sab: env(safe-area-inset-bottom, 0px);
  --sal: env(safe-area-inset-left, 0px); --sar: env(safe-area-inset-right, 0px);
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; height: 100%; overflow: hidden; background: #2b1b10; }
body {
  font: 600 15px/1.35 var(--body); color: var(--ink);
  -webkit-user-select: none; user-select: none; -webkit-touch-callout: none;
  overscroll-behavior: none; touch-action: none;
  position: fixed; inset: 0;
}
button { font: inherit; color: inherit; border: 0; background: none; padding: 0; margin: 0; cursor: pointer; touch-action: manipulation; }
[hidden] { display: none !important; }
svg { width: 24px; height: 24px; fill: none; stroke: currentColor; stroke-width: 2.6; stroke-linecap: round; stroke-linejoin: round; }
.noscript { color: var(--cream); text-align: center; padding: 40px; }

#game { position: fixed; inset: 0; background: linear-gradient(var(--sky-top), var(--sky-horizon)); }
#world { display: block; width: 100%; height: 100%; touch-action: none; }

/* ---------- type ---------- */
.display {
  font-family: var(--display); font-weight: 700; text-transform: uppercase; letter-spacing: .04em; color: var(--cream);
  text-shadow: 2px 0 0 var(--ink-2), -2px 0 0 var(--ink-2), 0 2px 0 var(--ink-2), 0 -2px 0 var(--ink-2), 2px 2px 0 var(--ink-2), -2px 2px 0 var(--ink-2), 0 4px 0 var(--ink-2), 0 6px 10px rgba(0, 0, 0, .35);
}
.kicker { font: 700 11px/1 var(--display); letter-spacing: .12em; text-transform: uppercase; color: var(--gold-3); text-shadow: 0 1px 0 var(--ink-2), 1px 0 0 var(--ink-2), -1px 0 0 var(--ink-2), 0 -1px 0 var(--ink-2); }

/* ---------- chunky surfaces ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 52px; padding: 0 26px; border-radius: 14px;
  font-family: var(--display); font-weight: 700; font-size: 20px; letter-spacing: .04em; text-transform: uppercase; color: var(--cream);
  text-shadow: 1.5px 0 0 var(--ink-2), -1.5px 0 0 var(--ink-2), 0 1.5px 0 var(--ink-2), 0 -1.5px 0 var(--ink-2), 0 3px 0 var(--ink-2);
  background: linear-gradient(var(--gold-3), var(--gold));
  box-shadow: 0 0 0 3px var(--ink-2), 0 6px 0 var(--gold-2), 0 6px 0 3px var(--ink-2), 0 12px 18px rgba(0, 0, 0, .35), inset 0 2px 0 rgba(255, 255, 255, .35);
  transition: transform .08s, box-shadow .08s; position: relative;
}
.btn:active { transform: translateY(5px); box-shadow: 0 0 0 3px var(--ink-2), 0 1px 0 var(--gold-2), 0 1px 0 3px var(--ink-2), 0 4px 8px rgba(0, 0, 0, .3), inset 0 2px 0 rgba(255, 255, 255, .35); }
.btn.big { min-height: 62px; padding: 0 40px; font-size: 26px; border-radius: 18px; }
.btn.stone { background: linear-gradient(#a7a9ad, var(--stone-ui)); box-shadow: 0 0 0 3px var(--ink-2), 0 6px 0 var(--stone-ui-2), 0 6px 0 3px var(--ink-2), 0 12px 18px rgba(0, 0, 0, .35), inset 0 2px 0 rgba(255, 255, 255, .35); }
.btn.stone:active { box-shadow: 0 0 0 3px var(--ink-2), 0 1px 0 var(--stone-ui-2), 0 1px 0 3px var(--ink-2), 0 4px 8px rgba(0, 0, 0, .3); }
.btn.danger { background: linear-gradient(#ef5a4c, var(--red)); box-shadow: 0 0 0 3px var(--ink-2), 0 6px 0 var(--red-2), 0 6px 0 3px var(--ink-2), 0 12px 18px rgba(0, 0, 0, .35), inset 0 2px 0 rgba(255, 255, 255, .3); }
.btn.danger:active { box-shadow: 0 0 0 3px var(--ink-2), 0 1px 0 var(--red-2), 0 1px 0 3px var(--ink-2), 0 4px 8px rgba(0, 0, 0, .3); }
.btn.teal { background: linear-gradient(#3fc1bd, var(--teal)); box-shadow: 0 0 0 3px var(--ink-2), 0 6px 0 var(--teal-2), 0 6px 0 3px var(--ink-2), 0 12px 18px rgba(0, 0, 0, .35), inset 0 2px 0 rgba(255, 255, 255, .3); }
.btn.teal:active { box-shadow: 0 0 0 3px var(--ink-2), 0 1px 0 var(--teal-2), 0 1px 0 3px var(--ink-2), 0 4px 8px rgba(0, 0, 0, .3); }
.btn:disabled, .ibtn:disabled { filter: saturate(.2) brightness(.8); cursor: default; }
.btn:disabled:active { transform: none; }

.ibtn {
  width: 52px; height: 52px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; color: var(--cream); position: relative; flex: none;
  transition: transform .08s, box-shadow .08s;
}
.ibtn.gold { background: linear-gradient(var(--gold-3), var(--gold)); box-shadow: 0 0 0 3px var(--ink-2), 0 5px 0 var(--gold-2), 0 5px 0 3px var(--ink-2), 0 10px 16px rgba(0, 0, 0, .35), inset 0 2px 0 rgba(255, 255, 255, .4); }
.ibtn.stone { background: linear-gradient(#a7a9ad, var(--stone-ui)); box-shadow: 0 0 0 3px var(--ink-2), 0 5px 0 var(--stone-ui-2), 0 5px 0 3px var(--ink-2), 0 10px 16px rgba(0, 0, 0, .35), inset 0 2px 0 rgba(255, 255, 255, .35); }
.ibtn.red { background: linear-gradient(#ef5a4c, var(--red)); box-shadow: 0 0 0 3px var(--ink-2), 0 5px 0 var(--red-2), 0 5px 0 3px var(--ink-2), 0 10px 16px rgba(0, 0, 0, .35), inset 0 2px 0 rgba(255, 255, 255, .3); }
.ibtn.teal { background: linear-gradient(#3fc1bd, var(--teal)); box-shadow: 0 0 0 3px var(--ink-2), 0 5px 0 var(--teal-2), 0 5px 0 3px var(--ink-2), 0 10px 16px rgba(0, 0, 0, .35), inset 0 2px 0 rgba(255, 255, 255, .3); }
.ibtn:active { transform: translateY(4px); box-shadow: 0 0 0 3px var(--ink-2), 0 1px 0 rgba(0, 0, 0, .3), 0 1px 0 3px var(--ink-2) !important; }
.ibtn svg { width: 26px; height: 26px; filter: drop-shadow(0 2px 0 rgba(0, 0, 0, .35)); }
.ibtn.sm { width: 44px; height: 44px; } .ibtn.sm svg { width: 22px; height: 22px; }

.badge {
  position: absolute; top: -8px; right: -10px; min-width: 24px; height: 24px; padding: 0 6px; border-radius: 12px;
  background: var(--teal); color: var(--cream); font: 700 12px/24px var(--display); text-align: center;
  box-shadow: 0 0 0 2.5px var(--ink-2), 0 2px 0 2.5px var(--ink-2); text-shadow: 0 1px 0 var(--ink-2);
}
.badge.red { background: var(--red); }
.badge.gold { background: var(--gold); }

.chip {
  height: 40px; padding: 0 14px; border-radius: 12px; display: inline-flex; align-items: center; gap: 6px;
  background: linear-gradient(#c88a48, var(--wood)); color: var(--cream); font: 700 16px/1 var(--display);
  box-shadow: 0 0 0 3px var(--ink-2), 0 4px 0 var(--wood-2), 0 4px 0 3px var(--ink-2), 0 8px 12px rgba(0, 0, 0, .3);
  text-shadow: 0 1.5px 0 var(--ink-2);
}

/* ---------- screens ---------- */
.screen { position: fixed; inset: 0; display: flex; align-items: center; justify-content: center; z-index: 15; }
.corner { position: absolute; display: flex; gap: 14px; align-items: center; z-index: 2; }
.corner.tr { top: calc(14px + var(--sat)); right: calc(16px + var(--sar)); }
.corner.tl { top: calc(14px + var(--sat)); left: calc(16px + var(--sal)); }

.start { background: radial-gradient(ellipse at 50% 120%, #7acb4a 0, #4e9a2e 22%, transparent 46%), linear-gradient(var(--sky-top), var(--sky-horizon) 70%, #9fdc78 71%, #6ab53e); flex-direction: column; }
.start-inner { display: flex; flex-direction: column; align-items: center; gap: 14px; padding: 20px; animation: rise .5s cubic-bezier(.2, 1.4, .4, 1) both; }
.logo { width: min(52vw, 360px, 64vh); max-height: 46vh; filter: drop-shadow(0 12px 18px rgba(0, 0, 0, .35)); }
.tagline { margin: 0; text-align: center; color: var(--cream); font: 700 15px/1.4 var(--body); text-shadow: 0 1px 0 var(--ink-2), 0 2px 8px rgba(0, 0, 0, .35); }
.engine-check { margin: 0; font: 600 11px/1.4 ui-monospace, monospace; color: rgba(43, 27, 16, .7); white-space: pre-line; text-align: center; min-height: 1.4em; }
.brand { position: absolute; bottom: calc(12px + var(--sab)); left: 0; right: 0; margin: 0; text-align: center; font: 700 12px/1 var(--display); letter-spacing: .12em; color: var(--cream); text-shadow: 0 1px 0 var(--ink-2); opacity: .85; }

/* map */
.map { background: linear-gradient(#4FB3F0 0, #CDEFFF 55%, #7ACB4A 56%, #4E9A2E 100%); align-items: stretch; justify-content: stretch; overflow: hidden; }
.map-scroll { position: absolute; inset: 0; overflow-x: auto; overflow-y: hidden; touch-action: pan-x; scrollbar-width: none; -webkit-overflow-scrolling: touch; }
.map-scroll::-webkit-scrollbar { display: none; }
.map-world { position: relative; height: 100%; min-width: 100%; background-image: var(--hills); background-repeat: repeat-x; background-position: left bottom; background-size: auto 46%; }
.map-path { position: absolute; inset: 0; width: 100%; height: 100%; }
.map-path path { fill: none; stroke: var(--cream); stroke-width: 6; stroke-dasharray: 2 14; stroke-linecap: round; filter: drop-shadow(0 2px 0 rgba(0, 0, 0, .35)); opacity: .9; }
.map-nodes { position: absolute; inset: 0; }
.node {
  position: absolute; width: 56px; height: 56px; margin: -28px 0 0 -28px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center; font: 700 22px/1 var(--display); color: var(--cream);
  background: linear-gradient(#a7a9ad, var(--stone-ui)); box-shadow: 0 0 0 3px var(--ink-2), 0 5px 0 var(--stone-ui-2), 0 5px 0 3px var(--ink-2), 0 10px 14px rgba(0, 0, 0, .3);
  text-shadow: 0 2px 0 var(--ink-2); transition: transform .08s;
}
.node.open { background: linear-gradient(var(--cream), var(--cream-2)); color: var(--ink); text-shadow: none; box-shadow: 0 0 0 3px var(--ink-2), 0 5px 0 #c9b48a, 0 5px 0 3px var(--ink-2), 0 10px 14px rgba(0, 0, 0, .3); }
.node.done { background: linear-gradient(var(--gold-3), var(--gold)); box-shadow: 0 0 0 3px var(--ink-2), 0 5px 0 var(--gold-2), 0 5px 0 3px var(--ink-2), 0 10px 14px rgba(0, 0, 0, .3); }
.node.current { transform: scale(1.12); }
.node.current::before { content: ''; position: absolute; inset: -9px; border-radius: 50%; border: 3px dashed var(--cream); animation: spin 8s linear infinite; }
.node .stars { position: absolute; bottom: -22px; left: 50%; transform: translateX(-50%); font-size: 14px; letter-spacing: -1px; color: var(--star); text-shadow: 0 1.5px 0 var(--ink-2); white-space: nowrap; }
.node .stars .off { color: var(--star-off); text-shadow: none; }
.node.locked svg { width: 20px; height: 20px; opacity: .8; }
.node .avatar { position: absolute; top: -46px; left: 50%; width: 42px; height: 42px; margin-left: -21px; image-rendering: auto; filter: drop-shadow(0 6px 6px rgba(0, 0, 0, .35)); animation: bob 1.6s ease-in-out infinite; pointer-events: none; }
.node .soon { position: absolute; top: -22px; font: 700 9px/1 var(--display); letter-spacing: .1em; color: var(--cream); text-shadow: 0 1px 0 var(--ink-2); opacity: .8; white-space: nowrap; }
.map-sign { position: absolute; left: calc(16px + var(--sal)); top: calc(80px + var(--sat)); display: flex; flex-direction: column; gap: 4px; padding: 12px 18px 14px; border-radius: 12px; background: linear-gradient(#c88a48, var(--wood)); box-shadow: 0 0 0 3px var(--ink-2), 0 6px 0 var(--wood-2), 0 6px 0 3px var(--ink-2), 0 12px 18px rgba(0, 0, 0, .35); pointer-events: none; }
.map-sign .title { font: 700 22px/1 var(--display); color: var(--cream); text-shadow: 1.5px 0 0 var(--ink-2), -1.5px 0 0 var(--ink-2), 0 1.5px 0 var(--ink-2), 0 -1.5px 0 var(--ink-2), 0 3px 0 var(--ink-2); letter-spacing: .04em; }
.map-play { position: absolute; left: 0; right: 0; bottom: calc(18px + var(--sab)); display: flex; justify-content: center; pointer-events: none; }
.map-play .btn { pointer-events: auto; }

/* ---------- HUD ---------- */
.hud { position: fixed; inset: 0; pointer-events: none; z-index: 10; }
.hud > * { pointer-events: none; }
.hud button { pointer-events: auto; }
.hud-top { position: absolute; top: calc(12px + var(--sat)); left: calc(14px + var(--sal)); right: calc(14px + var(--sar)); display: flex; align-items: flex-start; gap: 14px; }
.level-sign { display: flex; flex-direction: column; gap: 2px; padding: 8px 14px 9px; border-radius: 10px; background: linear-gradient(#c88a48, var(--wood)); box-shadow: 0 0 0 3px var(--ink-2), 0 4px 0 var(--wood-2), 0 4px 0 3px var(--ink-2), 0 8px 12px rgba(0, 0, 0, .3); margin-top: 2px; }
.level-sign .title { font: 700 15px/1 var(--display); color: var(--cream); text-shadow: 1px 0 0 var(--ink-2), -1px 0 0 var(--ink-2), 0 1px 0 var(--ink-2), 0 -1px 0 var(--ink-2), 0 2px 0 var(--ink-2); letter-spacing: .03em; text-transform: uppercase; white-space: nowrap; }
.hud-score { margin-left: auto; display: flex; flex-direction: column; align-items: flex-end; gap: 2px; }
.starbar { position: relative; width: 190px; height: 34px; }
.starbar-track { position: absolute; left: 0; right: 0; bottom: 0; height: 18px; border-radius: 6px; background: var(--teal-2); box-shadow: 0 0 0 3px var(--ink-2), 0 3px 0 3px var(--ink-2), inset 0 2px 4px rgba(0, 0, 0, .35); transform: skewX(-12deg); overflow: hidden; }
.starbar-fill { position: absolute; left: 0; top: 0; bottom: 0; width: 0%; background: linear-gradient(var(--gold-3), var(--gold)); transition: width .35s cubic-bezier(.2, .8, .2, 1); box-shadow: inset 0 -3px 0 var(--gold-2); }
.starbar .tick { position: absolute; top: -2px; bottom: -2px; width: 3px; background: var(--cream); left: 60%; box-shadow: 0 0 0 1px var(--ink-2); }
.starbar .tick.t3 { left: calc(100% - 3px); }
.starbar-stars { position: absolute; left: 0; right: 0; top: -4px; height: 18px; }
.starbar-stars .s { position: absolute; top: 0; transform: translateX(-50%); font-size: 18px; line-height: 1; color: var(--star-off); transition: transform .25s cubic-bezier(.2, 1.6, .4, 1), color .2s; }
.starbar-stars .s.on { color: var(--star); text-shadow: 0 1.5px 0 var(--ink-2), 0 0 8px rgba(255, 201, 60, .6); transform: translateX(-50%) scale(1.2); }
.starbar-stars .s.capped { color: rgba(217, 52, 43, .55); }
#hs1 { left: 6%; } #hs2 { left: 60%; } #hs3 { left: 98%; }
.score { font-size: 26px; line-height: 1; margin-top: 4px; font-variant-numeric: tabular-nums; }
.hud-bottom { position: absolute; left: calc(14px + var(--sal)); right: calc(14px + var(--sar)); bottom: calc(12px + var(--sab)); display: flex; align-items: flex-end; gap: 14px; }
.hotbar { display: flex; gap: 6px; padding: 8px 10px; border-radius: 12px; background: linear-gradient(#8a5525, var(--wood-2)); box-shadow: 0 0 0 3px var(--ink-2), 0 5px 0 #3d2510, 0 5px 0 3px var(--ink-2), 0 10px 14px rgba(0, 0, 0, .35), inset 0 2px 0 rgba(255, 255, 255, .15); min-height: 68px; pointer-events: none; }
.slot { position: relative; width: 52px; height: 52px; border-radius: 8px; background: rgba(0, 0, 0, .28); box-shadow: inset 0 0 0 2px rgba(0, 0, 0, .35); display: flex; align-items: center; justify-content: center; transition: transform .18s cubic-bezier(.2, 1.4, .4, 1), background .2s; }
.slot img { width: 44px; height: 44px; object-fit: contain; filter: drop-shadow(0 3px 2px rgba(0, 0, 0, .4)); }
.slot.active { transform: translateY(-10px) scale(1.08); background: rgba(255, 216, 107, .35); box-shadow: inset 0 0 0 2px var(--gold-3), 0 0 14px rgba(255, 216, 107, .55); }
.slot .count { position: absolute; right: -4px; bottom: -4px; min-width: 20px; height: 20px; border-radius: 10px; background: var(--teal); color: var(--cream); font: 700 11px/20px var(--display); text-align: center; padding: 0 5px; box-shadow: 0 0 0 2px var(--ink-2); }
.slot.empty { opacity: .45; }
.helpers { margin-left: auto; display: flex; gap: 16px; align-items: center; }
.tip { position: absolute; left: calc(70px + var(--sal)); bottom: calc(118px + var(--sab)); max-width: min(60vw, 340px); padding: 12px 16px; border-radius: 14px; background: var(--cream); color: var(--ink); font: 700 14px/1.35 var(--body); text-align: left; box-shadow: 0 0 0 3px var(--ink-2), 0 6px 0 3px var(--ink-2), 0 12px 18px rgba(0, 0, 0, .35); animation: rise .35s cubic-bezier(.2, 1.4, .4, 1) both; }
.tip::after { content: ''; position: absolute; left: 58px; bottom: -16px; border: 9px solid transparent; border-top-color: var(--cream); filter: drop-shadow(0 3px 0 var(--ink-2)); }

/* ---------- modal cards ---------- */
.modal { position: fixed; inset: 0; z-index: 30; display: flex; align-items: center; justify-content: center; background: var(--dim); padding: 16px; animation: fade .18s both; }
.card {
  position: relative; width: min(560px, 100%); max-height: calc(100% - 24px); overflow: auto; padding: 24px 24px 26px; border-radius: 18px;
  background: linear-gradient(var(--cream), var(--cream-2)); color: var(--ink);
  box-shadow: 0 0 0 4px var(--wood-2), 0 0 0 10px var(--wood), 0 0 0 13px var(--ink-2), 0 10px 0 13px var(--wood-2), 0 22px 40px rgba(0, 0, 0, .5);
  animation: pop .22s cubic-bezier(.2, 1.6, .4, 1) both; scrollbar-width: none;
}
.card::-webkit-scrollbar { display: none; }
.card.red { background: linear-gradient(#a3261e, var(--red-2)); color: var(--cream); }
.card.teal { background: linear-gradient(#2a8f8c, var(--teal-2)); color: var(--cream); }
.card.red .card-kicker, .card.teal .card-kicker { color: var(--gold-3); }
.card-kicker { font: 700 12px/1 var(--display); letter-spacing: .14em; color: var(--teal-2); text-transform: uppercase; margin: 0 0 6px; text-align: center; }
.card-title { margin: 0 0 14px; text-align: center; font-size: 34px; line-height: 1; }
.card.red .card-title, .card.teal .card-title { color: var(--cream); }
.card p { margin: 0 0 14px; text-align: center; font-weight: 600; }
.card .close { position: absolute; top: -16px; right: -16px; }
.row { display: flex; gap: 14px; justify-content: center; flex-wrap: wrap; margin-top: 8px; }
.row .btn { flex: 1 1 140px; max-width: 220px; }
.rail { display: flex; gap: 14px; justify-content: center; flex-wrap: wrap; margin: 6px 0 14px; }
.stars-big { display: flex; justify-content: center; gap: 10px; margin: 6px 0 10px; font-size: 54px; line-height: 1; }
.stars-big span { color: var(--star-off); transform: scale(0); animation: star .45s cubic-bezier(.2, 1.8, .4, 1) forwards; }
.stars-big span.on { color: var(--star); text-shadow: 0 3px 0 var(--ink-2), 0 0 18px rgba(255, 201, 60, .5); }
.stars-big span:nth-child(2) { animation-delay: .3s; } .stars-big span:nth-child(3) { animation-delay: .6s; }
.stat { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; padding: 6px 0; border-top: 2px dashed rgba(43, 27, 16, .18); }
.stat:first-of-type { border-top: 0; }
.stat b { font: 700 20px/1 var(--display); font-variant-numeric: tabular-nums; }
.card.red .stat { border-color: rgba(255, 243, 214, .2); }
.mobs-gloat { display: flex; justify-content: center; align-items: flex-end; gap: 6px; margin: 4px 0 8px; }
.mobs-gloat img { height: 84px; filter: drop-shadow(0 6px 6px rgba(0, 0, 0, .4)); animation: bob 1.4s ease-in-out infinite; }
.mobs-gloat img:nth-child(2) { height: 68px; animation-delay: .35s; }

/* settings rows */
.setting { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 0; border-top: 2px dashed rgba(43, 27, 16, .18); }
.setting:first-of-type { border-top: 0; }
.setting .label { display: flex; flex-direction: column; gap: 2px; }
.setting .label small { font-weight: 600; opacity: .7; }
.toggle { width: 62px; height: 34px; border-radius: 17px; background: var(--stone-ui-2); position: relative; box-shadow: 0 0 0 3px var(--ink-2), inset 0 2px 4px rgba(0, 0, 0, .4); transition: background .2s; flex: none; }
.toggle::after { content: ''; position: absolute; top: 4px; left: 4px; width: 26px; height: 26px; border-radius: 50%; background: linear-gradient(#fff, var(--cream-2)); box-shadow: 0 2px 0 rgba(0, 0, 0, .3); transition: left .2s; }
.toggle[aria-checked="true"] { background: var(--slime-2); }
.toggle[aria-checked="true"]::after { left: 32px; }
.field { display: flex; flex-direction: column; gap: 6px; margin: 8px 0; }
.field label { font-weight: 700; font-size: 13px; letter-spacing: .04em; text-transform: uppercase; opacity: .8; }
.field input { font: 700 18px/1 var(--body); padding: 12px 14px; border-radius: 10px; border: 0; background: #fff; color: var(--ink); box-shadow: 0 0 0 3px var(--ink-2), inset 0 2px 4px rgba(0, 0, 0, .12); outline: none; width: 100%; -webkit-user-select: text; user-select: text; }
.field input:focus { box-shadow: 0 0 0 3px var(--teal), inset 0 2px 4px rgba(0, 0, 0, .12); }
.error { color: var(--red); text-align: center; font-weight: 700; min-height: 1.2em; margin: 4px 0; }
.list { margin: 8px 0 12px; padding: 0; list-style: none; }
.list li { display: flex; align-items: center; gap: 10px; padding: 8px 0; border-top: 2px dashed rgba(43, 27, 16, .18); }
.list li:first-child { border-top: 0; }
.list li .name { font-weight: 700; flex: 1; }
.list li.me .name { color: var(--teal-2); }
.list li .val { font: 700 16px/1 var(--display); font-variant-numeric: tabular-nums; }
.list li .x { color: var(--red); font-weight: 900; padding: 4px 8px; }
.muted { opacity: .7; font-weight: 600; }
.links { display: flex; justify-content: center; gap: 18px; margin-top: 14px; font-weight: 700; }
.links button { color: var(--teal-2); text-decoration: underline; }

/* ---------- banner / toast ---------- */
.banner { position: fixed; top: calc(70px + var(--sat)); left: 0; right: 0; z-index: 20; text-align: center; font-size: 34px; pointer-events: none; animation: bannerIn 1.6s cubic-bezier(.2, 1.2, .4, 1) both; }
.toast { position: fixed; left: 50%; bottom: calc(24px + var(--sab)); transform: translateX(-50%); z-index: 25; padding: 12px 18px; border-radius: 12px; background: var(--ink); color: var(--cream); font-weight: 700; box-shadow: 0 8px 20px rgba(0, 0, 0, .4); animation: rise .25s both; max-width: 90vw; text-align: center; }
.rotate-hint { position: fixed; top: calc(56px + var(--sat)); left: 50%; transform: translateX(-50%); z-index: 25; padding: 10px 16px; border-radius: 12px; background: var(--cream); color: var(--ink); font-weight: 700; box-shadow: 0 0 0 3px var(--ink-2), 0 8px 20px rgba(0, 0, 0, .4); pointer-events: none; }

/* ---------- motion ---------- */
@keyframes rise { from { transform: translateY(16px); opacity: 0; } to { transform: none; opacity: 1; } }
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }
@keyframes pop { from { transform: scale(.9); opacity: 0; } to { transform: none; opacity: 1; } }
@keyframes star { to { transform: scale(1); } }
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes bob { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-6px); } }
@keyframes bannerIn { 0% { transform: translateY(-30px) scale(.7); opacity: 0; } 12% { transform: none; opacity: 1; } 80% { transform: none; opacity: 1; } 100% { transform: translateY(-10px); opacity: 0; } }
body.noanim *, body.noanim *::before, body.noanim *::after { animation-duration: 0s !important; transition-duration: 0s !important; }
body.noanim .stars-big span { transform: scale(1); }

/* ---------- small phones / portrait ---------- */
@media (max-height: 420px) {
  .btn.big { min-height: 54px; font-size: 22px; }
  .card { padding: 16px 18px 20px; } .card-title { font-size: 28px; }
  .stars-big { font-size: 44px; }
  .starbar { width: 150px; }
}
@media (orientation: portrait) {
  .hud-top { flex-wrap: wrap; }
  .level-sign { display: none; }
}
