* { box-sizing: border-box; margin: 0; padding: 0; }
:root {
  --bg: #0e0d0c;
  --bg2: #171512;
  --panel: rgba(21, 19, 17, .94);
  --line: #3d3832;
  --text: #ebefe4;
  --hp: #57c25f;
  --shield: #5c93a8;
  --gold: #d4a13d;
  --accent: #e5484d;
  --accent-dim: #7a2a2a;
  --brand: #f0c869;
  --brand2: #f0a0c0;
  --mono: "Consolas", "SF Mono", "Cascadia Mono", ui-monospace, monospace;
  --ui-display: "Chakra Petch", "Rajdhani", var(--ui, "Segoe UI"), system-ui, sans-serif;
}
:root { --h100: 100vh; }                                                  /* hauteur visible : 100vh compte les barres du navigateur d'un telephone comme ouvertes ou fermees selon le navigateur ; dvh suit la hauteur reelle */
@supports (height: 100dvh) { :root { --h100: 100dvh; } }
html, body { width: 100%; height: 100%; overflow: hidden; background: var(--bg);
  color: var(--text); font-family: var(--ui, "Segoe UI", system-ui, sans-serif);
  -webkit-user-select: none; user-select: none; touch-action: none; }
#game { position: fixed; inset: 0; display: block; background: var(--bg); cursor: crosshair; }
.hidden { display: none !important; }
.muted { opacity: .6; }
.small { font-size: 12px; }
kbd { background: #1c2016; border: 1px solid var(--line); border-radius: 3px;
  padding: 0 6px; font-size: 11px; font-family: var(--mono); color: var(--brand2); }


/* ---------- HUD ---------- */
#hud { position: fixed; inset: 0; z-index: 10; pointer-events: none; }
#hud > * { pointer-events: none; }

/* ---------- profil / classement / boutique / réglages ---------- */
.extra-pane { text-align: left; margin-top: 4px; min-height: 160px; }
.stats-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); gap: 12px; }
.stats-grid div { font-size: 13px; background: #141210; border: 1px solid var(--line);
  padding: 14px 10px; text-align: center; }
.stats-grid b { font-size: 22px; display: block; font-family: var(--mono); color: var(--brand2); }
.stats-grid span { opacity: .55; font-size: 10px; text-transform: uppercase; letter-spacing: .6px;
  display: block; margin-top: 4px; }

.sub-tabs { margin-bottom: 10px; grid-template-columns: repeat(auto-fit, minmax(78px, 1fr)); }
.sub-tabs .tab { padding: 7px; font-size: 11px; }

.lb-row { display: flex; align-items: center; padding: 9px 0; gap: 10px;
  border-bottom: 1px solid var(--line); font-size: 14px; }
.lb-row:last-child { border-bottom: none; }
.lb-rank { font-family: var(--mono); color: var(--brand2); width: 26px; flex: none; }
.lb-name { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lb-wins { font-family: var(--mono); font-size: 13px; opacity: .85; flex: none; }
.lb-row.you { margin-top: 6px; border-top: 1px dashed var(--brand2); border-bottom: none;
  padding-top: 12px; }
.lb-row.you .lb-name { color: var(--brand2); font-weight: 700; }

.controls-list { display: flex; flex-direction: column; gap: 11px; font-size: 13.5px; }
.controls-list kbd { margin-right: 4px; }

/* ---------- profil ---------- */
.profil-head { display: flex; align-items: center; gap: 14px; margin-bottom: 18px; }
.avatar { width: 44px; height: 44px; border-radius: 50%; flex: none;
  border: 2px solid rgba(255,255,255,.25); box-shadow: 0 4px 14px rgba(0,0,0,.4); }
.profil-name { font-family: var(--mono); font-weight: 700; font-size: 16px; }
.profil-sub { margin-top: 20px; padding-top: 16px; border-top: 1px solid var(--line); }
.sub-title { font-size: 11px; text-transform: uppercase; letter-spacing: 1px; opacity: .55;
  margin-bottom: 10px; font-family: var(--mono); }

.badges { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 16px; }
.badge { font-size: 11.5px; padding: 6px 10px; background: #1e190f; border: 1px solid var(--brand2);
  color: var(--brand2); border-radius: 3px; }
.badge.locked { background: #141210; border-color: var(--line); color: var(--text); opacity: .35; }

.hist-row { display: flex; align-items: center; gap: 10px; padding: 7px 0; font-size: 13px;
  border-bottom: 1px solid var(--line); }
.hist-row:last-child { border-bottom: none; }
.hist-result { font-family: var(--mono); font-weight: 700; width: 64px; flex: none; opacity: .7; }
.hist-result.won { color: var(--brand2); opacity: 1; }
.hist-row span:nth-child(2) { flex: 1; opacity: .8; }

#pwdMsg { color: var(--accent); }

/* ---------- boutique ---------- */
.currency-row { display: flex; gap: 20px; align-items: center; font-family: var(--mono); font-size: 14px;
  margin-bottom: 16px; }
.currency-row b { color: var(--brand2); }
.currency-row .btn-ghost { margin-left: auto; }
.shop-icon { font-size: 22px; }

.shop-crate { display: flex; align-items: center; gap: 12px; background: #141210;
  border: 1px solid var(--line); padding: 12px 14px; }
.shop-crate .shop-icon { font-size: 28px; }
.shop-crate-info { flex: 1; font-size: 12.5px; text-align: left; }
.shop-crate button { width: auto; }

.shop-skins-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
  gap: 8px; margin-top: 4px; }
.shop-skin-card { background: #141210; border: 2px solid var(--line); border-radius: 3px;
  padding: 10px 6px; text-align: center; font-size: 11px; cursor: pointer; position: relative;
  font-family: var(--mono); }
.shop-skin-card .swatch { width: 60px; height: 46px; margin: 0 auto 6px; }
.shop-skin-card .price { font-size: 11px; opacity: .8; margin-top: 4px; }
.shop-skin-card.equipped { border-color: var(--brand); box-shadow: 0 0 0 1px var(--brand) inset; }
.shop-skin-card.locked { opacity: .55; }
.shop-skin-card .equip-tag { display: block; margin-top: 4px; font-size: 9px; text-transform: uppercase;
  letter-spacing: .5px; color: var(--brand); }

.modal-overlay { position: fixed; inset: 0; z-index: 50; background: rgba(6,7,5,.78);
  display: flex; align-items: center; justify-content: center; padding: 20px; }
.modal-panel { max-width: 380px; }

.gem-pack-row { display: flex; align-items: center; gap: 10px; padding: 10px 0;
  border-bottom: 1px solid var(--line); font-family: var(--mono); font-size: 13px; }
.gem-pack-row:last-child { border-bottom: none; }
.gem-pack-row .gem-amt { flex: 1; text-align: left; }
.gem-pack-row .gem-price { opacity: .65; font-size: 12px; }
.gem-pack-row button { width: auto; margin: 0; }

#topbar { position: absolute; top: 16px; left: 50%; transform: translateX(-50%);
  display: flex; gap: 16px; align-items: center; }
#survbox { background: var(--panel); border: 1px solid var(--line); border-radius: 0;
  clip-path: polygon(0 8px, 8px 0, 100% 0, 100% 100%, 0 100%);
  padding: 8px 20px; text-align: center; }
#survbox b { font-size: 24px; font-family: var(--mono); color: var(--brand2); }
#survbox span { font-size: 10px; text-transform: uppercase; letter-spacing: 1px; opacity: .6;
  display: block; }
#stormbox { background: var(--panel); border: 1px solid var(--line);
  clip-path: polygon(0 8px, 8px 0, 100% 0, 100% 100%, 0 100%);
  padding: 10px 20px; font-size: 14px; font-weight: 600; font-family: var(--mono); }
#stormbox.warn { color: #ffb15c; border-color: #6a4a26; }
#stormbox.active { color: var(--accent); border-color: var(--accent-dim); animation: pulse 1s infinite; }
#stormbox[data-z="sand"].active { color: #ffcf8a; border-color: #8a5a22; }          /* la teinte du bandeau suit la zone de la carte (data-z : voir client.js) */
#stormbox[data-z="blizzard"].active { color: #c4e6ff; border-color: #3f6f9c; }
#stormbox[data-z="laser"].active { color: #ff9ab8; border-color: #8c2250; }
@keyframes pulse { 50% { opacity: .5; } }

#perfHud { position: absolute; top: 240px; left: 10px; padding: 4px 9px; font: 700 11px var(--mono); letter-spacing: .3px;
  color: rgba(255,255,255,.55); background: rgba(10,13,8,.5); border: 1px solid rgba(255,255,255,.1); border-radius: 4px;
  pointer-events: none; user-select: none; }         /* sous la minicarte (230px, collee en 0,0 - pas de position CSS propre), jamais dessus */

/* ---------- tuto (1re partie) : petite carte non bloquante, sous la barre du haut ET sous la 1re ligne du fil des eliminations (#feed, 78 px : sinon elle le cache), visible tant qu'on ne l'a pas passee ---------- */
#tutoBox { position: fixed; top: 108px; left: 50%; transform: translateX(-50%); z-index: 20; width: min(90vw, 380px);
  pointer-events: auto; padding: 16px 18px 14px; border-radius: 18px; text-align: center;
  background: rgba(14,13,11,.88); border: 1px solid rgba(255,255,255,.14); box-shadow: 0 18px 40px rgba(0,0,0,.5);
  animation: tutoIn .35s var(--ease, ease-out); }
@keyframes tutoIn { from { opacity: 0; transform: translate(-50%, -12px); } }
.tuto-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 10px; }
.tuto-step { font: 800 10.5px var(--ui, "Segoe UI"); letter-spacing: 1.2px; text-transform: uppercase; color: var(--brand); opacity: .9; white-space: nowrap; }
.tuto-dots { display: flex; justify-content: center; gap: 6px; }
.tuto-dots i { width: 6px; height: 6px; border-radius: 50%; background: rgba(255,255,255,.25); font-style: normal; transition: background .2s, box-shadow .2s; }
.tuto-dots i.done { background: rgba(240,200,105,.55); }                       /* etapes deja faites */
.tuto-dots i.on { background: var(--brand); box-shadow: 0 0 8px rgba(240,200,105,.65); }
.tuto-body h3 { font-size: 15px; color: var(--brand); margin-bottom: 4px; }
.tuto-body p { font: 600 13px/1.5 var(--ui, "Segoe UI"); opacity: .88; }
.tuto-goal { display: flex; align-items: center; justify-content: center; gap: 8px; margin-top: 10px; padding: 7px 12px; border-radius: 12px;
  background: rgba(255,255,255,.06); border: 1px solid rgba(255,255,255,.1); font: 700 12.5px var(--ui, "Segoe UI"); }
.tuto-goal b { font-family: var(--mono); color: var(--brand); }
.tuto-tick { position: relative; width: 16px; height: 16px; flex: none; border-radius: 50%; border: 2px solid rgba(255,255,255,.4); transition: background .25s, border-color .25s; }
.tuto-tick::after { content: ""; position: absolute; left: 2.5px; top: 2px; width: 7px; height: 4px; border-left: 2px solid #1b1405; border-bottom: 2px solid #1b1405;
  transform: rotate(-45deg); opacity: 0; transition: opacity .2s; }
#tutoBox.ok .tuto-tick { background: var(--brand); border-color: var(--brand); }
#tutoBox.ok .tuto-tick::after { opacity: 1; }
.tuto-bar { height: 5px; margin-top: 8px; border-radius: 99px; background: rgba(255,255,255,.12); overflow: hidden; }
.tuto-bar i { display: block; height: 100%; width: 0; border-radius: inherit; background: linear-gradient(90deg, var(--brand), #ffd98a); transition: width .25s ease-out; }
.tuto-goal.hidden, .tuto-bar.hidden { display: none; }
.tuto-actions { display: flex; justify-content: space-between; gap: 10px; margin-top: 12px; }
.tuto-actions .btn, .tuto-actions .btn-ghost { margin-top: 0; }
#tutoBox.ok { animation: tutoOk .6s ease-out; }                                  /* etape reussie : un halo dore qui s'etend */
@keyframes tutoOk { from { box-shadow: 0 0 0 0 rgba(240,200,105,.75), 0 18px 40px rgba(0,0,0,.5); } to { box-shadow: 0 0 0 28px rgba(240,200,105,0), 0 18px 40px rgba(0,0,0,.5); } }
#tutoBox.final { border-color: rgba(240,200,105,.55); }
body.no-fx #tutoBox, body.no-fx #tutoBox.ok { animation: none; }

#feed { position: absolute; top: 78px; right: 18px; text-align: right; font-size: 14px;
  line-height: 1.8; font-family: var(--mono); }
#feed div { background: rgba(10,13,8,.6); border-left: 2px solid var(--brand2); border-radius: 2px;
  padding: 2px 9px; display: inline-block; margin-bottom: 4px; }

#vitals { position: absolute; left: 22px; bottom: 22px; width: 400px; display: flex;
  flex-direction: column; gap: 7px; }

/* mode duo : direction + distance du coequipier, toujours sue (meme derriere un mur) ; grise et barree quand il est mort */
.team-compass { position: absolute; left: 22px; bottom: 96px; display: flex; align-items: center; gap: 8px;
  padding: 6px 12px; border-radius: 99px; background: rgba(10,13,8,.68); border: 1px solid rgba(127,224,200,.5); }
.team-compass.hidden { display: none; }
.team-compass.dead { border-color: rgba(255,255,255,.25); opacity: .6; }
.tc-arrow { font-style: normal; font-size: 17px; line-height: 1; color: #57e0c8; transform: rotate(var(--tc-a, 0deg)); transition: transform .15s linear; }
.team-compass.dead .tc-arrow { color: #9aa1a8; }
.tc-dist { font: 700 13px var(--mono); color: #c9fff2; }
.team-compass.dead .tc-dist { color: #9aa1a8; }

/* boss : une barre par boss en vie, sous le bandeau du haut ; la couleur --bc est celle du preset du boss */
#bossbar { position: absolute; top: 74px; left: 50%; transform: translateX(-50%); width: min(420px, 46vw); display: flex; flex-direction: column; gap: 8px; pointer-events: none; z-index: 3; }
#bossbar.hidden { display: none; }
.bb { display: grid; grid-template-columns: 1fr auto; align-items: center; gap: 2px 10px; padding: 6px 10px 7px; border-radius: 6px; background: rgba(12,9,8,.74); border: 1px solid color-mix(in srgb, var(--bc) 60%, transparent); box-shadow: 0 0 18px color-mix(in srgb, var(--bc) 28%, transparent); animation: bbIn .5s ease-out both; }
.bb-n { font: 900 13px var(--ui, "Segoe UI", sans-serif); letter-spacing: .14em; text-transform: uppercase; color: #fff; text-shadow: 0 1px 6px #000; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bb-t { font: 800 12px var(--mono, monospace); color: var(--bc); }
.bb-bar { grid-column: 1 / -1; position: relative; height: 12px; border-radius: 3px; overflow: hidden; background: #0008; border: 1px solid #000a; }
.bb-hp { position: absolute; inset: 0 auto 0 0; width: 100%; background: linear-gradient(180deg, color-mix(in srgb, var(--bc) 78%, #fff), var(--bc) 55%, color-mix(in srgb, var(--bc) 70%, #000)); transition: width .25s ease-out; }
.bb-sh { position: absolute; left: 0; top: 0; height: 3px; width: 0; background: #7fd0ff; box-shadow: 0 0 6px #7fd0ff; transition: width .25s ease-out; }
@keyframes bbIn { from { opacity: 0; transform: translateY(-14px) scale(.96); } }
body.no-fx .bb { animation: none; }
.bar { position: relative; height: 30px; background: #0f0e0c; border: 1px solid var(--line);
  overflow: hidden; }
.bar i { position: absolute; inset: 0; width: 0%; display: block; }
.bar.hp i { background: linear-gradient(180deg, #63d06b, var(--hp)); }
.bar.shield i { background: linear-gradient(180deg, #6fa8bd, var(--shield)); }
.bar span { position: absolute; right: 12px; top: 50%; transform: translateY(-50%);
  font-size: 15px; font-weight: 700; text-shadow: 0 1px 2px #000; font-family: var(--mono); }
.bar.shield { height: 19px; }

#reloadtag { position: absolute; left: 50%; bottom: 150px; transform: translateX(-50%);
  font-size: 17px; color: var(--brand2); font-weight: 800;
  font-family: var(--mono); letter-spacing: 1px; text-transform: uppercase;
  background: rgba(10,13,8,.75); border: 1px solid var(--brand2); padding: 7px 20px;
  border-radius: 3px; white-space: nowrap; }

#dragGhost { position: fixed; z-index: 40; transform: translate(-50%,-50%);
  background: #1a1714; border: 1px solid var(--brand2); border-radius: 3px;
  padding: 7px 14px; font-size: 13px; font-weight: 700; pointer-events: none;
  box-shadow: 0 8px 24px rgba(0,0,0,.5); font-family: var(--mono); }
#dragGhost.bad { border-color: var(--accent); color: #ffb0a8; }
#discardHint { position: fixed; left: 50%; bottom: 130px; transform: translateX(-50%);
  z-index: 39; background: rgba(229,72,77,.14); border: 1px dashed var(--accent);
  color: #ffb0a8; border-radius: 4px; padding: 9px 20px; font-size: 14px;
  font-weight: 700; pointer-events: none; }

#usebar { position: absolute; left: 50%; bottom: 140px; transform: translateX(-50%);
  width: 250px; height: 12px; background: #0f0e0c; border: 1px solid var(--line);
  overflow: hidden; }
#usebar i { display: block; height: 100%; width: 0%; background: var(--shield); }
#usebar span { position: absolute; top: -21px; left: 0; width: 100%; text-align: center;
  font-size: 12px; font-family: var(--mono); }

#deadLeaveBtn, #lobbyLeaveBtn, #lobbyGoBtn { pointer-events: auto; }

#deadcard, #endcard { position: absolute; left: 50%; top: 26%; transform: translateX(-50%);
  background: var(--panel); border: 1px solid var(--line);
  clip-path: polygon(0 16px, 16px 0, 100% 0, 100% calc(100% - 16px), calc(100% - 16px) 100%, 0 100%);
  padding: 26px 38px; text-align: center; min-width: 360px; }
#deadcard::before, #endcard::before { content: ""; position: absolute; top: 0; left: 0; right: 0;
  height: 3px; background: linear-gradient(90deg, var(--brand), var(--brand2)); }
#deadcard h2, #endcard h2 { font-size: 30px; margin-bottom: 8px; font-family: var(--mono);
  letter-spacing: 1px; text-transform: uppercase; }
#deadcard h2 { color: var(--accent); }
#endcard h2 { color: var(--brand2); }
#deadcard p, #endcard p { font-size: 15px; margin-bottom: 5px; }

#help { position: absolute; left: 50%; bottom: 6px; transform: translateX(-50%);
  font-size: 11.5px; opacity: .38; white-space: nowrap; font-family: var(--mono); }
#help b { color: var(--brand2); }
@media (max-width: 720px) { #help { display: none; } #vitals { width: 240px; } }

/* ---------- admin ---------- */
#godtag { position: absolute; left: 22px; bottom: 72px; font-family: var(--mono);
  font-weight: 800; font-size: 12px; letter-spacing: 1px; color: #7fd0ff;
  text-shadow: 0 1px 4px #000; }
#adminToggle { position: absolute; left: 22px; bottom: 92px; pointer-events: auto;
  padding: 7px 14px; font-size: 11.5px; font-weight: 800; letter-spacing: .5px;
  text-transform: uppercase; font-family: var(--mono); cursor: pointer;
  background: #10161c; border: 1px solid #7fd0ff; color: #7fd0ff; }
#adminToggle:hover { background: #16202a; }
#adminToggle.on { background: #7fd0ff; color: #08222e; }
#adminPanel { position: absolute; left: 22px; bottom: 132px; width: 320px; max-height: 60vh;
  display: flex; flex-direction: column; pointer-events: auto;
  background: var(--panel); border: 1px solid #7fd0ff;
  clip-path: polygon(0 14px, 14px 0, 100% 0, 100% 100%, 0 100%);
  padding: 14px 16px; font-size: 12.5px; }
.admin-head { font-family: var(--mono); font-weight: 800; letter-spacing: .5px;
  color: #7fd0ff; margin-bottom: 10px; text-transform: uppercase; font-size: 12px; }
.admin-actions { display: grid; grid-template-columns: repeat(2, 1fr); gap: 6px; margin-bottom: 4px; }
.admin-actions button { padding: 8px 6px; font-size: 11px; font-weight: 700;
  background: #141210; border: 1px solid var(--line); color: var(--text); cursor: pointer;
  font-family: var(--mono); }
.admin-actions button:hover { border-color: #7fd0ff; color: #7fd0ff; }
.admin-actions button.on { background: #7fd0ff; border-color: #7fd0ff; color: #08222e; }
#adminPlayers { overflow-y: auto; margin-top: 4px; }
.admin-row { display: flex; align-items: center; gap: 6px; padding: 6px 0;
  border-bottom: 1px solid var(--line); font-size: 12px; }
.admin-row:last-child { border-bottom: none; }
.admin-row .lb-name { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.admin-row .arow-hp { font-family: var(--mono); opacity: .7; flex: none; width: 34px; }
.admin-row.dead .lb-name, .admin-row.dead .arow-hp { opacity: .35; text-decoration: line-through; }
.admin-row button { flex: none; padding: 4px 8px; font-size: 10.5px; font-weight: 700;
  background: #141210; border: 1px solid var(--accent-dim); color: #ffb0a8; cursor: pointer;
  font-family: var(--mono); }
.admin-row button:hover { border-color: var(--accent); }
.admin-row button:disabled { opacity: .3; cursor: default; }

#extraAdmin .field { margin-top: 0; margin-bottom: 12px; }
.admin-row select { flex: none; background: #0c0b09; color: var(--text); border: 1px solid var(--line);
  font-family: var(--mono); font-size: 11px; padding: 5px 4px; }
.admin-row select:focus { border-color: #7fd0ff; outline: none; }
.tag-banned { color: var(--accent); font-size: 10px; font-weight: 800; letter-spacing: .5px;
  border: 1px solid var(--accent-dim); padding: 1px 5px; margin-left: 6px; }
.tag-role { color: #7fd0ff; font-size: 9.5px; opacity: .8; }

#adminLaunch { display: flex; flex-direction: column; align-items: center; gap: 14px; margin-bottom: 18px;
  padding-bottom: 16px; border-bottom: 1px solid var(--line); }
#adminLaunch .btn { max-width: 340px; width: 100%; }
.admin-mini { display: flex; gap: 10px; flex-wrap: wrap; justify-content: center; }
.admin-mini > div { min-width: 96px; padding: 8px 12px; background: #141210; border: 1px solid var(--line);
  border-radius: 6px; display: flex; flex-direction: column; align-items: center; gap: 2px; }
.admin-mini b { font-family: var(--mono); font-size: 20px; color: var(--brand2); }
.admin-mini span { font-size: 10.5px; opacity: .6; text-transform: uppercase; letter-spacing: .5px; }
.admin-mini .bad b { color: var(--accent); }

/* ---------- bandeau d'annonce / maintenance ---------- */
#siteBanner { position: relative; z-index: 3; text-align: center; padding: 8px 16px; font-size: 13px;
  font-weight: 700; letter-spacing: .3px; background: #1d2a33; color: #cfe9f7; border-bottom: 1px solid #3a5468; }
#siteBanner.warn { background: #3a1a17; color: #ffd0c8; border-bottom-color: var(--accent-dim); }
.stats-optout { margin-top: 22px; padding-top: 14px; border-top: 1px solid var(--line); text-align: left;
  font-size: 13px; }
.stats-optout label { cursor: pointer; }
.stats-optout p { margin-top: 6px; }

/* ---------- amis / messages / groupe ---------- */
.badge-dot { position: absolute; top: -5px; right: -5px; min-width: 17px; height: 17px; padding: 0 4px;
  border-radius: 9px; background: var(--accent); color: #fff; font: 700 10.5px/17px var(--mono);
  text-align: center; font-style: normal; }
.conv .badge-dot { position: static; }
.social-panel { max-width: 440px; width: 100%; max-height: 88vh; overflow-y: auto; }
.social-panel.wide { max-width: 660px; }
#friendsBody { text-align: left; min-height: 120px; max-height: 46vh; overflow-y: auto; margin: 8px 0 10px; }
.friend-row { display: flex; align-items: center; gap: 8px; padding: 7px 4px; border-bottom: 1px solid var(--line);
  font-size: 14px; }
.friend-row:last-child { border-bottom: none; }
.friend-row .small-btn, .party-member .small-btn { padding: 5px 9px; font-size: 11.5px; }
.friend-name { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-family: var(--mono);
  font-weight: 700; text-align: left; }
.friend-st { font-size: 11px; opacity: .55; font-family: var(--mono); }
.dot { width: 9px; height: 9px; border-radius: 50%; flex: none; background: #4a4640; }
.dot.st-on { background: var(--hp); box-shadow: 0 0 6px var(--hp); }
.dot.st-match { background: var(--brand); box-shadow: 0 0 6px var(--brand); }
.add-row { display: flex; gap: 8px; margin-bottom: 8px; }
.add-row .field { margin-top: 0; padding: 10px 12px; font-size: 15px; }

#msgLayout { display: flex; gap: 12px; text-align: left; height: 46vh; min-height: 260px; margin: 8px 0 10px; }
#msgList { flex: 0 0 170px; overflow-y: auto; border-right: 1px solid var(--line); padding-right: 8px;
  display: flex; flex-direction: column; gap: 4px; }
.conv { display: flex; align-items: center; gap: 8px; padding: 8px; background: #141210; border: 1px solid var(--line);
  color: var(--text); cursor: pointer; font-family: var(--mono); font-size: 13px; text-align: left; }
.conv.on { border-color: var(--brand); background: #1e190f; }
#msgThread { flex: 1; display: flex; flex-direction: column; min-width: 0; }
#msgHead { padding-bottom: 6px; border-bottom: 1px solid var(--line); }
#msgLog { flex: 1; overflow-y: auto; display: flex; flex-direction: column; gap: 6px; padding: 8px 2px; }
.bubble { max-width: 82%; padding: 7px 11px; border-radius: 10px; font-size: 13.5px; line-height: 1.35;
  word-break: break-word; }
.bubble.me { align-self: flex-end; background: linear-gradient(90deg, var(--brand), var(--brand2)); color: #2a1710;
  border-bottom-right-radius: 3px; }
.bubble.them { align-self: flex-start; background: #221f1b; border: 1px solid var(--line); border-bottom-left-radius: 3px; }
#msgForm { display: flex; gap: 8px; }
#msgForm .field { margin-top: 0; padding: 10px 12px; font-size: 14px; flex: 1; }
@media (max-width: 720px) {
  #msgLayout { flex-direction: column; height: auto; }
  #msgList { flex: none; flex-direction: row; overflow-x: auto; border-right: none; padding-right: 0; }
  #msgLog { min-height: 160px; max-height: 30vh; }
}

#toasts { position: fixed; top: 74px; right: 16px; z-index: 80; display: flex; flex-direction: column; gap: 8px;
  max-width: min(360px, calc(100vw - 32px)); }
.toast { display: flex; align-items: center; gap: 10px; padding: 10px 12px; background: var(--panel);
  border: 1px solid var(--line); border-left: 3px solid var(--brand); box-shadow: 0 10px 30px rgba(0,0,0,.5);
  font-size: 13.5px; animation: toastIn .2s ease-out; }
.toast.bad { border-left-color: var(--accent); }
.toast-text { flex: 1; text-align: left; }
.toast .small-btn { padding: 6px 12px; }
.toast-x { background: none; border: none; color: var(--text); opacity: .5; font-size: 18px; cursor: pointer; padding: 0 2px; }
@keyframes toastIn { from { opacity: 0; transform: translateY(-6px); } }

#partyArea { margin-top: 14px; }
#partyRow { display: flex; gap: 8px; justify-content: center; align-items: center; flex-wrap: wrap; }
#partyRow .field { width: 150px; margin-top: 0; padding: 9px 12px; font-size: 14px; text-align: center;
  letter-spacing: 3px; text-transform: uppercase; }
#partyCard { max-width: 380px; margin: 14px auto 0; padding: 12px 14px; background: rgba(20,18,16,.85);
  border: 1px solid var(--line); text-align: left; }
.party-head { display: flex; align-items: center; gap: 10px; margin-bottom: 8px; }
.party-title { font-size: 11px; text-transform: uppercase; letter-spacing: 1px; opacity: .55; font-family: var(--mono); }
.party-code { flex: 1; font-family: var(--mono); font-weight: 800; font-size: 22px; letter-spacing: 4px; color: var(--brand); }
.party-member { display: flex; align-items: center; gap: 8px; padding: 5px 0; }
.crown { width: 16px; color: var(--brand); }
.tag-guest { font-size: 10px; opacity: .6; border: 1px solid var(--line); padding: 0 5px; }
.party-actions { display: flex; gap: 8px; justify-content: flex-end; margin-top: 10px; }

/* ---------- PRIME : pseudo dore, menu dore, carte de la boutique ---------- */
.prime-name { background: linear-gradient(100deg, #ffe9a0 0%, #ffc93c 28%, #fff4c9 48%, #f2b632 68%, #c98a10 100%);
  background-size: 240% 100%; -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent; color: transparent; font-weight: 800; animation: primeShine 6s linear infinite; }
.prime-name::before { content: "♛"; margin-right: 5px; font-size: .92em; }
@keyframes primeShine { from { background-position: 0 0; } to { background-position: -240% 0; } }
.name-row { display: flex; align-items: center; gap: 8px; }
.prime-badge { font: 800 9.5px/1 var(--mono); letter-spacing: 1px; padding: 3px 6px; border-radius: 3px; color: #3a2606;
  background: linear-gradient(90deg, #ffe38a, #f2b632); box-shadow: 0 0 10px rgba(255,200,60,.45); }
.prime-ribbon { margin: -12px 0 16px; font: 700 11.5px var(--mono); letter-spacing: 1.6px; text-transform: uppercase; color: #ffd45a; }
.prime-ribbon::before, .prime-ribbon::after { content: "✦"; margin: 0 10px; opacity: .8; }

body.is-prime #menu, body.is-prime .modal-overlay { --brand: #ffd45a; --brand2: #ffae2b; --line: #4d3f22; --panel: rgba(27,21,12,.95); }

.prime-card { margin-top: 16px; }
.prime-card:empty { display: none; }
.prime-card-in { position: relative; overflow: hidden; border: 1px solid #7a5b1a; border-radius: 6px; padding: 16px 18px;
  background: linear-gradient(135deg, rgba(64,46,12,.55), rgba(20,16,10,.92) 62%); text-align: left; }
.prime-card-in::before { content: ""; position: absolute; inset: 0; pointer-events: none;
  background: linear-gradient(115deg, transparent 38%, rgba(255,226,140,.11) 50%, transparent 62%);
  background-size: 260% 100%; animation: primeSweep 8s ease-in-out infinite; }
@keyframes primeSweep { from { background-position: 130% 0; } to { background-position: -130% 0; } }
.prime-card-in.active { border-color: #d9a520; box-shadow: 0 0 0 1px rgba(255,212,90,.25) inset, 0 0 28px rgba(255,190,50,.14); }
.prime-head { display: flex; align-items: center; gap: 14px; position: relative; }
.prime-crown { color: #ffd45a; filter: drop-shadow(0 0 8px rgba(255,190,50,.6)); flex: none; }
.prime-titles { flex: 1; min-width: 0; }
.prime-title { font: 800 20px var(--mono); letter-spacing: 2px; }
.prime-title span { background: linear-gradient(90deg, #ffe9a0, #ffc93c, #f2b632); -webkit-background-clip: text;
  background-clip: text; -webkit-text-fill-color: transparent; }
.prime-tag { font-size: 11.5px; opacity: .6; }
.prime-price { text-align: right; flex: none; }
.prime-price b { display: block; font: 800 22px var(--mono); color: #ffd45a; }
.prime-price span { font-size: 11px; opacity: .6; }
.prime-perks { list-style: none; margin: 14px 0 6px; padding: 0; display: grid; gap: 7px; position: relative; }
.prime-perks li { display: flex; align-items: center; gap: 10px; font-size: 13px; text-align: left; }
.prime-perks li i { font-style: normal; width: 22px; text-align: center; flex: none; }
.prime-perks li span { flex: 1; }
.prime-perks li.soon { opacity: .5; }
.prime-perks li em { font: 700 9.5px var(--mono); letter-spacing: .5px; text-transform: uppercase; color: #ffd45a;
  border: 1px solid #6b5220; padding: 1px 7px; border-radius: 8px; font-style: normal; flex: none; }
.prime-perks.compact { margin: 6px 0 8px; }
.prime-foot { margin-top: 10px; position: relative; }
.prime-foot .muted { margin-top: 8px; }
.prime-buy { background: linear-gradient(90deg, #ffe38a, #f2b632); color: #3a2606; margin-top: 8px; font-size: 15px; }
.prime-status { font: 800 13px var(--mono); color: #ffd45a; letter-spacing: .5px; }

/* ---------- fenetres (cadeau, achat, recompenses) ---------- */
.popup-panel { max-width: 460px; }
.popup-icon { font-size: 54px; line-height: 1; margin-bottom: 8px; }
.popup-title { font: 800 26px var(--mono); letter-spacing: 1.5px; text-transform: uppercase; }
.popup-sub { margin-top: 6px; font-size: 14px; opacity: .88; }
.popup-sub b { color: var(--brand2); }
.popup-body { margin-top: 14px; }
.popup-actions { display: flex; gap: 10px; justify-content: center; margin-top: 18px; flex-wrap: wrap; }
.popup-actions .btn { min-width: 120px; margin-top: 0; }
.popup-panel.gold { border-color: #a8791c; }
.popup-panel.gold::before { background: linear-gradient(90deg, #ffe38a, #f2b632, #ffe38a); }
.popup-panel.gold .popup-title { color: #ffd45a; }
.popup-panel.gold .popup-icon { color: #ffd45a; text-shadow: 0 0 18px rgba(255,190,50,.65); }
.popup-panel.gold .popup-sub b { color: #ffd45a; }
.popup-panel.gold .btn:not(.btn-ghost) { background: linear-gradient(90deg, #ffe38a, #f2b632); color: #3a2606; }
.popup-panel.gift { overflow: hidden; }
.popup-panel.gift .popup-icon { animation: giftBounce 1.3s ease-in-out infinite; }
@keyframes giftBounce { 0%, 100% { transform: translateY(0) rotate(-4deg); } 50% { transform: translateY(-8px) rotate(4deg); } }
.gift-msg { font-style: italic; opacity: .88; margin: 0 0 10px; }
.gift-items { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; }
.gift-chip { display: inline-flex; align-items: center; gap: 6px; padding: 7px 12px; background: #1a1714; border: 1px solid var(--line);
  border-radius: 16px; font-size: 13.5px; }
.gift-chip b { color: var(--brand2); }
.gift-chip em { font-style: normal; font-size: 10.5px; opacity: .75; }
.gift-chip.prime { border-color: #a8791c; background: rgba(255,200,60,.09); }
.gift-chip.prime b { color: #ffd45a; }
.gift-chip.pass { border-color: #5b8fb0; background: rgba(90,159,214,.09); }
.gift-skin { display: inline-block; width: 34px; height: 34px; }
.gift-sparks { position: absolute; inset: 0; pointer-events: none; overflow: hidden; }
.gift-sparks i { position: absolute; bottom: -12px; width: 7px; height: 7px; border-radius: 2px; opacity: 0;
  animation: sparkRise 3.4s ease-out infinite; }
.gift-sparks i:nth-child(1) { left: 8%; background: #ffd45a; animation-delay: 0s; }
.gift-sparks i:nth-child(2) { left: 17%; background: #f0a0c0; animation-delay: .6s; }
.gift-sparks i:nth-child(3) { left: 27%; background: #7fd0ff; animation-delay: 1.4s; }
.gift-sparks i:nth-child(4) { left: 38%; background: #57c25f; animation-delay: .3s; }
.gift-sparks i:nth-child(5) { left: 49%; background: #ffd45a; animation-delay: 1.9s; }
.gift-sparks i:nth-child(6) { left: 60%; background: #e5484d; animation-delay: .9s; }
.gift-sparks i:nth-child(7) { left: 71%; background: #a48bff; animation-delay: 2.3s; }
.gift-sparks i:nth-child(8) { left: 82%; background: #ffd45a; animation-delay: .2s; }
.gift-sparks i:nth-child(9) { left: 91%; background: #f0a0c0; animation-delay: 1.2s; }
@keyframes sparkRise { 0% { transform: translateY(0) rotate(0); opacity: 0; } 12% { opacity: .95; }
  100% { transform: translateY(-330px) rotate(300deg); opacity: 0; } }

/* ---------- pass de combat ---------- */
.pass-head { display: flex; gap: 18px; align-items: center; flex-wrap: wrap; padding-bottom: 14px; border-bottom: 1px solid var(--line); }
.pass-level { width: 80px; height: 80px; border: 2px solid var(--brand); border-radius: 50%; flex: none; display: flex;
  flex-direction: column; align-items: center; justify-content: center;
  background: radial-gradient(circle, rgba(240,200,105,.16), transparent 70%); }
.pass-level span { font: 700 9px var(--mono); letter-spacing: 1px; text-transform: uppercase; opacity: .7; }
.pass-level b { font: 800 28px/1 var(--mono); color: var(--brand); }
.pass-level small { font-size: 10px; opacity: .5; }
.pass-xp { flex: 1; min-width: 230px; text-align: left; }
.pass-title { font: 800 16px var(--mono); letter-spacing: 1px; }
.pass-title span { color: var(--brand2); font-size: 12px; margin-left: 8px; opacity: .85; }
.pass-bar { height: 10px; background: #0f0e0c; border: 1px solid var(--line); border-radius: 6px; overflow: hidden; margin: 8px 0 6px; }
.pass-bar i { display: block; height: 100%; background: linear-gradient(90deg, var(--brand), var(--brand2)); }
.pass-xp-txt { font: 12px var(--mono); opacity: .9; margin-bottom: 3px; }
.pass-xp-txt em { font-style: normal; opacity: .6; }
.pass-actions { display: flex; flex-direction: column; gap: 8px; align-items: stretch; min-width: 190px; }
.pass-actions .btn { margin-top: 0; font-size: 13px; padding: 10px 14px; }
.pass-owned { font: 800 12px var(--mono); color: #ffd45a; border: 1px solid #a8791c; padding: 9px 14px; text-align: center;
  background: rgba(255,200,60,.08); }
.pass-scroll { overflow-x: auto; padding: 14px 0 10px; touch-action: pan-x; }
.pass-grid { display: flex; gap: 6px; min-width: max-content; }
.pass-labels { position: sticky; left: 0; z-index: 2; display: flex; flex-direction: column; gap: 6px; background: var(--panel); padding-right: 8px; }
.pass-labels .pl { height: 88px; width: 66px; display: flex; align-items: center; font: 800 10px var(--mono); letter-spacing: 1px; opacity: .7; }
.pass-labels .pl.num { height: 28px; }
.pass-labels .pl.prem { color: #ffd45a; opacity: 1; }
.pass-col { display: flex; flex-direction: column; gap: 6px; width: 84px; flex: none; }
.pass-num { height: 28px; display: flex; align-items: center; justify-content: center; font: 800 12px var(--mono);
  background: #141210; border: 1px solid var(--line); }
.pass-col.reached .pass-num { color: #2a1710; background: linear-gradient(90deg, var(--brand), var(--brand2)); border-color: var(--brand); }
.pass-col.next .pass-num { border-color: var(--brand); color: var(--brand); }
.pass-cell { height: 88px; border: 1px solid var(--line); background: #141210; display: flex; flex-direction: column;
  align-items: center; justify-content: center; gap: 6px; position: relative; font-family: var(--mono); font-size: 12px; user-select: none; }
.pass-cell b { font-size: 13px; }
.rw-ico { font-size: 22px; line-height: 1; }
.rw-skin { width: 42px; height: 42px; }
.pass-cell.prem { border-color: #4d3d1a; background: linear-gradient(180deg, rgba(64,46,12,.5), #141210); }
.pass-cell.locked { opacity: .42; }
.pass-cell.ready { cursor: pointer; border-color: var(--brand); box-shadow: 0 0 14px rgba(240,200,105,.35), inset 0 0 0 1px var(--brand);
  animation: readyPulse 1.7s ease-in-out infinite; }
@keyframes readyPulse { 50% { box-shadow: 0 0 22px rgba(240,200,105,.6), inset 0 0 0 1px var(--brand); } }
.pass-cell.claimed { opacity: .5; }
.pass-cell.nopass { cursor: pointer; opacity: .8; }
.pass-cell u { position: absolute; top: 4px; right: 5px; text-decoration: none; font-size: 12px; }
#passBuyBtn.pulse { animation: buyPulse .6s 2; }
@keyframes buyPulse { 50% { transform: scale(1.06); filter: brightness(1.3); } }
@media (max-width: 720px) { .pass-actions { flex-direction: row; flex-wrap: wrap; min-width: 0; width: 100%; } .pass-actions > * { flex: 1; } }
