/* Évolution ? — interface */

:root {
  --ui-font: system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --chalk-font: 'Segoe Print', 'Chalkboard SE', 'Bradley Hand', 'Comic Sans MS', cursive;
  --panel: rgba(18, 16, 24, 0.92);
  --panel-line: rgba(255, 255, 255, 0.12);
  --text: #f2eff7;
  --muted: #a9a3b6;
  --slot: 64px;
  --safe-b: env(safe-area-inset-bottom, 0px);
  --safe-r: env(safe-area-inset-right, 0px);
  --safe-l: env(safe-area-inset-left, 0px);
  --safe-t: env(safe-area-inset-top, 0px);

  --r-mediocre: #8a5a32;
  --r-ordinaire: #9aa4ad;
  --r-bon: #4fc46a;
  --r-rare: #4f8dff;
  --r-epique: #b264ff;
  --r-legendaire: #ffc531;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  height: 100%;
  overflow: hidden;
  background: #000;
  color: var(--text);
  font-family: var(--ui-font);
  -webkit-font-smoothing: antialiased;
  user-select: none;
  -webkit-user-select: none;
  -webkit-tap-highlight-color: transparent;
  overscroll-behavior: none;
}

button {
  font: inherit;
  color: inherit;
}

[hidden] {
  display: none !important;
}

#world,
.chalk {
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100vh;
  height: 100dvh;
  display: block;
  touch-action: none;
}

.chalk {
  pointer-events: none;
  z-index: 55;
}

.chalk-buttons {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 56;
}

.chalk-hit {
  position: absolute;
  pointer-events: auto;
  background: transparent;
  border: 0;
  border-radius: 18px;
  color: transparent;
  cursor: pointer;
  transition: box-shadow 0.25s, background 0.25s;
}

.chalk-hit:hover,
.chalk-hit:focus-visible {
  outline: none;
  background: rgba(255, 255, 255, 0.05);
  box-shadow: 0 0 22px rgba(255, 255, 255, 0.18);
}

.fade {
  position: fixed;
  inset: 0;
  pointer-events: none;
  opacity: 0;
  background: #000;
  z-index: 50;
}

/* ───────── Sous-titres du personnage mystérieux ───────── */
.subtitle {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  min-height: clamp(130px, 22vh, 190px);
  padding: 18px 16px calc(18px + var(--safe-b));
  background: linear-gradient(to bottom, rgba(0, 0, 0, 0.78), rgba(0, 0, 0, 0.92));
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  opacity: 0;
  transition: opacity 0.7s ease;
  z-index: 20;
  display: grid;
  place-items: center;
}

.subtitle.on {
  opacity: 1;
}

/* Au hub, le personnage mystérieux parle au-dessus de la barre de compétences. */
.subtitle.raised {
  left: 50%;
  right: auto;
  translate: -50% 0;
  width: min(720px, calc(100vw - 24px));
  bottom: calc(var(--slot) + 96px + var(--safe-b));
  min-height: 92px;
  padding: 10px 16px;
  border-radius: 18px;
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.subtitle-content {
  width: 100%;
  display: grid;
  place-items: center;
}

/* ───────── Tuiles de compétence et raretés ───────── */
.skill {
  --c: var(--r-ordinaire);
  position: relative;
  display: grid;
  place-items: center;
  width: var(--slot);
  height: var(--slot);
  border-radius: 14px;
  border: 3px solid var(--c);
  background: #2a2e33;
  color: #fff;
}

.skill .icon {
  width: 46%;
  height: 46%;
  filter: drop-shadow(0 1px 1px rgba(0, 0, 0, 0.6));
}

.r-mediocre {
  --c: var(--r-mediocre);
}
.r-ordinaire {
  --c: var(--r-ordinaire);
}
.r-bon {
  --c: var(--r-bon);
}
.r-rare {
  --c: var(--r-rare);
}
.r-epique {
  --c: var(--r-epique);
}
.r-legendaire {
  --c: var(--r-legendaire);
}

/* Médiocre : contour de terre, grumeleux. */
.skill.r-mediocre,
.slot.r-mediocre {
  border-color: #7a5230;
  border-style: solid;
  background:
    radial-gradient(circle at 20% 30%, rgba(122, 82, 48, 0.55) 0 2px, transparent 3px) 0 0 / 11px 9px,
    radial-gradient(circle at 70% 60%, rgba(70, 45, 25, 0.6) 0 1.5px, transparent 2.5px) 0 0 / 7px 8px,
    #2c2119;
  box-shadow: inset 0 0 0 2px #4a3220, inset 0 -6px 10px rgba(0, 0, 0, 0.35);
}
.skill.r-ordinaire,
.slot.r-ordinaire {
  background: linear-gradient(160deg, #3a3f46, #23262b);
  box-shadow: inset 0 0 0 2px #5e666e;
}
.skill.r-bon,
.slot.r-bon {
  background: linear-gradient(160deg, #1f4a2b, #11251a);
  box-shadow: inset 0 0 0 2px #2c7a40, 0 0 10px rgba(79, 196, 106, 0.25);
}
.skill.r-rare,
.slot.r-rare {
  background: linear-gradient(160deg, #1c3666, #0f1c36);
  box-shadow: inset 0 0 0 2px #2c5bb8, 0 0 0 2px rgba(79, 141, 255, 0.35), 0 0 14px rgba(79, 141, 255, 0.35);
}
.skill.r-epique,
.slot.r-epique {
  background: radial-gradient(circle at 30% 25%, #4a2a72, #1d0f30);
  box-shadow: inset 0 0 0 2px #7a3fc0, 0 0 0 3px rgba(178, 100, 255, 0.35), 0 0 18px rgba(178, 100, 255, 0.45);
}
.skill.r-legendaire,
.slot.r-legendaire {
  border-color: transparent;
  background:
    radial-gradient(circle at 30% 25%, #6a5014, #2b1f06) padding-box,
    conic-gradient(from var(--spin, 0deg), #ffc531, #fff3b0, #ff9d00, #ffe27a, #ffc531) border-box;
  box-shadow: 0 0 22px rgba(255, 197, 49, 0.55);
  animation: spin-border 3s linear infinite;
}

@property --spin {
  syntax: '<angle>';
  inherits: false;
  initial-value: 0deg;
}

@keyframes spin-border {
  to {
    --spin: 360deg;
  }
}

.skill .zone {
  position: absolute;
  font-size: 13px;
  font-weight: 800;
  opacity: 0.55;
  line-height: 1;
  pointer-events: none;
}
.skill .zl {
  left: 4px;
  top: 50%;
  translate: 0 -50%;
}
.skill .zr {
  right: 4px;
  top: 50%;
  translate: 0 -50%;
}
.skill .z0 {
  top: 2px;
  left: 50%;
  translate: -50% 0;
}
.skill .z1 {
  right: 4px;
  top: 50%;
  translate: 0 -50%;
}
.skill .z2 {
  bottom: 2px;
  left: 50%;
  translate: -50% 0;
}
.skill .z3 {
  left: 4px;
  top: 50%;
  translate: 0 -50%;
}
.skill.ctl-lr::after,
.slot.ctl-lr .slot-face::after {
  content: '';
  position: absolute;
  top: 18%;
  bottom: 18%;
  left: 50%;
  width: 1px;
  background: rgba(255, 255, 255, 0.18);
  pointer-events: none;
}

/* ───────── Barre de compétences ───────── */
.bar-wrap {
  position: fixed;
  left: 50%;
  bottom: calc(12px + var(--safe-b));
  translate: -50% 0;
  z-index: 12;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 10px;
  pointer-events: none;
}

.skillbar {
  display: flex;
  gap: 10px;
  padding: 8px;
  border-radius: 20px;
  background: rgba(10, 8, 14, 0.55);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  pointer-events: auto;
  animation: rise 0.5s ease both;
}

@keyframes rise {
  from {
    opacity: 0;
    translate: 0 20px;
  }
}

.slot {
  --c: var(--r-ordinaire);
  position: relative;
  width: var(--slot);
  height: var(--slot);
  padding: 0;
  border-radius: 14px;
  border: 3px solid var(--c);
  background: #22252a;
  cursor: pointer;
  touch-action: none;
  overflow: hidden;
  transition: transform 0.1s ease, filter 0.2s;
}

.slot:active {
  transform: scale(0.94);
}

.slot:focus-visible {
  outline: 2px solid #fff;
  outline-offset: 2px;
}

.slot.empty {
  border: 2px dashed rgba(255, 255, 255, 0.25);
  background: rgba(255, 255, 255, 0.04);
  box-shadow: none;
  cursor: default;
}

.slot-face {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
}

.slot-face .icon {
  width: 44%;
  height: 44%;
  filter: drop-shadow(0 1px 1px rgba(0, 0, 0, 0.6));
}

.slot .zone {
  position: absolute;
  font-size: 14px;
  font-weight: 800;
  opacity: 0.5;
}
.slot .zl,
.slot .z3 {
  left: 4px;
  top: 50%;
  translate: 0 -50%;
}
.slot .zr,
.slot .z1 {
  right: 4px;
  top: 50%;
  translate: 0 -50%;
}
.slot .z0 {
  top: 1px;
  left: 50%;
  translate: -50% 0;
}
.slot .z2 {
  bottom: 1px;
  left: 50%;
  translate: -50% 0;
}

.slot .cd {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: conic-gradient(rgba(0, 0, 0, 0.68) calc(var(--cd, 0) * 360deg), transparent 0);
}

.slot.spent .slot-face {
  filter: grayscale(1) brightness(0.45);
}

.slot.active {
  box-shadow: 0 0 0 2px #fff, 0 0 16px rgba(255, 255, 255, 0.5);
}

.slot .badge {
  position: absolute;
  top: 3px;
  right: 5px;
  font-size: 12px;
  font-weight: 800;
  text-shadow: 0 1px 2px #000;
  pointer-events: none;
}

.slot kbd {
  position: absolute;
  left: 5px;
  bottom: 3px;
  font: 700 10px var(--ui-font);
  opacity: 0.55;
  pointer-events: none;
}

.slot .pips {
  position: absolute;
  bottom: 4px;
  right: 5px;
  display: flex;
  gap: 3px;
  pointer-events: none;
}

.pips i,
.res-chip i {
  display: block;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.25);
}
.pips i.on {
  background: #fff;
}
.pips i.res-seve.on {
  background: #5fd16b;
}
.pips i.res-braise.on {
  background: #ff8a3d;
}
.pips i.res-ether.on {
  background: #6fe3ff;
}

.slot.shake {
  animation: shake 0.35s ease;
}

.slot.used {
  animation: pop 0.25s ease;
}

@keyframes shake {
  20%,
  60% {
    translate: -4px 0;
  }
  40%,
  80% {
    translate: 4px 0;
  }
}

@keyframes pop {
  50% {
    transform: scale(1.12);
    filter: brightness(1.6);
  }
}

/* ───────── Boutons flottants ───────── */
.fab {
  position: relative;
  width: 52px;
  height: 52px;
  border-radius: 16px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  background: rgba(20, 18, 26, 0.82);
  color: #fff;
  display: grid;
  place-items: center;
  cursor: pointer;
  pointer-events: auto;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.25);
  transition: transform 0.15s ease, background 0.2s;
}

.fab:hover {
  background: rgba(40, 34, 52, 0.92);
}

.fab:active {
  transform: scale(0.94);
}

.fab .count {
  position: absolute;
  top: -6px;
  right: -6px;
  min-width: 20px;
  height: 20px;
  padding: 0 5px;
  border-radius: 10px;
  background: #ff4fd8;
  font: 800 12px/20px var(--ui-font);
}

.fab.reset {
  position: fixed;
  right: calc(14px + var(--safe-r));
  bottom: calc(14px + var(--safe-b));
  z-index: 12;
}

.beckon {
  animation: beckon 1.2s ease-in-out infinite;
}

@keyframes beckon {
  50% {
    box-shadow: 0 0 0 6px rgba(255, 255, 255, 0.25), 0 0 30px rgba(255, 255, 255, 0.6);
    transform: translateY(-3px);
  }
}

/* ───────── Haut d'écran ───────── */
.hud {
  position: fixed;
  top: calc(10px + var(--safe-t));
  left: calc(12px + var(--safe-l));
  right: calc(12px + var(--safe-r));
  z-index: 11;
  display: flex;
  align-items: flex-start;
  gap: 12px;
  pointer-events: none;
}

.hud-info {
  padding: 8px 14px;
  border-radius: 14px;
  background: rgba(14, 12, 20, 0.62);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}

.hud[data-mode='hub'] .hud-info {
  background: rgba(255, 255, 255, 0.72);
  color: #1d1d22;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.08);
}

.hud-title {
  font-weight: 750;
  font-size: 15px;
}

.hud-sub {
  font-size: 12.5px;
  opacity: 0.8;
  margin-top: 2px;
}

.hud-sub .diff {
  font-weight: 800;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.5);
}

.hud-timer {
  position: absolute;
  left: 50%;
  translate: -50% 0;
  padding: 6px 16px;
  border-radius: 14px;
  background: rgba(14, 12, 20, 0.62);
  font: 800 22px/1.2 var(--ui-font);
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.02em;
}

.hud-timer.urgent {
  color: #ff6b8b;
  animation: throb 1s ease-in-out infinite;
}

@keyframes throb {
  50% {
    transform: scale(1.08);
  }
}

.hud-res {
  display: flex;
  gap: 6px;
  margin-top: 6px;
}

.res-chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 8px;
  border-radius: 10px;
  background: rgba(14, 12, 20, 0.62);
  font-size: 12px;
  font-weight: 700;
}

.res-chip i {
  background: var(--c);
  box-shadow: 0 0 6px var(--c);
}

.res-chip.frag i {
  background: #fff;
  border-radius: 2px;
  rotate: 45deg;
}

.hud-buttons {
  margin-left: auto;
  display: flex;
  gap: 8px;
  pointer-events: auto;
}

.round {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.18);
  background: rgba(14, 12, 20, 0.62);
  color: #fff;
  display: grid;
  place-items: center;
  cursor: pointer;
}

.round .icon {
  width: 20px;
  height: 20px;
}

.hud[data-mode='hub'] .round {
  background: rgba(255, 255, 255, 0.8);
  color: #1d1d22;
  border-color: rgba(0, 0, 0, 0.1);
}

/* ───────── Bulles ───────── */
.toasts {
  position: fixed;
  top: calc(70px + var(--safe-t));
  left: 50%;
  translate: -50% 0;
  z-index: 30;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  pointer-events: none;
}

.toast {
  max-width: min(86vw, 460px);
  padding: 8px 16px;
  border-radius: 12px;
  background: rgba(14, 12, 20, 0.86);
  border: 1px solid rgba(255, 255, 255, 0.12);
  font-size: 14px;
  text-align: center;
  opacity: 0;
  translate: 0 -8px;
  transition: opacity 0.3s, translate 0.3s;
}

.toast.on {
  opacity: 1;
  translate: 0 0;
}

.toast[class*='r-'] {
  border-color: var(--c);
  box-shadow: 0 0 16px color-mix(in srgb, var(--c) 40%, transparent);
}

.banner {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 80;
  padding: 10px;
  text-align: center;
  background: #2a1640;
  font-weight: 600;
}

/* ───────── Choix de compétences (intro, orbes) ───────── */
.intro-choices,
.orb-choices {
  display: flex;
  justify-content: center;
  gap: clamp(12px, 4vw, 28px);
  flex-wrap: wrap;
}

.choice {
  --i: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  width: min(220px, 28vw);
  min-width: 140px;
  padding: 14px 12px 12px;
  border-radius: 18px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(255, 255, 255, 0.04);
  cursor: pointer;
  text-align: center;
  animation: blow-in 0.7s cubic-bezier(0.2, 0.8, 0.2, 1) both;
  animation-delay: calc(var(--i) * 0.14s);
  transition: transform 0.2s, background 0.2s, opacity 0.4s, filter 0.4s;
}

.choice:hover,
.choice:focus-visible {
  transform: translateY(-4px);
  background: rgba(255, 255, 255, 0.08);
  outline: none;
}

.choice.small {
  width: 150px;
  min-width: 120px;
  padding: 10px;
}

.choice .skill.big {
  --slot: 78px;
}

.choice strong {
  font-size: 15px;
}

.choice p {
  margin: 0;
  font-size: 13px;
  color: var(--muted);
  line-height: 1.35;
}

.choice small {
  font-size: 11.5px;
  color: var(--muted);
}

.choice.chosen {
  transform: scale(1.06);
  box-shadow: 0 0 30px color-mix(in srgb, var(--c) 60%, transparent);
}

.choice.discarded {
  opacity: 0;
  filter: blur(6px);
  transform: translateX(60px);
}

@keyframes blow-in {
  from {
    opacity: 0;
    transform: translateX(-80px) rotate(-4deg);
    filter: blur(8px);
  }
}

.rarity-tag {
  display: inline-block;
  padding: 2px 9px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  color: #111;
  background: var(--c);
}

/* ───────── Inventaire ───────── */
.modal {
  position: fixed;
  inset: 0;
  z-index: 60;
  display: grid;
  place-items: center;
  padding: 16px;
  background: rgba(10, 8, 16, 0.55);
  backdrop-filter: blur(3px);
  -webkit-backdrop-filter: blur(3px);
}

.panel {
  position: relative;
  width: min(980px, 100%);
  max-height: min(88vh, 820px);
  overflow: auto;
  display: grid;
  grid-template-columns: 1fr 260px;
  grid-template-areas:
    'head head'
    'eq orbs'
    'all detail';
  gap: 14px 18px;
  padding: 18px 20px 20px;
  border-radius: 22px;
  background: var(--panel);
  border: 1px solid var(--panel-line);
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.45);
  animation: rise 0.25s ease both;
}

.panel header {
  grid-area: head;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.panel h2 {
  margin: 0;
  font-family: var(--chalk-font);
  font-weight: 400;
  font-size: 26px;
}

.panel h3 {
  margin: 0 0 8px;
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
}

.panel h3 small {
  text-transform: none;
  letter-spacing: 0;
  font-weight: 400;
  margin-left: 6px;
}

.inv-equipped {
  grid-area: eq;
}

.inv-orbs-wrap {
  grid-area: orbs;
}

.inv-all {
  grid-area: all;
}

.inv-detail {
  grid-area: detail;
  align-self: start;
  position: sticky;
  top: 0;
  padding: 12px 14px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.04);
  min-height: 120px;
}

.inv-detail h4 {
  margin: 0 0 6px;
  font-size: 17px;
}

.inv-detail p {
  margin: 8px 0 0;
  font-size: 13.5px;
  line-height: 1.4;
}

.inv-detail .limits,
.inv-detail .hint {
  color: var(--muted);
  font-size: 12.5px;
}

.inv-slots {
  display: flex;
  gap: 12px;
}

.inv-slot {
  position: relative;
  width: 76px;
  height: 76px;
  border-radius: 16px;
  border: 2px dashed rgba(255, 255, 255, 0.22);
  display: grid;
  place-items: center;
  transition: border-color 0.2s, background 0.2s;
}

.inv-slot.filled {
  border-style: solid;
  border-color: transparent;
}

.inv-slot.over {
  border-color: #fff;
  background: rgba(255, 255, 255, 0.08);
}

.inv-slot kbd {
  position: absolute;
  bottom: -18px;
  font: 700 11px var(--ui-font);
  color: var(--muted);
}

.inv-slot .skill {
  --slot: 70px;
  cursor: grab;
}

.inv-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(92px, 1fr));
  gap: 12px;
  margin-top: 4px;
}

.skill.card {
  --slot: 92px;
  width: 100%;
  aspect-ratio: 1;
  height: auto;
  padding-bottom: 16px;
  cursor: grab;
  touch-action: none;
}

.skill.card .icon {
  width: 38%;
  height: 38%;
}

.skill.card .card-name {
  position: absolute;
  left: 4px;
  right: 4px;
  bottom: 6px;
  font-size: 11px;
  font-weight: 650;
  text-align: center;
  line-height: 1.1;
  text-shadow: 0 1px 2px #000;
}

.skill .badge {
  position: absolute;
  top: 3px;
  right: 6px;
  font-size: 10.5px;
  font-weight: 800;
  opacity: 0.85;
}

.skill.equipped::before {
  content: '';
  position: absolute;
  top: 6px;
  left: 6px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #7dff9a;
  box-shadow: 0 0 6px #7dff9a;
}

.skill.selected {
  outline: 2px solid #fff;
  outline-offset: 3px;
}

.skill:focus-visible {
  outline: 2px solid #fff;
  outline-offset: 3px;
}

.drag-ghost {
  position: fixed;
  left: 0;
  top: 0;
  --slot: 64px;
  width: 64px !important;
  height: 64px !important;
  z-index: 100;
  pointer-events: none;
  opacity: 0.92;
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.5);
}

.drag-ghost .card-name {
  display: none;
}

.inv-orbs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.orb-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  padding: 6px 8px;
  border-radius: 14px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(255, 255, 255, 0.04);
  cursor: pointer;
  font-size: 11px;
  color: var(--muted);
  transition: transform 0.15s;
}

.orb-btn:hover {
  transform: translateY(-3px) scale(1.04);
}

.orb-btn svg {
  animation: orb-float 2.4s ease-in-out infinite;
}

@keyframes orb-float {
  50% {
    translate: 0 -3px;
  }
}

.inv-meta {
  margin-top: 10px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 12.5px;
  color: var(--muted);
}

.inv-meta b {
  color: var(--text);
  margin-right: 6px;
  font-weight: 650;
}

.frag-chip {
  display: inline-block;
  margin-right: 6px;
  padding: 1px 7px;
  border-radius: 8px;
  border: 1px solid var(--c);
  color: var(--text);
}

.empty-note {
  color: var(--muted);
  font-size: 13px;
  margin: 4px 0;
}

/* ───────── Ouverture d'orbe ───────── */
.orb-modal {
  position: fixed;
  inset: 0;
  z-index: 62;
  display: grid;
  place-items: center;
  background: radial-gradient(circle at 50% 40%, rgba(40, 20, 60, 0.75), rgba(5, 3, 10, 0.94));
}

.orb-stage {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  padding: 16px;
  max-width: 100%;
}

.orb-big {
  height: 160px;
  transition: transform 0.4s, opacity 0.4s;
}

.orb-big.shaking {
  animation: orb-shake 0.65s ease-in-out;
}

.orb-big.burst {
  animation: orb-burst 0.6s ease forwards;
}

@keyframes orb-shake {
  20% {
    transform: rotate(-8deg) scale(1.05);
  }
  40% {
    transform: rotate(8deg) scale(1.1);
  }
  60% {
    transform: rotate(-10deg) scale(1.15);
  }
  80% {
    transform: rotate(10deg) scale(1.2);
  }
}

@keyframes orb-burst {
  to {
    transform: scale(2.2);
    opacity: 0;
    filter: blur(6px) brightness(2);
    height: 0;
  }
}

.orb-title {
  margin: 0;
  font-family: var(--chalk-font);
  font-weight: 400;
  font-size: clamp(22px, 4vw, 32px);
}

.orb-hint {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
}

/* ───────── Écrans étroits ───────── */
@media (max-width: 760px) {
  :root {
    --slot: 56px;
  }

  .panel {
    grid-template-columns: 1fr;
    grid-template-areas: 'head' 'eq' 'orbs' 'detail' 'all';
    padding: 14px;
  }

  .inv-detail {
    position: static;
    min-height: 0;
  }

  .inv-slot {
    width: 64px;
    height: 64px;
  }

  .inv-slot .skill {
    --slot: 58px;
  }

  .hud-timer {
    top: 56px;
    font-size: 18px;
  }

  .hud-info {
    max-width: 58vw;
  }

  .choice {
    width: 44vw;
    min-width: 0;
  }
}

@media (max-width: 420px) {
  :root {
    --slot: 52px;
  }

  .skillbar {
    gap: 7px;
    padding: 6px;
  }

  .fab {
    width: 46px;
    height: 46px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .skill.r-legendaire,
  .slot.r-legendaire,
  .beckon,
  .hud-timer.urgent {
    animation: none;
  }
}
