/* ==========================================================================
   LE PORTIER — feuille de style
   ========================================================================== */

:root {
  --gold: #c8a95e;
  --gold-soft: #e0c887;
  --ink: #0d0f13;
  --ink-2: #161a21;
  --ink-3: #1f242e;
  --line: rgba(200, 169, 94, 0.22);
  --text: #e8e4dc;
  --text-dim: #9aa0ab;
  --green: #4fb477;
  --red: #d9534f;
  --orange: #e8a33d;
  --blue: #5a9fd6;
  --sans: "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --serif: "Georgia", "Times New Roman", serif;
  --radius: 10px;
}

* { box-sizing: border-box; }

html, body {
  margin: 0; padding: 0; height: 100%; overflow: hidden;
  background: #05070a; color: var(--text);
  font-family: var(--sans);
  -webkit-font-smoothing: antialiased;
}

#app { position: fixed; inset: 0; }
#canvas-container { position: absolute; inset: 0; }
#canvas-container canvas { display: block; width: 100%; height: 100%; }

.hidden { display: none !important; }

kbd {
  display: inline-block;
  min-width: 1.35em;
  padding: 1px 5px;
  margin: 0 2px;
  font-family: var(--sans);
  font-size: 0.82em;
  font-weight: 600;
  line-height: 1.5;
  text-align: center;
  color: #10131a;
  background: linear-gradient(#f2ece0, #cfc7b6);
  border-radius: 4px;
  border-bottom: 2px solid #8e8778;
}

.panel {
  background: linear-gradient(160deg, rgba(22, 26, 33, 0.88), rgba(13, 15, 19, 0.92));
  border: 1px solid var(--line);
  border-radius: var(--radius);
  backdrop-filter: blur(6px);
  box-shadow: 0 6px 26px rgba(0, 0, 0, 0.5);
}

/* ---------------- Boutons ---------------- */
.btn {
  font-family: var(--sans);
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 0.02em;
  color: var(--text);
  background: linear-gradient(#252b35, #171b22);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px 18px;
  cursor: pointer;
  transition: transform 0.08s ease, background 0.15s ease, border-color 0.15s ease;
}
.btn:hover { background: linear-gradient(#2f3743, #1d222b); border-color: var(--gold); }
.btn:active { transform: translateY(1px); }
.btn-primary {
  color: #1a1408;
  background: linear-gradient(#e3c987, #c8a95e);
  border-color: #f0dba6;
}
.btn-primary:hover { background: linear-gradient(#f0dba6, #d8b96c); }
.btn-danger { color: #ffd9d7; border-color: rgba(217, 83, 79, 0.5); }
.btn-danger:hover { background: linear-gradient(#4a2523, #2a1615); border-color: var(--red); }
.btn-ghost { background: transparent; border-color: rgba(255, 255, 255, 0.14); color: var(--text-dim); }
.btn-ghost:hover { color: var(--text); }
.btn-small { font-size: 12px; padding: 6px 12px; }
.btn-big { font-size: 17px; padding: 14px 34px; }
.btn:disabled { opacity: 0.4; cursor: not-allowed; transform: none; }

/* ==========================================================================
   HUD
   ========================================================================== */
#hud { position: absolute; inset: 0; pointer-events: none; user-select: none; }

#hud-top {
  position: absolute; top: 14px; left: 14px; right: 14px;
  display: flex; justify-content: space-between; align-items: flex-start; gap: 12px;
}
#hud-stats { padding: 10px 14px; min-width: 260px; }
#hud-level { padding: 10px 16px; text-align: right; }
.level-name { font-family: var(--serif); font-size: 18px; color: var(--gold-soft); letter-spacing: 0.04em; }
.level-sub { font-size: 11px; color: var(--text-dim); margin-top: 2px; }

.stat { display: flex; align-items: center; gap: 8px; }
.stat-label { font-size: 10px; text-transform: uppercase; letter-spacing: 0.1em; color: var(--text-dim); white-space: nowrap; }
.stat-val { font-size: 12px; font-weight: 700; font-variant-numeric: tabular-nums; min-width: 34px; text-align: right; }
.stat-row { display: flex; gap: 6px; margin-top: 8px; }
.chip {
  font-size: 12px; font-weight: 700; font-variant-numeric: tabular-nums;
  padding: 3px 9px; border-radius: 999px;
  background: rgba(255, 255, 255, 0.06); border: 1px solid rgba(255, 255, 255, 0.09);
}
#money-chip { color: var(--gold-soft); }

.bar {
  position: relative; flex: 1; height: 8px; min-width: 90px;
  background: rgba(0, 0, 0, 0.55);
  border: 1px solid rgba(255, 255, 255, 0.09);
  border-radius: 999px; overflow: hidden;
}
.bar-fill { position: absolute; inset: 0 auto 0 0; width: 100%; border-radius: 999px; transition: width 0.25s ease, background 0.3s ease; }
.bar-rep .bar-fill { background: linear-gradient(90deg, #3f9e68, #6ed49a); }
.bar-dmg .bar-fill { width: 0%; background: linear-gradient(90deg, #4fb477, #e8a33d); }
.bar-stam .bar-fill { background: linear-gradient(90deg, #4c7fb5, #7dc0f0); }

#hud-objective {
  position: absolute; top: 92px; left: 50%; transform: translateX(-50%);
  max-width: 620px; text-align: center;
  padding: 9px 20px; border-radius: 999px;
  background: rgba(10, 12, 16, 0.82);
  border: 1px solid var(--line);
  font-size: 14px; color: var(--gold-soft);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.5);
  animation: objPop 0.3s ease;
}
@keyframes objPop { from { opacity: 0; transform: translateX(-50%) translateY(-8px); } }

#client-list {
  position: absolute; top: 130px; right: 14px;
  display: flex; flex-direction: column; gap: 6px; width: 250px;
}
.client-card {
  padding: 7px 10px; border-radius: 8px;
  background: rgba(14, 17, 22, 0.86);
  border: 1px solid rgba(255, 255, 255, 0.09);
  border-left: 3px solid var(--blue);
  font-size: 12px;
  animation: slideIn 0.3s ease;
}
@keyframes slideIn { from { opacity: 0; transform: translateX(20px); } }
.client-card.returning { border-left-color: var(--orange); }
.client-card.urgent { border-left-color: var(--red); animation: pulse 1s infinite; }
@keyframes pulse { 50% { background: rgba(60, 20, 20, 0.86); } }
.client-card .cc-top { display: flex; justify-content: space-between; align-items: baseline; }
.client-card .cc-name { font-weight: 700; }
.client-card .cc-tag { font-size: 10px; color: var(--text-dim); text-transform: uppercase; letter-spacing: 0.06em; }
.client-card .cc-detail { color: var(--text-dim); font-size: 11px; margin-top: 1px; }
.client-card .cc-bar { height: 4px; margin-top: 5px; background: rgba(0, 0, 0, 0.5); border-radius: 999px; overflow: hidden; }
.client-card .cc-bar > div { height: 100%; background: var(--green); border-radius: 999px; transition: width 0.2s linear, background 0.3s; }

#hud-center { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; }
#crosshair { width: 5px; height: 5px; border-radius: 50%; background: rgba(255, 255, 255, 0.55); box-shadow: 0 0 4px rgba(0, 0, 0, 0.9); }
#interact-prompt {
  margin-top: 34px; padding: 8px 16px; border-radius: 999px;
  background: rgba(10, 12, 16, 0.88); border: 1px solid var(--gold);
  font-size: 14px; display: flex; align-items: center; gap: 8px;
  box-shadow: 0 4px 18px rgba(0, 0, 0, 0.6);
}

#hud-bottom {
  position: absolute; bottom: 14px; left: 14px; right: 14px;
  display: flex; justify-content: space-between; align-items: flex-end; gap: 12px;
}
#keyring { padding: 8px 10px; min-width: 190px; max-width: 340px; }
.keyring-title { font-size: 10px; text-transform: uppercase; letter-spacing: 0.1em; color: var(--text-dim); margin-bottom: 6px; }
#keyring-items { display: flex; flex-wrap: wrap; gap: 5px; }
.key-item {
  display: flex; align-items: center; gap: 5px;
  padding: 4px 9px; border-radius: 6px; font-size: 12px;
  background: rgba(255, 255, 255, 0.05); border: 1px solid rgba(255, 255, 255, 0.1);
}
.key-item.active { border-color: var(--gold); background: rgba(200, 169, 94, 0.16); color: var(--gold-soft); box-shadow: 0 0 12px rgba(200, 169, 94, 0.25); }
.key-item .ki-num { font-size: 10px; color: var(--text-dim); }
.keyring-empty { font-size: 12px; color: var(--text-dim); font-style: italic; }

#hud-right { display: flex; flex-direction: column; align-items: flex-end; gap: 8px; }
#car-gauges { padding: 10px 12px; display: flex; align-items: flex-end; gap: 14px; }
.gauge-damage { display: flex; flex-direction: column; gap: 4px; width: 160px; }
.gauge-damage .bar { min-width: 160px; height: 10px; }
.gauge-damage .stat-val { text-align: left; }
#speedo { position: relative; width: 110px; height: 110px; }
#speedo-canvas { width: 110px; height: 110px; }
#gear-ind {
  position: absolute; bottom: 16px; left: 50%; transform: translateX(-50%);
  font-size: 13px; font-weight: 700; color: var(--gold-soft); letter-spacing: 0.08em;
}
#stamina-wrap { padding: 8px 12px; display: flex; align-items: center; gap: 8px; }
#stamina-wrap .bar { min-width: 120px; }
#move-mode { color: var(--text-dim); font-weight: 600; min-width: 66px; }

#minimap-wrap { position: absolute; bottom: 14px; left: 50%; transform: translateX(-50%); text-align: center; }
#minimap {
  width: 420px; height: 336px;
  background: rgba(8, 10, 13, 0.93);
  border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.6);
}
.minimap-legend { font-size: 11px; color: var(--text-dim); margin-top: 4px; }

#toasts { position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%); display: flex; flex-direction: column; align-items: center; gap: 8px; width: 460px; }
.toast {
  padding: 10px 20px; border-radius: 8px; font-size: 14px; font-weight: 600; text-align: center;
  background: rgba(12, 15, 20, 0.92); border: 1px solid rgba(255, 255, 255, 0.12);
  box-shadow: 0 6px 24px rgba(0, 0, 0, 0.6);
  animation: toastIn 0.28s cubic-bezier(0.2, 1.4, 0.4, 1);
}
.toast.good { border-color: rgba(79, 180, 119, 0.6); color: #a8e8c2; }
.toast.bad { border-color: rgba(217, 83, 79, 0.6); color: #ffb3b0; }
.toast.info { border-color: var(--line); color: var(--gold-soft); }
.toast.money { border-color: rgba(200, 169, 94, 0.6); color: var(--gold-soft); font-size: 17px; }
.toast.out { animation: toastOut 0.35s ease forwards; }
@keyframes toastIn { from { opacity: 0; transform: scale(0.9) translateY(10px); } }
@keyframes toastOut { to { opacity: 0; transform: translateY(-16px); } }

#damage-flash {
  position: absolute; inset: 0; pointer-events: none; opacity: 0;
  box-shadow: inset 0 0 160px rgba(220, 40, 30, 0.85);
  transition: opacity 0.35s ease;
}

/* ==========================================================================
   MODALS
   ========================================================================== */
#modal-layer {
  position: absolute; inset: 0; z-index: 40;
  display: flex; align-items: center; justify-content: center;
  background: rgba(4, 6, 9, 0.62); backdrop-filter: blur(3px);
}
.modal {
  width: 480px; max-width: 92vw; max-height: 88vh; overflow: auto;
  padding: 22px 26px;
  background: linear-gradient(165deg, #1b2029, #10131a);
  border: 1px solid var(--line); border-radius: 14px;
  box-shadow: 0 20px 70px rgba(0, 0, 0, 0.75);
  animation: modalIn 0.22s cubic-bezier(0.2, 1.2, 0.4, 1);
}
.modal-wide { width: 780px; }
@keyframes modalIn { from { opacity: 0; transform: scale(0.95) translateY(12px); } }
.modal-head { display: flex; align-items: baseline; gap: 12px; margin-bottom: 16px; border-bottom: 1px solid var(--line); padding-bottom: 10px; }
.modal-head h2 { margin: 0; font-family: var(--serif); font-size: 21px; font-weight: 400; color: var(--gold-soft); letter-spacing: 0.03em; }
.modal-sub { font-size: 12px; color: var(--text-dim); }
.modal-actions { display: flex; justify-content: flex-end; align-items: center; gap: 10px; margin-top: 18px; }
.modal-actions.column { flex-direction: column; align-items: stretch; }
.hint { font-size: 11px; color: var(--text-dim); flex: 1; }

.modal label { display: block; font-size: 12px; color: var(--text-dim); margin-bottom: 6px; }
.modal input[type="text"] {
  width: 100%; padding: 11px 14px; font-size: 16px; font-family: var(--sans);
  color: var(--text); background: rgba(0, 0, 0, 0.4);
  border: 1px solid rgba(255, 255, 255, 0.16); border-radius: 8px; outline: none;
}
.modal input[type="text"]:focus { border-color: var(--gold); box-shadow: 0 0 0 3px rgba(200, 169, 94, 0.15); }

.ticket-visual { display: flex; justify-content: center; margin-bottom: 18px; }
.ticket-stub {
  width: 260px; padding: 14px 16px; text-align: center;
  background: linear-gradient(#f6f1e4, #e6dfcd); color: #2a2418;
  border-radius: 6px; box-shadow: 0 8px 22px rgba(0, 0, 0, 0.5);
  transform: rotate(-1.4deg);
  border: 1px dashed #b3a98d;
}
.ticket-hotel { font-family: var(--serif); font-size: 10px; letter-spacing: 0.18em; color: #7a6c4c; }
.ticket-label { font-size: 9px; letter-spacing: 0.24em; color: #9c8f6e; margin-bottom: 6px; }
.ticket-text { font-family: var(--serif); font-size: 26px; font-weight: 700; min-height: 34px; word-break: break-word; }
.ticket-car { font-size: 10px; color: #7a6c4c; margin-top: 4px; }
.ticket-num { font-family: var(--serif); font-size: 40px; text-align: center; color: var(--gold-soft); }

#cabinet-grid { display: grid; grid-template-columns: repeat(8, 1fr); gap: 8px; }
.cubby {
  position: relative; aspect-ratio: 1 / 1.05;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
  background: linear-gradient(#2a2117, #1a150e);
  border: 1px solid #3d3324; border-radius: 5px;
  cursor: pointer; transition: all 0.12s ease; overflow: hidden;
  pointer-events: auto;
}
.cubby:hover { border-color: var(--gold); background: linear-gradient(#3a2e1e, #241c12); }
.cubby.occupied { background: linear-gradient(#3a2e1e, #241c12); border-color: #6d5a37; }
.cubby.selected { border-color: var(--gold); box-shadow: 0 0 0 2px rgba(200, 169, 94, 0.4); }
.cubby .cub-num { position: absolute; top: 2px; left: 4px; font-size: 9px; color: #8a7a58; font-weight: 700; }
.cubby .cub-icon { font-size: 20px; line-height: 1; filter: drop-shadow(0 2px 3px rgba(0, 0, 0, 0.6)); }
.cubby .cub-label { font-size: 9px; color: var(--gold-soft); text-align: center; padding: 0 2px; word-break: break-word; line-height: 1.1; max-height: 2.3em; overflow: hidden; }
.cubby .cub-edit { position: absolute; bottom: 1px; right: 2px; font-size: 8px; color: #6a5c40; }
.cubby input {
  width: 92%; font-size: 10px; text-align: center; padding: 1px 2px;
  background: rgba(0, 0, 0, 0.5); color: var(--gold-soft);
  border: 1px solid var(--gold); border-radius: 3px; outline: none;
}
.cabinet-foot { display: flex; align-items: center; gap: 12px; margin-top: 16px; }

#notebook-table { width: 100%; border-collapse: collapse; font-size: 13px; }
#notebook-table th { text-align: left; font-size: 10px; text-transform: uppercase; letter-spacing: 0.1em; color: var(--text-dim); padding: 4px 6px; border-bottom: 1px solid var(--line); }
#notebook-table td { padding: 3px 4px; }
#notebook-table input {
  width: 100%; padding: 6px 8px; font-size: 13px; font-family: var(--sans);
  color: var(--text); background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08); border-radius: 5px; outline: none;
}
#notebook-table input:focus { border-color: var(--gold); background: rgba(0, 0, 0, 0.4); }
#notebook-table input:read-only { color: var(--text-dim); background: rgba(255, 255, 255, 0.02); }
.nb-del { cursor: pointer; color: #6a5c40; padding: 0 6px; font-size: 15px; }
.nb-del:hover { color: var(--red); }
#notebook-body { max-height: 52vh; overflow: auto; }

#pause-settings { display: flex; flex-direction: column; gap: 10px; margin-bottom: 6px; }

/* ==========================================================================
   ÉCRANS
   ========================================================================== */
.screen {
  position: absolute; inset: 0; z-index: 50;
  display: flex; align-items: center; justify-content: center;
  overflow: auto;
  /* Fond opaque : le canvas du jeu ne doit jamais transparaître, ni derrière la
     barre de défilement, ni sous le contenu quand le menu déborde. */
  background: #05070a;
}
.menu-bg {
  /* fixed et non absolute : sinon il remonte avec le défilement du menu et
     laisse une bande vide en bas de l'écran. */
  position: fixed; inset: 0;
  background:
    radial-gradient(1100px 700px at 70% 20%, rgba(200, 169, 94, 0.13), transparent 62%),
    radial-gradient(800px 600px at 15% 85%, rgba(60, 90, 140, 0.16), transparent 60%),
    linear-gradient(160deg, #0b0e13, #05070a 60%);
}
.menu-bg::after {
  content: ""; position: absolute; inset: 0;
  background-image: repeating-linear-gradient(0deg, rgba(255, 255, 255, 0.014) 0 1px, transparent 1px 3px);
  pointer-events: none;
}

.logo {
  font-family: var(--serif); font-weight: 400;
  font-size: 52px; letter-spacing: 0.18em; margin: 4px 0 3px;
  color: var(--gold-soft);
  text-shadow: 0 4px 40px rgba(200, 169, 94, 0.35);
}
.logo-mark { font-size: 44px; }
.brand-sub { font-size: 11px; letter-spacing: 0.42em; color: var(--gold); }
.brand-tag { font-size: 13px; color: var(--text-dim); letter-spacing: 0.06em; }

.loading-inner { position: relative; text-align: center; }
.loading-bar { width: 300px; height: 3px; margin: 22px auto 10px; background: rgba(255, 255, 255, 0.1); border-radius: 999px; overflow: hidden; }
#loading-fill { height: 100%; width: 0%; background: var(--gold); transition: width 0.3s ease; }
#loading-text { font-size: 12px; color: var(--text-dim); }
#screen-loading { background: linear-gradient(160deg, #0b0e13, #05070a); }

.menu-inner { position: relative; width: 1180px; max-width: 96vw; padding: 18px 0 24px; }
.menu-brand { text-align: center; margin-bottom: 16px; }
.menu-cols { display: grid; grid-template-columns: 1fr 330px; gap: 22px; align-items: start; }
.menu-list { display: flex; flex-direction: column; gap: 8px; }

.level-card {
  display: grid; grid-template-columns: 60px 1fr auto; align-items: center; gap: 16px;
  padding: 11px 18px; text-align: left; cursor: pointer;
  background: linear-gradient(100deg, rgba(24, 28, 35, 0.9), rgba(14, 17, 22, 0.9));
  border: 1px solid var(--line); border-left: 3px solid transparent; border-radius: var(--radius);
  transition: all 0.15s ease;
}
.level-card:hover { border-left-color: var(--gold); transform: translateX(4px); background: linear-gradient(100deg, rgba(34, 40, 50, 0.95), rgba(18, 22, 28, 0.95)); }
.level-card .lc-icon { font-size: 30px; text-align: center; }
.level-card .lc-title { font-family: var(--serif); font-size: 20px; color: var(--gold-soft); }
.level-card .lc-desc { font-size: 12px; color: var(--text-dim); margin-top: 3px; line-height: 1.45; }
.level-card .lc-meta { display: flex; gap: 6px; margin-top: 7px; flex-wrap: wrap; }
.level-card .lc-best { text-align: right; font-size: 11px; color: var(--text-dim); white-space: nowrap; }
.level-card .lc-best b { display: block; font-size: 17px; color: var(--gold-soft); }
.tag { font-size: 10px; padding: 2px 8px; border-radius: 999px; background: rgba(255, 255, 255, 0.06); border: 1px solid rgba(255, 255, 255, 0.09); color: var(--text-dim); }
.tag.hard { color: #ffb3b0; border-color: rgba(217, 83, 79, 0.4); }
.tag.easy { color: #a8e8c2; border-color: rgba(79, 180, 119, 0.4); }

.side-panel { padding: 13px 16px; margin-bottom: 9px; }
.side-title { font-family: var(--serif); font-size: 15px; color: var(--gold-soft); margin-bottom: 10px; letter-spacing: 0.05em; }
.side-money { font-size: 25px; font-weight: 700; color: var(--gold-soft); margin-bottom: 12px; font-variant-numeric: tabular-nums; }
.controls-list { list-style: none; margin: 0; padding: 0; font-size: 11.5px; color: var(--text-dim); line-height: 2; }

.shop-item {
  display: flex; align-items: center; gap: 10px; padding: 8px 4px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}
.shop-item:last-child { border-bottom: none; }
.shop-item .si-icon { font-size: 20px; width: 26px; text-align: center; }
.shop-item .si-body { flex: 1; }
.shop-item .si-name { font-size: 13px; font-weight: 600; }
.shop-item .si-desc { font-size: 10.5px; color: var(--text-dim); line-height: 1.35; }
.shop-item .si-owned { font-size: 11px; color: var(--green); font-weight: 700; }

.setup-inner { position: relative; width: 700px; max-width: 94vw; padding: 30px 34px 26px; }
.back-btn { position: absolute; top: 16px; left: 16px; }
.setup-inner h2 { font-family: var(--serif); font-weight: 400; font-size: 30px; color: var(--gold-soft); margin: 10px 0 4px; text-align: center; }
.setup-desc { text-align: center; color: var(--text-dim); font-size: 13px; margin: 0 0 22px; line-height: 1.55; }
.setup-actions { text-align: center; margin-top: 24px; }

.opt-row { display: flex; align-items: center; gap: 14px; padding: 9px 2px; border-bottom: 1px solid rgba(255, 255, 255, 0.05); }
.opt-row:last-child { border-bottom: none; }
.opt-label { flex: 0 0 210px; font-size: 13px; }
.opt-label small { display: block; color: var(--text-dim); font-size: 10.5px; line-height: 1.35; margin-top: 1px; }
.opt-control { flex: 1; display: flex; gap: 6px; flex-wrap: wrap; justify-content: flex-end; }
.seg {
  font-size: 12px; padding: 6px 12px; border-radius: 6px; cursor: pointer;
  background: rgba(255, 255, 255, 0.04); border: 1px solid rgba(255, 255, 255, 0.1); color: var(--text-dim);
  transition: all 0.12s;
}
.seg:hover { color: var(--text); border-color: rgba(255, 255, 255, 0.25); }
.seg.on { background: rgba(200, 169, 94, 0.18); border-color: var(--gold); color: var(--gold-soft); }
input[type="range"] { width: 160px; accent-color: var(--gold); }
.range-val { font-size: 12px; color: var(--text-dim); min-width: 40px; text-align: right; font-variant-numeric: tabular-nums; }

.end-inner { position: relative; width: 620px; max-width: 94vw; padding: 30px 34px; text-align: center; }
.end-verdict { font-family: var(--serif); font-size: 34px; color: var(--gold-soft); }
.end-verdict.fail { color: #ff9b97; }
.end-stars { font-size: 30px; letter-spacing: 0.14em; margin: 8px 0 4px; color: var(--gold); }
.end-reason { color: var(--text-dim); font-size: 13px; margin-bottom: 18px; }
.end-stats { width: 100%; border-collapse: collapse; font-size: 13px; margin-bottom: 22px; }
.end-stats td { padding: 7px 4px; border-bottom: 1px solid rgba(255, 255, 255, 0.06); text-align: left; }
.end-stats td:last-child { text-align: right; font-weight: 700; font-variant-numeric: tabular-nums; }
.end-stats tr.hl td:last-child { color: var(--gold-soft); font-size: 15px; }
.end-actions { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; }

#fade { position: absolute; inset: 0; background: #000; opacity: 0; pointer-events: none; transition: opacity 0.4s ease; z-index: 60; }
#fade.on { opacity: 1; }

/* interactif malgré le HUD non cliquable */
#modal-layer, .screen, .btn, .seg, .cubby, input, select, textarea { pointer-events: auto; }

::-webkit-scrollbar { width: 9px; height: 9px; }
::-webkit-scrollbar-track { background: #0b0e13; }
::-webkit-scrollbar-thumb { background: rgba(200, 169, 94, 0.3); border-radius: 999px; }
::-webkit-scrollbar-thumb:hover { background: rgba(200, 169, 94, 0.5); }

@media (max-width: 900px) {
  .menu-cols { grid-template-columns: 1fr; }
  .logo { font-size: 42px; }
  #minimap { width: 300px; height: 240px; }
}

/* Écrans peu hauts (portables) : on resserre le menu pour qu'il tienne
   entièrement, sans barre de défilement. */
@media (max-height: 920px) {
  .menu-inner { padding: 12px 0 16px; }
  .menu-brand { margin-bottom: 10px; }
  .logo { font-size: 42px; }
  .brand-sub { font-size: 10px; }
  .brand-tag { font-size: 12px; }
  .menu-list { gap: 6px; }
  .level-card { padding: 8px 16px; grid-template-columns: 48px 1fr auto; gap: 12px; }
  .level-card .lc-icon { font-size: 25px; }
  .level-card .lc-title { font-size: 17px; }
  .level-card .lc-desc { font-size: 11px; line-height: 1.35; margin-top: 2px; }
  .level-card .lc-meta { margin-top: 5px; }
  .side-panel { padding: 10px 14px; margin-bottom: 7px; }
  .side-money { font-size: 21px; margin-bottom: 8px; }
  .side-title { margin-bottom: 7px; }
  .shop-item { padding: 5px 4px; }
  .shop-item .si-desc { font-size: 10px; }
  .controls-list { font-size: 11px; line-height: 1.75; }
}

/* Très peu de hauteur (1366×768 et compagnie) : dernier cran de compacité. */
@media (max-height: 810px) {
  .menu-inner { padding: 8px 0 12px; }
  .logo { font-size: 36px; }
  .menu-brand { margin-bottom: 8px; }
  .brand-tag { font-size: 11px; }
  .shop-item { padding: 4px 4px; }
  .shop-item .si-name { font-size: 12px; }
  .controls-list { line-height: 1.6; }
  .level-card .lc-desc { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
}
