/* ==========================================================================
   Roulette Hextech — charte inspirée de League of Legends
   ========================================================================== */

:root {
  /* Or hextech */
  --gold-1: #F0E6D2;
  --gold-2: #C8AA6E;
  --gold-3: #C89B3C;
  --gold-4: #785A28;
  --gold-5: #463714;
  --gold-6: #32281E;
  /* Bleus hextech */
  --blue-1: #CDFAFA;
  --blue-2: #0AC8B9;
  --blue-3: #0397AB;
  --blue-4: #005A82;
  --blue-5: #0A323C;
  --blue-6: #091428;
  --blue-7: #0A1428;
  /* Gris */
  --grey-1: #A09B8C;
  --grey-2: #5B5A56;
  --grey-3: #3C3C41;
  --grey-4: #1E2328;
  --black: #010A13;
  /* États */
  --win: #0AC8B9;
  --loss: #E84057;

  --font-display: 'Cinzel', 'Trajan Pro', 'Times New Roman', serif;
  --font-body: 'Barlow', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --ease-out: cubic-bezier(.16, 1, .3, 1);
  --ease-back: cubic-bezier(.34, 1.56, .64, 1);

  --safe-t: env(safe-area-inset-top, 0px);
  --safe-b: env(safe-area-inset-bottom, 0px);
  --safe-l: env(safe-area-inset-left, 0px);
  --safe-r: env(safe-area-inset-right, 0px);
}

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

[hidden] { display: none !important; }

html {
  -webkit-text-size-adjust: 100%;
  background: var(--black);
}

body {
  margin: 0;
  min-height: 100vh;
  min-height: 100svh;
  font-family: var(--font-body);
  color: var(--gold-1);
  background: var(--black);
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
}

body.has-modal { overflow: hidden; }

button { font: inherit; }
img { max-width: 100%; }

.sr-only {
  position: absolute;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

:focus-visible {
  outline: 2px solid var(--blue-2);
  outline-offset: 3px;
}

.icon { width: 20px; height: 20px; display: block; flex: none; }

/* ==========================================================================
   Fond
   ========================================================================== */
.backdrop {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background:
    radial-gradient(120% 70% at 50% -15%, rgba(0, 90, 130, .45) 0%, rgba(10, 50, 60, .25) 35%, transparent 65%),
    radial-gradient(80% 50% at 50% 115%, rgba(120, 90, 40, .28) 0%, transparent 70%),
    linear-gradient(180deg, #091428 0%, #010A13 55%, #010A13 100%);
}

.backdrop::before {
  content: '';
  position: absolute;
  inset: 0;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='28' height='49' viewBox='0 0 28 49'%3E%3Cpath fill='%23C8AA6E' fill-rule='evenodd' d='M13.99 9.25l13 7.5v15l-13 7.5L1 31.75v-15l12.99-7.5zM3 17.9v12.7l10.99 6.34 11-6.35V17.9l-11-6.34L3 17.9zM0 15l12.98-7.5V0h-2v6.35L0 12.69v2.3zm0 18.5L12.98 41v8h-2v-6.85L0 35.81v-2.3zM15 0v7.5L27.99 15H28v-2.31h-.01L17 6.35V0h-2zm0 49v-8l12.99-7.5H28v2.31h-.01L17 42.15V49h-2z'/%3E%3C/svg%3E");
  background-size: 42px 73.5px;
  opacity: .06;
  -webkit-mask-image: radial-gradient(ellipse at 50% 40%, #000 10%, transparent 75%);
  mask-image: radial-gradient(ellipse at 50% 40%, #000 10%, transparent 75%);
}

.backdrop::after {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse at center, transparent 45%, rgba(0, 0, 0, .65) 100%);
}

.ambient {
  position: fixed;
  inset: 0;
  z-index: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

/* ==========================================================================
   Mise en page
   ========================================================================== */
.app {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 560px;
  min-height: 100vh;
  min-height: 100svh;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding:
    calc(var(--safe-t) + 12px)
    calc(var(--safe-r) + 16px)
    calc(var(--safe-b) + 16px)
    calc(var(--safe-l) + 16px);
}

.panel {
  position: relative;
  background: linear-gradient(180deg, rgba(10, 20, 40, .82), rgba(1, 10, 19, .88));
  border: 1px solid var(--gold-5);
  box-shadow: inset 0 0 0 1px rgba(1, 10, 19, .9), 0 14px 30px -14px rgba(0, 0, 0, .9);
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
}

.panel::before {
  content: '';
  position: absolute;
  inset: -1px;
  pointer-events: none;
  border: 1px solid transparent;
  background: linear-gradient(180deg, var(--gold-2), rgba(120, 90, 40, .5) 45%, transparent 100%) border-box;
  -webkit-mask: linear-gradient(#000 0 0) padding-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
}

/* Petit losange décoratif en haut des panneaux */
.panel::after {
  content: '';
  position: absolute;
  top: -4px;
  left: 50%;
  width: 7px;
  height: 7px;
  translate: -50% 0;
  rotate: 45deg;
  background: var(--black);
  border: 1px solid var(--gold-2);
  pointer-events: none;
}

/* ==========================================================================
   En-tête
   ========================================================================== */
.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.brand__emblem {
  width: 40px;
  height: 40px;
  flex: none;
  filter: drop-shadow(0 0 10px rgba(10, 200, 185, .35));
}

.brand__gem { animation: gem-glow 3s ease-in-out infinite; }

.brand__text {
  display: flex;
  flex-direction: column;
  line-height: 1;
}

.brand__kicker {
  font: 700 10px/1 var(--font-display);
  letter-spacing: .42em;
  text-transform: uppercase;
  color: var(--blue-2);
  margin-bottom: 3px;
}

.brand__title {
  margin: 0;
  font: 900 24px/1 var(--font-display);
  letter-spacing: .08em;
  text-transform: uppercase;
  background: linear-gradient(180deg, #F0E6D2 10%, #C8AA6E 55%, #785A28 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.demo-badge {
  align-self: flex-start;
  padding: 3px 7px;
  font: 700 9.5px/1 var(--font-display);
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--black);
  background: linear-gradient(180deg, var(--blue-1), var(--blue-2));
  border-radius: 2px;
}

/* ==========================================================================
   Boutons
   ========================================================================== */
.icon-btn {
  flex: none;
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  padding: 0;
  border-radius: 50%;
  background: radial-gradient(circle at 50% 30%, #1E2328, #010A13);
  border: 1px solid var(--gold-4);
  color: var(--gold-2);
  cursor: pointer;
  transition: color .2s, border-color .2s, transform .15s var(--ease-out), box-shadow .2s;
  touch-action: manipulation;
}

.icon-btn:active:not(:disabled) { transform: scale(.9); }
.icon-btn:disabled { opacity: .4; cursor: not-allowed; }
.icon-btn--sm { width: 38px; height: 38px; }
.icon-btn--sm .icon { width: 18px; height: 18px; }

.icon-btn .icon--sound-off { display: none; }
.icon-btn.is-muted .icon--sound-on { display: none; }
.icon-btn.is-muted .icon--sound-off { display: block; }
.icon-btn.is-muted { color: var(--grey-2); }

.text-btn {
  flex: none;
  padding: 2px 0;
  background: none;
  border: 0;
  border-bottom: 1px dashed currentColor;
  color: var(--blue-2);
  font: 700 11px/1.4 var(--font-display);
  letter-spacing: .12em;
  text-transform: uppercase;
  cursor: pointer;
}

/* Bouton hextech : bords en pointe, liseré doré */
.btn {
  --cut: 14px;
  --bd: linear-gradient(180deg, #C8AA6E, #785A28);
  --fill: linear-gradient(180deg, #1E2328, #010A13);
  position: relative;
  isolation: isolate;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 48px;
  padding: 8px 28px;
  border: 0;
  background: none;
  color: var(--gold-2);
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 14px;
  letter-spacing: .1em;
  text-transform: uppercase;
  cursor: pointer;
  user-select: none;
  -webkit-user-select: none;
  touch-action: manipulation;
  transition: transform .15s var(--ease-out), color .2s, filter .25s;
}

.btn::before,
.btn::after {
  content: '';
  position: absolute;
  z-index: -1;
  clip-path: polygon(var(--cut) 0, calc(100% - var(--cut)) 0, 100% 50%, calc(100% - var(--cut)) 100%, var(--cut) 100%, 0 50%);
  transition: filter .25s;
}

.btn::before { inset: 0; background: var(--bd); }

.btn::after {
  inset: 2px;
  background: var(--fill);
  clip-path: polygon(calc(var(--cut) - 1px) 0, calc(100% - var(--cut) + 1px) 0, 100% 50%, calc(100% - var(--cut) + 1px) 100%, calc(var(--cut) - 1px) 100%, 0 50%);
}

.btn:active:not(:disabled) { transform: scale(.97); }

.btn:disabled {
  cursor: not-allowed;
  filter: grayscale(.75) brightness(.55);
  animation: none !important;
}

.btn__icon { width: 20px; height: 20px; }

.btn__text {
  display: flex;
  flex-direction: column;
  align-items: center;
  line-height: 1.1;
}

.btn__sub {
  margin-top: 3px;
  font: 600 11.5px/1 var(--font-body);
  letter-spacing: .04em;
  text-transform: none;
  color: var(--blue-1);
  opacity: .85;
  max-width: 220px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.btn--primary {
  --bd: linear-gradient(180deg, #F0E6D2, #C8AA6E 45%, #785A28);
  color: var(--gold-1);
  text-shadow: 0 1px 0 rgba(1, 10, 19, .7), 0 0 12px rgba(10, 200, 185, .6);
}

.btn--primary::after {
  background:
    linear-gradient(105deg, transparent 38%, rgba(205, 250, 250, .38) 50%, transparent 62%) no-repeat,
    linear-gradient(180deg, #0AC8B9 -35%, #0397AB 8%, #005A82 55%, #0A323C 100%);
  background-size: 260% 100%, 100% 100%;
  background-position: 160% 0, 0 0;
  animation: btn-shine 3.6s ease-in-out infinite;
}

.btn--primary.is-ready { animation: ready-glow 2.6s ease-in-out infinite; }

.btn--secondary { width: 100%; min-height: 46px; font-size: 13.5px; }

.btn--gold {
  --cut: 10px;
  --bd: linear-gradient(180deg, #F0E6D2, #C8AA6E 50%, #785A28);
  --fill: linear-gradient(180deg, #C8AA6E, #A47E3D 55%, #785A28);
  padding: 0 16px;
  min-height: 48px;
  font-size: 12.5px;
  letter-spacing: .06em;
  color: var(--black);
  text-shadow: 0 1px 0 rgba(240, 230, 210, .4);
}

.btn--gold.is-loading { pointer-events: none; }
.btn--gold.is-loading .btn__label { animation: blink 1s ease-in-out infinite; }

.btn--xl { width: 100%; min-height: 60px; font-size: 17px; --cut: 18px; }
.btn--sm { min-height: 42px; padding: 6px 14px; font-size: 11.5px; --cut: 11px; }

@media (hover: hover) {
  .icon-btn:hover:not(:disabled) {
    color: var(--gold-1);
    border-color: var(--gold-2);
    box-shadow: 0 0 12px rgba(200, 170, 110, .3);
  }
  .btn:hover:not(:disabled) { color: var(--gold-1); }
  .btn:hover:not(:disabled)::before,
  .btn:hover:not(:disabled)::after { filter: brightness(1.18); }
  .btn--gold:hover:not(:disabled) { color: var(--black); }
  .text-btn:hover { color: var(--blue-1); }
}

/* ==========================================================================
   Formulaire Riot ID
   ========================================================================== */
.summoner { min-height: 76px; }

.riot-form {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 12px;
}

.riot-form.is-appearing,
.player.is-appearing { animation: pop-in .45s var(--ease-out); }

.riot-form__label {
  font: 700 11px/1 var(--font-display);
  letter-spacing: .18em;
  text-transform: uppercase;
  color: var(--gold-2);
}

.riot-form__row { display: flex; gap: 8px; }

.field {
  position: relative;
  flex: 1;
  min-width: 0;
  display: flex;
  align-items: center;
  height: 48px;
  background: rgba(1, 10, 19, .85);
  border: 1px solid var(--gold-4);
  transition: border-color .2s, box-shadow .25s;
}

.field:focus-within {
  border-color: var(--gold-2);
  box-shadow: 0 0 0 1px rgba(200, 170, 110, .25), 0 0 18px rgba(10, 200, 185, .25);
}

.field__icon { width: 18px; height: 18px; margin: 0 2px 0 12px; color: var(--gold-4); flex: none; }

.field__input {
  flex: 1;
  min-width: 0;
  height: 100%;
  padding: 0 8px;
  background: none;
  border: 0;
  outline: none;
  color: var(--gold-1);
  font: 600 16px/1 var(--font-body);
  letter-spacing: .02em;
}

.field__input::placeholder { color: var(--grey-2); }

.field__badge {
  flex: none;
  margin-right: 8px;
  padding: 4px 7px;
  font: 700 10.5px/1 var(--font-display);
  letter-spacing: .1em;
  color: var(--blue-2);
  border: 1px solid rgba(10, 200, 185, .45);
  background: rgba(10, 200, 185, .08);
}

.riot-form__foot {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 10px;
}

.riot-form__hint {
  margin: 0;
  font-size: 12.5px;
  line-height: 1.35;
  color: var(--grey-1);
}

.riot-form.has-error .field { border-color: var(--loss); }
.riot-form.has-error .riot-form__hint { color: #FF8A9B; }
.riot-form.is-inviting .field { animation: invite 2.4s ease-in-out infinite; }
.field.is-pulsing { animation: invite .8s ease-in-out 2; }
.is-shaking { animation: shake .45s ease both !important; }

/* ==========================================================================
   Joueur enregistré
   ========================================================================== */
.player {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 11px 12px 13px;
}

.player__avatar {
  position: relative;
  flex: none;
  width: 52px;
  height: 52px;
  padding: 2px;
  border-radius: 50%;
  background: conic-gradient(from 200deg, var(--gold-4), var(--gold-1), var(--gold-2), var(--gold-4));
  box-shadow: 0 0 14px rgba(200, 170, 110, .3);
}

.player__avatar img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 50%;
  border: 2px solid var(--black);
  background: var(--blue-7);
}

.player__level {
  position: absolute;
  left: 50%;
  bottom: -7px;
  translate: -50% 0;
  min-width: 28px;
  padding: 2px 6px;
  font: 700 10.5px/1 var(--font-body);
  text-align: center;
  color: var(--gold-1);
  background: var(--black);
  border: 1px solid var(--gold-4);
  border-radius: 9px;
}

.player__info {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.player__kicker {
  font: 700 10px/1 var(--font-display);
  letter-spacing: .16em;
  text-transform: uppercase;
  color: var(--grey-1);
}

.player__name {
  display: flex;
  align-items: baseline;
  min-width: 0;
  font: 800 16.5px/1.15 var(--font-display);
  color: var(--gold-1);
}

.player__name > span:first-child {
  min-width: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.player__tag {
  flex: none;
  margin-left: 4px;
  font: 600 14px/1 var(--font-body);
  color: var(--grey-1);
}

/* ==========================================================================
   Scène & carte de la partie
   ========================================================================== */
.stage {
  flex: 1;
  /* les rayons lumineux de la roue débordent : on coupe l'excédent horizontal
     pour que les mobiles ne dézooment pas la page */
  overflow-x: clip;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 14px;
}

.match-card {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  padding: 10px 12px;
}

.match-card.is-fresh { animation: pop-in .5s var(--ease-out); }

.match-card__champ {
  flex: none;
  width: 46px;
  height: 46px;
  padding: 2px;
  border-radius: 50%;
  background: linear-gradient(180deg, var(--gold-2), var(--gold-4));
}

.match-card__champ img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 50%;
  border: 2px solid var(--black);
  background: var(--black);
}

.match-card__body {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.match-card__kicker {
  font: 700 10px/1.2 var(--font-display);
  letter-spacing: .18em;
  text-transform: uppercase;
  color: var(--blue-2);
}

.match-card__title {
  font: 700 16px/1.2 var(--font-display);
  color: var(--gold-1);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.match-card__meta {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  font-size: 12.5px;
  color: var(--grey-1);
}

.match-card__meta > span:last-child {
  min-width: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.result-pill {
  flex: none;
  padding: 2px 7px;
  font: 700 10px/1.3 var(--font-body);
  letter-spacing: .1em;
  text-transform: uppercase;
  border: 1px solid currentColor;
}

.result-pill[data-result='win'] { color: var(--win); background: rgba(10, 200, 185, .1); }
.result-pill[data-result='loss'] { color: var(--loss); background: rgba(232, 64, 87, .1); }
.result-pill[data-result='remake'] { color: var(--grey-1); background: rgba(160, 155, 140, .1); }

.match-card__newer {
  flex: none;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1px;
  padding: 4px 2px;
  background: none;
  border: 0;
  color: var(--gold-2);
  font: 700 8.5px/1.1 var(--font-display);
  letter-spacing: .08em;
  text-transform: uppercase;
  cursor: pointer;
}

.match-card__newer .icon {
  width: 30px;
  height: 30px;
  padding: 5px;
  border: 1px solid var(--gold-4);
  border-radius: 50%;
  background: rgba(1, 10, 19, .7);
}

.match-card__newer:disabled { opacity: .4; cursor: not-allowed; }

/* ==========================================================================
   Roue
   ========================================================================== */
.wheel-stage {
  --wheel: clamp(250px, min(calc(100vw - 36px), calc(100vh - 450px)), 540px);
  position: relative;
  width: var(--wheel);
  height: var(--wheel);
  flex: none;
  margin: 4px auto 2px;
}

@supports (height: 100svh) {
  .wheel-stage { --wheel: clamp(250px, min(calc(100vw - 36px), calc(100svh - 450px)), 540px); }
}

/* Rayons de lumière derrière la roue */
.wheel-stage::before {
  content: '';
  position: absolute;
  inset: -18%;
  border-radius: 50%;
  background: repeating-conic-gradient(from 0deg, rgba(200, 170, 110, .14) 0deg 4deg, transparent 4deg 15deg);
  -webkit-mask-image: radial-gradient(circle, #000 34%, transparent 68%);
  mask-image: radial-gradient(circle, #000 34%, transparent 68%);
  animation: spin 70s linear infinite;
  pointer-events: none;
}

.wheel-stage::after {
  content: '';
  position: absolute;
  inset: -8%;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(10, 200, 185, .24) 0%, rgba(10, 200, 185, .07) 45%, transparent 70%);
  animation: glow-pulse 4s ease-in-out infinite;
  pointer-events: none;
}

.wheel {
  position: relative;
  z-index: 1;
  width: 100%;
  height: 100%;
  border-radius: 50%;
}

/* Socle / ombre portée */
.wheel::before {
  content: '';
  position: absolute;
  inset: 1%;
  border-radius: 50%;
  background: var(--black);
  box-shadow: 0 28px 60px -12px rgba(0, 0, 0, .9), 0 0 40px rgba(10, 200, 185, .12);
}

/* Éclair doré quand un champion est désigné */
.wheel::after {
  content: '';
  position: absolute;
  inset: 8.6%;
  z-index: 3;
  border-radius: 50%;
  pointer-events: none;
  opacity: 0;
  box-shadow:
    0 0 0 3px rgba(240, 230, 210, .9),
    0 0 55px 12px rgba(200, 170, 110, .55),
    inset 0 0 60px 12px rgba(240, 230, 210, .35);
}

.wheel.is-flashing::after { animation: wheel-flash 1.25s ease-out; }

.wheel__rotor-wrap {
  position: absolute;
  inset: 9%;
  z-index: 1;
}

.wheel__rotor {
  width: 100%;
  height: 100%;
  transform-origin: 50% 50%;
  will-change: transform;
}

.wheel-svg {
  display: block;
  width: 100%;
  height: 100%;
  overflow: visible;
}

.wheel.is-locked .wheel__rotor-wrap { filter: saturate(.35) brightness(.6); }

.wheel__rotor-wrap.is-leaving { animation: rotor-out .28s ease-in forwards; }
.wheel__rotor-wrap.is-entering { animation: fade-in .2s ease-out both; }
.wheel__rotor-wrap.is-entering .w-slice-art-inner {
  animation: slice-in .62s var(--ease-back) both;
  animation-delay: calc(var(--i, 0) * 75ms);
}
.wheel__rotor-wrap.is-entering .w-labels,
.wheel__rotor-wrap.is-entering .w-seps { animation: fade-in .45s .32s ease-out both; }

/* --- Contenu SVG des parts --- */
.w-name {
  font-family: var(--font-display);
  font-weight: 800;
  letter-spacing: .03em;
  fill: var(--gold-1);
  stroke: #010A13;
  stroke-width: 4.5px;
  stroke-linejoin: round;
  paint-order: stroke fill;
  transition: fill .3s;
}

.w-q {
  font-family: var(--font-display);
  font-weight: 900;
  font-size: 62px;
  fill: rgba(200, 170, 110, .38);
}

.w-dim { fill: #010A13; opacity: 0; transition: opacity .45s ease; }
.has-winner .w-slice-state:not(.is-winner) .w-dim { opacity: .5; }
.w-slice-state.is-banned .w-dim { opacity: .68; }

.w-win,
.w-win-glow { opacity: 0; stroke-linejoin: round; transition: opacity .3s; }
.w-win { fill: rgba(240, 230, 210, .07); stroke: var(--gold-1); stroke-width: 4; }
.w-win-glow { fill: none; stroke: var(--gold-2); stroke-width: 16; stroke-opacity: .35; }
.w-slice-state.is-winner .w-win,
.w-slice-state.is-winner .w-win-glow { opacity: 1; animation: win-pulse 1.6s ease-in-out infinite; }

.w-slice-label.is-winner .w-name { fill: #FFFFFF; }
.w-slice-label.is-banned .w-name { fill: var(--grey-2); }

.w-ban { opacity: 0; }
.w-ban-ring { fill: rgba(1, 10, 19, .6); stroke: var(--loss); stroke-width: 5; }
.w-ban-bar { stroke: var(--loss); stroke-width: 5; stroke-linecap: round; }
.w-slice-label.is-banned .w-ban { opacity: 1; animation: ban-stamp .5s var(--ease-back) both; }

/* --- Cadre --- */
.wheel__frame {
  position: absolute;
  inset: 0;
  z-index: 2;
  width: 100%;
  height: 100%;
  overflow: visible;
  pointer-events: none;
}

.bulb {
  fill: var(--gold-1);
  opacity: .5;
  animation: bulb-idle 2.4s ease-in-out infinite;
  animation-delay: calc(var(--i, 0) * -100ms);
}

.wheel.is-spinning .bulb {
  animation: bulb-chase .72s linear infinite;
  animation-delay: calc(var(--i, 0) * -30ms);
}

.wheel.is-flashing .bulb { animation: bulb-flash .3s linear 4; }
.wheel.is-locked .bulb { animation: none; opacity: .14; }

.gem-core { fill: var(--blue-2); animation: gem-glow 3s ease-in-out infinite; }
.wheel.is-locked .gem-core { fill: var(--grey-2); animation: none; }

/* --- Pointeur --- */
.wheel__pointer {
  position: absolute;
  top: -1.5%;
  left: 50%;
  z-index: 5;
  width: 11.5%;
  translate: -50% 0;
  pointer-events: none;
  filter: drop-shadow(0 5px 6px rgba(0, 0, 0, .7));
}

.wheel__pointer-svg {
  display: block;
  width: 100%;
  height: auto;
  overflow: visible;
  transform-origin: 50% 32%;
}

.ptr-gem { animation: gem-glow 2.2s ease-in-out infinite; }
.wheel.is-locked .ptr-gem { animation: none; opacity: .35; }

/* --- Moyeu central (bouton) --- */
.wheel__hub {
  position: absolute;
  top: 50%;
  left: 50%;
  z-index: 4;
  width: 25%;
  height: 25%;
  translate: -50% -50%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3%;
  padding: 0;
  border: 0;
  border-radius: 50%;
  cursor: pointer;
  color: var(--gold-1);
  background: radial-gradient(circle at 50% 32%, #0AC8B9 0%, #0397AB 20%, #005A82 44%, #0A323C 70%, #010A13 100%);
  box-shadow:
    0 0 0 calc(var(--wheel) * .007) #010A13,
    0 0 0 calc(var(--wheel) * .016) #C8AA6E,
    0 0 0 calc(var(--wheel) * .021) #463714,
    0 0 calc(var(--wheel) * .07) calc(var(--wheel) * .012) rgba(10, 200, 185, .45),
    inset 0 calc(var(--wheel) * -.018) calc(var(--wheel) * .04) rgba(0, 0, 0, .6),
    inset 0 calc(var(--wheel) * .01) calc(var(--wheel) * .02) rgba(205, 250, 250, .35);
  transition: transform .2s var(--ease-out), filter .3s;
  touch-action: manipulation;
}

.wheel__hub-gem {
  width: 36%;
  height: auto;
  filter: drop-shadow(0 0 6px rgba(205, 250, 250, .7));
}

.wheel__hub-label {
  font: 800 max(9px, calc(var(--wheel) * .032))/1 var(--font-display);
  letter-spacing: .08em;
  text-transform: uppercase;
  text-shadow: 0 1px 2px rgba(1, 10, 19, .9);
}

.wheel__hub:not(:disabled):active { transform: scale(.93); }
.wheel__hub:disabled { cursor: default; }
.wheel.is-locked .wheel__hub { filter: grayscale(.85) brightness(.55); }
.wheel.is-spinning .wheel__hub-gem { animation: spin .9s linear infinite; }
.wheel:not(.is-locked):not(.is-spinning) .wheel__hub:not(:disabled) { animation: hub-breathe 2.6s ease-in-out infinite; }

@media (hover: hover) {
  .wheel__hub:not(:disabled):hover { filter: brightness(1.18); }
}

/* --- Calques : verrou & chargement --- */
.wheel__overlay {
  position: absolute;
  inset: 9%;
  border-radius: 50%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2.5%;
  padding: 14%;
  text-align: center;
}

.wheel__lock {
  z-index: 6;
  cursor: pointer;
  background: radial-gradient(circle, rgba(1, 10, 19, .5) 0%, rgba(1, 10, 19, .86) 72%);
  -webkit-backdrop-filter: blur(2px);
  backdrop-filter: blur(2px);
}

.lock-icon {
  width: 25%;
  height: auto;
  filter: drop-shadow(0 0 14px rgba(200, 170, 110, .45));
  animation: float 3s ease-in-out infinite;
}

.lock-icon__shackle {
  transform-origin: 44px 29px;
  transition: transform .35s var(--ease-back);
}

.lock-title {
  margin: 0;
  font: 800 max(15px, calc(var(--wheel) * .056))/1.1 var(--font-display);
  letter-spacing: .06em;
  text-transform: uppercase;
  background: linear-gradient(180deg, #F0E6D2, #C8AA6E 60%, #785A28);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.lock-text {
  margin: 0;
  max-width: 82%;
  font: 500 max(12px, calc(var(--wheel) * .036))/1.3 var(--font-body);
  color: var(--grey-1);
}

.wheel__lock.is-opening { animation: lock-out .75s ease forwards; pointer-events: none; }
.wheel__lock.is-opening .lock-icon { animation: none; }
.wheel__lock.is-opening .lock-icon__shackle { transform: translateY(-5px) rotate(-32deg); }

.wheel__loader {
  z-index: 7;
  background: radial-gradient(circle, rgba(1, 10, 19, .72) 0%, rgba(1, 10, 19, .9) 72%);
  animation: fade-in .2s ease-out both;
}

.loader-text {
  margin: 4% 0 0;
  font: 700 max(11px, calc(var(--wheel) * .034))/1.2 var(--font-display);
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--gold-2);
}

.hex-spinner {
  position: relative;
  width: 30%;
  aspect-ratio: 1;
}

.hex-spinner span {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  border: 3px solid transparent;
}

.hex-spinner span:nth-child(1) {
  border-top-color: var(--gold-1);
  border-bottom-color: var(--gold-4);
  animation: spin 1.1s linear infinite;
}

.hex-spinner span:nth-child(2) {
  inset: 15%;
  border-left-color: var(--blue-2);
  border-right-color: var(--blue-4);
  animation: spin .8s linear infinite reverse;
}

.hex-spinner span:nth-child(3) {
  inset: 36%;
  border: 0;
  background: radial-gradient(circle, var(--blue-1), var(--blue-2) 40%, transparent 72%);
  animation: pulse 1.2s ease-in-out infinite;
}

/* ==========================================================================
   Équipe adverse (sous la roue)
   ========================================================================== */
.pick-row {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}

.team {
  display: flex;
  gap: 8px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.team__slot {
  position: relative;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  overflow: hidden;
  background: var(--blue-7);
  box-shadow: 0 0 0 2px var(--gold-5);
  transition: transform .35s var(--ease-back), box-shadow .3s, opacity .3s, filter .3s;
  animation: pop-in .45s var(--ease-out) both;
  animation-delay: calc(var(--i, 0) * 55ms);
}

.team__slot img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transform: scale(1.1);
}

.team__slot.is-empty {
  background: radial-gradient(circle at 50% 35%, #0A323C, #010A13);
  box-shadow: 0 0 0 2px var(--gold-6);
}

.team__slot.is-empty::before {
  content: '?';
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  font: 800 15px/1 var(--font-display);
  color: var(--gold-5);
}

.team__slot.is-banned { opacity: .5; filter: grayscale(1); }

.team__slot.is-banned::after {
  content: '';
  position: absolute;
  left: 50%;
  top: -10%;
  width: 3px;
  height: 120%;
  translate: -50% 0;
  rotate: -45deg;
  background: var(--loss);
  box-shadow: 0 0 6px rgba(232, 64, 87, .8);
}

.team__slot.is-picked {
  transform: translateY(-4px) scale(1.12);
  box-shadow: 0 0 0 2px var(--gold-1), 0 0 16px 3px rgba(200, 170, 110, .65);
}

.pick-row__info {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 18px;
}

.pick-row__status {
  font: 700 11.5px/1.2 var(--font-display);
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--grey-1);
  transition: color .3s;
}

.pick-row__status.is-picked { color: var(--gold-1); text-shadow: 0 0 12px rgba(200, 170, 110, .6); }

/* ==========================================================================
   Actions
   ========================================================================== */
.controls {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding-top: 2px;
}

/* ==========================================================================
   Révélation du champion
   ========================================================================== */
.reveal {
  position: fixed;
  inset: 0;
  z-index: 60;
  display: grid;
  place-items: center;
  padding:
    calc(var(--safe-t) + 16px)
    calc(var(--safe-r) + 16px)
    calc(var(--safe-b) + 16px)
    calc(var(--safe-l) + 16px);
  overflow: hidden;
}

.reveal__backdrop {
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at 50% 40%, rgba(10, 50, 60, .55), rgba(1, 10, 19, .93) 70%);
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);
  opacity: 0;
  transition: opacity .3s ease;
}

.reveal.is-open .reveal__backdrop { opacity: 1; }

.reveal__rays {
  position: absolute;
  top: 40%;
  left: 50%;
  width: 150vmax;
  height: 150vmax;
  translate: -50% -50%;
  background: repeating-conic-gradient(from 0deg, rgba(200, 170, 110, .13) 0deg 5deg, transparent 5deg 15deg);
  -webkit-mask-image: radial-gradient(circle, #000 0%, transparent 42%);
  mask-image: radial-gradient(circle, #000 0%, transparent 42%);
  opacity: 0;
  transition: opacity .5s ease;
  animation: spin 45s linear infinite;
  pointer-events: none;
}

.reveal.is-open .reveal__rays { opacity: 1; }

.reveal__card {
  position: relative;
  width: min(100%, 420px);
  max-height: 100%;
  overflow-y: auto;
  overscroll-behavior: contain;
  border: 2px solid transparent;
  background:
    linear-gradient(180deg, #0A1428, #010A13) padding-box,
    linear-gradient(180deg, #F0E6D2, #C8AA6E 28%, #785A28 70%, #463714) border-box;
  box-shadow: 0 30px 80px rgba(0, 0, 0, .8), 0 0 70px rgba(200, 170, 110, .25);
  opacity: 0;
  transform: translateY(40px) scale(.85);
}

.reveal.is-open .reveal__card { animation: card-in .7s var(--ease-back) forwards; }
.reveal.is-closing .reveal__card { animation: card-out .26s ease-in forwards; }

.reveal__art {
  position: relative;
  aspect-ratio: 16 / 10;
  overflow: hidden;
  background: radial-gradient(circle, #0A323C, #010A13);
}

.reveal__art img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 50% 22%;
  opacity: 0;
  transform: scale(1.14);
  transition: opacity .5s ease;
}

.reveal__art img.is-loaded { opacity: 1; }
.reveal.is-open .reveal__art img.is-loaded { animation: ken-burns 9s ease-out forwards; }

.reveal__art::after {
  content: '';
  position: absolute;
  inset: 0;
  background:
    linear-gradient(180deg, transparent 50%, rgba(10, 20, 40, .7) 80%, #0A1428 100%),
    linear-gradient(90deg, rgba(1, 10, 19, .35), transparent 25%, transparent 75%, rgba(1, 10, 19, .35));
}

.reveal__sparks {
  position: absolute;
  top: 42%;
  left: 50%;
  width: 0;
  height: 0;
  pointer-events: none;
}

.spark {
  position: absolute;
  left: -4px;
  top: -4px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: radial-gradient(circle, #FFFFFF 0%, #F0E6D2 30%, #C8AA6E 55%, transparent 72%);
  opacity: 0;
  animation: spark 1.1s var(--d, 0ms) cubic-bezier(.2, .7, .3, 1) both;
}

.spark--teal { background: radial-gradient(circle, #FFFFFF 0%, #CDFAFA 30%, #0AC8B9 55%, transparent 72%); }

.reveal__body {
  position: relative;
  margin-top: -34px;
  padding: 0 20px 20px;
  text-align: center;
}

.reveal__kicker {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  margin: 0 0 6px;
  font: 700 11px/1 var(--font-display);
  letter-spacing: .3em;
  text-transform: uppercase;
  color: var(--blue-2);
}

.reveal__kicker::before,
.reveal__kicker::after {
  content: '';
  width: 38px;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--blue-2));
}

.reveal__kicker::after { transform: scaleX(-1); }

.reveal__name {
  margin: 0;
  font: 900 clamp(30px, 9.5vw, 44px)/1.05 var(--font-display);
  letter-spacing: .04em;
  text-transform: uppercase;
  background: linear-gradient(100deg, #C8AA6E 0%, #F0E6D2 30%, #FFFFFF 45%, #F0E6D2 58%, #C8AA6E 85%);
  background-size: 250% 100%;
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  filter: drop-shadow(0 2px 10px rgba(200, 170, 110, .35));
  animation: name-shine 3.2s ease-in-out infinite;
}

.reveal__title {
  margin: 6px 0 0;
  font: italic 500 15px/1.3 var(--font-body);
  color: var(--grey-1);
}

.reveal__meta {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 6px;
  margin: 14px 0 0;
  padding: 0;
  list-style: none;
}

.reveal__meta li {
  padding: 5px 10px;
  font: 600 12px/1 var(--font-body);
  letter-spacing: .04em;
  color: var(--gold-1);
  background: rgba(10, 50, 60, .45);
  border: 1px solid var(--gold-5);
}

.reveal__actions {
  display: grid;
  gap: 10px;
  margin-top: 20px;
}

.reveal__actions .btn--primary { width: 100%; min-height: 52px; font-size: 15px; }

.reveal__row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.reveal__close {
  position: absolute;
  top: 10px;
  right: 10px;
  z-index: 2;
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  padding: 0;
  border-radius: 50%;
  border: 1px solid var(--gold-4);
  background: rgba(1, 10, 19, .7);
  color: var(--gold-2);
  cursor: pointer;
}

.reveal__close .icon { width: 18px; height: 18px; }

/* ==========================================================================
   Notifications
   ========================================================================== */
.toasts {
  position: fixed;
  top: calc(var(--safe-t) + 12px);
  left: 50%;
  z-index: 100;
  width: min(calc(100vw - 24px), 440px);
  translate: -50% 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
  pointer-events: none;
}

.toast {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 11px 14px;
  background: linear-gradient(180deg, rgba(30, 35, 40, .97), rgba(1, 10, 19, .97));
  border: 1px solid var(--gold-4);
  border-left: 3px solid var(--gold-2);
  box-shadow: 0 12px 30px rgba(0, 0, 0, .6);
  color: var(--gold-1);
  font-size: 14px;
  line-height: 1.35;
  opacity: 0;
  transform: translateY(-14px) scale(.98);
  transition: opacity .3s var(--ease-out), transform .35s var(--ease-out);
  pointer-events: auto;
  cursor: pointer;
}

.toast.is-in { opacity: 1; transform: none; }
.toast.is-out { opacity: 0; transform: translateY(-10px); }

.toast__icon { flex: none; width: 20px; height: 20px; color: var(--gold-2); }
.toast__icon svg { display: block; width: 100%; height: 100%; }

.toast--success { border-left-color: var(--blue-2); }
.toast--success .toast__icon { color: var(--blue-2); }
.toast--error { border-color: rgba(232, 64, 87, .45); border-left-color: var(--loss); }
.toast--error .toast__icon { color: var(--loss); }

/* ==========================================================================
   Adaptations d'écran
   ========================================================================== */
@media (max-width: 420px) {
  .field__icon { display: none; }
  .field__input { padding-left: 12px; }
  .btn--gold { padding: 0 13px; font-size: 12px; }
}

@media (min-width: 600px) {
  .app { gap: 16px; padding-top: calc(var(--safe-t) + 22px); }
  .brand__emblem { width: 46px; height: 46px; }
  .brand__title { font-size: 28px; }
  .team__slot { width: 42px; height: 42px; }
  .team { gap: 10px; }
}

/* Téléphone à l'horizontale : roue à droite, le reste à gauche */
@media (orientation: landscape) and (max-height: 560px) {
  .app {
    max-width: 980px;
    overflow-x: clip;
    overflow-clip-margin: 16px;
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    grid-template-rows: auto auto auto 1fr auto;
    grid-template-areas:
      'top   wheel'
      'sum   wheel'
      'match wheel'
      'ctrl  wheel'
      'ctrl  pick';
    column-gap: 28px;
    row-gap: 10px;
    align-items: start;
  }
  .stage { display: contents; }
  .topbar { grid-area: top; }
  .summoner { grid-area: sum; }
  .match-card { grid-area: match; }
  .controls { grid-area: ctrl; align-self: end; }
  .wheel-stage {
    grid-area: wheel;
    align-self: center;
    margin: 0 auto;
    --wheel: clamp(200px, min(calc(100vh - 120px), 46vw), 440px);
  }
  @supports (height: 100svh) {
    .wheel-stage { --wheel: clamp(200px, min(calc(100svh - 120px), 46vw), 440px); }
  }
  .pick-row { grid-area: pick; }
  .team { gap: 6px; }
  .team__slot { width: 32px; height: 32px; }
}

/* ==========================================================================
   Animations
   ========================================================================== */
@keyframes spin { to { transform: rotate(360deg); } }

@keyframes glow-pulse {
  0%, 100% { opacity: .65; transform: scale(.97); }
  50% { opacity: 1; transform: scale(1.03); }
}

@keyframes gem-glow {
  0%, 100% { opacity: .75; }
  50% { opacity: 1; }
}

@keyframes pulse {
  0%, 100% { transform: scale(.8); opacity: .7; }
  50% { transform: scale(1.1); opacity: 1; }
}

@keyframes float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-6%); }
}

@keyframes fade-in { from { opacity: 0; } to { opacity: 1; } }

@keyframes pop-in {
  from { opacity: 0; transform: translateY(8px) scale(.97); }
  to { opacity: 1; transform: none; }
}

@keyframes blink { 50% { opacity: .35; } }

@keyframes shake {
  0%, 100% { transform: translateX(0); }
  20% { transform: translateX(-7px); }
  40% { transform: translateX(6px); }
  60% { transform: translateX(-4px); }
  80% { transform: translateX(3px); }
}

@keyframes invite {
  0%, 100% { box-shadow: 0 0 0 0 rgba(10, 200, 185, 0); border-color: var(--gold-4); }
  50% { box-shadow: 0 0 0 1px rgba(10, 200, 185, .35), 0 0 20px rgba(10, 200, 185, .35); border-color: var(--blue-2); }
}

@keyframes btn-shine {
  0%, 55% { background-position: 160% 0, 0 0; }
  100% { background-position: -60% 0, 0 0; }
}

@keyframes ready-glow {
  0%, 100% { filter: drop-shadow(0 0 0 rgba(10, 200, 185, 0)); }
  50% { filter: drop-shadow(0 0 14px rgba(10, 200, 185, .55)); }
}

@keyframes hub-breathe {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.045); }
}

@keyframes rotor-out {
  to { opacity: 0; transform: scale(.8) rotate(-14deg); }
}

@keyframes slice-in {
  from { opacity: 0; transform: scale(.35); }
  to { opacity: 1; transform: scale(1); }
}

@keyframes win-pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: .5; }
}

@keyframes ban-stamp {
  0% { opacity: 0; transform: scale(2.6) rotate(-30deg); }
  100% { opacity: 1; transform: scale(1) rotate(0deg); }
}

@keyframes bulb-idle {
  0%, 100% { opacity: .28; }
  50% { opacity: .95; }
}

@keyframes bulb-chase {
  0% { opacity: 1; fill: #CDFAFA; }
  25% { opacity: .9; fill: #F0E6D2; }
  60%, 100% { opacity: .2; fill: #C8AA6E; }
}

@keyframes bulb-flash {
  0%, 49% { opacity: 1; fill: #FFFFFF; }
  50%, 100% { opacity: .15; }
}

@keyframes wheel-flash {
  0% { opacity: 0; }
  14% { opacity: 1; }
  100% { opacity: 0; }
}

@keyframes lock-out {
  0%, 35% { opacity: 1; transform: scale(1); }
  100% { opacity: 0; transform: scale(1.12); }
}

@keyframes card-in {
  0% { opacity: 0; transform: translateY(40px) scale(.85) rotateX(14deg); }
  60% { opacity: 1; transform: translateY(-4px) scale(1.02); }
  100% { opacity: 1; transform: none; }
}

@keyframes card-out {
  from { opacity: 1; transform: none; }
  to { opacity: 0; transform: translateY(20px) scale(.94); }
}

@keyframes ken-burns {
  from { transform: scale(1.14); }
  to { transform: scale(1.02); }
}

@keyframes name-shine {
  0%, 100% { background-position: 100% 0; }
  50% { background-position: 0% 0; }
}

@keyframes spark {
  0% { opacity: 0; transform: translate(0, 0) scale(var(--s, 1)); }
  12% { opacity: 1; }
  100% { opacity: 0; transform: translate(var(--dx), var(--dy)) scale(0); }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    animation-delay: 0ms !important;
    transition-duration: .01ms !important;
  }
}
