/* Hallmark · macrostructure: Rising Sky (studied: the-way-meditation) · tone: painted daylight sky, playful-calm · anchor hue: sky #84bde9 + balloon coral · pre-emit critique: P5 H4 E4 S5 R4 V4 */
@font-face { font-family: 'Nunito'; src: url('/assets/fonts/nunito.woff2') format('woff2'); font-weight: 400 900; font-display: swap; }

:root {
  --sky: #84bde9; --haze: #cfe4f4; --dusk: #5f8fb4; --coral: #e0644a; --pink: #e9a493;
  --gold: #e8b93a; --cream: #ede6d6; --ink: #1f3a52; --ink2: rgba(31, 58, 82, .74);
  --ease: cubic-bezier(.16, .84, .3, 1);
  --pad: clamp(16px, 3vw, 40px);
  --cream-a98: rgba(237, 230, 214, .98);
  --haze-a96: rgba(207, 228, 244, .96);
  --ink-a18: rgba(31, 58, 82, .18);
  --cream-a82: rgba(237, 230, 214, .82);
  --ink-a12: rgba(31, 58, 82, .12);
  --cream-a60: rgba(237, 230, 214, .6);
  --cream-a55: rgba(237, 230, 214, .55);
  --ink-a35: rgba(31, 58, 82, .35);
  --ink-a16: rgba(31, 58, 82, .16);
  --cream-a92: rgba(237, 230, 214, .92);
  --coral-a35: rgba(224, 100, 74, .35);
  --cream-a78: rgba(237, 230, 214, .78);
  --cream-a85: rgba(237, 230, 214, .85);
  --haze-a35: rgba(207, 228, 244, .35);
  --cream-a94: rgba(237, 230, 214, .94);
  --ink-a20: rgba(31, 58, 82, .2);
  --cream-a90: rgba(237, 230, 214, .9);
  --ink-a14: rgba(31, 58, 82, .14);
  --gold-a22: rgba(232, 185, 58, .22);
  --ink-a08: rgba(31, 58, 82, .08);
  --cream-a70: rgba(237, 230, 214, .7);
  --coral-a70: rgba(224, 100, 74, .7);
  --sky-top: #6fafe2;
  --sky-low: #a9d0ee;
  --pink-type: #e3907c;
  --gold-deep: #b88a14;
  --gold-num: #c8961a;
}
* { box-sizing: border-box; }
html { overflow-x: clip; scroll-behavior: smooth; scrollbar-color: var(--dusk) var(--haze); scrollbar-width: thin; }
::-webkit-scrollbar { width: 10px; }
::-webkit-scrollbar-track { background: var(--haze); }
::-webkit-scrollbar-thumb { background: var(--dusk); border-radius: 10px; border: 2px solid var(--haze); }
body {
  margin: 0; color: var(--ink); font: 500 18px/1.55 'Nunito', system-ui, sans-serif;
  background: linear-gradient(180deg, var(--sky-top) 0%, var(--sky) 30%, var(--sky-low) 70%, var(--haze) 100%) fixed;
  -webkit-font-smoothing: antialiased; overflow-x: clip;
}
img { display: block; max-width: 100%; }
a { color: inherit; }
button { font: inherit; color: inherit; }
:focus-visible { outline: 3px solid var(--ink); outline-offset: 3px; }
.defs { position: absolute; }
.pale { color: var(--ink2); }
[hidden] { display: none !important; }

/* fog that clears on load, like a morning sky */
.fog {
  position: fixed; inset: 0; z-index: 60; pointer-events: none;
  background: radial-gradient(120% 90% at 50% 60%, var(--cream-a98), var(--haze-a96));
  backdrop-filter: blur(18px); -webkit-backdrop-filter: blur(18px);
  transition: opacity 1.6s var(--ease), backdrop-filter 1.6s var(--ease);
}
.fog.gone { opacity: 0; backdrop-filter: blur(0); -webkit-backdrop-filter: blur(0); }

/* masthead */
.mast {
  position: fixed; top: 0; left: 0; right: 0; z-index: 40; display: flex; align-items: center; justify-content: space-between;
  gap: 12px; padding: 12px var(--pad); pointer-events: none;
}
.mast > * { pointer-events: auto; }
.home { display: flex; align-items: center; gap: 10px; text-decoration: none; }
.home img { width: 44px; height: 44px; border-radius: 50%; box-shadow: 0 6px 18px var(--ink-a18); }
.home-name { font-weight: 900; font-size: 22px; letter-spacing: .01em; }
.mast-right { display: flex; align-items: center; gap: 8px; }
.ca, .buy, .phantom, .round-ic {
  height: 42px; border: 0; border-radius: 999px; background: var(--cream-a82);
  backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
  box-shadow: 0 4px 14px var(--ink-a12); text-decoration: none; cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center; transition: transform .4s var(--ease), background .3s var(--ease);
}
.round-ic { width: 42px; }
.round-ic svg { width: 18px; height: 18px; fill: var(--ink); }
.ca { padding: 0 14px; gap: 8px; font-size: 14px; font-weight: 700; }
.ca-k { font-weight: 900; }
.ca-v { color: var(--ink2); font-variant-numeric: tabular-nums; }
.ca:disabled { cursor: default; }
.ca.live .ca-v { color: var(--ink); }
.buy { padding: 0 16px; font-weight: 800; font-size: 15px; background: var(--gold); }
.buy[aria-disabled="true"] { background: var(--cream-a60); color: var(--ink2); }
.phantom { padding: 0 16px 0 12px; gap: 8px; font-weight: 800; font-size: 15px; background: var(--ink); color: var(--cream); }
.phantom svg { width: 20px; height: 20px; fill: var(--cream); }
.ca:not(:disabled):hover, .buy:not([aria-disabled="true"]):hover, .phantom:hover, .round-ic:hover { transform: translateY(-2px); }

/* right-hand dot rail */
.rail { position: fixed; right: calc(var(--pad) - 6px); top: 50%; transform: translateY(-50%); z-index: 35; display: grid; gap: 14px; }
.rail a { position: relative; display: block; width: 14px; height: 14px; border-radius: 50%; background: var(--cream-a55); border: 2px solid var(--ink-a35); transition: transform .4s var(--ease), background .3s var(--ease); }
.rail a.on { background: var(--coral); border-color: var(--coral); transform: scale(1.25); }
.rail a span { position: absolute; right: 24px; top: 50%; transform: translate(6px, -50%); white-space: nowrap; font-size: 14px; font-weight: 800; opacity: 0; transition: .35s var(--ease); pointer-events: none; }
.rail a:hover span, .rail a:focus-visible span { opacity: 1; transform: translate(0, -50%); }

/* the hero is the game */
.sky-stage { position: relative; height: 100svh; min-height: 560px; overflow: hidden; touch-action: none; }
#game { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.intro {
  position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center;
  padding: 96px var(--pad) 40px; text-align: center; transition: opacity .7s var(--ease), transform .9s var(--ease), filter .7s var(--ease);
  pointer-events: none;
}
.intro > * { pointer-events: auto; }
.intro.away { opacity: 0; transform: translateY(-40px); filter: blur(10px); pointer-events: none; }
.intro.away > * { pointer-events: none; }
.mark { margin: 0; width: min(560px, 74vw); animation: bob 4.2s ease-in-out infinite; }
.mark img { width: 100%; height: auto; filter: drop-shadow(0 18px 24px var(--ink-a16)); }
.tag { margin: 6px 0 0; font-weight: 800; font-size: clamp(22px, 3.2vw, 40px); line-height: 1.1; white-space: nowrap; }
.up { position: relative; display: inline-block; font-size: 1.45em; line-height: .8; transform: translateY(-.3em) rotate(-7deg); margin-left: .1em; animation: lift 3.4s ease-in-out infinite; }
.up .bl { filter: url(#balloon-sm); }
.up-string { position: absolute; left: .25em; bottom: -.62em; width: .5em; height: .75em; overflow: visible; }
.up-string path { fill: none; stroke: var(--ink2); stroke-width: 2; stroke-linecap: round; }
.bl { font-weight: 900; filter: url(#balloon); display: inline-block; }
.bl-pink { color: var(--pink-type); } .bl-coral { color: var(--coral); } .bl-blue { color: var(--dusk); }
.pick { display: flex; gap: 18px; margin: 26px 0 0; }
.pet {
  position: relative; width: 104px; height: 128px; border-radius: 52px 52px 46px 46px; border: 3px solid transparent;
  background: var(--cream-a60); cursor: pointer; padding: 10px 0 0; display: flex; flex-direction: column; align-items: center;
  transition: transform .5s var(--ease), border-color .3s, background .3s var(--ease); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px);
}
.pet img { height: 82px; width: auto; }
.pet span { font-weight: 900; font-size: 16px; margin-top: 2px; }
.pet.on { border-color: var(--coral); background: var(--cream-a92); transform: translateY(-6px); }
.pet:hover { transform: translateY(-6px); }
.fly {
  margin-top: 22px; width: 116px; height: 116px; border-radius: 50%; border: 0; cursor: pointer;
  background: var(--coral); color: var(--cream); font-weight: 900; font-size: 30px; filter: url(#balloon);
  box-shadow: 0 16px 30px var(--coral-a35); animation: bob 3s ease-in-out infinite; transition: transform .4s var(--ease);
}
.fly:hover { transform: scale(1.06); }
.fly-sm { width: 92px; height: 92px; font-size: 18px; margin: 0; }
.hint { margin: 16px 0 0; font-size: 15px; color: var(--ink); font-weight: 600; max-width: 32ch; }

.hud { position: absolute; left: 0; right: 0; top: 72px; display: flex; justify-content: center; align-items: center; gap: 18px; pointer-events: none; }
.hud-n { display: flex; align-items: center; gap: 6px; padding: 6px 16px; border-radius: 999px; background: var(--cream-a78); font-variant-numeric: tabular-nums; }
.hud-n b { font-weight: 900; font-size: 26px; }
.hud-coins b { color: var(--gold-deep); }
.hud-n img { width: 26px; height: 26px; }
.hud-m small { font-weight: 800; font-size: 15px; }
.hud-b { display: flex; gap: 4px; }
.hud-b i { width: 16px; height: 20px; border-radius: 50% 50% 46% 46%; display: block; box-shadow: inset -3px -4px 0 var(--ink-a18); }
.tilt { pointer-events: auto; border: 0; border-radius: 999px; background: var(--cream-a85); padding: 8px 14px; font-weight: 800; font-size: 14px; cursor: pointer; }
.tilt.on { background: var(--ink); color: var(--cream); }

.result { position: absolute; inset: 0; display: grid; place-items: center; padding: 80px var(--pad) 24px; background: var(--haze-a35); animation: clear .6s var(--ease); }
.result-card {
  width: min(440px, 100%); text-align: center; padding: 26px 26px 24px; border-radius: 44px;
  background: var(--cream-a94); box-shadow: 0 30px 60px var(--ink-a20); animation: float-in .8s var(--ease);
}
.result-pet { width: 120px; height: 120px; object-fit: contain; margin: -86px auto 0; animation: bob 3.4s ease-in-out infinite; }
.result-line { font-weight: 800; font-size: 21px; line-height: 1.3; margin: 8px 0 12px; }
.result-nums { display: flex; justify-content: center; gap: 36px; }
.result-nums b { display: block; font-weight: 900; font-size: 44px; line-height: 1; font-variant-numeric: tabular-nums; }
.result-nums b.gold { color: var(--gold-num); }
.result-nums span { font-size: 15px; color: var(--ink2); font-weight: 700; }
.result-note { font-size: 15px; color: var(--ink2); margin: 14px 0 16px; min-height: 2.6em; }
.result-do { display: flex; align-items: center; justify-content: center; gap: 10px; flex-wrap: wrap; }
.soft { border: 2px solid var(--ink-a20); background: transparent; border-radius: 999px; padding: 10px 16px; font-weight: 800; font-size: 15px; cursor: pointer; text-decoration: none; }
.soft:hover { border-color: var(--ink); }

/* sections below: text surfaces out of the haze */
.board, .pays { position: relative; padding: clamp(90px, 14vh, 160px) var(--pad); }
.drift { width: min(860px, 100%); margin: 0 auto; text-align: center; }
.bal-title { margin: 0 0 18px; font-weight: 900; font-size: clamp(46px, 8vw, 104px); line-height: 1; letter-spacing: -.01em; }
.bal-title .bl { animation: bob 4s ease-in-out infinite; }
.bal-title .bl:nth-child(2) { animation-delay: -1.3s; } .bal-title .bl:nth-child(3) { animation-delay: -2.4s; }
.lede, .words { font-size: clamp(19px, 2.2vw, 26px); font-weight: 700; line-height: 1.45; margin: 0 auto 28px; max-width: 36ch; }
.lede b { font-variant-numeric: tabular-nums; }
.rise { opacity: 0; transform: translateY(30px); filter: blur(8px); transition: opacity 1s var(--ease), transform 1.2s var(--ease), filter 1s var(--ease); }
.rise.in { opacity: 1; transform: none; filter: none; }
.words .w { display: inline-block; opacity: 0; filter: blur(8px); transform: translateY(.3em); transition: opacity .7s var(--ease), filter .7s var(--ease), transform .9s var(--ease); }
.words.in .w { opacity: 1; filter: none; transform: none; }

.cloud-panel { text-align: left; padding: clamp(18px, 3vw, 34px); border-radius: 48px; background: var(--cream-a90); box-shadow: 0 30px 70px var(--ink-a14); }
.pool { font-weight: 700; font-size: 17px; padding: 0 6px 14px; border-bottom: 2px dashed var(--ink-a14); margin-bottom: 8px; }
.pool b { font-weight: 900; }
.ranks { list-style: none; margin: 0; padding: 0; max-height: 560px; overflow: auto; }
.ranks li { display: grid; grid-template-columns: 44px 40px minmax(0, 1fr) auto auto; align-items: center; gap: 12px; padding: 10px 6px; border-radius: 22px; font-variant-numeric: tabular-nums; }
.ranks li:nth-child(-n+3) .r { color: var(--cream); background: var(--coral); }
.ranks li:nth-child(2) .r { background: var(--pink); } .ranks li:nth-child(3) .r { background: var(--dusk); }
.ranks li.me { background: var(--gold-a22); }
.ranks .r { width: 36px; height: 36px; border-radius: 50%; display: grid; place-items: center; font-weight: 900; background: var(--ink-a08); }
.ranks .pf { width: 36px; height: 44px; object-fit: contain; }
.ranks .who { font-weight: 800; }
.ranks .who small { display: block; font-weight: 700; color: var(--ink2); font-size: 14px; }
.ranks .c { font-weight: 900; font-size: 22px; color: var(--gold-deep); }
.ranks .m { font-weight: 800; color: var(--ink2); min-width: 72px; text-align: right; }
.ranks li.empty, .empty { display: block; color: var(--ink2); font-weight: 700; padding: 18px 6px; text-align: center; }

.paid { margin-top: 48px; text-align: left; }
.paid h3 { text-align: center; font-size: 28px; font-weight: 900; margin: 0 0 14px; }
.payday { padding: 16px 22px; border-radius: 32px; background: var(--cream-a70); margin-bottom: 12px; }
.payday > p { margin: 0 0 6px; font-weight: 800; }
.payday ul { list-style: none; margin: 0; padding: 0; font-size: 15px; }
.payday li { display: flex; gap: 12px; justify-content: space-between; padding: 4px 0; font-variant-numeric: tabular-nums; }
.payday a { font-weight: 800; }

.prelaunch { color: var(--coral); }
.prelaunch .pale { color: var(--coral-a70); }
.posters { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: clamp(14px, 3vw, 34px); margin-top: 56px; }
.posters img { width: 100%; height: auto; border-radius: 36px; box-shadow: 0 30px 60px var(--ink-a20); }
.posters img:nth-child(1) { transform: rotate(-2.5deg); animation: bob 5s ease-in-out infinite; }
.posters img:nth-child(2) { transform: rotate(2deg) translateY(36px); animation: bob2 5.6s ease-in-out infinite; }

.foot { text-align: center; padding: 60px var(--pad) 70px; }
.foot img { margin: 0 auto 12px; border-radius: 50%; }
.foot p { margin: 0 auto 10px; max-width: 46ch; font-weight: 700; }
.foot-links { display: flex; gap: 20px; justify-content: center; }
.foot-links a { font-weight: 800; }

.toast { position: fixed; left: 50%; bottom: 24px; transform: translate(-50%, 30px); opacity: 0; z-index: 70; padding: 12px 20px; border-radius: 999px; background: var(--ink); color: var(--cream); font-weight: 700; font-size: 15px; transition: opacity .4s var(--ease), transform .4s var(--ease); max-width: 92vw; text-align: center; }
.toast.on { opacity: 1; transform: translate(-50%, 0); }

@keyframes bob { 0%, 100% { translate: 0 0; } 50% { translate: 0 -8px; } }
@keyframes bob2 { 0%, 100% { translate: 0 0; } 50% { translate: 0 -12px; } }
@keyframes lift { 0%, 100% { translate: 0 0; rotate: 0deg; } 50% { translate: 0 -5px; rotate: 3deg; } }
@keyframes float-in { from { opacity: 0; transform: translateY(40px) scale(.96); filter: blur(6px); } }
@keyframes clear { from { opacity: 0; } }

@media (max-width: 760px) {
  body { font-size: 16px; }
  .home-name, .ca-k { display: none; }
  .ca { padding: 0 12px; font-size: 13px; }
  .buy { padding: 0 12px; font-size: 13px; }
  .phantom { width: 42px; padding: 0; }
  .phantom span { display: none; }
  .mast-right { gap: 6px; }
  .rail { display: none; }
  .pet { width: 92px; height: 116px; }
  .pet img { height: 72px; }
  .fly { width: 100px; height: 100px; font-size: 26px; }
  .ranks li { grid-template-columns: 36px 30px minmax(0, 1fr) auto; gap: 8px; }
  .ranks .m { display: none; }
  .posters { grid-template-columns: minmax(0, 1fr); }
  .posters img:nth-child(2) { transform: rotate(2deg); }
  .hud { top: 66px; gap: 10px; flex-wrap: wrap; }
}
@media (max-width: 420px) {
  .ca-v { display: none; } .ca-k { display: inline; } .ca { width: 42px; padding: 0; }
  .home img { width: 40px; height: 40px; }
  .buy { padding: 0 10px; }
  .tag { font-size: 21px; }
}
/* big screens: the whole interface scales with the scene so nothing sits small in a huge sky */
@media (min-width: 1800px) and (min-height: 950px) { .mast, .intro > *, .hud, .result-card, .drift, .foot, .rail { zoom: 1.3; } }
@media (min-width: 2400px) and (min-height: 1300px) { .mast, .intro > *, .hud, .result-card, .drift, .foot, .rail { zoom: 1.65; } }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition-duration: .01s !important; }
  html { scroll-behavior: auto; }
  .rise, .words .w { opacity: 1; filter: none; transform: none; }
}

/* clouds drifting behind the text sections, the sky goes on */
.board, .pays { overflow: hidden; }
.puff { position: absolute; z-index: -1; pointer-events: none; opacity: .85; animation: drift 38s ease-in-out infinite alternate; }
.puff.p1 { width: clamp(260px, 34vw, 560px); left: -8%; top: 12%; }
.puff.p2 { width: clamp(220px, 28vw, 480px); right: -6%; top: 46%; animation-duration: 46s; opacity: .7; }
.puff.p3 { width: clamp(200px, 24vw, 420px); left: 4%; bottom: 4%; animation-duration: 52s; opacity: .6; }
.board > .drift, .pays > .drift { position: relative; z-index: 1; }
.board, .pays { isolation: isolate; }
@keyframes drift { from { transform: translateX(0); } to { transform: translateX(6vw); } }

/* pressed and disabled states for every control */
.ca, .buy, .phantom, .round-ic, .soft, .pet, .tilt, .fly { white-space: nowrap; -webkit-tap-highlight-color: transparent; }
.buy:active, .phantom:active, .round-ic:active, .soft:active, .tilt:active, .ca:not(:disabled):active { transform: translateY(1px); }
.fly:active { transform: scale(.97); }
.pet:active { transform: translateY(-3px); }
.soft:disabled, .phantom:disabled, .fly:disabled { opacity: .55; cursor: not-allowed; }
