:root {
  --bg: #120424;
  --bg2: #1d0838;
  --panel: rgba(255, 255, 255, 0.05);
  --line: rgba(255, 255, 255, 0.12);
  --text: #f6eeff;
  --muted: #b9a6d6;
  --pink: #ff3ea5;
  --cyan: #22e4ff;
  --gold: #ffd23f;
  --red: #e5214f;
  --black: #1b1530;
  --green: #0fa968;
  --felt: #0b5d3f;
  --felt-line: rgba(255, 255, 255, 0.35);
  --radius: 14px;
  --dock-h: 160px;
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  font-family: Inter, system-ui, sans-serif;
  color: var(--text);
  background:
    radial-gradient(1200px 600px at 20% -10%, rgba(255, 62, 165, 0.25), transparent 60%),
    radial-gradient(900px 500px at 110% 10%, rgba(34, 228, 255, 0.18), transparent 60%),
    var(--bg);
  background-attachment: fixed;
  min-height: 100vh;
  -webkit-tap-highlight-color: transparent;
}
button { font: inherit; color: inherit; cursor: pointer; }
.hidden { display: none !important; }

.logo {
  font-family: Bungee, Inter, sans-serif;
  font-size: 1.15rem;
  letter-spacing: 0.04em;
  margin: 0;
  color: var(--text);
  text-shadow: 0 0 12px rgba(255, 62, 165, 0.7);
}
.logo span { color: var(--gold); margin-left: 0.3em; text-shadow: 0 0 12px rgba(255, 210, 63, 0.7); }
.logo.big { font-size: clamp(2rem, 9vw, 3rem); text-align: center; }

.btn {
  border: 1px solid var(--line);
  background: var(--panel);
  border-radius: 999px;
  padding: 0.55rem 1rem;
  font-weight: 600;
  transition: transform 0.1s, background 0.2s;
}
.btn:hover { background: rgba(255, 255, 255, 0.12); }
.btn:active { transform: scale(0.96); }
.btn:disabled { opacity: 0.4; cursor: default; }
.btn.primary {
  background: linear-gradient(135deg, var(--pink), #a43bff);
  border: none;
  box-shadow: 0 0 18px rgba(255, 62, 165, 0.5);
}
.icon-btn { background: none; border: none; font-size: 1.2rem; padding: 0.3rem; opacity: 0.85; }

/* --- Auth --- */
.auth { min-height: 100vh; display: grid; place-items: center; padding: 16px; }
.auth-card {
  width: min(420px, 100%);
  background: var(--bg2);
  border: 1px solid var(--line);
  border-radius: 22px;
  padding: 28px 22px;
  box-shadow: 0 0 60px rgba(255, 62, 165, 0.25);
}
.tagline { text-align: center; color: var(--muted); margin: 0.4rem 0 1.4rem; font-size: 0.9rem; }
.auth-tabs, .side-tabs { display: flex; gap: 6px; margin-bottom: 14px; }
.tab {
  flex: 1;
  border: 1px solid var(--line);
  background: transparent;
  border-radius: 999px;
  padding: 0.45rem 0.6rem;
  font-weight: 600;
  font-size: 0.85rem;
  color: var(--muted);
}
.tab.active { background: var(--text); color: var(--bg); border-color: var(--text); }
.auth-form { display: grid; gap: 12px; }
.auth-form label { display: grid; gap: 4px; font-size: 0.85rem; color: var(--muted); }
.auth-form input {
  font: inherit;
  padding: 0.7rem 0.8rem;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: rgba(0, 0, 0, 0.3);
  color: var(--text);
}
.auth-form input:focus { outline: 2px solid var(--cyan); border-color: transparent; }
fieldset { border: none; padding: 0; margin: 0; }
legend { font-size: 0.85rem; color: var(--muted); margin-bottom: 6px; }
.color-pick { display: flex; flex-wrap: wrap; gap: 8px; }
.color-pick button {
  width: 34px; height: 34px; border-radius: 50%;
  border: 3px solid transparent;
  box-shadow: 0 0 0 1px var(--line);
}
.color-pick button.selected { border-color: var(--text); box-shadow: 0 0 14px currentColor; }
.color-pick button:disabled { opacity: 0.15; cursor: not-allowed; }
.auth-error { color: var(--pink); min-height: 1.2em; text-align: center; margin: 12px 0 0; font-weight: 600; }

/* --- Barre du haut --- */
.topbar {
  position: sticky; top: 0; z-index: 20;
  display: flex; align-items: center; gap: 12px;
  padding: 10px 16px;
  background: rgba(18, 4, 36, 0.85);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}
.topbar .logo { flex: 1; }
.balance { display: flex; align-items: baseline; gap: 5px; }
.balance small { color: var(--muted); font-size: 0.7rem; text-transform: uppercase; }
.balance b { font-family: Bungee, sans-serif; font-size: 1.3rem; color: var(--gold); text-shadow: 0 0 10px rgba(255, 210, 63, 0.6); }
.balance em { font-style: normal; font-size: 0.75rem; color: var(--gold); }
.balance.bump b { animation: bump 0.5s; }
@keyframes bump { 50% { transform: scale(1.25); } }
.timer { position: relative; width: 44px; height: 44px; display: grid; place-items: center; }
.timer .ring { position: absolute; inset: 0; transform: rotate(-90deg); }
.ring-bg { fill: none; stroke: var(--line); stroke-width: 4; }
.ring-fg { fill: none; stroke: var(--cyan); stroke-width: 4; stroke-linecap: round; stroke-dasharray: 119.4; transition: stroke 0.3s; }
.timer.closing .ring-fg { stroke: var(--pink); }
.timer.locked .ring-fg { stroke: var(--gold); }

.status {
  text-align: center;
  font-family: Bungee, sans-serif;
  font-size: 0.95rem;
  letter-spacing: 0.05em;
  padding: 8px 16px 0;
  color: var(--cyan);
  text-shadow: 0 0 10px rgba(34, 228, 255, 0.6);
}
.status.spin { color: var(--gold); text-shadow: 0 0 10px rgba(255, 210, 63, 0.6); }

/* --- Disposition --- */
.layout {
  display: grid;
  gap: 16px;
  padding: 12px 16px calc(var(--dock-h) + 24px);
  max-width: 1500px;
  margin: 0 auto;
}

/* --- Roue --- */
.wheel-zone { display: grid; gap: 12px; justify-items: center; position: relative; }
.wheel-wrap { position: relative; width: min(100%, 420px); aspect-ratio: 1; }
#wheel { width: 100%; height: 100%; display: block; filter: drop-shadow(0 0 24px rgba(255, 62, 165, 0.35)); }
.big-number {
  position: absolute; left: 50%; top: 50%;
  transform: translate(-50%, -50%);
  width: 34%; aspect-ratio: 1; border-radius: 50%;
  display: grid; place-items: center;
  font-family: Bungee, sans-serif; font-size: clamp(2rem, 9vw, 3.4rem);
  border: 4px solid var(--gold);
  box-shadow: 0 0 30px var(--gold);
  animation: pop 0.45s cubic-bezier(.2, 1.6, .5, 1);
}
.big-number.red { background: var(--red); }
.big-number.black { background: var(--black); }
.big-number.green { background: var(--green); }
@keyframes pop { from { transform: translate(-50%, -50%) scale(0.2); opacity: 0; } }

.history { display: flex; gap: 5px; flex-wrap: wrap; justify-content: center; max-width: 420px; }
.history span {
  width: 28px; height: 28px; border-radius: 50%;
  display: grid; place-items: center;
  font-size: 0.75rem; font-weight: 800;
  border: 1px solid var(--line);
}
.history span:first-child { width: 36px; height: 36px; font-size: 0.95rem; border: 2px solid var(--gold); box-shadow: 0 0 10px var(--gold); }
.red { background: var(--red); }
.black { background: var(--black); }
.green { background: var(--green); }

.reactions { display: flex; gap: 6px; }
.reactions button {
  font-size: 1.3rem; background: var(--panel); border: 1px solid var(--line);
  border-radius: 50%; width: 42px; height: 42px;
}
.reactions button:active { transform: scale(0.85); }

.win-banner {
  font-family: Bungee, sans-serif; font-size: 1.6rem;
  padding: 6px 18px; border-radius: 999px;
  animation: pop2 0.5s cubic-bezier(.2, 1.6, .5, 1);
}
.win-banner.win { color: var(--gold); text-shadow: 0 0 16px var(--gold); }
.win-banner.lose { color: var(--muted); font-size: 1.1rem; }
@keyframes pop2 { from { transform: scale(0.3); opacity: 0; } }

/* --- Tapis (vertical) --- */
.felt {
  position: relative;
  display: grid;
  gap: 3px;
  padding: 10px;
  background: radial-gradient(ellipse at center, #0f7a52, var(--felt));
  border-radius: var(--radius);
  border: 3px solid #c99a2e;
  box-shadow: 0 0 0 3px #5a3d0c, 0 0 40px rgba(15, 169, 104, 0.35);
  user-select: none;
}
.cell {
  position: relative;
  display: grid; place-items: center;
  border: 1px solid var(--felt-line);
  border-radius: 6px;
  font-weight: 800; font-size: 0.95rem;
  background: transparent;
  touch-action: manipulation;
  transition: box-shadow 0.15s, filter 0.15s;
  padding: 0;
}
.cell.num.red { background: var(--red); }
.cell.num.black { background: var(--black); }
.cell.num.green { background: var(--green); }
.cell.outside { font-size: 0.72rem; letter-spacing: 0.02em; }
/* Vertical (téléphone) : 0 en haut, une transversale par ligne. */
.felt.v { grid-template-columns: 54px 44px repeat(3, 1fr); grid-template-rows: 44px repeat(12, 34px) 40px; }
.felt.v .cell.rot span { writing-mode: vertical-rl; transform: rotate(180deg); }
/* Horizontal (comme au casino) : 0 à gauche, 2:1 à droite, douzaines et chances simples en dessous. */
.felt.h { grid-template-columns: 1.15fr repeat(12, minmax(0, 1fr)) 1.15fr; grid-template-rows: repeat(3, 52px) 42px 42px; padding: 14px; }
.felt.h .cell { font-size: 1.05rem; }
.felt.h .cell.outside { font-size: 0.85rem; }
.felt.h .cell.diamond-red span, .felt.h .cell.diamond-black span { width: 22px; height: 22px; }
.cell.preview { box-shadow: 0 0 0 2px var(--cyan) inset, 0 0 12px rgba(34, 228, 255, 0.7); filter: brightness(1.2); }
.cell.diamond-red span, .cell.diamond-black span {
  display: block; width: 18px; height: 18px; transform: rotate(45deg); border: 1px solid #fff;
}
.cell.diamond-red span { background: var(--red); }
.cell.diamond-black span { background: var(--black); }
.felt.open .cell:hover { filter: brightness(1.25); box-shadow: 0 0 0 2px var(--cyan) inset; }
.felt:not(.open) .cell { cursor: not-allowed; }
.cell.win { animation: winpulse 0.8s ease-in-out 4; box-shadow: 0 0 0 3px var(--gold) inset, 0 0 18px var(--gold); z-index: 2; }
@keyframes winpulse { 50% { filter: brightness(1.6); } }

.stack { position: absolute; inset: 0; pointer-events: none; }
.mini {
  position: absolute; left: calc(3px + var(--i, 0) * 11px); bottom: 3px;
  width: 14px; height: 14px; border-radius: 50%;
  border: 2px solid #fff;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.7);
}
.mychip {
  position: absolute; right: -6px; top: -8px; z-index: 3;
  min-width: 26px; height: 26px; padding: 0 4px; border-radius: 13px;
  display: grid; place-items: center;
  font-size: 0.66rem; font-weight: 800; color: #120424;
  border: 2px dashed rgba(0, 0, 0, 0.5);
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.6), 0 0 10px currentColor;
  animation: drop 0.2s ease-out;
}
@keyframes drop { from { transform: translateY(-12px) scale(1.4); opacity: 0; } }

/* --- Dock jetons --- */
.dock {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 30;
  display: flex; flex-wrap: wrap; gap: 8px 16px; align-items: center; justify-content: center;
  padding: 10px 16px calc(10px + env(safe-area-inset-bottom));
  background: rgba(18, 4, 36, 0.92);
  backdrop-filter: blur(12px);
  border-top: 1px solid var(--line);
}
.chips { display: flex; gap: 8px; }
.chip {
  width: 50px; height: 50px; border-radius: 50%;
  font-family: Bungee, sans-serif; font-size: 0.8rem; color: #120424;
  border: 4px dashed rgba(255, 255, 255, 0.85);
  box-shadow: 0 3px 0 rgba(0, 0, 0, 0.4);
  transition: transform 0.12s;
}
.chip.selected { transform: translateY(-6px) scale(1.08); box-shadow: 0 0 18px currentColor, 0 3px 0 rgba(0, 0, 0, 0.4); }
.chip[data-v="5"] { background: #f2f2f2; color: #120424; }
.chip[data-v="10"] { background: var(--cyan); }
.chip[data-v="25"] { background: var(--pink); color: #fff; }
.chip[data-v="100"] { background: #1a1a1a; color: var(--gold); border-color: var(--gold); }
.chip[data-v="500"] { background: #a43bff; color: #fff; }
.chip[data-v="1000"] { background: var(--gold); color: #120424; border-color: #fff3b0; }
.chip[data-v="2000"] { background: #ff8a3d; color: #120424; }
.chip[data-v="5000"] { background: linear-gradient(135deg, #ff3ea5, #ffd23f); color: #120424; border-color: #fff; box-shadow: 0 0 12px rgba(255, 210, 63, 0.6), 0 3px 0 rgba(0, 0, 0, 0.4); }
.dock-actions { display: flex; gap: 6px; align-items: center; }
.dock-actions .btn { padding: 0.45rem 0.8rem; font-size: 0.85rem; }
.stake { font-size: 0.85rem; color: var(--muted); margin-right: 4px; }
.stake b { color: var(--text); font-family: Bungee, sans-serif; }

/* --- Panneau latéral --- */
.card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px; min-width: 0; }
.card-title { font-family: Bungee, sans-serif; font-weight: 400; font-size: 0.95rem; letter-spacing: 0.04em; margin: 0 0 10px; color: var(--gold); }
.players-feed { display: grid; gap: 16px; }
.feed { max-height: 420px; overflow-y: auto; }

/* Téléphone et tablette : une colonne, cartes en onglets. */
@media (max-width: 1099px) {
  .panels { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 12px; }
  .panels .card { background: none; border: none; padding: 0; }
  .card.tab-hidden { display: none; }
  .card-players .card-title, .card > .card-title { display: none; }
  .players-feed .card-title { display: block; font-family: Inter, sans-serif; font-weight: 400; font-size: 0.75rem; text-transform: uppercase; letter-spacing: 0.06em; color: var(--muted); margin: 14px 2px 4px; }
}

/* Ordinateur : roue à gauche, tapis horizontal à droite, toutes les cartes visibles en dessous. */
@media (min-width: 1100px) {
  .layout { grid-template-columns: repeat(12, minmax(0, 1fr)); align-items: start; }
  .wheel-zone { grid-column: 1 / 5; grid-row: 1 / 3; }
  .table-zone { grid-column: 5 / 13; }
  .panels { display: contents; }
  .side-tabs { display: none; }
  .card-players { grid-column: 5 / 13; }
  .players-feed { grid-template-columns: 1fr 1fr; }
  .card-ranking { grid-column: 1 / 5; }
  .card-challenges { grid-column: 5 / 9; }
  .card-shop { grid-column: 9 / 13; }
  .card-profile { grid-column: 1 / 7; }
  .card-stats { grid-column: 7 / 13; }
}
.side-tabs .tab { font-size: 0.75rem; padding: 0.4rem 0.3rem; }
.panel { display: grid; gap: 8px; }
.row {
  display: grid; grid-template-columns: auto 1fr auto; gap: 10px; align-items: center;
  padding: 8px 10px; border-radius: 10px; background: rgba(0, 0, 0, 0.2);
}
.row.me { outline: 1px solid var(--cyan); }
.avatar {
  width: 32px; height: 32px; border-radius: 50%;
  display: grid; place-items: center;
  font-weight: 800; color: #120424; position: relative;
}
.avatar.off { opacity: 0.35; }
.avatar .dot { position: absolute; right: -1px; bottom: -1px; width: 10px; height: 10px; border-radius: 50%; background: #3dff8a; border: 2px solid var(--bg); }
.row .name { font-weight: 600; }
.row .sub { font-size: 0.75rem; color: var(--muted); }
.row .amount { font-family: Bungee, sans-serif; font-size: 0.9rem; color: var(--gold); text-align: right; }
.row .amount small { display: block; font-family: Inter, sans-serif; font-size: 0.7rem; color: var(--muted); }
.rank-pos { font-family: Bungee, sans-serif; width: 32px; text-align: center; font-size: 1.1rem; }
.unranked { opacity: 0.55; }
.note { font-size: 0.8rem; color: var(--muted); margin: 4px 2px; }
.feed-item { font-size: 0.85rem; padding: 8px 10px; border-left: 3px solid var(--pink); background: rgba(0, 0, 0, 0.2); border-radius: 0 8px 8px 0; }
.feed-item time { display: block; font-size: 0.7rem; color: var(--muted); }
.stat-block h4 { margin: 6px 0; font-size: 0.8rem; color: var(--muted); text-transform: uppercase; letter-spacing: 0.05em; }
.stat-nums { display: flex; gap: 6px; flex-wrap: wrap; }
.stat-nums span { display: grid; place-items: center; width: 40px; padding: 4px 0; border-radius: 8px; font-weight: 800; font-size: 0.9rem; }
.stat-nums small { font-weight: 400; font-size: 0.65rem; opacity: 0.8; }
.split { display: flex; height: 14px; border-radius: 7px; overflow: hidden; margin: 4px 0; }
.split div { height: 100%; }
.kv { display: flex; justify-content: space-between; font-size: 0.85rem; padding: 3px 0; }
.kv b { color: var(--gold); }

/* --- Effets --- */
.floaters { position: fixed; inset: 0; pointer-events: none; z-index: 40; overflow: hidden; }
.floater {
  position: absolute; bottom: 120px; font-size: 2rem;
  animation: floatup 2.6s ease-out forwards;
  display: grid; justify-items: center;
}
.floater small { font-size: 0.7rem; font-weight: 800; padding: 1px 6px; border-radius: 6px; color: #120424; }
@keyframes floatup { to { transform: translateY(-60vh) scale(1.3); opacity: 0; } }
.confetti { position: fixed; inset: 0; width: 100vw; height: 100vh; pointer-events: none; z-index: 45; }
.shake { animation: shake 0.5s; }
@keyframes shake { 20%, 60% { transform: translateX(-6px); } 40%, 80% { transform: translateX(6px); } }

.toast {
  position: fixed; left: 50%; bottom: calc(var(--dock-h) + 12px); transform: translateX(-50%);
  background: var(--pink); color: #fff; font-weight: 600;
  padding: 8px 16px; border-radius: 999px; z-index: 50;
  box-shadow: 0 0 20px rgba(255, 62, 165, 0.6);
}

.modal { position: fixed; inset: 0; z-index: 60; display: grid; place-items: center; padding: 16px; background: rgba(8, 0, 20, 0.8); backdrop-filter: blur(6px); }
.modal-card {
  width: min(440px, 100%); background: var(--bg2); border: 1px solid var(--line);
  border-radius: 22px; padding: 24px; display: grid; gap: 16px; text-align: center;
  box-shadow: 0 0 60px rgba(255, 210, 63, 0.3);
}
.podium { display: flex; justify-content: center; align-items: end; gap: 10px; height: 190px; }
.podium .step { width: 30%; display: grid; justify-items: center; align-content: end; gap: 6px; }
.podium .block {
  width: 100%; border-radius: 10px 10px 0 0; display: grid; place-items: center;
  font-family: Bungee, sans-serif; font-size: 1.4rem; color: #120424;
}
.podium .p1 .block { height: 110px; background: var(--gold); box-shadow: 0 0 24px var(--gold); }
.podium .p2 .block { height: 80px; background: #d8d8e8; }
.podium .p3 .block { height: 60px; background: #e0975a; }
.podium .who { font-weight: 800; font-size: 0.9rem; }
.podium .who small { display: block; font-weight: 400; color: var(--gold); }

@media (max-width: 520px) {
  :root { --dock-h: 172px; }
  .topbar { gap: 8px; padding: 8px 12px; }
  .topbar .logo { font-size: 0.9rem; }
  .balance small { display: none; }
  .chip { width: 38px; height: 38px; font-size: 0.62rem; border-width: 3px; }
  .felt.v { grid-template-columns: 48px 38px repeat(3, 1fr); grid-template-rows: 40px repeat(12, 32px) 38px; }
  .chips { gap: 5px; }
  .wheel-wrap { width: min(100%, 300px); }
}

/* ================= v0.2 : défis, bonus, championnat ================= */

.lasthour {
  font-family: Bungee, sans-serif; font-size: 0.7rem; color: #fff;
  background: var(--pink); padding: 3px 8px; border-radius: 999px;
  box-shadow: 0 0 14px var(--pink); animation: blink 1.2s infinite;
}
@keyframes blink { 50% { opacity: 0.55; } }

.golden-banner {
  margin: 6px auto 0; width: fit-content; max-width: calc(100% - 32px);
  text-align: center; font-size: 0.9rem; font-weight: 600;
  padding: 4px 14px; border-radius: 999px;
  background: linear-gradient(90deg, rgba(255, 210, 63, 0.15), rgba(255, 210, 63, 0.3), rgba(255, 210, 63, 0.15));
  border: 1px solid var(--gold); color: var(--gold);
  box-shadow: 0 0 16px rgba(255, 210, 63, 0.35);
}
.golden-banner b { font-family: Bungee, sans-serif; font-weight: 400; }
.golden-banner span { display: inline-grid; place-items: center; min-width: 26px; height: 26px; border-radius: 50%; color: #fff; font-weight: 800; }
.cell.golden { box-shadow: 0 0 0 3px var(--gold) inset, 0 0 16px var(--gold); animation: shimmer 1.4s infinite; z-index: 1; }
@keyframes shimmer { 50% { box-shadow: 0 0 0 3px #fff3b0 inset, 0 0 26px var(--gold); } }
.big-number.gold { border-color: #fff3b0; box-shadow: 0 0 50px var(--gold), 0 0 0 6px var(--gold); }

/* Zones de mises intérieures */
.spot {
  position: absolute; z-index: 4;
  width: 18px; height: 18px; padding: 0;
  transform: translate(-50%, -50%);
  border-radius: 50%; border: none; background: transparent;
  touch-action: manipulation;
}
.felt.open .spot:hover { background: rgba(34, 228, 255, 0.35); box-shadow: 0 0 0 2px var(--cyan); }
.felt:not(.open) .spot { cursor: not-allowed; }
.spot .mychip { right: auto; top: 50%; left: 50%; transform: translate(-50%, -50%); min-width: 22px; height: 22px; font-size: 0.6rem; }
.spot .mini { left: calc(-2px + var(--i, 0) * 6px); bottom: auto; top: -4px; width: 12px; height: 12px; }
.spot.win { animation: winpulse 0.8s ease-in-out 4; box-shadow: 0 0 0 3px var(--gold), 0 0 14px var(--gold); background: rgba(255, 210, 63, 0.4); }
.hint { font-size: 0.75rem; color: var(--muted); text-align: center; margin: 8px 4px 0; }

/* Bonus dans le dock */
.boosts { display: flex; gap: 6px; flex-wrap: wrap; justify-content: center; width: 100%; }
.boost {
  border: 1px solid var(--line); background: var(--panel); border-radius: 999px;
  padding: 0.35rem 0.75rem; font-size: 0.8rem; font-weight: 600;
}
.boost b { color: var(--gold); }
.boost em { font-style: normal; font-size: 0.7rem; color: #120424; background: var(--gold); padding: 1px 6px; border-radius: 999px; }
.boost.on { border-color: var(--gold); box-shadow: 0 0 14px rgba(255, 210, 63, 0.6); }
.boost:disabled { opacity: 0.4; cursor: default; }
.boost.rescue { background: linear-gradient(135deg, #ffd23f, #ff8a3d); color: #120424; border: none; animation: blink 1.4s infinite; }

/* Onglets & panneaux */
.side-tabs { flex-wrap: wrap; }
.side-tabs .tab { position: relative; flex: 1 1 auto; }
.tab .badge { position: absolute; top: -3px; right: -3px; width: 10px; height: 10px; border-radius: 50%; background: var(--pink); box-shadow: 0 0 8px var(--pink); }
.panel-title { font-size: 0.75rem; text-transform: uppercase; letter-spacing: 0.06em; color: var(--muted); margin: 14px 2px 4px; }
.seg { display: flex; background: rgba(0, 0, 0, 0.25); border-radius: 999px; padding: 3px; gap: 3px; }
.seg button { flex: 1; border: none; background: none; border-radius: 999px; padding: 0.35rem; font-size: 0.8rem; font-weight: 600; color: var(--muted); }
.seg button.on { background: var(--gold); color: #120424; }
.btn.small { padding: 0.3rem 0.7rem; font-size: 0.78rem; }
.crowns { font-size: 0.8rem; }

.objective {
  display: grid; grid-template-columns: 28px 1fr; gap: 10px; align-items: start;
  padding: 10px; border-radius: 10px; background: rgba(0, 0, 0, 0.2); border: 1px solid transparent;
}
.objective .check {
  width: 26px; height: 26px; border-radius: 8px; border: 2px solid var(--line);
  display: grid; place-items: center; font-weight: 800; color: #120424;
}
.objective.done { border-color: rgba(124, 255, 107, 0.5); }
.objective.done .check { background: #7cff6b; border-color: #7cff6b; }
.objective.done .name { text-decoration: line-through; opacity: 0.7; }
.objective .name { font-weight: 600; font-size: 0.9rem; }
.sub { font-size: 0.75rem; color: var(--muted); }
.bar { height: 6px; border-radius: 3px; background: rgba(255, 255, 255, 0.1); margin-top: 6px; overflow: hidden; }
.bar i { display: block; height: 100%; background: linear-gradient(90deg, var(--pink), var(--gold)); }
.streak { padding: 10px; border-radius: 10px; background: rgba(0, 0, 0, 0.2); font-size: 0.95rem; }
.streak b { font-family: Bungee, sans-serif; color: var(--gold); font-weight: 400; }
.streak .sub { display: block; margin-top: 2px; }
.duel { display: flex; justify-content: space-between; align-items: center; gap: 8px; flex-wrap: wrap; padding: 8px 10px; border-radius: 10px; background: rgba(0, 0, 0, 0.2); font-size: 0.85rem; }
.duel.live { border: 1px solid var(--pink); box-shadow: 0 0 10px rgba(255, 62, 165, 0.3); }
.duel.live b { color: var(--gold); }
.duel.muted { opacity: 0.6; }
.challenge { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 4px; }

.profile-head { display: grid; grid-template-columns: auto 1fr auto; gap: 10px; align-items: center; padding: 10px; border-radius: 12px; background: rgba(0, 0, 0, 0.25); }
.profile-head .avatar { width: 44px; height: 44px; font-size: 1.2rem; }
.profile-head .name { font-weight: 800; font-size: 1.05rem; }
.profile-head .amount { font-family: Bungee, sans-serif; color: var(--gold); text-align: right; }
.profile-head .amount small { display: block; font-family: Inter, sans-serif; font-size: 0.7rem; color: var(--muted); }
.item { display: grid; grid-template-columns: 32px 1fr; gap: 8px; align-items: center; padding: 6px 4px; }
.item .ico { font-size: 1.4rem; text-align: center; }
.item b { color: var(--gold); }
.badges { display: grid; grid-template-columns: repeat(auto-fill, minmax(92px, 1fr)); gap: 6px; }
.badge-card { padding: 6px 4px; border-radius: 10px; border: 1px solid transparent; background: rgba(0, 0, 0, 0.2); opacity: 0.5; text-align: center; display: grid; gap: 1px; align-content: start; }
.badge-card.got { opacity: 1; border: 1px solid rgba(255, 210, 63, 0.5); box-shadow: 0 0 10px rgba(255, 210, 63, 0.15); }
.badge-card .ico { font-size: 1.3rem; }
.badge-card .name { font-weight: 700; font-size: 0.8rem; }
.badge-card .sub { font-size: 0.68rem; }
.badge-card .coins { font-size: 0.68rem; color: var(--gold); font-weight: 700; }

.spark { width: 100%; height: 70px; display: block; margin: 4px 0; }
.spark-line, .spark-base { vector-effect: non-scaling-stroke; }
.spark-base { stroke: rgba(255, 255, 255, 0.25); stroke-dasharray: 4 4; }
.spark-line { fill: none; stroke-width: 2.5; stroke-linejoin: round; }
.spark-line.up, .spark-dot.up { stroke: #7cff6b; fill: none; }
.spark-line.down, .spark-dot.down { stroke: var(--pink); }
.spark-dot.up { fill: #7cff6b; }
.spark-dot.down { fill: var(--pink); }

.toast.gold { background: var(--gold); color: #120424; box-shadow: 0 0 24px rgba(255, 210, 63, 0.7); }
.crown-big { font-size: 4rem; line-height: 1; animation: pop 0.6s cubic-bezier(.2, 1.6, .5, 1); }
.champion { font-family: Bungee, sans-serif; font-size: 1.6rem; color: var(--gold); margin: 0; text-shadow: 0 0 16px var(--gold); }
.win-banner small { font-family: Inter, sans-serif; font-size: 0.85rem; color: var(--text); }

/* ================= v0.4 : chrono, porte-monnaie, boutique, guide ================= */

.topbar { display: block; padding: 8px 16px 10px; }
.topbar-row { display: flex; align-items: center; gap: 10px; }
.topbar-row .logo { flex: 1; }
.guide-btn { white-space: nowrap; }

.wallet { display: flex; gap: 8px; margin-top: 8px; overflow-x: auto; scrollbar-width: none; }
.wallet::-webkit-scrollbar { display: none; }
.wpill {
  flex: 1 0 auto; display: grid; gap: 1px; text-align: left;
  padding: 6px 12px; border-radius: 12px; border: 1px solid var(--line); background: rgba(0, 0, 0, 0.3);
}
.wpill .wv { font-size: 0.85rem; font-weight: 600; white-space: nowrap; }
.wpill b { font-family: Bungee, sans-serif; font-weight: 400; font-size: 1.05rem; }
.wpill small { font-size: 0.68rem; color: var(--muted); white-space: nowrap; }
.wpill.anf b { color: var(--gold); text-shadow: 0 0 10px rgba(255, 210, 63, 0.5); }
.wpill.dc b { color: var(--cyan); }
.wpill.ab b { color: var(--pink); }
.wpill:hover { border-color: rgba(255, 255, 255, 0.35); }
.wpill.bump b { animation: bump 0.5s; }

.bigtimer {
  position: relative; margin-top: 8px;
  display: grid; grid-template-columns: 1fr auto; align-items: center; gap: 4px 12px;
  padding: 8px 14px 12px; border-radius: 14px;
  background: linear-gradient(90deg, rgba(34, 228, 255, 0.12), rgba(34, 228, 255, 0.03));
  border: 1px solid rgba(34, 228, 255, 0.45);
  overflow: hidden;
}
.bt-label { font-family: Bungee, sans-serif; font-size: clamp(1rem, 2.6vw, 1.5rem); color: var(--cyan); text-shadow: 0 0 12px rgba(34, 228, 255, 0.6); line-height: 1.1; }
.bt-sub { font-size: 0.8rem; color: var(--muted); margin-top: 2px; }
.bt-sec { font-family: Bungee, sans-serif; font-size: clamp(2.6rem, 7vw, 4.2rem); line-height: 1; color: var(--cyan); text-shadow: 0 0 16px rgba(34, 228, 255, 0.7); }
.bt-sec small { font-size: 0.4em; margin-left: 2px; }
.bt-bar { position: absolute; left: 0; right: 0; bottom: 0; height: 5px; background: rgba(255, 255, 255, 0.08); }
.bt-bar i { display: block; height: 100%; background: var(--cyan); box-shadow: 0 0 10px var(--cyan); transition: width 0.2s linear; }
.bigtimer.closing { border-color: var(--pink); background: linear-gradient(90deg, rgba(255, 62, 165, 0.22), rgba(255, 62, 165, 0.05)); animation: urgent 0.5s ease-in-out infinite alternate; }
.bigtimer.closing .bt-label, .bigtimer.closing .bt-sec { color: var(--pink); text-shadow: 0 0 16px rgba(255, 62, 165, 0.8); }
.bigtimer.closing .bt-bar i { background: var(--pink); box-shadow: 0 0 10px var(--pink); }
@keyframes urgent { to { box-shadow: 0 0 22px rgba(255, 62, 165, 0.5); } }
.bigtimer[data-phase="spin"], .bigtimer[data-phase="result"] { border-color: rgba(255, 210, 63, 0.5); background: linear-gradient(90deg, rgba(255, 210, 63, 0.14), rgba(255, 210, 63, 0.03)); }
.bigtimer[data-phase="spin"] .bt-label, .bigtimer[data-phase="spin"] .bt-sec,
.bigtimer[data-phase="result"] .bt-label, .bigtimer[data-phase="result"] .bt-sec { color: var(--gold); text-shadow: 0 0 14px rgba(255, 210, 63, 0.6); }
.bigtimer[data-phase="spin"] .bt-bar i, .bigtimer[data-phase="result"] .bt-bar i { background: var(--gold); box-shadow: 0 0 10px var(--gold); }

.wheel-count {
  position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%);
  width: 30%; aspect-ratio: 1; border-radius: 50%;
  display: grid; place-items: center;
  font-family: Bungee, sans-serif; font-size: clamp(2.2rem, 8vw, 3.6rem); color: var(--cyan);
  background: rgba(18, 4, 36, 0.85); border: 3px solid var(--cyan);
  box-shadow: 0 0 24px rgba(34, 228, 255, 0.6); pointer-events: none;
}
.wheel-count.closing { color: var(--pink); border-color: var(--pink); box-shadow: 0 0 30px rgba(255, 62, 165, 0.8); animation: bump 1s infinite; }

.avatar.emoji { font-size: 1.1rem; }
.ptitle { font-size: 0.72rem; color: var(--gold); font-style: italic; }

.shop-balance { font-size: 0.95rem; padding: 10px 12px; border-radius: 10px; background: rgba(34, 228, 255, 0.1); border: 1px solid rgba(34, 228, 255, 0.4); }
.shop-balance b { font-family: Bungee, sans-serif; font-weight: 400; color: var(--cyan); font-size: 1.3rem; }
.shop-row { display: grid; grid-template-columns: 28px 1fr auto; gap: 8px; align-items: center; padding: 6px 4px; border-bottom: 1px solid rgba(255, 255, 255, 0.05); }
.shop-row .ico { font-size: 1.2rem; text-align: center; }
.shop-row .name { font-weight: 600; font-size: 0.88rem; }
.shop-row .name small { color: var(--muted); font-weight: 400; }
.btn.buy { border-color: var(--cyan); color: var(--cyan); white-space: nowrap; }
.btn.equipped { background: var(--gold); color: #120424; border-color: var(--gold); }
.shop-emojis { display: grid; grid-template-columns: repeat(auto-fill, minmax(70px, 1fr)); gap: 6px; }
.shop-emoji { display: grid; justify-items: center; gap: 4px; padding: 6px; border-radius: 10px; background: rgba(0, 0, 0, 0.2); border: 1px solid transparent; }
.shop-emoji span { font-size: 1.6rem; }
.shop-emoji.on { border-color: var(--gold); }
.shop-emoji .btn { padding: 0.2rem 0.5rem; font-size: 0.7rem; }

.guide-card { text-align: left; max-height: calc(100vh - 32px); overflow-y: auto; width: min(620px, 100%); gap: 10px; }
.guide-card h2 { text-align: center; }
.guide-card section { padding: 10px 12px; border-radius: 12px; background: rgba(0, 0, 0, 0.2); border: 1px solid transparent; }
.guide-card section.focus { border-color: var(--gold); box-shadow: 0 0 16px rgba(255, 210, 63, 0.3); }
.guide-card h3 { margin: 0 0 6px; font-size: 1rem; }
.guide-card p, .guide-card li { font-size: 0.9rem; line-height: 1.45; margin: 4px 0; color: #e8dcf7; }
.guide-card ul { margin: 4px 0; padding-left: 20px; }
.g-tip { color: var(--muted) !important; font-size: 0.8rem !important; }

@media (max-width: 520px) {
  .topbar { padding: 6px 12px 8px; }
  .guide-btn span { display: none; }
  .wpill { padding: 4px 10px; }
  .wpill small { font-size: 0.6rem; }
  .bigtimer { padding: 6px 12px 10px; margin-top: 6px; }
  .bt-sub { font-size: 0.72rem; }
}
@media (max-width: 520px) {
  .wallet { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; overflow: visible; }
  .wpill.bonus { display: none; }
  .wpill { padding: 4px 8px; }
  .wpill .wv { font-size: 0.72rem; }
  .wpill b { font-size: 0.95rem; }
  .wpill small { white-space: normal; line-height: 1.15; }
}

/* ================= Chat ================= */
.chat-col { display: flex; flex-direction: column; min-width: 0; }
.chat-log {
  height: 340px; overflow-y: auto; display: flex; flex-direction: column; gap: 6px;
  padding: 10px; border-radius: 10px; background: rgba(0, 0, 0, 0.25);
}
.msg { max-width: 85%; align-self: flex-start; padding: 6px 10px; border-radius: 12px 12px 12px 4px; background: rgba(255, 255, 255, 0.07); }
.msg.mine { align-self: flex-end; border-radius: 12px 12px 4px 12px; background: rgba(255, 62, 165, 0.16); }
.msg.pending { opacity: 0.6; }
.msg-head { display: flex; gap: 8px; align-items: baseline; font-size: 0.75rem; }
.msg-head time { color: var(--muted); font-size: 0.68rem; }
.msg-text { font-size: 0.9rem; line-height: 1.35; overflow-wrap: anywhere; }
.log-event { align-self: center; max-width: 95%; text-align: center; font-size: 0.74rem; color: var(--muted); padding: 1px 6px; }
.log-event time { margin-right: 6px; opacity: 0.7; }
.chat-form { display: flex; gap: 6px; margin-top: 8px; }
.chat-form input {
  flex: 1; min-width: 0; font: inherit; font-size: 0.9rem;
  padding: 0.55rem 0.85rem; border-radius: 999px;
  border: 1px solid var(--line); background: rgba(0, 0, 0, 0.3); color: var(--text);
}
.chat-form input:focus { outline: 2px solid var(--cyan); border-color: transparent; }
@media (min-width: 1100px) { .players-feed { grid-template-columns: 1fr 1.3fr; } }
@media (max-width: 520px) { .chat-log { height: 300px; } }

/* ================= Version sobre : moins de néons, de halos et de clignotements ================= */
body { background: linear-gradient(180deg, #170733 0%, #100322 60%) fixed; }
* { text-shadow: none !important; }
.btn.primary { background: var(--pink); box-shadow: none; }
#wheel { filter: drop-shadow(0 6px 20px rgba(0, 0, 0, 0.45)); }
.felt { background: #0d6545; border: 2px solid #9c7a2e; box-shadow: none; }
.cell.win, .spot.win { animation: none; box-shadow: 0 0 0 3px var(--gold) inset; }
.spot.win { box-shadow: 0 0 0 2px var(--gold); }
.cell.golden { animation: none; box-shadow: 0 0 0 2px var(--gold) inset; }
.cell.preview { box-shadow: 0 0 0 2px var(--cyan) inset; filter: brightness(1.15); }
.history span:first-child { box-shadow: none; }
.big-number { box-shadow: 0 8px 24px rgba(0, 0, 0, 0.45); }
.big-number.gold { box-shadow: 0 0 0 4px var(--gold); }
.chip.selected { transform: translateY(-4px); box-shadow: 0 0 0 3px #fff, 0 3px 0 rgba(0, 0, 0, 0.4); }
.chip[data-v="5000"] { box-shadow: 0 3px 0 rgba(0, 0, 0, 0.4); }
.mychip { box-shadow: 0 2px 4px rgba(0, 0, 0, 0.5); }
.lasthour, .boost.rescue { animation: none; box-shadow: none; }
.golden-banner { background: rgba(255, 210, 63, 0.08); box-shadow: none; }
.boost.on { background: rgba(255, 210, 63, 0.14); box-shadow: none; }
.badge-card.got, .duel.live, .shop-balance { box-shadow: none; }
.tab .badge { box-shadow: none; }
.toast, .toast.gold { box-shadow: 0 6px 20px rgba(0, 0, 0, 0.4); }
.auth-card, .modal-card { box-shadow: 0 20px 60px rgba(0, 0, 0, 0.55); }
.guide-card section.focus { box-shadow: none; }
.card-title { font-family: Inter, sans-serif; font-weight: 700; font-size: 0.78rem; text-transform: uppercase; letter-spacing: 0.08em; color: var(--muted); }
.bigtimer, .bigtimer[data-phase="spin"], .bigtimer[data-phase="result"], .bigtimer.closing {
  background: rgba(255, 255, 255, 0.04); border-color: var(--line); animation: none; box-shadow: none;
}
.bigtimer.closing { border-color: rgba(255, 62, 165, 0.6); }
.bt-label { font-family: Inter, sans-serif; font-weight: 800; text-transform: uppercase; letter-spacing: 0.03em; color: var(--text); }
.bt-bar i { box-shadow: none !important; }
.wheel-count, .wheel-count.closing { box-shadow: none; animation: none; }
.chat-peek {
  position: fixed; z-index: 35; left: 50%; transform: translateX(-50%);
  top: 200px; width: min(520px, calc(100% - 32px));
  text-align: left; font-size: 0.9rem; line-height: 1.3;
  padding: 10px 14px; border-radius: 14px; border: 1px solid var(--line);
  background: rgba(29, 8, 56, 0.96); box-shadow: 0 8px 24px rgba(0, 0, 0, 0.5);
  overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical;
  animation: drop 0.2s ease-out;
}
.chat-peek.hidden { display: none; }

/* ================= Mises favorites ================= */
.fav-btn { border-color: rgba(255, 210, 63, 0.5); }
.fav-sheet {
  position: fixed; z-index: 40; left: 50%; transform: translateX(-50%);
  bottom: calc(var(--dock-h) + 8px); width: min(480px, calc(100% - 32px));
  max-height: min(60vh, 460px); overflow-y: auto;
  padding: 12px 14px; border-radius: 16px; border: 1px solid var(--line);
  background: #1d0838; box-shadow: 0 12px 40px rgba(0, 0, 0, 0.55);
  display: grid; gap: 8px;
}
.fav-head { display: flex; justify-content: space-between; align-items: center; }
.fav-list { display: grid; gap: 6px; }
.fav-row { display: grid; grid-template-columns: 1fr auto auto; gap: 8px; align-items: center; padding: 8px 10px; border-radius: 10px; background: rgba(0, 0, 0, 0.25); }
.fav-info { min-width: 0; }
.fav-info .name { font-weight: 600; font-size: 0.9rem; }
.fav-info .sub { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.fav-info small { color: var(--gold); }
.fav-total { font-size: 0.75rem; color: var(--gold); font-weight: 700; margin-left: 4px; }
.fav-form { display: flex; gap: 6px; }
.fav-form input {
  flex: 1; min-width: 0; font: inherit; font-size: 0.85rem; padding: 0.5rem 0.8rem; border-radius: 999px;
  border: 1px solid var(--line); background: rgba(0, 0, 0, 0.3); color: var(--text);
}
.fav-form input:focus { outline: 2px solid var(--cyan); border-color: transparent; }
@media (max-width: 520px) { .dock-actions .btn { padding: 0.4rem 0.6rem; font-size: 0.8rem; } }
@media (max-width: 520px) { .fav-word { display: none; } .stake { white-space: nowrap; } }
