/* Zornice. Mobile first, no external assets. */

/* Registered so the whole sky can cross-fade between dawn phases. */
@property --sky-1 { syntax: '<color>'; inherits: true; initial-value: #050720; }
@property --sky-2 { syntax: '<color>'; inherits: true; initial-value: #121049; }
@property --sky-3 { syntax: '<color>'; inherits: true; initial-value: #2a1a6b; }
@property --sky-4 { syntax: '<color>'; inherits: true; initial-value: #4a2585; }
@property --far-hi { syntax: '<color>'; inherits: true; initial-value: #3a2f96; }
@property --far-lo { syntax: '<color>'; inherits: true; initial-value: #1d1760; }
@property --snow-hi { syntax: '<color>'; inherits: true; initial-value: #b3a8f7; }
@property --snow-lo { syntax: '<color>'; inherits: true; initial-value: #4f41ac; }
@property --front-hi { syntax: '<color>'; inherits: true; initial-value: #5145b0; }
@property --ground-top { syntax: '<color>'; inherits: true; initial-value: #1a1250; }
@property --p { syntax: '<number>'; inherits: true; initial-value: 0; }

:root {
  --ink: #2a1050;
  --gold: #ffd166;
  --gold-2: #ffb627;
  --orange: #ff9f45;
  --coral: #ff5e7e;
  --text: #fff;
  --muted: rgba(255, 255, 255, .68);
  --faint: rgba(255, 255, 255, .42);
  --line: rgba(255, 255, 255, .13);
  --card: rgba(26, 16, 76, .82);
  --font: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --display: ui-rounded, "SF Pro Rounded", system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --spring: cubic-bezier(.34, 1.56, .64, 1);
  --spring-soft: cubic-bezier(.3, 1.3, .5, 1);
  --out: cubic-bezier(.2, .8, .2, 1);
  --safe-t: env(safe-area-inset-top, 0px);
  --safe-b: env(safe-area-inset-bottom, 0px);
  --hero-h: clamp(404px, 51vh, 470px);
  --tab-h: 66px;
}
@supports (height: 1dvh) { :root { --hero-h: clamp(404px, 51dvh, 470px); } }

[data-color="gold"] { --c: #ffe08a; --c2: #ffb627; }
[data-color="violet"] { --c: #cdbbff; --c2: #9166ff; }
[data-color="pink"] { --c: #ffa9d2; --c2: #f0469b; }
[data-color="ice"] { --c: #9be9ff; --c2: #2aa7f4; }
[data-color="amber"] { --c: #ffc680; --c2: #ff7a3d; }
[data-color="sun"] { --c: #fff0a8; --c2: #ff9f45; }
[data-color="fire"] { --c: #ffa27a; --c2: #f0364f; }
[data-color="mint"] { --c: #98f7d6; --c2: #12b886; }
[data-color="rose"] { --c: #ffc6dd; --c2: #e0469b; }

*, *::before, *::after { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  font-family: var(--font);
  color: var(--text);
  background: #04041a;
  overflow: hidden;
  overscroll-behavior: none;
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}
button { font: inherit; color: inherit; border: 0; background: none; padding: 0; margin: 0; cursor: pointer; touch-action: manipulation; -webkit-user-select: none; user-select: none; }
h1, h2, h3, p, ul, ol { margin: 0; }
svg { display: block; }
[hidden] { display: none !important; }
.sprite { position: absolute; width: 0; height: 0; overflow: hidden; }
.sr-only { position: absolute; width: 1px; height: 1px; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
:focus { outline: none; }
:focus-visible { outline: 3px solid var(--gold); outline-offset: 3px; }

/* ---------- shell ---------- */

.app {
  position: relative;
  height: 100vh;
  height: 100dvh;
  max-width: 480px;
  margin: 0 auto;
  overflow: hidden;
  isolation: isolate;
  background: var(--sky-1);
  --stars: 1; --moon: 1; --sunlight: 0; --rise: 0; --pine: #17306b;
  transition: --sky-1 1.8s ease, --sky-2 1.8s ease, --sky-3 1.8s ease, --sky-4 1.8s ease,
    --far-hi 1.8s ease, --far-lo 1.8s ease, --snow-hi 1.8s ease, --snow-lo 1.8s ease,
    --front-hi 1.8s ease, --ground-top 1.8s ease;
}
.app.lapse { transition-duration: .9s; }
.app[data-phase="0"] {
  --sky-1: #050720; --sky-2: #121049; --sky-3: #2a1a6b; --sky-4: #4a2585;
  --far-hi: #4a3cb0; --far-lo: #1d1760; --snow-hi: #b3a8f7; --snow-lo: #4f41ac;
  --front-hi: #5145b0; --ground-top: #1a1250;
  --stars: 1; --moon: 1; --sunlight: 0;
}
.app[data-phase="1"] {
  --sky-1: #090c38; --sky-2: #291570; --sky-3: #742697; --sky-4: #d9488c;
  --far-hi: #5a359f; --far-lo: #2b1a72; --snow-hi: #cdb4fa; --snow-lo: #6a45b8;
  --front-hi: #6748b8; --ground-top: #1c1354;
  --stars: .85; --moon: .95; --sunlight: .6;
}
.app[data-phase="2"] {
  --sky-1: #131a5c; --sky-2: #4b2298; --sky-3: #c63f8e; --sky-4: #ff8a62;
  --far-hi: #8a45b0; --far-lo: #40207f; --snow-hi: #ffc9e0; --snow-lo: #a155be;
  --front-hi: #8a52c0; --ground-top: #201558;
  --stars: .5; --moon: .6; --sunlight: .9;
}
.app[data-phase="3"] {
  --sky-1: #1d2b84; --sky-2: #6c37ba; --sky-3: #f2598c; --sky-4: #ffc463;
  --far-hi: #b65cc0; --far-lo: #55288f; --snow-hi: #ffe6d6; --snow-lo: #cf73b8;
  --front-hi: #a964c4; --ground-top: #23175e;
  --stars: .28; --moon: .3; --sunlight: 1;
}

/* ---------- sky ---------- */

.sky { position: absolute; inset: 0; z-index: 0; pointer-events: none; overflow: hidden; }
.sky-grad {
  position: absolute; inset: 0;
  background: linear-gradient(180deg,
    var(--sky-1) 0,
    var(--sky-2) calc(var(--hero-h) * .4),
    var(--sky-3) calc(var(--hero-h) * .72),
    var(--sky-4) var(--hero-h));
}
.stars {
  position: absolute; left: 0; top: 0; width: 2px; height: 2px; border-radius: 50%;
  background: transparent; opacity: var(--stars);
  animation: twinkle 3.8s ease-in-out infinite;
}
.stars.s2 { animation-duration: 5.4s; animation-delay: -2.2s; }
.stars.s3 { width: 3px; height: 3px; animation-duration: 7s; animation-delay: -4s; }
@keyframes twinkle {
  0%, 100% { opacity: var(--stars); }
  50% { opacity: calc(var(--stars) * .3); }
}
#snow { position: absolute; inset: 0; width: 100%; height: 100%; }

.aurora {
  position: absolute; left: 0; right: 0; top: 0; height: calc(var(--hero-h) * .86);
  opacity: 0; transition: opacity 1.8s ease; filter: blur(24px); mix-blend-mode: screen;
}
.app.aurora-on .aurora { opacity: .95; }
.aurora i { position: absolute; left: -25%; width: 150%; height: 44%; border-radius: 50%; }
.aurora i:nth-child(1) { top: 2%; background: linear-gradient(90deg, transparent, #3dffb0 28%, #2ad4ff 62%, transparent); animation: aurora 9s ease-in-out infinite alternate; }
.aurora i:nth-child(2) { top: 20%; background: linear-gradient(90deg, transparent, #8b5cf6 22%, #3dffb0 52%, #ff7eb6 80%, transparent); opacity: .8; animation: aurora 12s -3s ease-in-out infinite alternate-reverse; }
.aurora i:nth-child(3) { top: 40%; background: linear-gradient(90deg, transparent, #2ad4ff 30%, #b6f08a 66%, transparent); opacity: .6; animation: aurora 15s -6s ease-in-out infinite alternate; }
@keyframes aurora {
  0% { transform: translateX(-9%) skewX(-16deg) scaleY(.6) rotate(-5deg); }
  100% { transform: translateX(9%) skewX(14deg) scaleY(1.25) rotate(4deg); }
}

/* ---------- views ---------- */

.views { position: absolute; inset: 0; z-index: 1; }
.view {
  position: absolute; inset: 0;
  overflow-y: auto; overflow-x: hidden;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  visibility: hidden;
}
.view::-webkit-scrollbar { display: none; }
.view.is-active { visibility: visible; }

.view.enter .rise { animation: rise .75s var(--out) both; animation-delay: calc(var(--i, 0) * 65ms + 40ms); }
@keyframes rise {
  from { opacity: 0; transform: translateY(26px) scale(.97); }
  to { opacity: 1; transform: none; }
}

/* ---------- hero (today) ---------- */

.hero { position: relative; height: var(--hero-h); padding-top: var(--safe-t); touch-action: pan-y; }
.hero.shaken .land { animation: shaken .65s ease-in-out; }
@keyframes shaken { 20% { transform: translateX(-7px) rotate(-.7deg); } 50% { transform: translateX(7px) rotate(.7deg); } 80% { transform: translateX(-3px); } }
.flakes { position: absolute; left: 0; right: 0; bottom: 0; height: 220px; z-index: 2; overflow: hidden; pointer-events: none; }
.flakes i { position: absolute; top: -10px; width: var(--s); height: var(--s); border-radius: 50%; background: #fff; opacity: var(--o); animation: fall var(--t) linear infinite; animation-delay: var(--dl); }
@keyframes fall { to { transform: translate(var(--dx), 240px); } }
.horizon {
  position: absolute; left: -10%; right: -10%; bottom: 40px; height: 240px;
  background: radial-gradient(60% 100% at 18% 100%, var(--sky-4), transparent 72%);
  opacity: calc(var(--sunlight) * .9); transition: opacity 1.8s ease; pointer-events: none;
}
.topbar { position: relative; z-index: 4; display: flex; align-items: center; justify-content: space-between; padding: 12px 16px 0 18px; pointer-events: none; }
.topbar > * { pointer-events: auto; }
.brand { display: flex; align-items: center; gap: 10px; text-align: left; border-radius: 14px; }
.brand-mark {
  width: 36px; height: 36px; border-radius: 12px; display: grid; place-items: center; color: var(--ink);
  background: linear-gradient(135deg, #ffe58f, #ffb347 55%, #ff7a6b);
  box-shadow: 0 6px 16px -4px rgba(255, 150, 80, .75), inset 0 1px 0 rgba(255, 255, 255, .6);
  --icon-cut: #ffc766;
}
.brand-mark svg { width: 22px; height: 22px; }
.brand.knock .brand-mark { animation: knock .32s var(--spring); }
@keyframes knock { 40% { transform: scale(.84) rotate(-10deg); } }
.brand-txt b { display: block; font: 800 19px/1 var(--display); letter-spacing: -.01em; }
.brand-txt small { display: block; margin-top: 3px; font-size: 11.5px; font-weight: 600; color: var(--muted); }
.icon-btn {
  width: 44px; height: 44px; border-radius: 50%; display: grid; place-items: center;
  background: rgba(255, 255, 255, .1); border: 1px solid var(--line);
  transition: transform .2s var(--out), background .3s;
}
.icon-btn:active { transform: scale(.9); }
.icon-btn svg { width: 22px; height: 22px; }
.icon-btn[aria-pressed="true"] { background: linear-gradient(135deg, #ffe58f, #ffb347); color: var(--ink); border-color: transparent; }
.icon-btn.ding svg { animation: ding .7s ease-in-out; transform-origin: 50% 10%; }
@keyframes ding { 20% { transform: rotate(18deg); } 45% { transform: rotate(-14deg); } 70% { transform: rotate(8deg); } }

.hero-body {
  position: relative; z-index: 3; display: flex; flex-direction: column; align-items: center; text-align: center;
  padding: 2px 20px 0; pointer-events: none;
  transform: translateY(calc(var(--sc, 0) * .32px)); opacity: calc(1 - var(--sc, 0) / 240);
}
.hero-body > * { pointer-events: auto; }
.greet { display: flex; flex-wrap: wrap; justify-content: center; gap: 2px 8px; font-size: 13.5px; font-weight: 600; color: var(--muted); pointer-events: none; }
.greet b { color: #fff; font-weight: 800; }
.feast {
  margin-top: 6px; padding: 4px 12px; border-radius: 999px; font: 800 12px/1.3 var(--font); letter-spacing: .02em; color: var(--ink);
  background: linear-gradient(120deg, #ffe58f, #ffb347); box-shadow: 0 6px 14px -6px rgba(255, 170, 70, .9);
}

.score { display: flex; flex-direction: column; align-items: center; margin-top: 2px; border-radius: 28px; padding: 0 14px; -webkit-touch-callout: none; touch-action: manipulation; }
.score.pop .odo { animation: pop .55s var(--spring); }
@keyframes pop { 35% { transform: scale(1.14); } }
.score.holding .odo { animation: hum .5s ease-in-out infinite alternate; }
@keyframes hum { to { transform: scale(1.04); } }
.odo {
  display: flex; font: 900 clamp(78px, 23vw, 96px)/1.12 var(--display); letter-spacing: -.035em;
  font-variant-numeric: tabular-nums; filter: drop-shadow(0 8px 22px rgba(255, 160, 60, .5));
}
.odo-col { display: inline-block; height: 1.12em; overflow: hidden; -webkit-mask-image: linear-gradient(180deg, transparent 0, #000 9%, #000 91%, transparent 100%); mask-image: linear-gradient(180deg, transparent 0, #000 9%, #000 91%, transparent 100%); }
.odo-strip { display: flex; flex-direction: column; transform: translateY(calc(var(--d, 0) * -10%)); transition: transform 1.1s var(--spring-soft); will-change: transform; }
.odo-strip b {
  display: block; height: 1.12em; font-weight: inherit;
  background: linear-gradient(180deg, #fffbe6 12%, #ffd166 50%, #ff9a3d 90%);
  -webkit-background-clip: text; background-clip: text; color: transparent; -webkit-text-fill-color: transparent;
}
.score-unit { margin-top: -6px; font: 800 12.5px/1 var(--font); letter-spacing: .2em; text-transform: uppercase; color: rgba(255, 255, 255, .8); padding-left: .2em; }

.rank-chip {
  margin-top: 13px; display: flex; align-items: center; gap: 10px; padding: 5px 16px 5px 5px; border-radius: 999px; text-align: left;
  background: rgba(14, 9, 52, .55); border: 1px solid rgba(255, 255, 255, .18);
  -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px);
  box-shadow: 0 12px 26px -12px rgba(0, 0, 0, .6);
  transition: transform .2s var(--out);
}
.rank-chip:active { transform: scale(.96); }
.ring {
  width: 42px; height: 42px; border-radius: 50%; display: grid; place-items: center; flex: none;
  background: conic-gradient(var(--gold) calc(var(--p) * 1turn), rgba(255, 255, 255, .18) 0);
  transition: --p 1.1s var(--out);
}
.ring svg { width: 34px; height: 34px; }
.rank-txt b { display: block; font: 800 15px/1.15 var(--display); }
.rank-txt small { display: block; margin-top: 2px; font-size: 12px; font-weight: 600; color: var(--muted); }

/* moon, sun, morning star, shooting star */

.moon {
  position: absolute; z-index: 2; right: 30px; top: calc(var(--safe-t) + 76px); width: 46px; height: 46px; border-radius: 50%;
  box-shadow: inset -13px 7px 0 0 #fff3c9; opacity: var(--moon);
  filter: drop-shadow(0 0 14px rgba(255, 240, 190, .65));
  transition: opacity 1.8s ease; animation: float 9s ease-in-out infinite;
}
@keyframes float { 0%, 100% { transform: rotate(-18deg) translateY(0); } 50% { transform: rotate(-12deg) translateY(-5px); } }
.moon.spin { animation: moonspin .9s var(--spring); }
@keyframes moonspin { from { transform: rotate(-18deg) scale(1); } 50% { transform: rotate(170deg) scale(1.25); } to { transform: rotate(342deg) scale(1); } }
.moon-cap {
  position: absolute; left: 0; top: -15px; width: 0; height: 0;
  border-left: 11px solid transparent; border-right: 11px solid transparent; border-bottom: 22px solid #ff5e8a;
  transform: rotate(-30deg) scale(0); transform-origin: 50% 100%; transition: transform .5s var(--spring);
}
.moon-cap::after { content: ""; position: absolute; left: -5px; top: -6px; width: 10px; height: 10px; border-radius: 50%; background: #fff; }
.moon.sleepy .moon-cap { transform: rotate(-30deg) scale(1); }
.moon-z { position: absolute; right: -12px; top: -6px; font: 900 15px/1 var(--display); font-style: normal; color: #fff; opacity: 0; }
.moon.sleepy .moon-z { animation: zzz 2.6s ease-in-out infinite; }
@keyframes zzz { 0% { opacity: 0; transform: translate(-6px, 8px) scale(.6); } 30% { opacity: 1; } 100% { opacity: 0; transform: translate(8px, -16px) scale(1.2); } }

.sun {
  position: absolute; z-index: 0; left: 15%; bottom: 0; width: 78px; height: 78px; margin-left: -39px;
  opacity: var(--sunlight); transform: translateY(calc(var(--rise) * -112px));
  transition: transform 2.4s var(--out), opacity 1.8s ease; pointer-events: none;
}
.app.lapse .sun { transition-duration: .9s; }
.sun .disc {
  position: absolute; inset: 0; border-radius: 50%;
  background: radial-gradient(circle at 42% 36%, #fffbe0, #ffd166 46%, #ff9a3d 100%);
  box-shadow: 0 0 44px 14px rgba(255, 196, 96, .6), 0 0 130px 56px rgba(255, 120, 96, .34);
}
.sun .rays {
  position: absolute; inset: -74px; border-radius: 50%;
  background: repeating-conic-gradient(rgba(255, 226, 150, .26) 0 7deg, transparent 7deg 20deg);
  -webkit-mask: radial-gradient(circle, transparent 40px, #000 48px, transparent 70%);
  mask: radial-gradient(circle, transparent 40px, #000 48px, transparent 70%);
  animation: rot 50s linear infinite;
}
@keyframes rot { to { transform: rotate(1turn); } }

.danica {
  position: absolute; z-index: 1; left: 24px; top: calc(var(--safe-t) + 104px); width: 22px; height: 22px; color: #fff;
  opacity: calc((var(--sunlight) - .55) * 2.2); filter: drop-shadow(0 0 8px #fff) drop-shadow(0 0 18px #ffe9a8);
  animation: danica 2.8s ease-in-out infinite; pointer-events: none;
}
@keyframes danica { 50% { transform: scale(1.35) rotate(12deg); } }

.shoot { position: absolute; z-index: 2; left: 0; top: 0; width: 72px; height: 72px; margin: -36px 0 0 -36px; border-radius: 50%; opacity: 0; pointer-events: none; }
.shoot.go { pointer-events: auto; }
.shoot i {
  position: absolute; right: 50%; top: 50%; width: 120px; height: 3px; margin-top: -1.5px; border-radius: 3px;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, .95)); transform-origin: 100% 50%; transform: rotate(var(--sa, 150deg));
}
.shoot i::after { content: ""; position: absolute; right: -4px; top: -3.5px; width: 10px; height: 10px; border-radius: 50%; background: #fff; box-shadow: 0 0 12px 4px rgba(255, 255, 255, .9), 0 0 26px 10px rgba(255, 220, 150, .6); }

/* the village */

.land { position: absolute; left: 0; bottom: -1px; width: 100%; height: 170px; z-index: 2; overflow: visible; pointer-events: none; }
.land .l-far { transform: translateY(calc(var(--sc, 0) * .1px)); }
.land .church, .land .owl, .land .rooster, .land .snowman.has { pointer-events: auto; cursor: pointer; }
.win { fill: #3b2c8c; transition: fill .9s ease; }
.win.on { fill: #ffd166; filter: drop-shadow(0 0 2.5px rgba(255, 200, 90, .95)); animation: win 5.5s ease-in-out infinite; }
.win.on:nth-of-type(2n) { animation-delay: -2.4s; }
@keyframes win { 0%, 100% { opacity: 1; } 44% { opacity: .78; } 50% { opacity: .96; } 57% { opacity: .82; } }
.church-glow { animation: glow 4.5s ease-in-out infinite; }
@keyframes glow { 50% { opacity: .7; } }
.church.flash .win.on { animation: flash .8s ease-out; }
@keyframes flash { 20% { fill: #fff; filter: drop-shadow(0 0 7px #fff); } }
.bell { transform-box: fill-box; transform-origin: 50% 0; }
.church.ringing .bell { animation: bell 1s ease-in-out; }
@keyframes bell {
  0% { transform: rotate(0); } 14% { transform: rotate(32deg); } 36% { transform: rotate(-28deg); }
  58% { transform: rotate(18deg); } 78% { transform: rotate(-9deg); } 100% { transform: rotate(0); }
}
.rings circle { fill: none; stroke: #ffd166; stroke-width: 1.4; opacity: 0; transform-box: fill-box; transform-origin: center; }
.rings.go circle { animation: ringout 1.3s ease-out; }
.rings.go circle:nth-child(2) { animation-delay: .16s; }
.rings.go circle:nth-child(3) { animation-delay: .32s; }
@keyframes ringout { 0% { opacity: .95; transform: scale(.3); } 100% { opacity: 0; transform: scale(3.8); } }

.bird { fill: #1b1250; opacity: 0; transform-box: fill-box; transform-origin: 50% 100%; transform: translateY(-16px) scale(.3); transition: opacity .4s ease, transform .8s var(--spring); }
.bird.on { opacity: 1; transform: none; }
.bird.on:nth-child(odd) { animation: peck 4s 1s ease-in-out infinite; }
@keyframes peck { 0%, 86%, 100% { transform: none; } 90% { transform: rotate(18deg); } 94% { transform: rotate(0); } 97% { transform: rotate(14deg); } }
.birds.scatter .bird.on { transition: transform 1.1s ease-in, opacity 1.1s ease-in; transform: translate(-60px, -70px) scale(.6); opacity: 0; }

.puff { fill: #ece7ff; opacity: 0; transform-box: fill-box; transform-origin: center; }
.puff.on { animation: puff 4.2s ease-out infinite; }
.puff.on:nth-child(2) { animation-delay: 1.4s; }
.puff.on:nth-child(3) { animation-delay: 2.8s; }
@keyframes puff { 0% { opacity: 0; transform: translate(0, 0) scale(.5); } 14% { opacity: .75; } 100% { opacity: 0; transform: translate(10px, -28px) scale(2.4); } }

.owl, .rooster { opacity: 0; pointer-events: none !important; transition: opacity 1s ease; }
.app[data-hour="night"] .owl { opacity: 1; pointer-events: auto !important; }
.app[data-hour="dawn"] .rooster { opacity: 1; pointer-events: auto !important; }
.owl-eyes { transform-box: fill-box; transform-origin: center; animation: blink 5.5s infinite; }
@keyframes blink { 0%, 91%, 100% { transform: scaleY(1); } 94% { transform: scaleY(.08); } }
.owl.hoot .owl-eyes { animation: hoot .7s var(--spring); }
@keyframes hoot { 40% { transform: scale(1.7); } }
.rooster-body { transform-box: fill-box; transform-origin: 60% 100%; animation: bobble 2.4s ease-in-out infinite; }
@keyframes bobble { 50% { transform: translateY(-1px) rotate(-3deg); } }
.rooster.crow .rooster-body { animation: crow 1s var(--spring); }
@keyframes crow { 30% { transform: rotate(-22deg) scale(1.35); } 60% { transform: rotate(-16deg) scale(1.3); } }

.prints ellipse { fill: rgba(42, 28, 122, .6); opacity: 0; transition: opacity .7s ease; }
.prints ellipse.on { opacity: 1; }
.prints ellipse.new { animation: printin 1s ease-out both; }
@keyframes printin { 0% { opacity: 0; fill: #fff; } 35% { opacity: 1; fill: #fff; } 100% { opacity: 1; } }

.smp { opacity: 0; transform-box: fill-box; transform-origin: 50% 100%; transform: scale(0); transition: transform .9s var(--spring), opacity .25s ease; }
.smp.on { opacity: 1; transform: scale(1); }
.snowman.wobble .smp.on { animation: wobble .7s ease-in-out; }
@keyframes wobble { 25% { transform: rotate(-9deg); } 55% { transform: rotate(7deg); } 80% { transform: rotate(-3deg); } }

/* ---------- ground + cards ---------- */

.ground {
  position: relative; z-index: 3; display: flex; flex-direction: column; gap: 14px;
  padding: 0 16px calc(var(--tab-h) + var(--safe-b) + 44px);
  min-height: calc(100% - var(--hero-h));
  background: linear-gradient(180deg, var(--ground-top) 0, #0f0a30 560px);
}
.ground > :first-child { margin-top: -36px; }

.card {
  position: relative; border-radius: 28px; padding: 18px;
  background: linear-gradient(180deg, rgba(255, 255, 255, .1), rgba(255, 255, 255, .03)), var(--card);
  border: 1px solid var(--line);
  box-shadow: 0 26px 50px -26px rgba(0, 0, 0, .75), inset 0 1px 0 rgba(255, 255, 255, .12);
}
.card-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
.eyebrow { font-size: 11.5px; font-weight: 800; letter-spacing: .11em; text-transform: uppercase; color: var(--muted); }
.card-title { margin-top: 4px; font: 800 21px/1.2 var(--display); letter-spacing: -.01em; }
.card-title::first-letter { text-transform: uppercase; }
.card-title.sm { font-size: 17.5px; }
.card-note { margin-top: 12px; font-size: 13px; font-weight: 600; color: var(--muted); text-align: center; }
.day-pts {
  flex: none; min-width: 58px; padding: 9px 12px; border-radius: 15px; text-align: center; font: 900 18px/1 var(--display); color: var(--ink);
  background: linear-gradient(135deg, #ffe58f, #ffb347); box-shadow: 0 8px 18px -8px rgba(255, 170, 70, .9);
  transition: background .4s, color .4s, box-shadow .4s;
}
.day-pts[data-zero] { background: rgba(255, 255, 255, .1); color: var(--muted); box-shadow: none; }
.day-pts.bump { animation: pop .5s var(--spring); }
.week-count { flex: none; padding: 7px 11px; border-radius: 13px; background: rgba(255, 255, 255, .1); font: 900 14px/1 var(--display); color: #fff; }

.mode { display: none; }
.card-today[data-mode="zornica"] .mode-zornica,
.card-today[data-mode="sunday"] .mode-sunday,
.card-today[data-mode="before"] .mode-before,
.card-today[data-mode="after"] .mode-after { display: block; }

.cta-wrap { position: relative; }
.cta {
  position: relative; display: flex; align-items: center; gap: 12px; width: 100%; min-height: 76px; padding: 13px 12px; border-radius: 26px;
  text-align: left; color: var(--ink); overflow: hidden; isolation: isolate;
  background: linear-gradient(118deg, #fff0a0 0%, #ffc552 36%, #ff8f5c 76%, #ff5e8a 100%);
  box-shadow: 0 16px 34px -12px rgba(255, 130, 90, .85), inset 0 1px 0 rgba(255, 255, 255, .7), inset 0 -4px 0 rgba(170, 50, 70, .22);
  transition: transform .18s var(--out);
  animation: breathe 2.8s ease-in-out infinite;
}
@keyframes breathe { 50% { box-shadow: 0 20px 44px -10px rgba(255, 130, 90, 1), inset 0 1px 0 rgba(255, 255, 255, .7), inset 0 -4px 0 rgba(170, 50, 70, .22); } }
.cta:active { transform: scale(.965); }
.cta.nudge { animation: nudge .5s ease-in-out; }
@keyframes nudge { 20% { transform: translateX(-7px) rotate(-1deg); } 45% { transform: translateX(6px) rotate(1deg); } 70% { transform: translateX(-3px); } }
.cta-ico { flex: none; width: 48px; height: 48px; border-radius: 16px; display: grid; place-items: center; background: rgba(255, 255, 255, .6); --icon-cut: #ffd98a; }
.cta-ico svg { width: 30px; height: 30px; animation: bob 2.6s ease-in-out infinite; }
@keyframes bob { 50% { transform: translateY(-3px); } }
.cta-txt { flex: 1; min-width: 0; }
.cta-txt b { display: block; font: 800 clamp(16px, 4.7vw, 19px)/1.15 var(--display); letter-spacing: -.015em; white-space: nowrap; }
.cta-txt small { display: block; margin-top: 3px; font-size: 12.5px; font-weight: 700; opacity: .72; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cta-pts { flex: none; padding: 9px 10px; border-radius: 14px; background: var(--ink); color: var(--gold); font: 900 17px/1 var(--display); }
.cta-shine { position: absolute; inset: 0; z-index: -1; background: linear-gradient(105deg, transparent 36%, rgba(255, 255, 255, .7) 50%, transparent 64%); transform: translateX(-120%); animation: shine 3.8s ease-in-out infinite; }
@keyframes shine { 0%, 50% { transform: translateX(-120%); } 82%, 100% { transform: translateX(120%); } }
.cta.leave { animation: ctaout .35s ease-in forwards; }
@keyframes ctaout { to { transform: scale(.86); opacity: 0; } }

.done {
  display: flex; align-items: center; gap: 13px; min-height: 76px; padding: 13px 12px 13px 14px; border-radius: 26px;
  background: linear-gradient(120deg, rgba(255, 209, 102, .2), rgba(255, 94, 138, .14)); border: 1.5px solid rgba(255, 209, 102, .6);
}
.done.in { animation: donein .6s var(--spring) both; }
@keyframes donein { from { transform: scale(.8); opacity: 0; } }
.done-check { flex: none; width: 50px; height: 50px; border-radius: 50%; display: grid; place-items: center; color: var(--ink); background: linear-gradient(135deg, #ffe58f, #ffb347); box-shadow: 0 0 0 6px rgba(255, 209, 102, .18); }
.done-check svg { width: 28px; height: 28px; }
.done.in .done-check { animation: checkpop .7s .1s var(--spring) both; }
@keyframes checkpop { from { transform: scale(0) rotate(-90deg); } }
.done-txt { flex: 1; min-width: 0; }
.done-txt b { display: block; font: 800 19px/1.2 var(--display); }
.done-txt small { display: block; margin-top: 2px; font-size: 12.5px; font-weight: 600; color: var(--muted); }
.undo { flex: none; padding: 10px 12px; border-radius: 13px; background: rgba(255, 255, 255, .1); font-size: 13px; font-weight: 700; color: var(--muted); }
.undo:active { background: rgba(255, 255, 255, .2); }

.bonus-label { display: flex; justify-content: space-between; gap: 10px; margin: 18px 2px 10px; }
.bonus-hint { letter-spacing: 0; text-transform: none; font-weight: 600; color: var(--faint); transition: opacity .4s; }
.chips { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.chip {
  position: relative; isolation: isolate; overflow: hidden; display: grid; grid-template-columns: auto 1fr; align-content: space-between;
  min-height: 104px; padding: 12px; border-radius: 22px; text-align: left;
  background: color-mix(in srgb, var(--c) 11%, transparent); border: 1.5px solid color-mix(in srgb, var(--c) 36%, transparent);
  transition: transform .18s var(--out), opacity .5s ease, filter .5s ease, border-color .4s, color .3s;
}
.chip:active { transform: scale(.96); }
.chip-fill { position: absolute; inset: 0; z-index: -1; background: linear-gradient(135deg, var(--c), var(--c2)); clip-path: circle(0% at var(--x, 30px) var(--y, 30px)); transition: clip-path .6s var(--out); }
.chip[aria-pressed="true"] { color: #1d0f4f; border-color: transparent; }
.chip[aria-pressed="true"] .chip-fill { clip-path: circle(150% at var(--x, 30px) var(--y, 30px)); }
.chip-ico { width: 40px; height: 40px; border-radius: 14px; display: grid; place-items: center; background: color-mix(in srgb, var(--c) 20%, transparent); color: var(--c); --icon-cut: #1b1250; transition: background .3s, color .3s; }
.chip-ico svg { width: 24px; height: 24px; }
.chip[aria-pressed="true"] .chip-ico { background: rgba(255, 255, 255, .42); color: #1d0f4f; --icon-cut: var(--c); }
.chip-pts { justify-self: end; align-self: start; padding: 5px 8px; border-radius: 10px; background: color-mix(in srgb, var(--c) 16%, transparent); color: var(--c); font: 900 14px/1 var(--display); transition: background .3s, color .3s; }
.chip[aria-pressed="true"] .chip-pts { background: rgba(29, 15, 79, .9); color: var(--c); }
.chip-txt { grid-column: 1 / -1; margin-top: 10px; }
.chip-txt b { display: block; font: 800 15.5px/1.15 var(--display); }
.chip-txt small { display: block; margin-top: 2px; font-size: 12px; font-weight: 600; color: var(--muted); transition: color .3s; }
.chip[aria-pressed="true"] .chip-txt small { color: rgba(29, 15, 79, .75); }
.chips.locked .chip { opacity: .45; filter: saturate(.25); }
.chips.unlock .chip { animation: unlock .6s var(--spring) both; animation-delay: calc(var(--n) * 70ms + 180ms); }
@keyframes unlock { from { transform: scale(.82) translateY(10px); } }
.chip.on-now[data-id="s"] .chip-ico svg { animation: ringing .7s ease-in-out; }
.chip.on-now[data-id="d"] .chip-ico svg { animation: hop .6s var(--spring); }
.chip.on-now[data-id="w"] .chip-ico svg { animation: spinflake .9s var(--out); }
.chip.on-now[data-id="c"] .chip-ico svg { animation: sip .8s ease-in-out; }
@keyframes ringing { 15% { transform: rotate(16deg); } 30% { transform: rotate(-14deg); } 45% { transform: rotate(12deg); } 60% { transform: rotate(-9deg); } 75% { transform: rotate(5deg); } }
@keyframes hop { 40% { transform: translateY(-7px) scale(1.1); } }
@keyframes spinflake { to { transform: rotate(240deg); } }
@keyframes sip { 30% { transform: rotate(-18deg) translateY(-2px); } 70% { transform: rotate(6deg); } }

.note { display: flex; align-items: center; gap: 14px; }
.note p { font-size: 15px; font-weight: 600; line-height: 1.45; color: rgba(255, 255, 255, .88); }
.note-ico { flex: none; width: 54px; height: 54px; border-radius: 18px; display: grid; place-items: center; color: var(--ink); }
.note-ico svg { width: 30px; height: 30px; }
.candle-ico { background: linear-gradient(135deg, #cdbbff, #9166ff); }
.star-ico { background: linear-gradient(135deg, #fff0a8, #ff9f45); }
.btn-ghost { width: 100%; min-height: 48px; margin-top: 14px; border-radius: 16px; background: rgba(255, 255, 255, .08); border: 1px solid var(--line); font: 700 15px/1 var(--font); }
.btn-ghost:active { background: rgba(255, 255, 255, .16); }
.count { display: flex; align-items: baseline; justify-content: center; gap: 10px; }
.count b { font: 900 72px/1 var(--display); background: linear-gradient(180deg, #fffbe6, #ffd166 50%, #ff9a3d); -webkit-background-clip: text; background-clip: text; color: transparent; }
.count span { font: 800 20px/1 var(--display); color: var(--muted); }
.count-sub { margin-top: 8px; text-align: center; font-size: 14.5px; font-weight: 600; line-height: 1.45; color: var(--muted); }

/* week challenge */

.week-row { display: flex; align-items: center; gap: 6px; }
.dot {
  position: relative; flex: 1 1 0; max-width: 46px; aspect-ratio: 1; border-radius: 50%; display: grid; place-items: center;
  background: rgba(255, 255, 255, .07); border: 1.5px solid rgba(255, 255, 255, .13); color: var(--muted); font: 800 13px/1 var(--display);
  transition: background .4s, border-color .4s, color .4s, transform .5s var(--spring);
}
.dot.on { background: linear-gradient(135deg, #ffe58f, #ffb347); border-color: transparent; color: var(--ink); box-shadow: 0 8px 16px -8px rgba(255, 170, 70, .95); }
.dot.on.now { animation: pop .6s var(--spring); }
.dot.today:not(.on) { border-color: var(--gold); color: #fff; }
.dot.today:not(.on)::after { content: ""; position: absolute; inset: -5px; border-radius: 50%; border: 1.5px solid var(--gold); animation: pulse 1.9s ease-out infinite; }
@keyframes pulse { from { opacity: .8; transform: scale(.86); } to { opacity: 0; transform: scale(1.28); } }
.dot.miss { opacity: .45; }
.week-link { flex: 0 0 8px; height: 2px; border-radius: 2px; background: rgba(255, 255, 255, .16); }
.week-flame {
  flex: none; width: 50px; height: 50px; border-radius: 17px; display: grid; place-items: center; align-content: center; gap: 0;
  background: rgba(255, 255, 255, .07); border: 1.5px dashed rgba(255, 255, 255, .22); color: var(--faint); --icon-cut: #1b1250;
  transition: background .5s, color .5s, border-color .5s;
}
.week-flame svg { width: 22px; height: 22px; }
.week-flame b { font: 900 11px/1 var(--display); margin-top: 1px; }
.week-flame.lit { background: linear-gradient(135deg, #ffb347, #ff5e7e); border: 0; color: var(--ink); --icon-cut: #ffd166; box-shadow: 0 10px 22px -8px rgba(255, 94, 126, .95); }
.week-flame.lit svg { animation: flicker 1.1s ease-in-out infinite alternate; transform-origin: 50% 90%; }
@keyframes flicker { 0% { transform: scale(1) rotate(-3deg); } 50% { transform: scale(1.1, 1.16) rotate(2deg); } 100% { transform: scale(.96, 1.06) rotate(-1deg); } }
.week-sub { margin-top: 12px; font-size: 13.5px; font-weight: 600; color: var(--muted); }

/* tiles */

.duo { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.tile { position: relative; overflow: hidden; border-radius: 24px; padding: 15px; border: 1px solid var(--line); background: linear-gradient(180deg, rgba(255, 255, 255, .1), rgba(255, 255, 255, .03)), var(--card); }
.tile-ico { position: absolute; right: 12px; top: 12px; width: 36px; height: 36px; border-radius: 13px; display: grid; place-items: center; --icon-cut: #1b1250; }
.tile-ico svg { width: 22px; height: 22px; }
.tile-streak .tile-ico { background: rgba(255, 122, 61, .2); color: #ff9a6b; }
.tile-streak.hot .tile-ico { background: linear-gradient(135deg, #ffb347, #ff5e7e); color: var(--ink); --icon-cut: #ffd166; }
.tile-streak.hot .tile-ico svg { animation: flicker 1.1s ease-in-out infinite alternate; transform-origin: 50% 90%; }
.tile-next .tile-ico { background: rgba(145, 102, 255, .25); color: #cdbbff; }
.tile-big { margin-top: 12px; font: 800 15px/1.1 var(--display); color: var(--muted); }
.tile-big b { font: 900 38px/1 var(--display); color: #fff; letter-spacing: -.02em; }
.tile-big.sm b { font-size: 19px; line-height: 1.2; letter-spacing: -.01em; display: block; min-height: 38px; padding-top: 6px; }
.tile-sub { margin-top: 5px; font-size: 13px; font-weight: 600; color: var(--muted); }

/* christmas wheat */

.card-wheat { background: linear-gradient(160deg, rgba(31, 163, 107, .26), rgba(255, 255, 255, .03) 60%), var(--card); border-color: rgba(120, 240, 170, .28); }
.wheat-stage { display: flex; align-items: center; gap: 12px; }
.wheat { flex: none; width: 46%; max-width: 170px; overflow: visible; }
.wheat-side { flex: 1; min-width: 0; }
.wheat-text { font-size: 14px; font-weight: 600; line-height: 1.45; color: rgba(255, 255, 255, .86); }
.wheat-side .btn-pill { margin-top: 12px; }
.blades { transform-box: fill-box; transform-origin: 50% 100%; animation: sway 4.5s ease-in-out infinite alternate; }
@keyframes sway { from { transform: skewX(-2.5deg); } to { transform: skewX(2.5deg); } }
.blades path { fill: none; stroke-width: 3.2; stroke-linecap: round; transform-box: fill-box; transform-origin: 50% 100%; transform: scaleY(var(--g, 0)); transition: transform 1.4s var(--spring-soft); }
.ribbon, .wheat-candle { opacity: 0; transition: opacity .8s ease; }
.wheat.tied .ribbon { opacity: 1; }
.wheat.lit .wheat-candle { opacity: 1; }
.wc-flame { transform-box: fill-box; transform-origin: 50% 100%; animation: flicker 1s ease-in-out infinite alternate; }
.drops path { fill: #7fd8ff; animation: drop .8s ease-in both; }
@keyframes drop { from { opacity: 0; transform: translateY(-34px); } 30% { opacity: 1; } to { opacity: 0; transform: translateY(18px); } }

.btn-pill { display: inline-flex; align-items: center; gap: 8px; min-height: 44px; padding: 10px 18px; border-radius: 999px; background: rgba(255, 255, 255, .13); border: 1px solid rgba(255, 255, 255, .22); font: 800 14.5px/1 var(--display); transition: transform .18s var(--out), background .3s; }
.btn-pill:active { transform: scale(.94); background: rgba(255, 255, 255, .22); }
.btn-pill svg { width: 18px; height: 18px; }
.btn-pill[disabled] { opacity: .55; }

/* ---------- calendar ---------- */

.hero-sm { position: relative; padding: calc(var(--safe-t) + 20px) 20px 62px; text-align: center; }
.view-title { font: 900 29px/1.1 var(--display); letter-spacing: -.02em; }
.view-sub { margin-top: 6px; font-size: 14px; font-weight: 600; color: var(--muted); }
.hillcut { position: absolute; left: 0; bottom: -1px; width: 100%; height: 46px; fill: var(--ground-top); }

.wreath { width: min(100%, 330px); margin: 14px auto 0; overflow: visible; }
.wreath .candle { cursor: pointer; }
.halo { opacity: 0; transition: opacity .9s ease; transform-box: fill-box; transform-origin: center; }
.candle.lit .halo { opacity: 1; animation: halo 2.6s ease-in-out infinite; }
@keyframes halo { 50% { transform: scale(1.14); opacity: .78; } }
.flame { transform-box: fill-box; transform-origin: 50% 100%; transform: scale(0); opacity: 0; transition: transform .7s var(--spring), opacity .3s ease; }
.candle.lit .flame { transform: scale(1); opacity: 1; animation: candle 1.5s ease-in-out infinite alternate; }
.candle:nth-of-type(2).lit .flame { animation-duration: 1.2s; animation-delay: -.4s; }
.candle:nth-of-type(3).lit .flame { animation-duration: 1.7s; animation-delay: -.8s; }
.candle:nth-of-type(4).lit .flame { animation-duration: 1.35s; animation-delay: -.2s; }
@keyframes candle {
  0% { transform: scale(1, 1) skewX(-3deg); } 30% { transform: scale(.94, 1.1) skewX(3deg); }
  60% { transform: scale(1.05, .95) skewX(-2deg); } 100% { transform: scale(.97, 1.07) skewX(4deg); }
}
.smk circle { fill: #d9d2ff; opacity: 0; transform-box: fill-box; transform-origin: center; }
.candle.puffed .smk circle { animation: smk 1.5s ease-out; }
.candle.puffed .smk circle:nth-child(2) { animation-delay: .22s; }
@keyframes smk { 0% { opacity: .75; transform: translateY(0) scale(.6); } 100% { opacity: 0; transform: translate(8px, -40px) scale(2.2); } }
.candle.shake { animation: none; }
.candle.shake rect:not(.hit) { animation: nope .45s ease-in-out; transform-box: fill-box; transform-origin: 50% 100%; }
@keyframes nope { 25% { transform: rotate(-5deg); } 60% { transform: rotate(4deg); } }
.wreath-cap { margin-top: 12px; font: 800 15.5px/1.3 var(--display); }
.wreath-cap small { display: block; margin-top: 3px; font: 600 13px/1.3 var(--font); color: var(--muted); }

.weeks { display: flex; flex-direction: column; gap: 14px; }
.ground > .weeks:first-child { margin-top: -22px; }
.wk-head { display: flex; align-items: center; gap: 12px; margin-bottom: 13px; }
.wk-candle { flex: none; width: 42px; height: 42px; border-radius: 15px; display: grid; place-items: center; background: linear-gradient(135deg, var(--c), var(--c2)); color: var(--ink); box-shadow: 0 8px 18px -8px var(--c2); }
.wk-candle svg { width: 24px; height: 24px; }
.wk-title { flex: 1; min-width: 0; }
.wk-title b { display: block; font: 800 17.5px/1.15 var(--display); }
.wk-title small { display: block; margin-top: 2px; font-size: 12.5px; font-weight: 600; color: var(--muted); }
.wk-bonus { flex: none; display: flex; align-items: center; gap: 3px; padding: 6px 11px 6px 7px; border-radius: 999px; background: rgba(255, 255, 255, .08); color: var(--faint); font: 900 13.5px/1 var(--display); --icon-cut: #1b1250; transition: background .5s, color .5s; }
.wk-bonus svg { width: 20px; height: 20px; }
.wk.complete .wk-bonus { background: linear-gradient(135deg, #ffb347, #ff5e7e); color: var(--ink); --icon-cut: #ffd166; box-shadow: 0 10px 20px -8px rgba(255, 94, 126, .9); }
.wk.complete .wk-bonus svg { animation: flicker 1.1s ease-in-out infinite alternate; transform-origin: 50% 90%; }
.doors { display: grid; grid-template-columns: repeat(6, 1fr); gap: 7px; }
.door {
  position: relative; aspect-ratio: 1 / 1.24; border-radius: 16px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
  background: rgba(255, 255, 255, .06); border: 1.5px solid rgba(255, 255, 255, .13); color: var(--muted);
  transition: transform .18s var(--out), background .4s, border-color .4s, color .4s;
}
.door:active { transform: scale(.92); }
.door small { font-size: 9.5px; font-weight: 800; letter-spacing: .07em; text-transform: uppercase; opacity: .85; }
.door b { font: 900 20px/1 var(--display); letter-spacing: -.02em; }
.door .mark { height: 13px; font: 900 10.5px/13px var(--display); }
.door.on { background: linear-gradient(160deg, #fff0a0, #ffc14d 50%, #ff8a5b); border-color: transparent; color: var(--ink); box-shadow: 0 12px 20px -12px rgba(255, 150, 70, 1), inset 0 1px 0 rgba(255, 255, 255, .7); }
.door.on.golden { background: linear-gradient(160deg, #fffbe0, #ffd84d 40%, #ff9f45 75%, #ff5e8a); }
.door.on.golden::before { content: ""; position: absolute; inset: -3px; border-radius: 18px; border: 2px solid rgba(255, 233, 150, .9); animation: pulse 2.2s ease-out infinite; }
.door.flip { animation: flip .7s var(--spring); }
@keyframes flip { 0% { transform: perspective(300px) rotateY(0); } 50% { transform: perspective(300px) rotateY(90deg) scale(1.1); } 100% { transform: perspective(300px) rotateY(0); } }
.door.today:not(.on) { border-color: var(--gold); color: #fff; background: rgba(255, 209, 102, .13); }
.door.today:not(.on)::before { content: ""; position: absolute; inset: -4px; border-radius: 19px; border: 1.5px solid var(--gold); animation: pulse 1.9s ease-out infinite; }
.door.miss { opacity: .62; }
.door.future { opacity: .5; }
.door.future .mark svg { width: 11px; height: 11px; margin: 1px auto 0; opacity: .7; }
.door.is-feast::after { content: ""; position: absolute; right: 5px; top: 5px; width: 6px; height: 6px; border-radius: 50%; background: #ff5e8a; box-shadow: 0 0 6px #ff5e8a; }
.door.on.is-feast::after { background: var(--ink); box-shadow: none; }
.door.xmas { aspect-ratio: auto; background: linear-gradient(135deg, #f0469b, #8b5cf6 60%, #2aa7f4); border: 0; color: #fff; opacity: 1; overflow: hidden; }
.door.xmas svg { width: 22px; height: 22px; color: #ffe58f; animation: danica 2.6s ease-in-out infinite; }
.door.xmas b { font-size: 13.5px; letter-spacing: 0; }
.door.xmas.shake { animation: nudge .5s ease-in-out; }
.view.enter .door { animation: doorin .55s var(--spring) both; animation-delay: calc(var(--n, 0) * 22ms + 260ms); }
@keyframes doorin { from { opacity: 0; transform: scale(.5) rotate(-8deg); } }
.foot { padding: 8px 12px 0; text-align: center; font-size: 12.5px; font-weight: 600; line-height: 1.6; color: var(--faint); }

/* ---------- journey ---------- */

.hero-path { padding-bottom: 66px; }
.medal-big { position: relative; display: grid; place-items: center; width: 132px; height: 132px; margin: 18px auto 0; border-radius: 50%; }
.medal-big svg { position: relative; width: 132px; height: 132px; filter: drop-shadow(0 16px 26px rgba(0, 0, 0, .45)); animation: medalfloat 5s ease-in-out infinite; }
@keyframes medalfloat { 50% { transform: translateY(-6px) rotate(3deg); } }
.medal-big.flipping svg { animation: coin 1s var(--out); }
@keyframes coin { 0% { transform: rotateY(0) scale(1); } 50% { transform: rotateY(540deg) scale(1.18); } 100% { transform: rotateY(1080deg) scale(1); } }
.medal-rays { position: absolute; inset: -60px; border-radius: 50%; background: repeating-conic-gradient(rgba(255, 220, 130, .2) 0 8deg, transparent 8deg 20deg); -webkit-mask: radial-gradient(circle, #000 30%, transparent 68%); mask: radial-gradient(circle, #000 30%, transparent 68%); animation: rot 36s linear infinite; }
.path-rank { margin-top: 14px; font: 900 24px/1.15 var(--display); letter-spacing: -.01em; }
.path-line { margin-top: 5px; font-size: 14px; font-weight: 600; color: var(--muted); }
.btn-share { margin-top: 14px; }

.stats { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.ground > .stats:first-child { margin-top: -26px; }
.stat { position: relative; overflow: hidden; border-radius: 24px; padding: 14px 15px; border: 1px solid color-mix(in srgb, var(--c) 34%, transparent); background: linear-gradient(140deg, color-mix(in srgb, var(--c2) 34%, transparent), color-mix(in srgb, var(--c2) 8%, transparent)), var(--card); }
.stat b { display: block; font: 900 34px/1 var(--display); letter-spacing: -.02em; color: var(--c); }
.stat b i { font: 800 15px/1 var(--display); font-style: normal; color: var(--muted); margin-left: 3px; }
.stat span { display: block; margin-top: 6px; font-size: 12.5px; font-weight: 700; color: rgba(255, 255, 255, .8); }
.stat svg { position: absolute; right: -6px; bottom: -8px; width: 62px; height: 62px; color: var(--c); opacity: .2; --icon-cut: transparent; }

.ladder { position: relative; list-style: none; padding: 0; display: flex; flex-direction: column-reverse; gap: 6px; }
.ladder::before, .ladder::after { content: ""; position: absolute; left: 28px; bottom: 34px; width: 4px; border-radius: 4px; }
.ladder::before { top: 34px; background: rgba(255, 255, 255, .12); }
.ladder::after { height: calc((100% - 68px) * var(--fill, 0)); background: linear-gradient(0deg, #ffb347, #ffe58f); box-shadow: 0 0 12px rgba(255, 190, 90, .8); transition: height 1.2s var(--out); }
.rung { position: relative; z-index: 1; display: flex; align-items: center; gap: 13px; padding: 8px 10px 8px 6px; border-radius: 22px; border: 1.5px solid transparent; }
.rung svg { flex: none; width: 48px; height: 48px; filter: grayscale(1) brightness(.75); opacity: .6; transition: filter .6s, opacity .6s; }
.rung.is-done svg, .rung.is-cur svg { filter: none; opacity: 1; }
.rung.is-cur { background: rgba(255, 209, 102, .11); border-color: rgba(255, 209, 102, .5); }
.rung.is-cur svg { animation: medalfloat 4s ease-in-out infinite; }
.rung-txt { flex: 1; min-width: 0; }
.rung-txt b { display: block; font: 800 16px/1.2 var(--display); }
.rung-txt small { display: block; margin-top: 2px; font-size: 12.5px; font-weight: 600; color: var(--muted); }
.rung-tag { flex: none; padding: 6px 10px; border-radius: 11px; font: 900 11.5px/1 var(--display); letter-spacing: .04em; text-transform: uppercase; background: rgba(255, 255, 255, .08); color: var(--faint); }
.rung-tag svg { width: 16px; height: 16px; filter: none !important; opacity: 1 !important; animation: none !important; }
.rung.is-done .rung-tag { background: rgba(152, 247, 214, .16); color: #98f7d6; padding: 6px; }
.rung.is-cur .rung-tag { background: linear-gradient(135deg, #ffe58f, #ffb347); color: var(--ink); }

.badges { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px 6px; }
.secrets { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px 4px; }
.badge { display: flex; flex-direction: column; align-items: center; gap: 7px; text-align: center; border-radius: 18px; padding: 4px 2px; transition: transform .18s var(--out); }
.badge:active { transform: scale(.92); }
.badge-disc {
  position: relative; width: 60px; height: 60px; border-radius: 50%; display: grid; place-items: center;
  background: rgba(255, 255, 255, .06); border: 1.5px dashed rgba(255, 255, 255, .22); color: rgba(255, 255, 255, .34); --icon-cut: #1b1250;
}
.secrets .badge-disc { width: 54px; height: 54px; }
.badge-disc svg { width: 30px; height: 30px; }
.secrets .badge-disc svg { width: 26px; height: 26px; }
.badge.on .badge-disc { border: 0; color: var(--ink); --icon-cut: var(--c); background: linear-gradient(135deg, var(--c), var(--c2)); box-shadow: 0 12px 20px -10px var(--c2), inset 0 2px 0 rgba(255, 255, 255, .55), inset 0 -3px 0 rgba(0, 0, 0, .14); }
.badge.on .badge-disc::after { content: ""; position: absolute; inset: 0; border-radius: 50%; background: linear-gradient(115deg, transparent 38%, rgba(255, 255, 255, .7) 50%, transparent 62%); background-size: 260% 100%; animation: gleam 4.5s ease-in-out infinite; }
@keyframes gleam { 0%, 60% { background-position: 130% 0; } 100% { background-position: -130% 0; } }
.badge.fresh .badge-disc { animation: fresh 1s var(--spring); }
@keyframes fresh { 0% { transform: scale(.3) rotate(-120deg); } 60% { transform: scale(1.25) rotate(8deg); } }
.badge b { font: 700 12px/1.2 var(--font); color: var(--muted); }
.badge.on b { color: #fff; }
.badge small { font: 800 11px/1 var(--display); color: var(--faint); }
.badge.on small { color: var(--c); }

.legend { list-style: none; padding: 0; display: flex; flex-direction: column; gap: 4px; }
.legend li { display: flex; align-items: center; gap: 12px; padding: 7px 4px; }
.legend-ico { flex: none; width: 38px; height: 38px; border-radius: 13px; display: grid; place-items: center; background: color-mix(in srgb, var(--c) 20%, transparent); color: var(--c); --icon-cut: #1b1250; }
.legend-ico svg { width: 22px; height: 22px; }
.legend-txt { flex: 1; min-width: 0; }
.legend-txt b { display: block; font: 800 15px/1.2 var(--display); }
.legend-txt small { display: block; font-size: 12.5px; font-weight: 600; color: var(--muted); }
.legend-pts { flex: none; font: 900 15px/1 var(--display); color: var(--c); }

.settings { display: flex; flex-direction: column; gap: 8px; }
.set-row, .row {
  display: flex; align-items: center; gap: 12px; width: 100%; padding: 10px 12px; border-radius: 20px; text-align: left;
  background: rgba(255, 255, 255, .06); border: 1.5px solid transparent; transition: background .35s, border-color .35s, opacity .35s, transform .18s var(--out);
}
.row:active, button.set-row:active { transform: scale(.98); }
.set-ico, .row-ico { flex: none; width: 42px; height: 42px; border-radius: 14px; display: grid; place-items: center; background: rgba(255, 255, 255, .1); --icon-cut: #1b1250; }
.set-ico svg, .row-ico svg { width: 24px; height: 24px; }
.set-txt, .row-txt { flex: 1; min-width: 0; }
.set-txt b, .row-txt b { display: block; font: 800 15.5px/1.2 var(--display); }
.set-txt small, .row-txt small { display: block; margin-top: 1px; font-size: 12.5px; font-weight: 600; color: var(--muted); }
.set-row.danger .set-ico { background: rgba(255, 94, 126, .18); color: #ff8aa2; }
.set-row.danger b { color: #ffb3c2; }
.switch { position: relative; flex: none; width: 48px; height: 29px; border-radius: 999px; background: rgba(255, 255, 255, .16); transition: background .35s; }
.switch i { position: absolute; left: 3px; top: 3px; width: 23px; height: 23px; border-radius: 50%; background: #fff; box-shadow: 0 2px 6px rgba(0, 0, 0, .3); transition: transform .45s var(--spring); }
[aria-pressed="true"] > .switch { background: linear-gradient(135deg, var(--c, #ffe58f), var(--c2, #ffb347)); }
[aria-pressed="true"] > .switch i { transform: translateX(19px); }
.time { flex: none; padding: 8px 10px; border-radius: 13px; background: rgba(255, 255, 255, .12); border: 1px solid var(--line); color: #fff; font: 800 16px/1.2 var(--display); color-scheme: dark; }

.row-ico { background: color-mix(in srgb, var(--c) 20%, transparent); color: var(--c); transition: background .35s, color .35s; }
.row-pts { flex: none; font: 900 14.5px/1 var(--display); color: var(--c); }
.row[aria-pressed="true"] { background: color-mix(in srgb, var(--c) 14%, transparent); border-color: color-mix(in srgb, var(--c) 52%, transparent); }
.row[aria-pressed="true"] .row-ico { background: linear-gradient(135deg, var(--c), var(--c2)); color: #1d0f4f; --icon-cut: var(--c); }
.row.locked { opacity: .4; }

/* ---------- tab bar ---------- */

.tabbar {
  position: absolute; z-index: 6; left: 50%; bottom: calc(var(--safe-b) + 12px); transform: translateX(-50%);
  display: grid; grid-template-columns: repeat(3, 1fr); width: min(calc(100% - 32px), 360px); height: var(--tab-h); padding: 6px; border-radius: 26px;
  background: rgba(20, 12, 62, .74); border: 1px solid rgba(255, 255, 255, .15);
  -webkit-backdrop-filter: blur(22px) saturate(160%); backdrop-filter: blur(22px) saturate(160%);
  box-shadow: 0 22px 44px -14px rgba(0, 0, 0, .8), inset 0 1px 0 rgba(255, 255, 255, .12);
}
.tab { position: relative; z-index: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; border-radius: 20px; color: var(--muted); font-size: 11.5px; font-weight: 800; transition: color .35s; }
.tab svg { width: 24px; height: 24px; transition: transform .5s var(--spring); }
.tab[aria-selected="true"] { color: var(--ink); }
.tab[aria-selected="true"] svg { transform: translateY(-1px) scale(1.1); }
.tab:active svg { transform: scale(.86); }
.tab-ind {
  position: absolute; z-index: 0; left: 6px; top: 6px; bottom: 6px; width: calc((100% - 12px) / 3); border-radius: 20px;
  background: linear-gradient(135deg, #fff0a0, #ffc14d 55%, #ff8a5b); box-shadow: 0 10px 22px -8px rgba(255, 160, 70, .9), inset 0 1px 0 rgba(255, 255, 255, .7);
  transform: translateX(calc(var(--tab, 0) * 100%)); transition: transform .55s var(--spring-soft);
}

/* ---------- overlays ---------- */

#fx { position: absolute; inset: 0; z-index: 50; width: 100%; height: 100%; pointer-events: none; }

.fly { position: absolute; z-index: 51; left: 0; top: 0; padding: 7px 13px; border-radius: 999px; font: 900 18px/1 var(--display); color: var(--ink); background: linear-gradient(135deg, #fff0a0, #ffb347); box-shadow: 0 10px 22px -6px rgba(255, 170, 70, .95); pointer-events: none; white-space: nowrap; }

.toasts { position: absolute; z-index: 45; left: 0; right: 0; top: calc(var(--safe-t) + 10px); display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 0 14px; pointer-events: none; }
.toast { display: flex; align-items: center; gap: 10px; max-width: 100%; padding: 8px 18px 8px 8px; border-radius: 999px; background: rgba(255, 255, 255, .97); color: #22104e; font: 700 14px/1.25 var(--font); box-shadow: 0 18px 38px -12px rgba(0, 0, 0, .65); animation: toastin .55s var(--spring) both; }
.toast.plain { padding-left: 18px; }
.toast.out { animation: toastout .32s ease-in forwards; }
@keyframes toastin { from { opacity: 0; transform: translateY(-26px) scale(.8); } }
@keyframes toastout { to { opacity: 0; transform: translateY(-18px) scale(.9); } }
.toast-ico { flex: none; width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; background: linear-gradient(135deg, var(--c, #ffe58f), var(--c2, #ffb347)); color: var(--ink); --icon-cut: var(--c, #ffe58f); }
.toast-ico svg { width: 20px; height: 20px; }
.toast b { display: block; font: 800 14.5px/1.2 var(--display); }
.toast small { display: block; font-size: 12.5px; font-weight: 600; opacity: .75; }

.bubble { position: absolute; z-index: 7; max-width: 210px; padding: 9px 13px; border-radius: 16px; background: #fff; color: #22104e; font: 700 13px/1.3 var(--font); text-align: center; box-shadow: 0 14px 30px -10px rgba(0, 0, 0, .6); transform-origin: 50% 100%; animation: bubble .45s var(--spring) both; pointer-events: none; }
.bubble::after { content: ""; position: absolute; left: var(--tail, 50%); bottom: -6px; width: 14px; height: 14px; margin-left: -7px; background: #fff; border-radius: 3px; transform: rotate(45deg); }
.bubble.out { animation: toastout .3s ease-in forwards; }
@keyframes bubble { from { opacity: 0; transform: scale(.5) translateY(10px); } }

.backdrop { position: absolute; inset: 0; z-index: 20; background: rgba(5, 4, 22, .62); -webkit-backdrop-filter: blur(5px); backdrop-filter: blur(5px); opacity: 0; pointer-events: none; transition: opacity .35s ease; }
.backdrop.show { opacity: 1; pointer-events: auto; }
.sheet {
  position: absolute; z-index: 21; left: 0; right: 0; bottom: 0; max-height: 90%; overflow-y: auto; overscroll-behavior: contain;
  padding: 0 18px calc(20px + var(--safe-b)); border-radius: 34px 34px 0 0;
  background: linear-gradient(180deg, #2d1c7a, #170e4a 70%); border-top: 1px solid rgba(255, 255, 255, .22);
  box-shadow: 0 -30px 70px rgba(0, 0, 0, .55);
  transform: translateY(105%); visibility: hidden; transition: transform .55s var(--spring-soft), visibility 0s .55s;
}
.sheet.show { transform: translateY(var(--drag, 0px)); visibility: visible; transition: transform .55s var(--spring-soft); }
.sheet.dragging { transition: none; }
.sheet-grab { display: grid; place-items: center; height: 30px; margin: 0 -18px; touch-action: none; cursor: grab; }
.sheet-grab i { width: 44px; height: 5px; border-radius: 5px; background: rgba(255, 255, 255, .3); }
.sheet-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; margin: 2px 0 16px; }
.sheet-title { margin-top: 4px; font: 900 23px/1.15 var(--display); letter-spacing: -.01em; }
.sheet-title::first-letter { text-transform: uppercase; }
.sheet-text { margin: 0 0 18px; font-size: 15px; font-weight: 600; line-height: 1.5; color: var(--muted); }
.sheet-rows { display: flex; flex-direction: column; gap: 8px; margin-bottom: 16px; }
.sheet-actions { display: flex; flex-direction: column; gap: 10px; }

.btn-gold {
  position: relative; width: 100%; min-height: 56px; padding: 0 22px; border-radius: 20px; font: 800 17.5px/1 var(--display); color: var(--ink);
  background: linear-gradient(118deg, #fff0a0, #ffc552 45%, #ff8f5c); box-shadow: 0 16px 30px -12px rgba(255, 130, 90, .85), inset 0 1px 0 rgba(255, 255, 255, .7), inset 0 -3px 0 rgba(170, 50, 70, .2);
  transition: transform .18s var(--out);
}
.btn-gold:active { transform: scale(.96); }
.btn-hold {
  position: relative; isolation: isolate; overflow: hidden; width: 100%; min-height: 56px; border-radius: 20px; touch-action: none; -webkit-touch-callout: none;
  background: rgba(255, 94, 126, .16); border: 1.5px solid rgba(255, 94, 126, .65); color: #ffd3dc; font: 800 16.5px/1 var(--display);
}
.btn-hold i { position: absolute; inset: 0; z-index: -1; background: linear-gradient(90deg, #ff5e7e, #ff8f5c); transform: scaleX(0); transform-origin: 0 50%; transition: transform .25s ease-out; }
.btn-hold.holding { color: #fff; }
.btn-hold.holding i { transform: scaleX(1); transition: transform 1.3s linear; }

.rankup { position: absolute; inset: 0; z-index: 30; display: grid; place-items: center; padding: 28px; text-align: center; overflow: hidden; background: radial-gradient(circle at 50% 38%, rgba(74, 37, 150, .95), rgba(8, 5, 32, .97) 70%); opacity: 0; visibility: hidden; transition: opacity .45s ease, visibility 0s .45s; }
.rankup.show { opacity: 1; visibility: visible; transition: opacity .45s ease; }
.rankup-rays { position: absolute; left: 50%; top: 38%; width: 1100px; height: 1100px; margin: -550px 0 0 -550px; border-radius: 50%; background: repeating-conic-gradient(rgba(255, 215, 120, .2) 0 8deg, transparent 8deg 18deg); -webkit-mask: radial-gradient(circle, #000 0, transparent 62%); mask: radial-gradient(circle, #000 0, transparent 62%); animation: rot 26s linear infinite; }
.rankup-in { position: relative; display: flex; flex-direction: column; align-items: center; width: 100%; max-width: 340px; }
.rankup-eyebrow { padding: 6px 14px; border-radius: 999px; background: rgba(255, 255, 255, .14); font: 800 12.5px/1 var(--font); letter-spacing: .16em; text-transform: uppercase; opacity: 0; }
.rankup-medal { width: 176px; height: 176px; margin: 22px 0 18px; opacity: 0; filter: drop-shadow(0 24px 40px rgba(0, 0, 0, .55)) drop-shadow(0 0 50px rgba(255, 200, 100, .5)); }
.rankup-medal svg { width: 100%; height: 100%; }
.rankup-name { font: 900 34px/1.08 var(--display); letter-spacing: -.02em; background: linear-gradient(180deg, #fff, #ffe58f 60%, #ffb347); -webkit-background-clip: text; background-clip: text; color: transparent; opacity: 0; }
.rankup-line { margin: 10px 0 28px; font-size: 16px; font-weight: 600; line-height: 1.45; color: rgba(255, 255, 255, .86); opacity: 0; }
.rankup .btn-gold { opacity: 0; }
.rankup.show .rankup-eyebrow { animation: rise .6s .1s var(--out) both; }
.rankup.show .rankup-medal { animation: medalin 1.1s .2s var(--spring) both; }
@keyframes medalin { 0% { opacity: 0; transform: scale(0) rotate(-200deg); } 100% { opacity: 1; transform: scale(1) rotate(0); } }
.rankup.show .rankup-name { animation: rise .7s .65s var(--out) both; }
.rankup.show .rankup-line { animation: rise .7s .8s var(--out) both; }
.rankup.show .btn-gold { animation: rise .7s 1s var(--out) both; }

.intro { position: absolute; inset: 0; z-index: 60; display: grid; place-content: center; justify-items: center; gap: 10px; overflow: hidden; background: radial-gradient(130% 80% at 50% 100%, #5a2a92 0, #1a1250 46%, #050720 100%); transition: opacity .7s ease, visibility 0s .7s; }
.intro.gone { opacity: 0; visibility: hidden; pointer-events: none; }
.intro.quick { transition-duration: .3s, 0s; transition-delay: 0s, .3s; }
.intro-sun { position: absolute; left: 50%; bottom: -210px; width: 420px; height: 420px; margin-left: -210px; border-radius: 50%; background: radial-gradient(circle, #fffbe0 0, #ffd166 28%, #ff8f5c 54%, rgba(255, 94, 138, .35) 66%, transparent 74%); opacity: 0; }
.intro.play .intro-sun { animation: introsun 1.9s var(--out) both; }
@keyframes introsun { from { opacity: 0; transform: translateY(190px) scale(.7); } to { opacity: 1; transform: none; } }
.intro-word { position: relative; display: flex; font: 900 68px/1.15 var(--display); letter-spacing: -.035em; }
.intro-word span { display: inline-block; opacity: 0; background: linear-gradient(180deg, #fff 10%, #ffe58f 60%, #ffb347); -webkit-background-clip: text; background-clip: text; color: transparent; }
.intro.play .intro-word span { animation: letter .75s var(--spring) both; }
.intro-word span:nth-child(1) { animation-delay: .1s !important; } .intro-word span:nth-child(2) { animation-delay: .16s !important; }
.intro-word span:nth-child(3) { animation-delay: .22s !important; } .intro-word span:nth-child(4) { animation-delay: .28s !important; }
.intro-word span:nth-child(5) { animation-delay: .34s !important; } .intro-word span:nth-child(6) { animation-delay: .4s !important; }
.intro-word span:nth-child(7) { animation-delay: .46s !important; }
@keyframes letter { from { opacity: 0; transform: translateY(46px) rotate(12deg) scale(.6); } to { opacity: 1; transform: none; } }
.intro-tag { position: relative; font: 800 14px/1 var(--font); letter-spacing: .26em; text-transform: uppercase; color: rgba(255, 255, 255, .85); opacity: 0; }
.intro.play .intro-tag { animation: rise .7s .7s var(--out) both; }

/* ---------- larger screens: present as a phone ---------- */

@media (min-width: 560px) {
  body { display: grid; place-items: center; background: radial-gradient(90% 70% at 50% 100%, #2a1a6b 0, #0b0930 50%, #04041a 100%); }
  .app { width: 412px; height: min(880px, calc(100vh - 44px)); border-radius: 46px; box-shadow: 0 0 0 10px #100c34, 0 0 0 11px rgba(255, 255, 255, .1), 0 50px 120px rgba(0, 0, 0, .7); }
  :root { --hero-h: 440px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001ms !important; animation-delay: 0s !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; }
  .hero-body { transform: none; }
}
