/* BIOMES: the Biome window, and what the whole game looks like in each biome.
   Loaded last so it can recolor everything. The rain itself is drawn by
   js/biomes.js. To make a new biome, copy the "rainy" blocks and change the
   colors (the biome's id in js/config.js is what goes in data-biome="...").   */

/* ---------- The Biome window (top of "Your Packs") ---------- */
.biome-panel {
  position: relative; overflow: hidden; margin-bottom: 1rem; padding: 0.85rem 1rem 0.8rem;
  border: 1px solid var(--line); border-radius: 12px;
  background: rgba(0, 0, 0, 0.2);
  transition: background-color 1.2s, border-color 1.2s, box-shadow 1.2s;
}
.biome-panel > * { position: relative; z-index: 1; }
.biome-top { display: flex; align-items: center; gap: 0.85rem; }
.biome-icon { flex: none; display: grid; place-items: center; width: 2.9rem; height: 2.9rem; font-size: 1.7rem; border-radius: 12px; background: rgba(255, 255, 255, 0.07); }
.biome-main { flex: 1; min-width: 0; display: flex; flex-direction: column; line-height: 1.15; }
.biome-label { font-size: 0.66rem; font-weight: 800; letter-spacing: 0.1em; text-transform: uppercase; color: var(--muted); }
.biome-name { font: 400 1.45rem var(--font-display); }
.biome-sub { font-size: 0.82rem; font-weight: 800; color: var(--muted); font-variant-numeric: tabular-nums; }
.biome-luck { flex: none; display: flex; flex-direction: column; align-items: flex-end; padding: 0.35rem 0.7rem; border-radius: 10px; background: rgba(255, 255, 255, 0.06); }
.biome-luck-label { font-size: 0.62rem; font-weight: 800; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); }
.biome-luck-val { font: 400 1.35rem/1.1 var(--font-display); }
.biome-luck-val.boosted { color: #7fe3ff; text-shadow: 0 0 12px rgba(94, 200, 255, 0.7); }
.biome-bar { height: 6px; margin-top: 0.7rem; border-radius: 999px; background: rgba(255, 255, 255, 0.12); overflow: hidden; }
.biome-bar-fill { height: 100%; width: 0; border-radius: inherit; background: linear-gradient(90deg, #3aa4ff, #8fe3ff); transition: width 1s linear; }
.biome-odds:empty { display: none; }
.biome-odds { margin: 0.6rem 0 0; font-size: 0.74rem; font-weight: 700; color: var(--muted); }

/* Rainy window: blue wash with little streaks of rain falling inside it */
.biome-panel[data-active="rainy"] {
  border-color: rgba(120, 205, 255, 0.5);
  background: linear-gradient(160deg, rgba(40, 120, 200, 0.4), rgba(8, 40, 82, 0.55));
  box-shadow: 0 0 26px rgba(60, 160, 255, 0.28), inset 0 0 30px rgba(90, 190, 255, 0.1);
}
.biome-panel[data-active="rainy"]::before,
.biome-panel[data-active="rainy"]::after {
  content: ""; position: absolute; inset: 0; z-index: 0; pointer-events: none;
  background-repeat: repeat;
}
.biome-panel[data-active="rainy"]::before {
  background-image: linear-gradient(100deg, transparent 47%, rgba(190, 230, 255, 0.34) 49%, transparent 51%);
  background-size: 19px 28px; animation: panel-rain 0.55s linear infinite;
}
.biome-panel[data-active="rainy"]::after {
  background-image: linear-gradient(100deg, transparent 48%, rgba(190, 230, 255, 0.2) 49.5%, transparent 51%);
  background-size: 31px 46px; animation: panel-rain-2 0.9s linear infinite;
}
@keyframes panel-rain   { to { background-position: 0 28px; } }
@keyframes panel-rain-2 { to { background-position: 0 46px; } }
.biome-panel[data-active="rainy"] .biome-icon { background: rgba(120, 205, 255, 0.2); animation: biome-bob 3s ease-in-out infinite; }
@keyframes biome-bob { 50% { transform: translateY(-3px); } }

/* Small pill in the top bar (only while a biome is active) */
.biome-pill {
  padding: 0.3rem 0.8rem; font: 800 0.8rem var(--font-body); white-space: nowrap; font-variant-numeric: tabular-nums;
  border-radius: 999px; color: #dff4ff; border: 1px solid rgba(120, 205, 255, 0.55); background: rgba(40, 120, 200, 0.3);
}
@media (max-width: 760px) { .biome-pill { display: none; } }

/* Banner when a biome starts / ends */
.biome-toast {
  position: fixed; left: 50%; top: 5.2rem; z-index: 60; transform: translateX(-50%);
  max-width: calc(100vw - 2rem); padding: 0.7rem 1.4rem; border-radius: 999px; text-align: center;
  font-weight: 800; color: var(--ink); background: rgba(10, 30, 60, 0.92); border: 1px solid var(--line);
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.5); animation: biome-toast-in 0.45s cubic-bezier(.2, 1.3, .4, 1);
  transition: opacity 0.6s, transform 0.6s;
}
.biome-toast[data-biome="rainy"] { color: #eaf8ff; border-color: rgba(120, 205, 255, 0.7); background: linear-gradient(90deg, rgba(20, 90, 170, 0.95), rgba(10, 40, 90, 0.95)); box-shadow: 0 0 28px rgba(60, 160, 255, 0.45), 0 12px 32px rgba(0, 0, 0, 0.5); }
.biome-toast.out { opacity: 0; transform: translate(-50%, -14px); }
@keyframes biome-toast-in { from { opacity: 0; transform: translate(-50%, -24px); } }

/* ---------- Sky, rain canvas, lightning ---------- */
.biome-sky {
  position: fixed; inset: 0; z-index: -1; pointer-events: none; overflow: hidden; opacity: 0; transition: opacity 3s ease;
  background:
    radial-gradient(ellipse at 50% 0%, rgba(80, 150, 215, 0.55), transparent 62%),
    linear-gradient(180deg, #0a2845 0%, #0b2f55 45%, #07213f 100%);
}
html[data-biome="rainy"] .biome-sky { opacity: 1; }
/* slow dark clouds drifting across the top */
.biome-clouds { position: absolute; left: -30%; top: -12%; width: 160%; height: 55%; opacity: 0.8; animation: clouds-drift 70s linear infinite alternate;
  background:
    radial-gradient(ellipse 18% 40% at 12% 40%, rgba(8, 24, 44, 0.75), transparent 70%),
    radial-gradient(ellipse 22% 46% at 34% 28%, rgba(12, 34, 60, 0.8), transparent 70%),
    radial-gradient(ellipse 20% 42% at 58% 38%, rgba(8, 24, 44, 0.75), transparent 70%),
    radial-gradient(ellipse 24% 48% at 82% 26%, rgba(12, 34, 60, 0.8), transparent 70%);
  filter: blur(14px);
}
@keyframes clouds-drift { to { transform: translateX(12%); } }
/* faint mist along the bottom */
.biome-sky::after { content: ""; position: absolute; inset: auto 0 0 0; height: 35%; background: linear-gradient(0deg, rgba(120, 190, 255, 0.14), transparent); }

#biome-rain { position: fixed; inset: 0; width: 100%; height: 100%; z-index: 12; pointer-events: none; display: none; }

.biome-flash { position: fixed; inset: 0; z-index: 13; pointer-events: none; opacity: 0; background: radial-gradient(ellipse at 60% 0%, rgba(235, 245, 255, 0.95), rgba(150, 200, 255, 0.55) 55%, rgba(150, 200, 255, 0.2)); }
.biome-flash.go { animation: lightning 1s ease-out; }
@keyframes lightning {
  0% { opacity: 0; } 4% { opacity: 0.75; } 12% { opacity: 0.1; } 18% { opacity: 0.55; } 40% { opacity: 0; } 100% { opacity: 0; }
}

/* ---------- RAINY: recolor the whole interface blue ---------- */
html[data-biome="rainy"] {
  --bg: #06182b; --bg-2: #0e3a5e;
  --panel: rgba(130, 195, 255, 0.07); --line: rgba(150, 210, 255, 0.18);
  --ink: #eef8ff; --muted: rgba(214, 236, 255, 0.68);
  --accent: #5ec8ff; --accent-ink: #031f38;
  scrollbar-color: #2f6a9c transparent;
}
html[data-biome="rainy"] body { background: radial-gradient(ellipse at 50% -10%, #1d5a8c, var(--bg) 65%) fixed; }
html[data-biome="rainy"] .topbar { background: rgba(6, 24, 43, 0.86); }
html[data-biome="rainy"] .admin-bar { background: rgba(10, 40, 72, 0.92); }
html[data-biome="rainy"] .tab.active { background: rgba(94, 200, 255, 0.18); color: var(--accent); }
html[data-biome="rainy"] .tab.active .tab-count { background: rgba(94, 200, 255, 0.24); }
html[data-biome="rainy"] .btn-main:hover { background: #9be3ff; }
html[data-biome="rainy"] .pip.on { border-color: #bfeaff; background: linear-gradient(160deg, #5ec8ff, #2a6fe0); box-shadow: 0 0 10px rgba(94, 200, 255, 0.6); }
html[data-biome="rainy"] .progress-fill { background: linear-gradient(90deg, #3aa4ff, #8fe3ff); }
html[data-biome="rainy"] .toast { box-shadow: 0 6px 0 #1b5f94, 0 14px 30px rgba(0, 0, 0, 0.5); }
html[data-biome="rainy"] .brand-mark { background: var(--accent); }
/* the free pack turns blue too (packs you pick from the shelf keep their own colors) */
html[data-biome="rainy"] .pack-stage {
  --foil:
    radial-gradient(circle at 30% 20%, rgba(255, 255, 255, 0.4), transparent 45%),
    repeating-linear-gradient(135deg, rgba(255, 255, 255, .08) 0 14px, transparent 14px 28px),
    linear-gradient(160deg, #6fd3ff, #2f82e6 60%, #173a86);
}
/* the free pack's stage halo/rays are warm by default */
html[data-biome="rainy"] .pack-rays { background: repeating-conic-gradient(rgba(170, 225, 255, 0.75) 0 7deg, transparent 7deg 24deg); }

/* colors fade instead of snapping when a biome starts or ends */
.topbar, .panel, .shelf, .free-status, .coll-bar, .tab, .pip { transition: background-color 1.5s, border-color 1.5s, color 1.5s, box-shadow 1.5s; }

@media (prefers-reduced-motion: reduce) {
  .biome-clouds, .biome-panel::before, .biome-panel::after, .biome-icon { animation: none !important; }
  .biome-sky { transition: none; }
}

/* =====================================================================
   GLOOMY DOWNPOUR: a violet storm. Same ideas as Rainy, purple and moodier,
   with a slowly pulsing sky, glowing clouds and a drifting violet fog.
   ===================================================================== */
.biome-panel[data-active="gloomy"] {
  border-color: rgba(190, 150, 255, 0.55);
  background: linear-gradient(160deg, rgba(110, 50, 210, 0.45), rgba(28, 8, 70, 0.62));
  box-shadow: 0 0 28px rgba(140, 80, 255, 0.34), inset 0 0 30px rgba(170, 120, 255, 0.12);
}
.biome-panel[data-active="gloomy"]::before,
.biome-panel[data-active="gloomy"]::after { content: ""; position: absolute; inset: 0; z-index: 0; pointer-events: none; background-repeat: repeat; }
.biome-panel[data-active="gloomy"]::before {
  background-image: linear-gradient(104deg, transparent 47%, rgba(210, 180, 255, 0.4) 49%, transparent 51%);
  background-size: 17px 26px; animation: panel-rain 0.45s linear infinite;
}
.biome-panel[data-active="gloomy"]::after {
  background-image: linear-gradient(104deg, transparent 48%, rgba(210, 180, 255, 0.22) 49.5%, transparent 51%);
  background-size: 29px 44px; animation: panel-rain-2 0.75s linear infinite;
}
.biome-panel[data-active="gloomy"] .biome-icon { background: rgba(190, 150, 255, 0.22); animation: biome-bob 2.4s ease-in-out infinite; }
.biome-panel[data-active="gloomy"] .biome-luck-val.boosted { color: #d9bcff; text-shadow: 0 0 12px rgba(180, 130, 255, 0.85); }
.biome-panel[data-active="gloomy"] .biome-bar-fill { background: linear-gradient(90deg, #7a3cff, #d9bcff); }

.biome-pill[data-biome="gloomy"] { color: #f0e4ff; border-color: rgba(190, 150, 255, 0.65); background: rgba(110, 50, 210, 0.34); }
.biome-toast[data-biome="gloomy"] { color: #f4eaff; border-color: rgba(190, 150, 255, 0.75); background: linear-gradient(90deg, rgba(100, 40, 190, 0.96), rgba(30, 8, 80, 0.96)); box-shadow: 0 0 30px rgba(150, 90, 255, 0.5), 0 12px 32px rgba(0, 0, 0, 0.5); }

html[data-biome="gloomy"] .biome-sky {
  opacity: 1;
  background:
    radial-gradient(ellipse at 50% 0%, rgba(130, 70, 220, 0.55), transparent 62%),
    linear-gradient(180deg, #1a0838 0%, #230c4d 45%, #12052d 100%);
  animation: gloom-breathe 7s ease-in-out infinite alternate;
}
@keyframes gloom-breathe { from { filter: brightness(0.9); } to { filter: brightness(1.15); } }
html[data-biome="gloomy"] .biome-clouds {
  opacity: 0.95; animation-duration: 45s;
  background:
    radial-gradient(ellipse 18% 40% at 12% 40%, rgba(18, 4, 44, 0.85), transparent 70%),
    radial-gradient(ellipse 22% 46% at 34% 28%, rgba(34, 10, 72, 0.9), transparent 70%),
    radial-gradient(ellipse 20% 42% at 58% 38%, rgba(18, 4, 44, 0.85), transparent 70%),
    radial-gradient(ellipse 24% 48% at 82% 26%, rgba(34, 10, 72, 0.9), transparent 70%),
    radial-gradient(ellipse 12% 20% at 40% 50%, rgba(170, 110, 255, 0.28), transparent 70%),
    radial-gradient(ellipse 12% 20% at 74% 46%, rgba(170, 110, 255, 0.22), transparent 70%);
}
/* violet fog creeping along the bottom */
html[data-biome="gloomy"] .biome-sky::after {
  height: 45%; background: radial-gradient(ellipse 60% 100% at 30% 100%, rgba(160, 100, 255, 0.28), transparent 70%), radial-gradient(ellipse 60% 100% at 80% 100%, rgba(120, 60, 230, 0.26), transparent 70%);
  animation: fog-drift 14s ease-in-out infinite alternate;
}
@keyframes fog-drift { from { transform: translateX(-4%); } to { transform: translateX(4%); } }
/* dark edges so the middle of the screen feels lit by the storm */
html[data-biome="gloomy"] .biome-sky::before {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background: radial-gradient(ellipse at 50% 45%, transparent 45%, rgba(8, 0, 25, 0.55) 100%);
}
html[data-biome="gloomy"] .biome-flash { background: radial-gradient(ellipse at 40% 0%, rgba(245, 235, 255, 0.95), rgba(180, 130, 255, 0.6) 55%, rgba(150, 90, 255, 0.25)); }

html[data-biome="gloomy"] {
  --bg: #11062a; --bg-2: #321070;
  --panel: rgba(190, 140, 255, 0.07); --line: rgba(200, 160, 255, 0.19);
  --ink: #f6f0ff; --muted: rgba(228, 214, 255, 0.68);
  --accent: #b78bff; --accent-ink: #1d0545;
  scrollbar-color: #5a3a9c transparent;
}
html[data-biome="gloomy"] body { background: radial-gradient(ellipse at 50% -10%, #4a1c92, var(--bg) 65%) fixed; }
html[data-biome="gloomy"] .topbar { background: rgba(17, 6, 42, 0.86); }
html[data-biome="gloomy"] .admin-bar { background: rgba(44, 16, 92, 0.92); }
html[data-biome="gloomy"] .tab.active { background: rgba(183, 139, 255, 0.2); color: var(--accent); }
html[data-biome="gloomy"] .tab.active .tab-count { background: rgba(183, 139, 255, 0.26); }
html[data-biome="gloomy"] .btn-main:hover { background: #cfb0ff; }
html[data-biome="gloomy"] .pip.on { border-color: #e0ccff; background: linear-gradient(160deg, #b78bff, #6a2cff); box-shadow: 0 0 10px rgba(183, 139, 255, 0.65); }
html[data-biome="gloomy"] .progress-fill { background: linear-gradient(90deg, #7a3cff, #d9bcff); }
html[data-biome="gloomy"] .toast { box-shadow: 0 6px 0 #4a2a8a, 0 14px 30px rgba(0, 0, 0, 0.5); }
html[data-biome="gloomy"] .pack-stage {
  --foil:
    radial-gradient(circle at 30% 20%, rgba(255, 255, 255, 0.4), transparent 45%),
    repeating-linear-gradient(135deg, rgba(255, 255, 255, .08) 0 14px, transparent 14px 28px),
    linear-gradient(160deg, #c49bff, #7a3cff 60%, #34108a);
}
html[data-biome="gloomy"] .pack-rays { background: repeating-conic-gradient(rgba(215, 180, 255, 0.75) 0 7deg, transparent 7deg 24deg); }

@media (prefers-reduced-motion: reduce) {
  html[data-biome="gloomy"] .biome-sky, html[data-biome="gloomy"] .biome-sky::after { animation: none; }
}


/* =====================================================================
   SNOWY: icy blue interface, plus snow piles along the bottom of the screen.
   The piles sit behind every window (z-index -1, above only the sky) and let clicks through;
   js/biomes.js decides which one is sparkling and handles the click.
   ===================================================================== */
.snow-layer { position: fixed; left: 0; right: 0; bottom: 0; height: 100px; z-index: -1; pointer-events: none; display: none; }
.snow-pile {
  position: absolute; bottom: -6px; border-radius: 50% 50% 0 0 / 90% 90% 0 0;
  background: radial-gradient(ellipse at 50% 15%, #ffffff, #dff3ff 55%, #a9d3ee);
  box-shadow: 0 -2px 14px rgba(200, 235, 255, 0.45);
}
/* sparkle: only on the Packs tab */
.snow-layer.on-packs .snow-pile.sparkle { animation: snow-glow 1.1s ease-in-out infinite alternate; }
.snow-layer.on-packs .snow-pile.sparkle::before,
.snow-layer.on-packs .snow-pile.sparkle::after {
  content: "\2726"; position: absolute; top: 8%; color: #fff; font-size: 1.5rem; line-height: 1;
  text-shadow: 0 0 8px #7fe3ff, 0 0 16px #7fe3ff; animation: snow-twinkle 0.8s ease-in-out infinite alternate;
}
.snow-layer.on-packs .snow-pile.sparkle::before { left: 28%; }
.snow-layer.on-packs .snow-pile.sparkle::after { left: 62%; font-size: 1.1rem; animation-delay: 0.4s; }
@keyframes snow-glow { to { box-shadow: 0 -4px 26px rgba(127, 227, 255, 0.95), 0 0 30px rgba(255, 255, 255, 0.7); filter: brightness(1.08); } }
@keyframes snow-twinkle { from { transform: scale(0.5) rotate(0); opacity: 0.45; } to { transform: scale(1.2) rotate(45deg); opacity: 1; } }

.biome-panel[data-active="snowy"] {
  border-color: rgba(205, 240, 255, 0.6);
  background: linear-gradient(160deg, rgba(120, 190, 235, 0.4), rgba(20, 60, 105, 0.55));
  box-shadow: 0 0 26px rgba(170, 225, 255, 0.3), inset 0 0 30px rgba(220, 245, 255, 0.1);
}
.biome-panel[data-active="snowy"] .biome-icon { background: rgba(220, 245, 255, 0.2); animation: biome-bob 3s ease-in-out infinite; }
.biome-panel[data-active="snowy"] .biome-luck-val.boosted { color: #e6f8ff; text-shadow: 0 0 12px rgba(200, 240, 255, 0.85); }
.biome-pill[data-biome="snowy"] { color: #f2fbff; border-color: rgba(205, 240, 255, 0.65); background: rgba(120, 190, 235, 0.3); }
.biome-toast[data-biome="snowy"] { color: #f2fbff; border-color: rgba(205, 240, 255, 0.75); background: linear-gradient(90deg, rgba(60, 130, 190, 0.96), rgba(20, 55, 100, 0.96)); box-shadow: 0 0 28px rgba(170, 225, 255, 0.45), 0 12px 32px rgba(0, 0, 0, 0.5); }

html[data-biome="snowy"] .biome-sky {
  opacity: 1;
  background:
    radial-gradient(ellipse at 50% 0%, rgba(170, 215, 245, 0.5), transparent 62%),
    linear-gradient(180deg, #17375a 0%, #1f4a74 45%, #12304e 100%);
}
html[data-biome="snowy"] .biome-clouds { opacity: 0.5; filter: blur(16px) brightness(2.2); }
html[data-biome="snowy"] {
  --bg: #0c2138; --bg-2: #24527f;
  --panel: #28527c; --line: rgba(205, 238, 255, 0.2);   /* solid, so snow piles never show through windows */
  --ink: #f4fbff; --muted: rgba(222, 242, 255, 0.7);
  --accent: #9fe0ff; --accent-ink: #072238;
  scrollbar-color: #4a7aa6 transparent;
}
html[data-biome="snowy"] body { background: radial-gradient(ellipse at 50% -10%, #2f6a9c, var(--bg) 65%) fixed; }
html[data-biome="snowy"] .topbar { background: rgba(12, 33, 56, 0.86); }
html[data-biome="snowy"] .admin-bar { background: rgba(26, 62, 100, 0.92); }
html[data-biome="snowy"] .tab.active { background: rgba(159, 224, 255, 0.18); color: var(--accent); }
html[data-biome="snowy"] .tab.active .tab-count { background: rgba(159, 224, 255, 0.24); }
html[data-biome="snowy"] .btn-main:hover { background: #c9efff; }
html[data-biome="snowy"] .pip.on { border-color: #e6f8ff; background: linear-gradient(160deg, #a9e6ff, #4a9ad8); box-shadow: 0 0 10px rgba(159, 224, 255, 0.6); }
html[data-biome="snowy"] .progress-fill, html[data-biome="snowy"] .biome-bar-fill { background: linear-gradient(90deg, #6cc0f0, #e6f8ff); }
html[data-biome="snowy"] .brand-mark { background: var(--accent); }

/* ---------- ANCIENT FOREST: mossy green-and-gold interface ---------- */
html[data-biome="ancient_forest"] {
  --bg: #0b1a10; --bg-2: #24472a;
  --panel: rgba(170, 220, 140, 0.07); --line: rgba(200, 230, 150, 0.2);
  --ink: #f6f8e8; --muted: rgba(226, 238, 200, 0.7);
  --accent: #e3c15a; --accent-ink: #2a1d05;
  scrollbar-color: #4c7a45 transparent;
}
html[data-biome="ancient_forest"] body { background: radial-gradient(ellipse at 50% -10%, #2f6a38, var(--bg) 65%) fixed; }
html[data-biome="ancient_forest"] .biome-sky {
  opacity: 1;
  background:
    radial-gradient(ellipse at 50% 0%, rgba(150, 200, 90, 0.4), transparent 62%),
    linear-gradient(180deg, #0e2a16 0%, #173b20 45%, #0b2012 100%);
}
html[data-biome="ancient_forest"] .biome-clouds { opacity: 0.3; filter: blur(16px) hue-rotate(60deg); }
html[data-biome="ancient_forest"] .topbar { background: rgba(11, 26, 16, 0.88); }
html[data-biome="ancient_forest"] .admin-bar { background: rgba(30, 62, 36, 0.92); }
html[data-biome="ancient_forest"] .tab.active { background: rgba(227, 193, 90, 0.18); color: var(--accent); }
html[data-biome="ancient_forest"] .tab.active .tab-count { background: rgba(227, 193, 90, 0.24); }
html[data-biome="ancient_forest"] .btn-main:hover { background: #f1d98a; }
html[data-biome="ancient_forest"] .progress-fill, html[data-biome="ancient_forest"] .biome-bar-fill { background: linear-gradient(90deg, #6fae4a, #e3c15a); }
html[data-biome="ancient_forest"] .brand-mark { background: var(--accent); }
.biome-panel[data-active="ancient_forest"] { border-color: rgba(227, 193, 90, 0.55); background: linear-gradient(120deg, rgba(40, 90, 45, 0.6), rgba(20, 50, 28, 0.6)); }
.biome-panel[data-active="ancient_forest"] .biome-icon { background: rgba(227, 193, 90, 0.2); animation: biome-bob 3s ease-in-out infinite; }
.biome-panel[data-active="ancient_forest"] .biome-luck-val.boosted { color: #f1d98a; text-shadow: 0 0 12px rgba(227, 193, 90, 0.8); }
.biome-pill[data-biome="ancient_forest"] { color: #fff6dc; border-color: rgba(227, 193, 90, 0.65); background: rgba(70, 130, 60, 0.35); }
.biome-toast[data-biome="ancient_forest"] { color: #fff6dc; border-color: rgba(227, 193, 90, 0.75); background: linear-gradient(90deg, rgba(50, 110, 55, 0.96), rgba(18, 50, 28, 0.96)); box-shadow: 0 0 28px rgba(227, 193, 90, 0.4), 0 12px 32px rgba(0, 0, 0, 0.5); }

/* ---------- VOID: black and magenta ---------- */
html[data-biome="void"] {
  --bg: #05020a; --bg-2: #1a0b2e;
  --panel: rgba(190, 120, 230, 0.07); --line: rgba(200, 140, 255, 0.2);
  --ink: #f5ecff; --muted: rgba(225, 205, 245, 0.7);
  --accent: #c076b9; --accent-ink: #1a0618;
  scrollbar-color: #5a2a80 transparent;
}
html[data-biome="void"] body { background: radial-gradient(ellipse at 50% -10%, #2a0f45, var(--bg) 65%) fixed; }
html[data-biome="void"] .biome-sky { opacity: 1; background: radial-gradient(ellipse at 50% 0%, rgba(150, 60, 200, 0.35), transparent 62%), linear-gradient(180deg, #08030f 0%, #10061e 50%, #04010a 100%); }
html[data-biome="void"] .biome-clouds { opacity: 0.2; filter: blur(16px) hue-rotate(250deg) brightness(0.5); }
html[data-biome="void"] .topbar { background: rgba(8, 3, 16, 0.9); }
html[data-biome="void"] .admin-bar { background: rgba(40, 14, 66, 0.92); }
html[data-biome="void"] .tab.active { background: rgba(192, 118, 185, 0.2); color: var(--accent); }
html[data-biome="void"] .progress-fill, html[data-biome="void"] .biome-bar-fill { background: linear-gradient(90deg, #5a1fb0, #c076b9); }
html[data-biome="void"] .brand-mark { background: var(--accent); }
.biome-panel[data-active="void"] { border-color: rgba(192, 118, 185, 0.6); background: linear-gradient(120deg, rgba(60, 20, 90, 0.7), rgba(8, 3, 16, 0.8)); }
.biome-panel[data-active="void"] .biome-icon { background: rgba(192, 118, 185, 0.22); animation: biome-bob 3s ease-in-out infinite; }
.biome-panel[data-active="void"] .biome-luck-val.boosted { color: #e6bfe1; text-shadow: 0 0 12px rgba(192, 118, 185, 0.85); }
.biome-pill[data-biome="void"] { color: #f5e6f3; border-color: rgba(192, 118, 185, 0.7); background: rgba(70, 20, 100, 0.45); }
.biome-toast[data-biome="void"] { color: #f8eefa; border-color: rgba(192, 118, 185, 0.8); background: linear-gradient(90deg, rgba(80, 25, 120, 0.96), rgba(8, 3, 16, 0.96)); box-shadow: 0 0 30px rgba(192, 118, 185, 0.5), 0 12px 32px rgba(0, 0, 0, 0.5); }

@media (prefers-reduced-motion: reduce) {
  .snow-pile, .snow-pile::before, .snow-pile::after, .biome-panel[data-active="snowy"] .biome-icon { animation: none !important; }
}

/* ---------- SANDS OF TIME: desert (sand, amber, dusty sky) ---------- */
html[data-biome="sands_of_time"] {
  --bg: #1d1208; --bg-2: #3b2511;
  --panel: rgba(255, 200, 120, 0.07); --line: rgba(255, 190, 110, 0.22);
  --ink: #fff4e0; --muted: rgba(255, 236, 205, 0.72);
  --accent: #f0b24a; --accent-ink: #2a1604;
  scrollbar-color: #8a5a22 transparent;
}
html[data-biome="sands_of_time"] body { background: radial-gradient(ellipse at 50% -10%, #8a5420, var(--bg) 65%) fixed; }
html[data-biome="sands_of_time"] .biome-sky { opacity: 1; background: radial-gradient(circle at 78% 8%, rgba(255, 220, 140, 0.55), transparent 38%), linear-gradient(180deg, #e0a050 0%, #a8682a 38%, #3b2511 100%); }
html[data-biome="sands_of_time"] .biome-sky::after { background: linear-gradient(0deg, rgba(240, 190, 110, 0.35), transparent); }
html[data-biome="sands_of_time"] .biome-clouds { opacity: 0.25; filter: blur(16px) sepia(1) hue-rotate(-10deg) brightness(1.1); }
html[data-biome="sands_of_time"] .topbar { background: rgba(32, 20, 9, 0.9); }
html[data-biome="sands_of_time"] .admin-bar { background: rgba(86, 54, 22, 0.92); }
html[data-biome="sands_of_time"] .tab.active { background: rgba(240, 178, 74, 0.2); color: var(--accent); }
html[data-biome="sands_of_time"] .tab.active .tab-count { background: rgba(240, 178, 74, 0.26); }
html[data-biome="sands_of_time"] .btn-main:hover { background: #ffd07a; }
html[data-biome="sands_of_time"] .progress-fill, html[data-biome="sands_of_time"] .biome-bar-fill { background: linear-gradient(90deg, #c4781e, #ffd07a); }
html[data-biome="sands_of_time"] .brand-mark { background: var(--accent); }
.biome-panel[data-active="sands_of_time"] { border-color: rgba(240, 178, 74, 0.6); background: linear-gradient(120deg, rgba(150, 92, 30, 0.65), rgba(50, 30, 12, 0.7)); }
.biome-panel[data-active="sands_of_time"] .biome-icon { background: rgba(240, 178, 74, 0.22); animation: biome-bob 3s ease-in-out infinite; }
.biome-panel[data-active="sands_of_time"] .biome-luck-val.boosted { color: #ffd98f; text-shadow: 0 0 12px rgba(240, 178, 74, 0.85); }
.biome-pill[data-biome="sands_of_time"] { color: #fff2d8; border-color: rgba(240, 178, 74, 0.7); background: rgba(150, 92, 30, 0.45); }
.biome-toast[data-biome="sands_of_time"] { color: #fff6e4; border-color: rgba(240, 178, 74, 0.8); background: linear-gradient(90deg, rgba(170, 105, 35, 0.96), rgba(50, 30, 12, 0.96)); box-shadow: 0 0 30px rgba(240, 178, 74, 0.45), 0 12px 32px rgba(0, 0, 0, 0.5); }


/* =====================================================================
   VOID SCENERY: an otherworldly place, not just a purple tint.
   Everything below sits at z-index -1 (behind <main>, every window and the topbar), is pointer-events: none,
   and is built by voidFx in js/biomes.js. The vortex button/minigame (css/vortex.css) sits on top, unchanged.
   ===================================================================== */
#void-canvas { position: fixed; inset: 0; width: 100%; height: 100%; z-index: -1; pointer-events: none; display: none; }
.void-layer { position: fixed; inset: 0; z-index: -1; pointer-events: none; overflow: hidden; opacity: 0; visibility: hidden; transition: opacity 3s ease, visibility 0s 3s; }
.void-layer.on { opacity: 1; visibility: visible; transition: opacity 3s ease; }
.void-layer > * { position: absolute; pointer-events: none; }

/* the normal-world glows and dust are replaced by the Void's own */
html[data-biome="void"] body::before { background:
  radial-gradient(circle at 18% 78%, rgba(255, 60, 200, 0.12), transparent 38%),
  radial-gradient(circle at 85% 20%, rgba(70, 40, 255, 0.2), transparent 42%); }
html[data-biome="void"] #particles { opacity: 0.35; filter: hue-rotate(260deg) saturate(1.4); }
html[data-biome="void"] .biome-sky { background:
  radial-gradient(ellipse at 50% 42%, rgba(0, 0, 0, 0.9) 0, rgba(0, 0, 0, 0.6) 14%, transparent 40%),
  radial-gradient(ellipse at 50% 0%, rgba(120, 40, 190, 0.3), transparent 60%),
  linear-gradient(180deg, #060210 0%, #0c0420 45%, #020006 100%); }
html[data-biome="void"] .biome-clouds { animation-duration: 160s; opacity: 0.3; filter: blur(22px) hue-rotate(250deg) brightness(0.45); }
html[data-biome="void"] .biome-sky::after { background: linear-gradient(0deg, rgba(255, 70, 210, 0.16), rgba(120, 50, 255, 0.06) 50%, transparent); }

/* nebula: slow-swirling clouds of magenta, indigo and teal-violet */
.void-nebula { inset: -25%; mix-blend-mode: screen; filter: blur(30px); animation: void-swirl 120s linear infinite;
  background:
    radial-gradient(ellipse 30% 22% at 28% 32%, rgba(190, 50, 220, 0.34), transparent 70%),
    radial-gradient(ellipse 26% 30% at 72% 26%, rgba(70, 50, 255, 0.34), transparent 70%),
    radial-gradient(ellipse 34% 20% at 62% 74%, rgba(255, 60, 170, 0.22), transparent 70%),
    radial-gradient(ellipse 22% 26% at 20% 72%, rgba(40, 160, 230, 0.16), transparent 70%); }
@keyframes void-swirl { to { transform: rotate(360deg); } }

/* distant event horizon: a dark disc with a glowing, slowly breathing accretion ring, centred behind the pack/vortex */
.void-horizon { left: 50%; top: 42%; width: min(92vmin, 880px); aspect-ratio: 1; transform: translate(-50%, -50%); border-radius: 50%;
  background: radial-gradient(circle, #000 0, #000 34%, transparent 35%),
    conic-gradient(from 0deg, rgba(255, 90, 220, 0.0), rgba(255, 90, 220, 0.5), rgba(120, 70, 255, 0.0) 35%, rgba(90, 60, 255, 0.4) 60%, rgba(255, 90, 220, 0.0) 80%, rgba(255, 90, 220, 0.0));
  -webkit-mask: radial-gradient(circle, #000 0, #000 56%, transparent 71%); mask: radial-gradient(circle, #000 0, #000 56%, transparent 71%);
  filter: blur(6px); opacity: 0.55; animation: void-ring 40s linear infinite, void-breathe 7s ease-in-out infinite alternate; }
@keyframes void-ring { to { transform: translate(-50%, -50%) rotate(360deg); } }
@keyframes void-breathe { to { opacity: 0.8; filter: blur(10px); } }

/* thin glowing cracks in reality */
.void-rift { width: 2px; height: 70vh; background: linear-gradient(180deg, transparent, rgba(255, 140, 235, 0.85) 30%, rgba(160, 120, 255, 0.9) 60%, transparent); box-shadow: 0 0 14px 3px rgba(200, 100, 255, 0.5), 0 0 40px 10px rgba(120, 60, 255, 0.25);
  clip-path: polygon(0 0, 100% 6%, 30% 24%, 100% 42%, 0 58%, 100% 78%, 40% 100%, 0 94%, 70% 76%, 0 56%, 80% 40%, 0 22%); opacity: 0.45; animation: void-flicker 5.5s steps(1) infinite; }
.void-rift-a { left: 11%; top: 8%; transform: rotate(14deg); }
.void-rift-b { right: 9%; top: 20%; height: 55vh; transform: rotate(-19deg); animation-delay: -2.7s; animation-duration: 7.3s; }
@keyframes void-flicker { 0%, 100% { opacity: 0.45; } 8% { opacity: 0.15; } 10% { opacity: 0.7; } 14% { opacity: 0.3; } 55% { opacity: 0.55; } 58% { opacity: 0.1; } 61% { opacity: 0.6; } }

/* shattered tower shards drifting upward and spinning, glowing at the edges */
.void-shards { inset: 0; }
.void-shard { position: absolute; bottom: -90px; width: var(--w); height: var(--h); background: linear-gradient(160deg, rgba(210, 130, 255, 0.55), rgba(40, 10, 80, 0.85) 60%, #0a0314);
  clip-path: polygon(50% 0, 100% 30%, 78% 100%, 18% 88%, 0 34%); filter: drop-shadow(0 0 6px rgba(200, 110, 255, 0.7));
  animation: void-rise var(--d) linear infinite; }
@keyframes void-rise { to { transform: translate(var(--sway), -118vh) rotate(var(--spin)); } }

/* dark edges: the world feels like it is being swallowed from the corners */
.void-vignette { inset: 0; background: radial-gradient(ellipse at 50% 45%, transparent 45%, rgba(2, 0, 8, 0.75) 100%); }

/* UI picks up the theme a little more, without changing layout */
html[data-biome="void"] .btn-main { box-shadow: 0 0 18px rgba(192, 118, 185, 0.45); }
html[data-biome="void"] .biome-panel[data-active="void"] { box-shadow: 0 0 30px rgba(150, 60, 220, 0.35), inset 0 0 30px rgba(190, 90, 255, 0.12); }
html[data-biome="void"] .vortex { position: relative; }
html[data-biome="void"] .vortex::before { content: ""; position: absolute; z-index: -1; left: 50%; top: 60px; width: 300px; aspect-ratio: 1; transform: translate(-50%, -50%); border-radius: 50%; pointer-events: none;
  background: radial-gradient(circle, rgba(160, 70, 240, 0.35), rgba(80, 30, 160, 0.15) 45%, transparent 70%); animation: void-breathe 5s ease-in-out infinite alternate; }

@media (prefers-reduced-motion: reduce) {
  .void-nebula, .void-horizon, .void-rift, .void-shard, html[data-biome="void"] .vortex::before { animation: none !important; }
  .void-shard { bottom: auto; top: 20%; }
}
@media (max-width: 760px) { .void-rift, .void-shards { display: none; } }

/* Ambient particles (snow / blowing sand / falling leaves): js/biomes.js "ambient". Behind everything, never clickable. */
#biome-ambient { position: fixed; inset: 0; width: 100%; height: 100%; z-index: -1; pointer-events: none; display: none; }


/* =====================================================================
   RAINBOW: deep twilight-blue sky with a glowing double rainbow arc, pastel clouds and drifting colour sparkles
   (the sparkles are the "prism" mode of the ambient canvas in js/biomes.js). Same hooks as the other biomes.
   ===================================================================== */
.biome-panel[data-active="rainbow"] {
  border-color: rgba(255, 255, 255, 0.55);
  background: linear-gradient(160deg, rgba(255, 120, 150, 0.22), rgba(255, 220, 120, 0.2) 30%, rgba(110, 230, 160, 0.2) 55%, rgba(110, 170, 255, 0.24) 80%, rgba(190, 130, 255, 0.28));
  box-shadow: 0 0 26px rgba(255, 190, 240, 0.3), inset 0 0 30px rgba(255, 255, 255, 0.08);
}
.biome-panel[data-active="rainbow"] .biome-icon { background: rgba(255, 255, 255, 0.2); animation: biome-bob 2.8s ease-in-out infinite; }
.biome-panel[data-active="rainbow"] .biome-luck-val.boosted { color: #fff; text-shadow: 0 0 12px rgba(255, 200, 240, 0.9); }
.biome-panel[data-active="rainbow"] .biome-bar-fill { background: linear-gradient(90deg, #ff6b6b, #ffd36b, #7be88f, #6bc4ff, #b98bff); }
.biome-pill[data-biome="rainbow"] { color: #fff; border-color: rgba(255, 255, 255, 0.6); background: linear-gradient(90deg, rgba(255, 90, 120, 0.42), rgba(255, 200, 90, 0.4), rgba(90, 220, 140, 0.4), rgba(90, 160, 255, 0.42), rgba(180, 120, 255, 0.44)); }
.biome-toast[data-biome="rainbow"] { color: #fff; border-color: rgba(255, 255, 255, 0.75); background: linear-gradient(90deg, rgba(200, 50, 90, 0.96), rgba(200, 140, 40, 0.96), rgba(40, 150, 90, 0.96), rgba(40, 100, 200, 0.96), rgba(120, 60, 200, 0.96)); box-shadow: 0 0 28px rgba(255, 200, 240, 0.45), 0 10px 26px rgba(0, 0, 0, 0.45); }

html[data-biome="rainbow"] .biome-sky {
  opacity: 1;
  background:
    radial-gradient(ellipse at 50% 100%, rgba(255, 190, 235, 0.35), transparent 55%),
    radial-gradient(ellipse at 50% 0%, rgba(120, 140, 255, 0.35), transparent 60%),
    linear-gradient(180deg, #15204a 0%, #26356f 50%, #3a2f6e 100%);
}
/* the double rainbow: 7 coloured rings centred below the screen (a faint second bow outside, like real life), gently shimmering */
html[data-biome="rainbow"] .biome-sky::before {
  content: ""; position: absolute; inset: 0; pointer-events: none; filter: blur(2.5px); animation: rainbow-shimmer 14s ease-in-out infinite alternate;
  background:
    radial-gradient(circle at 50% 122%, transparent 0 55vw,
      rgba(255, 70, 80, 0.4) 55vw 58vw, rgba(255, 150, 60, 0.4) 58vw 61vw, rgba(255, 225, 80, 0.4) 61vw 64vw, rgba(100, 225, 120, 0.4) 64vw 67vw,
      rgba(80, 200, 255, 0.4) 67vw 70vw, rgba(90, 120, 255, 0.4) 70vw 73vw, rgba(170, 100, 255, 0.4) 73vw 76vw, transparent 76vw),
    radial-gradient(circle at 50% 122%, transparent 0 84vw,
      rgba(170, 100, 255, 0.16) 84vw 86vw, rgba(90, 120, 255, 0.16) 86vw 88vw, rgba(80, 200, 255, 0.16) 88vw 90vw, rgba(100, 225, 120, 0.16) 90vw 92vw,
      rgba(255, 225, 80, 0.16) 92vw 94vw, rgba(255, 150, 60, 0.16) 94vw 96vw, rgba(255, 70, 80, 0.16) 96vw 98vw, transparent 98vw);
}
@keyframes rainbow-shimmer { from { opacity: 0.7; } to { opacity: 1; } }
html[data-biome="rainbow"] .biome-sky::after { background: linear-gradient(0deg, rgba(255, 200, 240, 0.22), transparent); }
html[data-biome="rainbow"] .biome-clouds { opacity: 0.55; filter: blur(16px) brightness(3) hue-rotate(300deg) saturate(0.8); }
html[data-biome="rainbow"] {
  --bg: #121a3c; --bg-2: #3a2f6e;
  --panel: rgba(255, 255, 255, 0.08); --line: rgba(255, 255, 255, 0.2);
  --ink: #fff; --muted: rgba(240, 236, 255, 0.72);
  --accent: #ffc4ec; --accent-ink: #2a0f3a;
  scrollbar-color: #7a64b8 transparent;
}
html[data-biome="rainbow"] body { background: radial-gradient(ellipse at 50% -10%, #3c4a9c, var(--bg) 65%) fixed; }
html[data-biome="rainbow"] .topbar { background: rgba(18, 26, 60, 0.86); }
html[data-biome="rainbow"] .admin-bar { background: rgba(50, 40, 110, 0.92); }
html[data-biome="rainbow"] .tab.active { background: rgba(255, 196, 236, 0.18); color: var(--accent); }
html[data-biome="rainbow"] .tab.active .tab-count { background: rgba(255, 196, 236, 0.24); }
html[data-biome="rainbow"] .btn-main:hover { background: #ffe0f5; }
html[data-biome="rainbow"] .pip.on { border-color: #fff; background: linear-gradient(160deg, #ff9bd0, #ffd36b 40%, #6bc4ff); box-shadow: 0 0 10px rgba(255, 196, 236, 0.6); }
html[data-biome="rainbow"] .progress-fill { background: linear-gradient(90deg, #ff6b6b, #ffd36b, #7be88f, #6bc4ff, #b98bff); }
html[data-biome="rainbow"] .brand-mark { background: linear-gradient(135deg, #ff6b6b, #ffd36b, #6bc4ff); }
@media (prefers-reduced-motion: reduce) { html[data-biome="rainbow"] .biome-sky::before { animation: none; } }
