/* ═══════════════════════════════════════════════════════════
   ÆTERNUM — Design System CSS
   Grimdark · Mobile-first · Dark theme
   ═══════════════════════════════════════════════════════════ */

/* ── TOKENS ─────────────────────────────────────────────── */
:root {
  --void:         #080b10;
  --abyss:        #0d1117;
  --deep:         #141922;
  --surface:      #1c2433;
  --panel:        #222d3d;
  --border:       rgba(120,140,180,0.12);
  --border-glow:  rgba(180,140,80,0.35);
  --border-hover: rgba(180,140,80,0.55);

  --gold:         #c9a84c;
  --gold-light:   #e8c97a;
  --gold-dim:     #7a6030;
  --gold-bg:      rgba(201,168,76,0.08);

  --crimson:      #a83232;
  --crimson-glow: #cc4444;
  --teal:         #2a9d8f;
  --void-purple:  #6b3fa0;

  --text-primary:   #e8e0d0;
  --text-secondary: #9aa0b0;
  --text-muted:     #5a6070;
  --text-danger:    #ff9090;
  --text-success:   #80e8c0;
  --text-info:      #80b8ff;
  --text-warning:   #e8c070;

  --font-display: 'Cinzel', serif;
  --font-body:    'Crimson Pro', serif;
  --font-mono:    'JetBrains Mono', monospace;

  --r-sm:  6px;
  --r-md:  10px;
  --r-lg:  16px;
  --r-xl:  24px;
}

/* ── RESET ───────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 16px; scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  background: var(--void);
  color: var(--text-primary);
  font-family: var(--font-body);
  font-size: 1rem;
  line-height: 1.65;
  min-height: 100vh;
  overflow-x: hidden;
}
a { color: var(--gold); text-decoration: none; }
a:hover { text-decoration: underline; color: var(--gold-light); }
img { max-width: 100%; display: block; }
button { cursor: pointer; }

/* ── ATMOSPHERIC BACKGROUND ─────────────────────────────── */
body::before {
  content: '';
  position: fixed; inset: 0;
  background:
    radial-gradient(ellipse 80% 50% at 20% 10%, rgba(107,63,160,0.07) 0%, transparent 60%),
    radial-gradient(ellipse 60% 40% at 80% 85%, rgba(168,50,50,0.05) 0%, transparent 55%),
    radial-gradient(ellipse 100% 60% at 50% 50%, rgba(42,157,143,0.03) 0%, transparent 70%);
  pointer-events: none;
  z-index: 0;
}

/* Noise texture */
body::after {
  content: '';
  position: fixed; inset: 0;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='0.025'/%3E%3C/svg%3E");
  pointer-events: none;
  z-index: 0;
  opacity: 0.5;
}

#main-content { position: relative; z-index: 1; }

/* ── TYPOGRAPHY ──────────────────────────────────────────── */
h1, h2, h3, h4 { font-family: var(--font-display); line-height: 1.15; }
h1 { font-size: clamp(1.8rem, 5vw, 2.8rem); font-weight: 700; color: var(--gold); letter-spacing: 0.06em; }
h2 { font-size: clamp(1.3rem, 4vw, 1.8rem); font-weight: 600; color: var(--gold); letter-spacing: 0.1em; }
h3 { font-size: 1.1rem; font-weight: 400; color: var(--text-primary); letter-spacing: 0.08em; }

.display-title {
  font-family: var(--font-display);
  font-size: clamp(2.4rem, 10vw, 5rem);
  font-weight: 700;
  letter-spacing: 0.1em;
  color: var(--gold);
  text-shadow: 0 0 60px rgba(201,168,76,0.25), 0 2px 0 rgba(0,0,0,0.8);
  line-height: 1;
}
.display-sub {
  font-family: var(--font-display);
  font-size: clamp(0.7rem, 2.5vw, 0.9rem);
  letter-spacing: 0.35em;
  color: var(--text-muted);
  text-transform: uppercase;
}
.lore-text {
  font-family: var(--font-body);
  font-style: italic;
  color: var(--text-secondary);
  line-height: 1.75;
}
.mono { font-family: var(--font-mono); }

/* ── LAYOUT ──────────────────────────────────────────────── */
.container      { width: 100%; max-width: 520px; margin: 0 auto; padding: 0 1rem; }
.container-wide { width: 100%; max-width: 700px; margin: 0 auto; padding: 0 1rem; }
.container-full { width: 100%; padding: 0 1rem; }

.flex         { display: flex; }
.flex-col     { display: flex; flex-direction: column; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.gap-sm       { gap: 8px; }
.gap-md       { gap: 12px; }
.gap-lg       { gap: 1rem; }
.flex-1       { flex: 1; }
.flex-wrap    { flex-wrap: wrap; }
.ml-auto      { margin-left: auto; }
.text-center  { text-align: center; }
.mt-sm  { margin-top: 0.5rem; }
.mt-md  { margin-top: 1rem; }
.mt-lg  { margin-top: 1.5rem; }
.mt-xl  { margin-top: 2rem; }
.mb-sm  { margin-bottom: 0.5rem; }
.mb-md  { margin-bottom: 1rem; }
.mb-lg  { margin-bottom: 1.5rem; }

/* ── CARDS ───────────────────────────────────────────────── */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  padding: 1.5rem;
  position: relative;
  overflow: hidden;
}
.card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(201,168,76,0.25), transparent);
}
.card-sm { padding: 1rem 1.25rem; }
.panel {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  padding: 1.25rem;
}

/* ── BUTTONS ─────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-family: var(--font-display);
  font-size: 0.78rem;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  border: none;
  border-radius: var(--r-sm);
  cursor: pointer;
  padding: 0.72rem 1.4rem;
  transition: all 0.2s ease;
  position: relative;
  overflow: hidden;
  text-decoration: none;
  white-space: nowrap;
  line-height: 1;
}
.btn::after {
  content: '';
  position: absolute; inset: 0;
  background: linear-gradient(180deg, rgba(255,255,255,0.05) 0%, transparent 100%);
  pointer-events: none;
}
.btn:disabled { opacity: 0.38; cursor: not-allowed; transform: none !important; }

.btn-primary {
  background: linear-gradient(135deg, #b8923c 0%, #c9a84c 50%, #a07830 100%);
  color: #1a1000;
  font-weight: 600;
  box-shadow: 0 0 18px rgba(201,168,76,0.2), inset 0 1px 0 rgba(255,255,255,0.1);
}
.btn-primary:hover:not(:disabled) {
  transform: translateY(-1px);
  box-shadow: 0 0 30px rgba(201,168,76,0.4), inset 0 1px 0 rgba(255,255,255,0.15);
  text-decoration: none;
}

.btn-ghost {
  background: transparent;
  color: var(--text-secondary);
  border: 1px solid var(--border);
}
.btn-ghost:hover:not(:disabled) {
  border-color: rgba(201,168,76,0.4);
  color: var(--gold-light);
  background: var(--gold-bg);
  text-decoration: none;
}

.btn-danger {
  background: linear-gradient(135deg, #7a2020, #a83232, #6a1818);
  color: #ffdddd;
  box-shadow: 0 0 16px rgba(168,50,50,0.15);
}
.btn-danger:hover:not(:disabled) {
  box-shadow: 0 0 28px rgba(168,50,50,0.35);
  transform: translateY(-1px);
  text-decoration: none;
}

.btn-teal {
  background: linear-gradient(135deg, #1a7060, #2a9d8f, #1a6050);
  color: #e0fff8;
  box-shadow: 0 0 16px rgba(42,157,143,0.15);
}
.btn-teal:hover:not(:disabled) { box-shadow: 0 0 28px rgba(42,157,143,0.3); transform: translateY(-1px); text-decoration: none; }

.btn-lg   { padding: 0.95rem 2.2rem; font-size: 0.85rem; border-radius: var(--r-md); }
.btn-sm   { padding: 0.45rem 0.9rem; font-size: 0.68rem; }
.btn-full { width: 100%; }

/* ── FORM FIELDS ─────────────────────────────────────────── */
.field { margin-bottom: 1.1rem; }
.field label {
  display: block;
  font-family: var(--font-display);
  font-size: 0.7rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 5px;
}
.field input,
.field select,
.field textarea {
  width: 100%;
  background: var(--deep);
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
  color: var(--text-primary);
  font-family: var(--font-body);
  font-size: 1rem;
  padding: 0.68rem 0.9rem;
  transition: border-color 0.2s, box-shadow 0.2s;
  outline: none;
  -webkit-appearance: none;
  appearance: none;
}
.field input:focus,
.field select:focus,
.field textarea:focus {
  border-color: rgba(201,168,76,0.5);
  box-shadow: 0 0 0 3px rgba(201,168,76,0.07), 0 0 12px rgba(201,168,76,0.08);
}
.field input.is-invalid,
.field select.is-invalid { border-color: var(--crimson); }
.field .invalid-feedback {
  font-size: 0.8rem;
  color: var(--text-danger);
  margin-top: 4px;
  display: block;
}
.field select option { background: var(--deep); }

/* Checkboxes */
.check-wrap {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin: 0.55rem 0;
}
.check-wrap input[type="checkbox"] {
  width: 17px; height: 17px;
  flex-shrink: 0;
  margin-top: 3px;
  accent-color: var(--gold);
  cursor: pointer;
  background: var(--deep);
  border: 1px solid var(--border);
  border-radius: 3px;
}
.check-wrap label {
  font-size: 0.875rem;
  color: var(--text-secondary);
  line-height: 1.55;
  cursor: pointer;
  font-family: var(--font-body);
}
.check-wrap label a { color: var(--gold); }

/* ── DIVIDERS ────────────────────────────────────────────── */
.divider {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 1.4rem 0;
  color: var(--text-muted);
  font-size: 0.72rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  font-family: var(--font-display);
}
.divider::before, .divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--border-glow), transparent);
}

/* ── PROGRESS BARS ───────────────────────────────────────── */
.progress-bar {
  height: 6px;
  background: var(--deep);
  border-radius: 3px;
  overflow: hidden;
  border: 1px solid rgba(255,255,255,0.04);
}
.progress-bar.thin { height: 4px; }
.progress-fill { height: 100%; border-radius: 3px; transition: width 0.45s ease; }
.progress-fill.hp  { background: linear-gradient(90deg, #6a1818, #cc4444); }
.progress-fill.mp  { background: linear-gradient(90deg, #1a2a6a, #4466cc); }
.progress-fill.xp  { background: linear-gradient(90deg, #4a3a10, #c9a84c); }
.progress-fill.cor { background: linear-gradient(90deg, #3a1050, #9933cc); }

/* ── STAT CHIP ───────────────────────────────────────────── */
.stat-chip {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  background: var(--deep);
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
  padding: 0.5rem 0.6rem;
  min-width: 52px;
  transition: border-color 0.2s;
}
.stat-chip:hover { border-color: var(--border-glow); }
.stat-chip .val {
  font-family: var(--font-display);
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--gold);
  line-height: 1;
}
.stat-chip .lbl {
  font-family: var(--font-display);
  font-size: 0.58rem;
  letter-spacing: 0.1em;
  color: var(--text-muted);
  text-transform: uppercase;
  margin-top: 3px;
}
.stats-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 7px;
}
@media (min-width: 400px) { .stats-grid { grid-template-columns: repeat(6, 1fr); } }

/* ── BANNERS / ALERTS ────────────────────────────────────── */
.banner {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  padding: 0.75rem 1rem;
  border-radius: var(--r-sm);
  font-size: 0.875rem;
  line-height: 1.55;
  margin: 0.75rem 0;
}
.banner-info    { background: rgba(42,100,157,0.13); border: 1px solid rgba(42,100,157,0.28); color: var(--text-info); }
.banner-warn    { background: rgba(201,168,76,0.09); border: 1px solid rgba(201,168,76,0.22); color: var(--text-warning); }
.banner-danger  { background: rgba(168,50,50,0.13);  border: 1px solid rgba(168,50,50,0.28);  color: var(--text-danger); }
.banner-success { background: rgba(42,157,143,0.12); border: 1px solid rgba(42,157,143,0.25); color: var(--text-success); }
.banner > span:first-child { flex-shrink: 0; font-size: 1rem; margin-top: 1px; }

/* ── HUD (game top bar) ──────────────────────────────────── */
.hud {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(8,11,16,0.96);
  border-bottom: 1px solid var(--border);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  padding: 0.55rem 1rem;
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}
.hud-name {
  font-family: var(--font-display);
  font-size: 0.82rem;
  color: var(--gold);
  letter-spacing: 0.08em;
  flex-shrink: 0;
  min-width: 80px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 130px;
}
.hud-bars {
  display: flex;
  flex-direction: column;
  gap: 3px;
  flex: 1;
  min-width: 90px;
  max-width: 190px;
}
.hud-bar-row { display: flex; align-items: center; gap: 5px; }
.hud-bar-label {
  font-family: var(--font-display);
  font-size: 0.58rem;
  letter-spacing: 0.08em;
  color: var(--text-muted);
  width: 16px;
  flex-shrink: 0;
  text-transform: uppercase;
}
.hud-bar { flex: 1; height: 4px; background: var(--deep); border-radius: 2px; overflow: hidden; }
.hud-bar-fill { height: 100%; border-radius: 2px; transition: width 0.4s; }
.hud-bar-fill.hp { background: linear-gradient(90deg, #8b0000, #cc4444); }
.hud-bar-fill.mp { background: linear-gradient(90deg, #001488, #4466cc); }
.hud-bar-val {
  font-family: var(--font-mono);
  font-size: 0.6rem;
  color: var(--text-muted);
  min-width: 40px;
  text-align: right;
  flex-shrink: 0;
}
.hud-resources { display: flex; gap: 10px; margin-left: auto; flex-shrink: 0; }
.hud-res {
  display: flex;
  align-items: center;
  gap: 4px;
  font-family: var(--font-display);
  font-size: 0.7rem;
  color: var(--text-secondary);
}
.hud-res .val { color: var(--gold); font-weight: 600; }

/* ── TABS ────────────────────────────────────────────────── */
.tab-bar {
  display: flex;
  border-bottom: 1px solid var(--border);
  margin-bottom: 1.25rem;
  overflow-x: auto;
  scrollbar-width: none;
  gap: 0;
}
.tab-bar::-webkit-scrollbar { display: none; }
.tab-btn {
  font-family: var(--font-display);
  font-size: 0.7rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-muted);
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  padding: 0.65rem 0.9rem;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.2s;
  flex-shrink: 0;
  text-decoration: none;
}
.tab-btn:hover { color: var(--text-secondary); }
.tab-btn.active { color: var(--gold); border-bottom-color: var(--gold); }
.tab-panel { display: none; }
.tab-panel.active { display: block; animation: fadeIn 0.25s ease; }

/* ── RACE CARDS ──────────────────────────────────────────── */
.race-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 9px;
}
@media (min-width: 480px) { .race-grid { grid-template-columns: repeat(4, 1fr); } }

.race-card {
  background: var(--deep);
  border: 2px solid transparent;
  border-radius: var(--r-md);
  padding: 0.9rem 0.7rem;
  cursor: pointer;
  transition: all 0.2s ease;
  text-align: center;
}
.race-card:hover { border-color: var(--border-glow); transform: translateY(-2px); }
.race-card.selected {
  border-color: var(--gold);
  background: var(--gold-bg);
  box-shadow: 0 0 18px rgba(201,168,76,0.12);
}
.race-glyph   { font-size: 1.7rem; display: block; margin-bottom: 0.35rem; }
.race-name    { font-family: var(--font-display); font-size: 0.76rem; letter-spacing: 0.08em; display: block; margin-bottom: 0.25rem; color: var(--text-primary); }
.race-faction { font-size: 0.65rem; padding: 2px 7px; border-radius: 20px; display: inline-block; font-family: var(--font-display); letter-spacing: 0.04em; }
.f-order   { background: rgba(42,100,157,0.2);  color: #7ab0e8; border: 1px solid rgba(42,100,157,0.3); }
.f-chaos   { background: rgba(168,50,50,0.2);   color: #e87a7a; border: 1px solid rgba(168,50,50,0.3); }
.f-neutral { background: rgba(201,168,76,0.12); color: #c9a84c; border: 1px solid rgba(201,168,76,0.28); }
.f-exiled  { background: rgba(80,60,100,0.25);  color: #b090c0; border: 1px solid rgba(100,80,130,0.35); }

/* ── CLASS CARDS ─────────────────────────────────────────── */
.class-card {
  display: flex;
  align-items: center;
  gap: 12px;
  background: var(--deep);
  border: 2px solid transparent;
  border-radius: var(--r-md);
  padding: 0.85rem 1rem;
  cursor: pointer;
  transition: all 0.2s;
  margin-bottom: 8px;
}
.class-card:hover { border-color: var(--border-glow); }
.class-card.selected { border-color: var(--gold); background: var(--gold-bg); }
.class-icon { font-size: 1.5rem; flex-shrink: 0; width: 34px; text-align: center; }
.class-name { font-family: var(--font-display); font-size: 0.85rem; color: var(--text-primary); display: block; }
.class-desc { font-size: 0.8rem; color: var(--text-secondary); display: block; }
.class-arch { font-size: 0.62rem; font-family: var(--font-display); letter-spacing: 0.1em; color: var(--text-muted); text-transform: uppercase; }

/* ── VILLAGE GRID ────────────────────────────────────────── */
.village-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}
@media (min-width: 600px) { .village-grid { grid-template-columns: repeat(3, 1fr); } }

.village-loc {
  background: var(--deep);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  padding: 1rem 0.75rem;
  cursor: pointer;
  transition: all 0.2s;
  text-align: center;
}
.village-loc:hover {
  border-color: var(--border-glow);
  transform: translateY(-2px);
  box-shadow: 0 4px 20px rgba(0,0,0,0.3);
}
.village-loc .loc-icon { font-size: 1.9rem; display: block; margin-bottom: 0.4rem; }
.village-loc .loc-name { font-family: var(--font-display); font-size: 0.76rem; letter-spacing: 0.1em; color: var(--text-primary); display: block; margin-bottom: 3px; }
.village-loc .loc-desc { font-size: 0.75rem; color: var(--text-muted); }

/* ── COMBAT ──────────────────────────────────────────────── */
.combat-arena {
  background: var(--deep);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  padding: 1.25rem;
  margin: 0.75rem 0;
}
.combatant { display: flex; flex-direction: column; gap: 6px; }
.combatant-name {
  font-family: var(--font-display);
  font-size: 0.8rem;
  letter-spacing: 0.12em;
  color: var(--text-secondary);
  text-transform: uppercase;
}
.combatant-avatar { font-size: 2.8rem; text-align: center; margin: 0.4rem 0; display: block; }
.vs-divider {
  text-align: center;
  font-family: var(--font-display);
  font-size: 0.75rem;
  letter-spacing: 0.25em;
  color: var(--crimson);
  padding: 0.4rem 0;
}
.vs-divider::before, .vs-divider::after { content: '—'; margin: 0 8px; color: var(--text-muted); }

.hp-row { display: flex; align-items: center; gap: 6px; }
.bar-label { font-family: var(--font-display); font-size: 0.58rem; letter-spacing: 0.08em; color: var(--text-muted); width: 18px; flex-shrink: 0; text-transform: uppercase; }
.bar-val { font-family: var(--font-mono); font-size: 0.62rem; min-width: 48px; text-align: right; flex-shrink: 0; }
.bar-val.red  { color: #cc4444; }
.bar-val.blue { color: #4466cc; }

.encounter-header {
  background: linear-gradient(135deg, rgba(100,20,20,0.3), rgba(50,10,10,0.5));
  border: 1px solid rgba(168,50,50,0.3);
  border-radius: var(--r-md);
  padding: 0.85rem 1rem;
  text-align: center;
  margin-bottom: 0.75rem;
}
.encounter-title {
  font-family: var(--font-display);
  font-size: 0.9rem;
  color: #ff8080;
  letter-spacing: 0.2em;
  text-transform: uppercase;
}

.combat-log-box {
  background: var(--void);
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
  padding: 0.75rem 1rem;
  max-height: 170px;
  overflow-y: auto;
  font-family: var(--font-mono);
  font-size: 0.76rem;
  line-height: 1.65;
  color: var(--text-secondary);
  scrollbar-width: thin;
  scrollbar-color: var(--border) transparent;
}
.log-entry { margin-bottom: 1px; }
.log-player_hit, .log-spell { color: #8aff8a; }
.log-enemy_hit   { color: #ff8a8a; }
.log-special, .log-victory, .log-reward { color: var(--gold); }
.log-defeat   { color: var(--text-danger); }
.log-system   { color: var(--text-muted); font-style: italic; }
.log-item     { color: #80aaff; }

.action-bar {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-top: 0.9rem;
}
@media (min-width: 400px) { .action-bar { grid-template-columns: repeat(4, 1fr); } }

/* ── COMBAT RESULT ───────────────────────────────────────── */
.result-panel {
  text-align: center;
  padding: 2rem 1rem;
  border-radius: var(--r-lg);
  border: 1px solid var(--border);
  margin-top: 1rem;
}
.result-victory { background: rgba(42,157,50,0.06); border-color: rgba(42,157,50,0.25); }
.result-defeat  { background: rgba(168,50,50,0.06); border-color: rgba(168,50,50,0.25); }
.result-icon { font-size: 3rem; margin-bottom: 0.75rem; display: block; }
.result-panel h3 {
  font-family: var(--font-display);
  font-size: 1.3rem;
  letter-spacing: 0.12em;
  margin-bottom: 0.5rem;
}
.result-victory h3 { color: var(--text-success); }
.result-defeat  h3 { color: var(--text-danger); }

.rewards-row { display: flex; justify-content: center; gap: 1.5rem; margin: 1rem 0; }
.reward-chip {
  font-family: var(--font-display);
  font-size: 1.3rem;
  color: var(--gold);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
}

/* ── ZONE CARDS (forest) ─────────────────────────────────── */
.zone-cards { display: flex; flex-direction: column; gap: 10px; }
.zone-card { transition: border-color 0.2s, transform 0.2s; cursor: pointer; }
.zone-card:hover { border-color: var(--border-glow); transform: translateY(-1px); }
.zone-danger { border-color: rgba(168,50,50,0.2); }
.zone-danger:hover { border-color: rgba(168,50,50,0.5); }
.zone-header { display: flex; align-items: center; gap: 12px; margin-bottom: 0.5rem; }
.zone-icon { font-size: 1.8rem; flex-shrink: 0; }
.zone-name { font-family: var(--font-display); font-size: 0.9rem; color: var(--text-primary); letter-spacing: 0.08em; }
.zone-level { font-size: 0.78rem; color: var(--text-muted); margin-top: 2px; }
.zone-desc { font-size: 0.85rem; color: var(--text-secondary); margin-bottom: 0.75rem; font-style: italic; }

/* ── STEP INDICATOR ──────────────────────────────────────── */
.steps { display: flex; align-items: center; margin-bottom: 1.75rem; }
.step  { display: flex; align-items: center; gap: 7px; }
.step-num {
  width: 28px; height: 28px;
  border-radius: 50%;
  background: var(--deep);
  border: 1px solid var(--border);
  display: flex; align-items: center; justify-content: center;
  font-family: var(--font-display);
  font-size: 0.7rem;
  color: var(--text-muted);
  flex-shrink: 0;
  transition: all 0.3s;
}
.step.active .step-num {
  background: var(--gold-dim);
  border-color: var(--gold);
  color: var(--gold-light);
  box-shadow: 0 0 10px rgba(201,168,76,0.25);
}
.step.done .step-num {
  background: rgba(42,157,143,0.18);
  border-color: var(--teal);
  color: var(--teal);
}
.step-label {
  font-family: var(--font-display);
  font-size: 0.63rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-muted);
}
.step.active .step-label { color: var(--gold); }
.step.done .step-label   { color: var(--teal); }
.step-line { flex: 1; height: 1px; background: var(--border); margin: 0 6px; max-width: 40px; }

/* ── INVENTORY ───────────────────────────────────────────── */
.inv-grid { display: grid; grid-template-columns: repeat(5, 1fr); gap: 6px; }
@media (min-width: 400px) { .inv-grid { grid-template-columns: repeat(6, 1fr); } }

.inv-slot {
  aspect-ratio: 1;
  background: var(--deep);
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
  display: flex; align-items: center; justify-content: center;
  font-size: 1.2rem;
  cursor: pointer;
  transition: border-color 0.2s;
  position: relative;
}
.inv-slot:hover { border-color: var(--border-glow); }
.inv-slot.rarity-uncommon  { border-color: rgba(107,255,107,0.35); }
.inv-slot.rarity-rare      { border-color: rgba(42,100,200,0.45); }
.inv-slot.rarity-epic      { border-color: rgba(107,63,160,0.55); }
.inv-slot.rarity-legendary { border-color: rgba(201,168,76,0.65); box-shadow: 0 0 8px rgba(201,168,76,0.15); }

/* ── SHOP ITEMS ──────────────────────────────────────────── */
.shop-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 0;
  border-bottom: 1px solid var(--border);
}
.shop-item:last-child { border-bottom: none; }
.shop-item-icon { font-size: 1.4rem; flex-shrink: 0; }
.shop-item-name { font-family: var(--font-display); font-size: 0.8rem; }
.shop-item-meta { font-size: 0.74rem; color: var(--text-muted); }
.r-common    { color: var(--text-secondary); }
.r-uncommon  { color: #6bff6b; }
.r-rare      { color: #6b9fff; }
.r-epic      { color: #bf7fff; }
.r-legendary { color: var(--gold); }

/* ── TAVERN CHAT ─────────────────────────────────────────── */
.tavern-msg {
  display: flex;
  gap: 9px;
  padding: 5px 0;
  border-bottom: 1px solid rgba(255,255,255,0.03);
}
.tavern-msg:last-child { border-bottom: none; }
.tavern-sender { font-family: var(--font-display); font-size: 0.76rem; color: var(--gold-light); flex-shrink: 0; min-width: 80px; }
.tavern-text   { font-size: 0.875rem; color: var(--text-secondary); flex: 1; }

/* ── CHARACTER SHEET ─────────────────────────────────────── */
.char-sheet-header { display: flex; gap: 1rem; align-items: flex-start; margin-bottom: 1.25rem; }
.char-avatar {
  font-size: 3rem; flex-shrink: 0;
  width: 68px; height: 68px;
  background: var(--deep);
  border: 1px solid var(--border-glow);
  border-radius: var(--r-md);
  display: flex; align-items: center; justify-content: center;
}
.char-meta { flex: 1; min-width: 0; }
.char-name-display {
  font-family: var(--font-display);
  font-size: 1.25rem;
  color: var(--gold-light);
  letter-spacing: 0.07em;
  margin-bottom: 3px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.char-subtitle { font-size: 0.82rem; color: var(--text-secondary); margin-bottom: 7px; }
.char-level-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: rgba(201,168,76,0.1);
  border: 1px solid var(--gold-dim);
  border-radius: 20px;
  padding: 2px 10px;
  font-family: var(--font-display);
  font-size: 0.7rem;
  color: var(--gold);
  letter-spacing: 0.1em;
}

/* ── TOAST NOTIFICATIONS ─────────────────────────────────── */
.toast {
  position: fixed;
  bottom: 1.25rem;
  left: 50%;
  transform: translateX(-50%) translateY(80px);
  background: var(--surface);
  border: 1px solid var(--border-glow);
  border-radius: var(--r-md);
  padding: 0.7rem 1.25rem;
  font-size: 0.875rem;
  color: var(--text-primary);
  z-index: 9999;
  transition: transform 0.3s cubic-bezier(0.34,1.4,0.64,1);
  max-width: 90vw;
  text-align: center;
  box-shadow: 0 8px 32px rgba(0,0,0,0.5);
  pointer-events: none;
}
.toast.show { transform: translateX(-50%) translateY(0); }
.toast.toast-error   { border-color: rgba(168,50,50,0.5); color: var(--text-danger); }
.toast.toast-success { border-color: rgba(42,157,143,0.5); color: var(--text-success); }

/* ── SECTION HEADER ──────────────────────────────────────── */
.section-header { text-align: center; padding: 1.5rem 0 1rem; }
.section-header p { color: var(--text-secondary); font-size: 0.9rem; font-style: italic; margin-top: 4px; }

/* ── LANDING PAGE ────────────────────────────────────────── */
.landing-wrap {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 2rem 1rem;
}
.landing-sigil {
  font-size: clamp(3rem, 12vw, 6rem);
  margin-bottom: 1rem;
  display: block;
  animation: pulseGold 4s ease-in-out infinite;
}
@keyframes pulseGold {
  0%,100% { text-shadow: 0 0 20px rgba(201,168,76,0.25); }
  50%      { text-shadow: 0 0 50px rgba(201,168,76,0.55), 0 0 100px rgba(201,168,76,0.15); }
}
.landing-lore {
  max-width: 400px;
  margin: 1.5rem auto;
  font-size: 0.95rem;
  color: var(--text-secondary);
  font-style: italic;
  line-height: 1.8;
  border-left: 2px solid var(--gold-dim);
  padding-left: 1rem;
  text-align: left;
}
.landing-actions {
  display: flex;
  flex-direction: column;
  gap: 10px;
  max-width: 280px;
  margin: 1.75rem auto 0;
}

/* ── AUTH FORMS ──────────────────────────────────────────── */
.auth-wrap {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 2rem 0 3rem;
}
.auth-header { text-align: center; margin-bottom: 1.75rem; }
.auth-header .sigil { font-size: 1.8rem; display: block; margin-bottom: 0.5rem; }

/* ── ANIMATIONS ──────────────────────────────────────────── */
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0); }
}
.fade-in { animation: fadeIn 0.35s ease both; }
.delay-1 { animation-delay: 0.1s; }
.delay-2 { animation-delay: 0.2s; }
.delay-3 { animation-delay: 0.3s; }

/* ── SCROLLBARS ──────────────────────────────────────────── */
::-webkit-scrollbar { width: 5px; height: 5px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 3px; }

/* ── RESPONSIVE ──────────────────────────────────────────── */
@media (max-width: 360px) {
  .action-bar { grid-template-columns: 1fr 1fr; }
  .village-grid { grid-template-columns: 1fr 1fr; }
  .race-grid { grid-template-columns: 1fr 1fr; }
}

/* ── COOKIE BANNER ─────────────────────────────────────── */
.cookie-banner-hidden { display: none !important; }
#cookie-banner {
  position: fixed; bottom: 0; left: 0; right: 0;
  background: var(--surface);
  border-top: 1px solid var(--border-glow);
  padding: 1rem; z-index: 9998;
  display: flex; align-items: center;
  gap: 1rem; flex-wrap: wrap;
}
