/* =====================================================================
   Nightfall City — thème sombre, couleurs franches par camp
   ===================================================================== */
:root {
  color-scheme: dark; /* le site est déjà sombre : les navigateurs ne doivent pas le « re-assombrir » */
  --bg: #07080d;
  --bg-2: #0c0e16;
  --surface: #121521;
  --surface-2: #181c2b;
  --line: #232840;
  --line-2: #2f3554;
  --text: #e7e9f3;
  --muted: #8b92b0;
  --dim: #5b6283;

  --police: #3d7bff;
  --police-2: #22d3ee;
  --crime: #ff3b5c;
  --crime-2: #ff8a3d;
  --cash: #22e39a;
  --dirty: #b26bff;
  --gold: #ffc53d;
  --danger: #ff4d6a;
  --ok: #22e39a;
  --info: #3d9bff;

  --accent: #8b7bff;
  --accent-2: #22d3ee;

  --radius: 12px;
  --radius-sm: 8px;
  --sidebar: 250px;
  --topbar: 60px;
  --font: 'Inter', system-ui, sans-serif;
  --display: 'Chakra Petch', 'Inter', sans-serif;
}
.theme-police   { --accent: var(--police); --accent-2: var(--police-2); }
.theme-criminal { --accent: var(--crime);  --accent-2: var(--crime-2); }

* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  background: var(--bg);
  color: var(--text);
  font: 15px/1.55 var(--font);
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}
body::before { /* halo d'ambiance */
  content: ''; position: fixed; inset: 0; pointer-events: none; z-index: -1;
  background:
    radial-gradient(900px 500px at 85% -10%, color-mix(in srgb, var(--accent) 16%, transparent), transparent 70%),
    radial-gradient(700px 400px at -10% 110%, color-mix(in srgb, var(--accent-2) 10%, transparent), transparent 70%);
}
a { color: var(--accent-2); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3, h4 { font-family: var(--display); letter-spacing: .02em; margin: 0 0 .6em; line-height: 1.2; }
h1 { font-size: 30px; }
h2 { font-size: 21px; }
h3 { font-size: 17px; }
p { margin: 0 0 1em; }
small, .muted { color: var(--muted); }
.dim { color: var(--dim); }
code { background: var(--surface-2); padding: 2px 6px; border-radius: 5px; font-size: 13px; }

/* ---------- Topbar ---------- */
.topbar {
  position: fixed; top: 0; left: 0; right: 0; height: var(--topbar); z-index: 30;
  display: flex; align-items: center; gap: 18px; padding: 0 18px;
  background: color-mix(in srgb, var(--bg-2) 88%, transparent);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}
.brand { display: flex; align-items: center; gap: 10px; font-family: var(--display); font-weight: 700; font-size: 19px; color: var(--text); text-transform: uppercase; letter-spacing: .08em; white-space: nowrap; }
.brand:hover { text-decoration: none; }
.brand-mark { width: 14px; height: 14px; border-radius: 3px; transform: rotate(45deg); background: linear-gradient(135deg, var(--police), var(--crime)); box-shadow: 0 0 14px color-mix(in srgb, var(--accent) 70%, transparent); }
.topstats { display: flex; gap: 8px; flex: 1; overflow-x: auto; scrollbar-width: none; }
.ts { white-space: nowrap; padding: 5px 11px; border-radius: 999px; background: var(--surface); border: 1px solid var(--line); font-size: 13px; font-weight: 600; }
.ts-server { color: var(--accent-2); }
.ts-wipe { color: var(--gold); }
.ts-cash { color: var(--cash); }
.ts-dirty { color: var(--dirty); }
.ts-wanted { color: var(--gold); letter-spacing: 2px; }
.ts-wanted i { color: var(--line-2); font-style: normal; }
.userbox { display: flex; align-items: center; gap: 10px; margin-left: auto; }
.userbox form { margin: 0; }
.uname { font-weight: 600; }
.burger { display: none; background: none; border: 0; color: var(--text); font-size: 22px; cursor: pointer; }

.role-pill { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; padding: 3px 8px; border-radius: 999px; border: 1px solid currentColor; }
.role-founder   { color: var(--gold); }
.role-admin     { color: var(--crime); }
.role-moderator { color: var(--police-2); }
.role-player    { color: var(--muted); }

/* ---------- Sidebar ---------- */
.sidebar {
  position: fixed; top: var(--topbar); bottom: 0; left: 0; width: var(--sidebar); z-index: 20;
  padding: 18px 12px 30px; overflow-y: auto;
  background: var(--bg-2); border-right: 1px solid var(--line);
}
.nav-title { font-size: 11px; text-transform: uppercase; letter-spacing: .12em; color: var(--dim); margin: 18px 10px 6px; font-weight: 700; }
.nav-sep { height: 1px; background: var(--line); margin: 14px 8px; }
.nav-link { display: flex; align-items: center; gap: 10px; padding: 9px 10px; border-radius: var(--radius-sm); color: var(--muted); font-weight: 500; transition: .15s; }
.nav-link:hover { background: var(--surface); color: var(--text); text-decoration: none; }
.nav-link.active { background: color-mix(in srgb, var(--accent) 16%, transparent); color: var(--text); box-shadow: inset 3px 0 0 var(--accent); }
.nav-link .ni { width: 22px; text-align: center; color: var(--accent); }
.nav-link.soon { opacity: .45; cursor: default; }
.nav-link.soon:hover { background: none; color: var(--muted); }
.nav-soon, .nav-badge { margin-left: auto; font-size: 10px; text-transform: uppercase; letter-spacing: .06em; padding: 2px 6px; border-radius: 5px; background: var(--surface-2); color: var(--dim); }
.nav-badge { background: var(--accent); color: #fff; }

.char-card { padding: 14px; border-radius: var(--radius); background: linear-gradient(160deg, color-mix(in srgb, var(--accent) 22%, var(--surface)), var(--surface)); border: 1px solid color-mix(in srgb, var(--accent) 40%, var(--line)); }
.cc-faction { font-size: 11px; text-transform: uppercase; letter-spacing: .1em; color: var(--accent-2); font-weight: 700; }
.cc-name { font-family: var(--display); font-size: 20px; font-weight: 700; margin: 2px 0; }
.cc-level { font-size: 13px; color: var(--muted); margin-bottom: 8px; }

.bar { height: 6px; border-radius: 99px; background: var(--bg); overflow: hidden; margin-top: 6px; }
.bar span { display: block; height: 100%; border-radius: 99px; }
.bar.xp span { background: linear-gradient(90deg, var(--gold), #ffe08a); }
.bar.hp span { background: linear-gradient(90deg, var(--danger), #ff8fa2); }

/* ---------- Layout principal ---------- */
.app-main { margin-left: var(--sidebar); padding: calc(var(--topbar) + 28px) 32px 60px; max-width: calc(1280px + var(--sidebar)); }
.guest-main { min-height: 100vh; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 22px; flex-wrap: wrap; }
.page-head h1 { margin: 0; }
.page-head p { margin: 4px 0 0; color: var(--muted); }

.grid { display: grid; gap: 18px; }
.g2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.g3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.g4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.span2 { grid-column: span 2; }

.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; }
.card h2, .card h3 { display: flex; align-items: center; gap: 8px; }
.card-accent { border-color: color-mix(in srgb, var(--accent) 45%, var(--line)); box-shadow: 0 0 0 1px color-mix(in srgb, var(--accent) 12%, transparent), 0 20px 40px -24px color-mix(in srgb, var(--accent) 60%, transparent); }

.stat { padding: 16px 18px; }
.stat .k { font-size: 12px; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); font-weight: 600; }
.stat .v { font-family: var(--display); font-size: 26px; font-weight: 700; margin-top: 4px; }
.v.cash { color: var(--cash); } .v.dirty { color: var(--dirty); } .v.gold { color: var(--gold); } .v.accent { color: var(--accent-2); } .v.danger { color: var(--danger); }

/* ---------- Formulaires & boutons ---------- */
label { display: block; font-size: 13px; font-weight: 600; color: var(--muted); margin-bottom: 6px; }
.field { margin-bottom: 16px; }
input[type=text], input[type=search], input[type=email], input[type=password], input[type=number], input[type=datetime-local], select, textarea {
  width: 100%; padding: 11px 13px; border-radius: var(--radius-sm);
  background: var(--bg-2); border: 1px solid var(--line-2); color: var(--text); font: inherit;
  transition: border-color .15s, box-shadow .15s;
}
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 25%, transparent); }
.inline-form { display: flex; gap: 8px; align-items: center; }
.inline-form input, .inline-form select { width: auto; flex: 1; min-width: 0; }
.check { display: flex; gap: 8px; align-items: center; font-weight: 500; color: var(--text); }

.btn, .btn-ghost, .btn-danger, .btn-ok {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 10px 18px; border-radius: var(--radius-sm); border: 1px solid transparent;
  font: 600 14px var(--font); cursor: pointer; transition: .15s; white-space: nowrap; color: #fff;
}
.btn { background: linear-gradient(135deg, var(--accent), color-mix(in srgb, var(--accent) 70%, var(--accent-2))); box-shadow: 0 8px 22px -10px var(--accent); }
.btn:hover { filter: brightness(1.12); text-decoration: none; }
.btn-ghost { background: transparent; border-color: var(--line-2); color: var(--text); }
.btn-ghost:hover { border-color: var(--accent); text-decoration: none; }
.btn-danger { background: color-mix(in srgb, var(--danger) 18%, transparent); border-color: color-mix(in srgb, var(--danger) 55%, transparent); color: #ffb3c0; }
.btn-danger:hover { background: var(--danger); color: #fff; }
.btn-ok { background: color-mix(in srgb, var(--ok) 16%, transparent); border-color: color-mix(in srgb, var(--ok) 50%, transparent); color: var(--ok); }
.btn-ok:hover { background: var(--ok); color: #04130c; }
.btn.block, .btn-ghost.block { width: 100%; }
.sm { padding: 6px 11px; font-size: 13px; }
button:disabled, .btn[disabled] { opacity: .4; cursor: not-allowed; filter: grayscale(.6); box-shadow: none; }

/* ---------- Flash ---------- */
.flash { padding: 12px 16px; border-radius: var(--radius-sm); margin-bottom: 16px; border: 1px solid; font-weight: 500; }
.flash-success { background: color-mix(in srgb, var(--ok) 12%, transparent); border-color: color-mix(in srgb, var(--ok) 45%, transparent); color: #9cf5cf; }
.flash-error   { background: color-mix(in srgb, var(--danger) 12%, transparent); border-color: color-mix(in srgb, var(--danger) 45%, transparent); color: #ffb3c0; }
.flash-info    { background: color-mix(in srgb, var(--info) 12%, transparent); border-color: color-mix(in srgb, var(--info) 45%, transparent); color: #b6d6ff; }
.guest-main .flash { position: fixed; top: 18px; left: 50%; transform: translateX(-50%); z-index: 50; min-width: 320px; max-width: 90vw; backdrop-filter: blur(10px); }

/* ---------- Tables ---------- */
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 14px; }
th { text-align: left; font-size: 11px; text-transform: uppercase; letter-spacing: .08em; color: var(--dim); padding: 10px 12px; border-bottom: 1px solid var(--line); font-weight: 700; }
td { padding: 11px 12px; border-bottom: 1px solid var(--line); vertical-align: middle; }
tr:hover td { background: color-mix(in srgb, var(--surface-2) 60%, transparent); }
.tag { display: inline-block; padding: 2px 8px; border-radius: 6px; font-size: 12px; font-weight: 600; background: var(--surface-2); color: var(--muted); }
.tag.police { background: color-mix(in srgb, var(--police) 20%, transparent); color: #9dbbff; }
.tag.criminal { background: color-mix(in srgb, var(--crime) 20%, transparent); color: #ff9aac; }
.tag.open { background: color-mix(in srgb, var(--ok) 18%, transparent); color: var(--ok); }
.tag.closed { background: var(--surface-2); color: var(--dim); }
.stars { color: var(--gold); letter-spacing: 2px; }
.stars i { color: var(--line-2); font-style: normal; }

/* ---------- Actions ---------- */
.action-cat { margin: 26px 0 12px; font-size: 13px; text-transform: uppercase; letter-spacing: .1em; color: var(--muted); }
.action { display: flex; flex-direction: column; gap: 10px; position: relative; overflow: hidden; }
.action .a-top { display: flex; gap: 12px; align-items: center; }
.action .a-icon { width: 46px; height: 46px; border-radius: 12px; display: grid; place-items: center; font-size: 22px; background: color-mix(in srgb, var(--accent) 16%, var(--surface-2)); border: 1px solid color-mix(in srgb, var(--accent) 35%, transparent); flex-shrink: 0; }
.action h3 { margin: 0; }
.action .a-meta { display: flex; gap: 6px; flex-wrap: wrap; }
.action p { color: var(--muted); font-size: 14px; margin: 0; flex: 1; }
.action form { margin: 0; }
.action.locked { opacity: .55; }
.cd { font-variant-numeric: tabular-nums; }

/* ---------- Inventaire ---------- */
.slots { display: grid; grid-template-columns: repeat(auto-fill, minmax(84px, 1fr)); gap: 10px; }
.slot {
  aspect-ratio: 1; border-radius: 10px; background: var(--bg-2); border: 1px dashed var(--line-2);
  position: relative; display: grid; place-items: center; cursor: default; user-select: none; transition: .12s;
}
.slot.filled { border-style: solid; cursor: grab; background: linear-gradient(160deg, var(--surface-2), var(--bg-2)); }
.slot.filled:hover { transform: translateY(-2px); border-color: var(--accent); }
.slot.selected { border-color: var(--accent); box-shadow: 0 0 0 2px var(--accent), 0 0 18px -4px var(--accent); }
.slot.drop-target { border-color: var(--accent-2); background: color-mix(in srgb, var(--accent-2) 12%, var(--bg-2)); }
.slot .s-icon { font-size: 30px; line-height: 1; }
.slot .s-qty { position: absolute; bottom: 4px; right: 7px; font-size: 12px; font-weight: 700; }
.slot .s-ill { position: absolute; top: 4px; left: 6px; font-size: 10px; color: var(--danger); font-weight: 800; }
.slot.r-uncommon { border-color: #3ad17a66; } .slot.r-rare { border-color: #3d9bff88; } .slot.r-epic { border-color: #b26bff99; } .slot.r-legendary { border-color: #ffc53daa; }
.capacity { font-size: 13px; color: var(--muted); }
.item-panel { position: sticky; top: calc(var(--topbar) + 20px); }
.item-panel .ip-icon { font-size: 44px; }
.rar { font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; }
.rar.common { color: var(--muted); } .rar.uncommon { color: #3ad17a; } .rar.rare { color: #3d9bff; } .rar.epic { color: var(--dirty); } .rar.legendary { color: var(--gold); }

/* ---------- Fil d'actualité ---------- */
.feed { list-style: none; margin: 0; padding: 0; }
.feed li { display: flex; gap: 10px; padding: 9px 0; border-bottom: 1px solid var(--line); font-size: 14px; }
.feed li:last-child { border-bottom: 0; }
.feed time { color: var(--dim); font-size: 12px; white-space: nowrap; padding-top: 2px; min-width: 42px; flex-shrink: 0; }
.feed .ev-fail { color: #ffb3c0; }
.feed .ev-arrest { color: #9dbbff; }
.feed .ev-level { color: var(--gold); }

/* ---------- Prison ---------- */
.jail { text-align: center; padding: 34px 20px; background: repeating-linear-gradient(90deg, var(--surface) 0 38px, var(--bg-2) 38px 46px); border-color: var(--line-2); }
.jail .big { font-family: var(--display); font-size: 42px; color: var(--gold); }

/* =====================================================================
   PAGES INVITÉ (accueil, connexion, inscription)
   ===================================================================== */
.landing-nav { position: absolute; top: 0; left: 0; right: 0; display: flex; align-items: center; justify-content: space-between; padding: 22px 40px; z-index: 5; }
.landing-nav .links { display: flex; gap: 10px; }
.hero { min-height: 100vh; display: grid; grid-template-columns: 1fr 1fr; position: relative; overflow: hidden; }
.hero-side { position: relative; display: flex; flex-direction: column; justify-content: center; padding: 120px 8% 80px; }
.hero-side.police { background: radial-gradient(circle at 20% 30%, #3d7bff33, transparent 60%), linear-gradient(160deg, #0a1430, #07080d 70%); }
.hero-side.crime  { background: radial-gradient(circle at 80% 70%, #ff3b5c33, transparent 60%), linear-gradient(200deg, #2a0a14, #07080d 70%); text-align: right; align-items: flex-end; }
.hero-side .kicker { font-family: var(--display); font-weight: 700; letter-spacing: .2em; text-transform: uppercase; font-size: 13px; }
.hero-side.police .kicker { color: var(--police-2); }
.hero-side.crime .kicker { color: var(--crime-2); }
.hero-side h2 { font-size: clamp(32px, 4.4vw, 62px); text-transform: uppercase; margin: 10px 0 14px; }
.hero-side.police h2 { color: #fff; text-shadow: 0 0 40px #3d7bff88; }
.hero-side.crime h2 { color: #fff; text-shadow: 0 0 40px #ff3b5c88; }
.hero-side p { max-width: 420px; color: var(--muted); font-size: 16px; }
.hero-center { position: absolute; left: 50%; bottom: 9%; transform: translateX(-50%); text-align: center; z-index: 3; width: min(560px, 90vw); }
.hero-center h1 { font-size: clamp(30px, 4vw, 52px); text-transform: uppercase; letter-spacing: .12em; margin-bottom: 12px; background: linear-gradient(90deg, #9dbbff, #fff 45%, #ff9aac); -webkit-background-clip: text; background-clip: text; color: transparent; }
.hero-center .cta { display: flex; gap: 12px; justify-content: center; }
.hero-divider { position: absolute; top: 0; bottom: 0; left: 50%; width: 2px; background: linear-gradient(transparent, #fff3, transparent); z-index: 2; }
.hero .btn { --accent: #6a5cff; --accent-2: #ff3b5c; padding: 14px 26px; font-size: 15px; }

.features { padding: 80px 40px; max-width: 1180px; margin: 0 auto; }
.features h2 { text-align: center; font-size: 30px; margin-bottom: 40px; }
.feature { padding: 22px; }
.feature .fi { font-size: 28px; margin-bottom: 10px; }
.feature h3 { margin-bottom: 6px; }
.feature p { color: var(--muted); margin: 0; font-size: 14px; }
.footer { text-align: center; padding: 30px; color: var(--dim); font-size: 13px; border-top: 1px solid var(--line); }

.auth-wrap { min-height: 100vh; display: grid; place-items: center; padding: 40px 18px; }
.auth-card { width: min(430px, 100%); padding: 34px; }
.auth-card .brand { justify-content: center; margin-bottom: 22px; }
.auth-card h1 { font-size: 24px; text-align: center; }
.auth-card .sub { text-align: center; color: var(--muted); margin-bottom: 24px; }
.auth-links { display: flex; justify-content: space-between; margin-top: 18px; font-size: 14px; }

/* Choix du camp */
.faction-pick { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.faction-pick input { position: absolute; opacity: 0; pointer-events: none; }
.faction-pick label { margin: 0; cursor: pointer; padding: 18px; border-radius: var(--radius); border: 2px solid var(--line-2); background: var(--bg-2); color: var(--text); text-align: center; transition: .15s; }
.faction-pick label .fp-i { font-size: 30px; display: block; }
.faction-pick label strong { display: block; font-family: var(--display); font-size: 18px; margin: 4px 0; }
.faction-pick label small { font-weight: 400; }
.faction-pick input[value=police]:checked + label { border-color: var(--police); background: #3d7bff1f; box-shadow: 0 0 24px -8px var(--police); }
.faction-pick input[value=criminal]:checked + label { border-color: var(--crime); background: #ff3b5c1f; box-shadow: 0 0 24px -8px var(--crime); }

.server-card { display: flex; flex-direction: column; gap: 12px; }
.server-card .sc-head { display: flex; justify-content: space-between; align-items: center; }
.balance { display: flex; height: 8px; border-radius: 99px; overflow: hidden; background: var(--bg); }
.balance .bp { background: var(--police); } .balance .bc { background: var(--crime); }

/* ---------- Responsive ---------- */
@media (max-width: 1100px) {
  .g4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .g3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 860px) {
  .burger { display: block; }
  .sidebar { transform: translateX(-100%); transition: transform .2s; }
  body.nav-open .sidebar { transform: none; box-shadow: 20px 0 50px #000a; }
  .app-main { margin-left: 0; padding: calc(var(--topbar) + 20px) 16px 50px; }
  .userbox .uname, .userbox .role-pill { display: none; }
  .g2, .g3, .g4 { grid-template-columns: 1fr; }
  .span2 { grid-column: auto; }
  .hero { grid-template-columns: 1fr; }
  .hero { min-height: 0; }
  .hero-side { padding: 110px 24px 40px; min-height: 0; min-width: 0; }
  .hero-side.crime { padding: 40px 24px; }
  .hero-divider { display: none; }
  /* Sur mobile, le titre et les boutons passent sous les deux camps au lieu de les recouvrir. */
  .hero-center { position: static; transform: none; width: auto; padding: 36px 20px 44px; background: #07080d; }
  .hero-center .cta { flex-wrap: wrap; }
  .landing-nav { padding: 16px; gap: 10px; }
  .features { padding: 50px 18px; }
}
@media (max-width: 480px) {
  .landing-nav .brand { font-size: 15px; letter-spacing: .06em; }
  .landing-nav .links .btn-ghost { display: none; } /* « J'ai déjà un compte » reste dans la page */
  .landing-nav .links .btn { padding: 8px 12px; font-size: 13px; }
}

/* ---------- Ajouts game design ---------- */
.loot-line { display: flex; gap: 6px; align-items: center; font-size: 18px; flex-wrap: wrap; }
.loot-line small { font-size: 12px; }
.event-banner { padding: 12px 16px; border-radius: var(--radius-sm); margin-bottom: 16px; border: 1px solid #ffc53d66;
  background: linear-gradient(90deg, #ffc53d1f, #b26bff1a); color: #ffe39a; }
.event-banner .muted { color: #c9b98a; }
.form-section { margin: 22px 0 10px; padding-top: 16px; border-top: 1px solid var(--line); font-size: 12px; text-transform: uppercase; letter-spacing: .1em; color: var(--muted); font-weight: 700; }
.form-section:first-of-type { border-top: 0; padding-top: 0; margin-top: 0; }
.rows-table td { padding: 6px 6px; border: 0; }
.rows-table tr:hover td { background: none; }
.rows-table input, .rows-table select { padding: 8px 10px; }
.help { font-size: 12px; color: var(--dim); margin-top: 4px; }
.toggle-off { opacity: .5; }
.diff-old { color: #ff9aac; text-decoration: line-through; }
.diff-new { color: var(--ok); }
.num-pos { color: var(--ok); } .num-neg { color: var(--danger); }
th.sortable { cursor: pointer; } th.sortable:hover { color: var(--text); }
.nowrap-nums td:not(:first-child) { white-space: nowrap; }

/* =====================================================================
   MODE JEU — ATH façon FPS (toutes les pages de jeu)
   ===================================================================== */
.game-mode { --hud-top: 86px; --hud-bottom: 112px; }
.game-mode::before {
  background:
    radial-gradient(1100px 600px at 50% 40%, transparent 55%, #000a 100%),
    radial-gradient(900px 500px at 85% -10%, color-mix(in srgb, var(--accent) 14%, transparent), transparent 70%);
}
.hud-vignette { position: fixed; inset: 0; pointer-events: none; z-index: 15;
  background: radial-gradient(ellipse at center, transparent 62%, #00000073 100%),
              repeating-linear-gradient(0deg, #ffffff03 0 1px, transparent 1px 3px); }

.hud-box { background: #090b12c4; backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
  border: 1px solid #ffffff14; border-left: 3px solid var(--accent); border-radius: 10px; padding: 8px 12px; box-shadow: 0 10px 30px -12px #000; }
.hud-btn { all: unset; box-sizing: border-box; cursor: pointer; display: grid; place-items: center; width: 32px; height: 32px; border-radius: 8px;
  background: #0b0d16d9; border: 1px solid var(--line-2); font-size: 15px; flex-shrink: 0; transition: .12s; }
.hud-btn:hover { border-color: var(--accent); box-shadow: 0 0 12px -2px var(--accent); }
.hud-btn:disabled { opacity: .3; cursor: default; box-shadow: none; border-color: var(--line-2); }
.hud-btn.sm { width: 26px; height: 26px; font-size: 13px; border-radius: 6px; }
.hud-btn.big { width: 46px; height: 46px; font-size: 22px; border-radius: 10px; }

/* --- Haut --- */
.hud-top { position: fixed; top: 0; left: 0; right: 0; z-index: 30; display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; padding: 12px 16px; pointer-events: none; }
.hud-top > * { pointer-events: auto; }
.hud-tl { min-width: 230px; max-width: 360px; }
.tl-name { font-family: var(--display); font-size: 16px; font-weight: 700; line-height: 1.15; }
.tl-sub { font-size: 12px; color: var(--muted); margin-top: 2px; }
.tl-sub b { color: var(--text); }
.tl-wipe { font-size: 12px; color: var(--muted); margin-top: 3px; }
.tl-wipe b { color: var(--gold); font-family: var(--display); }
.hud-tr { display: flex; flex-direction: column; align-items: flex-end; gap: 8px; max-width: 380px; }
.sys-btns { display: flex; gap: 6px; pointer-events: auto; }
/* La zone du fil (même vide ou estompée) ne doit jamais bloquer les clics sur la page : seuls les boutons réagissent. */
.hud-top .hud-tr { pointer-events: none; }
.sys-btns form { margin: 0; }
.killfeed { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; align-items: flex-end; gap: 4px; pointer-events: none; }
.killfeed li { font-size: 12.5px; line-height: 1.35; padding: 4px 10px; border-radius: 6px; background: #000000a6; border-right: 3px solid var(--line-2); text-align: right;
  animation: kf-fade .8s ease var(--kf-delay, 6s) forwards; }
.killfeed li .ic { margin-right: 6px; }
.killfeed li.kf-new { animation: kf-in .35s ease-out, kf-fade .8s ease var(--kf-delay, 6s) forwards; }
.killfeed .kf-action { border-color: var(--ok); } .killfeed .kf-fail { border-color: var(--danger); color: #ffb3c0; }
.killfeed .kf-level, .killfeed .kf-operation { border-color: var(--gold); } .killfeed .kf-arrest { border-color: var(--police); } .killfeed .kf-org { border-color: var(--dirty); }
.hud-tr:hover .killfeed li { animation: none; opacity: 1; visibility: visible; }
@keyframes kf-fade { to { opacity: 0; visibility: hidden; } }
@keyframes kf-in { from { transform: translateX(30px); opacity: 0; } }

/* --- Bas --- */
.hud-bottom { position: fixed; left: 0; right: 0; bottom: 0; z-index: 30; display: grid; grid-template-columns: minmax(250px, 300px) 1fr minmax(250px, 300px);
  align-items: end; gap: 14px; padding: 12px 16px; pointer-events: none; }
.hud-bottom::before { content: ''; position: absolute; inset: auto 0 0 0; height: 140px; background: linear-gradient(transparent, #000000b3); pointer-events: none; z-index: -1; }
.hud-bottom > * { pointer-events: auto; }
.meter { display: flex; align-items: center; gap: 8px; }
.meter + .meter { margin-top: 7px; }
.meter .lbl { width: 20px; text-align: center; font-size: 14px; }
.meter .track { flex: 1; height: 13px; border-radius: 3px; background: #05060a; border: 1px solid #ffffff1a; overflow: hidden; position: relative; transform: skewX(-12deg); }
.meter .track span { position: absolute; inset: 0 auto 0 0; }
.meter .track em { position: absolute; inset: 0; display: grid; place-items: center; font-style: normal; font-size: 9.5px; font-weight: 700; color: #fff; text-shadow: 0 1px 2px #000; letter-spacing: .05em; transform: skewX(12deg); }
.meter.hp .track span { background: linear-gradient(90deg, #b3132f, #ff4d6a); box-shadow: 0 0 10px #ff4d6a77; }
.meter.hp.low .track span { animation: pulse .8s infinite alternate; }
.meter.xp .track span { background: linear-gradient(90deg, #c88c00, #ffc53d); box-shadow: 0 0 10px #ffc53d55; }
.meter .lvl { font-family: var(--display); font-size: 12px; font-weight: 700; color: var(--gold); min-width: 44px; text-align: right; }
@keyframes pulse { from { opacity: .5; } to { opacity: 1; } }
.bl-wanted { margin-top: 7px; font-size: 19px; letter-spacing: 4px; color: var(--gold); padding-left: 28px; }
.bl-wanted i { font-style: normal; color: #ffffff26; }
.bl-wanted.hot { text-shadow: 0 0 10px #ffc53d99; }
.bl-police { margin-top: 7px; font-size: 12px; color: var(--muted); padding-left: 28px; }

.hotbar { justify-self: center; display: flex; gap: 6px; padding: 6px; border-radius: 12px; background: #090b12c4; backdrop-filter: blur(8px); border: 1px solid #ffffff14; box-shadow: 0 10px 30px -12px #000; }
.slotbtn { position: relative; width: 54px; height: 54px; border-radius: 9px; display: grid; place-items: center; background: #ffffff06; border: 1px solid #ffffff17; color: var(--text); transition: .12s; }
.slotbtn:hover { text-decoration: none; border-color: var(--accent); background: color-mix(in srgb, var(--accent) 10%, transparent); transform: translateY(-2px); }
.slotbtn.on { border-color: var(--accent); background: color-mix(in srgb, var(--accent) 22%, transparent); box-shadow: 0 0 14px -2px var(--accent), inset 0 0 12px -6px var(--accent); }
.slotbtn .si { font-size: 23px; line-height: 1; }
.slotbtn kbd { position: absolute; top: 2px; left: 5px; font: 700 10px var(--display); color: var(--dim); }
.slotbtn.on kbd { color: var(--text); }
.slotbtn .sl { position: absolute; bottom: calc(100% + 8px); left: 50%; transform: translateX(-50%); white-space: nowrap; font-size: 12px; font-weight: 600; padding: 4px 8px;
  border-radius: 6px; background: #000000e0; border: 1px solid var(--line-2); opacity: 0; pointer-events: none; transition: .12s; }
.slotbtn:hover .sl, .slotbtn:focus-visible .sl { opacity: 1; }
.slotbtn .sb { position: absolute; top: -5px; right: -5px; min-width: 16px; height: 16px; border-radius: 8px; background: var(--gold); color: #000; font: 800 10px var(--font); display: grid; place-items: center; animation: pulse .8s infinite alternate; }

.hud-br { justify-self: end; display: flex; align-items: flex-end; justify-content: flex-end; gap: 10px; border-left: 1px solid #ffffff14; border-right: 3px solid var(--accent); }
.money-col { display: flex; flex-direction: column; gap: 2px; text-align: right; }
.money-col .m { font-family: var(--display); font-weight: 700; font-size: 15px; white-space: nowrap; }
.money-col .m span { font-size: 13px; margin-right: 6px; }
.money-col .cash { color: var(--cash); } .money-col .bank { color: #9de7c9; } .money-col .dirty { color: var(--dirty); }
.br-btns { display: flex; flex-direction: column; align-items: center; gap: 6px; }

/* --- Contenu --- */
.game-main { max-width: 1180px; margin: 0 auto; padding: calc(var(--hud-top) + 14px) 24px calc(var(--hud-bottom) + 34px); position: relative; z-index: 1; }
.game-mode h1 { font-size: 24px; }
.game-mode .page-head { margin-bottom: 16px; }
.game-mode .page-head p { font-size: 13.5px; }
.game-mode .card { padding: 16px; }
.game-mode .item-panel { top: calc(var(--hud-top) + 10px); }
.game-mode .action-cat { margin-top: 20px; }
.hud-notices { display: flex; flex-direction: column; gap: 8px; margin-bottom: 14px; }
.hud-notices:empty { display: none; }
.hud-notices .flash, .hud-notices .event-banner { margin: 0; }
.flash.toast { animation: toast-out 8s ease forwards; overflow: hidden; }
.flash.toast.flash-error { animation-duration: 12s; }
.flash.toast:hover { animation-play-state: paused; }
@keyframes toast-out { 0%, 88% { opacity: 1; max-height: 200px; } 100% { opacity: 0; max-height: 0; padding-top: 0; padding-bottom: 0; border-width: 0; } }
.jail-strip { display: flex; align-items: center; gap: 14px; padding: 10px 14px; border-radius: 10px; border: 1px solid #ffc53d55;
  background: repeating-linear-gradient(90deg, #ffc53d10 0 22px, transparent 22px 30px), var(--surface); }
.jail-strip .t { font-family: var(--display); font-size: 20px; color: var(--gold); }
.jail-strip form { margin: 0; }

/* Panneaux & fil */
.hud-panel { background: color-mix(in srgb, var(--surface) 88%, transparent); border: 1px solid var(--line); border-radius: 10px; padding: 12px 14px; }
.panel-title { font-size: 12px; text-transform: uppercase; letter-spacing: .1em; color: var(--muted); margin-bottom: 6px; }
.feed-sm li { padding: 6px 0; font-size: 13px; gap: 8px; }
.feed-sm time { min-width: 36px; font-size: 11px; }
.feed-sm .ic { width: 18px; text-align: center; flex-shrink: 0; }
.dash-actions { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 14px; }
.dash-grid { display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr); gap: 14px; align-items: start; }
.dash-grid .feed-sm { max-height: calc(100vh - var(--hud-top) - var(--hud-bottom) - 150px); min-height: 240px; overflow-y: auto; }

/* Fenêtres */
dialog.hud-dialog { background: var(--surface); color: var(--text); border: 1px solid var(--line-2); border-radius: 12px; padding: 18px; width: min(360px, 92vw); }
dialog.hud-dialog::backdrop { background: #000a; backdrop-filter: blur(3px); }
dialog.hud-dialog h3 { margin-bottom: 10px; }
dialog.inv-dialog { width: min(860px, 96vw); max-height: 92vh; padding: 18px 20px; }
.inv-head { display: flex; justify-content: space-between; align-items: center; padding-right: 34px; }
.inv-layout { display: grid; grid-template-columns: minmax(0, 1fr) 260px; gap: 16px; align-items: start; }
.inv-layout .slots { grid-template-columns: repeat(auto-fill, minmax(68px, 1fr)); gap: 8px; }
.inv-layout .slot .s-icon { font-size: 26px; }
.inv-side { background: var(--bg-2); border: 1px solid var(--line); border-radius: 10px; padding: 14px; position: sticky; top: 0; }
.inv-side .ip-icon { font-size: 36px; }
.dlg-close { position: absolute; top: 12px; right: 12px; }

/* --- Écrans moyens et mobiles --- */
@media (max-width: 1100px) {
  .slotbtn { width: 46px; height: 46px; } .slotbtn .si { font-size: 20px; }
  .hud-bottom { grid-template-columns: minmax(220px, 260px) 1fr minmax(200px, 240px); }
}
@media (max-width: 900px) {
  .game-mode { --hud-top: 76px; --hud-bottom: 168px; }
  .killfeed { display: none; }
  .hud-tl { min-width: 0; padding: 6px 10px; }
  .hud-bottom { grid-template-columns: 1fr 1fr; gap: 8px; padding: 8px; }
  .hotbar { grid-column: 1 / -1; order: -1; justify-self: stretch; overflow-x: auto; justify-content: flex-start; }
  .slotbtn { flex-shrink: 0; width: 44px; height: 44px; }
  .slotbtn .sl { display: none; }
  .hud-box { padding: 6px 9px; }
  .game-main { padding-left: 12px; padding-right: 12px; }
  .dash-grid, .inv-layout { grid-template-columns: 1fr; }
}
@media (max-width: 560px) {
  .jail-strip { flex-wrap: wrap; gap: 8px; }
  .money-col .m { font-size: 13px; }
  .hud-btn.big { width: 38px; height: 38px; font-size: 18px; }
  /* Petits écrans : l'identité défile avec la page au lieu de recouvrir le contenu, et les 9 raccourcis tiennent sur une ligne. */
  .game-mode { --hud-top: 104px; }
  .hud-top { position: absolute; }
  .hotbar { justify-content: space-between; gap: 3px; padding: 4px; overflow-x: visible; }
  .slotbtn { width: auto; flex: 1 1 0; min-width: 0; height: 42px; }
  .slotbtn .si { font-size: 18px; }
  .slotbtn kbd { display: none; }
  .bl-wanted { font-size: 15px; padding-left: 0; }
}

/* --- Activités : catégories repliables --- */
.acc { margin-bottom: 10px; border: 1px solid var(--line); border-radius: 12px; background: color-mix(in srgb, var(--surface) 80%, transparent); overflow: hidden; }
.acc > summary { list-style: none; display: flex; align-items: center; gap: 12px; padding: 12px 16px; cursor: pointer; user-select: none; transition: background .12s; }
.acc > summary::-webkit-details-marker { display: none; }
.acc > summary:hover { background: color-mix(in srgb, var(--accent) 7%, transparent); }
.acc[open] > summary { background: color-mix(in srgb, var(--accent) 12%, transparent); border-bottom: 1px solid var(--line); box-shadow: inset 3px 0 0 var(--accent); }
.ac-icon { font-size: 20px; width: 26px; text-align: center; }
.ac-name { font-family: var(--display); font-weight: 700; font-size: 16px; }
.ac-count { font-size: 12px; color: var(--muted); }
.ac-ready { font-size: 11px; font-weight: 700; padding: 2px 8px; border-radius: 999px; background: var(--surface-2); color: var(--dim); }
.ac-ready.on { background: color-mix(in srgb, var(--ok) 18%, transparent); color: var(--ok); }
.ac-icons { margin-left: auto; display: flex; gap: 4px; font-size: 15px; opacity: .75; }
.ac-chev { font-size: 14px; color: var(--muted); transition: transform .15s; }
.acc[open] .ac-chev { transform: rotate(180deg); }
.act-grid { padding: 14px; }
.act-grid .action { padding: 14px; gap: 8px; }
.act-grid .action p { font-size: 13px; }
.act-grid .action .a-icon { width: 40px; height: 40px; font-size: 20px; }
@media (max-width: 700px) { .ac-icons, .ac-count { display: none; } }

/* --- Fenêtre « Gains » --- */
.act-btns { display: flex; gap: 8px; }
.act-btns .btn { flex: 1; }
.gain-btn { padding: 10px 12px; }
dialog.gain-dialog { width: min(620px, 96vw); max-height: 90vh; padding: 20px; }
.gd-head { display: flex; gap: 12px; align-items: center; padding-right: 40px; }
.gd-head .a-icon { width: 46px; height: 46px; border-radius: 12px; display: grid; place-items: center; font-size: 22px; background: color-mix(in srgb, var(--accent) 16%, var(--surface-2)); border: 1px solid color-mix(in srgb, var(--accent) 35%, transparent); }
.gd-section { margin: 16px 0 8px; font-size: 12px; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); font-weight: 700; }
.gd-section strong { font-size: 15px; letter-spacing: 0; }
.gd-table { width: 100%; font-size: 13px; }
.gd-table td, .gd-table th { padding: 6px 8px; }
.gd-table.loot td:not(:first-child), .gd-table.loot th:not(:first-child) { text-align: right; white-space: nowrap; }
.gd-off td { color: var(--dim); }
.gd-box { border-radius: 10px; padding: 10px 12px; border: 1px solid var(--line); background: var(--bg-2); }
.gd-box.ok { border-color: color-mix(in srgb, var(--ok) 35%, var(--line)); }
.gd-box.ko { border-color: color-mix(in srgb, var(--danger) 35%, var(--line)); }
.gd-list { list-style: none; margin: 0; padding: 0; font-size: 13.5px; }
.gd-list li { padding: 4px 0; }
.gd-summary { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 16px; }
.gd-summary > div { flex: 1; min-width: 150px; padding: 10px 12px; border-radius: 10px; background: var(--bg-2); border: 1px solid var(--line); }
.gd-summary small { display: block; font-size: 11px; color: var(--muted); }
.gd-summary strong { font-family: var(--display); font-size: 19px; }
@media (max-width: 560px) { .gain-dialog .grid.g2 { grid-template-columns: 1fr; } }

/* =====================================================================
   HARMONISATION « ATH » DES PAGES DE JEU
   ===================================================================== */
/* En-tête de page : titre court en capitales avec barre d'accent */
.game-mode .page-head { align-items: center; margin-bottom: 14px; padding: 2px 0 2px 14px; border-left: 3px solid var(--accent); }
.game-mode .page-head h1 { font-size: 20px; text-transform: uppercase; letter-spacing: .06em; }
.game-mode .page-head p { font-size: 12.5px; color: var(--muted); max-width: 820px; }
.game-mode h2 { font-size: 17px; }

/* Panneaux translucides */
.game-mode .card { background: #0b0d15d9; border: 1px solid #ffffff12; border-radius: 10px; padding: 14px; box-shadow: 0 10px 28px -18px #000; }
.game-mode .card-accent { border-color: color-mix(in srgb, var(--accent) 35%, #ffffff12); box-shadow: 0 10px 28px -18px #000, inset 3px 0 0 var(--accent); }
.game-mode .card > h2, .game-mode .card > h3, .game-mode .card > form > h3, .game-mode .card > .page-head h2 {
  font-family: var(--font); font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .1em; color: var(--muted); margin-bottom: 10px; }
.game-mode .grid { gap: 14px; }

/* Densité : tableaux, champs, boutons, étiquettes */
.game-mode table { font-size: 13px; }
.game-mode th { padding: 8px 10px; font-size: 10.5px; }
.game-mode td { padding: 8px 10px; }
.game-mode input[type=text], .game-mode input[type=email], .game-mode input[type=password], .game-mode input[type=number], .game-mode select, .game-mode textarea { padding: 8px 10px; font-size: 14px; }
.game-mode label { font-size: 12px; }
.game-mode .field { margin-bottom: 12px; }
.game-mode .btn, .game-mode .btn-ghost, .game-mode .btn-danger, .game-mode .btn-ok { padding: 8px 14px; font-size: 13px; }
.game-mode .sm:not(.hud-btn) { padding: 5px 10px; font-size: 12px; }
.game-mode .tag { font-size: 11px; padding: 2px 7px; }
.game-mode .stat .v { font-size: 20px; }
.game-mode .stat .k { font-size: 10.5px; }
.game-mode .feed li { font-size: 13px; padding: 7px 0; }

/* Onglets façon barre d'actions */
.game-mode .tabs { gap: 4px; padding: 5px; border-radius: 12px; background: #090b12c4; border: 1px solid #ffffff14; width: fit-content; max-width: 100%; overflow-x: auto; margin: 14px 0; }
.game-mode .tabs a { border-radius: 8px; border-color: transparent; padding: 7px 12px; font-size: 13px; white-space: nowrap; }
.game-mode .tabs a.on { box-shadow: 0 0 12px -3px var(--accent); }

/* Lignes compactes (boutique, agence, succès) */
.row-list { display: flex; flex-direction: column; }
.row-item { display: grid; grid-template-columns: 40px minmax(0, 1fr) auto; gap: 12px; align-items: center; padding: 9px 4px; border-bottom: 1px solid #ffffff0d; }
.row-item:last-child { border-bottom: 0; }
.row-item:hover { background: #ffffff05; }
.row-item .ri-icon { width: 40px; height: 40px; border-radius: 9px; display: grid; place-items: center; font-size: 20px; background: color-mix(in srgb, var(--accent) 12%, var(--surface-2)); border: 1px solid #ffffff12; }
.row-item .ri-name { font-weight: 700; font-size: 14px; }
.row-item .ri-name .rar { font-size: 10px; margin-left: 6px; }
.row-item .ri-desc { font-size: 12.5px; color: var(--muted); }
.row-item .ri-side { display: flex; align-items: center; gap: 8px; }
.row-item .ri-side form { display: flex; align-items: center; gap: 6px; margin: 0; }
.row-item .ri-price { font-family: var(--display); font-weight: 700; color: var(--cash); min-width: 84px; text-align: right; }
.row-item input[type=number] { width: 64px; padding: 6px 8px; }
.row-item.locked { opacity: .5; }
.row-item.done .ri-icon { border-color: var(--gold); box-shadow: 0 0 10px -3px var(--gold); }
.acc-body { padding: 6px 14px 10px; }
.slots.mini { grid-template-columns: repeat(auto-fill, minmax(56px, 1fr)); gap: 7px; }
.slots.mini .slot .s-icon { font-size: 22px; }
.slots.mini .slot .s-qty { font-size: 11px; }
@media (max-width: 700px) {
  .row-item { grid-template-columns: 36px minmax(0, 1fr); }
  .row-item .ri-side { grid-column: 1 / -1; justify-content: flex-end; }
}
@media (max-width: 800px) { .acc-body[style*="grid-template-columns"] { grid-template-columns: 1fr !important; } }
/* Grilles à colonnes fixes écrites dans les pages (ex. « 340px 1fr ») : une seule colonne sur petit écran. */
@media (max-width: 900px) { .grid[style*="grid-template-columns"] { grid-template-columns: minmax(0, 1fr) !important; } }

/* ===================== Icônes images ===================== */
img.ico { width: 1em; height: 1em; object-fit: contain; vertical-align: -.15em; display: inline-block; }
.ico-emoji { display: inline-block; line-height: 1; }
/* Les tuiles d'icônes portent déjà leur propre fond : on retire celui du conteneur. */
.a-icon:has(> img.ico), .ri-icon:has(> img.ico) { background: none; border: 0; box-shadow: none; padding: 0; }
.a-icon > img.ico, .ri-icon > img.ico { width: 100%; height: 100%; }
.row-item.done .ri-icon:has(> img.ico) { box-shadow: none; filter: drop-shadow(0 0 6px color-mix(in srgb, var(--gold) 60%, transparent)); }
.slot .s-icon img.ico { width: 1.25em; height: 1.25em; }
.slotbtn .si img.ico { width: 1.15em; height: 1.15em; }
.hud-btn img.ico { width: 1.1em; height: 1.1em; }
.hud-btn.big img.ico { width: 1.25em; height: 1.25em; }
.meter .lbl img.ico { width: 1.25em; height: 1.25em; }
.money-col .m span img.ico { width: 1.35em; height: 1.35em; vertical-align: -.3em; }
.ac-icon img.ico { width: 1.2em; height: 1.2em; }
.ac-icons img.ico { width: 1.25em; height: 1.25em; }
h1 img.ico, h2 img.ico, h3 img.ico { width: 1.05em; height: 1.05em; vertical-align: -.17em; }
td img.ico, .tag img.ico, li img.ico { width: 1.3em; height: 1.3em; vertical-align: -.35em; }
.ico-prev { display: inline-block; font-size: 22px; margin-right: 4px; vertical-align: middle; }

/* Admin : galerie d'icônes */
.icon-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
.icon-tile { background: var(--surface-2); border: 1px solid var(--line-2); border-radius: 12px; padding: 10px; display: flex; flex-direction: column; align-items: center; gap: 6px; text-align: center; scroll-margin-top: 80px; }
.icon-tile:target { border-color: var(--accent); box-shadow: 0 0 14px -4px var(--accent); }
.icon-tile .it-img { font-size: 56px; height: 64px; display: grid; place-items: center; }
.icon-tile .it-name { font-size: 12.5px; font-weight: 600; line-height: 1.2; }
.icon-tile code { font-size: 10.5px; opacity: .65; word-break: break-all; }
.icon-tile .it-src { font-size: 10.5px; text-transform: uppercase; letter-spacing: .06em; }
.icon-tile .it-src.custom { color: var(--ok); } .icon-tile .it-src.default { color: var(--muted); } .icon-tile .it-src.emoji { color: var(--gold); }
.icon-tile form { display: flex; gap: 4px; flex-wrap: wrap; justify-content: center; width: 100%; }
.icon-tile input[type=file] { font-size: 11px; width: 100%; }
.icon-tabs { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 14px; }
.loot-line img.ico { width: 24px; height: 24px; }
.slot .s-icon img.ico { width: 44px; height: 44px; }
.inv-layout .slot .s-icon img.ico { width: 42px; height: 42px; }
.slots.mini .slot .s-icon img.ico { width: 30px; height: 30px; }
.ac-icons img.ico { width: 20px; height: 20px; }
.a-meta .tag img.ico, .chip img.ico { width: 18px; height: 18px; vertical-align: -.3em; }
.gd-table td img.ico, .tbl td img.ico { width: 22px; height: 22px; vertical-align: -.4em; }
img.ico.emo { width: 1.2em; height: 1.2em; vertical-align: -.25em; }

/* Admin : atelier d'icônes */
.studio { display: grid; grid-template-columns: minmax(300px, 1.25fr) minmax(300px, 1fr) minmax(260px, .85fr); gap: 14px; align-items: start; }
@media (max-width: 1250px) { .studio { grid-template-columns: 1fr 1fr; } .st-apply { grid-column: 1 / -1; } }
@media (max-width: 800px) { .studio { grid-template-columns: 1fr; } }
.studio h3 { margin: 0 0 10px; }
.studio .field { margin-bottom: 10px; }
.studio .field > label { display: block; font-size: 12px; color: var(--muted); margin-bottom: 4px; }
.st-themes { display: flex; flex-wrap: wrap; gap: 5px; margin: 8px 0; }
.chip-btn { all: unset; cursor: pointer; font-size: 12px; padding: 3px 9px; border-radius: 99px; border: 1px solid var(--line-2); color: var(--muted); }
.chip-btn:hover { color: var(--text, #fff); border-color: var(--accent); }
.st-count { font-size: 12px; margin-bottom: 6px; }
.st-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(46px, 1fr)); gap: 5px; max-height: 470px; overflow: auto; padding-right: 4px; margin-bottom: 8px; }
.st-grid button, .st-badges button { all: unset; box-sizing: border-box; cursor: pointer; aspect-ratio: 1; display: grid; place-items: center; border-radius: 8px; background: var(--surface-2); border: 1px solid var(--line-2); color: #d9dbe8; padding: 7px; }
.st-grid button:hover, .st-badges button:hover { border-color: var(--accent); color: #fff; }
.st-grid button.on, .st-badges button.on { border-color: var(--accent); background: color-mix(in srgb, var(--accent) 22%, var(--surface-2)); color: #fff; }
.st-grid svg, .st-badges svg { width: 100%; height: 100%; }
.st-import { border-top: 1px solid var(--line-2); padding-top: 10px; margin-top: 6px; display: grid; gap: 6px; justify-items: start; }
.st-check { display: flex; gap: 6px; align-items: center; font-size: 13px; margin-bottom: 6px; }
.st-preview { display: grid; grid-template-columns: auto 1fr; gap: 6px 14px; align-items: center; margin-bottom: 14px; padding: 12px; border-radius: 12px;
  background: repeating-conic-gradient(#ffffff08 0 25%, transparent 0 50%) 0 0 / 16px 16px, var(--bg, #07080d); border: 1px solid var(--line-2); }
.st-big img { width: 128px; height: 128px; display: block; }
.st-sizes { display: flex; gap: 12px; align-items: flex-end; }
.st-sizes img:nth-child(1) { width: 64px; height: 64px; } .st-sizes img:nth-child(2) { width: 32px; height: 32px; } .st-sizes img:nth-child(3) { width: 20px; height: 20px; }
.st-name { grid-column: 1 / -1; font-size: 12px; font-family: ui-monospace, monospace; }
.studio img:not([src]) { visibility: hidden; }
.seg { display: inline-flex; border: 1px solid var(--line-2); border-radius: 9px; overflow: hidden; }
.seg button { all: unset; cursor: pointer; padding: 5px 11px; font-size: 13px; color: var(--muted); }
.seg button + button { border-left: 1px solid var(--line-2); }
.seg button.on { background: var(--accent); color: #fff; }
.st-pals { display: flex; flex-wrap: wrap; gap: 5px; }
.st-pals button { all: unset; cursor: pointer; width: 24px; height: 24px; border-radius: 7px; border: 2px solid transparent; box-shadow: inset 0 0 0 1px #ffffff22; }
.st-pals button.on, .st-pals button:hover { border-color: #fff; }
.st-colors { display: flex; flex-wrap: wrap; gap: 12px; margin-bottom: 10px; font-size: 12px; color: var(--muted); }
.st-colors label { display: flex; align-items: center; gap: 6px; }
.st-colors input[type=color] { width: 34px; height: 26px; padding: 0; border: 1px solid var(--line-2); border-radius: 6px; background: none; cursor: pointer; }
.st-badges { display: grid; grid-template-columns: repeat(7, 1fr); gap: 5px; }
.st-badges button { padding: 6px; font-size: 14px; }
.studio.glyph-mode .st-only-bg { display: none; }
.st-apply select[size] { width: 100%; }
.st-compare { display: flex; gap: 18px; margin: 10px 0; font-size: 12px; }
.st-cur { width: 72px; height: 72px; display: grid; place-items: center; margin-top: 4px; border-radius: 10px; background: var(--surface-2); border: 1px solid var(--line-2); }
.st-cur img { width: 60px; height: 60px; object-fit: contain; }
.st-apply .btn { width: 100%; margin-top: 12px; }
.st-dl { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 8px; }
.chip-btn small { opacity: .6; font-size: 10px; margin-left: 2px; }
.chip-btn.on { background: var(--accent); border-color: var(--accent); color: #fff; }
.chip-btn.sub { border-style: dashed; }
.studio.img-mode .st-no-img { display: none; }
.icon-tile .btn, .icon-tile .btn-ghost { max-width: 100%; white-space: normal; box-sizing: border-box; font-size: 12px; }
.flash-target { animation: flashTarget 1.6s ease-out; }
@keyframes flashTarget { 0%, 30% { box-shadow: 0 0 0 2px var(--accent), 0 0 24px -4px var(--accent); } 100% { box-shadow: none; } }

/* Messages affichés sans rechargement (au-dessus de l'ATH, ou dans la fenêtre ouverte) */
.nf-toasts { position: fixed; top: 14px; left: 50%; transform: translateX(-50%); z-index: 1000; display: flex; flex-direction: column; gap: 8px; width: min(520px, calc(100vw - 24px)); pointer-events: none; }
.nf-toasts .flash { margin: 0; pointer-events: auto; box-shadow: 0 12px 30px -10px #000; }
dialog > .nf-toasts { position: fixed; }

/* ===================== Admin : menu repliable, pages de section, fil d'Ariane ===================== */
.nav-group { margin: 2px 0; }
.nav-group > summary { list-style: none; display: flex; align-items: center; cursor: pointer; border-radius: var(--radius-sm); }
.nav-group > summary::-webkit-details-marker { display: none; }
.nav-group > summary .nav-link { flex: 1; min-width: 0; }
.nav-group-head.current > .nav-link:not(.active) { color: var(--text); }
.nav-chev { width: 28px; height: 32px; display: grid; place-items: center; flex-shrink: 0; border-radius: 6px; color: var(--dim); }
.nav-chev::before { content: ''; width: 7px; height: 7px; border-right: 2px solid currentColor; border-bottom: 2px solid currentColor; transform: rotate(-45deg); transition: transform .15s; }
.nav-group[open] > summary .nav-chev::before { transform: rotate(45deg); }
.nav-chev:hover { background: var(--surface); color: var(--text); }
.nav-group-items { margin: 2px 0 6px 14px; padding-left: 8px; border-left: 1px solid var(--line-2); }
.nav-group-items .nav-link { padding: 7px 10px; font-size: 13.5px; }

.crumbs { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; font-size: 12.5px; color: var(--dim); margin: -4px 0 14px; }
.crumbs a { color: var(--muted); }
.crumbs a:hover { color: var(--text); }
.crumbs strong { color: var(--text); font-weight: 600; }

.tool-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 12px; }
.tool-card { display: flex; gap: 14px; align-items: flex-start; padding: 16px; border-radius: 14px; background: var(--surface); border: 1px solid var(--line-2); color: var(--text); transition: .15s; }
.tool-card:hover { text-decoration: none; border-color: var(--accent); transform: translateY(-2px); box-shadow: 0 10px 26px -14px var(--accent); }
.tool-card .tc-icon { width: 46px; height: 46px; flex-shrink: 0; display: grid; place-items: center; font-size: 24px; border-radius: 12px; background: var(--surface-2); }
.tool-card .tc-body { display: flex; flex-direction: column; gap: 4px; flex: 1; min-width: 0; }
.tool-card strong { font-size: 15px; }
.tool-card .tc-desc { font-size: 13px; color: var(--muted); line-height: 1.4; }
.tool-card .tc-stat { align-self: flex-start; margin-top: 4px; font-size: 11.5px; padding: 2px 8px; border-radius: 99px; background: color-mix(in srgb, var(--accent) 16%, transparent); color: var(--text); }
.tool-card .tc-go { color: var(--dim); font-size: 18px; transition: .15s; }
.tool-card:hover .tc-go { color: var(--accent); transform: translateX(3px); }
.tool-others { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-top: 22px; font-size: 13px; }
.section-shortcuts { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 10px; margin-bottom: 18px; }
.tool-card.mini { padding: 12px; gap: 10px; align-items: center; }
.tool-card.mini .tc-icon { width: 38px; height: 38px; font-size: 19px; }

/* ===================== Admin : galerie et fiche des objets ===================== */
.gal-cat { display: flex; align-items: center; gap: 8px; margin: 22px 0 10px; font-size: 15px; }
.gal-cat .dim { font-size: 12px; font-weight: 500; }
.item-gallery { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
.item-card { position: relative; display: flex; flex-direction: column; align-items: center; text-align: center; gap: 4px; padding: 14px 10px 10px; border-radius: 14px;
  background: var(--surface); border: 1px solid var(--line-2); color: var(--text); transition: .15s; --rc: var(--line-2); }
.item-card:hover { text-decoration: none; transform: translateY(-2px); border-color: var(--rc); box-shadow: 0 10px 24px -14px var(--rc); }
.item-card.rar-uncommon { --rc: #3ad17a; } .item-card.rar-rare { --rc: #3d9bff; } .item-card.rar-epic { --rc: var(--dirty); } .item-card.rar-legendary { --rc: var(--gold); }
.item-card:not(.rar-common) { box-shadow: inset 0 -3px 0 -1px var(--rc); }
.item-card .ic-img { font-size: 52px; height: 58px; display: grid; place-items: center; }
.item-card .ic-name { font-weight: 600; font-size: 13.5px; line-height: 1.2; }
.item-card .ic-meta { font-size: 11px; color: var(--dim); }
.item-card .ic-meta .rar { font-size: 10px; }
.item-card .ic-price { font-size: 12.5px; color: var(--ok); font-weight: 600; }
.item-card .ic-flags { display: flex; gap: 3px; margin-top: 2px; }
.item-card .ic-flags span { font-size: 12px; width: 22px; height: 22px; display: grid; place-items: center; border-radius: 6px; opacity: .22; filter: grayscale(1); }
.item-card .ic-flags span.on { opacity: 1; filter: none; background: color-mix(in srgb, var(--ok) 15%, transparent); }
.item-card .ic-flags span.on.bad { background: color-mix(in srgb, var(--danger) 20%, transparent); }
.item-card .ic-owned { position: absolute; top: 8px; right: 8px; font-size: 10.5px; color: var(--muted); }
.item-card .pick { position: absolute; top: 8px; left: 8px; display: none; width: 18px; height: 18px; pointer-events: none; }
#gallery-form.selecting .item-card { cursor: pointer; }
#gallery-form.selecting .item-card .pick { display: block; }
#gallery-form.selecting .item-card.picked { border-color: var(--accent); background: color-mix(in srgb, var(--accent) 12%, var(--surface)); }
.bulk-bar { position: sticky; top: 8px; z-index: 5; display: flex; flex-wrap: wrap; align-items: center; gap: 10px; padding: 12px 14px; margin-bottom: 6px; border-color: var(--accent); }

.item-sheet { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 16px; align-items: start; }
.item-sheet .card h3 { margin: 0 0 12px; font-size: 15px; }
.sheet-main, .sheet-side { display: flex; flex-direction: column; gap: 14px; min-width: 0; }
.sheet-save { position: sticky; bottom: 10px; display: flex; align-items: center; gap: 12px; padding: 12px 14px; border-radius: var(--radius-sm); background: var(--surface); border: 1px solid var(--line-2); box-shadow: 0 10px 30px -12px #000; }
.sheet-icon { font-size: 96px; height: 110px; display: grid; place-items: center; margin-bottom: 10px; border-radius: 12px;
  background: repeating-conic-gradient(#ffffff06 0 25%, transparent 0 50%) 0 0 / 16px 16px, var(--bg-2, #07080d); }
.sheet-preview, .sheet-usage { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 7px; font-size: 13.5px; }
.sheet-usage li { display: flex; gap: 8px; align-items: baseline; }
.rule-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.rule { display: flex; gap: 10px; align-items: flex-start; padding: 10px 12px; margin: 0; border-radius: 10px; border: 1px solid var(--line-2); cursor: pointer; transition: .12s; }
.rule:hover { border-color: var(--muted); }
.rule input { position: absolute; opacity: 0; pointer-events: none; }
.rule-sw { flex-shrink: 0; width: 34px; height: 20px; border-radius: 99px; background: var(--surface-2); border: 1px solid var(--line-2); position: relative; margin-top: 1px; transition: .15s; }
.rule-sw::after { content: ''; position: absolute; top: 2px; left: 2px; width: 14px; height: 14px; border-radius: 50%; background: var(--muted); transition: .15s; }
.rule input:checked + .rule-sw { background: color-mix(in srgb, var(--ok) 35%, transparent); border-color: var(--ok); }
.rule input:checked + .rule-sw::after { left: 16px; background: var(--ok); }
.rule.bad input:checked + .rule-sw { background: color-mix(in srgb, var(--danger) 35%, transparent); border-color: var(--danger); }
.rule.bad input:checked + .rule-sw::after { background: var(--danger); }
.rule input:focus-visible + .rule-sw { outline: 2px solid var(--accent); outline-offset: 2px; }
.rule input:checked ~ .rule-txt strong { color: var(--text); }
.rule-txt { display: flex; flex-direction: column; gap: 2px; font-size: 13.5px; }
.rule-txt strong { color: var(--muted); font-weight: 600; }
.rule-txt small { color: var(--dim); font-size: 12px; line-height: 1.35; }
.btn-ghost.danger { color: var(--danger); border-color: color-mix(in srgb, var(--danger) 45%, transparent); }
@media (max-width: 1100px) { .item-sheet { grid-template-columns: 1fr; } }
@media (max-width: 700px) { .rule-grid { grid-template-columns: 1fr; } .item-gallery { grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); } }
.bulk-bar[hidden] { display: none; }
.sheet-side .inline-form { flex-wrap: wrap; }
@media (max-width: 700px) { .filters > input, .filters > select { flex: 1 1 150px; max-width: none !important; } }

/* ===================== Receleur et blanchiment (fenêtres de choix) ===================== */
dialog.choice-dialog { width: min(640px, calc(100vw - 24px)); max-height: 92vh; }
.choice-dialog h3 { display: flex; align-items: center; gap: 8px; }
.fence-list { container-type: inline-size; display: flex; flex-direction: column; gap: 6px; max-height: min(52vh, 460px); overflow-y: auto; padding-right: 4px; margin: 10px 0; }
.fence-row { display: grid; grid-template-columns: 40px minmax(0, 1fr) auto 84px; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 10px; border: 1px solid var(--line-2); background: var(--surface); transition: .12s; }
.fence-row.on { border-color: color-mix(in srgb, var(--dirty) 60%, transparent); background: color-mix(in srgb, var(--dirty) 8%, var(--surface)); }
.fence-row .fr-icon { font-size: 34px; display: grid; place-items: center; }
.fence-row .fr-name { display: flex; flex-direction: column; min-width: 0; }
.fence-row .fr-name strong { font-size: 14px; line-height: 1.25; }
.fence-row .fr-name small { font-size: 12px; color: var(--muted); }
.fence-row .fr-total { text-align: right; font-weight: 700; color: var(--dirty); font-size: 13.5px; white-space: nowrap; }
.qty-ctl { display: flex; align-items: center; gap: 4px; }
.qty-ctl input[type=number] { width: 52px; text-align: center; padding: 6px 4px; }
.qty-ctl .btn-ghost.sm { padding: 5px 9px; }
.choice-foot { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 12px; margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--line-2); }
.choice-total { font-size: 16px; }
.choice-total strong { color: var(--dirty); }
.launder-box { display: flex; flex-direction: column; gap: 12px; margin: 10px 0; padding: 14px; border-radius: 12px; background: var(--surface); border: 1px solid var(--line-2); }
.launder-input { display: flex; align-items: center; gap: 8px; }
.launder-input input { font-size: 26px; font-weight: 700; padding: 8px 12px; max-width: 240px; }
.launder-input span { font-size: 22px; color: var(--muted); }
.launder-box input[type=range] { width: 100%; accent-color: var(--dirty); }
.launder-result { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.launder-result > div { display: flex; flex-direction: column; gap: 2px; padding: 10px 12px; border-radius: 10px; background: var(--surface-2); }
.launder-result strong { font-size: 20px; }
.dirty-txt { color: var(--dirty); }
/* Fenêtre étroite : nom + total sur la 1re ligne, quantité en dessous */
@container (max-width: 520px) {
  .fence-row { grid-template-columns: 34px minmax(0, 1fr) auto; row-gap: 8px; }
  .fence-row .fr-icon { font-size: 28px; }
  .fence-row .qty-ctl { grid-column: 1 / -1; justify-content: flex-end; }
  .fence-row .fr-total { grid-row: 1; grid-column: 3; }
}
.choice-foot .inline-form { flex-wrap: wrap; justify-content: flex-end; }
@media (max-width: 560px) { .choice-foot { flex-direction: column; align-items: stretch; } .choice-foot .inline-form .btn { flex: 1 1 100%; } }

/* ---- Admin : galerie et fiche des activités ---- */
.gal-fac { display: flex; align-items: center; gap: 10px; margin: 26px 0 0; font-size: 18px; }
.gal-fac .dim { font-size: 13px; font-weight: 500; }
.gal-fac .btn-ghost { margin-left: auto; }
.act-gallery { grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); }
.item-card.fac-criminal { --rc: var(--danger); box-shadow: inset 0 -3px 0 -1px var(--rc); }
.item-card.fac-police { --rc: #3d9bff; box-shadow: inset 0 -3px 0 -1px var(--rc); }
.item-card.fac-any { --rc: var(--gold); box-shadow: inset 0 -3px 0 -1px var(--rc); }
.item-card.off { opacity: .5; }
.item-card.off:hover { opacity: .85; }
.act-card .ic-flags span.on { background: color-mix(in srgb, var(--accent) 16%, transparent); }
.tag.gold { background: color-mix(in srgb, var(--gold) 18%, transparent); color: var(--gold); }
.sec-help { font-size: 13px; margin-top: -4px; }
.item-sheet textarea { width: 100%; resize: vertical; font: inherit; line-height: 1.45; }
.act-preview { margin: 0; pointer-events: none; }
.act-preview .act-btns { display: flex; gap: 8px; margin-top: 10px; }
.act-preview .act-btns .btn { flex: 1; text-align: center; }
.action .a-why { margin: -4px 0 8px; font-size: 12.5px; color: var(--warn, #f5b942); }
.gd-conds li small { font-size: 12px; }

/* ---- Admin : serveurs & wipes ---- */
.srv-search { display: flex; align-items: center; gap: 10px; padding: 10px 14px; margin-bottom: 16px; }
.srv-search input { flex: 1; min-width: 0; }
.srv-search-ico { font-size: 18px; }
.srv > summary { flex-wrap: wrap; row-gap: 6px; }
.srv-title { display: flex; align-items: baseline; gap: 6px; min-width: 0; }
.srv-meter { display: flex; align-items: center; gap: 8px; margin-left: auto; }
.srv-meter small { font-size: 12px; color: var(--muted); white-space: nowrap; }
.srv-bar { width: 110px; height: 6px; border-radius: 99px; background: var(--surface-2); overflow: hidden; }
.srv-bar i { display: block; height: 100%; background: linear-gradient(90deg, var(--ok), var(--gold)); border-radius: 99px; }
.srv-split, .srv-wipe { font-size: 13px; color: var(--muted); white-space: nowrap; }
.srv-body { padding: 14px; display: flex; flex-direction: column; gap: 14px; }
.srv-body .card { margin: 0; }
.srv-body h3 { margin: 0 0 12px; font-size: 15px; }
.srv-cols { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); gap: 14px; align-items: start; }
.srv-ph { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 8px; }
.srv-ph h3 { margin: 0; }
.srv-players { max-height: 440px; overflow-y: auto; }
.srv-new > summary .ac-chev { margin-left: auto; }
.srv-new { border-style: dashed; }
mark { background: color-mix(in srgb, var(--gold) 35%, transparent); color: inherit; border-radius: 3px; padding: 0 1px; }
.dev-ban > summary { list-style: none; display: inline-block; cursor: pointer; }
.dev-ban > summary::-webkit-details-marker { display: none; }
@media (max-width: 900px) {
  .srv-cols { grid-template-columns: minmax(0, 1fr); }
  .srv-meter { margin-left: 0; }
  .srv-bar { width: 70px; }
}

/* ---- Maintenance ---- */
.maint-page { min-height: 100vh; display: grid; place-items: center; padding: 24px; margin: 0; }
.maint-box { width: min(560px, 100%); text-align: center; padding: 36px 28px; border-radius: 18px; background: color-mix(in srgb, var(--surface) 92%, transparent); border: 1px solid var(--line-2); box-shadow: 0 30px 80px -30px #000; }
.maint-icon { font-size: 54px; line-height: 1; margin-bottom: 10px; }
.maint-kicker { font-size: 12px; letter-spacing: .14em; text-transform: uppercase; color: var(--gold); font-weight: 700; }
.maint-box h1 { margin: 6px 0 12px; font-size: clamp(22px, 5vw, 30px); }
.maint-msg { color: var(--muted); font-size: 15px; line-height: 1.55; margin: 0 0 20px; }
.maint-timer { display: flex; flex-direction: column; gap: 2px; padding: 14px; border-radius: 12px; background: var(--surface-2); margin-bottom: 16px; }
.maint-timer strong { font-family: var(--display); font-size: 28px; color: var(--text); }
.maint-timer small { font-size: 12px; color: var(--muted); }
.maint-links { display: flex; justify-content: center; flex-wrap: wrap; gap: 8px; margin-top: 8px; }
.maint-banner { display: flex; align-items: center; gap: 12px; padding: 10px 14px; margin-bottom: 12px; border-radius: 12px; border: 1px solid color-mix(in srgb, var(--gold) 45%, transparent); background: color-mix(in srgb, var(--gold) 10%, var(--surface)); }
.maint-banner.staff { border-color: color-mix(in srgb, var(--danger) 45%, transparent); background: color-mix(in srgb, var(--danger) 10%, var(--surface)); }
.maint-banner .mb-ico { font-size: 22px; }
.maint-banner .mb-txt { flex: 1; display: flex; flex-direction: column; gap: 2px; font-size: 13.5px; min-width: 0; }
.maint-banner .mb-txt small { color: var(--muted); }
.maint-card.is-on { border-color: color-mix(in srgb, var(--danger) 50%, transparent); }
.maint-admin { display: flex; flex-direction: column; gap: 10px; }
.maint-state { display: flex; flex-direction: column; gap: 3px; padding: 10px 12px; border-radius: 10px; font-size: 13.5px; }
.maint-state.on { background: color-mix(in srgb, var(--danger) 12%, transparent); border: 1px solid color-mix(in srgb, var(--danger) 40%, transparent); }
.maint-state.soon { background: color-mix(in srgb, var(--gold) 10%, transparent); border: 1px solid color-mix(in srgb, var(--gold) 40%, transparent); }
.maint-state small { color: var(--muted); }
.maint-row { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.maint-row > input[type=text] { flex: 1; min-width: 180px; }
.maint-dur { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.maint-dur .check { margin: 0; }
.maint-presets { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.chip-btn.on { color: var(--text, #fff); border-color: var(--accent); background: color-mix(in srgb, var(--accent) 15%, transparent); }
.maint-form textarea { width: 100%; resize: vertical; font: inherit; }
.maint-form .check { display: block; margin: 6px 0; }
fieldset.ro-wrap { border: 0; margin: 0; padding: 0; min-width: 0; }
fieldset.ro-wrap:disabled button, fieldset.ro-wrap:disabled input, fieldset.ro-wrap:disabled select { opacity: .55; cursor: not-allowed; }

/* ---- Admin : staff ---- */
.staff-add { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; padding: 12px 14px; margin-bottom: 18px; }
.staff-add input[type=text] { flex: 1; min-width: 200px; }
.staff-add select { width: auto; }
.staff-rank { margin-bottom: 20px; }
.staff-rank h2 { display: flex; align-items: baseline; gap: 8px; font-size: 18px; margin: 0 0 10px; }
.staff-rank h2 small { font-size: 12px; font-weight: 500; margin-left: 4px; }
.sr-dot { width: 10px; height: 10px; border-radius: 50%; background: var(--rc); box-shadow: 0 0 10px var(--rc); align-self: center; }
.staff-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 12px; }
.staff-card { margin: 0; display: flex; flex-direction: column; gap: 10px; border-left: 3px solid var(--rc); }
.sc-top { display: flex; align-items: center; gap: 10px; }
.sc-avatar { position: relative; width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; font-weight: 700; font-size: 18px; background: color-mix(in srgb, var(--rc) 22%, var(--surface-2)); color: var(--rc); flex-shrink: 0; }
.sc-avatar i { position: absolute; right: -3px; bottom: -3px; width: 12px; height: 12px; border-radius: 50%; background: var(--dim, #555); border: 2px solid var(--surface); }
.sc-avatar i.on { background: var(--ok); }
.sc-id { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.sc-id small { font-size: 12px; }
.sc-stats { display: flex; flex-wrap: wrap; gap: 6px 14px; font-size: 12.5px; color: var(--muted); }
.sc-stats b { color: var(--text); }
.sc-acts { list-style: none; margin: 0; padding: 8px 10px; border-radius: 8px; background: var(--surface-2); font-size: 12px; display: flex; flex-direction: column; gap: 3px; }
.sc-acts time { color: var(--dim); }
.sc-acts code { font-size: 11px; }
.sc-note { display: flex; flex-direction: column; gap: 6px; align-items: flex-start; }
.sc-note textarea { width: 100%; resize: vertical; font: inherit; font-size: 13px; }
.sc-note-ro { margin: 0; font-size: 13px; color: var(--muted); }
.sc-actions { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin-top: auto; }

/* ---- Admin : grades & permissions ---- */
.perm-rules { display: flex; flex-direction: column; gap: 4px; font-size: 13px; margin-bottom: 18px; padding: 12px 14px; }
.rank-list { display: flex; flex-direction: column; gap: 6px; margin-bottom: 14px; }
.rank-row { position: relative; display: flex; flex-wrap: wrap; align-items: center; gap: 10px; padding: 8px 12px 8px 16px; border-radius: 10px; background: var(--surface-2); }
.rr-bar { position: absolute; left: 0; top: 6px; bottom: 6px; width: 4px; border-radius: 4px; background: var(--rc); }
.rr-main { display: flex; align-items: center; gap: 8px; min-width: 220px; font-size: 13px; }
.rr-count { font-size: 12px; color: var(--muted); min-width: 80px; }
.rr-tools, .rank-row > .rr-edit { margin-left: auto; flex-wrap: wrap; }
.rr-edit input[type=color], .rank-create input[type=color] { width: 38px; height: 32px; padding: 2px; border-radius: 8px; }
.rr-del > summary { list-style: none; display: inline-block; cursor: pointer; }
.rr-del > summary::-webkit-details-marker { display: none; }
.rank-create { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; padding-top: 12px; border-top: 1px dashed var(--line-2); }
.rank-create input[type=text] { flex: 1; min-width: 180px; }
.perm-matrix { width: 100%; border-collapse: separate; border-spacing: 0; }
.perm-matrix th, .perm-matrix td { padding: 8px 10px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.perm-matrix thead th { position: sticky; top: 0; background: var(--surface); z-index: 1; text-align: center; }
.perm-matrix thead th:first-child { text-align: left; }
.pm-head { display: inline-block; padding: 3px 10px; border-radius: 99px; border: 1px solid var(--rc); color: var(--rc); font-size: 12px; font-weight: 700; white-space: nowrap; }
.perm-matrix td:first-child { min-width: 260px; }
.perm-matrix td small { display: block; font-size: 12px; color: var(--muted); font-weight: 400; }
.pm-group th { text-align: left; font-size: 14px; padding-top: 18px; background: color-mix(in srgb, var(--accent) 6%, transparent); }
.pm-bulk { float: right; display: inline-flex; flex-wrap: wrap; gap: 4px; font-weight: 400; }
.pm-cell { text-align: center; width: 120px; }
.pm-box { position: relative; display: inline-grid; place-items: center; cursor: pointer; margin: 0; }
.pm-box input { position: absolute; opacity: 0; pointer-events: none; }
.pm-box span { width: 22px; height: 22px; border-radius: 7px; border: 1.5px solid var(--line-2); background: var(--surface-2); display: grid; place-items: center; transition: .12s; }
.pm-box input:checked + span { background: color-mix(in srgb, var(--ok) 30%, transparent); border-color: var(--ok); }
.pm-box input:checked + span::after { content: '✓'; color: var(--ok); font-weight: 800; font-size: 14px; }
.pm-box input:focus-visible + span { outline: 2px solid var(--accent); outline-offset: 2px; }
.pm-lock { opacity: .6; }
.pm-sub td { background: color-mix(in srgb, var(--surface-2) 50%, transparent); }
.pm-ban { width: auto; font-size: 12px; padding: 4px 6px; }

/* ---- Chat ---- */
.hud-chat { position: relative; }
.hud-badge, [data-chat-badge] { position: absolute; top: -6px; right: -6px; min-width: 16px; height: 16px; padding: 0 4px; border-radius: 99px; background: var(--danger); color: #fff; font-size: 10px; font-weight: 800; line-height: 16px; text-align: center; }
.nav-link [data-chat-badge] { position: static; margin-left: auto; }
.chat-panel { position: fixed; right: 16px; bottom: 16px; z-index: 60; width: min(400px, calc(100vw - 32px)); height: min(620px, calc(100vh - 110px));
  display: flex; flex-direction: column; border-radius: 16px; border: 1px solid var(--line-2); background: color-mix(in srgb, var(--surface) 96%, transparent);
  box-shadow: 0 24px 60px -18px #000, 0 0 0 1px #0006; backdrop-filter: blur(10px); overflow: hidden; }
.chat-panel[hidden] { display: none; }
.cp-head { display: flex; align-items: stretch; border-bottom: 1px solid var(--line); background: var(--surface-2); }
.cp-tabs { display: flex; flex: 1; min-width: 0; }
.cp-tab { all: unset; box-sizing: border-box; position: relative; flex: 1; display: flex; flex-direction: column; align-items: center; gap: 1px; padding: 8px 2px 7px; cursor: pointer; color: var(--muted); font-size: 11px; border-bottom: 2px solid transparent; }
.cp-tab span { font-size: 16px; line-height: 1.1; }
.cp-tab b { font-weight: 600; }
.cp-tab:hover { color: var(--text); }
.cp-tab.on { color: var(--text); border-bottom-color: var(--accent); background: color-mix(in srgb, var(--accent) 8%, transparent); }
.cp-tab:disabled { opacity: .35; cursor: not-allowed; }
.cp-dot { position: absolute; top: 6px; right: calc(50% - 16px); width: 8px; height: 8px; border-radius: 50%; background: var(--accent); display: none; }
.cp-dot.on { display: block; }
.cp-count { position: absolute; top: 3px; right: calc(50% - 22px); min-width: 16px; height: 16px; padding: 0 4px; border-radius: 99px; background: var(--danger); color: #fff; font-size: 10px; font-weight: 800; font-style: normal; line-height: 16px; display: none; }
.cp-count.on { display: block; }
.cp-close { all: unset; cursor: pointer; padding: 0 14px; color: var(--muted); font-size: 16px; }
.cp-close:hover { color: var(--text); }
.cp-sub { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; padding: 6px 12px; font-size: 12px; color: var(--muted); border-bottom: 1px solid var(--line); }
.cp-sub:empty { display: none; }
.cp-privacy { font-size: 11.5px; color: var(--dim, var(--muted)); }
.cp-back { all: unset; cursor: pointer; color: var(--accent); font-weight: 600; }
.cp-body { flex: 1; min-height: 0; display: flex; flex-direction: column; }
.cp-list { flex: 1; overflow-y: auto; padding: 8px 10px; display: flex; flex-direction: column; gap: 6px; overscroll-behavior: contain; }
.cp-list[hidden], .cp-convs[hidden] { display: none; }
.cp-msg { padding: 6px 9px; border-radius: 10px; background: var(--surface-2); max-width: 92%; align-self: flex-start; }
.cp-msg.mine { align-self: flex-end; background: color-mix(in srgb, var(--accent) 16%, var(--surface-2)); }
.cp-msg.is-staff { box-shadow: inset 2px 0 0 var(--gold); }
.cp-meta { display: flex; align-items: baseline; gap: 6px; font-size: 11.5px; }
.cp-who { all: unset; cursor: pointer; font-weight: 700; color: var(--text); }
.cp-who:hover { text-decoration: underline; }
.cp-staff { font-size: 9.5px; font-weight: 800; text-transform: uppercase; letter-spacing: .05em; border: 1px solid currentColor; border-radius: 99px; padding: 0 5px; }
.cp-meta time { color: var(--dim, var(--muted)); margin-left: auto; font-size: 10.5px; }
.cp-text { font-size: 13.5px; line-height: 1.4; white-space: pre-wrap; overflow-wrap: anywhere; }
.cp-empty { color: var(--muted); font-size: 13px; text-align: center; margin: auto 0; padding: 20px; }
.cp-convs { flex: 1; overflow-y: auto; padding: 10px; display: flex; flex-direction: column; gap: 8px; }
.cp-newpm { display: flex; gap: 6px; }
.cp-newpm input { flex: 1; min-width: 0; }
.cp-conv { all: unset; box-sizing: border-box; cursor: pointer; display: flex; flex-direction: column; gap: 2px; padding: 8px 10px; border-radius: 10px; background: var(--surface-2); }
.cp-conv:hover { background: color-mix(in srgb, var(--accent) 10%, var(--surface-2)); }
.cp-conv.unread { box-shadow: inset 3px 0 0 var(--accent); }
.cc-top { display: flex; align-items: center; gap: 6px; font-size: 13px; }
.cc-top time { margin-left: auto; font-size: 11px; color: var(--muted); }
.cc-unread { font-style: normal; min-width: 16px; height: 16px; padding: 0 4px; border-radius: 99px; background: var(--danger); color: #fff; font-size: 10px; font-weight: 800; line-height: 16px; text-align: center; }
.cc-last { font-size: 12px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cp-foot { border-top: 1px solid var(--line); padding: 8px 10px; }
.cp-form { display: flex; gap: 6px; align-items: flex-end; }
.cp-form[hidden] { display: none; }
.cp-form textarea { flex: 1; min-width: 0; resize: none; font: inherit; font-size: 13.5px; line-height: 1.4; max-height: 120px; padding: 8px 10px; }
.cp-form.sending { opacity: .6; pointer-events: none; }
.cp-form .btn { padding: 8px 12px; }
.cp-hint { font-size: 11.5px; color: var(--muted); min-height: 0; }
.cp-hint:not(:empty) { margin-top: 4px; }
.cp-hint.bad { color: var(--danger); }
.cp-banned { font-size: 13px; color: var(--danger); padding: 6px 2px; }
.cp-menu { position: absolute; z-index: 5; min-width: 200px; display: flex; flex-direction: column; padding: 6px; border-radius: 10px; background: var(--surface); border: 1px solid var(--line-2); box-shadow: 0 14px 30px -10px #000; }
.cp-menu[hidden] { display: none; }
.cm-title { font-size: 12px; color: var(--muted); padding: 4px 8px; }
.cp-menu button { all: unset; cursor: pointer; padding: 7px 8px; border-radius: 6px; font-size: 13px; }
.cp-menu button:hover { background: var(--surface-2); }
.cp-menu button.danger { color: var(--danger); }
@media (max-width: 600px) {
  .chat-panel { right: 0; bottom: 0; width: 100vw; height: 100dvh; border-radius: 0; }
}

/* ---- Admin : chat ---- */
.admin-tabs { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 16px; }
.admin-tabs a { padding: 8px 14px; border-radius: 10px; border: 1px solid var(--line-2); color: var(--muted); font-weight: 600; font-size: 14px; text-decoration: none; display: inline-flex; align-items: center; gap: 6px; }
.admin-tabs a:hover { color: var(--text); border-color: var(--accent); }
.admin-tabs a.on { color: var(--text); border-color: var(--accent); background: color-mix(in srgb, var(--accent) 14%, transparent); }
.btn-ghost.on { border-color: var(--accent); color: var(--text); }
.chat-table td { vertical-align: top; }
.chat-table .msg-body { white-space: normal; overflow-wrap: anywhere; min-width: 240px; }
tr.msg-deleted td, .rc-msg.msg-deleted { opacity: .55; }
tr.msg-deleted .msg-body { text-decoration: line-through; text-decoration-color: color-mix(in srgb, var(--danger) 60%, transparent); }
.report-card { margin-bottom: 12px; }
.report-card.done { opacity: .7; }
.rc-head { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; font-size: 13px; margin-bottom: 8px; }
.rc-reason { margin: 0 0 8px; font-style: italic; color: var(--muted); }
.rc-msg { padding: 10px 12px; border-radius: 10px; background: var(--surface-2); margin-bottom: 8px; overflow-wrap: anywhere; }

/* ---- Objets à ouvrir ---- */
.open-details { margin-top: 8px; font-size: 13px; }
.open-details > summary { cursor: pointer; color: var(--muted); }
.open-details > summary:hover { color: var(--text); }
.open-preview { list-style: none; margin: 8px 0 6px; padding: 0; display: flex; flex-direction: column; gap: 4px; }
.open-preview li { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 5px 8px; border-radius: 8px; background: var(--surface-2); }
.open-preview li span { display: flex; align-items: center; gap: 6px; }
.open-preview li b { font-variant-numeric: tabular-nums; color: var(--gold); white-space: nowrap; }
.open-preview .op-empty { opacity: .7; }
.op-req { margin: 6px 0; font-size: 12.5px; }
.op-note { margin: 4px 0 0; font-size: 11.5px; color: var(--dim, var(--muted)); }
dialog.open-result { width: min(380px, calc(100vw - 24px)); text-align: center; overflow: hidden; }
.or-box { display: flex; flex-direction: column; align-items: center; gap: 10px; padding: 6px 4px 2px; }
.or-icon { font-size: 64px; width: 96px; height: 96px; display: grid; place-items: center; }
.or-icon img.ico { width: 96px; height: 96px; }
.or-title { margin: 0; }
.or-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; width: 100%; }
.or-list li { display: flex; align-items: center; justify-content: center; gap: 8px; padding: 8px 10px; border-radius: 10px; background: var(--surface-2); font-size: 15px; }
.or-list li img.ico { width: 1.6em; height: 1.6em; }
.or-list li.or-money strong { color: var(--ok); }
.or-list li.r-rare { box-shadow: inset 0 0 0 1px #3d9bff88; }
.or-list li.r-epic { box-shadow: inset 0 0 0 1px #b46bff99; }
.or-list li.r-legendary { box-shadow: inset 0 0 0 1px #f5b942aa; }
.or-nothing { font-size: 16px; color: var(--muted); margin: 4px 0; }
.or-small { font-size: 12.5px; margin: 2px 0; }
.or-reveal { width: 100%; }
/* Animation : l'objet tremble, s'ouvre, puis le contenu apparaît ligne par ligne */
.or-anim .or-icon { animation: or-shake .9s ease-in-out, or-pop .35s ease-out .9s both; }
.or-anim .or-title { animation: or-fade .3s ease-out .9s both; }
.or-anim .or-reveal > *, .or-anim .or-list li { animation: or-rise .35s ease-out both; }
.or-anim .or-list li:nth-child(1), .or-anim .or-reveal > p:first-child { animation-delay: 1.05s; }
.or-anim .or-list li:nth-child(2) { animation-delay: 1.25s; }
.or-anim .or-list li:nth-child(3) { animation-delay: 1.45s; }
.or-anim .or-list li:nth-child(4) { animation-delay: 1.65s; }
.or-anim .or-list li:nth-child(n+5) { animation-delay: 1.85s; }
.or-anim .or-reveal > p { animation-delay: 1.9s; }
.or-anim .or-box > .btn { animation: or-fade .3s ease-out 1.6s both; }
.open-result:not(.is-empty).or-anim .or-icon { filter: drop-shadow(0 0 18px color-mix(in srgb, var(--gold) 55%, transparent)); }
@keyframes or-shake { 0%, 100% { transform: rotate(0) scale(1); } 15% { transform: rotate(-9deg) scale(1.04); } 30% { transform: rotate(8deg); } 45% { transform: rotate(-7deg) scale(1.06); } 60% { transform: rotate(6deg); } 75% { transform: rotate(-4deg) scale(1.08); } }
@keyframes or-pop { 0% { transform: scale(1.08); } 50% { transform: scale(1.22); } 100% { transform: scale(1); } }
@keyframes or-rise { from { opacity: 0; transform: translateY(10px) scale(.96); } to { opacity: 1; transform: none; } }
@keyframes or-fade { from { opacity: 0; } to { opacity: 1; } }
@media (prefers-reduced-motion: reduce) { .or-anim * { animation: none !important; } }
