/* ═══════════════════════════════════════════════════════
   The Savage Lands
   D&D dark theme
═══════════════════════════════════════════════════════ */

:root {
  --bg-deep:       #0a0a0f;
  --bg-panel:      #111118;
  --bg-panel-alt:  #15151d;
  --bg-msg-dm:     #14131c;
  --bg-msg-player: #0f0e17;
  --bg-input:      #13121b;

  --gold:          #d4a836;
  --gold-dim:      rgba(212, 168, 54, 0.15);
  --gold-border:   rgba(212, 168, 54, 0.3);
  --gold-bright:   #e8c44a;

  --text-dm:       #e8d6ac;
  --text-player:   #c0d8f2;
  --text-label:    #9a8eb0;
  --text-ui:       #c0b8d0;
  --text-muted:    #7a72a0;

  --hp-red:        #c04040;
  --hp-red-glow:   rgba(192, 64, 64, 0.4);
  --sp-purple:     #8855cc;
  --sp-purple-dim: rgba(136, 85, 204, 0.3);
  --ac-blue:       #3a7ab5;
  --teal:          #2a8a7a;
  --roll-amber:    #c8820a;
  --roll-amber-bg: rgba(200, 130, 10, 0.12);
  --blood-red:     #8b2020;
  --parchment:     rgba(212, 168, 54, 0.04);

  --border:        rgba(255, 255, 255, 0.06);
  --radius:        8px;

  --sidebar-w:     338px;
  --header-h:      52px;

  --font-display:  'Cinzel', 'Palatino Linotype', Georgia, serif;
  --font-body:     'Crimson Pro', Georgia, 'Times New Roman', serif;
  --font-ui:       'Segoe UI', system-ui, sans-serif;
}

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

html, body {
  height: 100%;
  overflow: hidden;
  background: var(--bg-deep);
  color: var(--text-ui);
  font-family: var(--font-ui);
  font-size: 14px;
}

/* ═══ HEADER ════════════════════════════════════════════ */
#site-header {
  position: fixed;
  top: 0; left: 0; right: 0;
  height: var(--header-h);
  background: linear-gradient(180deg, #141218 0%, var(--bg-panel) 100%);
  border-bottom: 1px solid var(--gold-border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 20px;
  z-index: 100;
  box-shadow: 0 2px 16px rgba(0, 0, 0, 0.5), 0 1px 0 rgba(212, 168, 54, 0.08);
}
#site-header::after {
  content: '';
  position: absolute;
  bottom: -1px; left: 0; right: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent 0%, rgba(212, 168, 54, 0.4) 30%, rgba(212, 168, 54, 0.6) 50%, rgba(212, 168, 54, 0.4) 70%, transparent 100%);
}

#title-block { display: flex; align-items: baseline; gap: 12px; }

#realm-title {
  font-family: var(--font-display);
  font-size: 16px;
  font-weight: 700;
  color: var(--gold);
  letter-spacing: 0.10em;
  text-shadow: 0 0 14px rgba(212, 168, 54, 0.45), 0 0 28px rgba(212, 168, 54, 0.2), 0 1px 2px rgba(0, 0, 0, 0.6);
}

#realm-sub {
  font-family: var(--font-ui);
  font-size: 11px;
  color: var(--text-muted);
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

#header-status { display: flex; align-items: center; gap: 12px; }

.badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  background: linear-gradient(135deg, rgba(212, 168, 54, 0.12) 0%, rgba(212, 168, 54, 0.06) 100%);
  border: 1px solid var(--gold-border);
  border-radius: 20px;
  padding: 3px 10px;
  font-size: 12px;
  color: var(--gold);
  box-shadow: inset 0 1px 0 rgba(255, 230, 140, 0.06), 0 1px 3px rgba(0, 0, 0, 0.2);
}

.dot {
  width: 8px; height: 8px;
  border-radius: 50%;
}
.dot-checking { background: #666; }
.dot-ok       { background: #4caf50; box-shadow: 0 0 6px #4caf5099, 0 0 12px rgba(76, 175, 80, 0.25); }
.dot-error    { background: #f44336; box-shadow: 0 0 6px #f4433699; }

/* ═══ LAYOUT ════════════════════════════════════════════ */
#layout {
  display: flex;
  height: 100vh;
  padding-top: var(--header-h);
}

/* ═══ SIDEBAR ═══════════════════════════════════════════ */
#sidebar {
  width: var(--sidebar-w);
  min-width: var(--sidebar-w);
  background: linear-gradient(180deg, #111118 0%, #0d0d14 100%);
  border-right: 1px solid var(--gold-border);
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  box-shadow: 2px 0 20px rgba(0, 0, 0, 0.4), 1px 0 0 rgba(212, 168, 54, 0.06);
}

/* Tab buttons */
#sidebar-tabs {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 1px;
  border-bottom: 1px solid var(--gold-border);
  position: sticky;
  top: 0;
  z-index: 10;
  background: linear-gradient(180deg, #16151e 0%, #111118 100%);
  flex-shrink: 0;
  padding: 4px 3px;
}

.tab-btn {
  background: linear-gradient(180deg, rgba(255,255,255,0.04) 0%, rgba(255,255,255,0.01) 100%);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-bottom: 2px solid transparent;
  border-radius: 4px 4px 0 0;
  color: var(--text-muted);
  font-family: var(--font-display);
  font-size: 9px;
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  padding: 9px 2px;
  cursor: pointer;
  position: relative;
  transition: all 0.3s cubic-bezier(.25,.8,.25,1);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04), 0 1px 3px rgba(0, 0, 0, 0.2);
}
.tab-btn:hover {
  color: var(--text-ui);
  background: linear-gradient(180deg, rgba(212, 168, 54, 0.08) 0%, rgba(212, 168, 54, 0.02) 100%);
  border-color: rgba(212, 168, 54, 0.15);
  text-shadow: 0 0 8px rgba(212, 168, 54, 0.2);
  transform: translateY(-1px);
  box-shadow: inset 0 1px 0 rgba(255, 230, 140, 0.06), 0 2px 6px rgba(0, 0, 0, 0.3);
}
.tab-btn.active {
  color: var(--gold);
  background: linear-gradient(180deg, rgba(212, 168, 54, 0.14) 0%, rgba(212, 168, 54, 0.04) 100%);
  border-color: rgba(212, 168, 54, 0.3);
  border-bottom: 2px solid var(--gold);
  text-shadow: 0 0 12px rgba(212, 168, 54, 0.4);
  box-shadow: inset 0 1px 0 rgba(255, 230, 140, 0.1), 0 0 12px rgba(212, 168, 54, 0.1);
}

/* Tab content panes */
.tab-content {
  display: flex;
  flex-direction: column;
  flex: 1;
}
.tab-content.hidden { display: none; }

/* Currency row */
.currency-row {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 6px;
}
.coin {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 6px 4px;
  border-radius: var(--radius);
  border: 1px solid var(--border);
}
.coin-label {
  font-size: 9px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: 3px;
  font-weight: 600;
}
.coin-val {
  font-family: var(--font-display);
  font-size: 16px;
  color: var(--text-dm);
}
.coin-pp { background: rgba(180,160,220,0.08); }
.coin-pp .coin-label { color: #b4a0dc; }
.coin-gp { background: rgba(201,168,76,0.08); }
.coin-gp .coin-label { color: var(--gold); }
.coin-ep { background: rgba(140,200,140,0.08); }
.coin-ep .coin-label { color: #88c888; }
.coin-sp { background: rgba(180,180,200,0.08); }
.coin-sp .coin-label { color: #b4b4c8; }
.coin-cp { background: rgba(180,120,80,0.08); }
.coin-cp .coin-label { color: #c89060; }

/* Spell slot rows */
.spell-slot-row {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 5px 0;
  border-bottom: 1px solid var(--border);
}
.spell-slot-row:last-child { border-bottom: none; }

.spell-slot-label {
  font-size: 10px;
  color: var(--text-muted);
  width: 26px;
  text-align: right;
  flex-shrink: 0;
}
.spell-slot-pips {
  display: flex;
  gap: 4px;
  flex: 1;
}
.slot-pip {
  width: 13px; height: 13px;
  border-radius: 3px;
  border: 1.5px solid var(--sp-purple);
  flex-shrink: 0;
  transition: opacity 0.2s;
}
.slot-pip.available {
  background: var(--sp-purple);
  box-shadow: 0 0 5px var(--sp-purple-dim), 0 0 12px rgba(136, 85, 204, 0.18);
}
.slot-pip.used {
  background: none;
  border-color: var(--text-muted);
  opacity: 0.3;
}
.spell-slot-count {
  font-family: var(--font-display);
  font-size: 10px;
  color: var(--text-muted);
  flex-shrink: 0;
  min-width: 24px;
  text-align: right;
}

/* Quest item title + description */
.quest-item-title {
  font-size: 12px;
  font-family: var(--font-body);
  color: var(--text-ui);
  line-height: 1.4;
}

.quest-item-desc {
  font-size: 11px;
  font-family: var(--font-body);
  color: var(--text-muted);
  font-style: italic;
  line-height: 1.4;
  margin-top: 2px;
}

/* Quest completed style */
.quest-item.completed .quest-item-title {
  color: var(--text-muted);
  text-decoration: line-through;
}
.quest-item.completed .quest-item-desc { color: var(--text-muted); opacity: 0.6; }
.quest-item.completed::before { color: var(--text-muted); }

/* ─── Quest Complete Popup ─── */
.qc-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.75);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 300;
  padding: 16px;
}

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

.qc-box {
  background: var(--bg-panel);
  border: 1px solid var(--gold-border);
  border-radius: 14px;
  padding: 32px 36px;
  max-width: 380px;
  width: 100%;
  box-shadow: 0 0 60px rgba(201, 168, 76, 0.15), 0 0 0 1px rgba(201,168,76,0.08), 0 0 80px rgba(201, 168, 76, 0.08);
  text-align: center;
  animation: qcEnter 0.5s cubic-bezier(.25,.8,.25,1) both;
}

@keyframes qcEnter {
  0% { opacity: 0; transform: scale(0.85) translateY(20px); }
  60% { opacity: 1; transform: scale(1.02) translateY(-2px); }
  100% { opacity: 1; transform: scale(1) translateY(0); }
}

.qc-header {
  font-family: var(--font-display);
  font-size: 18px;
  font-weight: 700;
  color: var(--gold);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  margin-bottom: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  text-shadow: 0 0 16px rgba(201, 168, 76, 0.4), 0 0 32px rgba(201, 168, 76, 0.15);
}

.qc-icon {
  font-size: 20px;
  color: var(--gold);
}

.qc-quests {
  margin-bottom: 20px;
}

.qc-quest-entry {
  padding: 10px 0;
  border-top: 1px solid var(--gold-border);
  border-bottom: 1px solid var(--gold-border);
  margin-bottom: 4px;
}
.qc-quest-name {
  font-family: var(--font-display);
  font-size: 15px;
  font-weight: 600;
  color: var(--text-dm);
  letter-spacing: 0.04em;
  margin-bottom: 6px;
}
.qc-quest-desc {
  font-family: var(--font-body);
  font-size: 13px;
  color: var(--text-muted);
  line-height: 1.55;
  font-style: italic;
}

.qc-rewards {
  margin-bottom: 24px;
  min-height: 24px;
}

.qc-reward-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-family: var(--font-body);
  font-size: 16px;
  color: var(--text-dm);
}

.qc-reward-icon {
  color: var(--gold);
  font-size: 14px;
}

.qc-btn {
  padding: 10px 36px;
  background: linear-gradient(135deg, #6a4e14 0%, #c9a84c 35%, #e8c44a 55%, #c9a84c 75%, #6a4e14 100%);
  border: 1px solid rgba(232, 196, 74, 0.3);
  border-radius: 6px;
  color: #0a0a10;
  font-family: var(--font-display);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.08em;
  cursor: pointer;
  box-shadow:
    0 2px 10px rgba(212, 168, 54, 0.35),
    0 4px 14px rgba(0, 0, 0, 0.35),
    inset 0 1px 0 rgba(255, 230, 140, 0.3);
  transition: box-shadow 0.25s cubic-bezier(.25,.8,.25,1), transform 0.15s cubic-bezier(.25,.8,.25,1);
}

.qc-btn:hover {
  box-shadow:
    0 0 20px rgba(212, 168, 54, 0.55),
    0 4px 16px rgba(0, 0, 0, 0.35),
    inset 0 1px 0 rgba(255, 230, 140, 0.35);
  transform: translateY(-1px);
}
.qc-btn:active {
  transform: translateY(1px);
  box-shadow:
    0 0 6px rgba(212, 168, 54, 0.2),
    0 1px 3px rgba(0, 0, 0, 0.4),
    inset 0 2px 5px rgba(0, 0, 0, 0.25);
}

#sidebar::-webkit-scrollbar { width: 4px; }
#sidebar::-webkit-scrollbar-track { background: transparent; }
#sidebar::-webkit-scrollbar-thumb { background: var(--gold-border); border-radius: 4px; }

.panel {
  padding: 12px 14px;
  border-bottom: 1px solid var(--border);
  box-shadow: inset 0 -1px 0 rgba(212, 168, 54, 0.03);
  background: var(--parchment);
}

.panel-header {
  font-family: var(--font-display);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--gold);
  margin-bottom: 10px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  text-shadow: 0 0 10px rgba(212, 168, 54, 0.3), 0 1px 2px rgba(0, 0, 0, 0.4);
  padding-bottom: 6px;
  border-bottom: 1px solid rgba(212, 168, 54, 0.1);
}

.panel-toggle {
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  font-size: 12px;
  padding: 0;
  line-height: 1;
  transition: color 0.2s;
}
.panel-toggle:hover { color: var(--gold); }

#char-name {
  font-family: var(--font-display);
  font-size: 16px;
  font-weight: 700;
  color: var(--text-dm);
  margin-bottom: 3px;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.4);
}

#char-meta {
  font-size: 11px;
  color: var(--text-muted);
  margin-bottom: 4px;
  line-height: 1.4;
}

#char-exp {
  font-size: 11px;
  color: var(--gold);
  margin-bottom: 12px;
  letter-spacing: 0.03em;
  text-shadow: 0 0 8px rgba(201, 168, 76, 0.2);
}

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

.stat-label {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-label);
}

.stat-value {
  font-family: var(--font-display);
  font-size: 12px;
  color: var(--text-ui);
}

/* HP bar */
.bar-track {
  height: 6px;
  background: rgba(255,255,255,0.06);
  border-radius: 3px;
  overflow: hidden;
}

.bar-fill {
  height: 100%;
  border-radius: 3px;
  transition: width 0.6s cubic-bezier(.25,.8,.25,1);
}

.bar-hp {
  background: linear-gradient(90deg, #6b1414, #a83030, var(--hp-red));
  box-shadow: 0 0 10px var(--hp-red-glow), 0 0 20px rgba(192, 64, 64, 0.25);
}

.bar-settlement {
  background: linear-gradient(90deg, #3a6b2a, #5aad3f);
  box-shadow: 0 0 8px rgba(90, 173, 63, 0.4), 0 0 16px rgba(90, 173, 63, 0.15);
}

/* Sorcery pips */
.pips-row {
  display: flex;
  gap: 5px;
  flex-wrap: wrap;
  margin-top: 5px;
}

.pip {
  width: 14px; height: 14px;
  border-radius: 50%;
  border: 1.5px solid var(--sp-purple);
  transition: background 0.3s;
}
.pip.filled {
  background: var(--sp-purple);
  box-shadow: 0 0 6px var(--sp-purple-dim), 0 0 14px rgba(136, 85, 204, 0.2);
}

/* Badges row */
.badges-row {
  display: flex;
  gap: 8px;
  margin-top: 12px;
}

.stat-badge {
  flex: 1;
  border-radius: var(--radius);
  padding: 7px 6px;
  text-align: center;
  border: 1px solid;
  position: relative;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04), 0 2px 6px rgba(0, 0, 0, 0.2);
}

.badge-blue   { background: linear-gradient(135deg, rgba(58,122,181,0.15) 0%, rgba(58,122,181,0.06) 100%); border-color: rgba(58,122,181,0.4); }
.badge-teal   { background: linear-gradient(135deg, rgba(42,138,122,0.15) 0%, rgba(42,138,122,0.06) 100%); border-color: rgba(42,138,122,0.4); }
.badge-gold   { background: linear-gradient(135deg, rgba(212,168,54,0.18) 0%, rgba(212,168,54,0.06) 100%); border-color: rgba(212,168,54,0.5); }
.badge-purple { background: linear-gradient(135deg, rgba(140,80,200,0.15) 0%, rgba(140,80,200,0.06) 100%); border-color: rgba(140,80,200,0.4); }

.badge-label {
  font-size: 9px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
  margin-bottom: 2px;
}

.badge-val {
  font-family: var(--font-display);
  font-size: 18px;
  font-weight: 600;
  color: var(--text-dm);
}

/* Ability scores table */
.ability-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12px;
  table-layout: auto; /* size columns to content, not fixed % */
}

.ability-table thead th {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
  padding: 4px 10px 7px;
  font-weight: 600;
  border-bottom: 1px solid var(--border);
  text-align: center;
  white-space: nowrap;
}

.ability-col-name  { text-align: left; }
.ability-col-score { text-align: center; }
.ability-col-mod   { text-align: center; }

.ability-table tbody tr {
  border-bottom: 1px solid var(--border);
}
.ability-table tbody tr:last-child {
  border-bottom: none;
}

.ability-name {
  font-family: var(--font-ui);
  font-size: 12px;
  color: var(--text-label);
  padding: 6px 12px 6px 4px;
  text-align: left;
  white-space: nowrap;
}

.ability-score {
  font-family: var(--font-display);
  font-size: 13px;
  color: var(--text-dm);
  text-align: center;
  padding: 6px 10px;
  white-space: nowrap;
}

.ability-mod {
  font-family: var(--font-display);
  font-size: 13px;
  text-align: center;
  padding: 6px 10px;
  font-weight: 600;
  white-space: nowrap;
}
.ability-mod.positive { color: #6fc08a; }
.ability-mod.negative { color: var(--hp-red); }
.ability-mod.neutral  { color: var(--text-muted); }

/* Skills table */
.skills-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12px;
}

.skills-table tbody tr {
  border-bottom: 1px solid var(--border);
}
.skills-table tbody tr:last-child {
  border-bottom: none;
}

.skill-name {
  font-family: var(--font-ui);
  font-size: 12px;
  color: var(--text-ui);
  padding: 4px 4px 4px 0;
  text-align: left;
  white-space: nowrap;
}

.skill-ability {
  font-size: 9px;
  color: var(--text-muted);
  letter-spacing: 0.04em;
  margin-left: 4px;
}

.skill-value {
  font-family: var(--font-display);
  font-size: 13px;
  color: var(--text-dm);
  text-align: right;
  padding: 4px 0;
  width: 32px;
  font-weight: 600;
}

/* Quest list */
.quest-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.quest-item {
  font-size: 12px;
  font-family: var(--font-body);
  color: var(--text-ui);
  line-height: 1.4;
  padding-left: 12px;
  position: relative;
}

.quest-item::before {
  content: '◈';
  position: absolute;
  left: 0;
  color: var(--gold);
  font-size: 10px;
  top: 1px;
}

/* Spell list */
.spell-list {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}

.spell-tag {
  font-size: 10px;
  background: rgba(255,255,255,0.05);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 2px 8px;
  color: var(--text-muted);
  white-space: nowrap;
}
.spell-tag.prepared {
  background: rgba(140,80,200,0.12);
  border-color: rgba(140,80,200,0.35);
  color: #c0a0e8;
}

/* Character Details panel */
.detail-field {
  margin-bottom: 10px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--border);
}
.detail-field:last-of-type { border-bottom: none; margin-bottom: 0; padding-bottom: 0; }
.detail-label {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
  margin-bottom: 3px;
}
.detail-text {
  font-size: 12px;
  color: var(--text-ui);
  line-height: 1.5;
  white-space: pre-wrap;
}

/* Weapon attack info in inventory list */
.item-atk-info {
  display: block;
  font-size: 10px;
  color: var(--text-muted);
  margin-top: 1px;
}

/* Inventory list */
.inv-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.inv-item {
  font-size: 12px;
  font-family: var(--font-body);
  color: var(--text-ui);
  padding: 4px 6px 4px 18px;
  position: relative;
  display: flex;
  align-items: baseline;
  gap: 5px;
  border-radius: 4px;
  cursor: pointer;
  transition: background 0.2s cubic-bezier(.25,.8,.25,1), color 0.2s cubic-bezier(.25,.8,.25,1), box-shadow 0.2s cubic-bezier(.25,.8,.25,1), transform 0.15s cubic-bezier(.25,.8,.25,1);
  user-select: none;
}

.inv-item:hover {
  background: rgba(201, 168, 76, 0.1);
  color: var(--gold);
  box-shadow: inset 2px 0 0 rgba(201, 168, 76, 0.4);
  transform: translateX(2px);
}

.inv-item:hover::before {
  color: var(--gold);
}

.inv-item::before {
  content: '·';
  position: absolute;
  left: 6px;
  color: var(--text-muted);
  transition: color 0.12s;
}

.inv-item-name {
  flex: 1;
}

.magic-glyph {
  font-size: 9px;
  color: var(--sp-purple);
}

/* ─── Inventory item context menu ──────────────────────────── */
#item-menu {
  position: fixed;
  z-index: 2000;
  background: linear-gradient(135deg, #1a1828 0%, #14122a 100%);
  border: 1px solid rgba(212, 168, 54, 0.35);
  border-radius: 8px;
  padding: 6px;
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 150px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.7), 0 0 0 1px rgba(212, 168, 54, 0.08), inset 0 1px 0 rgba(255, 230, 140, 0.04);
}

#item-menu.hidden {
  display: none;
}

.item-menu-title {
  font-size: 11px;
  font-family: var(--font-display);
  color: var(--gold);
  padding: 3px 8px 5px;
  border-bottom: 1px solid var(--gold-border);
  margin-bottom: 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 200px;
}

.item-menu-btn {
  background: none;
  border: none;
  color: var(--text-ui);
  font-size: 12px;
  font-family: var(--font-body);
  padding: 6px 10px;
  border-radius: 5px;
  text-align: left;
  cursor: pointer;
  transition: background 0.1s, color 0.1s;
  display: flex;
  align-items: center;
  gap: 7px;
}

.item-menu-btn:hover {
  background: rgba(201, 168, 76, 0.1);
  color: var(--gold);
}

.item-menu-btn.btn-equip { color: #6cba6c; }
.item-menu-btn.btn-equip:hover { background: rgba(108, 186, 108, 0.12); color: #8fd98f; }

.item-menu-btn.btn-unequip { color: #c97070; }
.item-menu-btn.btn-unequip:hover { background: rgba(201, 112, 112, 0.12); color: #e08888; }

.item-menu-btn .btn-icon {
  font-size: 10px;
  width: 14px;
  text-align: center;
  flex-shrink: 0;
}

/* ═══ CHAT SECTION ══════════════════════════════════════ */
#chat-section {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  position: relative;
}

#messages {
  flex: 1;
  overflow-y: auto;
  padding: 20px 24px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  scroll-behavior: smooth;
}

#messages::-webkit-scrollbar { width: 5px; }
#messages::-webkit-scrollbar-track { background: transparent; }
#messages::-webkit-scrollbar-thumb { background: var(--border); border-radius: 4px; }

/* Messages */
.msg-wrap {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.msg-label {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  font-weight: 600;
}

.msg-bubble {
  padding: 14px 18px;
  border-radius: var(--radius);
  line-height: 1.7;
  max-width: 820px;
  position: relative;
}

/* DM message */
.msg-dm .msg-label { color: var(--gold); }

.msg-dm .msg-bubble {
  background: linear-gradient(135deg, var(--bg-msg-dm) 0%, rgba(22, 20, 32, 0.95) 100%);
  border: 1px solid var(--gold-border);
  font-family: var(--font-body);
  font-size: 17px;
  color: var(--text-dm);
  border-left: 3px solid var(--gold);
  box-shadow: 0 2px 16px rgba(0, 0, 0, 0.3), 0 0 24px rgba(212, 168, 54, 0.05), inset 0 1px 0 rgba(212, 168, 54, 0.04);
}

/* Player message */
.msg-player { align-self: flex-end; align-items: flex-end; }
.msg-player .msg-label { color: var(--text-player); }

.msg-player .msg-bubble {
  background: var(--bg-msg-player);
  border: 1px solid rgba(155, 185, 220, 0.2);
  font-family: var(--font-ui);
  font-size: 14px;
  color: var(--text-player);
  border-right: 3px solid rgba(155, 185, 220, 0.5);
  text-align: right;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.2), 0 0 16px rgba(155, 185, 220, 0.03);
}

/* Error message */
.msg-error .msg-bubble {
  background: rgba(192,64,64,0.1);
  border: 1px solid rgba(192,64,64,0.35);
  color: #e08080;
  font-size: 13px;
}
.msg-error .msg-label { color: #cc5555; }

/* Typing indicator */
.typing-bubble {
  background: var(--bg-msg-dm);
  border: 1px solid var(--gold-border);
  border-left: 3px solid var(--gold);
  padding: 14px 18px;
  border-radius: var(--radius);
  display: flex;
  align-items: center;
  gap: 5px;
}

.typing-dot {
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--gold);
  opacity: 0.4;
  animation: pulse 1.2s infinite;
}
.typing-dot:nth-child(2) { animation-delay: 0.2s; }
.typing-dot:nth-child(3) { animation-delay: 0.4s; }

@keyframes pulse {
  0%, 80%, 100% { opacity: 0.4; transform: scale(1); }
  40% { opacity: 1; transform: scale(1.3); }
}

/* ═══ ROLL CARD ══════════════════════════════════════════ */
.roll-card {
  margin: 0 24px 12px;
  background: linear-gradient(135deg, rgba(200, 130, 10, 0.1) 0%, rgba(200, 130, 10, 0.05) 100%);
  border: 1px solid rgba(200, 130, 10, 0.45);
  border-radius: var(--radius);
  padding: 14px 18px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  box-shadow: 0 2px 20px rgba(200, 130, 10, 0.12), 0 0 35px rgba(200, 130, 10, 0.06), inset 0 1px 0 rgba(255, 200, 80, 0.06);
}

.roll-card.hidden { display: none; }

#roll-header {
  display: flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-display);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--roll-amber);
  text-shadow: 0 0 10px rgba(200, 130, 10, 0.3);
}

#roll-details {
  display: flex;
  align-items: center;
  gap: 10px;
}

#roll-type-label {
  font-family: var(--font-body);
  font-size: 16px;
  color: var(--text-dm);
}

.roll-dc-badge {
  background: rgba(200,130,10,0.2);
  border: 1px solid rgba(200,130,10,0.5);
  border-radius: 20px;
  padding: 2px 10px;
  font-size: 12px;
  color: var(--roll-amber);
  font-weight: 600;
}

#roll-btn {
  align-self: flex-start;
  background: var(--roll-amber);
  border: none;
  border-radius: var(--radius);
  color: #0a0a0f;
  font-family: var(--font-display);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.06em;
  padding: 8px 18px;
  cursor: pointer;
  box-shadow:
    0 2px 8px rgba(200, 130, 10, 0.35),
    0 4px 12px rgba(0, 0, 0, 0.4),
    inset 0 1px 0 rgba(255, 220, 120, 0.25);
  transition: box-shadow 0.25s cubic-bezier(.25,.8,.25,1), transform 0.15s cubic-bezier(.25,.8,.25,1);
}

#roll-btn:hover {
  box-shadow:
    0 0 18px rgba(200, 130, 10, 0.55),
    0 4px 14px rgba(0, 0, 0, 0.4),
    inset 0 1px 0 rgba(255, 220, 120, 0.3);
  transform: translateY(-1px);
}
#roll-btn:active {
  transform: translateY(1px) scale(0.97);
  box-shadow:
    0 0 8px rgba(200, 130, 10, 0.3),
    0 1px 4px rgba(0, 0, 0, 0.5),
    inset 0 2px 4px rgba(0, 0, 0, 0.2);
}
#roll-btn:disabled { opacity: 0.4; cursor: default; box-shadow: none; transform: none; }

#roll-result {
  font-family: var(--font-body);
  font-size: 22px;
  color: var(--text-dm);
  letter-spacing: 0.04em;
}
#roll-result.hidden { display: none; }

/* ═══ INPUT BAR ══════════════════════════════════════════ */
#input-bar {
  display: flex;
  align-items: flex-end;
  gap: 10px;
  padding: 14px 24px 18px;
  background: linear-gradient(180deg, var(--bg-panel) 0%, #0e0e16 100%);
  border-top: 1px solid var(--gold-border);
  box-shadow: 0 -2px 16px rgba(0, 0, 0, 0.3);
  position: relative;
}
#input-bar::before {
  content: '';
  position: absolute;
  top: -1px; left: 0; right: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent 0%, rgba(212, 168, 54, 0.3) 30%, rgba(212, 168, 54, 0.5) 50%, rgba(212, 168, 54, 0.3) 70%, transparent 100%);
}

#action-input {
  flex: 1;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text-ui);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.5;
  padding: 10px 14px;
  resize: none;
  outline: none;
  transition: border-color 0.25s cubic-bezier(.25,.8,.25,1), box-shadow 0.25s cubic-bezier(.25,.8,.25,1);
  max-height: 140px;
  overflow-y: auto;
}

#action-input::placeholder { color: var(--text-muted); }

#action-input:focus {
  border-color: var(--gold-border);
  box-shadow: 0 0 0 2px var(--gold-dim), 0 0 12px rgba(201, 168, 76, 0.08);
}

#send-btn {
  width: 44px; height: 44px;
  background: linear-gradient(135deg, #7a5a18 0%, #c9a84c 40%, #e8c44a 65%, #c9a84c 100%);
  border: 1px solid rgba(232, 196, 74, 0.3);
  border-radius: var(--radius);
  color: #0a0a0f;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  box-shadow:
    0 0 14px rgba(201, 168, 76, 0.45),
    0 3px 10px rgba(0, 0, 0, 0.5),
    inset 0 1px 0 rgba(255, 230, 140, 0.3),
    inset 0 -1px 0 rgba(0, 0, 0, 0.15);
  transition: box-shadow 0.25s cubic-bezier(.25,.8,.25,1), transform 0.15s cubic-bezier(.25,.8,.25,1);
}

#send-btn:hover {
  box-shadow:
    0 0 24px rgba(201, 168, 76, 0.7),
    0 0 40px rgba(201, 168, 76, 0.25),
    0 4px 14px rgba(0, 0, 0, 0.5),
    inset 0 1px 0 rgba(255, 230, 140, 0.35),
    inset 0 -1px 0 rgba(0, 0, 0, 0.15);
  transform: translateY(-1px);
}
#send-btn:active {
  transform: translateY(1px) scale(0.96);
  box-shadow:
    0 0 8px rgba(201, 168, 76, 0.3),
    0 1px 4px rgba(0, 0, 0, 0.6),
    inset 0 2px 6px rgba(0, 0, 0, 0.25);
}
#send-btn:disabled { opacity: 0.4; cursor: default; box-shadow: none; transform: none; }

/* ═══ COMBAT PANEL ═══════════════════════════════════════ */

#combat-panel {
  margin: 0 12px 8px;
  border: 1px solid rgba(180, 60, 60, 0.45);
  border-radius: var(--radius);
  background: linear-gradient(135deg, rgba(18, 8, 8, 0.96) 0%, rgba(14, 6, 6, 0.94) 100%);
  overflow: hidden;
  flex-shrink: 0;
  box-shadow: 0 2px 16px rgba(180, 60, 60, 0.1), inset 0 1px 0 rgba(180, 60, 60, 0.06);
  box-shadow: inset 0 0 28px rgba(160, 40, 40, 0.06);
}

#combat-header {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 10px;
  background: rgba(140, 30, 30, 0.28);
  border-bottom: 1px solid rgba(180, 60, 60, 0.35);
  font-family: var(--font-display);
  font-size: 12px;
  color: #e07070;
  letter-spacing: 0.08em;
}

#combat-icon { font-size: 13px; }

#combat-round-label {
  margin-left: auto;
  font-size: 10px;
  color: var(--text-muted);
  font-family: var(--font-ui);
  background: rgba(255,255,255,0.05);
  padding: 1px 6px;
  border-radius: 3px;
  border: 1px solid rgba(255,255,255,0.08);
  letter-spacing: 0.04em;
}

#combat-turn-label {
  font-size: 10px;
  color: #e0b070;
  font-family: var(--font-ui);
}

/* Initiative order */
#initiative-order {
  padding: 6px 10px;
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.combatant-row {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 4px 6px;
  border-radius: 4px;
  background: rgba(255,255,255,0.02);
  border: 1px solid transparent;
  border-left: 2px solid rgba(255,255,255,0.07);
  font-size: 11px;
  font-family: var(--font-ui);
  transition: background 0.15s;
}

.combatant-row.active-turn {
  border-color: rgba(224, 176, 112, 0.4);
  border-left-color: rgba(224, 176, 112, 0.85);
  background: rgba(224, 176, 112, 0.07);
}

.combatant-row.player {
  border-left-color: rgba(100, 160, 220, 0.8);
  background: rgba(100, 160, 220, 0.05);
}

.combatant-row.ally {
  border-left-color: rgba(80, 200, 120, 0.7);
  background: rgba(80, 200, 120, 0.04);
}

.combatant-row.enemy {
  border-left-color: rgba(200, 70, 70, 0.5);
}

.combatant-row.dead {
  opacity: 0.32;
  text-decoration: line-through;
}

.combatant-name {
  flex: 1;
  color: var(--text-ui);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.combatant-row.player .combatant-name { color: #8ab8d8; }
.combatant-row.ally   .combatant-name { color: #6ecf8a; }

/* Faction badges */
.faction-badge {
  font-size: 9px;
  font-family: var(--font-ui);
  font-weight: 600;
  letter-spacing: 0.05em;
  padding: 1px 4px;
  border-radius: 3px;
  white-space: nowrap;
  flex-shrink: 0;
}

.badge-you  { background: rgba(100,160,220,0.18); color: #8ab8d8; border: 1px solid rgba(100,160,220,0.3); }
.badge-ally { background: rgba(80,200,120,0.15);  color: #6ecf8a; border: 1px solid rgba(80,200,120,0.3); }
.badge-foe  { background: rgba(200,70,70,0.15);   color: #e08080; border: 1px solid rgba(200,70,70,0.3); }

.combatant-init {
  font-size: 10px;
  color: var(--text-muted);
  min-width: 22px;
  text-align: right;
}

.combatant-hp-bar-wrap {
  width: 50px;
  height: 4px;
  background: rgba(255,255,255,0.07);
  border-radius: 2px;
  overflow: hidden;
  flex-shrink: 0;
}

.combatant-hp-bar {
  height: 100%;
  border-radius: 2px;
  transition: width 0.3s;
}

.combatant-hp-bar.player-bar { background: var(--hp-red); }
.combatant-hp-bar.ally-bar   { background: #4caf6e; }
.combatant-hp-bar.enemy-bar  { background: #cc5522; }

.combatant-status {
  font-size: 10px;
  color: var(--text-muted);
  min-width: 60px;
  text-align: right;
}

.combatant-row.player .combatant-status { color: var(--text-ui); }
.combatant-row.ally   .combatant-status { color: var(--text-ui); }

/* Combat action area */
#combat-actions {
  padding: 6px 10px 8px;
  border-top: 1px solid rgba(180, 60, 60, 0.2);
  display: flex;
  flex-direction: column;
  gap: 6px;
}

#combat-target-row {
  display: flex;
  align-items: center;
  gap: 6px;
}

.combat-label {
  font-size: 10px;
  color: var(--text-muted);
  font-family: var(--font-ui);
  text-transform: uppercase;
  letter-spacing: 0.07em;
  white-space: nowrap;
}

#combat-target-select {
  background: var(--bg-input);
  border: 1px solid rgba(180, 60, 60, 0.35);
  color: var(--text-ui);
  font-size: 11px;
  padding: 3px 6px;
  border-radius: 4px;
  font-family: var(--font-ui);
  flex: 1;
}

/* Action groups */
#action-buttons {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.action-group {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.action-group-label {
  font-size: 9px;
  font-family: var(--font-ui);
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-muted);
  padding: 0 2px;
}

.action-group-attack .action-group-label  { color: rgba(220, 90, 90, 0.75); }
.action-group-cantrip .action-group-label,
.action-group-spell .action-group-label   { color: rgba(150, 100, 220, 0.75); }
.action-group-sorcery .action-group-label { color: rgba(220, 140, 60, 0.75); }
.action-group-tactic .action-group-label  { color: rgba(160, 200, 220, 0.65); }
.action-group-flee .action-group-label    { color: rgba(100, 200, 100, 0.65); }

.action-group-btns {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}

.action-btn {
  padding: 5px 11px;
  font-size: 11px;
  font-family: var(--font-ui);
  background: linear-gradient(180deg, rgba(255,255,255,0.06) 0%, rgba(255,255,255,0.02) 100%);
  border: 1px solid rgba(255,255,255,0.1);
  color: var(--text-ui);
  border-radius: 4px;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(.25,.8,.25,1);
  white-space: nowrap;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.05), 0 1px 4px rgba(0, 0, 0, 0.25);
  letter-spacing: 0.01em;
}

.action-btn:hover {
  background: linear-gradient(180deg, rgba(212,168,54,0.16) 0%, rgba(212,168,54,0.06) 100%);
  border-color: var(--gold-border);
  color: var(--gold);
  box-shadow: inset 0 1px 0 rgba(255, 230, 140, 0.08), 0 2px 10px rgba(212, 168, 54, 0.18);
  transform: translateY(-1px);
}

.action-btn:active {
  transform: translateY(0px);
  box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.3), 0 0px 2px rgba(0, 0, 0, 0.3);
}

.action-btn:disabled {
  opacity: 0.35;
  cursor: default;
  box-shadow: none;
  transform: none;
}

.action-btn.type-attack       { border-color: rgba(200, 80, 80, 0.3); }
.action-btn.type-attack:hover { background: rgba(200,80,80,0.14); border-color: rgba(200,80,80,0.55); color: #e08080; box-shadow: 0 2px 10px rgba(200, 80, 80, 0.2); }

.action-btn.type-cantrip,
.action-btn.type-spell        { border-color: rgba(136, 85, 204, 0.3); }
.action-btn.type-cantrip:hover,
.action-btn.type-spell:hover  { background: rgba(136,85,204,0.14); border-color: rgba(136,85,204,0.55); color: #bb88ee; box-shadow: 0 2px 10px rgba(136, 85, 204, 0.2); }

.action-btn.type-flee         { border-color: rgba(100, 180, 100, 0.3); }
.action-btn.type-flee:hover   { background: rgba(100,180,100,0.12); border-color: rgba(100,180,100,0.5); color: #80c880; box-shadow: 0 2px 10px rgba(100, 180, 100, 0.15); }

.combat-end-banner {
  padding: 8px 12px;
  font-family: var(--font-display);
  font-size: 14px;
  letter-spacing: 0.08em;
  text-align: center;
  font-weight: 600;
}

.combat-end-banner.victory { color: #80c880; background: rgba(80,200,80,0.1); }
.combat-end-banner.defeat  { color: #e08080; background: rgba(200,80,80,0.1); }
.combat-end-banner.fled    { color: #e0c080; background: rgba(200,180,80,0.1); }

/* ─── Level-Up Banner ─────────────────────────────────── */
#levelup-banner {
  position: fixed;
  bottom: 80px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  gap: 12px;
  background: linear-gradient(135deg, #1a140a, #241c0e);
  border: 1px solid var(--gold);
  border-radius: 10px;
  padding: 12px 20px;
  z-index: 600;
  box-shadow: 0 0 30px rgba(201,168,76,0.25);
  max-width: 420px;
  width: calc(100% - 32px);
}

#levelup-banner.hidden { display: none; }

.levelup-banner-text {
  flex: 1;
  font-family: var(--font-display);
  font-size: 13px;
  color: var(--gold);
  letter-spacing: 0.05em;
}

.levelup-banner-btn {
  padding: 7px 16px;
  background: linear-gradient(135deg, #8a6820, #c9a84c, #8a6820);
  border: none;
  border-radius: 5px;
  color: #0a0a10;
  font-family: var(--font-display);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.06em;
  cursor: pointer;
  white-space: nowrap;
  transition: opacity 0.15s;
}

.levelup-banner-btn:hover { opacity: 0.88; }


/* ─── Level-Up Modal ──────────────────────────────────── */
.levelup-modal-box {
  border-color: rgba(201,168,76,0.4) !important;
}

.levelup-hp-choices {
  display: flex;
  gap: 12px;
  margin-top: 16px;
  flex-wrap: wrap;
}

.levelup-hp-btn {
  flex: 1;
  padding: 12px;
  background: var(--bg-panel-alt, #14141f);
  border: 1px solid rgba(201,168,76,0.3);
  border-radius: 8px;
  color: var(--gold, #c9a84c);
  font-family: var(--font-display, 'Cinzel', serif);
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.05em;
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
  min-width: 120px;
}

.levelup-hp-btn:hover {
  border-color: var(--gold, #c9a84c);
  background: rgba(201,168,76,0.08);
}

.levelup-hp-roll {
  background: linear-gradient(135deg, rgba(138,104,32,0.2), rgba(201,168,76,0.15));
}

/* ─── Location Discovery Notification ─────────────────── */
#discovery-notification {
  position: fixed;
  bottom: 28px;
  right: 24px;
  z-index: 400;
  max-width: 320px;
  width: 100%;
  pointer-events: auto;
}
#discovery-inner {
  background: linear-gradient(135deg, rgba(20,18,32,0.97) 0%, rgba(30,24,48,0.97) 100%);
  border: 1px solid rgba(180, 140, 60, 0.5);
  border-radius: 10px;
  padding: 16px 18px 14px;
  box-shadow: 0 8px 32px rgba(0,0,0,0.6), 0 0 0 1px rgba(180,140,60,0.1);
}
#discovery-header {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
}
#discovery-icon {
  font-size: 15px;
}
#discovery-title {
  flex: 1;
  font-family: var(--font-display, 'Cinzel', serif);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--gold, #c9a84c);
}
#discovery-dismiss {
  background: none;
  border: none;
  color: var(--text-muted, #888);
  cursor: pointer;
  font-size: 12px;
  padding: 0 2px;
  line-height: 1;
}
#discovery-dismiss:hover { color: #ccc; }
#discovery-name {
  font-family: var(--font-display, 'Cinzel', serif);
  font-size: 15px;
  font-weight: 600;
  color: #e8d9a8;
  margin-bottom: 2px;
}
#discovery-region {
  font-size: 11px;
  color: var(--text-muted, #888);
  margin-bottom: 8px;
  font-style: italic;
}
#discovery-region:empty { display: none; }
#discovery-description {
  font-size: 12px;
  color: var(--text-dim, #aaa);
  line-height: 1.5;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
@keyframes discoverySlideIn {
  from { opacity: 0; transform: translateY(16px); }
  to   { opacity: 1; transform: translateY(0); }
}
@keyframes discoverySlideOut {
  from { opacity: 1; transform: translateY(0); }
  to   { opacity: 0; transform: translateY(16px); }
}
.discovery-fade-in  { animation: discoverySlideIn  0.35s ease forwards; }
.discovery-fade-out { animation: discoverySlideOut 0.35s ease forwards; }


/* ─── PARTY TAB ─────────────────────────────────────────── */
.party-card {
  background: linear-gradient(135deg, rgba(255,255,255,0.04) 0%, rgba(255,255,255,0.01) 100%);
  border: 1px solid var(--border, #333);
  border-radius: 8px;
  padding: 10px 12px;
  margin-bottom: 10px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
  transition: border-color 0.2s, box-shadow 0.2s;
}
.party-card:last-child { margin-bottom: 0; }
.party-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 5px;
}
.party-name {
  font-family: var(--font-display);
  font-size: 13px;
  color: var(--gold, #c9a84c);
  font-weight: 600;
}
.party-trust {
  font-size: 10px;
  font-family: var(--font-ui);
  padding: 2px 7px;
  border-radius: 10px;
  letter-spacing: 0.04em;
}
.trust-friendly  { background: rgba(80,160,80,0.15);  color: #80c080; border: 1px solid rgba(80,160,80,0.3); }
.trust-trusted   { background: rgba(80,120,200,0.15); color: #80a8e8; border: 1px solid rgba(80,120,200,0.3); }
.trust-devoted   { background: rgba(160,80,200,0.15); color: #c090e8; border: 1px solid rgba(160,80,200,0.3); }
.party-desc {
  font-size: 11px;
  font-family: var(--font-body);
  color: var(--text-muted, #888);
  font-style: italic;
  margin-bottom: 6px;
  line-height: 1.45;
}
.party-location {
  font-size: 11px;
  font-family: var(--font-ui);
  color: var(--text-muted, #888);
  margin-bottom: 6px;
}
.party-trust-bar-track {
  height: 3px;
  background: rgba(255,255,255,0.08);
  border-radius: 2px;
  overflow: hidden;
}
.party-trust-bar {
  height: 100%;
  background: linear-gradient(90deg, #6a9f6a, #a0c8a0);
  border-radius: 2px;
  transition: width 0.4s cubic-bezier(.25,.8,.25,1);
  box-shadow: 0 0 6px rgba(106, 159, 106, 0.3);
}
.party-card[role="button"] {
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
}
.party-card[role="button"]:hover {
  border-color: var(--gold-border, #c9a84c55);
  background: rgba(255,255,255,0.06);
}
.party-card[role="button"]:focus-visible {
  outline: 2px solid var(--gold, #c9a84c);
  outline-offset: 2px;
}

/* ─── AREA TAB ───────────────────────────────────────────── */
.area-card {
  background: linear-gradient(135deg, rgba(255,255,255,0.04) 0%, rgba(255,255,255,0.01) 100%);
  border: 1px solid var(--border, #333);
  border-radius: 8px;
  padding: 10px 12px;
  margin-bottom: 8px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}
.area-card:last-child { margin-bottom: 0; }

.area-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 4px;
}

.area-npc-name {
  font-family: var(--font-display);
  font-size: 13px;
  color: var(--text-main, #d0c8b8);
  font-weight: 600;
}

.area-npc-badge {
  font-size: 10px;
  font-family: var(--font-ui);
  padding: 2px 7px;
  border-radius: 10px;
  background: rgba(255,255,255,0.07);
  color: var(--text-muted, #888);
  border: 1px solid rgba(255,255,255,0.1);
  letter-spacing: 0.03em;
}

.area-npc-desc {
  font-size: 11px;
  font-family: var(--font-body);
  color: var(--text-muted, #888);
  font-style: italic;
  line-height: 1.45;
}

/* ─── PARTY MEMBER MODAL ─────────────────────────────────── */
.pm-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.7);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 400;
  padding: 16px;
}
.pm-box {
  background: var(--bg-panel, #1a1a2a);
  border: 1px solid rgba(201,168,76,0.3);
  border-radius: 12px;
  width: 100%;
  max-width: 520px;
  max-height: 80vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.pm-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  padding: 18px 20px 14px;
  border-bottom: 1px solid var(--border, #333);
  flex-shrink: 0;
}
.pm-title-block {
  display: flex;
  flex-direction: column;
  gap: 3px;
}
.pm-name {
  font-family: var(--font-display);
  font-size: 18px;
  font-weight: 600;
  color: var(--gold, #c9a84c);
}
.pm-race {
  font-size: 12px;
  color: var(--text-muted, #888);
  font-family: var(--font-ui);
  font-style: italic;
}
.pm-close-btn {
  background: none;
  border: none;
  color: var(--text-muted, #888);
  font-size: 16px;
  cursor: pointer;
  padding: 0 4px;
  line-height: 1;
  margin-top: 2px;
  transition: color 0.15s;
}
.pm-close-btn:hover { color: var(--text, #ddd); }
.pm-tabs {
  display: flex;
  gap: 2px;
  padding: 10px 16px 0;
  border-bottom: 1px solid var(--border, #333);
  flex-shrink: 0;
}
.pm-tab-btn {
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  color: var(--text-muted, #888);
  font-family: var(--font-ui);
  font-size: 12px;
  padding: 6px 12px 8px;
  cursor: pointer;
  transition: color 0.15s, border-color 0.15s;
}
.pm-tab-btn:hover { color: var(--text, #ddd); }
.pm-tab-btn.active {
  color: var(--gold, #c9a84c);
  border-bottom-color: var(--gold, #c9a84c);
}
.pm-tab-content {
  flex: 1;
  overflow-y: auto;
  padding: 18px 20px;
}
.pm-body-text {
  font-family: var(--font-body);
  font-size: 13px;
  color: var(--text, #ccc);
  line-height: 1.65;
  white-space: pre-wrap;
}
.pm-muted {
  color: var(--text-muted, #888);
}
.pm-section-label {
  font-family: var(--font-ui);
  font-size: 10px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-muted, #777);
  margin-bottom: 6px;
}
/* Events tab */
.pm-event-entry {
  border-left: 2px solid var(--border, #444);
  padding: 6px 0 6px 12px;
  margin-bottom: 12px;
}
.pm-event-entry.pm-event-important {
  border-left-color: var(--gold, #c9a84c);
}
.pm-event-date {
  font-size: 10px;
  font-family: var(--font-ui);
  color: var(--text-muted, #777);
  margin-bottom: 3px;
}
.pm-event-summary {
  font-family: var(--font-body);
  font-size: 12px;
  color: var(--text, #ccc);
  line-height: 1.5;
}
/* Stats tab */
.pm-stat-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 7px 0;
  border-bottom: 1px solid rgba(255,255,255,0.05);
  font-size: 13px;
}
.pm-stat-row:last-of-type { border-bottom: none; }
.pm-stat-label {
  font-family: var(--font-ui);
  color: var(--text-muted, #888);
  font-size: 12px;
}
.pm-stat-val {
  font-family: var(--font-body);
  color: var(--text, #ccc);
}
.pm-alive  { color: #80c080; }
.pm-dead   { color: #c08080; }
.pm-trust-bar-track {
  height: 5px;
  background: rgba(255,255,255,0.08);
  border-radius: 3px;
  overflow: hidden;
}
.pm-trust-bar {
  height: 100%;
  background: linear-gradient(90deg, #6a9f6a, #a0c8a0);
  border-radius: 3px;
}

/* Ability score grid */
.pm-ability-grid {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 6px;
  margin-top: 6px;
}
.pm-ability-cell {
  background: rgba(255,255,255,0.04);
  border: 1px solid var(--border, #333);
  border-radius: 6px;
  padding: 6px 4px;
  text-align: center;
}
.pm-ability-name {
  font-size: 9px;
  font-family: var(--font-ui);
  letter-spacing: 0.06em;
  color: var(--text-muted, #777);
  text-transform: uppercase;
  margin-bottom: 3px;
}
.pm-ability-score {
  font-size: 15px;
  font-family: var(--font-display);
  color: var(--text, #ddd);
  font-weight: 600;
  line-height: 1;
}
.pm-ability-mod {
  font-size: 11px;
  font-family: var(--font-ui);
  color: var(--gold, #c9a84c);
  margin-top: 2px;
}
/* Combat badges */
.pm-combat-badges {
  display: flex;
  gap: 10px;
  margin-top: 8px;
}
.pm-combat-badge {
  background: rgba(255,255,255,0.05);
  border: 1px solid var(--border, #333);
  border-radius: 8px;
  padding: 8px 16px;
  text-align: center;
  min-width: 60px;
}
.pm-combat-badge-label {
  font-size: 10px;
  font-family: var(--font-ui);
  color: var(--text-muted, #777);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}
.pm-combat-badge-val {
  font-size: 16px;
  font-family: var(--font-display);
  font-weight: 600;
  color: var(--text, #ddd);
  margin-top: 2px;
}
/* HP bar (red) */
.pm-hp-bar {
  height: 100%;
  background: linear-gradient(90deg, #8b2020, #c04040);
  border-radius: 3px;
  transition: width 0.4s ease;
}
/* Tag lists (equipment, proficiencies, spells) */
.pm-tag-list {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  margin-top: 5px;
}
.pm-tag {
  font-size: 11px;
  font-family: var(--font-ui);
  background: rgba(255,255,255,0.06);
  border: 1px solid var(--border, #3a3a4a);
  border-radius: 4px;
  padding: 3px 8px;
  color: var(--text, #ccc);
}
.pm-tag-cantrip {
  border-color: rgba(100,150,220,0.4);
  background: rgba(100,150,220,0.08);
  color: #8ab4e8;
}
.pm-tag-spell {
  border-color: rgba(160,100,220,0.4);
  background: rgba(160,100,220,0.08);
  color: #c090e8;
}

/* ─── Party Member Modal — Other Tab ──────────────────── */
.pm-other-hint {
  font-size: 12px;
  color: var(--text-muted, #666);
  line-height: 1.6;
  margin: 8px 0 14px;
}

.pm-remove-party-btn {
  padding: 9px 20px;
  background: rgba(160, 40, 40, 0.18);
  border: 1px solid rgba(200, 60, 60, 0.45);
  border-radius: 7px;
  color: #d97070;
  font-family: var(--font-display, 'Cinzel', serif);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.06em;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s;
}
.pm-remove-party-btn:hover {
  background: rgba(180, 45, 45, 0.3);
  border-color: rgba(220, 70, 70, 0.65);
}

.pm-remove-confirm-heading {
  font-family: var(--font-display, 'Cinzel', serif);
  font-size: 13px;
  font-weight: 700;
  color: #d97070;
  letter-spacing: 0.06em;
  margin-bottom: 8px;
}

.pm-remove-label {
  display: block;
  font-size: 10px;
  font-family: var(--font-display, 'Cinzel', serif);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-label, #888);
  margin-bottom: 6px;
}

.pm-remove-textarea {
  width: 100%;
  box-sizing: border-box;
  background: rgba(0, 0, 0, 0.3);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 6px;
  color: var(--text-ui, #bbb);
  font-family: var(--font-ui, sans-serif);
  font-size: 13px;
  line-height: 1.5;
  padding: 8px 10px;
  resize: vertical;
  outline: none;
  transition: border-color 0.15s;
}
.pm-remove-textarea:focus { border-color: rgba(200, 60, 60, 0.5); }
.pm-remove-textarea::placeholder { color: var(--text-muted, #555); }

.pm-remove-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 12px;
}

.pm-remove-cancel-btn {
  padding: 8px 18px;
  background: transparent;
  border: 1px solid var(--border, #333);
  border-radius: 6px;
  color: var(--text-muted, #777);
  font-family: var(--font-ui, sans-serif);
  font-size: 12px;
  cursor: pointer;
  transition: color 0.15s, border-color 0.15s;
}
.pm-remove-cancel-btn:hover { color: var(--text-ui, #bbb); border-color: rgba(255,255,255,0.15); }

.pm-remove-confirm-btn {
  padding: 8px 18px;
  background: rgba(140, 35, 35, 0.8);
  border: 1px solid rgba(180, 55, 55, 0.6);
  border-radius: 6px;
  color: #f0a0a0;
  font-family: var(--font-display, 'Cinzel', serif);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.06em;
  cursor: pointer;
  transition: background 0.15s;
}
.pm-remove-confirm-btn:hover { background: rgba(170, 45, 45, 0.9); }
.pm-remove-confirm-btn:disabled { opacity: 0.45; cursor: not-allowed; }

/* ═══ QUEST INTRO MODAL ══════════════════════════════════ */
#quest-intro-modal {
  position: fixed;
  inset: 0;
  z-index: 900;
  background: rgba(4, 4, 10, 0.97);
  display: flex;
  align-items: flex-start;
  justify-content: center;
  overflow-y: auto;
  padding: 40px 20px 60px;
  animation: questOverlayFade 0.4s ease both;
}

@keyframes questOverlayFade {
  from { opacity: 0; }
  to { opacity: 1; }
}
#quest-intro-scroll {
  max-width: 680px;
  width: 100%;
  background: var(--bg-panel);
  border: 1px solid var(--gold-border);
  border-radius: 12px;
  padding: 48px 52px 40px;
  position: relative;
  margin: auto 0;
  box-shadow: 0 0 80px rgba(201, 168, 76, 0.1), 0 16px 60px rgba(0, 0, 0, 0.6);
  animation: questIntroEnter 0.6s cubic-bezier(.25,.8,.25,1) both;
}

@keyframes questIntroEnter {
  0% { opacity: 0; transform: scale(0.92) translateY(30px); }
  50% { opacity: 1; }
  100% { opacity: 1; transform: scale(1) translateY(0); }
}
.qi-title-block {
  text-align: center;
  margin-bottom: 36px;
}
.qi-glyph {
  font-family: var(--font-display);
  font-size: 12px;
  letter-spacing: 5px;
  color: var(--gold);
  text-transform: uppercase;
  margin-bottom: 10px;
}
.qi-subtitle {
  font-family: var(--font-display);
  font-size: 22px;
  color: var(--text-dm);
  margin-bottom: 6px;
}
.qi-location-line {
  font-family: var(--font-display);
  font-size: 13px;
  color: #a07828;
  letter-spacing: 2px;
  margin-top: 4px;
}
.qi-body {
  margin-bottom: 28px;
}
.qi-body p {
  font-family: var(--font-body);
  font-size: 17px;
  line-height: 1.75;
  color: var(--text-dm);
  margin-bottom: 14px;
}
.qi-callout {
  background: var(--gold-dim);
  border-left: 3px solid var(--gold);
  padding: 10px 16px;
  border-radius: 0 6px 6px 0;
  margin-top: 6px;
}
.qi-section {
  margin-bottom: 28px;
  padding-top: 24px;
  border-top: 1px solid var(--border);
}
.qi-section p {
  font-family: var(--font-body);
  font-size: 17px;
  line-height: 1.75;
  color: var(--text-dm);
  margin-bottom: 12px;
}
.qi-section-header {
  font-family: var(--font-display);
  font-size: 10px;
  letter-spacing: 3px;
  color: var(--gold);
  text-transform: uppercase;
  margin-bottom: 14px;
}
.qi-emphasis {
  font-style: italic;
  color: var(--text-ui) !important;
}
.qi-list {
  margin: 8px 0 12px 22px;
}
.qi-list li {
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.7;
  color: var(--text-dm);
  margin-bottom: 6px;
}
.qi-list li strong {
  color: var(--text-ui);
}
#quest-intro-actions {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 32px;
  padding-top: 28px;
  border-top: 1px solid var(--gold-border);
}
.qi-action-btn {
  background: linear-gradient(135deg, rgba(212, 168, 54, 0.1) 0%, rgba(212, 168, 54, 0.04) 100%);
  border: 1px solid var(--gold-border);
  color: var(--text-dm);
  font-family: var(--font-body);
  font-size: 16px;
  padding: 14px 20px;
  border-radius: 8px;
  cursor: pointer;
  text-align: left;
  line-height: 1.5;
  transition: all 0.2s cubic-bezier(.25,.8,.25,1);
  width: 100%;
  box-shadow: inset 0 1px 0 rgba(255, 230, 140, 0.04), 0 2px 6px rgba(0, 0, 0, 0.2);
}
.qi-action-btn:hover {
  background: linear-gradient(135deg, rgba(212, 168, 54, 0.2) 0%, rgba(212, 168, 54, 0.08) 100%);
  border-color: var(--gold);
  box-shadow: inset 0 1px 0 rgba(255, 230, 140, 0.06), 0 2px 12px rgba(212, 168, 54, 0.12);
  transform: translateY(-1px);
}
#quest-intro-skip {
  text-align: center;
  margin-top: 20px;
}
#quest-intro-skip button {
  background: none;
  border: none;
  color: var(--text-muted);
  font-family: var(--font-ui);
  font-size: 12px;
  cursor: pointer;
  padding: 4px 8px;
  letter-spacing: 0.5px;
}
#quest-intro-skip button:hover { color: var(--text-ui); }

/* ═══ TTS CONTROLS ═══════════════════════════════════════ */

#tts-toggle-btn,
#tts-settings-btn {
  width: 38px; height: 38px;
  background: linear-gradient(180deg, rgba(255,255,255,0.04) 0%, rgba(255,255,255,0.01) 100%);
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: var(--radius);
  color: rgba(255,255,255,0.55);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: all 0.2s cubic-bezier(.25,.8,.25,1);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04), 0 1px 3px rgba(0, 0, 0, 0.2);
}
#tts-toggle-btn:hover,
#tts-settings-btn:hover {
  color: var(--text-ui);
  border-color: var(--gold-border);
  background: linear-gradient(180deg, rgba(212, 168, 54, 0.08) 0%, rgba(212, 168, 54, 0.02) 100%);
  box-shadow: inset 0 1px 0 rgba(255, 230, 140, 0.06), 0 2px 6px rgba(0, 0, 0, 0.3);
}
#tts-toggle-btn.tts-active {
  color: var(--gold);
  border-color: var(--gold-border);
  background: linear-gradient(180deg, rgba(212, 168, 54, 0.14) 0%, rgba(212, 168, 54, 0.06) 100%);
  box-shadow: 0 0 10px rgba(212, 168, 54, 0.1);
}

/* ─── TTS Settings Modal ───────────────────────────────── */

.tts-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.82);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 400;
  padding: 16px;
  backdrop-filter: blur(4px);
}

.tts-grimoire {
  background: linear-gradient(170deg, #0e0e1a 0%, #0a0a14 60%, #100a1e 100%);
  border: 1px solid var(--gold-border);
  border-radius: 14px;
  width: 100%;
  max-width: 580px;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  box-shadow:
    0 0 0 1px rgba(201,168,76,0.06),
    0 4px 60px rgba(0,0,0,0.85),
    0 0 80px rgba(100,60,180,0.06);
  overflow: hidden;
}

/* ── Header ── */
.tts-grim-head {
  position: relative;
  padding: 20px 24px 16px;
  border-bottom: 1px solid rgba(201,168,76,0.14);
  background: linear-gradient(180deg, rgba(201,168,76,0.04) 0%, transparent 100%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
}

.tts-grim-title {
  font-family: var(--font-display);
  font-size: 17px;
  font-weight: 600;
  color: var(--gold);
  letter-spacing: 0.12em;
  text-shadow: 0 0 20px rgba(201,168,76,0.3);
  margin: 0;
}

.tts-grim-close {
  position: absolute;
  top: 14px;
  right: 16px;
  background: none;
  border: 1px solid transparent;
  color: var(--text-muted);
  cursor: pointer;
  font-size: 13px;
  padding: 4px 8px;
  border-radius: 4px;
  transition: color 0.15s, border-color 0.15s;
}
.tts-grim-close:hover { color: var(--gold); border-color: var(--gold-border); }

/* Animated waveform */
.tts-waveform {
  display: flex;
  align-items: center;
  gap: 3px;
  height: 28px;
}
.twb {
  display: inline-block;
  width: 3px;
  background: var(--gold);
  border-radius: 2px;
  animation: twb-pulse 1.4s ease-in-out infinite;
  opacity: 0.5;
}
.twb:nth-child(1)  { height: 6px;  animation-delay: 0s; }
.twb:nth-child(2)  { height: 14px; animation-delay: 0.09s; }
.twb:nth-child(3)  { height: 20px; animation-delay: 0.18s; }
.twb:nth-child(4)  { height: 26px; animation-delay: 0.27s; }
.twb:nth-child(5)  { height: 22px; animation-delay: 0.36s; }
.twb:nth-child(6)  { height: 16px; animation-delay: 0.45s; }
.twb:nth-child(7)  { height: 24px; animation-delay: 0.54s; }
.twb:nth-child(8)  { height: 28px; animation-delay: 0.63s; }
.twb:nth-child(9)  { height: 24px; animation-delay: 0.72s; }
.twb:nth-child(10) { height: 18px; animation-delay: 0.81s; }
.twb:nth-child(11) { height: 22px; animation-delay: 0.90s; }
.twb:nth-child(12) { height: 14px; animation-delay: 0.99s; }
.twb:nth-child(13) { height: 20px; animation-delay: 1.08s; }
.twb:nth-child(14) { height: 10px; animation-delay: 1.17s; }
.twb:nth-child(15) { height: 16px; animation-delay: 1.26s; }
.twb:nth-child(16) { height: 8px;  animation-delay: 1.35s; }

@keyframes twb-pulse {
  0%, 100% { transform: scaleY(0.35); opacity: 0.25; }
  50%       { transform: scaleY(1);   opacity: 0.85; }
}

/* ── Scrollable body ── */
.tts-grim-body {
  overflow-y: auto;
  padding: 20px 24px;
  display: flex;
  flex-direction: column;
  gap: 20px;
  flex: 1;
  scrollbar-width: thin;
  scrollbar-color: var(--gold-border) transparent;
}

/* ── Section ── */
.tts-grim-section {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.tts-grim-section-head {
  display: flex;
  align-items: center;
  gap: 10px;
  padding-bottom: 8px;
  border-bottom: 1px solid rgba(201,168,76,0.1);
}
.tts-rune {
  font-size: 18px;
  color: var(--gold);
  opacity: 0.65;
  text-shadow: 0 0 10px rgba(201,168,76,0.4);
}
.tts-section-title {
  font-family: var(--font-display);
  font-size: 10px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--text-label);
}

/* ── Row ── */
.tts-grim-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.tts-grim-label {
  font-size: 12px;
  color: var(--text-ui);
  font-family: var(--font-ui);
  flex-shrink: 0;
  min-width: 110px;
}

/* ── Select ── */
.tts-select {
  flex: 1;
  background: rgba(10,10,20,0.8);
  border: 1px solid rgba(201,168,76,0.18);
  border-radius: 6px;
  color: var(--text-ui);
  font-family: var(--font-ui);
  font-size: 12px;
  padding: 6px 10px;
  cursor: pointer;
  outline: none;
  transition: border-color 0.15s;
}
.tts-select:focus { border-color: var(--gold-border); }

/* ── Toggle switch ── */
.tts-toggle {
  display: inline-flex;
  align-items: center;
  cursor: pointer;
}
.tts-toggle input { display: none; }
.tts-toggle-track {
  width: 42px;
  height: 22px;
  background: rgba(255,255,255,0.07);
  border: 1px solid rgba(255,255,255,0.14);
  border-radius: 11px;
  position: relative;
  transition: background 0.2s, border-color 0.2s;
}
.tts-toggle input:checked + .tts-toggle-track {
  background: rgba(201,168,76,0.18);
  border-color: var(--gold-border);
}
.tts-toggle-thumb {
  position: absolute;
  top: 2px;
  left: 2px;
  width: 16px;
  height: 16px;
  background: var(--text-muted);
  border-radius: 50%;
  transition: left 0.2s, background 0.2s;
}
.tts-toggle input:checked + .tts-toggle-track .tts-toggle-thumb {
  left: 22px;
  background: var(--gold);
}

/* ── Volume slider ── */
.tts-slider-wrap {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 10px;
}
.tts-slider-wrap input[type="range"] {
  flex: 1;
  accent-color: var(--gold);
  cursor: pointer;
  height: 4px;
}
.tts-slider-val {
  font-size: 11px;
  color: var(--text-muted);
  font-family: var(--font-ui);
  min-width: 36px;
  text-align: right;
}

/* ── Voice grid ── */
.tts-voice-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  align-items: start;
}
.tts-voice-card {
  background: rgba(255,255,255,0.02);
  border: 1px solid rgba(255,255,255,0.06);
  border-radius: 8px;
  padding: 10px 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.tts-voice-card-label {
  font-family: var(--font-display);
  font-size: 10px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-muted);
}
.tts-voice-card .tts-select {
  flex: unset;
  width: 100%;
  font-size: 11px;
}

/* ── Per-voice FX panels ── */
.tts-voice-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.tts-fx-expand-btn {
  background: none;
  border: 1px solid rgba(130,80,200,0.25);
  border-radius: 4px;
  color: #8060b8;
  font-family: var(--font-ui);
  font-size: 10px;
  letter-spacing: 0.04em;
  padding: 3px 8px;
  cursor: pointer;
  transition: color 0.15s, border-color 0.15s;
}
.tts-fx-expand-btn:hover, .tts-fx-expand-btn.expanded {
  color: #a080d8;
  border-color: rgba(160,100,220,0.5);
}
.tts-voice-fx-panel {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding-top: 8px;
  border-top: 1px solid rgba(130,80,200,0.12);
  margin-top: 2px;
}
.tts-vfx-row {
  display: flex;
  align-items: center;
  gap: 6px;
}
.tts-vfx-lbl {
  font-family: var(--font-ui);
  font-size: 10px;
  color: #8060b8;
  min-width: 52px;
  flex-shrink: 0;
}
.tts-fx-slider {
  flex: 1;
  accent-color: #9060d8;
  cursor: pointer;
  height: 4px;
}
.tts-vfx-pct {
  font-size: 10px;
  color: #6040a0;
  font-family: var(--font-ui);
  min-width: 28px;
  text-align: right;
}
/* NPC FX panel sits as sibling below the npc-row */
.tts-npc-fx-panel {
  padding: 6px 8px 4px;
  margin: -4px 0 2px;
  background: rgba(90,50,160,0.05);
  border-radius: 0 0 6px 6px;
  display: flex;
  flex-direction: column;
  gap: 5px;
}
.tts-npc-fx-btn {
  flex-shrink: 0;
  font-size: 10px;
  padding: 3px 6px;
}

/* ── Companion rows ── */
.tts-companion-rows {
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-height: 180px;
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: var(--gold-border) transparent;
}
.tts-npc-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 6px 8px;
  background: rgba(255,255,255,0.02);
  border-radius: 6px;
}
.tts-npc-name {
  font-size: 12px;
  color: var(--text-dm);
  font-family: var(--font-ui);
  min-width: 100px;
  flex-shrink: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* ── Footer ── */
.tts-grim-footer {
  padding: 14px 24px;
  border-top: 1px solid rgba(201,168,76,0.1);
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  background: rgba(0,0,0,0.2);
}
.tts-cancel-btn {
  background: none;
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 6px;
  color: var(--text-muted);
  font-family: var(--font-ui);
  font-size: 12px;
  padding: 7px 16px;
  cursor: pointer;
  transition: color 0.15s, border-color 0.15s;
}
.tts-cancel-btn:hover { color: var(--text-ui); border-color: rgba(255,255,255,0.25); }
.tts-save-btn {
  background: linear-gradient(135deg, rgba(90,56,16,0.9) 0%, rgba(201,168,76,0.18) 50%, rgba(90,56,16,0.9) 100%);
  border: 1px solid var(--gold-border);
  border-radius: 6px;
  color: var(--gold);
  font-family: var(--font-display);
  font-size: 11px;
  letter-spacing: 0.08em;
  padding: 7px 20px;
  cursor: pointer;
  transition: background 0.15s, box-shadow 0.15s;
}
.tts-save-btn:hover {
  background: linear-gradient(135deg, rgba(120,76,24,0.9) 0%, rgba(201,168,76,0.28) 50%, rgba(120,76,24,0.9) 100%);
  box-shadow: 0 0 16px rgba(201,168,76,0.15);
}

@media (max-width: 600px) {
  /* Bottom sheet */
  .tts-overlay   { align-items: flex-end; padding: 0; }
  .tts-grimoire  { max-width: 100%; max-height: 90vh; border-radius: 22px 22px 0 0; }

  /* Drag-pill indicator */
  .tts-grimoire::before {
    content: '';
    display: block;
    width: 36px;
    height: 4px;
    background: rgba(201,168,76,0.25);
    border-radius: 2px;
    margin: 10px auto 0;
    flex-shrink: 0;
  }

  /* Padding */
  .tts-grim-head   { padding: 8px 16px 12px; }
  .tts-grim-body   { padding: 14px 16px; gap: 16px; }
  .tts-grim-footer { padding: 10px 16px 18px; flex-direction: column; gap: 8px; }

  /* Full-width footer buttons on mobile */
  .tts-cancel-btn, .tts-save-btn {
    width: 100%;
    text-align: center;
    padding: 11px 16px;
    font-size: 13px;
  }

  /* Voice grid: single column */
  .tts-voice-grid { grid-template-columns: 1fr; }

  /* Bigger tap targets for effects buttons */
  .tts-fx-expand-btn { padding: 5px 14px; font-size: 11px; min-height: 30px; }
  .tts-npc-fx-btn    { padding: 5px 10px; min-height: 30px; }

  /* NPC rows: comfortable touch target */
  .tts-npc-row { min-height: 44px; }

  /* Companion list: more room on mobile */
  .tts-companion-rows { max-height: 220px; }

  /* FX label slightly larger for readability */
  .tts-vfx-lbl { min-width: 58px; font-size: 11px; }
}

/* ─── Battle Summary Modal ─────────────────────────────── */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.85);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 500;
  padding: 16px;
}
.modal-overlay.hidden { display: none !important; }

.modal-box {
  background: linear-gradient(135deg, #1a1826 0%, #151320 100%);
  border: 1px solid rgba(160,50,50,0.35);
  border-radius: 14px;
  padding: 28px 32px;
  max-width: 480px;
  width: 100%;
  box-shadow: 0 0 60px rgba(0,0,0,0.85), 0 0 40px rgba(160,50,50,0.08), inset 0 1px 0 rgba(255, 255, 255, 0.04);
}

.battle-summary-box {
  border-color: rgba(201,168,76,0.35);
  box-shadow: 0 0 60px rgba(0,0,0,0.85), 0 0 40px rgba(201,168,76,0.08);
  max-width: 560px;
  max-height: 80vh;
  display: flex;
  flex-direction: column;
}

.battle-summary-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 18px;
  flex-shrink: 0;
}

.battle-summary-title {
  font-family: var(--font-display, 'Cinzel', serif);
  font-size: 20px;
  font-weight: 700;
  color: var(--gold, #c9a84c);
  letter-spacing: 0.07em;
  text-shadow: 0 0 20px rgba(201,168,76,0.4);
}

.battle-summary-close-x {
  background: none;
  border: none;
  color: var(--text-muted, #666);
  font-size: 16px;
  cursor: pointer;
  padding: 2px 6px;
  border-radius: 4px;
  line-height: 1;
  transition: color 0.15s;
}
.battle-summary-close-x:hover { color: var(--text-ui, #bbb); }

.battle-summary-body {
  overflow-y: auto;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 18px;
  padding-right: 4px;
}

.battle-summary-section { display: flex; flex-direction: column; gap: 8px; }

.battle-summary-section-title {
  font-family: var(--font-display, 'Cinzel', serif);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--gold, #c9a84c);
  border-bottom: 1px solid rgba(201,168,76,0.15);
  padding-bottom: 5px;
}

.battle-summary-turns {
  display: flex;
  flex-direction: column;
  gap: 6px;
  max-height: 240px;
  overflow-y: auto;
}

.battle-turn-entry {
  font-size: 13px;
  color: var(--text-dm, #c8c0d8);
  line-height: 1.55;
  padding: 7px 10px;
  background: rgba(255,255,255,0.03);
  border-left: 2px solid rgba(201,168,76,0.25);
  border-radius: 0 5px 5px 0;
}

.battle-turn-label {
  font-size: 10px;
  font-family: var(--font-display, 'Cinzel', serif);
  color: var(--gold, #c9a84c);
  opacity: 0.9;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin-bottom: 2px;
}

.battle-summary-loot {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.battle-loot-enemy {
  font-size: 13px;
  color: var(--text-ui, #bbb);
}

.battle-loot-enemy-name {
  font-family: var(--font-display, 'Cinzel', serif);
  font-size: 11px;
  font-weight: 700;
  color: #c07070;
  letter-spacing: 0.05em;
  margin-bottom: 3px;
}

.battle-loot-items {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
}

.battle-loot-tag {
  font-size: 11px;
  color: var(--text-ui, #bbb);
  background: rgba(255,255,255,0.05);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 4px;
  padding: 2px 8px;
}

.battle-loot-none {
  font-size: 13px;
  color: var(--text-muted, #555);
  font-style: italic;
}

.battle-summary-footer {
  margin-top: 20px;
  display: flex;
  justify-content: flex-end;
  flex-shrink: 0;
}

.battle-summary-continue-btn {
  padding: 10px 26px;
  background: linear-gradient(135deg, rgba(138,104,32,0.4), rgba(201,168,76,0.25));
  border: 1px solid rgba(201,168,76,0.4);
  border-radius: 7px;
  color: var(--gold, #c9a84c);
  font-family: var(--font-display, 'Cinzel', serif);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.07em;
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
}
.battle-summary-continue-btn:hover {
  border-color: var(--gold, #c9a84c);
  background: rgba(201,168,76,0.2);
}

/* ═══ COMBAT DEAD OVERLAY ═══════════════════════════════ */
.combat-dead-banner {
  font-family: var(--font-display, 'Cinzel', serif);
  font-size: 15px;
  font-weight: 700;
  color: #d44;
  margin-bottom: 4px;
}
.combat-dead-sub {
  font-size: 12px;
  color: var(--text-muted);
  font-style: italic;
}

/* ═══ REVIVAL MODAL ══════════════════════════════════════ */
.revival-box {
  max-width: 440px;
  width: 100%;
  border-color: rgba(180, 50, 50, 0.5);
  padding: 28px 28px 22px;
  display: flex;
  flex-direction: column;
  gap: 18px;
}
.revival-header {
  display: flex;
  align-items: center;
  gap: 12px;
}
.revival-skull {
  font-size: 28px;
  line-height: 1;
}
.revival-title {
  font-family: var(--font-display, 'Cinzel', serif);
  font-size: 18px;
  font-weight: 700;
  color: #d44;
  letter-spacing: 0.05em;
}
.revival-body {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.revival-text {
  font-size: 14px;
  color: var(--text-dm);
  line-height: 1.55;
  margin: 0;
}
.revival-sub {
  font-size: 12px;
  color: var(--text-muted);
  line-height: 1.5;
  margin: 0;
}
.revival-footer {
  display: flex;
  justify-content: center;
}
.revival-btn {
  padding: 10px 28px;
  background: linear-gradient(135deg, rgba(130,30,30,0.5), rgba(180,50,50,0.3));
  border: 1px solid rgba(180, 50, 50, 0.5);
  border-radius: 7px;
  color: #e07070;
  font-family: var(--font-display, 'Cinzel', serif);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.07em;
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
}
.revival-btn:hover {
  border-color: rgba(220, 80, 80, 0.8);
  background: rgba(180, 50, 50, 0.3);
}
.revival-btn:disabled { opacity: 0.45; cursor: not-allowed; }

/* ═══ UTILITY ════════════════════════════════════════════ */
.hidden { display: none !important; }

/* Scrollbar resets */
* { scrollbar-width: thin; scrollbar-color: var(--border) transparent; }

/* ═══ MAP TAB — ANCIENT CARTOGRAPHIC REDESIGN ═══════════ */

.map-header-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
  padding: 0 2px;
}

.map-time-ancient {
  display: flex;
  align-items: center;
  gap: 7px;
  font-family: var(--font-display);
  font-size: 0.76rem;
}

.map-time-value {
  color: var(--gold);
  letter-spacing: 0.06em;
}

.map-time-sep { color: var(--text-muted); }

.map-time-period {
  color: #a07850;
  font-style: italic;
  letter-spacing: 0.02em;
}

.map-zoom-controls {
  display: flex;
  align-items: center;
  gap: 4px;
}

.map-btn-ancient {
  background: linear-gradient(180deg, #1c1610 0%, #120d07 100%);
  border: 1px solid rgba(170, 120, 35, 0.4);
  color: var(--gold);
  width: 28px;
  height: 26px;
  border-radius: 3px;
  cursor: pointer;
  font-size: 1rem;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.15s;
  font-family: var(--font-display);
  line-height: 1;
}
.map-btn-ancient:hover {
  border-color: rgba(201, 168, 76, 0.7);
  background: linear-gradient(180deg, #261e12 0%, #180f08 100%);
  box-shadow: 0 0 8px rgba(180, 130, 30, 0.3);
}

.map-btn-reset {
  width: auto;
  padding: 0 9px;
  font-size: 0.7rem;
  color: #a07850;
  border-color: rgba(120, 85, 30, 0.3);
  letter-spacing: 0.04em;
}

.map-zoom-label-ancient {
  font-family: var(--font-display);
  font-size: 0.66rem;
  color: #a07850;
  min-width: 88px;
  text-align: center;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.map-travel-card {
  background: linear-gradient(135deg, #100c06 0%, #181008 100%);
  border: 1px solid rgba(150, 108, 35, 0.32);
  border-radius: 5px;
  padding: 7px 12px;
  margin-bottom: 8px;
}

.map-travel-header {
  display: flex;
  align-items: center;
  gap: 7px;
  margin-bottom: 5px;
}

.map-travel-icon { color: var(--gold); font-size: 0.82rem; }

.map-travel-title {
  font-family: var(--font-display);
  font-size: 0.7rem;
  color: var(--gold);
  letter-spacing: 0.07em;
  flex: 1;
}

.map-travel-days {
  font-size: 0.67rem;
  color: #907055;
}

.map-travel-bar-bg {
  background: rgba(0, 0, 0, 0.5);
  border: 1px solid rgba(90, 65, 18, 0.35);
  border-radius: 2px;
  height: 4px;
  overflow: hidden;
}

.map-travel-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, #5a3c0c, #c9a84c, #5a3c0c);
  background-size: 200% 100%;
  animation: map-bar-shimmer 3s linear infinite;
  transition: width 0.4s;
}

@keyframes map-bar-shimmer {
  0%   { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

.map-travel-footer {
  display: flex;
  justify-content: space-between;
  margin-top: 3px;
}
.map-travel-remain { font-size: 0.64rem; color: #605040; }
.map-travel-miles  { font-size: 0.64rem; color: #806050; }

.map-filter-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 7px;
  padding: 2px 0;
}

.map-filter-label {
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 0.67rem;
  color: #806050;
  font-family: var(--font-display);
  letter-spacing: 0.04em;
  transition: color 0.15s;
  user-select: none;
}
.map-filter-label:hover { color: var(--gold); }
.map-filter-icon { font-size: 0.82rem; }

.map-canvas-frame {
  position: relative;
  border-radius: 2px;
  box-shadow:
    0 0 0 1px rgba(110, 78, 18, 0.45),
    0 0 0 4px rgba(30, 20, 8, 0.9),
    0 0 24px rgba(160, 115, 28, 0.14),
    0 8px 36px rgba(0, 0, 0, 0.75);
  overflow: hidden;
}

#map-canvas {
  display: block;
  width: 100%;
  background: #0a0704;
  cursor: grab;
  touch-action: none;
}

#map-tooltip {
  display: none;
  position: absolute;
  background: linear-gradient(145deg, #130d06 0%, #1a1108 100%);
  border: 1px solid rgba(150, 108, 35, 0.52);
  border-radius: 4px;
  padding: 9px 12px;
  font-size: 0.72rem;
  color: #c0a070;
  max-width: 230px;
  pointer-events: none;
  z-index: 10;
  line-height: 1.55;
  box-shadow: 0 4px 18px rgba(0, 0, 0, 0.65);
  font-family: var(--font-body);
}

.map-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  font-size: 0.65rem;
  color: #605040;
  margin-top: 6px;
  padding: 0 2px;
  font-family: var(--font-display);
  letter-spacing: 0.04em;
}

/* ─── Bug Report Button ────────────────────────────────────────── */
#bug-report-btn {
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  padding: 6px;
  border-radius: var(--radius);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: color 0.15s, background 0.15s;
  flex-shrink: 0;
}
#bug-report-btn:hover {
  color: var(--gold);
  background: var(--gold-dim);
}

/* ─── Bug Report Modal ─────────────────────────────────────────── */
.bug-report-box {
  width: 480px;
  max-width: 95vw;
  padding: 0;
  overflow: hidden;
}
.bug-report-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 18px 12px;
  border-bottom: 1px solid var(--gold-border);
}
.bug-report-title {
  font-family: var(--font-display);
  font-size: 0.95rem;
  color: var(--gold);
  letter-spacing: 0.04em;
}
.bug-report-close-x {
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 16px;
  cursor: pointer;
  padding: 2px 6px;
  border-radius: 4px;
  line-height: 1;
}
.bug-report-close-x:hover { color: var(--text-dm); }
.bug-report-body {
  padding: 16px 18px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.bug-report-label {
  font-size: 0.75rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: -4px;
}
.bug-report-input {
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text-dm);
  font-family: var(--font-body);
  font-size: 0.9rem;
  padding: 8px 10px;
  outline: none;
  transition: border-color 0.15s;
}
.bug-report-input:focus {
  border-color: var(--gold-border);
}
.bug-report-textarea {
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text-dm);
  font-family: var(--font-body);
  font-size: 0.9rem;
  padding: 8px 10px;
  outline: none;
  resize: vertical;
  min-height: 120px;
  transition: border-color 0.15s;
}
.bug-report-textarea:focus {
  border-color: var(--gold-border);
}
.bug-report-status {
  font-size: 0.82rem;
  padding: 6px 10px;
  border-radius: var(--radius);
  text-align: center;
}
.bug-report-status.status-ok {
  background: rgba(42, 138, 122, 0.15);
  color: var(--teal);
  border: 1px solid rgba(42, 138, 122, 0.3);
}
.bug-report-status.status-err {
  background: rgba(192, 64, 64, 0.12);
  color: var(--hp-red);
  border: 1px solid rgba(192, 64, 64, 0.25);
}

/* ═══ MOBILE SIDEBAR TOGGLE BUTTON ═══════════════════════ */
#mobile-sidebar-toggle {
  display: none;
  align-items: center;
  justify-content: center;
  background: none;
  border: 1px solid var(--gold-border);
  border-radius: var(--radius);
  color: var(--gold);
  cursor: pointer;
  padding: 5px 8px;
  font-size: 16px;
  line-height: 1;
}

/* Overlay backdrop for mobile sidebar */
#sidebar-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.65);
  z-index: 49;
}
#sidebar-overlay.active { display: block; }

/* ═══ MOBILE LAYOUT (≤ 768px) ════════════════════════════ */
@media (max-width: 768px) {
  /* Sidebar becomes an off-canvas overlay */
  #sidebar {
    position: fixed;
    top: var(--header-h);
    left: 0;
    bottom: 0;
    z-index: 50;
    width: 85vw;
    max-width: 320px;
    min-width: unset;
    transform: translateX(-100%);
    transition: transform 0.25s ease;
    overflow-y: auto;
  }
  #sidebar.mobile-open {
    transform: translateX(0);
  }

  /* Chat section fills full width */
  #chat-section {
    width: 100%;
    min-width: 0;
  }

  /* Show the hamburger toggle */
  #mobile-sidebar-toggle { display: flex; }

  /* Tighten header on small screens */
  #realm-sub { display: none; }
  #header-status { gap: 6px; }

  /* Input bar padding for thumbs */
  #input-bar { padding: 10px 12px 14px; gap: 8px; }
  #messages  { padding: 14px 12px; }
}
.bug-report-footer {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  padding: 12px 18px 16px;
  border-top: 1px solid var(--border);
}
.bug-report-cancel-btn {
  background: none;
  border: 1px solid var(--border);
  color: var(--text-muted);
  font-family: var(--font-ui);
  font-size: 0.82rem;
  padding: 6px 14px;
  border-radius: var(--radius);
  cursor: pointer;
}
.bug-report-cancel-btn:hover { color: var(--text-dm); }
.bug-report-submit-btn {
  background: linear-gradient(180deg, rgba(212, 168, 54, 0.14) 0%, rgba(212, 168, 54, 0.06) 100%);
  border: 1px solid var(--gold-border);
  color: var(--gold);
  font-family: var(--font-ui);
  font-size: 0.82rem;
  padding: 6px 16px;
  border-radius: var(--radius);
  cursor: pointer;
  transition: all 0.2s cubic-bezier(.25,.8,.25,1);
  box-shadow: inset 0 1px 0 rgba(255, 230, 140, 0.06), 0 1px 3px rgba(0, 0, 0, 0.2);
}
.bug-report-submit-btn:hover {
  background: linear-gradient(180deg, rgba(212, 168, 54, 0.22) 0%, rgba(212, 168, 54, 0.1) 100%);
  box-shadow: inset 0 1px 0 rgba(255, 230, 140, 0.08), 0 2px 8px rgba(212, 168, 54, 0.12);
  transform: translateY(-1px);
}
.bug-report-submit-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}
