/* ==========================================================================
   TIER LOOK — the battle arena changes with the difficulty tier. Extreme
   (tiers 6-10) turns the field ember-lit: a warm wash over the world art, a
   dark red vignette that breathes, embers rising off the ground, a glowing
   frame, an ember foe bar and a flame beside the stage label. applyTierLook()
   in js/17-stars.js sets .tl-ext on the arena (and builds the embers); this
   file is only the look. Normal and Hard keep the plain arena. Pure CSS, no
   raster art. Nightmare (tier 11 and up) is the second look, .tl-nm, further
   down: dark and cold, a red vignette that beats, soul motes, a skull either
   side of the stage number, and a chip for each modifier its foes carry.
   ========================================================================== */
.tierfx{display:none;position:absolute;inset:0;pointer-events:none;overflow:hidden}
.arena.tl-ext .tierfx,.arena.tl-nm .tierfx{display:block}
.tierfx>i{position:absolute;display:block;pointer-events:none;z-index:1}

/* a warm wash over everything below it, hottest at the ground */
.tfWash{inset:0;background:linear-gradient(0deg,#ff4a08 0%,#ff7a1a 38%,#ffb347 100%);mix-blend-mode:soft-light;opacity:.62}
/* a glow where the fighters stand, and a dark red edge that breathes */
.tfVig{inset:0;background:
  radial-gradient(ellipse 85% 34% at 50% 96%,rgba(255,106,26,.42),transparent 72%),
  radial-gradient(ellipse 120% 95% at 50% 46%,transparent 54%,rgba(74,8,0,.62) 100%);
  animation:tlBreathe 4.6s ease-in-out infinite}
/* the frame: a thin ember line with a glow just inside it */
.tfFrame{inset:0;z-index:2;box-shadow:inset 0 0 0 2px rgba(255,138,43,.88),inset 0 0 16px 2px rgba(255,90,26,.55),inset 0 -22px 26px -14px rgba(255,74,8,.5)}

/* embers: applyTierLook() puts in a fixed set of <i>, each with its own --x
   (across), --s (size), --t (seconds to rise), --d (delay) and --r (how far
   up it climbs, in px) */
.tfEmbers{inset:0}
.tfEmbers>i{position:absolute;left:var(--x);bottom:6%;width:var(--s);height:var(--s);border-radius:50%;
  background:#ffd089;box-shadow:0 0 7px 2px #ff6a1a;
  animation:tlRise var(--t) linear var(--d) infinite}

/* the HUD: an ember foe bar, ember lettering on the label, and a flame either
   side of the stage number (the label itself runs under the idle-reward button) */
.arena.tl-ext .hpseg.foe>i{background:linear-gradient(180deg,#ffc069,#e8480f);box-shadow:0 0 8px rgba(255,122,34,.75)}
.arena.tl-ext .stagemid span{color:#ffb066;text-shadow:0 0 8px #ff5a1a,0 1px 4px #2a0a02}
.arena.tl-ext .stagemid b::before,.arena.tl-ext .stagemid b::after{content:"";display:inline-block;width:.78em;height:.78em;vertical-align:-.06em;
  background:var(--tlFlame) center/contain no-repeat;filter:drop-shadow(0 0 4px #ff6a1a)}
.arena.tl-ext .stagemid b::before{margin-right:.2em}
.arena.tl-ext .stagemid b::after{margin-left:.2em}
:root{
  --tlFlame:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cdefs%3E%3ClinearGradient id='o' x1='0' y1='0' x2='0' y2='1'%3E%3Cstop offset='0' stop-color='%23ffd25a'/%3E%3Cstop offset='.55' stop-color='%23ff7a1a'/%3E%3Cstop offset='1' stop-color='%23d8300a'/%3E%3C/linearGradient%3E%3C/defs%3E%3Cpath d='M12.6 1.5C13.2 6 19 8.6 19 14.8A7 7 0 0 1 5 14.8C5 12.2 6.2 10.3 7.8 8.7C8.2 10.4 9 11.2 10 11.6C9.4 7.6 10.8 4 12.6 1.5Z' fill='url(%23o)' stroke='%23601504' stroke-width='.9' stroke-linejoin='round'/%3E%3Cpath d='M12 12.5C12.4 15 15 15.8 15 18.2A3 3 0 0 1 9 18.2C9 16.6 10.9 15.6 12 12.5Z' fill='%23fff0b0'/%3E%3C/svg%3E")}

@keyframes tlBreathe{0%,100%{opacity:.82}50%{opacity:1}}
@keyframes tlRise{0%{transform:translate(0,0);opacity:0}10%{opacity:1}65%{opacity:.85}100%{transform:translate(14px,calc(var(--r) * -1px));opacity:0}}
/* reduced motion: the same look, standing still */
@media (prefers-reduced-motion:reduce){.tfVig,.tfEmbers>i{animation:none!important}.tfEmbers>i{opacity:.8;transform:translateY(calc(var(--r) * -.5px))}}

/* ===== Nightmare (tier 11 and up) =====
   Colder and darker than Extreme: a wash of dark violet that also takes the colour down, a crimson vignette that beats
   like a pulse, soul motes (the same set of <i> the embers use) drifting up, a thin crimson frame, a crimson foe bar,
   a skull either side of the stage number. The modifiers are chips under the stage name (js/17-stars.js
   renderNightmareMods); a tap says what each one does. */
.arena.tl-nm .tfWash{background:linear-gradient(0deg,#3a0a2c 0%,#1d0b33 52%,#0d0a1c 100%);mix-blend-mode:multiply;opacity:.62;
  -webkit-backdrop-filter:saturate(.55);backdrop-filter:saturate(.55)}
.arena.tl-nm .tfVig{background:
  radial-gradient(ellipse 90% 30% at 50% 98%,rgba(170,14,58,.42),transparent 72%),
  radial-gradient(ellipse 120% 95% at 50% 46%,transparent 44%,rgba(58,0,22,.8) 100%);
  animation:tlBeat 2.8s ease-in-out infinite}
.arena.tl-nm .tfFrame{box-shadow:inset 0 0 0 2px rgba(196,40,84,.82),inset 0 0 18px 2px rgba(126,10,62,.66),inset 0 -22px 26px -14px rgba(96,0,42,.55)}
.arena.tl-nm .tfEmbers>i{background:#ffa6bb;box-shadow:0 0 7px 2px #b4143d}
.arena.tl-nm .hpseg.foe>i{background:linear-gradient(180deg,#e85b80,#7d0f33);box-shadow:0 0 8px rgba(196,30,84,.75)}
.arena.tl-nm .stagemid span{color:#f2bccd;text-shadow:0 0 8px #b4143d,0 1px 4px #1a0210;
  /* "Nightmare 11 · Holding · The Shallows" is long: tighter, so it stays clear of the idle-reward button */
  font-size:10.5px;letter-spacing:.07em}
.arena.tl-nm .stagemid b::before,.arena.tl-nm .stagemid b::after{content:"";display:inline-block;width:.78em;height:.78em;vertical-align:-.06em;
  background:var(--tlSkull) center/contain no-repeat;filter:drop-shadow(0 0 4px #ff2a5a)}
.arena.tl-nm .stagemid b::before{margin-right:.2em}
.arena.tl-nm .stagemid b::after{margin-left:.2em}
:root{--tlSkull:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M12 2.2C7.2 2.2 3.6 5.6 3.6 10.1c0 2.5 1.1 4.4 2.9 5.6v3.1c0 .6.5 1.1 1.1 1.1h1.6v-2.1h1.6v2.1h2.4v-2.1h1.6v2.1h1.6c.6 0 1.1-.5 1.1-1.1v-3.1c1.8-1.2 2.9-3.1 2.9-5.6C20.4 5.6 16.8 2.2 12 2.2z' fill='%23efe7f4' stroke='%233a0a22' stroke-width='.8' stroke-linejoin='round'/%3E%3Ccircle cx='8.7' cy='10.3' r='2.2' fill='%232a0616'/%3E%3Ccircle cx='15.3' cy='10.3' r='2.2' fill='%232a0616'/%3E%3Ccircle cx='8.7' cy='10.5' r='.9' fill='%23ff3a62'/%3E%3Ccircle cx='15.3' cy='10.5' r='.9' fill='%23ff3a62'/%3E%3Cpath d='M12 12.6l-1.2 2.3h2.4z' fill='%232a0616'/%3E%3C/svg%3E")}

.nmMods{display:flex;gap:5px;justify-content:center;flex-wrap:wrap;margin:4px auto 0;pointer-events:auto;
  /* the Daily button hangs off the right edge of the header: keep the row (and a second row, if it wraps) clear of it */
  max-width:calc(100% - 104px)}
.nmMods[hidden]{display:none}
.nmChip{min-height:24px;padding:4px 8px;border:1px solid rgba(232,92,132,.72);border-radius:99px;background:rgba(40,6,24,.8);color:#ffc6d5;
  font:700 10px/1 'Work Sans',sans-serif;letter-spacing:.05em;text-transform:uppercase;cursor:pointer;box-shadow:0 0 8px rgba(160,10,60,.45)}
.nmChip:hover,.nmChip:focus-visible{background:rgba(88,10,46,.9);color:#fff}

@keyframes tlBeat{0%,100%{opacity:.72}14%{opacity:1}28%{opacity:.8}42%{opacity:.96}}


/* Nightmare foe eyes (flat/SVG arena). The shape is emitted by buildScene(), so it
   follows the enemy rather than the viewport. Reduced motion leaves a bright still cue. */
.nmFoeEyes{fill:#b20d49;filter:drop-shadow(0 0 3px #ff2d6d) drop-shadow(0 0 8px #9d0a42);animation:nmEyeBeat .82s ease-in-out infinite;transform-origin:center}
.nmFoeEyeCore{fill:#fff1f6;filter:drop-shadow(0 0 3px #fff)}
@keyframes nmEyeBeat{0%,100%{opacity:.76}50%{opacity:1}}
@media (prefers-reduced-motion:reduce){.nmFoeEyes{animation:none;opacity:.9}}
