:root{
  /* v3: black and white, one accent for meaning (gains, the held button) */
  --paper:#FFFFFF; --paper-2:#F4F4F4; --ink:#111111; --ink-soft:#6B6B6B; --line:#E6E6E6;
  --accent:#2F6BFF;
  --marigold:#FFFFFF; --coral:#111111; --mint:#FFFFFF; --blush:#FFFFFF; --sky:#F4F4F4; --grey:#EDEDED;
  --display:'Gaegu', 'Comic Sans MS', cursive;
  --body:ui-rounded, 'SF Pro Rounded', 'Nunito', system-ui, sans-serif;
  --r:18px;
}
*{box-sizing:border-box;margin:0;padding:0}
html,body{height:100%}
body{background:#F2F2F2;color:var(--ink);font-family:var(--body);font-weight:600;display:grid;place-items:center;
  -webkit-font-smoothing:antialiased;overscroll-behavior:none}
button{font:inherit;color:inherit;cursor:pointer;border:0;background:none}
img{display:block;max-width:100%}

.device{position:relative;width:min(100vw,400px);height:min(100dvh,860px);background:var(--paper);overflow:hidden;
  display:flex;flex-direction:column;
  }
@media (min-width:500px){.device{border-radius:36px;border:3px solid var(--ink);box-shadow:0 30px 60px -20px rgba(35,48,94,.35)}}

/* HUD */
.hud{position:absolute;left:0;right:0;top:0;z-index:20;display:flex;align-items:center;justify-content:space-between;gap:12px;padding:12px 18px;pointer-events:none}
.hud>*{pointer-events:auto}
.hud-year{display:flex;align-items:center;gap:10px;font-family:var(--display);font-size:20px;font-weight:700}
.hud-bar{width:110px;height:8px;border:2px solid var(--ink);border-radius:8px;overflow:hidden}
.hud-bar i{display:block;height:100%;width:10%;background:var(--marigold);transition:width .8s cubic-bezier(.2,.8,.2,1)}
.hud-cash{font-weight:800;font-size:15px;border:2px solid var(--ink);border-radius:999px;padding:6px 12px;min-height:40px;background:#fff}

/* Stage + scenes */
.stage{flex:1;position:relative;overflow:hidden}
.scene{position:absolute;inset:0;display:flex;flex-direction:column;padding:66px 24px 28px;gap:14px;overflow-y:auto;overflow-x:hidden;
  animation:sceneIn .55s cubic-bezier(.2,.8,.2,1) both}
.scene.out{animation:sceneOut .35s ease both}
@keyframes sceneIn{from{opacity:0;transform:translateY(14px);filter:blur(4px)}to{opacity:1;transform:none;filter:none}}
@keyframes sceneOut{to{opacity:0;transform:translateY(-10px);filter:blur(4px)}}
.spacer{flex:1}

.kicker{font-family:var(--display);font-size:20px;color:var(--ink-soft);font-weight:700}
h1,.h1{font-family:var(--display);font-size:44px;line-height:.95;font-weight:700}
h2,.h2{font-family:var(--display);font-size:32px;line-height:1;font-weight:700}
p.lead{font-size:17px;line-height:1.4}
.small{font-size:13px;color:var(--ink-soft)}

/* Mood: colour as emotion */
.stage.mood-dip .scene{filter:saturate(.15) contrast(.95)}
.stage.mood-dip{background:var(--grey)}
.stage.mood-hype .scene{filter:saturate(1.35)}
.stage{transition:background .8s}
.scene{transition:filter .9s}

/* Buttons */
.btn{display:flex;align-items:center;justify-content:center;gap:8px;min-height:54px;padding:0 22px;border:2.5px solid var(--ink);
  border-radius:999px;background:var(--marigold);font-weight:800;font-size:17px;box-shadow:0 4px 0 var(--ink);
  transition:transform .12s, box-shadow .12s}
.btn:active{transform:translateY(3px) scale(.98);box-shadow:0 1px 0 var(--ink)}
.btn.ghost{background:#fff}
.btn.coral{background:var(--coral)}
.btn:disabled{opacity:.4;pointer-events:none}
.btn-row{display:flex;gap:10px}
.btn-row .btn{flex:1;padding:0 12px}
.stack{display:flex;flex-direction:column;gap:10px}

/* Speech */
.say{display:flex;gap:12px;align-items:flex-end}
.avatar{width:64px;height:64px;flex:none;border-radius:50%;border:2.5px solid var(--ink);overflow:hidden;background:var(--mint);display:grid;place-items:center;
  font-family:var(--display);font-size:30px;font-weight:700}
.avatar img{width:100%;height:100%;object-fit:cover}
.avatar.vik{background:var(--marigold)} .avatar.you{background:var(--blush)}
.bubble{position:relative;background:#fff;border:2.5px solid var(--ink);border-radius:20px 20px 20px 6px;padding:12px 14px;font-size:16px;line-height:1.35}
.bubble b{font-weight:800}

/* Art */
.art{border:2.5px solid var(--ink);border-radius:var(--r);overflow:hidden;background:var(--paper)}
.art img{width:100%;height:100%;object-fit:cover}
.hero-art{aspect-ratio:3/2}

/* Storefront cards (beat 1) */
.shops{display:grid;grid-template-columns:repeat(3,1fr);gap:10px}
.shop{display:flex;flex-direction:column;align-items:stretch;gap:0;touch-action:none;user-select:none}
.shop-face{aspect-ratio:1;border:2.5px solid var(--ink);border-radius:14px 14px 0 0;overflow:hidden;background:#fff}
.shop-face img,.shop-face svg{width:100%;height:100%;object-fit:cover}
.shop-name{font-family:var(--display);font-size:20px;font-weight:700;text-align:center;border-left:2.5px solid var(--ink);border-right:2.5px solid var(--ink);background:#fff;line-height:1.1;padding:2px 0}
.shop-what{font-size:11px;text-align:center;border-left:2.5px solid var(--ink);border-right:2.5px solid var(--ink);background:#fff;color:var(--ink-soft);padding-bottom:4px}
.stub{position:relative;height:62px;border:2.5px solid var(--ink);border-top:2.5px dashed var(--ink);border-radius:0 0 14px 14px;background:var(--marigold);
  display:flex;flex-direction:column;align-items:center;justify-content:center;font-weight:800;font-size:13px;cursor:grab;touch-action:none;transition:transform .15s}
.stub small{font-size:10px;font-weight:700;opacity:.75}
.stub.dragging{cursor:grabbing}
.stub.empty{background:var(--grey);pointer-events:none;opacity:.6}
.flying{position:fixed;z-index:50;pointer-events:none;transition:transform .55s cubic-bezier(.3,.7,.2,1),opacity .55s}
.owned{display:flex;justify-content:center;gap:3px;min-height:16px;margin-top:6px;flex-wrap:wrap}
.owned i{width:12px;height:12px;border:2px solid var(--ink);border-radius:3px;background:var(--marigold);animation:pop .35s cubic-bezier(.3,1.6,.5,1) both}
@keyframes pop{from{transform:scale(0)}}
.pocket{display:flex;align-items:center;justify-content:space-between;border:2.5px solid var(--ink);border-radius:var(--r);padding:10px 14px;background:#fff}
.pocket .cash{font-family:var(--display);font-size:30px;font-weight:700}

/* Chart */
.chart-card{border:2.5px solid var(--ink);border-radius:var(--r);background:#fff;padding:12px 12px 8px;position:relative}
.chart-head{display:flex;justify-content:space-between;align-items:baseline}
.chart-head .name{font-family:var(--display);font-size:22px;font-weight:700}
.chart-head .px{font-family:var(--display);font-size:34px;font-weight:700;transition:color .3s}
.chart-head .px.down{color:var(--coral)} .chart-head .px.up{color:#1F8F6E}
.chart{width:100%;height:150px;display:block;overflow:visible}
.chart .line{fill:none;stroke:var(--ink);stroke-width:3;stroke-linecap:round;stroke-linejoin:round}
.chart .ghost{fill:none;stroke:var(--ink-soft);stroke-width:2.5;stroke-dasharray:4 6;opacity:.6}
.chart .base{stroke:var(--ink);stroke-width:1.5;stroke-dasharray:2 5;opacity:.35}
.chart .dot{fill:var(--marigold);stroke:var(--ink);stroke-width:2.5}
.chart .sold{fill:var(--coral);stroke:var(--ink);stroke-width:2.5}

/* News card */
.news{border:2.5px solid var(--ink);border-radius:14px;background:var(--paper-2);padding:12px 14px;font-size:15px;line-height:1.35;animation:sceneIn .4s both}
.news .tag{display:inline-block;font-size:11px;font-weight:800;letter-spacing:.06em;text-transform:uppercase;background:var(--ink);color:var(--paper);border-radius:6px;padding:2px 7px;margin-bottom:6px}
.news.good .tag{background:#1F8F6E}

/* Hold button */
.hold{position:relative;width:180px;height:180px;margin:0 auto;border-radius:50%;border:3px solid var(--ink);background:var(--marigold);
  display:grid;place-items:center;text-align:center;font-weight:800;font-size:18px;line-height:1.15;touch-action:none;user-select:none;-webkit-user-select:none;
  box-shadow:0 6px 0 var(--ink);transition:transform .15s, box-shadow .15s}
.hold.pressed{transform:translateY(5px) scale(.97);box-shadow:0 1px 0 var(--ink)}
.hold svg{position:absolute;inset:-12px;width:calc(100% + 24px);height:calc(100% + 24px);transform:rotate(-90deg)}
.hold svg circle{fill:none;stroke:var(--ink);stroke-width:5;stroke-linecap:round}
.stage.mood-dip .hold{filter:none}

/* Scrubber */
.scrub{position:relative;height:64px;border:2.5px solid var(--ink);border-radius:999px;background:#fff;touch-action:none;user-select:none}
.scrub .track-label{position:absolute;inset:0;display:flex;align-items:center;justify-content:center;font-weight:800;font-size:14px;color:var(--ink-soft);pointer-events:none}
.scrub .fill{position:absolute;left:0;top:0;bottom:0;border-radius:999px;background:var(--sky)}
.scrub .knob{position:absolute;top:4px;width:52px;height:52px;border-radius:50%;border:2.5px solid var(--ink);background:var(--marigold);display:grid;place-items:center;font-size:20px;cursor:grab}

/* Bubbles flood */
.flood{position:relative;height:250px}
.flood .b{position:absolute;background:#fff;border:2.5px solid var(--ink);border-radius:18px;padding:8px 12px;font-weight:800;font-size:15px;white-space:nowrap;
  animation:floodIn .45s cubic-bezier(.3,1.5,.5,1) both;box-shadow:0 3px 0 var(--ink)}
.flood .b:nth-child(odd){background:var(--marigold)}
@keyframes floodIn{from{transform:scale(.3) rotate(-8deg);opacity:0}}

/* Reveal: three strips */
.strips{display:grid;grid-template-columns:repeat(3,1fr);gap:8px}
.strip{border:2.5px solid var(--ink);border-radius:16px;background:#fff;padding:10px 8px;display:flex;flex-direction:column;align-items:center;gap:6px;text-align:center;
  animation:sceneIn .5s both}
.strip:nth-child(2){animation-delay:.15s}.strip:nth-child(3){animation-delay:.3s}
.strip .avatar{width:48px;height:48px;font-size:22px}
.strip .who{font-family:var(--display);font-size:20px;font-weight:700;line-height:1}
.strip .num{font-family:var(--display);font-size:28px;font-weight:700;line-height:1}
.strip .num.down{color:var(--coral)} .strip .num.up{color:#1F8F6E}
.strip .did{font-size:12px;line-height:1.25;color:var(--ink-soft)}
.strip svg{width:100%;height:36px}
.strip.you{background:var(--paper-2)}
.ghost-note{font-size:14px;border:2px dashed var(--ink-soft);border-radius:14px;padding:10px 12px;color:var(--ink-soft)}

/* Sticker toast */
.sticker-toast{position:absolute;left:50%;top:40%;z-index:80;width:260px;transform:translate(-50%,-50%) rotate(-4deg);background:var(--marigold);border:3px solid var(--ink);
  border-radius:22px;padding:18px;text-align:center;box-shadow:0 8px 0 var(--ink);animation:stickerIn .6s cubic-bezier(.3,1.6,.5,1) both}
.sticker-toast .t{font-family:var(--display);font-size:18px;font-weight:700;opacity:.8}
.sticker-toast .x{font-family:var(--display);font-size:28px;font-weight:700;line-height:1.05;margin-top:4px}
.sticker-toast.leave{animation:stickerOut .5s ease both}
@keyframes stickerIn{from{transform:translate(-50%,-50%) rotate(12deg) scale(.2);opacity:0}}
@keyframes stickerOut{to{transform:translate(120px,-420px) rotate(20deg) scale(.2);opacity:0}}

/* Notebook / holdings */
.table{border:2.5px solid var(--ink);border-radius:var(--r);background:#fff;overflow:hidden}
.row{display:grid;grid-template-columns:1.4fr .7fr 1fr 1fr;gap:6px;padding:10px 12px;align-items:center;font-size:14px;border-top:1.5px dashed rgba(35,48,94,.3)}
.row:first-child{border-top:0;font-size:11px;font-weight:800;text-transform:uppercase;letter-spacing:.05em;color:var(--ink-soft)}
.row .nm{font-family:var(--display);font-size:20px;font-weight:700}
.row .r{text-align:right}
.up{color:#1F8F6E}.down{color:var(--coral)}
.pie-wrap{display:flex;align-items:center;gap:14px}
.pie{width:130px;height:130px;flex:none}
.legend{display:flex;flex-direction:column;gap:6px;font-size:14px}
.legend span{display:flex;align-items:center;gap:8px}
.legend i{width:14px;height:14px;border:2px solid var(--ink);border-radius:4px}
.callout{border:2.5px solid var(--ink);border-radius:var(--r);background:var(--sky);padding:12px 14px;font-size:14px;line-height:1.4}
.callout b{font-weight:800}

/* Slider */
.range{width:100%;appearance:none;-webkit-appearance:none;height:14px;border-radius:999px;border:2.5px solid var(--ink);background:#fff}
.range::-webkit-slider-thumb{-webkit-appearance:none;width:40px;height:40px;border-radius:50%;background:var(--mint);border:2.5px solid var(--ink);cursor:grab}
.range::-moz-range-thumb{width:40px;height:40px;border-radius:50%;background:var(--mint);border:2.5px solid var(--ink);cursor:grab}
.pies3{display:grid;grid-template-columns:repeat(3,1fr);gap:8px}
.pies3 .pie{width:100%;height:auto;aspect-ratio:1}

/* Sticker grid */
.stickers{display:grid;grid-template-columns:repeat(3,1fr);gap:10px}
.stk{aspect-ratio:1;border:2.5px solid var(--ink);border-radius:16px;background:var(--marigold);padding:8px;display:flex;flex-direction:column;justify-content:space-between;
  font-size:11px;line-height:1.2;transform:rotate(var(--rot,0deg))}
.stk b{font-family:var(--display);font-size:18px;line-height:1}
.stk.locked{background:transparent;border-style:dashed;color:var(--ink-soft);transform:none}
.stk .n{font-size:10px;font-weight:800;opacity:.7}

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

/* Florence panel: full-bleed art at the top of a scene, HUD floats over it */
.panel{position:relative;margin:-66px -24px 6px;flex:none;border-bottom:2.5px solid var(--ink);overflow:hidden;background:var(--blush)}
.panel img{width:100%;height:100%;object-fit:cover;display:block}
.panel .fallback{position:absolute;inset:0;display:grid;place-items:end center}
.scene.no-hud{padding-top:28px}
.scene.no-hud .panel{margin-top:-28px}
.foot{margin-top:auto;display:flex;flex-direction:column;gap:10px;padding-top:8px}
.panel .flood{position:absolute;inset:58px 12px 12px;height:auto}

.panel>div>img{object-position:var(--pos,center)}
.avatar img{object-fit:cover}
/* figure panel: character placed right on its own colour field (matches Paper 02) */
.panel.figure img{position:absolute;right:16px;top:34px;width:66%;height:auto;object-fit:contain}
.panel.store img{position:absolute;left:50%;top:44px;transform:translateX(-50%);width:auto;height:calc(100% - 50px);object-fit:contain}
.hud[hidden]{display:none}
.owned{align-items:center}
.owned span{font-size:12px;font-weight:700;color:var(--ink-soft);margin-left:4px}
.spacer.hint{display:grid;place-items:center;min-height:60px}

/* ===== v3 overrides ===== */
body{font-weight:500}
.device{background:#fff}
.btn{background:var(--ink);color:#fff;border-color:var(--ink);box-shadow:0 4px 0 #6B6B6B}
.btn.ghost{background:#fff;color:var(--ink);box-shadow:0 4px 0 var(--ink)}
.btn:active{box-shadow:0 1px 0 #6B6B6B}
.hud-cash{background:#fff}
.hud-bar i{background:var(--ink)}
.stage.mood-dip{background:#fff}
.stage.mood-dip .scene{filter:grayscale(1) contrast(.9)}
.stage.mood-hype .scene{filter:none}
.panel{background:#fff!important}
.hold{background:var(--accent);color:#fff}
.hold svg circle{stroke:var(--ink)}
.chart .dot{fill:#fff;stroke:var(--ink)}
.chart .sold{fill:var(--ink)}
.chart-head .px.up,.strip .num.up,.up{color:var(--accent)}
.chart-head .px.down,.strip .num.down,.down{color:var(--ink)}
.stub{background:#fff}
.stub.empty{background:var(--paper-2)}
.owned i{background:var(--ink)}
.news{background:#fff}
.news.good .tag{background:var(--accent)}
.callout{background:var(--paper-2)}
.sticker-toast{background:#fff;box-shadow:0 8px 0 var(--ink)}
.stk{background:#fff}
.range::-webkit-slider-thumb{background:var(--ink)}
.range::-moz-range-thumb{background:var(--ink)}
.scrub .fill{background:var(--paper-2)}
.scrub .knob{background:var(--ink);color:#fff}
.avatar{background:#fff}
.strip.you{background:var(--paper-2)}

/* Organic chat bubbles, one shape per speaker (matches Paper v3) */
.bubble{border-radius:34px 26px 30px 12px / 28px 34px 24px 18px;padding:13px 18px 14px;transform:rotate(-1deg);font-weight:500;line-height:1.38}
.say.vik .bubble{border-radius:22px 40px 18px 34px / 30px 22px 36px 26px;transform:rotate(1.4deg);font-weight:600}
.say.rao .bubble{border-radius:20px 24px 22px 10px / 22px 20px 24px 14px;transform:rotate(-.5deg)}
.say.you{flex-direction:row-reverse}
.say.you .bubble{background:var(--ink);color:#fff;border-color:var(--ink);border-radius:30px 18px 34px 26px / 24px 32px 20px 30px;transform:rotate(-.8deg)}
.flood .b{border-radius:22px 40px 18px 34px / 30px 22px 36px 26px;background:#fff;box-shadow:none}
.flood .b:nth-child(odd){background:var(--ink);color:#fff}
.flood .b:nth-child(3n){border-radius:34px 20px 30px 16px / 24px 34px 22px 28px}
.stickers{grid-template-columns:repeat(3,minmax(0,1fr))}
.stk{aspect-ratio:auto;min-height:124px;min-width:0;overflow-wrap:anywhere;gap:4px}
.stk span:not(.n){font-size:11.5px;line-height:1.3}
