@import url('https://fonts.googleapis.com/css2?family=Cinzel:wght@400;600&family=Lora:ital,wght@0,400;0,600;1,400&display=swap');

/* ── Variables ─────────────────────────────────────────────────── */
:root {
  --bg-dark:       #12100a;
  --bg-panel:      #1e1a0f;
  --bg-card:       #2a2314;
  --bg-input:      #0d0b07;
  --gold:          #c9a84c;
  --gold-light:    #e8d08a;
  --gold-dim:      #7a6430;
  --text:          #d4c5a0;
  --text-dim:      #7a6e52;
  --text-bright:   #ede4c8;
  --danger:        #8b2020;
  --danger-light:  #e87070;
  --border:        #3a2e18;
  --border-gold:   #5a4a28;
  --font-title:    'Cinzel', serif;
  --font-body:     'Lora', serif;
  --stats-bar-h:   50px;
}

/* ── Reset ─────────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html, body {
  height: 100%;
  overflow: hidden; /* l'app ne scroll pas — c'est la narrative qui scroll */
}

body {
  background: var(--bg-dark);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.7;
}

/* ── Layout principal ──────────────────────────────────────────── */
.game-container {
  display: flex;
  flex-direction: column;
  height: calc(100vh - var(--stats-bar-h));
  height: calc(100dvh - var(--stats-bar-h));
  max-width: 720px;
  margin: 0 auto;
  padding: 12px 12px 8px;
  gap: 10px;
  overflow: hidden;
}

/* ── Narrative ─────────────────────────────────────────────────── */
.narrative-panel {
  flex: 1;
  min-height: 0;          /* indispensable pour que flex+overflow fonctionne */
  overflow-y: auto;
  background: var(--bg-panel);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 18px 20px;
  position: relative;
}

.narrative-entry {
  color: var(--text);
  line-height: 1.85;
  margin-bottom: 4px;
}

.narrative-separator {
  border: none;
  border-top: 1px solid var(--border);
  margin: 16px 0;
  opacity: 0.5;
}

.player-bubble {
  display: flex;
  justify-content: flex-end;
  margin: 10px 0 14px;
}
.player-bubble-text {
  display: inline-block;
  max-width: 78%;
  background: var(--bg-card);
  border: 1px solid var(--border-gold);
  border-radius: 14px 14px 2px 14px;
  padding: 8px 16px;
  color: var(--text-bright);
  font-style: italic;
  line-height: 1.65;
  text-align: left;
}

.error-block {
  display: flex;
  align-items: center;
  gap: 10px;
  color: #f88;
  font-style: italic;
  flex-wrap: wrap;
}
.error-icon { flex-shrink: 0; }
.btn-retry {
  margin-left: auto;
  padding: 4px 14px;
  background: transparent;
  border: 1px solid rgba(248,136,136,0.4);
  border-radius: 4px;
  color: #f88;
  font-family: inherit;
  font-size: 0.9em;
  cursor: pointer;
  transition: background 0.2s, border-color 0.2s;
}
.btn-retry:hover { background: rgba(248,136,136,0.12); border-color: #f88; }

.narrative-loading {
  position: absolute;
  bottom: 12px;
  left: 50%;
  transform: translateX(-50%);
  color: var(--text-dim);
  font-style: italic;
  font-size: 0.88em;
  animation: pulse 1.8s ease-in-out infinite;
  white-space: nowrap;
  pointer-events: none;
}

@keyframes pulse {
  0%, 100% { opacity: 0.3; }
  50%       { opacity: 1;   }
}

/* ── Combat ────────────────────────────────────────────────────── */
.combat-panel {
  flex-shrink: 0;
  background: rgba(100, 20, 20, 0.14);
  border: 1px solid rgba(139, 32, 32, 0.55);
  border-radius: 4px;
  padding: 12px 16px;
}

.combat-panel.hidden { display: none; }

.combat-title {
  font-family: var(--font-title);
  font-size: 0.75em;
  letter-spacing: 3px;
  color: var(--danger-light);
  text-align: center;
  margin-bottom: 10px;
}

.enemy-info { margin-bottom: 10px; }

.enemy-name {
  font-family: var(--font-title);
  color: var(--danger-light);
  font-size: 1em;
  margin-bottom: 2px;
}

.enemy-desc {
  font-size: 0.8em;
  color: var(--text-dim);
  font-style: italic;
  margin-bottom: 6px;
}

.enemy-hp-wrap {
  display: flex;
  align-items: center;
  gap: 10px;
}

.enemy-hp-bar {
  flex: 1;
  background: rgba(0,0,0,0.5);
  border: 1px solid rgba(139,32,32,0.4);
  height: 7px;
  border-radius: 2px;
  overflow: hidden;
}

.enemy-hp-val {
  font-size: 0.75em;
  color: var(--danger-light);
  white-space: nowrap;
}

.combat-actions {
  display: flex;
  gap: 8px;
  margin-bottom: 10px;
}

.combat-btn {
  flex: 1;
  padding: 8px 4px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 3px;
  color: var(--text);
  font-family: var(--font-body);
  font-size: 0.85em;
  cursor: pointer;
  transition: all 0.18s;
}

.combat-btn:hover  { border-color: var(--gold-dim); color: var(--gold-light); }
.combat-btn:disabled { opacity: 0.4; cursor: not-allowed; }
.combat-btn.btn-attack { border-color: rgba(139,32,32,0.5); }
.combat-btn.btn-attack:hover { background: rgba(139,32,32,0.2); color: var(--danger-light); }

.combat-log {
  background: rgba(0,0,0,0.35);
  border: 1px solid var(--border);
  padding: 8px 10px;
  border-radius: 2px;
  font-size: 0.8em;
  max-height: 90px;
  overflow-y: auto;
  line-height: 1.6;
}

.combat-log div { margin-bottom: 2px; }

/* ── Response ──────────────────────────────────────────────────── */
.response-panel {
  flex-shrink: 0;
  background: var(--bg-panel);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 12px 16px;
}

.qcm-bar {
  display: flex;
  justify-content: flex-end;
  margin-bottom: 4px;
}

.qcm-toggle {
  background: none;
  border: none;
  color: var(--text-dim);
  cursor: pointer;
  padding: 8px 12px;
  font-size: 13px;
  line-height: 1;
  transition: color 0.15s;
  margin: -8px -12px;
}

.qcm-toggle i { transition: transform 0.2s; }
.qcm-toggle:hover { color: var(--gold-light); }

#qcm-mode.collapsed .qcm-toggle i { transform: rotate(180deg); }
#qcm-mode.collapsed #choices-container { display: none; }
#qcm-mode.collapsed .qcm-bar { margin-bottom: 0; }

.choices {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 10px;
}

.choice-btn {
  padding: 9px 14px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 3px;
  color: var(--text);
  font-family: var(--font-body);
  font-size: 0.9em;
  cursor: pointer;
  text-align: left;
  transition: all 0.15s;
  line-height: 1.4;
}

.choice-btn::before { content: '› '; color: var(--gold-dim); }
.choice-btn:hover   { border-color: var(--border-gold); color: var(--text-bright); background: rgba(201,168,76,0.06); padding-left: 20px; }
.choice-btn:disabled { opacity: 0.4; cursor: not-allowed; }

.free-text-zone {
  display: flex;
  gap: 8px;
  align-items: flex-end;
}

.free-text-zone.hidden { display: none; }
.qcm-mode.hidden       { display: none; }

#player-input {
  flex: 1;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: 3px;
  color: var(--text);
  font-family: var(--font-body);
  font-size: 0.9em;
  padding: 8px 12px;
  resize: none;
  height: 60px;
  transition: border-color 0.2s;
  line-height: 1.5;
}

#player-input:focus          { outline: none; border-color: var(--border-gold); }
#player-input::placeholder   { color: var(--text-dim); font-style: italic; }

#send-btn {
  padding: 8px 16px;
  background: var(--bg-card);
  border: 1px solid var(--border-gold);
  border-radius: 3px;
  color: var(--gold);
  font-family: var(--font-title);
  font-size: 0.78em;
  letter-spacing: 1.5px;
  cursor: pointer;
  transition: all 0.2s;
  white-space: nowrap;
  height: 42px;
  align-self: flex-end;
}

#send-btn:hover    { background: rgba(201,168,76,0.12); }
#send-btn:disabled { opacity: 0.4; cursor: not-allowed; }


/* ══════════════════════════════════════════════════════════════════
   BARRE DE STATS FIXE
══════════════════════════════════════════════════════════════════ */
.stats-bar {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  height: var(--stats-bar-h);
  background: rgba(14, 12, 7, 0.96);
  border-top: 1px solid var(--border);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  display: flex;
  align-items: center;
  padding: 0 14px;
  gap: 10px;
  z-index: 100;

  /* safe area pour les appareils avec barre home */
  padding-bottom: env(safe-area-inset-bottom);
}

.sb-stat {
  display: flex;
  align-items: center;
  gap: 5px;
  flex-shrink: 0;
}

.sb-stat-col {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 2px;
}

.sb-time {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1px;
  flex-shrink: 0;
  position: relative;
  cursor: pointer;
}

.time-popup {
  position: absolute;
  bottom: calc(100% + 10px);
  left: 50%;
  transform: translateX(-50%);
  background: var(--bg-panel);
  border: 1px solid var(--border-gold);
  border-radius: 6px;
  padding: 5px 11px;
  font-size: 12px;
  color: var(--text-main);
  white-space: nowrap;
  z-index: 200;
  pointer-events: none;
  box-shadow: 0 -4px 14px rgba(0,0,0,0.5);
}

.time-popup::after {
  content: '';
  position: absolute;
  top: 100%;
  left: 50%;
  transform: translateX(-50%);
  border: 5px solid transparent;
  border-top-color: var(--border-gold);
}
.sb-time-icon {
  font-size: 15px;
  line-height: 1;
  transition: color 0.6s ease;
}
.sb-time-label {
  font-size: 9px;
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: 0.8px;
  white-space: nowrap;
}

.sb-icon {
  font-size: 13px;
  line-height: 1;
}
.sb-pv-icon   { color: var(--danger-light); }
.sb-faim-icon { color: #a0852a; }

/* Mini barre PV */
.sb-mini-bar {
  width: 52px;
  height: 6px;
  background: rgba(0,0,0,0.5);
  border: 1px solid var(--border);
  border-radius: 2px;
  overflow: hidden;
}

.sb-bar-fill {
  height: 100%;
  border-radius: 1px;
  transition: width 0.4s ease, background-color 0.4s ease;
}

.sb-bar-fill.good    { background: linear-gradient(90deg, #2a5a2a, #4a9a4a); }
.sb-bar-fill.warning { background: linear-gradient(90deg, #6a4a10, #a07020); }
.sb-bar-fill.danger  { background: linear-gradient(90deg, #6a1010, #a02020); }

.sb-val {
  font-size: 11px;
  color: var(--text-dim);
  min-width: 22px;
}

.sb-text {
  font-size: 11px;
  color: var(--text-dim);
  white-space: nowrap;
}

.sb-rang {
  font-size: 11px;
  color: var(--gold-dim);
  letter-spacing: 3px;
}

.sb-divider {
  width: 1px;
  height: 20px;
  background: var(--border);
  flex-shrink: 0;
}

/* Bouton personnage (dans la stats bar, poussé à droite) */
.char-btn {
  margin-left: auto;
  width: 36px;
  height: 36px;
  background: var(--bg-card);
  border: 1px solid var(--border-gold);
  border-radius: 50%;
  color: var(--gold);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
  flex-shrink: 0;
}

.char-btn:hover,
.char-btn.active {
  background: rgba(201, 168, 76, 0.18);
  border-color: var(--gold);
}


/* ══════════════════════════════════════════════════════════════════
   DRAWER PERSONNAGE
══════════════════════════════════════════════════════════════════ */
.drawer-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.55);
  z-index: 200;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease;
}

.drawer-overlay.open {
  opacity: 1;
  pointer-events: auto;
}

.char-drawer {
  position: fixed;
  top: 0;
  right: 0;
  bottom: var(--stats-bar-h);
  width: 300px;
  background: var(--bg-panel);
  border-left: 1px solid var(--border-gold);
  z-index: 201;
  transform: translateX(100%);
  transition: transform 0.26s cubic-bezier(0.4, 0, 0.2, 1);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.char-drawer.open {
  transform: translateX(0);
}

.char-drawer-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 16px;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}

.char-drawer-title {
  font-family: var(--font-title);
  font-size: 0.85em;
  letter-spacing: 3px;
  color: var(--gold);
}

.char-drawer-close {
  background: none;
  border: none;
  color: var(--text-dim);
  font-size: 1.1em;
  cursor: pointer;
  padding: 4px 8px;
  transition: color 0.15s;
  line-height: 1;
}

.char-drawer-close:hover { color: var(--text); }

.char-drawer-body {
  flex: 1;
  overflow-y: auto;
  padding: 16px;
}

/* ── Contenu du drawer ── */
.char-name {
  font-size: 1.1em;
  font-weight: 600;
  color: var(--gold-light);
  margin-bottom: 2px;
}

.char-origin {
  font-size: 0.78em;
  color: var(--text-dim);
  font-style: italic;
  margin-bottom: 16px;
}

.stat { margin-bottom: 13px; }

.stat-label {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 5px;
}

.stat-label span:first-child {
  font-size: 0.72em;
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: 1.5px;
}

.stat-val { font-size: 0.73em; color: var(--text-dim); }

.bar {
  background: rgba(0,0,0,0.5);
  border: 1px solid var(--border);
  border-radius: 2px;
  height: 8px;
  overflow: hidden;
}

.bar-fill {
  height: 100%;
  border-radius: 1px;
  transition: width 0.5s ease, background-color 0.5s ease;
}

.bar-fill.good    { background: linear-gradient(90deg, #2a5a2a, #4a9a4a); }
.bar-fill.warning { background: linear-gradient(90deg, #6a4a10, #a07020); }
.bar-fill.danger  { background: linear-gradient(90deg, #6a1010, #a02020); }

.faim-scale {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 13px;
}

.faim-end {
  font-size: 0.68em;
  color: var(--text-dim);
  white-space: nowrap;
  flex-shrink: 0;
}

.faim-scale .bar { flex: 1; }

.rang-section { margin-bottom: 14px; }

.rang-label {
  font-size: 0.72em;
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: 1.5px;
  margin-bottom: 6px;
}

.rang-diamonds {
  text-align: center;
  color: var(--gold);
  font-size: 1.1em;
  letter-spacing: 6px;
}

.rang-name {
  text-align: center;
  font-size: 0.78em;
  color: var(--text-dim);
  font-style: italic;
  margin-top: 3px;
}

.bourse {
  font-size: 0.82em;
  color: var(--text-dim);
  text-align: center;
  padding: 6px;
  border: 1px solid var(--border);
  border-radius: 2px;
  margin-bottom: 16px;
}

.equipment-section { border-top: 1px solid var(--border); padding-top: 12px; margin-top: 4px; }

.equipment-section h3 {
  font-family: var(--font-title);
  font-size: 0.72em;
  color: var(--text-dim);
  letter-spacing: 2px;
  margin-bottom: 10px;
}

.item {
  font-size: 0.82em;
  color: var(--text);
  padding: 5px 8px;
  border: 1px solid var(--border);
  border-radius: 2px;
  margin-bottom: 4px;
  background: rgba(0,0,0,0.2);
  line-height: 1.4;
}

.no-item { color: var(--text-dim); font-style: italic; font-size: 0.8em; }

.new-game-btn {
  margin-top: 16px;
  width: 100%;
  padding: 8px;
  background: transparent;
  border: 1px solid var(--border);
  border-radius: 2px;
  color: var(--text-dim);
  font-family: var(--font-body);
  font-size: 0.8em;
  cursor: pointer;
  transition: all 0.2s;
  letter-spacing: 1px;
}

.new-game-btn:hover { border-color: var(--gold-dim); color: var(--text); }


/* ══════════════════════════════════════════════════════════════════
   MODALS
══════════════════════════════════════════════════════════════════ */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.75);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 400;
  backdrop-filter: blur(2px);
}

.modal-overlay.hidden { display: none; }

.modal {
  background: var(--bg-panel);
  border: 1px solid var(--border-gold);
  border-radius: 4px;
  padding: 28px 28px 24px;
  max-width: 520px;
  width: 92%;
  max-height: 92vh;
  overflow-y: auto;
  box-shadow: 0 20px 60px rgba(0,0,0,0.6);
}

.modal h2 {
  font-family: var(--font-title);
  color: var(--gold);
  font-size: 1.2em;
  letter-spacing: 3px;
  margin-bottom: 6px;
  text-align: center;
}

.modal-subtitle {
  color: var(--text-dim);
  font-style: italic;
  font-size: 0.85em;
  text-align: center;
  margin-bottom: 22px;
}

.modal p { color: var(--text); margin-bottom: 12px; }

.form-group { margin-bottom: 18px; }

.form-group label {
  display: block;
  font-size: 0.74em;
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: 2px;
  margin-bottom: 8px;
}

.form-group input[type="text"] {
  width: 100%;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: 3px;
  color: var(--text-bright);
  font-family: var(--font-body);
  font-size: 1.05em;
  padding: 10px 14px;
  transition: border-color 0.2s;
}

.form-group input[type="text"]:focus { outline: none; border-color: var(--border-gold); }

.origins { display: flex; flex-direction: column; gap: 8px; }

.origin-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 3px;
  padding: 12px 14px;
  cursor: pointer;
  transition: all 0.15s;
}

.origin-card:hover      { border-color: var(--border-gold); }
.origin-card.selected   { border-color: var(--gold-dim); background: rgba(201,168,76,0.07); }

.origin-title  { font-weight: 600; color: var(--gold-light); margin-bottom: 3px; font-size: 0.92em; }
.origin-desc   { font-size: 0.8em; color: var(--text-dim); margin-bottom: 5px; line-height: 1.45; }
.origin-stats  { font-size: 0.74em; color: var(--text-dim); font-style: italic; }

.modal-actions {
  display: flex;
  gap: 10px;
  margin-top: 20px;
  justify-content: center;
}

.btn-primary {
  padding: 10px 26px;
  background: rgba(201,168,76,0.1);
  border: 1px solid var(--gold-dim);
  border-radius: 3px;
  color: var(--gold);
  font-family: var(--font-title);
  font-size: 0.86em;
  letter-spacing: 2px;
  cursor: pointer;
  transition: all 0.2s;
}

.btn-primary:hover { background: rgba(201,168,76,0.22); }

.btn-secondary {
  padding: 10px 26px;
  background: transparent;
  border: 1px solid var(--border);
  border-radius: 3px;
  color: var(--text-dim);
  font-family: var(--font-title);
  font-size: 0.86em;
  letter-spacing: 1px;
  cursor: pointer;
  transition: all 0.2s;
}

.btn-secondary:hover { border-color: var(--border-gold); color: var(--text); }

/* Death screen */
.death-screen { text-align: center; padding: 16px; }

.death-screen h2 {
  font-family: var(--font-title);
  color: var(--danger-light);
  font-size: 1.3em;
  letter-spacing: 3px;
  margin-bottom: 12px;
}

.death-screen p { color: var(--text-dim); font-style: italic; margin-bottom: 18px; }


/* ── Scrollbars ─────────────────────────────────────────────────── */
::-webkit-scrollbar        { width: 4px; }
::-webkit-scrollbar-track  { background: var(--bg-dark); }
::-webkit-scrollbar-thumb  { background: var(--border); border-radius: 2px; }
::-webkit-scrollbar-thumb:hover { background: var(--gold-dim); }

/* ── Utilitaire ─────────────────────────────────────────────────── */
.hidden { display: none !important; }


/* ── Taille du texte narratif ───────────────────────────────────── */
body.text-sm .narrative-entry { font-size: 14px; line-height: 1.75; }
body.text-lg .narrative-entry { font-size: 19px; line-height: 1.95; }

/* ── Panel settings ─────────────────────────────────────────────── */
.settings-panel {
  position: fixed;
  bottom: calc(var(--stats-bar-h) + 8px);
  right: 12px;
  background: var(--bg-panel);
  border: 1px solid var(--border-gold);
  border-radius: 4px;
  padding: 14px 16px;
  z-index: 150;
  box-shadow: 0 -4px 24px rgba(0,0,0,0.55);
  min-width: 220px;
}

.settings-group {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.settings-label {
  font-size: 0.72em;
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: 1.5px;
  white-space: nowrap;
}

.settings-separator {
  border: none;
  border-top: 1px solid var(--border);
  margin: 10px 0;
}

.gamestate-panel {
  margin-top: 10px;
  border-top: 1px solid var(--border);
  padding-top: 10px;
  max-height: 340px;
  overflow-y: auto;
  font-size: 0.82em;
}
.gs-date {
  color: var(--gold-dim);
  margin-bottom: 8px;
  font-style: italic;
}
.gs-section {
  font-size: 0.72em;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  color: var(--text-dim);
  margin: 10px 0 4px;
}
.gs-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.gs-list li {
  color: var(--text);
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 4px 8px;
}
.gs-npc-meta {
  color: var(--text-dim);
  font-size: 0.9em;
}
.gs-status { font-size: 0.8em; padding: 1px 5px; border-radius: 3px; }
.gs-dead    { background: rgba(139,32,32,0.3); color: #e87070; }
.gs-missing { background: rgba(80,70,20,0.3);  color: #c9a84c; }
.gs-empty   { color: var(--text-dim); font-style: italic; }

.size-btns { display: flex; gap: 6px; }

.size-btn {
  width: 34px;
  height: 34px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 3px;
  color: var(--text-dim);
  cursor: pointer;
  transition: all 0.15s;
  font-family: var(--font-body);
  display: flex;
  align-items: center;
  justify-content: center;
}

.size-btn:nth-child(1) { font-size: 12px; }
.size-btn:nth-child(2) { font-size: 16px; }
.size-btn:nth-child(3) { font-size: 21px; }

.size-btn:hover  { border-color: var(--gold-dim); color: var(--text); }
.size-btn.active { border-color: var(--gold-dim); color: var(--gold); background: rgba(201,168,76,0.08); }

/* ── Bouton logs dans le drawer ─────────────────────────────────── */
.log-btn {
  width: 100%;
  margin-top: 8px;
  padding: 8px;
  background: transparent;
  border: 1px solid var(--border);
  border-radius: 4px;
  color: var(--text-dim);
  font-family: var(--font-body);
  font-size: 0.8rem;
  cursor: pointer;
  text-align: center;
}
.log-btn:hover { border-color: var(--gold-dim); color: var(--text); }

/* ── Panel logs ─────────────────────────────────────────────────── */
.log-panel {
  position: fixed;
  inset: 0;
  z-index: 300;
  background: #0a0a0a;
  display: flex;
  flex-direction: column;
  font-family: monospace;
  font-size: 12px;
}

.log-panel-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 14px;
  background: #111;
  border-bottom: 1px solid #333;
  color: #aaa;
  font-size: 13px;
  flex-shrink: 0;
}

.log-panel-actions { display: flex; gap: 8px; }
.log-panel-actions button {
  background: #222;
  border: 1px solid #444;
  color: #aaa;
  padding: 4px 10px;
  border-radius: 3px;
  cursor: pointer;
  font-size: 12px;
}
.log-panel-actions button:hover { background: #333; }

.log-content {
  flex: 1;
  overflow-y: auto;
  padding: 8px;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.log-entry {
  display: flex;
  gap: 8px;
  padding: 3px 4px;
  border-radius: 2px;
  line-height: 1.4;
  word-break: break-all;
}
.log-entry:hover { background: #1a1a1a; }

.log-time { color: #555; flex-shrink: 0; }
.log-text { color: #ccc; white-space: pre-wrap; }

.log-log   .log-text { color: #bbb; }
.log-info  .log-text { color: #6af; }
.log-warn  .log-text { color: #fa6; }
.log-error .log-text { color: #f66; }
.log-error { background: #1a0000; }

.log-empty { color: #555; padding: 20px; text-align: center; }

/* ── Responsive ─────────────────────────────────────────────────── */
@media (max-width: 480px) {
  .char-drawer   { width: min(300px, 88vw); }
  .game-container { padding: 8px 8px 6px; gap: 8px; }
}

@media (min-width: 720px) {
  .game-container { padding: 16px 20px 12px; gap: 12px; }
  .narrative-panel { padding: 20px 24px; }
}
