/* =====================================================================
   PUISSANCE X — feuille de style « jeu »
   Ambiance arcade néon : fond violet profond, jetons rouges/jaunes lumineux,
   boutons 3D, panneaux vitrés, animations partout.
   ===================================================================== */
:root {
  --bg-0: #07051a;
  --bg-1: #110b2e;
  --bg-2: #1a1145;
  --panel: rgba(32, 22, 82, .72);
  --panel-solid: #1d1450;
  --panel-2: rgba(55, 38, 130, .55);
  --line: rgba(160, 140, 255, .22);
  --line-strong: rgba(180, 160, 255, .45);
  --text: #f4f1ff;
  --muted: #b3a9e0;
  --dim: #8277b8;

  --red: #ff3d68;
  --red-2: #c3123f;
  --yellow: #ffcf33;
  --yellow-2: #e08f00;
  --cyan: #2ee6ff;
  --violet: #8b5cff;
  --pink: #ff4fd8;
  --green: #2bea8e;
  --green-2: #0f9a58;
  --blue: #3d6bff;
  --blue-2: #1e3fd1;
  --gold: #ffd45c;

  --board-a: #3a5cff;
  --board-b: #2135d6;
  --hole: #0a0628;

  --radius: 20px;
  --radius-sm: 12px;
  --glow-v: 0 0 0 1px var(--line), 0 18px 50px rgba(5, 2, 25, .55);
  --font: 'Nunito', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --display: 'Lilita One', 'Fredoka', var(--font);
  --ease-out: cubic-bezier(.2, .9, .25, 1.15);
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0;
  min-height: 100vh;
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.5;
  color: var(--text);
  background: var(--bg-0);
  overflow-x: hidden;
}

/* Fond animé : halos colorés + grille en perspective */
body::before {
  content: '';
  position: fixed; inset: 0; z-index: -2;
  background:
    radial-gradient(900px 600px at 10% -10%, rgba(139, 92, 255, .45), transparent 60%),
    radial-gradient(800px 500px at 110% 10%, rgba(255, 61, 104, .28), transparent 60%),
    radial-gradient(900px 700px at 50% 120%, rgba(46, 230, 255, .22), transparent 60%),
    linear-gradient(180deg, var(--bg-1), var(--bg-0));
}
body::after {
  content: '';
  position: fixed; left: -50%; right: -50%; bottom: -10%; height: 55%; z-index: -1;
  background-image:
    linear-gradient(rgba(139, 92, 255, .22) 1px, transparent 1px),
    linear-gradient(90deg, rgba(139, 92, 255, .22) 1px, transparent 1px);
  background-size: 60px 60px;
  transform: perspective(500px) rotateX(62deg);
  transform-origin: bottom;
  mask-image: linear-gradient(to top, rgba(0,0,0,.9), transparent 85%);
  -webkit-mask-image: linear-gradient(to top, rgba(0,0,0,.9), transparent 85%);
  animation: gridScroll 6s linear infinite;
  pointer-events: none;
}
@keyframes gridScroll { to { background-position: 0 60px, 0 0; } }

/* Jetons flottants en arrière-plan (créés par app.js) */
.bg-tokens { position: fixed; inset: 0; z-index: -1; pointer-events: none; overflow: hidden; }
.bg-tokens i {
  position: absolute; bottom: -80px; border-radius: 50%;
  opacity: .16; filter: blur(.5px);
  animation: floatUp linear infinite;
}
.bg-tokens i.r { background: radial-gradient(circle at 35% 30%, #ff9db2, var(--red) 50%, var(--red-2)); }
.bg-tokens i.y { background: radial-gradient(circle at 35% 30%, #fff1a8, var(--yellow) 50%, var(--yellow-2)); }
@keyframes floatUp {
  from { transform: translateY(0) rotate(0); }
  to { transform: translateY(-120vh) rotate(360deg); }
}

a { color: var(--cyan); text-decoration: none; }
a:hover { color: #9ff3ff; }
h1, h2, h3 { font-family: var(--display); font-weight: 400; line-height: 1.1; margin: 0 0 .5em; letter-spacing: .5px; }
h1 { font-size: clamp(2rem, 5vw, 3.2rem); }
h2 { font-size: 1.5rem; }
h3 { font-size: 1.15rem; }
p { margin: 0 0 1em; }
.muted { color: var(--muted); }
.small { font-size: .875rem; }
.hidden { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.title-glow {
  background: linear-gradient(180deg, #fff 20%, #c9b8ff);
  -webkit-background-clip: text; background-clip: text; color: transparent;
  filter: drop-shadow(0 4px 0 rgba(30, 10, 90, .9)) drop-shadow(0 0 24px rgba(139, 92, 255, .6));
}
.page-title { display: flex; align-items: center; gap: 14px; margin-bottom: 6px; }
.page-title h1 { margin: 0; }
.page-title .icon { font-size: 2.4rem; filter: drop-shadow(0 6px 10px rgba(0,0,0,.5)); }
.page-sub { color: var(--muted); margin: 8px 0 26px; max-width: 720px; }

:focus-visible { outline: 3px solid var(--yellow); outline-offset: 3px; border-radius: 8px; }

/* ------------------------------------------------------------- Transitions de page */
main { animation: pageIn .55s var(--ease-out) both; }
body.leaving main { animation: pageOut .22s ease-in both; }
@keyframes pageIn { from { opacity: 0; transform: translateY(18px) scale(.985); } }
@keyframes pageOut { to { opacity: 0; transform: translateY(-10px) scale(.99); } }
.reveal { animation: revealUp .6s var(--ease-out) both; animation-delay: calc(var(--i, 0) * 70ms + 80ms); }
@keyframes revealUp { from { opacity: 0; transform: translateY(26px) scale(.96); } }

/* ------------------------------------------------------------- En-tête */
.topbar {
  position: sticky; top: 0; z-index: 30;
  background: linear-gradient(180deg, rgba(10, 6, 34, .92), rgba(10, 6, 34, .75));
  backdrop-filter: blur(14px) saturate(1.4);
  -webkit-backdrop-filter: blur(14px) saturate(1.4);
  border-bottom: 1px solid var(--line);
  box-shadow: 0 10px 30px rgba(0,0,0,.35);
}
.topbar-inner {
  max-width: 1240px; margin: 0 auto; padding: 10px 16px;
  display: flex; align-items: center; gap: 14px;
}
.logo { display: flex; align-items: center; gap: 10px; color: var(--text); flex: none; }
.logo:hover { color: var(--text); }
.logo-mark {
  width: 42px; height: 42px; border-radius: 12px; position: relative;
  background: linear-gradient(145deg, var(--board-a), var(--board-b));
  box-shadow: inset 0 -4px 0 rgba(0,0,0,.3), 0 4px 14px rgba(61, 107, 255, .6);
  display: grid; grid-template-columns: 1fr 1fr; gap: 3px; padding: 6px;
  transition: transform .3s var(--ease-out);
}
.logo:hover .logo-mark { transform: rotate(-8deg) scale(1.08); }
.logo-mark i { border-radius: 50%; background: var(--red); box-shadow: inset 0 -2px 0 rgba(0,0,0,.3); }
.logo-mark i:nth-child(2), .logo-mark i:nth-child(3) { background: var(--yellow); }
.logo-text { font-family: var(--display); font-size: 1.45rem; letter-spacing: 1px; line-height: 1; }
.logo-text b { color: var(--yellow); font-weight: 400; }

.nav { display: flex; gap: 4px; flex: 1; justify-content: center; }
.nav a {
  display: flex; align-items: center; gap: 7px;
  color: var(--muted); padding: 9px 10px; border-radius: 12px;
  font-weight: 800; font-size: .95rem; white-space: nowrap; position: relative;
  transition: color .2s, background .2s, transform .2s var(--ease-out);
}
.ic { width: 1.25em; height: 1.25em; flex: none; display: inline-block; vertical-align: -0.22em; }
.nav a .ic { width: 20px; height: 20px; transition: transform .3s var(--ease-out); }
.nav a:hover { color: var(--text); background: rgba(139, 92, 255, .15); }
.nav a:hover .ic { transform: scale(1.18) rotate(-6deg); }
.nav a[aria-current="page"] { color: var(--text); background: linear-gradient(180deg, rgba(139, 92, 255, .45), rgba(139, 92, 255, .2)); box-shadow: inset 0 0 0 1px rgba(180, 160, 255, .4); }
.nav a[aria-current="page"]::after { content: ''; position: absolute; left: 30%; right: 30%; bottom: -11px; height: 3px; border-radius: 3px; background: var(--yellow); box-shadow: 0 0 10px var(--yellow); }
.nav .dot-badge { position: absolute; top: 4px; right: 4px; width: 9px; height: 9px; border-radius: 50%; background: var(--red); box-shadow: 0 0 0 2px var(--bg-1), 0 0 10px var(--red); animation: pulse 1.4s ease-in-out infinite; }

.userbox { display: flex; align-items: center; gap: 10px; flex: none; }
.coin-chip:hover { color: var(--gold); filter: brightness(1.15); }
.coin-chip {
  display: flex; align-items: center; gap: 7px; padding: 5px 14px 5px 6px; border-radius: 999px;
  background: linear-gradient(180deg, rgba(255, 207, 51, .2), rgba(255, 207, 51, .07));
  box-shadow: inset 0 0 0 1px rgba(255, 207, 51, .45);
  font-family: var(--display); font-size: 1.1rem; color: var(--gold); white-space: nowrap;
}
.coin-chip.bump { animation: bump .5s var(--ease-out); }
@keyframes bump { 40% { transform: scale(1.22); } }
.coin {
  width: 24px; height: 24px; border-radius: 50%; display: inline-grid; place-items: center; flex: none;
  background: radial-gradient(circle at 35% 30%, #fff3b0, #ffcf33 45%, #c27c00);
  box-shadow: inset 0 -2px 0 rgba(0,0,0,.25), 0 0 10px rgba(255, 207, 51, .6);
  font-size: .7rem; color: #7a4a00; font-family: var(--display);
}
.coin::after { content: '★'; }
.player-chip {
  display: flex; align-items: center; gap: 10px; padding: 4px 12px 4px 4px; border-radius: 999px;
  background: var(--panel-2); box-shadow: inset 0 0 0 1px var(--line); color: var(--text);
  transition: transform .2s var(--ease-out), box-shadow .2s;
}
.player-chip { border: 0; font: inherit; cursor: pointer; }
.player-chip .chev { width: 16px; height: 16px; color: var(--muted); transition: transform .2s; }
.player-chip[aria-expanded="true"] .chev { transform: rotate(180deg); }
.player-chip:hover { color: var(--text); transform: translateY(-2px); box-shadow: inset 0 0 0 1px var(--line-strong), 0 8px 20px rgba(0,0,0,.4); }
.player-chip .meta { line-height: 1.1; }
.player-chip .name { font-weight: 900; font-size: .92rem; }
.mini-xp { width: 80px; height: 6px; border-radius: 6px; background: rgba(0,0,0,.45); overflow: hidden; margin-top: 3px; }
.mini-xp span { display: block; height: 100%; background: linear-gradient(90deg, var(--cyan), var(--violet)); border-radius: 6px; }

/* Menu du compte */
.user-wrap { position: relative; }
.user-menu {
  position: absolute; right: 0; top: calc(100% + 10px); width: 270px; z-index: 50;
  background: linear-gradient(180deg, #2a1c6e, #1a1150); border-radius: 18px; padding: 8px;
  box-shadow: 0 0 0 1px var(--line-strong), 0 24px 50px rgba(0,0,0,.6);
  animation: menuIn .2s var(--ease-out);
}
.user-menu[hidden] { display: none; }
@keyframes menuIn { from { opacity: 0; transform: translateY(-8px) scale(.97); } }
.user-menu .um-head { display: flex; gap: 12px; align-items: center; padding: 10px 10px 14px; border-bottom: 1px solid var(--line); margin-bottom: 6px; }
.user-menu .um-head b { font-family: var(--display); font-weight: 400; font-size: 1.15rem; }
.user-menu a, .user-menu button { display: flex; align-items: center; gap: 12px; width: 100%; padding: 11px 12px; border-radius: 11px; color: var(--text); font: inherit; font-weight: 800; background: none; border: 0; cursor: pointer; text-align: left; }
.user-menu a:hover, .user-menu button:hover, .user-menu a:focus-visible, .user-menu button:focus-visible { background: rgba(139, 92, 255, .25); color: var(--text); }
.user-menu .ic { width: 20px; height: 20px; color: var(--muted); }
.user-menu .danger { color: #ff8aa5; }
.user-menu .danger .ic { color: #ff8aa5; }
.user-menu hr { border: 0; border-top: 1px solid var(--line); margin: 6px 0; }

/* Barre d'onglets mobile */
.tabbar { display: none; }
@media (max-width: 720px) {
  .has-tabbar .topbar .nav { display: none; }
  .tabbar {
    display: grid; grid-template-columns: repeat(5, 1fr); position: fixed; left: 0; right: 0; bottom: 0; z-index: 60;
    padding: 6px 6px calc(6px + env(safe-area-inset-bottom));
    background: linear-gradient(180deg, rgba(20, 12, 56, .94), rgba(10, 6, 34, .98));
    backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
    border-top: 1px solid var(--line); box-shadow: 0 -10px 30px rgba(0,0,0,.4);
  }
  .tabbar a { position: relative; display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 6px 2px; border-radius: 12px; color: var(--dim); font-size: .68rem; font-weight: 900; }
  .tabbar a .ic { width: 24px; height: 24px; }
  .tabbar a[aria-current="page"] { color: var(--yellow); background: rgba(255, 207, 51, .1); }
  .tabbar a[aria-current="page"] .ic { filter: drop-shadow(0 0 8px rgba(255, 207, 51, .6)); }
  .tabbar .dot-badge { position: absolute; top: 4px; right: calc(50% - 18px); width: 9px; height: 9px; border-radius: 50%; background: var(--red); box-shadow: 0 0 0 2px var(--bg-1); }
  .has-tabbar main { padding-bottom: 110px; }
  .has-tabbar .footer { padding-bottom: 100px; }
  .has-tabbar .toasts { bottom: 86px; }
  .user-menu { width: min(300px, calc(100vw - 24px)); right: -4px; }
}

/* Avatar avec anneau + pastille de niveau */
.avatar-ring {
  position: relative; width: 42px; height: 42px; flex: none; border-radius: 50%;
  display: grid; place-items: center; font-size: 1.45rem;
  background: radial-gradient(circle at 50% 35%, #3a2a8a, #140c3a);
  box-shadow: 0 0 0 2px var(--ring, var(--violet)), 0 0 14px var(--ring, var(--violet));
}
.avatar-ring.lg { width: 104px; height: 104px; font-size: 3.6rem; box-shadow: 0 0 0 4px var(--ring, var(--violet)), 0 0 30px var(--ring, var(--violet)); }
.avatar-ring.md { width: 64px; height: 64px; font-size: 2.2rem; box-shadow: 0 0 0 3px var(--ring, var(--violet)), 0 0 20px var(--ring, var(--violet)); }
.lvl-badge {
  position: absolute; right: -6px; bottom: -6px; min-width: 22px; height: 22px; padding: 0 5px;
  border-radius: 8px; display: grid; place-items: center;
  font-family: var(--display); font-size: .78rem; color: #1b0f45;
  background: linear-gradient(180deg, #fff, #c6b6ff); box-shadow: 0 2px 0 #6a50d8, 0 0 0 2px var(--bg-1);
}
.avatar-ring.lg .lvl-badge { min-width: 38px; height: 34px; font-size: 1.15rem; right: -4px; bottom: -4px; border-radius: 11px; }
.avatar-ring.md .lvl-badge { min-width: 28px; height: 26px; font-size: .9rem; }

@media (max-width: 1440px) {
  .nav a .lbl { display: none; }
  .nav a { padding: 10px; }
  .nav a .ic { width: 22px; height: 22px; }
}
@media (max-width: 720px) {
  .topbar-inner { flex-wrap: wrap; gap: 8px; }
  .nav { order: 3; flex-basis: 100%; justify-content: space-between; }
  .nav a[aria-current="page"]::after { bottom: -4px; }
  .player-chip .meta { display: none; }
  .player-chip { padding: 3px; }
  .userbox { margin-left: auto; }
  .logo-text { font-size: 1.2rem; }
}

/* ------------------------------------------------------------- Mise en page */
main { max-width: 1240px; margin: 0 auto; padding: 28px 16px 70px; position: relative; }
.grid { display: grid; gap: 20px; }
.grid-2 { grid-template-columns: repeat(auto-fit, minmax(min(320px, 100%), 1fr)); }
.grid-3 { grid-template-columns: repeat(auto-fit, minmax(min(260px, 100%), 1fr)); }
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.spacer { flex: 1; }
.card {
  position: relative;
  background: linear-gradient(180deg, rgba(48, 34, 120, .78), rgba(24, 16, 66, .82));
  border-radius: var(--radius);
  padding: 22px;
  box-shadow: var(--glow-v), inset 0 1px 0 rgba(255,255,255,.08);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}
.card > h2:first-child { margin-top: 0; }
.card-head { display: flex; align-items: center; gap: 10px; margin-bottom: 14px; }
.card-head h2 { margin: 0; }
.card-head .ico { font-size: 1.6rem; }
.card-head > .ic { width: 28px; height: 28px; color: var(--yellow); filter: drop-shadow(0 0 8px rgba(255, 207, 51, .35)); }
.page-title > .ic { width: 44px; height: 44px; color: var(--yellow); filter: drop-shadow(0 0 14px rgba(255, 207, 51, .45)); }

/* ------------------------------------------------------------- Boutons 3D */
.btn {
  --c1: #4e7bff; --c2: #2a4ce0; --sh: #172c8f;
  position: relative; overflow: hidden;
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 48px; padding: 10px 22px;
  border: 0; border-radius: 14px; cursor: pointer;
  font-family: var(--display); font-size: 1.08rem; letter-spacing: .6px; color: #fff;
  text-shadow: 0 2px 0 rgba(0,0,0,.25);
  background: linear-gradient(180deg, var(--c1), var(--c2));
  box-shadow: 0 5px 0 var(--sh), 0 10px 20px rgba(0,0,0,.35), inset 0 2px 0 rgba(255,255,255,.3);
  transform: translateY(0);
  transition: transform .12s ease, box-shadow .12s ease, filter .2s;
  user-select: none;
}
.btn::before {
  content: ''; position: absolute; top: 0; left: -120%; width: 60%; height: 100%;
  background: linear-gradient(100deg, transparent, rgba(255,255,255,.35), transparent);
  transform: skewX(-20deg); transition: left .55s ease;
}
.btn:hover { color: #fff; filter: brightness(1.08); transform: translateY(-2px); box-shadow: 0 7px 0 var(--sh), 0 14px 26px rgba(0,0,0,.4), inset 0 2px 0 rgba(255,255,255,.3); }
.btn:hover::before { left: 140%; }
.btn:active { transform: translateY(4px); box-shadow: 0 1px 0 var(--sh), 0 4px 8px rgba(0,0,0,.3), inset 0 2px 0 rgba(255,255,255,.2); }
.btn:disabled { filter: grayscale(.7) brightness(.7); cursor: not-allowed; transform: none; }
.btn-red { --c1: #ff5a80; --c2: #e01e4f; --sh: #8c0b2c; }
.btn-yellow { --c1: #ffe066; --c2: #ffb800; --sh: #b36b00; color: #4a2600; text-shadow: 0 1px 0 rgba(255,255,255,.4); }
.btn-yellow:hover { color: #4a2600; }
.btn-green { --c1: #4af5a5; --c2: #10c46e; --sh: #087042; color: #04341d; text-shadow: 0 1px 0 rgba(255,255,255,.35); }
.btn-green:hover { color: #04341d; }
.btn-violet { --c1: #a37bff; --c2: #7340ff; --sh: #3f1ea6; }
.btn-ghost { --c1: rgba(120, 95, 230, .35); --c2: rgba(80, 55, 190, .35); --sh: rgba(20, 10, 70, .9); box-shadow: 0 4px 0 var(--sh), inset 0 0 0 1px var(--line-strong); }
.btn-sm { min-height: 38px; padding: 6px 14px; font-size: .92rem; border-radius: 11px; }
.btn-lg { min-height: 64px; padding: 14px 34px; font-size: 1.5rem; border-radius: 18px; }
.btn-xl { min-height: 84px; padding: 18px 44px; font-size: 2rem; border-radius: 22px; }
.btn-block { width: 100%; }
.btn .ic { width: 1.1em; height: 1.1em; }
.btn.glow { animation: ctaGlow 2s ease-in-out infinite; }
@keyframes ctaGlow { 50% { box-shadow: 0 5px 0 var(--sh), 0 0 34px rgba(255, 207, 51, .65), inset 0 2px 0 rgba(255,255,255,.3); } }

/* ------------------------------------------------------------- Formulaires */
label, .label { display: block; font-weight: 800; margin-bottom: 7px; font-size: .95rem; }
input, select, textarea {
  width: 100%; min-height: 48px; padding: 11px 14px;
  font: inherit; color: var(--text);
  background: rgba(8, 4, 30, .7); border: 2px solid var(--line); border-radius: 13px;
  transition: border-color .2s, box-shadow .2s, background .2s;
}
textarea { min-height: 100px; resize: vertical; }
input:hover, select:hover, textarea:hover { border-color: var(--line-strong); }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--violet); box-shadow: 0 0 0 4px rgba(139, 92, 255, .25); background: rgba(12, 6, 40, .9); }
input[aria-invalid="true"] { border-color: var(--red); box-shadow: 0 0 0 4px rgba(255, 61, 104, .2); animation: shakeX .35s; }
select option { background: var(--panel-solid); }
.field { margin-bottom: 16px; }
.field-error { color: #ff8aa5; font-size: .87rem; margin-top: 5px; min-height: 1em; font-weight: 700; }
.form-msg { padding: 12px 14px; border-radius: 13px; margin-bottom: 14px; font-weight: 700; animation: revealUp .35s var(--ease-out); }
.form-msg.error { background: rgba(255, 61, 104, .15); box-shadow: inset 0 0 0 1px rgba(255, 61, 104, .6); color: #ffc2cf; }
.form-msg.ok { background: rgba(43, 234, 142, .13); box-shadow: inset 0 0 0 1px rgba(43, 234, 142, .55); color: #b8ffdc; }
@keyframes shakeX { 25% { transform: translateX(-6px); } 75% { transform: translateX(6px); } }

.tabs { display: flex; gap: 6px; margin-bottom: 20px; background: rgba(5, 2, 25, .6); padding: 5px; border-radius: 16px; box-shadow: inset 0 0 0 1px var(--line); }
.tabs button { flex: 1; min-height: 46px; border: 0; border-radius: 12px; background: transparent; color: var(--muted); font-family: var(--display); font-size: 1.1rem; letter-spacing: .5px; cursor: pointer; transition: all .25s var(--ease-out); }
.tabs button:hover { color: var(--text); }
.tabs button[aria-selected="true"] { background: linear-gradient(180deg, var(--violet), #5a2fe0); color: #fff; box-shadow: 0 4px 0 #3a1a9e, 0 6px 16px rgba(139, 92, 255, .5); }

/* ------------------------------------------------------------- Badges / rangs */
.badge { display: inline-flex; align-items: center; gap: 5px; padding: 3px 11px; border-radius: 999px; font-size: .8rem; font-weight: 900; background: var(--panel-2); color: var(--muted); box-shadow: inset 0 0 0 1px var(--line); }
.badge.live { color: #b8ffdc; background: rgba(43, 234, 142, .14); box-shadow: inset 0 0 0 1px rgba(43, 234, 142, .5); }
.badge.live::before { content: ''; width: 8px; height: 8px; border-radius: 50%; background: var(--green); box-shadow: 0 0 8px var(--green); animation: pulse 1.4s infinite; }
.rank {
  display: inline-flex; align-items: center; gap: 8px; padding: 4px 12px 4px 5px; border-radius: 999px;
  font-family: var(--display); letter-spacing: .5px; font-size: .95rem;
  background: linear-gradient(90deg, color-mix(in srgb, var(--rank) 35%, transparent), transparent);
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--rank) 70%, transparent);
  color: var(--rank);
}
.rank-gem {
  width: 22px; height: 22px; display: grid; place-items: center; flex: none;
  clip-path: polygon(50% 0, 100% 30%, 85% 100%, 15% 100%, 0 30%);
  background: linear-gradient(180deg, #fff, var(--rank) 55%, color-mix(in srgb, var(--rank) 60%, #000));
}
.streak { display: inline-flex; align-items: center; gap: 3px; font-family: var(--display); color: #ff9a3d; font-size: 1.05rem; }
.streak .ic { width: 18px; height: 18px; }
.streak.hot { animation: flame 1s ease-in-out infinite; }
@keyframes flame { 50% { transform: scale(1.12) rotate(-3deg); filter: drop-shadow(0 0 8px #ff7a1a); } }

/* Barre d'XP */
.xpbar { position: relative; height: 18px; border-radius: 10px; background: rgba(5, 2, 25, .75); box-shadow: inset 0 2px 4px rgba(0,0,0,.6), 0 0 0 1px var(--line); overflow: hidden; }
.xpbar > span { position: absolute; inset: 0 auto 0 0; border-radius: 10px; background: linear-gradient(90deg, var(--cyan), var(--violet), var(--pink)); box-shadow: 0 0 14px rgba(46, 230, 255, .6); transition: width 1.2s var(--ease-out); overflow: hidden; }
.xpbar > span::after { content: ''; position: absolute; inset: 0; background: repeating-linear-gradient(-45deg, rgba(255,255,255,.18) 0 8px, transparent 8px 16px); background-size: 22px 22px; animation: stripes 1s linear infinite; }
@keyframes stripes { to { background-position: 22px 0; } }
.xpbar > em { position: absolute; inset: 0; display: grid; place-items: center; font-style: normal; font-size: .72rem; font-weight: 900; text-shadow: 0 1px 2px #000; }

/* ------------------------------------------------------------- Accueil */
.hero { display: grid; grid-template-columns: 1.05fr .95fr; gap: 40px; align-items: center; min-height: calc(100vh - 170px); }
.hero h1 { font-size: clamp(2.6rem, 6.5vw, 5rem); margin-bottom: 14px; }
.hero h1 .accent-r { color: var(--red); text-shadow: 0 0 30px rgba(255, 61, 104, .6); }
.hero h1 .accent-y { color: var(--yellow); text-shadow: 0 0 30px rgba(255, 207, 51, .6); }
.hero .lead { font-size: 1.2rem; color: var(--muted); max-width: 560px; }
.hero-stats { display: flex; gap: 14px; margin: 26px 0; flex-wrap: wrap; }
.hero-stat { padding: 12px 18px; border-radius: 16px; background: var(--panel); box-shadow: inset 0 0 0 1px var(--line); min-width: 120px; }
.hero-stat b { display: block; font-family: var(--display); font-size: 1.8rem; font-weight: 400; color: var(--yellow); line-height: 1.1; }
.hero-stat span { color: var(--muted); font-size: .85rem; font-weight: 700; }
.hero-cta { display: flex; gap: 14px; flex-wrap: wrap; align-items: center; }
.demo-board { position: relative; max-width: 470px; margin: 0 auto; width: 100%; animation: floaty 6s ease-in-out infinite; }
.demo-board::before { content: ''; position: absolute; inset: 10% -10% -15%; background: radial-gradient(closest-side, rgba(61, 107, 255, .55), transparent); filter: blur(30px); z-index: -1; }
@keyframes floaty { 50% { transform: translateY(-14px) rotate(-1deg); } }
.demo-label { text-align: center; margin-top: 18px; color: var(--muted); font-weight: 800; }
.features { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 18px; margin-top: 40px; }
.feature { text-align: center; padding: 26px 18px; transition: transform .3s var(--ease-out); }
.feature:hover { transform: translateY(-6px) rotate(-.5deg); }
.feature .ic.big { width: 54px; height: 54px; padding: 12px; margin: 0 auto 14px; display: block; border-radius: 16px; color: var(--yellow); background: linear-gradient(180deg, rgba(255, 207, 51, .22), rgba(255, 207, 51, .06)); box-shadow: inset 0 0 0 1px rgba(255, 207, 51, .35); }
.feature:nth-child(2) .ic.big { color: var(--pink); background: linear-gradient(180deg, rgba(255, 79, 216, .22), rgba(255, 79, 216, .06)); box-shadow: inset 0 0 0 1px rgba(255, 79, 216, .35); }
.feature:nth-child(3) .ic.big { color: var(--cyan); background: linear-gradient(180deg, rgba(46, 230, 255, .2), rgba(46, 230, 255, .05)); box-shadow: inset 0 0 0 1px rgba(46, 230, 255, .35); }
.feature:nth-child(4) .ic.big { color: var(--green); background: linear-gradient(180deg, rgba(43, 234, 142, .2), rgba(43, 234, 142, .05)); box-shadow: inset 0 0 0 1px rgba(43, 234, 142, .35); }
.auth-section { display: grid; grid-template-columns: 1fr 1fr; gap: 30px; align-items: center; margin-top: 60px; }
.auth-card { max-width: 480px; width: 100%; margin: 0 auto; }
@media (max-width: 900px) { .hero, .auth-section { grid-template-columns: 1fr; gap: 26px; min-height: 0; } .demo-board { max-width: 360px; } }

/* ------------------------------------------------------------- Lobby */
.lobby-top { display: grid; grid-template-columns: 1.3fr 1fr; gap: 20px; margin-bottom: 20px; }
@media (max-width: 900px) { .lobby-top { grid-template-columns: 1fr; } }
.profile-hero { display: flex; gap: 22px; align-items: center; overflow: hidden; }
.profile-hero::after { content: ''; position: absolute; right: -60px; top: -60px; width: 240px; height: 240px; border-radius: 50%; background: radial-gradient(closest-side, rgba(255, 207, 51, .18), transparent); pointer-events: none; }
.profile-hero .info { flex: 1; min-width: 0; }
.profile-hero .pseudo { font-family: var(--display); font-size: 2rem; line-height: 1.1; margin-bottom: 8px; word-break: break-word; }
.profile-hero .row { margin-bottom: 10px; }
.play-hero {
  display: flex; flex-direction: column; justify-content: center; align-items: center; text-align: center; gap: 12px;
  background: linear-gradient(160deg, rgba(255, 61, 104, .35), rgba(139, 92, 255, .35) 55%, rgba(46, 230, 255, .25)), rgba(24, 16, 66, .85);
  overflow: hidden;
}
.play-hero::before { content: ''; position: absolute; inset: -50%; background: conic-gradient(from 0deg, transparent, rgba(255,255,255,.08), transparent 30%); animation: spin 8s linear infinite; pointer-events: none; }
.play-hero > * { position: relative; }
.mode-card { display: flex; flex-direction: column; gap: 10px; overflow: hidden; cursor: pointer; transition: transform .35s var(--ease-out), box-shadow .3s; border: 0; color: inherit; font: inherit; text-align: left; }
.mode-card:hover, .mode-card:focus-visible { transform: translateY(-8px) scale(1.02); box-shadow: 0 0 0 2px var(--accent), 0 24px 60px rgba(0,0,0,.6), 0 0 40px color-mix(in srgb, var(--accent) 45%, transparent); }
.mode-card .art { height: 120px; margin: -22px -22px 6px; position: relative; overflow: hidden; display: grid; place-items: center; font-size: 4rem; background: linear-gradient(135deg, var(--accent), color-mix(in srgb, var(--accent) 30%, #10082e)); }
.mode-card .art::before { content: ''; position: absolute; inset: 0; background: radial-gradient(circle at 20% 120%, rgba(255,255,255,.3), transparent 50%), repeating-linear-gradient(45deg, rgba(255,255,255,.06) 0 12px, transparent 12px 24px); }
.mode-card .art span { position: relative; filter: drop-shadow(0 8px 10px rgba(0,0,0,.45)); transition: transform .4s var(--ease-out); color: #fff; }
.mode-card .art .ic { width: 64px; height: 64px; }
.mode-card:hover .art span { transform: scale(1.2) rotate(-10deg); }
.mode-card h3 { font-size: 1.6rem; margin: 0; }
.mode-card p { margin: 0; color: var(--muted); }
.mode-card .tag { position: absolute; top: 12px; right: 12px; z-index: 1; }
.mode-card .foot { display: flex; align-items: center; justify-content: space-between; margin-top: auto; padding-top: 6px; }

/* Récompense quotidienne */
.daily-row { display: grid; grid-template-columns: repeat(7, 1fr); gap: 8px; margin: 12px 0 16px; }
.daily-day { position: relative; text-align: center; padding: 10px 2px 8px; border-radius: 14px; background: rgba(5, 2, 25, .55); box-shadow: inset 0 0 0 1px var(--line); font-weight: 900; font-size: .78rem; color: var(--muted); }
.daily-day .chest { display: block; margin: 4px 0; }
.daily-day .chest .ic { width: 24px; height: 24px; }
.daily-day.today .chest .ic { color: var(--yellow); }
.daily-day.done .chest .ic { color: var(--green); }
.daily-day.big .chest .ic { width: 28px; height: 28px; color: var(--gold); }
.daily-day.done { opacity: .55; }
.daily-day.today { color: var(--text); background: linear-gradient(180deg, rgba(255, 207, 51, .3), rgba(255, 207, 51, .06)); box-shadow: inset 0 0 0 2px var(--yellow), 0 0 20px rgba(255, 207, 51, .35); animation: wiggle 2.5s ease-in-out infinite; }
@keyframes wiggle { 0%, 80%, 100% { transform: rotate(0); } 85% { transform: rotate(-6deg) scale(1.06); } 90% { transform: rotate(6deg) scale(1.06); } 95% { transform: rotate(-3deg); } }
@media (max-width: 480px) { .daily-row { gap: 4px; } .daily-day .chest { font-size: 1.2rem; } .daily-day { font-size: .68rem; } }

.mini-quest { display: flex; align-items: center; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--line); }
.mini-quest:last-child { border-bottom: 0; }
.mq-ico { width: 34px; height: 34px; flex: none; display: grid; place-items: center; border-radius: 10px; background: rgba(139, 92, 255, .2); color: #cbb8ff; }
.mq-ico .ic { width: 18px; height: 18px; }
.mq-ico.ready { background: rgba(255, 207, 51, .2); color: var(--yellow); }
.mini-quest .info { flex: 1; min-width: 0; font-weight: 800; font-size: .92rem; }

/* Overlays */
.overlay { position: fixed; inset: 0; z-index: 70; display: flex; align-items: center; justify-content: center; padding: 16px; background: rgba(4, 2, 18, .82); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); animation: fadeIn .25s ease both; overflow-y: auto; }
.overlay.closing { animation: fadeOut .2s ease both; }
@keyframes fadeIn { from { opacity: 0; } }
@keyframes fadeOut { to { opacity: 0; } }
.overlay > .panel { animation: popIn .45s var(--ease-out) both; width: min(540px, 100%); text-align: center; margin: auto; }
@keyframes popIn { from { opacity: 0; transform: scale(.7) translateY(30px); } }
.radar { width: 190px; height: 190px; margin: 10px auto 22px; border-radius: 50%; position: relative; background: radial-gradient(circle, rgba(46, 230, 255, .12) 0 30%, transparent 31%), repeating-radial-gradient(circle, transparent 0 30px, rgba(46, 230, 255, .25) 30px 31px); box-shadow: 0 0 0 2px rgba(46, 230, 255, .4), 0 0 40px rgba(46, 230, 255, .3); overflow: hidden; }
.radar::before { content: ''; position: absolute; inset: 0; border-radius: 50%; background: conic-gradient(from 0deg, rgba(46, 230, 255, .55), transparent 25%); animation: spin 2s linear infinite; }
.radar .me { position: absolute; inset: 0; display: grid; place-items: center; font-size: 3rem; }
.radar .blip { position: absolute; width: 10px; height: 10px; border-radius: 50%; background: var(--yellow); box-shadow: 0 0 10px var(--yellow); animation: blip 2s ease-out infinite; }
@keyframes blip { 0% { opacity: 0; transform: scale(.3); } 20% { opacity: 1; transform: scale(1.4); } 100% { opacity: 0; } }
@keyframes spin { to { transform: rotate(360deg); } }
.search-time { font-family: var(--display); font-size: 2.6rem; color: var(--cyan); text-shadow: 0 0 20px rgba(46, 230, 255, .6); line-height: 1.1; }
.tip { color: var(--muted); font-size: .92rem; min-height: 2.8em; margin: 10px 0 18px; transition: opacity .3s; }

/* ------------------------------------------------------------- Plateau */
.game-layout { display: grid; grid-template-columns: minmax(0, 1fr) 330px; gap: 22px; align-items: start; }
@media (max-width: 980px) { .game-layout { grid-template-columns: 1fr; } }

.players { display: grid; grid-template-columns: 1fr auto 1fr; gap: 12px; align-items: center; margin-bottom: 14px; }
.player {
  display: flex; align-items: center; gap: 12px; padding: 10px 14px; min-width: 0;
  background: var(--panel); border-radius: 18px; position: relative; overflow: hidden;
  box-shadow: inset 0 0 0 2px var(--line);
  transition: box-shadow .3s, transform .3s var(--ease-out), opacity .3s;
}
.player::before { content: ''; position: absolute; inset: 0; opacity: 0; transition: opacity .3s; }
.player.p1::before { background: linear-gradient(90deg, rgba(255, 61, 104, .35), transparent 70%); }
.player.p2::before { background: linear-gradient(270deg, rgba(255, 207, 51, .3), transparent 70%); }
.player > * { position: relative; }
.player.active { transform: scale(1.04); }
.player.active::before { opacity: 1; }
.player.p1.active { box-shadow: inset 0 0 0 2px var(--red), 0 0 30px rgba(255, 61, 104, .45); }
.player.p2.active { box-shadow: inset 0 0 0 2px var(--yellow), 0 0 30px rgba(255, 207, 51, .4); }
.player:not(.active) { opacity: .8; }
.player.p2 { flex-direction: row-reverse; text-align: right; }
.player .name { font-family: var(--display); font-size: 1.2rem; letter-spacing: .4px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.player .meta { font-size: .82rem; color: var(--muted); font-weight: 800; display: flex; gap: 8px; flex-wrap: wrap; }
.player.p2 .meta { justify-content: flex-end; }
.player .pinfo { min-width: 0; flex: 1; }
.token-avatar { display: inline-block; width: 40px; height: 40px; border-radius: 50%; flex: none; box-shadow: inset 0 -4px 0 rgba(0,0,0,.3), 0 0 12px rgba(0,0,0,.4); }
.token-avatar.p1 { background: radial-gradient(circle at 35% 30%, #ffb3c4, var(--red) 45%, var(--red-2)); }
.token-avatar.p2 { background: radial-gradient(circle at 35% 30%, #fff4b8, var(--yellow) 45%, var(--yellow-2)); }
.mini-token { display: inline-block; width: 26px; height: 26px; border-radius: 50%; flex: none; box-shadow: inset 0 -3px 0 rgba(0,0,0,.3), 0 0 10px rgba(0,0,0,.4); }
.vs { font-family: var(--display); font-size: 1.8rem; color: var(--yellow); text-shadow: 0 3px 0 #7a3d00, 0 0 20px rgba(255, 207, 51, .6); transform: rotate(-6deg); }
.offline { color: #ff8aa5; }
@media (max-width: 560px) {
  .players { gap: 6px; }
  .player { padding: 8px; gap: 8px; }
  .player .avatar-ring { width: 34px; height: 34px; font-size: 1.2rem; }
  .player .lvl-badge { display: none; }
  .player .name { font-size: .98rem; }
  .player .meta { display: none; }
  .vs { font-size: 1.2rem; }
  .player .mini-token { display: none; }
}

.turn-banner { text-align: center; margin: 4px 0 18px; min-height: 64px; }
.turn-text { font-family: var(--display); font-size: clamp(1.4rem, 3.5vw, 2.1rem); letter-spacing: .8px; display: inline-block; }
.turn-text.mine { color: var(--yellow); text-shadow: 0 3px 0 #7a3d00, 0 0 24px rgba(255, 207, 51, .55); animation: pulseScale 1.2s ease-in-out infinite; }
.turn-text.theirs { color: var(--muted); }
.turn-text.win { color: var(--green); text-shadow: 0 0 24px rgba(43, 234, 142, .6); }
.turn-text.lose { color: var(--red); }
@keyframes pulseScale { 50% { transform: scale(1.06); } }
.timer-bar { height: 10px; max-width: 520px; margin: 8px auto 0; border-radius: 10px; background: rgba(5, 2, 25, .7); overflow: hidden; box-shadow: inset 0 0 0 1px var(--line); }
.timer-bar span { display: block; height: 100%; border-radius: 10px; background: linear-gradient(90deg, var(--green), var(--cyan)); transition: width .25s linear, background .3s; }
.timer-bar.low span { background: linear-gradient(90deg, var(--red), #ff8a3d); box-shadow: 0 0 14px var(--red); }
.timer-label { font-weight: 900; color: var(--muted); font-size: .85rem; margin-top: 4px; font-variant-numeric: tabular-nums; }

.board-wrap { max-width: min(600px, calc((100vh - 250px) * 7 / 6)); min-width: min(100%, 300px); margin: 0 auto; position: relative; padding-top: 30px; }
.board {
  position: relative;
  display: grid; grid-template-columns: repeat(7, 1fr);
  padding: 12px 10px 16px;
  background: linear-gradient(180deg, var(--board-a), var(--board-b));
  border-radius: 24px;
  box-shadow:
    inset 0 3px 0 rgba(255,255,255,.3),
    inset 0 -10px 0 rgba(0, 0, 60, .35),
    0 0 0 4px #1a249e,
    0 24px 60px rgba(10, 20, 120, .6),
    0 0 80px rgba(61, 107, 255, .35);
  user-select: none;
}
.board::after { content: ''; position: absolute; left: 6%; right: 6%; bottom: -26px; height: 26px; background: radial-gradient(closest-side, rgba(0,0,0,.55), transparent); z-index: -1; }
.board.shake { animation: boardShake .3s ease; }
@keyframes boardShake { 25% { transform: translate(0, 4px); } 50% { transform: translate(0, -2px); } 75% { transform: translate(0, 1px); } }
.board .col {
  display: block; width: 100%; min-width: 0; -webkit-appearance: none; appearance: none;
  border: 0; background: transparent; padding: 0; margin: 0; font: inherit; color: inherit;
  border-radius: 16px; cursor: pointer; position: relative; transition: background .2s;
  -webkit-tap-highlight-color: transparent; touch-action: manipulation;
}
.board .col-inner { display: flex; flex-direction: column; width: 100%; }
.board .col:disabled { cursor: default; }
.board.interactive .col:not(:disabled):hover, .board.interactive .col:not(:disabled):focus-visible { background: linear-gradient(180deg, rgba(255,255,255,.18), rgba(255,255,255,.04)); }
.board.interactive .col:not(:disabled):hover::before, .board.interactive .col:not(:disabled):focus-visible::before { content: '▼'; position: absolute; top: -38px; left: 50%; transform: translateX(-50%); color: var(--hover-color, var(--yellow)); font-size: 1.3rem; text-shadow: 0 0 12px currentColor; animation: arrowBob .6s ease-in-out infinite alternate; }
@keyframes arrowBob { to { transform: translate(-50%, 6px); } }
.board .cell { width: 100%; padding: 8%; position: relative; }
.board .hole {
  width: 100%; aspect-ratio: 1 / 1; border-radius: 50%; position: relative;
  background: radial-gradient(circle at 50% 70%, #160f4a, var(--hole) 70%);
  box-shadow: inset 0 6px 8px rgba(0,0,0,.75), 0 2px 0 rgba(255,255,255,.18);
}
.piece {
  position: absolute; inset: 0; border-radius: 50%; z-index: 1;
  box-shadow: inset 0 -5px 0 rgba(0,0,0,.28), inset 0 4px 0 rgba(255,255,255,.35), 0 3px 6px rgba(0,0,0,.4);
}
.piece::before { content: ''; position: absolute; inset: 18%; border-radius: 50%; box-shadow: inset 0 2px 3px rgba(0,0,0,.25), 0 1px 0 rgba(255,255,255,.25); }
.piece.p1, .mini-token.p1 { background: radial-gradient(circle at 35% 30%, #ffb3c4, var(--red) 45%, var(--red-2)); }
.piece.p2, .mini-token.p2 { background: radial-gradient(circle at 35% 30%, #fff4b8, var(--yellow) 45%, var(--yellow-2)); }
.piece.win { animation: winPulse .9s ease-in-out infinite; z-index: 2; }
.piece.win::after { content: ''; position: absolute; inset: -12%; border-radius: 50%; border: 4px solid #fff; box-shadow: 0 0 20px #fff, 0 0 40px var(--win-glow, #fff); animation: ringPulse .9s ease-in-out infinite; }
@keyframes winPulse { 50% { transform: scale(1.12); filter: brightness(1.35); } }
@keyframes ringPulse { 50% { transform: scale(1.12); opacity: .6; } }
.board.has-win .piece:not(.win) { filter: brightness(.45) saturate(.6); transition: filter .6s; }
.piece.last::before { box-shadow: inset 0 2px 3px rgba(0,0,0,.25), 0 0 0 3px rgba(255,255,255,.75); }
.board .preview { position: absolute; inset: 0; border-radius: 50%; opacity: .4; animation: previewPulse 1s ease-in-out infinite; }
@keyframes previewPulse { 50% { opacity: .2; } }

.game-actions { display: flex; justify-content: center; gap: 12px; margin-top: 22px; flex-wrap: wrap; }

/* ------------------------------------------------------------- Panneau latéral */
.side-panel .card + .card { margin-top: 18px; }
.chat-log { height: 230px; overflow-y: auto; background: rgba(5, 2, 25, .6); border-radius: 14px; padding: 10px; font-size: .95rem; box-shadow: inset 0 0 0 1px var(--line); scroll-behavior: smooth; }
.chat-log .msg { margin-bottom: 7px; word-wrap: break-word; animation: msgIn .3s var(--ease-out); }
@keyframes msgIn { from { opacity: 0; transform: translateX(-10px); } }
.chat-log .msg b.p1 { color: #ff8aa5; }
.chat-log .msg b.p2 { color: #ffe27a; }
.chat-log .msg.quick span { display: inline-block; padding: 1px 10px; border-radius: 999px; background: rgba(139, 92, 255, .35); font-weight: 800; }
.chat-log .sys { color: var(--dim); font-style: italic; font-size: .85rem; }
.quick-msgs { display: flex; flex-wrap: wrap; gap: 6px; margin: 12px 0; }
.quick-msgs .btn { min-height: 32px; padding: 4px 10px; font-size: .82rem; }
.moves-list { max-height: 170px; overflow-y: auto; margin: 0; padding: 0; list-style: none; display: grid; grid-template-columns: 1fr 1fr; gap: 4px; counter-reset: mv; }
.moves-list li { counter-increment: mv; display: flex; gap: 6px; align-items: center; padding: 4px 8px; border-radius: 8px; background: rgba(5, 2, 25, .45); font-size: .85rem; font-weight: 700; min-width: 0; }
.moves-list li::before { content: counter(mv); color: var(--dim); font-size: .75rem; min-width: 16px; }
.moves-list li i { width: 14px; height: 14px; border-radius: 50%; flex: none; }
.moves-list li i.p1 { background: radial-gradient(circle at 35% 30%, #ffb3c4, var(--red) 45%, var(--red-2)); }
.moves-list li i.p2 { background: radial-gradient(circle at 35% 30%, #fff4b8, var(--yellow) 45%, var(--yellow-2)); }

/* Écran VS */
.vs-screen { position: fixed; inset: 0; z-index: 80; display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; overflow: hidden; background: #05021a; animation: vsOut .4s ease 2.1s forwards; }
.vs-screen .side { height: 100%; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 14px; padding: 20px; }
.vs-screen .side.p1 { background: linear-gradient(120deg, #ff3d68, #7a0a2b); clip-path: polygon(0 0, 100% 0, 85% 100%, 0 100%); animation: slideL .5s var(--ease-out) both; }
.vs-screen .side.p2 { background: linear-gradient(240deg, #ffcf33, #8a4b00); clip-path: polygon(15% 0, 100% 0, 100% 100%, 0 100%); animation: slideR .5s var(--ease-out) both; }
.vs-screen .side .pname { font-family: var(--display); font-size: clamp(1.4rem, 4vw, 2.6rem); text-shadow: 0 4px 0 rgba(0,0,0,.35); text-align: center; word-break: break-word; }
.vs-screen .side .pmeta { font-weight: 900; opacity: .9; text-align: center; }
.vs-screen .side.p2 .pname, .vs-screen .side.p2 .pmeta { color: #3b1d00; text-shadow: none; }
.vs-screen .big-vs { font-family: var(--display); font-size: clamp(4rem, 12vw, 9rem); color: #fff; text-shadow: 0 6px 0 #3a1a9e, 0 0 50px #8b5cff; z-index: 2; margin: 0 -40px; animation: vsSlam .5s var(--ease-out) .35s both; }
.vs-screen .mode-label { position: absolute; top: 8%; left: 0; right: 0; text-align: center; font-family: var(--display); font-size: 1.4rem; letter-spacing: 4px; color: #fff; text-shadow: 0 2px 10px #000; animation: revealUp .5s .5s both; z-index: 3; }
@keyframes slideL { from { transform: translateX(-100%); } }
@keyframes slideR { from { transform: translateX(100%); } }
@keyframes vsSlam { from { transform: scale(4) rotate(-20deg); opacity: 0; } }
@keyframes vsOut { to { opacity: 0; visibility: hidden; } }
@media (max-width: 600px) { .vs-screen .avatar-ring.lg { width: 74px; height: 74px; font-size: 2.4rem; } .vs-screen .big-vs { margin: 0 -20px; } }

/* Écran de fin de partie */
.result-panel { position: relative; overflow: hidden; padding: 30px 24px 26px; }
.result-panel::before { content: ''; position: absolute; left: 50%; top: 70px; width: 700px; height: 700px; margin: -350px 0 0 -350px; background: repeating-conic-gradient(from 0deg, var(--ray, rgba(255, 207, 51, .16)) 0 10deg, transparent 10deg 20deg); animation: spin 18s linear infinite; z-index: 0; }
.result-panel > * { position: relative; z-index: 1; }
.result-title { font-family: var(--display); font-size: clamp(3rem, 10vw, 5rem); line-height: 1; margin: 6px 0 4px; animation: titleSlam .6s var(--ease-out) both; }
.result-title.win { color: var(--yellow); text-shadow: 0 6px 0 #8a4b00, 0 0 40px rgba(255, 207, 51, .7); }
.result-title.lose { color: #ff8aa5; text-shadow: 0 6px 0 #6b0a24, 0 0 40px rgba(255, 61, 104, .5); }
.result-title.draw { color: var(--cyan); text-shadow: 0 6px 0 #0a4b5a, 0 0 40px rgba(46, 230, 255, .5); }
@keyframes titleSlam { from { transform: scale(2.6); opacity: 0; } }
.result-sub { color: var(--muted); font-weight: 800; margin-bottom: 18px; }
.reward-list { display: grid; grid-template-columns: repeat(auto-fit, minmax(110px, 1fr)); gap: 10px; margin: 18px 0; }
.reward { padding: 12px; border-radius: 16px; background: rgba(5, 2, 25, .65); box-shadow: inset 0 0 0 1px var(--line); animation: popIn .45s var(--ease-out) both; animation-delay: calc(.5s + var(--i, 0) * .15s); }
.reward b { display: block; font-family: var(--display); font-weight: 400; font-size: 1.7rem; line-height: 1.1; }
.reward span { font-size: .8rem; color: var(--muted); font-weight: 800; }
.reward.gold b { color: var(--gold); }
.reward.xp b { color: var(--cyan); }
.reward.elo-up b { color: var(--green); }
.reward.elo-down b { color: #ff8aa5; }
.reward.fire b { color: #ff9a3d; display: inline-flex; align-items: center; gap: 4px; }
.reward b .ic { width: 22px; height: 22px; }
.levelup-banner { margin: 10px 0; padding: 12px; border-radius: 16px; font-family: var(--display); font-size: 1.5rem; background: linear-gradient(90deg, rgba(139, 92, 255, .5), rgba(255, 79, 216, .5)); box-shadow: 0 0 30px rgba(139, 92, 255, .6); animation: popIn .6s var(--ease-out) 1.2s both; }

/* ------------------------------------------------------------- Tableaux / classement */
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: separate; border-spacing: 0 6px; }
th, td { padding: 11px 14px; text-align: left; white-space: nowrap; }
th { color: var(--dim); font-size: .78rem; text-transform: uppercase; letter-spacing: .08em; font-weight: 900; }
tbody tr { background: rgba(5, 2, 25, .45); transition: background .2s; }
tbody tr:hover { background: rgba(139, 92, 255, .2); }
tbody td:first-child { border-radius: 12px 0 0 12px; }
tbody td:last-child { border-radius: 0 12px 12px 0; }
tbody tr.me { background: rgba(255, 207, 51, .14); }
.win-txt { color: var(--green); font-weight: 900; }
.loss-txt { color: #ff8aa5; font-weight: 900; }
.draw-txt { color: var(--muted); font-weight: 900; }
.podium { display: grid; grid-template-columns: 1fr 1.15fr 1fr; gap: 14px; align-items: end; margin-bottom: 26px; max-width: 760px; margin-left: auto; margin-right: auto; }
.podium .spot { text-align: center; display: flex; flex-direction: column; align-items: center; gap: 8px; min-width: 0; color: var(--text); }
.podium .spot .pname { font-family: var(--display); font-size: 1.2rem; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.podium .block { width: 100%; border-radius: 16px 16px 0 0; display: grid; place-items: center; font-family: var(--display); font-size: 2.6rem; color: rgba(255,255,255,.95); text-shadow: 0 4px 0 rgba(0,0,0,.3); }
.podium .s1 .block { height: 140px; background: linear-gradient(180deg, #ffd45c, #c98a00); box-shadow: 0 0 40px rgba(255, 212, 92, .5); }
.podium .s2 .block { height: 105px; background: linear-gradient(180deg, #e3e8ff, #8b93c4); }
.podium .s3 .block { height: 80px; background: linear-gradient(180deg, #ffb27a, #b8622a); }
.podium .crown { animation: floaty 3s ease-in-out infinite; height: 34px; color: var(--gold); filter: drop-shadow(0 0 10px rgba(255, 212, 92, .7)); }
.podium .crown .ic { width: 34px; height: 34px; }
.rank-pos { font-family: var(--display); font-size: 1.2rem; color: var(--muted); }
.rank-pos.r1 { color: var(--gold); } .rank-pos.r2 { color: #e3e8ff; } .rank-pos.r3 { color: #ffb27a; }

/* ------------------------------------------------------------- Profil */
.profile-head { display: flex; gap: 24px; align-items: center; flex-wrap: wrap; overflow: hidden; }
.stats-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); gap: 12px; }
.stat { background: rgba(5, 2, 25, .55); border-radius: 16px; padding: 14px; text-align: center; box-shadow: inset 0 0 0 1px var(--line); transition: transform .25s var(--ease-out); }
.stat:hover { transform: translateY(-4px); }
.stat .value { font-family: var(--display); font-size: 2rem; line-height: 1.1; }
.stat .label { color: var(--muted); font-size: .82rem; font-weight: 800; }
.avatar-picker { display: grid; grid-template-columns: repeat(auto-fill, minmax(56px, 1fr)); gap: 8px; }
.avatar-picker button { font-size: 1.8rem; min-height: 56px; border-radius: 14px; border: 0; background: rgba(5, 2, 25, .6); box-shadow: inset 0 0 0 2px var(--line); cursor: pointer; transition: transform .2s var(--ease-out), box-shadow .2s; }
.avatar-picker button:hover { transform: scale(1.12) rotate(-6deg); }
.avatar-picker button[aria-pressed="true"] { box-shadow: inset 0 0 0 3px var(--yellow), 0 0 18px rgba(255, 207, 51, .5); background: rgba(255, 207, 51, .12); }

/* ------------------------------------------------------------- Quêtes */
.quest { display: flex; align-items: center; gap: 14px; padding: 14px; background: rgba(5, 2, 25, .5); border-radius: 16px; box-shadow: inset 0 0 0 1px var(--line); transition: transform .25s var(--ease-out); }
.quest + .quest { margin-top: 10px; }
.quest:hover { transform: translateX(4px); }
.quest .q-ico .ic { width: 26px; height: 26px; }
.quest .q-ico { color: #cbb8ff; width: 52px; height: 52px; flex: none; display: grid; place-items: center; border-radius: 14px; background: linear-gradient(180deg, rgba(139, 92, 255, .4), rgba(139, 92, 255, .15)); }
.quest.ready { box-shadow: inset 0 0 0 2px var(--yellow), 0 0 22px rgba(255, 207, 51, .25); }
.quest.ready .q-ico { color: var(--yellow); }
.quest.claimed .q-ico { color: var(--green); }
.quest.ready .q-ico { background: linear-gradient(180deg, rgba(255, 207, 51, .55), rgba(255, 207, 51, .2)); animation: wiggle 2s infinite; }
.quest.claimed { opacity: .5; }
.quest .info { flex: 1; min-width: 0; }
.quest .info .t { font-weight: 900; }
.progress { height: 12px; background: rgba(5, 2, 25, .8); border-radius: 999px; overflow: hidden; margin-top: 7px; box-shadow: inset 0 0 0 1px var(--line); }
.progress > span { display: block; height: 100%; border-radius: 999px; background: linear-gradient(90deg, var(--yellow), #ff8a3d); box-shadow: 0 0 10px rgba(255, 207, 51, .5); transition: width 1s var(--ease-out); }
.reward-tag { display: inline-flex; align-items: center; gap: 6px; font-family: var(--display); color: var(--gold); font-size: 1.1rem; white-space: nowrap; }
@media (max-width: 480px) { .quest { flex-wrap: wrap; } .quest .q-ico { width: 42px; height: 42px; font-size: 1.4rem; } }

/* ------------------------------------------------------------- Caisses & objets */
.case-card { text-align: center; overflow: hidden; transition: transform .35s var(--ease-out), box-shadow .3s; }
.case-card:hover { transform: translateY(-8px); box-shadow: 0 0 0 2px var(--accent), 0 26px 60px rgba(0,0,0,.6), 0 0 50px color-mix(in srgb, var(--accent) 40%, transparent); }
.case-card::before { content: ''; position: absolute; left: 50%; top: 140px; width: 300px; height: 300px; margin: -150px 0 0 -150px; background: radial-gradient(closest-side, color-mix(in srgb, var(--accent) 45%, transparent), transparent); pointer-events: none; }
.case-card > * { position: relative; }
.chest-visual { width: 150px; height: 120px; margin: 6px auto 18px; position: relative; animation: floaty 3.5s ease-in-out infinite; }
.case-card:hover .chest-visual { animation: wiggle 1s ease-in-out infinite; }
.chest-visual .lid, .chest-visual .base { position: absolute; left: 0; right: 0; background: linear-gradient(180deg, var(--c1), var(--c2)); box-shadow: inset 0 -6px 0 rgba(0,0,0,.25), inset 0 3px 0 rgba(255,255,255,.35), 0 10px 24px rgba(0,0,0,.5); overflow: hidden; }
.chest-visual .lid { top: 0; height: 46%; border-radius: 22px 22px 8px 8px; }
.chest-visual .base { bottom: 0; height: 58%; border-radius: 8px 8px 14px 14px; }
.chest-visual .band { position: absolute; left: 50%; width: 22px; margin-left: -11px; top: 0; bottom: 0; background: linear-gradient(180deg, var(--b1), var(--b2)); }
.chest-visual .lock { position: absolute; left: 50%; top: 36%; width: 30px; height: 34px; margin-left: -15px; border-radius: 8px; background: linear-gradient(180deg, #fff6c8, #e2a800); box-shadow: 0 3px 0 #8a5a00, 0 0 18px rgba(255, 220, 120, .7); z-index: 2; }
.chest-bronze { --c1: #d48a4a; --c2: #8e4f1d; --b1: #6b3a14; --b2: #4a250a; }
.chest-argent { --c1: #e6ecff; --c2: #8d98c9; --b1: #5d6699; --b2: #3c4370; }
.chest-or { --c1: #ffe27a; --c2: #d99400; --b1: #a35f00; --b2: #6e3f00; }
.odds { list-style: none; padding: 0; margin: 14px 0 18px; font-size: .88rem; display: grid; gap: 5px; text-align: left; }
.odds li { display: grid; grid-template-columns: 88px 1fr 46px; align-items: center; gap: 8px; font-weight: 800; }
.odds .bar { height: 8px; border-radius: 6px; background: rgba(5, 2, 25, .7); overflow: hidden; }
.odds .bar span { display: block; height: 100%; border-radius: 6px; }
.odds li > :last-child { text-align: right; color: var(--muted); }

.item-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 14px; }
.item-grid > p { grid-column: 1 / -1; margin: 0; }
.item {
  position: relative; overflow: hidden;
  background: linear-gradient(180deg, color-mix(in srgb, var(--rarity, #9ca3af) 22%, #12093a), #0b0627);
  border-radius: 18px; padding: 16px 10px 14px; text-align: center; color: var(--text); font: inherit;
  border: 0; box-shadow: inset 0 0 0 2px color-mix(in srgb, var(--rarity, #9ca3af) 70%, transparent), 0 8px 20px rgba(0,0,0,.4);
  transition: transform .25s var(--ease-out), box-shadow .25s;
}
.item::before { content: ''; position: absolute; left: 0; right: 0; bottom: 0; height: 4px; background: var(--rarity); box-shadow: 0 0 12px var(--rarity); }
.item:hover { transform: translateY(-5px) rotate(-1deg); box-shadow: inset 0 0 0 2px var(--rarity), 0 14px 30px rgba(0,0,0,.5), 0 0 26px color-mix(in srgb, var(--rarity) 50%, transparent); }
.item.r-legendaire { animation: legendGlow 2.2s ease-in-out infinite; }
@keyframes legendGlow { 50% { box-shadow: inset 0 0 0 2px var(--rarity), 0 0 30px color-mix(in srgb, var(--rarity) 60%, transparent); } }
.item.r-legendaire .shine { position: absolute; top: -50%; left: -60%; width: 40%; height: 200%; background: linear-gradient(90deg, transparent, rgba(255,255,255,.25), transparent); transform: rotate(20deg); animation: sheen 3s ease-in-out infinite; pointer-events: none; }
@keyframes sheen { 0%, 60% { left: -60%; } 100% { left: 140%; } }
.item.selectable { cursor: pointer; }
.item[aria-pressed="true"] { box-shadow: inset 0 0 0 3px var(--yellow), 0 0 24px rgba(255, 207, 51, .5); transform: scale(1.03); }
.item[aria-pressed="true"]::after { content: '✓'; position: absolute; top: 6px; left: 8px; width: 24px; height: 24px; border-radius: 50%; background: var(--yellow); color: #3b1d00; font-weight: 900; display: grid; place-items: center; }
.item .token { width: 66px; height: 66px; border-radius: 50%; margin: 4px auto 10px; box-shadow: inset 0 -5px 0 rgba(0,0,0,.28), inset 0 4px 0 rgba(255,255,255,.3), 0 6px 14px rgba(0,0,0,.5); transition: transform .4s var(--ease-out); }
.item:hover .token { transform: rotate(25deg) scale(1.08); }
.item .name { font-weight: 900; font-size: .98rem; }
.item .rarity { font-size: .74rem; font-weight: 900; color: var(--rarity); text-transform: uppercase; letter-spacing: .08em; }
.item .equipped-tag { position: absolute; top: 8px; right: 8px; font-size: .7rem; background: var(--green); color: #04341d; padding: 2px 8px; border-radius: 8px; font-weight: 900; box-shadow: 0 0 12px rgba(43, 234, 142, .6); }
.item .actions { display: flex; gap: 6px; justify-content: center; margin-top: 10px; flex-wrap: wrap; }
.item .actions .btn { min-height: 32px; padding: 3px 10px; font-size: .8rem; }
.item.is-equipped { box-shadow: inset 0 0 0 3px var(--green), 0 0 22px rgba(43, 234, 142, .35); }

/* Ouverture de caisse */
.roulette-box { width: min(820px, 100%); min-width: 0; text-align: center; position: relative; }
.roulette { position: relative; overflow: hidden; border-radius: 20px; background: rgba(5, 2, 25, .85); padding: 18px 0; box-shadow: inset 0 0 0 2px var(--line-strong), 0 0 60px rgba(139, 92, 255, .4); }
.roulette::before, .roulette::after { content: ''; position: absolute; top: 0; bottom: 0; width: 18%; z-index: 2; pointer-events: none; }
.roulette::before { left: 0; background: linear-gradient(90deg, #05021a, transparent); }
.roulette::after { right: 0; background: linear-gradient(270deg, #05021a, transparent); }
.roulette .pointer { position: absolute; left: 50%; top: 0; bottom: 0; width: 4px; margin-left: -2px; background: var(--yellow); box-shadow: 0 0 16px var(--yellow); z-index: 3; }
.roulette .pointer::before, .roulette .pointer::after { content: ''; position: absolute; left: 50%; margin-left: -11px; border: 11px solid transparent; }
.roulette .pointer::before { top: 0; border-top-color: var(--yellow); }
.roulette .pointer::after { bottom: 0; border-bottom-color: var(--yellow); }
.roulette-strip { display: flex; gap: 10px; will-change: transform; }
.roulette-strip .item { flex: 0 0 120px; }
.reveal-zone { margin-top: 26px; position: relative; }
.reveal-card { width: 230px; margin: 0 auto 18px; animation: cardFlip .8s var(--ease-out) both; }
.reveal-card .item { padding: 26px 14px 18px; }
.reveal-card .item .token { width: 110px; height: 110px; }
.reveal-card .item .name { font-family: var(--display); font-size: 1.5rem; font-weight: 400; }
@keyframes cardFlip { from { transform: perspective(800px) rotateY(180deg) scale(.4); opacity: 0; } }
.reveal-rays { position: absolute; left: 50%; top: 40%; width: 900px; height: 900px; margin: -450px 0 0 -450px; background: repeating-conic-gradient(from 0deg, color-mix(in srgb, var(--rarity) 35%, transparent) 0 8deg, transparent 8deg 16deg); animation: spin 14s linear infinite; z-index: -1; pointer-events: none; mask-image: radial-gradient(closest-side, #000, transparent); -webkit-mask-image: radial-gradient(closest-side, #000, transparent); }

/* ------------------------------------------------------------- Échanges */
.trade { padding: 16px; background: rgba(5, 2, 25, .5); border-radius: 16px; box-shadow: inset 0 0 0 1px var(--line); }
.trade + .trade { margin-top: 12px; }
.trade.incoming.pending { box-shadow: inset 0 0 0 2px var(--yellow), 0 0 20px rgba(255, 207, 51, .2); }
.trade-sides { display: grid; grid-template-columns: 1fr auto 1fr; gap: 12px; align-items: start; margin: 12px 0; }
.chip .coin { width: 16px; height: 16px; }
.chip .coin::after { font-size: .5rem; }
.trade-sides .arrow { font-size: 1.6rem; align-self: center; color: var(--cyan); }
.chip { display: inline-flex; align-items: center; gap: 6px; padding: 4px 11px; border-radius: 999px; background: rgba(5, 2, 25, .7); box-shadow: inset 0 0 0 1px var(--rarity, var(--line)); font-size: .85rem; font-weight: 800; margin: 2px; }
.chip .dot { width: 16px; height: 16px; border-radius: 50%; }
@media (max-width: 600px) { .trade-sides { grid-template-columns: 1fr; } .chip .coin { width: 16px; height: 16px; }
.chip .coin::after { font-size: .5rem; }
.trade-sides .arrow { transform: rotate(90deg); justify-self: center; } }

/* ------------------------------------------------------------- Notifications */
.toasts { position: fixed; right: 16px; bottom: 16px; z-index: 90; display: flex; flex-direction: column; gap: 10px; max-width: min(400px, calc(100vw - 32px)); }
.toast { background: linear-gradient(180deg, #2b1d70, #1b1150); border-radius: 16px; padding: 14px 16px; box-shadow: 0 0 0 1px var(--line-strong), 0 16px 40px rgba(0,0,0,.55); border-left: 5px solid var(--violet); font-weight: 700; animation: toastIn .45s var(--ease-out) both; }
.toast.out { animation: toastOut .3s ease-in both; }
.toast.error { border-left-color: var(--red); }
.toast.success { border-left-color: var(--green); }
.toast.invite { border-left-color: var(--yellow); box-shadow: 0 0 0 2px var(--yellow), 0 0 30px rgba(255, 207, 51, .35); }
.toast .row { margin-top: 10px; }
@keyframes toastIn { from { opacity: 0; transform: translateX(110%) scale(.9); } }
@keyframes toastOut { to { opacity: 0; transform: translateX(110%); } }

.fly-coin { position: fixed; z-index: 95; pointer-events: none; transition: transform .8s cubic-bezier(.5, -0.4, .7, 1), opacity .8s; }
.float-text { position: fixed; z-index: 95; pointer-events: none; font-family: var(--display); font-size: 1.6rem; color: var(--gold); text-shadow: 0 3px 0 #7a3d00, 0 0 14px rgba(255, 207, 51, .7); animation: floatText 1.4s ease-out forwards; }
@keyframes floatText { 0% { opacity: 0; transform: translate(-50%, 0) scale(.5); } 20% { opacity: 1; transform: translate(-50%, -20px) scale(1.2); } 100% { opacity: 0; transform: translate(-50%, -90px) scale(1); } }

canvas.confetti { position: fixed; inset: 0; z-index: 99; pointer-events: none; }


@media (max-width: 720px) {
  .profile-hero { flex-direction: column; text-align: center; }
  .profile-hero .row { justify-content: center; }
  .avatar-ring.lg { width: 84px; height: 84px; font-size: 2.8rem; }
  .page-title > .ic { width: 34px; height: 34px; }
  .btn-xl { min-height: 70px; font-size: 1.7rem; padding: 14px 36px; }
  .hero-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
  .hero-stat { min-width: 0; padding: 10px; }
  .hero-stat b { font-size: 1.4rem; }
  .hero-stat span { font-size: .72rem; }
  .players .vs { display: none; }
  .players { grid-template-columns: 1fr 1fr; }
}
.footer { text-align: center; color: var(--dim); font-size: .85rem; padding: 20px 16px 30px; font-weight: 700; }
@keyframes pulse { 50% { opacity: .45; } }

@media (prefers-reduced-motion: reduce) {
  html:not(.motion-full) *, html:not(.motion-full) *::before, html:not(.motion-full) *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}
html.reduce-motion *, html.reduce-motion *::before, html.reduce-motion *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
html.no-bg-fx body::after, html.no-bg-fx .bg-tokens { display: none; }

/* ------------------------------------------------------------- Paramètres */
.settings-layout { display: grid; grid-template-columns: 250px minmax(0, 1fr); gap: 22px; align-items: start; }
.settings-nav { position: sticky; top: 90px; display: flex; flex-direction: column; gap: 4px; padding: 10px; }
.settings-nav a { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border-radius: 12px; color: var(--muted); font-weight: 800; }
.settings-nav a .ic { width: 20px; height: 20px; }
.settings-nav a:hover { color: var(--text); background: rgba(139, 92, 255, .15); }
.settings-nav a[aria-current="true"] { color: var(--text); background: linear-gradient(90deg, rgba(139, 92, 255, .45), rgba(139, 92, 255, .1)); box-shadow: inset 3px 0 0 var(--yellow); }
.settings-section { scroll-margin-top: 96px; }
.settings-section + .settings-section { margin-top: 20px; }
.settings-section h2 { display: flex; align-items: center; gap: 10px; }
.settings-section h2 .ic { width: 26px; height: 26px; color: var(--yellow); }
.setting-row { display: flex; align-items: center; gap: 16px; padding: 16px 0; border-top: 1px solid var(--line); }
.setting-row:first-of-type { border-top: 0; }
.setting-row .txt { flex: 1; min-width: 0; }
.setting-row .txt b { display: block; }
.setting-row .txt span { color: var(--muted); font-size: .88rem; }
.switch { position: relative; width: 56px; height: 32px; flex: none; }
.switch input { position: absolute; inset: 0; opacity: 0; width: 100%; height: 100%; margin: 0; cursor: pointer; min-height: 0; z-index: 1; }
.switch span { position: absolute; inset: 0; border-radius: 999px; background: rgba(5, 2, 25, .8); box-shadow: inset 0 0 0 2px var(--line-strong); transition: background .2s; }
.switch span::after { content: ''; position: absolute; top: 4px; left: 4px; width: 24px; height: 24px; border-radius: 50%; background: #cfc6f5; box-shadow: 0 2px 6px rgba(0,0,0,.4); transition: transform .25s var(--ease-out), background .2s; }
.switch input:checked + span { background: linear-gradient(180deg, var(--green), var(--green-2)); box-shadow: none; }
.switch input:checked + span::after { transform: translateX(24px); background: #fff; }
.switch input:focus-visible + span { outline: 3px solid var(--yellow); outline-offset: 2px; }
input[type="range"] { -webkit-appearance: none; appearance: none; height: 8px; min-height: 0; padding: 0; border: 0; border-radius: 8px; background: rgba(5, 2, 25, .8); width: 180px; }
input[type="range"]::-webkit-slider-thumb { -webkit-appearance: none; width: 22px; height: 22px; border-radius: 50%; background: var(--yellow); box-shadow: 0 0 10px rgba(255, 207, 51, .6); cursor: pointer; }
input[type="range"]::-moz-range-thumb { width: 22px; height: 22px; border: 0; border-radius: 50%; background: var(--yellow); cursor: pointer; }
.seg { display: inline-flex; background: rgba(5, 2, 25, .7); padding: 4px; border-radius: 12px; box-shadow: inset 0 0 0 1px var(--line); }
.seg button { border: 0; background: transparent; color: var(--muted); font: inherit; font-weight: 800; padding: 7px 12px; border-radius: 9px; cursor: pointer; }
.seg button[aria-pressed="true"] { background: var(--violet); color: #fff; }
.danger-zone { box-shadow: inset 0 0 0 1px rgba(255, 61, 104, .45), 0 18px 50px rgba(5, 2, 25, .55); }
.session-info { display: flex; gap: 12px; align-items: center; padding: 14px; border-radius: 14px; background: rgba(5, 2, 25, .5); box-shadow: inset 0 0 0 1px var(--line); margin-bottom: 14px; }
.session-info .ic { width: 28px; height: 28px; color: var(--green); }
@media (max-width: 860px) {
  .settings-layout { grid-template-columns: 1fr; }
  .settings-nav { position: static; flex-direction: row; overflow-x: auto; padding: 6px; }
  .settings-nav a { white-space: nowrap; padding: 10px 12px; }
  .settings-nav a[aria-current="true"] { box-shadow: inset 0 -3px 0 var(--yellow); }
  .setting-row { flex-wrap: wrap; }
}
