/* PetForge — deliberately not a blue/purple loot-box game.
   Deep ink-green ground, tangerine / acid-lime / hot-magenta accents. */

:root {
  --bg:        #0B100E;
  --bg2:       #101815;
  --panel:     #141C19;
  --panel2:    #1A2420;
  --line:      #253029;
  --line2:     #33443B;
  --text:      #EDEAE3;
  --muted:     #8C9A93;
  --accent:    #FF6B35;   /* tangerine */
  --accent2:   #B8FF3C;   /* acid lime  */
  --accent3:   #FF2E88;   /* hot magenta */
  --gold:      #FFD23F;
  --danger:    #FF4D4D;
  --radius:    14px;
  --tap:       44px;
  --shadow:    0 10px 30px rgba(0,0,0,.45);
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  background:
    radial-gradient(1200px 700px at 12% -10%, rgba(255,107,53,.10), transparent 60%),
    radial-gradient(900px 600px at 95% 0%, rgba(184,255,60,.07), transparent 55%),
    var(--bg);
  color: var(--text);
  font: 15px/1.5 ui-rounded, "Avenir Next", "Segoe UI", system-ui, -apple-system, sans-serif;
  min-height: 100vh;
  -webkit-text-size-adjust: 100%;
  overflow-x: hidden;
}
button { font: inherit; color: inherit; cursor: pointer; }
h1, h2, h3 { margin: 0 0 .5rem; line-height: 1.2; }
b { color: var(--text); }

/* ── Top bar ─────────────────────────────────────────────────────────── */
.topbar {
  position: sticky; top: 0; z-index: 40;
  display: flex; align-items: center; gap: .75rem;
  padding: .6rem clamp(.7rem, 3vw, 1.4rem);
  background: rgba(11,16,14,.88);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--line);
}
.brand { display: flex; align-items: center; gap: .45rem; font-size: 1.15rem; letter-spacing: .5px; }
.brand-egg { font-size: 1.4rem; animation: bob 3s ease-in-out infinite; }
.brand-name b { color: var(--accent); }
.wallet { display: flex; gap: .4rem; margin-left: auto; flex-wrap: wrap; justify-content: flex-end; }
.stat {
  display: flex; align-items: center; gap: .35rem;
  background: var(--panel); border: 1px solid var(--line);
  border-radius: 999px; padding: .3rem .7rem; font-variant-numeric: tabular-nums;
  font-size: .9rem; white-space: nowrap;
}
.stat .ic { font-size: .95rem; }
.stat.coins { color: var(--gold); border-color: #4a3d13; }
.stat.earned { color: var(--accent2); border-color: #35461a; }
.stat.shards { color: #A9C6FF; border-color: #263651; }
.stat.ribbons { color: #FFB7D5; border-color: #4A2436; }
.stat.market { color: var(--accent); border-color: #4a2a17; }
.stat.market.hot { animation: pulseGlow 1.6s ease-in-out infinite; }
.icon-btn {
  width: 34px; height: 34px; border-radius: 50%; border: 1px solid var(--line);
  background: var(--panel); font-weight: 700;
}
.icon-btn:hover { border-color: var(--accent); color: var(--accent); }

/* ── Tabs ────────────────────────────────────────────────────────────── */
.tabs {
  position: sticky; top: 52px; z-index: 35;
  display: flex; gap: .3rem; overflow-x: auto; scrollbar-width: none;
  padding: .5rem clamp(.7rem, 3vw, 1.4rem);
  background: rgba(11,16,14,.82); backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--line);
}
.tabs::-webkit-scrollbar { display: none; }
.tab {
  position: relative; display: flex; align-items: center; gap: .4rem;
  border: 1px solid transparent; background: transparent; color: var(--muted);
  padding: .45rem .8rem; border-radius: 999px; white-space: nowrap; font-size: .9rem;
  min-height: 36px;
}
.tab span { font-size: 1.05rem; }
.tab:hover { color: var(--text); background: var(--panel); }
.tab.active { color: var(--bg); background: var(--accent2); font-weight: 700; }
.pip {
  width: 7px; height: 7px; border-radius: 50%; background: var(--accent3); display: none;
}
.pip.show { display: block; }
.pip.live { display: block; animation: blink 1.8s infinite; }

main { padding: clamp(.8rem, 3vw, 1.6rem); max-width: 1180px; margin: 0 auto; }

/* ── Generic UI ──────────────────────────────────────────────────────── */
.panel {
  background: var(--panel); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 1rem;
}
.panel + .panel { margin-top: 1rem; }
.section-title {
  display: flex; align-items: center; gap: .5rem; flex-wrap: wrap;
  font-size: 1.05rem; margin-bottom: .8rem;
}
.section-title .hint { font-size: .8rem; color: var(--muted); font-weight: 400; }
.muted { color: var(--muted); }
.small { font-size: .82rem; }
.right { margin-left: auto; }
.row { display: flex; align-items: center; gap: .5rem; flex-wrap: wrap; }

.btn {
  border: 1px solid var(--line2); background: var(--panel2); color: var(--text);
  border-radius: 10px; padding: .5rem .85rem; min-height: 38px; font-size: .9rem;
  transition: transform .08s ease, border-color .15s ease, background .15s ease;
}
.btn:hover:not(:disabled) { border-color: var(--accent); }
.btn:active:not(:disabled) { transform: translateY(1px); }
.btn:disabled { opacity: .38; cursor: not-allowed; }
.btn.primary { background: var(--accent); border-color: var(--accent); color: #1a0d06; font-weight: 700; }
.btn.primary:hover:not(:disabled) { filter: brightness(1.12); }
.btn.lime { background: var(--accent2); border-color: var(--accent2); color: #0e1406; font-weight: 700; }
.btn.pink { background: var(--accent3); border-color: var(--accent3); color: #2a0512; font-weight: 700; }
.btn.ghost { background: transparent; }
.btn.danger { border-color: #5a2222; color: #ff9a9a; }
.btn.sm { padding: .3rem .6rem; min-height: 30px; font-size: .8rem; border-radius: 8px; }

input[type="text"], input[type="number"], select {
  background: var(--bg2); border: 1px solid var(--line2); color: var(--text);
  border-radius: 10px; padding: .5rem .7rem; min-height: 38px; font: inherit; font-size: .9rem;
}
input:focus, select:focus { outline: 2px solid var(--accent); outline-offset: 1px; }
label.check { display: flex; align-items: center; gap: .5rem; cursor: pointer; padding: .3rem 0; }
input[type="checkbox"] { width: 18px; height: 18px; accent-color: var(--accent2); }

.bar { height: 8px; border-radius: 999px; background: var(--bg2); overflow: hidden; border: 1px solid var(--line); }
.bar > i { display: block; height: 100%; background: linear-gradient(90deg, var(--accent), var(--gold)); border-radius: 999px; transition: width .4s ease; }
.bar.lime > i { background: linear-gradient(90deg, var(--accent2), #4ee38a); }

/* ── Pet orbs & cards ────────────────────────────────────────────────── */
.orb {
  position: relative; display: inline-grid; place-items: center;
  width: 64px; height: 64px; flex: none;
}
.orb-ring {
  position: absolute; inset: 0; border-radius: 50%;
  border: 2px solid var(--rc);
  background: radial-gradient(circle at 50% 45%, color-mix(in srgb, var(--rc) 28%, transparent), transparent 68%);
  box-shadow: 0 0 14px color-mix(in srgb, var(--rc) 45%, transparent), inset 0 0 12px color-mix(in srgb, var(--rc) 22%, transparent);
  animation: spinRing 8s linear infinite;
}
.orb-glyph { position: relative; font-size: 1.9rem; line-height: 1; filter: drop-shadow(0 2px 4px rgba(0,0,0,.5)); }
.orb.huge { width: 168px; height: 168px; }
.orb.huge .orb-glyph { font-size: 5.4rem; }
.orb.sm { width: 42px; height: 42px; }
.orb.sm .orb-glyph { font-size: 1.25rem; }

/* Rarity effects — orb rings spin; tags must never inherit that rotation. */
.fx-rainbow .orb-ring {
  border-color: transparent;
  background-image: conic-gradient(#FF2E88, #FFD23F, #B8FF3C, #22C1C3, #FF6B35, #FF2E88);
  animation: spinRing 3.4s linear infinite;
  -webkit-mask: radial-gradient(circle, transparent 60%, #000 62%); mask: radial-gradient(circle, transparent 60%, #000 62%);
}
.fx-glitch .orb-ring { animation: spinRing 8s linear infinite, glitchShift .9s steps(3) infinite; }
.fx-oil .orb-ring {
  background-image: conic-gradient(from 0deg, #E7D9FF, #9BF6E0, #FFD9F2, #C3E8FF, #FFF3C4, #E7D9FF);
  border-color: #fff; opacity: .95;
  -webkit-mask: radial-gradient(circle, transparent 58%, #000 60%); mask: radial-gradient(circle, transparent 58%, #000 60%);
  animation: spinRing 5s linear infinite, hueRoll 6s linear infinite;
}
.fx-prism .orb-ring {
  border: none;
  background-image: conic-gradient(from 0deg, #fff, #FF2E88, #FFD23F, #B8FF3C, #22C1C3, #fff);
  box-shadow: 0 0 32px rgba(255,255,255,.75), 0 0 60px rgba(255,46,136,.5);
  animation: spinRing 2.4s linear infinite;
  -webkit-mask: radial-gradient(circle, transparent 55%, #000 58%); mask: radial-gradient(circle, transparent 55%, #000 58%);
}
.fx-prism .orb-glyph { filter: drop-shadow(0 0 12px #fff) drop-shadow(0 0 24px var(--accent3)); }

.rarity-tag {
  display: inline-block; font-size: .66rem; font-weight: 800; letter-spacing: .09em;
  text-transform: uppercase; padding: .16rem .45rem; border-radius: 5px;
  color: var(--rc); border: 1px solid color-mix(in srgb, var(--rc) 55%, transparent);
  background: color-mix(in srgb, var(--rc) 12%, transparent);
}
/* Top-tier tags get their own sweeping gradient plates with dark text on top. */
.rarity-tag.fx-rainbow, .rarity-tag.fx-oil, .rarity-tag.fx-prism {
  color: #120E0C; border-color: transparent; text-shadow: none;
  background-size: 220% 100%;
  animation: sweepBg 3.2s linear infinite;
}
.rarity-tag.fx-rainbow { background-image: linear-gradient(90deg, #FF2E88, #FFD23F, #B8FF3C, #22C1C3, #FF6B35, #FF2E88); }
.rarity-tag.fx-oil     { background-image: linear-gradient(90deg, #E7D9FF, #9BF6E0, #FFD9F2, #C3E8FF, #FFF3C4, #E7D9FF); animation-duration: 4.5s; }
.rarity-tag.fx-prism   { background-image: linear-gradient(90deg, #FFFFFF, #FF2E88, #FFD23F, #B8FF3C, #22C1C3, #FFFFFF); animation-duration: 2.4s; }
.rarity-tag.fx-glitch  { animation: glitchText 1.4s steps(4) infinite; }
@keyframes sweepBg { to { background-position: -220% 0; } }

.pet-card {
  position: relative; display: flex; flex-direction: column; align-items: center; gap: .3rem;
  background: linear-gradient(180deg, color-mix(in srgb, var(--rc) 9%, var(--panel)), var(--panel));
  border: 1px solid color-mix(in srgb, var(--rc) 38%, var(--line));
  border-radius: 12px; padding: .7rem .5rem .6rem; text-align: center;
  transition: transform .12s ease, box-shadow .15s ease;
}
.pet-card:hover { transform: translateY(-3px); box-shadow: 0 8px 22px color-mix(in srgb, var(--rc) 25%, transparent); }
.pet-card[data-r="10"] { border-color: #fff; box-shadow: 0 0 22px rgba(255,255,255,.28); }
.pc-name { font-size: .84rem; font-weight: 600; line-height: 1.2; }
.pc-sub { font-size: .76rem; color: var(--muted); font-variant-numeric: tabular-nums; }
/* Source chip — which egg this pet came out of. */
.pc-egg {
  display: flex; align-items: center; gap: .22rem; max-width: 100%;
  font-size: .68rem; color: var(--muted);
  background: rgba(0,0,0,.28); border: 1px solid var(--line);
  border-radius: 999px; padding: .1rem .42rem .1rem .3rem;
}
.pc-egg-ic { font-size: .8rem; line-height: 1; flex: none; }
.pc-egg-nm { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.stack-count {
  position: absolute; top: 6px; left: 7px; font-size: .7rem; font-weight: 800;
  background: var(--bg); border: 1px solid var(--line2); border-radius: 6px; padding: 0 .3rem;
}
.marks { position: absolute; top: 5px; right: 6px; display: flex; gap: 2px; font-size: .75rem; }
.mark.fav { color: var(--gold); }
.new-badge {
  position: absolute; top: -7px; right: -6px; background: var(--accent3); color: #fff;
  font-size: .6rem; font-weight: 900; letter-spacing: .08em; padding: .12rem .35rem;
  border-radius: 5px; box-shadow: 0 2px 8px rgba(255,46,136,.6);
}
.new-badge.big { top: 8px; right: 8px; font-size: .75rem; padding: .2rem .5rem; }

/* ── Mutations ───────────────────────────────────────────────────────── */
.mut-chips { display: flex; gap: .2rem; flex-wrap: wrap; justify-content: center; }
.mut-chip {
  display: inline-flex; align-items: center; gap: .12rem;
  font-size: .62rem; font-weight: 800; padding: .08rem .3rem;
  border-radius: 5px; color: #140F06; background: var(--mc, #FFD23F);
  box-shadow: 0 0 8px color-mix(in srgb, var(--mc, #FFD23F) 60%, transparent);
}
.mut-chip b { color: inherit; font-size: .6rem; }
.mut-chip.mut-golden   { --mc: #FFD23F; }
.mut-chip.mut-godly    { --mc: #FFF6C9; }
.mut-chip.mut-frozen   { --mc: #7FE9FF; }
.mut-chip.mut-ancient  { --mc: #C8A24A; color: #1B1403; }
.mut-chip.mut-rainbow  {
  --mc: #FF2E88; color: #140F06;
  background: linear-gradient(90deg, #FF2E88, #FFD23F, #B8FF3C, #22C1C3, #FF2E88);
  background-size: 220% 100%; animation: sweepBg 2.6s linear infinite;
}
/* Solid navy plate so the text stays readable; the flag reads in the border. */
.mut-chip.mut-american {
  --mc: #FF3B3B; color: #fff; background: #16255C;
  border-top: 2px solid #FF3B3B; border-bottom: 2px solid #E9EEFF;
  box-shadow: 0 0 8px rgba(59,107,255,.7);
}
.mut-chip.mut-astral {
  --mc: #B14BFF; color: #fff;
  background: radial-gradient(circle at 30% 30%, #E2B8FF, #6B1FB8);
}
.mut-chip.mut-glitched {
  --mc: #00FFC2; color: #04231C;
  animation: glitchShift .3s steps(3) infinite;
}
.mut-chip.mut-void {
  --mc: #8A7BFF; color: #E7E2FF; background: #0A0714;
  border: 1px solid #8A7BFF; box-shadow: 0 0 10px rgba(138,123,255,.8), inset 0 0 8px #000;
}
.mut-chip.mut-prismatic {
  --mc: #FFFFFF; color: #111;
  background: linear-gradient(90deg, #fff, #FFD9F2, #C3E8FF, #FFF3C4, #fff);
  background-size: 240% 100%; animation: sweepBg 1.8s linear infinite;
  box-shadow: 0 0 12px #fff;
}

/* Mutation index: clickable summary tiles, one per mutation. */
.mut-tile {
  text-align: left; font: inherit; color: inherit; cursor: pointer;
  border-color: color-mix(in srgb, var(--mc) 40%, var(--line));
  transition: transform .1s ease, border-color .15s ease;
}
.mut-tile:hover { transform: translateY(-2px); border-color: var(--mc); }
.mut-tile.on {
  border-color: var(--mc);
  box-shadow: 0 0 0 1px var(--mc) inset, 0 0 16px color-mix(in srgb, var(--mc) 35%, transparent);
}
.mut-tile .bar > i { background: var(--mc); }

/* Per-pet pips in the base index: which mutations you've already found. Ten of
   them have to fit inside a 112px card, so they wrap onto a second row. */
.mut-dots {
  display: flex; gap: .1rem .12rem; justify-content: center; margin-top: .2rem;
  flex-wrap: wrap; max-width: 100%;
}
.mut-dots i {
  font-size: .6rem; line-height: 1; font-style: normal;
  opacity: .22; filter: grayscale(1);
}
.mut-dots i.on { opacity: 1; filter: none; }

/* Mutated cards get a matching frame so they stand out in the grid. */
.pet-card[data-mut] { border-width: 2px; }
.pet-card[data-mut="golden"]    { border-color: #FFD23F; box-shadow: 0 0 16px rgba(255,210,63,.35); }
.pet-card[data-mut="godly"]     { border-color: #FFF6C9; box-shadow: 0 0 20px rgba(255,246,201,.45); }
.pet-card[data-mut="rainbow"]   { border-color: #FF2E88; box-shadow: 0 0 20px rgba(255,46,136,.45); }
.pet-card[data-mut="american"]  { border-color: #FF3B3B; box-shadow: 0 0 20px rgba(59,107,255,.45); }
.pet-card[data-mut="frozen"]    { border-color: #7FE9FF; box-shadow: 0 0 20px rgba(127,233,255,.45); }
.pet-card[data-mut="astral"]    { border-color: #B14BFF; box-shadow: 0 0 22px rgba(177,75,255,.5); }
.pet-card[data-mut="glitched"]  { border-color: #00FFC2; box-shadow: 0 0 22px rgba(0,255,194,.5); }
.pet-card[data-mut="ancient"]   { border-color: #C8A24A; box-shadow: 0 0 20px rgba(200,162,74,.5); }
.pet-card[data-mut="void"]      { border-color: #8A7BFF; box-shadow: 0 0 26px rgba(138,123,255,.55), inset 0 0 20px rgba(0,0,0,.7); }
.pet-card[data-mut="prismatic"] { border-color: #fff; box-shadow: 0 0 30px rgba(255,255,255,.7); }

.pet-grid {
  display: grid; gap: .6rem;
  grid-template-columns: repeat(auto-fill, minmax(112px, 1fr));
}
.pet-card.locked-out { opacity: .28; filter: grayscale(1); }
.pet-card.clickable { cursor: pointer; }

/* ── Hatch tab ───────────────────────────────────────────────────────── */
.egg-select { display: grid; gap: .6rem; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); }
.egg-tile {
  position: relative; text-align: left; border-radius: 12px; padding: .7rem;
  background: var(--panel2); border: 1px solid var(--line); overflow: hidden;
  min-height: 92px; display: flex; flex-direction: column; gap: .2rem;
}
.egg-tile::before {
  content: ''; position: absolute; inset: 0; opacity: .16;
  background: linear-gradient(135deg, var(--c1), var(--c2));
}
.egg-tile > * { position: relative; }
.egg-tile:hover { border-color: var(--accent); }
.egg-tile.active { border-color: var(--accent2); box-shadow: 0 0 0 1px var(--accent2) inset; }
.egg-tile.locked { opacity: .55; cursor: not-allowed; }
.egg-tile .et-emoji { font-size: 1.7rem; }
.egg-tile .et-name { font-weight: 700; font-size: .9rem; }
.egg-tile .et-meta { font-size: .74rem; color: var(--muted); }

.hatch-main {
  display: grid; gap: 1rem;
  grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr);
}
@media (max-width: 860px) { .hatch-main { grid-template-columns: 1fr; } }

.stage-panel {
  position: relative; overflow: hidden; text-align: center;
  min-height: 320px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: .8rem;
}
.stage-panel::before {
  content: ''; position: absolute; inset: 0; opacity: .2;
  background: radial-gradient(circle at 50% 40%, var(--c1), transparent 62%),
              linear-gradient(160deg, transparent 40%, var(--c2) 140%);
}
.stage-panel > * { position: relative; }
.big-egg {
  font-size: clamp(5rem, 16vw, 8rem); line-height: 1;
  animation: bob 3.2s ease-in-out infinite;
  filter: drop-shadow(0 14px 22px rgba(0,0,0,.55));
  cursor: pointer; user-select: none; border: none; background: none;
}
.big-egg:active { transform: scale(.94); }
.open-row { display: flex; gap: .45rem; flex-wrap: wrap; justify-content: center; }
.odds-table { display: grid; gap: .3rem; }
.odds-row { display: grid; grid-template-columns: 96px 1fr 66px; align-items: center; gap: .5rem; font-size: .82rem; }
.odds-bar { height: 7px; border-radius: 999px; background: var(--bg2); overflow: hidden; }
.odds-bar > i { display: block; height: 100%; background: var(--rc); border-radius: 999px; }
.odds-pct { text-align: right; color: var(--muted); font-variant-numeric: tabular-nums; }

.unlock-note { display: flex; align-items: center; gap: .6rem; flex-wrap: wrap; font-size: .85rem; }

/* ── Potions ─────────────────────────────────────────────────────────── */
.egg-drop { position: relative; display: grid; place-items: center; padding: .4rem 1.2rem; border-radius: 20px; }
.egg-drop.drag-over {
  background: rgba(184,255,60,.10);
  outline: 2px dashed var(--accent2); outline-offset: 4px;
}
.egg-drop.drag-over .big-egg { transform: scale(1.08); }
.armed-row { display: flex; gap: .3rem; flex-wrap: wrap; justify-content: center; margin-top: .3rem; }
.armed-chip {
  font-size: .72rem; border-radius: 999px; padding: .18rem .55rem;
  background: var(--accent2); color: #0e1406; border: none; font-weight: 700;
}
.armed-chip:hover { background: var(--danger); color: #fff; }

.potion-tray { margin-top: 1rem; }
.potion-row { display: flex; gap: .5rem; flex-wrap: wrap; }
.potion {
  display: flex; flex-direction: column; align-items: center; gap: .12rem;
  min-width: 92px; padding: .55rem .6rem; cursor: grab;
  background: var(--panel2); border: 1px solid var(--line2); border-radius: 12px;
  transition: transform .1s ease, border-color .15s ease;
}
.potion:hover { border-color: var(--accent2); transform: translateY(-2px); }
.potion:active { cursor: grabbing; }
.potion.dragging { opacity: .45; }
.potion.armed { border-color: var(--accent2); background: rgba(184,255,60,.12); }
.potion-ic { font-size: 1.5rem; line-height: 1; }
.potion-nm { font-size: .7rem; text-align: center; line-height: 1.15; }
.potion-n { font-size: .68rem; color: var(--muted); font-variant-numeric: tabular-nums; }

/* ── Lists / tables ──────────────────────────────────────────────────── */
.list { display: grid; gap: .5rem; }
.list-row {
  display: flex; align-items: center; gap: .7rem;
  background: var(--panel2); border: 1px solid var(--line); border-radius: 11px; padding: .55rem .7rem;
}
.list-row .lr-main { min-width: 0; flex: 1; }
.list-row .lr-title { font-size: .9rem; font-weight: 600; }
.list-row .lr-sub { font-size: .78rem; color: var(--muted); }
.list-row .lr-actions { display: flex; gap: .35rem; flex-wrap: wrap; justify-content: flex-end; }
@media (max-width: 560px) {
  .list-row { flex-wrap: wrap; }
  .list-row .lr-actions { width: 100%; justify-content: flex-start; }
}

.toolbar { display: flex; gap: .45rem; flex-wrap: wrap; align-items: center; margin-bottom: .8rem; }
.toolbar input[type="text"] { flex: 1 1 180px; min-width: 140px; }
.chip {
  border: 1px solid var(--line2); background: var(--panel2); border-radius: 999px;
  padding: .3rem .7rem; font-size: .8rem; min-height: 32px;
}
.chip.on { background: var(--accent2); color: #0e1406; border-color: var(--accent2); font-weight: 700; }

/* Three-way switch: All / Discovered / Not discovered. */
.seg {
  display: inline-flex; border: 1px solid var(--line2); border-radius: 999px;
  background: var(--bg2); padding: 2px; gap: 2px; flex-wrap: wrap;
}
.seg-btn {
  border: none; background: transparent; color: var(--muted);
  padding: .32rem .8rem; border-radius: 999px; font-size: .82rem; min-height: 32px;
  display: inline-flex; align-items: center; gap: .35rem; white-space: nowrap;
}
.seg-btn b { font-size: .74rem; opacity: .75; font-variant-numeric: tabular-nums; color: inherit; }
.seg-btn:hover { color: var(--text); }
.seg-btn.on { background: var(--accent2); color: #0e1406; font-weight: 700; }
.seg-btn.on b { opacity: .9; }

.kv { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: .6rem; }
.kv-item { background: var(--panel2); border: 1px solid var(--line); border-radius: 11px; padding: .6rem .7rem; }
.kv-item .k { font-size: .74rem; color: var(--muted); text-transform: uppercase; letter-spacing: .06em; }
.kv-item .v { font-size: 1.05rem; font-weight: 700; font-variant-numeric: tabular-nums; }

.ach {
  display: flex; gap: .7rem; align-items: center;
  background: var(--panel2); border: 1px solid var(--line); border-radius: 11px; padding: .6rem .7rem;
}
.ach.done { border-color: var(--accent2); background: linear-gradient(180deg, rgba(184,255,60,.08), var(--panel2)); }
.ach .ach-ic { font-size: 1.5rem; width: 2rem; text-align: center; flex: none; }
.ach .ach-body { flex: 1; min-width: 0; }
.ach .ach-name { font-weight: 700; font-size: .9rem; }
.ach .ach-desc { font-size: .78rem; color: var(--muted); }
.ach .ach-rew { font-size: .76rem; color: var(--gold); white-space: nowrap; }

/* ── Sanctuary ───────────────────────────────────────────────────────── */
.plot-grid { display: grid; gap: .7rem; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); }
.plot {
  position: relative; display: flex; flex-direction: column; gap: .5rem;
  background: var(--panel2); border: 1px solid var(--line); border-radius: 13px;
  padding: .75rem; min-height: 190px; text-align: left; color: inherit; font: inherit;
  box-shadow: inset 0 0 30px color-mix(in srgb, var(--rc, #253029) 12%, transparent);
}
.plot.empty, .plot.locked {
  align-items: center; justify-content: center; text-align: center;
  border-style: dashed; border-color: var(--line2);
}
.plot.empty { cursor: pointer; transition: border-color .15s ease, transform .1s ease; }
.plot.empty:hover { border-color: var(--accent2); transform: translateY(-2px); }
.plot-ic { font-size: 1.9rem; opacity: .7; }
.plot-top { display: flex; gap: .6rem; align-items: center; }
.plot-id { min-width: 0; display: flex; flex-direction: column; gap: .2rem; align-items: flex-start; }
.plot-name { font-weight: 700; font-size: .95rem; }
.plot-say {
  font-size: .78rem; color: var(--muted); font-style: italic; line-height: 1.35;
  flex: 1; display: flex; align-items: center;
}
.plot-bond { display: grid; gap: .25rem; }
.plot-foot { display: flex; align-items: center; justify-content: space-between; gap: .4rem; }
.plot[data-mut] { border-width: 2px; }

/* ── Village ─────────────────────────────────────────────────────────── */
.visit-ic { font-size: 2.6rem; animation: bob 3.4s ease-in-out infinite; }
.folk-grid { display: grid; gap: .6rem; grid-template-columns: repeat(auto-fill, minmax(215px, 1fr)); }
.folk {
  background: var(--panel2); border: 1px solid var(--line); border-radius: 12px;
  padding: .65rem .7rem; cursor: pointer; transition: border-color .15s ease, transform .1s ease;
}
.folk:hover { border-color: var(--accent2); transform: translateY(-2px); }
.folk-top { display: flex; gap: .5rem; align-items: center; margin-bottom: .45rem; }
.folk-ic { font-size: 1.7rem; }
.folk-name { font-weight: 700; font-size: .92rem; }
.folk-lvl {
  margin-left: auto; font-weight: 800; font-size: .95rem; color: var(--accent2);
  background: var(--bg2); border: 1px solid var(--line2); border-radius: 999px;
  min-width: 30px; height: 30px; display: grid; place-items: center;
}
.list-row.is-done { opacity: .55; }
.list-row.is-picked { border-color: var(--accent2); background: rgba(184,255,60,.07); }

.letter { cursor: pointer; }
.letter.unread { border-color: var(--accent); background: rgba(255,107,53,.06); }
.letter .dot {
  display: inline-block; width: 7px; height: 7px; border-radius: 50%;
  background: var(--accent); margin-right: .4rem; vertical-align: middle;
}
.letter .attach { margin-left: .3rem; }

/* ── Expeditions ─────────────────────────────────────────────────────── */
.expo-clock {
  font-variant-numeric: tabular-nums; font-weight: 800; color: var(--gold);
  min-width: 62px; text-align: right;
}
.list-row.is-locked { opacity: .5; }
.list-row.report { border-color: var(--line2); }
.list-row.report.good {
  border-color: var(--accent2);
  background: linear-gradient(180deg, rgba(184,255,60,.07), var(--panel2));
}

/* ── Fusion Lab ──────────────────────────────────────────────────────── */
.panel.lab {
  border-color: #3A2A55;
  background: linear-gradient(180deg, rgba(177,75,255,.09), var(--panel));
}
.recipe .section-title { border-bottom: 1px solid var(--line); padding-bottom: .45rem; }
.fuse-row { display: flex; align-items: center; justify-content: center; gap: .6rem; flex-wrap: wrap; }
.fuse-arrow { font-size: 1.6rem; color: var(--accent2); }

/* ── Pet Show ────────────────────────────────────────────────────────── */
.entry-row { display: grid; gap: .7rem; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); }
.entry-card { display: grid; gap: .35rem; }
.board { display: grid; gap: .3rem; }
.board-row {
  display: grid; grid-template-columns: 44px minmax(74px, 1fr) 44px minmax(0, 2fr) auto;
  align-items: center; gap: .5rem; padding: .35rem .5rem;
  background: var(--panel2); border: 1px solid var(--line); border-radius: 10px;
  font-size: .84rem;
}
.board-row.is-mine {
  border-color: var(--accent2); background: linear-gradient(90deg, rgba(184,255,60,.12), var(--panel2));
}
.board-place { font-weight: 800; text-align: center; }
.board-who { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.board-pet { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.board-score { font-variant-numeric: tabular-nums; color: var(--gold); font-weight: 700; }
.theme-tag {
  font-size: .66rem; font-weight: 800; text-transform: uppercase; letter-spacing: .06em;
  color: #0e1406; background: var(--accent2); border-radius: 4px; padding: .05rem .3rem;
}
.place-badge {
  display: grid; place-items: center; width: 78px; height: 78px; border-radius: 50%;
  background: var(--panel2); border: 2px solid var(--line2); line-height: 1.1; flex: none;
}
.place-badge b { font-size: 1.5rem; }
.place-badge.gold { border-color: var(--gold); box-shadow: 0 0 22px rgba(255,210,63,.45); }
.place-badge.silver { border-color: #C9D2DA; box-shadow: 0 0 18px rgba(201,210,218,.35); }

/* ── Event / countdown ───────────────────────────────────────────────── */
.event-hero {
  position: relative; overflow: hidden; border-radius: var(--radius);
  padding: 1.2rem; text-align: center; border: 1px solid var(--line);
}
.event-hero::before {
  content: ''; position: absolute; inset: 0; opacity: .28;
  background: linear-gradient(135deg, var(--c1), var(--c2));
  animation: hueRoll 14s linear infinite;
}
.event-hero > * { position: relative; }
.event-emoji { font-size: 3.4rem; animation: bob 2.6s ease-in-out infinite; }
.countdown {
  font-size: 1.6rem; font-weight: 800; font-variant-numeric: tabular-nums;
  letter-spacing: .04em; color: var(--gold);
}

/* ── Hatch overlay ───────────────────────────────────────────────────── */
.hatch-overlay {
  position: fixed; inset: 0; z-index: 100;
  display: flex; align-items: center; justify-content: center;
  background: rgba(6,9,8,.9);
  animation: fadeIn .22s ease;
  overflow: hidden;
}
.hatch-overlay.hidden { display: none; }
.hatch-bg { position: absolute; inset: 0; overflow: hidden; }
.hatch-bg .bg-sweep {
  position: absolute; inset: -30%;
  background: conic-gradient(from 0deg, var(--c1), var(--c2), var(--c1));
  opacity: .30; filter: blur(60px); animation: spinRing 18s linear infinite;
}
.motes { position: absolute; inset: 0; }
.mote {
  position: absolute; left: var(--x); bottom: -10%; font-size: var(--sz); opacity: .55;
  animation: rise var(--d) linear infinite; animation-delay: var(--delay);
}
@keyframes rise {
  0%   { transform: translateY(0) rotate(0deg); opacity: 0; }
  10%  { opacity: .6; }
  90%  { opacity: .5; }
  100% { transform: translateY(-118vh) rotate(320deg); opacity: 0; }
}

.hatch-stage { position: relative; width: min(90vw, 520px); height: min(70vh, 520px); display: grid; place-items: center; }
.hatch-stage.zoom-in { animation: camZoom .5s cubic-bezier(.2,.9,.25,1) both; }
@keyframes camZoom { from { transform: scale(.55); opacity: 0; } to { transform: scale(1); opacity: 1; } }

.hatch-egg {
  position: absolute; font-size: clamp(5rem, 20vw, 10rem); line-height: 1;
  animation: bob 2.4s ease-in-out infinite;
  filter: drop-shadow(0 18px 26px rgba(0,0,0,.6));
}
.hatch-egg.rattle { animation: bob 2.4s ease-in-out infinite, rattle .12s linear infinite; }

.hatch-rings { position: absolute; inset: 0; display: grid; place-items: center; opacity: 0; transition: opacity .25s; }
.hatch-rings.active { opacity: 1; }
.hatch-rings i {
  position: absolute; width: 140px; height: 140px; border-radius: 50%;
  border: 2px solid var(--rc); box-shadow: 0 0 26px var(--rc);
  animation: ringOut var(--ring-speed, 1.5s) ease-out infinite;
}
.hatch-rings i:nth-child(2) { animation-delay: calc(var(--ring-speed, 1.5s) / 3); }
.hatch-rings i:nth-child(3) { animation-delay: calc(var(--ring-speed, 1.5s) / 3 * 2); }
@keyframes ringOut {
  from { transform: scale(.35); opacity: .95; }
  to   { transform: scale(2.6); opacity: 0; }
}

.hatch-bolts { position: absolute; inset: 0; opacity: 0; }
.hatch-bolts.active { opacity: 1; }
.hatch-bolts svg { width: 100%; height: 100%; }
.hatch-bolts polyline {
  filter: drop-shadow(0 0 6px currentColor);
  animation: boltFlick .34s steps(2) infinite; animation-delay: var(--delay);
}
@keyframes boltFlick { 0%,100% { opacity: 1; } 50% { opacity: .15; } }

.hatch-sil {
  position: absolute; font-size: clamp(5rem, 20vw, 10rem); line-height: 1;
  filter: brightness(0) drop-shadow(0 0 26px rgba(255,255,255,.6));
  transform: scale(.7); transition: filter .3s ease, transform .3s ease;
}
.hatch-sil.hidden { display: none; }
.hatch-sil.resolve { filter: brightness(1) drop-shadow(0 0 30px var(--rc)); transform: scale(1.08); }

.hatch-flash {
  position: absolute; inset: 0; pointer-events: none; opacity: 0; z-index: 5;
  background: radial-gradient(circle at 50% 50%, #fff, var(--fc) 40%, transparent 72%);
}
.hatch-flash.fire { animation: flashOut .5s ease-out; }
.hatch-flash.pulse { animation: flashPulse .22s ease-out; }
@keyframes flashOut { 0% { opacity: 0; } 12% { opacity: 1; } 100% { opacity: 0; } }
@keyframes flashPulse { 0% { opacity: 0; } 40% { opacity: .45; } 100% { opacity: 0; } }

/* ── Mutation backdrops ──────────────────────────────────────────────────
   Sits above the egg's own themed background and takes it over entirely.
   With several mutations, the biggest multiplier supplies the visuals. */
.hatch-mut { position: absolute; inset: 0; pointer-events: none; opacity: 0; overflow: hidden; }
.hatch-mut.on { opacity: 1; }
.mut-wash { position: absolute; inset: 0; }

/* Golden — molten gold wash with drifting flakes. */
.mut-golden .mut-wash {
  background: radial-gradient(circle at 50% 45%, #FFE889, #E8A317 45%, #6B4405 100%);
}
.gold-flakes { position: absolute; inset: 0; }
.gold-flakes i {
  position: absolute; left: var(--x); top: -6%; width: var(--sz); height: var(--sz);
  background: #FFF3B0; border-radius: 2px; box-shadow: 0 0 8px #FFD23F;
  animation: goldFall var(--t) linear infinite; animation-delay: var(--delay);
}
@keyframes goldFall {
  from { transform: translateY(0) rotate(0deg); opacity: 0; }
  10%  { opacity: 1; }
  to   { transform: translateY(112vh) rotate(540deg); opacity: .2; }
}

/* Godly — blessed white-gold light with descending rays and a halo. */
.mut-godly .mut-wash {
  background: radial-gradient(circle at 50% 32%, #FFFFFF, #FFF3C4 30%, #C9A227 70%, #3A2C05 100%);
}
.godly-rays {
  position: absolute; left: 50%; top: -40%; width: 190vmax; height: 190vmax;
  transform: translateX(-50%); opacity: .35;
  background: repeating-conic-gradient(from 0deg, rgba(255,255,255,.8) 0deg 2deg, transparent 2deg 11deg);
  -webkit-mask: radial-gradient(circle, #000 6%, transparent 55%);
  mask: radial-gradient(circle, #000 6%, transparent 55%);
  animation: spinRing 40s linear infinite;
}
.godly-halo {
  position: absolute; left: 50%; top: 42%; width: min(52vw, 380px); height: min(52vw, 380px);
  transform: translate(-50%, -50%); border-radius: 50%;
  border: 6px solid rgba(255,255,255,.85); box-shadow: 0 0 60px #FFF3C4, inset 0 0 60px #FFF3C4;
  animation: bloomPulse 2.4s ease-in-out infinite;
}

/* A wash that spins has to be bigger than its box, or a rotating square sweeps
   its own corners into view and the scene behind shows through. Sizing the
   overhang in vmax rather than % keeps it covered at any aspect ratio — a
   percentage overhang that suffices at 16:9 still tears open on an ultrawide. */
.mut-rainbow .mut-wash, .mut-prismatic .mut-wash {
  inset: -75vmax;
}

/* Rainbow — the whole background cycles through colour. */
.mut-rainbow .mut-wash {
  background: conic-gradient(from 0deg, #FF2E88, #FF6B35, #FFD23F, #B8FF3C, #22C1C3, #6F42C1, #FF2E88);
  filter: saturate(1.3);
  animation: hueRoll 3.2s linear infinite, spinRing 22s linear infinite;
}

/* American — red/white/blue stripes under continuous fireworks. */
.mut-american .mut-wash {
  background: linear-gradient(160deg, #B22234 0%, #0A1A4F 100%);
}
.stripes {
  position: absolute; inset: 0; opacity: .35;
  background: repeating-linear-gradient(0deg, #B22234 0 6%, #FFFFFF 6% 12%);
  -webkit-mask: linear-gradient(180deg, transparent 30%, #000 100%);
  mask: linear-gradient(180deg, transparent 30%, #000 100%);
}
.mut-fw { position: absolute; width: 0; height: 0; }
.mut-fw i {
  position: absolute; width: 5px; height: 5px; border-radius: 50%;
  background: var(--c); box-shadow: 0 0 12px var(--c);
  --sz: 5px; --t: var(--dur);
  animation: fly var(--dur) ease-out infinite; animation-delay: var(--delay);
}

/* Frozen — deep ice with frost creeping in from the edges and falling snow. */
.mut-frozen .mut-wash {
  background: radial-gradient(circle at 50% 40%, #DFF9FF, #4FC6E8 45%, #0C3348 100%);
}
.frost-vignette {
  position: absolute; inset: 0;
  background:
    radial-gradient(circle at 12% 8%,  rgba(255,255,255,.75), transparent 26%),
    radial-gradient(circle at 88% 14%, rgba(255,255,255,.65), transparent 24%),
    radial-gradient(circle at 6% 92%,  rgba(255,255,255,.7),  transparent 28%),
    radial-gradient(circle at 94% 88%, rgba(255,255,255,.6),  transparent 26%);
  animation: bloomPulse 3.4s ease-in-out infinite;
}
.snow { position: absolute; inset: 0; }
.snow i {
  position: absolute; left: var(--x); top: -6%; width: var(--sz); height: var(--sz);
  background: #fff; border-radius: 50%; box-shadow: 0 0 6px #DFF9FF;
  animation: goldFall var(--t) linear infinite; animation-delay: var(--delay);
}

/* Astral — a slow violet nebula with a ring of orbiting sigils. */
.mut-astral .mut-wash {
  background: radial-gradient(circle at 50% 45%, #F0D9FF, #8B2FD6 40%, #1A0630 100%);
}
.astral-swirl {
  position: absolute; left: 50%; top: 45%; width: 150vmax; height: 150vmax;
  transform: translate(-50%, -50%);
  background: conic-gradient(from 0deg, transparent 0deg 30deg, rgba(226,184,255,.35) 45deg,
    transparent 60deg 120deg, rgba(255,255,255,.25) 140deg, transparent 160deg 360deg);
  animation: spinRing 18s linear infinite;
}
.astral-ring {
  position: absolute; left: 50%; top: 45%; width: min(62vw, 440px); height: min(62vw, 440px);
  transform: translate(-50%, -50%); border-radius: 50%;
  border: 2px dashed rgba(255,255,255,.6);
  animation: spinRing 26s linear infinite reverse;
}

/* Glitched — the scene tears itself apart on a CRT and puts itself back. */
.mut-glitched .mut-wash {
  background: linear-gradient(180deg, #041F1A, #00FFC2 50%, #041F1A);
  background-size: 100% 300%;
  animation: glitchRoll 2.4s steps(9) infinite;
}
@keyframes glitchRoll { to { background-position: 0 300%; } }
.glitch-bars {
  position: absolute; inset: 0; mix-blend-mode: screen; opacity: .8;
  background: repeating-linear-gradient(0deg,
    rgba(255,0,128,.3) 0 3px, transparent 3px 9px, rgba(0,255,194,.3) 9px 12px, transparent 12px 26px);
  animation: glitchShift .16s steps(2) infinite, scanRoll 3s linear infinite;
}
.glitch-tear {
  position: absolute; left: 0; right: 0; height: 14%; top: 42%;
  background: rgba(255,255,255,.16); mix-blend-mode: overlay;
  animation: tearJump 1.1s steps(4) infinite;
}
@keyframes tearJump {
  0% { top: 18%; } 25% { top: 62%; } 50% { top: 34%; } 75% { top: 77%; } 100% { top: 18%; }
}

/* Ancient — sunlit dust over old brass, with slow drifting motes. */
.mut-ancient .mut-wash {
  background: radial-gradient(circle at 50% 30%, #FFE9B0, #C8A24A 42%, #3B2A08 100%);
}
.ancient-dust { position: absolute; inset: 0; }
.ancient-dust i {
  position: absolute; left: var(--x); top: var(--y); width: var(--sz); height: var(--sz);
  background: #FFF3D0; border-radius: 50%; opacity: .7; box-shadow: 0 0 8px #FFE9B0;
  animation: bob var(--t) ease-in-out infinite; animation-delay: var(--delay);
}
.ancient-glyphs {
  position: absolute; inset: 0; opacity: .3;
  background: repeating-linear-gradient(90deg, rgba(59,42,8,.55) 0 2px, transparent 2px 30px),
              repeating-linear-gradient(0deg, rgba(59,42,8,.55) 0 2px, transparent 2px 30px);
  -webkit-mask: radial-gradient(circle, transparent 22%, #000 70%);
  mask: radial-gradient(circle, transparent 22%, #000 70%);
}

/* Void — near-black, with everything falling into the middle. */
.mut-void .mut-wash {
  background: radial-gradient(circle at 50% 45%, #000 18%, #2A1B6B 55%, #08050F 100%);
}
.void-hole {
  position: absolute; left: 50%; top: 45%; width: min(46vw, 340px); height: min(46vw, 340px);
  transform: translate(-50%, -50%); border-radius: 50%;
  background: #000; box-shadow: 0 0 90px 30px rgba(138,123,255,.55), inset 0 0 60px #000;
  animation: bloomPulse 3s ease-in-out infinite;
}
.void-pull { position: absolute; inset: 0; }
.void-pull i {
  position: absolute; left: 50%; top: 45%; width: 4px; height: 4px; border-radius: 50%;
  background: #C9C0FF; box-shadow: 0 0 8px #8A7BFF;
  animation: suckIn var(--t) linear infinite; animation-delay: var(--delay);
}
@keyframes suckIn {
  from { transform: rotate(var(--a)) translateX(var(--d)) scale(1); opacity: 0; }
  15%  { opacity: 1; }
  to   { transform: rotate(calc(var(--a) + 220deg)) translateX(0) scale(0); opacity: 0; }
}

/* Prismatic — white light split into everything at once. */
.mut-prismatic .mut-wash {
  background: conic-gradient(from 0deg, #fff, #FFD9F2, #C3E8FF, #D8FFD0, #FFF3C4, #FFD9F2, #fff);
  animation: spinRing 10s linear infinite, hueRoll 5s linear infinite;
}
.prism-beams {
  position: absolute; left: 50%; top: 45%; width: 200vmax; height: 200vmax;
  transform: translate(-50%, -50%); opacity: .55;
  background: repeating-conic-gradient(from 0deg,
    rgba(255,255,255,.95) 0deg 1.5deg, transparent 1.5deg 9deg);
  -webkit-mask: radial-gradient(circle, #000 4%, transparent 48%);
  mask: radial-gradient(circle, #000 4%, transparent 48%);
  animation: spinRing 22s linear infinite;
}
.prism-facets {
  position: absolute; inset: 0; mix-blend-mode: overlay; opacity: .5;
  background: repeating-linear-gradient(60deg, rgba(255,255,255,.5) 0 6px, transparent 6px 22px),
              repeating-linear-gradient(-60deg, rgba(255,255,255,.4) 0 6px, transparent 6px 22px);
  animation: bloomPulse 2.2s ease-in-out infinite;
}

/* ── Rarity-tier flourishes (Mythic and above) ───────────────────────── */
.hatch-fx { position: absolute; inset: 0; pointer-events: none; opacity: 0; z-index: 1; }
.hatch-stage { z-index: 3; }
.hatch-fx.on { opacity: 1; }

/* Every tier gets a breathing glow in its own rarity colour. */
.tier-glow {
  position: absolute; inset: 0;
  background: radial-gradient(circle at 50% 50%, color-mix(in srgb, var(--rc) 26%, transparent), transparent 55%);
  animation: bloomPulse 2.1s ease-in-out infinite;
}

/* Chroma — a rainbow bar wipes across the screen. */
.chroma-sweep {
  position: absolute; inset: -20% -60%;
  background: linear-gradient(105deg, transparent 42%, rgba(255,46,136,.32) 47%,
    rgba(255,210,63,.32) 50%, rgba(184,255,60,.32) 53%, rgba(34,193,195,.32) 56%, transparent 61%);
  animation: sweepAcross 1.5s ease-in-out infinite;
}
@keyframes sweepAcross { from { transform: translateX(-45%); } to { transform: translateX(45%); } }

/* Xotic — CRT scanlines plus an RGB split shudder. */
.scanlines {
  position: absolute; inset: 0; opacity: .22;
  background: repeating-linear-gradient(0deg, rgba(0,255,194,.16) 0 1px, transparent 1px 4px);
  animation: scanRoll 5s linear infinite;
}
@keyframes scanRoll { to { background-position: 0 120px; } }
.rgb-split {
  position: absolute; inset: 0; mix-blend-mode: screen; opacity: .5;
  background: linear-gradient(90deg, rgba(255,0,128,.22), transparent 30%, transparent 70%, rgba(0,255,194,.22));
  animation: glitchShift .28s steps(3) infinite;
}

/* Iridescent — rotating godrays, oil vignette, drifting shimmer. */
.godrays {
  position: absolute; left: 50%; top: 50%; width: 190vmax; height: 190vmax;
  transform: translate(-50%, -50%); opacity: .14;
  background: repeating-conic-gradient(from 0deg, rgba(255,255,255,.32) 0deg 3deg, transparent 3deg 14deg);
  -webkit-mask: radial-gradient(circle, #000 4%, rgba(0,0,0,.5) 26%, transparent 62%);
  mask: radial-gradient(circle, #000 4%, rgba(0,0,0,.5) 26%, transparent 62%);
  animation: spinRing 26s linear infinite;
}
.godrays.bright { opacity: .2; animation-duration: 18s; }
.oil-vignette {
  position: absolute; inset: 0; mix-blend-mode: soft-light; opacity: .22;
  background: conic-gradient(from 0deg, #E7D9FF, #9BF6E0, #FFD9F2, #C3E8FF, #FFF3C4, #E7D9FF);
  animation: hueRoll 7s linear infinite;
}
.shimmer { position: absolute; inset: 0; }
.shimmer i {
  position: absolute; left: var(--x); top: var(--y); width: var(--sz); height: var(--sz);
  background: #fff; border-radius: 50%; box-shadow: 0 0 12px #fff, 0 0 24px var(--rc);
  animation: twinkle var(--t) ease-in-out infinite; animation-delay: var(--delay);
}
@keyframes twinkle {
  0%, 100% { transform: scale(0); opacity: 0; }
  50%      { transform: scale(1); opacity: 1; }
}

/* Transcended — white bloom and a light pillar behind the pet. */
.bloom {
  position: absolute; inset: 0;
  background: radial-gradient(circle at 50% 50%, rgba(255,255,255,.20), transparent 44%);
  animation: bloomPulse 1.7s ease-in-out infinite;
}
@keyframes bloomPulse { 0%, 100% { opacity: .22; transform: scale(1); } 50% { opacity: .5; transform: scale(1.08); } }
.pillar {
  position: absolute; left: 50%; top: -10%; width: min(46vw, 340px); height: 130%;
  transform: translateX(-50%);
  background: linear-gradient(180deg, transparent, rgba(255,255,255,.16) 35%, rgba(255,255,255,.16) 65%, transparent);
  -webkit-mask: linear-gradient(90deg, transparent, #000 32%, #000 68%, transparent);
  mask: linear-gradient(90deg, transparent, #000 32%, #000 68%, transparent);
  animation: pillarBreathe 2.6s ease-in-out infinite;
}
@keyframes pillarBreathe { 0%, 100% { opacity: .3; } 50% { opacity: .6; } }

/* Shockwave rings on the reveal beat. */
.hatch-shock { position: absolute; inset: 0; display: grid; place-items: center; pointer-events: none; }
.shock {
  position: absolute; width: 120px; height: 120px; border-radius: 50%;
  border: 3px solid var(--c); box-shadow: 0 0 30px var(--c), inset 0 0 20px var(--c);
  animation: shockOut .95s cubic-bezier(.16,.8,.3,1) forwards; animation-delay: var(--delay);
  opacity: 0;
}
@keyframes shockOut {
  0%   { transform: scale(.2); opacity: 1; border-width: 5px; }
  100% { transform: scale(7); opacity: 0; border-width: .5px; }
}

/* Rarity word slamming in behind the card. */
.hatch-banner {
  position: absolute; inset: 0; display: grid; place-items: center;
  pointer-events: none; z-index: 2; opacity: 0;
}
.hatch-banner.show { opacity: 1; }
.hatch-banner span {
  font-size: clamp(2.6rem, 13vw, 7rem); font-weight: 900; letter-spacing: .12em;
  text-transform: uppercase; color: transparent;
  -webkit-text-stroke: 2px var(--rc); opacity: .28;
  animation: bannerSlam .7s cubic-bezier(.15,1.4,.35,1) both;
}
@keyframes bannerSlam {
  0%   { transform: scale(2.4); opacity: 0; letter-spacing: .5em; }
  60%  { opacity: .34; }
  100% { transform: scale(1); opacity: .28; letter-spacing: .12em; }
}
.hatch-banner.fx-prism span { -webkit-text-stroke-color: #fff; opacity: .4; }

.hatch-particles { position: absolute; inset: 0; pointer-events: none; }
.particle {
  position: absolute; left: 50%; top: 50%; width: var(--sz); height: var(--sz);
  background: var(--c); border-radius: 50%; box-shadow: 0 0 10px var(--c);
  animation: fly var(--t) cubic-bezier(.15,.7,.3,1) forwards; animation-delay: var(--delay);
}
@keyframes fly {
  from { transform: rotate(var(--a)) translateX(0) scale(1); opacity: 1; }
  to   { transform: rotate(var(--a)) translateX(var(--d)) scale(0); opacity: 0; }
}

.confetti {
  position: absolute; left: var(--x); top: -8%; width: var(--w); height: var(--h);
  background: var(--c); animation: fall var(--t) linear forwards; animation-delay: var(--delay);
}
@keyframes fall {
  from { transform: translateY(0) rotate(0deg); opacity: 1; }
  to   { transform: translateY(115vh) rotate(var(--rot)); opacity: .85; }
}
.firework { position: absolute; width: 0; height: 0; }
.firework i {
  position: absolute; width: 5px; height: 5px; border-radius: 50%;
  background: var(--c); box-shadow: 0 0 10px var(--c);
  animation: fly 1.1s ease-out forwards; animation-delay: var(--delay);
  --t: 1.1s; --sz: 5px;
}

.hatch-reveal { position: absolute; display: grid; place-items: center; }
.reveal-card {
  position: relative; display: flex; flex-direction: column; align-items: center; gap: .3rem;
  padding: 1.6rem 2rem 1.3rem; border-radius: 20px; min-width: min(84vw, 320px);
  background: linear-gradient(180deg, color-mix(in srgb, var(--rc) 14%, #0C120F), #0C120F);
  border: 2px solid var(--rc);
  box-shadow: 0 0 44px color-mix(in srgb, var(--rc) 55%, transparent), var(--shadow);
  animation: cardIn .45s cubic-bezier(.2,1.3,.4,1) both;
}
@keyframes cardIn { from { transform: scale(.6) translateY(24px); opacity: 0; } to { transform: none; opacity: 1; } }
.rv-rarity { font-size: .8rem; font-weight: 900; letter-spacing: .16em; text-transform: uppercase; color: var(--rc); }
.rv-name { font-size: 1.5rem; font-weight: 800; }
.rv-egg { font-size: .8rem; color: var(--muted); }
.rv-value { margin-top: .3rem; font-size: 1rem; color: var(--gold); font-weight: 700; }
.rv-mult { display: block; font-size: .74rem; color: var(--accent2); font-weight: 700; }
.reveal-card[data-mut] { border-width: 3px; }
.reveal-card[data-mut="golden"]    { border-color: #FFD23F; }
.reveal-card[data-mut="godly"]     { border-color: #FFF6C9; }
.reveal-card[data-mut="rainbow"]   { border-color: #FF2E88; }
.reveal-card[data-mut="american"]  { border-color: #FFFFFF; }
.reveal-card[data-mut="frozen"]    { border-color: #7FE9FF; }
.reveal-card[data-mut="astral"]    { border-color: #E2B8FF; }
.reveal-card[data-mut="glitched"]  { border-color: #00FFC2; }
.reveal-card[data-mut="ancient"]   { border-color: #C8A24A; }
.reveal-card[data-mut="void"]      { border-color: #8A7BFF; }
.reveal-card[data-mut="prismatic"] { border-color: #FFFFFF; box-shadow: 0 0 60px rgba(255,255,255,.8); }
.reveal-card[data-r="10"] { border-color: #fff; }

.hatch-grid {
  position: absolute; inset: 0; z-index: 4; overflow-y: auto;
  padding: clamp(1rem, 4vw, 2rem); animation: fadeIn .3s ease;
}
.hatch-grid.hidden { display: none; }
.bulk-head { text-align: center; margin-bottom: 1rem; }
.bulk-title { font-size: 1.4rem; font-weight: 800; }
.bulk-sub { font-size: .88rem; color: var(--muted); }
.bulk-grid { display: grid; gap: .55rem; grid-template-columns: repeat(auto-fill, minmax(108px, 1fr)); max-width: 1000px; margin: 0 auto; }
.bulk-cell { animation: popIn .3s ease both; animation-delay: calc(var(--i) * 28ms); }
.bulk-cell.is-best .pet-card { box-shadow: 0 0 0 2px var(--rc), 0 0 26px color-mix(in srgb, var(--rc) 60%, transparent); }
@keyframes popIn { from { transform: scale(.6); opacity: 0; } to { transform: none; opacity: 1; } }

.hatch-skip {
  position: absolute; bottom: max(1rem, env(safe-area-inset-bottom)); right: 1rem; z-index: 6;
  background: rgba(20,28,25,.9); border: 1px solid var(--line2); color: var(--text);
  border-radius: 999px; padding: .55rem 1.1rem; min-height: 40px; backdrop-filter: blur(8px);
}
.hatch-skip:hover:not(:disabled) { border-color: var(--accent2); color: var(--accent2); }
/* The hatch plays out in full — the button only arms once the pet is revealed. */
.hatch-skip:disabled { opacity: .45; cursor: default; letter-spacing: .04em; }
.hatch-overlay[data-stage="done"] .hatch-skip { animation: cardIn .3s ease both; }

/* Reveal card gets its own halo at the very top tiers. */
.reveal-card[data-r="9"]::after, .reveal-card[data-r="10"]::after {
  content: ''; position: absolute; inset: -30px; border-radius: 34px; z-index: -1;
  background: conic-gradient(from 0deg, var(--rc), transparent, var(--rc), transparent, var(--rc));
  filter: blur(26px); opacity: .6; animation: spinRing 6s linear infinite;
}
.reveal-card[data-r="10"]::after { animation-duration: 3.2s; opacity: .85; }

/* Screen shake */
.shake-lo  { animation: shake .34s cubic-bezier(.36,.07,.19,.97) 2; }
.shake-hi  { animation: shakeBig .30s cubic-bezier(.36,.07,.19,.97) 3; }
.shake-max { animation: shakeBig .26s cubic-bezier(.36,.07,.19,.97) 5; }
@keyframes shake    { 10%,90% { transform: translate(-2px,1px); } 30%,70% { transform: translate(3px,-2px); } 50% { transform: translate(-4px,2px); } }
@keyframes shakeBig { 10%,90% { transform: translate(-6px,3px) rotate(-.3deg); } 30%,70% { transform: translate(8px,-5px) rotate(.4deg); } 50% { transform: translate(-11px,6px) rotate(-.5deg); } }

/* ── Modal & toasts ──────────────────────────────────────────────────── */
.modal {
  position: fixed; inset: 0; z-index: 120; display: flex; align-items: center; justify-content: center;
  background: rgba(5,8,7,.78); padding: 1rem; animation: fadeIn .18s ease; overflow-y: auto;
}
.modal.hidden { display: none; }
.modal-card {
  position: relative; background: var(--panel); border: 1px solid var(--line2);
  border-radius: 16px; padding: 1.2rem; width: min(560px, 100%); max-height: 88vh; overflow-y: auto;
  box-shadow: var(--shadow); animation: cardIn .25s ease both;
}
.modal-close {
  position: absolute; top: .6rem; right: .6rem; width: 32px; height: 32px; border-radius: 50%;
  border: 1px solid var(--line2); background: var(--panel2);
}
.modal-close:hover { border-color: var(--danger); color: var(--danger); }

.toasts {
  position: fixed; bottom: max(1rem, env(safe-area-inset-bottom)); left: 50%; transform: translateX(-50%);
  z-index: 140; display: flex; flex-direction: column-reverse; gap: .4rem; align-items: center;
  pointer-events: none; width: min(92vw, 460px);
}
.toast {
  background: rgba(20,28,25,.96); border: 1px solid var(--line2); border-radius: 11px;
  padding: .55rem .9rem; font-size: .86rem; box-shadow: var(--shadow);
  animation: toastIn .25s ease, toastOut .35s ease forwards; animation-delay: 0s, 3.4s;
  max-width: 100%;
}
.toast.good { border-color: var(--accent2); color: var(--accent2); }
.toast.bad { border-color: var(--danger); color: #ffb3b3; }
.toast.gold { border-color: var(--gold); color: var(--gold); }
@keyframes toastIn { from { transform: translateY(14px); opacity: 0; } }
@keyframes toastOut { to { transform: translateY(-8px); opacity: 0; } }

/* ── Page footer ─────────────────────────────────────────────────────────
   Deliberately quiet: it sits below every tab's content, so it should read as
   a colophon rather than as another thing competing to be clicked. */
.page-foot {
  padding: 2rem 1rem calc(1.6rem + env(safe-area-inset-bottom));
  text-align: center;
}
.page-foot a {
  color: var(--muted); text-decoration: none;
  font-size: .74rem; letter-spacing: .04em;
  opacity: .55; transition: opacity .15s ease, color .15s ease;
}
.page-foot a:hover { opacity: 1; color: var(--accent2); }

/* ── Release notes page ──────────────────────────────────────────────── */
.notes { max-width: 940px; margin: 0 auto; padding: 1rem clamp(.7rem, 3vw, 1.4rem) 0; }
.notes-h {
  margin: 1.8rem 0 .7rem; font-size: .8rem; font-weight: 800;
  text-transform: uppercase; letter-spacing: .14em; color: var(--muted);
}
.notes-list { padding-left: 1.1rem; line-height: 1.75; margin: .4rem 0 0; }
.notes-list li + li { margin-top: .35rem; }
/* A hairline in the section's own colour, so the notes scan as a stack of
   cards without needing a heading style per feature. */
.panel.note { border-left: 3px solid var(--c1); }
.panel.note + .panel.note { margin-top: .8rem; }
/* The chips are a reference list here rather than a badge on a card, so they
   get a size at which the emoji is actually readable. */
.notes-page .mut-chip {
  flex: none; align-self: flex-start; margin-top: .15rem;
  font-size: .78rem; padding: .22rem .5rem; gap: .25rem; min-width: 62px;
  justify-content: center;
}
.notes-page .mut-chip b { font-size: .72rem; }

/* ── Shared keyframes ────────────────────────────────────────────────── */
@keyframes bob { 0%,100% { transform: translateY(0); } 50% { transform: translateY(-11px); } }
@keyframes rattle { 0% { margin-left: -3px; } 50% { margin-left: 3px; } 100% { margin-left: -3px; } }
@keyframes spinRing { to { transform: rotate(360deg); } }
@keyframes fadeIn { from { opacity: 0; } }
@keyframes blink { 0%,100% { opacity: 1; } 50% { opacity: .25; } }
@keyframes pulseGlow { 0%,100% { box-shadow: 0 0 0 rgba(255,107,53,0); } 50% { box-shadow: 0 0 14px rgba(255,107,53,.6); } }
@keyframes hueRoll { to { filter: hue-rotate(360deg); } }
@keyframes glitchShift { 0% { transform: translate(0,0); } 33% { transform: translate(1.5px,-1px); } 66% { transform: translate(-1.5px,1px); } 100% { transform: translate(0,0); } }
@keyframes glitchText { 0%,100% { text-shadow: none; } 50% { text-shadow: 1.5px 0 var(--accent3), -1.5px 0 #00FFC2; } }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}

/* ── Mobile ──────────────────────────────────────────────────────────── */
@media (max-width: 620px) {
  .brand-name { display: none; }
  .topbar { gap: .4rem; padding: .5rem .7rem; }
  .stat { font-size: .8rem; padding: .25rem .55rem; }
  .tabs { top: 48px; }
  .tab span { font-size: 1.15rem; }
  .tab { padding: .4rem .6rem; font-size: .78rem; }
  .pet-grid { grid-template-columns: repeat(auto-fill, minmax(98px, 1fr)); gap: .45rem; }
  .orb { width: 54px; height: 54px; }
  .orb-glyph { font-size: 1.6rem; }
  .odds-row { grid-template-columns: 78px 1fr 54px; font-size: .76rem; }
  .plot-grid { grid-template-columns: 1fr; }
  .folk-grid { grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); }
  /* The show board drops the pet orb and leans on the name instead. */
  .board-row { grid-template-columns: 38px minmax(64px, 1fr) minmax(0, 1.6fr) auto; font-size: .78rem; }
  .board-row .orb.sm { display: none; }
}
