/* ===========================
   CSS PARTIE 1: VARIABLES ET CONFIGURATION
   =========================== */

:root {
  /* Variables principales du thème */
  --panel: #151515;
  --bd: rgba(214,181,106,.35);
  --ink: #f2f2f2;
  --ok: #22c55e;
  --ko: #ef4444;
  --muted: #cfcfcf;
  --brand: #d6b56a;
  
  /* Surfaces & papier (fonds) */
  --surface-0: #0b0b0b;
  --surface-1: #141414;
  --surface-2: #181818;
  --surface-3: #222222;
  --paper-0: #fffef8;
  --paper-1: #f7f4e9;

  /* Encres (texte) */
  --ink-0: #222222;
  --ink-1: #686868;
  --ink-2: #8f8f8f;
  --ink-inv: #ffffff;

  /* Couleurs d'accent */
  --brand-2: #a4884f;
  --danger: #7a2e32;
  --success: #2c4e1a;
  --warning: #9a6a28;
  --info: #2a577a;

  /* Dimensions */
  --header-h: 90px;
  --crimebar-h: 15px;

  /* Effets */
  --sep: rgba(0,0,0,.13);
  --ring: rgba(214,181,106,.45);
  --shadow: 0 8px 24px rgba(0,0,0,.28);
  --shadow-heavy: 0 14px 44px rgba(0,0,0,.5);
  --radius: 10px;
  --radius-big: 14px;

  /* Couleurs boutons */
  --btn-dark-bg: #161616;
  --btn-dark-bd: rgba(255,255,255,.14);
  --btn-ghost-bd: rgba(255,255,255,.18);

    /* couleurs (avec fallback si color-mix n’est pas supporté) */
  --delta-txt: var(--ink-inv);
  --delta-bd:  var(--btn-ghost-bd);
  --delta-shadow: var(--shadow);

  /* neutre (quasi jamais utilisé si .up/.down présents) */
  --delta-bg-neutral: var(--surface-3);
  --delta-bg-neutral-mixed: color-mix(in srgb, var(--surface-3) 85%, transparent);

  /* variantes état */
  --delta-bg-up:   var(--success);
  --delta-bg-up-mixed:   color-mix(in srgb, var(--success) 92%, transparent);
  --delta-bg-down: var(--danger);
  --delta-bg-down-mixed: color-mix(in srgb, var(--danger) 92%, transparent);
}

/* Animations globales */
@keyframes pulse-once { 
  0% { transform: scale(1) } 
  40% { transform: scale(1.05) } 
  100% { transform: scale(1) } 
}

@keyframes shine { 
  from { background-position: 200% 0 } 
  to { background-position: -200% 0 } 
}

@keyframes spin {
  to { transform: rotate(360deg) }
}

@keyframes deplete { 
  from { transform: scaleX(1) } 
  to { transform: scaleX(0) } 
}

@keyframes shimmer {
  0% { background-position: 0 0 }
  100% { background-position: 100% 0 }
}

@keyframes badgePulse {
  0%, 100% { transform: scale(1) }
  50% { transform: scale(1.1) }
}

@keyframes adminPulse {
  0%, 100% { transform: scale(1); opacity: 1; }
  50% { transform: scale(1.1); opacity: .8; }
}

/* Classes d'animation */
.pulse-once { animation: pulse-once .45s ease-out 1; }

.spinner {
  width: 14px;
  height: 14px;
  border: 2px solid rgba(255,255,255,.25);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin .8s linear infinite;
}

/* ===========================
   CSS PARTIE 2: RESET ET STYLES DE BASE
   =========================== */

* {
  box-sizing: border-box;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

html, body {
  height: 100%;
  overflow-x: hidden;
  margin: 0;
  padding: 0;
}

body {
  background-color: #0b0b0b;
  background-image: url("/assets/bg_mafia_1920x1080.webp");
  background-repeat: no-repeat;
  background-position: center top;
  background-attachment: fixed;
  background-size: cover;
  font-family: system-ui, -apple-system, sans-serif;
  color: white;
  min-height: 100vh;
}

body::before {
  content: ""; 
  position: fixed; 
  inset: 0; 
  pointer-events: none; 
  z-index: 0;
  background: repeating-linear-gradient(135deg, rgba(255,255,255,.03) 0 2px, rgba(255,255,255,0) 2px 10px), var(--noise);
  mix-blend-mode: soft-light; 
  opacity: .22;
}

body::after {
  content: ""; 
  position: fixed; 
  inset: 0; 
  pointer-events: none; 
  z-index: 0;
  background: radial-gradient(1200px 600px at -10% -20%, rgba(122,46,50,.15) 0%, transparent 55%),
             radial-gradient(1000px 500px at 110% 120%, rgba(214,181,106,.12) 0%, transparent 52%);
}

a { 
  color: var(--brand); 
  text-decoration: none; 
  font-weight: 600; 
  transition: color .2s ease, text-shadow .2s ease; 
}

a:hover { 
  color: #fff; 
  text-shadow: 0 0 8px rgba(214,181,106,.5); 
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation: none !important;
    transition: none !important;
  }
}

/* ===========================
   UTILITAIRES
   =========================== */
.u-center { text-align: center !important; }
.u-middle { vertical-align: middle !important; } 
.u-center-all { display: flex; align-items: center; justify-content: center; } 
.u-center-block { margin-left: auto; margin-right: auto; }
.mt-2 { margin-top: .5rem }
.mb-2 { margin-bottom: .5rem }
.t-right { text-align: right }
.t-muted { color: var(--brand-2) }
.t-left { text-align: left } 
.inline { display: inline }
.muted { color: #bbb }

/* ===========================
   LAYOUT ET GRILLES
   =========================== */
.layout--toptabs .main-content {
  padding: 24px;
  width: calc(100% - 48px); 
  flex: 1 0 auto;
  min-width: 0; 
  margin: 210px auto 16px;
  background: rgba(0,0,0,.82);
  border-radius: var(--radius-big);
  border: 1px solid rgba(214,181,106,.1);
  box-shadow: 0 4px 16px rgba(0,0,0,.15);
  position: relative;
}

.grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.field {
  gap: 12px;
  margin-bottom: 20px;
}

.grid--two {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}

.span-all {
  grid-column: 1 / -1;
  margin-top: 20px;
}

.content {
  background: var(--paper-fibers) repeat, linear-gradient(180deg, var(--paper-0) 0%, var(--paper-1) 100%);
  background-size: 120px 120px, auto;
  border: 3px solid var(--sep); 
  border-radius: var(--radius-big);
  box-shadow: var(--shadow-heavy); 
  padding: 30px; 
  min-height: 70vh; 
  position: relative; 
  z-index: 0;
}

.content--dark {
  background: var(--surface-2);
  background-image: none;
  color: var(--ink-inv);
  border: 3px solid rgba(214,181,106,.28);
}

.content::after {
  content: ""; 
  position: absolute; 
  inset: 0; 
  border-radius: var(--radius-big);
  box-shadow: inset 0 0 0 1px rgba(0,0,0,.06), inset 0 16px 40px rgba(0,0,0,.06);
  pointer-events: none;
}

.section { margin: 0 0 18px; }

.section__title {
  margin: 0; 
  font-family: 'Times New Roman', serif; 
  font-size: 30px; 
  font-weight: 900; 
  letter-spacing: 1.5px;
  color: var(--brand);
  text-shadow: 0 2px 6px rgba(0,0,0,.25);
}

.section__head {
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:16px
}

.section__subtitle { 
  color: var(--ink-1); 
  font-size: 14px; 
  line-height: 1.6; 
}

.card {
  position: relative;
  background: #151515;
  border: 1px solid var(--bd);
  border-radius: 14px;
  padding: 14px;
  box-shadow: var(--shadow); 
  overflow: hidden;
}

.card--dark { 
  background: linear-gradient(145deg, var(--surface-2) 0%, var(--surface-3) 100%); 
  border: 2px solid rgba(214,181,106,.25); 
  color: var(--ink-inv); 
}

.card--paper { 
  background: #fff; 
  border: 1px solid rgba(0,0,0,.12);  
}

.card__title { 
  margin: 0 0 8px; 
  font-weight: 900; 
  color: var(--brand); 
  text-transform: uppercase; 
  letter-spacing: .6px; 
  margin-bottom: 15px;
}

.card__body p { margin: .35rem 0; }
.ctitle { margin: 0 0 6px; font-weight: 900; }
.cmeta { font-size: 13px; color: var(--muted); white-space: nowrap; user-select: none; }

.panel {
  background: #141414;
  border: 1px solid var(--bd);
  border-radius: 14px;
  padding: 10px 12px;
  margin-bottom: 10px;
}

/* BADGES - VERSION FUSIONNÉE */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 8px;
  border-radius: 999px;
  font-size: 11px;
  border: 1px solid rgba(255,255,255,.14);
  background: linear-gradient(135deg, rgba(214,181,106,.25), rgba(164,120,31,.15));
  color: var(--brand); 
  font-weight: 800; 
  text-transform: uppercase; 
  letter-spacing: .5px;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.08);
}

.badge:empty { display: none !important; }

.badge.mail { background: linear-gradient(135deg, rgba(59,130,246,.25), rgba(59,130,246,.15)); color: #60a5fa; border-color: rgba(59,130,246,.4); }
.badge.events { background: linear-gradient(135deg, rgba(245,158,11,.25), rgba(245,158,11,.15)); color: #fbbf24; border-color: rgba(245,158,11,.4); }
.badge.announcements { background: linear-gradient(135deg, rgba(168,85,247,.25), rgba(168,85,247,.15)); color: #c084fc; border-color: rgba(168,85,247,.4); }
.badge.jail { background: linear-gradient(135deg, rgba(122,46,50,.25), rgba(122,46,50,.15)); color: var(--danger); border-color: var(--danger); }
.badge.hospital { background: linear-gradient(135deg, rgba(34,197,94,.25), rgba(34,197,94,.15)); color: #4ade80; border-color: rgba(34,197,94,.4); }
.badge.lock { background: linear-gradient(135deg, rgba(122,46,50,.22), rgba(122,46,50,.10)); color: #ffb3b3; border-color: rgba(122,46,50,.35); }
.badge.gang { color: var(--brand); }

/* CHIPS - VERSION UNIQUE */
.chip {
  padding: 3px 8px;
  font-size: 11px;
  border-radius: 999px;
  background: rgba(255,255,255,.06);
  border: 1px solid rgba(255,255,255,.14);
  color: #ddd;
  flex: 0 0 auto;
  font-weight: 700; 
  letter-spacing: .4px; 
  text-transform: uppercase;
  text-shadow: 0 1px 0 rgba(0,0,0,.45);
}

.chip-money { background: linear-gradient(135deg, rgba(34,197,94,.22), rgba(34,197,94,.12)); border-color: rgba(34,197,94,.4); color: #4ade80; }
.chip-crystals { background: linear-gradient(135deg, rgba(168,85,247,.22), rgba(168,85,247,.12)); border-color: rgba(168,85,247,.4); color: #c084fc; }
.chip-level { background: linear-gradient(135deg, rgba(245,158,11,.22), rgba(245,158,11,.12)); border-color: rgba(245,158,11,.4); color: #fbbf24; }

.tag { 
  display: inline-block; 
  padding: 2px 8px; 
  border-radius: 999px; 
  font-size: 11px; 
  font-weight: 900; 
  border: 1px solid rgba(255,255,255,.18); 
}

.tag--online { background: linear-gradient(135deg, #1d7a2a, #48d368); color: #0a140a; }
.tag--offline { background: linear-gradient(135deg, #444, #2a2a2a); color: #ddd; }

.alert { display: inline-block; padding: 8px 10px; border-radius: 8px; }
.alert--warn { background: linear-gradient(135deg, rgba(122,46,50,.2), rgba(122,46,50,.1)); border: 1px solid rgba(122,46,50,.4); }

.err {
  color: #ffcec9;
  background: linear-gradient(135deg, rgba(122,46,50,.18) 0%, rgba(122,46,50,.08) 100%);
  border: 2px solid rgba(122,46,50,.45);
  padding: 10px 12px;
  border-radius: 10px;
  margin: 10px 0;
  font-weight: 800;
  text-shadow: 0 1px 0 rgba(0,0,0,.35);
}

.countdown { 
  font-family: 'Courier New', monospace; 
  font-weight: 900; 
  color: var(--brand); 
  background: rgba(0,0,0,.22); 
  padding: 4px 8px; 
  border-radius: 6px; 
  border: 1px solid rgba(214,181,106,.25); 
}

.link--soft { color: var(--brand); font-weight: 900; }
.link--soft:hover { color: #fff; text-shadow: 0 0 8px rgba(214,181,106,.5); }
.username--donor { color: #ffb; text-shadow: 0 0 6px rgba(214,181,106,.5); }

/* ===========================
   BOUTONS - VERSION FUSIONNÉE
   =========================== */

.btn {
  padding: 10px 16px; 
  border-radius: var(--radius); 
  border: 2px solid transparent;
  cursor: pointer; 
  font-weight: 900; 
  font-size: 12px; 
  text-transform: uppercase; 
  letter-spacing: .5px;
  transition: all .2s ease; 
  box-shadow: 0 4px 8px rgba(0,0,0,.25); 
  font-family: inherit;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  height: auto;
  line-height: normal;
}

.btn:hover { transform: translateY(-2px); box-shadow: 0 6px 12px rgba(0,0,0,.35); }
.btn[disabled] { opacity: .5; cursor: not-allowed; transform: none !important; box-shadow: 0 2px 4px rgba(0,0,0,.12) !important; }

.btn--brand { background: linear-gradient(135deg, var(--brand), var(--brand-2)); color: #1a1a1a; border-color: rgba(214,181,106,.35); }
.btn--danger { background: linear-gradient(135deg, var(--danger), #a5424a); color: #fff; border-color: rgba(122,46,50,.35); }
.btn--success { background: linear-gradient(135deg, var(--success), #47a447); color: #fff; border-color: rgba(66,116,40,.35); }
.btn--accent { background: linear-gradient(135deg, #3559d1, #0ec6ff); color: #0b1226; border-color: rgba(14,198,255,.35); }
.btn--ghost { background: transparent; color: #ddd; border-color: var(--btn-ghost-bd); }
.btn--outline { background: transparent; color: var(--ink-0); border: 2px dashed var(--warning); box-shadow: none; }
.btn--dark { background: var(--btn-dark-bg); color: #eee; border-color: var(--btn-dark-bd); }
.btn--warn { background: linear-gradient(135deg, #9a6a28, #f59e0b); color: #161616; }

.btn--xs { padding: 6px 10px; font-size: 11px; }
.btn--sm { padding: 8px 14px; font-size: 11px; height: 36px; }
.btn--lg { padding: 12px 18px; font-size: 13px; }
.btn--block { width: 100%; }

.btn--dark:hover { transform: none; box-shadow: none; filter: brightness(1.06); }

.btn-try {
  padding: 10px 12px;
  border-radius: 10px;
  border: 2px solid rgba(255,255,255,.14);
  background: #161616;
  color: #eee;
  font-weight: 900;
  cursor: pointer;
  transition: all .2s ease;
}

.btn-try[disabled] { opacity: .55; cursor: not-allowed; }

.actions { display: flex; gap: 10px; justify-content: flex-end; }

.cta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  margin-top: 12px;
}

.cta .right { display: flex; gap: 8px; align-items: center; }

.state {
  font-weight: 900;
  font-size: 12px;
  padding: 4px 8px;
  border-radius: 999px;
  border: 1px solid rgba(255,255,255,.14);
}

.state.calm { color: #c7f9c7; background: rgba(34,197,94,.14); }
.state.hot { color: #ffe8a6; background: rgba(245,158,11,.14); }
.state.alert { color: #ffb3b3; background: rgba(239,68,68,.14); }

.lock {
  position: absolute;
  top: 10px;
  right: 10px;
}

/* ===========================
   FORMULAIRES - VERSION FUSIONNÉE
   =========================== */

.input, .select, .textarea {
  width: 100%; 
  height: 44px;
  padding: 10px 14px;
  border-radius: 12px;
  color: var(--ink-inv);
  background: #151515;
  border: 2px solid rgba(255,255,255,.12);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.05), 0 6px 16px rgba(0,0,0,.28);
  transition: border-color .15s, box-shadow .15s, transform .05s;
  font-family: inherit;
}

.textarea {
  height: auto;
  min-height: 80px;
  resize: vertical;
}

.input:hover, .select:hover { border-color: rgba(214,181,106,.28); }

.input:focus, .select:focus, .textarea:focus { 
  outline: 0;
  border-color: var(--brand);
  box-shadow: 0 0 0 3px rgba(214,181,106,.25), 0 10px 20px rgba(0,0,0,.35);
  transform: translateY(-1px);
}

.input::placeholder { color: #b7b7b7; opacity: .7; }
.input:disabled, .select:disabled { opacity: .6; cursor: not-allowed; }
.is-invalid { border-color: var(--danger) !important; box-shadow: 0 0 0 3px rgba(122,46,50,.25) !important; }

.select--nice {
  -webkit-appearance: none;
  appearance: none;
  padding-right: 44px;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20'><path fill='%23d6b56a' d='M5.6 7.2 10 11.6l4.4-4.4 1.4 1.4L10 14.4 4.2 8.6z'/></svg>");
  background-repeat: no-repeat;
  background-position: right 12px center;
  background-size: 18px 18px;
}

.select--compact {
  min-width: 120px;
  height: 36px;
  padding: 0 10px;
  font-size: 12px;
}

.control {
  position: relative;
}

.control .prefix, .control .suffix {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 28px;
  min-width: 28px;
  padding: 0 8px;
  border-radius: 999px;
  font-weight: 900;
  font-size: 11px;
  color: #f3e6c7;
  background: linear-gradient(135deg, rgba(214,181,106,.15), rgba(0,0,0,.25));
  border: 1px solid rgba(214,181,106,.35);
  pointer-events: none;
}

.control .prefix { left: 8px; }
.control .suffix { right: 8px; }

.input.has-prefix { padding-left: 46px; }
.input.has-suffix { padding-right: 52px; }

.input--num {
  -moz-appearance: textfield;
  appearance: textfield;
}

.input--num::-webkit-outer-spin-button,
.input--num::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

/* 1) On neutralise les flèches natives pour éviter le doublon */
.input.input--num::-webkit-outer-spin-button,
.input.input--num::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.input.input--num { -moz-appearance: textfield; } /* Firefox */

/* 2) L'entrée garde de la place à droite pour la zone stepper */
.input.input--num { padding-right: 52px; }

/* 3) Stepper intégré visuellement au champ */
.control { position: relative; }

.stepper {
  position: absolute;
  top: 4px; 
  bottom: 4px;
  right: 4px;
  width: 40px;
  display: grid;
  grid-template-rows: 1fr 1fr;
  border-left: 1px solid rgba(255,255,255,.08); 
  border-radius: 0 10px 10px 0; 
  background: linear-gradient(135deg, rgba(255,255,255,.04), rgba(0,0,0,.12));
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.02);
  pointer-events: auto;
  z-index: 3;
  opacity: .85;
  transition: background .15s ease, opacity .15s ease;
}

/* Un peu plus lisible au survol/focus du champ */
.control:hover .stepper,
.input.input--num:focus ~ .stepper,
.input.input--num:focus-visible ~ .stepper {
  background: linear-gradient(135deg, rgba(255,255,255,.06), rgba(0,0,0,.10));
  opacity: 1;
}

/* Boutons du stepper, ultra sobres */
.stepper__btn {
  all: unset;
  display: grid;
  place-items: center;
  font-size: 10px;
  font-weight: 800;
  color: var(--brand);
  cursor: pointer;
  transition: background .12s ease, color .12s ease, transform .06s ease;
}

.stepper__btn:hover  { background: rgba(214,181,106,.10); color: #fff; }
.stepper__btn:active { transform: translateY(1px); }

/* Variante compacte (facultatif) */
.stepper.stepper--compact { width: 34px; }
.stepper.stepper--compact .stepper__btn { font-size: 9px; }


.field .label {
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: .5px;
  color: var(--brand);
  font-size: 12px;
  margin-bottom: 6px;
  display: block;
}

.field--password {
  display: flex; 
  align-items: center;
}

.field--password .input {
  flex: 1; 
  margin: 0;
  border-top-right-radius: 0;
  border-bottom-right-radius: 0;
}

.field--password .toggle {
  height: 40px;
  padding: 0 12px;
  display: inline-flex; 
  align-items: center; 
  gap: 6px;
  background: var(--btn-dark-bg, #161616);
  color: #eee;
  border: 1px solid rgba(255,255,255,.14);
  border-left: none;
  border-top-left-radius: 0;
  border-bottom-left-radius: 0;
  box-shadow: none;
  cursor: pointer;
  font-weight: 800;
  font-size: 12px;
}

.field--password .toggle:hover { filter: brightness(1.06); }

.field--password .input:focus + .toggle {
  border-color: var(--brand);
  box-shadow: 0 0 0 3px rgba(214,181,106,.25);
}

.check.check--brand { 
  margin-top: 2px; 
  display: flex; 
  align-items: center; 
  gap: 10px; 
}

.check.check--brand input {
  width: 18px; 
  height: 18px; 
  accent-color: var(--brand);
}

.check.check--brand span {
  color: #e9e1c8; 
  font-weight: 700;
  text-transform: uppercase; 
  letter-spacing: .4px; 
  font-size: 11px;
}

.spec-form {
  display: flex; 
  align-items: center; 
  gap: 8px;
}

.spec-form .input {
  background: var(--surface-1); 
  border: 1px solid rgba(255,255,255,.12);
  color: var(--ink-inv); 
  padding: 8px 10px; 
  border-radius: 6px;
}

.spec-form .input:focus {
  border-color: var(--brand); 
  box-shadow: 0 0 0 2px var(--ring);
}

#sell-form {
  display: grid;
  gap: 16px;
}

#sell-form .field {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

#sell-form .grid {
  gap: 16px !important;
}

/* ===========================
   HEADER TOP TABS ET NAVIGATION
   =========================== */

.toptabs-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 200;
  background: linear-gradient(180deg, rgba(24,24,24,.96), rgba(16,16,16,.96));
  backdrop-filter: blur(16px);
  border-bottom: 3px solid rgba(214,181,106,.4);
  box-shadow: 0 8px 32px rgba(0,0,0,.5);
  margin: 0;
  overflow: visible !important;
}

.toptabs-header::before {
  content: ""; 
  position: absolute; 
  inset: 0; 
  pointer-events: none;
  background: var(--noise); 
  opacity: .08; 
  mix-blend-mode: soft-light;
}

.user-strip {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: linear-gradient(135deg, rgba(214,181,106,.1), rgba(214,181,106,.02));
  position: relative;
  z-index: 1;
  min-height: 64px;
}

.header-logo {
  display: flex;
  align-items: center;
  margin-right: 24px;
}

.header-logo .brand-logo {
  height: 72px;
  margin-left: 15px;
  width: auto;
  object-fit: contain;
  filter: drop-shadow(0 2px 6px rgba(0,0,0,.4));
  transition: filter .2s ease;
}

.header-logo .brand-logo:hover {
  filter: drop-shadow(0 4px 12px rgba(214,181,106,.3));
}

.user-main {
  display: flex;
  align-items: center;
  gap: 16px;
  flex: 1;
  justify-content: flex-start;
}

.user-avatar {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--brand), var(--brand-2));
  color: #1a1a1a;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 900;
  font-size: 18px;
  border: 2px solid rgba(214,181,106,.5);
  box-shadow: 
    0 4px 12px rgba(0,0,0,.3),
    inset 0 2px 4px rgba(255,255,255,.2);
  transition: all .2s ease;
  will-change: transform;
}

.user-avatar:hover {
  transform: scale(1.05);
  box-shadow: 
    0 6px 16px rgba(0,0,0,.4),
    0 0 20px rgba(214,181,106,.3);
}

.user-info {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.user-name {
  margin: 0;
  font-size: 17px;
  font-weight: 800;
}

.user-name a {
  color: #fff;
  text-decoration: none;
  transition: all .2s ease;
  text-shadow: 0 1px 2px rgba(0,0,0,.5);
}

.user-name a:hover {
  color: var(--brand);
  text-shadow: 0 0 12px rgba(214,181,106,.6);
  transform: translateX(2px);
}

.user-resources {
  display: flex;
  gap: 14px;
  font-size: 12px;
  font-weight: 700;
}

.resource-money,
.resource-crystals,
.resource-level {
  color: var(--brand);
  padding: 2px 6px;
  border-radius: 4px;
  background: rgba(214,181,106,.12);
  border: 1px solid rgba(214,181,106,.2);
  transition: all .2s ease;
  text-shadow: 0 1px 0 rgba(0,0,0,.5);
}

.resource-money:hover,
.resource-crystals:hover,
.resource-level:hover {
  background: rgba(214,181,106,.2);
  color: #fff;
  transform: translateY(-1px);
  box-shadow: 0 2px 6px rgba(214,181,106,.3);
}

.user-status {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  margin-right: 25px;
  position: relative;
  z-index: 350;
}

.user-status .us-row {
  display: flex;
  align-items: center;
  gap: 10px;
}

.us-btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 30px;
  border-radius: 8px;
  padding: 0;
  border: 2px solid transparent;
  background: linear-gradient(180deg, rgba(255,255,255,.05), rgba(255,255,255,.03));
  box-shadow: 0 2px 6px rgba(0,0,0,.25);
  cursor: pointer;
  text-decoration: none;
}

.us-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(0,0,0,.35);
}

.us-icn {
  font-size: 16px;
  line-height: 1;
}

.us-badge {
  position: absolute;
  top: -6px;
  right: -6px;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  border-radius: 999px;
  background: #eab308;
  color: #111;
  font-size: 11px;
  font-weight: 900;
  display: none;
  align-items: center;
  justify-content: center;
  border: 2px solid rgba(0,0,0,.25);
}

.tab-online-icn {
  display: inline-block;
  width: 18px;
  height: 18px;
  margin-right: 6px;
  vertical-align: middle;
  background: url('/assets/ui/mafioso_badge.png') center/contain no-repeat;
}

.us-sep {
  width: 10px;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,.15), transparent);
}

.us-sep-line {
  height: 1px;
  background: rgba(255,255,255,.12);
  margin: 6px 8px;
}

.us-live {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  text-decoration: none;
  cursor: pointer;
  user-select: none;
  border-radius: 8px;
  padding: 6px 10px;
  font-weight: 800;
  font-size: 11px;
  letter-spacing: .5px;
  text-transform: uppercase;
  border: 2px solid transparent;
  box-shadow: 0 2px 8px rgba(0,0,0,.25);
  transition: transform .15s ease, box-shadow .15s ease, filter .15s ease;
}

.us-live:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(0,0,0,.35);
}

.us-live.ok {
  background: linear-gradient(135deg, rgba(34,197,94,.18), rgba(34,197,94,.08));
  color: #a7f3a7;
  border-color: rgba(34,197,94,.4);
}

.us-live.bad {
  background: linear-gradient(135deg, rgba(122,46,50,.18), rgba(122,46,50,.08));
  color: #ffb3b3;
  border-color: rgba(122,46,50,.45);
}

.us-live[hidden] {
  display: none;
}

.us-menu {
  position: relative;
  z-index: 1000;  /* Au lieu de 500 */
}

.us-dropdown {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  min-width: 200px;
  border-radius: 10px;
  background: #161616;
  border: 1px solid rgba(214,181,106,.35);
  box-shadow: 0 16px 40px rgba(0,0,0,.55);
  padding: 6px;
  z-index: 10000;  /* Très élevé pour passer au-dessus de tout */
}

.user-status {
  position: relative;
  z-index: 1000;  /* Pareil que .us-menu */
  margin-right: 25px;
}

.us-dropdown[hidden] {
  display: none;
}

.user-strip {
  position: relative;
  z-index: 300;
}

.us-mi {
  display: flex;
  gap: 8px;
  align-items: center;
  padding: 8px 10px;
  border-radius: 8px;
  color: #eee;
  text-decoration: none;
  font-weight: 600;
}

.us-mi:hover {
  background: rgba(255,255,255,.06);
}

/* ===========================
   STATS ZONE ET NAVIGATION PAR ONGLETS
   =========================== */

.stats-zone {
  padding: 12px 20px 16px;
  background: 
    linear-gradient(135deg, rgba(0,0,0,.2) 0%, rgba(0,0,0,.1) 100%),
    linear-gradient(90deg, rgba(214,181,106,.05) 0%, transparent 50%, rgba(214,181,106,.05) 100%);
  border-top: 1px solid rgba(255,255,255,.06);
  border-bottom: 2px solid rgba(214,181,106,.3);
  position: relative;
  z-index: 1;
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 14px;
  max-width: 1300px;
  margin: 0 auto;
}

.stat-item {
  display: flex;
  flex-direction: column;
  gap: 6px;
  transition: transform .2s ease;
  will-change: transform;
}

.stat-item:hover {
  transform: translateY(-1px);
}

.stat-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: .8px;
}

.stat-name {
  color: var(--brand);
  text-shadow: 0 1px 2px rgba(0,0,0,.5);
}

.stat-value {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: #e8e8e8;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

.stat-timer {
  font-family: 'Courier New', monospace;
  font-size: 10px;
  color: var(--brand-2);
  background: rgba(0,0,0,.3);
  padding: 2px 5px;
  border-radius: 3px;
  border: 1px solid rgba(214,181,106,.2);
  display: none;
  min-width: 42px;
  text-align: center;
}

.stat-track {
  height: 10px;
  background: 
    linear-gradient(90deg, #0a0a0a, #111, #0a0a0a),
    radial-gradient(ellipse at center, #151515, #0a0a0a);
  border-radius: 999px;
  overflow: hidden;
  border: 1px solid rgba(214,181,106,.25);
  box-shadow: 
    inset 0 1px 3px rgba(0,0,0,.6),
    0 1px 0 rgba(255,255,255,.1);
  position: relative;
}

.stat-fill {
  height: 100%;
  border-radius: 999px;
  transition: width .6s cubic-bezier(0.4, 0.0, 0.2, 1);
  position: relative;
  overflow: hidden;
  will-change: transform;
}

.stat-fill.updating::after {
  content: ""; 
  position: absolute; 
  inset: 0;
  background: linear-gradient(90deg, transparent 0%, rgba(255,255,255,.4) 50%, transparent 100%);
  background-size: 200% 100%;
  animation: shine 1.5s linear 1;
  border-radius: 999px;
  display: block;
}

.fill-energy,
.fill-will,
.fill-brave,
.fill-hp,
.fill-xp {
  background: linear-gradient(90deg, #a4884f, #d6b56a, #f4e4c1);
  box-shadow: 0 0 8px rgba(214,181,106,.4);
}

.tab-nav {
  display: flex;
  overflow-x: auto;
  overflow-y: visible;
  padding: 0 20px;
  scrollbar-width: none;
  background: 
    linear-gradient(90deg, rgba(0,0,0,.15) 0%, rgba(0,0,0,.05) 50%, rgba(0,0,0,.15) 100%),
    linear-gradient(180deg, rgba(214,181,106,.03), transparent);
  position: relative;
  z-index: 200;
  scroll-behavior: smooth;
  align-items: center;
  gap: 0;
}

.tab-nav::-webkit-scrollbar { display: none; }

.tab-nav::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(214,181,106,.3), transparent);
}

.tab-separator {
  width: 1px;
  height: 20px;
  background: linear-gradient(180deg, transparent, rgba(255,255,255,.1), transparent);
  align-self: center;
  margin: 0 4px;
}

.tab-item {
  padding: 14px 18px;
  color: #999;
  text-decoration: none;
  white-space: nowrap;
  border-bottom: 3px solid transparent;
  font-weight: 700;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: .8px;
  transition: all .25s cubic-bezier(0.4, 0.0, 0.2, 1);
  position: relative;
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 80px;
  justify-content: center;
  will-change: transform;
}

.tab-item::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(214,181,106,.05), transparent);
  border-radius: 8px 8px 0 0;
  opacity: 0;
  transition: opacity .25s ease;
}

.tab-item:hover::before { opacity: 1; }

.tab-item:hover {
  color: #ddd;
  transform: translateY(-2px);
  text-shadow: 0 2px 4px rgba(0,0,0,.5);
}

.tab-item:focus {
  outline: 2px solid var(--brand);
  outline-offset: -2px;
  border-radius: 4px;
}

.tab-item.active {
  color: var(--brand);
  border-bottom-color: var(--brand);
  background: linear-gradient(135deg, rgba(214,181,106,.15), rgba(214,181,106,.05));
  box-shadow: 
    0 -2px 12px rgba(214,181,106,.2),
    inset 0 1px 0 rgba(255,255,255,.1);
  text-shadow: 0 0 12px rgba(214,181,106,.6);
  transform: translateY(-1px);
}

.tab-item.active::before { opacity: 1; }
.tab-item:active { transform: translateY(1px); }

.tab-icon {
  font-size: 15px;
  filter: drop-shadow(0 1px 2px rgba(0,0,0,.4));
  transition: transform .2s ease;
}

.tab-item:hover .tab-icon { transform: scale(1.1); }

.tab-item.active .tab-icon {
  transform: scale(1.15);
  filter: drop-shadow(0 2px 6px rgba(214,181,106,.4));
}

.tab-label {
  font-weight: 800;
  transition: all .2s ease;
}

.tab-badge {
  position: absolute;
  top: 4px;
  right: 8px;
  background: linear-gradient(135deg, var(--danger), #a5424a);
  color: white;
  border-radius: 12px;
  padding: 3px 7px;
  font-size: 9px;
  font-weight: 900;
  border: 1px solid rgba(0,0,0,.3);
  box-shadow: 
    0 2px 6px rgba(0,0,0,.4),
    inset 0 1px 0 rgba(255,255,255,.2);
  display: none;
  min-width: 16px;
  text-align: center;
  animation: badgePulse 2s infinite ease-in-out;
}

.tab-item.disabled {
  opacity: .45;
  cursor: not-allowed;
  filter: grayscale(0.2);
}

.tab-item.disabled .tab-badge { display: none; }

.tab-flex-spacer { flex: 1 1 auto; }

.tab-online {
  display: inline-flex; 
  align-items: center; 
  gap: 6px;
  height: 28px; 
  padding: 0 10px; 
  margin-left: 10px;
  border-radius: 999px;
  background: rgba(255,255,255,.06);
  border: 1px solid rgba(255,255,255,.14);
  font-weight: 800; 
  font-size: 12px; 
  color: #ddd;
}

.tab-online-icn { line-height: 1; }
#tab-online-count { min-width: 1.5ch; text-align: right; }

/* DROPDOWN ADMIN */
.tab-dropdown {
  position: relative;
  z-index: 400;
}

.tab-item--btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  border: none;
  background: none;
  color: inherit;
  padding: 14px 18px;
  font-weight: 700;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: .8px;
  border-bottom: 3px solid transparent;
  transition: all .25s cubic-bezier(0.4, 0.0, 0.2, 1);
  position: relative;
  min-width: 80px;
  justify-content: center;
  will-change: transform;
}

.tab-item--btn::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(214,181,106,.05), transparent);
  border-radius: 8px 8px 0 0;
  opacity: 0;
  transition: opacity .25s ease;
}


.tab-item--btn:hover::before { opacity: 1; }

.tab-item--btn:hover {
  color: #ddd;
  transform: translateY(-2px);
  text-shadow: 0 2px 4px rgba(0,0,0,.5);
}

.tab-item--btn:focus {
  outline: 2px solid var(--brand);
}

.tab-item--btn.active {
  color: #d6b56a;
  border-bottom-color: #d6b56a;
  background: linear-gradient(135deg, rgba(214,181,106,.15), rgba(214,181,106,.05));
  box-shadow: 
    0 -2px 12px rgba(214,181,106,.2),
    inset 0 1px 0 rgba(255,255,255,.1);
  text-shadow: 0 0 12px rgba(214,181,106,.6);
  transform: translateY(-1px);
}

.tab-item--btn.active::before { opacity: 1; }

.tab-caret {
  opacity: .7;
  font-size: 10px;
  transition: transform .2s ease;
}

.tab-item--btn[aria-expanded="true"] .tab-caret {
  transform: rotate(180deg);
}

/* Force la visibilité du conteneur parent */
.tab-nav {
  position: relative;
  z-index: 200;
  overflow: visible !important;
}

.tab-dropdown {
  position: relative;
  z-index: 400;
}

/* Le menu déroulant */
.tab-menu {
  position: absolute;
  right: 0;
  top: calc(100% + 8px);
  min-width: 240px;
  background: linear-gradient(145deg, #0f1115, #1a1d22);
  border: 2px solid rgba(214,181,106,.35);
  border-radius: 12px;
  box-shadow: 
    0 16px 40px rgba(0,0,0,.8),
    0 0 0 1px rgba(214,181,106,.3);
  padding: 8px;
  z-index: 10000;
  backdrop-filter: blur(16px);
  pointer-events: auto;
  
  /* Animation d'apparition */
  opacity: 0;
  transform: translateY(-10px) scale(0.95);
  transition: opacity .2s ease, transform .2s ease;
}

/* Flèche du menu */
.tab-menu::before {
  content: "";
  position: absolute;
  top: -8px;
  right: 24px;
  width: 14px;
  height: 14px;
  background: linear-gradient(135deg, #0f1115, #1a1d22);
  border-left: 2px solid rgba(214,181,106,.35);
  border-top: 2px solid rgba(214,181,106,.35);
  transform: rotate(45deg);
  z-index: -1;
}

/* État caché (par défaut) */
.tab-menu[hidden] {
  display: none !important;
  visibility: hidden !important;
  pointer-events: none !important;
}

/* État visible (quand hidden est retiré) */
.tab-menu:not([hidden]) {
  display: block !important;
  visibility: visible !important;
  opacity: 1;
  transform: translateY(0) scale(1);
}

/* Items du menu */
.tab-mi {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  text-decoration: none;
  color: #e5e7eb;
  border-radius: 8px;
  font-weight: 600;
  font-size: 13px;
  transition: all .15s ease;
  border: 1px solid transparent;
}

.tab-mi:hover {
  background: linear-gradient(135deg, rgba(214,181,106,.12), rgba(214,181,106,.06));
  color: #d6b56a;
  border-color: rgba(214,181,106,.25);
  transform: translateX(2px);
}

.tab-mi:active {
  transform: translateX(2px) translateY(1px);
}

.tab-mi:focus {
  outline: 2px solid #d6b56a;
  outline-offset: -2px;
}

/* Icône des items */
.tab-mi-icon {
  font-size: 16px;
  width: 20px;
  text-align: center;
  filter: drop-shadow(0 1px 2px rgba(0,0,0,.4));
}

.tab-mi:hover .tab-mi-icon {
  filter: drop-shadow(0 1px 2px rgba(0,0,0,.4)) drop-shadow(0 0 8px rgba(214,181,106,.4));
}

/* Séparateur */
.tab-sep {
  height: 1px;
  margin: 8px 6px;
  background: linear-gradient(90deg, transparent, rgba(214,181,106,.3), transparent);
  border: none;
}

.admin-badge {
  position: absolute;
  top: 6px;
  right: 6px;
  background: linear-gradient(135deg, #ef4444, #dc2626);
  color: white;
  border-radius: 10px;
  padding: 2px 6px;
  font-size: 9px;
  font-weight: 900;
  border: 1px solid rgba(0,0,0,.3);
  box-shadow: 
    0 2px 6px rgba(0,0,0,.4),
    inset 0 1px 0 rgba(255,255,255,.2);
  min-width: 14px;
  text-align: center;
  animation: adminPulse 3s infinite ease-in-out;
}

/* ===========================
   TOOLBAR - VERSION UNIQUE
   =========================== */

.toolbar {
  width: 100%;
  margin: 12px 0;
  display: flex;
  gap: 10px;
  align-items: center;
  flex-wrap: nowrap;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: thin;
}

.tool-left {
  display: flex; 
  gap: 8px; 
  align-items: center; 
  flex: 0 0 auto;
}

.tool-right {
  flex: 1 1 auto;
  display: grid;
  align-items: center;
  gap: 10px;
  grid-auto-flow: column;
  grid-template-columns:
    auto minmax(160px,1fr)
    auto minmax(160px,1fr)
    56px
    auto;
}

.toolbar label {
  color: #bbb; 
  font-size: 12px; 
  margin-right: 6px; 
  white-space: nowrap;
}

.toolbar .select,
.toolbar .btn {
  height: 36px; 
  line-height: 34px;
  padding: 0 10px;
  border-radius: 8px;
  border: 1px solid rgba(255,255,255,.14);
  background: #161616; 
  color: #eee; 
  font-weight: 700; 
  font-size: 12.5px;
  white-space: nowrap;
  width: 100%;
}

#dir.select {
  width: 56px; 
  min-width: 56px; 
  max-width: 56px;
  text-align: center; 
  padding: 0 6px;
}

.modal .btn {
  width: auto;
  height: 32px; 
  line-height: 30px;
  padding: 0 10px;
  border: 1px solid rgba(255,255,255,.14);
}

.tool-right > *, .tool-left > * { flex: 0 0 auto; }

/* TOOLBAR MARCHÉ - SPÉCIFIQUE */
.market-page .toolbar {
  flex-wrap: wrap;
  overflow: visible;
}

.market-page .tool-right {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  min-width: 0;
}

.market-page .toolbar .input,
.market-page .toolbar .select {
  box-sizing: border-box;
}

.market-page .toolbar .input {
  min-width: 200px;
  max-width: 260px;
  flex: 1 1 200px;
}

.market-page .toolbar .select {
  min-width: 120px;
  flex: 0 0 auto;
}

.market-page .toolbar #f-type {
  min-width: 160px;
  max-width: 200px;
}

.market-page .toolbar #f-curr {
  min-width: 140px;
  max-width: 160px;
}

.market-page .toolbar #f-sort {
  min-width: 120px;
  max-width: 150px;
}

.market-page .toolbar #dir {
  width: 60px;
  min-width: 60px;
  max-width: 60px;
}

.market-page .toolbar .btn {
  flex: 0 0 auto;
}

.market-page .toolbar label.cmeta {
  flex: 0 0 auto;
  margin-right: 6px;
}

.market-stats {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  margin: 8px 0 16px;
  padding: 6px 12px;
  background: rgba(0,0,0,.1);
  border-radius: 6px;
  border: 1px solid rgba(255,255,255,.08);
}

.result-count {
  color: #bbb;
  font-size: 12px;
  font-weight: 600;
}

.result-count #count-total {
  color: var(--brand);
  font-weight: 800;
}

.wanted {
  display: flex;
  align-items: center;
  gap: 10px; 
  margin-top: 10px; 
  margin-bottom: 10px;
}

.wanted .label {
  font-weight: 900;
  letter-spacing: .5px;
}

.stars {
  display: flex;
  gap: 4px;
  align-items: center;
}

.star {
  width: 18px;
  height: 18px;
}

.bar {
  flex: 1;
  height: 8px;
  border-radius: 999px;
  background: #0f0f0f;
  border: 1px solid rgba(255,255,255,.12);
  overflow: hidden;
}

.bar > i {
  display: block;
  height: 100%;
  width: 0;
  background: linear-gradient(90deg, #22c55e, #f59e0b, #ef4444);
  transition: width .35s ease;
}

.mwrap {
  margin-top: 8px;
}

.mlabel {
  font-size: 12px;
  color: #e5d8b3;
}

.mbar {
  height: 8px;
  border-radius: 999px;
  background: #0f0f0f;
  border: 1px solid rgba(255,255,255,.12);
  overflow: hidden;
  margin-top: 6px;
}

.mbar > i {
  display: block;
  height: 100%;
  width: 0;
  background: linear-gradient(90deg, #d6b56a, #fff1b8);
}

.inline {
  position: absolute;
  left: 12px;
  right: 12px;
  top: 12px;
  background: #121212;
  border: 2px solid var(--bd);
  border-radius: 12px;
  padding: 12px 14px;
  box-shadow: 0 12px 30px rgba(0,0,0,.45);
  z-index: 10;
}

.inline.ok {
  outline: 3px solid rgba(34,197,94,.18);
}

.inline.ko {
  outline: 3px solid rgba(239,68,68,.18);
}

.ititle {
  margin: 0 0 2px;
  font-weight: 900;
}

.isub {
  margin: 0;
  color: #bbb;
  font-size: 13px;
}

.out {
  margin-top: 10px;
  padding: 10px 12px;
  border-radius: 10px;
  background: #121212;
  border: 1px solid rgba(255,255,255,.12);
}

.note {
  color: #d3cab2;
  font-size: 13px;
}

/* ===========================
   TABLES - VERSION FUSIONNÉE
   =========================== */

.tbl {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  background: transparent;
  border: 1px solid rgba(214,181,106,.28);
  border-radius: var(--radius-big);
}

.tbl thead th {
  position: sticky;
  top: 0;
  z-index: 1;
  text-align: center;
  padding: 12px 14px;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: .6px;
  font-size: 12px;
  border-bottom: 2px solid rgba(214,181,106,.25);
}

.tbl--dark {
  color: var(--ink-inv);
  background: linear-gradient(135deg, #161616, #222);
}

.tbl--dark thead th {
  background: linear-gradient(180deg, rgba(214,181,106,.08), rgba(0,0,0,.0));
  color: var(--brand);
}

.tbl tbody tr {
  transition: background .15s;
}

.tbl--dark tbody tr {
  background: linear-gradient(135deg, rgba(214,181,106,.06) 0%, transparent 100%), 
             linear-gradient(135deg, #161616 0%, #222 100%);
}

.tbl td {
  padding: 12px 14px;
  border-bottom: 1px solid rgba(0,0,0,.07);
}

.tbl--dark td {
  border-bottom: 1px solid rgba(255,255,255,.06);
}

.tbl--compact td, .tbl--compact th {
  padding: 10px 12px;
}

.tbl--zebra tbody tr:nth-child(odd) {
  background: rgba(0,0,0,.02);
}

.tbl--hover tbody tr:hover {
  background: rgba(214,181,106,.07);
}

.tbl--grid tbody tr+tr {
  border-top: 1px solid var(--sep);
}

.tbl--profile { 
  color: var(--ink-inv); 
  background: linear-gradient(135deg, #161616, #222); 
}

.tbl--profile thead th { 
  color: var(--brand); 
  background: linear-gradient(180deg, rgba(214,181,106,.08), transparent); 
}

.col-thumb { width: 56px }
.col-actions { width: 1%; white-space: nowrap }
.col-num { text-align: right; font-variant-numeric: tabular-nums }
.col-nowrap { white-space: nowrap }

.cell-badge {
  display: inline-block;
  padding: .1rem .5rem;
  border-radius: .5rem;
  background: rgba(255,255,255,.09);
  font-size: .78rem;
}

.tbl__detail-row > td {
  background: #fffdf7;
  padding: 0;
  border: 0;
}

.tbl__detail {
  padding: 12px;
  border-top: 1px solid rgba(214,181,106,.25);
}

.tbl__empty { 
  text-align: center; 
  opacity: .75; 
}

.table-wrap .col-actions .action-bar { 
  display: flex; 
  gap: 6px; 
  flex-wrap: wrap; 
  justify-content: flex-end; 
}

.action-buttons {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  justify-content: center;
}

.action-buttons .btn {
  padding: 6px 10px;
  font-size: 11px;
  font-weight: 700;
  border-radius: 6px;
  cursor: pointer;
  transition: all .15s ease;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 60px;
}

.item-info-row {
  background: rgba(0,0,0,.1) !important;
}

.item-info-row td {
  padding: 0 !important;
  border: none !important;
}

/* ===========================
   MODALES - VERSION UNIQUE
   =========================== */

.modal {
  position: fixed;
  inset: 0;
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 999;
}

.modal[aria-hidden="false"] {
  display: flex !important;
}

.modal__scrim {
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,.66);
}

.modal__card {
  position: relative;
  z-index: 1;
  min-width: min(600px, 96vw);
  border-radius: 14px;
  border: 1px solid var(--bd);
  background: #151515;
  box-shadow: 0 16px 40px rgba(0,0,0,.55);
}

.modal__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 16px;
  border-bottom: 1px solid rgba(255,255,255,.08);
}

.modal__title {
  margin: 0;
  font-weight: 900;
}

.modal__body {
  padding: 16px;
}

.modal__foot {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  padding: 12px 16px;
  border-top: 1px solid rgba(255,255,255,.08);
}

.modal__close {
  font-weight: 900;
  padding: 6px 10px;
}

/* ===========================
   SECTIONS THÉMATIQUES
   =========================== */

.section.theme--medical {
  display: grid;
  grid-template-columns: 1fr auto;
  grid-template-areas:
    "title   art"
    "subtitle art"
    "card    card";
  align-items: start;
  gap: 0 16px;
}

.section.theme--medical .section__title { grid-area: title; }
.section.theme--medical .section__subtitle { grid-area: subtitle; }
.section.theme--medical .card { grid-area: card; }

.section__art--hospital {
  grid-area: art;
  position: relative;
  top: -8px;
  height: clamp(96px, 18vw, 140px);
  width: auto;
  pointer-events: none;
  filter: drop-shadow(0 6px 14px rgba(0,0,0,.35));
  opacity: .98;
}

.section.theme--prison {
  display: grid;
  grid-template-columns: 1fr auto;
  grid-template-areas:
    "title    art"
    "subtitle art"
    "card     card";
  align-items: start;
  gap: 0 16px;
}

.section.theme--prison .section__title { grid-area: title; }
.section.theme--prison .section__subtitle { grid-area: subtitle; }
.section.theme--prison .card { grid-area: card; }

.section__art--prison {
  grid-area: art;
  position: relative;
  top: -8px;
  height: clamp(96px, 18vw, 140px);
  width: auto;
  pointer-events: none;
  filter: drop-shadow(0 6px 14px rgba(0,0,0,.35));
  opacity: .98;
}

/* ===========================
   PAGES SPÉCIALISÉES
   =========================== */

.explore-toolbar { 
  display: flex; 
  justify-content: flex-end; 
  align-items: center; 
  gap: 8px; 
  margin: 6px 0 14px; 
}

.explore-toggle { 
  display: inline-flex; 
  gap: 6px; 
  padding: 4px; 
  border-radius: 999px; 
  background: #161616; 
  border: 1px solid rgba(255,255,255,.12); 
}

.tbtn { 
  border: 0; 
  padding: 8px 14px; 
  border-radius: 999px; 
  cursor: pointer; 
  font-weight: 800; 
  color: #ddd; 
  background: transparent; 
  transition: filter .15s ease, transform .08s ease; 
}

.tbtn:hover { color: #fff; }
.tbtn:active { transform: translateY(1px); }

.tbtn.active {
  background: linear-gradient(135deg, var(--brand), var(--brand-2));
  color: #111; 
  border: 1px solid rgba(214,181,106,.45);
  box-shadow: 0 2px 8px rgba(0,0,0,.25), inset 0 -2px 0 rgba(0,0,0,.18);
}

#pane-map, #pane-links { 
  margin-top: 6px; 
}

/* ===========================
   ONGLETS SYSTÈME
   =========================== */

.tabs__nav {
  display: flex;
  gap: .6rem;
  flex-wrap: wrap;
  margin: .6rem 0 1rem;
}

.tabs__btn {
  padding: .45rem .9rem;
  cursor: pointer;
  border: 1px solid rgba(255,255,255,.14);
  background: #161616;
  color: #ddd;
  border-radius: 999px;
  font-weight: 800;
  letter-spacing: .2px;
}

.tabs__btn:hover {
  filter: brightness(1.08);
}

.tabs__btn .badge {
  margin-left: .45rem;
  font-size: .8em;
  padding: .1rem .45rem;
  border-radius: .5rem;
  background: rgba(255,255,255,.09);
  color: #cfcfcf;
}

.tabs__btn.is-active {
  background: linear-gradient(135deg, var(--brand), var(--brand-2));
  color: #111;
  border-color: rgba(214,181,106,.45);
  box-shadow: 0 4px 10px rgba(0,0,0,.18);
}

.tabs__pane {
  display: none;
}

.tabs__pane.is-active {
  display: block;
}

/* ===========================
   SKELETON LOADING
   =========================== */

.skeleton {
  height: 64px;
  border-radius: var(--radius);
  background: linear-gradient(90deg, rgba(0,0,0,.05) 25%, rgba(0,0,0,.09) 37%, rgba(0,0,0,.05) 63%), #fffef8;
  background-size: 400% 100%;
  border: 1px solid var(--sep);
  animation: shimmer 1.15s infinite linear;
}

/* ===========================
   STAFF TOOLS
   =========================== */

.staff-tools .actions {
  justify-content: flex-end;
  gap: 10px;
  margin: 0 0 12px;
}

.staff-tools .tbl {
  margin-bottom: 14px;
}

/* ===========================
   TICK SYSTÈME
   =========================== */

.tick {
  display: none;
}

.tick.show {
  display: inline;
}

/* ===========================
   TOAST - VERSION UNIQUE
   =========================== */

.toast-container {
  position: fixed;
  top: 76px;
  right: 16px;
  z-index: 10000;
  pointer-events: none;
}

.toast {
  margin-top: 16px;
  padding: 14px 18px;
  border-radius: var(--radius);
  font-weight: 800;
  border: 2px solid;
  position: relative;
  overflow: hidden;
  display: none;
}

.toast::before {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  top: 0;
  height: 3px;
}

.toast.ok {
  background: linear-gradient(135deg, rgba(44,78,26,.16) 0%, rgba(44,78,26,.08) 100%), #1b1b1b;
  border-color: var(--success);
  color: #a7f3a7;
}

.toast.ok::before {
  background: linear-gradient(90deg, var(--success), #4caf50);
}

.toast.err {
  background: linear-gradient(135deg, rgba(122,46,50,.18) 0%, rgba(122,46,50,.08) 100%), #1b1b1b;
  border-color: var(--danger);
  color: #ffb3b3;
}

.toast.err::before {
  background: linear-gradient(90deg, var(--danger), #f44336);
}

.toast-fixed {
  position: fixed;
  top: 16px;
  right: 16px;
  z-index: 1000;
  min-width: 260px;
  box-shadow: var(--shadow-heavy);
}

/* ===========================
   LAYOUT INVENTAIRE ET OBJETS
   =========================== */

.item-sheet {
  background: linear-gradient(145deg, #1a1a1a, #2a2a2a);
  border-radius: 12px;
  padding: 20px;
  margin: 16px;
  border: 1px solid rgba(214,181,106,.25);
  box-shadow: 0 8px 24px rgba(0,0,0,.3);
  display: grid;
  grid-template-areas:
    "header header"
    "content image"
    "stats stats";
  grid-template-columns: 1fr 200px;
  gap: 20px;
  align-items: start;
}

.item-sheet__header {
  grid-area: header;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  padding-bottom: 16px;
  border-bottom: 1px solid rgba(214,181,106,.2);
}

.item-sheet__title {
  margin: 0;
  font-weight: 900;
  font-size: 20px;
  color: var(--brand);
  text-shadow: 0 1px 2px rgba(0,0,0,.5);
}

.item-sheet__pills {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.item-pill {
  display: inline-block;
  padding: 4px 10px;
  background: rgba(214,181,106,.15);
  color: var(--brand);
  border-radius: 16px;
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .5px;
  border: 1px solid rgba(214,181,106,.3);
}

.item-sheet__content {
  grid-area: content;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.item-sheet__desc {
  color: #ccc;
  font-style: italic;
  margin: 0;
  line-height: 1.6;
  font-size: 14px;
}

.item-sheet__image {
  grid-area: image;
  display: flex;
  flex-direction: column;
  align-items: center;
  background: rgba(0,0,0,.4);
  border: 2px solid rgba(214,181,106,.2);
  border-radius: 12px;
  padding: 20px;
  min-height: 180px;
  justify-content: center;
}

.item-sheet__img {
  max-width: 120px;
  max-height: 120px;
  width: auto;
  height: auto;
  object-fit: contain;
  filter: drop-shadow(0 4px 12px rgba(214,181,106,.3));
}

.item-sheet__stats {
  grid-area: stats;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  padding-top: 16px;
  border-top: 1px solid rgba(255,255,255,.1);
}

.item-stats-col {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.item-stat {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 12px;
  background: rgba(0,0,0,.2);
  border-radius: 6px;
  border: 1px solid rgba(255,255,255,.08);
}

.item-stat__k {
  font-weight: 600;
  color: #aaa;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: .3px;
}

.item-stat__v {
  font-weight: 900;
  color: var(--brand);
  font-size: 13px;
  font-family: 'Courier New', monospace;
}

.item-stat__v.money {
  color: #4ade80;
}

.item-stat__v.money::before {
  content: "💰";
  opacity: .7;
  margin-right: 1px;
}

/* ===========================
   KPI ET UTILITAIRES
   =========================== */

.kpi-row { 
  display: flex; 
  gap: 10px; 
  flex-wrap: wrap;
  margin-bottom: 15px;
}

.kpi {
  display: flex; 
  align-items: center; 
  gap: 8px;
  padding: 8px 10px; 
  border-radius: 999px;
  font-weight: 800; 
  font-size: 12px; 
  letter-spacing: .2px;
  background: rgba(214,181,106,.10);
  border: 1px solid rgba(214,181,106,.32); 
  color: #ecd5a2;
}

.kpi .v { 
  font-size: 14px; 
  color: #fff;
}

.hr-soft { 
  height: 1px; 
  background: linear-gradient(90deg, transparent, rgba(255,255,255,.12), transparent); 
  border: 0; 
  margin: 12px 0;
}

.card.is-locked { 
  opacity: .65; 
}

.level-ribbon {
  position: absolute; 
  top: 12px; 
  right: -30px;
  background: var(--brand);
  color: #fff; 
  padding: 4px 35px; 
  font-size: 11px; 
  font-weight: 600; 
  text-align: center;
  transform: rotate(45deg); 
  transform-origin: center;
  box-shadow: 0 2px 4px rgba(0,0,0,.1); 
  z-index: 2; 
  min-width: 80px;
  text-shadow: 0 1px 2px rgba(0,0,0,.3);
  transition: transform .2s ease;
}

.card:hover .level-ribbon { 
  transform: rotate(45deg) scale(1.05); 
}

.card.is-locked .level-ribbon {
  background: linear-gradient(135deg, #6b7280 0%, #4b5563 100%);
}

.risk { 
  display: flex; 
  gap: 4px; 
}

.risk-dot {
  width: 10px; 
  height: 10px; 
  border-radius: 3px;
  border: 1px solid rgba(255,255,255,.18); 
  background: rgba(255,255,255,.06);
}

.risk-dot.on { 
  background: var(--brand); 
  border-color: var(--brand); 
}

.lock-overlay {
  position: absolute; 
  top: 83%; 
  left: 50%; 
  transform: translate(-50%, -50%);
  background: rgba(0,0,0,.8); 
  color: #fff; 
  padding: 6px 12px; 
  border-radius: 16px; 
  font-size: 11px; 
  font-weight: 600; 
  z-index: 3;
}

.mastery-pill {
  display: inline-flex; 
  align-items: center; 
  gap: 6px;
  padding: 2px 8px; 
  border-radius: 999px;
  background: rgba(255,255,255,.06);
  border: 1px solid rgba(255,255,255,.08);
  font-size: 11px; 
  line-height: 1; 
  white-space: nowrap;
}

.mastery-pill .m-level { 
  font-weight: 800; 
  letter-spacing: .2px; 
  opacity: .95;
}

.mastery-pill .m-bar { 
  width: 70px; 
  height: 6px; 
  background: rgba(255,255,255,.08);
  border-radius: 999px; 
  position: relative; 
  overflow: hidden;
}

.mastery-pill .m-bar i { 
  position: absolute; 
  inset: 0 auto 0 0; 
  width: 0%;
  background: linear-gradient(90deg, var(--m1), var(--m2));
  border-radius: 999px; 
  transition: width .35s ease;
}

.mastery-pill .m-count { 
  opacity: .9;
}

.mastery-pill.is-m0 { --m1: #9ca3af; --m2: #6b7280; }
.mastery-pill.is-m1 { --m1: #34d399; --m2: #059669; }
.mastery-pill.is-m2 { --m1: #60a5fa; --m2: #2563eb; }
.mastery-pill.is-m3 { --m1: #a78bfa; --m2: #7c3aed; }
.mastery-pill.is-m4 { --m1: #f59e0b; --m2: #d97706; }
.mastery-pill.is-m5 { --m1: #f472b6; --m2: #ec4899; }

/* ===========================
   GESTION PERSONNAGE - VERSION FUSIONNÉE
   =========================== */

.char-header {
  margin-bottom: 32px;
  width: 100%;
  max-width: 1400px;
  margin-left: auto;
  margin-right: auto;
}

.char-title-area {
  margin-bottom: 20px;
}

.char-title-area .section__title {
  margin-bottom: 8px;
}

.char-title-area .section__subtitle {
  color: #999;
  font-size: 14px;
  line-height: 1.5;
  margin: 0;
}

.char-controls {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  margin-bottom: 25px;
}

.char-nav {
  flex: 0 0 auto;
}

.char-actions {
  display: flex;
  align-items: flex-end;
  gap: 12px;
  flex-wrap: nowrap;
}

.optimization-group {
  display: flex;
  align-items: flex-end;
  gap: 8px;
  flex-wrap: nowrap;
}

.optimization-group .cmeta {
  font-size: 12px;
  color: #bbb;
  white-space: nowrap;
  margin-bottom: 2px;
}

.char-equipment-layout {
  display: grid;
  grid-template-columns: minmax(280px, 1fr) 300px minmax(380px, 1fr);
  gap: 32px;
  align-items: start;
  margin-bottom: 32px;
  width: 100%;
  max-width: 1400px;
  margin-left: auto;
  margin-right: auto;
}

.char-slots {
  display: grid;
  grid-template-rows: repeat(4, 1fr);
  gap: 16px;
  height: fit-content;
  width: 100%;
}

.char-slots--left {
  justify-items: end;
}

.char-slots--right {
  justify-items: start;
}

.equipment-slot {
  position: relative;
  background: linear-gradient(145deg, #151515, #1a1a1a);
  border: 2px solid rgba(214,181,106,.25);
  border-radius: 12px;
  padding: 14px;
  transition: all .2s ease;
  min-height: 140px;
  width: 100%;
  max-width: 280px;
  min-width: 240px;
  overflow: hidden;
}

.equipment-slot:hover {
  border-color: var(--brand);
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(214,181,106,.3);
}

.equipment-slot.is-active {
  border-color: var(--brand);
  background: linear-gradient(145deg, rgba(214,181,106,.08), rgba(214,181,106,.04));
  box-shadow: 0 0 0 3px rgba(214,181,106,.2);
}

.equipment-slot[data-locked="1"] {
  border-style: dashed;
  opacity: .8;
}

.slot-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
  padding-bottom: 8px;
  border-bottom: 1px solid rgba(255,255,255,.1);
}

.slot-title {
  margin: 0;
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: .5px;
}

.slot-lock {
  background: none;
  border: none;
  color: #888;
  cursor: pointer;
  font-size: 14px;
  padding: 4px;
  border-radius: 4px;
  transition: all .2s ease;
}

.slot-lock:hover {
  color: var(--brand);
  background: rgba(214,181,106,.1);
}

.slot-lock[aria-pressed="true"] {
  color: var(--brand);
}

.slot-content {
  min-height: 100px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.empty-slot {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  color: #666;
  cursor: pointer;
  padding: 12px;
  border-radius: 8px;
  transition: all .2s ease;
}

.empty-slot:hover {
  color: #999;
  background: rgba(255,255,255,.03);
}

.slot-icon {
  font-size: 18px;
  opacity: .7;
}

.slot-placeholder {
  font-size: 11px;
  text-align: center;
  line-height: 1.3;
}

.equipped-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  position: relative;
  padding: 8px;
  border-radius: 8px;
  background: rgba(0,0,0,.2);
  border: 1px solid rgba(255,255,255,.1);
  transition: all .2s ease;
}

.equipped-item:hover {
  background: rgba(0,0,0,.3);
  border-color: rgba(214,181,106,.3);
}

.equipped-item .item-icon {
  width: 48px;
  height: 48px;
  border-radius: 6px;
  object-fit: contain;
}

.equipped-item .item-info {
  text-align: center;
}

.equipped-item .item-name {
  font-size: 11px;
  font-weight: 600;
  color: #eee;
  line-height: 1.2;
}

.unequip-btn {
  position: absolute;
  top: 4px;
  right: 4px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: rgba(239,68,68,.8);
  color: white;
  border: none;
  cursor: pointer;
  font-size: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity .2s ease;
}

.equipped-item:hover .unequip-btn {
  opacity: 1;
}

.unequip-btn:hover {
  background: #ef4444;
  transform: scale(1.1);
}

.char-stats-grid {
  display: grid;
  gap: 8px;
}

.char-stats-grid .stat-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 6px 10px;
  background: rgba(0,0,0,.2);
  border-radius: 6px;
  border: 1px solid rgba(255,255,255,.08);
}

.char-stats-grid .stat-label {
  font-size: 11px;
  color: #aaa;
  font-weight: 600;
}

.char-stats-grid .stat-value {
  font-size: 12px;
  font-weight: 800;
  color: var(--brand);
  font-family: 'Courier New', monospace;
}

.portrait-hint {
  font-size: 12px;
  text-align: center;
  color: #888;
  background: rgba(0,0,0,.2);
  padding: 8px 12px;
  border-radius: 8px;
  border: 1px solid rgba(255,255,255,.06);
  max-width: 240px;
}

.equipment-slot.drag-over {
  border-color: var(--brand);
  background: rgba(214,181,106,.1);
  box-shadow: 0 4px 20px rgba(214,181,106,.3);
}

.equipment-slot.drag-invalid {
  border-color: #ef4444;
  background: rgba(239,68,68,.1);
}

.drop-zone {
  position: absolute;
  inset: 0;
  background: rgba(214,181,106,.2);
  border-radius: 12px;
  display: none;
  align-items: center;
  justify-content: center;
  border: 2px solid var(--brand);
}

.equipment-slot.drag-over .drop-zone {
  display: flex;
}

.drop-indicator {
  background: var(--brand);
  color: #000;
  padding: 8px 16px;
  border-radius: 6px;
  font-weight: 600;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: .5px;
}

.char-extra {
  margin-top: 24px;
  padding-top: 24px;
  border-top: 1px solid rgba(255,255,255,.1);
}

.char-extra h4 {
  margin: 0 0 16px;
  font-size: 14px;
  text-align: center;
}

.char-extra .char-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 12px;
}

.char-portrait-section {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 20px;
}

.char-portrait-container {
  position: relative;
  width: 240px;
  height: 390px;
  border-radius: 16px;
  overflow: hidden;
  background: linear-gradient(145deg, #1a1a1a, #2a2a2a);
  border: 3px solid rgba(214,181,106,.4);
  box-shadow: 
    0 12px 32px rgba(0,0,0,.5),
    inset 0 1px 0 rgba(255,255,255,.1);
  transition: all .3s ease;
}

.char-portrait-container:hover {
  transform: translateY(-4px) scale(1.02);
  box-shadow: 
    0 20px 40px rgba(0,0,0,.6),
    0 0 30px rgba(214,181,106,.3),
    inset 0 1px 0 rgba(255,255,255,.15);
  border-color: var(--brand);
}

.char-portrait {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: all .3s ease;
}

.char-portrait-container:hover .char-portrait {
  transform: scale(1.05);
  filter: brightness(1.1) contrast(1.05);
}

.portrait-overlay {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  background: linear-gradient(transparent, rgba(0,0,0,.8));
  padding: 16px;
  transform: translateY(100%);
  transition: transform .3s ease;
}

.char-portrait-container:hover .portrait-overlay {
  transform: translateY(0);
}

.char-info {
  text-align: center;
}

.char-name {
  margin: 0 0 4px;
  font-size: 16px;
  font-weight: 900;
  color: var(--brand);
  text-shadow: 0 2px 4px rgba(0,0,0,.8);
}

.char-level {
  font-size: 12px;
  color: #ccc;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .5px;
}

.char-stats-panel {
  background: linear-gradient(145deg, #151515, #1a1a1a);
  border: 2px solid rgba(214,181,106,.25);
  border-radius: 12px;
  padding: 16px;
  width: 100%;
  max-width: 260px;
}

.stats-title {
  margin: 0 0 14px;
  font-size: 14px;
  font-weight: 800;
  color: var(--brand);
  text-align: center;
  text-transform: uppercase;
  letter-spacing: .5px;
}

.inventory-section {
  margin-top: 40px;
  padding-top: 32px;
  border-top: 2px solid rgba(214,181,106,.25);
  position: relative;
}

.inventory-section::before {
  content: "";
  position: absolute;
  top: -1px;
  left: 50%;
  transform: translateX(-50%);
  width: 80px;
  height: 2px;
  background: linear-gradient(90deg, var(--brand), #fff, var(--brand));
  border-radius: 1px;
}

.inventory-title {
  margin: 0 0 20px;
  color: var(--brand);
  font-weight: 900;
  font-size: 22px;
  text-transform: uppercase;
  letter-spacing: .8px;
  text-shadow: 0 2px 4px rgba(0,0,0,.3);
  text-align: center;
}

.section__row {
  display: flex;
  align-items: flex-end;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 16px;
}

.section__row h3 {
  margin: 0;
  color: var(--brand);
  font-weight: 800;
}

.section__row .field {
  margin-bottom: 0;
}

.section__row .field .label {
  font-size: 11px;
  margin-bottom: 4px;
}

.section__row .field .input,
.section__row .field .select {
  height: 32px;
  padding: 0 8px;
  font-size: 12px;
}

.filters-grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr auto;
  gap: 20px;
  align-items: end;
}

.filter-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.filter-label {
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: .4px;
  color: var(--brand);
  text-shadow: 0 1px 2px rgba(0,0,0,.5);
}

.filter-input,
.filter-select {
  height: 42px;
  padding: 0 14px;
  font-size: 14px;
  border-radius: 10px;
  background: rgba(0,0,0,.8);
  border: 2px solid rgba(255,255,255,.15);
  color: #eee;
  font-weight: 600;
  transition: all .2s ease;
  min-width: 0;
}

.filter-input:focus,
.filter-select:focus {
  border-color: var(--brand);
  background: rgba(0,0,0,.3);
  box-shadow: 0 0 0 3px rgba(214,181,106,.2);
  transform: translateY(-1px);
}

.filter-input::placeholder {
  color: #888;
  font-style: italic;
}

.inventory-counter {
  background: linear-gradient(135deg, rgba(0,0,0,.3), rgba(0,0,0,.2));
  border: 2px solid rgba(214,181,106,.3);
  border-radius: 10px;
  padding: 12px 16px;
  color: #eee;
  font-size: 14px;
  font-weight: 700;
  text-align: center;
  white-space: nowrap;
  box-shadow: 0 4px 12px rgba(0,0,0,.2);
}

.inventory-counter .count-number {
  color: var(--brand);
  font-weight: 900;
  font-size: 16px;
}

.equippable-items {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 10px;
  margin-top: 12px;
}

.inventory-item {
  display: flex;
  gap: 10px;
  align-items: center;
  border: 1px solid rgba(255,255,255,.12);
  background: rgba(0,0,0,.15);
  border-radius: 10px;
  padding: 10px;
  cursor: grab;
  transition: all .2s ease;
}

.inventory-item:hover {
  border-color: rgba(214,181,106,.4);
  background: rgba(214,181,106,.05);
  transform: translateY(-1px);
}

.inventory-item:active {
  cursor: grabbing;
  transform: scale(.98);
}

.inventory-item.is-equipped {
  opacity: .6;
  cursor: not-allowed;
}

.inventory-item .item-icon {
  width: 40px;
  height: 40px;
  border-radius: 6px;
  object-fit: contain;
  background: rgba(0,0,0,.3);
}

.inventory-item .item-details {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
  flex: 1;
}

.inventory-item .item-name {
  font-weight: 600;
  color: #eee;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.inventory-item .item-meta {
  display: flex;
  gap: 8px;
  font-size: 11px;
  color: #999;
}

.inventory-item .rarity {
  font-weight: 600;
  text-transform: capitalize;
}

.inventory-item .equipped-indicator {
  background: var(--brand);
  color: #000;
  padding: 1px 4px;
  border-radius: 3px;
  font-size: 9px;
  font-weight: 700;
}

.inventory-item.rarity-common { box-shadow: inset 3px 0 0 0 #8b8b8b33; }
.inventory-item.rarity-uncommon { box-shadow: inset 3px 0 0 0 #22c55e55; }
.inventory-item.rarity-rare { box-shadow: inset 3px 0 0 0 #3b82f655; }
.inventory-item.rarity-epic { box-shadow: inset 3px 0 0 0 #a855f755; }
.inventory-item.rarity-legendary { box-shadow: inset 3px 0 0 0 #eab30866; }

/* ===========================
   RESPONSIVE - CONSOLIDÉ
   =========================== */

@media (max-width: 1200px) {
  .char-equipment-layout {
    grid-template-columns: minmax(240px, 1fr) 280px minmax(240px, 1fr);
    gap: 24px;
  }
  
  .equipment-slot {
    max-width: 260px;
    min-width: 220px;
  }
  
  .char-portrait-container {
    width: 240px;
    height: 320px;
  }
  
  .char-stats-panel {
    max-width: 260px;
  }
  
  .filters-grid {
    grid-template-columns: 2fr 1fr 1fr auto;
    gap: 16px;
  }
  
  .market-page .toolbar .input {
    min-width: 180px;
    max-width: 200px;
  }
  
  .market-page .toolbar #f-type {
    min-width: 140px;
    max-width: 160px;
  }
}

@media (max-width: 1080px) {
  .shell {
    grid-template-columns: 1fr;
    gap: 16px;
  }
}

@media (max-width: 1024px) {  
  .stats-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
  }
  
  .user-strip {
    padding: 12px 16px;
  }
  
  .stats-zone {
    padding: 10px 16px 14px;
  }

  .main-content {
    padding: 20px;
  }
}

@media (max-width: 1000px) {
  .grid--two,
  .grid--profile {
    grid-template-columns: 1fr;
  }
  
  .char-controls {
    flex-direction: column;
    align-items: stretch;
    gap: 12px;
  }
  
  .char-actions {
    justify-content: center;
  }
  
  .optimization-group {
    justify-content: center;
  }
  
  .char-equipment-layout {
    grid-template-columns: 1fr 260px 1fr;
    gap: 20px;
  }
  
  .filters-grid {
    grid-template-columns: 1fr 1fr;
    grid-template-rows: auto auto;
    gap: 16px;
  }
  
  .inventory-counter {
    grid-column: 1 / -1;
    justify-self: center;
  }
  
  .market-page .tool-right {
    flex-direction: column;
    align-items: stretch;
    gap: 8px;
  }
  
  .market-page .toolbar .input,
  .market-page .toolbar .select,
  .market-page .toolbar .btn {
    width: 100%;
    max-width: none;
  }
  
  .market-page .toolbar #dir {
    width: 100%;
    text-align: center;
  }
}

@media (max-width: 900px) {
  .section.theme--medical,
  .section.theme--prison {
    display: block;
  }
  
  .section__art--hospital,
  .section__art--prison {
    display: none;
  }
  
  .char-equipment-layout {
    grid-template-columns: 1fr;
    gap: 24px;
    text-align: center;
  }
  
  .char-slots {
    grid-template-columns: repeat(2, 1fr);
    grid-template-rows: repeat(2, 1fr);
    justify-items: center;
    max-width: 600px;
    margin: 0 auto;
  }
  
  .char-slots--left,
  .char-slots--right {
    justify-items: center;
  }
  
  .equipment-slot {
    max-width: none;
    width: 100%;
    min-width: 200px;
  }
  
  .char-portrait-section {
    order: -1;
  }
}

@media (max-width: 860px) {
  .grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 780px) {
  .tool-right {
    gap: 8px;
    grid-template-columns:
      auto minmax(120px,1fr)
      auto minmax(120px,1fr)
      48px
      auto;
  }
  
  .select, .btn {
    height: 34px;
    line-height: 32px;
    padding: 0 8px;
    font-size: 12px;
  }
  
  .tab-online {
    height: 26px;
    padding: 0 8px;
    font-size: 11.5px;
  }
  
  .market-page .toolbar {
    flex-direction: column;
    gap: 8px;
  }
  
  .market-page .toolbar .input {
    min-width: auto;
  }
}

@media (max-width: 768px) {
  .user-strip {
    padding: 10px 16px;
  }

  .user-main {
    gap: 12px;
  }

  .user-avatar {
    width: 42px;
    height: 42px;
    font-size: 16px;
  }

  .user-name {
    font-size: 15px;
  }

  .user-resources {
    flex-direction: row;
    flex-wrap: wrap;
    gap: 8px;
    font-size: 11px;
  }

  .stats-zone {
    padding: 8px 12px 12px;
  }

  .stats-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
  }

  .stat-header {
    font-size: 10px;
  }

  .stat-value {
    font-size: 11px;
  }

  .stat-timer {
    font-size: 10px;
    padding: 1px 4px;
  }

  .stats-grid .stat-item:nth-child(3) .stat-name {
    font-size: 0;
  }
  
  .stats-grid .stat-item:nth-child(3) .stat-name::before {
    content: "PA";
    font-size: 11px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: .8px;
    color: var(--brand);
    text-shadow: 0 1px 2px rgba(0,0,0,.5);
    display: inline-block;
  }

  .tab-item {
    padding: 12px 14px;
    font-size: 11px;
    min-width: 70px;
  }

  .tab-icon {
    font-size: 14px;
  }

  .main-content {
    padding: 16px;
  }

  .actions {
    flex-direction: column;
    gap: 8px;
  }
  
  .btn {
    padding: 8px 12px;
    font-size: 11px;
  }
  
  .cta {
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
  }
  
  .tbl, .tbl thead, .tbl tbody, .tbl th, .tbl td, .tbl tr {
    display: block;
    width: 100%;
  }
  
  .tbl thead {
    display: none;
  }
  
  .tbl tr {
    border: 1px solid var(--sep);
    border-radius: 8px;
    margin: 10px 0;
    overflow: hidden;
  }
  
  .tbl td {
    border: 0;
    border-bottom: 1px solid var(--sep);
  }
  
  .tbl td:last-child {
    border-bottom: 0;
  }
  
  .tbl td[data-label]::before {
    content: attr(data-label);
    display: block;
    font-size: 11px;
    color: var(--brand);
    text-transform: uppercase;
    letter-spacing: .5px;
    margin-bottom: 4px;
  }
  
  .col-actions {
    white-space: normal;
  }
  
  .table {
    font-size: 14px;
  }
  
  .table .row td {
    padding: 10px 12px;
  }
  
  .action-buttons {
    flex-direction: column;
    gap: 4px;
  }
  
  .action-buttons .btn {
    width: 100%;
    min-width: auto;
  }
  
  .market-stats {
    text-align: center;
  }
  
  .result-count {
    font-size: 11px;
  }
  
  .item-sheet {
    grid-template-areas:
      "header"
      "image"
      "content"
      "stats";
    grid-template-columns: 1fr;
    gap: 16px;
  }
  
  .item-sheet__image {
    min-height: 140px;
    padding: 16px;
  }
  
  .item-sheet__img {
    max-width: 80px;
    max-height: 80px;
  }
  
  .item-sheet__stats {
    grid-template-columns: 1fr;
  }
  
  .item-sheet__header {
    flex-direction: column;
    align-items: flex-start;
  }
  
  .inventory-header {
    padding: 20px;
  }
  
  .inventory-title {
    font-size: 18px;
    margin-bottom: 16px;
  }
  
  .filters-grid {
    grid-template-columns: 1fr;
    gap: 12px;
  }
  
  .filter-input,
  .filter-select {
    height: 38px;
    font-size: 13px;
  }
  
  .tab-menu {
    min-width: 200px;
    right: -20px;
  }
  
  .tab-mi {
    padding: 8px 10px;
    font-size: 12px;
  }
  
/* ===========================
   CONTINUATION RESPONSIVE - PARTIE 3
   =========================== */

@media (max-width: 768px) {
  .tab-mi-icon {
    font-size: 14px;
    width: 18px;
  }
  
  .tick {
    font-size: 10px;
    padding: 1px 4px;
  }
}

@media (max-width: 720px) {
  .tbl, .tbl thead, .tbl tbody, .tbl th, .tbl td, .tbl tr {
    display: block;
    width: 100%;
  }
  
  .tbl thead {
    display: none;
  }
  
  .tbl tr {
    border: 1px solid var(--sep);
    border-radius: 8px;
    margin: 10px 0;
    overflow: hidden;
  }
  
  .tbl td {
    border: 0;
    border-bottom: 1px solid var(--sep);
  }
  
  .tbl td:last-child {
    border-bottom: 0;
  }
  
  .tbl td[data-label]::before {
    content: attr(data-label); 
    display: block; 
    font-size: 11px; 
    color: var(--brand);
    text-transform: uppercase; 
    letter-spacing: .5px; 
    margin-bottom: 4px;
  }
  
  .col-actions {
    white-space: normal;
  }
  
  .table { 
    font-size: 14px; 
  }
  
  .table .row td { 
    padding: 10px 12px; 
  }
}

@media (max-width: 640px) {
  .char-header {
    margin-bottom: 24px;
  }
  
  .char-controls {
    gap: 8px;
  }
  
  .char-actions {
    flex-direction: column;
    width: 100%;
  }
  
  .optimization-group {
    flex-direction: column;
    width: 100%;
  }
  
  .optimization-group .select--compact {
    width: 100%;
  }
  
  .char-slots {
    grid-template-columns: 1fr;
    grid-template-rows: auto;
    max-width: 320px;
  }
  
  .char-portrait-container {
    width: 220px;
    height: 290px;
  }
  
  .char-stats-panel {
    max-width: 320px;
  }
  
  .portrait-hint {
    max-width: 320px;
  }
  
  .equippable-items {
    grid-template-columns: 1fr;
  }
  
  .section__row {
    flex-direction: column;
    align-items: stretch;
  }
}

@media (max-width: 520px) {
  .cstats { 
    grid-template-columns: 1fr; 
  }
}

@media (max-width: 480px) {  
  .user-strip {
    flex-direction: column;
    gap: 10px;
    align-items: center;
    text-align: center;
    padding: 8px 12px;
  }

  .user-main {
    justify-content: center;
  }

  .user-status {
    align-items: center;
  }

  .stats-grid {
    grid-template-columns: 1fr;
    gap: 8px;
  }

  .stat-item {
    gap: 4px;
  }

  .stat-track {
    height: 8px;
  }

  .tab-nav {
    padding: 0 8px;
  }

  .tab-item {
    padding: 10px 12px;
    font-size: 10px;
    gap: 4px;
    min-width: 60px;
  }

  .tab-label {
    display: none;
  }

  .tab-icon {
    font-size: 16px;
  }

  .main-content {
    padding: 12px;
  }
}

/* ===========================
   CORRECTIONS ET AJUSTEMENTS FINAUX
   =========================== */

/* Assure que les sections principales utilisent toute la largeur */
.section {
  width: 100%;
  max-width: none;
}

/* Force la visibilité du menu admin */
.toptabs-header {
  overflow: visible !important;
}

.tab-nav {
  overflow: visible !important;
  position: relative;
  z-index: 300;
}

.tab-dropdown {
  position: relative;
  z-index: 400;
}

.tab-menu {
  z-index: 9999 !important;
}

/* Neutralise l'étirement des boutons dans les modales */
.modal .btn {
  width: auto !important;
}

.modal__head .btn {
  width: auto !important;
}

/* Évite que les éléments de toolbar s'étirent */
.tool-right > *, 
.tool-left > * { 
  flex: 0 0 auto; 
}

/* Corrections pour les inputs dans toolbar */
.toolbar .input,
.toolbar .select,
.toolbar .btn {
  box-sizing: border-box;
}

/* Assure que le dropdown reste au-dessus de tout */
.us-dropdown,
.tab-menu {
  z-index: 5000 !important;
}

/* Empêche le débordement horizontal du body */
html {
  overflow-x: hidden;
}

/* Optimisation des performances pour les animations */
.stat-fill,
.tab-item,
.user-avatar,
.tab-item::before {
  will-change: transform;
}

/* Correction du z-index général */
.user-strip {
  position: relative;
  z-index: 300;
}

.user-status {
  position: relative;
  z-index: 350;
}

/* Assure une bonne apparence sur tous les navigateurs */
.input,
.select,
.textarea,
.btn {
  -webkit-appearance: none;
  -moz-appearance: none;
}

/* Fix pour Safari */
.select:not(.select--nice) {
  background-image: none;
}

/* Empêche la sélection de texte pendant le drag & drop */
.inventory-item[draggable="true"] {
  -webkit-user-select: none;
  -moz-user-select: none;
  user-select: none;
}

/* Amélioration de la lisibilité sur petits écrans */
@media (max-width: 400px) {
  body {
    font-size: 14px;
  }
  
  .section__title {
    font-size: 24px;
  }
  
  .card {
    padding: 12px;
  }
  
  .btn {
    padding: 6px 10px;
    font-size: 10px;
  }
}

/* ===========================
   PRINT STYLES (BONUS)
   =========================== */

@media print {
  .toptabs-header,
  .user-strip,
  .stats-zone,
  .tab-nav,
  .sidebar,
  .btn,
  .actions {
    display: none !important;
  }
  
  body {
    background: white;
    color: black;
  }
  
  .content {
    background: white;
    border: 1px solid #ccc;
    box-shadow: none;
  }
  
  .card {
    border: 1px solid #ccc;
    box-shadow: none;
    page-break-inside: avoid;
  }
  
  a {
    color: black;
    text-decoration: underline;
  }
}

/* ===========================
   DARK MODE SUPPORT (BONUS)
   =========================== */

@media (prefers-color-scheme: dark) {
  /* Le thème est déjà sombre par défaut, pas de changements nécessaires */
}

/* ===========================
   HIGH CONTRAST MODE SUPPORT
   =========================== */

@media (prefers-contrast: high) {
  .card,
  .panel,
  .input,
  .select,
  .btn {
    border-width: 2px;
  }
  
  .tab-item.active {
    border-bottom-width: 4px;
  }
  
  a:focus,
  .btn:focus,
  .input:focus,
  .select:focus {
    outline: 3px solid var(--brand);
    outline-offset: 2px;
  }
}

/* ===========================
   SCROLLBAR PERSONNALISÉ
   =========================== */

/* Firefox */
* {
  scrollbar-width: thin;
  scrollbar-color: rgba(214,181,106,.3) rgba(0,0,0,.2);
}

/* Webkit (Chrome, Safari, Edge) */
::-webkit-scrollbar {
  width: 10px;
  height: 10px;
}

::-webkit-scrollbar-track {
  background: rgba(0,0,0,.2);
  border-radius: 5px;
}

::-webkit-scrollbar-thumb {
  background: rgba(214,181,106,.3);
  border-radius: 5px;
  transition: background .2s ease;
}

::-webkit-scrollbar-thumb:hover {
  background: rgba(214,181,106,.5);
}

::-webkit-scrollbar-thumb:active {
  background: var(--brand);
}

/* Scrollbar pour les conteneurs sombres */
.content--dark::-webkit-scrollbar-track,
.card--dark::-webkit-scrollbar-track {
  background: rgba(255,255,255,.05);
}

/* ===========================
   ACCESSIBILITY IMPROVEMENTS
   =========================== */

/* Focus visible pour la navigation au clavier */
*:focus-visible {
  outline: 2px solid var(--brand);
  outline-offset: 2px;
  border-radius: 4px;
}

/* Amélioration du contraste pour les éléments interactifs */
.btn:focus-visible,
.tab-item:focus-visible,
.input:focus-visible,
.select:focus-visible {
  outline: 3px solid var(--brand);
  outline-offset: 2px;
}

/* Skip to content link (pour accessibilité) */
.skip-to-content {
  position: absolute;
  top: -40px;
  left: 0;
  background: var(--brand);
  color: #000;
  padding: 8px;
  text-decoration: none;
  z-index: 10000;
}

.skip-to-content:focus {
  top: 0;
}

/* Indicateur de chargement accessible */
.loading[aria-busy="true"]::after {
  content: "Chargement en cours...";
  position: absolute;
  left: -9999px;
}

/* ===========================
   UTILITIES SUPPLÉMENTAIRES
   =========================== */

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border-width: 0;
}

.no-scroll {
  overflow: hidden;
}

.pointer-events-none {
  pointer-events: none;
}

.cursor-pointer {
  cursor: pointer;
}

.cursor-not-allowed {
  cursor: not-allowed;
}

/* Animations utilitaires */
.fade-in {
  animation: fadeIn .3s ease-in;
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

.slide-in-up {
  animation: slideInUp .3s ease-out;
}

@keyframes slideInUp {
  from {
    transform: translateY(20px);
    opacity: 0;
  }
  to {
    transform: translateY(0);
    opacity: 1;
  }
}
}

/* ===========================
   OPTIMISATION MOBILE STATS ZONE
   =========================== */

@media (max-width: 768px) {
  .stats-zone {
    padding: 6px 12px 10px;
  }
  
  .stats-grid {
    grid-template-columns: 1fr;
    gap: 6px;
  }
  
  .stat-item {
    gap: 4px;
  }
  
  .stat-header {
    font-size: 10px;
    letter-spacing: .4px;
  }
  
  .stat-name {
    /* Abréviations pour gagner de la place */
  }
  
  .stat-value {
    font-size: 11px;
  }
  
  .stat-track {
    height: 6px;
  }
  
  /* Affichage horizontal compact */
  .stat-item {
    display: grid;
    grid-template-columns: auto 1fr;
    grid-template-rows: auto auto;
    gap: 4px 8px;
    align-items: center;
  }
  
  .stat-header {
    grid-column: 1 / -1;
    grid-row: 1;
  }
  
  .stat-track {
    grid-column: 1 / -1;
    grid-row: 2;
  }
}

@media (max-width: 480px) {
  .stats-zone {
    padding: 4px 8px 8px;
  }
  
  .stats-grid {
    gap: 4px;
  }
  
  .stat-item {
    padding: 4px 8px;
    background: rgba(0,0,0,.15);
    border-radius: 6px;
  }
  
  .stat-header {
    font-size: 9px;
    gap: 4px;
  }
  
  .stat-name {
    max-width: 60px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }
  
  .stat-value {
    font-size: 10px;
    margin-left: auto;
  }
  
  .stat-track {
    height: 5px;
    margin-top: 2px;
  }
  
  .stat-timer {
    display: none !important;
  }
  
  /* Version ultra-compacte : 2 colonnes */
  .stats-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 4px;
  }
}

/* Version alternative : barres en overlay */
@media (max-width: 380px) {
  .stats-zone {
    position: fixed;
    bottom: 60px;
    left: 0;
    right: 0;
    background: linear-gradient(to top, rgba(0,0,0,.95), rgba(0,0,0,.85));
    backdrop-filter: blur(8px);
    border-top: 1px solid rgba(214,181,106,.2);
    border-bottom: none;
    z-index: 150;
    padding: 6px 8px;
  }
  
  .stats-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 3px;
  }
  
  .stat-item {
    padding: 3px 6px;
    min-height: 32px;
  }
  
  .stat-header {
    font-size: 8px;
  }
  
  .stat-value {
    font-size: 9px;
  }
  
  .stat-track {
    height: 4px;
  }
}

@media (max-width: 480px) {
  .stat-name {
    font-size: 0;
    width: 20px;
    height: 20px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
  }
  
  .stat-name::before {
    content: "⚡";
    font-size: 14px;
  }
  
  .stat-item:nth-child(2) .stat-name::before { content: "🎲"; }
  .stat-item:nth-child(3) .stat-name::before { content: "⭐"; }
  .stat-item:nth-child(4) .stat-name::before { content: "❤️"; }
  .stat-item:nth-child(5) .stat-name::before { content: "📈"; }
}

.us-live.us-ev{
  font-weight:800;
  border:1px solid rgba(255,215,0,.45);
  background: linear-gradient(180deg, rgba(255,215,0,.15), rgba(255,215,0,.08));
  box-shadow: 0 0 0 2px rgba(255,215,0,.10) inset, 0 0 12px rgba(255,215,0,.15);
  animation: evPulse 1.8s ease-in-out infinite;
  color: var(--brand);
}

@keyframes evPulse{
  0%,100%{ box-shadow: 0 0 0 2px rgba(255,215,0,.10) inset, 0 0 8px rgba(255,215,0,.12); }
  50%   { box-shadow: 0 0 0 2px rgba(255,215,0,.18) inset, 0 0 16px rgba(255,215,0,.28); }
}

.widget {
  transition: all .2s ease;
  position: relative;
  user-select: none;
}

.widget:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(214,181,106,.3);
}

.widget.dragging {
  opacity: 0.5;
  cursor: grabbing;
}

.widget--compact {
  padding: 14px;
}

.widget-header {
  margin-bottom: 12px;
  padding-bottom: 8px;
  border-bottom: 1px solid rgba(255,255,255,.08);
}

.widget-title {
  font-size: 13px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: .6px;
  color: var(--brand);
  margin: 0;
}

.widget-body {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.stats-mini {
  display: grid;
  grid-template-columns: repeat(1, 1fr);
  gap: 8px;
}

.stat-mini {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 5px 8px;
  background: rgba(0,0,0,.2);
  border-radius: 6px;
  border: 1px solid rgba(255,255,255,.06);
}

.stat-mini__label {
  font-size: 10px;
  color: #999;
  text-transform: uppercase;
  letter-spacing: .3px;
  font-weight: 600;
}

.stat-mini__value {
  font-size: 13px;
  font-weight: 900;
  color: var(--brand);
  font-family: 'Courier New', monospace;
}

.widget-info {
  padding: 10px;
  background: rgba(214,181,106,.08);
  border: 1px solid rgba(214,181,106,.15);
  border-radius: 8px;
}

.widget-info__label {
  font-size: 9px;
  color: #999;
  text-transform: uppercase;
  letter-spacing: .4px;
  margin-bottom: 4px;
  font-weight: 700;
}

.widget-info__value {
  font-size: 13px;
  font-weight: 800;
  color: var(--brand);
  margin-bottom: 2px;
}

.widget-info__meta {
  font-size: 11px;
  color: #bbb;
}

.widget-stats-row {
  display: flex;
  gap: 12px;
  margin-top: 8px;
}

.widget-stat-inline {
  display: flex;
  align-items: center;
  gap: 4px;
  flex: 1;
}

.widget-stat-inline__icon {
  font-size: 14px;
}

.widget-stat-inline__value {
  font-size: 12px;
  font-weight: 700;
  color: #eee;
}

.widget-empty {
  text-align: center;
  padding: 16px 10px;
}

.widget-empty__text {
  font-size: 12px;
  color: #666;
  margin-bottom: 8px;
}

.event-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.event-item {
  padding: 8px;
  background: rgba(0,0,0,.15);
  border-radius: 6px;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 8px;
}

.event-item__text {
  font-size: 11px;
  color: #ddd;
  flex: 1;
  line-height: 1.4;
}

.event-item__time {
  font-size: 10px;
  color: #888;
  font-weight: 600;
  white-space: nowrap;
}

.item-sheet {
  background: linear-gradient(145deg, #1a1a1a, #252525);
  border-radius: 12px;
  padding: 20px;
  margin: 12px;
  border: 2px solid rgba(214,181,106,.25);
}

.item-sheet__header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
  margin-bottom: 20px;
  padding-bottom: 16px;
  border-bottom: 1px solid rgba(255,255,255,.1);
}

.item-sheet__title-group {
  flex: 1;
}

.item-sheet__title {
  margin: 0 0 8px;
  font-size: 20px;
  font-weight: 900;
  color: var(--brand);
  text-shadow: 0 1px 2px rgba(0,0,0,.5);
}

.item-sheet__pills {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.item-pill {
  display: inline-block;
  padding: 4px 10px;
  background: rgba(214,181,106,.12);
  color: var(--brand);
  border-radius: 12px;
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .5px;
  border: 1px solid rgba(214,181,106,.25);
}

.item-pill--weapon {
  background: rgba(239,68,68,.12);
  color: #fca5a5;
  border-color: rgba(239,68,68,.3);
}

.item-pill--armor {
  background: rgba(34,197,94,.12);
  color: #4ade80;
  border-color: rgba(34,197,94,.3);
}

.item-sheet__desc {
  color: #ccc;
  font-style: italic;
  line-height: 1.6;
  font-size: 14px;
  margin: 0 0 20px;
}

.item-sheet__stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 12px;
  margin-bottom: 20px;
}

.item-stat-card {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px;
  background: rgba(0,0,0,.3);
  border-radius: 10px;
  border: 1px solid rgba(255,255,255,.08);
  transition: all .2s ease;
}

.item-stat-card:hover {
  background: rgba(0,0,0,.4);
  border-color: rgba(214,181,106,.2);
  transform: translateY(-1px);
}

.item-stat-card__icon {
  font-size: 24px;
  line-height: 1;
}

.item-stat-card__content {
  flex: 1;
}

.item-stat-card__label {
  font-size: 10px;
  color: #999;
  text-transform: uppercase;
  letter-spacing: .4px;
  font-weight: 600;
  margin-bottom: 3px;
}

.item-stat-card__value {
  font-size: 16px;
  font-weight: 900;
  color: var(--brand);
  font-family: 'Courier New', monospace;
}

.item-sheet__section-title {
  font-size: 13px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: .6px;
  color: var(--brand);
  margin: 0 0 12px;
}

.item-sheet__combat-stats {
  margin-top: 20px;
  padding-top: 20px;
  border-top: 1px solid rgba(255,255,255,.08);
}

.combat-stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: 10px;
}

.combat-stat {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 12px;
  background: rgba(214,181,106,.08);
  border-radius: 8px;
  border: 1px solid rgba(214,181,106,.15);
}

.combat-stat__label {
  font-size: 11px;
  color: #bbb;
  font-weight: 600;
}

.combat-stat__value {
  font-size: 14px;
  font-weight: 900;
  color: var(--brand);
  font-family: 'Courier New', monospace;
}

.item-sheet__footer {
  margin-top: 16px;
  padding-top: 16px;
  border-top: 1px solid rgba(255,255,255,.08);
}

.item-badge--success {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  background: rgba(34,197,94,.12);
  color: #4ade80;
  border-radius: 8px;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .4px;
  border: 1px solid rgba(34,197,94,.25);
}

/* ===========================
   OPTIMISATION MOBILE HEADER
   =========================== */

/* Masquer la barre XP sur mobile */
@media (max-width: 768px) {
  .stats-grid .stat-item:nth-child(5) {
    display: none;
  }
}

/* Réorganisation complète en mobile */
@media (max-width: 768px) {
  .toptabs-header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 200;
  }

  /* User strip ultra compact */
  .user-strip {
    min-height: 52px;
    padding: 6px 12px;
    gap: 8px;
  }

  .user-main {
    flex: 1;
    gap: 8px;
    min-width: 0;
  }

  .user-avatar {
    width: 36px;
    height: 36px;
    font-size: 14px;
    flex-shrink: 0;
  }

  .user-info {
    flex: 1;
    min-width: 0;
    gap: 2px;
  }

  .user-name {
    font-size: 14px;
    line-height: 1.2;
    margin: 0;
  }

  /* Resources en ligne unique et compact */
  .user-resources {
    display: flex;
    gap: 6px;
    font-size: 10px;
    flex-wrap: nowrap;
    overflow-x: auto;
    scrollbar-width: none;
  }

  .user-resources::-webkit-scrollbar {
    display: none;
  }

  .resource-money,
  .resource-crystals,
  .resource-level {
    white-space: nowrap;
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 10px;
  }

  /* Actions utilisateur compactes */
  .user-status {
    margin-right: 0;
    flex-shrink: 0;
  }

  .us-row {
    gap: 4px;
  }

  .us-btn {
    width: 30px;
    height: 28px;
    border-radius: 6px;
  }

  .us-icn {
    font-size: 14px;
  }

  .us-badge {
    top: -4px;
    right: -4px;
    min-width: 14px;
    height: 14px;
    font-size: 9px;
    padding: 0 3px;
  }

  /* Masquer les statuts live sauf événements */
  .us-live.us-jail,
  .us-live.us-hosp {
    display: none;
  }

  .us-live.us-ev {
    font-size: 10px;
    padding: 4px 8px;
    height: 28px;
    gap: 4px;
  }

  /* Stats zone ultra compacte - 2 par ligne */
  .stats-zone {
    padding: 4px 8px 6px;
    border-top: 1px solid rgba(255,255,255,.04);
  }

  .stats-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 6px 8px;
  }

  .stat-item {
    padding: 0;
    gap: 2px;
    background: transparent;
  }

  .stat-header {
    font-size: 9px;
    margin-bottom: 1px;
  }

  .stat-name {
    font-weight: 700;
  }

  .stat-value {
    font-size: 10px;
  }

  .stat-timer {
    display: none !important;
  }

  .stat-track {
    height: 5px;
    border-radius: 3px;
    border: 1px solid rgba(255,255,255,.08);
  }

  /* Navigation par onglets - version hamburger */
  .tab-nav {
    display: none; /* Masqué par défaut, on va créer un menu burger */
  }

  /* Nouveau menu hamburger */
  .mobile-nav-toggle {
    position: fixed;
    bottom: 60px;
    right: 16px;
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--brand), var(--brand-2));
    color: #000;
    border: 3px solid rgba(0,0,0,.3);
    box-shadow: 0 4px 16px rgba(0,0,0,.4), 0 0 0 4px rgba(214,181,106,.2);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    z-index: 999;
    cursor: pointer;
    transition: all .2s ease;
  }

  .mobile-nav-toggle:active {
    transform: scale(0.95);
  }

  .mobile-nav-menu {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(180deg, rgba(24,24,24,.98), rgba(16,16,16,.98));
    backdrop-filter: blur(20px);
    border-top: 2px solid rgba(214,181,106,.4);
    box-shadow: 0 -8px 32px rgba(0,0,0,.6);
    transform: translateY(100%);
    transition: transform .3s cubic-bezier(0.4, 0.0, 0.2, 1);
    z-index: 998;
    max-height: 80vh;
    overflow-y: auto;
    padding: 16px 12px 24px;
  }

  .mobile-nav-menu.is-open {
    transform: translateY(0);
  }

  .mobile-nav-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
    margin-bottom: 16px;
  }

  .mobile-nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 14px 8px;
    background: rgba(255,255,255,.04);
    border: 1px solid rgba(255,255,255,.1);
    border-radius: 12px;
    text-decoration: none;
    color: #ddd;
    font-size: 11px;
    font-weight: 700;
    text-align: center;
    transition: all .2s ease;
  }

  .mobile-nav-item:active {
    transform: scale(0.96);
    background: rgba(214,181,106,.1);
  }

  .mobile-nav-item.active {
    background: linear-gradient(135deg, rgba(214,181,106,.15), rgba(214,181,106,.08));
    border-color: var(--brand);
    color: var(--brand);
  }

  .mobile-nav-icon {
    font-size: 22px;
    line-height: 1;
  }

  .mobile-nav-label {
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: .3px;
  }

  /* Section admin dans le menu mobile */
  .mobile-nav-section {
    margin-top: 16px;
    padding-top: 16px;
    border-top: 1px solid rgba(255,255,255,.1);
  }

  .mobile-nav-section-title {
    font-size: 11px;
    font-weight: 800;
    color: var(--brand);
    text-transform: uppercase;
    letter-spacing: .5px;
    margin: 0 0 12px 8px;
  }

  .mobile-nav-list {
    display: flex;
    flex-direction: column;
    gap: 4px;
  }

  .mobile-nav-link {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    background: rgba(255,255,255,.03);
    border: 1px solid rgba(255,255,255,.08);
    border-radius: 8px;
    text-decoration: none;
    color: #ddd;
    font-size: 13px;
    font-weight: 600;
    transition: all .2s ease;
  }

  .mobile-nav-link:active {
    background: rgba(214,181,106,.1);
    border-color: rgba(214,181,106,.3);
  }

  .mobile-nav-link-icon {
    font-size: 16px;
    width: 20px;
    text-align: center;
  }

  /* Info utilisateur en haut du menu */
  .mobile-nav-user {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px;
    background: linear-gradient(135deg, rgba(214,181,106,.08), rgba(214,181,106,.04));
    border: 1px solid rgba(214,181,106,.2);
    border-radius: 12px;
    margin-bottom: 16px;
  }

  .mobile-nav-user-avatar {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--brand), var(--brand-2));
    color: #000;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 900;
    font-size: 16px;
    border: 2px solid rgba(214,181,106,.4);
    flex-shrink: 0;
  }

  .mobile-nav-user-info {
    flex: 1;
    min-width: 0;
  }

  .mobile-nav-user-name {
    font-size: 14px;
    font-weight: 800;
    color: #fff;
    margin: 0 0 4px;
  }

  .mobile-nav-user-stats {
    display: flex;
    gap: 8px;
    font-size: 11px;
    color: var(--brand);
    font-weight: 700;
  }

  /* Online counter dans le menu mobile */
  .mobile-nav-online {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 8px;
    background: rgba(0,0,0,.2);
    border-radius: 8px;
    font-size: 12px;
    color: #999;
    margin-top: 12px;
  }
}

/* Très petits écrans */
@media (max-width: 480px) {
  .user-strip {
    min-height: 48px;
    padding: 4px 8px;
  }

  .user-avatar {
    width: 32px;
    height: 32px;
    font-size: 13px;
  }

  .user-name {
    font-size: 13px;
  }

  .user-resources {
    gap: 4px;
    font-size: 9px;
  }

  .resource-money,
  .resource-crystals,
  .resource-level {
    padding: 2px 4px;
    font-size: 9px;
  }

  .stats-zone {
    padding: 3px 6px 4px;
  }

  .stats-grid {
    gap: 2px;
  }

  .stat-header {
    font-size: 8px;
  }

  .stat-value {
    font-size: 9px;
  }

  .stat-track {
    height: 4px;
  }

  .mobile-nav-grid {
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
  }

  .mobile-nav-item {
    padding: 12px 6px;
    font-size: 10px;
  }

  .mobile-nav-icon {
    font-size: 20px;
  }
}

/* Version alternative: menu bottom fixe (comme Instagram/TikTok) */
@media (max-width: 768px) {
  .mobile-bottom-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: 60px;
    background: linear-gradient(180deg, rgba(24,24,24,.98), rgba(16,16,16,.98));
    backdrop-filter: blur(16px);
    border-top: 2px solid rgba(214,181,106,.3);
    box-shadow: 0 -4px 16px rgba(0,0,0,.4);
    display: flex;
    align-items: center;
    justify-content: space-around;
    padding: 0 8px;
    z-index: 999;
  }

  .bottom-nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;
    padding: 8px;
    text-decoration: none;
    color: #999;
    font-size: 10px;
    font-weight: 700;
    transition: all .2s ease;
    position: relative;
    flex: 1;
    max-width: 80px;
  }

  .bottom-nav-item.active {
    color: var(--brand);
  }

  .bottom-nav-item.active .bottom-nav-icon {
    transform: scale(1.1);
  }

  .bottom-nav-icon {
    font-size: 24px;
    line-height: 1;
    transition: transform .2s ease;
  }

  .bottom-nav-label {
    font-size: 9px;
    text-transform: uppercase;
    letter-spacing: .3px;
  }

  /* Badge de notification */
  .bottom-nav-badge {
    position: absolute;
    top: 4px;
    right: 12px;
    min-width: 16px;
    height: 16px;
    padding: 0 4px;
    border-radius: 999px;
    background: #ef4444;
    color: #fff;
    font-size: 9px;
    font-weight: 900;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px solid rgba(0,0,0,.3);
  }
}

@media (max-width: 768px) {
  /* Navigation du gang en mode compact */
  .card.card--dark .card__body > div[style*="grid-template-columns"] {
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 8px !important;
  }
  
  /* Masquer les emojis/icônes (premier span) */
  .card.card--dark .btn[style*="flex-direction:column"] > span:first-child {
    display: none;
  }
  
  /* Texte du bouton prend toute la place */
  .card.card--dark .btn[style*="flex-direction:column"] {
    padding: 10px 8px !important;
    justify-content: center;
    gap: 0 !important;
  }
  
  .card.card--dark .btn[style*="flex-direction:column"] > span:last-child {
    font-size: 11px !important;
    font-weight: 800;
    text-align: center;
  }
}

.game-footer {
    background: linear-gradient(180deg, rgba(24,24,24,.96), rgba(12,12,12,.98));
    border-top: 2px solid rgba(214,181,106,.25);
    margin-top: auto;
    padding: 40px 20px 20px;
    position: relative;
    z-index: 1;
}

.game-footer::before {
    content: "";
    position: absolute;
    inset: 0;
    pointer-events: none;
    background: var(--noise);
    opacity: .06;
    mix-blend-mode: soft-light;
}

.footer-content {
    max-width: 1200px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 32px;
    padding-bottom: 32px;
    border-bottom: 1px solid rgba(255,255,255,.08);
}

.footer-section {
    position: relative;
}

.footer-logo-img {
    height: 78px;
    width: auto;
    filter: drop-shadow(0 2px 6px rgba(0,0,0,.4));
    margin-bottom: 12px;
}

.footer-tagline {
    color: #999;
    font-size: 13px;
    line-height: 1.5;
    margin: 0;
}

.footer-title {
    font-size: 12px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: .6px;
    color: var(--brand);
    margin: 0 0 14px;
}

.footer-list {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.footer-link {
    color: #bbb;
    text-decoration: none;
    font-size: 13px;
    font-weight: 600;
    transition: color .2s ease;
    display: inline-block;
}

.footer-link:hover {
    color: var(--brand);
}

.footer-stat {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 6px 0;
    font-size: 12px;
}

.footer-stat-label {
    color: #999;
    font-weight: 600;
}

.footer-stat-value {
    color: var(--brand);
    font-weight: 800;
    font-family: 'Courier New', monospace;
}

.footer-bottom {
    max-width: 1200px;
    margin: 0 auto;
    padding-top: 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 16px;
}

.footer-legal {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.footer-copyright {
    color: #666;
    font-size: 12px;
    margin: 0;
}

.footer-legal-links {
    display: flex;
    gap: 8px;
    align-items: center;
}

.footer-link-small {
    color: #888;
    text-decoration: none;
    font-size: 11px;
    font-weight: 600;
    transition: color .2s ease;
}

.footer-link-small:hover {
    color: var(--brand);
}

.footer-separator {
    color: #444;
    font-size: 11px;
}

.footer-version {
    background: rgba(214,181,106,.08);
    padding: 4px 12px;
    border-radius: 12px;
    border: 1px solid rgba(214,181,106,.2);
}

.footer-version-text {
    color: var(--brand);
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .4px;
}

/* Mobile */
@media (max-width: 768px) {
    .game-footer {
        padding: 32px 16px 16px;
    }

    .footer-content {
        grid-template-columns: 1fr;
        gap: 24px;
        padding-bottom: 24px;
    }

    .footer-bottom {
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
    }

    .footer-legal {
        width: 100%;
    }

    .footer-version {
        align-self: flex-start;
    }
    
    /* Si bottom nav mobile active */
    body.has-bottom-nav .game-footer {
        padding-bottom: 80px;
    }
}

/* ============================================
   COMBAT ARENA - Styles Corruptia
   ============================================ */

.arena-container {
  margin: 0 auto;
  position: relative;
  z-index: 1;
}

/* Header */
.arena-header {
  text-align: center;
  margin-bottom: 30px;
  padding: 24px;
  background: linear-gradient(180deg, rgba(24,24,24,.95), rgba(20,20,20,.85));
  border-radius: var(--radius-big);
  border: 1px solid rgba(214,181,106,.2);
  box-shadow: var(--shadow);
  position: relative;
  overflow: hidden;
}

.arena-title {
  font-weight: 800;
  color: var(--brand);
  margin-bottom: 8px;
  text-transform: uppercase;
  letter-spacing: 2px;
  text-shadow: 0 2px 8px rgba(214,181,106,.4);
}

.vs-subtitle {
  font-size: 1.1em;
  color: #888;
  letter-spacing: 4px;
  text-transform: uppercase;
  font-weight: 600;
}

/* Layout 3 colonnes */
.combat-layout {
  display: grid;
  grid-template-columns: 1fr 2fr 1fr;
  gap: 20px;
  margin-bottom: 24px;
}

/* Cartes joueurs */
.player-card {
  background: linear-gradient(180deg, var(--surface-2), var(--surface-1));
  border-radius: var(--radius-big);
  padding: 24px;
  border: 1px solid rgba(255,255,255,.08);
  box-shadow: var(--shadow);
  transition: all 0.3s ease;
  position: relative;
}

.player-card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, transparent, var(--brand-2), transparent);
  opacity: 0.5;
}

.player-card.attacker {
  border-color: rgba(214,181,106,.3);
}

.player-card.attacker::before {
  background: linear-gradient(90deg, transparent, var(--brand), transparent);
  opacity: 0.8;
}

.player-card.defender {
  border-color: rgba(164,136,79,.3);
}

.player-card.winner {
  border-color: var(--brand);
  box-shadow: 0 0 30px rgba(214,181,106,.4), var(--shadow-heavy);
  animation: winnerGlow 2s ease-in-out infinite;
}

@keyframes winnerGlow {
  0%, 100% { box-shadow: 0 0 20px rgba(214,181,106,.3), var(--shadow); }
  50% { box-shadow: 0 0 40px rgba(214,181,106,.6), var(--shadow-heavy); }
}

.player-avatar {
  width: 110px;
  height: 110px;
  margin: 0 auto 16px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--surface-3), var(--surface-2));
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 3em;
  border: 3px solid var(--brand-2);
  box-shadow: 0 4px 16px rgba(0,0,0,.4), inset 0 2px 8px rgba(214,181,106,.1);
  position: relative;
}

.player-card.attacker .player-avatar {
  border-color: var(--brand);
  box-shadow: 0 4px 20px rgba(214,181,106,.3), inset 0 2px 8px rgba(214,181,106,.15);
}

.player-name {
  text-align: center;
  font-size: 1.4em;
  font-weight: 700;
  margin-bottom: 4px;
  color: var(--paper-0);
}

.player-level {
  text-align: center;
  color: var(--brand);
  font-weight: 600;
  font-size: 0.95em;
  margin-bottom: 16px;
  text-transform: uppercase;
  letter-spacing: 1px;
}

/* Barre HP */
.hp-bar-container {
  background: rgba(0,0,0,.4);
  border-radius: 20px;
  padding: 3px;
  margin-bottom: 20px;
  position: relative;
  height: 28px;
  border: 1px solid rgba(255,255,255,.06);
  overflow: hidden;
}

.hp-bar {
  height: 100%;
  border-radius: 17px;
  background: linear-gradient(90deg, var(--brand), var(--brand-2));
  transition: width 0.8s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  box-shadow: 0 0 10px rgba(214,181,106,.5);
}

.hp-bar::after {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,.3), transparent);
  animation: shimmer 2.5s infinite;
}

@keyframes shimmer {
  0% { left: -100%; }
  100% { left: 200%; }
}

.hp-bar.low {
  background: linear-gradient(90deg, var(--danger), #5a1f22);
}

.hp-bar.medium {
  background: linear-gradient(90deg, var(--warning), #7a5320);
}

.hp-text {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  font-weight: 700;
  font-size: 0.85em;
  color: var(--paper-0);
  text-shadow: 0 1px 4px rgba(0,0,0,.8);
  z-index: 10;
  letter-spacing: 0.5px;
}

/* Stats */
.stats-grid-arena {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
  margin-bottom: 18px;
}

.stat-item-arena {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 12px;
  background: rgba(0,0,0,.3);
  border-radius: 8px;
  border: 1px solid rgba(255,255,255,.06);
}

.stat-icon-arena {
  font-size: 1.2em;
  margin-right: 6px;
}

.stat-label-arena {
  flex: 1;
  font-size: 0.8em;
  color: #999;
  font-weight: 600;
}

.stat-value-arena {
  font-weight: 800;
  color: var(--brand);
  font-family: 'Courier New', monospace;
  font-size: 0.9em;
}

/* Équipement */
.equipment-section {
  border-top: 1px solid rgba(255,255,255,.08);
  padding-top: 14px;
}

.equipment-title {
  font-size: 0.75em;
  color: var(--brand-2);
  margin-bottom: 10px;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  font-weight: 700;
}

.equipment-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.equipment-item {
  background: rgba(0,0,0,.25);
  padding: 8px 10px;
  border-radius: 6px;
  font-size: 0.85em;
  display: flex;
  align-items: center;
  gap: 8px;
  border-left: 3px solid;
  transition: all 0.2s;
}

.equipment-item:hover {
  background: rgba(0,0,0,.35);
  transform: translateX(2px);
}

.equipment-item.legendary { border-left-color: #ff6b6b; }
.equipment-item.epic { border-left-color: #a855f7; }
.equipment-item.rare { border-left-color: var(--brand); }
.equipment-item.uncommon { border-left-color: #60a5fa; }
.equipment-item.common { border-left-color: #6b7280; }

/* Zone de combat centrale */
.combat-zone {
  background: linear-gradient(180deg, rgba(20,20,20,.95), rgba(14,14,14,.95));
  border-radius: var(--radius-big);
  padding: 24px;
  border: 1px solid rgba(214,181,106,.3);
  box-shadow: var(--shadow-heavy);
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.round-indicator {
  text-align: center;
  padding: 14px 20px;
  background: linear-gradient(135deg, var(--brand-2), var(--brand));
  border-radius: var(--radius);
  font-size: 1.2em;
  font-weight: 800;
  letter-spacing: 3px;
  color: var(--ink-0);
  box-shadow: 0 4px 12px rgba(214,181,106,.3);
  text-transform: uppercase;
}

.combat-log {
  flex: 1;
  background: rgba(0,0,0,.5);
  border-radius: var(--radius);
  padding: 16px;
  overflow-y: auto;
  font-family: 'Courier New', monospace;
  font-size: 0.9em;
  border: 1px solid rgba(255,255,255,.05);
}

.combat-log::-webkit-scrollbar {
  width: 6px;
}

.combat-log::-webkit-scrollbar-track {
  background: rgba(0,0,0,.3);
  border-radius: 10px;
}

.combat-log::-webkit-scrollbar-thumb {
  background: var(--brand-2);
  border-radius: 10px;
}

.combat-log::-webkit-scrollbar-thumb:hover {
  background: var(--brand);
}

.log-entry {
  margin-bottom: 10px;
  padding: 10px 12px;
  border-radius: 6px;
  animation: logSlideIn 0.3s ease-out;
}

@keyframes logSlideIn {
  from {
    opacity: 0;
    transform: translateX(-15px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

.log-entry.attack {
  background: rgba(214,181,106,.08);
  border-left-color: var(--brand);
  color: #e8d4a8;
}

.log-entry.defense {
  background: rgba(164,136,79,.08);
  border-left-color: var(--brand-2);
  color: #d4c099;
}

.log-entry.critical {
  background: rgba(214,181,106,.15);
  border-left-color: var(--brand);
  color: var(--brand);
  font-weight: 700;
  box-shadow: 0 0 10px rgba(214,181,106,.2);
}

.log-entry.miss {
  background: rgba(100,100,100,.08);
  border-left-color: #555;
  color: #888;
  opacity: 0.7;
}

.log-entry.info {
  background: rgba(255,255,255,.03);
  border-left-color: #444;
  color: #aaa;
}

/* Contrôles */
.combat-controls {
  display: flex;
  gap: 12px;
  justify-content: center;
  align-items: center;
  padding: 20px;
  background: linear-gradient(180deg, rgba(24,24,24,.95), rgba(20,20,20,.85));
  border-radius: var(--radius-big);
  border: 1px solid rgba(214,181,106,.15);
  box-shadow: var(--shadow);
  flex-wrap: wrap;
}

.speed-controls {
  display: flex;
  gap: 8px;
  align-items: center;
  padding: 8px 16px;
  background: rgba(0,0,0,.3);
  border-radius: var(--radius);
  border: 1px solid rgba(255,255,255,.08);
}

.speed-label {
  color: var(--brand-2);
  font-size: 0.85em;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-right: 6px;
}

.speed-btn {
  padding: 6px 14px;
  background: rgba(255,255,255,.05);
  border: 1px solid rgba(255,255,255,.1);
  color: #aaa;
  border-radius: 6px;
  cursor: pointer;
  font-weight: 600;
  font-size: 0.85em;
  transition: all 0.2s;
}

.speed-btn:hover {
  background: rgba(255,255,255,.1);
  color: var(--paper-0);
}

.speed-btn.active {
  background: linear-gradient(135deg, var(--brand-2), var(--brand));
  border-color: var(--brand);
  color: var(--ink-0);
  box-shadow: 0 2px 8px rgba(214,181,106,.3);
}

/* Résultats */
.results-panel {
  background: linear-gradient(180deg, rgba(24,24,24,.98), rgba(20,20,20,.95));
  border-radius: var(--radius-big);
  padding: 28px;
  margin-top: 24px;
  border: 2px solid var(--brand);
  box-shadow: 0 0 30px rgba(214,181,106,.3), var(--shadow-heavy);
  display: none;
  position: relative;
  overflow: hidden;
}

.results-panel::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, transparent, var(--brand), transparent);
}

.results-panel.show {
  display: block;
  animation: resultsFadeIn 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

@keyframes resultsFadeIn {
  from {
    opacity: 0;
    transform: translateY(30px) scale(0.95);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.result-title {
  text-align: center;
  font-size: 2.2em;
  font-weight: 800;
  margin-bottom: 24px;
  text-transform: uppercase;
  letter-spacing: 3px;
}

.result-title.victory {
  color: var(--brand);
  text-shadow: 0 0 20px rgba(214,181,106,.6), 0 2px 4px rgba(0,0,0,.5);
}

.result-title.defeat {
  color: var(--danger);
  text-shadow: 0 0 20px rgba(122,46,50,.6), 0 2px 4px rgba(0,0,0,.5);
}

.rewards-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  margin-bottom: 20px;
}

.reward-item {
  background: rgba(0,0,0,.4);
  padding: 20px;
  border-radius: var(--radius);
  text-align: center;
  border: 1px solid rgba(255,255,255,.08);
  transition: all 0.3s;
}

.reward-item:hover {
  border-color: var(--brand-2);
  background: rgba(0,0,0,.5);
  transform: translateY(-2px);
}

.reward-icon {
  font-size: 2.2em;
  margin-bottom: 10px;
}

.reward-label {
  color: #888;
  font-size: 0.8em;
  margin-bottom: 6px;
  text-transform: uppercase;
  letter-spacing: 1px;
  font-weight: 600;
}

.reward-value {
  font-size: 1.6em;
  font-weight: 800;
  color: var(--brand);
  font-family: 'Courier New', monospace;
}

.hospital-info {
  text-align: center;
  padding: 18px;
  background: rgba(122,46,50,.15);
  border-radius: var(--radius);
  margin-top: 16px;
  border: 1px solid rgba(122,46,50,.3);
}

.hospital-label {
  color: #999;
  margin-bottom: 6px;
  font-size: 0.9em;
}

.hospital-time {
  font-size: 1.4em;
  font-weight: 800;
  color: var(--danger);
  font-family: 'Courier New', monospace;
}

/* Alerts */
.alert {
  padding: 16px 20px;
  border-radius: var(--radius);
  margin-bottom: 20px;
  border: 1px solid;
  font-size: 0.95em;
}

.alert--danger {
  background: rgba(122,46,50,.15);
  border-color: rgba(122,46,50,.4);
  color: #ff9999;
}

.alert strong {
  font-weight: 700;
  color: var(--danger);
}

/* Responsive */
@media (max-width: 1200px) {
  .combat-layout {
    grid-template-columns: 1fr;
  }
  
  .rewards-grid {
    grid-template-columns: 1fr;
  }
  
  .arena-title {
    font-size: 2em;
  }
}

@media (max-width: 768px) {
  .arena-title {
    font-size: 1.6em;
  }
  
  .vs-subtitle {
    font-size: 0.9em;
  }
  
  .stats-grid {
    grid-template-columns: 1fr;
  }

  .combat-controls {
    flex-direction: column;
  }
  
  .player-avatar {
    width: 90px;
    height: 90px;
    font-size: 2.5em;
  }
  
  .combat-log {
    max-height: 300px;
    font-size: 0.85em;
  }
}

.player-avatar { width: 64px; height: 64px; border-radius: 50%; background: linear-gradient(135deg, var(--brand), var(--brand-2)); display: flex; align-items: center; justify-content: center; font-size: 24px; border: 2px solid rgba(214,181,106,.4); }

/* TAILLE DE LA CARTE - Agrandie */
.map-viewport {
    position: relative;
    height: 80vh;
    border-radius: var(--radius);
    overflow: hidden;
    border: 2px solid var(--bd);
    box-shadow: inset 0 0 20px rgba(0,0,0,.3), var(--shadow);
    background: #0a0a14;
}

.map-canvas {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0.85); /* Augmenté de 0.65 à 0.95 */
    width: 1800px;
    height: 1200px;
    background: linear-gradient(0deg, rgba(40,40,40,0.1) 1px, transparent 1px),
                linear-gradient(90deg, rgba(40,40,40,0.1) 1px, transparent 1px);
    background-size: 60px 60px;
    transition: filter 2s ease;
}

.map-canvas.night { filter: brightness(0.4); }
.map-canvas.day { filter: brightness(1.1); }


.map-canvas {
    background-image: url('/assets/maps/city_map.png');
    background-size: cover;
    background-position: center;
}


.income-badge {
    background: rgba(0,0,0,0.8);
    padding: 3px 6px;
    border-radius: 4px;
    border: 1px solid rgba(255,255,255,0.1);
}

.income-money { color: #4ade80; }
.income-crystals { color: #a78bfa; }

/* Districts existants - niveau inférieur */
.district {
    position: absolute;
    border: 2px dashed rgba(212,175,55,0.15);
    border-radius: var(--radius);
    background: rgba(212,175,55,0.03);
    pointer-events: all;
    transition: all 0.3s ease;
    cursor: pointer;
    z-index: 1;
}

.district:hover {
    border-color: rgba(212,175,55,0.3);
    background: rgba(212,175,55,0.06);
}

.district-label {
    position: absolute;
    top: 10px;
    left: 10px;
    font-size: 1rem;
    font-weight: 700;
    color: rgba(212,175,55,0.4);
    text-transform: uppercase;
    letter-spacing: 2px;
    pointer-events: none;
    text-shadow: 0 2px 4px rgba(0,0,0,0.8);
}

/* Reste du CSS existant... */
.road { position: absolute; background: rgba(80,80,80,0.3); border: 1px solid rgba(100,100,100,0.2); box-shadow: inset 0 0 20px rgba(0,0,0,0.5); z-index: 1; }
.road.horizontal { height: 40px; }
.road.vertical { width: 40px; }
.road::after { content: ''; position: absolute; background: repeating-linear-gradient(90deg, var(--brand) 0px, var(--brand) 20px, transparent 20px, transparent 40px); height: 2px; width: 100%; top: 50%; transform: translateY(-50%); opacity: 0.3; }
.road.vertical::after { background: repeating-linear-gradient(0deg, var(--brand) 0px, var(--brand) 20px, transparent 20px, transparent 40px); width: 2px; height: 100%; left: 50%;}

.streetlight { position: absolute; width: 6px; height: 50px; background: linear-gradient(to bottom, #555, #333); z-index: 8; }
.streetlight::before { content: ''; position: absolute; top: -15px; left: 50%; transform: translateX(-50%); width: 15px; height: 15px; background: var(--brand); border-radius: 50%; box-shadow: 0 0 30px rgba(214,181,106,0.8); opacity: 0; transition: opacity 2s; }
.map-canvas.night .streetlight::before { opacity: 1; }
.streetlight::after { content: ''; position: absolute; top: 0; left: 50%; transform: translateX(-50%); width: 100px; height: 100px; background: radial-gradient(circle, rgba(214,181,106,0.3) 0%, transparent 70%); opacity: 0; transition: opacity 2s; pointer-events: none; }
.map-canvas.night .streetlight::after { opacity: 1; }

.map-building { position: absolute; width: 120px; height: 120px; background: linear-gradient(135deg, var(--surface-2), var(--surface-3)); border: 3px solid var(--brand); border-radius: var(--radius); cursor: pointer; transition: all 0.3s ease; display: flex; flex-direction: column; align-items: center; justify-content: center; box-shadow: var(--shadow-heavy), 0 0 20px rgba(214,181,106,0.3); z-index: 250; }
.map-building::after { content: ''; position: absolute; top: 20%; left: 15%; width: 70%; height: 60%; background: repeating-linear-gradient(0deg, transparent 0, transparent 15px, rgba(255,215,0,0.3) 15px, rgba(255,215,0,0.3) 18px), repeating-linear-gradient(90deg, transparent 0, transparent 15px, rgba(255,215,0,0.3) 15px, rgba(255,215,0,0.3) 18px); opacity: 0; transition: opacity 2s; pointer-events: none; z-index: -1; }
.map-canvas.night .map-building::after { opacity: 1; }
.map-building:hover::before { opacity: 1; }
.map-building:hover { transform: scale(1.15) translateY(-5px); border-color: #ffd700; box-shadow: 0 20px 50px rgba(214,181,106,0.6), 0 0 40px rgba(214,181,106,0.5); z-index: 100; }
.map-building-icon { font-size: 2.5rem; margin-bottom: 5px; filter: drop-shadow(0 2px 5px rgba(0,0,0,0.8)); position: relative; z-index: 2; pointer-events: none; }
.map-building-name { font-size: 0.75rem; text-align: center; color: var(--brand); font-weight: 800; text-shadow: 0 1px 3px rgba(0,0,0,0.8); padding: 0 5px; position: relative; z-index: 2; letter-spacing: 0.5px; pointer-events: none; }
.map-building-badge { position: absolute; top: -10px; right: -10px; background: linear-gradient(135deg, var(--danger), #a5424a); color: white; border-radius: 50%; width: 28px; height: 28px; display: flex; align-items: center; justify-content: center; font-size: 0.7rem; font-weight: 900; box-shadow: 0 0 15px rgba(220,20,60,0.8); animation: mapPulse 2s ease-in-out infinite; z-index: 3; pointer-events: none; }
@keyframes mapPulse { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.15); } }
.map-building.gang-hq { width: 180px; height: 180px; background: linear-gradient(135deg, rgba(139,0,0,0.4), var(--surface-3)); border-color: #8b0000; border-width: 4px; z-index: 60; }
.map-building.gang-hq .map-building-icon { font-size: 4rem; }
.map-building.gang-hq:hover { border-color: #ff0000; box-shadow: 0 20px 60px rgba(139,0,0,0.8), 0 0 50px rgba(255,0,0,0.6); }

.map-entity { position: absolute; font-size: 1.2rem; z-index: 9; filter: drop-shadow(0 2px 3px rgba(0,0,0,0.5)); transform: scaleX(-1); pointer-events: none; }
.map-entity.car { font-size: 1.5rem; animation: entityDrive linear infinite; z-index: 5; }
@keyframes entityDrive { 0% { left: -50px; } 100% { left: 1850px; } }
.map-entity.police-car { font-size: 1.5rem; z-index: 15; }
.map-entity.police-car::after { content: ''; position: absolute; top: -5px; right: 15px; width: 10px; height: 10px; border-radius: 50%; background: #dc143c; box-shadow: 0 0 15px rgba(220,20,60,0.9); animation: policeSiren 0.5s ease-in-out infinite alternate; }
@keyframes policeSiren { 0% { background: #dc143c; box-shadow: 0 0 15px rgba(220,20,60,0.9); } 100% { background: #1e90ff; box-shadow: 0 0 15px rgba(30,144,255,0.9); } }
.map-entity.helicopter { font-size: 2rem; z-index: 20; animation: entityFly 60s linear infinite; }
@keyframes entityFly { 0% { left: -100px; top: 100px; transform: scaleX(-1); } 25% { left: 50%; top: 150px; transform: scaleX(-1); } 50% { left: 1900px; top: 200px; transform: scaleX(1); } 75% { left: 50%; top: 250px; transform: scaleX(1); } 100% { left: -100px; top: 100px; transform: scaleX(-1); } }
.map-entity.helicopter::before { content: ''; position: absolute; top: 100%; left: 50%; transform: translateX(-50%); width: 150px; height: 400px; background: linear-gradient(to bottom, rgba(255,255,220,0.3) 0%, rgba(255,255,220,0.1) 50%, transparent 100%); clip-path: polygon(40% 0%, 60% 0%, 100% 100%, 0% 100%); opacity: 0; transition: opacity 2s; pointer-events: none; }
.map-canvas.night .map-entity.helicopter::before { opacity: 1; }
.map-entity.car::before { content: ''; position: absolute; right: 100%; top: 50%; transform: translateY(-50%) scaleX(-1); width: 80px; height: 40px; background: radial-gradient(ellipse at left, rgba(255,255,200,0.4) 0%, transparent 70%); opacity: 0; transition: opacity 2s; pointer-events: none; }
.map-canvas.night .map-entity.car::before { opacity: 1; }

@media (max-width: 1200px) { .map-canvas { transform: translate(-50%, -50%) scale(0.5); } }
@media (max-width: 768px) { .map-viewport { height: 60vh; } .map-canvas { transform: translate(-50%, -50%) scale(0.35); } }

/* Zones de territoires - Version améliorée avec quadrillage */
.territory-zone {
    position: absolute;
    border: 3px solid;
    border-radius: var(--radius-big);
    transition: all 0.3s ease;
    cursor: pointer;
    z-index: 2;
    background-image: 
        /* Quadrillage fin */
        repeating-linear-gradient(0deg, 
            transparent 0px, 
            transparent 19px, 
            rgba(255,255,255,0.08) 19px, 
            rgba(255,255,255,0.08) 20px
        ),
        repeating-linear-gradient(90deg, 
            transparent 0px, 
            transparent 19px, 
            rgba(255,255,255,0.08) 19px, 
            rgba(255,255,255,0.08) 20px
        );
    background-size: 20px 20px;
}

/* Zone neutre - VISIBLE */
.territory-zone.neutral {
    border-color: rgba(214,181,106,0.5);
    background-color: rgba(40,40,50,0.3);
    border-style: dashed;
    box-shadow: inset 0 0 30px rgba(0,0,0,0.3);
}

.territory-zone.neutral:hover {
    border-color: rgba(214,181,106,0.8);
    background-color: rgba(40,40,50,0.4);
}

/* Zone contrôlée */
.territory-zone.controlled {
    border-style: solid;
    background-color: rgba(50,205,50,0.15);
    border-color: rgba(50,205,50,0.7);
    box-shadow: inset 0 0 30px rgba(50,205,50,0.1), 0 0 20px rgba(50,205,50,0.3);
}

/* Zone contestée */
.territory-zone.contested {
    border-style: double;
    border-width: 4px;
    background-color: rgba(220,20,60,0.15);
    border-color: rgba(220,20,60,0.7);
    animation: territoryContest 2s ease-in-out infinite;
    box-shadow: inset 0 0 30px rgba(220,20,60,0.1), 0 0 20px rgba(220,20,60,0.3);
}

@keyframes territoryContest {
    0%, 100% { 
        opacity: 0.8; 
        transform: scale(1);
        box-shadow: inset 0 0 30px rgba(220,20,60,0.1), 0 0 20px rgba(220,20,60,0.3);
    }
    50% { 
        opacity: 1; 
        transform: scale(1.01);
        box-shadow: inset 0 0 40px rgba(220,20,60,0.2), 0 0 30px rgba(220,20,60,0.5);
    }
}

/* Zone possédée par l'utilisateur */
.territory-zone.owned-by-user {
    background-color: rgba(214,181,106,0.2);
    border-color: var(--brand);
    border-width: 4px;
    box-shadow: inset 0 0 40px rgba(214,181,106,0.15), 0 0 30px rgba(214,181,106,0.4);
}

.territory-zone:hover {
    transform: scale(1.03);
    z-index: 8;
    border-width: 4px;
}

.territory-zone.neutral:hover {
    box-shadow: inset 0 0 40px rgba(214,181,106,0.2), 0 0 30px rgba(214,181,106,0.4);
}

.territory-zone.controlled:hover {
    box-shadow: inset 0 0 40px rgba(50,205,50,0.2), 0 0 30px rgba(50,205,50,0.5);
}

.territory-zone.contested:hover {
    box-shadow: inset 0 0 50px rgba(220,20,60,0.3), 0 0 40px rgba(220,20,60,0.6);
}

.territory-zone.owned-by-user:hover {
    box-shadow: inset 0 0 50px rgba(214,181,106,0.3), 0 0 40px rgba(214,181,106,0.6);
}

/* Labels des zones */
.territory-label {
    position: absolute;
    top: 8px;
    left: 8px;
    font-size: 0.85rem;
    font-weight: 800;
    color: var(--brand);
    text-transform: uppercase;
    letter-spacing: 1px;
    pointer-events: none;
    text-shadow: 0 2px 8px rgba(0,0,0,1);
    background: rgba(0,0,0,0.85);
    padding: 6px 12px;
    border-radius: 6px;
    border: 2px solid rgba(214,181,106,0.3);
    white-space: nowrap;
    display: flex;
    align-items: center;
}

.territory-owner {
    position: absolute;
    bottom: 8px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0,0,0,0.9);
    border: 2px solid;
    border-radius: 8px;
    padding: 6px 12px;
    font-size: 0.75rem;
    pointer-events: none;
    font-weight: 700;
    white-space: nowrap;
    box-shadow: 0 4px 12px rgba(0,0,0,0.5);
}

.territory-owner.neutral { 
    border-color: rgba(214,181,106,0.5); 
    color: #d6b56a; 
}

.territory-owner.controlled { 
    border-color: rgba(50,205,50,0.7); 
    color: #4ade80; 
    box-shadow: 0 0 15px rgba(50,205,50,0.4);
}

.territory-owner.contested { 
    border-color: rgba(220,20,60,0.7); 
    color: #ff6b6b;
    box-shadow: 0 0 15px rgba(220,20,60,0.4);
}

.territory-income {
    position: absolute;
    top: 8px;
    right: 8px;
    display: flex;
    flex-direction: column;
    gap: 4px;
    font-size: 0.7rem;
    font-weight: 700;
    pointer-events: none;
}

.income-badge {
    background: rgba(0,0,0,0.9);
    padding: 4px 8px;
    border-radius: 6px;
    border: 1px solid rgba(255,255,255,0.2);
    white-space: nowrap;
    box-shadow: 0 2px 8px rgba(0,0,0,0.5);
}

.income-money { 
    color: #4ade80; 
    border-color: rgba(50,205,50,0.4);
}

.income-crystals { 
    color: #a78bfa;
    border-color: rgba(167,139,250,0.4);
}

.suggestion-item {
    padding: 12px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 12px;
    transition: background .2s;
    border-bottom: 1px solid rgba(255,255,255,.05);
}
.suggestion-item:hover { background: var(--surface-2); }
.suggestion-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid var(--brand-2);
}
.suggestion-placeholder {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: var(--brand);
    color: #000;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
}

/* ===== Pagination – thème Corruptia ===== */
.pagination{
  display:flex; align-items:center; justify-content:center; gap:.5rem;
  padding:.75rem; flex-wrap:wrap;
}

.page-btn, .page-ellipsis{
  display:inline-flex; align-items:center; justify-content:center;
  min-width: 40px; height: 40px; padding: 0 .9rem;
  background: var(--btn-dark-bg);
  color: var(--ink-inv); text-decoration:none; font-weight:600;
  border:1px solid var(--btn-dark-bd);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  transition: transform .12s ease, box-shadow .12s ease, border-color .12s ease, background .12s ease;
}

.page-btn:hover{
  transform: translateY(-1px);
  border-color: var(--ring);
  background: linear-gradient(180deg, var(--surface-2), var(--surface-3));
}

.page-btn:focus-visible{
  outline:0; box-shadow: 0 0 0 3px var(--ring);
}

.page-btn.is-active, .page-btn[aria-current="page"]{
  background: linear-gradient(180deg, var(--brand), var(--brand-2));
  border-color: var(--brand-2);
  color: #111; /* bon contraste sur l’or */
  text-shadow: 0 1px 0 rgba(255,255,255,.25);
}

.page-btn.is-disabled{
  opacity:.45; cursor:not-allowed; pointer-events:none;
}

.page-btn.page-btn--nav{
  min-width: 40px; padding: 0 .6rem;
}

.page-ellipsis{
  min-width:auto; padding:0 .35rem; border-color: transparent; background: transparent; box-shadow:none;
  color: var(--ink-2);
}

/* Mobile : boutons plus compacts */
@media (max-width:480px){
  .page-btn, .page-ellipsis{ min-width:36px; height:36px; padding:0 .6rem; font-weight:600; }
}

.table-wrap { position: relative; }
.table-wrap.is-loading::after{
  content:"Chargement…";
  position:absolute; inset:0; display:flex; align-items:center; justify-content:center;
  background: rgba(0,0,0,.35);
  color: var(--ink-inv); font-weight:700; letter-spacing:.3px;
  backdrop-filter: blur(2px);
  border-radius: var(--radius);
}

.mobile-nav-user { display:flex; gap:12px; align-items:center; padding:12px; }
.mobile-nav-user-avatar{
  width:56px; height:56px; border-radius:50%;
  position:relative; overflow:hidden;
  border:1px solid var(--bd);
  background: linear-gradient(180deg, var(--brand), var(--brand-2));
  box-shadow: var(--shadow);
}
.mobile-nav-user-avatar img.mobile-avatar-img{
  width:100%; height:100%; object-fit:cover; display:block;
}
.mobile-avatar-fallback{
  position:absolute; inset:0; display:flex; align-items:center; justify-content:center;
  font-weight:800; font-size:20px; color:#111; user-select:none;
}
.mobile-nav-user-name{ font-weight:700; color:var(--ink-inv); }
.mobile-nav-user-stats{ color:var(--ink-2); font-size:12px; }

.dr-day {
  background: var(--surface-2);
  border: 1px solid rgba(214, 181, 106, 0.15);
  border-radius: 8px;
  padding: 8px;
  text-align: center;
  transition: all 0.2s;
}
.dr-day.claimed {
  background: var(--success);
  border-color: var(--ok);
}
.dr-day.today {
  border: 2px solid var(--brand);
  background: rgba(214, 181, 106, 0.08);
}
.dr-day-label {
  font-size: 11px;
  color: var(--ink-2);
  margin-bottom: 4px;
  text-transform: uppercase;
}
.dr-day-status {
  font-size: 20px;
  color: var(--ink);
}
.dr-day.claimed .dr-day-status {
  color: var(--ok);
}
@keyframes drClaim {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.05); }
}
.claiming { animation: drClaim 0.5s ease-in-out 3; }

.fc{
  --fc-border-color: var(--bd);
  --fc-page-bg-color: transparent;
}
.fc .fc-daygrid-day-number,
.fc .fc-col-header-cell-cushion{
  color: var(--ink);
}
.fc .fc-toolbar-title{
  color: var(--ink);
  font-weight: 800;
}
.fc .fc-button:focus{ outline: none; box-shadow: 0 0 0 2px var(--brand); }
.fc-theme-standard .fc-scrollgrid{
  background: var(--surface-1);
  border: 1px solid var(--bd);
  border-radius: 10px;
  overflow: hidden;
}

.stat-item { position: relative; }

/* Bulle + durée ~1.6s, alignée au thème */
.res-delta {
  pointer-events: none;
  user-select: none;
  font-weight: 800;
  font-size: 12px;
  line-height: 1;
  padding: 2px 6px;
  border-radius: 999px;

  /* Fallback → puis version mixée si dispo */
  background: var(--delta-bg-neutral);
  background: var(--delta-bg-neutral-mixed);

  color: var(--delta-txt);
  border: 1px solid var(--delta-bd);
  box-shadow: var(--delta-shadow);

  opacity: 0;
  animation: resFloat 1.6s ease-out forwards;
  z-index: 5;
}

/* Etats (up/down) – on applique d’abord la couleur pleine,
   puis la version “mixée” (avec transparence) */
.res-delta.up {
  background: var(--delta-bg-up);
  background: var(--delta-bg-up-mixed);
}
.res-delta.down {
  background: var(--delta-bg-down);
  background: var(--delta-bg-down-mixed);
}

/* Keyframes inchangées (peuvent aussi lire des vars si tu veux) */
@keyframes resFloat {
  0%   { opacity: 0; transform: translateY(0); }
  10%  { opacity: 1; transform: translateY(-6px); }
  70%  { opacity: 1; transform: translateY(-10px); }
  100% { opacity: 0; transform: translateY(-26px); }
}

/* Ancrage propre sur tes spans ressources */
.resource-money,
.resource-crystals,
.resource-level { position: relative; display: inline-flex; align-items: center; gap: .25rem; }

.resource-money .res-label,
.resource-crystals .res-label,
.resource-level .res-label { display: inline-block; }

/* (optionnel) pour les jauges si tu unifies avec statDelta() */
.stat-item { position: relative; }

/* Accessibilité: respecte la préférence de mouvement réduit */
@media (prefers-reduced-motion: reduce) {
  .res-delta { animation-duration: 0.8s; transform: none; }
  @keyframes resFloat {
    0%   { opacity: 0; transform: none; }
    50%  { opacity: 1; transform: none; }
    100% { opacity: 0; transform: none; }
  }
}

/* === Sticky footer global (fin du fichier) === */

/* 1) Le viewport doit offrir de la hauteur */
html, body {
  min-height: 100dvh;   /* mieux que 100vh sur mobile */
}

/* 2) Layout colonne sur le body */
body {
  display: flex;
  flex-direction: column;
  /* garde ton gap si tu veux un espace entre contenu et footer */
  gap: 10px;
}

/* 4) Pas d'auto-marge sur le footer si tu en avais ailleurs */
.game-footer {
  margin-top: 0;   /* important si tu avais tenté margin-top:auto */
}


/* ========================================
   CHAT DOCK - Design Moderne Corruptia
   ======================================== */

/* --- Variables --- */
:root {
  --chat-bg: linear-gradient(180deg, rgba(20,20,20,.98), rgba(14,14,14,.95));
  --chat-border: rgba(214,181,106,.3);
  --chat-surface: rgba(30,30,30,.95);
  --chat-hover: rgba(255,255,255,.05);
  --chat-brand: #d6b56a;
  --chat-text: #e8e8e8;
  --chat-text-muted: #999;
  --chat-bubble-other: rgba(40,40,40,.95);
  --chat-bubble-mine: rgba(53,89,209,.25);
  --chat-shadow: 0 8px 32px rgba(0,0,0,.6);
}

/* --- Container Principal --- */
.chatdock {
  position: fixed;
  bottom: 20px;
  right: 20px;
  z-index: 500;
  font-family: system-ui, -apple-system, sans-serif;
  max-width: 720px;
  width: auto; /* Changé */
}

/* --- Barre Minimisée (état replié) --- */
/* Place le bouton du chat exactement comme le menu hamburger */
.chatdock__minimized{
  position: fixed;
  bottom: 40px;
  right: 16px;
  z-index: 99; /* au-dessus du reste */
}

/* Bouton chat = même look & feel que .mobile-nav-toggle */
.chatdock__mini-btn{
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--brand), var(--brand-2));
  color: #000; /* icône noire comme le menu */
  border: 3px solid rgba(0,0,0,.3);
  box-shadow: 0 4px 16px rgba(0,0,0,.4), 0 0 0 4px rgba(214,181,106,.2);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px; /* même taille d’icône */
  cursor: pointer;
  transition: all .2s ease;
  position: relative;
}

/* Effets identiques */
.chatdock__mini-btn:active{
  transform: scale(0.95);
}

/* Icône et badge adaptés au fond clair */
.chat-icon{ color: #000; line-height: 1; }

.chat-unread-badge{
  position: absolute;
  top: -6px;
  right: -6px;
  min-width: 22px;
  height: 22px;
  padding: 0 6px;
  border-radius: 999px;
  background: #000;           /* contraste sur gradient clair */
  color: #ffd976;             /* ton doré */
  font-size: 12px;
  font-weight: 700;
  display: grid;
  place-items: center;
  box-shadow: 0 2px 8px rgba(0,0,0,.45);
}

/* Accessibilité focus */
.chatdock__mini-btn:focus-visible{
  outline: none;
  box-shadow: 0 0 0 3px #000, 0 0 0 6px rgba(214,181,106,.5);
}

@keyframes badgePulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.1); }
}

/* Quand le chat est ouvert, cacher le bouton */
.chatdock__panel:not([hidden]) ~ .chatdock__minimized {
  display: none !important;
}

/* --- Panel Principal --- */
.chatdock__panel {
  position: fixed; /* Changé */
  bottom: 20px;
  right: 20px;
  width: 720px;
  max-width: calc(100vw - 40px);
  background: var(--chat-bg);
  border: 2px solid var(--chat-border);
  border-radius: 16px;
  box-shadow: var(--chat-shadow);
  backdrop-filter: blur(16px);
  display: flex;
  flex-direction: column;
  max-height: 800px;
  height: 70vh;
  z-index: 501;
  animation: chatSlideUp .3s cubic-bezier(0.4, 0, 0.2, 1);
}

@keyframes chatSlideUp {
  from {
    opacity: 0;
    transform: translateY(20px) scale(0.95);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes badgePulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.1); }
}

.chatdock--open .chatdock__minimized {
  display: none;
}

/* --- Header --- */
.chatdock__header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 20px;
  border-bottom: 1px solid rgba(255,255,255,.08);
  background: linear-gradient(180deg, rgba(255,255,255,.02), transparent);
}

.chatdock__header-left {
  display: flex;
  align-items: center;
  gap: 16px;
  flex: 1;
}

.chatdock__title {
  margin: 0;
  font-size: 18px;
  font-weight: 800;
  color: var(--chat-brand);
  letter-spacing: .5px;
}

.chatdock__online {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  color: var(--chat-text-muted);
  font-weight: 600;
}

.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #22c55e;
  animation: statusPulse 2s ease-in-out infinite;
}

@keyframes statusPulse {
  0%, 100% { opacity: 1; }
  50% { opacity: .5; }
}

/* Header actions */
.chatdock__header-right{display:flex;gap:8px}
.chatdock__header-btn{
  width:32px;height:32px;border-radius:8px;
  background:rgba(255,255,255,.05);border:1px solid rgba(255,255,255,.1);
  color:var(--chat-text);display:flex;align-items:center;justify-content:center;
  cursor:pointer;transition:.2s;font-size:14px;font-weight:700
}
.chatdock__header-btn:hover{background:rgba(255,255,255,.1);border-color:var(--chat-brand)}

/* Tabs */
.chatdock__tabs{display:flex;gap:8px;padding:12px 16px;border-bottom:1px solid rgba(255,255,255,.05);overflow-x:auto;scrollbar-width:none}
.chatdock__tabs::-webkit-scrollbar{display:none}
.chatdock__tab{
  padding:8px 16px;border-radius:10px;background:rgba(255,255,255,.04);
  border:1px solid rgba(255,255,255,.06);color:var(--chat-text-muted);
  font-weight:700;font-size:13px;cursor:pointer;transition:.2s;white-space:nowrap;display:flex;align-items:center;gap:6px;position:relative
}
.chatdock__tab:hover{background:rgba(255,255,255,.08);border-color:rgba(255,255,255,.15);color:var(--chat-text)}
.chatdock__tab.is-active{
  background:linear-gradient(135deg, rgba(214,181,106,.2), rgba(214,181,106,.1));
  border-color:var(--chat-brand);color:var(--chat-brand);box-shadow:inset 0 0 0 1px rgba(214,181,106,.2)
}
.chatdock__tab-badge{
  background:linear-gradient(135deg,#ef4444,#dc2626);color:#fff;font-size:10px;font-weight:900;
  padding:2px 6px;border-radius:10px;min-width:18px;text-align:center
}

/* Messages wrapper + scrollbars */
.chatdock__messages-wrapper{flex:1;display:flex;flex-direction:column;overflow:hidden;position:relative}
.chatdock__messages{flex:1;overflow-y:auto;padding:16px;display:block; /* mono-colonne */ }
.chatdock__messages::-webkit-scrollbar{width:6px}
.chatdock__messages::-webkit-scrollbar-track{background:transparent}
.chatdock__messages::-webkit-scrollbar-thumb{background:rgba(214,181,106,.3);border-radius:3px}
.chatdock__messages::-webkit-scrollbar-thumb:hover{background:rgba(214,181,106,.5)}
/* Firefox */
.chatdock__messages{scrollbar-width:thin;scrollbar-color:rgba(214,181,106,.3) transparent}

/* Séparateur de date (une seule version) */
.chatdock__date-separator{
  display:flex;align-items:center;justify-content:center;margin:16px 0;position:relative
}
.chatdock__date-separator::before,
.chatdock__date-separator::after{
  content:'';flex:1;height:1px;background:linear-gradient(to right,transparent,rgba(255,255,255,.1),transparent)
}
.chatdock__date-separator span{
  padding:4px 12px;font-size:11px;font-weight:700;color:var(--chat-text-muted);
  text-transform:uppercase;letter-spacing:.5px;background:var(--chat-surface);
  border-radius:12px;border:1px solid rgba(255,255,255,.06)
}

/* Message compact aligné à gauche */
.chatmsg{
  display:block;padding:6px 10px;margin:2px 0;border-radius:8px;background:var(--card,#121316);
  opacity:0;transform:translateY(4px);transition:opacity .16s, transform .16s, background .2s
}
.chatmsg--visible{opacity:1;transform:none}
.chatmsg__line{display:block;line-height:1.35;overflow-wrap:anywhere;color:var(--ink,#d9dee3);font-size:.95rem}
.chatmsg__del{
  appearance:none;border:0;background:transparent;cursor:pointer;font-weight:700;margin-right:8px;
  opacity:.7;color:var(--brand)
}
.chatmsg__del:hover{opacity:1}
.chatmsg__time{color:var(--ink-2,#9aa3ad);margin-right:6px;font-size:11px;font-weight:500}
.chatmsg__user{font-weight:600;margin-right:6px}
.chatmsg__userlink{font-weight:600;margin-right:6px;color:var(--ink,#d9dee3);text-decoration:none}
.chatmsg__userlink:hover{text-decoration:underline}
.chatmsg__content{color:var(--chat-text);line-height:1.5;font-size:14px}
.chatmsg__content a{color:var(--chat-brand);text-decoration:underline}

/* Badge “nouveaux messages” */
.chatdock__new{position:absolute;bottom:8px;left:50%;transform:translateX(-50%);z-index:10}
.chatdock__new button{
  background:linear-gradient(135deg,var(--chat-brand),rgba(164,136,79,.9));color:#111;border:2px solid rgba(0,0,0,.3);
  padding:8px 16px;border-radius:20px;font-weight:800;font-size:12px;cursor:pointer;
  box-shadow:0 4px 16px rgba(0,0,0,.5);transition:.2s;text-transform:uppercase;letter-spacing:.5px
}
.chatdock__new button:hover{transform:translateY(-2px);box-shadow:0 6px 20px rgba(0,0,0,.6)}

/* Formulaire */
.chatdock__form{padding:16px;border-top:1px solid rgba(255,255,255,.08);background:linear-gradient(180deg,transparent,rgba(0,0,0,.2))}
.chatdock__input-wrapper{
  background:rgba(30,30,30,.95);border:2px solid rgba(255,255,255,.1);border-radius:14px;padding:10px 12px;
  display:flex;flex-direction:column;gap:8px;transition:border-color .2s
}
.chatdock__input-wrapper:focus-within{border-color:var(--chat-brand);box-shadow:0 0 0 3px rgba(214,181,106,.15)}
.chatdock__input{
  background:transparent;border:none;outline:0;color:var(--chat-text);font-size:14px;line-height:1.5;
  resize:none;min-height:20px;max-height:120px;font-family:inherit
}
.chatdock__input::placeholder{color:var(--chat-text-muted)}
.chatdock__actions{display:flex;align-items:center;gap:8px;justify-content:flex-end}
.chatdock__action-btn{
  width:36px;height:36px;border-radius:8px;background:rgba(255,255,255,.05);border:1px solid rgba(255,255,255,.1);
  display:flex;align-items:center;justify-content:center;font-size:18px;cursor:pointer;transition:.2s
}
.chatdock__action-btn:hover:not(:disabled){background:rgba(255,255,255,.1);transform:scale(1.1)}
.chatdock__action-btn:disabled{opacity:.4;cursor:not-allowed}
.chatdock__send-btn{
  width:40px;height:40px;border-radius:10px;background:linear-gradient(135deg,var(--chat-brand),rgba(164,136,79,.9));
  border:2px solid rgba(214,181,106,.3);color:#111;display:flex;align-items:center;justify-content:center;
  font-size:18px;font-weight:700;cursor:pointer;transition:.2s;box-shadow:0 2px 8px rgba(0,0,0,.3)
}
.chatdock__send-btn:hover{transform:scale(1.1);box-shadow:0 4px 12px rgba(214,181,106,.4)}
.chatdock__send-btn:active{transform:scale(1.05)}

/* Emoji Picker */
.emoji-picker{
  position:absolute;bottom:80px;right:16px;width:300px;max-height:320px;background:var(--chat-surface);
  border:2px solid var(--chat-border);border-radius:16px;box-shadow:var(--chat-shadow);z-index:10;
  animation:emojiSlideUp .3s cubic-bezier(.4,0,.2,1)
}
@keyframes emojiSlideUp{from{opacity:0;transform:translateY(10px) scale(.95)} to{opacity:1;transform:translateY(0) scale(1)}}
.emoji-picker__header{display:flex;justify-content:space-between;align-items:center;padding:12px 16px;border-bottom:1px solid rgba(255,255,255,.08);font-weight:700;color:var(--chat-brand)}
.emoji-picker__close{
  width:28px;height:28px;border-radius:6px;background:rgba(255,255,255,.05);border:1px solid rgba(255,255,255,.1);
  color:var(--chat-text);display:flex;align-items:center;justify-content:center;cursor:pointer;font-size:18px;font-weight:700;transition:.2s
}
.emoji-picker__close:hover{background:rgba(255,255,255,.1)}
.emoji-picker__grid{display:grid;grid-template-columns:repeat(5,1fr);gap:4px;padding:12px;max-height:250px;overflow-y:auto}
.emoji-btn{
  width:48px;height:48px;border-radius:8px;background:transparent;border:1px solid transparent;font-size:24px;cursor:pointer;transition:.2s;display:flex;align-items:center;justify-content:center
}
.emoji-btn:hover{background:rgba(255,255,255,.1);border-color:rgba(255,255,255,.15);transform:scale(1.15)}

/* Responsive */
@media (max-width:768px){
  .chatdock__minimized{bottom:16px;}
  .chatdock__panel{bottom:8px;right:8px;left:8px;width:auto;max-width:none;max-height:85vh;height:85vh}
  .chatdock__mini-btn{width:56px;height:56px;font-size:24px}
  .emoji-picker{right:8px;left:8px;width:auto}
}
@media (max-width:480px){
  .chatdock__minimized{bottom:12px;}
  .chatdock__mini-btn{width:52px;height:52px;font-size:22px}
  .chatdock__header{padding:12px 16px}
  .chatdock__title{font-size:16px}
  .chatdock__tabs{padding:8px 12px}
  .chatdock__tab{padding:6px 12px;font-size:12px}
  .chatdock__messages{padding:12px}
}

/* ===========================
   GYM - RESPONSIVE DESIGN
   =========================== */

/* Tablettes et petits écrans */
@media (max-width: 1024px) {
  /* Grid métriques/stats passe en 1 colonne */
  .section .grid--two {
    grid-template-columns: 1fr;
    gap: 16px;
  }
  
  /* Programmes rapides - 2 par ligne */
  .prog-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
  }
}

/* Tablettes portrait et mobiles larges */
@media (max-width: 768px) {
  /* Section title plus compact */
  .section__title {
    font-size: 24px;
  }
  
  .section__subtitle {
    font-size: 13px;
  }
  
  /* KPI row wraps mieux */
  .kpi-row {
    gap: 8px;
  }
  
  .kpi-row .chip,
  .kpi-row .badge {
    font-size: 10px;
    padding: 2px 6px;
  }
  
  /* Train split passe en 1 colonne */
  .train-split {
    grid-template-columns: 1fr !important;
    gap: 20px;
  }
  
  .train-hr {
    display: block !important;
    margin: 10px 0;
  }
  
  /* Form elements plus grands pour toucher */
  #gym-form .input,
  #gym-form .select {
    height: 48px;
    font-size: 16px; /* évite le zoom iOS */
  }
  
  #gym-form .btn {
    height: 52px;
    font-size: 15px;
  }
  
  /* Stepper plus accessible */
  .stepper {
    width: 44px;
  }
  
  .stepper__btn {
    font-size: 14px;
  }
  
  /* Programmes rapides - 1 par ligne */
  .prog-grid {
    grid-template-columns: 1fr;
  }
  
  .prog-card {
    padding: 14px;
  }
  
  .prog-card__head {
    flex-wrap: wrap;
    gap: 8px;
  }
  
  .prog-steps {
    font-size: 12px;
  }
  
  /* Stats mini plus lisibles */
  .stats-mini {
    gap: 10px;
  }
  
  .stat-mini {
    padding: 8px 10px;
  }
  
  .stat-mini__label {
    font-size: 11px;
  }
  
  .stat-mini__value {
    font-size: 14px;
  }
  
  /* Barres métriques */
  .mwrap {
    margin-top: 10px;
  }
  
  .mbar {
    height: 10px;
  }
  
  /* Streak dots plus grands */
  .streak-dots {
    gap: 6px;
  }
  
  .streak-dot {
    width: 12px;
    height: 12px;
  }
  
  /* Tables - mode responsive */
  .section .tbl {
    font-size: 13px;
  }
  
  .section .tbl thead th {
    padding: 10px 8px;
    font-size: 10px;
  }
  
  .section .tbl td {
    padding: 10px 8px;
  }
}

/* Mobiles */
@media (max-width: 640px) {
  /* Section header */
  .section__title {
    font-size: 20px;
    letter-spacing: 1px;
  }
  
  .section__subtitle {
    font-size: 12px;
    line-height: 1.5;
  }
  
  /* KPI compact */
  .kpi-row {
    flex-direction: column;
    align-items: stretch;
    gap: 6px;
  }
  
  .kpi-row .chip,
  .kpi-row .badge {
    justify-content: center;
    padding: 6px 10px;
  }
  
  /* Cards padding réduit */
  .card--dark {
    padding: 12px;
  }
  
  .card__title {
    font-size: 13px;
    margin-bottom: 10px;
  }
  
  /* Métriques layout vertical */
  .mwrap {
    margin-top: 12px;
  }
  
  .mlabel {
    font-size: 11px;
  }
  
  .mbar {
    margin-top: 8px;
  }
  
  .cmeta {
    font-size: 12px;
    margin-top: 6px;
  }
  
  /* Form amélioré pour mobile */
  #gym-form .field {
    margin-bottom: 16px;
  }
  
  #gym-form .label {
    font-size: 11px;
    margin-bottom: 8px;
  }
  
  #gym-form .input,
  #gym-form .select {
    height: 52px;
    font-size: 16px;
    padding: 12px 16px;
  }
  
  #gym-form .input--num {
    padding-right: 60px; /* plus d'espace pour stepper */
  }
  
  .stepper {
    width: 48px;
    right: 6px;
  }
  
  #gym-form .btn--block {
    height: 56px;
    font-size: 16px;
    font-weight: 800;
  }
  
  /* Programmes rapides optimisés */
  .prog-card {
    border-radius: 10px;
  }
  
  .prog-card__head .chip {
    font-size: 11px;
    padding: 4px 8px;
  }
  
  .prog-cost {
    font-size: 13px;
  }
  
  .prog-steps {
    margin-left: 12px;
    font-size: 11px;
    line-height: 1.6;
  }
  
  .prog-steps li {
    margin-bottom: 4px;
  }
  
  .prog-run {
    width: 100%;
    height: 44px;
    font-size: 13px;
  }
  
  /* Stats mini en colonne */
  .stats-mini {
    grid-template-columns: 1fr;
  }
  
  .stat-mini {
    padding: 10px 12px;
  }
  
  .stat-mini__label {
    font-size: 12px;
  }
  
  .stat-mini__value {
    font-size: 15px;
  }
  
  /* Tables en mode mobile */
  .section .tbl,
  .section .tbl thead,
  .section .tbl tbody,
  .section .tbl th,
  .section .tbl td,
  .section .tbl tr {
    display: block;
    width: 100%;
  }
  
  .section .tbl thead {
    display: none;
  }
  
  .section .tbl tr {
    margin-bottom: 12px;
    border: 1px solid rgba(255,255,255,.08);
    border-radius: 8px;
    overflow: hidden;
    background: rgba(0,0,0,.2);
  }
  
  .section .tbl td {
    padding: 10px 12px;
    border: none;
    border-bottom: 1px solid rgba(255,255,255,.05);
    display: flex;
    justify-content: space-between;
    align-items: center;
  }
  
  .section .tbl td:last-child {
    border-bottom: none;
  }
  
  /* Labels pour les cellules */
  .section .tbl td::before {
    content: attr(data-label);
    font-weight: 700;
    color: var(--brand);
    text-transform: uppercase;
    font-size: 10px;
    letter-spacing: .5px;
    margin-right: 10px;
  }
  
  /* Historique - labels spécifiques */
  .section .tbl tbody tr td:nth-child(1)::before { content: "Heure"; }
  .section .tbl tbody tr td:nth-child(2)::before { content: "Stat"; }
  .section .tbl tbody tr td:nth-child(3)::before { content: "Reps"; }
  .section .tbl tbody tr td:nth-child(4)::before { content: "Gain"; }
  .section .tbl tbody tr td:nth-child(5)::before { content: "Énergie"; }
  .section .tbl tbody tr td:nth-child(6)::before { content: "Bonus"; }
  
  /* Leaderboard - labels spécifiques */
  .section .card:last-child .tbl tbody tr td:nth-child(1)::before { content: "Rang"; }
  .section .card:last-child .tbl tbody tr td:nth-child(2)::before { content: "Joueur"; }
  .section .card:last-child .tbl tbody tr td:nth-child(3)::before { content: "Puissance"; }
  
  /* Widget empty responsive */
  .widget-empty {
    padding: 20px 12px;
  }
  
  .widget-empty__text {
    font-size: 11px;
  }
}

/* Très petits écrans */
@media (max-width: 480px) {
  .section {
    margin-bottom: 12px;
  }
  
  .section__title {
    font-size: 18px;
    margin-bottom: 6px;
  }
  
  .section__subtitle {
    font-size: 11px;
  }
  
  /* Cards ultra compact */
  .card--dark {
    padding: 10px;
    border-radius: 10px;
  }
  
  .card__title {
    font-size: 12px;
    margin-bottom: 8px;
  }
  
  /* Grids compacts */
  .grid--two {
    gap: 10px;
  }
  
  /* Form ultra optimisé */
  #gym-form .field {
    margin-bottom: 14px;
  }
  
  #gym-form .input,
  #gym-form .select {
    height: 50px;
    border-radius: 10px;
  }
  
  .control .prefix,
  .control .suffix {
    height: 24px;
    min-width: 24px;
    padding: 0 6px;
    font-size: 10px;
  }
  
  /* Programmes plus compacts */
  .prog-card {
    padding: 10px;
  }
  
  .prog-card__head {
    margin-bottom: 6px;
  }
  
  .prog-steps {
    margin-bottom: 6px;
    font-size: 10px;
  }
  
  .prog-run {
    height: 40px;
    font-size: 12px;
  }
  
  /* Streak dots ajustés */
  .streak-dots {
    justify-content: center;
    gap: 8px;
  }
  
  .streak-dot {
    width: 14px;
    height: 14px;
  }
  
  /* HR soft */
  .hr-soft {
    margin: 10px 0;
  }
  
  /* Stats valeurs */
  .stat-mini__value,
  #fatigue-val,
  #quota-val,
  #streak-mul {
    font-size: 14px;
  }
  
  /* Tables encore plus compactes */
  .section .tbl td {
    padding: 8px 10px;
    font-size: 12px;
  }
  
  .section .tbl td::before {
    font-size: 9px;
  }
}

/* Landscape mobile */
@media (max-width: 896px) and (orientation: landscape) {
  .section .grid--two {
    grid-template-columns: repeat(2, 1fr);
  }
  
  .train-split {
    grid-template-columns: 1fr 1fr !important;
  }
  
  .train-hr {
    display: none !important;
  }
  
  .prog-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

/* Fix pour iOS zoom sur focus input */
@supports (-webkit-touch-callout: none) {
  #gym-form input,
  #gym-form select {
    font-size: 16px !important;
  }
}

/* Amélioration accessibilité tactile */
@media (hover: none) and (pointer: coarse) {
  .prog-run,
  .btn,
  .stepper__btn {
    min-height: 44px;
    min-width: 44px;
  }
  
  .prog-card {
    cursor: default;
  }
  
  .prog-card:active {
    transform: scale(0.98);
  }
}

/* Dark mode spécifique gym */
@media (prefers-color-scheme: dark) {
  .mbar {
    background: rgba(0,0,0,.5);
  }
  
  .streak-dot {
    border: 1px solid rgba(255,255,255,.15);
  }
  
  .prog-card {
    background: rgba(0,0,0,.15);
    border-color: rgba(255,255,255,.1);
  }
}

/* Print friendly */
@media print {
  .section .btn,
  .stepper,
  .prog-actions {
    display: none !important;
  }
  
  .section .tbl {
    font-size: 10pt;
  }
  
  .card--dark {
    border: 1px solid #ccc;
    background: white;
    color: black;
  }
}

/* ===========================
   PROFIL UTILISATEUR - RESPONSIVE
   =========================== */

/* Desktop - Optimisations */
@media (min-width: 1025px) {
  .profile-header-grid {
    display: grid;
    grid-template-columns: 120px 1fr;
    gap: 24px;
    align-items: start;
  }
}

/* Tablettes et moyens écrans */
@media (max-width: 1024px) {
  /* Grid 2 colonnes reste */
  .grid--two {
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
  }
}

/* Tablettes portrait */
@media (max-width: 768px) {
  /* Header compact */
  .section__title {
    font-size: 22px;
  }

  .section__subtitle {
    font-size: 13px;
  }

  /* Grid profil passe en 1 colonne */
  .card--dark > div[style*="grid-template-columns"] {
    grid-template-columns: 1fr !important;
    gap: 20px;
  }

  /* Avatar centré sur mobile */
  .card--dark > div > div:first-child {
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
  }

  /* Stats rapides en 2 colonnes */
  .stat-mini {
    padding: 8px 10px;
  }

  .stat-mini__label {
    font-size: 10px;
  }

  .stat-mini__value {
    font-size: 13px;
  }

  /* Actions wrap mieux */
  .card--dark button,
  .card--dark .btn {
    flex: 1 1 calc(50% - 5px);
    min-width: 140px;
  }

  /* Grid 2 colonnes pour tablettes */
  .grid--two {
    grid-template-columns: repeat(2, 1fr);
    gap: 14px;
  }

  /* Relations sociales - grid reste 2x2 */
  .card--dark div[style*="grid-template-columns: repeat(2"] {
    gap: 10px;
  }
}

/* Mobiles larges */
@media (max-width: 640px) {
  /* Header stack vertical */
  .section > div:first-child {
    flex-direction: column;
    align-items: flex-start !important;
    gap: 12px;
  }

  .section > div:first-child .tag {
    align-self: flex-start;
  }

  /* Avatar plus petit */
  .chip.chip-level {
    font-size: 12px;
    padding: 4px 10px;
  }

  /* Titre profil */
  .card--dark h3 {
    font-size: 20px !important;
  }

  /* Badges wrap */
  .card--dark div[style*="flex-wrap"] {
    gap: 6px;
  }

  .badge,
  .chip {
    font-size: 10px;
    padding: 3px 8px;
  }

  /* Stats rapides - 2 colonnes */
  .card--dark > div > div > div[style*="grid-template-columns"] {
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 8px;
    padding: 12px;
  }

  /* Actions full width sur mobile */
  .card--dark > div > div > div[style*="flex-wrap"] .btn {
    flex: 1 1 100%;
    min-width: 0;
  }

  /* Grid infos devient 1 colonne */
  .grid--two {
    grid-template-columns: 1fr;
    gap: 12px;
  }

  /* Cards moins de padding */
  .card--dark {
    padding: 14px;
  }

  .card__title {
    font-size: 14px;
    margin-bottom: 12px;
  }

  .card__body {
    padding: 0;
  }

  /* Stats combat compact */
  .stats-mini {
    gap: 8px;
  }

  /* Infos perso - layout vertical */
  .card--dark .card__body > div[style*="flex-direction:column"] > div {
    padding: 8px 0 !important;
    font-size: 13px;
  }

  .card--dark .card__body span.t-muted {
    font-size: 12px;
  }

  /* Activité dates plus compactes */
  .card--dark .card__body > div > div > div:last-child {
    font-size: 12px !important;
    line-height: 1.4;
  }

  /* Relations sociales - compteurs */
  .card--dark div[style*="grid-template-columns: repeat(2"] > div {
    padding: 10px !important;
  }

  .card--dark div[style*="grid-template-columns: repeat(2"] > div > div:first-child {
    font-size: 20px !important;
  }

  /* Actions sociales wrap */
  .card--dark .card__body > div[style*="flex-wrap"] {
    gap: 6px;
  }

  .btn--xs {
    padding: 6px 10px;
    font-size: 10px;
  }

  /* Staff notes */
  #staffnotes {
    font-size: 14px;
  }

  .card--dark form .card__body {
    padding: 14px;
  }
}

/* Très petits écrans */
@media (max-width: 480px) {
  /* Section spacing */
  .section {
    margin-bottom: 16px;
  }

  .section__title {
    font-size: 18px;
    letter-spacing: 0.3px;
  }

  .section__subtitle {
    font-size: 12px;
  }

  /* Cards ultra compact */
  .card--dark {
    padding: 12px;
    border-radius: 10px;
  }

  /* Avatar encore plus petit */
  /* Titre */
  .card--dark h3 {
    font-size: 18px !important;
  }

  /* Stats rapides full mobile - 1 colonne */
  .card--dark > div > div > div[style*="grid-template-columns"] {
    grid-template-columns: 1fr !important;
    padding: 10px;
  }

  .stat-mini {
    padding: 8px;
    flex-direction: row;
    justify-content: space-between;
  }

  .stat-mini__label {
    font-size: 11px;
  }

  .stat-mini__value {
    font-size: 14px;
  }

  /* Actions empilées */
  .card--dark .btn {
    width: 100%;
    padding: 10px 14px;
    font-size: 13px;
  }

  /* Card title */
  .card__title {
    font-size: 13px;
  }

  /* Stats combat - 1 colonne aussi */
  .stats-mini {
    grid-template-columns: 1fr;
  }

  /* Relations - compteurs stack */
  .card--dark div[style*="grid-template-columns: repeat(2"] {
    grid-template-columns: 1fr !important;
  }

  .card--dark div[style*="grid-template-columns: repeat(2"] > div {
    padding: 12px !important;
  }

  /* Dividers plus discrets */
  .hr-soft {
    margin: 8px 0;
  }

  /* Tags plus petits */
  .tag {
    font-size: 11px !important;
    padding: 4px 10px !important;
  }

  /* Badges ultra compact */
  .badge {
    font-size: 9px;
    padding: 2px 6px;
  }

  /* Staff notes form */
  #staffnotes {
    min-height: 120px;
    font-size: 13px;
  }

  .card--dark form .btn {
    width: 100%;
    height: 48px;
  }
}

/* Landscape mobile */
@media (max-width: 896px) and (orientation: landscape) {
  /* Grid retourne en 2 colonnes en paysage */
  .grid--two {
    grid-template-columns: repeat(2, 1fr);
  }

  /* Stats en 2 colonnes */
  .card--dark > div > div > div[style*="grid-template-columns"] {
    grid-template-columns: repeat(2, 1fr) !important;
  }
}

/* Accessibilité - zones tactiles */
@media (hover: none) and (pointer: coarse) {
  .btn,
  .btn--xs {
    min-height: 44px;
    min-width: 44px;
  }

  .btn--xs {
    padding: 8px 12px;
    font-size: 12px;
  }
}

/* Fix iOS font zoom */
@supports (-webkit-touch-callout: none) {
  .card--dark input,
  .card--dark textarea,
  .card--dark select {
    font-size: 16px !important;
  }
}

/* Dark mode amélioré */
@media (prefers-color-scheme: dark) {
  .stat-mini {
    background: rgba(0,0,0,.35);
  }

  .card--dark h3 {
    text-shadow: 0 2px 8px rgba(0,0,0,.5);
  }
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
  .card--dark img,
  .btn {
    transition: none !important;
  }
}

/* Print */
@media print {
  /* Masquer les actions */
  .btn,
  .card--dark div[style*="flex-wrap"] .btn,
  #staffnotes-form {
    display: none !important;
  }

  /* Cards avec bordures simples */
  .card--dark {
    border: 1px solid #ccc;
    background: white;
    color: black;
    box-shadow: none;
  }

  /* Optimiser pour impression */
  .section {
    page-break-inside: avoid;
  }

  .grid--two {
    grid-template-columns: 1fr 1fr;
  }
}

/* Sécurité - éviter débordements */
.card--dark * {
  max-width: 100%;
  word-wrap: break-word;
  overflow-wrap: break-word;
}

/* Amélioration sélection texte */
.card--dark h3,
.card__title,
.section__title {
  user-select: text;
}

/* Optimisation badges */
.badge,
.chip {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
}

/* Transition fluides */
.card--dark,
.btn,
.stat-mini {
  transition: all 0.2s ease;
}

.card--dark:hover {
  transform: translateY(-1px);
}

/* Focus visible pour accessibilité */
.btn:focus-visible,
a:focus-visible {
  outline: 2px solid var(--brand);
  outline-offset: 2px;
}

/* Amélioration contraste pour accessibilité */
@media (prefers-contrast: high) {
  .card--dark {
    border-width: 2px;
  }

  .badge,
  .chip {
    border-width: 2px;
  }

  .stat-mini {
    border-width: 2px;
  }
}

/* ===========================
   PAGE EXPLORER - RESPONSIVE
   =========================== */

/* Desktop optimisé */
@media (min-width: 1400px) {
  #pane-links > div {
    grid-template-columns: repeat(4, 1fr);
  }

  /* Footer contrôle horizontal sur desktop */
  .sector-card > div:last-child > div {
    flex-direction: row !important;
    align-items: center !important;
  }

  .sector-card > div:last-child > div > div:first-child {
    width: auto;
    flex: 1;
  }

  .sector-card > div:last-child .btn {
    width: auto;
  }
}

@media (min-width: 1200px) and (max-width: 1399px) {
  #pane-links > div {
    grid-template-columns: repeat(3, 1fr);
  }

  /* Footer contrôle horizontal */
  .sector-card > div:last-child > div {
    flex-direction: row !important;
    align-items: center !important;
  }

  .sector-card > div:last-child > div > div:first-child {
    width: auto;
    flex: 1;
  }

  .sector-card > div:last-child .btn {
    width: auto;
  }
}

/* Tablettes larges */
@media (max-width: 1024px) {
  #pane-links > div {
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
  }

  .sector-card {
    border-width: 1px;
  }

  /* Footer contrôle horizontal sur tablette */
  .sector-card > div:last-child > div {
    flex-direction: row !important;
    align-items: center !important;
  }

  .sector-card > div:last-child > div > div:first-child {
    width: auto;
    flex: 1;
  }

  .sector-card > div:last-child .btn {
    width: auto;
  }

  /* Lieux en 2 colonnes sur tablette */
  .sector-card .btn--dark {
    padding: 12px 8px;
  }
}

/* Tablettes portrait et mobiles larges */
@media (max-width: 768px) {
  /* Header section */
  .section > div:first-child {
    flex-direction: column;
    align-items: flex-start !important;
  }

  .section__title {
    font-size: 22px;
  }

  .explore-toggle {
    width: 100%;
  }

  .tbtn {
    flex: 1;
    padding: 10px 12px;
    font-size: 12px;
  }

  /* Grid secteurs en 1 colonne */
  #pane-links > div {
    grid-template-columns: 1fr;
    gap: 14px;
  }

  /* Cards secteur plus compactes */
  .sector-card > div:first-child {
    padding: 16px 16px 14px;
  }

  .sector-card h3 {
    font-size: 15px;
  }

  .sector-card .cmeta {
    font-size: 11px;
  }

  /* Status badge plus petit */
  .sector-card > div:first-child > div > div:last-child {
    padding: 4px 10px !important;
  }

  .sector-card > div:first-child > div > div:last-child span:last-child {
    font-size: 10px !important;
  }

  /* Revenus stack sur mobile */
  .sector-card > div:first-child > div:last-child {
    flex-direction: column;
    gap: 6px !important;
  }

  .sector-card > div:first-child > div:last-child > div {
    width: 100%;
    justify-content: center;
  }

  /* Lieux en 2 colonnes */
  .sector-card > div:nth-child(3) > div:last-child {
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 8px;
  }

  .sector-btn {
    padding: 12px 6px !important;
  }

  .sector-btn span:first-child {
    font-size: 20px !important;
  }

  .sector-btn span:last-child {
    font-size: 10px !important;
  }

  /* Footer contrôle - alignement cohérent */
  .sector-card > div:last-child {
    margin-top: auto; /* Force le footer en bas */
  }

  .sector-card > div:last-child > div {
    flex-direction: column;
    align-items: flex-start !important;
    gap: 10px;
  }

  .sector-card > div:last-child > div > div {
    width: 100%;
  }

  .sector-card > div:last-child .btn {
    width: 100%;
  }

  /* Carte - légende wrap */
  #pane-map .card--dark > div {
    flex-direction: column;
    align-items: flex-start !important;
  }

  #pane-map .card--dark > div > div:last-child {
    flex-direction: column;
    align-items: flex-start !important;
  }
}

/* Mobiles */
@media (max-width: 640px) {
  .section {
    margin-bottom: 16px;
  }

  .section__title {
    font-size: 20px;
  }

  .section__subtitle {
    font-size: 12px;
  }

  /* Toggle ultra compact */
  .explore-toggle {
    padding: 3px;
  }

  .tbtn {
    padding: 8px 10px;
    font-size: 11px;
    border-radius: 8px;
  }

  /* Cards secteur */
  .sector-card {
    border-width: 1px;
  }

  .sector-card > div:first-child {
    padding: 14px 14px 12px;
  }

  /* Header secteur */
  .sector-card h3 {
    font-size: 14px;
  }

  .sector-card > div:first-child > div > div:first-child > div:first-child span:first-child {
    font-size: 24px !important;
  }

  .sector-card .cmeta {
    font-size: 11px;
    line-height: 1.3;
  }

  /* Status badge */
  .sector-card > div:first-child > div > div:last-child {
    padding: 5px 10px !important;
    align-self: flex-start;
  }

  .sector-card > div:first-child > div > div:last-child span:first-child {
    font-size: 14px !important;
  }

  /* Revenus vertical */
  .sector-card > div:first-child > div:last-child {
    padding: 8px 10px !important;
  }

  .sector-card > div:first-child > div:last-child > div span:first-child {
    font-size: 14px !important;
  }

  .sector-card > div:first-child > div:last-child > div span:last-child {
    font-size: 12px !important;
  }

  /* Lieux section */
  .sector-card > div:nth-child(3) {
    padding: 14px;
  }

  .sector-card > div:nth-child(3) > div:first-child {
    margin-bottom: 8px;
    font-size: 9px;
  }

  /* Lieux en 1 colonne sur très petits écrans */
  .sector-card > div:nth-child(3) > div:last-child {
    grid-template-columns: 1fr !important;
  }

  .sector-btn {
    padding: 12px 10px !important;
    flex-direction: row !important;
    gap: 10px !important;
  }

  .sector-btn span:first-child {
    font-size: 22px !important;
  }

  .sector-btn span:last-child {
    font-size: 11px !important;
    text-align: left;
    flex: 1;
  }

  /* Footer */
  .sector-card > div:last-child {
    padding: 12px 14px;
  }

  .sector-card > div:last-child > div > div > div:first-child {
    font-size: 8px;
  }

  .sector-card > div:last-child > div > div > div:last-child {
    font-size: 11px;
  }

  .sector-card > div:last-child .btn {
    height: 36px;
    font-size: 11px;
  }

  /* Carte - Controls compacts */
  #pane-map .card--dark {
    padding: 12px;
    font-size: 12px;
  }

  #pane-map .card--dark > div > div:last-child > span {
    font-size: 11px;
  }

  #pane-map .card--dark > div > div:last-child > span > span:first-child {
    width: 10px;
    height: 10px;
  }
}

/* Très petits écrans */
@media (max-width: 480px) {
  .section__title {
    font-size: 18px;
    letter-spacing: 0.3px;
  }

  .section__subtitle {
    font-size: 11px;
  }

  /* Cards ultra compact */
  .sector-card {
    border-radius: 10px;
  }

  .sector-card > div:first-child {
    padding: 12px;
  }

  /* Header flex vertical */
  .sector-card > div:first-child > div {
    flex-direction: column !important;
    align-items: flex-start !important;
  }

  .sector-card > div:first-child > div > div:last-child {
    align-self: flex-start;
  }

  /* Icône secteur plus petit */
  .sector-card > div:first-child > div > div:first-child > div:first-child span:first-child {
    font-size: 20px !important;
  }

  .sector-card h3 {
    font-size: 13px;
  }

  /* Revenus */
  .sector-card > div:first-child > div:last-child {
    width: 100%;
  }

  /* Lieux en liste */
  .sector-card > div:nth-child(3) {
    padding: 12px;
  }

  .sector-card > div:nth-child(3) > div:last-child {
    gap: 6px;
  }

  .sector-btn {
    padding: 10px 8px !important;
  }

  .sector-btn span:first-child {
    font-size: 20px !important;
  }

  .sector-btn span:last-child {
    font-size: 10px !important;
  }

  /* Footer */
  .sector-card > div:last-child {
    padding: 10px 12px;
  }

  .btn--xs {
    height: 32px;
    font-size: 10px;
    padding: 0 10px;
  }
}

/* Landscape mobile */
@media (max-width: 896px) and (orientation: landscape) {
  /* 2 colonnes en paysage pour mieux utiliser l'espace */
  #pane-links > div {
    grid-template-columns: repeat(2, 1fr);
  }

  /* Lieux en 2 colonnes */
  .sector-card > div:nth-child(3) > div:last-child {
    grid-template-columns: repeat(2, 1fr) !important;
  }

  .sector-btn {
    flex-direction: column !important;
  }
}

/* Vue carte responsive */
@media (max-width: 1200px) {
  .map-canvas {
    transform: translate(-50%, -50%) scale(0.6);
  }
}

@media (max-width: 768px) {
  .map-viewport {
    height: 60vh;
  }
  
  .map-canvas {
    transform: translate(-50%, -50%) scale(0.4);
  }

  .territory-label {
    font-size: 0.8rem;
  }

  .territory-owner {
    font-size: 0.65rem;
  }

  .territory-income {
    display: none; /* Trop petit sur mobile */
  }
}

@media (max-width: 480px) {
  .map-viewport {
    height: 50vh;
  }

  .map-canvas {
    transform: translate(-50%, -50%) scale(0.3);
  }
}

/* Accessibilité tactile */
@media (hover: none) and (pointer: coarse) {
  .sector-btn,
  .tbtn,
  .btn {
    min-height: 44px;
    min-width: 44px;
  }

  .sector-card {
    cursor: default;
  }

  .sector-btn:active {
    transform: scale(0.96);
  }

  .territory-zone {
    cursor: pointer;
  }

  .map-building {
    cursor: pointer;
  }
}

/* Fix iOS zoom */
@supports (-webkit-touch-callout: none) {
  .tbtn {
    font-size: 12px !important;
  }
}

/* Dark mode amélioré */
@media (prefers-color-scheme: dark) {
  .sector-card {
    background: linear-gradient(145deg, #1a1a1a, #222);
  }

  .sector-btn {
    background: rgba(0,0,0,.4);
  }

  .sector-btn:hover {
    background: rgba(214,181,106,.12);
  }
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
  .sector-card,
  .sector-btn,
  .territory-zone {
    transition: none !important;
  }

  .sector-card:hover {
    transform: none;
  }

  .sector-btn:hover {
    transform: none;
  }
}

/* Print */
@media print {
  #pane-map {
    display: none !important;
  }

  .explore-toggle {
    display: none !important;
  }

  #pane-links {
    display: block !important;
  }

  .sector-card {
    page-break-inside: avoid;
    border: 1px solid #ccc;
    background: white;
    color: black;
  }

  .sector-btn,
  .btn {
    border: 1px solid #999;
    box-shadow: none;
  }
}

/* Amélioration contraste */
@media (prefers-contrast: high) {
  .sector-card {
    border-width: 3px;
  }

  .sector-btn {
    border-width: 2px;
  }

  .tbtn {
    border-width: 2px;
  }
}

/* Optimisations performance */
.sector-card,
.sector-btn {
  will-change: transform;
}

.territory-zone {
  will-change: transform, z-index;
}

/* Éviter débordements */
.sector-card *,
.territory-label,
.territory-owner {
  max-width: 100%;
  word-wrap: break-word;
  overflow-wrap: break-word;
}

/* Focus visible */
.sector-btn:focus-visible,
.tbtn:focus-visible,
.btn:focus-visible {
  outline: 2px solid var(--brand);
  outline-offset: 2px;
}

/* Hover states améliorés */
@media (hover: hover) {
  .sector-card:hover {
    transform: translateY(-4px);
  }

  .sector-btn:hover {
    background: rgba(214,181,106,.15);
    border-color: var(--brand);
    transform: translateY(-2px);
  }

  .tbtn:hover:not(.active) {
    background: rgba(255,255,255,.08);
  }
}

/* Animation apparition cards */
@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.sector-card {
  animation: fadeInUp 0.4s ease-out backwards;
}

.sector-card:nth-child(1) { animation-delay: 0.05s; }
.sector-card:nth-child(2) { animation-delay: 0.10s; }
.sector-card:nth-child(3) { animation-delay: 0.15s; }
.sector-card:nth-child(4) { animation-delay: 0.20s; }
.sector-card:nth-child(5) { animation-delay: 0.25s; }
.sector-card:nth-child(6) { animation-delay: 0.30s; }
.sector-card:nth-child(7) { animation-delay: 0.35s; }
.sector-card:nth-child(8) { animation-delay: 0.40s; }

/* Désactiver animations si préférence */
@media (prefers-reduced-motion: reduce) {
  .sector-card {
    animation: none !important;
  }
}

/* ===========================
   COMBAT DASHBOARD - RESPONSIVE
   =========================== */

/* Desktop - 3 colonnes */
@media (min-width: 1025px) {
  /* Les stats restent en 3 colonnes */
}

/* Tablettes larges - reste 3 colonnes */
@media (max-width: 1024px) {
  /* Stats principales en 3 colonnes sur tablette */
  .section > div[style*="grid-template-columns: repeat(3"] {
    gap: 12px;
  }

  .section .card--dark .card__body {
    padding: 12px;
  }
}

/* Tablettes portrait - 2 colonnes */
@media (max-width: 768px) {
  /* Stats principales passent en 2 colonnes */
  .section > div[style*="grid-template-columns: repeat(3"] {
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 10px;
  }

  .section__title {
    font-size: 24px;
  }

  /* Actions en colonne */
  .actions {
    flex-direction: column;
    align-items: stretch;
  }

  .actions .btn {
    width: 100%;
  }

  /* Cards stats plus compactes */
  .card--dark .card__title {
    font-size: 13px;
  }

  .card--dark .card__body > div:first-child {
    font-size: 1.6em !important;
  }

  .card--dark .cmeta {
    font-size: 12px;
  }

  /* Combats récents en 1 colonne */
  .card--dark .card__body > div[style*="grid-template-columns"] {
    grid-template-columns: 1fr !important;
  }

  /* Stats détaillées en 1 colonne */
  .grid--two {
    grid-template-columns: 1fr !important;
  }
}

/* Mobiles - 1 colonne */
@media (max-width: 640px) {
  /* Stats principales en 1 colonne */
  .section > div[style*="grid-template-columns: repeat(3"] {
    grid-template-columns: 1fr !important;
    gap: 10px;
  }

  .section__title {
    font-size: 20px;
  }

  .section__subtitle {
    font-size: 13px;
  }

  /* Actions compactes */
  .actions {
    margin-bottom: 16px !important;
  }

  .actions .btn {
    padding: 10px 14px;
    font-size: 13px;
  }

  /* Alertes plus compactes */
  .alert {
    padding: 10px 12px;
    font-size: 13px;
  }

  /* Cards stats */
  .card--dark {
    padding: 12px;
  }

  .card--dark .card__title {
    font-size: 12px;
    margin-bottom: 8px;
  }

  .card--dark .card__body {
    padding: 10px;
  }

  .card--dark .card__body > div:first-child {
    font-size: 1.8em !important;
    margin-bottom: 6px !important;
  }

  .card--dark .cmeta {
    font-size: 11px;
  }

  /* Barre de progression */
  .bar {
    height: 8px;
  }

  /* KPI row */
  .kpi-row {
    gap: 8px;
  }

  .kpi {
    padding: 6px 8px;
    font-size: 11px;
  }

  /* Panel combats récents */
  .panel {
    padding: 10px !important;
  }

  .panel .badge {
    font-size: 10px !important;
    padding: 2px 6px !important;
  }

  .panel .cmeta {
    font-size: 10px !important;
  }

  /* Stats détaillées */
  .panel > div {
    padding: 6px 0 !important;
    font-size: 12px;
  }

  .panel h4 {
    font-size: 13px !important;
  }
}

/* Très petits écrans */
@media (max-width: 480px) {
  .section {
    margin-bottom: 16px;
  }

  .section__title {
    font-size: 18px;
  }

  .section__subtitle {
    font-size: 12px;
  }

  /* Actions encore plus compactes */
  .actions .btn {
    padding: 8px 12px;
    font-size: 12px;
  }

  /* Cards ultra compactes */
  .card--dark {
    padding: 10px;
    border-radius: 10px;
  }

  .card--dark .card__title {
    font-size: 11px;
  }

  .card--dark .card__body > div:first-child {
    font-size: 1.6em !important;
  }

  /* Stats grid plus serré */
  .section > div[style*="grid-template-columns"] {
    gap: 8px;
  }

  /* Combats récents - layout vertical optimisé */
  .panel > div:first-child {
    flex-direction: column;
    align-items: flex-start !important;
    gap: 6px;
  }

  .panel > div:nth-child(2) > div {
    flex-direction: column !important;
    gap: 10px;
  }

  .panel .chip {
    font-size: 10px !important;
    padding: 2px 6px !important;
  }

  /* Stats détaillées ultra compact */
  .panel > div {
    padding: 6px 0 !important;
  }

  .panel > div span:first-child {
    font-size: 11px;
  }

  .panel > div span:last-child {
    font-size: 12px;
  }
}

/* Landscape mobile */
@media (max-width: 896px) and (orientation: landscape) {
  /* Stats en 3 colonnes en paysage */
  .section > div[style*="grid-template-columns: repeat(3"] {
    grid-template-columns: repeat(3, 1fr) !important;
  }

  /* Stats détaillées en 2 colonnes */
  .grid--two {
    grid-template-columns: repeat(2, 1fr) !important;
  }
}

/* Accessibilité tactile */
@media (hover: none) and (pointer: coarse) {
  .btn,
  .panel a {
    min-height: 44px;
  }

  .actions .btn {
    min-height: 48px;
  }
}

/* Fix iOS zoom */
@supports (-webkit-touch-callout: none) {
  .actions .btn {
    font-size: 14px !important;
  }
}

/* Dark mode amélioré */
@media (prefers-color-scheme: dark) {
  .card--dark {
    background: linear-gradient(145deg, #1a1a1a, #222);
  }

  .panel {
    background: rgba(0,0,0,.3);
  }
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
  .card--dark,
  .btn,
  .panel {
    transition: none !important;
  }
}

/* Print */
@media print {
  .actions,
  .btn {
    display: none !important;
  }

  .card--dark {
    border: 1px solid #ccc;
    background: white;
    color: black;
    page-break-inside: avoid;
  }

  .section > div[style*="grid-template-columns"] {
    grid-template-columns: repeat(3, 1fr) !important;
  }
}

/* Amélioration contraste */
@media (prefers-contrast: high) {
  .card--dark {
    border-width: 2px;
  }

  .alert {
    border-width: 2px;
  }

  .badge {
    border-width: 2px;
  }
}

/* Optimisation performance */
.card--dark,
.panel {
  will-change: transform;
}

/* Focus visible */
.btn:focus-visible,
a:focus-visible {
  outline: 2px solid var(--brand);
  outline-offset: 2px;
}

/* ===========================
   HISTORIQUE COMBAT - RESPONSIVE
   =========================== */

/* Desktop - optimal */
@media (min-width: 1025px) {
  /* Stats en 4 colonnes */
}

/* Tablettes larges */
@media (max-width: 1024px) {
  /* Stats restent en 4 colonnes mais plus compact */
  .card--dark .card__body > div[style*="grid-template-columns:repeat(4"] {
    gap: 12px;
  }

  .card--dark .card__body > div[style*="grid-template-columns:repeat(4"] > div {
    padding: 10px !important;
  }

  .card--dark .card__body > div[style*="grid-template-columns:repeat(4"] > div > div:first-child {
    font-size: 28px !important;
  }
}

/* Tablettes portrait */
@media (max-width: 768px) {
  /* Header card compact */
  .card--dark > div:first-child {
    flex-direction: column !important;
    align-items: flex-start !important;
    gap: 12px;
  }

  .card--dark > div:first-child .btn {
    align-self: flex-start;
  }

  /* Stats passent en 2x2 */
  .card--dark .card__body > div[style*="grid-template-columns:repeat(4"] {
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 10px;
  }

  .card--dark .card__body > div[style*="grid-template-columns:repeat(4"] > div > div:first-child {
    font-size: 28px !important;
  }

  /* Panel combat en colonne */
  .panel > div[style*="grid-template-columns:1fr auto"] {
    grid-template-columns: 1fr !important;
    gap: 16px;
  }

  .panel > div > div:last-child {
    align-items: stretch !important;
    width: 100%;
  }

  .panel > div > div:last-child > div {
    flex-direction: row !important;
    width: 100%;
  }

  .panel .btn--dark {
    flex: 1;
  }

  /* Combattants plus compact */
  .panel > div > div:first-child > div[style*="grid-template-columns:1fr auto 1fr"] {
    gap: 10px;
  }

  .panel > div > div:first-child > div[style*="grid-template-columns:1fr auto 1fr"] > div {
    font-size: 13px;
  }
}

/* Mobiles */
@media (max-width: 640px) {
  /* Header */
  .card--dark > div:first-child {
    padding: 14px 16px;
  }

  .card--dark > div:first-child h3 {
    font-size: 16px;
  }

  .card--dark > div:first-child .section__subtitle {
    font-size: 11px;
  }

  .card--dark > div:first-child .btn {
    padding: 6px 12px;
    font-size: 11px;
  }

  /* Stats en 1 colonne */
  .card--dark .card__body > div[style*="grid-template-columns:repeat(4"] {
    grid-template-columns: 1fr !important;
    gap: 10px;
  }

  .card--dark .card__body > div[style*="grid-template-columns:repeat(4"] > div {
    padding: 12px !important;
  }

  .card--dark .card__body > div[style*="grid-template-columns:repeat(4"] > div > div:first-child {
    font-size: 32px !important;
  }

  /* Panel combat */
  .panel {
    padding: 12px !important;
    border-left-width: 3px !important;
  }

  /* Badges plus petits */
  .panel .badge {
    font-size: 10px !important;
    padding: 3px 8px !important;
  }

  .panel .cmeta {
    font-size: 10px !important;
  }

  /* Combattants en colonne */
  .panel > div > div:first-child > div[style*="grid-template-columns:1fr auto 1fr"] {
    grid-template-columns: 1fr !important;
    gap: 12px;
    text-align: left !important;
  }

  .panel > div > div:first-child > div[style*="grid-template-columns:1fr auto 1fr"] > div:nth-child(2) {
    text-align: center;
    padding: 8px 0;
    border-top: 1px solid rgba(255,255,255,.08);
    border-bottom: 1px solid rgba(255,255,255,.08);
  }

  .panel > div > div:first-child > div[style*="grid-template-columns:1fr auto 1fr"] > div:last-child {
    text-align: left !important;
  }

  .panel > div > div:first-child > div[style*="grid-template-columns:1fr auto 1fr"] > div > div {
    text-align: inherit;
  }

  /* Récompenses full width */
  .panel > div > div:last-child {
    min-width: 0 !important;
  }

  .panel > div > div:last-child > div {
    width: 100%;
  }

  .panel > div > div:last-child > div > div {
    padding: 6px 8px !important;
  }

  .panel > div > div:last-child > div > div span:last-child {
    font-size: 12px !important;
  }

  /* Pagination plus compacte */
  .pagination {
    gap: 6px !important;
    padding: 0 !important;
  }

  .page-btn {
    min-width: 36px !important;
    height: 36px !important;
    padding: 0 8px !important;
    font-size: 11px !important;
  }

  .page-ellipsis {
    padding: 0 4px !important;
  }
}

/* Très petits écrans */
@media (max-width: 480px) {
  /* Header ultra compact */
  .card--dark > div:first-child {
    padding: 12px 14px;
  }

  .card--dark > div:first-child h3 {
    font-size: 15px;
  }

  /* Card body */
  .card__body {
    padding: 12px;
  }

  /* Stats */
  .card--dark .card__body > div[style*="grid-template-columns"] > div {
    padding: 10px !important;
  }

  .card--dark .card__body > div[style*="grid-template-columns"] > div > div:first-child {
    font-size: 28px !important;
  }

  .card--dark .card__body > div[style*="grid-template-columns"] > div > div:last-child {
    font-size: 10px !important;
  }

  /* Panel */
  .panel {
    padding: 10px !important;
  }

  /* Badges wrap */
  .panel > div > div:first-child > div:first-child {
    gap: 6px;
  }

  /* Combattants très compact */
  .panel > div > div:first-child > div[style*="grid-template-columns"] {
    padding: 10px !important;
    gap: 10px;
  }

  .panel > div > div:first-child > div[style*="grid-template-columns"] .cmeta {
    font-size: 9px !important;
  }

  .panel > div > div:first-child > div[style*="grid-template-columns"] > div > div:nth-child(2) {
    font-size: 13px !important;
  }

  /* Récompenses */
  .panel > div > div:last-child > div > div {
    padding: 6px 8px !important;
    gap: 6px !important;
  }

  .panel > div > div:last-child > div > div span:first-child {
    font-size: 14px !important;
  }

  .panel > div > div:last-child > div > div span:last-child {
    font-size: 11px !important;
  }

  /* Bouton détails */
  .panel .btn--dark {
    padding: 8px 10px !important;
    font-size: 12px !important;
  }

  /* Pagination mini */
  .pagination {
    flex-wrap: wrap;
    justify-content: center;
  }

  .page-btn {
    min-width: 32px !important;
    height: 32px !important;
    padding: 0 6px !important;
    font-size: 10px !important;
  }

  /* Cache les boutons première/dernière page */
  .page-btn[title]:first-child,
  .page-btn[title]:last-child {
    display: none;
  }
}

/* Landscape mobile */
@media (max-width: 896px) and (orientation: landscape) {
  /* Stats en 4 colonnes en paysage */
  .card--dark .card__body > div[style*="grid-template-columns"] {
    grid-template-columns: repeat(4, 1fr) !important;
  }

  /* Panel revient en 2 colonnes */
  .panel > div[style*="grid-template-columns"] {
    grid-template-columns: 1fr auto !important;
  }

  .panel > div > div:last-child {
    min-width: 180px !important;
  }

  /* Combattants en ligne */
  .panel > div > div:first-child > div[style*="grid-template-columns"] {
    grid-template-columns: 1fr auto 1fr !important;
  }

  .panel > div > div:first-child > div[style*="grid-template-columns"] > div:last-child {
    text-align: right !important;
  }
}

/* Accessibilité tactile */
@media (hover: none) and (pointer: coarse) {
  .panel .btn,
  .page-btn {
    min-height: 44px;
  }

  .panel:active {
    transform: scale(0.98);
  }
}

/* Fix iOS zoom */
@supports (-webkit-touch-callout: none) {
  .page-btn {
    font-size: 12px !important;
  }
}

/* Dark mode amélioré */
@media (prefers-color-scheme: dark) {
  .panel {
    background: rgba(0,0,0,.15);
  }

  .panel:hover {
    background: rgba(0,0,0,.25);
  }
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
  .panel {
    transition: none !important;
  }

  .panel:hover {
    transform: none;
  }
}

/* Print */
@media print {
  .card--dark > div:first-child .btn,
  .panel .btn,
  .pagination {
    display: none !important;
  }

  .panel {
    page-break-inside: avoid;
    border: 1px solid #ccc;
    background: white;
    color: black;
  }

  .card--dark .card__body > div[style*="grid-template-columns"] {
    grid-template-columns: repeat(4, 1fr) !important;
  }
}

/* Amélioration contraste */
@media (prefers-contrast: high) {
  .panel {
    border-left-width: 4px !important;
    border-width: 2px;
  }

  .badge {
    border-width: 2px;
  }

  .page-btn {
    border-width: 2px;
  }
}

/* Optimisation performance */
.panel {
  will-change: transform;
}

/* Focus visible */
.page-btn:focus-visible,
.panel .btn:focus-visible {
  outline: 2px solid var(--brand);
  outline-offset: 2px;
}

/* ============================================
   STREAK DOTS - Indicateur de série de jours
   ============================================ */

/* Conteneur des points */
.streak-dots {
  display: flex;
  gap: 8px;
  justify-content: center;
  align-items: center;
  padding: 10px 0;
}

/* Point individuel (inactif par défaut) */
.streak-dot {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.1);
  border: 2px solid rgba(255, 255, 255, 0.2);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  cursor: default;
}

/* Point actif (quand le streak est atteint) */
.streak-dot.on {
  background: linear-gradient(135deg, #fbbf24, #f59e0b);
  border-color: #fbbf24;
  box-shadow: 
    0 0 8px rgba(251, 191, 36, 0.4),
    0 0 16px rgba(251, 191, 36, 0.2),
    inset 0 1px 0 rgba(255, 255, 255, 0.3);
  transform: scale(1.1);
}

/* Animation pulse pour le point actif */
.streak-dot.on::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 100%;
  height: 100%;
  border-radius: 50%;
  background: rgba(251, 191, 36, 0.4);
  transform: translate(-50%, -50%);
  animation: pulse-streak 2s ease-in-out infinite;
}

@keyframes pulse-streak {
  0%, 100% {
    transform: translate(-50%, -50%) scale(1);
    opacity: 0.8;
  }
  50% {
    transform: translate(-50%, -50%) scale(1.5);
    opacity: 0;
  }
}

/* Hover sur les points inactifs */
.streak-dot:not(.on):hover {
  background: rgba(255, 255, 255, 0.15);
  border-color: rgba(255, 255, 255, 0.3);
  transform: scale(1.05);
}

/* Responsive : Plus petits sur mobile */
@media (max-width: 640px) {
  .streak-dots {
    gap: 6px;
  }
  
  .streak-dot {
    width: 12px;
    height: 12px;
  }
}

/* Dark mode (si applicable) */
@media (prefers-color-scheme: dark) {
  .streak-dot {
    background: rgba(255, 255, 255, 0.05);
    border-color: rgba(255, 255, 255, 0.15);
  }
  
  .streak-dot.on {
    box-shadow: 
      0 0 10px rgba(251, 191, 36, 0.5),
      0 0 20px rgba(251, 191, 36, 0.25);
  }
}

/* Variante avec numérotation (optionnel) */
.streak-dots--numbered .streak-dot::before {
  content: attr(data-day);
  position: absolute;
  top: -20px;
  left: 50%;
  transform: translateX(-50%);
  font-size: 10px;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.4);
  white-space: nowrap;
}

.streak-dots--numbered .streak-dot.on::before {
  color: #fbbf24;
}

@keyframes fadeInScale {
  from {
    opacity: 0;
    transform: scale(0);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

/* Effet "complete" quand les 7 jours sont atteints */
.streak-dots--complete .streak-dot.on {
  animation: celebrate 0.6s ease-out;
}

@keyframes celebrate {
  0%, 100% {
    transform: scale(1.1);
  }
  25% {
    transform: scale(1.3) rotate(5deg);
  }
  50% {
    transform: scale(1.1) rotate(-5deg);
  }
  75% {
    transform: scale(1.3) rotate(3deg);
  }
}

/* Bulle delta universelle */
.delta-bubble {
  position: absolute;
  right: -6px;
  top: -6px;
  font-size: 12px;
  font-weight: 800;
  padding: 3px 8px;
  border-radius: 6px;
  pointer-events: none;
  z-index: 1000;
  animation: delta-rise 1.8s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
  white-space: nowrap;
  letter-spacing: 0.3px;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
}

/* Gains (vert) */
.delta-bubble.up {
  background: linear-gradient(135deg, var(--brand) 0%, var(--brand-2) 100%);
  color: var(--surface-0);
  border: 1px solid rgba(255, 255, 255, 0.2);
    box-shadow: 
    0 2px 8px rgba(214, 181, 106, 0.5),
    0 0 0 1px rgba(214, 181, 106, 0.2);
}

/* Pertes (rouge) */
.delta-bubble.down {
  background: linear-gradient(135deg, var(--ko) 0%, #dc2626 100%);
  color: var(--ink-inv);
  border: 1px solid rgba(255, 255, 255, 0.2);
  box-shadow: 
    0 2px 8px rgba(214, 181, 106, 0.5),
    0 0 0 1px rgba(214, 181, 106, 0.2);
}

/* Variante or/spécial (pour argent, cristaux) */
.delta-bubble.gold {
  background: linear-gradient(135deg, var(--brand) 0%, var(--brand-2) 100%);
  color: var(--surface-0);
  border: 1px solid rgba(255, 255, 255, 0.3);
  box-shadow: 
    0 2px 8px rgba(214, 181, 106, 0.5),
    0 0 0 1px rgba(214, 181, 106, 0.2);
}

/* Animation unifiée */
@keyframes delta-rise {
  0% {
    opacity: 0;
    transform: translateY(0) scale(0.7);
  }
  15% {
    opacity: 1;
    transform: translateY(-8px) scale(1.15);
  }
  25% {
    transform: translateY(-12px) scale(1);
  }
  100% {
    opacity: 0;
    transform: translateY(-40px) scale(0.85);
  }
}

/* Assurer le positionnement relatif des conteneurs */
.stat-item,
.stat-value,
.user-resources > span,
.resource-money,
.resource-crystals,
.resource-level {
  position: relative;
}

/* Ancien nom pour compatibilité */
.res-delta,
.stat-delta {
  /* Rediriger vers la nouvelle classe */
}

/* === TRAINING MODE === */
.training-mode {
  margin-bottom: 24px;
}

.training-mode:last-child {
  margin-bottom: 0;
}

.training-mode__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 16px;
  flex-wrap: wrap;
}

.mode-badge {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 16px;
  background: var(--surface-2);
  border: 1px solid var(--bd);
  border-radius: 8px;
  font-weight: 700;
  font-size: 14px;
}

.mode-badge--active {
  background: rgba(214, 181, 106, 0.1);
  border-color: var(--brand);
  color: var(--brand);
}

.mode-badge__icon {
  font-size: 18px;
}

.mode-info {
  display: flex;
  gap: 8px;
}

/* === TRAINING FORM === */
.training-form__inputs {
  display: flex;
  gap: 16px;
  align-items: flex-end;
  flex-wrap: wrap;
}

@media (max-width: 768px) {
  .training-form__inputs {
    flex-direction: column;
    align-items: stretch;
  }
  
  .training-form__inputs .field {
    width: 100% !important;
  }
  
  .training-form__inputs > div:last-child {
    width: 100%;
  }
  
  .training-form__inputs .btn {
    width: 100%;
  }
}

/* === SEPARATOR === */
.training-separator {
  display: flex;
  align-items: center;
  gap: 16px;
  margin: 32px 0;
}

.training-separator__line {
  flex: 1;
  height: 1px;
  background: linear-gradient(
    90deg,
    transparent,
    var(--bd) 20%,
    var(--bd) 80%,
    transparent
  );
}

.training-separator__text {
  font-weight: 700;
  font-size: 12px;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 1px;
  padding: 0 8px;
}

/* === PROGRAMS GRID === */
.programs-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 16px;
}

@media (max-width: 768px) {
  .programs-grid {
    grid-template-columns: 1fr;
  }
}

/* === PROGRAM CARD === */
.program-card {
  display: flex;
  flex-direction: column;
  background: var(--surface-2);
  border: 1px solid var(--bd);
  border-radius: 10px;
  overflow: hidden;
  transition: all 0.2s;
}

.program-card:hover {
  border-color: var(--brand);
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(214, 181, 106, 0.15);
}

.program-card__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 16px;
  background: var(--surface-1);
  border-bottom: 1px solid var(--bd);
}

.program-card__badge {
  font-weight: 700;
  font-size: 14px;
  color: var(--ink);
}

.program-card__cost {
  display: flex;
  align-items: baseline;
  gap: 4px;
  font-weight: 800;
  color: var(--brand);
}

.cost-value {
  font-size: 20px;
}

.cost-unit {
  font-size: 11px;
  opacity: 0.8;
}

.program-card__body {
  flex: 1;
  padding: 16px;
}

.program-steps {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.program-step {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  background: rgba(0, 0, 0, 0.2);
  border-radius: 6px;
  font-size: 13px;
}

.program-step__icon {
  font-size: 16px;
  width: 20px;
  text-align: center;
}

.program-step__label {
  flex: 1;
  font-weight: 600;
  color: var(--ink);
}

.program-step__value {
  font-weight: 700;
  color: var(--brand);
}

.program-card__footer {
  padding: 16px;
  padding-top: 0;
}

.program-card__footer .btn {
  font-size: 13px;
  padding: 10px 16px;
}

/* === ANIMATIONS === */
@keyframes pulse-glow {
  0%, 100% {
    box-shadow: 0 0 0 0 rgba(214, 181, 106, 0.4);
  }
  50% {
    box-shadow: 0 0 0 8px rgba(214, 181, 106, 0);
  }
}

.role-badge{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  margin-left:.35rem;
  font-size:0.9em;
  line-height:1;
  vertical-align:middle;
  opacity:.9;
}
.role-badge.role-mod{ /* modérateur */
  /* tu peux custom (couleur/emoji) si tu veux un petit fond */
}
.role-badge.role-admin{ /* administrateur */
  /* idem, optionnel */
}

/* Animations Modal */
@keyframes modalFadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

@keyframes modalSlideUp {
  from {
    transform: translateY(40px);
    opacity: 0;
  }
  to {
    transform: translateY(0);
    opacity: 1;
  }
}

/* Shift Cards */
.shift-card {
  transition: all 0.3s ease;
}

.shift-card:hover:not(.shift-card--completed) {
  transform: translateY(-4px);
  box-shadow: 0 8px 24px rgba(214, 181, 106, 0.3);
}

.shift-card--completed {
  opacity: 0.6;
  filter: grayscale(0.5);
}

/* Choice Options */
.choice-option {
  transition: all 0.2s ease;
}

.choice-option:hover {
  background: rgba(214, 181, 106, 0.1) !important;
  border-color: var(--brand) !important;
  transform: translateX(4px);
}

.choice-option input[type="radio"]:checked ~ span {
  color: var(--brand);
  font-weight: 700;
}

.choice-option input[type="radio"]:checked {
  accent-color: var(--brand);
}

/* Skill Tree */
.skill-node {
  transition: all 0.3s ease;
  position: relative;
  overflow: hidden;
}

.skill-node::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  transition: left 0.5s;
}

.skill-node:hover::before {
  left: 100%;
}

.skill-node--unlocked {
  animation: skillUnlock 0.5s ease-out;
}

@keyframes skillUnlock {
  0% {
    transform: scale(0.9);
    opacity: 0;
  }
  50% {
    transform: scale(1.05);
  }
  100% {
    transform: scale(1);
    opacity: 1;
  }
}

/* Badge Active (utilisé pour les shifts complétés) */
.badge-active {
  background: linear-gradient(135deg, rgba(74, 222, 128, 0.25), rgba(74, 222, 128, 0.1));
  border: 1px solid rgba(74, 222, 128, 0.4);
  color: #4ade80;
  padding: 4px 12px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  display: inline-block;
}

@keyframes badgePulse {
  0%, 100% {
    box-shadow: 0 0 0 0 rgba(74, 222, 128, 0.4);
  }
  50% {
    box-shadow: 0 0 0 6px rgba(74, 222, 128, 0);
  }
}

/* Task Result Animation */
@keyframes taskSuccess {
  0% {
    transform: scale(0.5) rotate(-10deg);
    opacity: 0;
  }
  50% {
    transform: scale(1.2) rotate(5deg);
  }
  100% {
    transform: scale(1) rotate(0);
    opacity: 1;
  }
}

.task-result-icon {
  animation: taskSuccess 0.6s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

/* Timer Urgent */
.timer-urgent {
  animation: timerPulse 1s infinite;
}

@keyframes timerPulse {
  0%, 100% {
    color: var(--err);
    transform: scale(1);
  }
  50% {
    color: #ff6b6b;
    transform: scale(1.1);
  }
}

/* Performance Bar */
.performance-bar {
  width: 100%;
  height: 8px;
  background: rgba(0, 0, 0, 0.3);
  border-radius: 999px;
  overflow: hidden;
  position: relative;
}

.performance-bar__fill {
  height: 100%;
  background: linear-gradient(90deg, var(--brand), #fff1b8);
  transition: width 0.5s ease;
  border-radius: 999px;
}

/* Streak Flame Animation */
@keyframes flameFlicker {
  0%, 100% {
    transform: scale(1) translateY(0);
    filter: hue-rotate(0deg);
  }
  25% {
    transform: scale(1.05) translateY(-2px);
    filter: hue-rotate(10deg);
  }
  50% {
    transform: scale(0.95) translateY(1px);
    filter: hue-rotate(-10deg);
  }
  75% {
    transform: scale(1.02) translateY(-1px);
    filter: hue-rotate(5deg);
  }
}

.streak-flame {
  display: inline-block;
  animation: flameFlicker 2s ease-in-out infinite;
}

/* Loading Spinner pour les boutons */
@keyframes buttonSpin {
  to {
    transform: rotate(360deg);
  }
}

.btn--loading::before {
  content: '⏳';
  display: inline-block;
  margin-right: 8px;
  animation: buttonSpin 1s linear infinite;
}

/* Responsive */
@media (max-width: 768px) {
  .modal__content {
    width: 95%;
    max-width: none;
    max-height: 95vh;
  }
  
  .modal__content--lg {
    max-width: none;
  }
  
  .modal__body {
    padding: 16px;
  }
  
  .skill-node {
    font-size: 13px;
  }
}

/* États désactivés améliorés */
.btn:disabled,
.btn[disabled] {
  opacity: 0.5;
  cursor: not-allowed;
  filter: grayscale(0.5);
}

.btn:disabled:hover,
.btn[disabled]:hover {
  transform: none;
  box-shadow: none;
}

/* Hover effects sur les cartes de shift */
.shift-card button {
  transition: all 0.2s ease;
}

.shift-card button:hover:not(:disabled) {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(214, 181, 106, 0.4);
}

/* Scrollbar personnalisée pour modals */
.modal__body::-webkit-scrollbar {
  width: 8px;
}

.modal__body::-webkit-scrollbar-track {
  background: rgba(0, 0, 0, 0.2);
  border-radius: 4px;
}

.modal__body::-webkit-scrollbar-thumb {
  background: rgba(214, 181, 106, 0.3);
  border-radius: 4px;
}

.modal__body::-webkit-scrollbar-thumb:hover {
  background: rgba(214, 181, 106, 0.5);
}

/* Transitions douces pour les changements de contenu */
.fade-in {
  animation: fadeIn 0.3s ease-in;
}

@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

/* Effet de glow sur les éléments importants */
.glow-brand {
  box-shadow: 0 0 20px rgba(214, 181, 106, 0.3);
  animation: glowPulse 2s ease-in-out infinite;
}

@keyframes glowPulse {
  0%, 100% {
    box-shadow: 0 0 20px rgba(214, 181, 106, 0.3);
  }
  50% {
    box-shadow: 0 0 30px rgba(214, 181, 106, 0.5);
  }
}

/* ======================================================================
   KPI BADGES STYLES
   ====================================================================== */

.kpi-row {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 20px;
}

.kpi-card {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  border-radius: 12px;
  background: rgba(0, 0, 0, 0.2);
  border: 1px solid rgba(255, 255, 255, 0.1);
  min-width: 200px;
  transition: all 0.2s ease;
}

.kpi-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.kpi-card__icon {
  font-size: 28px;
  line-height: 1;
  filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.3));
}

.kpi-card__content {
  display: flex;
  flex-direction: column;
  gap: 2px;
  flex: 1;
}

.kpi-card__label {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: rgba(255, 255, 255, 0.6);
  font-weight: 600;
}

.kpi-card__value {
  font-size: 20px;
  font-weight: 700;
  line-height: 1.2;
  color: #fff;
}

.kpi-card__sub {
  font-size: 12px;
  color: rgba(255, 255, 255, 0.7);
  font-weight: 500;
}

/* Variants */
.kpi-card--danger {
  background: linear-gradient(135deg, rgba(239, 68, 68, 0.15) 0%, rgba(220, 38, 38, 0.1) 100%);
  border-color: rgba(239, 68, 68, 0.3);
}

.kpi-card--danger .kpi-card__value {
  color: #fca5a5;
}

.kpi-card--warn {
  background: linear-gradient(135deg, rgba(251, 191, 36, 0.15) 0%, rgba(245, 158, 11, 0.1) 100%);
  border-color: rgba(251, 191, 36, 0.3);
}

.kpi-card--warn .kpi-card__value {
  color: #fcd34d;
}

/* Animation pour le timer */
@keyframes pulse {
  0%, 100% {
    opacity: 1;
  }
  50% {
    opacity: 0.8;
  }
}

.kpi-card--danger .kpi-card__icon {
  animation: pulse 2s ease-in-out infinite;
}

/* Responsive */
@media (max-width: 768px) {
  .kpi-card {
    min-width: 100%;
    flex: 1;
  }
  
  .kpi-card__value {
    font-size: 18px;
  }
}

/* ===========================
   QUICK STATS - PILLS COMPACT
   =========================== */

.quick-stats {
  display: flex;
  gap: 10px;
  flex: 1;
  justify-content: center;
  align-items: center;
}

.stat-pill {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 14px;
  background: rgba(0,0,0,.3);
  border: 1px solid rgba(255,255,255,.1);
  border-radius: 20px;
  transition: all .2s ease;
  position: relative;
  min-width: 110px;
}

.stat-pill:hover {
  background: rgba(0,0,0,.4);
  border-color: rgba(214,181,106,.3);
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0,0,0,.3);
}

/* Icône */
.stat-pill__icon {
  font-size: 20px;
  line-height: 1;
  filter: drop-shadow(0 2px 4px rgba(0,0,0,.5));
}

/* Conteneur valeur + timer */
.stat-pill__data {
  display: flex;
  flex-direction: column;
  gap: 2px;
  position: relative;
}

/* Valeur (ex: 114/114) */
.stat-pill__value {
  font-family: 'Courier New', monospace;
  font-size: 12px;
  font-weight: 700;
  color: #fff;
  line-height: 1.2;
  white-space: nowrap;
}

/* Timer en dessous (ex: [05:23]) */
.stat-pill__timer {
  font-family: 'Courier New', monospace;
  font-size: 10px;
  color: var(--brand);
  font-weight: 600;
  white-space: nowrap;
  display: none; /* Caché par défaut, affiché par JS */
}

/* Responsive */
@media (max-width: 1200px) {
  .quick-stats {
    gap: 8px;
  }
  
  .stat-pill {
    min-width: 100px;
    padding: 6px 12px;
  }
}

@media (max-width: 768px) {
  .quick-stats {
    gap: 6px;
    overflow-x: auto;
    scrollbar-width: none;
    justify-content: flex-start;
  }
  
  .quick-stats::-webkit-scrollbar {
    display: none;
  }
  
  .stat-pill {
    min-width: 90px;
    padding: 6px 10px;
    flex-shrink: 0;
  }
  
  .stat-pill__icon {
    font-size: 18px;
  }
  
  .stat-pill__value {
    font-size: 13px;
  }
  
  .stat-pill__timer {
    font-size: 9px;
  }
}

@media (max-width: 480px) {
  .stat-pill {
    min-width: 85px;
    padding: 5px 8px;
  }
  
  .stat-pill__icon {
    font-size: 16px;
  }
  
  .stat-pill__value {
    font-size: 12px;
  }
}

#chatdock-panel {
  display: none;
}

#chatdock-minimized {
  display: none;
}
#chatdock-panel[aria-hidden="true"],
#chatdock-minimized[aria-hidden="true"] {
  display: none;
}

/* Désactiver transitions au chargement */
.fill-energy[data-hydrated="0"],
.fill-brave[data-hydrated="0"],
.fill-hp[data-hydrated="0"],
.fill-xp[data-hydrated="0"] {
  transition: none !important;
}

/* Activer après hydratation */
.fill-energy[data-hydrated="1"],
.fill-brave[data-hydrated="1"],
.fill-hp[data-hydrated="1"],
.fill-xp[data-hydrated="1"] {
  transition: width 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

/**
 * 🏙️ TERRITORY BATTLE - Styles minimaux (réutilise le CSS principal)
 */

/* =====================================================
 * 📊 BARRES DE COMBAT - Animation pulse unique
 * ===================================================== */

.battle-bar__fill {
  position: relative;
  height: 100%;
  transition: width 0.5s cubic-bezier(0.4, 0, 0.2, 1);
  border-radius: 16px;
  overflow: hidden;
}

/* Pulse animé pour les barres */
.battle-bar__pulse {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(90deg, 
    transparent, 
    rgba(255, 255, 255, 0.3), 
    transparent
  );
  animation: battlePulse 2s ease-in-out infinite;
}

@keyframes battlePulse {
  0%, 100% { opacity: 0.3; }
  50% { opacity: 0.8; }
}

/* Couleurs des barres (réutilise tes couleurs) */
.battle-bar--attack .battle-bar__fill {
  background: linear-gradient(90deg, var(--ko), #dc2626);
  box-shadow: 0 0 20px rgba(239, 68, 68, 0.5);
}

.battle-bar--defense .battle-bar__fill {
  background: linear-gradient(90deg, var(--ok), #22c55e);
  box-shadow: 0 0 20px rgba(74, 222, 128, 0.5);
}

/* =====================================================
 * ⏱️ COOLDOWN BAR - Spécifique aux actions
 * ===================================================== */

.cooldown-bar {
  position: relative;
  margin-top: 16px;
  height: 32px;
  background: rgba(0, 0, 0, 0.3);
  border-radius: 16px;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.cooldown-bar__fill {
  position: absolute;
  top: 0;
  left: 0;
  height: 100%;
  background: linear-gradient(90deg, var(--ko), #dc2626);
  border-radius: 16px;
}

.cooldown-bar__text {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  font-size: 14px;
  font-weight: 700;
  color: white;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.5);
  z-index: 1;
}

/* =====================================================
 * 🎮 ACTION BUTTONS - États spéciaux
 * ===================================================== */

.action-btn--disabled,
.action-btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
  pointer-events: none;
}

/* =====================================================
 * 📱 RESPONSIVE SPÉCIFIQUE
 * ===================================================== */

@media (max-width: 768px) {
  .battle-bar__fill {
    border-radius: 12px;
  }
  
  .cooldown-bar {
    height: 28px;
    margin-top: 12px;
  }
  
  .cooldown-bar__text {
    font-size: 12px;
  }
}

@media (max-width: 480px) {
  .battle-bar__fill {
    border-radius: 10px;
  }
  
  .cooldown-bar {
    height: 24px;
  }
}

/* Styles pour les variantes de boutons si nécessaire */
.btn--danger {
  background: #ef4444;
  color: white;
}

.btn--danger:hover {
  background: #dc2626;
}

.btn--warning {
  background: #f59e0b;
  color: white;
}

.btn--warning:hover {
  background: #d97706;
}

.btn--ok {
  background: #10b981;
  color: white;
}

.btn--ok:hover {
  background: #059669;
}

/* Animation d'entrée */
.modal[aria-hidden="false"] .modal__card {
  animation: modalSlideIn 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes modalSlideIn {
  from {
    opacity: 0;
    transform: translateY(-20px) scale(0.95);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

/* Scrim fade in */
.modal[aria-hidden="false"] .modal__scrim {
  animation: scrimFadeIn 0.2s ease-out;
}

@keyframes scrimFadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

/* ===========================
   STATS BAR - Barre dédiée entre logo et menu
   =========================== */

.stats-bar {
  background: linear-gradient(180deg, rgba(0,0,0,.4) 0%, rgba(0,0,0,.6) 100%);
  border-bottom: 1px solid var(--bd);
  padding: 8px 20px;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
  backdrop-filter: blur(8px);
  position: relative;
  z-index: 10;
}

.stats-bar::before {
  content: "";
  position: absolute;
  inset: 0;
  background: repeating-linear-gradient(135deg, rgba(214,181,106,.02) 0 2px, transparent 2px 10px);
  pointer-events: none;
}

/* Carte de stat */
.stat-card {
  background: rgba(0,0,0,.3);
  border: 1px solid rgba(255,255,255,.08);
  border-radius: 8px;
  padding: 8px 12px;
  position: relative;
  overflow: hidden;
  transition: all .25s ease;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 42px;
}

.stat-card:hover {
  background: rgba(0,0,0,.45);
  border-color: rgba(214,181,106,.3);
  transform: translateY(-1px);
  box-shadow: 0 2px 8px rgba(0,0,0,.2), 0 0 12px rgba(214,181,106,.1);
}

/* GAUCHE: Icône */
.stat-card__icon {
  font-size: 18px;
  filter: drop-shadow(0 1px 2px rgba(0,0,0,.5));
  line-height: 1;
  flex-shrink: 0;
}

/* GAUCHE: Label */
.stat-card__label {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: rgba(214,181,106,.8);
  text-shadow: 0 1px 2px rgba(0,0,0,.5);
  white-space: nowrap;
  flex-shrink: 0;
}

/* DROITE: Container valeur + timer */
.stat-card__content {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-left: auto;
}

/* DROITE: Valeur */
.stat-card__value {
  font-family: 'Courier New', monospace;
  font-size: 12px;
  font-weight: 700;
  color: #fff;
  text-shadow: 0 1px 2px rgba(0,0,0,.5);
  white-space: nowrap;
}

/* DROITE: Timer */
.stat-card__timer {
  font-family: 'Courier New', monospace;
  font-size: 10px;
  color: var(--brand);
  font-weight: 600;
  text-shadow: 0 1px 2px rgba(0,0,0,.5);
  white-space: nowrap;
}

/* Barre de progression en bas */
.stat-card__bar {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: rgba(0,0,0,.4);
  overflow: hidden;
}

.stat-card__fill {
  height: 100%;
  transition: width 0.6s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
}

/* Couleurs des barres */
.fill-energy {
  background: linear-gradient(90deg, #eab308 0%, #f59e0b 100%);
  box-shadow: 0 0 8px rgba(234, 179, 8, 0.4);
}

.fill-brave {
  background: linear-gradient(90deg, #3b82f6 0%, #2563eb 100%);
  box-shadow: 0 0 8px rgba(59, 130, 246, 0.4);
}

.fill-hp {
  background: linear-gradient(90deg, var(--ko) 0%, #dc2626 100%);
  box-shadow: 0 0 8px rgba(239, 68, 68, 0.4);
}

.fill-xp {
  background: linear-gradient(90deg, var(--ok) 0%, #059669 100%);
  box-shadow: 0 0 8px rgba(16, 185, 129, 0.4);
}

/* Animation subtile shimmer */
.stat-card__fill::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,.2), transparent);
  animation: shimmer 3s ease-in-out infinite;
}

/* Désactiver transitions au chargement */
.fill-energy[data-hydrated="0"],
.fill-brave[data-hydrated="0"],
.fill-hp[data-hydrated="0"],
.fill-xp[data-hydrated="0"] {
  transition: none !important;
}

/* Activer après hydratation */
.fill-energy[data-hydrated="1"],
.fill-brave[data-hydrated="1"],
.fill-hp[data-hydrated="1"],
.fill-xp[data-hydrated="1"] {
  transition: width 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ========================================
   RESPONSIVE
   ======================================== */

@media (max-width: 1024px) {
  .stats-bar {
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
    padding: 6px 16px;
  }
  
  .stat-card {
    min-height: 38px;
  }
  
  .stat-card__label {
    font-size: 9px;
  }
  
  .stat-card__value {
    font-size: 11px;
  }
  
  .stat-card__timer {
    font-size: 9px;
  }
}

@media (max-width: 640px) {
  .stats-bar {
    padding: 6px 12px;
    gap: 6px;
  }
  
  .stat-card {
    padding: 6px 10px;
    min-height: 36px;
    gap: 8px;
  }
  
  .stat-card__icon {
    font-size: 16px;
  }
  
  .stat-card__label {
    font-size: 8px;
  }
  
  .stat-card__value {
    font-size: 10px;
  }
  
  .stat-card__timer {
    font-size: 8px;
    gap: 6px;
  }
  
  .stat-card__content {
    gap: 6px;
  }
}

@media (max-width: 480px) {
  .stat-card__label {
    display: none; /* Masquer le label sur très petit écran */
  }
  
  .stat-card__icon {
    font-size: 14px;
  }
  
  .stat-card__value {
    font-size: 9px;
  }
  
  .stat-card__timer {
    font-size: 7px;
  }
}

.grid--three {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
}

@media (max-width: 1024px) {
    .grid--three {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 640px) {
    .grid--three {
        grid-template-columns: 1fr;
    }
}

/* ================================================================
   BARRE FLOTTANTE CHAT
   ================================================================ */

.chat-bar {
  position: fixed;
  bottom: 20px;
  right: 20px;
  z-index: 500;
  display: flex;
  flex-direction: column;
  gap: 12px;
  align-items: flex-end;
}

.chat-bar__btn {
  position: relative;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.chat-bar__btn:hover {
  transform: scale(1.05);
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.2);
}

.chat-bar__btn:active {
  transform: scale(0.95);
}

/* Bouton principal */
.chat-bar__btn--main {
  background: linear-gradient(135deg, var(--brand) 0%, var(--brand-2) 100%);
  color: var(--ink-inv);
  border: 2px solid rgba(214,181,106,.4);
}

.chat-bar__btn--main:hover {
  background: linear-gradient(135deg, #e8c67a 0%, var(--brand) 100%);
  box-shadow: 0 6px 20px rgba(214,181,106,.4);
}

/* Bouton paramètres */
.chat-bar__btn--settings {
  width: 48px;
  height: 48px;
  background: var(--surface-2);
  color: var(--brand);
  border: 2px solid var(--bd);
}

.chat-bar__btn--settings:hover {
  background: var(--surface-3);
  border-color: var(--brand);
  color: var(--ink-inv);
  box-shadow: 0 4px 12px rgba(214,181,106,.3);
}

/* Badge de notifications */
.chat-bar__badge {
  position: absolute;
  top: -4px;
  right: -4px;
  min-width: 22px;
  height: 22px;
  padding: 0 6px;
  background: #ff4757;
  color: white;
  border-radius: 11px;
  font-size: 11px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 2px solid white;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

/* ================================================================
   MODALE DE GESTION
   ================================================================ */

.chat-modal__dialog--large {
  max-width: 600px;
  width: 90%;
  max-height: 80vh;
}

.chat-manage {
  display: flex;
  flex-direction: column;
  gap: 24px;
  padding: 0;
}

.chat-manage__section {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.chat-manage__section-title {
  font-size: 14px;
  font-weight: 700;
  color: #333;
  margin: 0;
  padding: 8px 12px;
  background: #f5f5f5;
  border-radius: 6px;
}

.chat-manage__item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px;
  background: white;
  border: 1px solid #e0e0e0;
  border-radius: 8px;
  transition: all 0.2s ease;
}

.chat-manage__item:hover {
  background: #f9f9f9;
  border-color: #667eea;
  box-shadow: 0 2px 8px rgba(102, 126, 234, 0.1);
}

.chat-manage__item-icon {
  font-size: 24px;
  line-height: 1;
  flex-shrink: 0;
}

.chat-manage__item-info {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.chat-manage__item-name {
  font-weight: 600;
  color: #333;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.chat-manage__item-desc,
.chat-manage__item-time {
  font-size: 12px;
  color: #999;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.chat-manage__item-badge {
  min-width: 24px;
  height: 24px;
  padding: 0 8px;
  background: #ff4757;
  color: white;
  border-radius: 12px;
  font-size: 12px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.chat-manage__item-action {
  width: 36px;
  height: 36px;
  border-radius: 6px;
  border: 1px solid #e0e0e0;
  background: white;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  transition: all 0.2s ease;
  flex-shrink: 0;
}

.chat-manage__item-action:hover {
  background: #f5f5f5;
  border-color: #667eea;
  transform: scale(1.05);
}

.chat-manage__item-action--danger {
  border-color: #ff4757;
  color: #ff4757;
}

.chat-manage__item-action--danger:hover {
  background: #fff5f5;
  border-color: #ff4757;
}

.chat-manage__loading,
.chat-manage__empty,
.chat-manage__error {
  padding: 40px;
  text-align: center;
  color: #999;
  font-size: 14px;
}

.chat-manage__error {
  color: #ff4757;
}

/* ================================================================
   RESPONSIVE
   ================================================================ */

@media (max-width: 640px) {
  .chat-bar {
    bottom: 16px;
    right: 16px;
  }
  
  .chat-bar__btn--main {
    width: 48px;
    height: 48px;
  }
  
  .chat-bar__btn--settings {
    width: 40px;
    height: 40px;
  }
  
  .chat-modal__dialog--large {
    width: 95%;
    max-height: 90vh;
  }
  
  .chat-manage__item {
    padding: 10px;
  }
  
  .chat-manage__item-icon {
    font-size: 20px;
  }
  
  .chat-manage__item-name {
    font-size: 14px;
  }
}

/* ================================================================
   ANIMATIONS
   ================================================================ */

@keyframes bounceIn {
  0% {
    opacity: 0;
    transform: scale(0.3);
  }
  50% {
    opacity: 1;
    transform: scale(1.05);
  }
  70% {
    transform: scale(0.9);
  }
  100% {
    transform: scale(1);
  }
}

.chat-bar__btn {
  animation: bounceIn 0.5s ease;
}

.chat-bar__badge {
  animation: bounceIn 0.3s ease;
}

/* ================================================================
   DARK MODE SUPPORT (optionnel)
   ================================================================ */

@media (prefers-color-scheme: dark) {
  .chat-bar__btn--settings {
    background: #2d2d2d;
    color: #e0e0e0;
    border-color: #444;
  }
  
  .chat-bar__btn--settings:hover {
    background: #3d3d3d;
    border-color: #667eea;
    color: #667eea;
  }
  
  .chat-manage__section-title {
    background: #2d2d2d;
    color: #e0e0e0;
  }
  
  .chat-manage__item {
    background: #2d2d2d;
    border-color: #444;
  }
  
  .chat-manage__item:hover {
    background: #3d3d3d;
    border-color: #667eea;
  }
  
  .chat-manage__item-name {
    color: #e0e0e0;
  }
  
  .chat-manage__item-action {
    background: #2d2d2d;
    border-color: #444;
  }
  
  .chat-manage__item-action:hover {
    background: #3d3d3d;
  }
}

/* ============================================
   JOB MODULE STYLES
   ============================================ */

/* Progress Section */
.progress-section {
  margin-bottom: 24px;
}

.progress-header {
  display: flex;
  justify-content: space-between;
  margin-bottom: 8px;
}

.progress-bar {
  height: 12px;
  background: var(--surface-3);
  border-radius: 999px;
  overflow: hidden;
}

.progress-bar__fill {
  height: 100%;
  background: linear-gradient(90deg, var(--brand), var(--ok));
  transition: width 0.3s ease;
}

/* Next Rank */
.next-rank {
  padding: 16px;
  background: var(--surface-3);
  border-radius: var(--radius);
  margin-bottom: 16px;
}

.next-rank__label {
  font-size: 11px;
  text-transform: uppercase;
  font-weight: 700;
  opacity: 0.7;
  margin-bottom: 8px;
}

.next-rank__title {
  font-size: 16px;
  font-weight: 900;
  color: var(--brand);
  margin-bottom: 4px;
}

.next-rank__salary {
  font-size: 14px;
  margin-bottom: 8px;
  color: var(--ok);
}

.next-rank__stats {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

/* Max Rank */
.max-rank {
  text-align: center;
  padding: 24px;
}

.max-rank__icon {
  font-size: 48px;
  margin-bottom: 8px;
}

.max-rank__text {
  font-weight: 700;
  color: var(--brand);
}

/* Table Highlight */
.tbl__row--highlight {
  background: rgba(214, 181, 106, 0.1);
}

/* Specials Grid */
.specials-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 16px;
  margin-top: 20px;
}

.special-card {
  padding: 20px;
  background: var(--surface-3);
  border-radius: var(--radius);
  border: 2px solid rgba(255, 255, 255, 0.1);
  transition: all 0.2s ease;
}

.special-card--available {
  border-color: var(--brand);
}

.special-card__icon {
  font-size: 36px;
  text-align: center;
  margin-bottom: 12px;
}

.special-card__title {
  font-size: 16px;
  font-weight: 900;
  color: var(--brand);
  margin: 0 0 8px;
}

.special-card__desc {
  font-size: 13px;
  line-height: 1.4;
  color: var(--cmeta);
  margin-bottom: 12px;
}

.special-card__cost {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 12px;
}

/* Info Banner */
.info-banner {
  display: flex;
  align-items: center;
  gap: 20px;
}

.info-banner__icon {
  font-size: 56px;
  flex-shrink: 0;
}

.info-banner__title {
  font-size: 20px;
  font-weight: 900;
  color: var(--brand);
  margin: 0 0 8px;
}

.info-banner__text {
  font-size: 14px;
  line-height: 1.5;
  color: var(--cmeta);
  margin: 0;
}

/* Jobs Grid */
.jobs-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 20px;
}

.job-offer {
  padding: 24px;
  background: var(--surface-2);
  border-radius: var(--radius);
  border: 2px solid rgba(255, 255, 255, 0.1);
  transition: all 0.2s ease;
}

.job-offer--eligible {
  border-color: var(--ok);
}

.job-offer--locked {
  opacity: 0.6;
  border-color: var(--ko);
}

.job-offer__header {
  display: flex;
  gap: 16px;
  margin-bottom: 20px;
}

.job-offer__icon {
  font-size: 48px;
  flex-shrink: 0;
}

.job-offer__title {
  font-size: 18px;
  font-weight: 900;
  color: var(--brand);
  margin: 0 0 6px;
}

.job-offer__desc {
  font-size: 13px;
  line-height: 1.4;
  color: var(--cmeta);
  margin: 0;
}

.job-offer__rank {
  padding: 12px;
  background: var(--surface-3);
  border-radius: var(--radius);
  margin-bottom: 16px;
  text-align: center;
}

.job-offer__rank .cmeta {
  display: block;
  font-size: 10px;
  margin-bottom: 4px;
}

.job-offer__rank strong {
  font-size: 14px;
}

/* Job Requirements */
.job-requirements {
  padding: 16px;
  background: var(--surface-3);
  border-radius: var(--radius);
  border: 2px solid;
  margin-bottom: 16px;
}

.job-requirements--met {
  border-color: var(--ok);
}

.job-requirements--unmet {
  border-color: var(--ko);
}

.job-requirements__label {
  font-size: 11px;
  text-transform: uppercase;
  font-weight: 700;
  letter-spacing: 0.5px;
  margin-bottom: 12px;
  text-align: center;
}

.job-requirements--met .job-requirements__label {
  color: var(--ok);
}

.job-requirements--unmet .job-requirements__label {
  color: var(--ko);
}

.job-requirements__list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.requirement {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 13px;
  padding: 4px 0;
}

.requirement span:last-child {
  font-weight: 700;
}

/* Utilities */
.txt-ok {
  color: var(--ok);
}

.txt-ko {
  color: var(--ko);
}

/* Button Group */
.btn-group {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

/* Responsive */
@media (max-width: 768px) {
  .kpi-row {
    grid-template-columns: repeat(2, 1fr);
  }
  
  .specials-grid,
  .jobs-grid {
    grid-template-columns: 1fr;
  }
  
  .info-banner {
    flex-direction: column;
    text-align: center;
  }
  
  .job-offer__header {
    flex-direction: column;
    text-align: center;
  }
}

/* ============================================
   RECORDS PERSONNELS - GYM
   ============================================ */

.records-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
}

@media (max-width: 768px) {
  .records-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 480px) {
  .records-grid {
    grid-template-columns: 1fr;
  }
}

.record-card {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  background: linear-gradient(135deg, rgba(214, 181, 106, 0.08) 0%, rgba(214, 181, 106, 0.03) 100%);
  border: 1px solid rgba(214, 181, 106, 0.15);
  border-radius: 10px;
  transition: all 0.2s ease;
}

.record-card:hover {
  background: linear-gradient(135deg, rgba(214, 181, 106, 0.12) 0%, rgba(214, 181, 106, 0.05) 100%);
  border-color: rgba(214, 181, 106, 0.25);
  transform: translateY(-2px);
}

.record-icon {
  font-size: 24px;
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(214, 181, 106, 0.1);
  border-radius: 10px;
  flex-shrink: 0;
}

.record-info {
  flex: 1;
  min-width: 0;
}

.record-value {
  font-size: 1.25rem;
  font-weight: 800;
  color: var(--brand, #d6b56a);
  line-height: 1.2;
}

.record-value .record-unit {
  font-size: 0.75rem;
  font-weight: 600;
  opacity: 0.7;
}

.record-label {
  font-size: 0.75rem;
  color: var(--ink-2, #999);
  margin-top: 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Animation d'entrée */
.record-card {
  animation: recordFadeIn 0.3s ease forwards;
  opacity: 0;
}

.record-card:nth-child(1) { animation-delay: 0.05s; }
.record-card:nth-child(2) { animation-delay: 0.1s; }
.record-card:nth-child(3) { animation-delay: 0.15s; }
.record-card:nth-child(4) { animation-delay: 0.2s; }
.record-card:nth-child(5) { animation-delay: 0.25s; }
.record-card:nth-child(6) { animation-delay: 0.3s; }

@keyframes recordFadeIn {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Fix boutons flottants mobile */
@media (max-width: 768px) {
    .chatdock__minimized,
    .chat-bar {
        bottom: 80px !important;
    }
    
    .mobile-nav-toggle {
        bottom: 16px;
    }
}

@media (max-width: 480px) {
    .chatdock__minimized,
    .chat-bar {
        bottom: 85px !important;
    }
    
    .chatdock__mini-btn {
        width: 48px !important;
        height: 48px !important;
    }
}

/* Footer minimal */
.footer-minimal {
    padding: 12px 20px;
    background: rgba(0,0,0,.6);
    border-top: 1px solid var(--bd);
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 8px;
    font-size: 11px;
    color: #666;
}

.footer-minimal a {
    color: var(--brand-2);
    font-weight: 600;
}

.footer-minimal .sep {
    opacity: 0.3;
}

@media (max-width: 480px) {
    .footer-minimal {
        flex-wrap: wrap;
        padding-bottom: 90px;
    }
}

@media (max-width: 768px) {
  /* Cacher seulement les infos utilisateur (avatar, pseudo, ressources) */
  .user-strip .user-main {
    display: none !important;
  }

  /* Logo à gauche, status à droite */
  .user-strip {
    justify-content: space-between;
    padding: 8px 16px;
  }

  /* Optionnel : réduire légèrement le logo sur mobile */
  .header-logo .brand-logo {
    height: 32px;
    width: auto;
  }
}