:root {
  --night: #071526;
  --deep: #0c2340;
  --navy: #16324f;
  --ocean: #2b6cb0;
  --sky: #63b3ed;
  --ice: #c9ecff;
  --snow: #f4fbff;
  --beak: #ff9f1c;
  --twitch: #9146ff;
  --ok: #4ade80;
  --bad: #f87171;
  --text: #e8f4ff;
  --muted: #8fb2d1;
  --panel: rgba(18, 42, 72, 0.72);
  --panel-border: rgba(201, 236, 255, 0.14);
  --radius: 20px;
  --shadow: 0 20px 50px rgba(0, 0, 0, 0.35);
}

* { box-sizing: border-box; }

html, body { margin: 0; min-height: 100%; }

body {
  font-family: "Nunito", system-ui, sans-serif;
  color: var(--text);
  background:
    radial-gradient(1200px 600px at 50% -10%, #1d4f86 0%, transparent 60%),
    radial-gradient(900px 500px at 100% 100%, #123a63 0%, transparent 60%),
    linear-gradient(180deg, #0a1f38 0%, var(--night) 100%);
  background-attachment: fixed;
  overflow-x: hidden;
}

/* Banquise en bas de page */
body::after {
  content: "";
  position: fixed;
  left: 0; right: 0; bottom: 0;
  height: 90px;
  background:
    radial-gradient(60% 120% at 20% 100%, rgba(201,236,255,.10) 0 60%, transparent 61%),
    radial-gradient(50% 100% at 75% 100%, rgba(201,236,255,.08) 0 60%, transparent 61%);
  pointer-events: none;
  z-index: 0;
}

#snow, #confetti {
  position: fixed; inset: 0;
  width: 100%; height: 100%;
  pointer-events: none;
}
#snow { z-index: 0; }
#confetti { z-index: 60; }

h1, h2, h3, .btn, .winner-name, .field-label { font-family: "Fredoka", "Nunito", sans-serif; }

/* ---------- Header ---------- */
.topbar {
  position: relative; z-index: 2;
  min-width: 0;
  display: flex; align-items: center; justify-content: space-between;
  padding: 18px 32px;
}
.brand { display: flex; align-items: center; gap: 14px; min-width: 0; }
.top-status { flex: none; }
.brand-pingu { width: 54px; height: 62px; filter: drop-shadow(0 6px 10px rgba(0,0,0,.35)); animation: waddle 3s ease-in-out infinite; transform-origin: 50% 100%; }
.brand h1 { margin: 0; font-size: 30px; font-weight: 700; letter-spacing: .3px; color: var(--snow); }
.brand h1 span { color: var(--sky); }
.brand p { margin: 0; color: var(--muted); font-size: 14px; }

@keyframes waddle {
  0%, 100% { transform: rotate(-4deg); }
  50% { transform: rotate(4deg); }
}

.top-status { display: flex; gap: 10px; align-items: center; }
.pill {
  display: flex; align-items: center; gap: 8px;
  padding: 8px 14px; border-radius: 999px;
  background: var(--panel); border: 1px solid var(--panel-border);
  font-weight: 700; font-size: 14px;
}
.pill .dot { width: 9px; height: 9px; border-radius: 50%; background: var(--muted); }
.pill.on .dot { background: var(--ok); box-shadow: 0 0 0 4px rgba(74,222,128,.2); }
.pill.wait .dot { background: var(--beak); animation: pulse 1s infinite; }

.icon-btn {
  width: 40px; height: 40px; border-radius: 50%;
  border: 1px solid var(--panel-border); background: var(--panel);
  color: var(--text); font-size: 18px; cursor: pointer;
  transition: transform .15s;
}
.icon-btn:hover { transform: scale(1.08); }
.pill.bad .dot { background: var(--bad); box-shadow: 0 0 0 4px rgba(248,113,113,.2); }
.online-pill { color: var(--ice); cursor: default; }

/* ---------- Accès co-pilote ---------- */
.login-card { display: flex; flex-direction: column; align-items: center; gap: 12px; width: min(400px, 100%); }
.login-title { margin: 0 0 6px; font-size: 24px; font-weight: 600; }
.login-card input {
  width: 100%; text-align: center; font-size: 18px; letter-spacing: 2px;
  padding: 13px 14px; border-radius: 12px;
  border: 1px solid rgba(201,236,255,.25); background: rgba(7,21,38,.6); color: var(--text);
  font-family: inherit; outline: none;
}
.login-card input:focus { border-color: var(--sky); box-shadow: 0 0 0 3px rgba(99,179,237,.22); }
.login-error { margin: 0; min-height: 18px; color: #ffb4b4; font-size: 14px; font-weight: 700; }
.login-card .btn { width: 100%; }
#login-modal { z-index: 80; }

/* ---------- Layout ---------- */
.layout {
  position: relative; z-index: 1;
  display: grid;
  grid-template-columns: 340px minmax(0, 1fr) 340px;
  gap: 24px;
  padding: 0 32px 40px;
  align-items: start;
}

.panel {
  background: var(--panel);
  border: 1px solid var(--panel-border);
  border-radius: var(--radius);
  padding: 22px;
  backdrop-filter: blur(14px);
  box-shadow: var(--shadow);
}
.panel h2 { margin: 0 0 16px; font-size: 21px; font-weight: 600; display: flex; align-items: center; gap: 8px; }
.panel h3 { margin: 0 0 10px; font-size: 16px; font-weight: 600; }
.panel-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 14px; }
.panel-head h2 { margin: 0; }
.h-icon { font-size: 18px; }

.field-label { display: block; font-size: 14px; font-weight: 500; color: var(--ice); margin: 18px 0 8px; }
.field-label:first-of-type { margin-top: 0; }
.hint { color: var(--muted); font-size: 13px; margin: 8px 0 0; line-height: 1.45; }
.hint b { color: var(--ice); }

input[type="text"], input[type="search"] {
  width: 100%;
  padding: 11px 14px;
  border-radius: 12px;
  border: 1px solid rgba(201,236,255,.18);
  background: rgba(7, 21, 38, .55);
  color: var(--text);
  font: inherit; font-size: 15px;
  outline: none;
  transition: border-color .15s, box-shadow .15s;
}
input:focus { border-color: var(--sky); box-shadow: 0 0 0 3px rgba(99,179,237,.22); }
input::placeholder { color: #6a8cab; }

.input-row { display: flex; gap: 8px; }
.input-row input { flex: 1; min-width: 0; }

/* ---------- Boutons ---------- */
.btn {
  border: none; cursor: pointer;
  padding: 11px 16px; border-radius: 12px;
  font-size: 15px; font-weight: 600;
  color: var(--text);
  transition: transform .12s, filter .15s, background .15s, opacity .15s;
  white-space: nowrap;
}
.btn:hover:not(:disabled) { filter: brightness(1.1); transform: translateY(-1px); }
.btn:active:not(:disabled) { transform: translateY(1px); }
.btn:disabled { opacity: .45; cursor: not-allowed; }
.btn-primary { background: linear-gradient(180deg, #3b82c4, var(--ocean)); box-shadow: 0 4px 0 #1c4f85; }
.btn-ghost { background: rgba(201,236,255,.08); border: 1px solid rgba(201,236,255,.16); }
.btn-sm { padding: 7px 12px; font-size: 13px; }
.btn-link { background: none; color: var(--muted); font-size: 13px; padding: 8px 0 0; text-decoration: underline; text-underline-offset: 3px; }
.btn-link:hover { color: var(--ice); transform: none !important; }

.btn-big {
  width: 100%; margin-top: 18px; padding: 14px;
  font-size: 16px; display: flex; align-items: center; justify-content: center; gap: 10px;
}
.btn-open { background: rgba(74,222,128,.14); border: 1px solid rgba(74,222,128,.45); color: #c9f7d9; }
.btn-open .open-dot { width: 10px; height: 10px; border-radius: 50%; background: var(--ok); animation: pulse 1.6s infinite; }
.btn-open.closed { background: rgba(248,113,113,.12); border-color: rgba(248,113,113,.45); color: #ffd4d4; }
.btn-open.closed .open-dot { background: var(--bad); animation: none; }

@keyframes pulse {
  0% { box-shadow: 0 0 0 0 rgba(74,222,128,.6); }
  100% { box-shadow: 0 0 0 10px rgba(74,222,128,0); }
}

.btn-spin {
  background: linear-gradient(180deg, #ffb547, var(--beak));
  color: #3b1d00;
  box-shadow: 0 5px 0 #c46d00, 0 12px 30px rgba(255,159,28,.35);
  font-size: 19px; padding: 15px 34px; border-radius: 16px;
}
.btn-spin.btn-sm { font-size: 14px; padding: 10px 16px; box-shadow: 0 4px 0 #c46d00; }

/* ---------- Chaînes ---------- */
.chips { list-style: none; padding: 0; margin: 10px 0 0; display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
  display: flex; align-items: center; gap: 8px;
  padding: 6px 8px 6px 12px; border-radius: 999px;
  background: rgba(145,70,255,.18); border: 1px solid rgba(145,70,255,.45);
  font-weight: 700; font-size: 14px;
  animation: pop .25s ease-out;
}
.chip .st { width: 8px; height: 8px; border-radius: 50%; background: var(--beak); }
.chip.ok .st { background: var(--ok); }
.chip.err { background: rgba(248,113,113,.14); border-color: rgba(248,113,113,.5); }
.chip.err .st { background: var(--bad); }
.chip button {
  width: 22px; height: 22px; border-radius: 50%; border: none;
  background: rgba(255,255,255,.12); color: var(--text); cursor: pointer; font-size: 13px; line-height: 1;
}
.chip button:hover { background: rgba(248,113,113,.6); }

/* ---------- Mot-clé ---------- */
.keyword-box {
  display: flex; align-items: center;
  border-radius: 12px; border: 1px solid rgba(201,236,255,.18);
  background: rgba(7,21,38,.55); overflow: hidden;
}
.keyword-box:focus-within { border-color: var(--sky); box-shadow: 0 0 0 3px rgba(99,179,237,.22); }
.keyword-box .bang { padding: 0 4px 0 14px; font-family: "Fredoka"; font-weight: 700; font-size: 20px; color: var(--beak); }
.keyword-box input { border: none; background: none; box-shadow: none !important; padding-left: 2px; font-weight: 700; font-size: 17px; }

/* ---------- Toggles ---------- */
.toggles { display: flex; flex-direction: column; gap: 12px; margin-top: 20px; }
.toggle { display: flex; align-items: center; gap: 12px; font-size: 14px; font-weight: 600; cursor: pointer; user-select: none; }
.toggle input { display: none; }
.toggle .slider {
  position: relative; flex: none;
  width: 42px; height: 24px; border-radius: 999px;
  background: rgba(201,236,255,.16); transition: background .2s;
}
.toggle .slider::after {
  content: ""; position: absolute; top: 3px; left: 3px;
  width: 18px; height: 18px; border-radius: 50%; background: var(--snow);
  transition: transform .2s cubic-bezier(.3,1.5,.6,1);
}
.toggle input:checked + .slider { background: var(--ocean); }
.toggle input:checked + .slider::after { transform: translateX(18px); }

input[type="range"] { width: 100%; accent-color: var(--beak); }

/* ---------- Gagnants ---------- */
.winners-block { margin-top: 22px; padding-top: 18px; border-top: 1px solid var(--panel-border); }
.winners { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 6px; }
.winners li {
  display: flex; justify-content: space-between; gap: 8px;
  padding: 8px 12px; border-radius: 10px; background: rgba(7,21,38,.4); font-size: 14px;
}
.winners li b { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.winners li span { color: var(--muted); font-size: 12px; flex: none; }

/* ---------- Roue ---------- */
.stage { display: flex; flex-direction: column; align-items: center; gap: 22px; padding-top: 6px; }
.wheel-wrap {
  position: relative;
  width: min(100%, 640px, calc(100vh - 230px));
  min-width: 300px;
  aspect-ratio: 1;
}
#wheel {
  width: 100%; height: 100%;
  border-radius: 50%;
  filter: drop-shadow(0 25px 40px rgba(0,0,0,.45));
}
.ice-ring {
  position: absolute; inset: -10px; border-radius: 50%;
  border: 10px solid rgba(201,236,255,.85);
  box-shadow: inset 0 0 0 3px rgba(255,255,255,.6), 0 0 40px rgba(99,179,237,.35), inset 0 0 25px rgba(99,179,237,.4);
  pointer-events: none;
}
.pointer {
  position: absolute; z-index: 3;
  top: -26px; left: 50%;
  width: 46px; height: 60px;
  transform: translateX(-50%);
  background: linear-gradient(180deg, #ffffff, var(--ice) 60%, var(--sky));
  clip-path: polygon(50% 100%, 0 0, 100% 0);
  filter: drop-shadow(0 4px 6px rgba(0,0,0,.4));
  transform-origin: 50% 10%;
}
.pointer.tick { animation: tick .12s ease-out; }
@keyframes tick {
  0% { transform: translateX(-50%) rotate(0); }
  40% { transform: translateX(-50%) rotate(-14deg); }
  100% { transform: translateX(-50%) rotate(0); }
}
.hub {
  position: absolute; z-index: 2;
  left: 50%; top: 50%;
  width: 24%; aspect-ratio: 1;
  transform: translate(-50%, -50%);
  border-radius: 50%;
  border: 6px solid var(--snow);
  background: radial-gradient(circle at 35% 30%, #ffffff, var(--ice) 70%);
  box-shadow: 0 10px 25px rgba(0,0,0,.4), inset 0 -6px 12px rgba(43,108,176,.25);
  cursor: pointer; padding: 0;
  display: grid; place-items: center;
  transition: transform .2s cubic-bezier(.3,1.6,.6,1);
}
.hub:hover:not(:disabled) { transform: translate(-50%, -50%) scale(1.07); }
.hub:disabled { cursor: default; }
.hub svg { width: 70%; height: 78%; margin-top: 4%; }
.spinning .hub svg { animation: waddle .35s ease-in-out infinite; transform-origin: 50% 90%; }

.stage-actions { display: flex; flex-direction: column; align-items: center; gap: 10px; }
.stage-count { margin: 0; color: var(--muted); font-size: 15px; }
.stage-count b { color: var(--snow); font-family: "Fredoka"; font-size: 20px; }

/* ---------- Participants ---------- */
.badge {
  padding: 2px 10px; border-radius: 999px;
  background: var(--beak); color: #3b1d00; font-size: 14px; font-weight: 700;
}
.search { margin-bottom: 12px; }
.players {
  list-style: none; padding: 0; margin: 0;
  max-height: calc(100vh - 380px); min-height: 120px;
  overflow-y: auto;
  display: flex; flex-direction: column; gap: 6px;
  padding-right: 4px;
}
[hidden] { display: none !important; }
.players::-webkit-scrollbar { width: 8px; }
.players::-webkit-scrollbar-thumb { background: rgba(201,236,255,.18); border-radius: 8px; }
.player {
  display: flex; align-items: center; gap: 10px;
  padding: 8px 10px; border-radius: 12px;
  background: rgba(7,21,38,.45);
  border: 1px solid transparent;
}
.player.new { animation: slideIn .35s ease-out; border-color: rgba(255,159,28,.45); }
.player .avatar {
  flex: none; width: 30px; height: 30px; border-radius: 50%;
  display: grid; place-items: center;
  font-family: "Fredoka"; font-weight: 700; font-size: 14px; color: #0c2340;
}
.player .info { flex: 1; min-width: 0; }
.player .name { font-weight: 800; font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.player .src { font-size: 11px; color: var(--muted); }
.player .sub { color: var(--twitch); font-size: 11px; font-weight: 800; margin-left: 4px; }
.player .del {
  flex: none; opacity: 0; width: 26px; height: 26px; border-radius: 8px; border: none;
  background: rgba(248,113,113,.18); color: #ffd4d4; cursor: pointer; transition: opacity .15s;
}
.player:hover .del { opacity: 1; }
.player .del:hover { background: rgba(248,113,113,.55); }

@keyframes slideIn { from { opacity: 0; transform: translateX(20px); } to { opacity: 1; transform: none; } }
@keyframes pop { from { transform: scale(.6); opacity: 0; } to { transform: scale(1); opacity: 1; } }

.empty-state { text-align: center; padding: 24px 10px; color: var(--muted); }
.empty-state svg { width: 70px; height: 82px; opacity: .85; animation: waddle 3s ease-in-out infinite; transform-origin: 50% 100%; }
.empty-state p { margin: 10px 0 0; font-size: 14px; line-height: 1.5; }
.empty-state b { color: var(--beak); }
.manual { margin-top: 14px; }
.manual .btn { width: 44px; font-size: 20px; padding: 0; }

/* ---------- Modale ---------- */
.modal {
  position: fixed; inset: 0; z-index: 50;
  display: grid; place-items: center;
  background: rgba(4, 12, 24, .72);
  backdrop-filter: blur(6px);
  animation: fade .25s;
  padding: 20px;
}
.modal[hidden] { display: none; }
.modal-card {
  position: relative;
  width: min(520px, 100%);
  padding: 70px 30px 28px;
  border-radius: 28px;
  text-align: center;
  background: linear-gradient(180deg, #1c4570, #0f2a48);
  border: 2px solid rgba(201,236,255,.35);
  box-shadow: 0 30px 80px rgba(0,0,0,.6), 0 0 0 8px rgba(201,236,255,.06);
  animation: bounceIn .55s cubic-bezier(.2,1.6,.4,1);
}
.modal-pingu {
  position: absolute; top: -62px; left: 50%; transform: translateX(-50%);
  width: 110px; height: 128px;
  filter: drop-shadow(0 10px 16px rgba(0,0,0,.4));
  animation: hop 1s ease-in-out infinite;
}
@keyframes hop {
  0%, 100% { transform: translateX(-50%) translateY(0); }
  50% { transform: translateX(-50%) translateY(-12px) rotate(3deg); }
}
.modal-kicker { margin: 0; color: var(--ice); font-weight: 700; letter-spacing: 2px; text-transform: uppercase; font-size: 13px; }
.winner-name {
  margin: 8px 0 6px;
  font-size: clamp(32px, 7vw, 52px);
  font-weight: 700;
  color: var(--beak);
  text-shadow: 0 4px 0 #8a4a00, 0 0 30px rgba(255,159,28,.5);
  word-break: break-word;
}
.winner-meta { margin: 0 0 18px; color: var(--muted); font-size: 14px; }
.winner-meta #winner-channel { color: #c4a5ff; font-weight: 700; }
.winner-meta #winner-timer { color: var(--snow); font-weight: 800; font-variant-numeric: tabular-nums; }
.winner-chat {
  text-align: left; border-radius: 14px; padding: 12px 14px;
  background: rgba(7,21,38,.5); border: 1px solid var(--panel-border);
}
.winner-chat-title { margin: 0 0 8px; font-size: 13px; font-weight: 700; color: var(--ice); }
.winner-chat ul { list-style: none; padding: 0; margin: 0; max-height: 130px; overflow-y: auto; display: flex; flex-direction: column; gap: 6px; }
.winner-chat li { font-size: 14px; animation: slideIn .3s; word-break: break-word; }
.winner-chat li time { color: var(--muted); font-size: 12px; margin-right: 6px; }
.winner-chat li.muted { color: var(--muted); font-style: italic; animation: none; }
.modal-actions { display: flex; gap: 8px; justify-content: center; flex-wrap: wrap; margin-top: 20px; }

@keyframes fade { from { opacity: 0; } }
@keyframes bounceIn { from { transform: scale(.5) translateY(40px); opacity: 0; } }

/* ---------- Toasts ---------- */
#toasts { position: fixed; bottom: 22px; left: 50%; transform: translateX(-50%); z-index: 70; display: flex; flex-direction: column; gap: 8px; align-items: center; }
.toast {
  padding: 10px 18px; border-radius: 12px;
  background: #102b4a; border: 1px solid rgba(201,236,255,.25);
  box-shadow: var(--shadow); font-weight: 700; font-size: 14px;
  animation: toastIn .3s ease-out;
}
.toast.out { opacity: 0; transform: translateY(10px); transition: all .3s; }
@keyframes toastIn { from { opacity: 0; transform: translateY(14px); } }

/* =========================================================
   Animations
   ========================================================= */

/* Aurores boréales */
.aurora { position: fixed; inset: 0 0 auto 0; height: 60vh; z-index: 0; pointer-events: none; overflow: hidden; filter: blur(60px); opacity: .55; }
.aurora span { position: absolute; top: -20%; width: 55vw; height: 45vh; border-radius: 50%; mix-blend-mode: screen; }
.aurora span:nth-child(1) { left: -10%; background: radial-gradient(closest-side, rgba(74,222,128,.45), transparent); animation: aurora1 18s ease-in-out infinite alternate; }
.aurora span:nth-child(2) { left: 30%; background: radial-gradient(closest-side, rgba(99,179,237,.5), transparent); animation: aurora2 22s ease-in-out infinite alternate; }
.aurora span:nth-child(3) { right: -15%; background: radial-gradient(closest-side, rgba(145,70,255,.45), transparent); animation: aurora3 26s ease-in-out infinite alternate; }
@keyframes aurora1 { to { transform: translate(18vw, 6vh) scale(1.2) rotate(12deg); } }
@keyframes aurora2 { to { transform: translate(-14vw, 10vh) scale(.85) rotate(-10deg); } }
@keyframes aurora3 { to { transform: translate(-20vw, 4vh) scale(1.15) rotate(8deg); } }

/* Entrée de page */
.topbar { animation: dropIn .7s cubic-bezier(.2,1.2,.4,1) both; }
.layout > * { min-width: 0; }
.layout > * { animation: riseIn .8s cubic-bezier(.2,1.1,.4,1) both; }
#panel-config { animation-delay: .12s; }
.stage { animation-delay: .22s; }
#panel-players { animation-delay: .32s; }

.stage .wheel-wrap { animation: wheelIn 1.1s .3s cubic-bezier(.2,1.3,.4,1) both; }
@keyframes dropIn { from { opacity: 0; transform: translateY(-24px); } }
@keyframes riseIn { from { opacity: 0; transform: translateY(30px); } }
@keyframes wheelIn { from { opacity: 0; transform: scale(.6) rotate(-90deg); } }

/* Pingouin qui glisse sur la banquise */
.slide-pingu {
  position: fixed; bottom: 18px; left: 0; z-index: 1;
  width: 56px; height: 66px;
  pointer-events: none;
  animation: belly 32s linear infinite;
  animation-delay: 6s;
  transform: translateX(-160px);
}
.slide-pingu svg { width: 100%; height: 100%; transform: rotate(90deg); filter: drop-shadow(0 6px 6px rgba(0,0,0,.35)); }
@keyframes belly {
  0% { transform: translateX(-160px) translateY(0); }
  3% { transform: translateX(-60px) translateY(-6px); }
  22% { transform: translateX(calc(100vw + 160px)) translateY(0); }
  100% { transform: translateX(calc(100vw + 160px)); }
}

/* Roue : petit rebond quand quelqu'un rejoint */
#wheel.bump { animation: bump .35s ease-out; }
@keyframes bump { 40% { transform: scale(1.025); } }
.badge.pop, .stage-count b.pop { display: inline-block; animation: badgePop .35s cubic-bezier(.3,1.8,.5,1); }
@keyframes badgePop { 50% { transform: scale(1.35); } }

/* Pointeur qui tombe en place à la fin */
.pointer.land { animation: land .6s cubic-bezier(.3,1.8,.5,1); }
@keyframes land {
  0% { transform: translateX(-50%) translateY(0) scale(1); }
  30% { transform: translateX(-50%) translateY(-10px) scale(1.15); }
  100% { transform: translateX(-50%) translateY(0) scale(1); }
}

/* Halo de la roue pendant le spin */
.spinning .ice-ring { animation: ringGlow .8s ease-in-out infinite alternate; }
@keyframes ringGlow { to { box-shadow: inset 0 0 0 3px rgba(255,255,255,.8), 0 0 80px rgba(255,159,28,.55), inset 0 0 30px rgba(255,159,28,.4); } }

/* Hub : se dandine au survol */
.hub:hover:not(:disabled) svg { animation: waddle .6s ease-in-out infinite; transform-origin: 50% 90%; }

/* Bouton spin : respire quand il est prêt */
.btn-spin:not(:disabled):not(.btn-sm) { animation: breathe 2.4s ease-in-out infinite; }
@keyframes breathe {
  50% { box-shadow: 0 5px 0 #c46d00, 0 14px 44px rgba(255,159,28,.6); }
}
.btn-spin { position: relative; overflow: hidden; }
.btn-spin::after {
  content: ""; position: absolute; top: 0; left: -60%; width: 40%; height: 100%;
  background: linear-gradient(100deg, transparent, rgba(255,255,255,.55), transparent);
  transform: skewX(-20deg);
  animation: shine 3.5s ease-in-out infinite;
}
.btn-spin:disabled::after { display: none; }
@keyframes shine { 0%, 60% { left: -60%; } 100% { left: 130%; } }

/* Nom du gagnant lettre par lettre */
.winner-name .ch { display: inline-block; animation: letterIn .5s cubic-bezier(.2,1.8,.4,1) both; white-space: pre; }
@keyframes letterIn { from { opacity: 0; transform: translateY(30px) scale(.4) rotate(-20deg); } }

/* Survol des cartes */
.panel { transition: border-color .25s, box-shadow .25s; }
.panel:hover { border-color: rgba(201,236,255,.24); }
.player { transition: background .15s, transform .15s; }
.player:hover { background: rgba(43,108,176,.25); transform: translateX(-2px); }
.player.out { animation: slideOut .25s ease-in forwards; }
@keyframes slideOut { to { opacity: 0; transform: translateX(30px); height: 0; padding-block: 0; margin: 0; } }
.winners li.fresh { animation: winnerRow 1.2s ease-out both; }
@keyframes winnerRow {
  0% { opacity: 0; transform: translateX(-20px); background: rgba(255,159,28,.5); }
  40% { opacity: 1; transform: none; }
  100% { background: rgba(7,21,38,.4); }
}

/* ---------- Pingouins qui tombent ---------- */
.stage { position: relative; }
.wheel-wrap, .stage-actions { position: relative; z-index: 1; }
.pingu-rain {
  position: absolute; z-index: 0;
  inset: -100px -40px 0;
  overflow: hidden; pointer-events: none;
  -webkit-mask-image: linear-gradient(180deg, transparent 0, #000 12%, #000 85%, transparent 100%);
          mask-image: linear-gradient(180deg, transparent 0, #000 12%, #000 85%, transparent 100%);
}
.falling {
  position: absolute; top: -90px;
  opacity: .85;
  animation: fall var(--fall) linear forwards;
}
.falling svg { width: 100%; height: 100%; display: block; filter: drop-shadow(0 6px 8px rgba(0,0,0,.35)); }
.falling.tumble svg { animation: tumble var(--fall) linear forwards; }
.falling.spin svg { animation: tumble calc(var(--fall) / 3) linear infinite; }
.falling.flat svg { animation: flail .5s ease-in-out infinite alternate; }
.falling.parachute { opacity: .95; }
.falling.parachute svg { animation: dangle 1.4s ease-in-out infinite alternate; transform-origin: 50% -30%; }
.falling .chute {
  position: absolute; left: 50%; bottom: 92%;
  width: 190%; aspect-ratio: 2 / 1;
  transform: translateX(-50%);
  border-radius: 999px 999px 0 0;
  background: repeating-linear-gradient(90deg, var(--beak) 0 20%, #fff 20% 40%);
}
.falling .chute::after {
  content: ""; position: absolute; left: 14%; right: 14%; top: 100%; height: 60%;
  border-left: 1px solid rgba(255,255,255,.7); border-right: 1px solid rgba(255,255,255,.7);
  clip-path: polygon(0 0, 100% 0, 70% 100%, 30% 100%);
}
@keyframes fall {
  to { transform: translate(var(--sway), calc(100vh + 200px)); }
}
@keyframes tumble { to { transform: rotate(var(--rot)); } }
@keyframes flail { from { transform: rotate(-25deg) scaleX(1); } to { transform: rotate(25deg) scaleX(-1); } }
@keyframes dangle { from { transform: rotate(-12deg); } to { transform: rotate(12deg); } }

/* ---------- Crédits ---------- */
.credits {
  position: fixed; z-index: 40;
  right: 18px; bottom: 16px;
  display: flex; align-items: center; gap: 10px;
  padding: 8px 16px 8px 12px;
  border-radius: 999px;
  background: rgba(12, 35, 64, .85);
  border: 1px solid rgba(201,236,255,.22);
  box-shadow: 0 8px 24px rgba(0,0,0,.35);
  backdrop-filter: blur(10px);
  color: var(--ice); font-size: 14px; font-weight: 700;
}
.layout { padding-bottom: 80px; }
.credits { cursor: help; outline: none; }
.credits > svg { width: 22px; height: 26px; animation: waddle 2.4s ease-in-out infinite; transform-origin: 50% 100%; }

/* Popup lore : Luwake le bot */
.lore {
  position: absolute; right: 0; bottom: calc(100% + 16px);
  width: 230px;
  padding: 18px 18px 16px;
  border-radius: 18px;
  text-align: center;
  background: linear-gradient(160deg, #1a1035, #0c2340);
  border: 1px solid rgba(145,70,255,.6);
  box-shadow: 0 18px 40px rgba(0,0,0,.5), 0 0 30px rgba(145,70,255,.35);
  opacity: 0; visibility: hidden;
  transform: translateY(12px) scale(.85);
  transform-origin: 85% 100%;
  transition: opacity .2s, transform .35s cubic-bezier(.2,1.6,.4,1), visibility .2s;
  pointer-events: none;
}
.lore::after {
  content: ""; position: absolute; right: 34px; top: 100%;
  border: 9px solid transparent; border-top-color: rgba(145,70,255,.6);
}
.credits:hover .lore, .credits:focus .lore {
  opacity: 1; visibility: visible; transform: none;
}
.lore-bot { position: relative; width: 74px; height: 86px; margin: 10px auto 10px; }
.lore-bot svg { width: 100%; height: 100%; }
.credits:hover .lore-bot svg, .credits:focus .lore-bot svg { animation: robot .25s steps(2) infinite; }
.lore-bot .visor {
  position: absolute; left: 22%; right: 22%; top: 32%; height: 13%;
  border-radius: 6px;
  background: linear-gradient(90deg, #ff3d6e, #ff9f1c);
  box-shadow: 0 0 12px #ff3d6e;
  animation: scan 1.2s ease-in-out infinite alternate;
}
.lore-bot .antenna {
  position: absolute; left: 50%; top: -12px; width: 3px; height: 16px;
  background: #b78bff; transform: translateX(-50%);
}
.lore-bot .antenna::after {
  content: ""; position: absolute; left: 50%; top: -5px; width: 9px; height: 9px;
  border-radius: 50%; background: #ff3d6e; transform: translateX(-50%);
  box-shadow: 0 0 10px #ff3d6e;
  animation: blink 1s steps(2) infinite;
}
.lore-title {
  position: relative; margin: 0;
  font-family: "Fredoka"; font-size: 24px; font-weight: 700;
  color: #fff; letter-spacing: .5px;
}
.lore-title::before, .lore-title::after {
  content: attr(data-text); position: absolute; inset: 0;
}
.lore-title::before { color: #ff3d6e; animation: glitch 1.6s infinite; clip-path: inset(0 0 55% 0); }
.lore-title::after { color: #4dd2ff; animation: glitch 1.6s infinite reverse; clip-path: inset(55% 0 0 0); }
@keyframes glitch {
  0%, 86%, 100% { transform: none; opacity: 0; }
  88% { transform: translate(-3px, 1px); opacity: .9; }
  92% { transform: translate(3px, -1px); opacity: .9; }
  96% { transform: translate(-1px, 0); opacity: .9; }
}
@keyframes robot { from { transform: translateY(0); } to { transform: translateY(-2px); } }
@keyframes scan { from { filter: brightness(.8); } to { filter: brightness(1.4); } }
@keyframes blink { 50% { opacity: .2; } }
.credits b {
  font-family: "Fredoka"; font-weight: 700; letter-spacing: .5px;
  background: linear-gradient(90deg, var(--sky), var(--twitch), var(--beak), var(--sky));
  background-size: 300% 100%;
  -webkit-background-clip: text; background-clip: text; color: transparent;
  animation: gradientMove 6s linear infinite;
}
@keyframes gradientMove { to { background-position: 300% 0; } }

/* =========================================================
   Responsive
   ========================================================= */
.layout { grid-template-columns: minmax(280px, 340px) minmax(0, 1fr) minmax(280px, 340px); }
.stage { position: sticky; top: 16px; }

/* Tablette / petit laptop : roue en haut, 2 colonnes dessous */
@media (max-width: 1280px) {
  .layout { grid-template-columns: 1fr 1fr; gap: 20px; }
  .stage { grid-column: 1 / -1; order: -1; position: static; }
  .wheel-wrap { width: min(calc(100vw - 100px), 560px, calc(100vh - 220px)); min-width: 280px; }
  .players { max-height: 440px; }
}

/* Mobile */
@media (max-width: 760px) {
  .layout { grid-template-columns: 1fr; padding: 0 14px 24px; gap: 16px; }
  .topbar { padding: 14px; gap: 10px; }
  .brand { gap: 10px; }
  .brand-pingu { width: 40px; height: 46px; }
  .brand h1 { font-size: 23px; }
  .brand p { display: none; }
  .pill { padding: 7px 11px; font-size: 13px; }
  .wheel-wrap { width: calc(100vw - 56px); max-width: 480px; min-width: 0; }
  .pointer { width: 36px; height: 46px; top: -20px; }
  .ice-ring { inset: -7px; border-width: 7px; }
  .hub { border-width: 4px; }
  .btn-spin { font-size: 17px; padding: 13px 26px; }
  .panel { padding: 18px; border-radius: 18px; }
  .players { max-height: 360px; }
  .modal-card { padding: 60px 18px 20px; border-radius: 22px; }
  .modal-pingu { width: 90px; height: 105px; top: -52px; }
  .modal-actions { flex-direction: column; }
  .modal-actions .btn { width: 100%; }
  .slide-pingu { width: 42px; height: 50px; bottom: 10px; }
  .layout { padding-bottom: 16px; }
  .credits { position: relative; right: auto; bottom: auto; margin: 0 auto 24px; width: fit-content; font-size: 13px; }
  .lore { right: 50%; transform: translate(50%, 12px) scale(.85); transform-origin: 50% 100%; }
  .credits:hover .lore, .credits:focus .lore { transform: translateX(50%); }
  .lore::after { right: 50%; transform: translateX(50%); }
  .pingu-rain { inset: -60px -14px 0; }
}

/* Très petits écrans */
@media (max-width: 380px) {
  #conn-text { display: none; }
  .pill { padding: 9px; }
  .brand h1 { font-size: 20px; }
  .input-row .btn-primary { padding: 11px 12px; }
}

/* Écrans tactiles : bouton supprimer toujours visible */
@media (hover: none) {
  .player .del { opacity: .8; }
}

/* Accessibilité : moins d'animations si demandé par le système */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
  .aurora, .slide-pingu { display: none; }
}
