:root {
  --bg: #07080d;
  --glass: rgba(16, 19, 31, .82);
  --surface-2: rgba(30, 35, 54, .9);
  --line: rgba(255, 255, 255, .1);
  --text: #eef0f7;
  --muted: #8b92ab;
  --plus: #22c55e;
  --minus: #ef4444;
  --accent: #facc15;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; overflow: hidden; }
body {
  background: radial-gradient(ellipse at center, #151a2b 0%, var(--bg) 100%) fixed;
  background-color: var(--bg);
  color: var(--text);
  font: 15px/1.4 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}
button { font: inherit; cursor: pointer; }

/* Le terrain de jeu = tout l'écran */
#cv { position: fixed; inset: 0; width: 100vw; height: 100vh; height: 100dvh; display: block; }

/* Barre du haut, par-dessus le jeu */
.top {
  position: fixed; top: 0; left: 0; right: 0; z-index: 5;
  display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
  padding: 10px 16px; pointer-events: none;
}
.top > * { pointer-events: auto; }
.brand { font-weight: 900; letter-spacing: .08em; font-size: 20px; text-shadow: 0 2px 8px #000; }
.brand span { color: var(--accent); }
.spacer { flex: 1; }

/* Barre Vote / Malus en bas de l'écran */
.actionbar {
  position: fixed; left: 50%; bottom: 28px; transform: translateX(-50%); z-index: 6;
  display: flex; flex-direction: column; align-items: center; gap: 8px; width: max-content; max-width: calc(100% - 32px);
}
.actions { display: flex; gap: 12px; }
.act {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
  min-width: 140px; padding: 10px 18px; border-radius: 16px; border: 2px solid var(--line);
  background: var(--glass); color: var(--text); backdrop-filter: blur(8px);
  box-shadow: 0 8px 30px rgba(0,0,0,.45); transition: transform .12s, background .12s, border-color .12s;
}
.act .lbl { font-weight: 900; font-size: 20px; letter-spacing: .02em; }
.act .cd { font-size: 13px; color: var(--muted); font-variant-numeric: tabular-nums; font-weight: 600; }
.act.vote .lbl { color: var(--plus); }
.act.malus .lbl { color: var(--minus); }
.act.vote.ready { border-color: var(--plus); }
.act.malus.ready { border-color: var(--minus); }
.act.ready .cd { color: var(--text); }
.act.wait { opacity: .6; }
.act:not(.wait):hover { transform: translateY(-2px); }
.act.vote.on { background: var(--plus); border-color: var(--plus); }
.act.malus.on { background: var(--minus); border-color: var(--minus); }
.act.on .lbl, .act.on .cd { color: #fff; }
.aimhint {
  background: #141826; border: 1px solid var(--line); border-radius: 10px; padding: 7px 14px;
  font-size: 14px; text-align: center; box-shadow: 0 8px 30px rgba(0,0,0,.45);
}
.aimhint[hidden] { display: none; }
/* Coffre à bijoux (boutique) en bas à droite */
.chest {
  position: fixed; right: 18px; bottom: 22px; z-index: 7;
  width: 104px; padding: 0; border: 0; background: none; color: var(--text);
  display: flex; flex-direction: column; align-items: center; gap: 2px;
  filter: drop-shadow(0 8px 18px rgba(0,0,0,.6));
  transition: transform .15s;
}
.chest svg { width: 96px; height: 88px; overflow: visible; animation: chestHop 10s ease-in-out infinite; transform-origin: 50% 100%; }
/* petit saut toutes les 10 secondes (le saut dure ~1 s, puis le coffre reste immobile) */
@keyframes chestHop {
  0%, 10%, 100% { transform: translateY(0) scale(1, 1) rotate(0); }
  1%   { transform: translateY(0) scale(1.08, .9); }
  3%   { transform: translateY(-22px) scale(.95, 1.06) rotate(-6deg); }
  5%   { transform: translateY(0) scale(1.1, .88) rotate(0); }
  6.5% { transform: translateY(-9px) scale(.98, 1.03) rotate(5deg); }
  8%   { transform: translateY(0) scale(1.04, .96); }
}
@media (prefers-reduced-motion: reduce) { .chest svg { animation: none; } }
.chest:hover { transform: translateY(-3px) scale(1.04); }
.chest .glow { animation: chestGlow 2.4s ease-in-out infinite; transform-origin: 48px 40px; }
.chest .g1 { animation: chestBob 2s ease-in-out infinite; }
.chest .g2 { animation: chestBob 2.3s ease-in-out .3s infinite; }
.chest .g3 { animation: chestBob 2.1s ease-in-out .6s infinite; }
.chest .sp { animation: chestTwinkle 1.8s ease-in-out infinite; transform-box: fill-box; transform-origin: center; }
.chest .s2 { animation-delay: .9s; }
@keyframes chestGlow { 50% { opacity: .55; } }
@keyframes chestBob { 50% { transform: translateY(-3px); } }
@keyframes chestTwinkle { 0%, 100% { opacity: 0; transform: scale(.4); } 50% { opacity: 1; transform: scale(1); } }
.chest-count {
  position: absolute; top: -6px; right: -4px;
  background: #0e7490; border: 2px solid #67e8f9; color: #fff; border-radius: 999px;
  padding: 2px 8px; font-size: 13px; font-weight: 900; font-variant-numeric: tabular-nums; white-space: nowrap;
}
.chest-label { font-size: 12px; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; color: #fde68a; text-shadow: 0 1px 4px #000; }
.chest.on svg { filter: drop-shadow(0 0 14px rgba(103,232,249,.9)); }
.chest.on .chest-label { color: #67e8f9; }

/* Fenêtre boutique : « Le Coffre » */
.shopcard {
  width: 100%; max-width: 760px; max-height: calc(100vh - 32px); max-height: calc(100dvh - 32px);
  display: flex; flex-direction: column; overflow: hidden;
  background: #141826; border: 2px solid #b45309; border-radius: 20px;
  box-shadow: 0 0 0 4px rgba(245,158,11,.15), 0 30px 80px rgba(0,0,0,.6);
  animation: shopIn .28s cubic-bezier(.2,1.4,.4,1);
}
@keyframes shopIn { from { transform: scale(.85) translateY(20px); opacity: 0; } }
.shophead {
  position: relative; text-align: center; padding: 18px 20px 14px;
  background: radial-gradient(ellipse at 50% 0%, rgba(253,230,138,.35), transparent 70%), linear-gradient(180deg, #7a4520, #4a280f);
  border-bottom: 3px solid #f59e0b;
}
.shopicon { font-size: 44px; line-height: 1; animation: chestBob 2s ease-in-out infinite; pointer-events: none; }
.shophead h3 { margin: 4px 0 6px; font-size: 24px; font-weight: 900; letter-spacing: .04em; color: #fde68a; text-shadow: 0 2px 0 #78350f; }
.balance {
  display: inline-block; background: #0e7490; border: 2px solid #67e8f9; border-radius: 999px;
  padding: 4px 16px; font-size: 20px; font-weight: 900; font-variant-numeric: tabular-nums;
}
.shopsub { margin: 8px 0 0; font-size: 12px; color: #fcd9a6; }
.shopsub b { color: #fff; }
.shopx {
  position: absolute; top: 10px; right: 10px; width: 32px; height: 32px; border-radius: 50%;
  border: 0; background: rgba(0,0,0,.35); padding: 0;
  z-index: 2; /* au-dessus du 💰 animé, qui recouvrait la moitié gauche du bouton */
}
/* la croix = deux barres posées pile au centre du rond */
.shopx::before, .shopx::after {
  content: ""; position: absolute; left: 50%; top: 50%;
  width: 14px; height: 2.5px; margin: -1.25px 0 0 -7px; border-radius: 2px; background: #fde68a;
}
.shopx::before { transform: rotate(45deg); }
.shopx::after { transform: rotate(-45deg); }
.shopx:hover { background: rgba(0,0,0,.55); }
.shopbody { padding: 14px 16px 16px; overflow-y: auto; }
.shopbody h4 { margin: 4px 0 8px; font-size: 13px; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); }
.shopgrid { list-style: none; margin: 0 0 14px; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 10px; }
.shopitem {
  --c: #22c55e;
  position: relative; width: 100%; height: 100%; min-height: 150px;
  display: flex; flex-direction: column; align-items: center; gap: 4px; text-align: center;
  background: linear-gradient(180deg, #1f2538, #171b2a); color: var(--text);
  border: 2px solid color-mix(in srgb, var(--c) 45%, transparent); border-radius: 14px; padding: 12px 8px 10px;
  transition: transform .12s, border-color .12s, box-shadow .12s;
}
.shopitem.minus { --c: #ef4444; }
.shopitem.shield { --c: #60a5fa; }
.shopitem.freeze { --c: #a5f3fc; }
.shopitem:not(:disabled):hover { transform: translateY(-3px); border-color: var(--c); box-shadow: 0 8px 24px color-mix(in srgb, var(--c) 30%, transparent); }
.shopitem .tag {
  position: absolute; top: 6px; right: 6px; font-size: 11px; font-weight: 900; padding: 1px 6px; border-radius: 999px;
  background: color-mix(in srgb, var(--c) 22%, transparent); color: var(--c);
}
.shopitem .ico { font-size: 34px; line-height: 1.1; margin-top: 4px; }
.shopitem .nm { font-size: 14px; }
.shopitem .ds { color: var(--muted); font-size: 11px; line-height: 1.3; flex: 1; }
.shopitem .buy {
  margin-top: 4px; width: 100%; padding: 6px 4px; border-radius: 8px; font-weight: 900; font-size: 13px;
  background: var(--c); color: #0b0d14; white-space: nowrap;
}
.shopitem.locked { cursor: not-allowed; }
.shopitem.locked .ico, .shopitem.locked .nm { opacity: .55; }
.shopitem.locked .buy { background: #2a3048; color: var(--muted); font-weight: 700; font-size: 11px; }
.shopbody .earn {
  margin: 0; font-size: 12px; color: var(--muted); background: #1c2133; border-radius: 10px; padding: 10px 12px; line-height: 1.5;
}
.shopbody .earn b { color: #67e8f9; }
@media (max-width: 520px) {
  .shopgrid { grid-template-columns: repeat(2, 1fr); }
  .shopitem { min-height: 140px; }
}
.aimhint a { color: var(--muted); }
body.aiming #cv { cursor: crosshair; }
body.aiming #cv.hover { cursor: pointer; }
.me { color: var(--muted); font-size: 13px; background: var(--glass); padding: 5px 12px; border-radius: 999px; }
.me #pseudo { color: var(--text); font-weight: 600; cursor: pointer; }
.dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--plus); margin-right: 6px; }

/* Panneau du classement, flottant et repliable */
.toggle {
  position: fixed; right: 16px; top: 56px; z-index: 6;
  background: var(--glass); color: var(--text); border: 1px solid var(--line);
  border-radius: 10px; padding: 7px 14px; font-weight: 700; font-size: 13px; backdrop-filter: blur(6px);
}
.toggle::after { content: " ▴"; color: var(--muted); }
.toggle[aria-expanded="false"]::after { content: " ▾"; }
.panel {
  position: fixed; right: 16px; top: 96px; z-index: 5; width: 380px;
  max-height: calc(100vh - 250px); max-height: calc(100dvh - 250px);
  background: var(--glass); border: 1px solid var(--line); border-radius: 12px; backdrop-filter: blur(8px);
  padding: 12px; display: flex; flex-direction: column; overflow: hidden;
}
.panel.closed { display: none; }
.panel h2 { font-size: 12px; text-transform: uppercase; letter-spacing: .1em; color: var(--muted); margin: 4px 0 6px; }
.hint { margin: 0 0 10px; font-size: 12px; color: var(--muted); }
.ranking { list-style: none; margin: 0 0 12px; padding: 0; display: flex; flex-direction: column; gap: 4px; flex: none; }
.row {
  display: grid; grid-template-columns: 18px 30px 1fr auto; align-items: center; gap: 8px;
  padding: 5px 8px; border-radius: 8px; background: var(--surface-2);
}
.row .pos { color: var(--muted); font-weight: 700; font-size: 13px; text-align: right; }
.row .av { width: 30px; height: 30px; border-radius: 50%; object-fit: cover; object-position: 50% 20%; border: 2px solid; }
.row .name { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-size: 14px; }
.row .sub { display: block; font-size: 11px; color: var(--muted); font-weight: 400; }
.row .score { font-weight: 800; font-variant-numeric: tabular-nums; text-align: right; }
.row .trend { display: block; font-size: 11px; font-weight: 600; }
.up { color: var(--plus); } .down { color: var(--minus); } .flat { color: var(--muted); }
.btns { display: flex; gap: 4px; }
.btns button {
  width: 32px; height: 30px; border-radius: 6px; border: 1px solid var(--line);
  background: #0b0d14; color: var(--text); font-weight: 800; font-size: 16px;
}
.btns .p:not(:disabled):hover { background: var(--plus); border-color: var(--plus); color: #04140a; }
.btns .m:not(:disabled):hover { background: var(--minus); border-color: var(--minus); color: #1a0505; }
.btns button:disabled { opacity: .3; cursor: not-allowed; }

.feed { list-style: none; margin: 0; padding: 0; overflow-y: auto; flex: 1; min-height: 60px; font-size: 12px; }
.feed li { padding: 4px 2px; border-bottom: 1px solid var(--line); color: var(--muted); animation: in .3s ease; }
.feed li b { color: var(--text); }
@keyframes in { from { opacity: 0; transform: translateY(-4px); } }

.foot {
  position: fixed; left: 16px; bottom: 8px; z-index: 5; color: var(--muted); font-size: 11px;
  text-shadow: 0 1px 4px #000; max-width: calc(100% - 32px);
}
.foot a, .credits a { color: var(--muted); }

.modal { position: fixed; inset: 0; background: rgba(0,0,0,.65); display: grid; place-items: center; padding: 16px; z-index: 10; }
.modal[hidden] { display: none; }
.card { background: #141826; border: 1px solid var(--line); border-radius: 14px; padding: 22px; width: 100%; max-width: 360px; display: flex; flex-direction: column; gap: 10px; }
.card h3 { margin: 0; font-size: 20px; }
.card p { margin: 0; color: var(--muted); }
.card input { padding: 11px 12px; border-radius: 8px; border: 1px solid var(--line); background: #07080d; color: var(--text); font: inherit; }
.card button { padding: 11px; border-radius: 8px; border: 0; background: var(--accent); color: #1a1500; font-weight: 800; }
.card .ghost { background: transparent; color: var(--muted); font-weight: 500; }
.credits { max-width: 480px; }
.credits ul { margin: 0; padding-left: 18px; font-size: 13px; color: var(--muted); display: flex; flex-direction: column; gap: 6px; max-height: 50vh; overflow-y: auto; }
.credits li b { color: var(--text); }
.auth .f { display: flex; flex-direction: column; gap: 4px; font-size: 13px; color: var(--muted); font-weight: 600; }
.auth .f[hidden] { display: none; }
.auth .links { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px 16px; font-size: 13px; }
.auth .links a { color: var(--text); }
.auth .links a[hidden] { display: none; }
.card button:disabled { opacity: .5; cursor: not-allowed; }
.ok { color: var(--plus); font-size: 13px; }
.ok:empty, .err:empty { display: none; }
.err { color: var(--minus); font-size: 13px; min-height: 1em; }

.toast {
  position: fixed; left: 50%; bottom: 32px; transform: translateX(-50%) translateY(20px);
  background: #1c2133; border: 1px solid var(--line); padding: 10px 16px; border-radius: 10px;
  opacity: 0; transition: .25s; pointer-events: none; z-index: 20; max-width: calc(100% - 32px);
}
.toast.show { opacity: 1; transform: translateX(-50%); }

/* Bouton Partager */
.share {
  background: var(--accent); color: #1a1500; border: 0; border-radius: 999px;
  padding: 6px 14px; font-weight: 800; font-size: 13px;
}

/* Bandeaux : duel du jour, lien d'équipe */
.banners {
  position: fixed; top: 52px; left: 16px; z-index: 4;
  display: flex; flex-direction: column; align-items: flex-start; gap: 6px; max-width: calc(100% - 430px);
  pointer-events: none;
}
.banner {
  background: var(--glass); border: 1px solid var(--line); border-radius: 12px; backdrop-filter: blur(6px);
  padding: 6px 14px; font-size: 13px; text-align: center; pointer-events: auto;
}
.banner[hidden] { display: none; }
.banner.duel { border-color: rgba(250, 204, 21, .5); }
.banner.duel b { font-weight: 800; }
.banner.duel .vs { color: var(--accent); font-weight: 900; margin: 0 6px; }
.banner.duel .pts { font-variant-numeric: tabular-nums; font-weight: 800; }
.banner small { color: var(--muted); }
.banner.team { border-color: rgba(255, 255, 255, .5); }
.banner.team button { margin-left: 8px; background: none; border: 0; color: var(--muted); }

/* Onglets du panneau */
.tabs { display: flex; gap: 4px; margin-bottom: 10px; flex: none; }
.tab {
  flex: 1; background: transparent; border: 1px solid var(--line); color: var(--muted);
  border-radius: 8px; padding: 6px; font-weight: 700; font-size: 13px;
}
.tab.on { background: var(--surface-2); color: var(--text); border-color: rgba(255,255,255,.25); }
.tabpane { display: flex; flex-direction: column; min-height: 0; flex: 1; overflow-y: auto; }
.tabpane[hidden] { display: none; }
.panel h2 small { text-transform: none; letter-spacing: 0; font-weight: 400; }
.row.duel { box-shadow: inset 0 0 0 1px rgba(250, 204, 21, .6); }
.row.team { box-shadow: inset 0 0 0 2px #fff; }
.row .tag { font-size: 10px; font-weight: 800; color: var(--accent); margin-left: 4px; }
.row .fan { display: block; font-size: 11px; color: var(--muted); font-weight: 400; overflow: hidden; text-overflow: ellipsis; }
.btns .s { font-size: 13px; }
.lb { list-style: none; margin: 0 0 12px; padding: 0; display: flex; flex-direction: column; gap: 3px; font-size: 13px; }
.lb li { display: grid; grid-template-columns: 22px 1fr auto; gap: 8px; align-items: center; padding: 5px 8px; border-radius: 8px; background: var(--surface-2); }
.lb li.me { box-shadow: inset 0 0 0 1px var(--accent); }
.lb .n { font-weight: 800; font-variant-numeric: tabular-nums; }
.lb .p { color: var(--muted); font-weight: 700; text-align: right; }
.lb .favdot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; margin-right: 6px; }
.lb .empty { display: block; background: none; color: var(--muted); padding: 2px 0; }
.mystats { background: var(--surface-2); border-radius: 10px; padding: 10px; margin-bottom: 12px; font-size: 13px; color: var(--muted); }
.mystats b { color: var(--text); }

/* Sélecteur d'emoji */
#cv { cursor: default; }
#cv.hover { cursor: pointer; }
.picker {
  position: fixed; z-index: 8; display: flex; gap: 2px; padding: 4px;
  background: #141826; border: 1px solid var(--line); border-radius: 999px; box-shadow: 0 8px 30px rgba(0,0,0,.5);
  transform: translate(-50%, -120%);
}
.picker[hidden] { display: none; }
.picker button { background: none; border: 0; font-size: 24px; width: 40px; height: 40px; border-radius: 50%; }
.picker button:hover { background: var(--surface-2); }

@media (max-width: 700px) {
  .banners { top: 124px; left: 12px; max-width: calc(100% - 24px); }
  .banner { font-size: 12px; padding: 5px 10px; }
  .share { padding: 5px 10px; }
  .top { padding: 8px 12px; gap: 6px; }
  .brand { font-size: 17px; }
  .me { margin-left: auto; }
  .toggle { top: 84px; right: 12px; }
  .panel { left: 12px; right: 12px; width: auto; top: 124px; bottom: 118px; max-height: none; }
  .foot { left: 12px; right: 12px; bottom: 6px; font-size: 10px; text-align: center; max-width: none; }
  .actionbar { bottom: 34px; left: 12px; transform: none; width: calc(100% - 112px); max-width: none; }
  .chest { right: 8px; bottom: 30px; width: 88px; }
  .chest svg { width: 80px; height: 72px; }
  .chest-label { display: none; }
  .actions { width: 100%; }
  .act { flex: 1; min-width: 0; padding: 8px 6px; }
  .act .cd { font-size: 11px; }
  .actions { gap: 8px; }
  .act .lbl { font-size: 15px; }
  .aimhint { font-size: 13px; }
}

/* ======================================================================
   THÈME « TRÉSOR » : bois, or et bleu nuit (même style que Le Coffre)
   ====================================================================== */
:root {
  --wood: #7a4520; --wood-d: #4a280f; --wood-l: #9a5a2a;
  --gold: #f59e0b; --gold-l: #fde68a; --gold-d: #b45309;
  --navy: #141826; --navy-2: #1c2133;
  --gem: #67e8f9;
  --title: "Lilita One", system-ui, sans-serif;
  --plank: linear-gradient(180deg, var(--wood), var(--wood-d));
  --goldgrad: linear-gradient(180deg, #fde68a, #f59e0b 55%, #b45309);
}
body {
  background:
    radial-gradient(ellipse at 50% -10%, rgba(245,158,11,.16), transparent 55%),
    radial-gradient(ellipse at 50% 110%, rgba(103,232,249,.08), transparent 50%),
    radial-gradient(ellipse at center, #141a2c 0%, #06070c 100%) fixed;
}

/* --- Barre du haut --- */
.brand {
  font-family: var(--title); font-weight: 400; font-size: 24px; letter-spacing: .05em;
  padding: 4px 16px 3px; border-radius: 12px; background: var(--plank);
  border: 2px solid var(--gold-d); box-shadow: inset 0 1px 0 rgba(253,230,138,.35), 0 6px 18px rgba(0,0,0,.5);
  color: var(--gold-l); text-shadow: 0 2px 0 #3a1d08;
  animation: dropIn .6s cubic-bezier(.2,1.4,.4,1) backwards;
}
.brand span {
  background: linear-gradient(100deg, #fde68a 20%, #fff 40%, #f59e0b 60%, #fde68a 80%);
  background-size: 250% 100%; -webkit-background-clip: text; background-clip: text; color: transparent;
  text-shadow: none; animation: shimmer 4s linear infinite;
}
.me {
  background: var(--navy); border: 2px solid rgba(245,158,11,.45); color: #fcd9a6;
  animation: dropIn .6s .1s cubic-bezier(.2,1.4,.4,1) backwards;
}
.me #pseudo { color: var(--gold-l); }
.dot { box-shadow: 0 0 0 0 rgba(34,197,94,.7); animation: livePulse 2s infinite; }
.share {
  position: relative; overflow: hidden; background: var(--goldgrad); color: #3a1d08;
  border: 2px solid var(--gold-d); font-weight: 900; box-shadow: 0 4px 0 #78350f, 0 8px 18px rgba(0,0,0,.4);
  transition: transform .12s, box-shadow .12s; animation: dropIn .6s .05s cubic-bezier(.2,1.4,.4,1) backwards;
}
.share:hover { transform: translateY(-2px); }
.share:active { transform: translateY(2px); box-shadow: 0 2px 0 #78350f; }
.share::after, .act.ready::after, .card button[type="submit"]::after, #logoutBtn::after, #creditsClose::after {
  content: ""; position: absolute; top: 0; left: -60%; width: 40%; height: 100%;
  background: linear-gradient(100deg, transparent, rgba(255,255,255,.55), transparent);
  transform: skewX(-20deg); animation: shine 3.5s ease-in-out infinite; pointer-events: none;
}

/* --- Bandeaux --- */
.banner {
  background: var(--navy); border: 2px solid rgba(245,158,11,.4); border-radius: 14px;
  box-shadow: 0 6px 18px rgba(0,0,0,.45); animation: slideRight .5s cubic-bezier(.2,1.3,.4,1) backwards;
}
.banner.duel {
  background: var(--plank); border-color: var(--gold-d); color: #fcd9a6;
  box-shadow: inset 0 1px 0 rgba(253,230,138,.3), 0 6px 18px rgba(0,0,0,.45);
}
.banner.duel .vs { color: var(--gold-l); font-family: var(--title); font-weight: 400; font-size: 15px; display: inline-block; animation: vsBeat 1.6s ease-in-out infinite; }
.banner.duel .pts { color: #fff; }
.banner.duel small { color: #e8c99a; }
.banner.team { animation-delay: .1s; border-color: rgba(255,255,255,.5); }

/* --- Classement --- */
.toggle {
  background: var(--plank); color: var(--gold-l); border: 2px solid var(--gold-d); border-radius: 12px;
  font-family: var(--title); font-weight: 400; font-size: 15px; letter-spacing: .03em;
  box-shadow: inset 0 1px 0 rgba(253,230,138,.3), 0 6px 16px rgba(0,0,0,.45);
  animation: dropIn .6s .15s cubic-bezier(.2,1.4,.4,1) backwards;
}
.toggle::after { color: var(--gold); }
.panel {
  background: rgba(20, 24, 38, .94); border: 2px solid var(--gold-d); border-radius: 18px; padding: 0;
  box-shadow: 0 0 0 4px rgba(245,158,11,.12), 0 20px 50px rgba(0,0,0,.55);
  animation: slideLeft .5s cubic-bezier(.2,1.2,.4,1) backwards;
}
.panel .tabs { margin: 0; padding: 10px; background: var(--plank); border-bottom: 3px solid var(--gold); gap: 6px; }
.panel .tabpane { padding: 10px 12px 12px; }
.tab {
  border: 2px solid rgba(253,230,138,.25); color: #e8c99a; background: rgba(0,0,0,.2);
  font-family: var(--title); font-weight: 400; font-size: 15px; letter-spacing: .03em; transition: background .15s, transform .1s;
}
.tab:hover { background: rgba(0,0,0,.35); }
.tab.on { background: var(--goldgrad); color: #3a1d08; border-color: var(--gold-l); box-shadow: 0 3px 0 #78350f; }
.panel h2 { color: var(--gold); font-family: var(--title); font-weight: 400; font-size: 14px; letter-spacing: .06em; }
.row {
  background: linear-gradient(180deg, #1f2538, #171b2a); border: 1px solid rgba(245,158,11,.12); border-radius: 12px;
  transition: transform .25s, box-shadow .25s, background .4s;
}
.row:hover { transform: translateX(-3px); border-color: rgba(245,158,11,.35); }
.ranking .row:first-child {
  position: relative; overflow: hidden;
  background: linear-gradient(180deg, rgba(245,158,11,.28), rgba(120,53,15,.35)); border-color: var(--gold);
}
.ranking .row:first-child .pos { color: transparent; }
.ranking .row:first-child .pos::before { content: "👑"; color: initial; font-size: 14px; }
.ranking .row:first-child::after {
  content: ""; position: absolute; top: 0; left: -60%; width: 40%; height: 100%;
  background: linear-gradient(100deg, transparent, rgba(253,230,138,.35), transparent);
  transform: skewX(-20deg); animation: shine 4s ease-in-out infinite; pointer-events: none;
}
.ranking .row:nth-child(2) .pos { color: #e5e7eb; }
.ranking .row:nth-child(3) .pos { color: #d97706; }
.row .score { font-family: var(--title); font-weight: 400; font-size: 18px; }
.row.bump-up { animation: bumpUp .9s ease; }
.row.bump-down { animation: bumpDown .9s ease; }
.row.moved-up { animation: movedUp .6s cubic-bezier(.2,1.3,.4,1); }
.lb li { background: linear-gradient(180deg, #1f2538, #171b2a); border: 1px solid rgba(245,158,11,.12); border-radius: 10px; }
.lb li:nth-child(1) .p { color: var(--gold-l); }
.mystats { background: var(--plank); color: #e8c99a; border: 2px solid var(--gold-d); }
.mystats b { color: var(--gold-l); }
.feed li { border-bottom-color: rgba(245,158,11,.12); animation: feedIn .45s cubic-bezier(.2,1.2,.4,1); }
.hint { color: #a3a9bf; }

/* --- Boutons Vote / Malus --- */
.act {
  --c: #22c55e; position: relative; overflow: hidden;
  background: linear-gradient(180deg, #1f2538, #141826); border: 2px solid color-mix(in srgb, var(--c) 50%, transparent);
  border-radius: 18px; box-shadow: 0 5px 0 #0a0c14, 0 12px 28px rgba(0,0,0,.5);
  transition: transform .12s, box-shadow .12s, background .15s, border-color .15s;
  animation: riseIn .6s .2s cubic-bezier(.2,1.4,.4,1) backwards;
}
.act.malus { --c: #ef4444; animation-delay: .3s; }
.act .lbl { font-family: var(--title); font-weight: 400; font-size: 24px; letter-spacing: .03em; text-shadow: 0 2px 0 rgba(0,0,0,.5); }
.act.vote .lbl, .act.malus .lbl { color: var(--c); }
.act.ready { border-color: var(--c); animation: riseIn .6s .2s cubic-bezier(.2,1.4,.4,1) backwards, readyGlow 2s ease-in-out 1s infinite; }
.act.malus.ready { animation-delay: .3s, 1.1s; }
.act:not(.wait):hover { transform: translateY(-3px); }
.act:not(.wait):active { transform: translateY(3px); box-shadow: 0 2px 0 #0a0c14, 0 6px 14px rgba(0,0,0,.5); }
.act.on { background: linear-gradient(180deg, color-mix(in srgb, var(--c) 85%, #fff), var(--c)); box-shadow: 0 5px 0 color-mix(in srgb, var(--c) 50%, #000), 0 0 30px color-mix(in srgb, var(--c) 60%, transparent); }
.act.on .lbl, .act.on .cd { color: #fff; }
.act.wait { opacity: .55; filter: saturate(.6); }
.aimhint {
  background: var(--plank); border: 2px solid var(--gold-d); color: #fcd9a6; border-radius: 12px;
  box-shadow: inset 0 1px 0 rgba(253,230,138,.3), 0 8px 24px rgba(0,0,0,.5); animation: popIn .3s cubic-bezier(.2,1.4,.4,1);
}
.aimhint a { color: var(--gold-l); }
.chest { animation: riseIn .7s .4s cubic-bezier(.2,1.4,.4,1) backwards; }
.chest-count.pop, .balance.pop { animation: countPop .5s cubic-bezier(.2,1.6,.4,1); }

/* --- Fenêtres (inscription, compte, crédits) --- */
.modal { background: rgba(4, 5, 10, .72); backdrop-filter: blur(3px); animation: fadeIn .2s ease; }
.card {
  background: var(--navy); border: 2px solid var(--gold-d); border-radius: 20px; padding: 0 22px 20px; overflow: hidden;
  box-shadow: 0 0 0 4px rgba(245,158,11,.15), 0 30px 80px rgba(0,0,0,.6);
  animation: shopIn .3s cubic-bezier(.2,1.4,.4,1);
}
.card h3 {
  margin: 0 -22px 6px; padding: 16px 22px 12px; text-align: center;
  background: radial-gradient(ellipse at 50% 0%, rgba(253,230,138,.3), transparent 70%), var(--plank);
  border-bottom: 3px solid var(--gold);
  font-family: var(--title); font-weight: 400; font-size: 24px; letter-spacing: .03em; color: var(--gold-l); text-shadow: 0 2px 0 #3a1d08;
}
.card p { text-align: center; }
.card input { background: #0b0e18; border: 2px solid rgba(245,158,11,.25); border-radius: 10px; transition: border-color .15s, box-shadow .15s; }
.card input:focus { outline: none; border-color: var(--gold); box-shadow: 0 0 0 3px rgba(245,158,11,.2); }
.card button { position: relative; overflow: hidden; border-radius: 12px; transition: transform .1s, box-shadow .1s; }
.card button:not(.ghost):not(.shopitem) {
  background: var(--goldgrad); color: #3a1d08; border: 2px solid var(--gold-d); font-weight: 900; font-size: 16px;
  box-shadow: 0 4px 0 #78350f;
}
.card button:not(.ghost):not(.shopitem):hover { transform: translateY(-1px); }
.card button:not(.ghost):not(.shopitem):active { transform: translateY(3px); box-shadow: 0 1px 0 #78350f; }
.card .ghost:hover { color: var(--gold-l); }
.auth .f { color: #e8c99a; }
.auth .links a { color: var(--gold-l); }
.err:not(:empty) { animation: shake .4s; }

/* --- Toast, emojis, bas de page --- */
.toast {
  background: var(--plank); border: 2px solid var(--gold-d); color: #fff7e6; font-weight: 700; border-radius: 14px;
  box-shadow: inset 0 1px 0 rgba(253,230,138,.3), 0 12px 30px rgba(0,0,0,.55);
  transform: translateX(-50%) translateY(30px) scale(.9);
  transition: opacity .25s, transform .35s cubic-bezier(.2,1.5,.4,1);
}
.toast.show { transform: translateX(-50%) translateY(0) scale(1); }
.picker { background: var(--plank); border: 2px solid var(--gold-d); animation: popIn .25s cubic-bezier(.2,1.5,.4,1); }
.picker button { transition: transform .12s; }
.picker button:hover { background: rgba(0,0,0,.3); transform: scale(1.25) translateY(-3px); }
.foot a { color: #c9a777; }

/* --- Animations --- */
@keyframes shimmer { to { background-position: -250% 0; } }
@keyframes shine { 0%, 60% { left: -60%; } 100% { left: 130%; } }
@keyframes dropIn { from { transform: translateY(-30px); opacity: 0; } }
@keyframes riseIn { from { transform: translateY(40px) scale(.9); opacity: 0; } }
@keyframes slideLeft { from { transform: translateX(40px); opacity: 0; } }
@keyframes slideRight { from { transform: translateX(-30px); opacity: 0; } }
@keyframes popIn { from { transform: scale(.8); opacity: 0; } }
@keyframes fadeIn { from { opacity: 0; } }
@keyframes feedIn { from { transform: translateX(-16px); opacity: 0; background: rgba(245,158,11,.25); } }
@keyframes livePulse { 70% { box-shadow: 0 0 0 7px rgba(34,197,94,0); } 100% { box-shadow: 0 0 0 0 rgba(34,197,94,0); } }
@keyframes vsBeat { 50% { transform: scale(1.25); } }
@keyframes readyGlow { 50% { box-shadow: 0 5px 0 #0a0c14, 0 0 26px color-mix(in srgb, var(--c) 55%, transparent); } }
@keyframes bumpUp { 0% { background: rgba(34,197,94,.45); transform: scale(1.03); } 100% { } }
@keyframes bumpDown { 0% { background: rgba(239,68,68,.45); transform: translateX(4px); } 20% { transform: translateX(-4px); } 40% { transform: translateX(2px); } 100% { } }
@keyframes movedUp { from { transform: translateY(14px); box-shadow: 0 0 0 2px var(--gold); } }
@keyframes countPop { 40% { transform: scale(1.35); } }
@keyframes shake { 20%, 60% { transform: translateX(-5px); } 40%, 80% { transform: translateX(5px); } }

@media (max-width: 700px) {
  .brand { font-size: 19px; padding: 3px 12px 2px; }
  .act .lbl { font-size: 17px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}

/* Boutique agrandie : onglets Bonus & malus / Pluies */
.shoptabs { display: flex; gap: 6px; padding: 10px 16px 0; background: var(--navy); }
.stab {
  flex: 1; padding: 9px 8px; border-radius: 12px 12px 0 0; border: 2px solid rgba(245,158,11,.3); border-bottom: 0;
  background: #1c2133; color: #e8c99a; font-family: var(--title); font-size: 16px; letter-spacing: .03em;
  transition: background .15s, color .15s;
}
.stab:hover { background: #242a40; }
.stab.on { background: var(--goldgrad); color: #3a1d08; border-color: var(--gold-l); }
.shopbody { border-top: 3px solid var(--gold); }
.shopitem.rain { --c: #fde68a; }
.rainnote {
  margin: 2px 0 12px; font-size: 13px; color: #e8c99a; line-height: 1.45;
  background: var(--plank); border: 2px solid var(--gold-d); border-radius: 12px; padding: 10px 12px;
}
.rainnote b { color: var(--gold-l); }
#stab-rain .shopitem .ico { font-size: 40px; animation: chestBob 2.2s ease-in-out infinite; }

/* Bandeau « pluie en cours » */
.rainbanner {
  position: fixed; top: 12px; left: 50%; transform: translateX(-50%); z-index: 6;
  background: var(--plank); border: 2px solid var(--gold-d); color: #fff7e6; border-radius: 999px;
  padding: 6px 16px; font-size: 14px; font-weight: 700; white-space: nowrap; max-width: calc(100% - 32px); overflow: hidden; text-overflow: ellipsis;
  box-shadow: inset 0 1px 0 rgba(253,230,138,.3), 0 8px 24px rgba(0,0,0,.5); animation: popIn .35s cubic-bezier(.2,1.5,.4,1);
}
.rainbanner[hidden] { display: none; }
@media (max-width: 700px) { .rainbanner { top: auto; bottom: 120px; font-size: 12px; } }

/* ===================== Cosmétiques « Mon style » ===================== */
.shoptabs { flex-wrap: wrap; }
.stab { min-width: 120px; }
.shopitem.projectile { --c: #f87171; }
.shopitem.projectile.good { --c: #f9a8d4; }
.shopitem.style { --c: #fde68a; cursor: default; }
.shopitem.style .buy { cursor: pointer; }
.shopitem.style.locked .buy { cursor: not-allowed; }
.shopitem.equipped { border-color: #22c55e; box-shadow: 0 0 0 2px rgba(34,197,94,.35); }
.shopitem.equipped .buy { background: #22c55e; }
#stab-style h4 { margin-top: 10px; }
.mylook { margin: 0 0 8px; padding: 10px 12px; border-radius: 12px; background: #1c2133; text-align: center; font-size: 16px; }

/* Pseudo stylé */
.pbadge { margin-right: 3px; }
.ptitle { font-size: .85em; font-style: italic; color: #e8c99a; }
.pname { display: inline-block; }
.pname.name-rainbow {
  background: linear-gradient(90deg, #ef4444, #f59e0b, #facc15, #22c55e, #3b82f6, #a855f7, #ef4444);
  background-size: 300% 100%; -webkit-background-clip: text; background-clip: text; color: transparent;
  animation: shimmer 3s linear infinite; font-weight: 900;
}
.pname.name-gold {
  background: linear-gradient(100deg, #b45309 10%, #fde68a 35%, #fff 45%, #f59e0b 60%, #b45309 90%);
  background-size: 250% 100%; -webkit-background-clip: text; background-clip: text; color: transparent;
  animation: shimmer 3.5s linear infinite; font-weight: 900;
}
/* Pluie de slogan perso : carte dorée « premium », en tête de liste, sur toute la largeur */
.shopgrid li.featured-li { grid-column: 1 / -1; }
.shopitem.featured {
  --c: #facc15; min-height: 120px;
  display: grid; grid-template-columns: 70px 1fr auto; grid-template-rows: auto auto; column-gap: 14px; row-gap: 2px;
  align-items: center; text-align: left; padding: 16px 18px; overflow: hidden;
  background: linear-gradient(135deg, #78350f, #b45309 35%, #f59e0b 55%, #b45309 75%, #78350f);
  border: 2px solid #fde68a; box-shadow: 0 0 0 3px rgba(250,204,21,.25), 0 10px 30px rgba(245,158,11,.35);
}
.shopitem.featured .ico { grid-row: 1 / 3; font-size: 50px; margin: 0; text-align: center; animation: chestBob 2s ease-in-out infinite; }
.shopitem.featured .nm { font-family: var(--title); font-weight: 400; font-size: 22px; color: #fff7e6; text-shadow: 0 2px 0 #78350f; align-self: end; }
.shopitem.featured .ds { color: #fef3c7; font-size: 13px; align-self: start; }
.shopitem.featured .buy { grid-column: 3; grid-row: 1 / 3; width: auto; padding: 10px 18px; font-size: 16px; background: #fff7e6; color: #78350f; box-shadow: 0 4px 0 #78350f; }
.shopitem.featured .tag { background: #fff7e6; color: #b45309; font-size: 12px; }
.shopitem.featured::after {
  content: ""; position: absolute; top: 0; left: -60%; width: 40%; height: 100%;
  background: linear-gradient(100deg, transparent, rgba(255,255,255,.55), transparent);
  transform: skewX(-20deg); animation: shine 3s ease-in-out infinite; pointer-events: none;
}
.shopitem.featured.locked { filter: saturate(.7) brightness(.85); }
.shopitem.featured.locked .buy { background: #3b2a12; color: #fde68a; }
@media (max-width: 520px) {
  .shopitem.featured { grid-template-columns: 52px 1fr; }
  .shopitem.featured .ico { font-size: 38px; }
  .shopitem.featured .buy { grid-column: 1 / -1; grid-row: 3; margin-top: 8px; }
}
