/* Isha's Star Atlas — one committed visual world: a night sky seen through a
   telescope. Every colour is declared here, so the page holds its own look
   whatever theme the host is in. */

:root {
  --ink: #080B1F;
  --ink-2: #0C1130;
  --panel: rgba(20, 27, 60, 0.82);
  --panel-2: rgba(27, 36, 80, 0.75);
  --line: #2C3668;
  --line-soft: rgba(155, 139, 255, 0.22);
  --text: #F2ECFF;
  --muted: #A4ADD8;
  --gold: #FFC94A;
  --gold-deep: #E89A1C;
  --teal: #45E0C0;
  --magenta: #FF79C4;
  --violet: #9B8BFF;
  --coral: #FF6B74;
  --display: 'Baloo 2', 'Trebuchet MS', system-ui, sans-serif;
  --body: 'Nunito', 'Segoe UI', system-ui, -apple-system, sans-serif;
  --r: 18px;
  --shadow: 0 14px 40px rgba(3, 5, 20, 0.55);
  padding-top: env(safe-area-inset-top, 0px);
  padding-bottom: env(safe-area-inset-bottom, 0px);
}

* { box-sizing: border-box; }

html, body { margin: 0; }

body {
  background:
    radial-gradient(1100px 620px at 78% -8%, rgba(255, 121, 196, 0.16), transparent 62%),
    radial-gradient(900px 560px at 8% 8%, rgba(69, 224, 192, 0.13), transparent 60%),
    linear-gradient(176deg, #0B1130 0%, var(--ink) 48%, #05081A 100%);
  background-color: var(--ink);
  color: var(--text);
  font-family: var(--body);
  font-size: 16px;
  line-height: 1.5;
  -webkit-text-size-adjust: 100%;
  min-height: 100%;
}

#sky, #fx {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
}
#sky { z-index: 0; }
#fx { z-index: 60; pointer-events: none; }

.shell {
  position: relative;
  z-index: 1;
  max-width: 940px;
  margin: 0 auto;
  padding-inline: 16px;
  padding-block: 18px 56px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

button { font: inherit; color: inherit; cursor: pointer; }
button:focus-visible, [tabindex]:focus-visible {
  outline: 3px solid var(--gold);
  outline-offset: 2px;
}

/* ================= HUD ================= */
.hud {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px 16px;
  padding: 12px 14px;
  background: var(--panel);
  border: 1px solid var(--line-soft);
  border-radius: var(--r);
  backdrop-filter: blur(9px);
  box-shadow: var(--shadow);
}

.who { display: flex; align-items: center; gap: 12px; flex: 1 1 220px; min-width: 0; }

.avatar {
  position: relative;
  width: 54px; height: 54px;
  flex: none;
  border-radius: 50%;
  display: grid; place-items: center;
  font-size: 26px;
  background: radial-gradient(circle at 35% 30%, #27305F, #141B3C);
  border: 2px solid var(--gold);
  box-shadow: 0 0 18px rgba(255, 201, 74, 0.3);
}
.avatar b {
  position: absolute; bottom: -5px; right: -5px;
  min-width: 22px; height: 22px;
  padding: 0 4px;
  border-radius: 11px;
  background: var(--gold);
  color: #2A1B00;
  font-family: var(--display);
  font-size: 13px; font-weight: 800;
  display: grid; place-items: center;
  border: 2px solid var(--ink-2);
}

.whotext { min-width: 0; flex: 1; }
.kname {
  display: block;
  font-family: var(--display);
  font-weight: 700;
  font-size: 17px;
  letter-spacing: 0.2px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.xp {
  height: 9px;
  border-radius: 99px;
  background: rgba(255, 255, 255, 0.1);
  overflow: hidden;
  margin: 5px 0 3px;
}
.xp i {
  display: block; height: 100%;
  background: linear-gradient(90deg, var(--gold-deep), var(--gold));
  border-radius: 99px;
  transition: width 0.5s cubic-bezier(.2, .8, .2, 1);
}
.xptext { font-size: 11.5px; color: var(--muted); letter-spacing: 0.4px; text-transform: uppercase; font-weight: 700; }

.chips { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.chip {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 7px 11px;
  border-radius: 99px;
  background: var(--panel-2);
  border: 1px solid var(--line);
  font-size: 14px;
  font-variant-numeric: tabular-nums;
}
.chip b { font-family: var(--display); font-weight: 800; font-size: 15px; }
.chip.gold b { color: var(--gold); }
.chip.teal b { color: var(--teal); }
.chip.pink b { color: var(--magenta); }
.chip.btn { border-color: var(--line-soft); font-size: 17px; line-height: 1; padding: 7px 10px; }

/* ================= nav ================= */
.nav {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding-bottom: 2px;
  scrollbar-width: none;
}
.nav::-webkit-scrollbar { display: none; }
.navbtn {
  flex: none;
  padding: 9px 14px;
  border-radius: 99px;
  border: 1px solid var(--line);
  background: rgba(20, 27, 60, 0.6);
  color: var(--muted);
  font-family: var(--display);
  font-weight: 600;
  font-size: 14.5px;
  white-space: nowrap;
  transition: background .18s, color .18s, border-color .18s;
}
.navbtn:hover { color: var(--text); border-color: var(--violet); }
.navbtn.on {
  background: linear-gradient(180deg, rgba(255, 201, 74, .18), rgba(255, 201, 74, .06));
  border-color: var(--gold);
  color: var(--text);
}

/* ================= panels ================= */
.panel {
  background: var(--panel);
  border: 1px solid var(--line-soft);
  border-radius: 22px;
  padding: 18px;
  backdrop-filter: blur(9px);
  box-shadow: var(--shadow);
}
.panel + .panel { margin-top: 16px; }

.ph {
  font-family: var(--display);
  font-size: clamp(20px, 4.6vw, 26px);
  font-weight: 800;
  margin: 0 0 14px;
  text-wrap: balance;
  line-height: 1.2;
}
.phsub {
  display: block;
  font-family: var(--body);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: .6px;
  text-transform: uppercase;
  color: var(--muted);
  margin-top: 3px;
}
h3.sub {
  font-family: var(--display);
  font-size: 16px;
  font-weight: 700;
  color: var(--gold);
  margin: 22px 0 10px;
  letter-spacing: .3px;
}
.lead { color: var(--muted); max-width: 62ch; margin: 0 0 14px; }

.back {
  background: none;
  border: none;
  color: var(--violet);
  font-family: var(--display);
  font-weight: 700;
  font-size: 15px;
  padding: 4px 0;
  margin-bottom: 6px;
}
.back:hover { color: var(--gold); }
.back.small { font-size: 13.5px; }
.back.center { display: block; margin: 16px auto 0; }

/* ================= daily quests ================= */
.quests { padding-bottom: 14px; }
.qgrid { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 10px; }
.quest {
  background: var(--panel-2);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 11px 12px;
}
.quest.done { border-color: var(--teal); }
.qtop { display: flex; justify-content: space-between; gap: 8px; font-size: 14px; font-weight: 700; }
.qrew { color: var(--teal); flex: none; }
.qbar { height: 7px; border-radius: 99px; background: rgba(255, 255, 255, .09); margin: 8px 0 6px; overflow: hidden; }
.qbar i { display: block; height: 100%; background: linear-gradient(90deg, var(--violet), var(--magenta)); transition: width .4s; }
.quest.done .qbar i { background: linear-gradient(90deg, var(--teal), #8CFFE4); }
.qnum { font-size: 12px; color: var(--muted); font-variant-numeric: tabular-nums; }
.claim {
  width: 100%;
  padding: 7px;
  border-radius: 10px;
  border: none;
  background: linear-gradient(180deg, var(--teal), #27B79A);
  color: #04231D;
  font-family: var(--display);
  font-weight: 800;
}

/* ================= region cards ================= */
.rgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 12px; }
.rcard {
  --rh: var(--violet);
  display: flex; gap: 13px; align-items: flex-start;
  text-align: left;
  padding: 14px;
  border-radius: 18px;
  border: 1px solid var(--line);
  background: linear-gradient(145deg, rgba(27, 36, 80, .9), rgba(14, 20, 48, .9));
  transition: transform .16s, border-color .16s, box-shadow .16s;
}
.rcard.hue-teal { --rh: var(--teal); }
.rcard.hue-gold { --rh: var(--gold); }
.rcard.hue-magenta { --rh: var(--magenta); }
.rcard.hue-violet { --rh: var(--violet); }
.rcard:not(.locked):hover { transform: translateY(-3px); border-color: var(--rh); box-shadow: 0 10px 28px rgba(0, 0, 0, .4); }
.rcard.beat { border-color: var(--rh); }
.rglyph {
  flex: none;
  width: 48px; height: 48px;
  border-radius: 14px;
  display: grid; place-items: center;
  font-size: 24px;
  background: color-mix(in srgb, var(--rh) 18%, transparent);
  border: 1px solid color-mix(in srgb, var(--rh) 45%, transparent);
}
.rbody { min-width: 0; }
.rbody h3 { font-family: var(--display); font-size: 17.5px; font-weight: 700; margin: 2px 0 3px; }
.rbody p { margin: 0; font-size: 13.5px; color: var(--muted); }
.rmeta { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 9px; }
.starpill {
  font-size: 12.5px; font-weight: 800;
  padding: 3px 9px; border-radius: 99px;
  background: rgba(255, 201, 74, .14);
  color: var(--gold);
  font-variant-numeric: tabular-nums;
}
.tag {
  font-size: 12px; font-weight: 800; letter-spacing: .4px;
  padding: 3px 9px; border-radius: 99px;
  background: color-mix(in srgb, var(--rh) 20%, transparent);
  color: var(--rh);
}
.tag.soft { background: rgba(255, 255, 255, .07); color: var(--muted); }
.rcard.locked { opacity: .5; cursor: default; }
.rcard.locked .rglyph { background: rgba(255, 255, 255, .06); border-color: var(--line); }

/* ================= stage list ================= */
.sgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 10px; }
.scard {
  display: grid;
  grid-template-columns: 34px 1fr;
  grid-template-areas: "n name" "n stars";
  gap: 2px 11px;
  align-items: center;
  text-align: left;
  padding: 13px;
  border-radius: 16px;
  border: 1px solid var(--line);
  background: var(--panel-2);
  transition: border-color .16s, transform .16s;
}
.scard:not(.locked):hover { border-color: var(--gold); transform: translateY(-2px); }
.snum {
  grid-area: n;
  width: 34px; height: 34px;
  border-radius: 50%;
  display: grid; place-items: center;
  background: rgba(155, 139, 255, .18);
  color: var(--violet);
  font-family: var(--display); font-weight: 800; font-size: 16px;
}
.sname { grid-area: name; font-family: var(--display); font-weight: 700; font-size: 15.5px; }
.stars { grid-area: stars; letter-spacing: 2px; }
.stars b { color: rgba(255, 255, 255, .18); font-size: 15px; }
.stars b.lit { color: var(--gold); text-shadow: 0 0 10px rgba(255, 201, 74, .55); }
.scard.locked { opacity: .42; cursor: not-allowed; }

.bosscard {
  display: flex; align-items: center; gap: 14px;
  width: 100%;
  margin-top: 12px;
  padding: 15px;
  border-radius: 18px;
  text-align: left;
  border: 1px solid var(--coral);
  background: linear-gradient(135deg, rgba(255, 107, 116, .16), rgba(255, 121, 196, .08));
  transition: transform .16s, box-shadow .16s;
}
.bosscard:not(.locked):hover { transform: translateY(-2px); box-shadow: 0 10px 26px rgba(255, 107, 116, .2); }
.bosscard.locked { border-color: var(--line); background: rgba(255, 255, 255, .04); opacity: .55; cursor: not-allowed; }
.bosscard.beat { border-color: var(--teal); background: linear-gradient(135deg, rgba(69, 224, 192, .16), rgba(155, 139, 255, .08)); }
.bglyph { font-size: 32px; flex: none; }
.bbody b { display: block; font-family: var(--display); font-size: 17px; }
.bbody i { font-style: normal; font-size: 13px; color: var(--muted); }

/* ================= play screen ================= */
.play { padding: 16px 16px 20px; }
.phead { display: flex; align-items: center; gap: 12px; }
.pbar {
  flex: 1;
  height: 10px;
  border-radius: 99px;
  background: rgba(255, 255, 255, .09);
  overflow: hidden;
}
.pbar i {
  display: block; height: 100%;
  background: linear-gradient(90deg, var(--teal), var(--gold));
  border-radius: 99px;
  transition: width .35s cubic-bezier(.2, .8, .2, 1);
}
.pbar.bz { margin-top: 8px; }
.pbar.bz i { background: linear-gradient(90deg, var(--magenta), var(--gold)); transition: width 1s linear; }
.pcount { font-size: 13px; font-weight: 800; color: var(--muted); font-variant-numeric: tabular-nums; flex: none; }

.pstatus { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; margin: 12px 0 6px; }
.where { font-family: var(--display); font-weight: 700; font-size: 14.5px; color: var(--muted); }
.hearts b { font-size: 15px; letter-spacing: 1px; }
.hearts b.gone { opacity: .35; }
.combo {
  font-size: 13px; font-weight: 800;
  padding: 4px 10px; border-radius: 99px;
  background: rgba(255, 201, 74, .16);
  color: var(--gold);
  animation: pop .3s ease-out;
}
@keyframes pop { from { transform: scale(.7); opacity: 0; } }

.qcard {
  margin: 10px 0 16px;
  padding: 20px 16px;
  border-radius: 20px;
  background: linear-gradient(170deg, rgba(31, 41, 92, .92), rgba(13, 19, 46, .92));
  border: 1px solid var(--line-soft);
  text-align: center;
}
.eyebrow {
  display: inline-block;
  font-size: 11.5px; font-weight: 800;
  letter-spacing: 1.2px; text-transform: uppercase;
  color: var(--teal);
  margin-bottom: 10px;
}
.prompt {
  font-family: var(--display);
  font-size: clamp(30px, 8vw, 46px);
  font-weight: 700;
  line-height: 1.18;
  text-wrap: balance;
  font-variant-numeric: tabular-nums;
}
.prompt.long { font-size: clamp(18px, 4.4vw, 23px); line-height: 1.4; font-weight: 600; }
.blank {
  display: inline-block;
  min-width: 1.5em;
  border-bottom: 4px solid var(--gold);
  color: var(--gold);
}
.unit { margin-top: 10px; font-size: 13px; color: var(--muted); font-weight: 700; letter-spacing: .4px; }
.blitzq { margin: 14px 0 16px; }

/* stacked fractions */
.frac {
  display: inline-flex; flex-direction: column; align-items: center;
  vertical-align: middle; line-height: 1; margin: 0 .12em;
}
.frac .fn, .frac .fd { font-size: .78em; }
.frac .fb { width: 100%; min-width: 1.2em; height: .09em; min-height: 2px; background: currentColor; border-radius: 2px; margin: .14em 0; }

/* question visuals */
.vis { width: 100%; margin: 16px auto 4px; }
.vis svg { width: 100%; height: auto; display: block; }
.sv-dot { fill: var(--gold); }
.sv-ring { fill: none; stroke: var(--violet); stroke-width: 1.6; }
.sv-on { fill: var(--teal); }
.sv-off { fill: rgba(255, 255, 255, .1); }
.sv-face { fill: rgba(155, 139, 255, .16); stroke: var(--violet); stroke-width: 1.6; }
.sv-line { stroke: var(--text); stroke-width: 1.8; fill: none; stroke-linecap: round; }
.sv-tick { stroke: rgba(255, 255, 255, .25); stroke-width: 1; }
.sv-txt { fill: var(--muted); font-family: 'Nunito', sans-serif; font-size: 12px; font-weight: 700; }
.sv-txt.sv-left { text-anchor: start; }
.sv-num { fill: var(--text); font-family: 'Baloo 2', sans-serif; font-size: 15px; font-weight: 700; }
.sv-hour { stroke: var(--text); stroke-width: 5; stroke-linecap: round; }
.sv-min { stroke: var(--gold); stroke-width: 3.2; stroke-linecap: round; }
.sv-pin { fill: var(--magenta); }
.sv-mark { fill: var(--magenta); }
.sv-mtxt { fill: var(--magenta); font-family: 'Baloo 2', sans-serif; font-size: 15px; font-weight: 800; }
.sv-bar { fill: var(--teal); }
.sv-icon { font-size: 18px; }
.sv-key { fill: var(--muted); font-family: 'Nunito', sans-serif; font-size: 11px; font-weight: 700; }

/* ================= answers ================= */
.choices { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.choice {
  min-height: 66px;
  padding: 12px 14px;
  border-radius: 16px;
  border: 2px solid var(--line);
  background: linear-gradient(180deg, rgba(36, 47, 102, .9), rgba(22, 30, 70, .9));
  font-family: var(--display);
  font-size: clamp(19px, 5vw, 25px);
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  display: grid; place-items: center;
  transition: transform .12s, border-color .12s, background .12s;
}
.choice:not(:disabled):hover { border-color: var(--gold); transform: translateY(-2px); }
.choice:not(:disabled):active { transform: scale(.97); }
.choice.yes { border-color: var(--teal); background: linear-gradient(180deg, rgba(69, 224, 192, .3), rgba(69, 224, 192, .12)); }
.choice.no { border-color: var(--coral); background: linear-gradient(180deg, rgba(255, 107, 116, .28), rgba(255, 107, 116, .1)); }
.choice.out { opacity: .22; }
.choice:disabled { cursor: default; }
.choice span { display: block; }

/* keypad */
.kpwrap { max-width: 320px; margin: 0 auto; }
.kpdisplay {
  min-height: 62px;
  border-radius: 14px;
  border: 2px solid var(--gold);
  background: rgba(8, 11, 31, .7);
  display: grid; place-items: center;
  font-family: var(--display);
  font-size: 34px; font-weight: 800;
  color: var(--gold);
  font-variant-numeric: tabular-nums;
  margin-bottom: 10px;
}
.kpdisplay i { font-style: normal; font-size: 14px; font-family: var(--body); font-weight: 700; color: var(--muted); }
.kp { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.key {
  min-height: 56px;
  border-radius: 14px;
  border: 1px solid var(--line);
  background: var(--panel-2);
  font-family: var(--display);
  font-size: 23px; font-weight: 700;
  transition: background .12s, transform .1s;
}
.key:not(:disabled):hover { background: rgba(155, 139, 255, .2); }
.key:not(:disabled):active { transform: scale(.95); }

.go {
  display: block;
  width: 100%;
  margin-top: 12px;
  padding: 15px 18px;
  border-radius: 15px;
  border: none;
  background: linear-gradient(180deg, var(--gold), var(--gold-deep));
  color: #2A1B00;
  font-family: var(--display);
  font-size: 18px; font-weight: 800;
  letter-spacing: .3px;
  box-shadow: 0 6px 0 rgba(176, 113, 10, .55);
  transition: transform .1s, box-shadow .1s;
}
.go:active { transform: translateY(3px); box-shadow: 0 3px 0 rgba(176, 113, 10, .55); }
.go.big { margin-top: 18px; }
.go.ghost {
  background: transparent;
  border: 1.5px solid var(--line);
  color: var(--text);
  box-shadow: none;
  font-size: 16px;
}
.go.ghost:hover { border-color: var(--violet); }
.go.ghost:active { transform: none; }
.go.boss { background: linear-gradient(180deg, var(--coral), #D8434D); color: #2A0206; box-shadow: 0 6px 0 rgba(150, 40, 48, .6); }
.go.danger { border-color: rgba(255, 107, 116, .5); color: var(--coral); margin-top: 24px; }

.powers { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; justify-content: center; }
.power {
  padding: 8px 13px;
  border-radius: 99px;
  border: 1px solid var(--violet);
  background: rgba(155, 139, 255, .14);
  font-size: 13.5px; font-weight: 700;
}
.power b { font-family: var(--display); color: var(--gold); }
.power.still { border-color: var(--line); background: rgba(255, 255, 255, .05); color: var(--muted); cursor: default; }

/* ================= feedback ================= */
.fb {
  margin-top: 14px;
  padding: 15px 16px;
  border-radius: 16px;
  border: 1.5px solid var(--line);
  background: rgba(8, 11, 31, .72);
  animation: slideup .22s ease-out;
}
@keyframes slideup { from { transform: translateY(10px); opacity: 0; } }
.fb.good { border-color: var(--teal); background: linear-gradient(180deg, rgba(69, 224, 192, .14), rgba(8, 11, 31, .7)); }
.fb.bad { border-color: var(--coral); background: linear-gradient(180deg, rgba(255, 107, 116, .14), rgba(8, 11, 31, .7)); }
.fbhead { font-family: var(--display); font-size: 19px; font-weight: 800; }
.fb.good .fbhead { color: var(--teal); }
.fb.bad .fbhead { color: var(--coral); }
.fbans { margin-top: 6px; font-size: 17px; font-family: var(--display); }
.fbans b { color: var(--gold); font-size: 21px; }
.fbwhy { margin-top: 7px; font-size: 14.5px; color: var(--text); opacity: .9; max-width: 56ch; }
.fb .go.next { max-width: 280px; margin-left: auto; margin-right: auto; }

/* ================= results ================= */
.result { text-align: center; }
.bigstars { font-size: 44px; letter-spacing: 6px; margin-bottom: 4px; }
.bigstars b { color: rgba(255, 255, 255, .16); }
.bigstars b.lit { color: var(--gold); text-shadow: 0 0 22px rgba(255, 201, 74, .6); animation: starpop .45s cubic-bezier(.2, 1.4, .4, 1) backwards; }
.bigstars b.lit:nth-child(1) { animation-delay: .05s; }
.bigstars b.lit:nth-child(2) { animation-delay: .22s; }
.bigstars b.lit:nth-child(3) { animation-delay: .39s; }
@keyframes starpop { from { transform: scale(0) rotate(-60deg); opacity: 0; } }
.bigstars.sad { letter-spacing: 0; }
.rtitle { font-family: var(--display); font-size: clamp(22px, 5.6vw, 30px); font-weight: 800; margin: 4px 0 2px; text-wrap: balance; }
.rsub { color: var(--muted); margin: 0 auto 10px; max-width: 46ch; }

.rstats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(96px, 1fr));
  gap: 9px;
  margin: 16px 0;
}
.rs {
  padding: 12px 8px;
  border-radius: 14px;
  background: var(--panel-2);
  border: 1px solid var(--line);
}
.rs b { display: block; font-family: var(--display); font-size: 25px; font-weight: 800; font-variant-numeric: tabular-nums; line-height: 1.1; }
.rs i { font-style: normal; font-size: 11.5px; letter-spacing: .5px; text-transform: uppercase; color: var(--muted); font-weight: 700; }
.rs.gold b { color: var(--gold); }
.rs.teal b { color: var(--teal); }

.levelup {
  margin: 14px 0;
  padding: 13px;
  border-radius: 14px;
  background: linear-gradient(135deg, rgba(255, 201, 74, .22), rgba(255, 121, 196, .14));
  border: 1px solid var(--gold);
  font-family: var(--display);
  font-size: 17px; font-weight: 700;
}
.newbeast {
  margin: 18px auto;
  max-width: 400px;
  padding: 16px;
  border-radius: 18px;
  background: rgba(155, 139, 255, .1);
  border: 1px solid var(--violet);
}
.nbtag { font-size: 11.5px; letter-spacing: 1.4px; text-transform: uppercase; color: var(--magenta); font-weight: 800; }
.newbeast h3 { font-family: var(--display); font-size: 20px; margin: 6px 0 4px; }
.newbeast p { margin: 0; color: var(--muted); font-size: 14px; }
.newbadges { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 10px; margin: 14px 0; }
.nb {
  padding: 12px;
  border-radius: 14px;
  background: rgba(255, 201, 74, .12);
  border: 1px solid var(--gold);
  text-align: center;
}
.nb span { font-size: 26px; display: block; }
.nb b { display: block; font-family: var(--display); font-size: 15px; }
.nb i { font-style: normal; font-size: 12.5px; color: var(--muted); }
.ractions { display: flex; flex-direction: column; gap: 8px; max-width: 420px; margin: 18px auto 0; }
.ractions .go { margin-top: 0; }

/* ================= blitz ================= */
.bzhead { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.bzlabel { font-family: var(--display); font-weight: 800; font-size: 16px; color: var(--magenta); letter-spacing: .5px; }
.bzscore { font-family: var(--display); font-size: 26px; font-weight: 800; color: var(--teal); font-variant-numeric: tabular-nums; }
.bztime {
  font-family: var(--display); font-size: 26px; font-weight: 800;
  min-width: 48px; text-align: right;
  font-variant-numeric: tabular-nums;
  color: var(--gold);
}
.bztime.urgent { color: var(--coral); animation: tick .5s ease-out; }
@keyframes tick { from { transform: scale(1.25); } }

/* ================= tricky facts ================= */
.tchips { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 8px; }
.tchip {
  padding: 7px 12px;
  border-radius: 99px;
  background: rgba(255, 107, 116, .14);
  border: 1px solid rgba(255, 107, 116, .45);
  font-family: var(--display);
  font-weight: 700;
  font-size: 15px;
  font-variant-numeric: tabular-nums;
}
.tchip b { color: var(--coral); font-size: 12px; margin-left: 5px; }

/* ================= star beasts ================= */
.bgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(215px, 1fr)); gap: 12px; }
.bcard {
  padding: 14px;
  border-radius: 18px;
  background: var(--panel-2);
  border: 1px solid var(--line);
  text-align: center;
}
.bcard.locked { opacity: .6; }
.bcard h3 { font-family: var(--display); font-size: 16.5px; margin: 10px 0 4px; }
.bcard p { margin: 0; font-size: 13px; color: var(--muted); }
.cons { width: 100%; }
.cons svg { width: 100%; height: auto; display: block; }
.cons .clines { stroke: var(--violet); stroke-width: 0.7; fill: none; opacity: .75; }
.cons .cdots { fill: var(--gold); }
.cons.bright .cdots { filter: drop-shadow(0 0 3px rgba(255, 201, 74, .9)); }
.cons.dim .cdots { fill: rgba(255, 255, 255, .25); }

.badges { display: grid; grid-template-columns: repeat(auto-fill, minmax(165px, 1fr)); gap: 10px; }
.badge {
  padding: 12px;
  border-radius: 14px;
  background: rgba(255, 201, 74, .1);
  border: 1px solid rgba(255, 201, 74, .4);
  text-align: center;
}
.badge span { font-size: 24px; display: block; }
.badge b { display: block; font-family: var(--display); font-size: 14.5px; }
.badge i { font-style: normal; font-size: 12px; color: var(--muted); }
.badge.off { background: rgba(255, 255, 255, .04); border-color: var(--line); opacity: .6; }

/* ================= shop ================= */
.igrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(165px, 1fr)); gap: 10px; }
.icard {
  display: flex; flex-direction: column; gap: 4px;
  padding: 13px;
  border-radius: 16px;
  background: var(--panel-2);
  border: 1px solid var(--line);
  text-align: center;
}
.icard.owned { border-color: var(--teal); }
.iglyph { font-size: 30px; }
.icard b { font-family: var(--display); font-size: 15.5px; }
.icard .have { font-size: 11.5px; letter-spacing: .5px; text-transform: uppercase; color: var(--teal); font-weight: 800; }
.icard i { font-style: normal; font-size: 12.5px; color: var(--muted); flex: 1; }
.buy {
  margin-top: 8px;
  padding: 9px;
  border-radius: 11px;
  border: none;
  background: linear-gradient(180deg, var(--gold), var(--gold-deep));
  color: #2A1B00;
  font-family: var(--display);
  font-weight: 800; font-size: 15px;
}
.buy.no { background: rgba(255, 255, 255, .07); color: var(--muted); cursor: not-allowed; }
.buy.on { background: rgba(69, 224, 192, .2); color: var(--teal); border: 1px solid var(--teal); }

/* ================= grown-ups table ================= */
.tablewrap { overflow-x: auto; margin-bottom: 4px; }
table.stats { width: 100%; border-collapse: collapse; font-size: 14px; min-width: 420px; }
table.stats th {
  text-align: left;
  font-size: 11.5px; letter-spacing: .8px; text-transform: uppercase;
  color: var(--muted); font-weight: 800;
  padding: 8px 10px;
  border-bottom: 1px solid var(--line);
}
table.stats td { padding: 10px; border-bottom: 1px solid rgba(255, 255, 255, .06); }
table.stats .num { text-align: right; font-variant-numeric: tabular-nums; }
.acc { font-size: 12px; font-weight: 800; padding: 3px 9px; border-radius: 99px; }
.acc.good { background: rgba(69, 224, 192, .18); color: var(--teal); }
.acc.ok { background: rgba(255, 201, 74, .18); color: var(--gold); }
.acc.low { background: rgba(255, 107, 116, .18); color: var(--coral); }
.acc.none { background: rgba(255, 255, 255, .07); color: var(--muted); }

/* ================= footer ================= */
.foot { text-align: center; font-size: 12.5px; color: var(--muted); padding-top: 4px; }

/* ================= narrow screens ================= */
@media (max-width: 430px) {
  .shell { padding-block: 12px 48px; }
  .panel { padding: 15px 13px; border-radius: 18px; }
  .rgrid, .sgrid { grid-template-columns: 1fr; }
  .avatar { width: 46px; height: 46px; font-size: 22px; }
  .choice { min-height: 60px; }
}

@media (prefers-reduced-motion: reduce) {
  * { animation-duration: .001s !important; transition-duration: .001s !important; }
}

/* ======================================================================
   THE PRESENT — every correct answer unwraps a toy
   ====================================================================== */
.giftwrap {
  position: fixed;
  left: 50%; top: 40%;
  transform: translate(-50%, -50%);
  z-index: 70;
  pointer-events: none;
  display: grid;
  grid-template-rows: 150px auto;
  justify-items: center;
  --gc1: #FF9BD2; --gc2: #E0559F; --gglow: rgba(255, 121, 196, .5);
}
.giftwrap.r-rare { --gc1: #7FE9FF; --gc2: #2E9BD6; --gglow: rgba(69, 224, 192, .55); }
.giftwrap.r-legend { --gc1: #FFDE87; --gc2: #E89A1C; --gglow: rgba(255, 201, 74, .65); }

/* a soft spotlight so the toy reads clearly over whatever is behind it */
.giftscrim {
  position: fixed; inset: 0;
  z-index: 69;
  pointer-events: none;
  background: radial-gradient(circle at 50% 40%,
    rgba(4, 6, 18, .95) 0%, rgba(4, 6, 18, .9) 14%, rgba(4, 6, 18, .6) 24%, rgba(4, 6, 18, 0) 46%);
  /* One animation covering the whole 2.1s life of the present: stacking a
     fade-in and a delayed fade-out left the element stuck at opacity 0. */
  animation: scrimCycle 2.1s ease-out forwards;
}
@keyframes scrimCycle {
  0% { opacity: 0; }
  12% { opacity: 1; }
  71% { opacity: 1; }
  93% { opacity: 0; }
  100% { opacity: 0; }
}

.rays, .giftbox, .toypop { grid-area: 1 / 1; align-self: center; }
.toylabel { grid-area: 2 / 1; }

.rays {
  width: 190px; height: 190px;
  border-radius: 50%;
  background: radial-gradient(circle, var(--gglow) 0%, transparent 62%);
  animation: raysOut .6s ease-out .6s both;
}
.giftwrap.r-legend .rays { width: 240px; height: 240px; }

/* the box, drawn in CSS */
.giftbox {
  position: relative;
  width: 98px; height: 110px;
  animation: giftIn .28s cubic-bezier(.2, 1.7, .4, 1) both,
             giftShake .42s ease-in-out .3s 1,
             giftGone .28s ease-in .64s forwards;
}
.gb-body {
  position: absolute; left: 6px; bottom: 0;
  width: 86px; height: 72px;
  border-radius: 7px;
  background: linear-gradient(160deg, var(--gc1), var(--gc2));
  box-shadow: inset 0 -8px 16px rgba(0, 0, 0, .18);
}
.gb-lid {
  position: absolute; left: 0; top: 14px;
  width: 98px; height: 26px;
  border-radius: 6px;
  background: linear-gradient(160deg, var(--gc1), var(--gc2));
  filter: brightness(1.12);
  animation: lidOff .5s cubic-bezier(.3, -.5, .6, 1) .62s forwards;
}
.gb-band {
  position: absolute; left: 41px; bottom: 0;
  width: 16px; height: 72px;
  background: linear-gradient(180deg, #FFE39B, var(--gold));
  border-radius: 2px;
}
.gb-bow {
  position: absolute; top: -8px; left: 50%;
  transform: translateX(-50%);
  font-size: 30px;
  animation: bowOff .5s cubic-bezier(.3, -.5, .6, 1) .62s forwards;
}

.toypop {
  animation: toyPop .46s cubic-bezier(.2, 1.75, .4, 1) .7s backwards;
}
.toy {
  font-size: 66px;
  line-height: 1;
  filter: drop-shadow(0 7px 16px rgba(0, 0, 0, .5));
}

.toylabel {
  margin-top: 6px;
  text-align: center;
  animation: labelUp .38s ease-out .88s backwards;
}
.toylabel b {
  display: block;
  font-family: var(--display);
  font-size: 21px; font-weight: 800;
  color: var(--text);
  text-shadow: 0 2px 10px rgba(0, 0, 0, .7);
}
.toylabel i {
  font-style: normal;
  font-size: 12px; font-weight: 800;
  letter-spacing: 1px; text-transform: uppercase;
  color: var(--gc1);
}
.newtag {
  display: inline-block;
  padding: 2px 10px; margin-bottom: 4px;
  border-radius: 99px;
  background: linear-gradient(180deg, var(--gold), var(--gold-deep));
  color: #2A1B00;
  font-family: var(--display);
  font-size: 12px; font-weight: 800; letter-spacing: 1px;
  animation: newPop .4s cubic-bezier(.2, 1.8, .4, 1) 1s backwards;
}

.giftwrap.away { animation: flyAway .55s ease-in forwards; }

@keyframes giftIn { from { transform: scale(0) rotate(-25deg); } }
@keyframes giftShake {
  0%, 100% { transform: rotate(0); }
  20% { transform: rotate(-9deg); }
  45% { transform: rotate(8deg); }
  70% { transform: rotate(-5deg); }
}
@keyframes giftGone { to { transform: scale(.5); opacity: 0; } }
@keyframes lidOff { to { transform: translateY(-82px) rotate(32deg); opacity: 0; } }
@keyframes bowOff { to { transform: translateX(-50%) translateY(-96px) rotate(-28deg); opacity: 0; } }
@keyframes raysOut { from { transform: scale(.2); opacity: 0; } 60% { opacity: 1; } to { transform: scale(1.1); opacity: .75; } }
@keyframes toyPop { from { transform: scale(.1); opacity: 0; } }
@keyframes labelUp { from { transform: translateY(14px); opacity: 0; } }
@keyframes newPop { from { transform: scale(0) rotate(-14deg); } }
@keyframes flyAway { to { transform: translate(-50%, -50%) translate(26vw, -40vh) scale(.15); opacity: 0; } }

/* --- each toy moves its own way --- */
@keyframes hop { 0%,100% { transform: translateY(0) scaleY(1); } 30% { transform: translateY(-20px) scaleY(1.06); } 55% { transform: translateY(0) scaleY(.92); } }
@keyframes float { 0%,100% { transform: translateY(0) rotate(-5deg); } 50% { transform: translateY(-14px) rotate(5deg); } }
@keyframes bounce { 0%,100% { transform: translateY(0) scale(1.08, .9); } 40% { transform: translateY(-26px) scale(.93, 1.1); } }
@keyframes drop { 0%,100% { transform: translateY(-6px); } 50% { transform: translateY(24px); } }
@keyframes waddle { 0%,100% { transform: translateX(-7px) rotate(-13deg); } 50% { transform: translateX(7px) rotate(13deg); } }
@keyframes wiggle { 0%,100% { transform: rotate(-15deg); } 50% { transform: rotate(15deg); } }
@keyframes snap { 0%,100% { transform: scale(1); } 45% { transform: scale(1.17); } }
@keyframes beat { 0%,100% { transform: scale(1) rotate(0); } 25% { transform: scale(1.2) rotate(-7deg); } 60% { transform: scale(.96) rotate(6deg); } }
@keyframes sway { 0%,100% { transform: translateX(-11px) rotate(-19deg); } 50% { transform: translateX(11px) rotate(19deg); } }
@keyframes zoom { 0%,100% { transform: translateX(-18px); } 50% { transform: translateX(18px); } }
@keyframes glide { 0%,100% { transform: translate(-20px, 6px) rotate(-9deg); } 50% { transform: translate(20px, -6px) rotate(9deg); } }
@keyframes chug { 0%,100% { transform: translate(-15px, 0); } 25% { transform: translate(0, -4px); } 50% { transform: translate(15px, 0); } 75% { transform: translate(0, -4px); } }
@keyframes march { 0%,100% { transform: translateX(-11px) rotate(-10deg); } 50% { transform: translateX(11px) rotate(10deg); } }
@keyframes stomp { 0%,100% { transform: translateY(0) scale(1.07, .9); } 35% { transform: translateY(-17px) scale(.95, 1.08); } }
@keyframes flutter { 0%,100% { transform: translateY(-8px) rotate(-17deg); } 50% { transform: translateY(8px) rotate(17deg); } }
@keyframes roll { from { transform: translateX(-20px) rotate(0); } to { transform: translateX(20px) rotate(360deg); } }
@keyframes swing { 0%,100% { transform: rotate(-23deg); } 50% { transform: rotate(23deg); } }
@keyframes leap { 0%,100% { transform: translate(-14px, 10px) rotate(-16deg); } 50% { transform: translate(14px, -14px) rotate(16deg); } }
@keyframes notes { 0%,100% { transform: translateY(0) scale(1); } 50% { transform: translateY(-11px) scale(1.1); } }
@keyframes launch { 0% { transform: translateY(10px) rotate(-6deg); } 100% { transform: translateY(-16px) rotate(6deg); } }
@keyframes gallop { 0%,100% { transform: translate(-11px, 4px); } 50% { transform: translate(11px, -10px); } }
@keyframes sparkle { 0%,100% { transform: rotate(-22deg) scale(1); } 50% { transform: rotate(22deg) scale(1.16); } }
@keyframes build { 0%,100% { transform: scaleY(.93); } 50% { transform: scaleY(1.08); } }
@keyframes kaleid { from { transform: rotate(0); filter: hue-rotate(0); } to { transform: rotate(360deg); filter: hue-rotate(360deg); } }

.a-hop { animation: hop .85s ease-in-out infinite; }
.a-float { animation: float 1.8s ease-in-out infinite; }
.a-bounce { animation: bounce .72s ease-in-out infinite; }
.a-drop { animation: drop 1.1s ease-in-out infinite; }
.a-waddle { animation: waddle .62s ease-in-out infinite; }
.a-wiggle { animation: wiggle .5s ease-in-out infinite; }
.a-snap { animation: snap .7s ease-in-out infinite; }
.a-beat { animation: beat .45s ease-in-out infinite; }
.a-sway { animation: sway 1.5s ease-in-out infinite; }
.a-zoom { animation: zoom .9s ease-in-out infinite; }
.a-glide { animation: glide 1.9s ease-in-out infinite; }
.a-chug { animation: chug 1.2s linear infinite; }
.a-march { animation: march .5s steps(2, end) infinite; }
.a-stomp { animation: stomp .8s ease-in-out infinite; }
.a-flutter { animation: flutter .38s ease-in-out infinite; }
.a-roll { animation: roll 1.4s linear infinite alternate; }
.a-swing { animation: swing 1.2s ease-in-out infinite; transform-origin: 50% 8%; }
.a-leap { animation: leap 1s ease-in-out infinite; }
.a-notes { animation: notes .8s ease-in-out infinite; }
.a-launch { animation: launch .9s ease-in-out infinite alternate; }
.a-gallop { animation: gallop .55s ease-in-out infinite; }
.a-sparkle { animation: sparkle 1s ease-in-out infinite; }
.a-build { animation: build .9s ease-in-out infinite; transform-origin: 50% 100%; }
.a-kaleid { animation: kaleid 3.4s linear infinite; }

/* ======================================================================
   TOY BOX
   ====================================================================== */
.tgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(116px, 1fr)); gap: 10px; }
.tcard {
  padding: 13px 8px 11px;
  border-radius: 16px;
  background: var(--panel-2);
  border: 1px solid var(--line);
  text-align: center;
  position: relative;
  overflow: hidden;
}
.tcard.r-rare { border-color: rgba(69, 224, 192, .45); }
.tcard.r-legend {
  border-color: rgba(255, 201, 74, .55);
  background: linear-gradient(180deg, rgba(255, 201, 74, .13), var(--panel-2));
}
.tcard .tglyph { font-size: 36px; line-height: 1.1; }
/* the toys hold still in the cabinet until you look at one */
.tcard .tglyph[class*="a-"] { animation-play-state: paused; }
.tcard:hover .tglyph[class*="a-"] { animation-play-state: running; }
.tcard b { display: block; font-family: var(--display); font-size: 13.5px; margin-top: 4px; line-height: 1.25; }
.tcard i { font-style: normal; font-size: 10.5px; letter-spacing: .6px; text-transform: uppercase; color: var(--muted); font-weight: 800; }
.tcard.r-rare i { color: var(--teal); }
.tcard.r-legend i { color: var(--gold); }
.tcount {
  position: absolute; top: 7px; right: 8px;
  font-family: var(--display); font-size: 12px; font-weight: 800;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}
.tcard.locked { opacity: .45; }
.tcard.locked .tglyph { filter: grayscale(1); }

.blitztoys { margin: 16px 0 4px; }
.btrow { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; }
.bt {
  position: relative;
  width: 52px; height: 52px;
  display: grid; place-items: center;
  font-size: 27px;
  border-radius: 14px;
  background: var(--panel-2);
  border: 1px solid var(--line);
  animation: toyPop .4s cubic-bezier(.2, 1.7, .4, 1) backwards;
}
.bt.r-rare { border-color: rgba(69, 224, 192, .5); }
.bt.r-legend { border-color: var(--gold); background: rgba(255, 201, 74, .14); }
.bt i {
  position: absolute; bottom: -5px;
  font-style: normal; font-size: 8.5px; font-weight: 800; letter-spacing: .5px;
  padding: 1px 5px; border-radius: 99px;
  background: var(--gold); color: #2A1B00;
}

/* ======================================================================
   THE REPAIR PANEL — what went wrong, and the way through it
   ====================================================================== */
.fb.fixit { padding: 16px; }
.fxhead { display: flex; align-items: center; gap: 12px; }
.fxorb { font-size: 30px; flex: none; animation: orbPulse 1.7s ease-in-out infinite; }
@keyframes orbPulse { 0%, 100% { transform: scale(1); filter: brightness(1); } 50% { transform: scale(1.12); filter: brightness(1.35); } }
.fxtitle b { display: block; font-family: var(--display); font-size: 19px; font-weight: 800; color: var(--gold); }
.fxtitle i { font-style: normal; font-size: 12.5px; color: var(--muted); }

.fxpicked {
  margin-top: 13px;
  padding: 11px 13px;
  border-radius: 12px;
  background: rgba(255, 107, 116, .12);
  border-left: 3px solid var(--coral);
  animation: stepIn .35s ease-out backwards;
}
.fxyou { font-size: 11px; letter-spacing: 1.1px; text-transform: uppercase; font-weight: 800; color: var(--coral); }
.fxpicked > b { font-family: var(--display); font-size: 21px; vertical-align: middle; margin-left: 4px; }
.fxpicked p { margin: 7px 0 0; font-size: 14.5px; line-height: 1.5; }

.fxwalk { margin-top: 15px; }
.fxlabel {
  display: block;
  font-size: 11px; letter-spacing: 1.2px; text-transform: uppercase;
  font-weight: 800; color: var(--teal);
  margin-bottom: 9px;
}
.fxsteps { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.fxstep {
  display: flex; gap: 11px; align-items: flex-start;
  padding: 10px 12px;
  border-radius: 12px;
  background: rgba(155, 139, 255, .11);
  border: 1px solid var(--line-soft);
  animation: stepIn .42s ease-out backwards;
  animation-delay: calc(var(--d) * 190ms + 150ms);
}
@keyframes stepIn { from { transform: translateX(-14px); opacity: 0; } }
.fxn {
  flex: none;
  width: 24px; height: 24px;
  border-radius: 50%;
  background: var(--violet);
  color: #0A0E26;
  font-family: var(--display); font-size: 14px; font-weight: 800;
  display: grid; place-items: center;
}
.fxstep p { margin: 0; font-size: 14.5px; line-height: 1.45; }

.fxans {
  margin-top: 15px;
  padding: 13px;
  border-radius: 14px;
  text-align: center;
  background: linear-gradient(135deg, rgba(255, 201, 74, .22), rgba(69, 224, 192, .1));
  border: 1px solid var(--gold);
  animation: ansGlow .5s ease-out .78s backwards;
}
@keyframes ansGlow { from { transform: scale(.9); opacity: 0; } }
.fxans span { display: block; font-size: 11px; letter-spacing: 1.1px; text-transform: uppercase; font-weight: 800; color: var(--muted); }
.fxans b { font-family: var(--display); font-size: 32px; font-weight: 800; color: var(--gold); line-height: 1.2; }
.fxans i { font-style: normal; font-size: 13px; color: var(--muted); margin-left: 6px; }

.go.relight { background: linear-gradient(180deg, var(--teal), #27B79A); color: #04231D; box-shadow: 0 6px 0 rgba(20, 130, 110, .6); }
.go.relight:active { box-shadow: 0 3px 0 rgba(20, 130, 110, .6); }
.go.relight .plus { font-size: 13px; opacity: .75; margin-left: 4px; }

@media (max-width: 430px) {
  .giftwrap { grid-template-rows: 130px auto; }
  .toy { font-size: 56px; }
  .tgrid { grid-template-columns: repeat(auto-fill, minmax(100px, 1fr)); }
}

/* ======================================================================
   NOVA — the star cub, drawn in SVG and grown from earned stars
   ====================================================================== */
.cub {
  --cb: #9B8BFF; --cb2: #6E5CD8; --ca: #FFC94A; --cdark: #121840;
  line-height: 0;
}
.cub.f2 { --cb: #8FA6FF; --cb2: #5C74D8; }
.cub.f3 { --cb: #7FD6F0; --cb2: #3E9DBE; }
.cub.f4 { --cb: #8BE8D6; --cb2: #35B59C; }
.cub.f5 { --cb: #FFD98A; --cb2: #E89A1C; --ca: #FFF3CF; }

.cub svg { width: 100%; height: auto; display: block; overflow: visible; }
.cub.tiny { width: 46px; }
.cub.mini { width: 50px; flex: none; }
.cub.mid { width: 132px; margin: 0 auto; }
.cub.big { width: 190px; margin: 0 auto; }

.cb-body { fill: var(--cb); }
.cb-belly { fill: rgba(255, 255, 255, .22); }
.cb-ear { fill: var(--cb2); }
.cb-ear-in { fill: var(--magenta); opacity: .5; }
.cb-eye { fill: var(--cdark); }
.cb-glint { fill: #fff; }
.cb-cheek { fill: var(--magenta); opacity: .45; }
.cb-mouth, .cb-lid { fill: none; stroke: var(--cdark); stroke-width: 2.6; stroke-linecap: round; }
.cb-mark { fill: var(--ca); filter: drop-shadow(0 0 4px var(--ca)); }
.cb-crown { fill: var(--gold); stroke: var(--gold-deep); stroke-width: 1.4; stroke-linejoin: round; }
.ct { fill: none; stroke: var(--cb2); stroke-width: 5.5; stroke-linecap: round; }
.ct-star { fill: var(--ca); filter: drop-shadow(0 0 5px var(--ca)); }
.cw {
  fill: var(--cb);
  opacity: .9;
  stroke: var(--cb2);
  stroke-width: 2;
  stroke-linejoin: round;
  filter: brightness(1.25) drop-shadow(0 0 7px var(--cb));
}
.cub-spark { fill: var(--ca); }
.cz { fill: var(--muted); font-family: var(--display); font-size: 15px; font-weight: 800; }

.eg-shell { fill: var(--cb); }
.eg-spot { fill: rgba(255, 255, 255, .3); }
.eg-crack { fill: none; stroke: var(--cdark); stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; opacity: .55; }

/* motion */
.cub-float { animation: cubFloat 3.1s ease-in-out infinite; transform-box: fill-box; transform-origin: center; }
@keyframes cubFloat { 0%, 100% { transform: translateY(2px); } 50% { transform: translateY(-4px); } }

.cub-eyes { animation: cubBlink 4.6s ease-in-out infinite; transform-box: fill-box; transform-origin: center; }
@keyframes cubBlink { 0%, 93%, 100% { transform: scaleY(1); } 96% { transform: scaleY(.08); } }

.cub.f4 .cub-wings, .cub.f5 .cub-wings { animation: cubFlap 1.6s ease-in-out infinite; transform-box: fill-box; transform-origin: center bottom; }
@keyframes cubFlap { 0%, 100% { transform: scaleX(1) scaleY(.94); } 50% { transform: scaleX(.88) scaleY(1.1); } }

.cub-tail { animation: cubTail 2.4s ease-in-out infinite; transform-box: fill-box; transform-origin: 8% 70%; }
@keyframes cubTail { 0%, 100% { transform: rotate(-7deg); } 50% { transform: rotate(9deg); } }

.m-happy .cub-float { animation: cubCheer .52s cubic-bezier(.3, 1.5, .4, 1) infinite; }
@keyframes cubCheer { 0%, 100% { transform: translateY(0) scale(1); } 40% { transform: translateY(-13px) scale(1.05, .96); } }
.m-sad .cub-main { animation: cubTilt 2.2s ease-in-out infinite; transform-box: fill-box; transform-origin: center bottom; }
@keyframes cubTilt { 0%, 100% { transform: rotate(-4deg); } 50% { transform: rotate(4deg); } }
.m-sleep .cub-float { animation: cubSleep 3.6s ease-in-out infinite; }
@keyframes cubSleep { 0%, 100% { transform: translateY(3px) scale(1, .98); } 50% { transform: translateY(-2px) scale(1.02, 1); } }

.cub-spark { animation: sparkPop 1.1s ease-out infinite; animation-delay: calc(var(--i) * 130ms); transform-box: fill-box; transform-origin: center; }
@keyframes sparkPop { 0% { transform: scale(0) rotate(0); opacity: 0; } 35% { transform: scale(1.15) rotate(40deg); opacity: 1; } 100% { transform: scale(.2) rotate(90deg); opacity: 0; } }
.cz { animation: zzzUp 2.4s ease-out infinite; animation-delay: calc(var(--i) * 420ms); opacity: 0; }
@keyframes zzzUp { 0% { transform: translateY(6px); opacity: 0; } 30% { opacity: .9; } 100% { transform: translateY(-14px); opacity: 0; } }
.m-happy .eg-shell, .cub.f0 .eg-shell { animation: eggWobble 2.6s ease-in-out infinite; transform-box: fill-box; transform-origin: center bottom; }
@keyframes eggWobble { 0%, 70%, 100% { transform: rotate(0); } 78% { transform: rotate(-6deg); } 86% { transform: rotate(5deg); } 93% { transform: rotate(-2deg); } }

/* in the HUD */
.cubslot {
  flex: none;
  width: 56px; height: 56px;
  padding: 3px;
  border-radius: 50%;
  border: 1px solid var(--line-soft);
  background: radial-gradient(circle at 50% 60%, rgba(155, 139, 255, .22), rgba(20, 27, 60, .5));
  display: grid; place-items: center;
  transition: transform .16s, border-color .16s;
}
.cubslot:hover { transform: translateY(-2px) scale(1.06); border-color: var(--violet); }

/* Nova's own screen */
.cubpanel { text-align: center; }
.cubstage {
  padding: 10px 0 2px;
  background: radial-gradient(ellipse at 50% 68%, rgba(155, 139, 255, .22), transparent 66%);
}
.cubblurb { color: var(--muted); max-width: 44ch; margin: 4px auto 16px; font-size: 15px; }
.cubnext {
  padding: 14px;
  border-radius: 16px;
  background: var(--panel-2);
  border: 1px solid var(--line);
  text-align: left;
}
.cnhead { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; font-size: 14.5px; flex-wrap: wrap; }
.cnhead b { font-family: var(--display); font-size: 17px; color: var(--gold); }
.cnnum { font-family: var(--display); font-weight: 800; color: var(--teal); font-variant-numeric: tabular-nums; }
.qbar.big { height: 12px; margin: 10px 0 8px; }
.qbar.big i { background: linear-gradient(90deg, var(--violet), var(--teal)); }
.cubnext p { margin: 0; font-size: 13.5px; color: var(--muted); }
.cubnext.maxed { text-align: center; }
.cubnext.maxed b { font-family: var(--display); font-size: 18px; color: var(--gold); }

.cstages { display: flex; gap: 6px; margin: 16px 0; justify-content: center; flex-wrap: wrap; }
.cstage {
  flex: 1 1 94px; max-width: 130px;
  padding: 9px 6px;
  border-radius: 12px;
  background: rgba(255, 255, 255, .04);
  border: 1px solid var(--line);
  opacity: .5;
}
.cstage.on { opacity: 1; }
.cstage.here { border-color: var(--gold); background: rgba(255, 201, 74, .12); }
.cdot { display: block; width: 9px; height: 9px; margin: 0 auto 6px; border-radius: 50%; background: var(--line); }
.cstage.on .cdot { background: var(--teal); box-shadow: 0 0 8px var(--teal); }
.cstage.here .cdot { background: var(--gold); box-shadow: 0 0 10px var(--gold); }
.cstage b { display: block; font-family: var(--display); font-size: 12.5px; line-height: 1.2; }
.cstage i { font-style: normal; font-size: 10.5px; color: var(--muted); }

/* ======================================================================
   THE WEEK IN THE SKY
   ====================================================================== */
.weekpanel { padding-bottom: 14px; }
.wrow { display: flex; gap: 7px; justify-content: space-between; }
.wd {
  flex: 1;
  display: flex; flex-direction: column; align-items: center; gap: 5px;
  animation: wdIn .4s cubic-bezier(.2, 1.5, .4, 1) backwards;
  animation-delay: calc(var(--i) * 55ms);
}
@keyframes wdIn { from { transform: translateY(10px) scale(.7); opacity: 0; } }
.wdot {
  width: 100%; max-width: 46px; aspect-ratio: 1;
  border-radius: 13px;
  display: grid; place-items: center;
  background: rgba(255, 255, 255, .05);
  border: 1.5px solid var(--line);
  font-size: 17px; color: transparent;
}
.wd.on .wdot {
  background: linear-gradient(170deg, rgba(255, 201, 74, .3), rgba(255, 201, 74, .12));
  border-color: var(--gold);
  color: var(--gold);
  text-shadow: 0 0 10px rgba(255, 201, 74, .7);
}
.wd.now .wdot { border-color: var(--teal); box-shadow: 0 0 0 3px rgba(69, 224, 192, .18); }
.wd i { font-style: normal; font-size: 11px; font-weight: 800; color: var(--muted); letter-spacing: .5px; }
.wd.now i { color: var(--teal); }
.wfoot { margin-top: 12px; }
.wfoot p { margin: 0 0 10px; font-size: 13.5px; color: var(--muted); }
.claim.wide { max-width: 320px; margin: 0 auto; }
.wrow.small .wdot { max-width: 34px; border-radius: 10px; font-size: 13px; }

/* ======================================================================
   WELCOME BACK
   ====================================================================== */
.wbwrap {
  position: fixed; inset: 0;
  z-index: 80;
  display: grid; place-items: center;
  padding: 20px;
  background: rgba(4, 6, 18, .88);
  backdrop-filter: blur(5px);
  animation: wbIn .35s ease-out;
}
.wbwrap.out { animation: wbOut .34s ease-in forwards; }
@keyframes wbIn { from { opacity: 0; } }
@keyframes wbOut { to { opacity: 0; } }
.wbcard {
  width: 100%; max-width: 420px;
  padding: 22px 20px 20px;
  border-radius: 24px;
  text-align: center;
  background: linear-gradient(170deg, rgba(31, 41, 92, .97), rgba(11, 16, 40, .97));
  border: 1px solid var(--violet);
  box-shadow: 0 30px 70px rgba(0, 0, 0, .6);
  animation: wbCard .45s cubic-bezier(.2, 1.4, .4, 1);
}
@keyframes wbCard { from { transform: translateY(26px) scale(.92); opacity: 0; } }
.wbcub { margin-bottom: 4px; }
.wbtitle { font-family: var(--display); font-size: 25px; font-weight: 800; margin: 0; text-wrap: balance; }
.wbsub { color: var(--muted); font-size: 14px; margin: 5px 0 16px; min-height: 2.6em; }
.wbstats { display: flex; justify-content: center; gap: 18px; margin: 15px 0 4px; flex-wrap: wrap; }
.wbstats span { font-size: 12px; color: var(--muted); }
.wbstats b { display: block; font-family: var(--display); font-size: 22px; color: var(--gold); }

/* ======================================================================
   THE ANIMATION PASS
   ====================================================================== */
#view.enter > .panel { animation: viewIn .42s cubic-bezier(.2, .9, .3, 1) backwards; }
#view.enter > .panel:nth-child(2) { animation-delay: .07s; }
#view.enter > .panel:nth-child(3) { animation-delay: .13s; }
@keyframes viewIn { from { transform: translateY(16px); opacity: 0; } }

#view.enter .rcard, #view.enter .scard, #view.enter .tcard, #view.enter .bcard, #view.enter .icard {
  animation: cardIn .4s cubic-bezier(.2, 1.1, .3, 1) backwards;
}
.rgrid > *:nth-child(n) { --s: 0; }
#view.enter .rgrid > *:nth-child(1), #view.enter .sgrid > *:nth-child(1) { animation-delay: .04s; }
#view.enter .rgrid > *:nth-child(2), #view.enter .sgrid > *:nth-child(2) { animation-delay: .09s; }
#view.enter .rgrid > *:nth-child(3), #view.enter .sgrid > *:nth-child(3) { animation-delay: .14s; }
#view.enter .rgrid > *:nth-child(4), #view.enter .sgrid > *:nth-child(4) { animation-delay: .19s; }
#view.enter .rgrid > *:nth-child(5) { animation-delay: .24s; }
#view.enter .rgrid > *:nth-child(6) { animation-delay: .29s; }
#view.enter .rgrid > *:nth-child(7) { animation-delay: .34s; }
#view.enter .rgrid > *:nth-child(8) { animation-delay: .39s; }
@keyframes cardIn { from { transform: translateY(14px) scale(.97); opacity: 0; } }

.chip b.bump { animation: chipBump .45s cubic-bezier(.2, 1.7, .4, 1); display: inline-block; }
@keyframes chipBump { 0% { transform: scale(1); } 35% { transform: scale(1.45); color: #fff; } 100% { transform: scale(1); } }

/* a hot streak warms the whole question card */
.play.warm .qcard { border-color: rgba(255, 201, 74, .4); }
.play.hot .qcard {
  border-color: var(--gold);
  box-shadow: 0 0 26px rgba(255, 201, 74, .22);
}
.play.blazing .qcard {
  border-color: transparent;
  box-shadow: 0 0 34px rgba(255, 121, 196, .3);
  background-image: linear-gradient(170deg, rgba(31, 41, 92, .92), rgba(13, 19, 46, .92)),
                    linear-gradient(120deg, var(--gold), var(--magenta), var(--teal), var(--gold));
  background-origin: border-box;
  background-clip: padding-box, border-box;
  border: 2px solid transparent;
  animation: auroraShift 3s linear infinite;
  background-size: 100% 100%, 300% 300%;
}
@keyframes auroraShift { to { background-position: 0 0, 300% 0; } }

/* losing a heart */
.play.hurt { animation: hurtShake .45s cubic-bezier(.36, .07, .19, .97); }
.play.hurt::after {
  content: '';
  position: absolute; inset: 0;
  border-radius: 22px;
  pointer-events: none;
  background: radial-gradient(ellipse at 50% 50%, transparent 52%, rgba(255, 107, 116, .3) 100%);
  animation: hurtFlash .55s ease-out forwards;
}
.panel.play { position: relative; }
@keyframes hurtShake { 10%, 90% { transform: translateX(-3px); } 20%, 80% { transform: translateX(5px); } 30%, 50%, 70% { transform: translateX(-8px); } 40%, 60% { transform: translateX(8px); } }
@keyframes hurtFlash { to { opacity: 0; } }
.hearts b.gone { animation: heartBreak .5s ease-out; }
@keyframes heartBreak { 0% { transform: scale(1.5) rotate(0); } 40% { transform: scale(.8) rotate(-18deg); } 100% { transform: scale(1) rotate(0); } }

/* constellations draw themselves in */
.cons .clines line {
  animation: drawLine .7s ease-out forwards;
  animation-delay: calc(var(--i) * 110ms + 200ms);
}
@keyframes drawLine { to { stroke-dashoffset: 0; } }
.cons .cdots circle {
  animation: dotPop .4s cubic-bezier(.2, 1.8, .4, 1) backwards;
  animation-delay: calc(var(--i) * 90ms);
  transform-box: fill-box; transform-origin: center;
}
@keyframes dotPop { from { transform: scale(0); opacity: 0; } }
.cons.dim .cdots circle { animation: none; }

.grewbox { border-color: var(--teal); background: rgba(69, 224, 192, .1); }
.grewbox .nbtag { color: var(--teal); }

.levelup { animation: levelPop .6s cubic-bezier(.2, 1.5, .4, 1); }
@keyframes levelPop { 0% { transform: scale(.8); opacity: 0; } 60% { transform: scale(1.04); } 100% { transform: scale(1); } }

/* toasts */
.toast {
  position: fixed;
  left: 50%; bottom: 22px;
  transform: translateX(-50%);
  z-index: 75;
  max-width: min(92vw, 420px);
  padding: 12px 18px;
  border-radius: 99px;
  background: rgba(16, 22, 54, .97);
  border: 1px solid var(--violet);
  box-shadow: 0 14px 36px rgba(0, 0, 0, .5);
  font-size: 14px; font-weight: 700;
  text-align: center;
  animation: toastIn .4s cubic-bezier(.2, 1.4, .4, 1);
}
.toast.out { animation: toastOut .5s ease-in forwards; }
@keyframes toastIn { from { transform: translateX(-50%) translateY(26px); opacity: 0; } }
@keyframes toastOut { to { transform: translateX(-50%) translateY(26px); opacity: 0; } }

@media (max-width: 430px) {
  .cubslot { width: 48px; height: 48px; }
  .cub.big { width: 160px; }
  .wrow { gap: 4px; }
  .cstage { flex: 1 1 72px; }
}
