:root {
  --ink: #2a1a3a;
  --ink-dim: rgba(42, 26, 58, .62);
  --card: rgba(255, 255, 255, .86);
  --card-strong: rgba(255, 255, 255, .94);
  --line: rgba(255, 255, 255, .55);
  --play: #ff4d8d;
  --good: #22c55e;
  --today: #7c3aed;
  --gold: #ffd60a;
  --shadow: 0 12px 36px rgba(80, 40, 90, .18);
  --radius: 26px;
  --safe-top: env(safe-area-inset-top, 0px);
  --glass: rgba(255, 255, 255, .30);
  --glass-tint: rgba(255, 255, 255, .42);
  --glass-line: rgba(255, 255, 255, .55);
  --glass-shadow: 0 10px 34px rgba(16, 24, 20, .16), inset 0 1px 0 rgba(255, 255, 255, .72);
  --glass-blur: blur(28px) saturate(1.85);
}

* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; }
body {
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Rounded", "Nunito",
    "Comic Sans MS", ui-rounded, system-ui, sans-serif;
  color: var(--ink);
  background: #14261c;
  -webkit-font-smoothing: antialiased;
  padding-bottom: 56px;
}
.sky {
  position: fixed; inset: 0;
  background: #14261c center top / cover no-repeat;
  z-index: -1;
  overflow: hidden;
}
.sky video {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  object-fit: cover;
  object-position: center top;
  pointer-events: none;
}
.sky::after {
  content: "";
  position: absolute; inset: 0;
  pointer-events: none;
  background: var(--sky-wash, none);
}
.nav {
  position: sticky; top: 0; z-index: 5;
  display: flex; align-items: center; justify-content: space-between;
  padding: calc(12px + var(--safe-top)) 18px 12px;
  backdrop-filter: saturate(1.4) blur(18px);
  -webkit-backdrop-filter: saturate(1.4) blur(18px);
  background: rgba(255, 255, 255, .38);
  border-bottom: 1px solid var(--line);
}
.brand { display: flex; gap: 12px; align-items: center; }
.mon {
  width: 52px; height: 52px; border-radius: 18px;
  background: #fff;
  box-shadow: var(--shadow);
  display: grid; place-items: center;
  animation: bob 2.6s ease-in-out infinite;
}
@keyframes bob { 50% { transform: translateY(-4px) rotate(-4deg); } }
.kicker {
  margin: 0; font-size: 11px; letter-spacing: .10em; text-transform: uppercase;
  color: var(--ink-dim); font-weight: 800;
  max-width: 58vw; line-height: 1.25;
}
h1 { margin: 0; font-size: 24px; letter-spacing: -.03em; font-weight: 900; }
.coin {
  position: relative;
  display: flex; align-items: baseline; gap: 6px;
  background: linear-gradient(180deg, #fff6c2, #ffd60a);
  color: #5a3a00;
  border-radius: 999px;
  padding: 8px 14px 8px 10px;
  box-shadow: 0 8px 24px rgba(255, 184, 0, .4);
  font-variant-numeric: tabular-nums;
}
.coin-dot {
  width: 22px; height: 22px; border-radius: 50%;
  background: radial-gradient(circle at 30% 30%, #fff, #e6b800);
  display: grid; place-items: center;
  font-size: 8px; font-weight: 800; color: #7a5a00;
}
.coin strong { font-size: 18px; }

main { width: min(560px, calc(100% - 24px)); margin: 16px auto 0; position: relative; z-index: 1; }
.glass {
  background: var(--card);
  backdrop-filter: blur(18px) saturate(1.3);
  -webkit-backdrop-filter: blur(18px) saturate(1.3);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}
.hero { padding: 18px 18px 14px; position: relative; }
.unit {
  margin: 0; font-size: 12px; font-weight: 800; color: #c026d3;
  letter-spacing: .06em; text-transform: uppercase;
}
.blurb {
  margin: 8px 0 14px; font-size: 20px; line-height: 1.25;
  font-weight: 800; letter-spacing: -.02em;
}
.stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.stats div {
  background: #fff;
  border-radius: 18px; padding: 10px 8px; text-align: center;
}
.stats b { display: block; font-size: 22px; font-weight: 900; }
.stats span { font-size: 11px; color: var(--ink-dim); font-weight: 700; }

.section-label {
  margin: 22px 8px 10px; font-size: 15px; font-weight: 900;
  color: #fff; text-shadow: 0 2px 10px rgba(80, 20, 90, .45);
}
button.section-label {
  display: flex; align-items: center; justify-content: space-between;
  width: calc(100% - 16px); gap: 10px;
  background: transparent; border: 0; padding: 0;
  font: inherit; color: #fff; cursor: pointer; text-align: left;
}
button.section-label::after {
  content: "";
  width: 9px; height: 9px; flex: none;
  border-right: 2.5px solid #fff; border-bottom: 2.5px solid #fff;
  transform: rotate(45deg); margin: 0 6px 4px 0;
  opacity: .9; transition: transform .18s ease;
}
button.section-label.is-collapsed::after {
  transform: rotate(-45deg); margin-bottom: 0;
}

.next-bracket, .going {
  display: grid; gap: 10px;
}
.next-bracket {
  background: linear-gradient(180deg, #fff7d1, #ffe08a);
  border: 3px solid #fff;
  border-radius: 28px;
  padding: 12px;
  box-shadow: 0 16px 40px rgba(255, 170, 0, .28);
}
.next-hd {
  display: flex; justify-content: space-between; align-items: center;
  padding: 4px 8px 8px; font-weight: 800; color: #7a4a00;
}
.badge {
  background: var(--play); color: #fff;
  border-radius: 999px; padding: 4px 10px; font-size: 12px; font-weight: 900;
}

.play {
  display: grid; grid-template-columns: 44px 1fr auto; gap: 10px; align-items: center;
  text-decoration: none; color: inherit;
  background: #fff;
  border-radius: 20px;
  padding: 12px;
  box-shadow: 0 6px 16px rgba(90, 40, 20, .08);
}
.play.doing { outline: 3px solid #ffd60a; }
.play.locked { opacity: 0.58; filter: grayscale(0.25); pointer-events: none; }
.play.locked .play-num, .play.locked .play-go { background: #8b8b8b; }
.play.done .play-num, .play.done .play-go { background: var(--good); }
.play-num {
  width: 44px; height: 44px; border-radius: 16px;
  background: #7c3aed; color: #fff;
  display: grid; place-items: center;
  font-size: 20px; font-weight: 900;
}
.play.doing .play-num { background: #f59e0b; }
.play-name { font-size: 16px; font-weight: 900; letter-spacing: -.02em; line-height: 1.2; }
.play-meta { font-size: 12px; color: var(--ink-dim); font-weight: 700; margin-top: 3px; }
.play-go {
  position: relative;
  background: var(--play); color: #fff;
  font-weight: 900; font-size: 13px; letter-spacing: .04em;
  padding: 10px 12px; border-radius: 999px;
}
.play-go:has(.fly) {
  box-shadow: 0 0 16px rgba(255, 225, 74, .55);
}
body.wx-night .play-go:has(.fly) {
  box-shadow: 0 0 18px rgba(243, 255, 122, .7);
}
body.wx-rain .play-go:has(.fly),
body.wx-storm .play-go:has(.fly) {
  box-shadow: 0 0 12px rgba(198, 224, 112, .4);
}
body.wx-night.wx-rain .play-go:has(.fly),
body.wx-night.wx-storm .play-go:has(.fly) {
  box-shadow: 0 0 16px rgba(159, 240, 200, .55);
}

.bonus-bracket {
  display: grid; gap: 10px;
  background: rgba(255, 255, 255, .20);
  backdrop-filter: blur(14px) saturate(1.4);
  -webkit-backdrop-filter: blur(14px) saturate(1.4);
  border: 1px solid rgba(255, 255, 255, .28);
  border-radius: 28px;
  padding: 12px;
  box-shadow: 0 8px 24px rgba(16, 24, 20, .10), inset 0 1px 0 rgba(255, 255, 255, .35);
}
.bonus-bracket.is-collapsed { display: none !important; }
.bonus-hd {
  display: flex; justify-content: space-between; align-items: center;
  padding: 4px 8px 8px; font-weight: 800; color: #fff;
  text-shadow: 0 1px 2px #000, 0 0 10px rgba(0, 0, 0, .65);
}
.bonus-badge { background: rgba(124, 58, 237, .88); }
.lock-ico { display: block; }
.play.locked .play-go { display: grid; place-items: center; padding: 8px; min-width: 44px; }
.bonus-bracket .play {
  background: rgba(255, 255, 255, .20);
  color: #fff;
  backdrop-filter: blur(10px) saturate(1.2);
  -webkit-backdrop-filter: blur(10px) saturate(1.2);
  border: 1px solid rgba(255, 255, 255, .28);
  box-shadow: none;
}
.bonus-bracket .play.locked {
  opacity: 1;
  filter: none;
}
.bonus-bracket .play-name {
  color: #fff;
  text-shadow: 0 1px 2px #000, 0 0 10px rgba(0, 0, 0, .7);
}

.roll {
  position: relative;
  background: rgba(255, 255, 255, .20);
  backdrop-filter: blur(14px) saturate(1.4);
  -webkit-backdrop-filter: blur(14px) saturate(1.4);
  border-radius: 24px;
  box-shadow: 0 8px 24px rgba(16, 24, 20, .10), inset 0 1px 0 rgba(255, 255, 255, .35);
  overflow: visible;
  border: 1px solid rgba(255, 255, 255, .28);
  color: #fff;
}
.roll.is-collapsed { display: none !important; }
.roll-list {
  max-height: calc(7 * 62px);
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  border-radius: 0 0 24px 24px;
}
.roll-list::-webkit-scrollbar { width: 8px; }
.roll-list::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, .48);
  border-radius: 99px;
}
.roll-cut {
  height: 14px;
  background:
    radial-gradient(circle at 8px 0, transparent 7px, rgba(255, 255, 255, .28) 8px) repeat-x;
  background-size: 16px 16px;
  background-color: transparent;
  filter: none;
  border-bottom: 1px solid rgba(255, 255, 255, .28);
}
.ticket {
  display: grid; grid-template-columns: 36px 1fr; gap: 10px; align-items: center;
  min-height: 62px;
  padding: 12px 16px;
  text-decoration: none; color: #fff;
  border-top: 1px solid rgba(255, 255, 255, .22);
}
.tick-dot {
  width: 32px; height: 32px; border-radius: 50%;
  background: var(--good); color: #fff;
  display: grid; place-items: center; font-weight: 900;
}
.tick-name {
  font-size: 15px; font-weight: 800; color: #fff;
  text-shadow: 0 1px 2px #000, 0 0 10px rgba(0, 0, 0, .7);
}
.tick-meta {
  font-size: 12px; color: rgba(255, 255, 255, .88); font-weight: 700; margin-top: 2px;
  text-shadow: 0 1px 2px #000, 0 0 8px rgba(0, 0, 0, .65);
}

@media (min-width: 820px) {
  main { width: min(640px, calc(100% - 32px)); }
}

.wx-fx {
  position: fixed; inset: 0;
  pointer-events: none;
  z-index: 0;
  overflow: hidden;
}
body.wx-night { background: #0a1218; }
body.wx-night .bonus-bracket,
body.wx-night .roll,
body.wx-night .bonus-bracket .play {
  background: rgba(255, 255, 255, .20);
}
body.wx-rain .wx-fx,
body.wx-storm .wx-fx {
  background-image:
    repeating-linear-gradient(175deg, transparent 0 12px, rgba(255,255,255,.22) 12px 13px, transparent 13px 28px),
    repeating-linear-gradient(185deg, transparent 0 18px, rgba(210,230,255,.12) 18px 19px, transparent 19px 42px);
  background-size: 120px 180px, 90px 220px;
  animation: rain-fall .48s linear infinite;
  opacity: .42;
}
body.wx-night.wx-rain .wx-fx,
body.wx-night.wx-storm .wx-fx { opacity: .28; }
@keyframes rain-fall {
  from { background-position: 0 0, 0 0; }
  to { background-position: 18px 180px, -12px 220px; }
}
body.wx-storm.wx-flash .sky { filter: brightness(1.55) saturate(.65); }
body.wx-cloudy .sky { filter: saturate(.72) brightness(.88) contrast(.96); }
body.wx-fog .wx-fx {
  background: radial-gradient(ellipse at 50% 28%, rgba(210,220,230,.34), rgba(180,190,200,.12) 55%, transparent 75%);
}

.egg {
  width: 34px; height: 34px;
  padding: 0; border: 0; background: transparent;
  cursor: pointer;
  z-index: 4;
  filter: drop-shadow(0 2px 5px rgba(0,0,0,.28));
}
.egg img {
  width: 100%; height: 100%; display: block; pointer-events: none;
  animation: egg-bob 3.2s ease-in-out infinite;
}
@keyframes egg-bob { 50% { transform: translateY(-3px); } }
.egg.pop img { animation: egg-pop .45s ease; }
@keyframes egg-pop {
  0% { transform: scale(1); }
  40% { transform: scale(1.35) rotate(-10deg); }
  100% { transform: scale(1); }
}
.egg.caught { opacity: .55; filter: grayscale(.2) drop-shadow(0 1px 2px rgba(0,0,0,.2)); }
.egg.caught img { animation: none; }
.egg-sky-tl {
  position: fixed;
  top: calc(var(--safe-top) + 64px);
  left: 6px;
}
.egg-coin {
  position: absolute;
  left: -16px; top: 6px;
  width: 26px; height: 26px;
  z-index: 2;
}
.egg-sky-br {
  position: fixed;
  bottom: 16px; right: 10px;
}
.egg-hero {
  position: absolute;
  right: 12px; bottom: -16px;
  z-index: 2;
}
.egg-roll {
  position: absolute;
  right: 14px; top: -4px;
  width: 30px; height: 30px;
  z-index: 2;
}
.egg-sky-ml {
  position: fixed;
  top: 46vh; left: -10px;
}
.egg-floor {
  position: fixed;
  bottom: 10px; left: 50%;
  transform: translateX(-50%);
}
.egg-credit {
  position: absolute; width: 1px; height: 1px;
  overflow: hidden; clip: rect(0 0 0 0);
}

.fly {
  --fly: #ffe14a;
  --fly-core: #fff8d0;
  --fly-wing: rgba(255, 255, 255, .7);
  --fly-body: #243014;
  position: absolute;
  right: -10px; top: -16px;
  width: 38px; height: 38px;
  z-index: 3;
  cursor: pointer;
  transform-origin: 50% 70%;
  filter: drop-shadow(0 0 6px color-mix(in srgb, var(--fly) 70%, transparent));
}
.fly img {
  width: 100%; height: 100%; display: block; pointer-events: none;
  animation: fly-flap .28s ease-in-out infinite;
  filter: drop-shadow(0 0 5px var(--fly));
}
.fly.idle { animation: fly-perch 2.8s ease-in-out infinite; }
.fly.idle img { animation-duration: .55s; }
.fly.landing { animation: fly-land 1.1s cubic-bezier(.18, .86, .24, 1) both; }
.fly.takeoff { animation: fly-go .72s ease-in both; }
.fly.takeoff img { animation-duration: .12s; }
@keyframes fly-flap {
  0%, 100% { transform: rotate(-10deg) translateY(0); }
  50% { transform: rotate(10deg) translateY(-3px); }
}
@keyframes fly-pulse {
  50% { opacity: .55; }
}
@keyframes fly-perch {
  0%, 100% { transform: translate(0, 0) rotate(8deg); }
  50% { transform: translate(2px, -4px) rotate(-6deg); }
}
@keyframes fly-land {
  0% { transform: translate(-72px, -96px) rotate(-28deg) scale(.35); opacity: 0; }
  62% { opacity: 1; }
  100% { transform: translate(0, 0) rotate(8deg) scale(1); }
}
@keyframes fly-go {
  0% { transform: translate(0, 0) rotate(8deg) scale(1); opacity: 1; }
  100% { transform: translate(28px, -70px) rotate(30deg) scale(.45); opacity: .15; }
}

body:not(.wx-night):not(.wx-rain):not(.wx-storm):not(.wx-cloudy):not(.wx-fog) .fly {
  --fly: #ffe14a;
  --fly-core: #fff8d0;
}
body.wx-cloudy .fly {
  --fly: #d4dc6a;
  --fly-core: #f4f7d2;
  opacity: .82;
}
body.wx-fog .fly {
  --fly: #eef6c8;
  --fly-core: #ffffff;
  filter: blur(.3px) drop-shadow(0 0 8px #eef6c8);
  opacity: .7;
}
body.wx-rain .fly,
body.wx-storm .fly {
  --fly: #c6e070;
  --fly-core: #eef8c4;
  opacity: .7;
}
body.wx-rain .fly.idle { animation-duration: 3.6s; }
body.wx-storm .fly .glow { animation: fly-pulse .26s steps(2, end) infinite; }
body.wx-night .fly {
  --fly: #f3ff7a;
  --fly-core: #ffffff;
  filter: drop-shadow(0 0 12px #f3ff7a) drop-shadow(0 0 4px #fff);
}
body.wx-night .fly .glow { animation-duration: 1s; }
body.wx-night.wx-rain .fly,
body.wx-night.wx-storm .fly {
  --fly: #9ff0c8;
  --fly-core: #e9fff6;
  filter: drop-shadow(0 0 10px #9ff0c8);
}

.swarm {
  position: fixed; inset: 0;
  pointer-events: none;
  z-index: 0;
  overflow: hidden;
}
.flyer {
  position: absolute;
  height: auto;
  image-rendering: auto;
  filter: drop-shadow(0 0 6px rgba(255, 225, 74, .75));
  animation: flyer-go var(--t, 16s) ease-in-out infinite;
  opacity: .92;
}
@keyframes flyer-go {
  0%, 100% { transform: translate(0, 0) rotate(-8deg); }
  30% { transform: translate(var(--dx, 12vw), var(--dy, -8vh)) rotate(10deg); }
  62% { transform: translate(calc(var(--dx, 12vw) * -0.55), calc(var(--dy, -8vh) * 0.45)) rotate(-12deg); }
}
body.wx-night .flyer {
  filter: drop-shadow(0 0 10px #f3ff7a) drop-shadow(0 0 3px #fff);
  opacity: 1;
}
body.wx-rain .flyer,
body.wx-storm .flyer { opacity: .62; }
body.wx-fog .flyer { opacity: .55; filter: blur(.2px) drop-shadow(0 0 8px #eef6c8); }
