/* Chirp: dawn chorus. Warm pastel paper, indigo ink, one sunrise yellow. The music staff is the
   centrepiece; everything around it stays quiet. */
:root {
  --sky: #F8EFEA;
  --paper: #FFFDF9;
  --ink: #1E2344;
  --ink-2: #4A4F70;
  --ink-3: #5E627E;
  --rule: #EBDDD6;
  --rule-strong: #D9C4BA;
  --yolk: #F5B83D;
  --yolk-soft: #FBE7B8;
  --on-yolk: #2A1F05;
  --leaf: #1F7F55;
  --leaf-ink: #1F7F55;
  --amber: #D98E2B;
  --amber-ink: #9A5A08;
  --miss: #A9A7C4;
  --berry: #B3304F;
  --gold: #E3B23C;
  --rail: #1E2344;
  --rail-ink: #C9CBE6;
  --focus: var(--ink);
  --ivory: #FFFDF6;
  --ebony: #1E2344;
  --k0: #E9544F; --k1: #F08A3C; --k2: #E9B73A; --k3: #5DBB63; --k4: #2FB3A6; --k5: #3E8EDE; --k6: #6A6BD8; --k7: #A15BD1; --k8: #E063A8; --k9: #EE7E86;
  --serif: "Young Serif", "Georgia", serif;
  --sans: "Schibsted Grotesk", system-ui, -apple-system, "Segoe UI", sans-serif;
  color-scheme: light;
}
/* The app keeps its light, pastel look whatever the system setting. Night colours belong to the
   journey's dark scenes only: every html.scene-dark rule in these stylesheets. */
html.scene-dark {
  color-scheme: dark;
  --sky: #14172E; --paper: #1C2042; --ink: #ECEBFA; --ink-2: #BDBEDC; --ink-3: #8D90B4;
  --rule: #2E3360; --rule-strong: #444A80; --yolk-soft: #4A3B16; --miss: #555A84;
  --rail: #0E1024; --ivory: #F3F0E6; --ebony: #0E1024;
  --leaf-ink: #5BC894; --amber-ink: #E7A24A; --berry: #E0607F; --focus: var(--yolk);
}
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--sky); color: var(--ink); }
body { font: 400 16px/1.55 var(--sans); -webkit-font-smoothing: antialiased; }
a { color: inherit; text-underline-offset: 3px; }
button, input, select { font: inherit; color: inherit; }
button { cursor: pointer; }
button:disabled { cursor: default; opacity: .45; }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; border-radius: 4px; }
/* On the indigo surfaces the sunrise yellow is the ring that shows. */
.rail, .tabbar, .plus-block { --focus: var(--yolk); }
[hidden] { display: none !important; }
h1, h2, h3 { font-family: var(--serif); font-weight: 400; margin: 0; text-wrap: balance; letter-spacing: -.005em; }
h1 { font-size: 40px; line-height: 1.1; }
h2 { font-size: 26px; line-height: 1.2; }
h3 { font-size: 19px; line-height: 1.25; }
p { margin: 0; max-width: 64ch; }
.muted { color: var(--ink-3); }
.small { font-size: 14px; }
.num { font-variant-numeric: tabular-nums; }
.figure { font-family: var(--serif); font-variant-numeric: tabular-nums; line-height: 1; }

/* ---------- shell ---------- */
.shell { display: grid; grid-template-columns: 232px 1fr; min-height: 100vh; transition: grid-template-columns .35s cubic-bezier(.3,.8,.3,1); }
.shell.folded { grid-template-columns: 76px 1fr; }
.rail { position: sticky; top: 0; height: 100vh; background: var(--rail); color: var(--rail-ink); padding: 22px 16px; display: flex; flex-direction: column; gap: 14px; overflow-y: auto; }
.wordmark { display: flex; align-items: center; gap: 10px; font-family: var(--serif); font-size: 30px; color: #fff; text-decoration: none; padding: 0 8px; }
.mark { width: 30px; height: 30px; background: url(/favicon.svg) center / contain no-repeat; }
.nav { display: flex; flex-direction: column; }
.nav a { text-decoration: none; padding: 7px 10px; border-radius: 10px; font-weight: 500; color: var(--rail-ink); display: flex; align-items: center; gap: 12px; white-space: nowrap; position: relative; transition: background .2s, color .2s; }
.nav .ic { width: 20px; height: 20px; flex: none; transition: transform .25s cubic-bezier(.3,1.6,.5,1); }
.nav a:hover .ic { transform: scale(1.18) rotate(-6deg); }
.nav a.on .ic { color: var(--yolk); animation: ic-pop .45s cubic-bezier(.3,1.8,.5,1); }
@keyframes ic-pop { 40% { transform: scale(1.35) rotate(-8deg); } }
.nav .lbl, .rail-plus .lbl, .wordmark { transition: opacity .2s; }
/* The sidebar's fold: labels fade, the icons stay on their rail, group titles become thin rules. */
.rail-head { display: flex; align-items: center; justify-content: space-between; gap: 6px; }
.rail-toggle { display: grid; place-items: center; width: 34px; height: 34px; flex: none; border: 0; border-radius: 10px; background: rgba(255,255,255,.06); color: var(--rail-ink); cursor: pointer; transition: background .2s, transform .2s; }
.rail-toggle:hover { background: rgba(255,255,255,.14); color: #fff; }
.rail-toggle .ic { width: 20px; height: 20px; }
.shell.folded .rail { padding-inline: 12px; }
.shell.folded .wordmark { font-size: 0; gap: 0; padding: 0 11px; }
.shell.folded .nav .lbl, .shell.folded .rail-plus .lbl, .shell.folded .rail-foot p { opacity: 0; width: 0; overflow: hidden; }
.shell.folded .nav a { gap: 0; padding: 10px 0; justify-content: center; }
.shell.folded .nav-group { font-size: 0; max-width: none; height: 1px; margin: 12px 10px; background: rgba(255,255,255,.12); }
.shell.folded .rail-plus { padding: 10px 14px; display: flex; }
.shell.folded .rail-head { flex-direction: column; gap: 14px; }
.rail-tip { position: fixed; z-index: 70; translate: 0 -50%; background: var(--ink); color: var(--paper); padding: 5px 10px; border-radius: 8px; font-size: 13px; font-weight: 600; white-space: nowrap; pointer-events: none; animation: tip .15s ease-out; box-shadow: 0 6px 16px rgba(0,0,0,.2); }
html.scene-dark .rail-tip { background: #fff; color: #1E2344; }
.rail-plus { display: flex; gap: 10px; align-items: flex-start; }
.rail-plus .plus-ic { width: 20px; height: 20px; flex: none; color: var(--yolk); margin-top: 2px; }
.nav a:hover { color: #fff; background: rgba(255,255,255,.06); }
.nav a.on { color: #fff; background: rgba(255,255,255,.1); box-shadow: inset 3px 0 0 var(--yolk); }
@keyframes tip { from { opacity: 0; translate: -4px -50%; } }
.nav-group { margin: 16px 10px 4px; font-size: 13px; color: #8A8DB5; }
.rail-foot { margin-top: auto; font-size: 14px; }
.rail-foot a { color: #fff; }
.rail-plus { display: block; border: 1px solid rgba(255,255,255,.18); border-radius: 12px; padding: 12px; text-decoration: none; color: var(--rail-ink); }
.rail-plus b { color: var(--yolk); font-weight: 700; }
.main { min-width: 0; display: flex; flex-direction: column; }
.top { display: flex; align-items: center; justify-content: flex-end; gap: 20px; padding: 18px 40px 0; }
.top .stat-link { text-decoration: none; display: flex; align-items: baseline; gap: 6px; font-size: 14px; color: var(--ink-3); }
.top .stat-link b { font-family: var(--serif); font-weight: 400; font-size: 18px; color: var(--ink); font-variant-numeric: tabular-nums; }
.top .who { text-decoration: none; white-space: nowrap; font-weight: 700; border: 1px solid var(--rule-strong); border-radius: 999px; padding: 6px 14px; font-size: 14px; }
.top .sfx-toggle { display: flex; align-items: center; gap: 6px; min-height: 36px; padding: 6px 10px; border: 0; border-radius: 999px; background: none; color: var(--ink-3); font: inherit; font-size: 14px; cursor: pointer; }
.top .sfx-toggle:hover { color: var(--ink); background: rgba(0,0,0,.05); }
.top .sfx-toggle svg { width: 20px; height: 20px; flex: none; }
.top .sfx-toggle[aria-pressed="false"] { color: var(--ink-3); opacity: .75; }
.top .who.cta { background: var(--ink); color: var(--paper); border-color: var(--ink); }
.view { width: 100%; max-width: 920px; padding: 20px 40px 56px; display: flex; flex-direction: column; gap: 32px; outline: none; }
.foot { display: flex; gap: 20px; padding: 24px 40px 40px; font-size: 14px; color: var(--ink-3); }
.tabbar, .mobile-mark { display: none; }
@media (max-width: 860px) {
  .shell { grid-template-columns: 1fr; }
  .rail { display: none; }
  .top { justify-content: space-between; padding: 12px 16px; position: sticky; top: env(safe-area-inset-top, 0px); background: var(--sky); z-index: 5; }
  .top .opt { display: none; }
  .top .sfx-toggle { margin-left: auto; min-width: 44px; min-height: 44px; justify-content: center; }
  .top { gap: 8px; }
  .top .who { padding: 6px 12px; }
  .mobile-mark { display: flex; font-family: var(--serif); font-size: 24px; color: var(--ink); text-decoration: none; align-items: center; gap: 8px; }
  .view { padding: 8px 16px 24px; gap: 26px; }
  h1 { font-size: 32px; }
  .foot { padding: 16px 16px 100px; }
  .tabbar { display: flex; position: fixed; left: 0; right: 0; bottom: 0; background: var(--rail); padding: 6px 6px calc(6px + env(safe-area-inset-bottom, 0px)); z-index: 10; }
  .tabbar a { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; min-height: 52px; text-align: center; text-decoration: none; font-weight: 600; font-size: 11.5px; padding: 6px 2px; border-radius: 12px; color: var(--rail-ink); }
  .tabbar .ic { width: 22px; height: 22px; transition: transform .25s cubic-bezier(.3,1.6,.5,1); }
  .tabbar a.on { color: #fff; background: rgba(255,255,255,.08); }
  .tabbar a.on .ic { color: var(--yolk); animation: ic-pop .45s cubic-bezier(.3,1.8,.5,1); }
  .tabbar a:active .ic { transform: scale(.85); }
  .desk-only { display: none !important; }
}
@media (min-width: 561px) { .phone-only { display: none !important; } }

/* ---------- controls ---------- */
.btn { border: 1px solid transparent; border-radius: 10px; padding: 10px 18px; font-weight: 700; background: var(--ink); color: var(--paper); text-decoration: none; display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 44px; }
.btn:hover:not(:disabled) { filter: brightness(1.12); }
.btn.sun { background: var(--yolk); color: var(--on-yolk); }
.btn.quiet { background: transparent; color: var(--ink); border-color: var(--rule-strong); }
.btn.quiet:hover:not(:disabled) { background: var(--paper); filter: none; }
.btn.go { background: var(--leaf); color: #fff; }
.btn.big { font-size: 18px; padding: 14px 26px; min-height: 54px; border-radius: 12px; }
.btn svg { width: 20px; height: 20px; flex: none; }
.link { background: none; border: 0; padding: 0; font-weight: 700; text-decoration: underline; text-underline-offset: 3px; }
/* Result screen: the next step and the encore up front, the rest as a quiet line of links. */
@media (max-width: 860px) {
  .next-row { position: sticky; bottom: calc(60px + env(safe-area-inset-bottom, 0px)); z-index: 5; padding: 14px 0 10px; margin-bottom: -10px;
    background: linear-gradient(to top, var(--sky) 75%, transparent); }
  .next-row #next { flex: 1; }
}
.more-row { display: flex; flex-wrap: wrap; gap: 6px 20px; margin-top: -12px; }
.more-row .link { font-size: 14px; font-weight: 600; color: var(--ink-2); min-height: 32px; }
.row { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
.row.split { justify-content: space-between; }
.stack { display: flex; flex-direction: column; gap: 14px; }
.lede { font-size: 18px; color: var(--ink-2); max-width: 56ch; }
.error { color: var(--berry); font-weight: 600; }
.panel { background: var(--paper); border-radius: 16px; padding: 24px; display: flex; flex-direction: column; gap: 14px; }
.notice { border-left: 3px solid var(--yolk); padding: 4px 0 4px 14px; display: flex; gap: 14px; align-items: center; justify-content: space-between; flex-wrap: wrap; }
.tag { font-size: 13px; font-weight: 600; color: var(--ink-2); }
.tag.plus { color: #6A4FD8; }
.tag.gold { color: #7A5600; }
html.scene-dark .tag.plus { color: #A898FF; } html.scene-dark .tag.gold { color: var(--gold); }
.meter { height: 6px; border-radius: 3px; background: var(--rule); overflow: hidden; }
.meter i { display: block; height: 100%; background: var(--yolk); }
.field { display: flex; flex-direction: column; gap: 6px; font-size: 14px; font-weight: 600; }
.field input, .field select, .search { padding: 11px 13px; border-radius: 10px; border: 1px solid var(--rule-strong); background: var(--paper); font-weight: 400; font-size: 16px; }
input[type=range] { accent-color: var(--ink); width: 100%; }
.seg { display: flex; gap: 4px; flex-wrap: wrap; border-bottom: 1px solid var(--rule); }
.seg button { border: 0; background: none; padding: 10px 12px; font-weight: 600; color: var(--ink-3); border-bottom: 2px solid transparent; margin-bottom: -1px; }
.seg button[aria-pressed="true"] { color: var(--ink); border-bottom-color: var(--yolk); }

/* ---------- lists & tables ---------- */
.ruled { display: flex; flex-direction: column; }
.ruled > * { border-top: 1px solid var(--rule); }
.ruled > *:last-child { border-bottom: 1px solid var(--rule); }
.entry { display: grid; grid-template-columns: 1fr auto; gap: 4px 24px; align-items: center; padding: 18px 0; text-decoration: none; }
.entry h3 { font-size: 20px; }
.entry p { color: var(--ink-3); font-size: 15px; }
a.entry:hover h3, button.entry:hover h3 { text-decoration: underline; text-underline-offset: 4px; }
button.entry { background: none; border-left: 0; border-right: 0; border-bottom: 0; text-align: left; width: 100%; }
.entry .aside { grid-row: 1 / span 2; grid-column: 2; text-align: right; }
.numbers { display: grid; grid-template-columns: repeat(3, 1fr); border-top: 1px solid var(--rule); border-bottom: 1px solid var(--rule); }
.numbers > a, .numbers > div { padding: 18px 20px 18px 0; text-decoration: none; display: flex; flex-direction: column; gap: 4px; }
.numbers > :is(a, div) + :is(a, div) { border-left: 1px solid var(--rule); padding-left: 24px; }
.numbers .figure { font-size: 44px; }
.numbers span { color: var(--ink-3); font-size: 14px; }
.numbers a:hover .figure { text-decoration: underline; text-decoration-thickness: 2px; text-underline-offset: 6px; }

.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-variant-numeric: tabular-nums; }
th, td { text-align: left; padding: 11px 12px 11px 0; border-bottom: 1px solid var(--rule); }
th { font-size: 13px; font-weight: 600; color: var(--ink-3); }
td a { font-weight: 700; text-decoration: none; }
td a:hover { text-decoration: underline; }
tr.me td { background: var(--yolk-soft); }
td.rank { width: 40px; color: var(--ink-3); }
.cols { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 32px; }
.empty { color: var(--ink-3); padding: 12px 0; }
.empty-sky { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 6px; padding: 28px 16px; border-radius: 18px; background: linear-gradient(to bottom, color-mix(in srgb, #8FC9F2 22%, var(--paper)), var(--paper)); }
.empty-fly { animation: hover-fly 2.6s ease-in-out infinite; }
.empty-fly .bird.flyer { width: 110px; height: 82px; }
@keyframes hover-fly { 50% { translate: 0 -10px; rotate: -4deg; } }
@media (prefers-reduced-motion: reduce) { .empty-fly { animation: none; } }

/* ---------- bird ---------- */
.bird { width: 84px; height: 82px; flex: none; transform-origin: 50% 90%; overflow: visible; }
.bird .body { fill: var(--bird, #FF7A59); transition: fill .6s; }
.bird .belly { fill: var(--belly, #FFD9C8); }
.bird.shadow .body { fill: var(--miss); }
.bird.shadow { opacity: .75; }
/* Three perfect songs in a row: the bird glows until a miss. */
.bird.hot { filter: drop-shadow(0 0 6px #FF8A3C) drop-shadow(0 0 2px #FFC04A); animation: warm 1.2s ease-in-out infinite alternate; }
@keyframes warm { to { filter: drop-shadow(0 0 11px #FF8A3C) drop-shadow(0 0 3px #FFC04A); } }
.bird .q { opacity: 0; }
.bird.mystery { --bird: var(--miss); }
.bird.mystery .q { opacity: 1; }
.bird.golden { filter: drop-shadow(0 0 7px var(--gold)); }
.bird.sing { animation: bob .32s ease-in-out infinite alternate; }
.bird .beak-open { opacity: 0; }
.bird.sing .beak-open { opacity: 1; }
.bird.sing .beak-shut { opacity: 0; }
/* Singing: the mic button pulses while it listens, and the key being sung glows. */
.btn.mic svg { width: 18px; height: 18px; }
.btn.quiet.mic[aria-pressed="true"] { background: var(--berry); color: #fff; border-color: var(--berry); animation: mic-pulse 1.2s ease-in-out infinite; }
@keyframes mic-pulse { 50% { box-shadow: 0 0 0 8px color-mix(in srgb, var(--berry) 20%, transparent); } }
.key.hum { box-shadow: inset 0 -14px 0 var(--c), 0 0 0 3px var(--yolk); z-index: 3; }
.key.black.hum { box-shadow: 0 0 0 3px var(--yolk); }
@media (prefers-reduced-motion: reduce) { .btn.mic[aria-pressed="true"] { animation: none; } }
/* During the encore the bird sways to the beat as well as singing. */
.bird.dance { animation: bob .32s ease-in-out infinite alternate, sway 1.1s ease-in-out infinite; transform-origin: 50% 90%; }
@keyframes sway { 0%, 100% { rotate: -6deg; } 50% { rotate: 6deg; } }
@keyframes bob { from { transform: rotate(-4deg); } to { transform: rotate(4deg) translateY(-3px); } }

/* ---------- the staff ---------- */
.stave { background: var(--paper); border-radius: 18px; padding: 20px 20px 12px; display: flex; flex-direction: column; gap: 6px; position: relative; overflow: hidden; }
/* Each habitat tints the play area and puts its scenery along the bottom. */
.stave.habitat { background: linear-gradient(to bottom, color-mix(in srgb, #8FC9F2 26%, var(--paper)), var(--paper) 48%, color-mix(in srgb, var(--hab) 16%, var(--paper))); }
html.scene-dark .stave.habitat { background: linear-gradient(to bottom, color-mix(in srgb, #3A4390 40%, var(--paper)), var(--paper) 50%, color-mix(in srgb, var(--hab) 16%, var(--paper))); }
.stave > :not(.scene):not(.sky-layer) { position: relative; }
.stave .scene { position: absolute; left: 0; right: 0; bottom: 0; width: 100%; height: 84px; opacity: .2; pointer-events: none; }
/* Solid shapes, faded as one layer, so overlapping scenery doesn't show seams. */
.stave .scene .g2 { fill-opacity: 1; }
.stave-head { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; align-items: baseline; }
.stave-head .say { font-family: var(--serif); font-size: 21px; }
.stave-head .sub { color: var(--ink-3); font-size: 14px; }
.staff { width: 100%; height: auto; display: block; overflow: visible; }
.staff .line { stroke: var(--rule-strong); stroke-width: 1.2; }
/* The treble clef: the glyph's baseline sits on the G line it curls around. */
.staff .clef { font: 56px "Noto Music", "Segoe UI Symbol", "Apple Symbols", serif; fill: var(--ink-2); }
.staff .ledger { stroke: var(--ink-3); stroke-width: 1.4; }
.staff .col { fill: transparent; cursor: pointer; }
.staff .col.cursor { fill: var(--yolk); fill-opacity: .2; stroke: var(--yolk); stroke-width: 1.5; }
.staff .head { fill: var(--ink); }
.staff .head.exact { fill: var(--leaf); }
.staff .head.part { fill: var(--amber); }
.staff .head.miss { fill: var(--miss); }
.staff .ghost { fill: none; stroke: var(--ink); stroke-width: 1.6; stroke-dasharray: 3 2; }
.staff .slot { fill: none; stroke: var(--rule-strong); stroke-width: 1.4; stroke-dasharray: 3 3; }
.staff .dur { fill: var(--rule-strong); }
.staff .acc { font: 600 17px var(--sans); fill: var(--ink); }
.staff .lbl { font: 600 13px var(--sans); fill: var(--ink-3); text-anchor: middle; }
.staff .lbl.exact { fill: var(--leaf-ink); } .staff .lbl.part { fill: var(--amber-ink); } .staff .lbl.miss { fill: var(--ink-3); }
.staff .ping { transform-box: fill-box; transform-origin: center; animation: ping .35s ease-out; }
@keyframes ping { 50% { transform: scale(1.5); } }
.perch { display: flex; align-items: flex-end; gap: 4px; }
.perch > div { flex: 1; min-width: 0; }
@media (max-width: 560px) {
  .perch .bird { width: 46px; height: 44px; margin-right: -8px; }
  .stave { padding: 16px 10px 10px; }
  .stave-head .say { font-size: 19px; }
  .slots { gap: 3px; }
  .stave .slots button { min-width: 27px; padding: 3px 2px; font-size: 13px; }
  .kbd .key { min-width: 0; padding-bottom: 12px; }
  .kbd .key .n { font-size: 12px; }
  .kbd .whites { height: clamp(150px, 26vh, 220px); gap: 2px; }
  .tools .go { order: -1; flex-basis: 100%; min-height: 50px; font-size: 17px; }
  .tools .spacer { display: none; }
  .tools .quiet { flex: 1; padding-inline: 6px; min-height: 42px; font-size: 15px; white-space: nowrap; }
  .numbers { grid-template-columns: repeat(3, 1fr); }
  .numbers > :is(a, div) + :is(a, div) { padding-left: 12px; }
  .numbers > a, .numbers > div { padding-right: 8px; }
  .numbers .figure { font-size: 30px; }
  .numbers span { font-size: 12px; }
  .entry { grid-template-columns: 1fr; }
  .entry .aside { grid-row: auto; grid-column: 1; text-align: left; }
  .hero .row .btn { flex: 1 1 100%; }
  .context { gap: 2px 14px; }
}
.slots { display: flex; justify-content: center; gap: 4px; flex-wrap: wrap; }
.slots button { border: 1px solid var(--rule); background: none; border-radius: 8px; min-width: 38px; padding: 4px 8px; font-weight: 600; font-size: 14px; color: var(--ink-2); }
.slots button.cursor { border-color: var(--yolk); background: var(--yolk-soft); color: var(--ink); }

/* ---------- round ---------- */
.round { display: flex; flex-direction: column; gap: 18px; }
.context { display: flex; gap: 18px; flex-wrap: wrap; align-items: baseline; color: var(--ink-3); font-size: 14px; }
.context b { color: var(--ink); font-weight: 700; }
.back-btn { display: inline-flex; align-items: center; gap: 2px; min-height: 36px; padding: 4px 12px 4px 6px; border-radius: 999px; border: 1px solid var(--rule-strong); background: var(--paper); color: var(--ink); font-weight: 700; font-size: 14px; }
.back-btn svg { width: 18px; height: 18px; }
.back-btn:hover { border-color: var(--ink-3); }
.clock { height: 4px; border-radius: 2px; background: var(--rule); overflow: hidden; }
.clock i { display: block; height: 100%; background: var(--ink); transition: width .2s linear; }
.clock.low i { background: var(--berry); }
.listen-row { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
.listen-row .count { color: var(--ink-3); font-size: 14px; }
/* On a phone the whole round (staff, listen, keys, submit) fits one screen between the top bar and
   the tab bar, so nothing needs scrolling mid-song. */
@media (max-width: 560px) {
  .round { gap: 10px; }
  .round .stave { padding: 12px 10px 8px; gap: 2px; }
  .round .stave-head .say { font-size: 17px; }
  .round .stave-head .sub { font-size: 13px; line-height: 1.35; }
  .listen-row { flex-wrap: nowrap; gap: 8px; }
  .listen-row .btn.big { flex: 1; min-height: 48px; padding: 10px 14px; font-size: 17px; }
  .listen-row .btn.quiet { min-height: 48px; padding: 8px 12px; white-space: nowrap; }
  .listen-row .btn { white-space: nowrap; }
  .listen-row .count { font-size: 12px; line-height: 1.2; max-width: 64px; }
  .round .kbd .whites { height: clamp(130px, 25vh, 220px); }
  .round .tools { gap: 6px; }
}
@media (max-width: 560px) and (max-height: 720px) {
  .round .stave-head .sub { display: none; }
  .round .kbd .whites { height: clamp(108px, 17vh, 150px); }
}
.tools { display: flex; gap: 8px; flex-wrap: wrap; }
.tools .spacer { flex: 1; }
.tools .go:not(.ready) { opacity: .45; }
.tools .go.ready { box-shadow: 0 4px 0 color-mix(in srgb, var(--leaf) 60%, #000); animation: pop .45s cubic-bezier(.3,1.8,.5,1); }
.kbd { user-select: none; -webkit-user-select: none; touch-action: manipulation; overflow-x: auto; padding-bottom: 6px; }
.kbd-inner { position: relative; }
.whites { display: flex; height: 168px; gap: 3px; }
.key { flex: 1 1 0; min-width: 30px; border: 1px solid var(--rule-strong); border-top: 0; border-radius: 0 0 9px 9px; background: var(--ivory); color: #1E2344; display: flex; flex-direction: column; justify-content: flex-end; align-items: center; padding: 0 0 16px; box-shadow: inset 0 -8px 0 var(--c); position: relative; }
.key .n { font-weight: 700; font-size: 14px; line-height: 1; }
.key .k { font-size: 11px; color: #5E627E; margin-top: 2px; text-transform: lowercase; }
.key.black { position: absolute; top: 0; height: 60%; background: var(--ebony); color: #fff; border: 0; border-radius: 0 0 7px 7px; transform: translateX(-50%); z-index: 2; box-shadow: inset 0 -5px 0 rgba(255,255,255,.12); padding-bottom: 10px; min-width: 0; }
.key.black .k { color: #9DA1C8; }
.key.down { filter: brightness(.9); transform-origin: top; }
.key.black.down { transform: translateX(-50%) scaleY(.98); }
.keyhint { color: var(--ink-3); font-size: 13px; text-align: center; margin: 0 auto; }
html.scene-dark .key { border-color: transparent; }

/* ---------- results ---------- */
.verdict { display: grid; grid-template-columns: auto 1fr; gap: 28px; align-items: start; }
@media (max-width: 620px) { .verdict { grid-template-columns: 1fr; gap: 20px; } }
.bigfig { font-family: var(--serif); font-size: 76px; line-height: .95; font-variant-numeric: tabular-nums; }
.bigfig small { font-size: 26px; }
.delta { font-family: var(--serif); font-size: 28px; }
.delta.up { color: var(--leaf-ink); } .delta.down { color: var(--berry); }
.facts { display: flex; flex-direction: column; gap: 6px; color: var(--ink-2); }
.facts b { color: var(--ink); }
.legend { display: flex; gap: 16px; flex-wrap: wrap; font-size: 13px; color: var(--ink-3); }
.legend i { display: inline-block; width: 10px; height: 10px; border-radius: 50%; margin-right: 6px; vertical-align: -1px; }
.flash { position: fixed; inset: 0; display: grid; place-items: center; pointer-events: none; z-index: 20; font-family: var(--serif); font-size: 120px; animation: flash .8s ease-out forwards; }
@keyframes flash { from { opacity: 1; transform: scale(.85); } to { opacity: 0; transform: scale(1.15); } }
.rushbar { display: grid; grid-template-columns: repeat(3, 1fr); border-top: 1px solid var(--rule); border-bottom: 1px solid var(--rule); }
.rushbar > div { padding: 12px 0; } .rushbar > div + div { border-left: 1px solid var(--rule); padding-left: 18px; }
.rushbar .figure { font-size: 40px; }
.rushbar span { color: var(--ink-3); font-size: 14px; }

/* ---------- hero ---------- */
.hero { display: grid; grid-template-columns: 1fr; gap: 22px; }
.hero h1 { font-size: 56px; line-height: 1.04; }
@media (max-width: 860px) { .hero h1 { font-size: 40px; } }
.hero .demo { background: var(--paper); border-radius: 18px; padding: 18px 20px 10px; }
/* Before the first song: the sound reminder sits between the example and the button. */
.sound-note { display: flex; align-items: flex-start; gap: 12px; padding: 12px 16px; border-radius: 14px; background: var(--yolk-soft); color: var(--ink); max-width: none; }
.sound-note svg { width: 22px; height: 22px; flex: none; margin-top: 1px; animation: sound-wave 1.6s ease-in-out infinite; transform-origin: 30% 50%; }
@keyframes sound-wave { 50% { transform: scale(1.14); } }
@media (prefers-reduced-motion: reduce) { .sound-note svg { animation: none; } }

/* ---------- birds, shop, season ---------- */
.plate { display: grid; grid-template-columns: 200px 1fr; gap: 24px; padding: 22px 0; border-top: 1px solid var(--rule); }
@media (max-width: 700px) { .plate { grid-template-columns: 1fr; gap: 12px; } }
.plate h3 { font-size: 22px; }
.plate .glyph { margin-bottom: 8px; }
/* Field guide: five cards per habitat; unmet birds are silhouettes. */
.cards { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 10px; }
@media (max-width: 1000px) and (min-width: 861px), (max-width: 620px) { .cards { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.card { background: var(--paper); border: 0; border-radius: 14px; padding: 12px 10px; display: flex; flex-direction: column; align-items: center; gap: 2px; text-align: center; box-shadow: inset 0 -4px 0 color-mix(in srgb, var(--c) 45%, transparent); }
.card .bird { width: 100%; max-width: 78px; height: 74px; }
.card b { font-size: 14px; line-height: 1.25; }
button.card:hover b { text-decoration: underline; }
.card.golden { box-shadow: inset 0 0 0 2px var(--gold); }
.card.unmet { background: transparent; border: 1.5px dashed var(--rule-strong); box-shadow: none; }
.card.unmet b { color: var(--ink-3); font-weight: 600; }
.wares { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 28px 20px; }
.ware { display: flex; flex-direction: column; gap: 8px; align-items: flex-start; }
.ware .preview { height: 64px; display: flex; align-items: flex-end; }
.ware .keys { display: flex; gap: 2px; height: 40px; width: 150px; align-items: flex-end; }
.ware .keys i { flex: 1; height: 100%; background: var(--ivory); border: 1px solid var(--rule-strong); border-top: 0; border-radius: 0 0 4px 4px; box-shadow: inset 0 -6px 0 var(--c); }
.ware.on .name::after { content: " (in use)"; color: var(--ink-3); font-weight: 400; }
.ware .name { font-weight: 700; }
.plus-block { background: var(--rail); color: var(--rail-ink); border-radius: 18px; padding: 28px; display: grid; grid-template-columns: 1.3fr 1fr; gap: 28px; }
.plus-block h2 { color: #fff; }
.plus-block ul { margin: 0; padding-left: 18px; display: flex; flex-direction: column; gap: 4px; }
.plus-block .btn.quiet { color: #fff; border-color: rgba(255,255,255,.3); }
.plus-block .btn.quiet:hover { background: rgba(255,255,255,.08); }
@media (max-width: 700px) { .plus-block { grid-template-columns: 1fr; padding: 22px; } }
.price { font-family: var(--serif); font-size: 34px; color: #fff; }
/* Season: a battle-pass timeline. Free rewards above the XP rail, pass rewards below, the player's
   bird standing on the rail where their XP puts them. */
.sp-hud { display: grid; grid-template-columns: auto 1fr; gap: 22px; align-items: center; background: var(--paper); border-radius: 18px; padding: 18px 22px; box-shadow: inset 4px 0 0 var(--yolk); }
.sp-tier { width: 92px; height: 92px; border-radius: 50%; display: grid; place-content: center; text-align: center; background: var(--yolk); color: var(--on-yolk); box-shadow: 0 0 0 5px var(--yolk-soft); line-height: 1.1; }
.sp-tier .figure { font-size: 40px; }
.sp-tier .muted { color: color-mix(in srgb, var(--on-yolk) 70%, transparent); font-size: 12px; }
.meter.big { height: 12px; border-radius: 6px; }
.meter.big i { border-radius: 6px; background: linear-gradient(90deg, var(--yolk), #F59A3D); }
.sp-actions { align-items: center; }
.st { display: inline-flex; align-items: center; gap: 5px; font-size: 13px; font-weight: 600; color: var(--ink-3); }
.st.ok { color: var(--leaf-ink); }
.st.pass { color: #6A4FD8; }
.st svg, .sp-lane svg, .sp-upsell svg { width: 14px; height: 14px; flex: none; }
.lock rect { fill: currentColor; }
@media (max-width: 560px) { .sp-hud { grid-template-columns: 1fr; justify-items: start; padding: 16px; } .sp-hud > .stack { width: 100%; } }

.sp-upsell { display: grid; grid-template-columns: auto 1fr auto; gap: 16px; align-items: center; border-radius: 18px; padding: 16px 20px; background: linear-gradient(120deg, #2C2170, #5A3FC8); color: #E6E1FF; --focus: var(--yolk); }
.sp-upsell b { color: #fff; font-size: 17px; }
.sp-upsell > div:first-child { width: 44px; height: 44px; border-radius: 50%; display: grid; place-items: center; background: rgba(255,255,255,.14); color: var(--yolk); }
.sp-upsell > div:first-child svg { width: 20px; height: 20px; }
@media (max-width: 620px) { .sp-upsell { grid-template-columns: auto 1fr; } .sp-upsell .btn { grid-column: 1 / -1; } }

.sp-scroll { overflow-x: auto; scrollbar-width: thin; }
.sp-grid { display: grid; grid-template-columns: 56px repeat(var(--n), 150px); grid-template-rows: auto 96px auto; gap: 0 10px; width: max-content; padding: 16px 12px 16px 0; }
/* The lane labels reach over the grid padding so badges and glows on cards scrolled under them stay hidden. */
.sp-lane.free { margin-top: -16px; } .sp-lane.pass { margin-bottom: -16px; }
.sp-lane { position: sticky; left: 0; z-index: 3; background: var(--sky); display: flex; align-items: center; gap: 4px; font: 700 12px var(--sans); color: var(--ink-3); text-transform: uppercase; letter-spacing: .05em; }
.sp-lane.pass { color: #6A4FD8; }
.sp-lane::after { content: ""; position: absolute; top: 0; bottom: 0; right: -10px; width: 10px; background: linear-gradient(90deg, var(--sky), transparent); }
.sp-rail { grid-column: 2 / -1; position: relative; }
.sp-rail::before, .sp-rail .fill { content: ""; position: absolute; left: 0; right: 0; top: 62px; height: 10px; margin-top: -5px; border-radius: 5px; background: var(--rule); }
.sp-rail .fill { right: auto; background: linear-gradient(90deg, var(--yolk), #F59A3D); box-shadow: 0 0 12px color-mix(in srgb, var(--yolk) 60%, transparent); }
.sp-node { position: absolute; top: 62px; transform: translate(-50%, -50%); z-index: 1; width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; font: 700 13px var(--sans); font-variant-numeric: tabular-nums; background: var(--paper); color: var(--ink-3); border: 2px solid var(--rule-strong); }
.sp-node.past { background: var(--yolk); border-color: var(--paper); color: var(--on-yolk); }
.sp-node.next { border: 2px dashed var(--yolk); color: var(--ink); }
.sp-you { position: absolute; top: 0; z-index: 2; transform: translateX(-50%); display: flex; flex-direction: column; align-items: center; pointer-events: none; }
.sp-you .bird { width: 40px; height: 38px; animation: sp-hop 1.8s ease-in-out infinite; }
.sp-you em { order: -1; font: 700 11px var(--sans); font-style: normal; white-space: nowrap; background: var(--ink); color: var(--paper); border-radius: 999px; padding: 2px 8px; margin-bottom: -2px; }
@keyframes sp-hop { 0%, 70%, 100% { transform: translateY(0); } 80% { transform: translateY(-6px); } }

.sp-card { position: relative; background: var(--paper); border-radius: 14px; padding: 12px; display: flex; flex-direction: column; gap: 6px; align-items: flex-start; min-height: 162px; border: 2px solid transparent; }
.sp-card.free { grid-row: 1; }
.sp-card.premium { grid-row: 3; background: color-mix(in srgb, #6A4FD8 9%, var(--paper)); border-color: color-mix(in srgb, #6A4FD8 35%, transparent); }
.sp-card .preview { height: 64px; display: flex; align-items: flex-end; gap: 6px; }
.sp-card .preview .figure { font-size: 34px; }
.sp-card .preview .bird { width: 62px; height: 60px; }
.sp-card .keys, .sp-reveal .keys { display: flex; gap: 2px; height: 40px; width: 122px; align-items: flex-end; }
.sp-card .keys i, .sp-reveal .keys i { flex: 1; height: 100%; background: var(--ivory); border: 1px solid var(--rule-strong); border-top: 0; border-radius: 0 0 4px 4px; box-shadow: inset 0 -6px 0 var(--c); }
.sp-card .nm { font-size: 14px; line-height: 1.3; }
.sp-card .nm .muted { font-size: 12px; display: block; }
.sp-card .btn { min-height: 34px; padding: 5px 16px; margin-top: auto; }
.sp-card .st { margin-top: auto; }
.coin { width: 26px; height: 26px; border-radius: 50%; background: radial-gradient(circle at 35% 35%, #FFE38A, var(--gold) 60%, #B98516); box-shadow: inset 0 0 0 2px rgba(0,0,0,.08); margin-bottom: 4px; }
.sp-card .badge { position: absolute; top: -9px; right: -9px; width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center; }
.sp-card .badge svg { width: 14px; height: 14px; }
.sp-card .badge.ok { background: var(--leaf); color: #fff; }
.sp-card .badge.lk { background: #6A4FD8; color: #fff; }
/* Ready: glowing so it asks to be tapped. */
.sp-card.ready { border-color: var(--yolk); box-shadow: 0 0 0 4px color-mix(in srgb, var(--yolk) 30%, transparent), 0 8px 22px color-mix(in srgb, var(--yolk) 35%, transparent); animation: sp-glow 1.6s ease-in-out infinite; }
@keyframes sp-glow { 50% { box-shadow: 0 0 0 7px color-mix(in srgb, var(--yolk) 18%, transparent), 0 8px 26px color-mix(in srgb, var(--yolk) 45%, transparent); } }
.sp-card.claimed .preview, .sp-card.claimed .nm { opacity: .55; }
.sp-card.ahead, .sp-card.locked { border-style: dashed; border-color: var(--rule-strong); background: transparent; }
.sp-card.ahead .preview, .sp-card.locked .preview { opacity: .45; filter: grayscale(.6); }
.sp-card.premium.locked { border-color: color-mix(in srgb, #6A4FD8 40%, transparent); background: color-mix(in srgb, #6A4FD8 4%, transparent); }
/* Reached but the pass isn't bought: shown in full colour so it's clear what's being left behind. */
.sp-card.missed { border-color: #6A4FD8; border-style: dashed; }
.sp-reveal { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 6px; margin-bottom: 14px; }
.sp-reveal p { max-width: 36ch; }
.sp-reveal .preview { height: 110px; display: flex; align-items: center; justify-content: center; animation: rise .5s cubic-bezier(.3,1.4,.5,1) both; }
.sp-reveal .preview .bird { width: 110px; height: 104px; }
@media (max-width: 560px) { .sp-grid { grid-template-columns: 40px repeat(var(--n), 132px); } .sp-lane { font-size: 10px; letter-spacing: 0; } .sp-card .keys { width: 104px; } }
html.scene-dark .st.pass, html.scene-dark .sp-lane.pass { color: #A898FF; } html.scene-dark .sp-card.missed { border-color: #A898FF; }
@media (prefers-reduced-motion: reduce) { .sp-card.ready, .sp-you .bird, .sp-reveal .preview { animation: none; } }
.ach { display: grid; grid-template-columns: 22px 1fr; gap: 10px; padding: 10px 0; }
.ach .dot { width: 14px; height: 14px; border-radius: 50%; margin-top: 5px; background: var(--gold); }
.ach.locked { color: var(--ink-3); }
.ach.locked .dot { background: transparent; border: 1.5px solid var(--rule-strong); }
.ach p { font-size: 14px; color: var(--ink-3); }
.chart { width: 100%; height: 170px; display: block; }
.ad-box { aspect-ratio: 16 / 9; border-radius: 12px; background: var(--sky); display: grid; place-items: center; text-align: center; padding: 16px; color: var(--ink-3); }

/* ---------- toasts & modal ---------- */
.toasts { position: fixed; right: 20px; bottom: 20px; display: flex; flex-direction: column; gap: 8px; z-index: 50; max-width: calc(100vw - 40px); }
@media (max-width: 860px) { .toasts { top: 76px; bottom: auto; left: 16px; right: 16px; } } /* clear of the Next button and the tab bar */
.toast { background: var(--ink); color: var(--paper); border-radius: 10px; padding: 11px 15px; font-weight: 600; font-size: 15px; }
.toast.gold { background: var(--yolk); color: var(--on-yolk); }
.modal { position: fixed; inset: 0; background: rgba(14, 16, 36, .5); display: grid; place-items: center; z-index: 40; padding: 16px; }
.modal .panel { width: min(460px, 100%); max-height: 90vh; overflow: auto; }
/* Celebration burst: feathers in the keyboard colours and notes, thrown out then drifting down. */
.fx { position: fixed; pointer-events: none; z-index: 30; animation: burst 1.5s cubic-bezier(.2,.7,.3,1) both; }
.fx.feather { width: 9px; height: 18px; margin: -9px 0 0 -4px; background: var(--c); border-radius: 100% 0 100% 0; }
.fx.note { font-size: 22px; line-height: 1; margin: -11px 0 0 -6px; color: var(--c); }
@keyframes burst {
  0% { transform: translate(0, 0) scale(.3) rotate(0); opacity: 1; }
  35% { transform: translate(var(--dx), var(--dy)) scale(1) rotate(calc(var(--r) * .4)); opacity: 1; }
  100% { transform: translate(calc(var(--dx) * 1.15), calc(var(--dy) + 150px)) scale(.9) rotate(var(--r)); opacity: 0; }
}
/* Result: notes appear one by one; the score pops on a win and shakes on a miss. */
.staff.reveal [data-col] { animation: reveal .36s cubic-bezier(.3,1.6,.5,1) both; animation-delay: var(--d, 0ms); transform-box: fill-box; transform-origin: center; }
@keyframes reveal { from { opacity: 0; transform: scale(.2); } }
.pop { animation: pop .45s cubic-bezier(.3,1.8,.5,1); }
@keyframes pop { 40% { transform: scale(1.18); } }
.shake { animation: shake .4s ease-in-out; }
@keyframes shake { 20%, 60% { transform: translateX(-6px); } 40%, 80% { transform: translateX(6px); } }
@media (prefers-reduced-motion: reduce) { .bird.sing, .bird.dance, .flash, .fx, .staff .ping, .staff.reveal [data-col], .pop, .shake { animation: none; } .fx, .flash { display: none; } }

/* ---------- stages: habitat glyphs, the route, the lesson path, the classic ladder ---------- */
.glyph { width: 48px; height: 32px; flex: none; overflow: visible; fill: var(--c); }
.glyph.big { width: 72px; height: 48px; }
.glyph .g2 { fill-opacity: .45; }
.glyph .gs { fill: none; stroke: var(--c); stroke-width: 2.2; stroke-linecap: round; }

.route-scroll { overflow-x: auto; scrollbar-width: thin; padding-bottom: 4px; }
.route { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(12, minmax(64px, 1fr)); }
.stop { position: relative; display: flex; flex-direction: column; align-items: center; gap: 4px; padding-top: 38px; text-align: center; }
.stop .glyph { position: absolute; top: 0; }
/* The track: one line through every node, yellow up to where the player is. */
.stop::before { content: ""; position: absolute; top: 49px; left: 0; right: 0; border-top: 2px dashed var(--rule-strong); }
.stop:first-child::before { left: 50%; } .stop:last-child::before { right: 50%; }
.stop.past::before, .stop.here::before { border-top: 3px solid var(--yolk); top: 48px; }
.stop.here::before { right: 50%; }
.stop.here:last-child::before { right: 50%; }
.stop .node { position: relative; width: 12px; height: 12px; margin: 5px 0 6px; border-radius: 50%; background: var(--sky); border: 2px solid var(--rule-strong); }
.stop.past .node { background: var(--yolk); border-color: var(--yolk); }
.stop:not(.past):not(.here) .glyph { opacity: .45; }
.stop.here .node { border: 0; background: none; }
.stop.here .node .bird { position: absolute; width: 46px; height: 44px; left: 50%; bottom: -8px; transform: translateX(-50%); }
.stop.here .glyph { display: none; }
.stop b { font-size: 13px; font-weight: 700; line-height: 1.2; padding: 0 2px; }
.stop:not(.past):not(.here) b { color: var(--ink-2); font-weight: 600; }
.stop .lv { font-size: 12px; color: var(--ink-3); font-variant-numeric: tabular-nums; }
@media (max-width: 860px) { .route-scroll { -webkit-mask-image: linear-gradient(90deg, transparent, #000 16px, #000 calc(100% - 16px), transparent); mask-image: linear-gradient(90deg, transparent, #000 16px, #000 calc(100% - 16px), transparent); } .route { padding: 0 12px; } }

.path { list-style: none; margin: 0; padding: 0; }
.step { display: grid; grid-template-columns: 44px 1fr; gap: 0 16px; position: relative; }
.step::before { content: ""; position: absolute; left: 21px; top: 0; bottom: 0; border-left: 2px solid var(--rule); }
.step:first-child::before { top: 30px; } .step:last-child::before { bottom: calc(100% - 30px); }
.step.passed::before { border-left-color: var(--leaf); }
.step .node { position: relative; z-index: 1; align-self: start; margin-top: 12px; width: 44px; height: 44px; border-radius: 50%; display: grid; place-items: center;
  font: 400 19px/1 var(--serif); font-variant-numeric: tabular-nums; background: var(--paper); color: var(--ink-2); border: 2px solid var(--rule-strong); }
.step.passed .node { background: var(--leaf); border-color: var(--leaf); color: #fff; }
.step.next .node { background: var(--yolk); border-color: var(--yolk); color: var(--on-yolk); }
.step.locked .node { border-style: dashed; color: var(--ink-3); background: transparent; }
.step .entry { border-top: 1px solid var(--rule); }
.step:first-child .entry { border-top: 0; }

.ladder { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; }
.ladder li { display: grid; grid-template-columns: 112px 1fr auto; gap: 16px; align-items: center; padding: 11px 0; border-top: 1px solid var(--rule); color: var(--ink-2); }
.ladder li:last-child { border-bottom: 1px solid var(--rule); }
.ladder .dots { display: flex; gap: 4px; align-items: center; }
.ladder .dots i { width: 10px; height: 10px; border-radius: 50%; border: 1.5px solid var(--rule-strong); }
.ladder .dots i.more { width: 14px; border-radius: 5px; border-style: dashed; }
.ladder li.heard .dots i, .ladder li.now .dots i { background: var(--ink-3); border-color: var(--ink-3); }
.ladder li.now { color: var(--ink); font-weight: 700; }
.ladder li.now .dots i { background: var(--yolk); border-color: var(--yolk); }
.ladder li.heard { color: var(--ink-3); }
.ladder li.heard .pts { text-decoration: line-through; }
@media (max-width: 560px) { .ladder li { grid-template-columns: 1fr auto; gap: 4px 12px; } .ladder .dots { grid-column: 1 / -1; } }

/* ---------- journey, bird reveal, daily card, stars ---------- */
.stars { display: inline-flex; gap: 3px; vertical-align: -2px; }
.stars i { width: 14px; height: 14px; background: var(--rule-strong); clip-path: polygon(50% 0, 61% 35%, 98% 35%, 68% 57%, 79% 91%, 50% 70%, 21% 91%, 32% 57%, 2% 35%, 39% 35%); }
.stars i.on { background: var(--gold); }
.stars.big i { width: 30px; height: 30px; }
.bigfig .stars.big i { width: 40px; height: 40px; }

.stop > a { display: flex; flex-direction: column; align-items: center; gap: 4px; text-decoration: none; color: inherit; }
.stop > a:hover b { text-decoration: underline; text-underline-offset: 3px; }
.stop .stars i { width: 11px; height: 11px; }
.stop.locked::before { border-top-style: dashed; }
.stop.locked .glyph { opacity: .35; }
.stop.locked b { color: var(--ink-3); font-weight: 600; }

.habs { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 14px; }
.hab { background: var(--paper); border-radius: 16px; padding: 16px; display: flex; flex-direction: column; gap: 6px; text-decoration: none; box-shadow: inset 0 -5px 0 color-mix(in srgb, var(--c) 55%, transparent); }
a.hab:hover b { text-decoration: underline; text-underline-offset: 3px; }
.hab b { font-family: var(--serif); font-weight: 400; font-size: 21px; }
.hab.locked { background: transparent; border: 1.5px dashed var(--rule-strong); box-shadow: none; }
.hab.locked .glyph { opacity: .35; }

.meet { display: flex; align-items: center; gap: 18px; background: var(--paper); border-radius: 18px; padding: 16px 22px; animation: rise .5s cubic-bezier(.3,1.4,.5,1) both; }
.meet .bird { width: 118px; height: 112px; }
.meet h2 { font-size: 28px; }
.meet.golden { box-shadow: inset 0 0 0 2px var(--gold), 0 0 24px color-mix(in srgb, var(--gold) 35%, transparent); }
.meet.away { background: transparent; border: 1.5px dashed var(--rule-strong); }
.meet.away h2 { color: var(--ink-2); }
@keyframes rise { from { opacity: 0; transform: translateY(14px) scale(.96); } }
/* A newly met bird flies in and lands on the card. */
.meet:not(.away) .bird { animation: land .9s cubic-bezier(.3,.9,.4,1.1) .15s both; }
@keyframes land { 0% { translate: 260px -140px; rotate: -18deg; scale: .6; } 70% { translate: -6px 4px; rotate: 4deg; scale: 1.04; } 100% { translate: 0 0; rotate: 0deg; scale: 1; } }
@media (prefers-reduced-motion: reduce) { .meet:not(.away) .bird { animation: none; } }
@media (max-width: 560px) { .meet { padding: 12px 14px; gap: 10px; } .meet .bird { width: 80px; height: 76px; } .meet h2 { font-size: 22px; } }

.hot-tag { color: #B8450F; font-weight: 700; }
.hot-tag::before { content: ""; display: inline-block; width: 9px; height: 12px; margin-right: 6px; vertical-align: -1px; background: linear-gradient(#FFC04A, #FF6A2C); border-radius: 50% 50% 50% 50% / 60% 60% 40% 40%; }
html.scene-dark .hot-tag { color: #FF9A5A; }

.how summary { cursor: pointer; font-size: 14px; color: var(--ink-3); font-weight: 600; }
.how p { font-size: 14px; color: var(--ink-3); margin-top: 6px; }

.today { display: grid; grid-template-columns: auto 1fr auto; gap: 18px; align-items: center; background: var(--paper); border-radius: 16px; padding: 16px 20px; text-decoration: none; box-shadow: inset 4px 0 0 var(--yolk); }
.today .figure { font-size: 44px; min-width: 44px; text-align: center; }
.today .figure::after { content: "day streak"; display: block; font: 600 11px var(--sans); color: var(--ink-3); margin-top: 4px; }
.today.done { box-shadow: inset 4px 0 0 var(--leaf); }
@media (max-width: 560px) { .today { grid-template-columns: auto 1fr; } .today .btn { grid-column: 1 / -1; } }

.fx.fly { animation: none; font-size: 22px; line-height: 1; margin: -11px 0 0 -6px; }
@media (prefers-reduced-motion: reduce) { .meet, .bird.hot { animation: none; } }

/* ---------- journey map ---------- */
.jtop { position: sticky; top: 0; z-index: 4; background: var(--sky); padding: 8px 0 12px; display: flex; flex-direction: column; gap: 2px; }
@media (max-width: 860px) { .jtop { top: 68px; } }
.jmap { display: flex; flex-direction: column; gap: 8px; }
.band { position: relative; border-radius: 22px; overflow: hidden; background: linear-gradient(to top, color-mix(in srgb, var(--c) 34%, var(--paper)), color-mix(in srgb, var(--c) 12%, var(--paper))); }
.band.dark { background: linear-gradient(to top, #2E2766, #100D2A); }
.band.dark .band-head { color: #fff; } .band.dark .band-head span { color: #C9CBE6; }
.band .scene { position: absolute; left: 0; right: 0; bottom: 0; width: 100%; height: 130px; opacity: .25; pointer-events: none; }
.band .scene .g2 { fill-opacity: 1; }
.band.far .scene { opacity: .12; }
.trail { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; }
/* The road: a wide soft band, the walked part lit in sunrise yellow, and dots down the middle. */
.trail path { fill: none; stroke-linecap: round; stroke-linejoin: round; vector-effect: non-scaling-stroke; }
.trail .road { stroke: color-mix(in srgb, var(--c) 30%, var(--paper)); stroke-width: 34; }
.trail .walked { stroke: var(--yolk); stroke-width: 14; filter: drop-shadow(0 0 6px color-mix(in srgb, var(--yolk) 70%, transparent)); }
.trail .dots { stroke: var(--paper); stroke-width: 5; stroke-dasharray: 1 16; opacity: .9; }
.band.dark .trail .road { stroke: rgba(255,255,255,.12); }
/* Soft clouds drifting behind day chapters. */
.band:not(.dark)::before { content: ""; position: absolute; inset: 0; pointer-events: none; background:
  radial-gradient(60px 22px at 14% 90px, rgba(255,255,255,.75), transparent 70%), radial-gradient(44px 16px at 20% 104px, rgba(255,255,255,.6), transparent 70%),
  radial-gradient(70px 24px at 82% 330px, rgba(255,255,255,.7), transparent 70%), radial-gradient(40px 15px at 88% 344px, rgba(255,255,255,.55), transparent 70%);
  background-size: 100% 520px; background-repeat: repeat-y; }
html.scene-dark .band:not(.dark)::before { opacity: .12; }
.prop { position: absolute; z-index: 0; transform: translate(-50%, -100%); pointer-events: none; }
.prop .glyph { width: calc(48px * var(--s)); height: calc(32px * var(--s)); }
.band.far .prop { filter: saturate(.5); }
@media (max-width: 560px) { .prop .glyph { width: calc(30px * var(--s)); height: calc(20px * var(--s)); } }
.band-head { position: absolute; left: 16px; right: 16px; bottom: 14px; display: flex; gap: 12px; align-items: center; z-index: 1; }
.band-head b { display: block; font: 400 20px/1.2 var(--serif); }
.band-head span { font-size: 13px; color: var(--ink-3); }
.flock { margin-left: auto; display: flex; }
.flock .bird { width: 34px; height: 32px; }
@media (max-width: 560px) { .flock { display: none; } .band-head b { font-size: 17px; } }
.node { position: absolute; z-index: 2; transform: translate(-50%, -50%); width: 56px; height: 56px; padding: 0; border-radius: 50%; border: 3px solid var(--c); background: var(--paper); color: var(--ink); display: grid; place-items: center; font: 400 20px var(--serif); }
.node .stars { position: absolute; bottom: -15px; left: 50%; transform: translateX(-50%); }
.node .stars i { width: 12px; height: 12px; }
.node { box-shadow: 0 5px 0 color-mix(in srgb, var(--c) 55%, #000); transition: transform .1s; }
.node.open:active { transform: translate(-50%, calc(-50% + 3px)); box-shadow: 0 2px 0 color-mix(in srgb, var(--c) 55%, #000); }
.node.passed { background: var(--c); color: #fff; }
.node.shut { border-style: dashed; opacity: .7; box-shadow: none; }
.node.mist { opacity: .3; filter: blur(1.5px); }
.node.challenge { border-radius: 16px; }
.node .tw { position: absolute; top: -9px; right: -9px; width: 24px; height: 24px; border-radius: 50%; background: var(--ink); color: var(--paper); font: 700 13px/24px var(--sans); font-style: normal; }
.node.gate { width: 76px; height: 42px; border-radius: 12px; font: 700 14px var(--sans); }
.node.gate.passed .lock { color: #fff; }
.node.duel { width: 86px; height: 86px; }
.node.duel .bird { width: 66px; height: 62px; }
.node.here { width: 66px; height: 66px; background: var(--yolk); border-color: var(--paper); color: var(--on-yolk); box-shadow: 0 5px 0 #B98516, 0 0 0 7px color-mix(in srgb, var(--yolk) 45%, transparent); animation: here-pulse 1.6s ease-in-out infinite; }
@keyframes here-pulse { 50% { box-shadow: 0 5px 0 #B98516, 0 0 0 14px color-mix(in srgb, var(--yolk) 10%, transparent); } }
.nextcard { position: absolute; z-index: 4; transform: translateY(-78%); width: min(200px, 40%); background: var(--paper); border-radius: 14px; padding: 12px 14px; display: flex; flex-direction: column; gap: 4px; align-items: flex-start; box-shadow: 0 10px 28px rgba(30,35,68,.18), inset 0 -4px 0 var(--c); animation: rise .5s cubic-bezier(.3,1.4,.5,1) both; }
.nextcard::before { content: ""; position: absolute; top: 78%; width: 14px; height: 14px; background: var(--paper); transform: translateY(-50%) rotate(45deg); }
.nextcard.r::before { left: -6px; } .nextcard.l::before { right: -6px; }
.nextcard .eyebrow { font: 700 11px var(--sans); text-transform: uppercase; letter-spacing: .06em; color: var(--ink-3); }
.nextcard b { font: 400 17px/1.2 var(--serif); }
.nextcard .btn { min-height: 36px; padding: 6px 18px; margin-top: 4px; }
@media (max-width: 560px) { .nextcard { width: 42%; padding: 10px; } .nextcard b { font-size: 15px; } }
.jhud { display: flex; gap: 14px; align-items: center; background: var(--paper); border-radius: 14px; padding: 10px 14px; margin-top: 8px; box-shadow: inset 0 -4px 0 color-mix(in srgb, var(--c) 55%, transparent); }
.jbar { height: 8px; } .jbar i { background: var(--c); }
.jtotal { display: inline-flex; align-items: center; gap: 4px; font-size: 18px; } .jtotal .stars i { width: 18px; height: 18px; }
@media (max-width: 560px) { .jhud .glyph { display: none; } }
.node .gift { position: absolute; top: -12px; left: -8px; width: 22px; height: 20px; border-radius: 5px; background: var(--berry); box-shadow: inset 0 -7px 0 rgba(0,0,0,.18); }
.node .gift::after { content: ""; position: absolute; left: 9px; top: -3px; width: 4px; height: 23px; background: var(--yolk); }
.pip { position: absolute; z-index: 3; transform: translateX(-50%); display: flex; align-items: flex-end; pointer-events: none; animation: hop 1.8s ease-in-out infinite; }
.pip .bird { width: 54px; height: 52px; }
.pip .bird + .bird { width: 36px; height: 34px; margin-left: -8px; }
@keyframes hop { 50% { transform: translate(-50%, -6px); } }
.pip.in-flight { animation: none; z-index: 6; }
.pip.in-flight .bird.flyer { width: 72px; height: 54px; }
.nextcard { transition: opacity .3s; } .nextcard.wait { opacity: 0; }
.band.reveal .scene, .band.reveal .flock .bird { animation: rise .9s cubic-bezier(.3,1.4,.5,1) both; }
.band.reveal .flock .bird:nth-child(2) { animation-delay: .1s; } .band.reveal .flock .bird:nth-child(3) { animation-delay: .2s; }
.band.reveal .flock .bird:nth-child(4) { animation-delay: .3s; } .band.reveal .flock .bird:nth-child(5) { animation-delay: .4s; }
.sky { position: absolute; inset: 0; pointer-events: none; }
.sky i { position: absolute; width: 3px; height: 3px; border-radius: 50%; background: #fff; opacity: .12; transition: opacity 1s; }
.sky i.lit { opacity: .9; box-shadow: 0 0 6px #fff; }
.bubble { display: flex; gap: 14px; align-items: flex-start; }
.bubble .bird { width: 76px; height: 72px; }
.bubble b { font: 400 20px var(--serif); }
.bubble p { margin-top: 4px; font-size: 17px; }
@media (prefers-reduced-motion: reduce) { .node.here, .nextcard { animation: none; } }
@media (prefers-reduced-motion: reduce) { .pip, .band.reveal .scene, .band.reveal .flock .bird { animation: none; } }

.jcard { display: grid; grid-template-columns: auto 1fr auto; gap: 18px; align-items: center; padding: 18px 20px; border-radius: 18px; text-decoration: none; background: linear-gradient(to right, color-mix(in srgb, var(--c) 18%, var(--paper)), var(--paper)); box-shadow: inset 0 -5px 0 color-mix(in srgb, var(--c) 55%, transparent); }
.jcard .jc-text { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.jcard .jc-text b { font: 400 22px/1.2 var(--serif); }
.jc-strip { display: flex; gap: 6px; margin-top: 4px; }
.jc-strip i { width: 14px; height: 14px; border-radius: 50%; border: 2px solid var(--c); background: var(--paper); }
.jc-strip i.got { background: var(--c); }
.jc-strip i.gate { width: 20px; border-radius: 4px; }
.jc-strip i.duel { width: 18px; height: 18px; }
.jc-strip i.challenge { border-radius: 4px; }
.jc-side { display: flex; flex-direction: column; align-items: flex-end; gap: 4px; }
.jc-side .figure { font-size: 36px; }
@media (max-width: 560px) { .jcard { grid-template-columns: auto 1fr; } .jc-side { grid-column: 1 / -1; flex-direction: row; align-items: center; } .jc-side .btn { margin-left: auto; } }

/* ---------- flight: flapping birds, the living sky, the swoop between screens ---------- */
.bird.flyer { width: 72px; height: 54px; }
.flyer .wing { transform-box: fill-box; transform-origin: 90% 100%; }
.flyer.flapping .wing.near { animation: flap .32s ease-in-out infinite; }
.flyer.flapping .wing.far { animation: flap .32s ease-in-out infinite; animation-delay: -.04s; }
@keyframes flap { 0%, 100% { transform: scaleY(1); } 50% { transform: scaleY(-.55) translateY(6px); } }

.sky-layer { position: absolute; inset: 0; overflow: hidden; pointer-events: none; z-index: 0; }
.sky-layer .cloud { position: absolute; left: 0; width: var(--w); height: calc(var(--w) * .34); border-radius: 999px; background: #fff; opacity: .55;
  filter: blur(.5px); animation: drift var(--t) linear infinite; animation-delay: var(--o); }
.sky-layer .cloud::before, .sky-layer .cloud::after { content: ""; position: absolute; background: inherit; border-radius: 50%; }
.sky-layer .cloud::before { width: 46%; height: 130%; left: 16%; bottom: 30%; }
.sky-layer .cloud::after { width: 34%; height: 100%; left: 50%; bottom: 40%; }
.sky-layer .cloud:not(.near) { opacity: .32; transform: scale(.7); }
@keyframes drift { from { translate: -40vw 0; } to { translate: 140vw 0; } }
.flock-wrap { position: absolute; left: 0; width: 70px; animation: cross var(--t) linear infinite; animation-delay: var(--o); }
@keyframes cross { 0% { translate: -120px 20px; } 60% { translate: 110vw -30px; } 100% { translate: 110vw -30px; } }
.flock-sky { width: 70px; height: 52px; overflow: visible; }
.flock-sky .fb { fill: none; stroke: var(--ink-3); stroke-width: 1.6; stroke-linecap: round; opacity: .6; transform-box: fill-box; transform-origin: center; animation: flock-flap .5s ease-in-out infinite; animation-delay: var(--d); }
@keyframes flock-flap { 50% { scale: 1 .35; } }
html.scene-dark .sky-layer .cloud { opacity: .07; } html.scene-dark .sky-layer .cloud:not(.near) { opacity: .05; } html.scene-dark .flock-sky .fb { stroke: #C9CBE6; opacity: .45; }

/* The swoop: sky slides in, speed streaks and clouds rush left, Pip flaps across, then it all clears. */
.flight { position: fixed; inset: 0; z-index: 60; pointer-events: all; overflow: hidden; }
.flight-sky { position: absolute; inset: 0; background: linear-gradient(to bottom, #8FC9F2, #CFE8FA 60%, #FFE9C2); animation: sky-in .38s cubic-bezier(.5,0,.3,1) both; }
html.scene-dark .flight-sky { background: linear-gradient(to bottom, #1B2360, #34307A 60%, #5A3F7A); }
@keyframes sky-in { from { clip-path: circle(0 at 85% 50%); } to { clip-path: circle(150% at 85% 50%); } }
.flight .streak { position: absolute; right: -300px; width: var(--w); height: 3px; border-radius: 3px; background: rgba(255,255,255,.8); animation: streak .5s linear infinite; animation-delay: var(--d); }
@keyframes streak { from { translate: 0 0; } to { translate: calc(-100vw - 600px) 0; } }
.flight .rush-cloud { position: absolute; right: -320px; width: var(--w); height: calc(var(--w) * .36); border-radius: 999px; background: #fff; opacity: .85; animation: rush .9s cubic-bezier(.3,.1,.6,1) both; animation-delay: var(--d); }
html.scene-dark .flight .rush-cloud { opacity: .18; } html.scene-dark .flight .streak { background: rgba(255,255,255,.35); }
@keyframes rush { from { translate: 0 0; } to { translate: calc(-100vw - 700px) 0; } }
.flight-pip { position: absolute; left: 0; top: 42%; animation: pip-cross 1.2s cubic-bezier(.45,.05,.4,1) both; }
.flight-pip .bird.flyer { width: 150px; height: 112px; filter: drop-shadow(0 10px 14px rgba(30,35,68,.25)); }
@keyframes pip-cross { 0% { translate: -180px 60px; rotate: -8deg; } 50% { translate: calc(50vw - 75px) -10px; rotate: 0deg; } 100% { translate: calc(100vw + 40px) -80px; rotate: -10deg; } }
.flight-card { position: absolute; left: 50%; top: 62%; translate: -50% 0; width: max-content; max-width: 88vw; background: var(--paper); border-radius: 18px; padding: 14px 26px; text-align: center; display: flex; flex-direction: column; gap: 2px;
  box-shadow: 0 16px 40px rgba(30,35,68,.25); animation: card-pop .5s cubic-bezier(.3,1.5,.5,1) .15s both; }
.flight-card b { font: 400 26px/1.15 var(--serif); }
.flight-card span { color: var(--ink-3); font-size: 14px; font-weight: 600; }
@keyframes card-pop { from { opacity: 0; scale: .7; } }
.flight.out { animation: flight-out .5s ease-in both; }
@keyframes flight-out { to { opacity: 0; } }
@media (prefers-reduced-motion: reduce) { .flight { display: none; } .sky-layer .cloud, .flock-wrap, .flyer .wing, .flock-sky .fb { animation: none; } .flock-wrap { display: none; } }

/* ---------- motion everywhere ---------- */
/* Pages: each section rises in, one after another. */
.view.enter > * { animation: enter .5s cubic-bezier(.2,.8,.2,1) both; }
.view.enter > :nth-child(2) { animation-delay: .06s; } .view.enter > :nth-child(3) { animation-delay: .12s; }
.view.enter > :nth-child(4) { animation-delay: .18s; } .view.enter > :nth-child(5) { animation-delay: .24s; }
.view.enter > :nth-child(6) { animation-delay: .3s; } .view.enter > :nth-child(n+7) { animation-delay: .36s; }
@keyframes enter { from { opacity: 0; translate: 0 18px; } }
/* Cards lift toward the pointer; everything pressable sinks a little when pressed. */
:is(.entry, .hab, .card, .ware, .sp-card, .today, .jcard, .plate, .meet) { transition: translate .2s cubic-bezier(.3,1.4,.5,1), box-shadow .2s; }
:is(a.entry, a.hab, button.card, .ware, .today, .jcard):hover { translate: 0 -3px; box-shadow: 0 10px 24px rgba(30,35,68,.12); }
.btn { transition: transform .12s, filter .15s, box-shadow .2s; }
.btn:active:not(:disabled) { transform: scale(.96); }
/* The sunrise buttons carry a slow shine across them. */
.btn.sun { position: relative; overflow: hidden; }
.btn.sun::after { content: ""; position: absolute; inset: 0; background: linear-gradient(105deg, transparent 35%, rgba(255,255,255,.5) 50%, transparent 65%); translate: -120% 0; animation: shine 3.8s ease-in-out infinite; pointer-events: none; }
@keyframes shine { 0%, 60% { translate: -120% 0; } 85%, 100% { translate: 120% 0; } }
/* Dialogs pop, toasts slide in. */
.modal:not([hidden]) { animation: fade .2s ease-out; }
.modal .panel { animation: panel-pop .35s cubic-bezier(.3,1.5,.5,1); }
@keyframes fade { from { opacity: 0; } }
@keyframes panel-pop { from { opacity: 0; scale: .9; translate: 0 12px; } }
.toast { animation: toast-in .4s cubic-bezier(.3,1.5,.5,1); }
@keyframes toast-in { from { opacity: 0; translate: 40px 0; scale: .95; } }
@media (max-width: 860px) { @keyframes toast-in { from { opacity: 0; translate: 0 -20px; scale: .95; } } }
/* Meters fill from empty when they appear. */
.meter i { animation: fill-in .9s cubic-bezier(.3,.8,.3,1) .2s both; transform-origin: left; }
@keyframes fill-in { from { scale: 0 1; } }
/* The logo bird bobs as if it's about to sing. */
.wordmark .mark, .mobile-mark .mark { animation: perch 3.2s ease-in-out infinite; transform-origin: 50% 90%; }
@keyframes perch { 0%, 80%, 100% { rotate: 0deg; } 85% { rotate: -12deg; } 90% { rotate: 8deg; } 95% { rotate: -4deg; } }
@media (prefers-reduced-motion: reduce) {
  .view.enter > *, .modal:not([hidden]), .modal .panel, .toast, .meter i, .wordmark .mark, .mobile-mark .mark, .btn.sun::after, .nav a.on .ic, .tabbar a.on .ic { animation: none; }
  .shell { transition: none; }
}
/* Lists and grids ripple in, item by item. */
.view.enter :is(.cards, .wares, .habs, .cols, .ladder, .path) > *, .view.enter tbody tr { animation: enter .45s cubic-bezier(.2,.8,.2,1) both; animation-delay: calc(.15s + var(--i, 0) * 45ms); }
:is(.cards, .wares, .habs, .cols, .ladder, .path) > :nth-child(1), tbody tr:nth-child(1) { --i: 0; } :is(.cards, .wares, .habs, .cols, .ladder, .path) > :nth-child(2), tbody tr:nth-child(2) { --i: 1; }
:is(.cards, .wares, .habs, .cols, .ladder, .path) > :nth-child(3), tbody tr:nth-child(3) { --i: 2; } :is(.cards, .wares, .habs, .cols, .ladder, .path) > :nth-child(4), tbody tr:nth-child(4) { --i: 3; }
:is(.cards, .wares, .habs, .cols, .ladder, .path) > :nth-child(5), tbody tr:nth-child(5) { --i: 4; } :is(.cards, .wares, .habs, .cols, .ladder, .path) > :nth-child(6), tbody tr:nth-child(6) { --i: 5; }
:is(.cards, .wares, .habs, .cols, .ladder, .path) > :nth-child(7), tbody tr:nth-child(7) { --i: 6; } :is(.cards, .wares, .habs, .cols, .ladder, .path) > :nth-child(n+8), tbody tr:nth-child(n+8) { --i: 7; }
/* Birds and hats come alive under the pointer. */
:is(.card, .ware, .meet, .hab) .bird { transition: rotate .3s cubic-bezier(.3,1.6,.5,1), scale .3s cubic-bezier(.3,1.6,.5,1); }
:is(button.card, .ware):hover .bird { rotate: -8deg; scale: 1.08; }
/* The home page's demo sits in the open sky. */
.hero .demo { position: relative; overflow: hidden; background: linear-gradient(to bottom, color-mix(in srgb, #8FC9F2 26%, var(--paper)), var(--paper) 70%); }
.hero .demo > :not(.sky-layer) { position: relative; }
html.scene-dark .hero .demo { background: linear-gradient(to bottom, color-mix(in srgb, #3A4390 40%, var(--paper)), var(--paper) 70%); }
#featherCount.bump { display: inline-block; animation: bump .6s cubic-bezier(.3,1.8,.5,1); color: var(--amber-ink); }
@keyframes bump { 30% { scale: 1.45; } }
@media (prefers-reduced-motion: reduce) { .view.enter :is(.cards, .wares, .habs, .cols, .ladder, .path) > *, .view.enter tbody tr, #featherCount.bump { animation: none; } }

/* ---------- cosmetic previews: every item is a small moving picture ---------- */
.ware .keys i, .reward .keys i { animation: key-ripple 2.4s ease-in-out infinite; animation-delay: calc(var(--i) * 90ms); }
@keyframes key-ripple { 0%, 60%, 100% { translate: 0 0; } 70% { translate: 0 3px; } }
/* Instruments: the drawing, with sound waves that pulse while it plays. */
.inst-btn { position: relative; display: flex; align-items: flex-end; gap: 2px; padding: 0; border: 0; background: none; cursor: pointer; }
.inst { width: 84px; height: 63px; transition: scale .25s cubic-bezier(.3,1.6,.5,1), rotate .25s; }
.inst-btn:hover .inst { scale: 1.08; rotate: -4deg; }
.inst-btn .waves { position: absolute; right: -14px; top: 6px; width: 20px; height: 30px; }
.inst-btn .waves i { position: absolute; left: 0; top: 50%; width: calc(8px + var(--n, 0) * 6px); aspect-ratio: 1; translate: 0 -50%; border: 2px solid var(--ink-3); border-left-color: transparent; border-bottom-color: transparent; border-radius: 50%; rotate: 45deg; opacity: .25; }
.inst-btn .waves i:nth-child(2) { --n: 1; } .inst-btn .waves i:nth-child(3) { --n: 2; }
.inst-btn:hover .waves i, .inst-btn.playing .waves i { animation: wave .9s ease-out infinite; animation-delay: calc(var(--n) * .15s); border-top-color: var(--leaf); border-right-color: var(--leaf); }
.inst-btn.playing .inst { animation: inst-play .3s ease-in-out infinite alternate; }
@keyframes wave { 0% { opacity: 0; } 40% { opacity: 1; } 100% { opacity: 0; } }
@keyframes inst-play { to { rotate: 3deg; scale: 1.05; } }

/* Trails: Pip flaps in place while the trail streams away behind. */
.trail-demo { position: relative; display: block; width: 130px; height: 60px; border-radius: 12px; overflow: hidden; background: linear-gradient(to bottom, color-mix(in srgb, #8FC9F2 30%, var(--paper)), var(--paper)); }
.trail-demo .bird.flyer { position: absolute; right: 10px; top: 10px; width: 54px; height: 40px; animation: hover-fly 1.6s ease-in-out infinite; }
.trail-demo i { position: absolute; top: calc(18px + var(--y) * .3px); right: 50px; width: 8px; height: 8px; animation: stream 1.4s linear infinite; animation-delay: calc(var(--i) * -.2s); }
@keyframes stream { from { translate: 0 0; opacity: 1; } to { translate: -110px 0; opacity: 0; } }
.t-none i { display: none; }
.t-sparkles i { background: #F7C948; clip-path: polygon(50% 0, 62% 38%, 100% 50%, 62% 62%, 50% 100%, 38% 62%, 0 50%, 38% 38%); width: 10px; height: 10px; }
.t-notes i { width: auto; height: auto; font-size: 13px; font-style: normal; color: var(--k6); } .t-notes i::before { content: "♪"; }
.t-notes i:nth-child(even)::before { content: "♫"; }
.t-feathers i { width: 6px; height: 12px; border-radius: 100% 0 100% 0; background: var(--bird, #FF7A59); }
.t-bubbles i { border-radius: 50%; border: 1.5px solid #6FB8E8; background: rgba(255,255,255,.5); width: 9px; height: 9px; }
.t-petals i { width: 8px; height: 6px; border-radius: 80% 0 80% 0; background: #F4A3B8; }
.t-rainbow i { width: 22px; height: 4px; border-radius: 2px; background: var(--k0); }
.t-rainbow i:nth-child(2) { background: var(--k1); } .t-rainbow i:nth-child(3) { background: var(--k2); } .t-rainbow i:nth-child(4) { background: var(--k3); }
.t-rainbow i:nth-child(5) { background: var(--k5); } .t-rainbow i:nth-child(6) { background: var(--k6); } .t-rainbow i:nth-child(7) { background: var(--k7); }

/* Skies: a patch of each backdrop, alive. */
.sky-demo { position: relative; display: block; width: 130px; height: 60px; border-radius: 12px; overflow: hidden; background: var(--sky-bg); }
.sky-demo i { position: absolute; }
.s-day { --sky-bg: linear-gradient(#8FC9F2, #DDF0FB); }
.s-day i:nth-child(-n+2) { width: 34px; height: 11px; border-radius: 99px; background: #fff; top: calc(12px + var(--i) * 20px); left: -40px; animation: demo-drift calc(7s + var(--i) * 3s) linear infinite; animation-delay: calc(var(--i) * -3s); }
.s-dawn { --sky-bg: linear-gradient(#F9B7A0, #FCE3C4 55%, #CFE6F7); }
.s-dawn i:first-child { width: 26px; height: 26px; border-radius: 50%; background: #FFD27A; left: 52px; bottom: -12px; box-shadow: 0 0 18px #FFC45A; animation: rise-sun 4s ease-in-out infinite alternate; }
.s-sunset { --sky-bg: linear-gradient(#5A3F9A, #E0607F 50%, #F7B05A); }
.s-sunset i:first-child { width: 28px; height: 28px; border-radius: 50%; background: #FFD27A; left: 50px; bottom: -8px; box-shadow: 0 0 20px #FFB04A; }
.s-sunset i:nth-child(2) { width: 40px; height: 8px; border-radius: 99px; background: rgba(255,255,255,.4); top: 14px; left: -44px; animation: demo-drift 9s linear infinite; }
.s-night { --sky-bg: linear-gradient(#0F1433, #2A2F6A); }
.s-night i, .s-aurora i { width: 3px; height: 3px; border-radius: 50%; background: #fff; left: calc(var(--x) * 1%); top: calc(var(--y) * 1%); animation: twinkle 1.8s ease-in-out infinite; animation-delay: calc(var(--i) * -.37s); }
.s-night i:first-child { width: 14px; height: 14px; background: none; box-shadow: -4px 3px 0 #F3EBD8; top: 6px; left: 100px; animation: none; }
.s-aurora { --sky-bg: linear-gradient(#0E1A3A, #16305A); }
.s-aurora::before { content: ""; position: absolute; inset: -20% -10%; background: linear-gradient(100deg, transparent 20%, rgba(80,240,180,.55) 40%, rgba(120,140,255,.45) 55%, transparent 75%); filter: blur(6px); animation: aurora 5s ease-in-out infinite alternate; }
.s-blossom { --sky-bg: linear-gradient(#FCE4EC, #FFF6F0); }
.s-blossom i { width: 7px; height: 5px; border-radius: 80% 0 80% 0; background: #F4A3B8; left: calc(var(--i) * 16px); top: -8px; animation: petal-fall calc(2.6s + var(--i) * .3s) linear infinite; animation-delay: calc(var(--i) * -.5s); }
@keyframes demo-drift { to { translate: 180px 0; } }
@keyframes rise-sun { to { translate: 0 -14px; } }
@keyframes twinkle { 50% { opacity: .2; scale: .6; } }
@keyframes aurora { to { translate: 12% 6%; } }
@keyframes petal-fall { to { translate: 20px 72px; rotate: 300deg; } }

/* Celebrations: a small burst on a loop. */
.burst-demo { position: relative; display: block; width: 130px; height: 60px; border-radius: 12px; background: color-mix(in srgb, var(--yolk) 12%, var(--paper)); overflow: hidden; }
.burst-demo i { position: absolute; left: 50%; top: 55%; width: 8px; height: 8px; margin: -4px; --a: calc(var(--i) * 36deg); animation: mini-burst 1.6s cubic-bezier(.2,.7,.3,1) infinite; }
@keyframes mini-burst { 0% { translate: 0 0; opacity: 1; scale: .4; } 70% { opacity: 1; } 100% { translate: calc(cos(var(--a)) * 52px) calc(sin(var(--a)) * 26px + 10px); opacity: 0; scale: 1; rotate: 200deg; } }
.b-feathers i { width: 6px; height: 12px; border-radius: 100% 0 100% 0; background: var(--k0); } .b-feathers i:nth-child(odd) { background: var(--k4); } .b-feathers i:nth-child(3n) { background: var(--k2); }
.b-confetti i { width: 5px; height: 9px; border-radius: 1px; background: var(--k0); } .b-confetti i:nth-child(2n) { background: var(--k3); } .b-confetti i:nth-child(3n) { background: var(--k5); } .b-confetti i:nth-child(5n) { background: var(--k2); }
.b-stars i { width: 11px; height: 11px; background: #F7C948; clip-path: polygon(50% 0, 61% 35%, 98% 35%, 68% 57%, 79% 91%, 50% 70%, 21% 91%, 32% 57%, 2% 35%, 39% 35%); }
.b-hearts i { width: auto; height: auto; font-style: normal; color: #E0607F; font-size: 12px; line-height: 1; } .b-hearts i::before { content: "♥"; }
.b-bubbles i { border-radius: 50%; border: 1.5px solid #6FB8E8; background: rgba(255,255,255,.6); width: 10px; height: 10px; }
.b-fireworks i { width: 4px; height: 4px; border-radius: 50%; background: #FFD27A; box-shadow: 0 0 6px 1px #FF9A3C; } .b-fireworks i:nth-child(2n) { background: #9AD8FF; box-shadow: 0 0 6px 1px #3E8EDE; }
@media (prefers-reduced-motion: reduce) { .trail-demo i, .trail-demo .bird, .sky-demo i, .sky-demo::before, .burst-demo i, .ware .keys i, .inst-btn .waves i, .inst-btn.playing .inst { animation: none; } }

/* ---------- the shop: a purse, a row of aisle tabs, and cards that show what you'd get ---------- */
.shop-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; flex-wrap: wrap; }
.purse { display: flex; align-items: center; gap: 8px; background: var(--paper); border-radius: 999px; padding: 8px 18px 8px 12px; box-shadow: inset 0 -3px 0 var(--yolk); }
.purse .fea { width: 24px; height: 24px; color: var(--amber); animation: perch 3.2s ease-in-out infinite; }
.purse .figure { font-size: 26px; }
.fea { width: 16px; height: 16px; flex: none; }
.shop-tabs { display: flex; flex-wrap: wrap; gap: 8px; padding: 4px 2px 8px; margin: -8px 0 -14px; }
@media (max-width: 700px) { .shop-tabs { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; margin-inline: -16px; padding-inline: 16px; } }
.shop-tabs::-webkit-scrollbar { display: none; }
.shop-tab { display: flex; align-items: center; gap: 8px; flex: none; min-height: 44px; padding: 8px 14px; border-radius: 999px; border: 1px solid var(--rule-strong); background: var(--paper); color: var(--ink-2); font-weight: 700; font-size: 15px; cursor: pointer; transition: background .2s, color .2s, translate .2s; }
.shop-tab .ic { width: 18px; height: 18px; transition: rotate .3s cubic-bezier(.3,1.6,.5,1); }
.shop-tab small { font-size: 12px; font-weight: 600; color: var(--ink-3); background: var(--sky); border-radius: 999px; padding: 1px 7px; }
.shop-tab:hover { translate: 0 -2px; } .shop-tab:hover .ic { rotate: -10deg; }
.shop-tab[aria-selected="true"] { background: var(--ink); border-color: var(--ink); color: var(--paper); }
.shop-tab[aria-selected="true"] .ic { color: var(--yolk); }
.shop-tab[aria-selected="true"] small { background: rgba(255,255,255,.14); color: var(--paper); }
.shop-tab.plus-tab .ic { color: #6A4FD8; }
.shop-panel { display: flex; flex-direction: column; gap: 18px; }
.shop-panel.swap > * { animation: enter .4s cubic-bezier(.2,.8,.2,1) both; }
.shop-panel.swap .wares > * { animation: enter .4s cubic-bezier(.2,.8,.2,1) both; animation-delay: calc(.05s + var(--i, 0) * 40ms); }
.shop-panel .wares { grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 14px; }
.shop-panel .ware { background: var(--paper); border-radius: 16px; padding: 12px; gap: 8px; align-items: stretch; border: 2px solid transparent; }
.shop-panel .ware .preview { height: 86px; display: grid; place-items: center; border-radius: 12px; background: var(--sky); overflow: hidden; }
.shop-panel .ware .preview .bird { width: 76px; height: 74px; }
.shop-panel .ware .preview .keys { width: 128px; }
.shop-panel .ware .name { font-size: 15px; }
.shop-panel .ware.on { border-color: var(--leaf); }
.shop-panel .ware.on .name::after { content: none; }
.shop-panel .ware .btn { min-height: 38px; padding: 6px 12px; }
.shop-panel .ware .buy { gap: 5px; }
.price-tag { display: inline-flex; align-items: center; gap: 5px; font-weight: 700; color: var(--ink-2); min-height: 38px; }
.price-tag small { margin-left: auto; font-weight: 600; color: var(--ink-3); font-size: 12px; }
.shop-panel .ware.locked:not(:hover) .preview > * { filter: saturate(.85); }
@media (max-width: 560px) { .shop-panel .wares { grid-template-columns: repeat(2, 1fr); gap: 10px; } .shop-panel .ware .preview { height: 78px; } .purse { padding: 6px 14px 6px 10px; } }
@media (prefers-reduced-motion: reduce) { .shop-panel.swap > *, .shop-panel.swap .wares > *, .purse .fea { animation: none; } }

/* ---------- equipped cosmetics, in play ---------- */
/* Skies: the chosen sky colours the top of the staff card, the home demo and the swoop. */
:root { --sky-top: color-mix(in srgb, #8FC9F2 26%, var(--paper)); }
html[data-sky="dawn"] { --sky-top: #F9C4AE; }
html[data-sky="sunset"] { --sky-top: #7A4FA8; }
html[data-sky="blossom"] { --sky-top: #FAD4E0; }
html[data-sky="night"] { --sky-top: #151B45; }
html[data-sky="aurora"] { --sky-top: #0F2045; }
html:not([data-sky="day"]) .stave.habitat { background: linear-gradient(to bottom, var(--sky-top), var(--sky-top) 8%, var(--paper) 36%, color-mix(in srgb, var(--hab) 16%, var(--paper))); }
html:not([data-sky="day"]) .hero .demo, html:not([data-sky="day"]) .empty-sky { background: linear-gradient(to bottom, var(--sky-top), var(--paper) 70%); }
html:is([data-sky="sunset"], [data-sky="night"], [data-sky="aurora"]) .stave.habitat .stave-head .say { color: #fff; }
html:is([data-sky="sunset"], [data-sky="night"], [data-sky="aurora"]) .stave.habitat .stave-head .sub { color: #D8D6F2; }
html:is([data-sky="night"], [data-sky="aurora"]) .sky-layer .cloud { opacity: .06; }
html[data-sky="sunset"] .flight-sky { background: linear-gradient(#5A3F9A, #E0607F 55%, #F7B05A); }
html[data-sky="dawn"] .flight-sky { background: linear-gradient(#F9B7A0, #FCE3C4 55%, #CFE6F7); }
html[data-sky="blossom"] .flight-sky { background: linear-gradient(#F8C8D8, #FFF1F4); }
html[data-sky="night"] .flight-sky { background: linear-gradient(#0B1030, #2A2F6A); }
html[data-sky="aurora"] .flight-sky { background: linear-gradient(#0B1733, #1C3A68); }
.sky-layer .twk, .sky-layer .petal, .sky-layer .glow { display: none; position: absolute; }
html:is([data-sky="night"], [data-sky="aurora"]) .sky-layer .twk { display: block; width: 3px; height: 3px; border-radius: 50%; background: #fff; animation: twinkle 2s ease-in-out infinite; animation-delay: calc(var(--i) * -.3s); }
html[data-sky="blossom"] .sky-layer .petal { display: block; top: -10px; width: 9px; height: 6px; border-radius: 80% 0 80% 0; background: #F4A3B8; animation: petal-drop calc(6s + var(--i) * .7s) linear infinite; animation-delay: calc(var(--i) * -1.1s); }
@keyframes petal-drop { to { translate: 60px 320px; rotate: 540deg; } }
html[data-sky="aurora"] .sky-layer .glow { display: block; inset: -10% -10% 45%; background: linear-gradient(100deg, transparent 15%, rgba(80,240,180,.4) 38%, rgba(120,140,255,.35) 55%, transparent 78%); filter: blur(10px); animation: aurora 7s ease-in-out infinite alternate; }

/* Trails: particles stream off behind Pip in the swoop. */
.ftrail { position: absolute; right: 70%; top: 44%; width: 0; height: 0; }
.ftrail i { position: absolute; width: 12px; height: 12px; top: calc(var(--y) * 1px); animation: ftrail .7s linear infinite; animation-delay: calc(var(--i) * -.06s); display: none; }
@keyframes ftrail { from { translate: 0 0; opacity: 1; scale: 1; } to { translate: -260px 0; opacity: 0; scale: .5; } }
html:not([data-trail="none"]) .ftrail i { display: block; }
html[data-trail="sparkles"] .ftrail i { background: #F7C948; clip-path: polygon(50% 0, 62% 38%, 100% 50%, 62% 62%, 50% 100%, 38% 62%, 0 50%, 38% 38%); width: 16px; height: 16px; }
html[data-trail="notes"] .ftrail i { width: auto; height: auto; font-size: 22px; font-style: normal; color: var(--k6); } html[data-trail="notes"] .ftrail i::before { content: "♪"; }
html[data-trail="notes"] .ftrail i:nth-child(even)::before { content: "♫"; }
html[data-trail="feathers"] .ftrail i { width: 9px; height: 18px; border-radius: 100% 0 100% 0; background: var(--bird); }
html[data-trail="bubbles"] .ftrail i { border-radius: 50%; border: 2px solid #6FB8E8; background: rgba(255,255,255,.55); width: 14px; height: 14px; }
html[data-trail="petals"] .ftrail i { width: 13px; height: 9px; border-radius: 80% 0 80% 0; background: #F4A3B8; }
html[data-trail="rainbow"] .ftrail i { width: 60px; height: 7px; border-radius: 4px; background: var(--k0); top: calc(var(--r) * 7px - 24px); animation-duration: .5s; }
html[data-trail="rainbow"] .ftrail i:nth-child(7n+2) { background: var(--k1); } html[data-trail="rainbow"] .ftrail i:nth-child(7n+3) { background: var(--k2); }
html[data-trail="rainbow"] .ftrail i:nth-child(7n+4) { background: var(--k3); } html[data-trail="rainbow"] .ftrail i:nth-child(7n+5) { background: var(--k5); }
html[data-trail="rainbow"] .ftrail i:nth-child(7n+6) { background: var(--k6); } html[data-trail="rainbow"] .ftrail i:nth-child(7n) { background: var(--k7); }

/* Celebrations: the burst particles in each style. */
.fx.fx-confetti { width: 8px; height: 14px; margin: -7px 0 0 -4px; background: var(--c); border-radius: 2px; }
.fx.fx-stars { width: 18px; height: 18px; margin: -9px 0 0 -9px; background: #F7C948; clip-path: polygon(50% 0, 61% 35%, 98% 35%, 68% 57%, 79% 91%, 50% 70%, 21% 91%, 32% 57%, 2% 35%, 39% 35%); }
.fx.fx-hearts { font-size: 22px; line-height: 1; margin: -11px 0 0 -8px; color: #E0607F; } .fx.fx-hearts::before { content: "♥"; }
.fx.fx-hearts:nth-child(3n) { color: var(--k8); }
.fx.fx-bubbles { width: 16px; height: 16px; margin: -8px 0 0 -8px; border-radius: 50%; border: 2px solid #6FB8E8; background: rgba(255,255,255,.55); }
.fx.fx-fireworks { width: 7px; height: 7px; margin: -3px 0 0 -3px; border-radius: 50%; background: #FFD27A; box-shadow: 0 0 10px 3px #FF9A3C; }
@media (prefers-reduced-motion: reduce) { .sky-layer .twk, .sky-layer .petal, .sky-layer .glow, .ftrail i { animation: none; } .ftrail { display: none; } }
html:is([data-sky="night"], [data-sky="aurora"]) .flight .rush-cloud { opacity: .14; } html:is([data-sky="night"], [data-sky="aurora"]) .flight .streak { background: rgba(255,255,255,.4); }

/* Achievement rewards: the comet trail, the rainbow burst, the cosmos sky, and their shop label. */
.ach-tag { display: inline-flex; align-items: center; gap: 5px; color: #9A5A08; text-decoration: none; }
.ach-tag .ic { width: 15px; height: 15px; }
html.scene-dark .ach-tag { color: var(--gold); }
.t-comet i { width: 30px; height: 5px; border-radius: 3px; background: linear-gradient(90deg, transparent, #9AD8FF, #fff); box-shadow: 0 0 8px #9AD8FF; }
html[data-trail="comet"] .ftrail i { width: 90px; height: 8px; border-radius: 4px; background: linear-gradient(90deg, transparent, #9AD8FF, #fff); box-shadow: 0 0 14px #9AD8FF; top: calc(var(--r) * 3px - 10px); }
.b-rainbow i { width: 9px; height: 9px; border-radius: 50%; background: var(--k0); } .b-rainbow i:nth-child(2) { background: var(--k1); } .b-rainbow i:nth-child(3) { background: var(--k2); }
.b-rainbow i:nth-child(4) { background: var(--k3); } .b-rainbow i:nth-child(5) { background: var(--k4); } .b-rainbow i:nth-child(6) { background: var(--k5); }
.b-rainbow i:nth-child(7) { background: var(--k6); } .b-rainbow i:nth-child(8) { background: var(--k7); } .b-rainbow i:nth-child(9) { background: var(--k8); }
.fx.fx-rainbow { width: 12px; height: 12px; margin: -6px 0 0 -6px; border-radius: 50%; background: var(--c); box-shadow: 0 0 8px var(--c); }
.s-cosmos { --sky-bg: radial-gradient(circle at 30% 40%, #7A3FB8, transparent 55%), radial-gradient(circle at 75% 60%, #D0508A, transparent 50%), linear-gradient(#120C33, #2A1650); }
.s-cosmos i { width: 3px; height: 3px; border-radius: 50%; background: #fff; left: calc(var(--x) * 1%); top: calc(var(--y) * 1%); animation: twinkle 1.6s ease-in-out infinite; animation-delay: calc(var(--i) * -.3s); }
html[data-sky="cosmos"] { --sky-top: #24124A; }
html[data-sky="cosmos"] .stave.habitat .stave-head .say { color: #fff; } html[data-sky="cosmos"] .stave.habitat .stave-head .sub { color: #E0D4F5; }
html[data-sky="cosmos"] .sky-layer .twk { display: block; width: 3px; height: 3px; border-radius: 50%; background: #fff; animation: twinkle 2s ease-in-out infinite; animation-delay: calc(var(--i) * -.3s); }
html[data-sky="cosmos"] .sky-layer .cloud { opacity: .05; }
html[data-sky="cosmos"] .flight-sky { background: radial-gradient(circle at 30% 40%, #7A3FB8, transparent 55%), radial-gradient(circle at 75% 60%, #D0508A, transparent 50%), linear-gradient(#120C33, #2A1650); }
html[data-sky="cosmos"] .flight .rush-cloud { opacity: .12; }

/* ---------- the nest ---------- */
.nest-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 18px; flex-wrap: wrap; }
.nest-level { display: flex; flex-direction: column; gap: 6px; min-width: 240px; background: var(--paper); border-radius: 16px; padding: 12px 16px; box-shadow: inset 0 -4px 0 color-mix(in srgb, var(--leaf) 50%, transparent); }
.lv-badge { display: inline-flex; align-items: center; gap: 8px; font: 400 20px var(--serif); }
.lv-badge .ic { width: 22px; height: 22px; color: #8A5A2B; }
.nest-scene { position: relative; height: clamp(400px, 62vh, 580px); border-radius: 24px; overflow: hidden;
  background: linear-gradient(to bottom, var(--sky-top, #CFE8FA), color-mix(in srgb, #8FC9F2 12%, var(--paper)) 70%); }
html[data-sky="day"] .nest-scene { background: linear-gradient(to bottom, #9FD2F4, #E4F3FC 75%); }
html:is([data-sky="night"], [data-sky="aurora"], [data-sky="cosmos"]) .nest-scene { background: linear-gradient(to bottom, var(--sky-top), #3A3F75 80%); }
html[data-sky="sunset"] .nest-scene { background: linear-gradient(#5A3F9A, #E0607F 55%, #F7B05A); }
html[data-sky="dawn"] .nest-scene { background: linear-gradient(#F9B7A0, #FCE3C4 60%, #CFE6F7); }
html[data-sky="blossom"] .nest-scene { background: linear-gradient(#F8C8D8, #FFF1F4); }
html.scene-dark[data-sky="day"] .nest-scene { background: linear-gradient(#1B2360, #34307A 80%); }
.tree { position: absolute; inset: 0; width: 100%; height: 100%; }
.tree .canopy { fill: color-mix(in srgb, var(--leaf) 55%, #2E7D3A); opacity: .55; animation: sway-canopy 7s ease-in-out infinite alternate; transform-origin: 50% 100%; transform-box: fill-box; }
.tree .canopy.c2 { opacity: .45; animation-duration: 9s; } .tree .canopy.c3 { opacity: .5; animation-duration: 6s; }
@keyframes sway-canopy { to { transform: skewX(1.6deg); } }
.tree .ground { fill: color-mix(in srgb, var(--leaf) 60%, #3E8E4A); }
.tree .trunk { fill: #7A5230; }
.tree .branch { fill: none; stroke: #7A5230; stroke-width: 7; stroke-linecap: round; vector-effect: non-scaling-stroke; }
.tree .lights { fill: none; stroke: #FFE08A; stroke-width: 3; stroke-dasharray: 1 12; stroke-linecap: round; vector-effect: non-scaling-stroke; filter: drop-shadow(0 0 3px #FFD04A); animation: lights 1.6s steps(2) infinite; }
@keyframes lights { 50% { stroke-dashoffset: 6.5; } }
.tree .bunting-line { fill: none; stroke: #C9955A; stroke-width: 1.5; vector-effect: non-scaling-stroke; }
.tree .lantern rect { fill: #FFB04A; filter: drop-shadow(0 0 4px #FFB04A); }
.tree .lantern .string { stroke: #5A3A20; stroke-width: 1; vector-effect: non-scaling-stroke; }
.tree .lantern { animation: swing 3s ease-in-out infinite; animation-delay: var(--d); transform-box: fill-box; transform-origin: 50% 0; }
@keyframes swing { 50% { rotate: 6deg; } }
.residents { position: absolute; inset: 0; }
.resident { position: absolute; padding: 0; border: 0; background: none; cursor: pointer; translate: -50% -94%; z-index: 2; }
.resident .bird { width: clamp(40px, 5.2vw, 58px); height: clamp(38px, 5vw, 56px); animation: nest-bob 2.4s ease-in-out infinite; animation-delay: calc(var(--d) * -1); transition: scale .2s cubic-bezier(.3,1.6,.5,1); }
.resident.on-ground .bird { width: clamp(34px, 4.2vw, 46px); height: clamp(32px, 4vw, 44px); }
.resident:hover .bird, .resident.picked .bird { scale: 1.2; }
.resident.picked::after { content: ""; position: absolute; left: 50%; bottom: -4px; width: 30px; height: 6px; translate: -50% 0; border-radius: 50%; background: var(--yolk); filter: blur(2px); }
.resident.gold .bird { filter: drop-shadow(0 0 6px var(--gold)); }
.resident.flying { z-index: 5; } .resident.flying .bird.flyer { width: 56px; height: 42px; animation: none; }
.resident .bird.sing { animation: bob .32s ease-in-out infinite alternate; }
@keyframes nest-bob { 0%, 70%, 100% { translate: 0 0; } 78% { translate: 0 -5px; } 86% { translate: 0 0; } 92% { translate: 0 -2px; } }
.pip-home { position: absolute; translate: -50% -86%; z-index: 3; pointer-events: none; }
.pip-home .bird { width: 70px; height: 68px; animation: perch 4s ease-in-out infinite; }
.bird-card { position: absolute; left: 16px; bottom: 16px; z-index: 6; display: flex; gap: 12px; align-items: center; max-width: min(360px, calc(100% - 32px)); background: var(--paper); border-radius: 16px; padding: 10px 16px 10px 10px; box-shadow: 0 12px 30px rgba(30,35,68,.2); }
.bird-card.pop { animation: panel-pop .35s cubic-bezier(.3,1.5,.5,1); }
.bird-card b { font: 400 19px var(--serif); }
.bc-bird .bird { width: 62px; height: 60px; }
.gift { display: grid; grid-template-columns: auto 1fr auto; gap: 16px; align-items: center; background: var(--paper); border-radius: 18px; padding: 14px 18px; }
.gift-box { width: 52px; height: 52px; border-radius: 14px; display: grid; place-items: center; background: var(--sky); color: var(--ink-3); }
.gift-box .ic { width: 28px; height: 28px; }
.gift.ready { box-shadow: inset 4px 0 0 var(--yolk), 0 8px 24px color-mix(in srgb, var(--yolk) 25%, transparent); }
.gift.ready .gift-box { background: var(--yolk); color: var(--on-yolk); animation: gift-wiggle 1.8s ease-in-out infinite; }
@keyframes gift-wiggle { 0%, 70%, 100% { rotate: 0deg; } 75% { rotate: -10deg; } 82% { rotate: 9deg; } 89% { rotate: -5deg; } }
@media (max-width: 560px) { .gift { grid-template-columns: auto 1fr; } .gift .btn { grid-column: 1 / -1; } .nest-scene { height: 440px; border-radius: 18px; } }
.res-groups { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 12px; }
.res-group { background: var(--paper); border-radius: 16px; padding: 12px 14px; box-shadow: inset 0 -4px 0 color-mix(in srgb, var(--c) 50%, transparent); }
.rg-head { display: flex; align-items: center; gap: 8px; margin-bottom: 6px; } .rg-head .glyph { width: 36px; height: 24px; } .rg-head .muted { margin-left: auto; }
.rg-birds { display: flex; flex-wrap: wrap; gap: 4px; }
.rg-bird { display: flex; flex-direction: column; align-items: center; gap: 0; width: 64px; padding: 4px 2px; border: 0; border-radius: 10px; background: none; cursor: pointer; font-size: 11px; font-weight: 600; color: var(--ink-2); line-height: 1.2; text-align: center; }
.rg-bird:hover { background: var(--sky); } .rg-bird .bird { width: 44px; height: 42px; }
/* A gift waiting: a dot on the Nest nav item, a chip in the top bar. */
.nav a.has-gift::after, .tabbar a.has-gift::after { content: ""; position: absolute; top: 8px; left: 24px; width: 9px; height: 9px; border-radius: 50%; background: var(--yolk); box-shadow: 0 0 0 2px var(--rail); animation: ping-dot 1.6s ease-in-out infinite; }
.tabbar a { position: relative; } .tabbar a.has-gift::after { left: calc(50% + 6px); top: 6px; }
@keyframes ping-dot { 50% { scale: 1.35; } }
@media (prefers-reduced-motion: reduce) { .tree .canopy, .tree .lights, .tree .lantern, .resident .bird, .pip-home .bird, .gift.ready .gift-box, .has-gift::after { animation: none; } }

/* ---------- the top bar: stat chips and the player menu ---------- */
.top { gap: 10px; }
.chips { display: flex; align-items: center; gap: 8px; margin-left: auto; }
.chip { display: inline-flex; align-items: center; gap: 6px; min-height: 38px; padding: 5px 12px 5px 8px; border-radius: 999px; background: var(--paper); text-decoration: none; color: var(--ink-3); font-size: 13px; font-weight: 600; box-shadow: 0 1px 0 var(--rule), inset 0 0 0 1px var(--rule); transition: translate .2s cubic-bezier(.3,1.6,.5,1), box-shadow .2s; }
.chip:hover { translate: 0 -2px; box-shadow: 0 6px 14px rgba(30,35,68,.1), inset 0 0 0 1px var(--rule-strong); }
.chip b { font: 400 18px/1 var(--serif); color: var(--ink); font-variant-numeric: tabular-nums; }
.chip .ic { width: 22px; height: 22px; padding: 3px; border-radius: 50%; flex: none; }
.c-rating .ic { background: #E8E4FF; color: #5A48C8; }
.c-streak .ic { background: #FFE6D6; color: #C9601E; }
.c-streak.lit .ic { background: linear-gradient(#FFC04A, #FF6A2C); color: #fff; animation: flicker 1.4s ease-in-out infinite; }
@keyframes flicker { 50% { scale: 1.1 1.18; } }
.c-feathers .ic { background: #FFF1CC; color: #B98516; }
.c-gift { background: var(--yolk); color: var(--on-yolk); box-shadow: none; animation: gift-wiggle 1.8s ease-in-out infinite; }
.c-gift .ic { background: rgba(255,255,255,.4); color: var(--on-yolk); }
.chip.bump b { animation: bump .6s cubic-bezier(.3,1.8,.5,1); display: inline-block; color: var(--amber-ink); }
html.scene-dark .c-rating .ic { background: #34307A; color: #C8BCFF; } html.scene-dark .c-streak .ic { background: #4A2E1C; color: #FF9A5A; } html.scene-dark .c-feathers .ic { background: #4A3B16; color: var(--yolk); }
.me-menu { position: relative; }
.me-btn { display: flex; align-items: center; gap: 8px; min-height: 40px; padding: 3px 10px 3px 3px; border-radius: 999px; border: 1px solid var(--rule-strong); background: var(--paper); cursor: pointer; font-weight: 700; font-size: 14px; }
.me-btn > .ic { width: 16px; height: 16px; color: var(--ink-3); transition: rotate .2s; }
.me-btn[aria-expanded="true"] > .ic { rotate: 180deg; }
.me-av { width: 34px; height: 34px; border-radius: 50%; background: var(--sky); display: grid; place-items: center; overflow: hidden; flex: none; }
.me-av .bird { width: 34px; height: 33px; translate: 1px 3px; }
.me-av.big { width: 48px; height: 48px; } .me-av.big .bird { width: 48px; height: 46px; }
.menu { position: absolute; right: 0; top: calc(100% + 8px); z-index: 30; width: min(360px, calc(100vw - 24px)); background: var(--paper); border-radius: 18px; padding: 14px; box-shadow: 0 18px 44px rgba(30,35,68,.22), 0 0 0 1px var(--rule); animation: panel-pop .25s cubic-bezier(.3,1.5,.5,1); transform-origin: top right; }
.menu-head { display: flex; gap: 12px; align-items: center; padding: 2px 4px 12px; border-bottom: 1px solid var(--rule); }
.menu-head b { display: block; font: 400 19px var(--serif); } .menu-head small { color: var(--ink-3); font-size: 13px; }
.menu-links { display: flex; flex-direction: column; padding: 8px 0; border-bottom: 1px solid var(--rule); }
.menu-links a { display: flex; align-items: center; gap: 10px; padding: 9px 8px; border-radius: 10px; text-decoration: none; font-weight: 600; font-size: 15px; }
.menu-links a:hover { background: var(--sky); } .menu-links .ic { width: 18px; height: 18px; color: var(--ink-3); }
.menu-label { display: flex; align-items: center; gap: 8px; margin: 12px 8px 4px; font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--ink-3); }
.menu-label .ic { width: 15px; height: 15px; }
.snd { display: flex; flex-direction: column; gap: 4px; }
.snd-row { display: grid; grid-template-columns: 30px 1fr auto; grid-template-rows: auto auto; gap: 2px 10px; align-items: center; padding: 8px; border-radius: 12px; }
.snd-row:hover { background: color-mix(in srgb, var(--sky) 60%, transparent); }
.snd-ic { grid-row: 1 / 3; width: 30px; height: 30px; border-radius: 9px; display: grid; place-items: center; background: var(--sky); color: var(--ink-2); }
.snd-ic .ic { width: 17px; height: 17px; }
.snd-txt b { display: block; font-size: 14px; } .snd-txt small { display: block; font-size: 12px; color: var(--ink-3); line-height: 1.3; }
.snd-vol { grid-column: 2 / 4; width: 100%; accent-color: var(--yolk); height: 18px; margin: 0; }
.snd-vol:disabled { opacity: .35; }
.switch { width: 42px; height: 24px; border-radius: 999px; border: 0; padding: 0; background: var(--rule-strong); position: relative; cursor: pointer; transition: background .2s; }
.switch i { position: absolute; left: 3px; top: 3px; width: 18px; height: 18px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0,0,0,.25); transition: translate .25s cubic-bezier(.3,1.5,.5,1); }
.switch[aria-checked="true"] { background: var(--leaf); } .switch[aria-checked="true"] i { translate: 18px 0; }
@media (max-width: 860px) {
  .chips { gap: 5px; } .chip { padding: 4px 9px 4px 5px; min-height: 34px; } .chip b { font-size: 16px; } .chip .ic { width: 20px; height: 20px; }
  .me-btn { padding: 2px 6px 2px 2px; gap: 4px; min-height: 38px; } .me-av { width: 32px; height: 32px; }
  .top .mobile-mark { font-size: 0; gap: 0; }
}
@media (max-width: 380px) { .c-streak { display: none; } }
@media (prefers-reduced-motion: reduce) { .c-streak.lit .ic, .c-gift, .menu { animation: none; } }

/* The home page's nest card. */
.ncard { display: grid; grid-template-columns: auto 1fr auto; gap: 18px; align-items: center; padding: 14px 20px; border-radius: 18px; text-decoration: none;
  background: linear-gradient(to right, color-mix(in srgb, #8FC9F2 22%, var(--paper)), var(--paper)); box-shadow: inset 0 -5px 0 color-mix(in srgb, #8A5A2B 45%, transparent); }
.ncard .jc-text { display: flex; flex-direction: column; gap: 4px; }
.ncard .jc-text b { font: 400 22px/1.2 var(--serif); }
.ncard.ready { box-shadow: inset 0 -5px 0 var(--yolk), 0 8px 24px color-mix(in srgb, var(--yolk) 22%, transparent); }
.ncard .btn .ic { width: 18px; height: 18px; }
.nc-perch { display: flex; align-items: flex-end; min-width: 120px; }
.nc-perch > span { margin-left: -14px; animation: nest-bob 2.4s ease-in-out infinite; animation-delay: calc(var(--i) * -.4s); }
.nc-perch > span:first-child { margin-left: 0; }
.nc-perch .bird { width: 46px; height: 44px; }
.nc-empty { display: grid; place-items: center; width: 56px; height: 56px; border-radius: 16px; background: var(--sky); color: #8A5A2B; } .nc-empty .ic { width: 30px; height: 30px; }
@media (max-width: 560px) { .ncard { grid-template-columns: 1fr auto; } .nc-perch { grid-column: 1 / -1; } }

/* ---------- profile: stats, rating, games, achievements ---------- */
.phead { display: grid; grid-template-columns: auto 1fr auto; gap: 18px; align-items: center; }
.p-av { width: 104px; height: 104px; border-radius: 28px; display: grid; place-items: center; background: linear-gradient(to bottom, color-mix(in srgb, #8FC9F2 30%, var(--paper)), var(--paper)); box-shadow: inset 0 -5px 0 var(--yolk); }
.p-av .bird { width: 92px; height: 88px; animation: perch 4s ease-in-out infinite; }
.pill { display: inline-flex; align-items: center; gap: 5px; padding: 3px 10px; border-radius: 999px; background: var(--paper); font-size: 13px; font-weight: 700; color: var(--ink-2); }
.pill .ic { width: 15px; height: 15px; } .pill.plus { color: #6A4FD8; } .pill.gold { color: #9A5A08; }
.p-actions .btn .ic, .btn .ic { width: 18px; height: 18px; }
@media (max-width: 700px) { .phead { grid-template-columns: auto 1fr; } .p-actions { grid-column: 1 / -1; } .p-av { width: 80px; height: 80px; border-radius: 22px; } .p-av .bird { width: 70px; height: 68px; } }
.pstats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
@media (max-width: 700px) { .pstats { grid-template-columns: repeat(2, 1fr); gap: 8px; } }
.pstat { display: flex; gap: 12px; align-items: center; padding: 14px; border-radius: 16px; background: var(--paper); text-decoration: none; color: inherit; }
a.pstat[href] { transition: translate .2s cubic-bezier(.3,1.4,.5,1), box-shadow .2s; } a.pstat[href]:hover { translate: 0 -3px; box-shadow: 0 10px 24px rgba(30,35,68,.1); }
.ps-ic { width: 44px; height: 44px; border-radius: 14px; display: grid; place-items: center; flex: none; }
.ps-ic .ic { width: 24px; height: 24px; }
.ps-txt { display: flex; flex-direction: column; min-width: 0; } .ps-txt small { font-size: 12px; font-weight: 700; color: var(--ink-3); text-transform: uppercase; letter-spacing: .04em; }
.ps-txt .figure { font-size: 30px; } .ps-txt .muted { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.s-rating .ps-ic { background: #E8E4FF; color: #5A48C8; } .s-birds .ps-ic { background: #DFF3E6; color: #1F7F55; } .s-stars .ps-ic { background: #FFF1CC; color: #B98516; }
.s-streak .ps-ic { background: #FFE6D6; color: #C9601E; } .s-rush .ps-ic { background: #DCEEFF; color: #2E6FC8; } .s-perfect .ps-ic { background: #FCE4F0; color: #C0407A; }
html.scene-dark .ps-ic { filter: saturate(.8) brightness(.55); } html.scene-dark .ps-ic .ic { filter: brightness(2.4); }
@media (max-width: 560px) { .pstat { padding: 10px; gap: 8px; } .ps-ic { width: 36px; height: 36px; border-radius: 11px; } .ps-txt .figure { font-size: 24px; } }
.pcard { background: var(--paper); border-radius: 18px; padding: 16px 18px; display: flex; flex-direction: column; gap: 10px; }
table.games td { vertical-align: middle; padding-block: 9px; }
.mode-cell { display: inline-flex; align-items: center; gap: 8px; font-weight: 600; } .mode-cell .ic { width: 18px; height: 18px; color: var(--ink-3); }
.acc-cell { display: inline-flex; align-items: center; gap: 8px; font-variant-numeric: tabular-nums; }
.acc-bar { width: 70px; height: 7px; border-radius: 4px; background: var(--rule); overflow: hidden; } .acc-bar i { display: block; height: 100%; border-radius: 4px; }
.delta-chip { display: inline-block; padding: 2px 8px; border-radius: 999px; font-weight: 700; font-size: 13px; background: var(--sky); color: var(--ink-3); font-variant-numeric: tabular-nums; }
.delta-chip.up { background: #DFF3E6; color: #1F7F55; } .delta-chip.down { background: #FBE1E7; color: #B3304F; }
html.scene-dark .delta-chip.up { background: #1E3A2C; color: #5BC894; } html.scene-dark .delta-chip.down { background: #3E1E28; color: #E0607F; }
@media (max-width: 560px) { .acc-bar { width: 40px; } table.games th:nth-child(2), table.games td:nth-child(2) { display: none; } }
.badges { display: grid; grid-template-columns: repeat(auto-fill, minmax(270px, 1fr)); gap: 12px; }
.badge-card { display: grid; grid-template-columns: 56px 1fr; gap: 12px; padding: 14px; border-radius: 16px; background: var(--paper); align-items: start; }
.badge-card .medal { width: 56px; height: 56px; border-radius: 50%; display: grid; place-items: center; background: var(--sky); color: var(--ink-3); border: 3px dashed var(--rule-strong); }
.badge-card .medal .ic { width: 26px; height: 26px; }
.badge-card.earned .medal { border: 0; color: #fff; box-shadow: inset 0 -4px 0 rgba(0,0,0,.18), 0 4px 12px rgba(0,0,0,.12); }
.badge-card.earned.bronze .medal { background: linear-gradient(145deg, #E8A870, #B86E3A); }
.badge-card.earned.silver .medal { background: linear-gradient(145deg, #D8DEE8, #8E99AE); }
.badge-card.earned.gold .medal { background: linear-gradient(145deg, #FFE08A, #D9A21E); animation: shimmer 3s ease-in-out infinite; }
@keyframes shimmer { 50% { box-shadow: inset 0 -4px 0 rgba(0,0,0,.18), 0 0 18px rgba(247,201,72,.6); } }
.badge-card:not(.earned) b { color: var(--ink-2); }
.bc-body { display: flex; flex-direction: column; gap: 4px; min-width: 0; } .bc-body b { font-size: 16px; }
.done-on { color: var(--leaf-ink); font-weight: 600; }
.bprog { display: flex; align-items: center; gap: 8px; } .bprog .meter { flex: 1; height: 7px; } .bprog .meter i { background: var(--yolk); }
.rewards { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 2px; }
.rw { display: inline-flex; align-items: center; gap: 4px; padding: 2px 8px 2px 6px; border-radius: 999px; background: #FFF1CC; color: #7A5600; font-size: 12px; font-weight: 700; }
.rw .fea { width: 13px; height: 13px; }
.rw.item { background: #EDE8FF; color: #5A48C8; } .rw .ic { width: 13px; height: 13px; }
.rw-pic { width: 22px; height: 22px; border-radius: 50%; overflow: hidden; display: grid; place-items: center; background: #fff; }
.rw-pic > * { scale: .3; flex: none; } .rw-pic .bird { width: 70px; height: 68px; scale: .34; }
html.scene-dark .rw { background: #4A3B16; color: var(--yolk); } html.scene-dark .rw.item { background: #2E2A5A; color: #C8BCFF; }
@media (prefers-reduced-motion: reduce) { .badge-card.earned.gold .medal, .p-av .bird { animation: none; } }

/* ---------- mode lobbies: Ranked, Puzzles, Puzzle Rush, Practice ---------- */
.mode-hero { position: relative; overflow: hidden; display: grid; grid-template-columns: 1fr auto; gap: 24px; align-items: center; padding: 30px 32px; border-radius: 26px; color: #fff; background: var(--mh-bg); isolation: isolate; }
.m-ranked { --mh-bg: linear-gradient(135deg, #3B2F8F, #6A4FD8 60%, #9A7AF0); --mh-ring: #F7C948; }
.m-puzzles { --mh-bg: linear-gradient(135deg, #0E5A5A, #1F9A8A 60%, #5BC8B0); --mh-ring: #FFE08A; }
.m-rush { --mh-bg: linear-gradient(135deg, #8A1E2E, #E0533A 55%, #F7A84A); --mh-ring: #FFE08A; }
.m-practice { --mh-bg: linear-gradient(135deg, #1F5A3A, #2F8A52 60%, #7AC87A); --mh-ring: #FFE08A; }
.mode-hero .sky-layer { z-index: -1; opacity: .7; }
.mode-hero .sky-layer .flock-sky .fb { stroke: rgba(255,255,255,.7); }
.mh-text { display: flex; flex-direction: column; gap: 10px; min-width: 0; }
.mh-text h1 { color: #fff; font-size: 44px; }
.mh-text .lede { color: rgba(255,255,255,.88); max-width: 46ch; }
.mh-kicker { display: inline-flex; align-items: center; gap: 8px; align-self: flex-start; padding: 4px 12px 4px 6px; border-radius: 999px; background: rgba(255,255,255,.16); font-weight: 700; font-size: 14px; }
.mh-kicker .ic { width: 24px; height: 24px; padding: 4px; border-radius: 50%; background: rgba(255,255,255,.2); }
.mode-hero .btn.quiet { color: #fff; border-color: rgba(255,255,255,.4); background: rgba(255,255,255,.08); }
.mh-badge { display: flex; flex-direction: column; align-items: center; gap: 8px; }
.mb-ring { width: 150px; height: 150px; border-radius: 50%; display: flex; flex-direction: column; align-items: center; justify-content: center; background: rgba(255,255,255,.12);
  box-shadow: inset 0 0 0 6px var(--mh-ring), 0 0 0 10px rgba(255,255,255,.08); animation: ring-glow 3s ease-in-out infinite; }
@keyframes ring-glow { 50% { box-shadow: inset 0 0 0 6px var(--mh-ring), 0 0 0 16px rgba(255,255,255,.04); } }
.mb-ring .figure { font-size: 48px; color: #fff; } .mb-ring small { font-size: 13px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: rgba(255,255,255,.8); }
.mb-sub { font-size: 14px; font-weight: 600; color: rgba(255,255,255,.9); text-align: center; max-width: 180px; }
.mh-fly { position: absolute; top: 2px; left: 0; z-index: -1; animation: mh-cross 11s linear infinite; }
.mh-fly .bird.flyer { width: 64px; height: 48px; filter: drop-shadow(0 6px 8px rgba(0,0,0,.2)); }
@keyframes mh-cross { 0% { translate: -90px 30px; } 45% { translate: calc(55vw) -10px; } 100% { translate: calc(100vw + 60px) 20px; } }
@media (max-width: 700px) {
  .mode-hero { grid-template-columns: 1fr; padding: 22px 18px; gap: 16px; border-radius: 20px; }
  .mh-text h1 { font-size: 32px; } .mh-badge { flex-direction: row; justify-content: flex-start; } .mb-ring { width: 104px; height: 104px; } .mb-ring .figure { font-size: 34px; } .mb-sub { text-align: left; }
  .mode-hero .row .btn { flex: 1 1 auto; }
}
.steps3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
@media (max-width: 700px) { .steps3 { grid-template-columns: 1fr; gap: 8px; } }
.step3 { position: relative; display: flex; flex-direction: column; gap: 4px; padding: 16px; border-radius: 18px; background: var(--paper); }
.s3-ic { width: 44px; height: 44px; border-radius: 14px; display: grid; place-items: center; background: var(--sky); color: var(--ink-2); margin-bottom: 4px; }
.s3-ic .ic { width: 24px; height: 24px; }
.s3-n { position: absolute; top: 12px; right: 14px; font: 400 26px var(--serif); color: var(--rule-strong); }
@media (max-width: 700px) { .step3 { display: grid; grid-template-columns: 44px 1fr; gap: 0 12px; padding: 12px; } .s3-ic { grid-row: 1 / 3; margin: 0; } }
.pips { display: flex; flex-wrap: wrap; gap: 6px; } .pips i { width: 22px; height: 22px; border-radius: 7px; background: #1F9A8A; box-shadow: inset 0 -3px 0 rgba(0,0,0,.18); }
.pips i.used { background: var(--rule); box-shadow: none; }
.podium { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.podium li { display: grid; grid-template-columns: 34px 1fr auto; align-items: center; gap: 10px; padding: 8px 12px; border-radius: 12px; background: var(--sky); }
.podium li.me { box-shadow: inset 3px 0 0 var(--yolk); }
.pod-n { width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; font-weight: 800; background: var(--rule); }
.podium li:nth-child(1) .pod-n { background: linear-gradient(145deg, #FFE08A, #D9A21E); color: #fff; }
.podium li:nth-child(2) .pod-n { background: linear-gradient(145deg, #D8DEE8, #8E99AE); color: #fff; }
.podium li:nth-child(3) .pod-n { background: linear-gradient(145deg, #E8A870, #B86E3A); color: #fff; }
.podium .figure { font-size: 22px; }
.lvgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 10px; }
.lvhab { display: grid; grid-template-columns: auto 1fr; grid-template-rows: auto auto; gap: 4px 10px; align-items: center; padding: 10px 12px; border-radius: 14px; background: var(--sky); box-shadow: inset 0 -3px 0 color-mix(in srgb, var(--c) 45%, transparent); }
.lvhab .glyph { grid-row: 1 / 3; width: 42px; height: 28px; }
.lvchips { display: flex; gap: 6px; }
.lvchip { min-width: 38px; min-height: 34px; border-radius: 10px; border: 1.5px solid color-mix(in srgb, var(--c) 50%, var(--rule)); background: var(--paper); font-weight: 800; cursor: pointer; transition: translate .15s, background .15s; }
.lvchip:hover { translate: 0 -2px; }
.lvchip.on { background: var(--c); border-color: var(--c); color: #fff; box-shadow: 0 4px 10px color-mix(in srgb, var(--c) 40%, transparent); }
.lvchip.you:not(.on) { border-style: dashed; border-color: var(--yolk); }
@media (prefers-reduced-motion: reduce) { .mh-fly, .mb-ring { animation: none; } }

/* Journey swoops take on the chapter: its colour low in the sky, its scenery rushing by below, and
   what drifts in its air. */
.flight[class*="hab-"] .flight-sky { background: linear-gradient(to bottom, #8FC9F2, color-mix(in srgb, var(--hab) 35%, #FFF3D8)); }
html:is([data-sky="night"], [data-sky="aurora"], [data-sky="cosmos"]) .flight[class*="hab-"] .flight-sky, .flight.hab-night .flight-sky { background: linear-gradient(to bottom, #0B1030, color-mix(in srgb, var(--hab) 40%, #2A2F6A)); }
.flight-ground { position: absolute; left: 0; right: 0; bottom: 0; height: 26vh; display: flex; align-items: flex-end; background: linear-gradient(to top, color-mix(in srgb, var(--hab) 45%, #fff), transparent); animation: ground-in .4s ease-out both; }
.flight-ground span { position: absolute; bottom: 0; left: 100%; animation: ground-rush 1s linear infinite; animation-delay: calc(var(--i) * -.1s); }
.flight-ground .glyph { width: calc(110px * var(--s)); height: calc(74px * var(--s)); }
@keyframes ground-rush { to { translate: calc(-100vw - 260px) 0; } }
@keyframes ground-in { from { opacity: 0; translate: 0 40px; } }
.flight-bits i { position: absolute; right: -20px; top: calc(var(--y) * 1%); animation: ftrail 1.1s linear infinite; animation-delay: calc(var(--d) * -1 - var(--i) * .05s); }
.flight-bits.petal i { width: 12px; height: 8px; border-radius: 80% 0 80% 0; background: color-mix(in srgb, var(--hab) 60%, #F4A3B8); }
.flight-bits.leaf i { width: 14px; height: 9px; border-radius: 100% 0 100% 0; background: color-mix(in srgb, var(--hab) 80%, #2E7D3A); rotate: 30deg; }
.flight-bits.bubble i { width: 12px; height: 12px; border-radius: 50%; border: 2px solid rgba(255,255,255,.85); background: rgba(255,255,255,.25); }
.flight-bits.snow i { width: 8px; height: 8px; border-radius: 50%; background: #fff; box-shadow: 0 0 6px #fff; }
.flight-bits.dust i { width: 6px; height: 6px; border-radius: 50%; background: color-mix(in srgb, var(--hab) 70%, #fff); opacity: .8; }
.flight-bits.star i { width: 4px; height: 4px; border-radius: 50%; background: #fff; box-shadow: 0 0 8px 2px #fff; }
.flight-card .fc-glyph { width: 56px; height: 38px; align-self: center; margin-bottom: 2px; }
@media (prefers-reduced-motion: reduce) { .flight-ground span, .flight-bits i { animation: none; } }
.entry.with-ic { grid-template-columns: auto 1fr auto; column-gap: 14px; }
.entry-ic { grid-row: 1 / 3; align-self: center; width: 44px; height: 44px; border-radius: 14px; display: grid; place-items: center; background: var(--paper); color: var(--ink-2); box-shadow: inset 0 -3px 0 var(--rule); transition: rotate .25s cubic-bezier(.3,1.6,.5,1); }
.entry-ic .ic { width: 22px; height: 22px; }
.entry.with-ic:hover .entry-ic { rotate: -8deg; }
.entry.with-ic > h3, .entry.with-ic > p { grid-column: 2; } .entry.with-ic > .aside { grid-column: 3; grid-row: 1 / 3; }
@media (max-width: 560px) { .entry.with-ic { grid-template-columns: auto 1fr; } .entry.with-ic > .aside { grid-column: 2; grid-row: auto; } .entry.with-ic .entry-ic { grid-row: 1 / 4; align-self: start; } }

/* Back on the map: the stop just played pulses so it's easy to spot. */
.node.just-played { animation: just-played 1.2s ease-out 3; }
@keyframes just-played { 0% { box-shadow: 0 5px 0 color-mix(in srgb, var(--c) 55%, #000), 0 0 0 0 color-mix(in srgb, var(--yolk) 80%, transparent); } 100% { box-shadow: 0 5px 0 color-mix(in srgb, var(--c) 55%, #000), 0 0 0 22px transparent; } }
@media (prefers-reduced-motion: reduce) { .node.just-played { animation: none; outline: 3px solid var(--yolk); outline-offset: 4px; } }

/* ---------- Chirp Plus: the member card, the crowned avatar, the badge ---------- */
.rail-plus.member { position: relative; overflow: hidden; display: flex; gap: 10px; align-items: flex-start; padding: 14px 12px; border: 0; border-radius: 16px; color: #E6E1FF;
  background: linear-gradient(145deg, #2C2170, #5A3FC8 60%, #8A5AE0); box-shadow: inset 0 0 0 1.5px rgba(247,201,72,.55), 0 8px 24px rgba(90,63,200,.35); }
.rail-plus.member::before { content: ""; position: absolute; inset: 0; background: linear-gradient(110deg, transparent 30%, rgba(255,230,150,.35) 48%, transparent 62%); translate: -120% 0; animation: shine 4.5s ease-in-out infinite; pointer-events: none; }
.rail-plus.member .lbl { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.pm-name { font: 400 19px var(--serif); background: linear-gradient(90deg, #FFE08A, #F7C948, #FFF3C4, #F7C948); background-size: 200% 100%; -webkit-background-clip: text; background-clip: text; color: transparent; animation: gold-flow 3s linear infinite; }
@keyframes gold-flow { to { background-position: -200% 0; } }
.rail-plus.member small { font-size: 12px; color: #CFC6FF; }
.pm-crown { width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; flex: none; background: radial-gradient(circle at 35% 30%, #FFE9A0, #D9A21E); box-shadow: 0 0 14px rgba(247,201,72,.6); animation: hover-fly 2.6s ease-in-out infinite; }
.pm-crown .plus-ic { width: 20px; height: 20px; color: #5A3A00; margin: 0; }
.pm-perks { display: flex; align-items: center; gap: 5px; margin-top: 6px; }
.pm-perks span { width: 24px; height: 24px; border-radius: 50%; display: grid; place-items: center; background: rgba(255,255,255,.12); }
.pm-perks .ic { width: 13px; height: 13px; color: #F7C948; }
.pm-perks small { margin-left: 2px; color: #FFE08A; font-weight: 700; }
.shell.folded .rail-plus.member { padding: 10px; justify-content: center; }
.me-btn.plus .me-av { box-shadow: 0 0 0 2px #F7C948, 0 0 10px rgba(247,201,72,.5); }
.me-btn.plus { position: relative; }
.me-btn.plus::after { content: ""; position: absolute; left: 22px; top: -5px; width: 16px; height: 12px; background: #F7C948;
  clip-path: polygon(0 100%, 0 20%, 28% 55%, 50% 0, 72% 55%, 100% 20%, 100% 100%); filter: drop-shadow(0 1px 1px rgba(0,0,0,.3)); }
.plus-badge { display: inline-flex; align-items: center; gap: 4px; padding: 1px 8px 1px 5px; border-radius: 999px; background: linear-gradient(90deg, #5A3FC8, #8A5AE0); color: #FFE08A; font-weight: 700; font-size: 12px; }
.plus-badge .ic { width: 13px; height: 13px; }
.plus-block ul.perks-on { list-style: none; padding-left: 0; }
.plus-block ul.perks-on li::before { content: "✓"; display: inline-block; width: 20px; color: var(--yolk); font-weight: 800; }
@media (prefers-reduced-motion: reduce) { .rail-plus.member::before, .pm-name, .pm-crown { animation: none; } }
@media (min-width: 861px) and (max-height: 940px) { .nav a { padding-block: 5px; } .nav-group { margin-top: 10px; } .rail { gap: 10px; padding-block: 18px; } }
.pm-perks small { white-space: nowrap; }

/* ---------- rewards you can watch arrive ---------- */
.reward-strip { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; padding: 12px; border-radius: 18px; background: var(--paper); box-shadow: inset 0 -4px 0 var(--rule); }
.rw-chip { display: inline-flex; align-items: center; gap: 7px; padding: 6px 14px 6px 6px; border-radius: 999px; font-weight: 700; animation: chip-in .5s cubic-bezier(.3,1.6,.5,1) both; }
.rw-chip b { font: 400 24px/1 var(--serif); }
.rw-chip small { font-size: 13px; opacity: .8; }
.rw-feathers { background: #FFF1CC; color: #7A5600; }
.rw-feathers .ic { width: 30px; height: 30px; padding: 6px; border-radius: 50%; background: linear-gradient(145deg, #FFE08A, #E9A92A); color: #fff; }
.rw-xp { background: #EEE8FF; color: #4A36A8; animation-delay: .12s; }
html.scene-dark .rw-feathers { background: #4A3B16; color: var(--yolk); } html.scene-dark .rw-xp { background: #2E2A5A; color: #C8BCFF; }
@keyframes chip-in { from { opacity: 0; scale: .6; translate: 0 10px; } }
.star4 { width: 30px; height: 30px; border-radius: 50%; background: radial-gradient(circle, #3A2A8A, #1A1450); display: grid; place-items: center; position: relative; }
.star4::before { content: ""; width: 18px; height: 18px; background: linear-gradient(135deg, #FFF6C8, #F7C948 45%, #B98AFF); clip-path: polygon(50% 0, 60% 40%, 100% 50%, 60% 60%, 50% 100%, 40% 60%, 0 50%, 40% 40%); filter: drop-shadow(0 0 4px #FFE08A); animation: twinkle 1.6s ease-in-out infinite; }
.xp-box { position: relative; flex: 1 1 260px; display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 10px; padding: 6px 12px; border-radius: 14px; text-decoration: none; background: linear-gradient(90deg, #1A1450, #2E2170); color: #E6E1FF; }
.xp-tier { font-size: 13px; font-weight: 700; } .xp-tier b { font: 400 20px var(--serif); color: #FFE08A; }
.xp-num { font-size: 13px; font-variant-numeric: tabular-nums; } .xp-num b { font-weight: 800; color: #fff; }
.xp-bar { position: relative; height: 12px; border-radius: 6px; background: rgba(255,255,255,.14); overflow: hidden; }
.xp-fill { position: absolute; inset: 0 auto 0 0; width: 0; border-radius: 6px; background: linear-gradient(90deg, #7A5AE0, #B98AFF, #FFE08A); box-shadow: 0 0 10px #B98AFF; transition: width .35s cubic-bezier(.3,1.2,.5,1); }
.xp-fill::after { content: ""; position: absolute; right: -2px; top: 50%; width: 10px; height: 10px; translate: 0 -50%; border-radius: 50%; background: #fff; box-shadow: 0 0 10px 4px #FFE08A; }
.xp-bar.zap { animation: zap .35s ease-out; }
@keyframes zap { 40% { box-shadow: 0 0 0 3px rgba(255,224,138,.5), 0 0 16px #B98AFF; } }
.tier-up { position: absolute; right: 12px; top: -14px; padding: 3px 10px; border-radius: 999px; background: linear-gradient(90deg, #F7C948, #FFE08A); color: #3A2A00; font-weight: 800; font-size: 13px; opacity: 0; pointer-events: none; }
.tier-up.show { animation: tier-pop 1.8s cubic-bezier(.3,1.6,.5,1) both; }
@keyframes tier-pop { 0% { opacity: 0; scale: .4; } 15% { opacity: 1; scale: 1.2; } 30% { scale: 1; } 80% { opacity: 1; translate: 0 -6px; } 100% { opacity: 0; translate: 0 -14px; } }
/* The flying bits themselves. */
.reward-bit { position: fixed; z-index: 80; pointer-events: none; margin: -10px 0 0 -10px; }
/* A collected reward rising from its button: "+20 feathers · Meadow seed". */
.reward-pop { position: fixed; z-index: 85; pointer-events: none; translate: calc(-50% + var(--sx, 0px)) calc(-100% - 18px); display: flex; align-items: center; gap: 8px;
  padding: 7px 14px 7px 9px; border-radius: 999px; background: var(--paper); color: var(--ink); font: 800 15px var(--sans); white-space: nowrap;
  box-shadow: inset 0 0 0 2px var(--yolk), 0 5px 0 color-mix(in srgb, var(--yolk) 55%, var(--paper)), 0 16px 30px rgba(30,35,68,.22);
  animation: rp-rise 2.3s cubic-bezier(.3,1.4,.5,1) both; }
.rp-item { display: inline-flex; align-items: center; gap: 6px; }
.rp-item + .rp-item { padding-left: 8px; box-shadow: -1.5px 0 0 var(--rule); }
.rp-item > svg, .rp-item > :first-child:not(b) { width: 26px; height: 26px; flex: none; }
.rp-feathers > svg { color: #E9A92A; }
.rp-item.rare b { color: var(--amber-ink); }
@keyframes rp-rise { 0% { opacity: 0; transform: translateY(16px) scale(.5); } 12% { opacity: 1; transform: translateY(0) scale(1.1); } 20% { transform: scale(1); }
  78% { opacity: 1; transform: translateY(-14px); } 100% { opacity: 0; transform: translateY(-36px); } }
@keyframes rp-fade { 0%, 100% { opacity: 0; } 8%, 85% { opacity: 1; } }
/* Where a reward lands gives a little hop: the Nest link for seeds, the ribbon counter for ribbons. */
:is(.nav a, .tabbar a).got .ic { animation: nav-got .5s cubic-bezier(.3,1.8,.5,1); }
.rib-count.got b { display: inline-block; animation: bump .6s cubic-bezier(.3,1.8,.5,1); }
@keyframes nav-got { 35% { scale: 1.55; rotate: -12deg; } }
@media (prefers-reduced-motion: reduce) { .reward-pop { animation-name: rp-fade; } :is(.nav a, .tabbar a).got .ic, .rib-count.got b { animation: none; } }
.bit-feather { width: 22px; height: 22px; color: #E9A92A; filter: drop-shadow(0 2px 3px rgba(0,0,0,.25)); }
.bit-feather svg { width: 100%; height: 100%; }
.bit-star { width: 16px; height: 16px; margin: -8px 0 0 -8px; background: linear-gradient(135deg, #FFF6C8, #F7C948 45%, #B98AFF); clip-path: polygon(50% 0, 60% 40%, 100% 50%, 60% 60%, 50% 100%, 40% 60%, 0 50%, 40% 40%);
  filter: drop-shadow(0 0 6px #FFE08A) drop-shadow(0 0 10px #B98AFF); }
/* The purse in the top bar pops as each feather lands. */
.chip.bump { animation: purse-pop .35s cubic-bezier(.3,1.8,.5,1); }
@keyframes purse-pop { 40% { scale: 1.14; box-shadow: 0 0 0 4px color-mix(in srgb, var(--yolk) 45%, transparent); } }
@media (max-width: 560px) { .xp-box { flex-basis: 100%; } .rw-chip b { font-size: 21px; } }
@media (prefers-reduced-motion: reduce) { .rw-chip, .star4::before, .tier-up.show, .chip.bump, .xp-bar.zap { animation: none; } .tier-up.show { opacity: 1; } }
@media (max-width: 860px) { #result > .meet { order: -2; } #result > .reward-strip { order: -1; } }
@media (max-width: 560px) { .next-row .btn { white-space: nowrap; } .next-row #duet > span { display: none; } .next-row #duet { padding-inline: 14px; } }

/* ---------- the Chirp bird in the wordmark, and the small gold plus beside it ---------- */
.mark { background: none; display: inline-grid; place-items: center; overflow: visible; }
.mark svg { width: 100%; height: 100%; overflow: visible; }
.mark .mk-body { fill: #FF7A59; transition: fill .4s; }
.mark .mk-crown { opacity: 0; transform: translateY(6px) scale(.6); transform-origin: 38px 12px; transform-box: view-box; transition: opacity .3s, transform .4s cubic-bezier(.3,1.6,.5,1); }
.wordmark.plus .mark .mk-body, .mobile-mark.plus .mark .mk-body { fill: url(#markGold); }
.wordmark.plus .mark .mk-crown, .mobile-mark.plus .mark .mk-crown { opacity: 1; transform: none; }
.wordmark.plus .mark, .mobile-mark.plus .mark { filter: drop-shadow(0 0 6px rgba(247,201,72,.55)); }
.rail-head { position: relative; }
.plus-sup { display: grid; place-items: center; width: 22px; height: 22px; flex: none; margin: -18px auto 0 -6px; border-radius: 50%; background: rgba(247,201,72,.14); color: #F7C948; text-decoration: none; box-shadow: inset 0 0 0 1.5px rgba(247,201,72,.55); transition: transform .2s cubic-bezier(.3,1.6,.5,1), background .2s; }
.plus-sup .ic { width: 14px; height: 14px; stroke-width: 3; }
.plus-sup:hover { transform: scale(1.18) rotate(90deg); background: #F7C948; color: #2A1F05; }
.plus-sup.member { background: linear-gradient(135deg, #FFE9A0, #E3A91E); color: #5A3A00; box-shadow: 0 0 10px rgba(247,201,72,.5); }
.plus-sup.member .ic { stroke-width: 2.4; }
.plus-sup.member:hover { transform: scale(1.15) rotate(-8deg); }
.shell.folded .plus-sup { position: absolute; top: -4px; left: 34px; margin: 0; width: 18px; height: 18px; }
.shell.folded .plus-sup .ic { width: 11px; height: 11px; }
.plus-sup.mobile { display: none; }
@media (max-width: 860px) { .plus-sup.mobile { display: grid; margin: -14px 0 0 -4px; background: color-mix(in srgb, #F7C948 18%, transparent); color: #B8860B; } .plus-sup.mobile.member { color: #5A3A00; } }

/* ---------- the nest scene ---------- */
.nest-scene { isolation: isolate; }
.nest-scene .far { position: absolute; inset: 0; width: 100%; height: 100%; z-index: 0; }
.nest-scene .sky-layer { z-index: 0; }
.sun-disc { position: absolute; right: 12%; top: 10%; width: 64px; height: 64px; border-radius: 50%; background: var(--sun); box-shadow: 0 0 40px 10px color-mix(in srgb, var(--sun) 60%, transparent); z-index: 0; animation: sun-breathe 6s ease-in-out infinite; }
.sun-disc.low { top: auto; bottom: 30%; width: 90px; height: 90px; }
.moon-disc { position: absolute; right: 14%; top: 9%; width: 54px; height: 54px; border-radius: 50%; background: #FFF3C4; box-shadow: 0 0 30px 6px rgba(255,243,196,.35); z-index: 0; }
.moon-disc::after { content: ""; position: absolute; left: 12px; top: 14px; width: 9px; height: 9px; border-radius: 50%; background: #EAD9A0; box-shadow: 16px 10px 0 -2px #EAD9A0; }
@keyframes sun-breathe { 50% { box-shadow: 0 0 56px 16px color-mix(in srgb, var(--sun) 50%, transparent); } }
.mist { position: absolute; left: -10%; right: -10%; top: 48%; height: 18%; background: linear-gradient(transparent, rgba(255,255,255,.6), transparent); filter: blur(8px); animation: mist 14s ease-in-out infinite alternate; z-index: 0; }
@keyframes mist { to { translate: 6% 0; } }
.tree { z-index: 1; }
.tree .canopy { opacity: .9; }
.tree .canopy.c2 { opacity: .9; } .tree .canopy.c3 { opacity: .92; }
.tree.t-pine .canopy { animation-duration: 10s; }
.tree .frond { fill: none; stroke-width: 1.4; stroke-linecap: round; vector-effect: non-scaling-stroke; stroke-width: 5; opacity: .85; animation: frond 5s ease-in-out infinite alternate; animation-delay: calc(var(--i) * -.4s); transform-box: fill-box; transform-origin: 50% 0; }
.tree .drape { animation: frond 4.5s ease-in-out infinite alternate; animation-delay: calc(var(--i) * -.33s); transform-box: fill-box; transform-origin: 50% 0; }
.tree .dot { animation: twinkle 3s ease-in-out infinite; animation-delay: calc(var(--i) * -.37s); }
.tree.t-apple .dot, .tree.t-cherry .dot { animation: none; }
.tree.t-golden .canopy { filter: drop-shadow(0 0 4px rgba(255,220,120,.6)); }
@keyframes frond { from { rotate: -3deg; } to { rotate: 3deg; } }
.decor-layer { position: absolute; inset: 0; z-index: 2; pointer-events: none; }
.residents { z-index: 3; }
.bird-card { z-index: 8; }
.placed, .spot { position: absolute; translate: -50% -100%; }
.placed.g, .spot.g { width: clamp(58px, 12%, 112px); aspect-ratio: 1; }
.placed.g.back, .spot.g.back { width: clamp(46px, 9.5%, 90px); z-index: -1; }
.placed.h, .spot.h { translate: -50% 0; width: clamp(40px, 8%, 76px); aspect-ratio: 1; transform-origin: 50% 0; }
.placed.h { animation: hang-sway 4s ease-in-out infinite; animation-delay: calc(var(--d) * -1); }
@keyframes hang-sway { 0%, 100% { rotate: -4deg; } 50% { rotate: 4deg; } }
.placed .decor, .spot .decor { width: 100%; height: 100%; display: block; overflow: visible; }
.placed.g .decor { filter: drop-shadow(0 3px 2px rgba(30,35,68,.18)); }
.placed.g::before { content: ""; position: absolute; left: 12%; right: 12%; bottom: -2px; height: 8%; border-radius: 50%; background: rgba(30,35,68,.16); filter: blur(2px); }
/* Decorating: every open spot shows itself; locked ones say when they open. */
.nest-scene.editing .decor-layer { pointer-events: auto; }
.nest-scene.editing::after { content: ""; position: absolute; inset: 0; background: rgba(30,35,68,.12); z-index: 1; pointer-events: none; }
.nest-scene.editing .residents { opacity: .45; pointer-events: none; }
.spot { border: 0; padding: 0; background: none; cursor: pointer; z-index: 4; border-radius: 14px; }
.spot:not(.filled) { display: grid; place-items: center; }
.spot:not(.filled).g { aspect-ratio: 1.3; }
.spot-mark { display: grid; place-items: center; width: 60%; max-width: 44px; aspect-ratio: 1; border-radius: 50%; background: rgba(255,255,255,.85); color: var(--ink); box-shadow: 0 0 0 3px rgba(255,255,255,.4), 0 6px 16px rgba(30,35,68,.2); animation: spot-pulse 1.8s ease-in-out infinite; }
.spot-mark .ic { width: 55%; height: 55%; }
.spot.locked .spot-mark { background: rgba(30,35,68,.5); color: #fff; animation: none; box-shadow: none; }
.spot.filled { outline: 2px dashed rgba(255,255,255,.9); outline-offset: 2px; }
.spot:hover .spot-mark, .spot:focus-visible .spot-mark { scale: 1.12; background: var(--yolk); }
.spot.filled:hover { outline-color: var(--yolk); }
@keyframes spot-pulse { 50% { box-shadow: 0 0 0 7px rgba(255,255,255,.18), 0 6px 16px rgba(30,35,68,.2); } }
/* Little lives inside the decorations. */
.decor .glow-lamp { animation: lamp 3s ease-in-out infinite; }
.decor .halo { animation: lamp 3s ease-in-out infinite; }
@keyframes lamp { 50% { opacity: .75; } }
.decor .flame { transform-origin: 20px 33px; transform-box: view-box; animation: flame .5s ease-in-out infinite alternate; }
@keyframes flame { to { scale: 1.06 .92; } }
.decor .bee { animation: bee 3s ease-in-out infinite; }
@keyframes bee { 25% { translate: -4px -3px; } 50% { translate: -2px 3px; } 75% { translate: 3px -2px; } }
.decor .blades { transform-box: view-box; animation: spin 6s linear infinite; }
.hat .spin { transform-box: view-box; animation: spin 1.2s linear infinite; }
@keyframes spin { to { rotate: 360deg; } }
.decor .spray { animation: lamp 1.2s ease-in-out infinite; }
.decor .smoke { animation: smoke 3s ease-out infinite; }
@keyframes smoke { from { translate: 0 4px; opacity: .8; } to { translate: 3px -6px; opacity: 0; } }
.decor .notes-up { animation: notes-up 2.6s ease-out infinite; }
@keyframes notes-up { from { translate: 0 6px; opacity: 0; } 30% { opacity: 1; } to { translate: 2px -8px; opacity: 0; } }
.decor .fish { animation: fish 5s ease-in-out infinite; }
@keyframes fish { 50% { translate: -8px .3px; } }
.decor .twinkle-bit { transform-box: fill-box; transform-origin: center; animation: twinkle 1.8s ease-in-out infinite; }
.decor .bulb { animation: twinkle 1.6s ease-in-out infinite; animation-delay: calc(var(--i) * -.3s); transform-box: fill-box; transform-origin: center; }
.decor .chime-swing { transform-origin: 20px 7px; transform-box: view-box; animation: chime 3s ease-in-out infinite; }
@keyframes chime { 0%, 100% { rotate: -5deg; } 50% { rotate: 5deg; } }
.decor .disco-tiles { animation: lamp .8s steps(2) infinite; }
/* What drifts through the air. */
.air { position: absolute; inset: 0; pointer-events: none; z-index: 5; overflow: hidden; }
.air i { position: absolute; left: calc(var(--x) * 1%); top: -12px; }
.air-petals i { width: 9px; height: 6px; border-radius: 80% 0 80% 0; background: #F7B5C8; animation: fall calc(9s + var(--i) * .6s) linear infinite; animation-delay: calc(var(--i) * -1.3s); }
.air-leaves i { width: 10px; height: 8px; border-radius: 100% 0 100% 0; background: #E0572A; animation: fall calc(10s + var(--i) * .5s) linear infinite; animation-delay: calc(var(--i) * -1.5s); }
.air-leaves i:nth-child(3n) { background: #F2A03C; } .air-leaves i:nth-child(4n) { background: #C8371F; }
.air-snow i { width: 6px; height: 6px; border-radius: 50%; background: #fff; box-shadow: 0 0 4px rgba(255,255,255,.8); animation: fall calc(11s + var(--i) * .5s) linear infinite; animation-delay: calc(var(--i) * -1.1s); }
.air-sparkle i { width: 8px; height: 8px; background: #FFE9A0; clip-path: polygon(50% 0, 62% 38%, 100% 50%, 62% 62%, 50% 100%, 38% 62%, 0 50%, 38% 38%); top: calc(var(--y) * 1%); animation: twinkle 2.2s ease-in-out infinite; animation-delay: calc(var(--i) * -.4s); }
.air-stars { z-index: 0; } .air-stars i { width: 3px; height: 3px; border-radius: 50%; background: #fff; top: calc(var(--y) * .8%); animation: twinkle 2.4s ease-in-out infinite; animation-delay: calc(var(--i) * -.3s); }
.air-aurora { position: absolute; inset: -10% -10% 45%; background: linear-gradient(100deg, transparent 15%, rgba(80,240,180,.45) 38%, rgba(120,140,255,.4) 55%, transparent 78%); filter: blur(12px); animation: aurora 8s ease-in-out infinite alternate; z-index: 0; }
.air-gulls { position: absolute; inset: 0; z-index: 0; pointer-events: none; }
.air-gulls i { position: absolute; top: calc(12% + var(--i) * 7%); left: -20px; width: 14px; height: 6px; border: 2px solid #3A4A6A; border-bottom: 0; border-radius: 50% 50% 0 0 / 100% 100% 0 0; animation: gull calc(24s + var(--i) * 6s) linear infinite; animation-delay: calc(var(--i) * -9s); }
@keyframes gull { to { translate: 110vw -20px; } }
@keyframes fall { from { translate: 0 0; rotate: 0deg; } to { translate: 60px 620px; rotate: 540deg; } }
@media (prefers-reduced-motion: reduce) {
  .air, .air-aurora, .air-gulls, .mist { display: none; }
  .sun-disc, .tree .frond, .tree .drape, .tree .dot, .placed.h, .decor *, .hat .spin, .spot-mark { animation: none !important; }
}

/* ---------- the page around the scene ---------- */
.nest-actions { gap: 10px; align-items: center; }
.small-purse { padding: 6px 14px 6px 10px; }
.small-purse .fea { width: 18px; height: 18px; color: var(--amber); }
.edit-hint { display: flex; align-items: center; gap: 6px; margin-top: -8px; }
.edit-hint .ic { width: 16px; height: 16px; }
.edit-hint .link { font-size: inherit; }
.small-btn { min-height: 34px; padding: 5px 14px; font-size: 14px; border-radius: 9px; }
.small-btn .fea { width: 15px; height: 15px; }
.icon-btn { width: 36px; height: 36px; border: 0; border-radius: 10px; background: var(--sky); color: var(--ink); font-size: 22px; line-height: 1; cursor: pointer; }
.icon-btn:hover { background: var(--rule); }
.back-link { display: inline-flex; align-items: center; gap: 2px; text-decoration: none; color: var(--ink-3); font-weight: 600; }
.back-link .ic { width: 16px; height: 16px; }
.big-tag { display: inline-flex; align-items: center; gap: 6px; font-size: 15px; padding: 8px 14px; border-radius: 999px; background: var(--paper); color: var(--berry); }
.big-tag .ic, .tag .ic { width: 15px; height: 15px; }
.tag { display: inline-flex; align-items: center; gap: 4px; }
.cosy-chip { align-self: flex-start; font-size: 12px; font-weight: 700; color: #9A5A08; background: color-mix(in srgb, var(--yolk) 22%, transparent); padding: 2px 8px; border-radius: 999px; }
html.scene-dark .cosy-chip { color: var(--yolk); }

/* The decorating drawer: items for one spot, owned first. */
.decor-drawer { background: var(--paper); border-radius: 20px; padding: 16px 18px 20px; box-shadow: 0 14px 40px rgba(30,35,68,.14); animation: panel-pop .35s cubic-bezier(.3,1.4,.5,1); scroll-margin: 90px; }
.dd-head { display: flex; justify-content: space-between; gap: 12px; align-items: flex-start; flex-wrap: wrap; margin-bottom: 14px; }
.dd-head h2 { font-size: 22px; }
.dd-head .row { gap: 8px; align-items: center; }
.dtab { border: 1px solid var(--rule-strong); background: none; border-radius: 999px; padding: 6px 14px; font-weight: 600; color: var(--ink-2); cursor: pointer; }
.dtab[aria-selected="true"] { background: var(--ink); color: var(--paper); border-color: var(--ink); }
.ditems { display: grid; grid-template-columns: repeat(auto-fill, minmax(128px, 1fr)); gap: 12px; max-height: 420px; overflow-y: auto; padding: 4px; }
.ditem { display: flex; flex-direction: column; align-items: center; gap: 6px; text-align: center; padding: 12px 8px; border-radius: 14px; background: var(--sky); transition: transform .2s cubic-bezier(.3,1.6,.5,1); }
.ditem:hover { transform: translateY(-3px); }
.ditem.on { box-shadow: inset 0 0 0 2px var(--leaf); }
.ditem .preview { height: 70px; display: grid; place-items: center; }
.ditem .preview .decor, .ditem .preview .plant { width: 64px; height: 64px; }
.ditem .name { font-weight: 700; font-size: 14px; line-height: 1.2; }
.ditem .small .ic { width: 13px; height: 13px; vertical-align: -2px; }
.ditem.unowned .preview { filter: saturate(.85); }
.seed-facts { display: flex; gap: 8px; font-size: 12px; color: var(--ink-3); font-weight: 600; }
.seed-facts span { display: inline-flex; align-items: center; gap: 2px; }
.seed-facts .fea { width: 12px; height: 12px; color: var(--amber); }

/* Garden and gift side by side. */
.nest-grid { display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(260px, 1fr); gap: 16px; align-items: start; }
.nest-grid.one { grid-template-columns: 1fr; }
@media (max-width: 860px) { .nest-grid { grid-template-columns: 1fr; } }
.garden { background: var(--paper); border-radius: 20px; padding: 16px 18px; box-shadow: inset 0 -5px 0 color-mix(in srgb, #8A5A2B 35%, transparent); }
.garden h2 { display: flex; align-items: center; gap: 8px; }
.garden h2 .ic { width: 22px; height: 22px; color: var(--leaf-ink); }
.plots { display: grid; grid-template-columns: repeat(auto-fill, minmax(118px, 1fr)); gap: 10px; }
.plot { position: relative; display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 10px 8px 12px; border-radius: 16px; background: linear-gradient(to bottom, color-mix(in srgb, #8FC9F2 18%, var(--paper)), color-mix(in srgb, #C9955A 20%, var(--paper))); border: 0; font: inherit; color: inherit; text-align: center; }
button.plot { cursor: pointer; }
button.plot:hover { transform: translateY(-2px); box-shadow: 0 8px 18px rgba(30,35,68,.1); }
.plot .plant { width: 76px; height: 76px; overflow: visible; }
.plot b { font-size: 14px; }
.plot.ripe { box-shadow: 0 0 0 2px var(--yolk), 0 8px 24px color-mix(in srgb, var(--yolk) 30%, transparent); }
.plot.ripe .plant { animation: ripe-bob 1.6s ease-in-out infinite; transform-origin: 50% 100%; }
@keyframes ripe-bob { 50% { transform: scale(1.06) rotate(-2deg); } }
.plot.locked { background: repeating-linear-gradient(45deg, var(--sky), var(--sky) 8px, var(--paper) 8px, var(--paper) 16px); color: var(--ink-3); justify-content: center; min-height: 150px; }
.plot.locked > .ic { width: 26px; height: 26px; }
.plot.empty .plant { opacity: .8; }
.plot.just-planted .plant { animation: plant-pop .6s cubic-bezier(.3,1.7,.5,1); }
@keyframes plant-pop { from { transform: scale(.4); } }
.plot.watering::after { content: ""; position: absolute; left: 50%; top: 10px; width: 6px; height: 10px; border-radius: 50% 50% 50% 50% / 60% 60% 40% 40%; background: #6FB8E8; box-shadow: -14px -6px 0 #6FB8E8, 12px -10px 0 #6FB8E8; animation: rain .8s ease-in 2; }
@keyframes rain { from { translate: 0 -10px; opacity: 1; } to { translate: 0 40px; opacity: 0; } }
.drops { display: flex; gap: 2px; }
.drops i { color: var(--rule-strong); display: grid; } .drops i .ic { width: 14px; height: 14px; }
.drops i.on { color: #3E9AD0; } .drops i.on .ic { fill: #6FB8E8; }
.ok-note { display: inline-flex; align-items: center; gap: 4px; color: var(--leaf-ink); font-weight: 600; }
.ok-note .ic { width: 14px; height: 14px; }
.plot .btn .ic { width: 16px; height: 16px; }
.gift { align-self: stretch; }

/* The cosiness track: where the nest is, and what each level opens. */
.cosy { background: var(--paper); border-radius: 20px; padding: 18px; display: flex; flex-direction: column; gap: 14px; }
.cosy-head { display: flex; gap: 18px; align-items: center; flex-wrap: wrap; }
.cosy-meter { flex: 1; min-width: 220px; display: flex; flex-direction: column; gap: 6px; }
.cosy .jbar { height: 10px; border-radius: 5px; } .cosy .jbar i { background: linear-gradient(90deg, #F2A6C0, var(--yolk)); border-radius: 5px; }
.lv-track { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(6, minmax(150px, 1fr)); gap: 10px; overflow-x: auto; padding-bottom: 4px; }
.lv-track > li { display: flex; flex-direction: column; gap: 4px; padding: 12px; border-radius: 14px; background: var(--sky); position: relative; }
.lv-track > li b { font: 400 17px var(--serif); }
.lv-track ul { margin: 4px 0 0; padding-left: 16px; font-size: 13px; color: var(--ink-2); display: flex; flex-direction: column; gap: 3px; }
.lv-dot { width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; background: var(--paper); color: var(--ink-3); }
.lv-dot .ic { width: 16px; height: 16px; }
.lv-track .done { opacity: .75; }
.lv-track .done .lv-dot { background: var(--leaf); color: #fff; }
.lv-track .now { background: color-mix(in srgb, var(--yolk) 18%, var(--paper)); box-shadow: inset 0 0 0 2px var(--yolk); }
.lv-track .now .lv-dot { background: var(--yolk); color: var(--on-yolk); animation: gift-wiggle 2.4s ease-in-out infinite; }
.lv-track .ahead ul { color: var(--ink-3); }

/* Visitors, and other people's nests. */
.vlog { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; }
.vlog li { display: flex; gap: 6px; align-items: baseline; padding: 8px 0; border-bottom: 1px solid var(--rule); flex-wrap: wrap; }
.vlog li a { font-weight: 700; }
.vlog li .muted { margin-left: auto; }
.nest-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 12px; }
.nest-card { display: flex; gap: 12px; align-items: center; padding: 10px; border-radius: 16px; background: var(--paper); text-decoration: none; color: inherit; transition: transform .2s cubic-bezier(.3,1.6,.5,1), box-shadow .2s; }
.nest-card:hover { transform: translateY(-3px); box-shadow: 0 10px 24px rgba(30,35,68,.12); }
.nc-view { position: relative; width: 84px; height: 84px; flex: none; border-radius: 12px; overflow: hidden; }
.nc-view .bd-chip { position: absolute; inset: 0; width: 100%; height: 100%; border-radius: 0; }
.nc-tree { position: absolute; left: 8px; bottom: 2px; width: 60px; height: 60px; } .nc-tree .decor { width: 100%; height: 100%; }
.nc-pip { position: absolute; right: 2px; bottom: 2px; } .nc-pip .bird { width: 34px; height: 33px; }
.nc-txt { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.nc-txt b { font: 400 18px var(--serif); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.nc-tags { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 2px; }
.tag.thirsty { color: #2E7FB8; } .tag.done { color: var(--leaf-ink); }
.visit-others .row .btn .ic { width: 18px; height: 18px; }
.plus-badge .ic { width: 14px; height: 14px; vertical-align: -2px; }

/* Shop previews for nest items. */
.aisle-sub { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; margin: 26px 0 12px; font: 400 21px var(--serif); }
.aisle-sub small { font: 400 14px var(--sans); }
.ware .preview .decor { width: 64px; height: 64px; }
.decor-chip { display: grid; place-items: end center; width: 72px; height: 64px; border-radius: 12px; background: linear-gradient(to bottom, color-mix(in srgb, #8FC9F2 25%, var(--paper)) 70%, color-mix(in srgb, #6DBB5E 35%, var(--paper)) 70%); }
.decor-chip.hang { place-items: start center; background: linear-gradient(to bottom, #8A5A2B 0 5px, color-mix(in srgb, #8FC9F2 25%, var(--paper)) 5px); }
.decor-chip .decor { width: 56px; height: 56px; }
.bd-chip { display: block; width: 110px; height: 64px; border-radius: 12px; overflow: hidden; }
.bd-chip svg { width: 100%; height: 100%; display: block; }
.tree-chip { width: 64px; height: 64px; }
.tree-chip.shiny { filter: drop-shadow(0 0 5px rgba(255,220,120,.6)); }

/* More trails, skies and celebrations for Pip. */
.t-leaves i { width: 9px; height: 7px; border-radius: 100% 0 100% 0; background: #E0572A; } .t-leaves i:nth-child(2n) { background: #F2A03C; }
.t-snow i { width: 6px; height: 6px; border-radius: 50%; background: #fff; box-shadow: 0 0 0 1px #C9D6E4; }
.t-hearts i { width: auto; height: auto; font-style: normal; font-size: 11px; color: #E0607F; } .t-hearts i::before { content: "♥"; }
.t-stars i { width: 6px; height: 6px; border-radius: 50%; background: #FFF3B0; box-shadow: 0 0 6px #F7C948; }
html[data-trail="leaves"] .ftrail i { width: 14px; height: 11px; border-radius: 100% 0 100% 0; background: #E0572A; } html[data-trail="leaves"] .ftrail i:nth-child(2n) { background: #F2A03C; }
html[data-trail="snow"] .ftrail i { width: 9px; height: 9px; border-radius: 50%; background: #fff; box-shadow: 0 0 4px #BFE6F5; }
html[data-trail="hearts"] .ftrail i { width: auto; height: auto; font-style: normal; font-size: 20px; color: #E0607F; } html[data-trail="hearts"] .ftrail i::before { content: "♥"; }
html[data-trail="stars"] .ftrail i { width: 8px; height: 8px; border-radius: 50%; background: #FFF3B0; box-shadow: 0 0 10px 2px #F7C948; }
.s-golden { --sky-bg: linear-gradient(#F2A94A, #FCE0A8 60%, #FFF3D8); }
.s-golden i:first-child { width: 30px; height: 30px; border-radius: 50%; background: #FFE08A; left: 80px; bottom: 4px; box-shadow: 0 0 22px #FFB04A; }
.s-twilight { --sky-bg: linear-gradient(#2A2F6A, #7A5AB8 60%, #E08AB0); }
.s-twilight i { width: 2px; height: 2px; border-radius: 50%; background: #fff; left: calc(var(--x) * 1%); top: calc(var(--y) * .5%); animation: twinkle 2s ease-in-out infinite; animation-delay: calc(var(--i) * -.3s); }
.s-ocean { --sky-bg: linear-gradient(#7FC8F0 55%, #3E9AD0 55%, #2E7FB8); }
.s-ocean i:nth-child(-n+3) { width: 18px; height: 2px; border-radius: 2px; background: rgba(255,255,255,.7); top: calc(38px + var(--i) * 6px); left: calc(var(--x) * 1%); animation: demo-drift 6s linear infinite alternate; }
html[data-sky="golden"] { --sky-top: #F2A94A; } html[data-sky="twilight"] { --sky-top: #3A2F7A; } html[data-sky="ocean"] { --sky-top: #6FB8E8; }
html[data-sky="golden"] .flight-sky { background: linear-gradient(#F2A94A, #FCE0A8 60%, #FFF3D8); }
html[data-sky="twilight"] .flight-sky { background: linear-gradient(#2A2F6A, #7A5AB8 60%, #E08AB0); }
html[data-sky="ocean"] .flight-sky { background: linear-gradient(#7FC8F0, #BFE6F5 60%, #3E9AD0); }
html[data-sky="twilight"] .stave.habitat .stave-head .say { color: #fff; } html[data-sky="twilight"] .stave.habitat .stave-head .sub { color: #E0D4F5; }
html[data-sky="twilight"] .sky-layer .twk { display: block; width: 3px; height: 3px; border-radius: 50%; background: #fff; animation: twinkle 2s ease-in-out infinite; animation-delay: calc(var(--i) * -.3s); }
.b-petals i { width: 8px; height: 6px; border-radius: 80% 0 80% 0; background: #F4A3B8; } .b-petals i:nth-child(2n) { background: #FBD3E0; }
.b-notes i { width: auto; height: auto; font-style: normal; font-size: 13px; color: var(--k6); line-height: 1; } .b-notes i::before { content: "♪"; } .b-notes i:nth-child(2n)::before { content: "♫"; color: var(--k0); }
.b-gold i { width: 10px; height: 10px; border-radius: 50%; background: radial-gradient(circle at 35% 30%, #FFF0A0, #E3B23C 60%, #B8860B); }
.fx.fx-petals { width: 14px; height: 10px; margin: -5px 0 0 -7px; border-radius: 80% 0 80% 0; background: #F4A3B8; } .fx.fx-petals:nth-child(2n) { background: #FBD3E0; }
.fx.fx-notes { font-size: 24px; line-height: 1; margin: -12px 0 0 -7px; color: var(--c); } .fx.fx-notes::before { content: "♪"; } .fx.fx-notes:nth-child(2n)::before { content: "♫"; }
.fx.fx-gold { width: 16px; height: 16px; margin: -8px 0 0 -8px; border-radius: 50%; background: radial-gradient(circle at 35% 30%, #FFF0A0, #E3B23C 60%, #B8860B); box-shadow: 0 0 8px rgba(247,201,72,.6); }

/* ---------- one centred column: the top bar lines up with the page, and stays on screen ---------- */
.view { margin-inline: auto; }
.top { position: sticky; top: 0; z-index: 20; padding: 14px max(40px, calc((100% - 920px) / 2 + 40px)); background: color-mix(in srgb, var(--sky) 86%, transparent); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); transition: box-shadow .2s; }
.foot { padding-inline: max(40px, calc((100% - 920px) / 2 + 40px)); }
html { scroll-padding-top: calc(var(--top-h, 70px) + 12px); }
.jtop { top: var(--top-h, 0px); }
@media (max-width: 860px) {
  .top { padding: 12px 16px; top: env(safe-area-inset-top, 0px); }
  .foot { padding-inline: 16px; }
  .jtop { top: calc(var(--top-h, 0px) + env(safe-area-inset-top, 0px)); }
}
/* The journey's shortcut back to Pip's stop. */
.to-pip { position: fixed; right: max(24px, calc((100vw - 232px - 920px) / 2 + 40px)); bottom: 28px; z-index: 15; display: flex; align-items: center; gap: 10px; padding: 8px 18px 8px 10px; border: 0; border-radius: 999px; background: var(--ink); color: var(--paper); font: inherit; text-align: left; cursor: pointer; box-shadow: 0 12px 30px rgba(30,35,68,.3); animation: to-pip-in .35s cubic-bezier(.3,1.5,.5,1); transition: transform .15s; }
.to-pip[hidden] { display: none; }
.to-pip:hover { transform: translateY(-2px); }
.to-pip:active { transform: scale(.96); }
.to-pip .bird { width: 40px; height: 39px; animation: to-pip-hop 1.8s ease-in-out infinite; }
@keyframes to-pip-hop { 50% { translate: 0 -3px; } }
.to-pip span { display: flex; flex-direction: column; line-height: 1.25; }
.to-pip small { font-size: 12px; opacity: .75; }
.shell.folded .to-pip { right: max(24px, calc((100vw - 76px - 920px) / 2 + 40px)); }
@keyframes to-pip-in { from { opacity: 0; translate: 0 16px; scale: .9; } }
@media (max-width: 860px) { .to-pip { right: 16px; bottom: calc(76px + env(safe-area-inset-bottom, 0px)); } }
@media (prefers-reduced-motion: reduce) { .to-pip, .to-pip .bird { animation: none; } }

/* ---------- lessons: a banner, then a path of lesson cards ---------- */
.m-learn { --mh-bg: linear-gradient(135deg, #7A2E5A, #C0507A 55%, #F08AA8); --mh-ring: #FFE08A; }
.m-leaders { --mh-bg: linear-gradient(135deg, #7A4A08, #C98A1E 55%, #F2C45A); --mh-ring: #FFF3C4; }
.mode-hero { animation: hero-tint .45s ease-out; }
@keyframes hero-tint { from { filter: saturate(.6) brightness(1.1); } }
.lmeter { height: 10px; border-radius: 5px; } .lmeter i { background: linear-gradient(90deg, #F08AA8, var(--yolk)); border-radius: 5px; }
.lpath { list-style: none; margin: 6px 0 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.lstep { position: relative; display: grid; grid-template-columns: 48px 1fr; gap: 14px; align-items: center; }
.lstep::before { content: ""; position: absolute; left: 23px; top: -10px; bottom: -10px; width: 2px; background: var(--rule); z-index: 0; }
.lstep:first-child::before { top: 50%; } .lstep:last-child::before { bottom: 50%; }
.lstep.passed::before { background: var(--leaf); }
.lnode { position: relative; z-index: 1; width: 48px; height: 48px; border-radius: 50%; display: grid; place-items: center; font: 400 20px var(--serif); background: var(--paper); color: var(--ink-2); box-shadow: inset 0 0 0 2px var(--rule-strong); }
.lnode .ic { width: 22px; height: 22px; }
.lstep.passed .lnode { background: var(--leaf); color: #fff; box-shadow: none; }
.lstep.next .lnode { background: var(--yolk); color: var(--on-yolk); box-shadow: 0 0 0 6px color-mix(in srgb, var(--yolk) 30%, transparent); animation: gift-wiggle 2.4s ease-in-out infinite; }
.lstep.locked .lnode { background: var(--sky); color: var(--ink-3); box-shadow: inset 0 0 0 2px var(--rule); }
.lcard { display: flex; align-items: center; gap: 16px; padding: 14px 16px; border-radius: 16px; background: var(--sky); transition: transform .2s cubic-bezier(.3,1.6,.5,1), box-shadow .2s; }
.lcard:hover { transform: translateX(3px); box-shadow: 0 8px 20px rgba(30,35,68,.08); }
.lstep.next .lcard { background: color-mix(in srgb, var(--yolk) 16%, var(--paper)); box-shadow: inset 0 0 0 2px var(--yolk); }
.lstep.passed .lcard { box-shadow: inset 4px 0 0 var(--leaf); }
.lstep.locked .lcard { opacity: .8; }
.lc-body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.lc-body h3 { font: 400 20px var(--serif); margin: 0; }
.lc-body p { color: var(--ink-2); font-size: 15px; }
.lc-kicker { font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; color: var(--ink-3); }
.lc-pass { color: var(--leaf-ink); }
.lcard .btn { flex: none; }
.lcard .btn .ic { width: 16px; height: 16px; }
@media (max-width: 560px) { .lstep { grid-template-columns: 38px 1fr; gap: 10px; } .lnode { width: 38px; height: 38px; font-size: 17px; } .lstep::before { left: 18px; } .lcard { flex-direction: column; align-items: flex-start; } .lcard .btn { align-self: stretch; } }

/* ---------- leaderboards: a podium for the top three, then the rest ---------- */
.lb-tabs { border: 0; gap: 8px; }
.lb-tabs button { border: 1px solid var(--rule-strong); border-radius: 999px; padding: 8px 16px; margin: 0; color: var(--ink-2); background: none; cursor: pointer; transition: background .2s, color .2s; }
.lb-tabs button:hover { background: var(--paper); }
.lb-tabs button[aria-pressed="true"] { background: var(--ink); border-color: var(--ink); color: var(--paper); }
.lb-card { gap: 18px; padding: 22px; }
.podium { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; align-items: end; max-width: 560px; width: 100%; margin: 0 auto; }
.podium:has(.pod:only-child) { grid-template-columns: minmax(0, 180px); justify-content: center; }
.pod { display: flex; flex-direction: column; align-items: center; gap: 4px; text-decoration: none; color: inherit; min-width: 0; }
.pod-bird { position: relative; animation: nest-bob 2.6s ease-in-out infinite; }
.pod-bird .bird { width: 64px; height: 62px; }
.pod.gold .pod-bird .bird { width: 80px; height: 78px; }
.pod-crown { position: absolute; left: 50%; top: -18px; translate: -30% 0; color: #E3A91E; } .pod-crown .ic { width: 26px; height: 26px; fill: #F7C948; }
.pod-name { font-weight: 700; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pod-val { font-size: 22px; }
.pod-step { width: 100%; height: calc(var(--h) * 120px); border-radius: 14px 14px 6px 6px; display: grid; place-items: start center; padding-top: 10px; margin-top: 6px; }
.pod-step .figure { font-size: 30px; color: #fff; text-shadow: 0 2px 0 rgba(0,0,0,.15); }
.pod.gold .pod-step { background: linear-gradient(#F7D35A, #D99A1E); }
.pod.silver .pod-step { background: linear-gradient(#D6DCE6, #9AA3B5); }
.pod.bronze .pod-step { background: linear-gradient(#E9A87A, #B5673A); }
.pod.me .pod-name::after { content: " (you)"; color: var(--ink-3); font-weight: 500; }
.pod:hover .pod-bird { animation-duration: .6s; }
.lrows { display: flex; flex-direction: column; gap: 6px; }
.lrow { display: grid; grid-template-columns: 44px minmax(0, 1fr) minmax(80px, 30%) auto; gap: 14px; align-items: center; padding: 10px 14px; border-radius: 12px; background: var(--sky); text-decoration: none; color: inherit; transition: transform .15s; }
.lrow:hover { transform: translateX(3px); }
.lrow.me { background: var(--yolk-soft); box-shadow: inset 3px 0 0 var(--yolk); }
.lr-rank { font-size: 20px; color: var(--ink-3); text-align: center; }
.lr-name { display: flex; flex-direction: column; min-width: 0; } .lr-name b { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lr-bar { height: 8px; border-radius: 4px; background: var(--rule); overflow: hidden; } .lr-bar i { display: block; height: 100%; background: linear-gradient(90deg, #F2C45A, #C98A1E); border-radius: 4px; }
.lr-val { font-size: 20px; min-width: 56px; text-align: right; }
.lb-foot { text-align: center; }
@media (max-width: 560px) { .lrow { grid-template-columns: 34px minmax(0, 1fr) auto; } .lr-bar { display: none; } .pod-bird .bird { width: 48px; height: 46px; } .pod.gold .pod-bird .bird { width: 60px; height: 58px; } }
@media (prefers-reduced-motion: reduce) { .pod-bird, .lstep.next .lnode, .mode-hero { animation: none; } }

/* ---------- season track: drag or swipe, no scrollbar ---------- */
.sp-frame { position: relative; }
.sp-scroll { overflow-x: auto; scrollbar-width: none; cursor: grab; user-select: none; -webkit-user-select: none; overscroll-behavior-x: contain;
  --lane: 56px; --fade-l: linear-gradient(90deg, #000 var(--lane), transparent var(--lane), #000 calc(var(--lane) + 44px)); --fade-r: linear-gradient(90deg, #000 calc(100% - 44px), transparent);
  -webkit-mask-image: var(--fade-l), var(--fade-r); mask-image: var(--fade-l), var(--fade-r); -webkit-mask-composite: source-in; mask-composite: intersect; }
.sp-scroll::-webkit-scrollbar { display: none; }
.sp-scroll.at-start { -webkit-mask-image: var(--fade-r); mask-image: var(--fade-r); }
.sp-scroll.at-end { -webkit-mask-image: var(--fade-l); mask-image: var(--fade-l); }
@media (max-width: 560px) { .sp-scroll { --lane: 40px; } }
.sp-scroll.at-start.at-end { -webkit-mask-image: none; mask-image: none; }
.sp-scroll.dragging { cursor: grabbing; }
.sp-scroll.dragging * { pointer-events: none; }
.sp-arrow { position: absolute; top: 50%; z-index: 5; translate: 0 -50%; width: 44px; height: 44px; border: 0; border-radius: 50%; display: grid; place-items: center; background: var(--paper); color: var(--ink); cursor: pointer; box-shadow: 0 6px 18px rgba(30,35,68,.18); transition: transform .15s, background .15s; }
.sp-arrow[hidden] { display: none; }
.sp-arrow:hover { transform: scale(1.08); background: var(--yolk); color: var(--on-yolk); }
.sp-arrow svg { width: 22px; height: 22px; }
.sp-arrow.prev { left: -14px; } .sp-arrow.next { right: -14px; }
@media (hover: none) { .sp-arrow { display: none; } .sp-scroll { cursor: auto; } }

/* ---------- materials: seed packets, crops, ribbons ---------- */
.mat { width: 30px; height: 36px; flex: none; display: inline-block; vertical-align: middle; }
.mat.crop-ic { display: inline-grid; place-items: center; } .mat.crop-ic .plant { width: 36px; height: 36px; }
.seed-pkt.rare { filter: drop-shadow(0 0 4px rgba(247,201,72,.7)); }
.rw-drop { background: color-mix(in srgb, var(--leaf) 14%, var(--paper)); color: var(--ink); text-decoration: none; animation-delay: calc(.2s + var(--i) * .12s); }
.rw-drop.rare { background: color-mix(in srgb, var(--yolk) 28%, var(--paper)); box-shadow: 0 0 0 1.5px var(--yolk); }
.rw-drop .mat { width: 26px; height: 32px; }
.market, .pouch { background: var(--paper); border-radius: 20px; padding: 16px 18px; }
.market h2, .pouch h2 { display: flex; align-items: center; gap: 8px; }
.market h2 .ic, .pouch h2 .ic { width: 22px; height: 22px; color: var(--amber-ink); }
.pouch h2 .ic { color: var(--leaf-ink); }
.wants { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; padding: 10px 12px; border-radius: 14px; background: color-mix(in srgb, var(--yolk) 16%, var(--paper)); }
.want { display: inline-flex; align-items: center; gap: 4px; padding: 2px 10px 2px 2px; border-radius: 999px; background: var(--paper); font-weight: 600; font-size: 14px; }
.want b { color: var(--amber-ink); }
.want .mat.crop-ic .plant { width: 28px; height: 28px; }
.mrows { display: flex; flex-direction: column; gap: 6px; }
.mrow { display: flex; align-items: center; gap: 10px; padding: 6px 10px; border-radius: 12px; background: var(--sky); }
.mrow.hot { box-shadow: inset 3px 0 0 var(--yolk); background: color-mix(in srgb, var(--yolk) 10%, var(--sky)); }
.mr-name { flex: 1; display: flex; flex-direction: column; min-width: 0; line-height: 1.25; }
.mr-act { gap: 6px; flex-wrap: nowrap; }
.pouch-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(84px, 1fr)); gap: 8px; }
.pkt { display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 8px 4px; border: 0; border-radius: 12px; background: var(--sky); font: inherit; font-size: 12px; font-weight: 600; color: var(--ink-2); cursor: pointer; text-align: center; transition: transform .2s cubic-bezier(.3,1.6,.5,1); }
.pkt:hover { transform: translateY(-3px) rotate(-3deg); }
.pkt .mat { width: 34px; height: 42px; }
.pkt b { font: 400 16px var(--serif); color: var(--ink); }
.pkt.rare { background: color-mix(in srgb, var(--yolk) 18%, var(--sky)); }
.pouch .ribbon-ic { width: 18px; height: 22px; vertical-align: -5px; }
.ditem.rare-item { box-shadow: inset 0 0 0 2px var(--yolk); }
.ditem .seed-pkt { width: 48px; height: 58px; }
a.plot.locked { text-decoration: none; }

/* ---------- the workbench ---------- */
.bench { background: var(--paper); border-radius: 20px; padding: 16px 18px 18px; box-shadow: inset 0 -5px 0 color-mix(in srgb, #8A5A2B 30%, transparent); }
.bench h2 { display: flex; align-items: center; gap: 8px; } .bench h2 .ic { width: 22px; height: 22px; color: #8A5A2B; }
.recipes { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 10px; }
.recipe { display: grid; grid-template-columns: 64px 1fr; grid-template-rows: auto auto; gap: 6px 12px; align-items: center; padding: 10px 12px; border-radius: 16px; background: var(--sky); transition: transform .2s cubic-bezier(.3,1.6,.5,1); }
.recipe:hover { transform: translateY(-2px); }
.recipe > .btn, .recipe > .st, .recipe > .small { grid-column: 2; justify-self: start; }
.rc-art { grid-row: 1 / 3; width: 64px; height: 64px; display: grid; place-items: end center; border-radius: 12px; background: linear-gradient(to bottom, color-mix(in srgb, #8FC9F2 22%, var(--paper)) 72%, color-mix(in srgb, #6DBB5E 30%, var(--paper)) 72%); }
.rc-art .decor { width: 56px; height: 56px; }
.rc-body { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.rc-body b { font: 400 17px var(--serif); }
.rc-needs { display: flex; flex-wrap: wrap; gap: 4px; }
.need { display: inline-flex; align-items: center; gap: 2px; padding: 1px 7px 1px 2px; border-radius: 999px; background: var(--paper); font-size: 12px; color: var(--ink-3); }
.need .mat { width: 20px; height: 24px; } .need .mat.crop-ic .plant { width: 24px; height: 24px; }
.need .fea { width: 14px; height: 14px; color: var(--amber); margin-left: 3px; }
.need.ok { color: var(--leaf-ink); box-shadow: inset 0 0 0 1.5px color-mix(in srgb, var(--leaf) 45%, transparent); }
.recipe.ready { box-shadow: inset 0 0 0 2px var(--yolk), 0 8px 20px color-mix(in srgb, var(--yolk) 25%, transparent); background: color-mix(in srgb, var(--yolk) 12%, var(--sky)); }
.recipe.made { opacity: .8; }
.recipe.grand .rc-art { background: linear-gradient(135deg, #3A2F7A, #6A4FB0); }
.recipe.grand { box-shadow: inset 0 0 0 1.5px color-mix(in srgb, #9A7FE0 60%, transparent); }
.craft-tag { display: inline-flex; align-items: center; gap: 4px; color: #8A5A2B; text-decoration: none; } .craft-tag .ic { width: 14px; height: 14px; }
html.scene-dark .craft-tag { color: #E2B878; }

/* ---------- the ribbon counter ---------- */
.rib-head { display: flex; flex-wrap: wrap; gap: 16px; align-items: center; margin-bottom: 18px; padding: 16px; border-radius: 18px; background: linear-gradient(120deg, color-mix(in srgb, #2A52B8 12%, var(--paper)), color-mix(in srgb, #E0507A 10%, var(--paper))); }
.rib-count { display: flex; align-items: center; gap: 8px; } .rib-count .ribbon-ic { width: 40px; height: 50px; } .rib-count b { font-size: 36px; }
.chest { display: flex; align-items: center; gap: 10px; padding: 8px 12px; border-radius: 14px; background: var(--paper); }
.chest-box { width: 42px; height: 42px; border-radius: 12px; display: grid; place-items: center; background: var(--sky); color: var(--ink-3); } .chest-box .ic { width: 24px; height: 24px; }
.chest.ready .chest-box { background: linear-gradient(135deg, #2A52B8, #E0507A); color: #fff; animation: gift-wiggle 1.8s ease-in-out infinite; }
.rib-buy .ribbon-ic, .rib-price .ribbon-ic { width: 16px; height: 20px; }
.rib-buy { background: linear-gradient(135deg, #2A52B8, #4A72D8); color: #fff; }
.trophy-num { position: absolute; left: 50%; bottom: 3%; translate: -50% 0; font: 400 clamp(9px, 1.1vw, 13px)/1 var(--serif); color: #FFF3C4; text-shadow: 0 1px 0 rgba(0,0,0,.35); pointer-events: none; }
.t-ribbons i { width: 16px; height: 4px; border-radius: 2px; background: #E0507A; } .t-ribbons i:nth-child(2n) { background: #2A52B8; } .t-ribbons i:nth-child(3n) { background: #F7D35A; }
html[data-trail="ribbons"] .ftrail i { width: 34px; height: 6px; border-radius: 3px; background: #E0507A; animation-duration: .6s; } html[data-trail="ribbons"] .ftrail i:nth-child(2n) { background: #2A52B8; } html[data-trail="ribbons"] .ftrail i:nth-child(3n) { background: #F7D35A; }
@media (prefers-reduced-motion: reduce) { .chest.ready .chest-box { animation: none; } }

/* ---------- the daily bird board ---------- */
.board { background: var(--paper); border-radius: 22px; padding: 18px; display: flex; flex-direction: column; gap: 12px; box-shadow: inset 0 -5px 0 color-mix(in srgb, var(--leaf) 40%, transparent); }
.bd-head { display: flex; align-items: center; gap: 14px; }
.bd-bird .bird { width: 52px; height: 50px; animation: perch 3.6s ease-in-out infinite; }
.bd-head h2 { font-size: 24px; }
.bd-count { margin-left: auto; font-size: 30px; color: var(--leaf-ink); }
.bd-tasks { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
@media (max-width: 760px) { .bd-tasks { grid-template-columns: 1fr; } }
.bd-task { display: grid; grid-template-columns: 40px 1fr; gap: 8px 10px; align-items: center; padding: 12px; border-radius: 16px; background: var(--sky); }
.bd-task .btn { grid-column: 1 / -1; }
.bt-ic { width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; background: var(--paper); color: var(--ink-2); } .bt-ic .ic { width: 22px; height: 22px; }
.bt-body { display: flex; flex-direction: column; gap: 5px; min-width: 0; } .bt-body b { font-size: 14px; line-height: 1.3; }
.bt-body .meter i { background: var(--leaf); }
.bd-task.done { background: color-mix(in srgb, var(--yolk) 16%, var(--sky)); box-shadow: inset 0 0 0 2px var(--yolk); }
.bd-task.done .bt-ic { background: var(--yolk); color: var(--on-yolk); animation: gift-wiggle 1.8s ease-in-out infinite; }
.bd-task.claimed { opacity: .7; } .bd-task.claimed .bt-ic { background: var(--leaf); color: #fff; }
.bd-bonus { align-self: stretch; }
/* What each task pays, shown before collecting it: feathers and the exact seed. */
.bt-pay { grid-column: 1 / -1; display: flex; flex-wrap: wrap; gap: 6px; }
.bt-pay > span { display: inline-flex; align-items: center; gap: 5px; padding: 3px 10px 3px 5px; border-radius: 999px; background: var(--paper); font-size: 13px; font-weight: 700; color: var(--ink-2); }
.bt-pay .ic { width: 18px; height: 18px; color: #E9A92A; } .bt-pay svg:not(.ic) { width: 20px; height: 20px; flex: none; }
.bt-pay .rare { color: var(--amber-ink); box-shadow: inset 0 0 0 1.5px color-mix(in srgb, var(--gold) 60%, transparent); }
.bt-pay.got { opacity: .5; }
.bd-bonus-row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; } .bd-bonus-row .bt-pay > span { background: var(--sky); }
.bd-count.bump { display: inline-block; animation: bump .6s cubic-bezier(.3,1.8,.5,1); }
.bd-done { text-align: center; }
@media (prefers-reduced-motion: reduce) { .bd-bird .bird, .bd-task.done .bt-ic { animation: none; } }

/* ---------- featured in the shop ---------- */
.featured { background: linear-gradient(120deg, color-mix(in srgb, var(--yolk) 20%, var(--paper)), color-mix(in srgb, #E0507A 10%, var(--paper))); border-radius: 20px; padding: 16px 18px; display: flex; flex-direction: column; gap: 12px; }
.featured h2 { display: flex; align-items: center; gap: 8px; font-size: 22px; } .featured h2 .ic { width: 22px; height: 22px; color: var(--amber-ink); }
.feats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
@media (max-width: 700px) { .feats { grid-template-columns: 1fr; } }
.feat { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 16px; background: var(--paper); }
.feat .preview { flex: none; max-width: 130px; display: grid; place-items: center; }
.feat .preview .bird { width: 56px; height: 54px; } .feat .preview .keys { width: 100px; }
.feat .stack { flex: 1; min-width: 0; }
.feat .btn, .feat .price-tag, .feat .st { flex: none; }
.sale { color: var(--berry); }
.pouch > a { display: inline-flex; align-items: center; gap: 6px; } .pouch > a .ic { width: 16px; height: 16px; }
.feat { display: grid; grid-template-columns: 84px 1fr; gap: 4px 12px; align-items: center; }
.feat .preview { grid-row: 1 / 3; width: 84px; } .feat .preview .keys, .feat .preview .trail-demo, .feat .preview .sky-demo, .feat .preview .burst-demo, .feat .preview .bd-chip { width: 84px; }
.feat > .btn, .feat > .price-tag, .feat > .st { grid-column: 2; justify-self: start; min-height: 36px; padding: 4px 14px; }
.feat .sale { white-space: nowrap; }

/* ---------- worlds ---------- */
.m-worlds { --mh-bg: linear-gradient(135deg, #1F3F7A, #3A68AE 50%, #E0A23A); --mh-ring: #FFE08A; }
.world-tabs { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 8px; }
.world-tabs a { display: inline-flex; align-items: center; gap: 6px; padding: 6px 14px; border-radius: 999px; border: 1px solid var(--rule-strong); text-decoration: none; color: var(--ink-2); font-weight: 600; font-size: 14px; background: var(--paper); }
.world-tabs a small { font-size: 12px; color: var(--ink-3); }
.world-tabs a.on { background: var(--ink); color: var(--paper); border-color: var(--ink); } .world-tabs a.on small { color: color-mix(in srgb, var(--paper) 75%, transparent); }
.world-tabs a.all { margin-left: auto; border-style: dashed; } .world-tabs .ic { width: 16px; height: 16px; }
.band.locked > :not(.band-lock) { filter: grayscale(.7) opacity(.55); }
.band-lock { position: sticky; top: calc(var(--top-h, 70px) + 150px); z-index: 7; margin: 60px auto 0; width: min(520px, 92%); display: flex; align-items: center; gap: 12px; padding: 14px 16px; border-radius: 18px; background: var(--paper); box-shadow: 0 14px 34px rgba(30,35,68,.25); }
.bl-ic { width: 44px; height: 44px; flex: none; border-radius: 50%; display: grid; place-items: center; background: linear-gradient(135deg, #FFE9A0, #D99A1E); color: #5A3A00; } .bl-ic .ic { width: 22px; height: 22px; }
.band-lock .btn { margin-left: auto; flex: none; } .band-lock .btn .ic { width: 16px; height: 16px; }
.worlds { display: flex; flex-direction: column; gap: 14px; }
.world-card { display: grid; grid-template-columns: 240px 1fr auto; gap: 18px; align-items: center; padding: 14px; border-radius: 22px; background: var(--paper); text-decoration: none; color: inherit; box-shadow: inset 0 -5px 0 color-mix(in srgb, var(--c) 45%, transparent); transition: transform .2s cubic-bezier(.3,1.6,.5,1), box-shadow .2s; }
.world-card:hover { transform: translateY(-3px); box-shadow: inset 0 -5px 0 color-mix(in srgb, var(--c) 45%, transparent), 0 14px 30px rgba(30,35,68,.12); }
.wc-art { position: relative; height: 130px; border-radius: 16px; overflow: hidden; background: linear-gradient(to bottom, color-mix(in srgb, var(--c) 30%, #DDF0FB), color-mix(in srgb, var(--c) 18%, var(--paper))); }
.wc-art .scene { position: absolute; left: 0; right: 0; bottom: 0; width: 100%; height: 60%; }
.wc-glyphs { position: absolute; left: 10px; top: 10px; display: flex; gap: 4px; } .wc-glyphs .glyph { width: 30px; height: 20px; }
.wc-body { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.wc-body b { font: 400 26px var(--serif); }
.wc-kicker { font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; color: var(--ink-3); }
.wc-prog { display: flex; flex-direction: column; gap: 4px; margin-top: 4px; } .wc-prog .jbar i { background: var(--c); }
.wc-lock, .wc-open { display: inline-flex; align-items: center; gap: 5px; color: #9A5A08; } .wc-open { color: var(--leaf-ink); }
.wc-lock .ic, .wc-open .ic { width: 14px; height: 14px; flex: none; }
@media (max-width: 760px) { .world-card { grid-template-columns: 1fr; } .world-card > .btn { justify-self: start; } }
.coming { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 10px; }
.soon { display: flex; flex-direction: column; gap: 4px; padding: 14px; border-radius: 16px; background: repeating-linear-gradient(135deg, var(--paper), var(--paper) 10px, color-mix(in srgb, var(--c) 8%, var(--paper)) 10px, color-mix(in srgb, var(--c) 8%, var(--paper)) 20px); border: 1.5px dashed color-mix(in srgb, var(--c) 45%, var(--rule)); }
.soon .glyph { width: 42px; height: 28px; } .soon b { font: 400 18px var(--serif); }
.recipe > .small, .ditem > .small { display: inline-flex; align-items: center; gap: 4px; } .recipe > .small .ic, .ditem > .small .ic { width: 14px; height: 14px; flex: none; }

/* ---------- the harvest show (harvest-fx.js) ---------- */
.hv-stage { position: fixed; inset: 0; z-index: 70; display: grid; place-items: center; padding: 16px;
  background: radial-gradient(circle at 50% 45%, color-mix(in srgb, var(--yolk) 28%, transparent), rgba(10,12,30,.55) 70%);
  animation: hv-fade .3s ease-out both; }
.hv-stage.out { animation: hv-fade .28s ease-in reverse both; }
@keyframes hv-fade { from { opacity: 0; } }
.hv-card { position: relative; width: min(380px, 100%); background: var(--paper); color: var(--ink); border-radius: 26px; padding: 22px 20px 18px;
  text-align: center; box-shadow: 0 24px 60px rgba(0,0,0,.35), 0 0 0 3px var(--yolk); animation: hv-card-in .55s cubic-bezier(.3,1.6,.5,1) both; overflow: hidden; isolation: isolate; }
@keyframes hv-card-in { from { opacity: 0; scale: .6; translate: 0 40px; } }
.hv-rays { position: absolute; inset: -60%; z-index: -1; opacity: .35;
  background: repeating-conic-gradient(from 0deg at 50% 38%, color-mix(in srgb, var(--yolk) 70%, transparent) 0 9deg, transparent 9deg 22deg);
  animation: hv-spin 14s linear infinite; }
@keyframes hv-spin { to { rotate: 360deg; } }
.hv-title { margin: 0 0 4px; font-size: 34px; letter-spacing: .5px; color: var(--amber-ink); }
.hv-title span { display: inline-block; animation: hv-letter .6s cubic-bezier(.3,1.8,.5,1) both; animation-delay: calc(var(--i) * 45ms + .15s); }
@keyframes hv-letter { from { opacity: 0; translate: 0 22px; scale: .4; } }
.hv-basket-wrap { position: relative; width: 132px; height: 92px; margin: 4px auto 10px; }
.hv-basket { position: relative; z-index: 1; width: 100%; height: 100%; filter: drop-shadow(0 6px 8px rgba(0,0,0,.2)); }
.hv-basket-wrap.bump { animation: hv-bump .32s cubic-bezier(.3,1.8,.5,1); }
@keyframes hv-bump { 40% { scale: 1.12 .92; } 70% { scale: .96 1.05; } }
.hv-pile { position: absolute; left: 50%; top: 22px; z-index: 0; width: 0; height: 0; }
.hv-pile span { position: absolute; left: var(--x); top: calc(var(--d) * -3px); width: 30px; height: 30px; margin-left: -15px; animation: hv-drop .4s cubic-bezier(.3,1.6,.5,1) both; }
.hv-pile span > * { width: 100%; height: 100%; }
@keyframes hv-drop { from { translate: 0 -30px; opacity: 0; } }
.hv-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; text-align: left; }
.hv-list li { display: grid; grid-template-columns: 30px 1fr auto; align-items: center; gap: 8px; padding: 6px 10px; border-radius: 12px;
  background: color-mix(in srgb, var(--yolk) 12%, transparent); opacity: 0; translate: -16px 0; transition: opacity .3s, translate .3s cubic-bezier(.3,1.6,.5,1); }
.hv-list li.in { opacity: 1; translate: 0 0; }
.hv-list li.rare { box-shadow: inset 0 0 0 2px var(--gold); }
.hv-list li.tick .hv-qty { animation: hv-bump .3s cubic-bezier(.3,1.8,.5,1); }
.hv-ic > * { width: 28px; height: 28px; display: block; }
.hv-qty { font-weight: 800; font-size: 18px; color: var(--amber-ink); display: inline-block; }
.hv-qty i { font-style: normal; }
.hv-bonus { grid-column: 2 / -1; font-size: 12px; font-weight: 700; color: var(--leaf-ink, #2E8B57); opacity: 0; }
.hv-list li.bonus-in .hv-bonus { animation: hv-letter .5s cubic-bezier(.3,1.8,.5,1) both; opacity: 1; }
.hv-fea { margin: 10px 0 0; font-weight: 700; }
.hv-actions { display: flex; gap: 10px; justify-content: center; margin-top: 16px; opacity: 0; pointer-events: none; transition: opacity .3s; }
.hv-stage.finished .hv-actions { opacity: 1; pointer-events: auto; }
.hv-ghost { position: fixed; z-index: 75; pointer-events: none; transform-origin: 50% 100%; animation: hv-leap 1.1s cubic-bezier(.3,.9,.4,1) both; }
.hv-ghost > svg { width: 100%; height: 100%; }
@keyframes hv-leap { 0% { scale: 1; } 15% { scale: 1.25 .7; } 35% { scale: .9 1.25; translate: 0 -40px; rotate: -8deg; }
  60% { translate: 0 -70px; rotate: 10deg; scale: 1.15; opacity: 1; } 100% { translate: 0 -110px; scale: .4; opacity: 0; rotate: 0deg; } }
.bit-crop { width: 30px; height: 30px; margin: -15px 0 0 -15px; filter: drop-shadow(0 3px 4px rgba(0,0,0,.3)); }
.bit-crop > * { width: 100%; height: 100%; display: block; }
.bit-crop.rare { filter: drop-shadow(0 0 8px var(--gold)); }
.market.flash { animation: hv-flash 1.4s ease-out; }
@keyframes hv-flash { 20% { box-shadow: 0 0 0 4px var(--yolk), 0 10px 30px color-mix(in srgb, var(--yolk) 40%, transparent); } }
@media (prefers-reduced-motion: reduce) { .hv-stage, .hv-card, .hv-rays, .hv-title span, .hv-basket-wrap.bump, .hv-pile span, .hv-list li.tick .hv-qty, .hv-list li.bonus-in .hv-bonus, .market.flash { animation: none; } .hv-list li { transition: none; } }

/* ---------- a song on a phone: one line of context, one row of tools ---------- */
/* Labels with a short form for phones ("Submit", "⌫"). */
.t-short { display: none; }
@media (max-width: 560px) {
  .t-long { display: none; }
  .t-short { display: inline; }
  .round .context { flex-wrap: nowrap; gap: 10px; align-items: center; white-space: nowrap; overflow: hidden; font-size: 13px; }
  .round .context > span { min-width: 0; overflow: hidden; text-overflow: ellipsis; }
  .round .context > .back-btn { flex: none; }
  .round .context.has-extra > :is(.c-mode, .c-level, .c-len) { display: none; }
  .round .context .hot-tag { flex: none; margin-left: auto; }
  .round .tools { flex-wrap: nowrap; }
  .round .tools .go { order: 0; flex: 1.7 1 0; flex-basis: 0; min-height: 48px; font-size: 16px; }
  .round .tools .quiet { flex: 1 1 0; min-height: 48px; padding-inline: 4px; }
}

/* ---------- a finished journey stop: the stars earned (round.js) ---------- */
.stop-done { display: flex; flex-direction: column; align-items: center; gap: 6px; text-align: center; padding: 18px 16px 16px; border-radius: 20px;
  background: radial-gradient(circle at 50% 30%, color-mix(in srgb, var(--yolk) 22%, var(--paper)), var(--paper) 70%); box-shadow: 0 0 0 2px color-mix(in srgb, var(--yolk) 45%, transparent);
  animation: sd-in .5s cubic-bezier(.3,1.6,.5,1) both; }
.stop-done.full { box-shadow: 0 0 0 3px var(--yolk), 0 12px 32px color-mix(in srgb, var(--yolk) 35%, transparent); }
@keyframes sd-in { from { opacity: 0; scale: .85; } }
.sd-kicker { font-size: 12px; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; color: var(--amber-ink); }
.sd-stars { display: flex; gap: 10px; align-items: flex-end; margin: 2px 0; }
.sd-stars i { width: 48px; height: 48px; background: var(--rule-strong);
  clip-path: polygon(50% 0, 61% 35%, 98% 35%, 68% 57%, 79% 91%, 50% 70%, 21% 91%, 32% 57%, 2% 35%, 39% 35%); }
.sd-stars i:nth-child(2) { width: 60px; height: 60px; }
.sd-stars i.on { background: linear-gradient(160deg, #FFE9A0, var(--gold) 55%, #D08A12); filter: drop-shadow(0 3px 6px color-mix(in srgb, var(--gold) 60%, transparent)); }
/* Earned stars wait as grey, then pop to gold one after another when the result settles. */
.stop-done:not(.go) .sd-stars i.on { background: var(--rule-strong); filter: none; }
.stop-done.go .sd-stars i.on { animation: sd-star .55s cubic-bezier(.3,1.9,.5,1) both; animation-delay: calc(.25s + var(--i) * .35s); }
@keyframes sd-star { 0% { scale: .2; rotate: -40deg; opacity: .3; } 60% { scale: 1.3; rotate: 8deg; opacity: 1; } 100% { scale: 1; rotate: 0deg; } }
.sd-line { font-family: var(--serif); font-size: 22px; }
@media (prefers-reduced-motion: reduce) { .stop-done, .stop-done.go .sd-stars i.on { animation: none; } .stop-done:not(.go) .sd-stars i.on { background: linear-gradient(160deg, #FFE9A0, var(--gold) 55%, #D08A12); } }

/* ---------- the Play page: every mode as a tile (views-play.js) ---------- */
.modes { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 14px; }
.mode-tile { position: relative; display: flex; flex-direction: column; gap: 4px; padding: 16px 16px 14px; border-radius: 20px; text-decoration: none; color: var(--ink); overflow: hidden; isolation: isolate;
  background: linear-gradient(160deg, color-mix(in srgb, var(--c) 13%, var(--paper)), var(--paper) 62%);
  box-shadow: inset 0 0 0 1.5px color-mix(in srgb, var(--c) 18%, transparent), 0 4px 0 color-mix(in srgb, var(--c) 28%, var(--yolk-soft));
  transition: translate .2s cubic-bezier(.3,1.6,.5,1), box-shadow .2s; animation: mt-in .5s cubic-bezier(.3,1.5,.5,1) both; }
.mode-tile:nth-child(2) { animation-delay: .05s; } .mode-tile:nth-child(3) { animation-delay: .1s; } .mode-tile:nth-child(4) { animation-delay: .15s; }
.mode-tile:nth-child(5) { animation-delay: .2s; } .mode-tile:nth-child(6) { animation-delay: .25s; } .mode-tile:nth-child(7) { animation-delay: .3s; }
@keyframes mt-in { from { opacity: 0; translate: 0 18px; scale: .96; } }
.mode-tile::after { content: ""; position: absolute; z-index: -1; right: -30px; top: -30px; width: 110px; height: 110px; border-radius: 50%; background: color-mix(in srgb, var(--c) 11%, transparent); transition: scale .35s cubic-bezier(.3,1.6,.5,1); }
.mode-tile:hover { translate: 0 -3px; box-shadow: inset 0 0 0 1.5px color-mix(in srgb, var(--c) 55%, transparent), 0 7px 0 color-mix(in srgb, var(--c) 35%, transparent); }
.mode-tile:hover::after { scale: 1.35; }
.mode-tile:active { translate: 0 2px; box-shadow: inset 0 0 0 1.5px color-mix(in srgb, var(--c) 55%, transparent), 0 1px 0 color-mix(in srgb, var(--c) 35%, transparent); }
.mt-ic { width: 46px; height: 46px; border-radius: 14px; display: grid; place-items: center; background: color-mix(in srgb, var(--c) 34%, var(--paper)); color: color-mix(in srgb, var(--c) 72%, var(--ink)); margin-bottom: 6px;
  box-shadow: inset 0 -3px 0 color-mix(in srgb, var(--c) 22%, transparent); transition: rotate .25s cubic-bezier(.3,1.6,.5,1); }
.mt-ic .ic { width: 24px; height: 24px; }
.mode-tile:hover .mt-ic { rotate: -10deg; }
.mode-tile > b { font-family: var(--serif); font-size: 20px; }
.mt-blurb { color: var(--ink-3); font-size: 14px; line-height: 1.35; flex: 1; }
.mt-stat { margin-top: 6px; font-weight: 700; font-size: 14px; color: color-mix(in srgb, var(--c) 70%, var(--ink)); }
.mt-stat .figure { font-size: 20px; }
.mt-badge { position: absolute; top: 12px; right: 12px; padding: 3px 10px; border-radius: 999px; font-size: 12px; font-weight: 800; background: var(--yolk); color: var(--on-yolk);
  animation: mt-badge 1.8s ease-in-out infinite; }
@keyframes mt-badge { 50% { scale: 1.08; rotate: 3deg; } }
@media (max-width: 560px) {
  .modes { grid-template-columns: 1fr 1fr; gap: 10px; }
  .mode-tile { padding: 12px 12px 12px; border-radius: 16px; }
  .mt-ic { width: 40px; height: 40px; border-radius: 12px; }
  .mode-tile > b { font-size: 17px; }
  .mt-blurb { font-size: 13px; }
  .mt-badge { top: 10px; right: 10px; font-size: 11px; padding: 2px 8px; }
}
@media (prefers-reduced-motion: reduce) { .mode-tile, .mt-badge { animation: none; } .mode-tile, .mode-tile::after, .mt-ic { transition: none; } }
/* The last tile, alone on its row, runs the full width with its icon beside the words. */
.mode-tile.wide { grid-column: 1 / -1; display: grid; grid-template-columns: auto 1fr auto; align-items: center; column-gap: 14px; }
.mode-tile.wide .mt-ic { grid-row: 1 / 3; margin: 0; }
.mode-tile.wide > b { grid-column: 2; } .mode-tile.wide .mt-blurb { grid-column: 2; }
.mode-tile.wide .mt-stat { grid-column: 3; grid-row: 1 / 3; margin: 0; }
@media (max-width: 560px) { .mode-tile.wide { grid-template-columns: auto 1fr; } .mode-tile.wide .mt-stat { grid-column: 2; grid-row: auto; } .mode-tile.wide .mt-ic { grid-row: 1 / 4; } }

/* ---------- achievements won on a song: gold badges in the result (round.js) ---------- */
.ach-row { display: flex; flex-wrap: wrap; gap: 10px; }
.ach-chip { display: inline-flex; align-items: center; gap: 10px; padding: 8px 14px 8px 8px; border-radius: 16px; text-decoration: none; color: var(--on-yolk);
  background: linear-gradient(135deg, #FFE9A0, var(--yolk)); box-shadow: 0 4px 0 color-mix(in srgb, var(--yolk) 55%, #000), 0 8px 20px color-mix(in srgb, var(--yolk) 35%, transparent); }
.ach-chip small { display: block; font-size: 11px; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; opacity: .75; }
.ach-chip b { font-size: 16px; }
.ach-chip em { font-style: normal; font-weight: 800; margin-left: 4px; }
.ach-ic { width: 36px; height: 36px; border-radius: 12px; display: grid; place-items: center; background: rgba(255,255,255,.55); }
.ach-ic .ic { width: 20px; height: 20px; }
.ach-row:not(.go) .ach-chip { opacity: 0; }
.ach-row.go .ach-chip { animation: ach-pop .6s cubic-bezier(.3,1.8,.5,1) both; animation-delay: calc(.5s + var(--i) * .25s); }
.ach-row.go .ach-ic { animation: ach-spin 1s ease-out both; animation-delay: calc(.6s + var(--i) * .25s); }
@keyframes ach-pop { from { opacity: 0; scale: .3; rotate: -6deg; } }
@keyframes ach-spin { 40% { rotate: 20deg; scale: 1.2; } }
@media (prefers-reduced-motion: reduce) { .ach-row .ach-chip, .ach-row .ach-ic { animation: none !important; opacity: 1 !important; } }
/* On a phone the result leads with what was won: the stop's stars, the bird, then the rewards and badges. */
@media (max-width: 860px) { #result > .stop-done { order: -3; } #result > .ach-row { order: -1; } }

/* ---------- Puzzles: Classic | Puzzle Rush, one switch on both pages (views-play.js) ---------- */
.pz-switch { display: inline-flex; gap: 4px; padding: 4px; border-radius: 999px; background: var(--paper); box-shadow: inset 0 0 0 1px var(--rule); align-self: flex-start; }
.pz-switch a { display: inline-flex; align-items: center; gap: 8px; padding: 9px 18px; border-radius: 999px; font-weight: 700; text-decoration: none; color: var(--ink-3); transition: background .2s, color .2s; }
.pz-switch a .ic { width: 18px; height: 18px; }
.pz-switch a:hover { color: var(--ink); }
.pz-switch a.on { background: var(--ink); color: var(--paper); box-shadow: 0 3px 0 color-mix(in srgb, var(--ink) 60%, #000); animation: pop .4s cubic-bezier(.3,1.8,.5,1); }
.pz-switch a.on .ic { color: var(--yolk); }
@media (max-width: 560px) { .pz-switch { align-self: stretch; } .pz-switch a { flex: 1; justify-content: center; padding: 9px 10px; } }
@media (prefers-reduced-motion: reduce) { .pz-switch a.on { animation: none; } }

/* ---------- the nest's areas (views-nest.js, nest-scene.js) ---------- */
/* Area tabs: one chip per area, built or still to build. */
.area-tabs { display: flex; gap: 8px; overflow-x: auto; padding: 2px 2px 6px; scrollbar-width: none; margin-bottom: -14px; }
.area-tabs::-webkit-scrollbar { display: none; }
.atab { flex: none; display: flex; align-items: center; gap: 8px; padding: 8px 14px 8px 8px; border-radius: 16px; border: 0; background: var(--paper); color: var(--ink);
  box-shadow: inset 0 0 0 1.5px var(--rule), 0 3px 0 var(--rule); transition: translate .2s cubic-bezier(.3,1.6,.5,1), box-shadow .2s; text-align: left; }
.atab:hover { translate: 0 -2px; }
.atab-ic { width: 34px; height: 34px; border-radius: 11px; display: grid; place-items: center; color: #fff; background: var(--ac, var(--leaf)); box-shadow: inset 0 -3px 0 rgba(0,0,0,.15); }
.atab-ic .ic { width: 19px; height: 19px; }
.atab-txt { display: flex; flex-direction: column; line-height: 1.15; }
.atab-txt b { font-size: 15px; } .atab-txt small { font-size: 12px; color: var(--ink-3); display: inline-flex; align-items: center; gap: 3px; } .atab-txt small .ic { width: 12px; height: 12px; }
.atab.on { background: var(--ink); color: var(--paper); box-shadow: 0 3px 0 color-mix(in srgb, var(--ink) 60%, #000); }
.atab.on .atab-txt small { color: color-mix(in srgb, var(--paper) 70%, transparent); }
.atab.unbuilt .atab-ic { background: var(--rule-strong); }
.a-treetop { --ac: #4FA35A; } .a-garden { --ac: #E0A23A; } .a-pond { --ac: #3E8EDE; } .a-glade { --ac: #2F7A42; } .a-loft { --ac: #8A6BD8; }

/* The scene: as tall as before, and as wide as the area (a bigger area scrolls sideways). */
.nest-scene { overflow-x: auto; overflow-y: hidden; overscroll-behavior-x: contain; scrollbar-width: thin; background: none !important; }
.scene-inner { position: relative; height: 100%; min-width: 100%; isolation: isolate; }
.scene-inner > .far, .scene-inner > .ground-layer { position: absolute; inset: 0; width: 100%; height: 100%; }
.scene-inner > .far { z-index: 0; } .scene-inner > .ground-layer { z-index: 1; pointer-events: none; }
.tree-zone { position: absolute; left: 0; top: 0; bottom: 0; z-index: 2; }
.tree-zone .tree { position: absolute; inset: 0; width: 100%; height: 100%; }
.pieces { position: absolute; inset: 0; z-index: 3; pointer-events: none; }

/* A piece: sized from the scene's height, so it looks the same however wide the area is. Nearer the
   front (--s) is bigger; big pieces are bigger again. Ground and water pieces stand on their spot;
   hanging ones hang from it. */
.piece { position: absolute; height: calc(var(--s, 1) * 19%); aspect-ratio: 1; translate: -50% -100%; padding: 0; border: 0; background: none; pointer-events: none; }
.piece.big { height: calc(var(--s, 1) * 27%); }
.piece.p-hang { translate: -50% 0; height: 15%; transform-origin: 50% 0; animation: hang-sway 4s ease-in-out infinite; }
.piece.p-water { translate: -50% -88%; }
.piece .decor { width: 100%; height: 100%; display: block; overflow: visible; }
.piece.flip .decor { scale: -1 1; }
.piece.p-ground .decor, .piece.p-water .decor { filter: drop-shadow(0 3px 2px rgba(30,35,68,.18)); }
.piece.p-ground::before { content: ""; position: absolute; left: 14%; right: 14%; bottom: -2px; height: 8%; border-radius: 50%; background: rgba(30,35,68,.16); filter: blur(2px); }
.piece .trophy-num { position: absolute; left: 50%; top: 42%; translate: -50% 0; font: 700 11px var(--sans); color: #6E4A08; }
.decor .bob { animation: bob-float 2.8s ease-in-out infinite; transform-box: fill-box; }
.decor .ripple { animation: ripple 3.2s ease-in-out infinite; transform-box: fill-box; transform-origin: center; }
@keyframes bob-float { 50% { translate: 0 -1.2px; } }
@keyframes ripple { 50% { scale: 1.12 1; opacity: .15; } }

/* Decorating: pieces can be picked up and dragged; the bands they can go in show faintly. */
.nest-scene.editing { box-shadow: 0 0 0 3px var(--yolk), 0 10px 30px color-mix(in srgb, var(--yolk) 30%, transparent); }
.nest-scene.editing .pieces { pointer-events: none; }
.nest-scene.editing .piece { pointer-events: auto; cursor: grab; touch-action: none; border-radius: 12px; transition: filter .2s; }
.nest-scene.editing .piece:hover { filter: drop-shadow(0 0 6px #fff); }
.nest-scene.editing .piece.sel { outline: 2.5px dashed #fff; outline-offset: 3px; filter: drop-shadow(0 0 8px var(--yolk)); animation: none; }
.nest-scene.editing .piece.lifted { cursor: grabbing; filter: drop-shadow(0 12px 10px rgba(30,35,68,.35)); scale: 1.08; z-index: 999 !important; }
.nest-scene.editing .residents, .nest-scene.editing .wanderer { opacity: .4; pointer-events: none; }
.nest-scene.editing::after { display: none; }
.place-band { position: absolute; left: 0; right: 0; z-index: 2; pointer-events: none; border-block: 1.5px dashed rgba(255,255,255,.75); background: rgba(255,255,255,.12); }
.place-band span { position: sticky; left: 8px; display: inline-block; margin: 4px 8px; padding: 2px 8px; border-radius: 999px; font-size: 11px; font-weight: 800; letter-spacing: .04em; text-transform: uppercase; color: var(--ink); background: rgba(255,255,255,.8); }
.pb-water { border-color: rgba(200,235,255,.9); }
.piece.landed { animation: piece-land .5s cubic-bezier(.3,1.8,.5,1); }
.piece.p-hang.landed { animation: piece-land .5s cubic-bezier(.3,1.8,.5,1), hang-sway 4s ease-in-out .5s infinite; }
@keyframes piece-land { 0% { scale: 1.25; } 40% { scale: .88 1.1; } 100% { scale: 1; } }
.cosy-float { position: fixed; z-index: 90; translate: -50% 0; pointer-events: none; font-weight: 800; font-size: 15px; color: #fff; background: var(--leaf); padding: 3px 10px; border-radius: 999px;
  box-shadow: 0 4px 12px rgba(0,0,0,.2); animation: cosy-float 1.3s ease-out forwards; }
@keyframes cosy-float { 0% { opacity: 0; translate: -50% 10px; scale: .6; } 20% { opacity: 1; scale: 1.1; } 100% { opacity: 0; translate: -50% -50px; scale: 1; } }

/* The bar under the scene: the area's cosiness and room, and Decorate; or the picked piece's tools. */
.area-bar { display: flex; align-items: center; gap: 14px 18px; flex-wrap: wrap; padding: 12px 16px; margin-top: -14px; border-radius: 18px; background: var(--paper); box-shadow: inset 0 0 0 1px var(--rule); }
.ab-name { display: flex; flex-direction: column; min-width: 120px; } .ab-name b { font: 400 20px var(--serif); }
.ab-room { display: flex; flex-direction: column; gap: 4px; flex: 1; min-width: 160px; }
.ab-room .meter { height: 8px; border-radius: 99px; background: var(--rule); overflow: hidden; }
.ab-room .meter i { display: block; height: 100%; border-radius: inherit; background: linear-gradient(90deg, var(--leaf), #8FD47A); transition: width .4s cubic-bezier(.3,1.4,.5,1); }
.ab-room .meter.full i { background: linear-gradient(90deg, var(--amber, #E0A23A), var(--yolk)); }
.ab-room small { color: var(--ink-3); } .ab-room small b { color: var(--ink); }
.ab-act { gap: 8px; margin-left: auto; flex-wrap: wrap; }
.sel-bar { box-shadow: inset 0 0 0 2px var(--yolk); background: color-mix(in srgb, var(--yolk) 10%, var(--paper)); animation: pop .35s cubic-bezier(.3,1.8,.5,1); }

/* The tray of pieces for this area. */
.tray { background: var(--paper); border-radius: 20px; padding: 14px 16px; display: flex; flex-direction: column; gap: 12px; margin-top: -12px; animation: sd-in .35s cubic-bezier(.3,1.5,.5,1) both; }
.tray-head { display: flex; flex-direction: column; gap: 10px; }
.tray-filter { border: 0; gap: 6px; }
.tray-filter button { border: 0; border-radius: 999px; padding: 6px 12px; background: var(--sky, #EEF2FB); color: var(--ink-2); font-size: 13px; }
.tray-filter button[aria-pressed="true"] { background: var(--ink); color: var(--paper); }
.titems { display: grid; grid-template-columns: repeat(auto-fill, minmax(118px, 1fr)); gap: 10px; max-height: 420px; overflow-y: auto; padding: 2px; }
.titem { display: flex; flex-direction: column; align-items: center; gap: 4px; text-align: center; padding: 10px 8px; border-radius: 14px; background: var(--sky, #F3F5FC); box-shadow: inset 0 0 0 1px var(--rule); }
.titem .preview { width: 64px; height: 64px; display: grid; place-items: center; }
.titem .preview .decor-chip, .titem .preview .decor { width: 60px; height: 60px; }
.titem .name { font-weight: 700; font-size: 13px; line-height: 1.2; }
.titem .tmeta { display: flex; gap: 4px; align-items: center; }
.titem.suits { box-shadow: inset 0 0 0 2px color-mix(in srgb, var(--yolk) 70%, transparent); }
.titem.here { opacity: .75; }
.titem.unowned .preview { filter: saturate(.6); }
.titem .btn { margin-top: auto; }
.big-chip { font-size: 11px; font-weight: 800; padding: 1px 6px; border-radius: 6px; background: var(--ink); color: var(--paper); }

/* The level pill in the header. */
.lv-pill { display: inline-flex; align-items: center; gap: 8px; padding: 8px 14px; border-radius: 999px; border: 0; background: var(--paper); color: var(--ink); box-shadow: inset 0 0 0 1px var(--rule); }
.lv-pill .ic { width: 18px; height: 18px; color: #8A5A2B; } .lv-pill b { font-weight: 700; } .lv-pill .figure { font-size: 18px; color: var(--leaf-ink); }

/* An area still to build: faded, behind its plan. */
.blueprint { position: relative; }
.blueprint .nest-scene { filter: grayscale(.7) blur(1.5px); opacity: .6; pointer-events: none; }
.bp-card { position: absolute; left: 50%; top: 50%; translate: -50% -50%; width: min(420px, calc(100% - 32px)); display: grid; grid-template-columns: auto 1fr; gap: 12px 14px; align-items: center;
  padding: 18px; border-radius: 20px; background: var(--paper); box-shadow: 0 16px 40px rgba(30,35,68,.25); animation: sd-in .45s cubic-bezier(.3,1.5,.5,1) both; }
.bp-card .btn { grid-column: 1 / -1; }
.bp-ic, .proj-ic { width: 48px; height: 48px; border-radius: 14px; display: grid; place-items: center; color: #fff; background: var(--ac); box-shadow: inset 0 -4px 0 rgba(0,0,0,.15); }
.bp-ic .ic, .proj-ic .ic { width: 24px; height: 24px; }

/* Something being built: a banner at the top of the nest. */
.build-banner { display: flex; align-items: center; gap: 12px; padding: 10px 14px; border-radius: 16px; background: var(--paper); box-shadow: inset 0 0 0 1px var(--rule); margin-bottom: -14px; }
.build-banner .proj-ic { width: 38px; height: 38px; border-radius: 11px; }
.build-banner .proj-ic .ic { animation: build-tap 1s ease-in-out infinite; }
.build-banner > .btn, .build-banner > .link { margin-left: auto; }
.build-banner.done { box-shadow: inset 0 0 0 2px var(--yolk), 0 8px 24px color-mix(in srgb, var(--yolk) 30%, transparent); animation: pop .5s cubic-bezier(.3,1.8,.5,1); }
.build-banner.done .proj-ic .ic { animation: none; }
@keyframes build-tap { 50% { rotate: -14deg; } }

/* The workbench's Build tab. */
.bench-tabs { border: 0; gap: 6px; }
.bench-tabs button { display: inline-flex; align-items: center; gap: 6px; border: 0; border-radius: 999px; padding: 8px 14px; background: var(--sky, #EEF2FB); color: var(--ink-2); }
.bench-tabs button .ic { width: 16px; height: 16px; }
.bench-tabs button[aria-pressed="true"] { background: var(--ink); color: var(--paper); }
.projs { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 12px; }
.proj { display: grid; grid-template-columns: auto 1fr; gap: 10px 14px; align-items: start; padding: 14px; border-radius: 18px; background: var(--paper); box-shadow: inset 0 0 0 1px var(--rule); }
.proj > .btn, .proj > .small, .proj > .proj-bar { grid-column: 1 / -1; justify-self: stretch; }
.proj .rc-body { display: flex; flex-direction: column; gap: 4px; }
.proj.ready { box-shadow: inset 0 0 0 2px var(--leaf), 0 6px 18px color-mix(in srgb, var(--leaf) 20%, transparent); }
.proj.locked { opacity: .7; }
.proj.building { box-shadow: inset 0 0 0 2px var(--yolk); }
.proj.building .proj-ic .ic { animation: build-tap 1s ease-in-out infinite; }
.proj.just-started { animation: pop .5s cubic-bezier(.3,1.8,.5,1); }
.proj-bar { display: flex; align-items: center; gap: 10px; }
.proj-bar .meter { flex: 1; height: 10px; border-radius: 99px; background: var(--rule); overflow: hidden; }
.proj-bar .meter i { display: block; height: 100%; background: repeating-linear-gradient(-45deg, var(--yolk) 0 8px, #F7D35A 8px 16px); background-size: 22px 22px; animation: stripes 1s linear infinite; }
@keyframes stripes { to { background-position: 22px 0; } }
.nest-scene.grand-open { animation: grand-open 1s cubic-bezier(.3,1.5,.5,1); }
@keyframes grand-open { 0% { scale: .92; filter: brightness(1.5); } 60% { scale: 1.02; } 100% { scale: 1; filter: none; } }

/* The areas' own scenery. */
.beds { position: absolute; inset: 0; z-index: 2; pointer-events: none; }
.bed { position: absolute; top: 69%; width: 9%; min-width: 34px; translate: -50% -100%; aspect-ratio: 1; }
.bed .plant { width: 100%; height: 100%; }
.area-pond .wave { animation: wave 3s ease-in-out infinite; animation-delay: calc(var(--i) * -.6s); }
@keyframes wave { 50% { translate: 1.5px 0; opacity: .2; } }
.rays { position: absolute; inset: 0; z-index: 0; background: repeating-linear-gradient(115deg, transparent 0 60px, rgba(255,250,210,.35) 60px 90px, transparent 90px 170px); animation: rays 9s ease-in-out infinite alternate; }
@keyframes rays { to { opacity: .45; } }
.loft-stars { position: absolute; inset: 0 0 40% 0; z-index: 0; background-image: radial-gradient(1.5px 1.5px at 20% 30%, #fff, transparent), radial-gradient(1.5px 1.5px at 60% 18%, #fff, transparent),
  radial-gradient(1px 1px at 80% 40%, #fff, transparent), radial-gradient(1px 1px at 40% 50%, #fff, transparent), radial-gradient(1.5px 1.5px at 90% 12%, #fff, transparent); background-size: 240px 180px; opacity: .8; animation: twinkle 3s ease-in-out infinite; }
.wanderer { position: absolute; z-index: 3; translate: -50% -92%; height: calc(var(--s, 1) * 10%); aspect-ratio: 1; pointer-events: none; animation: wander 7s ease-in-out infinite; animation-delay: calc(var(--d) * -1); }
.wanderer .bird { width: 100%; height: 100%; animation: nest-bob 2.4s ease-in-out infinite; animation-delay: calc(var(--d) * -1); }
@keyframes wander { 0%, 100% { translate: -50% -92%; } 45% { translate: calc(-50% + 18px) -92%; scale: -1 1; } 55% { translate: calc(-50% + 18px) -92%; scale: -1 1; } }

@media (max-width: 560px) {
  .area-bar { padding: 10px 12px; gap: 10px; }
  .ab-act { width: 100%; margin-left: 0; } .ab-act > .btn { flex: 1; }
  .titems { grid-template-columns: repeat(auto-fill, minmax(100px, 1fr)); max-height: 340px; }
  .projs { grid-template-columns: 1fr; }
  .build-banner { flex-wrap: wrap; }
}
@media (prefers-reduced-motion: reduce) {
  .piece, .piece.landed, .decor .bob, .decor .ripple, .build-banner .proj-ic .ic, .proj.building .proj-ic .ic, .proj-bar .meter i, .nest-scene.grand-open, .rays, .loft-stars, .wanderer, .wanderer .bird, .area-pond .wave, .tray, .bp-card, .sel-bar { animation: none; }
}
