/* Vagario — interface en jeu (mobile first) */
html, body.game { height: 100%; overflow: hidden; overscroll-behavior: none; touch-action: none; }
body.game { user-select: none; -webkit-user-select: none; }
#cv { position: fixed; inset: 0; width: 100%; height: 100%; display: block; }

.hud { position: fixed; inset: 0; pointer-events: none; z-index: 5; }
.hud > * { pointer-events: auto; }
.hud.hidden-ui > *:not(.joystick) { opacity: 0; pointer-events: none; }

.hud-btn {
  width: 44px; height: 44px; border-radius: 14px; border: 1px solid var(--line);
  display: grid; place-items: center; cursor: pointer; position: relative;
  background: var(--surface); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
  color: var(--text);
}

/* Haut gauche */
.hud-tl { position: absolute; left: 10px; top: calc(10px + var(--safe-t)); display: flex; gap: 8px; align-items: center; }
.stat-pill { display: flex; gap: 14px; padding: 6px 14px; border-radius: 14px; height: 44px; align-items: center; }
.stat-pill > div { display: grid; line-height: 1.05; }
.stat-pill .k { font-size: 9.5px; text-transform: uppercase; letter-spacing: .12em; color: var(--text-3); font-weight: 600; }
.stat-pill b { font: 600 17px/1.1 var(--font-display); font-variant-numeric: tabular-nums; }
.stat-pill b.bump { animation: bump .35s ease; }
@keyframes bump { 40% { transform: scale(1.18); } }

/* Classement live */
.hud-tr { position: absolute; right: 10px; top: calc(10px + var(--safe-t)); }
.lb { width: 168px; padding: 6px 6px 8px; border-radius: 14px; }
.lb-head { width: 100%; display: flex; justify-content: space-between; align-items: center; background: none; border: 0; padding: 4px 6px 6px; cursor: pointer; }
.lb-head .display { font-size: 14px; }
.lb-count { font-size: 11px; color: var(--text-3); font-weight: 600; }
.lb ol { list-style: none; margin: 0; padding: 0; display: grid; gap: 2px; }
.lb li { display: flex; align-items: center; gap: 6px; padding: 3px 6px; border-radius: 6px; font-size: 12.5px; font-weight: 500; min-width: 0; }
.lb li .rk { width: 16px; text-align: center; font: 700 12px var(--font-display); color: var(--text-3); flex-shrink: 0; }
.lb li .nm { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lb li .ms { font-variant-numeric: tabular-nums; color: var(--text-2); font-size: 11.5px; }
.lb li .badge { height: 14px; padding: 0 4px; font-size: 8.5px; }
.lb li:nth-child(1) .rk { color: var(--gold); }
.lb li:nth-child(2) .rk { color: #c9d0e2; }
.lb li:nth-child(3) .rk { color: #d9a07a; }
.lb li.me { background: var(--accent-soft); color: #fff; box-shadow: inset 2px 0 0 var(--accent); }
.lb li:nth-child(n+6) { display: none; }
.lb.open li:nth-child(n+6) { display: flex; }
.lb-me { margin-top: 4px; padding: 5px 8px; border-radius: 8px; font-size: 12px; font-weight: 600; background: var(--accent-soft); color: var(--accent); display: flex; justify-content: space-between; }

/* Minimap */
.minimap-wrap { position: absolute; left: 10px; top: calc(62px + var(--safe-t)); width: 104px; height: 104px; border-radius: 12px; overflow: hidden; border: 1px solid var(--line); background: rgba(10, 13, 30, .6); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); }
#minimap { width: 100%; height: 100%; display: block; }
.mm-lock { position: absolute; left: 4px; bottom: 4px; display: flex; gap: 3px; align-items: center; font-size: 9px; font-weight: 600; letter-spacing: .04em; color: var(--gold); background: rgba(0, 0, 0, .55); padding: 2px 5px; border-radius: 6px; }

/* Tchat */
.hud-bl { position: absolute; left: 10px; bottom: calc(10px + var(--safe-b)); display: flex; flex-direction: column; align-items: flex-start; gap: 8px; }
.chat { width: min(86vw, 340px); padding: 6px; border-radius: 16px; display: none; flex-direction: column; gap: 6px; }
.chat.open { display: flex; }
.chat-log { max-height: 30vh; overflow-y: auto; display: flex; flex-direction: column; gap: 6px; padding: 4px; scrollbar-width: thin; -webkit-mask-image: linear-gradient(transparent, #000 18px); mask-image: linear-gradient(transparent, #000 18px); }
.msg { display: flex; gap: 8px; align-items: flex-start; animation: msg-in .2s ease-out; }
@keyframes msg-in { from { opacity: 0; transform: translateY(6px); } }
.msg .avatar { --s: 28px; }
.msg-body { flex: 1; min-width: 0; font-size: 13.5px; line-height: 1.35; }
.msg-head { display: flex; align-items: center; gap: 4px; flex-wrap: wrap; }
.msg-name { font-weight: 800; font-size: 12.5px; }
.msg-text { color: var(--text); overflow-wrap: anywhere; }
.msg.sys .msg-text { color: var(--cyan); font-weight: 600; font-size: 12.5px; }
.msg.sys { padding-left: 2px; }
.msg-time { margin-left: auto; padding-left: 6px; font-size: 10.5px; font-weight: 600; color: var(--text-3, rgba(255, 255, 255, .45)); font-variant-numeric: tabular-nums; white-space: nowrap; }
.msg.sys .msg-time { margin-left: 6px; padding-left: 0; }
.chat-form { display: flex; gap: 6px; }
.chat-input { flex: 1; min-width: 0; height: 40px; padding: 0 12px; border-radius: 12px; border: 1px solid var(--line-strong); background: rgba(255, 255, 255, .06); outline: none; user-select: text; -webkit-user-select: text; font-size: 16px; }
.chat-input:focus { border-color: var(--cyan); }
.chat-send { width: 40px; height: 40px; border-radius: 12px; border: 0; background: var(--grad-primary); color: var(--accent-ink); display: grid; place-items: center; cursor: pointer; }
.chat-unread { position: absolute; top: -6px; right: -6px; min-width: 20px; height: 20px; padding: 0 5px; border-radius: 10px; background: var(--accent); color: var(--accent-ink); font-size: 11px; font-weight: 800; display: grid; place-items: center; }

/* Actions mobiles */
.actions { position: absolute; right: 14px; bottom: calc(18px + var(--safe-b)); display: none; flex-direction: column-reverse; align-items: center; gap: 14px; }
.act { border: 0; border-radius: 50%; display: grid; place-items: center; align-content: center; gap: 1px; color: #fff; cursor: pointer; touch-action: none; }
.act span { font: 600 9.5px var(--font); text-transform: uppercase; letter-spacing: .1em; }
.act-split { width: 84px; height: 84px; color: var(--accent-ink); background: var(--grad-primary); box-shadow: 0 0 0 1px rgba(255, 255, 255, .25) inset, 0 12px 30px -8px rgba(94, 240, 168, .6); }
.act-eject { width: 62px; height: 62px; background: rgba(14, 17, 26, .8); backdrop-filter: blur(12px); box-shadow: inset 0 0 0 1px var(--line-strong); }
.act:active, .act.pressed { transform: scale(.92); filter: brightness(1.2); }
.joystick { position: fixed; width: 120px; height: 120px; margin: -60px 0 0 -60px; border-radius: 50%; border: 2px solid rgba(255, 255, 255, .25); background: rgba(255, 255, 255, .05); pointer-events: none; z-index: 4; }
.joystick i { position: absolute; left: 50%; top: 50%; width: 52px; height: 52px; margin: -26px 0 0 -26px; border-radius: 50%; background: radial-gradient(circle at 35% 30%, rgba(255, 255, 255, .9), rgba(190, 200, 255, .6)); box-shadow: 0 4px 16px rgba(0, 0, 0, .4); }
body.touch .actions { display: flex; }
body.touch .chat { width: calc(100vw - 132px); max-width: 340px; }
body.touch .chat-log { max-height: 24vh; }

/* Overlays */
.overlay { position: fixed; inset: 0; z-index: 20; display: grid; place-items: end center; padding: 12px 12px calc(12px + var(--safe-b)); background: rgba(5, 6, 10, .78); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); animation: fade .25s ease; overflow-y: auto; }
.overlay[hidden] { display: none; }
@keyframes fade { from { opacity: 0; } }
.sheet { width: 100%; max-width: 440px; display: grid; gap: 14px; padding: 24px 20px; border-radius: 24px; background: linear-gradient(180deg, #121520, #0b0d14); border: 1px solid var(--line-strong); box-shadow: var(--shadow); animation: rise .35s cubic-bezier(.2, .9, .3, 1.2); }
@keyframes rise { from { transform: translateY(24px); opacity: 0; } }
.tag .i { font-size: 14px; }
.end-title { letter-spacing: -.01em; }
.logo-sm { display: flex; justify-content: center; align-items: center; gap: 8px; font-size: 24px; }
.who { display: flex; gap: 14px; align-items: center; padding: 12px; border-radius: 18px; background: rgba(255, 255, 255, .04); border: 1px solid var(--line); }
.who-skin { width: 64px; height: 64px; border-radius: 50%; flex-shrink: 0; background: var(--bg-3) center/cover; color: var(--text); box-shadow: 0 0 0 3px rgba(255, 255, 255, .12); display: grid; place-items: center; font: 700 26px var(--font-display); }
.who-skin.vip { box-shadow: 0 0 0 3px var(--gold), var(--glow-gold); }
.who-info { min-width: 0; display: grid; gap: 6px; }
.who-name { font-size: 22px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.who-meta { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; font-size: 13px; color: var(--text-2); }
.who-meta a { color: var(--cyan); font-weight: 600; }
.server-chip { display: flex; justify-content: center; gap: 8px; align-items: center; font-size: 13px; color: var(--text-2); }
.server-chip .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--green); box-shadow: 0 0 8px var(--green); }
.league-strip { display: flex; gap: 12px; align-items: center; padding: 12px 14px; border-radius: 14px; background: var(--gold-soft); border: 1px solid rgba(233, 196, 125, .25); font-size: 13px; }
.league-strip .ic { font-size: 22px; color: var(--gold); display: grid; }
.controls-hint { text-align: center; font-size: 12px; margin: 0; }

.end-title { text-align: center; font-size: 22px; }
.end-points { display: flex; justify-content: center; align-items: baseline; gap: 4px; }
.end-points b { font-size: 68px; line-height: 1; font-variant-numeric: tabular-nums; letter-spacing: -.03em; color: var(--text); }
.end-points .plus { font: 600 34px var(--font-display); color: var(--accent); }
.end-points .unit { font: 500 18px var(--font); color: var(--text-2); }
.end-tags { display: flex; justify-content: center; gap: 6px; flex-wrap: wrap; }
.end-tags:empty { display: none; }
.tag { display: inline-flex; align-items: center; gap: 6px; padding: 6px 10px; border-radius: 8px; font-size: 12.5px; font-weight: 600; animation: pop .4s cubic-bezier(.2, .9, .3, 1.4) both; }
.tag-gold { background: var(--gold-soft); color: var(--gold); box-shadow: inset 0 0 0 1px rgba(233, 196, 125, .35); }
.tag-cyan { background: var(--accent-soft); color: var(--accent); }
.tag-pink { background: rgba(255, 111, 174, .12); color: #ff9cc6; box-shadow: inset 0 0 0 1px rgba(255, 111, 174, .3); }
@keyframes pop { from { transform: scale(.4); opacity: 0; } }
.end-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.end-stats > div { display: grid; gap: 2px; text-align: center; padding: 10px 4px; border-radius: 14px; background: rgba(255, 255, 255, .04); border: 1px solid var(--line); }
.end-stats b { font: 700 20px var(--font-display); font-variant-numeric: tabular-nums; }
.end-stats span { font-size: 11px; color: var(--text-3); text-transform: uppercase; letter-spacing: .6px; font-weight: 700; }
.end-progress { display: grid; gap: 8px; padding: 12px; border-radius: 16px; background: rgba(255, 255, 255, .04); border: 1px solid var(--line); }
.end-progress .row { display: flex; align-items: center; gap: 8px; font-size: 13px; }
.end-league { font-size: 13.5px; color: var(--text-2); display: grid; gap: 4px; }
.end-league b { color: var(--text); }
.end-guest { display: grid; gap: 10px; font-size: 14px; text-align: center; }
.end-guest p { margin: 0; color: var(--text-2); }
.end-links { display: flex; justify-content: center; gap: 4px; }

.toast { background: rgba(10, 12, 30, .85); border: 1px solid var(--line-strong); backdrop-filter: blur(10px); font-size: 14px; }
.toast.kill { border-color: rgba(94, 240, 168, .45); color: var(--accent); }
.toast.gold { border-color: var(--gold); color: var(--gold); }

@media (max-width: 440px) {
  .hide-xs, .stat-pill > .hide-xs { display: none; }
  .lb { width: 146px; }
  .stat-pill { gap: 10px; padding: 6px 10px; }
  .stat-pill b { font-size: 15px; }
}

/* Desktop */
@media (min-width: 900px) and (hover: hover) {
  .hud-tl { left: 18px; top: 18px; }
  .hud-tr { right: 18px; top: 18px; }
  .lb { width: 230px; padding: 8px 8px 10px; }
  .lb li { font-size: 14px; padding: 4px 8px; }
  .lb li:nth-child(n+6) { display: flex; }
  .minimap-wrap { left: auto; top: auto; right: 18px; bottom: 18px; width: 170px; height: 170px; }
  .hud-bl { left: 18px; bottom: 18px; }
  .chat { width: 380px; }
  .chat-log { max-height: 260px; }
  .overlay { place-items: center; }
}

/* Onglets du tchat */
.chat-tabs { display: flex; gap: 4px; padding: 2px; }
.chat-tabs button { flex: 1; display: inline-flex; align-items: center; justify-content: center; gap: 6px; height: 30px; border: 0; border-radius: 9px; background: transparent; color: var(--text-3); font: 600 12.5px var(--font); cursor: pointer; position: relative; }
.chat-tabs button.active { background: rgba(255, 255, 255, .07); color: var(--text); }
.chat-tabs .dot { width: 6px; height: 6px; border-radius: 50%; background: var(--accent); }
.team-tag { display: inline-flex; align-items: center; height: 16px; padding: 0 5px; border-radius: 4px; font: 700 9.5px/1 var(--font); letter-spacing: .06em; color: #05060a; background: var(--tc, var(--accent)); }
.team-tag:empty { display: none; }
.msg .team-tag { height: 15px; font-size: 9px; }
.msg-role { font-size: 10.5px; color: var(--text-3); font-weight: 600; }
.chat-guest { display: flex; align-items: center; gap: 8px; height: 40px; padding: 0 12px; border-radius: 12px; background: var(--accent-soft); color: var(--accent); font-size: 13px; font-weight: 600; box-shadow: inset 0 0 0 1px rgba(94, 240, 168, .25); }
.chat.guest .chat-form { display: none; }
/* Barre spectateur */
.spec-bar { position: absolute; left: 50%; transform: translateX(-50%); top: calc(64px + var(--safe-t)); display: flex; align-items: center; gap: 12px; padding: 6px 6px 6px 14px; border-radius: 14px; }
.spec-label { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; font-weight: 600; color: var(--text-2); }
body.spectating .stat-pill, body.spectating .actions { display: none !important; }
@media (min-width: 900px) and (hover: hover) { .spec-bar { top: 18px; } }
.lb li .team-tag { height: 14px; font-size: 8.5px; padding: 0 4px; flex-shrink: 0; }
@media (max-width: 899px), (hover: none) {
  .spec-bar { top: auto; left: auto; transform: none; right: 12px; bottom: calc(14px + var(--safe-b)); flex-direction: column; align-items: stretch; gap: 6px; padding: 8px; }
  .spec-label { justify-content: center; }
}
/* Tchat : défilement invisible tant qu'on ne survole pas */
.chat-log { scrollbar-width: none; overscroll-behavior: contain; }
.chat-log::-webkit-scrollbar { width: 0; }
@media (hover: hover) {
  .chat-log:hover { scrollbar-width: thin; scrollbar-color: rgba(255, 255, 255, .16) transparent; }
  .chat-log:hover::-webkit-scrollbar { width: 6px; }
}
.spec-label b { color: var(--text); font-weight: 600; }
@media (max-width: 899px), (hover: none) {
  .spec-bar { flex-direction: row; padding: 6px; gap: 6px; }
  .spec-label b, .spec-label .dim { display: none; }
  .spec-label { width: 34px; justify-content: center; font-size: 18px; }
}

/* Classement repliable */
.lb-head { gap: 6px; }
.lb-head .display { margin-right: auto; }
.lb-chev { font-size: 14px; color: var(--text-3); transition: transform .2s ease; }
.lb.collapsed .lb-chev { transform: rotate(180deg); }
.lb.collapsed { width: auto; min-width: 0; padding-bottom: 6px; }
.lb.collapsed ol, .lb.collapsed .lb-me { display: none !important; }
.lb.collapsed .lb-head { padding-bottom: 4px; }
.lb.collapsed .lb-count { color: var(--accent); }
.lb-count { white-space: nowrap; }
@media (max-width: 440px) { .lb-head .display { font-size: 13px; } .lb-count { font-size: 10.5px; } }
@media (max-width: 440px) { .xs-hide { display: none; } }

/* Barre d'outils staff */
.staff-bar { position: absolute; left: 10px; top: calc(176px + var(--safe-t)); display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 6px; border-radius: 14px; border-color: rgba(255, 90, 110, .35); }
.staff-label { font: 700 8.5px/1 var(--font); letter-spacing: .12em; text-transform: uppercase; color: #ff8b99; padding: 2px 0; }
.sb-btn { width: 40px; height: 40px; border-radius: 11px; border: 0; display: grid; place-items: center; background: rgba(255, 255, 255, .05); color: var(--text); font-size: 19px; cursor: pointer; transition: background .15s, transform .1s; }
.sb-btn:hover { background: rgba(255, 255, 255, .1); }
.sb-btn:active { transform: scale(.92); }
.sb-btn.on { background: var(--accent); color: var(--accent-ink); box-shadow: 0 0 16px rgba(94, 240, 168, .5); }
#sb-virus { color: #4dff8a; }
.announce-box { position: absolute; left: 50%; top: calc(70px + var(--safe-t)); transform: translateX(-50%); width: min(92vw, 420px); padding: 14px; border-radius: 16px; display: grid; gap: 10px; z-index: 6; }
.ab-head { display: flex; align-items: center; gap: 8px; font-weight: 600; font-size: 14px; }
.ab-actions { display: flex; justify-content: flex-end; gap: 6px; }
/* Bandeau d'annonce : discret, ne bloque pas le jeu */
.notices { position: absolute; left: 50%; top: calc(64px + var(--safe-t)); transform: translateX(-50%); display: grid; gap: 8px; justify-items: center; pointer-events: none; width: min(92vw, 520px); z-index: 4; }
.notice { display: flex; gap: 12px; align-items: flex-start; padding: 10px 16px 10px 12px; border-radius: 14px; background: rgba(10, 12, 20, .78); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); border: 1px solid rgba(94, 240, 168, .3); box-shadow: 0 12px 30px -10px rgba(0, 0, 0, .6); animation: notice-in .35s cubic-bezier(.2, .9, .3, 1.2), notice-out .5s ease-in forwards; animation-delay: 0s, 7.5s; }
.notice .ic { width: 30px; height: 30px; border-radius: 9px; flex-shrink: 0; display: grid; place-items: center; background: var(--accent-soft); color: var(--accent); font-size: 16px; }
.notice .tx { display: grid; gap: 2px; min-width: 0; }
.notice .tx b { font-size: 14.5px; font-weight: 600; line-height: 1.4; overflow-wrap: anywhere; }
.notice .tx span { font-size: 11px; color: var(--text-3); letter-spacing: .04em; }
@keyframes notice-in { from { opacity: 0; transform: translateY(-10px) scale(.97); } }
@keyframes notice-out { to { opacity: 0; transform: translateY(-8px); } }
@media (min-width: 900px) and (hover: hover) {
  .staff-bar { left: 18px; top: 50%; transform: translateY(-50%); }
  .notices { top: 76px; }
  .announce-box { top: 84px; }
}
.mode-note { display: flex; gap: 12px; align-items: flex-start; padding: 12px 14px; border-radius: 14px; background: rgba(108, 140, 255, .1); border: 1px solid rgba(108, 140, 255, .3); font-size: 13px; line-height: 1.45; }
.mode-note > .i { font-size: 20px; color: var(--blue); flex-shrink: 0; margin-top: 2px; }
.lb li .nm.dim { color: var(--text-3); font-size: 11.5px; }

/* Choix du serveur (lobby) */
.srv-pick { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.srv { display: flex; align-items: center; gap: 10px; padding: 10px; border-radius: 14px; border: 1px solid var(--line); background: rgba(255, 255, 255, .03); color: var(--text); cursor: pointer; text-align: left; transition: border-color .15s, background .15s; min-width: 0; }
.srv:hover { background: rgba(255, 255, 255, .06); }
.srv.on { border-color: rgba(94, 240, 168, .55); background: var(--accent-soft); box-shadow: inset 0 0 0 1px rgba(94, 240, 168, .25); }
.srv[disabled] { opacity: .45; cursor: not-allowed; }
.srv-ic { width: 34px; height: 34px; border-radius: 10px; flex-shrink: 0; display: grid; place-items: center; font-size: 18px; color: var(--accent); background: var(--accent-soft); }
.srv-ic.team { color: var(--blue); background: rgba(108, 140, 255, .14); }
.srv-tx { display: grid; gap: 1px; min-width: 0; }
.srv-tx b { font: 600 14.5px/1.2 var(--font-display); }
.srv-tx span { font-size: 11.5px; color: var(--text-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* Carte de profil (clic sur un joueur du tchat) */
.msg-who { padding: 0; border: 0; background: none; border-radius: 50%; cursor: pointer; flex-shrink: 0; }
.msg-who:hover .avatar { box-shadow: 0 0 0 2px rgba(255, 255, 255, .35); }
button.msg-name { padding: 0; border: 0; background: none; font: inherit; font-weight: 800; font-size: 12.5px; cursor: pointer; }
button.msg-name:hover { text-decoration: underline; text-underline-offset: 2px; }
.pcard { background: rgba(11, 13, 21, .96); box-shadow: 0 20px 50px -12px rgba(0, 0, 0, .8), inset 0 0 0 1px var(--line-strong); position: fixed; z-index: 60; padding: 16px; border-radius: 18px; display: grid; gap: 14px; animation: pc-in .18s cubic-bezier(.2, .9, .3, 1.2); }
.pcard[hidden] { display: none; }
@keyframes pc-in { from { opacity: 0; transform: translateY(6px) scale(.98); } }
.pc-close { position: absolute; top: 10px; right: 10px; width: 28px; height: 28px; border: 0; border-radius: 8px; background: rgba(255, 255, 255, .06); color: var(--text-2); display: grid; place-items: center; cursor: pointer; }
.pc-close:hover { color: var(--text); background: rgba(255, 255, 255, .1); }
.pc-head { display: flex; gap: 12px; align-items: center; padding-right: 30px; }
.pc-id { display: grid; gap: 5px; min-width: 0; }
.pc-name { display: flex; align-items: center; gap: 6px; font: 600 17px/1.1 var(--font-display); }
.pc-name span:last-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pc-badges { display: flex; gap: 4px; flex-wrap: wrap; }
.pc-badges:empty { display: none; }
.pc-lvl { display: flex; align-items: center; gap: 10px; }
.pc-lvl .progress { flex: 1; }
.pc-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
.pc-stat { display: grid; gap: 3px; padding: 9px 8px; border-radius: 11px; background: rgba(255, 255, 255, .04); text-align: center; }
.pc-stat b { font: 600 16px/1 var(--font-display); font-variant-numeric: tabular-nums; }
.pc-stat span { font-size: 11px; color: var(--text-2); }
.pc-stat.top b { color: var(--gold); }
.pc-vs { display: flex; gap: 10px; flex-wrap: wrap; align-items: baseline; padding-top: 10px; border-top: 1px solid var(--line); font-size: 12.5px; font-weight: 600; }
.pc-vs em { font-style: normal; font-weight: 700; }
.pc-vs em.plus { color: var(--accent); }
.pc-vs em.minus { color: #ff8b99; }
.pc-guest { margin: 0; font-size: 13px; color: var(--text-2); }
.pc-loading { display: flex; gap: 6px; justify-content: center; padding: 10px 0; }
.pc-loading i { width: 7px; height: 7px; border-radius: 50%; background: var(--text-3); animation: pc-dot 1s infinite; }
.pc-loading i:nth-child(2) { animation-delay: .15s; }
.pc-loading i:nth-child(3) { animation-delay: .3s; }
@keyframes pc-dot { 50% { opacity: .3; transform: translateY(-3px); } }

/* Serveur plein */
.offline-alt { display: grid; gap: 8px; }
.srv.full .srv-tx span { color: var(--red); }

/* Réglages du serveur (super admin) */
.cfg-panel { position: fixed; z-index: 55; right: 12px; top: calc(62px + var(--safe-t)); width: min(380px, calc(100vw - 24px)); max-height: calc(100vh - 90px); display: grid; grid-template-rows: auto auto 1fr auto; border-radius: 18px; background: rgba(11, 13, 21, .96); box-shadow: 0 20px 50px -12px rgba(0, 0, 0, .8), inset 0 0 0 1px var(--line-strong); overflow: hidden; }
.cfg-panel[hidden] { display: none; }
.cfg-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 14px 14px 10px 16px; }
.cfg-head b { font: 600 16px/1 var(--font-display); }
.cfg-head .dim { font-size: 13px; }
.cfg-head .pc-close { position: static; }
.cfg-stats { display: flex; flex-wrap: wrap; gap: 6px 12px; padding: 0 16px 12px; font-size: 12.5px; color: var(--text-2); border-bottom: 1px solid var(--line); }
.cfg-stats b { color: var(--text); font-variant-numeric: tabular-nums; }
.cfg-stats .hot, .cfg-stats .hot b { color: #ff8b99; }
.cfg-body { overflow-y: auto; padding: 6px 16px 10px; display: grid; gap: 2px; scrollbar-width: thin; }
.cfg-group { margin-top: 10px; font: 600 10.5px/1 var(--font); letter-spacing: .14em; text-transform: uppercase; color: var(--text-3); }
.cfg-row { display: grid; grid-template-columns: 1fr auto; gap: 4px 10px; align-items: center; padding: 8px 0; border-bottom: 1px solid var(--line); cursor: pointer; }
.cfg-row:last-child { border-bottom: 0; }
.cfg-label { font-size: 13.5px; font-weight: 600; }
.cfg-def { font-style: normal; font-weight: 500; font-size: 11.5px; color: var(--gold); }
.cfg-row.changed .cfg-val { color: var(--gold); }
.cfg-val { font-size: 13px; font-weight: 700; font-variant-numeric: tabular-nums; }
.cfg-row input[type=range] { grid-column: 1 / -1; width: 100%; accent-color: var(--accent); }
.cfg-switch { grid-column: 1 / -1; justify-self: start; width: 18px; height: 18px; accent-color: var(--accent); }
.cfg-foot { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 10px 16px; border-top: 1px solid var(--line); font-size: 12px; }

/* Nombre de joueurs en ligne (menu) */
.online-line { margin: 0; display: flex; align-items: center; justify-content: center; gap: 8px; font-size: 12.5px; font-weight: 600; color: var(--text-2); }
.dot-live { display: inline-block; width: 7px; height: 7px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 0 3px rgba(94, 240, 168, .18); flex-shrink: 0; }

/* Bouton son des annonces */
.hud-row { display: flex; gap: 8px; }
.sound-toggle .off { display: none; }
.sound-toggle.muted .on { display: none; }
.sound-toggle.muted .off { display: block; }
.sound-toggle.muted { color: var(--text-3); }

/* Détail des points de ligue en fin de partie */
.end-detail { margin: -4px 0 0; display: grid; gap: 4px; justify-items: center; text-align: center; font-size: 12.5px; color: var(--text-2); }
.end-detail .withheld { color: var(--gold); font-weight: 600; }
.cfg-stats .cfg-levels { flex-basis: 100%; }

/* Panneau de réglages : sections dépliables */
.cfg-body { gap: 8px; padding-top: 10px; }
.cfg-sec { border-radius: 12px; background: rgba(255, 255, 255, .025); box-shadow: inset 0 0 0 1px var(--line); overflow: hidden; }
.cfg-sec-head { width: 100%; display: flex; align-items: center; gap: 10px; padding: 11px 12px; border: 0; background: none; color: var(--text); cursor: pointer; font: inherit; text-align: left; }
.cfg-sec-head:hover { background: rgba(255, 255, 255, .03); }
.cfg-sec-title { font: 600 11px/1 var(--font); letter-spacing: .14em; text-transform: uppercase; color: var(--text-2); }
.cfg-sum { margin-left: auto; font-size: 12px; color: var(--text-3); font-variant-numeric: tabular-nums; white-space: nowrap; }
.cfg-chev { font-size: 14px; color: var(--text-3); transition: transform .2s ease; transform: rotate(90deg); }
.cfg-sec.open > .cfg-sec-head .cfg-chev, .cfg-disclosure.open .cfg-chev { transform: rotate(180deg); }
.cfg-sec-body { display: none; padding: 0 12px 6px; }
.cfg-sec.open > .cfg-sec-body { display: grid; }
.cfg-sec.open > .cfg-sec-head .cfg-sum { visibility: hidden; }
.cfg-disclosure { display: flex; align-items: center; gap: 8px; width: 100%; margin: 2px 0; padding: 9px 10px; border: 0; border-radius: 10px; background: rgba(155, 123, 255, .08); box-shadow: inset 0 0 0 1px rgba(155, 123, 255, .22); color: var(--text); cursor: pointer; font: 600 13px/1 var(--font); }
.cfg-disclosure:hover { background: rgba(155, 123, 255, .13); }
.cfg-disclosure .cfg-sum { color: #c3b0ff; }
.cfg-sub { display: none; padding: 6px 4px 2px 10px; margin-left: 4px; border-left: 2px solid rgba(155, 123, 255, .3); }
.cfg-sub.open { display: grid; }
.cfg-levelbar { display: flex; height: 8px; border-radius: 99px; overflow: hidden; background: rgba(255, 255, 255, .06); margin: 4px 0 6px; }
.cfg-levelbar i { display: block; height: 100%; transition: width .3s ease; }
.cfg-levelbar .lv-b { background: #5ad7ff; }
.cfg-levelbar .lv-n { background: #9b7bff; }
.cfg-levelbar .lv-e { background: #ff6f91; }
.cfg-sub .cfg-row:nth-of-type(1) input[type=range] { accent-color: #5ad7ff; }
.cfg-sub .cfg-row:nth-of-type(2) input[type=range] { accent-color: #9b7bff; }
.cfg-sub .cfg-row:nth-of-type(3) input[type=range] { accent-color: #ff6f91; }

/* Invité : une seule ligne discrète sous le bouton Jouer */
.guest-line { margin: -4px 0 0; display: flex; justify-content: center; gap: 8px; font-size: 13px; color: var(--text-3); }
.guest-line a { color: var(--text-2); font-weight: 600; }
.guest-line a:first-child { color: var(--accent); }
.guest-line a:hover { text-decoration: underline; text-underline-offset: 3px; }

/* Fin de partie : un seul retour discret vers l'accueil */
.end-sheet { position: relative; }
.end-home { position: absolute; top: 14px; left: 14px; width: 38px; height: 38px; border-radius: 12px; display: grid; place-items: center; color: var(--text-2); background: rgba(255, 255, 255, .05); box-shadow: inset 0 0 0 1px var(--line); font-size: 18px; }
.end-home:hover { color: var(--text); background: rgba(255, 255, 255, .09); }

/* Tchat : émoticônes et liens du staff */
.emoji-wrap { position: relative; flex-shrink: 0; }
.emoji-btn { width: 40px; height: 40px; border-radius: 12px; border: 0; background: rgba(255, 255, 255, .06); font-size: 19px; line-height: 1; cursor: pointer; display: grid; place-items: center; }
.emoji-btn:hover, .emoji-btn[aria-expanded="true"] { background: rgba(255, 255, 255, .12); }
.emoji-panel { position: absolute; z-index: 70; right: 0; bottom: calc(100% + 8px); width: min(296px, 86vw); display: grid; grid-template-columns: repeat(8, 1fr); gap: 2px; padding: 8px; border-radius: 16px; background: rgba(14, 16, 25, .98); border: 1px solid var(--line-strong); box-shadow: 0 18px 40px -12px rgba(0, 0, 0, .8); }
.emoji-panel[hidden] { display: none; }
.emoji-panel:not(.up) { bottom: auto; top: calc(100% + 8px); }
.emoji { aspect-ratio: 1; border: 0; border-radius: 9px; background: none; font-size: 20px; line-height: 1; cursor: pointer; display: grid; place-items: center; }
.emoji:hover { background: rgba(255, 255, 255, .08); }
.msg-link { color: var(--accent); text-decoration: underline; text-underline-offset: 2px; word-break: break-all; }

/* Votes d'intérêt et fenêtre « Bientôt » */
.vote-btn .i { fill: none; transition: fill .2s, transform .2s; }
.vote-btn.voted .i { fill: currentColor; transform: scale(1.1); }
.vote-count { margin-left: 2px; padding: 2px 8px; border-radius: 99px; background: rgba(0, 0, 0, .18); font-size: 12.5px; font-variant-numeric: tabular-nums; }
.btn:not(.btn-primary):not(.btn-gold) .vote-count { background: rgba(255, 255, 255, .08); }
.soon-dlg { position: relative; text-align: left; justify-items: stretch; gap: 14px; width: min(440px, calc(100vw - 32px)); }
.soon-dlg h2 { font-size: 24px; }
.soon-x { position: absolute; top: 12px; right: 12px; width: 34px; height: 34px; border: 0; border-radius: 10px; background: rgba(255, 255, 255, .06); color: var(--text-2); display: grid; place-items: center; cursor: pointer; }
.soon-badge { justify-self: start; padding: 4px 10px; border-radius: 8px; background: rgba(155, 123, 255, .14); color: #c3b0ff; font: 700 11px/1 var(--font); letter-spacing: .12em; text-transform: uppercase; box-shadow: inset 0 0 0 1px rgba(155, 123, 255, .35); }
.soon-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.soon-list li { display: flex; gap: 12px; align-items: flex-start; font-size: 14.5px; color: var(--text-2); line-height: 1.45; }
.soon-ic { width: 34px; height: 34px; flex-shrink: 0; border-radius: 10px; display: grid; place-items: center; background: rgba(255, 255, 255, .05); font-size: 17px; }
.soon-price { display: flex; align-items: baseline; gap: 8px; }
.soon-price b { font: 600 30px/1 var(--font-display); color: var(--gold); }
.soon-note { margin: -4px 0 0; font-size: 12.5px; text-align: center; }
@media (max-width: 560px) { .soon-dlg { width: 100%; } }
/* Mode pas encore ouvert dans le choix du serveur */
.srv.soon { grid-column: 1 / -1; border-style: dashed; border-color: rgba(155, 123, 255, .35); padding: 8px 10px; }
.srv.soon:hover { border-color: rgba(155, 123, 255, .6); background: rgba(155, 123, 255, .06); }
.srv-ic.soon { color: #c3b0ff; background: rgba(155, 123, 255, .12); }
.srv.soon .srv-tx span { color: #c3b0ff; }

.chat-unread.pop { animation: unread-pop .45s cubic-bezier(.3, 1.6, .5, 1); }
@keyframes unread-pop { 0% { transform: scale(.4); } 60% { transform: scale(1.2); } 100% { transform: scale(1); } }

/* Barre staff : en bas à gauche, dans la rangée tchat / son */
.hud-row { align-items: center; }
.hud-row .staff-bar { position: static; transform: none; flex-direction: row; padding: 4px 6px; gap: 4px; }
.hud-row .staff-bar[hidden] { display: none; }
.hud-row .staff-label { writing-mode: horizontal-tb; transform: none; margin: 0 4px; }
/* Téléphone, mode spectateur : la barre « Jouer » prend toute la largeur en bas,
   le tchat et les boutons passent au-dessus (plus rien ne se touche) */
@media (max-width: 640px) {
  body.spectating .spec-bar { left: 10px; right: 10px; bottom: calc(10px + var(--safe-b)); }
  body.spectating .spec-bar > .btn, body.spectating .spec-bar > button:last-child { flex: 1; }
  body.spectating .hud-bl { bottom: calc(82px + var(--safe-b)); }
}

/* Barre staff pliable, alignée à droite du bouton son */
.hud-row .staff-bar { align-self: stretch; align-items: center; }
.sb-toggle { display: flex; align-items: center; gap: 4px; height: 100%; min-height: 40px; padding: 0 8px; border: 0; border-radius: 10px; background: none; cursor: pointer; color: #ff8b99; }
.sb-toggle:hover { background: rgba(255, 90, 110, .08); }
.sb-chev { font-size: 13px; transform: rotate(90deg); transition: transform .2s; }
.staff-bar.open .sb-chev { transform: rotate(-90deg); }
.sb-tools { display: none; gap: 4px; }
.staff-bar.open .sb-tools { display: flex; }
.sb-tools .sb-btn[hidden] { display: none; }
@media (max-width: 640px) {
  .sb-btn { width: 36px; height: 36px; font-size: 17px; }
  .sb-toggle .staff-label { display: none; }
  .sb-toggle { padding: 0 10px; }
  .sb-toggle::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: #ff5a6e; box-shadow: 0 0 8px rgba(255, 90, 110, .7); }
}
/* Fin de partie : le titre laisse la place au bouton accueil */
.end-title { padding: 0 44px; }
@media (max-width: 640px) {
  .hud-row .staff-bar { padding: 3px; gap: 2px; }
  .sb-tools { gap: 2px; }
  .sb-btn { width: 32px; height: 32px; font-size: 16px; border-radius: 9px; }
  .sb-toggle { padding: 0 6px; min-height: 32px; }
}
