:root {
  --primary: #ffb500;
  --primary-dark: #c98f00;
  --bg: #1a1a1a;
  --surface: #2a2a2a;
  --surface-1: #2e2e2e;
  --surface-2: #333;
  --border: #444;
  --text: #f2f2f2;
  --muted: #b0b0b0;
  --warning: #f59e0b;
}

.hero-town-layout {
  background: transparent !important;
  color: var(--text);
  min-height: 100vh;
  font-family: 'Roboto', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

/* ── App bar ────────────────────────────────────────────────── */
.appbar {
  position: sticky;
  top: 0;
  z-index: 30;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.55rem 0.85rem;
  background: var(--primary);
  color: #111;
  box-shadow: 0 2px 8px rgba(0,0,0,.45);
  flex-wrap: wrap;
}
.appbar h1 { margin: 0; font-size: 1.05rem; font-weight: 800; }
.appbar .spacer { flex: 1; }
.appbar button, .btn {
  border: 1px solid rgba(0,0,0,.22);
  background: rgba(0,0,0,.08);
  color: #111;
  border-radius: 8px;
  padding: 0.45rem 0.8rem;
  cursor: pointer;
  font-size: 0.86rem;
  font-weight: 600;
}

.gold-chip {
  display: inline-flex;
  align-items: center;
  background: #111;
  color: var(--primary);
  border-radius: 999px;
  padding: 0.35rem 0.75rem;
  font-weight: 700;
  font-size: 0.9rem;
}

.page-container { max-width: 1200px; margin: 0 auto; padding: 0.75rem; }


/* ── Area tabs (Town / Character Sheet / Manage) ───────────── */
.area-tabs {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 0.5rem;
  margin-bottom: 0.75rem;
}
.area-tab {
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  border-radius: 10px;
  padding: 0.7rem 0.85rem;
  cursor: pointer;
  font-weight: 700;
  font-size: 0.95rem;
  text-align: left;
}
.area-tab:hover { border-color: var(--primary); }
.area-tab.active {
  border-color: var(--primary);
  box-shadow: inset 0 0 0 1px var(--primary);
  background: rgba(255,181,0,.08);
}
.area-tab .sub { display: block; margin-top: 0.2rem; font-size: 0.72rem; font-weight: 600; color: var(--muted); }
.area-tab .short { display: none; }

/* ── Building nav (row of town-building buttons) ───────────── */
.building-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 0;
}

.building-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  border-radius: 10px;
  padding: 0.55rem 0.5rem;
  cursor: pointer;
  text-align: center;
  min-width: 90px;
  flex: 1 1 0;
  max-width: 130px;
  gap: 0.15rem;
  transition: border-color 0.15s, background 0.15s;
}
.building-btn:hover { border-color: var(--primary); background: rgba(255,181,0,.04); }
.building-btn.active {
  border-color: var(--primary);
  box-shadow: inset 0 0 0 1px var(--primary);
  background: rgba(255,181,0,.1);
}
.building-btn .icon { font-size: 1.15rem; line-height: 1; }
.building-btn .label { font-weight: 700; font-size: 0.75rem; line-height: 1.2; white-space: nowrap; }
.building-btn .sub { font-size: 0.65rem; color: var(--muted); line-height: 1.2; white-space: nowrap; }

/* ── Building header box (background image area) ───────────── */
.building-header-box {
  background-color: var(--surface);
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  border-radius: 12px;
  border: 1px solid rgba(255, 181, 0, 0.3);
  padding: 0.85rem;
  margin-bottom: 0.75rem;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5);
}

.building-info-bar {
  padding: 0.6rem 0.85rem;
  margin-top: 0.6rem;
  border-top: 1px solid rgba(255,255,255,.08);
}
.building-info-bar .building-title {
  margin: 0;
  color: var(--primary);
  font-family: 'Cinzel', serif;
  letter-spacing: 0.04em;
  font-size: 1.15rem;
  font-weight: 800;
  text-shadow: 0 1px 6px rgba(0,0,0,.7);
}
.building-info-bar .building-quote {
  margin: 0.2rem 0 0;
  color: var(--muted);
  font-style: italic;
  font-size: 0.85rem;
  text-shadow: 0 1px 4px rgba(0,0,0,.5);
}

/* ── Building content (the main area inside shop container) ──── */
.building-content {
  padding: 0.5rem 0 0;
  margin-top: 0.5rem;
}

/* ── Per-building background images ────────────────────────── */
.building-header-box[data-building="market"]   { background-image: linear-gradient(180deg, rgba(14, 14, 18, 0.72) 0%, rgba(14, 14, 18, 0.88) 100%), url('../images/town/market_bg.png'); }
.building-header-box[data-building="training"] { background-image: linear-gradient(180deg, rgba(14, 14, 18, 0.72) 0%, rgba(14, 14, 18, 0.88) 100%), url('../images/town/training_bg.png'); }
.building-header-box[data-building="bank"]     { background-image: linear-gradient(180deg, rgba(14, 14, 18, 0.72) 0%, rgba(14, 14, 18, 0.88) 100%), url('../images/town/bank_bg.png'); }
.building-header-box[data-building="henchmen"] { background-image: linear-gradient(180deg, rgba(14, 14, 18, 0.72) 0%, rgba(14, 14, 18, 0.88) 100%), url('../images/town/henchmen_bg.png'); }
.building-header-box[data-building="lodgings"] { background-image: linear-gradient(180deg, rgba(14, 14, 18, 0.72) 0%, rgba(14, 14, 18, 0.88) 100%), url('../images/town/bank_bg.png'); }
.building-header-box[data-building="healer"]   { background-image: linear-gradient(180deg, rgba(14, 14, 18, 0.72) 0%, rgba(14, 14, 18, 0.88) 100%), url('../images/town/healer_bg.png'); }
.building-header-box[data-building="tavern"]   { background-image: linear-gradient(180deg, rgba(14, 14, 18, 0.72) 0%, rgba(14, 14, 18, 0.88) 100%), url('../images/town/tavern_bg.png'); }
.building-header-box[data-building="college"]  { background-image: linear-gradient(180deg, rgba(14, 14, 18, 0.72) 0%, rgba(14, 14, 18, 0.88) 100%), url('../images/town/college_bg.png'); }

/* ── Generic building header (legacy) ──────────────────────── */
.building-header {
  border-radius: 12px;
  padding: 1rem 1.1rem;
  margin-bottom: 0.75rem;
  border: 1px solid var(--border);
  background: linear-gradient(135deg, rgba(255,255,255,.04), rgba(0,0,0,.2));
}
.building-header h2 { margin: 0 0 0.35rem; color: var(--primary); font-size: 1.15rem; }
.building-header .quote { color: var(--muted); font-style: italic; font-size: 0.9rem; }

/* ── Fantasy headers ───────────────────────────────────────── */
.fantasy-header2 {
  color: var(--primary);
  font-size: 1.05rem;
  font-weight: 800;
  margin: 1rem 0 0.5rem;
}

/* ── Chips ──────────────────────────────────────────────────── */
.chips { display: flex; flex-wrap: wrap; gap: 0.4rem; }
.chip {
  border: 1px solid var(--border);
  background: var(--surface-2);
  color: var(--text);
  border-radius: 999px;
  padding: 0.25rem 0.65rem;
  font-size: 0.78rem;
  font-weight: 700;
}
.chip.gold { color: var(--primary); border-color: var(--primary-dark); }

/* ── Note panel ────────────────────────────────────────────── */
.note {
  border: 1px solid var(--border);
  background: var(--surface);
  border-radius: 10px;
  padding: 0.75rem 0.9rem;
  color: var(--muted);
  font-size: 0.86rem;
  margin-bottom: 0.75rem;
}

/* ── Grid layouts ──────────────────────────────────────────── */
.shop-layout, .vault-layout, .spell-layout, .map-layout, .sheet-grid {
  display: grid;
  gap: 0.75rem;
}
@media (min-width: 768px) {
  .shop-layout, .vault-layout { grid-template-columns: minmax(240px, 38%) minmax(0, 1fr); }
  .spell-layout { grid-template-columns: minmax(0, 1.6fr) minmax(220px, 1fr); }
  .map-layout { grid-template-rows: auto 1fr; min-height: 420px; }
}

/* ── Panel ─────────────────────────────────────────────────── */
.panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  overflow: hidden;
  min-height: 160px;
  display: flex;
  flex-direction: column;
}
.panel-head {
  padding: 0.6rem 0.85rem;
  border-bottom: 1px solid var(--border);
  font-size: 0.8rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--muted);
}
.panel-body {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--muted);
  text-align: center;
  padding: 1.4rem 1rem;
  font-size: 0.9rem;
}

/* ── Inner nav ─────────────────────────────────────────────── */
.merchant-nav, .inner-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-bottom: 0.65rem;
}
.inner-nav button {
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  border-radius: 8px;
  padding: 0.4rem 0.7rem;
  cursor: pointer;
  font-weight: 700;
  font-size: 0.8rem;
}
.inner-nav button.active {
  border-color: var(--primary);
  background: rgba(255,181,0,.08);
}

/* ── Tables ────────────────────────────────────────────────── */
.table-wrap { overflow-x: auto; margin-bottom: 0.75rem; }
table.layout {
  width: 100%;
  border-collapse: collapse;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  overflow: hidden;
  font-size: 0.86rem;
}
table.layout th, table.layout td {
  padding: 0.55rem 0.65rem;
  border-bottom: 1px solid rgba(255,255,255,.06);
  text-align: left;
}
table.layout th { color: var(--muted); font-size: 0.75rem; text-transform: uppercase; letter-spacing: .04em; }
table.layout td.empty { color: var(--muted); font-style: italic; }

/* ── Toolbar ───────────────────────────────────────────────── */
.toolbar { display: flex; flex-wrap: wrap; gap: 0.5rem; align-items: center; margin-bottom: 0.75rem; }

/* ── Filters ───────────────────────────────────────────────── */
.filters { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 0.5rem; margin-bottom: 0.75rem; }
.filter {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 0.45rem 0.55rem;
}
.filter label { display: block; font-size: 0.7rem; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; font-weight: 700; margin-bottom: 0.3rem; }
.filter .opts { display: flex; flex-direction: column; gap: 0.2rem; }
.filter .opts label { text-transform: none; letter-spacing: 0; font-size: 0.8rem; color: var(--text); font-weight: 600; display: flex; gap: 0.35rem; align-items: center; }

/* ── Character sheet grid ──────────────────────────────────── */
.sheet-grid { grid-template-columns: 1fr; }
.sheet-block {
  background: var(--surface);
  border: 1px dashed var(--border);
  border-radius: 10px;
  min-height: 72px;
  padding: 0.7rem 0.85rem;
  color: var(--muted);
}
.sheet-block.portrait { min-height: 140px; text-align: center; }
.sheet-block strong { display: block; color: var(--primary); margin-bottom: 0.25rem; }
.sheet-location { color: var(--muted); font-size: 0.82rem; margin-bottom: 0.45rem; }

@media (min-width: 768px) {
  .sheet-grid {
    grid-template-columns: 1fr 160px 1fr;
    grid-template-areas:
      "statsL portrait statsR"
      "name    portrait wounds"
      "hth     hth      hth"
      "rng     rng      rng"
      "wpn     wpn      wpn"
      "arm     arm      arm"
      "eq      eq       eq"
      "notes   notes    notes"
      "fx      fx       fx";
  }
  .sheet-block.statsL { grid-area: statsL; }
  .sheet-block.portrait { grid-area: portrait; }
  .sheet-block.statsR { grid-area: statsR; }
  .sheet-block.name { grid-area: name; }
  .sheet-block.wounds { grid-area: wounds; }
  .sheet-block.hth { grid-area: hth; }
  .sheet-block.rng { grid-area: rng; }
  .sheet-block.wpn { grid-area: wpn; }
  .sheet-block.arm { grid-area: arm; }
  .sheet-block.eq { grid-area: eq; }
  .sheet-block.notes { grid-area: notes; }
  .sheet-block.fx { grid-area: fx; }
}

.sheet-actions { display: flex; gap: 0.5rem; flex-wrap: wrap; margin-bottom: 0.75rem; }

/* ── Buttons ───────────────────────────────────────────────── */
.btn.ghost, .btn.dark {
  background: var(--surface-2);
  color: var(--text);
  border-color: var(--border);
}
.btn.primary { background: var(--primary); color: #111; border-color: var(--primary-dark); }

/* ── Popup overlay ─────────────────────────────────────────── */
.ahq-popup-overlay {
  display: flex;
  position: fixed;
  inset: 0;
  z-index: 80;
  background: rgba(0,0,0,.62);
  align-items: center;
  justify-content: center;
  padding: 1rem;
}
.ahq-popup {
  width: min(920px, 96vw);
  min-height: 420px;
  max-height: 90vh;
  overflow: auto;
  background: var(--surface);
  border: 1px solid var(--primary);
  border-radius: 14px;
  box-shadow: 0 16px 40px rgba(0,0,0,.55);
  display: flex;
  flex-direction: column;
}
.ahq-popup-head {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.75rem 0.9rem;
  border-bottom: 1px solid var(--border);
}
.ahq-popup-head h3 { margin: 0; flex: 1; color: var(--primary); font-size: 1.1rem; }
.ahq-popup-body { padding: 0.85rem; }

/* ── MudBlazor dark overrides inside building-content ──────── */
.building-content .mud-paper {
  background: var(--surface) !important;
  color: var(--text) !important;
  border: 1px solid var(--border) !important;
  border-radius: 10px !important;
  box-shadow: none !important;
}

.building-content .mud-table {
  background: var(--surface) !important;
  color: var(--text) !important;
  border: 1px solid var(--border) !important;
  border-radius: 10px !important;
}
.building-content .mud-table .mud-table-head th {
  color: var(--primary) !important;
  font-family: 'Cinzel', serif !important;
  font-size: 0.82rem;
  text-transform: uppercase;
  letter-spacing: .06em;
  border-bottom: 2px solid rgba(255, 181, 0, 0.4) !important;
}
.building-content .mud-table .mud-table-body td {
  color: var(--text) !important;
  border-bottom: 1px solid rgba(255,255,255,.06) !important;
}
.building-content .mud-table .mud-table-toolbar {
  background: transparent !important;
  color: var(--primary) !important;
}
.building-content .mud-table .mud-table-toolbar .mud-typography {
  color: var(--primary) !important;
}

.building-content .mud-alert {
  border-radius: 8px !important;
}

.building-content .mud-text-secondary,
.building-content .mud-typography.mud-text-secondary {
  color: var(--muted) !important;
}

.building-content .mud-button-filled.mud-button-filled-primary {
  background: var(--primary) !important;
  color: #111 !important;
}

/* Live quest list/create pages use the same dark surfaces as Town buildings. */
.live-quest-list-page,
.live-quest-create-page {
  color: var(--text);
  padding: 0.75rem;
}

.live-quest-list-page > .mud-stack {
  padding: 0.85rem;
  background: rgba(18, 18, 24, 0.88);
  border: 1px solid rgba(255, 181, 0, 0.3);
  border-radius: 12px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.45);
}

.live-quest-select .mud-input,
.live-quest-select .mud-input-label,
.live-quest-select .mud-select-input,
.live-quest-create-card .mud-input,
.live-quest-create-card .mud-input-label,
.live-quest-create-card .mud-select-input,
.live-quest-create-card input,
.live-quest-create-card input::placeholder {
  color: #ffffff !important;
  opacity: 1;
}

.live-quest-select .mud-input-outlined-border,
.live-quest-create-card .mud-input-outlined-border {
  border-color: rgba(255, 255, 255, 0.62) !important;
}

.live-quest-select .mud-input-control:hover .mud-input-outlined-border,
.live-quest-select .mud-input-control.mud-input-focused .mud-input-outlined-border,
.live-quest-create-card .mud-input-control:hover .mud-input-outlined-border,
.live-quest-create-card .mud-input-control.mud-input-focused .mud-input-outlined-border {
  border-color: var(--primary) !important;
}

.live-quest-select-popover,
.live-quest-select-popover .mud-paper,
.live-quest-select-list {
  background: #111116 !important;
  color: #ffffff !important;
  border-color: rgba(255, 181, 0, 0.55) !important;
}

.live-quest-select-list .mud-list-item,
.live-quest-select-list .mud-list-item-text {
  color: #ffffff !important;
}

.live-quest-select-list .mud-list-item:hover,
.live-quest-select-list .mud-list-item-selected {
  background: rgba(255, 181, 0, 0.18) !important;
  color: var(--primary) !important;
}

.live-quest-create-label {
  color: #ffffff !important;
  font-weight: 600;
}

.live-quest-create-list {
  background: rgba(12, 12, 16, 0.92) !important;
  border: 1px solid rgba(255, 181, 0, 0.35) !important;
  border-radius: 10px !important;
  max-height: 280px;
  overflow-y: auto;
}

.live-quest-create-quest-list {
  background: transparent !important;
  padding: 0.25rem 0 !important;
}

.live-quest-create-option,
.live-quest-create-option--selected {
  color: #ffffff !important;
  border-radius: 0 !important;
}

.live-quest-create-option:hover {
  background: rgba(255, 181, 0, 0.12) !important;
}

.live-quest-create-option--selected {
  background: rgba(255, 181, 0, 0.22) !important;
  border-left: 3px solid var(--primary) !important;
}

.live-quest-create-option-name {
  color: #ffffff !important;
}

.live-quest-create-option--selected .live-quest-create-option-name {
  color: var(--primary) !important;
  font-weight: 700;
}

.live-quest-grid-wrap {
  max-width: 100%;
  overflow-x: auto;
  border-radius: 10px;
}

.live-quest-grid.mud-table,
.live-quest-grid .mud-table-container,
.live-quest-grid .mud-table-root {
  background: var(--surface) !important;
  color: var(--text) !important;
}

.live-quest-grid.mud-table {
  border: 1px solid var(--border) !important;
  border-radius: 10px !important;
}

.live-quest-grid .mud-table-head th {
  color: var(--primary) !important;
  font-family: 'Cinzel', serif !important;
  font-size: 0.82rem;
  letter-spacing: .06em;
  text-transform: uppercase;
  border-bottom: 2px solid rgba(255, 181, 0, 0.4) !important;
}

.live-quest-grid .mud-table-body tr {
  background: var(--surface) !important;
}

.live-quest-grid .mud-table-body tr:hover {
  background: rgba(255, 181, 0, 0.08) !important;
}

.live-quest-grid .mud-table-body td {
  color: var(--text) !important;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08) !important;
}

.live-quest-create-card {
  background: rgba(22, 22, 28, 0.96) !important;
  color: #ffffff !important;
  border: 1px solid rgba(255, 181, 0, 0.35);
  border-radius: 14px !important;
  box-shadow: 0 16px 48px rgba(0, 0, 0, 0.65) !important;
}

.live-quest-create-card h2,
.live-quest-create-card .mud-typography {
  color: #ffffff !important;
}

/* ── Responsive ────────────────────────────────────────────── */
@media (max-width: 800px) {
  .filters { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 600px) {
  .page-container { padding: 0.55rem; }
  .area-tab { padding: 0.5rem 0.3rem; font-size: 0.82rem; text-align: center; }
  .area-tab .sub { display: none; }
  .area-tab .full { display: none; }
  .area-tab .short { display: inline; }
  .building-nav { gap: 0.3rem; }
  .building-btn { min-width: 60px; max-width: none; padding: 0.45rem 0.2rem; }
  .building-btn .icon { font-size: 1.1rem; }
  .building-btn .label { font-size: 0.68rem; }
  .building-btn .sub { display: none; }
  .building-header-box { padding: 0.5rem; }
  .building-info-bar .building-title { font-size: 0.95rem; }
  .building-info-bar .building-quote { display: none; }
  .filters { grid-template-columns: 1fr 1fr; }
  .panel { min-height: 120px; }
}

/* ── Area Tabs Bar & Header Meta ────────────────────────────── */
.area-tabs-bar {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 0.75rem;
  flex-wrap: wrap;
  max-width: 1040px;
  margin-left: auto;
  margin-right: auto;
  width: 100%;
}
.area-tabs-bar .area-tabs {
  flex: 1;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.75rem;
  width: 100%;
}
.area-hero-meta {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 0.6rem;
  background: rgba(18, 18, 24, 0.78);
  border: 1px solid rgba(255, 181, 0, 0.3);
  border-radius: 10px;
  padding: 0.35rem 0.75rem;
  backdrop-filter: blur(8px);
}
.hero-meta-name {
  font-weight: 700;
  color: var(--primary);
  font-size: 0.95rem;
}

/* ── Glassmorphism Translucent Overlays ─────────────────────── */
.building-content .mud-paper,
.building-content .mud-card,
.mud-card,
.panel,
.table-wrap table.layout,
.sheet-block,
.building-header,
.filter {
  background: rgba(18, 18, 24, 0.82) !important;
  backdrop-filter: blur(10px) !important;
  -webkit-backdrop-filter: blur(10px) !important;
  border: 1px solid rgba(255, 181, 0, 0.25) !important;
  border-radius: 10px !important;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.45) !important;
  color: var(--text) !important;
}

/* Character Sheet Transparency Overrides */
.ahq-sheet-wrap,
.ahq-sheet-wrap .ahq-sheet,
.sheet-main-col,
.sheet-main-col .mud-container {
  background-color: transparent !important;
  box-shadow: none !important;
  border: none !important;
  backdrop-filter: none !important;
  -webkit-backdrop-filter: none !important;
}

.mud-list-item {
  color: var(--text) !important;
  border-radius: 8px !important;
  margin-bottom: 0.25rem !important;
  border: 1px solid rgba(255, 255, 255, 0.08) !important;
  transition: background 0.15s ease-in-out !important;
}
.mud-list-item:hover {
  background: rgba(255, 181, 0, 0.18) !important;
  color: #ffb500 !important;
  border-color: rgba(255, 181, 0, 0.4) !important;
}

.delete-hero-btn {
  background: transparent;
  border: none;
  color: #ef4444;
  font-size: 0.9rem;
  font-weight: 800;
  cursor: pointer;
  padding: 0.15rem 0.4rem;
  border-radius: 4px;
  margin-left: 0.3rem;
  transition: all 0.15s ease-in-out;
}
.delete-hero-btn:hover {
  background: rgba(239, 68, 68, 0.25);
  color: #f87171;
  transform: scale(1.2);
}

/* ── Character Sheet 2-Column Grid Layout ───────────────────── */
.character-sheet-layout {
  display: grid;
  grid-template-columns: 280px minmax(0, 1fr);
  gap: 1rem;
  align-items: start;
  max-width: 1040px;
  margin: 0 auto;
  width: 100%;
}

.sheet-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  padding: 0.65rem;
  background: rgba(18, 18, 24, 0.85);
  border: 1px solid rgba(255, 181, 0, 0.3);
  border-radius: 12px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.45);
}

.sheet-action-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  min-height: 38px;
  padding: 0.42rem 0.65rem;
  border: 1px solid var(--border);
  border-radius: 9px;
  background: var(--surface);
  color: var(--text);
  font-size: 0.75rem;
  font-weight: 700;
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
}

.sheet-action-btn:hover:not(:disabled) {
  border-color: var(--primary);
  background: rgba(255, 181, 0, 0.1);
}

.sheet-action-btn .mud-icon-root {
  color: var(--primary);
  font-size: 1.15rem;
}

.sheet-action-btn:disabled {
  color: #777;
  cursor: not-allowed;
  opacity: 0.55;
}

.sheet-action-btn:disabled .mud-icon-root { color: #777; }
@media (max-width: 900px) {
  .character-sheet-layout {
    grid-template-columns: 1fr;
  }
}

/* ── Dark Dialog Modal Overrides ────────────────────────────── */
.mud-dialog.ahq-dark-dialog {
  background: rgba(22, 22, 28, 0.95) !important;
  backdrop-filter: blur(14px) !important;
  -webkit-backdrop-filter: blur(14px) !important;
  border: 1px solid rgba(255, 181, 0, 0.35) !important;
  border-radius: 14px !important;
  color: #f2f2f2 !important;
  box-shadow: 0 16px 48px rgba(0, 0, 0, 0.75) !important;
}
.ahq-dark-dialog .mud-dialog-title {
  color: #ffb500 !important;
  border-bottom: 1px solid rgba(255, 181, 0, 0.2) !important;
}
.ahq-dark-dialog .mud-tabs-toolbar {
  background: rgba(0, 0, 0, 0.35) !important;
}
.ahq-dark-dialog .mud-tab {
  color: #b0b0b0 !important;
  font-weight: 700 !important;
}
.ahq-dark-dialog .mud-tab.mud-tab-active {
  color: #ffb500 !important;
}
.ahq-dark-dialog input,
.ahq-dark-dialog label,
.ahq-dark-dialog .mud-select-input {
  color: #ffffff !important;
}
.ahq-dark-dialog .mud-dialog-content,
.ahq-dark-dialog .mud-dialog-actions,
.ahq-dark-dialog .mud-typography {
  color: #f2f2f2 !important;
}

.item-transfer-dialog .mud-input-control,
.item-transfer-dialog .mud-input,
.item-transfer-dialog .mud-input-label,
.item-transfer-dialog .mud-select-input,
.item-transfer-dialog .mud-numeric-field {
  color: #ffffff !important;
}

.item-transfer-dialog .mud-input-outlined-border {
  border-color: rgba(255, 181, 0, 0.55) !important;
}

.item-transfer-popover,
.item-transfer-popover .mud-paper,
.item-transfer-list {
  background: #111116 !important;
  color: #ffffff !important;
  border-color: rgba(255, 181, 0, 0.55) !important;
}

.item-transfer-list .mud-list-item,
.item-transfer-list .mud-list-item-text {
  color: #ffffff !important;
}

.item-transfer-list .mud-list-item:hover {
  background: rgba(255, 181, 0, 0.18) !important;
}

.quest-reward-select-popover,
.quest-reward-select-popover .mud-paper,
.quest-reward-select-list {
  background: #111116 !important;
  color: #ffffff !important;
  border-color: rgba(255, 181, 0, 0.55) !important;
}

.quest-reward-select-list .mud-list-item,
.quest-reward-select-list .mud-list-item-text {
  color: #ffffff !important;
}

.quest-reward-select-list .mud-list-item:hover,
.quest-reward-select-list .mud-list-item-selected {
  background: rgba(255, 181, 0, 0.18) !important;
  color: #ffbd00 !important;
}

.item-transfer-option {
  display: inline-flex;
  align-items: center;
  gap: 0.65rem;
  color: inherit;
}

.item-transfer-option .shop-item-image,
.item-transfer-option img {
  width: 34px;
  height: 34px;
  object-fit: contain;
}

/* ── Hero Creation Card Helpers ────────────────────────────── */
.hero-name-input input {
  color: #ffffff !important;
  font-size: 1.1rem !important;
  font-weight: 700 !important;
}
.hero-name-input label,
.hero-name-input .mud-input-label,
.hero-name-input input::placeholder {
  color: rgba(255, 255, 255, 0.85) !important;
}
.hero-name-input.mud-input-focused label,
.hero-name-input.mud-input-focused .mud-input-label {
  color: #ffb500 !important;
}

/* ── Hero Roster Sidebar ───────────────────────────────────── */
.hero-roster-sidebar {
  background: rgba(18, 18, 24, 0.85);
  border: 1px solid rgba(255, 181, 0, 0.3);
  border-radius: 12px;
  backdrop-filter: blur(10px);
  padding: 0.75rem;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.45);
}
.sidebar-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-bottom: 0.5rem;
  margin-bottom: 0.65rem;
  border-bottom: 1px solid rgba(255, 181, 0, 0.2);
}
.sidebar-title {
  font-family: 'Cinzel', serif;
  font-weight: 800;
  font-size: 0.95rem;
  color: #ffb500;
  letter-spacing: 0.04em;
}
.btn-xs {
  padding: 0.2rem 0.5rem;
  font-size: 0.75rem;
}
.roster-list {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}
.roster-hero-group {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}
.roster-item {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  padding: 0.45rem 0.6rem;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  cursor: pointer;
  transition: all 0.15s ease-in-out;
}
.roster-item:hover {
  background: rgba(255, 181, 0, 0.12);
  border-color: rgba(255, 181, 0, 0.4);
  transform: translateX(2px);
}
.roster-item.active {
  background: rgba(255, 181, 0, 0.22);
  border-color: #ffb500;
  box-shadow: 0 0 10px rgba(255, 181, 0, 0.25);
}
.hero-avatar {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  overflow: hidden;
  border: 1px solid rgba(255, 181, 0, 0.5);
  flex-shrink: 0;
}
.hero-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.hero-info {
  flex: 1;
  min-width: 0;
}
.hero-name {
  font-size: 0.86rem;
  font-weight: 700;
  color: #fff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.roster-item.active .hero-name {
  color: #ffb500;
}
.hero-sub {
  font-size: 0.72rem;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.gold-mini {
  font-size: 0.72rem;
  font-weight: 700;
  color: #ffb500;
  background: rgba(0, 0, 0, 0.3);
  padding: 0.1rem 0.4rem;
  border-radius: 4px;
}
.roster-henchmen-list {
  margin-left: 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  border-left: 2px solid rgba(255, 181, 0, 0.25);
  padding-left: 0.4rem;
}
.henchman-item {
  padding: 0.35rem 0.5rem;
  font-size: 0.8rem;
  background: rgba(0, 0, 0, 0.25);
}
.henchman-icon {
  font-size: 0.85rem;
}

/* ── Tavern Quest Cards ──────────────────────── */
.fantasy-quest-card {
  background: linear-gradient(135deg, rgba(28, 28, 36, 0.95), rgba(18, 18, 24, 0.98)) !important;
  border: 1px solid var(--border, rgba(255, 255, 255, 0.1)) !important;
  border-radius: 12px !important;
  transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}

.fantasy-quest-card:hover {
  border-color: rgba(255, 181, 0, 0.35) !important;
  box-shadow: 0 4px 18px rgba(0, 0, 0, 0.4);
}

.fantasy-quest-card.active-quest {
  border: 1.5px solid #ffb500 !important;
  background: linear-gradient(135deg, rgba(38, 32, 18, 0.95), rgba(22, 19, 14, 0.98)) !important;
  box-shadow: 0 0 18px rgba(255, 181, 0, 0.22);
}

.quest-rumor-quote {
  background: rgba(0, 0, 0, 0.28);
  border-left: 3px solid var(--primary, #ffb500);
  border-radius: 0 8px 8px 0;
  padding: 0.6rem 0.85rem;
}

.quest-info-block {
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid rgba(255, 255, 255, 0.05);
  border-radius: 8px;
  padding: 0.65rem 0.8rem;
  height: 100%;
}

.quest-block-header {
  font-weight: 700;
  letter-spacing: 0.05em;
  display: flex;
  align-items: center;
  margin-bottom: 0.35rem;
}

.quest-block-header.gold-label {
  color: #ffb500;
}

.quest-block-header.info-label {
  color: #4fc3f7;
}

.quest-block-header.companions-label {
  color: #ce93d8;
}

.companion-chip {
  background: rgba(255, 255, 255, 0.04) !important;
  border-color: rgba(255, 255, 255, 0.12) !important;
}
