/* Layout: the scene (garage → office → data centre → campus → planet) fills the centre; resource chips across the top,
   shop docked on the right, goal cards in the stage's empty sky. Sticker UI: flat fills, ink outlines,
   hard drop shadows, no gradients. One deliberate light look (no dark theme). */
:root {
  color-scheme: light;
  --ink: #2b2433;
  --paper: #fffaf0;
  --sand: #f1e7d4;
  --sky: #bde3f1;
  --go: #5cbf63;
  --go-dark: #3e8f45;
  --gold: #f6c445;
  --gold-dark: #c99722;
  --coral: #ef7c64;
  --coral-dark: #c4573f;
  --blue: #5b8ef0;
  --blue-soft: #dce7ff;
  --violet: #9a7de2;
  --mint-soft: #dff3df;
  --gold-soft: #fff0c4;
  --grey: #cbc5d0;
  --grey-dark: #a59eac;
  --muted: #6c6375;
  --display: "Fredoka", "Trebuchet MS", "Segoe UI", system-ui, sans-serif;
  --body: "Nunito", "Segoe UI", system-ui, sans-serif;
}
* { box-sizing: border-box; }
html { background: var(--sky); }
body { margin: 0; background: var(--sky); color: var(--ink); font: 600 15px/1.45 var(--body);
  padding-left: max(16px, env(safe-area-inset-left, 0px)); padding-right: max(16px, env(safe-area-inset-right, 0px)); padding-block: 14px 44px; }
button { font: inherit; color: inherit; cursor: pointer; }
:focus-visible { outline: 3px dashed var(--ink); outline-offset: 3px; }
h1, h2, h3 { text-wrap: balance; }
svg.i { stroke: var(--ink); stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
.ns * { vector-effect: non-scaling-stroke; }

.app { max-width: 1500px; margin: 0 auto; display: grid; grid-template-columns: 280px minmax(0, 1fr) 400px;
  grid-template-areas: "hud hud hud" "left play shop"; gap: 14px 18px; align-items: start; }
.app[hidden] { display: none; }

/* HUD */
.hud { grid-area: hud; display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.chips { display: flex; gap: 10px; flex-wrap: wrap; }
.chip { display: inline-flex; align-items: center; gap: 8px; background: var(--paper); border: 3px solid var(--ink);
  border-radius: 999px; padding: 4px 16px 4px 4px; box-shadow: 0 3px 0 var(--ink); }
.ico { width: 36px; height: 36px; border-radius: 50%; border: 2.5px solid var(--ink); display: grid; place-items: center; flex: none; }
.ico svg { width: 22px; height: 22px; }
.chip b { display: block; font: 600 19px/1.05 var(--display); font-variant-numeric: tabular-nums; }
.chip small { display: block; font-size: 11.5px; line-height: 1.2; color: var(--muted); font-weight: 800; }
.stagecard { flex: 1 1 320px; max-width: 560px; background: var(--paper); border: 3px solid var(--ink); border-radius: 18px;
  box-shadow: 0 4px 0 var(--ink); padding: 8px 14px 10px; }
.stagecard .row { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; }
.stagecard h1 { margin: 0; font: 600 25px/1.1 var(--display); }
.step { font-size: 11.5px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.bar { position: relative; height: 26px; margin-top: 6px; border: 3px solid var(--ink); border-radius: 999px; background: var(--sand); overflow: hidden; }
.bar > span { position: absolute; inset: 0 auto 0 0; background: var(--gold); border-right: 3px solid var(--ink); }
.bar > span::after { content: ""; position: absolute; left: 8px; right: 8px; top: 3px; height: 5px; border-radius: 5px; background: #fff; opacity: .55; }
.bar em { position: absolute; inset: 0; display: grid; place-items: center; font: 600 13.5px/1 var(--display); font-style: normal; }
.move-btn { display: none; width: 100%; margin-top: 8px; }
.move-btn.show { display: block; }

/* Stage */
.play { grid-area: play; position: relative; min-width: 0; }
.stage { position: relative; width: 100%; aspect-ratio: 960 / 690; }
.scene { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.bubble { position: absolute; transform: translate(-26%, -100%); display: grid; gap: 2px; max-width: min(270px, 34%);
  padding: 8px 14px 10px; background: #fff; border: 3px solid var(--ink); border-radius: 18px; box-shadow: 0 4px 0 var(--ink);
  text-align: left; animation: nudge 2.4s ease-in-out infinite; }
.bubble::after { content: ""; position: absolute; left: 24%; bottom: -11px; width: 18px; height: 18px; background: #fff;
  border-right: 3px solid var(--ink); border-bottom: 3px solid var(--ink); transform: rotate(45deg); }
.bubble:active { scale: .97; }
.bubble-label { font-size: 11px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; color: var(--coral-dark); }
.bubble-text { font: 600 16px/1.2 var(--display); }
.bubble-cta { font-size: 12.5px; font-weight: 800; color: var(--muted); }
.bubble-cta b { color: var(--go-dark); }
@keyframes nudge { 0%, 100% { translate: 0 0; } 50% { translate: 0 -5px; } }
.floater { position: absolute; pointer-events: none; z-index: 5; font: 700 22px/1 var(--display); color: var(--go);
  text-shadow: 2px 0 var(--ink), -2px 0 var(--ink), 0 2px var(--ink), 0 -2px var(--ink), 2px 2px var(--ink), -2px 2px var(--ink), 0 4px var(--ink);
  animation: rise .9s ease-out forwards; }
@keyframes rise { from { opacity: 1; translate: -50% 0; } to { opacity: 0; translate: -50% -56px; } }
.ticker { position: absolute; left: 3%; right: 3%; bottom: 1.2%; height: 40px; display: flex; align-items: center; overflow: hidden;
  background: var(--paper); border: 3px solid var(--ink); border-radius: 999px; box-shadow: 0 3px 0 var(--ink); }
.ticker-tag { align-self: stretch; display: grid; place-items: center; padding: 0 14px; background: var(--coral); color: #fff;
  border-right: 3px solid var(--ink); font: 600 14px/1 var(--display); letter-spacing: .08em; }
.ticker-track { flex: 1; overflow: hidden; white-space: nowrap; }
.ticker-track p { display: inline-block; margin: 0; font-size: 14px; animation: tick 40s linear infinite; }
@keyframes tick { to { transform: translateX(-50%); } }

/* Cards & goal */
.card { background: var(--paper); border: 3px solid var(--ink); border-radius: 18px; box-shadow: 0 4px 0 var(--ink); }
.side-cards { position: absolute; left: 0; top: 1%; width: 22%; min-width: 200px; display: grid; gap: 10px; }
.goal { padding: 10px 12px 12px; }
.goal.done { background: var(--mint-soft); }
.goal-top { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.tag { font: 600 12px/1 var(--display); letter-spacing: .08em; text-transform: uppercase; padding: 5px 9px; border: 2.5px solid var(--ink); border-radius: 9px; background: var(--gold); }
.goal-reward { font-size: 12.5px; font-weight: 800; color: var(--muted); }
.goal-reward b { color: var(--go-dark); }
.goal h3 { margin: 8px 0 6px; font: 600 17px/1.2 var(--display); }
.goal .buy { width: 100%; }
.impact { display: flex; gap: 10px; align-items: center; padding: 10px 12px; background: #f6f1f8; border-style: dashed; box-shadow: none; }
.impact .ico { background: #fff; }
.impact h3 { margin: 0; font: 600 15px/1.2 var(--display); }
.impact p { margin: 2px 0 0; font-size: 12.5px; color: var(--muted); }
.mini { position: relative; flex: 1; height: 18px; border: 2.5px solid var(--ink); border-radius: 999px; background: var(--sand); overflow: hidden; }
.mini > span { position: absolute; inset: 0 auto 0 0; background: var(--gold); }
.mini em { position: absolute; inset: 0; display: grid; place-items: center; font: 600 11.5px/1 var(--display); font-style: normal; }
.goal .mini { height: 22px; }
.goal .mini > span { background: var(--go); }

/* Buttons */
.buy { border: 3px solid var(--ink); border-radius: 13px; background: var(--go); color: #fff; font: 600 17px/1 var(--display);
  padding: 8px 10px 12px; min-width: 76px; box-shadow: inset 0 -5px 0 var(--go-dark), 0 3px 0 var(--ink); text-shadow: 0 2px 0 var(--go-dark); transition: transform .06s; }
.buy small { display: block; margin-bottom: 3px; font: 800 10px/1 var(--body); letter-spacing: .1em; text-shadow: none; }
.buy:active:not(:disabled) { transform: translateY(3px); box-shadow: inset 0 -3px 0 var(--go-dark), 0 0 0 var(--ink); }
.buy:disabled { background: var(--grey); color: #fbf9fc; box-shadow: inset 0 -5px 0 var(--grey-dark), 0 3px 0 var(--ink); text-shadow: none; cursor: not-allowed; }
.buy.gold { background: var(--gold); color: var(--ink); box-shadow: inset 0 -5px 0 var(--gold-dark), 0 3px 0 var(--ink); text-shadow: none; }

/* Shop */
.shop { grid-area: shop; display: grid; grid-template-columns: 62px minmax(0, 1fr); gap: 10px; align-items: start; min-width: 0; }
.tabs { display: flex; flex-direction: column; gap: 10px; padding-top: 8px; }
.tab { position: relative; width: 62px; height: 62px; border: 3px solid var(--ink); border-radius: 15px; display: grid; place-items: center;
  box-shadow: inset 0 -5px 0 rgba(43, 36, 51, .2), 0 3px 0 var(--ink); transition: transform .15s; }
.tab svg { width: 32px; height: 32px; }
.tab.blue, .panel-head.blue { background: var(--blue); }
.tab.gold, .panel-head.gold { background: var(--gold); }
.tab.green, .panel-head.green { background: var(--go); }
.tab.violet, .panel-head.violet { background: var(--violet); }
.tab[aria-selected="true"] { transform: translateX(7px); }
.dot { position: absolute; top: -9px; right: -9px; min-width: 23px; height: 23px; padding: 0 5px; border-radius: 999px; background: var(--coral);
  color: #fff; border: 2.5px solid var(--ink); font: 600 12px/18px var(--display); }
.panel { background: var(--paper); border: 3px solid var(--ink); border-radius: 20px; box-shadow: 0 4px 0 var(--ink); overflow: hidden; min-width: 0; }
.panel-head { display: flex; justify-content: space-between; align-items: center; gap: 8px; padding: 10px 14px; border-bottom: 3px solid var(--ink); color: #fff; }
.panel-head.gold { color: var(--ink); }
.panel-head h2 { margin: 0; font: 600 22px/1 var(--display); }
.panel-body { padding: 12px; display: grid; gap: 10px; max-height: 640px; overflow-y: auto; }
.hint { margin: 0; font-size: 13px; color: var(--muted); }
.amount { display: flex; border: 2.5px solid var(--ink); border-radius: 10px; overflow: hidden; background: var(--paper); }
.amount button { border: 0; background: none; padding: 5px 9px; font: 600 13px/1 var(--display); color: var(--ink); }
.amount button + button { border-left: 2.5px solid var(--ink); }
.amount button[aria-pressed="true"] { background: var(--gold); }
.item { display: grid; grid-template-columns: 66px minmax(0, 1fr) auto; gap: 10px; align-items: center; padding: 8px; background: #fff; border: 3px solid var(--ink); border-radius: 15px; }
.item.locked { background: #f4f1f6; }
.thumb { position: relative; width: 66px; height: 66px; border: 2.5px solid var(--ink); border-radius: 12px; display: grid; place-items: center; overflow: hidden; }
.thumb > svg { width: 64px; height: 52px; }
.thumb .lock { position: absolute; right: 2px; bottom: 2px; width: 24px; height: 24px; }
.item h3 { margin: 0; display: flex; align-items: center; gap: 6px; flex-wrap: wrap; font: 600 16.5px/1.15 var(--display); }
.owned { font: 600 12px/1 var(--display); background: var(--ink); color: var(--paper); border-radius: 999px; padding: 3px 7px; }
.stats { margin: 3px 0 6px; font-size: 12.5px; color: var(--muted); }
.stats .earn { color: var(--go-dark); font-weight: 800; }
.stats .watt { color: #a46d0c; font-weight: 800; }
.mile { display: flex; align-items: center; gap: 6px; }
.stars { display: flex; gap: 1px; }
.stars svg { width: 15px; height: 15px; }
.fact { padding: 10px 12px; background: #fff; border: 3px solid var(--ink); border-radius: 15px; }
.fact-top { display: flex; justify-content: space-between; align-items: center; margin-bottom: 4px; }
.pill { font: 600 11.5px/1 var(--display); letter-spacing: .06em; text-transform: uppercase; padding: 4px 8px; border: 2px solid var(--ink); border-radius: 999px; }
.pill.new { background: var(--coral); color: #fff; }
.pill.read { background: var(--mint-soft); }
.fact h3 { margin: 0 0 4px; font: 600 16px/1.2 var(--display); }
.fact p { margin: 0; font-size: 13.5px; }
.fact.unread p.body { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.fact .src { margin-top: 6px; font-size: 11.5px; color: var(--muted); }
.fact .uses { margin-top: 8px; display: flex; gap: 6px; align-items: center; font-size: 12.5px; font-weight: 800; color: #2f6f3a; }
.fact .uses svg { width: 18px; height: 18px; }
.fact .buy { margin-top: 8px; padding: 6px 12px 9px; font-size: 15px; }
.fact.more { display: flex; gap: 8px; align-items: center; background: #f4f1f6; border-style: dashed; color: var(--muted); font-size: 13px; }
.fact.more svg { width: 22px; height: 22px; flex: none; }
.badges { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.badge { display: grid; justify-items: center; align-content: start; gap: 3px; text-align: center; padding: 8px 4px; background: #fff; border: 3px solid var(--ink); border-radius: 15px; }
.badge.locked { background: #f4f1f6; }
.badge svg { width: 50px; height: 58px; }
.badge b { font: 600 13.5px/1.1 var(--display); }
.badge span { font-size: 11px; line-height: 1.25; color: var(--muted); }

/* Samples */
.samples { grid-area: samples; margin-top: 26px; }
.samples > h2 { margin: 0; font: 600 26px/1.1 var(--display); }
.samples > p { margin: 4px 0 16px; color: var(--muted); max-width: 65ch; }
.sample-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 18px; align-items: start; }
.eyebrow { display: block; font-size: 11px; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); }
.sample { padding: 14px 16px 16px; }
.sample h3 { margin: 2px 0 10px; font: 600 22px/1.1 var(--display); }
.gauge-row { display: flex; align-items: center; gap: 12px; }
.gauge { width: 60%; max-width: 220px; flex: none; }
.gauge-num b { display: block; font: 600 46px/1 var(--display); }
.gauge-num small { font: 600 16px var(--display); color: var(--muted); }
.gauge-num .pill { display: inline-block; margin-top: 6px; background: var(--gold); }
.forecast { margin: 8px 0 10px; font-size: 14px; }
.fp-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.fp { display: grid; grid-template-columns: 28px 1fr; gap: 6px; align-items: start; padding: 8px; background: #fff; border: 2.5px solid var(--ink); border-radius: 12px; }
.fp svg { width: 26px; height: 26px; }
.fp b { display: block; font: 600 15px/1.1 var(--display); }
.fp span { display: block; font-size: 11.5px; line-height: 1.25; color: var(--muted); }
.press-head { display: flex; gap: 12px; align-items: center; margin: -14px -16px 12px; padding: 12px 16px; background: var(--blue); color: #fff; border-bottom: 3px solid var(--ink); border-radius: 15px 15px 0 0; }
.press-head svg { width: 56px; height: 56px; flex: none; }
.press-head .eyebrow { color: #e8eeff; }
.press-head h3 { margin: 2px 0 0; color: #fff; }
.q { margin: 0 0 12px; font: 600 18px/1.3 var(--display); }
.answers { display: grid; gap: 8px; }
.ans { text-align: left; padding: 10px 14px; background: #fff; border: 3px solid var(--ink); border-radius: 13px; box-shadow: 0 3px 0 var(--ink); font: 600 16px/1.1 var(--display); }
.ans:hover:not(:disabled) { background: var(--blue-soft); }
.ans:disabled { cursor: default; }
.ans.right { background: var(--go); color: #fff; }
.ans.wrong { background: var(--coral); color: #fff; }
.reward { margin: 12px 0 0; font-size: 13px; color: var(--muted); }
.result { margin: 10px 0 0; padding: 10px 12px; border-radius: 12px; border: 2.5px solid var(--ink); background: var(--mint-soft); font-size: 13.5px; }
.result.bad { background: #fde3dc; }
.link { border: 0; background: none; padding: 0; margin-top: 8px; font-weight: 800; color: var(--blue); text-decoration: underline; }
.newlist { margin: 0 0 14px; padding-left: 20px; display: grid; gap: 4px; }
.move-art { display: grid; place-items: center; height: 120px; margin: 4px 0 10px; background: var(--gold-soft); border: 2.5px solid var(--ink); border-radius: 14px; }
.move-art svg { width: 84px; height: 84px; }
.sample .buy { width: 100%; }

/* Toast */
.toast { position: fixed; top: calc(14px + env(safe-area-inset-top, 0px)); left: 50%; z-index: 60; display: flex; align-items: center; gap: 12px;
  padding: 8px 18px 8px 8px; max-width: calc(100% - 32px); transform: translate(-50%, -170%); transition: transform .45s cubic-bezier(.3, 1.5, .5, 1); }
.toast.show { transform: translate(-50%, 0); }
.toast > svg { width: 50px; height: 58px; flex: none; }
.toast .eyebrow { color: var(--violet); }
.toast b { display: block; font: 600 19px/1.1 var(--display); }
.toast .desc { font-size: 13px; color: var(--muted); }

@media (max-width: 1240px) { .app { grid-template-columns: minmax(0, 1fr) 380px; grid-template-areas: "hud hud" "play shop" "left shop"; } }
@media (max-width: 900px) {
  .app { grid-template-columns: minmax(0, 1fr); grid-template-areas: "hud" "play" "left" "shop"; }
  .sample-grid { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 640px) {
  body { font-size: 14px; }
  .stagecard { order: -1; flex-basis: 100%; max-width: none; }
  .chip { padding-right: 12px; }
  .chip b { font-size: 16px; }
  .chip small { display: none; }
  .ico { width: 30px; height: 30px; }
  .ico svg { width: 18px; height: 18px; }
  
  .bubble { max-width: 58%; padding: 5px 9px 7px; border-radius: 14px; }
  .bubble-label { display: none; }
  .bubble-text { font-size: 12.5px; }
  .bubble-cta { font-size: 10.5px; }
  .ticker { height: 30px; }
  .ticker-tag { font-size: 11px; padding: 0 8px; }
  .ticker-track p { font-size: 12px; }
  .shop { grid-template-columns: minmax(0, 1fr); }
  .tabs { flex-direction: row; padding-top: 0; }
  .tab { width: auto; flex: 1; height: 52px; }
  .tab[aria-selected="true"] { transform: translateY(5px); }
  .panel-body { max-height: none; }
  .badges { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .fp-grid { grid-template-columns: minmax(0, 1fr); }
}

@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; } }
