/* shard room-annabel (annabel.css) — the ANNABEL THEME for Word Lab (the English tutor).
   Gaming-noir deep palette + teal accents + Space Grotesk display stack. Sets the
   --wl-* token VALUES the shared engine consumes (token NAMES are declared by the
   engine's 00-base.css); adds Annabel-only chrome + the earned-answer RANK-UP flourish.
   Loaded AFTER engine.css so these values win. Owns ONLY .wl-room-annabel-* + the
   --wl-* token values — never the engine's .wl-app/.wl-stage/.wl-nav component rules.
   No assets, no webfont files: "Space Grotesk" is named and falls back to system. */

:root {
  /* --- surfaces: deep noir navy --- */
  --wl-bg:         #0a0e17;
  --wl-surface:    #141b2b;
  --wl-surface-2:  #1e2840;
  /* --- ink: high-contrast cool whites (>=7:1 on --wl-surface) --- */
  --wl-ink:        #eaf1fb;   /* ~14:1 on --wl-surface */
  --wl-ink-soft:   #9fb0cc;   /* ~7.8:1 on --wl-surface */
  --wl-line:       #2c3954;
  /* --- accents: neon teal (case-file teal) + electric violet (red-string) --- */
  --wl-accent:     #2ee6c2;   /* ~10.8:1 on --wl-surface */
  --wl-accent-ink: #062018;   /* ~11.8:1 on --wl-accent (dark ink on bright teal) */
  --wl-accent-2:   #9d7bff;
  --wl-good:       #46e08a;
  --wl-warn:       #ffb454;   /* amber wrong-chunk pulse — reads on dark */
  --wl-focus:      #ffd24a;   /* gold focus ring, high visibility on dark */
  /* --- renderer-consumed tokens (render-spell / render-wordgame / render-comprehension
         + signature) that Annabel was MISSING. Without these the shared renderers fell back
         to their LIGHT-THEME literals (#2a2333 / #1b1b2f / #6b6478 / rgba(0,0,0,..)) which
         are invisible / failing-contrast on the noir bg. Re-mapped to Annabel's EXISTING
         noir palette so the look is unchanged, only legibility improves. WCAG-AA. --- */
  --wl-fg:           #eaf1fb;   /* = --wl-ink; spell body text, typed letters, hint text, reveal word -- ~15:1 on --wl-surface */
  --wl-text:         #eaf1fb;   /* word-game body/prompt/tile/input/reveal (this renderer uses --wl-text, not --wl-fg) */
  --wl-text-soft:    #9fb0cc;   /* = --wl-ink-soft; signature detective caption + secondary text */
  --wl-muted:        #9fb0cc;   /* reveal-button label + reveal labels -- ~7.8:1 on --wl-surface, ~8.8:1 on --wl-bg */
  --wl-on-accent:    #062018;   /* dark ink for text on the bright teal accent (white would fail) -- ~10.8:1 on --wl-accent */
  --wl-surface-soft: rgba(255, 255, 255, 0.05);  /* accessibility-block panel -- subtle LIGHT overlay on dark, not the dark rgba(0,0,0) fallback */
  --wl-accent-soft:  rgba(46, 230, 194, 0.16);   /* replay-pill hover wash, teal-tinted */
  --wl-good-soft:    rgba(70, 224, 138, 0.22);   /* correct-chunk feedback wash */
  --wl-warn-soft:    rgba(255, 180, 84, 0.22);   /* wrong-chunk feedback wash */
  --wl-marker:       rgba(255, 180, 84, 0.28);   /* comprehension long-press highlight -- translucent amber keeps --wl-ink text legible (opaque light-yellow literal would not) */
  /* --- shape + rhythm --- */
  --wl-radius:     14px;
  --wl-radius-sm:  9px;
  --wl-gap:        16px;
  --wl-touch:      44px;      /* accessibility minimum — never shrink */
  --wl-maxw:       760px;
  --wl-shadow:     0 14px 36px rgba(0, 0, 0, 0.55);
  /* --- type: Space Grotesk leads, graceful system fallback (no font files) --- */
  --wl-font:         "Space Grotesk", "Segoe UI", system-ui, -apple-system, BlinkMacSystemFont, Roboto, Helvetica, Arial, sans-serif;
  --wl-font-display: "Space Grotesk", "Segoe UI", system-ui, -apple-system, sans-serif;
}

/* ---- atmospheric backdrop (decorative, fixed, behind everything) ---- */
.wl-room-annabel-bg {
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background:
    radial-gradient(1100px 620px at 80% -12%, rgba(46, 230, 194, 0.12), transparent 60%),
    radial-gradient(900px 520px at 8% 112%, rgba(157, 123, 255, 0.10), transparent 60%),
    linear-gradient(180deg, #0a0e17, #0b1018);
}
.wl-room-annabel-bg::after {
  content: "";
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(54, 226, 194, 0.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(54, 226, 194, 0.035) 1px, transparent 1px);
  background-size: 46px 46px;
  opacity: 0.7;
}

/* ---- header chrome (children of the engine's .wl-nav banner) ---- */
.wl-room-annabel-wordmark {
  margin-right: auto;               /* push mute + HUD to the right when .wl-nav is a flex row */
  font-family: var(--wl-font-display);
  font-weight: 700;
  font-size: 14px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--wl-ink-soft);
  white-space: nowrap;
}
.wl-room-annabel-wordmark b { color: var(--wl-accent); }
.wl-room-annabel-wordmark i {
  font-style: normal;
  margin-left: 8px;
  font-size: 11px;
  letter-spacing: 0.22em;
  color: var(--wl-accent-2);
}

.wl-room-annabel-mute {
  flex: 0 0 auto;
  width: var(--wl-touch);
  height: var(--wl-touch);
  min-width: var(--wl-touch);
  min-height: var(--wl-touch);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  border: 1px solid var(--wl-line);
  border-radius: var(--wl-radius-sm);
  background: var(--wl-surface-2);
  color: var(--wl-ink);
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.wl-room-annabel-mute:hover { color: var(--wl-accent); border-color: var(--wl-accent); }
.wl-room-annabel-mute:focus-visible { outline: 3px solid var(--wl-focus); outline-offset: 2px; }
.wl-room-annabel-mute-ico { width: 23px; height: 23px; display: block; }
/* muted state (aria-pressed="true"): hide the sound waves, show the slash */
.wl-room-annabel-mute[aria-pressed="true"] { color: var(--wl-ink-soft); }
.wl-room-annabel-mute[aria-pressed="true"] .wl-room-annabel-mute-wave { display: none; }
.wl-room-annabel-mute-slash { display: none; }
.wl-room-annabel-mute[aria-pressed="true"] .wl-room-annabel-mute-slash { display: inline; }

/* ---- the RANK-UP flourish: fires ONLY on an EARNED correct answer (XP up),
        never on Reveal (Reveal stays plain + un-celebratory per the invariant).
        Decorative + aria-hidden; boot.js toggles .is-on. ---- */
.wl-room-annabel-fx {
  position: fixed;
  inset: 0;
  display: none;
  pointer-events: none;
  z-index: 7000;                    /* below TutorShell confetti (z 9000) */
}
.wl-room-annabel-fx.is-on { display: block; }

.wl-room-annabel-fx-ring {
  position: absolute;
  left: 50%;
  top: 42%;
  width: 44px;
  height: 44px;
  margin: -22px 0 0 -22px;
  border-radius: 50%;
  border: 3px solid var(--wl-accent);
  transform: scale(0);
  opacity: 0;
}
.wl-room-annabel-fx.is-on .wl-room-annabel-fx-ring { animation: wl-room-annabel-shock 900ms ease-out; }

.wl-room-annabel-fx-cap {
  position: absolute;
  left: 0;
  right: 0;
  top: 45%;
  text-align: center;
  font-family: var(--wl-font-display);
  font-weight: 700;
  letter-spacing: 0.03em;
  font-size: clamp(22px, 5.5vw, 38px);
  color: var(--wl-accent);
  text-shadow: 0 0 20px rgba(46, 230, 194, 0.6);
  opacity: 0;
}
.wl-room-annabel-fx.is-on .wl-room-annabel-fx-cap { animation: wl-room-annabel-cap 1150ms ease-out; }

/* a streak "flame" flicking up near the HUD (top-right) */
.wl-room-annabel-fx-flame {
  position: absolute;
  right: 22px;
  top: 60px;
  width: 18px;
  height: 26px;
  border-radius: 50% 50% 50% 50% / 60% 60% 42% 42%;
  background: linear-gradient(180deg, #ffe07a, #ff7a3c 58%, #ff4d6d);
  filter: drop-shadow(0 0 10px rgba(255, 140, 60, 0.7));
  transform-origin: 50% 100%;
  opacity: 0;
}
.wl-room-annabel-fx.is-on .wl-room-annabel-fx-flame { animation: wl-room-annabel-flame 1000ms ease-out; }

@keyframes wl-room-annabel-shock {
  0%   { transform: scale(0);  opacity: 0.9; }
  70%  { opacity: 0.45; }
  100% { transform: scale(14); opacity: 0; }
}
@keyframes wl-room-annabel-cap {
  0%   { opacity: 0; transform: translateY(8px) scale(0.96); }
  18%  { opacity: 1; transform: none; }
  78%  { opacity: 1; }
  100% { opacity: 0; }
}
@keyframes wl-room-annabel-flame {
  0%   { opacity: 0; transform: scaleY(0.4); }
  25%  { opacity: 1; transform: scaleY(1.15); }
  60%  { transform: scaleY(0.92); }
  100% { opacity: 0; transform: scaleY(0.5); }
}
@keyframes wl-room-annabel-capfade {
  0%   { opacity: 0; }
  20%  { opacity: 1; }
  80%  { opacity: 1; }
  100% { opacity: 0; }
}

/* reduced-motion: kill the moving shockwave/flame; keep a still caption fade only */
@media (prefers-reduced-motion: reduce) {
  .wl-room-annabel-bg::after { display: none; }
  .wl-room-annabel-fx-ring,
  .wl-room-annabel-fx-flame { display: none; }
  .wl-room-annabel-fx.is-on .wl-room-annabel-fx-cap { animation: wl-room-annabel-capfade 700ms ease; }
}
