:root {
  --bg: #14100c;
  --panel: #1f1810;
  --panel-light: #2a2015;
  --border: #4a3a24;
  --gold: #d4af37;
  --text: #e8dfc8;
  --text-dim: #a89a7a;
  --hp: #a12d2d;
  --mp: #2d6fa1;
  --xp: #6a9c3f;
  --danger: #c0392b;
  --success: #4a8c3f;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: Georgia, 'Times New Roman', serif;
  min-height: 100vh;
}

#app {
  max-width: 900px;
  margin: 0 auto;
  padding: 24px 16px;
}

h1, h2, h3 {
  color: var(--gold);
  font-weight: normal;
  letter-spacing: 0.5px;
}

h1 { text-align: center; border-bottom: 2px solid var(--border); padding-bottom: 12px; }

.panel {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 20px;
  margin-bottom: 16px;
}

.form-group { margin-bottom: 14px; }
label { display: block; margin-bottom: 4px; color: var(--text-dim); font-size: 0.9em; }

input, select {
  width: 100%;
  padding: 10px;
  background: var(--panel-light);
  border: 1px solid var(--border);
  border-radius: 4px;
  color: var(--text);
  font-size: 1em;
  font-family: inherit;
}

button {
  background: var(--panel-light);
  border: 1px solid var(--gold);
  color: var(--gold);
  padding: 10px 18px;
  border-radius: 4px;
  cursor: pointer;
  font-family: inherit;
  font-size: 1em;
  transition: background 0.15s;
}
button:hover { background: var(--border); }
button:disabled { opacity: 0.5; cursor: not-allowed; }
button.danger { border-color: var(--danger); color: var(--danger); }
button.primary { background: var(--gold); color: #14100c; font-weight: bold; }

.row { display: flex; gap: 10px; flex-wrap: wrap; }
.row > * { flex: 1; }

.error { color: var(--danger); margin: 8px 0; }
.success-msg { color: var(--success); margin: 8px 0; }

.link-btn {
  background: none; border: none; color: var(--text-dim);
  text-decoration: underline; padding: 4px; cursor: pointer;
}

.tabs { display: flex; gap: 4px; margin-bottom: 16px; border-bottom: 1px solid var(--border); flex-wrap: wrap; }
.tab {
  background: none; border: none; color: var(--text-dim);
  padding: 10px 16px; cursor: pointer; border-bottom: 2px solid transparent;
}
.tab.active { color: var(--gold); border-bottom-color: var(--gold); }

.char-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 16px; }
.stat-bar { background: var(--panel-light); border-radius: 4px; height: 18px; overflow: hidden; margin: 4px 0; position: relative; }
.stat-fill { height: 100%; transition: width 0.3s; }
.stat-fill.hp { background: var(--hp); }
.stat-fill.mp { background: var(--mp); }
.stat-fill.xp { background: var(--xp); }
.stat-label { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; font-size: 0.75em; color: var(--text); }

.card { background: var(--panel-light); border: 1px solid var(--border); border-radius: 4px; padding: 14px; margin-bottom: 10px; }
.card-title { color: var(--gold); font-weight: bold; }
.card-meta { color: var(--text-dim); font-size: 0.85em; }

.char-list-item { display: flex; justify-content: space-between; align-items: center; }

.combat-log { background: #0d0906; border: 1px solid var(--border); border-radius: 4px; padding: 14px; margin-top: 14px; max-height: 260px; overflow-y: auto; }
.combat-log p { margin: 4px 0; }

.rarity-commun { color: var(--text); }
.rarity-rare { color: #4a90d9; }
.rarity-epique { color: #a34ad9; }
.rarity-legendaire { color: var(--gold); }

.slot-tag { font-size: 0.75em; padding: 2px 6px; border: 1px solid var(--gold); border-radius: 3px; color: var(--gold); margin-left: 6px; }
