/* ============================================================================
 * explore-styles.css — Rabbit Hole feature directory
 * Overlay / HUD / feature-panel CSS + 2D-fallback extras.
 * Pairs with guide-styles.css (which provides .guide-card / .guide-grid).
 * Always include a full font fallback stack: Poppins is cookie-gated.
 * ==========================================================================*/

:root {
  /* Mirror both spellings so copied snippets work either way. */
  --pink: #ff69b4;
  --pink-hover: #ff1493;
  --patreon: #9b59b6;
  --rh-font: 'Poppins', system-ui, -apple-system, Segoe UI, Roboto, sans-serif;
  /* The chosen companion's accent. persona.js overrides this on :root once a
     persona is picked; the default keeps the dive pink for the first-run picker. */
  --rh-persona-accent: #ff69b4;
}

body {
  font-family: var(--rh-font);
}

/* Nav logo (guide-styles.css sizes .logo text but not the image/wrapper). */
.logo-wrapper { display: flex; align-items: center; gap: 0.5rem; }
.logo-img { height: 40px; width: auto; border-radius: 8px; vertical-align: middle; }

/* Ambient floating particles (guide-styles.css doesn't define these). */
.particles { position: fixed; inset: 0; pointer-events: none; z-index: -1; overflow: hidden; }
.particle {
  position: absolute; width: 4px; height: 4px; border-radius: 50%;
  background: var(--accent-pink, #ff69b4); opacity: 0.3; animation: rhFloat 15s infinite;
}
@keyframes rhFloat {
  0%, 100% { transform: translateY(100vh) rotate(0deg); opacity: 0; }
  10% { opacity: 0.3; } 90% { opacity: 0.3; }
  100% { transform: translateY(-100vh) rotate(720deg); opacity: 0; }
}

/* ───────────── WebGL canvas (behind everything readable) ───────────── */
#rh-canvas {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
  display: none;
  touch-action: none; /* we handle scroll/drag ourselves in 3D */
}
body.rh-3d-active #rh-canvas { display: block; }
/* In 3D mode the page itself doesn't scroll — the dive is the scroll.
   overscroll-behavior also kills pull-to-refresh / rubber-banding on mobile. */
body.rh-3d-active { overflow: hidden; overscroll-behavior: none; }

/* ───────────── HUD layer (chips, progress, hints) ───────────── */
.rh-hud {
  position: fixed;
  inset: 0;
  z-index: 10;
  pointer-events: none; /* container is transparent to input */
  display: none;
}
body.rh-3d-active .rh-hud { display: block; }
.rh-hud > * { pointer-events: auto; } /* actual controls are clickable */

/* Sector jump rail (right edge) */
.rh-sector-rail {
  position: absolute;
  top: 50%;
  right: 1.5rem;
  transform: translateY(-50%);
}
/* draggable scrubber: vertical line + node dots inline with the label chips */
.rh-scrub { position: relative; }
.rh-scrub-rows {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}
.rh-scrub-row { display: flex; align-items: center; gap: 0.6rem; }
.rh-scrub-line {
  position: absolute;
  left: 9px;
  width: 2px;
  transform: translateX(-50%);
  background: linear-gradient(180deg, rgba(255,105,180,0.15), rgba(255,105,180,0.5), rgba(155,89,182,0.25));
  z-index: 0;
  pointer-events: none;
}
.rh-scrub-node {
  flex: 0 0 18px;
  width: 18px; height: 18px;
  padding: 0; margin: 0;
  border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, 0.28);
  background: rgba(40, 30, 60, 0.85);
  cursor: pointer;
  position: relative; z-index: 1;
  transition: border-color .25s, background .25s, transform .2s;
}
.rh-scrub-node:hover { transform: scale(1.18); border-color: var(--accent-pink, #ff69b4); }
.rh-scrub-node.at { border-color: #fff; background: rgba(255,105,180,0.35); }
.rh-scrub-node.locked::after {
  content: '🔒'; position: absolute; inset: 0; font-size: 9px;
  display: flex; align-items: center; justify-content: center;
}
.rh-scrub-thumb {
  position: absolute;
  left: 9px; top: 0;
  width: 16px; height: 16px;
  transform: translate(-50%, -50%);
  border-radius: 50%;
  background: radial-gradient(circle at 50% 40%, #ffd0ec 0%, var(--accent-pink, #ff69b4) 45%, #c2369a 100%);
  box-shadow: 0 0 10px 3px rgba(255,105,180,0.8), 0 0 22px 6px rgba(255,105,180,0.4);
  z-index: 2;
  pointer-events: none;
  transition: top .12s ease-out;
}
.rh-scrub-hit {
  position: absolute;
  left: -6px; top: 0; bottom: 0;
  width: 30px;
  z-index: 3;
  cursor: grab;
  touch-action: none;
}
.rh-scrub-hit:active { cursor: grabbing; }
.rh-scrub-hit:focus-visible { outline: 2px solid var(--accent-pink, #ff69b4); outline-offset: 2px; border-radius: 8px; }
.rh-chip {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 0.9rem;
  border-radius: 50px;
  background: rgba(30, 30, 58, 0.72);
  border: 1px solid rgba(255, 105, 180, 0.25);
  color: var(--text-secondary, #b0b0c0);
  font: 600 0.85rem var(--rh-font);
  cursor: pointer;
  backdrop-filter: blur(8px);
  transition: border-color .25s, color .25s, transform .25s, background .25s;
}
.rh-chip .rh-chip-icon { font-size: 1rem; }
.rh-chip:hover { transform: translateX(-4px); border-color: var(--accent-pink, #ff69b4); color: #fff; }
.rh-chip.active { color: #fff; background: rgba(255, 105, 180, 0.22); border-color: var(--accent-pink, #ff69b4); }
.rh-chip.locked { opacity: 0.6; }
.rh-chip.locked .rh-chip-icon::after { content: ' 🔒'; }
.rh-chip:focus-visible { outline: 2px solid var(--accent-pink, #ff69b4); outline-offset: 2px; }

/* Top-left title + breadcrumb in 3D */
.rh-hud-title {
  position: absolute;
  top: 5rem;
  left: 2rem;
  max-width: 22rem;
}
.rh-hud-title h1 {
  font-size: 1.6rem;
  background: var(--accent-gradient, linear-gradient(135deg, #ff69b4, #9b59b6));
  -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent;
}
.rh-hud-title .rh-sector-name { color: var(--text-secondary, #b0b0c0); font-size: 0.95rem; margin-top: 0.25rem; }

/* Scroll hint (bottom center, fades after first interaction) */
.rh-scroll-hint {
  position: absolute;
  bottom: 1.5rem;
  left: 50%;
  transform: translateX(-50%);
  color: var(--text-muted, #707090);
  font-size: 0.85rem;
  text-align: center;
  animation: rhBob 2s ease-in-out infinite;
  transition: opacity .4s;
  pointer-events: none; /* informational only — never steal taps from the rail/cards */
}
.rh-scroll-hint.hidden { opacity: 0; }
@keyframes rhBob { 0%,100% { transform: translate(-50%, 0); } 50% { transform: translate(-50%, 6px); } }

/* Floating node label shown on hover */
.rh-node-label {
  position: fixed;
  z-index: 11;
  transform: translate(-50%, -130%);
  padding: 0.35rem 0.7rem;
  border-radius: 8px;
  background: rgba(13, 13, 26, 0.9);
  border: 1px solid rgba(255, 105, 180, 0.3);
  color: #fff;
  font: 600 0.85rem var(--rh-font);
  pointer-events: none;
  white-space: nowrap;
  opacity: 0;
  transition: opacity .15s;
}
.rh-node-label.show { opacity: 1; }

/* ───────────── Feature panel (readable DOM over canvas) ───────────── */
.rh-panel {
  position: fixed;
  inset: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 5rem 1.5rem 2rem;
  background: rgba(8, 8, 18, 0.62);
  backdrop-filter: blur(4px);
}
.rh-panel[hidden] { display: none; }
.rh-panel-card {
  position: relative;
  width: min(1080px, 100%);
  max-height: 100%;
  overflow-y: auto;
  background: var(--bg-card, #1e1e3a);
  border: 1px solid rgba(255, 105, 180, 0.25);
  border-radius: 20px;
  box-shadow: 0 24px 70px rgba(0, 0, 0, 0.55);
  animation: rhPanelIn .25s ease-out;
}
@keyframes rhPanelIn { from { opacity: 0; transform: translateY(16px); } to { opacity: 1; transform: none; } }

/* Feature view: the card flattens to the wall, then a near-fullscreen split
   panel opens — big media on the LEFT (still that crossfades to the tutorial
   video) and the explanation + guide links on the RIGHT. */
.rh-panel.rh-panel-side {
  background: rgba(8, 8, 18, 0.66);
  backdrop-filter: blur(3px);
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
}
.rh-panel.rh-panel-side .rh-panel-card {
  width: min(1500px, 96vw);
  height: min(880px, 90vh);
  height: min(880px, 90dvh); /* dvh: track the real visible area under the mobile URL bar */
  max-height: 90vh;
  max-height: 90dvh;
  display: flex;
  flex-direction: row;
  overflow: hidden;
  animation: rhPanelIn .3s ease-out;
}
.rh-panel-side .rh-panel-hero-wrap {
  flex: 1.7 1 0;
  height: 100%;
  aspect-ratio: auto;
  border-radius: 20px 0 0 20px;
}
.rh-panel-side .rh-panel-body {
  flex: 1 1 0;
  height: 100%;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 2.5rem 2.75rem;
}
.rh-panel-side .rh-panel-body h2 { font-size: 2rem; }
.rh-panel-side .rh-panel-body p { font-size: 1.12rem; line-height: 1.6; margin-bottom: 1.75rem; }
.rh-panel-side .rh-btn { padding: 0.9rem 1.6rem; font-size: 1rem; }
@media (max-width: 768px) {
  .rh-panel.rh-panel-side { padding: 0.75rem; }
  .rh-panel.rh-panel-side .rh-panel-card { flex-direction: column; height: 92vh; height: 92dvh; }
  .rh-panel-side .rh-panel-hero-wrap { flex: none; width: 100%; height: 40%; border-radius: 20px 20px 0 0; }
  .rh-panel-side .rh-panel-body { flex: 1; height: auto; justify-content: flex-start; padding: 1.5rem; }
}

/* Phones: the base feature panel becomes a bottom sheet — full-width, anchored
   to the bottom edge, body scrolls, clear of the notch/home-bar insets. This is
   the mobile-tier feature view (taps open this instead of the in-world card). */
@media (max-width: 768px) {
  .rh-panel {
    align-items: flex-end;
    padding: 0;
    padding-top: calc(3.5rem + env(safe-area-inset-top, 0px)); /* keep the site nav reachable */
  }
  .rh-panel-card {
    width: 100%;
    max-height: 100%;
    border-radius: 20px 20px 0 0;
    padding-bottom: env(safe-area-inset-bottom, 0px);
    overscroll-behavior: contain; /* sheet scroll never chains into pull-to-refresh */
    animation: rhSheetIn .28s ease-out;
  }
  .rh-panel-close { width: 44px; height: 44px; font-size: 1.3rem; }
  .rh-panel-actions .rh-btn { padding: 0.7rem 1.1rem; font-size: 0.9rem; }
}
@keyframes rhSheetIn { from { opacity: 0; transform: translateY(48px); } to { opacity: 1; transform: none; } }
.rh-panel-hero-wrap {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  border-radius: 20px 20px 0 0;
  background: var(--bg-secondary, #252542);
}
.rh-panel-hero {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
/* the tutorial clip fades in over the still after a beat */
.rh-panel-video { opacity: 0; transition: opacity 0.8s ease; }
.rh-panel-video.show { opacity: 1; }
.rh-panel-body { padding: 1.5rem 1.75rem 1.75rem; }
.rh-panel-body h2 { font-size: 1.5rem; margin-bottom: 0.4rem; display: flex; align-items: center; gap: 0.6rem; flex-wrap: wrap; }
.rh-panel-body p { color: var(--text-secondary, #b0b0c0); margin-bottom: 1.25rem; }

/* Feature mini-deck: heading + body text that swap on Back/Next, with progress dots. */
.rh-slides { margin-bottom: 1.25rem; }
.rh-slide-h { margin: 0 0 0.5rem; font-size: 1.05rem; font-weight: 600; color: var(--accent-pink, #ff69b4); }
.rh-slide-body { color: var(--text-secondary, #b0b0c0); line-height: 1.6; min-height: 6.5em; }
.rh-slide-body strong { color: var(--text-primary, #fff); font-weight: 600; }
.rh-slide-body em { color: var(--accent-pink, #ff69b4); font-style: normal; }
.rh-slide-foot { display: flex; align-items: center; justify-content: space-between; gap: 0.75rem; margin-top: 1rem; }
.rh-slide-dots { display: flex; gap: 0.4rem; }
.rh-slide-dot { width: 8px; height: 8px; border-radius: 50%; background: rgba(255, 105, 180, 0.25); transition: background .2s, transform .2s; }
.rh-slide-dot.active { background: var(--accent-pink, #ff69b4); transform: scale(1.25); }
.rh-slide-nav { display: flex; gap: 0.5rem; }
.rh-slide-nav .rh-btn { padding: 0.45rem 0.9rem; font-size: 0.9rem; }
.rh-panel-side .rh-slide-h { font-size: 1.2rem; }
.rh-panel-side .rh-slide-body { font-size: 1.12rem; min-height: 7em; }

/* Hub chooser rows (DOM sheet twin of the in-world chooser card). */
.rh-branch-list { display: flex; flex-direction: column; gap: 0.6rem; margin-bottom: 1.25rem; }
.rh-branch-btn {
  display: flex; flex-direction: column; align-items: flex-start; gap: 0.25rem;
  padding: 0.85rem 1rem; border-radius: 14px; text-align: left; cursor: pointer;
  background: var(--bg-secondary, #252542);
  border: 1px solid rgba(255, 105, 180, 0.3);
  color: var(--text-primary, #fff);
  font: 600 0.95rem var(--rh-font);
  transition: border-color .2s, background .2s;
}
.rh-branch-btn:hover { border-color: var(--accent-pink, #ff69b4); }
.rh-branch-title { display: inline-flex; align-items: center; gap: 0.5rem; flex-wrap: wrap; }
.rh-branch-blurb { color: var(--text-secondary, #b0b0c0); font-weight: 400; font-size: 0.85rem; line-height: 1.45; }

/* Colour-coded setting chips (the "dials" slide). Each row: type pill + name + value + note. */
.rh-settings { display: flex; flex-direction: column; gap: 0.55rem; }
.rh-setting { display: flex; flex-wrap: wrap; align-items: baseline; gap: 0.3rem 0.55rem; }
.rh-setting-name { font-weight: 600; color: var(--text-primary, #fff); }
.rh-setting-val { color: #cfd2e6; font-variant-numeric: tabular-nums; }
.rh-setting-note { color: var(--text-secondary, #b0b0c0); font-size: 0.86em; }
.rh-settings-foot { margin: 0.85rem 0 0; color: var(--text-secondary, #b0b0c0); font-size: 0.88em; font-style: italic; }

.rh-chip {
  display: inline-flex; align-items: center; gap: 0.25rem;
  min-width: 104px; justify-content: center;
  padding: 0.18rem 0.5rem; border-radius: 7px;
  font: 700 0.62rem/1 var(--rh-font); letter-spacing: 0.04em; text-transform: uppercase;
  border: 1px solid transparent; white-space: nowrap; flex: none;
}
.rh-chip--freq      { background: rgba(79,195,217,0.16);  color: #7fdcec; border-color: rgba(79,195,217,0.40); }
.rh-chip--intensity { background: rgba(255,105,180,0.16); color: #ff8fc7; border-color: rgba(255,105,180,0.40); }
.rh-chip--amount    { background: rgba(176,107,240,0.16); color: #c79bf5; border-color: rgba(176,107,240,0.40); }
.rh-chip--timing    { background: rgba(70,201,154,0.16);  color: #74dcb6; border-color: rgba(70,201,154,0.40); }
.rh-chip--chance    { background: rgba(245,197,66,0.16);  color: #f5d27a; border-color: rgba(245,197,66,0.42); }
.rh-chip--danger    { background: rgba(229,83,75,0.18);   color: #f5897f; border-color: rgba(229,83,75,0.45); }
.rh-chip--mode      { background: rgba(154,160,192,0.16); color: #c0c5dc; border-color: rgba(154,160,192,0.38); }
.rh-chip--content   { background: rgba(107,191,89,0.16);  color: #9bd687; border-color: rgba(107,191,89,0.40); }

/* Contextual key: only the categories used on this card. */
.rh-legend { display: flex; flex-wrap: wrap; gap: 0.3rem 0.9rem; margin-top: 0.9rem; padding-top: 0.7rem; border-top: 1px solid rgba(255,105,180,0.12); }
.rh-legend-item { display: inline-flex; align-items: center; gap: 0.35rem; font-size: 0.7rem; color: var(--text-secondary, #b0b0c0); }
.rh-legend-dot { width: 9px; height: 9px; border-radius: 50%; border: 1px solid transparent; flex: none; }

/* Side note pinned to a feature (feature.aside) — e.g. "grab asset packs on
   Discord". In the DOM sheet it sits under the description as a small callout;
   the 3D view renders its own canvas twin beside the info card. */
.rh-panel-aside {
  display: flex; flex-direction: column; gap: 0.3rem;
  margin-bottom: 1.25rem; padding: 0.85rem 1rem;
  border: 1px solid rgba(255, 105, 180, 0.35);
  border-radius: 14px;
  background: rgba(255, 105, 180, 0.07);
  font-size: 0.9rem;
}
.rh-panel-aside strong { color: var(--accent-pink, #ff69b4); }
.rh-panel-aside span { color: var(--text-secondary, #b0b0c0); line-height: 1.5; }
.rh-panel-aside a { color: var(--accent-pink, #ff69b4); font-weight: 700; text-decoration: underline; text-underline-offset: 3px; }

.rh-panel-actions { display: flex; gap: 0.75rem; flex-wrap: wrap; }
.rh-btn {
  display: inline-flex; align-items: center; gap: 0.5rem;
  padding: 0.8rem 1.4rem; border-radius: 50px;
  font: 600 0.95rem var(--rh-font); text-decoration: none; cursor: pointer;
  border: 1px solid transparent; transition: transform .25s, box-shadow .25s, background .25s;
}
.rh-btn-primary { background: var(--accent-gradient, linear-gradient(135deg, #ff69b4, #9b59b6)); color: #fff; box-shadow: 0 4px 20px rgba(255, 105, 180, 0.4); }
.rh-btn-primary:hover { transform: translateY(-2px); box-shadow: 0 6px 30px rgba(255, 105, 180, 0.5); }
.rh-btn-ghost { background: var(--bg-secondary, #252542); color: var(--text-primary, #fff); border-color: rgba(255, 105, 180, 0.3); }
.rh-btn-ghost:hover { border-color: var(--accent-pink, #ff69b4); }
.rh-panel-close {
  position: absolute; top: 0.75rem; right: 0.75rem;
  z-index: 2; /* above the hero still/video, which shares the card's top corner */
  width: 2.2rem; height: 2.2rem; border-radius: 50%;
  background: rgba(13, 13, 26, 0.7); border: 1px solid rgba(255, 105, 180, 0.3);
  color: #fff; font-size: 1.1rem; cursor: pointer; line-height: 1;
  display: flex; align-items: center; justify-content: center;
}
.rh-panel-close:hover { background: rgba(255, 105, 180, 0.25); }

/* Tier badge (shared with 2D) */
.rh-tier {
  display: inline-block; padding: 0.15rem 0.6rem; border-radius: 10px;
  font: 700 0.7rem var(--rh-font); text-transform: uppercase; letter-spacing: 0.04em;
  background: rgba(255, 105, 180, 0.15); color: var(--accent-pink, #ff69b4);
  border: 1px solid rgba(255, 105, 180, 0.3);
}
.rh-tier.lab { background: rgba(155, 89, 182, 0.18); color: #c08fe0; border-color: rgba(155, 89, 182, 0.4); }

/* ───────────── Persistent HUD controls (try-3D / list-view) ───────────── */
.rh-controls {
  position: fixed;
  bottom: 1.25rem;
  right: 1.25rem;
  z-index: 30;
  display: flex;
  gap: 0.6rem;
}
#rh-try3d, #rh-listview { display: none; }
body.rh-2d-active.rh-can-3d #rh-try3d { display: inline-flex; }
body.rh-3d-active #rh-listview { display: inline-flex; }

/* ───────────── Loader ───────────── */
.rh-loader {
  position: fixed; inset: 0; z-index: 40;
  display: flex; align-items: center; justify-content: center;
  flex-direction: column; gap: 1rem;
  background: var(--bg-dark, #0d0d1a);
  color: var(--text-secondary, #b0b0c0);
}
.rh-loader[hidden] { display: none; }
.rh-loader-ring {
  width: 48px; height: 48px; border-radius: 50%;
  border: 3px solid rgba(255, 105, 180, 0.2);
  border-top-color: var(--accent-pink, #ff69b4);
  animation: rhSpin 0.9s linear infinite;
}
@keyframes rhSpin { to { transform: rotate(360deg); } }
/* One-tap gate: the loader waits for a gesture so the dive's audio is allowed */
.rh-loader.rh-loader-tap { cursor: pointer; }
.rh-loader.rh-loader-tap .rh-loader-ring { animation-play-state: paused; opacity: 0.35; }
.rh-loader.rh-loader-tap p {
  color: #fff;
  font-size: 1.15rem;
  animation: rhTapPulse 1.6s ease-in-out infinite;
}
@keyframes rhTapPulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.55; } }

/* ───────────── Persona picker (personaPicker.js) ───────────── */
/* Full-screen "pick your companion" chooser, shown over the loader at boot and
   re-opened from the HUD 🎭 button to switch mid-dive. Fades in via .is-in. */
.rh-persona-picker {
  position: fixed; inset: 0; z-index: 60;
  display: flex; align-items: center; justify-content: center;
  padding: 2rem 1.25rem;
  background: radial-gradient(120% 120% at 50% 20%, rgba(30, 12, 40, 0.94), rgba(8, 6, 16, 0.97));
  backdrop-filter: blur(6px);
  opacity: 0; transition: opacity 0.35s ease;
}
.rh-persona-picker.is-in { opacity: 1; }
.rh-persona-picker.is-leaving { opacity: 0; pointer-events: none; }
.rh-persona-panel { width: 100%; max-width: 880px; text-align: center; }
.rh-persona-heading {
  font: 700 clamp(1.6rem, 4vw, 2.4rem) var(--rh-font);
  margin: 0 0 0.5rem;
  background: linear-gradient(135deg, #ff69b4, #9b59b6);
  -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent;
}
.rh-persona-sub { color: var(--text-secondary, #b0b0c0); margin: 0 auto 2rem; max-width: 34rem; font-size: 1.02rem; }
.rh-persona-grid { display: flex; gap: 1.25rem; justify-content: center; flex-wrap: wrap; }
.rh-persona-card {
  position: relative;
  flex: 1 1 220px; max-width: 260px;
  display: flex; flex-direction: column; align-items: center; gap: 0.35rem;
  padding: 1.4rem 1rem 1.25rem;
  cursor: pointer;
  color: #fff; font-family: var(--rh-font);
  background: rgba(20, 12, 28, 0.72);
  border: 2px solid color-mix(in srgb, var(--card-accent, #ff69b4) 45%, transparent);
  border-radius: 18px;
  box-shadow: 0 10px 34px rgba(0, 0, 0, 0.4);
  transition: transform 0.18s ease, border-color 0.18s ease, box-shadow 0.18s ease;
}
.rh-persona-card:hover, .rh-persona-card:focus-visible {
  transform: translateY(-6px);
  border-color: var(--card-accent, #ff69b4);
  box-shadow: 0 16px 44px color-mix(in srgb, var(--card-accent, #ff69b4) 40%, rgba(0, 0, 0, 0.5));
  outline: none;
}
.rh-persona-art {
  width: 130px; height: 150px;
  display: flex; align-items: flex-end; justify-content: center;
  overflow: hidden;
  filter: drop-shadow(0 8px 18px color-mix(in srgb, var(--card-accent, #ff69b4) 55%, transparent));
}
.rh-persona-art img { max-width: 100%; max-height: 100%; object-fit: contain; }
.rh-persona-name { font-size: 1.15rem; font-weight: 700; }
.rh-persona-tagline { font-size: 0.85rem; color: var(--text-secondary, #b0b0c0); }
.rh-persona-badge {
  position: absolute; top: 0.6rem; right: 0.6rem;
  font: 700 0.6rem/1 var(--rh-font); letter-spacing: 0.05em; text-transform: uppercase;
  padding: 0.25rem 0.5rem; border-radius: 999px;
  color: #fff; background: var(--card-accent, #ff69b4);
}
.rh-persona-card.is-current { border-color: var(--card-accent, #ff69b4); }
/* Drone has no voicelines wired yet — flag it. Sits top-LEFT so it never collides
   with the top-right "Current" badge if the visitor already picked Drone. */
.rh-persona-badge--wip {
  right: auto; left: 0.6rem; top: 0.6rem;
  color: #061006; background: var(--accent-green, #50C878);
}
@media (max-width: 620px) {
  .rh-persona-grid { gap: 0.75rem; }
  .rh-persona-card { flex-basis: 46%; padding: 1rem 0.6rem; }
  .rh-persona-art { width: 96px; height: 112px; }
}

/* ───────────── Persona accent tint on the DOM chrome ───────────── */
/* Once a persona is chosen (persona.js sets body[data-persona] + --rh-persona-accent),
   the loader ring, ambient particles and HUD controls take her colour. */
body[data-persona] .rh-loader-ring { border-top-color: var(--rh-persona-accent); }
body[data-persona] .particle { background: var(--rh-persona-accent); }
body[data-persona] .rh-bubble-toggle:hover { border-color: var(--rh-persona-accent); }
.rh-bubble-persona { border-color: color-mix(in srgb, var(--rh-persona-accent) 60%, transparent); }
.rh-bubble-persona:hover { border-color: var(--rh-persona-accent); }
/* Drone is green-on-black: the transparent WebGL canvas lets the page backdrop show at
   the edges / before the tunnel paints, so darken it to near-black for the drone mod. */
body[data-persona="drone"] { background: #050805; }

/* ───────────── 2D fallback extras (on top of guide-styles.css) ───────────── */
#rh-2d-wrap[hidden] { display: none; }
/* When the 3D dive is active, the readable 2D layer + hero step aside. */
body.rh-3d-active #rh-2d-wrap,
body.rh-3d-active .rh-hero { display: none; }
.rh-sector-blurb { color: var(--text-secondary, #b0b0c0); margin: -0.5rem 0 1.25rem; }
.rh-subgroup-title { font-size: 1.05rem; color: var(--accent-pink, #ff69b4); margin: 1.5rem 0 0.25rem; }
.rh-subgroup-blurb { color: var(--text-muted, #707090); font-size: 0.9rem; margin-bottom: 1rem; }
.rh-sector-locked .guide-card { opacity: 0.92; }
.rh-soon {
  color: var(--accent-gold, #FFD700) !important;
  background: rgba(255, 215, 0, 0.1) !important;
}
.rh-teaser-card { border-style: dashed !important; }

/* The hero CTA on this page */
.rh-hero {
  text-align: center;
  padding: 7rem 2rem 1rem;
  position: relative;
  z-index: 1;
}
.rh-hero h1 {
  font-size: clamp(2.2rem, 5vw, 3.4rem);
  margin-bottom: 0.75rem;
  background: var(--accent-gradient, linear-gradient(135deg, #ff69b4, #9b59b6));
  -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent;
}
.rh-hero p { color: var(--text-secondary, #b0b0c0); max-width: 620px; margin: 0 auto; font-size: 1.1rem; }

@media (max-width: 768px) {
  /* Anchor the rail to the lower-right (above the list-view pill) and collapse
     chips to icon-only, so it stops covering the 3D cards on the right side. */
  .rh-sector-rail {
    right: 0.6rem;
    top: auto;
    bottom: calc(3.6rem + env(safe-area-inset-bottom, 0px));
    transform: none;
  }
  .rh-scrub-rows { gap: 0.5rem; }
  .rh-chip { padding: 0.4rem 0.7rem; font-size: 0.78rem; }
  .rh-sector-rail .rh-chip { padding: 0.32rem 0.5rem; }
  .rh-sector-rail .rh-chip > span:not(.rh-chip-icon) { display: none; }
  .rh-sector-rail .rh-chip .rh-chip-icon { font-size: 0.95rem; }
  .rh-scrub-hit { left: -12px; width: 44px; } /* ≥44px touch target */
  .rh-hud-title { top: calc(4.5rem + env(safe-area-inset-top, 0px)); left: 1rem; max-width: 60vw; }
  /* Bottom bar: bubble dock (left) + list-view pill (right) share one compact
     safe-area row; the scroll hint moves ABOVE them so the three never overlap
     on a narrow screen (they collided at desktop offsets). */
  .rh-controls { bottom: calc(0.75rem + env(safe-area-inset-bottom, 0px)); right: 0.75rem; }
  .rh-controls .rh-btn { padding: 0.6rem 1rem; font-size: 0.85rem; }
  .rh-bubble-dock {
    left: 0.75rem;
    bottom: calc(0.85rem + env(safe-area-inset-bottom, 0px));
    max-width: 46vw;
    flex-wrap: wrap;
    gap: 0.4rem;
  }
  .rh-scroll-hint { bottom: calc(4.6rem + env(safe-area-inset-bottom, 0px)); max-width: 90vw; }
}

/* ============================================================================
 * Bubble Pop preview — floating bubbles (bubbles.js). The 3D sprites live in
 * WebGL; this is just the HUD chrome: the on/off toggle, the XP readout, and the
 * pop / trigger / lucky screen effects.
 * ==========================================================================*/

/* Bottom-left dock: toggle + running XP. */
.rh-bubble-dock {
  position: absolute;
  left: 1rem;
  bottom: 1.4rem;
  display: flex;
  align-items: center;
  gap: 0.6rem;
  z-index: 12;
  pointer-events: none; /* only the button takes input */
}
.rh-bubble-toggle {
  pointer-events: auto;
  font-family: var(--rh-font);
  font-size: 0.82rem;
  font-weight: 600;
  color: #fff;
  background: rgba(20, 12, 28, 0.78);
  border: 1px solid rgba(255, 105, 180, 0.55);
  border-radius: 999px;
  padding: 0.4rem 0.85rem;
  cursor: pointer;
  backdrop-filter: blur(6px);
  transition: border-color .2s, background .2s, opacity .2s;
}
.rh-bubble-toggle:hover { border-color: var(--pink); background: rgba(40, 18, 50, 0.85); }
.rh-bubble-toggle.is-off { color: #b0b0c0; border-color: rgba(255, 255, 255, 0.18); opacity: 0.75; }
.rh-bubble-score {
  font-family: var(--rh-font);
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--pink);
  text-shadow: 0 0 8px rgba(255, 105, 180, 0.6);
}

/* The bubble field: a full-screen, CLICK-THROUGH layer over the canvas. Only the
 * bubbles inside it catch input, so clicks on empty space still reach the scene. */
.rh-bubbles-layer {
  position: absolute;
  inset: 0;
  overflow: hidden;
  pointer-events: none !important;
  z-index: 0; /* below the HUD chrome (rail/title/dock), above the canvas */
}
.rh-bubble-wrap {
  position: absolute;
  bottom: 0;
  pointer-events: none;
  will-change: transform;
  animation: rhBubbleRise var(--rise, 12s) linear forwards;
}
@keyframes rhBubbleRise {
  from { transform: translateY(12vh); }
  to { transform: translateY(-122vh); }
}
.rh-bubble {
  pointer-events: auto;
  border-radius: 50%;
  cursor: pointer;
  will-change: transform;
  animation: rhBubbleSway var(--sway-dur, 4s) ease-in-out infinite alternate;
  /* the real app sprites (transparent bubble art) + a soft glow so the art reads
   * against the dark tunnel. Each kind gets its own effect-bubble sprite below. */
  background: center / contain no-repeat url('/assets/bubbles/bubble.png');
  filter: drop-shadow(0 0 7px rgba(255, 120, 195, 0.5));
}
@keyframes rhBubbleSway {
  from { transform: translateX(calc(var(--sway, 28px) * -0.5)); }
  to { transform: translateX(calc(var(--sway, 28px) * 0.5)); }
}
.rh-bubble--flash { background-image: url('/assets/bubbles/effects/flash.png'); filter: drop-shadow(0 0 9px rgba(255, 240, 200, 0.75)); }
.rh-bubble--subliminal { background-image: url('/assets/bubbles/effects/subliminal.png'); filter: drop-shadow(0 0 9px rgba(210, 130, 255, 0.75)); }
.rh-bubble--spiral { background-image: url('/assets/bubbles/effects/spiral.png'); filter: drop-shadow(0 0 9px rgba(110, 225, 255, 0.75)); }
.rh-bubble--glitch { background-image: url('/assets/bubbles/effects/glitch.png'); filter: drop-shadow(0 0 9px rgba(140, 255, 170, 0.75)); }
.rh-bubble--braindrain { background-image: url('/assets/bubbles/effects/braindrain.png'); filter: drop-shadow(0 0 9px rgba(180, 150, 255, 0.75)); }
.rh-bubble--prism { background-image: url('/assets/bubbles/effects/prism.png'); filter: drop-shadow(0 0 10px rgba(255, 200, 245, 0.8)); }
.rh-bubble--pinkfilter { background-image: url('/assets/bubbles/effects/pinkfilter.png'); filter: drop-shadow(0 0 10px rgba(255, 105, 180, 0.85)); }
.rh-bubble--lucky { background-image: url('/assets/bubbles/effects/golden.png'); filter: drop-shadow(0 0 13px rgba(255, 210, 90, 0.95)); }
/* pop burst — replaces the sway animation, removed on animationend */
.rh-bubble.is-pop { animation: rhBubblePop 0.3s ease-out forwards; }
@keyframes rhBubblePop {
  0% { transform: scale(1); opacity: 1; }
  40% { transform: scale(1.55); opacity: 0.85; }
  100% { transform: scale(2); opacity: 0; }
}

/* Full-screen, non-interactive layer for pop FX. MUST stay click-through so it
 * never steals pops from the canvas (.rh-hud > * defaults to pointer-events:auto). */
.rh-bubble-fx {
  position: absolute;
  inset: 0;
  pointer-events: none !important;
  overflow: hidden;
  z-index: 11;
}

/* Floating "+XP" that drifts up and fades. */
.rh-xp-pop {
  position: absolute;
  transform: translate(-50%, -50%);
  font-family: var(--rh-font);
  font-weight: 800;
  font-size: 1.1rem;
  color: #fff;
  text-shadow: 0 0 10px rgba(255, 105, 180, 0.9);
  white-space: nowrap;
  animation: rhXpFloat 0.95s ease-out forwards;
}
.rh-xp-combo { color: #ffd45e; font-size: 1.25rem; text-shadow: 0 0 12px rgba(255, 212, 94, 0.9); }
.rh-xp-lucky { color: #ffe27a; font-size: 1.6rem; text-shadow: 0 0 18px rgba(255, 212, 94, 1); }
@keyframes rhXpFloat {
  0% { opacity: 0; transform: translate(-50%, -30%) scale(0.7); }
  18% { opacity: 1; transform: translate(-50%, -55%) scale(1.08); }
  100% { opacity: 0; transform: translate(-50%, -150%) scale(1); }
}

/* Spiral overlay (Trigger → spiral): a faint full-screen wash that loops for ~5s
 * then fades. Click-through so it never steals pops. */
.rh-fx-spiralvid {
  position: absolute;
  inset: 0;
  width: 100%; height: 100%;
  pointer-events: none;
  object-fit: cover;
  mix-blend-mode: screen;
  opacity: 0;
  animation: rhFade30 5s linear forwards;
}
/* Glitch overlay (Trigger → glitch): a full-screen clip at ~30%, click-through,
 * with a punchy filter so it reads as a glitch rather than a clean flash. */
.rh-fx-glitchvid {
  position: absolute;
  inset: 0;
  width: 100%; height: 100%;
  pointer-events: none;
  object-fit: cover;
  filter: saturate(1.5) contrast(1.2) hue-rotate(8deg);
  opacity: 0;
  animation: rhFade30 5s linear forwards;
}
@keyframes rhVidIn { from { opacity: 0; } to { opacity: 0.95; } }
/* Faint full-screen overlay: fade in to ~30%, hold, fade out over ~5s. Shared by
 * the spiral / braindrain / pink washes so they read as ambient, not blocking. */
@keyframes rhFade30 {
  0% { opacity: 0; }
  8% { opacity: 0.3; }
  86% { opacity: 0.3; }
  100% { opacity: 0; }
}

/* Clickable flash clips (Trigger → flash): drop at random spots, can be popped to
 * spawn two more (the hydra, capped at 2 generations). pointer-events:auto so they
 * catch taps; a soft pulse hints they're interactive. */
.rh-fx-flashclip {
  position: absolute;
  width: var(--w, 34vw);
  max-width: 560px;
  height: auto;
  max-height: 62vh;
  transform: translate(-50%, -50%);
  pointer-events: auto;
  cursor: pointer;
  object-fit: contain;
  border-radius: 10px;
  box-shadow: 0 0 34px rgba(255, 105, 180, 0.55), inset 0 0 0 2px rgba(255, 255, 255, 0.22);
  opacity: 0;
  animation: rhVidIn 0.2s ease-out forwards, rhFlashPulse 1.2s ease-in-out 0.2s infinite;
}
@keyframes rhFlashPulse {
  0%, 100% { box-shadow: 0 0 26px rgba(255, 105, 180, 0.5), inset 0 0 0 2px rgba(255, 255, 255, 0.18); }
  50% { box-shadow: 0 0 48px rgba(255, 105, 180, 0.9), inset 0 0 0 2px rgba(255, 255, 255, 0.35); }
}
/* Subliminal word flash (Trigger → glitch). */
.rh-sublim-word {
  position: absolute;
  top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  pointer-events: none;
  font-family: var(--rh-font);
  font-weight: 900;
  font-size: clamp(2.5rem, 9vw, 7rem);
  letter-spacing: 0.04em;
  color: #fff;
  text-shadow: 0 0 24px rgba(255, 105, 180, 0.9);
  text-transform: uppercase;
  white-space: nowrap;
  animation: rhSublim 0.5s ease-out forwards;
}
@keyframes rhSublim {
  0% { opacity: 0; transform: translate(-50%, -50%) scale(1.3); }
  18% { opacity: 0.95; transform: translate(-50%, -50%) scale(1); }
  100% { opacity: 0; transform: translate(-50%, -50%) scale(0.96); }
}

/* Braindrain: a dark vignette over the whole screen (the mind draining). Faint
 * (~30%), holds for ~5s, click-through. */
.rh-fx-drain {
  background: radial-gradient(circle at 50% 50%, rgba(0, 0, 0, 0) 22%, rgba(40, 10, 50, 0.95) 100%);
  animation: rhFade30 5s linear forwards;
}
/* Prism: a rainbow shimmer wash. */
.rh-fx-prism {
  background: conic-gradient(from 0deg,
    rgba(255, 0, 128, 0.30), rgba(255, 200, 0, 0.30), rgba(0, 255, 170, 0.30),
    rgba(0, 170, 255, 0.30), rgba(180, 0, 255, 0.30), rgba(255, 0, 128, 0.30));
  mix-blend-mode: screen;
  animation: rhPrism 0.9s ease-out forwards;
}
@keyframes rhPrism {
  0% { opacity: 0; transform: scale(0.7) rotate(0deg); }
  25% { opacity: 0.9; }
  100% { opacity: 0; transform: scale(1.5) rotate(90deg); }
}

/* Trigger Bubble effects: flash / spiral / glitch. */
.rh-fx { position: absolute; inset: 0; pointer-events: none; }
/* Pink filter: a flat pink wash over the whole page at ~25%, holds ~5s, click-through. */
.rh-fx-flash {
  background: rgba(255, 95, 175, 1);
  animation: rhFadePink 5s linear forwards;
}
@keyframes rhFadePink {
  0% { opacity: 0; }
  8% { opacity: 0.25; }
  86% { opacity: 0.25; }
  100% { opacity: 0; }
}
.rh-fx-spiral {
  background: conic-gradient(from 0deg, rgba(179, 136, 255, 0) 0deg, rgba(179, 136, 255, 0.4) 60deg, rgba(255, 105, 180, 0) 120deg, rgba(159, 216, 255, 0.4) 200deg, rgba(179, 136, 255, 0) 300deg);
  mix-blend-mode: screen;
  animation: rhFxSpiral 0.7s ease-out forwards;
  transform-origin: 50% 55%;
}
@keyframes rhFxSpiral {
  0% { opacity: 0; transform: rotate(0deg) scale(0.6); }
  20% { opacity: 0.9; }
  100% { opacity: 0; transform: rotate(320deg) scale(1.6); }
}
.rh-fx-glitch {
  background:
    repeating-linear-gradient(0deg, rgba(159, 216, 255, 0.12) 0 2px, rgba(0, 0, 0, 0) 2px 4px);
  mix-blend-mode: screen;
  animation: rhFxGlitch 0.42s steps(3) forwards;
}
@keyframes rhFxGlitch {
  0% { opacity: 0; transform: translateX(0); }
  25% { opacity: 1; transform: translateX(-6px); }
  50% { opacity: 0.7; transform: translateX(5px); }
  75% { opacity: 1; transform: translateX(-3px); }
  100% { opacity: 0; transform: translateX(0); }
}
/* Glitch also kicks the WebGL canvas for the duration of the effect. */
.rh-canvas-glitch { animation: rhCanvasGlitch 0.42s steps(2) 1; }
@keyframes rhCanvasGlitch {
  0% { filter: none; transform: translateX(0); }
  30% { filter: hue-rotate(40deg) saturate(1.6); transform: translateX(-4px); }
  60% { filter: hue-rotate(-30deg) saturate(1.4); transform: translateX(4px); }
  100% { filter: none; transform: translateX(0); }
}

@media (max-width: 768px) {
  .rh-bubble-dock { left: 0.7rem; bottom: 1rem; }
  .rh-bubble-toggle { font-size: 0.76rem; padding: 0.35rem 0.7rem; }
}
