:root {
  --ink: #1d1a16;
  --cream: #eef9e6;
  --paper: #fbfff7;
  --yellow: #ffc72c;
  --primary: #4cd07d;
  --primary-dark: #13804a;
  --teal: #1fb5a8;
  --pink: #ff5d8f;
  --purple: #8b5cf6;
  --green: #2fbf71;
  --red: #e5484d;
  --muted: #7a6f5f;
  --display: "Lilita One", "Arial Black", system-ui, sans-serif;
  --body: "Nunito", system-ui, -apple-system, Segoe UI, sans-serif;
  color-scheme: light;
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  font: 700 15px/1.4 var(--body); color: var(--ink);
  background: #12392a;
  background-image: radial-gradient(rgba(255, 255, 255, .07) 2px, transparent 2px);
  background-size: 22px 22px;
  min-height: 100dvh;
}
button { font: inherit; color: inherit; cursor: pointer; border: 0; background: none; }
button:disabled { cursor: not-allowed; }
button:focus-visible, input:focus-visible { outline: 3px solid var(--pink); outline-offset: 2px; }
h2, h3 { margin: 0; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }

.game { width: 100%; max-width: 480px; margin: 0 auto; min-height: 100dvh; background: var(--cream); position: relative; display: flex; flex-direction: column; border-left: 3px solid var(--ink); border-right: 3px solid var(--ink); }
@media (max-width: 486px) { .game { border-left: 0; border-right: 0; } }

/* chunky buttons */
.chunky {
  font-family: var(--display); font-size: 18px; letter-spacing: .02em;
  background: var(--primary); color: var(--ink);
  border: 3px solid var(--ink); border-radius: 14px; padding: 10px 14px;
  box-shadow: 0 4px 0 var(--ink); transition: transform .06s, box-shadow .06s;
}
.chunky:not(:disabled):active { transform: translateY(3px); box-shadow: 0 1px 0 var(--ink); }
.chunky:disabled { filter: grayscale(1); opacity: .45; }
.chunky.alt { background: var(--teal); color: #fff; }
.chunky.pink { background: var(--pink); color: #fff; }
.chunky.ghost { background: var(--paper); }
.chunky.small { font-size: 14.5px; padding: 6px 10px; border-radius: 11px; box-shadow: 0 3px 0 var(--ink); }
.chunky.sq { flex: 0 0 48px; padding: 0; font-size: 22px; }

/* stage */
.stage { position: relative; overflow: hidden; border-bottom: 3px solid var(--ink); background: #7cc8ff; }
.stage svg { display: block; width: 100%; height: 100%; }
.stage.main { height: 236px; flex: 0 0 auto; }
.stage.title { height: 300px; }
.stage .scene { position: absolute; inset: 0; }
.stage.shake { animation: shake .45s; }
@keyframes shake { 20% { transform: translateX(-7px); } 40% { transform: translateX(6px); } 60% { transform: translateX(-4px); } 80% { transform: translateX(3px); } }
.bob { animation: bob 2.4s ease-in-out infinite; }
@keyframes bob { 50% { transform: translateY(-2.5px); } }
.eyes { animation: blink 4.5s infinite; transform-origin: 40px 36px; transform-box: view-box; }
@keyframes blink { 0%, 95%, 100% { transform: scaleY(1); } 97% { transform: scaleY(.1); } }
.danfo { animation: drive 11s linear infinite; }
@keyframes drive { from { transform: translateX(-110px); } to { transform: translateX(520px); } }
.cloud { animation: drift 40s linear infinite; }
.cloud.c2 { animation-duration: 55s; animation-delay: -20s; }
@keyframes drift { from { transform: translateX(-120px); } to { transform: translateX(460px); } }
.twinkle { animation: tw 2s ease-in-out infinite alternate; }
.twinkle:nth-child(odd) { animation-delay: -1s; }
@keyframes tw { to { opacity: .2; } }
.waves { animation: wave 3s ease-in-out infinite alternate; }
@keyframes wave { to { transform: translateX(10px); } }
@media (prefers-reduced-motion: reduce) { .bob, .danfo, .cloud, .twinkle, .waves, .eyes { animation: none; } }

.chip { position: absolute; top: 10px; background: var(--paper); border: 2.5px solid var(--ink); border-radius: 99px; padding: 3px 10px; font-size: 12.5px; box-shadow: 0 2px 0 var(--ink); max-width: 64%; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.chip.where { left: 10px; }
.chip.pips { right: 10px; letter-spacing: -1px; font-size: 14px; padding: 2px 8px; }
.chip.pips i { font-style: normal; filter: grayscale(1); opacity: .3; }
.chip.pips i.on { filter: none; opacity: 1; }

.floats { position: absolute; inset: 0; pointer-events: none; }
.float { position: absolute; top: 46%; transform: translateX(-50%); font-family: var(--display); font-size: 22px; color: #fff; -webkit-text-stroke: 1.5px var(--ink); paint-order: stroke fill; text-shadow: 0 3px 0 var(--ink); animation: floatup 2s ease-out forwards; opacity: 0; white-space: nowrap; }
.float.good { color: #7dffb3; }
.float.bad { color: #ff8a8a; }
.float.money.good { color: var(--yellow); font-size: 26px; }
@keyframes floatup { 0% { opacity: 0; transform: translate(-50%, 10px) scale(.6); } 15% { opacity: 1; transform: translate(-50%, 0) scale(1.15); } 30% { transform: translate(-50%, -6px) scale(1); } 100% { opacity: 0; transform: translate(-50%, -80px); } }

/* HUD */
.hud { display: grid; grid-template-columns: auto 1fr auto auto; gap: 4px 10px; align-items: center; padding: 10px 12px; background: var(--primary); border-bottom: 3px solid var(--ink); position: sticky; top: 0; z-index: 5; }
.agebadge { grid-row: span 2; width: 58px; height: 58px; border-radius: 50%; background: var(--paper); border: 3px solid var(--ink); box-shadow: 0 3px 0 var(--ink); display: grid; place-items: center; align-content: center; font-family: var(--display); font-size: 26px; line-height: .9; }
.agebadge small { font-size: 10px; letter-spacing: .1em; color: var(--muted); }
.id { min-width: 0; display: grid; }
.id b { font-family: var(--display); font-size: 19px; font-weight: 400; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.id span { font-size: 12.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cash { display: flex; align-items: center; gap: 4px; background: var(--ink); color: var(--yellow); border-radius: 99px; padding: 3px 10px 3px 3px; font-family: var(--display); font-size: 17px; }
.cash.neg { color: #ff8a8a; }
.coin { width: 24px; height: 24px; border-radius: 50%; background: var(--yellow); color: var(--ink); display: grid; place-items: center; font-size: 14px; border: 2px solid #c99a12; }
.mute { font-size: 18px; width: 34px; height: 34px; border-radius: 50%; background: var(--paper); border: 2.5px solid var(--ink); }
.bars { grid-column: 2 / -1; display: grid; grid-template-columns: 1fr 1fr; gap: 3px 10px; }
.sbar { display: flex; align-items: center; gap: 4px; }
.sbar .ic { font-size: 13px; width: 18px; text-align: center; }
.track { flex: 1; height: 10px; background: rgba(255, 255, 255, .6); border: 2px solid var(--ink); border-radius: 99px; overflow: hidden; }
.track i { display: block; height: 100%; transition: width .6s cubic-bezier(.3, 1.4, .5, 1); }
.track i.g { background: var(--green); }
.track i.y { background: #ff9f1c; }
.track i.r { background: var(--red); }

/* feed */
.feed { flex: 1; padding: 10px 14px 170px; }
.yr { display: flex; align-items: center; justify-content: space-between; font-family: var(--display); font-size: 20px; margin: 4px 0 8px; }
.link { font-family: var(--body); font-size: 13px; font-weight: 800; text-decoration: underline; text-underline-offset: 3px; }
.bubble { background: var(--paper); border: 2.5px solid var(--ink); border-radius: 16px; padding: 10px 13px; margin-bottom: 9px; box-shadow: 3px 3px 0 var(--ink); font-weight: 700; }
.bubble.new { animation: pop .4s cubic-bezier(.3, 1.5, .5, 1) both; }
@keyframes pop { from { opacity: 0; transform: scale(.85) translateY(8px); } }
.hint { color: var(--muted); font-size: 13px; text-align: center; padding: 6px 10px; }

/* dock */
.dock { position: fixed; bottom: 0; left: 50%; transform: translateX(-50%); width: 100%; max-width: 480px; z-index: 6; background: var(--paper); border-top: 3px solid var(--ink); padding: 8px 12px calc(10px + env(safe-area-inset-bottom)); border-left: 3px solid var(--ink); border-right: 3px solid var(--ink); }
@media (max-width: 486px) { .dock { border-left: 0; border-right: 0; } }
.dockbtns { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin-bottom: 8px; }
.round { display: grid; justify-items: center; font-size: 12px; font-weight: 800; gap: 2px; }
.round span { width: 46px; height: 46px; border-radius: 50%; display: grid; place-items: center; font-size: 22px; background: var(--cream); border: 3px solid var(--ink); box-shadow: 0 3px 0 var(--ink); transition: transform .06s; }
.round:active span { transform: translateY(2px); box-shadow: 0 1px 0 var(--ink); }
.next { width: 100%; font-size: 24px; padding: 11px; display: flex; justify-content: center; gap: 10px; }
.next span { display: inline-block; animation: nudge 1.2s ease-in-out infinite; }
@keyframes nudge { 50% { transform: translateX(4px); } }

/* sheets */
.sheetwrap { position: fixed; inset: 0; z-index: 30; background: rgba(15, 10, 0, .5); display: flex; align-items: flex-end; justify-content: center; }
.sheet { width: 100%; max-width: 480px; max-height: 84dvh; overflow: auto; background: var(--cream); border: 3px solid var(--ink); border-bottom: 0; border-radius: 24px 24px 0 0; padding-bottom: calc(16px + env(safe-area-inset-bottom)); }
.sheet.in { animation: up .28s cubic-bezier(.3, 1.3, .5, 1); }
@keyframes up { from { transform: translateY(60px); opacity: 0; } }
.sheethead { position: sticky; top: 0; z-index: 2; display: flex; align-items: center; gap: 8px; padding: 12px 14px; background: var(--primary); border-bottom: 3px solid var(--ink); }
.sheethead h2 { font-family: var(--display); font-weight: 400; font-size: 22px; flex: 1; }
.pipsmall { font-family: var(--display); background: var(--ink); color: var(--yellow); border-radius: 99px; padding: 2px 10px; }
.x { width: 36px; height: 36px; border-radius: 50%; background: var(--paper); border: 2.5px solid var(--ink); font-size: 16px; }
.sheetbody { padding: 12px 14px; }
.sub { font-family: var(--display); font-weight: 400; font-size: 19px; margin: 18px 0 8px; }
.fine { color: var(--muted); font-size: 12.5px; font-weight: 600; margin: 6px 0; }
.empty { text-align: center; padding: 30px 10px; font-size: 16px; }
.empty::first-line { font-size: 44px; }

.tiles { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.tiles.one { grid-template-columns: 1fr; margin-bottom: 12px; }
.tile { position: relative; text-align: left; display: grid; gap: 1px; align-content: start; background: var(--c); border: 3px solid var(--ink); border-radius: 18px; padding: 10px 11px 11px; box-shadow: 0 4px 0 var(--ink); min-height: 120px; transition: transform .06s; }
.tile:not(:disabled):active { transform: translateY(3px); box-shadow: 0 1px 0 var(--ink); }
.tile:disabled { filter: grayscale(.9); opacity: .5; }
.tile .em { font-size: 34px; line-height: 1.1; }
.tile b { font-family: var(--display); font-weight: 400; font-size: 17px; line-height: 1.1; margin-top: 2px; }
.tile small { font-size: 11.5px; color: #4d453a; }
.tile .eff { color: var(--ink); font-weight: 800; }
.tile .cost { position: absolute; top: 8px; right: 8px; background: var(--ink); color: var(--yellow); font-family: var(--display); font-size: 12.5px; border-radius: 99px; padding: 1px 8px; }

.cards { display: grid; gap: 8px; }
.card, .person { display: flex; gap: 10px; align-items: center; background: var(--paper); border: 2.5px solid var(--ink); border-radius: 14px; padding: 10px 11px; box-shadow: 0 3px 0 var(--ink); }
.card .grow, .person .grow { flex: 1; min-width: 0; display: grid; gap: 1px; }
.card b, .person b { font-weight: 800; }
.card small, .person small { color: var(--muted); font-size: 12.5px; }
.card .miss { color: var(--red); }
.card .right { display: flex; gap: 6px; flex-wrap: wrap; justify-content: flex-end; }
.tag { font-family: var(--display); background: var(--green); color: #fff; border: 2px solid var(--ink); border-radius: 99px; padding: 1px 10px; font-size: 13px; }
.person { align-items: flex-start; }
.person .face { font-size: 30px; width: 50px; height: 50px; border-radius: 50%; background: var(--cream); border: 2.5px solid var(--ink); display: grid; place-items: center; flex: 0 0 auto; }
.person .sbar { margin: 4px 0; }
.btnrow { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; }
.hero-card { background: var(--paper); border: 3px solid var(--ink); border-radius: 18px; padding: 12px; box-shadow: 0 4px 0 var(--ink); display: grid; gap: 2px; }
.hero-card .big { font-family: var(--display); font-size: 21px; }
.hero-card small { color: var(--muted); }
.perf { font-size: 12.5px; color: var(--muted); margin-top: 6px; }

.jy { display: flex; gap: 10px; margin-bottom: 12px; }
.jage { flex: 0 0 40px; height: 40px; border-radius: 50%; background: var(--primary); border: 2.5px solid var(--ink); display: grid; place-items: center; font-family: var(--display); font-size: 17px; }
.jy p { margin: 0 0 6px; background: var(--paper); border: 2px solid var(--ink); border-radius: 12px; padding: 7px 10px; font-size: 14px; }

/* event + ending card */
.modal { position: fixed; inset: 0; z-index: 40; background: rgba(15, 10, 0, .55); display: grid; place-items: center; padding: 16px; }
.modal[hidden] { display: none; }
.evcard { width: 100%; max-width: 420px; max-height: 92dvh; overflow: auto; background: var(--paper); border: 3px solid var(--ink); border-radius: 24px; box-shadow: 0 8px 0 var(--ink); animation: flip .45s cubic-bezier(.3, 1.4, .5, 1); }
@keyframes flip { from { transform: perspective(800px) rotateY(70deg) scale(.8); opacity: 0; } }
.evtop { background: var(--c); border-bottom: 3px solid var(--ink); height: 110px; display: grid; place-items: center; background-image: repeating-linear-gradient(45deg, rgba(255, 255, 255, .18) 0 12px, transparent 12px 24px); }
.evicon { width: 82px; height: 82px; border-radius: 50%; background: var(--paper); border: 3px solid var(--ink); display: grid; place-items: center; font-size: 46px; box-shadow: 0 4px 0 var(--ink); animation: wob 2s ease-in-out infinite; }
@keyframes wob { 50% { transform: rotate(-6deg) scale(1.05); } }
.evbody { padding: 14px 16px 18px; }
.kicker { font-size: 12px; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); }
.evbody h2 { font-size: 19px; font-weight: 800; margin: 6px 0 14px; line-height: 1.35; }
.choices { display: grid; gap: 10px; }
.choices .chunky { text-align: left; font-size: 17px; }
.end .worth { font-family: var(--display); font-size: 36px; line-height: 1; margin-bottom: 8px; }
.end .worth small { display: block; font-family: var(--body); font-size: 12px; color: var(--muted); }
.end ul { margin: 0 0 12px; padding-left: 18px; }
.badges { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 16px; }
.badges span { background: var(--yellow); border: 2px solid var(--ink); border-radius: 99px; padding: 2px 9px; font-size: 12.5px; }

/* fx layer */
#fx { position: fixed; inset: 0; pointer-events: none; z-index: 50; overflow: hidden; }
.splash { position: absolute; inset: 0; display: grid; place-items: center; align-content: center; gap: 14px; background: radial-gradient(circle, rgba(76, 208, 125, .4), rgba(15, 10, 0, .35)); animation: fadein .2s; }
.splash.out { animation: fadeout .25s forwards; }
.burst { width: 170px; height: 170px; border-radius: 50%; background: var(--primary); border: 4px solid var(--ink); box-shadow: 0 7px 0 var(--ink); display: grid; place-items: center; align-content: center; animation: boing .6s cubic-bezier(.3, 1.8, .5, 1); position: relative; }
.burst .ic { position: absolute; top: -26px; font-size: 44px; animation: wob 1s ease-in-out infinite; }
.burst small { font-family: var(--display); font-size: 18px; letter-spacing: .15em; line-height: 1; }
.burst b { font-family: var(--display); font-weight: 400; font-size: 76px; line-height: .95; }
.chips { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px; max-width: 340px; }
.chips span { font-family: var(--display); font-size: 16px; background: var(--paper); border: 2.5px solid var(--ink); border-radius: 99px; padding: 2px 10px; animation: boing .5s .2s cubic-bezier(.3, 1.8, .5, 1) both; }
.chips .good { color: #12854a; }
.chips .bad { color: #c42b30; }
@keyframes boing { from { transform: scale(.2); opacity: 0; } }
@keyframes fadein { from { opacity: 0; } }
@keyframes fadeout { to { opacity: 0; } }
.confetti { position: absolute; top: -12px; width: 9px; height: 14px; border-radius: 2px; animation: fall linear forwards; }
@keyframes fall { to { top: 105vh; transform: rotate(720deg) translateX(40px); } }
.toast { position: absolute; top: 14px; left: 50%; transform: translateX(-50%); display: flex; gap: 10px; align-items: center; background: var(--paper); border: 3px solid var(--ink); border-radius: 16px; padding: 8px 14px 8px 10px; box-shadow: 0 5px 0 var(--ink); animation: drop .45s cubic-bezier(.3, 1.6, .5, 1); max-width: 92vw; }
.toast span { font-size: 30px; }
.toast small { display: block; font-size: 11px; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); }
.toast b { font-family: var(--display); font-weight: 400; font-size: 18px; }
.toast.out { animation: fadeout .4s forwards; }
@keyframes drop { from { transform: translate(-50%, -80px); } }

/* start screen */
.logo { position: absolute; left: 0; right: 0; top: 26px; display: grid; justify-items: center; font-family: var(--display); line-height: .9; transform: rotate(-4deg); }
.logo span { font-size: 64px; color: var(--primary); -webkit-text-stroke: 3px var(--ink); paint-order: stroke fill; text-shadow: 0 6px 0 var(--ink); }
.logo span + span { font-size: 54px; color: #fff; background: var(--pink); padding: 0 14px 4px; border: 3px solid var(--ink); border-radius: 14px; box-shadow: 0 5px 0 var(--ink); text-shadow: 0 4px 0 var(--ink); margin-top: 4px; }
.creator { padding: 16px 16px 30px; display: grid; gap: 12px; grid-template-columns: minmax(0, 1fr); }
.creator .h { font-family: var(--display); font-weight: 400; font-size: 24px; }
.row { display: flex; gap: 8px; align-items: center; }
.row input { flex: 1; min-width: 0; font: 800 15px var(--body); color: var(--ink); background: var(--paper); border: 3px solid var(--ink); border-radius: 13px; padding: 10px 11px; box-shadow: inset 0 3px 0 rgba(0, 0, 0, .06); }
.seg { flex: 1; display: flex; gap: 8px; }
.seg button { flex: 1; font-family: var(--display); font-size: 17px; padding: 9px; border: 3px solid var(--ink); border-radius: 13px; background: var(--paper); box-shadow: 0 3px 0 var(--ink); }
.seg button.on { background: var(--teal); color: #fff; }
.pickers { justify-content: space-between; }
.swatches { display: flex; gap: 8px; flex-wrap: wrap; }
.sw { width: 40px; height: 40px; border-radius: 50%; border: 3px solid var(--ink); box-shadow: 0 3px 0 var(--ink); }
.sw.on { outline: 3px solid var(--pink); outline-offset: 2px; }
.lbl { font-family: var(--display); font-size: 18px; margin-top: 4px; }
.areas { display: grid; grid-template-columns: repeat(auto-fill, minmax(104px, 1fr)); gap: 8px; }
.area { display: grid; text-align: left; gap: 2px; padding: 8px 10px; border: 3px solid var(--ink); border-radius: 13px; background: var(--paper); box-shadow: 0 3px 0 var(--ink); }
.area.on { background: var(--primary); }
.area b { font-weight: 800; }
.area small { font-size: 12px; letter-spacing: -1px; }
.area .dim { filter: grayscale(1); opacity: .25; }
.chunky.play { font-size: 28px; padding: 13px; margin-top: 6px; background: var(--primary-dark); color: #fff; text-shadow: 0 2px 0 var(--ink); }
.creator .fine { text-align: center; }
