/* Éternité — les mini-jeux : l'émission des Défis (js/show.js), la salle au trésor (js/hoard.js) et « Où est Xûr ? »
   (js/whereis.js). Le cadre commun vient de css/components/game.css. */

.game-status.is-good { color: var(--page-accent-hi); }
.game-status.is-bad { color: #ffb08a; }
.game-foot { margin: 0; padding: 0 24px 18px; font-size: .72rem; font-style: italic; line-height: 1.5; color: var(--faint); }

/* ---------- L'émission ---------- */
.show-game { border-color: rgba(255, 95, 184, .35); }
.show-steps { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 6px; margin: 14px 24px 0; padding: 0; list-style: none; counter-reset: step; }
.show-steps li { position: relative; padding: 8px 6px 8px 30px; border: 1px solid var(--line); font-size: .64rem; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: var(--faint); counter-increment: step; }
.show-steps li::before { content: counter(step); position: absolute; left: 8px; top: 50%; display: grid; place-items: center; width: 16px; height: 16px; margin-top: -8px; border: 1px solid currentColor; border-radius: 50%; font-size: .58rem; }
.show-steps li.is-done { color: var(--stage-hi); border-color: rgba(255, 95, 184, .35); }
.show-steps li.is-done::before { content: '✓'; background: var(--stage); border-color: var(--stage); color: #1a0716; }
.show-steps li.is-current { color: #fff; border-color: var(--stage); background: rgba(255, 95, 184, .12); box-shadow: 0 0 16px rgba(255, 95, 184, .3); }
.show-host { display: flex; align-items: center; gap: 14px; margin: 14px 24px 0; padding: 10px 14px; border: 1px solid rgba(159, 231, 200, .3); background: rgba(10, 24, 20, .55); }
.show-host img { flex: none; width: 120px; height: 30px; object-fit: cover; border: 1px solid rgba(159, 231, 200, .4); }
.show-line { margin: 0; font-family: var(--font-lore); font-style: italic; font-size: 1.12rem; line-height: 1.4; color: var(--xur-hi); }
.show-line.is-new { animation: line-in .5s ease both; }
.show-stage { position: relative; min-height: 380px; margin: 14px 24px 0; display: grid; place-items: center; border: 1px solid var(--line); overflow: hidden;
  background: radial-gradient(ellipse 70% 40% at 50% 100%, rgba(255, 95, 184, .16), transparent 70%), radial-gradient(ellipse 90% 70% at 50% 30%, #161032, #07060f 80%); }
.show-idle { max-width: 420px; margin: 0; padding: 20px; text-align: center; font-family: var(--font-lore); font-style: italic; font-size: 1.2rem; color: var(--muted); }

/* la roue */
.wheel { display: grid; justify-items: center; gap: 14px; padding: 20px; }
.wheel-label { margin: 0; font-size: .7rem; font-weight: 800; letter-spacing: .2em; text-transform: uppercase; color: var(--gold); }
.wheel-frame { position: relative; width: 250px; height: 250px; }
.wheel-pointer { position: absolute; left: 50%; top: -12px; z-index: 2; width: 0; height: 0; margin-left: -11px; border: 11px solid transparent; border-top: 18px solid var(--gold); filter: drop-shadow(0 2px 4px rgba(0, 0, 0, .6)); }
.wheel-disc { position: absolute; inset: 0; border-radius: 50%; border: 6px solid #c99a3a; box-shadow: 0 0 0 3px #5a3a08, 0 0 30px rgba(255, 207, 92, .35), inset 0 0 24px rgba(0, 0, 0, .5);
  background: conic-gradient(from -36deg, #ff8a4a 0 72deg, #9fd3ff 72deg 144deg, #8fe07a 144deg 216deg, #e9e4ff 216deg 288deg, #7ff0e0 288deg 360deg); transform: rotate(0deg); }
.wheel-disc::after { content: ''; position: absolute; left: 50%; top: 50%; width: 46px; height: 46px; margin: -23px 0 0 -23px; border-radius: 50%; background: radial-gradient(circle at 40% 35%, #fff6d8, #c99a3a 60%, #5a3a08); box-shadow: 0 2px 8px rgba(0, 0, 0, .6); }
.wheel-disc.is-spinning { transform: rotate(var(--turn)); transition: transform 3.1s cubic-bezier(.15, .65, .12, 1); }
.wheel-seg { position: absolute; left: 50%; top: 50%; width: 90px; margin-left: -45px; margin-top: -9px; transform: rotate(var(--a)) translateY(-82px); text-align: center; font-size: .66rem; font-weight: 900; letter-spacing: .08em; text-transform: uppercase; color: #120c1e; }
.wheel-disc.is-landed { box-shadow: 0 0 0 3px #5a3a08, 0 0 46px rgba(255, 207, 92, .7), inset 0 0 24px rgba(0, 0, 0, .5); }

/* les arènes */
.arena-wrap { display: grid; gap: 8px; width: 100%; padding: 12px; }
.arena-head { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 14px; }
.arena-title { margin: 0; font-size: .76rem; font-weight: 800; letter-spacing: .16em; text-transform: uppercase; color: var(--rc, var(--gold)); }
.arena-text { margin: 0; font-size: .82rem; line-height: 1.45; color: var(--muted); }
.arena-timer { position: absolute; right: 22px; top: 14px; margin: 0; padding: 2px 10px; border: 1px solid var(--line); font-size: .8rem; font-weight: 800; font-variant-numeric: tabular-nums; color: var(--pearl); }
.arena-timer.is-low { color: #ffb08a; border-color: #ffb08a; }
.arena-box { position: relative; }
.arena { position: relative; width: 100%; aspect-ratio: 16 / 8; min-height: 280px; overflow: hidden; border: 1px solid color-mix(in srgb, var(--rc, #ffcf5c) 35%, transparent);
  background: radial-gradient(ellipse 80% 60% at 50% 110%, color-mix(in srgb, var(--rc, #ffcf5c) 18%, transparent), transparent 70%),
    linear-gradient(180deg, #0c0b1c, #141228 60%, #1c1730); }
.arena::before { content: ''; position: absolute; inset: 0; pointer-events: none; background-image: linear-gradient(rgba(255, 255, 255, .03) 1px, transparent 1px), linear-gradient(90deg, rgba(255, 255, 255, .03) 1px, transparent 1px); background-size: 8% 12%; }
.arena.is-frozen .unit { pointer-events: none; filter: grayscale(.6) brightness(.7); }
.arena.is-over .unit { pointer-events: none; opacity: .4; }
.arena-down { position: absolute; left: 50%; top: 50%; z-index: 5; margin: 0; padding: 8px 18px; transform: translate(-50%, -50%); border: 1px solid #ffb08a; background: rgba(20, 6, 4, .85); font-size: .9rem; font-weight: 900; letter-spacing: .2em; text-transform: uppercase; color: #ffb08a; }
.arena-down[hidden] { display: none; }

.unit { position: absolute; left: var(--x); top: var(--y); z-index: 1; display: grid; place-items: center; width: 54px; height: 54px; padding: 0; transform: translate(-50%, -50%);
  border: 2px solid var(--rc, #ffcf5c); border-radius: 50%; background: radial-gradient(circle at 40% 35%, color-mix(in srgb, var(--rc, #ffcf5c) 55%, #fff), color-mix(in srgb, var(--rc, #ffcf5c) 45%, #000) 70%);
  color: #0c0b1c; font: inherit; cursor: crosshair; transition: transform .12s, opacity .25s, filter .2s; animation: unit-in .25s ease both, unit-bob 2.4s ease-in-out .25s infinite; }
.unit:hover, .unit:focus-visible { transform: translate(-50%, -50%) scale(1.1); outline: 0; box-shadow: 0 0 0 3px rgba(255, 255, 255, .35); }
.unit-name { position: absolute; top: 100%; left: 50%; width: max-content; max-width: 130px; margin-top: 4px; transform: translateX(-50%); font-size: .58rem; font-weight: 800; letter-spacing: .04em; line-height: 1.2; text-align: center; text-transform: uppercase; color: var(--pearl); text-shadow: 0 1px 3px #000; pointer-events: none; }
.unit-hp { position: absolute; left: 6px; right: 6px; bottom: -5px; height: 4px; border-radius: 2px; background: linear-gradient(90deg, #ff6a6a calc(var(--hp, 1) * 100%), rgba(255, 255, 255, .15) 0); pointer-events: none; }
.unit.is-big { width: 78px; height: 78px; }
.unit--boss { width: 110px; height: 110px; border-width: 3px; box-shadow: 0 0 30px color-mix(in srgb, var(--rc, #ffcf5c) 50%, transparent); animation: unit-in .25s ease both; }
.unit--boss .unit-name { font-size: .7rem; }
.unit--add { width: 40px; height: 40px; border-radius: 30% 30% 50% 50%; }
.unit--carrier { border-style: double; border-width: 4px; }
.unit--target, .unit--boss { border-radius: 18%; }
.unit.is-shielded { box-shadow: 0 0 0 4px rgba(150, 220, 255, .9), 0 0 22px rgba(150, 220, 255, .8); }
.unit.is-shielded::after { content: ''; position: absolute; inset: -9px; border: 2px dashed rgba(150, 220, 255, .9); border-radius: inherit; animation: shield-spin 6s linear infinite; pointer-events: none; }
.unit--pickup { width: 30px; height: 30px; border-radius: 4px; transform: translate(-50%, -50%) rotate(45deg); border-color: #fff; background: radial-gradient(circle, #fff, var(--rc, #ffcf5c)); box-shadow: 0 0 18px #fff; animation: unit-in .25s ease both, pickup-glow 1s ease-in-out infinite; }
.unit--pickup:hover { transform: translate(-50%, -50%) rotate(45deg) scale(1.15); }
.unit--pickup .unit-name { transform: translateX(-50%) rotate(-45deg); top: 120%; }
.unit--pickup .unit-hp { display: none; }
.unit--mine, .unit--trap { border-color: #ffd36b; background: radial-gradient(circle, #3a2a10, #120c06); color: #ffd36b; }
.unit-clock { position: absolute; inset: -6px; border-radius: 50%; background: conic-gradient(#ffd36b calc(var(--t, 1) * 360deg), transparent 0); -webkit-mask: radial-gradient(circle, transparent 62%, #000 64%); mask: radial-gradient(circle, transparent 62%, #000 64%); pointer-events: none; }
.unit--trap { border-radius: 8px; border-color: #7ff0e0; background: repeating-linear-gradient(90deg, rgba(127, 240, 224, .5) 0 3px, transparent 3px 9px), rgba(4, 30, 28, .8); }
.unit--trap .unit-clock { border-radius: 8px; background: conic-gradient(#7ff0e0 calc(var(--t, 1) * 360deg), transparent 0); }
.unit--chosen { opacity: .1; border-color: rgba(255, 255, 255, .4); background: radial-gradient(circle, rgba(255, 255, 255, .25), transparent 70%); animation: chosen-shimmer 2.4s ease-in-out infinite; }
.unit--chosen .unit-name, .unit--chosen .unit-hp { opacity: 0; }
.unit--chosen:hover, .unit--chosen:focus-visible { opacity: .35; }
.unit--runner { border-color: #e9e4ff; background: radial-gradient(circle at 40% 35%, #fff, #8d86b0 70%); transition: left .5s ease, top .5s ease, transform .12s; }
.unit.is-hit { animation: unit-hit .18s ease; }
.unit.is-gone { opacity: 0; transform: translate(-50%, -50%) scale(.4); pointer-events: none; }
@keyframes unit-in { from { opacity: 0; transform: translate(-50%, -50%) scale(.3); } }
@keyframes unit-bob { 50% { margin-top: -4px; } }
@keyframes unit-hit { 50% { filter: brightness(2.2); } }
@keyframes shield-spin { to { transform: rotate(360deg); } }
@keyframes pickup-glow { 50% { box-shadow: 0 0 28px #fff; } }
@keyframes chosen-shimmer { 50% { opacity: .18; } }

/* la course d'obstacles */
.course { display: grid; justify-items: center; gap: 14px; padding: 20px; }
.course-scene { position: relative; width: 240px; height: 240px; }
.course-ring { position: absolute; inset: 20px; border-radius: 50%; transform: rotate(var(--r, 0deg));
  background: conic-gradient(from -24deg, transparent 0 48deg, #cfd8ff 48deg 360deg); -webkit-mask: radial-gradient(circle, transparent 54%, #000 56%); mask: radial-gradient(circle, transparent 54%, #000 56%); }
.course-ring.is-ok { background: conic-gradient(from -24deg, transparent 0 48deg, #8fe07a 48deg 360deg); }
.course-ring.is-ko { background: conic-gradient(from -24deg, transparent 0 48deg, #ff8a6a 48deg 360deg); }
.course-aim { position: absolute; left: 50%; top: -4px; width: 0; height: 0; margin-left: -10px; border: 10px solid transparent; border-top: 16px solid var(--gold); }
.course-cannon { position: absolute; left: 50%; top: 50%; width: 40px; height: 40px; margin: -20px 0 0 -20px; border-radius: 50%; background: radial-gradient(circle at 40% 35%, #fff6d8, #c99a3a 60%, #5a3a08); box-shadow: 0 0 20px rgba(255, 207, 92, .5); }
.course-tip { margin: 0; font-size: .82rem; color: var(--muted); }
.course-actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; }

/* les plaques */
.plates { display: grid; justify-items: center; gap: 16px; padding: 20px; width: 100%; }
.plates-clock { margin: 0; font-size: 2rem; font-weight: 900; font-variant-numeric: tabular-nums; color: var(--gold); text-shadow: 0 0 16px rgba(255, 207, 92, .5); }
.plates-row { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; width: min(100%, 560px); }
.plate { display: grid; justify-items: center; gap: 4px; padding: 26px 10px; border: 2px solid color-mix(in srgb, var(--rc) 60%, transparent); border-radius: 50% / 34%; background: radial-gradient(ellipse at 50% 40%, color-mix(in srgb, var(--rc) 22%, transparent), rgba(0, 0, 0, .3)); color: var(--pearl); font: inherit; cursor: pointer; transition: transform .2s, box-shadow .2s; }
.plate b { font-size: 1rem; font-weight: 900; letter-spacing: .1em; text-transform: uppercase; color: var(--rc); }
.plate small { font-size: .62rem; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); }
.plate:hover:not(:disabled) { transform: translateY(-3px); }
.plate[aria-pressed="true"] { box-shadow: 0 0 0 3px var(--rc), 0 0 24px var(--rc); }
.plate.is-open { box-shadow: 0 0 0 3px #fff, 0 0 36px var(--rc); }
.plate:disabled:not(.is-open) { opacity: .35; }

/* le bilan */
.show-results { display: grid; justify-items: center; gap: 14px; padding: 24px; text-align: center; }
.results-title { margin: 0; font-size: 1.3rem; font-weight: 900; letter-spacing: .06em; text-transform: uppercase; color: var(--gold); }
.results-list { display: flex; flex-wrap: wrap; justify-content: center; gap: 12px; margin: 0; padding: 0; list-style: none; }
.results-list li { display: flex; align-items: center; gap: 10px; padding: 8px 14px; border: 1px solid rgba(255, 207, 92, .4); background: rgba(40, 28, 6, .5); }
.results-list b { font-size: 1.1rem; color: var(--gold-hi); }
.results-note { max-width: 520px; margin: 0; font-size: .86rem; color: var(--muted); }
.results-actions { display: flex; gap: 10px; }

/* ---------- La salle au trésor ---------- */
.hoard-game { border-color: rgba(255, 207, 92, .35); }
.hoard-chests { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; margin: 16px 24px 0; padding: 26px 20px; border: 1px solid var(--line); background: radial-gradient(ellipse 80% 70% at 50% 100%, rgba(255, 207, 92, .16), transparent 70%), #0b0906; }
.chest { position: relative; display: grid; justify-items: center; align-content: end; min-height: 220px; padding: 0 0 10px; border: 0; background: none; color: var(--pearl); font: inherit; cursor: pointer; }
.chest-body { position: relative; width: 120px; height: 64px; border: 2px solid #5a3a08; border-radius: 4px 4px 8px 8px; background: linear-gradient(180deg, #b5832c, #7a5212); box-shadow: inset 0 0 0 6px rgba(255, 207, 92, .25), 0 10px 20px rgba(0, 0, 0, .5); }
.chest-body::after { content: ''; position: absolute; left: 50%; top: 8px; width: 16px; height: 20px; margin-left: -8px; border-radius: 3px; background: #ffcf5c; box-shadow: 0 0 8px rgba(255, 207, 92, .8); }
.chest-lid { position: relative; z-index: 1; width: 124px; height: 34px; margin-bottom: -2px; border: 2px solid #5a3a08; border-radius: 40px 40px 4px 4px; background: linear-gradient(180deg, #d6a242, #94661a); transform-origin: 50% 100%; transition: transform .5s cubic-bezier(.3, 1.6, .5, 1); }
.chest:hover:not(:disabled) .chest-lid, .chest:focus-visible .chest-lid { transform: translateY(-4px) rotate(-3deg); }
.chest:focus-visible { outline: 2px solid var(--gold); outline-offset: 4px; }
.chest.is-open .chest-lid { opacity: 0; transform: translateY(-30px) rotate(-12deg); transition: transform .5s, opacity .4s .1s; }
.chest.is-open .chest-body { box-shadow: inset 0 0 0 6px rgba(255, 207, 92, .25), 0 -18px 40px rgba(255, 207, 92, .45), 0 10px 20px rgba(0, 0, 0, .5); }
.chest-prize { position: absolute; left: 0; right: 0; top: 0; display: grid; justify-items: center; gap: 2px; opacity: 0; transform: translateY(20px); transition: opacity .4s .2s, transform .5s .2s; pointer-events: none; }
.chest.is-open .chest-prize { opacity: 1; transform: none; }
.chest-prize img { border: 1px solid rgba(255, 255, 255, .4); box-shadow: 0 0 16px rgba(255, 207, 92, .5); }
.chest-prize b { max-width: 160px; font-size: .78rem; font-weight: 800; line-height: 1.2; text-transform: uppercase; color: var(--gold-hi); }
.chest-prize small { font-size: .6rem; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.chest.is-rare .chest-prize img { box-shadow: 0 0 22px #ffcf5c, 0 0 40px rgba(255, 140, 220, .6); }
.chest.is-shake { animation: chest-shake .4s ease; }
.chest:disabled { cursor: default; }
@keyframes chest-shake { 25% { transform: translateX(-5px); } 50% { transform: translateX(5px); } 75% { transform: translateX(-3px); } }
.hoard-collection { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 8px; margin: 0; padding: 0 24px 18px; list-style: none; }
.hoard-slot { display: grid; justify-items: center; gap: 4px; padding: 8px 4px; border: 1px dashed var(--line); text-align: center; }
.hoard-slot img { opacity: .15; filter: grayscale(1); }
.hoard-slot span { font-size: .58rem; font-weight: 700; line-height: 1.2; text-transform: uppercase; color: var(--faint); }
.hoard-slot.is-owned { border-style: solid; border-color: rgba(255, 207, 92, .4); }
.hoard-slot.is-owned img { opacity: 1; filter: none; }
.hoard-slot.is-owned span { color: var(--pearl); }
.hoard-slot.is-owned.is-rare { border-color: var(--gold); box-shadow: 0 0 14px rgba(255, 207, 92, .3); }

/* ---------- Où est Xûr ? ---------- */
.whereis-game { border-color: rgba(159, 231, 200, .3); }
.whereis-q { display: flex; align-items: center; gap: 14px; margin: 14px 24px 0; padding: 12px 14px; border: 1px solid rgba(159, 231, 200, .3); background: rgba(10, 24, 20, .55); }
.whereis-q img { flex: none; border: 1px solid rgba(255, 255, 255, .3); }
.whereis-q p { margin: 0; font-family: var(--font-lore); font-style: italic; font-size: 1.15rem; line-height: 1.4; color: var(--xur-hi); }
.whereis-places { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 10px; margin: 14px 24px 0; padding: 0; list-style: none; }
.place-card { display: flex; flex-direction: column; border: 1px solid var(--line); background: rgba(255, 255, 255, .02); transition: border-color .3s, box-shadow .3s; }
.place-photo { position: relative; margin: 0; aspect-ratio: 4 / 3; overflow: hidden; }
.place-photo > a { position: absolute; inset: 0; display: block; }
.place-photo img { width: 100%; height: 100%; object-fit: cover; }
.place-pick { display: grid; gap: 2px; justify-content: stretch; width: 100%; padding: 10px 8px; border-width: 0; border-top: 1px solid var(--line); font-size: .66rem; text-align: center; }
.place-pick small { font-size: .58rem; font-weight: 600; letter-spacing: .08em; color: var(--muted); }
.place-card.is-right { border-color: var(--xur); box-shadow: 0 0 20px rgba(159, 231, 200, .35); }
.place-card.is-wrong { border-color: #ff8a6a; }
.place-card.is-right .place-pick:disabled, .place-card.is-wrong .place-pick:disabled { opacity: 1; }

@media (max-width: 1020px) {
  .show-steps { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .whereis-places { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .hoard-collection { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}
@media (max-width: 680px) {
  .show-steps, .show-host, .show-stage, .hoard-chests, .whereis-q, .whereis-places { margin-left: 12px; margin-right: 12px; }
  .show-steps { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .show-host img { display: none; }
  .arena { aspect-ratio: 3 / 4; }
  .unit { width: 46px; height: 46px; }
  .unit.is-big { width: 62px; height: 62px; }
  .unit--boss { width: 86px; height: 86px; }
  .wheel-frame { width: 210px; height: 210px; }
  .wheel-seg { transform: rotate(var(--a)) translateY(-68px); }
  .hoard-chests { grid-template-columns: minmax(0, 1fr); padding: 16px 10px; }
  .hoard-collection { grid-template-columns: repeat(3, minmax(0, 1fr)); padding: 0 12px 16px; }
  .whereis-places { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .plates-row { gap: 8px; }
  .plate { padding: 18px 6px; }
}
@media (prefers-reduced-motion: reduce) {
  .unit, .unit--pickup, .unit--chosen, .unit.is-shielded::after, .chest.is-shake, .show-line.is-new { animation: none; }
  .wheel-disc.is-spinning { transition: none; }
}
