/* =======================================================================
   WIZARD: REALMS OF ETERNITY - styles.css
   Fantasy UI: dark stone, aged parchment, gold filigree and arcane glow.
   No external fonts or images are used.
   ======================================================================= */

:root {
  --gold: #c8a33c;
  --gold-bright: #f0d060;
  --gold-dim: #8a6f2a;
  --stone: #241f2e;
  --stone-2: #1a1622;
  --stone-3: #2f2839;
  --parch: #e8dcc0;
  --parch-dim: #b8ac8c;
  --ink: #2a2218;
  --blood: #8a2f3a;
  --mana: #4a7fd8;
  --life: #b83a3a;
  --glow: #8fd8ff;
  --violet: #b07bff;
  --ui-scale: 1;
}

* { box-sizing: border-box; }

html, body {
  margin: 0; padding: 0;
  width: 100%; height: 100%;
  overflow: hidden;
  background: #05040a;
  color: var(--parch);
  font-family: Georgia, 'Times New Roman', serif;
  user-select: none;
  -webkit-user-select: none;
}

#app { position: fixed; inset: 0; }

#game-canvas {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  display: block;
  image-rendering: auto;
  background: #05040a;
}

.fx-layer {
  position: absolute; inset: 0;
  pointer-events: none;
}

/* -----------------------------------------------------------------------
   HUD BUTTONS - drawn over the canvas so they can actually be clicked
   ----------------------------------------------------------------------- */
#hud-sound {
  position: absolute; top: 14px; right: 16px;
  display: flex; gap: 8px;
  z-index: 6;
}
.hud-btn {
  position: relative;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 1px;
  width: 38px; height: 38px; padding: 0;
  color: var(--gold-bright);
  background: linear-gradient(180deg, rgba(50,42,64,0.95), rgba(16,13,24,0.97));
  border: 2px solid var(--gold-dim);
  border-radius: 8px;
  cursor: pointer;
  font-family: inherit;
  transition: border-color 0.15s ease, color 0.15s ease, transform 0.12s ease, opacity 0.2s ease;
  box-shadow: 0 2px 10px rgba(0,0,0,0.5);
  z-index: 6;
}
.hud-btn svg { width: 21px; height: 21px; display: block; }
.hud-btn:hover { border-color: var(--gold-bright); color: #fff6d0; transform: translateY(-1px); }
.hud-btn:active { transform: translateY(1px); }
.hud-btn.off { color: #7a6f5c; border-color: #4a4136; }
.hud-btn.off .off-mark {
  position: absolute; left: 4px; right: 4px; top: 50%; height: 2.4px;
  background: #d04a4a; border-radius: 2px;
  transform: rotate(-42deg);
  box-shadow: 0 0 6px rgba(208,74,74,0.8);
}
.hud-btn.hidden { opacity: 0; pointer-events: none; }

#hud-spellbook {
  position: absolute;
  left: calc(50% + 232px * var(--ui-scale));
  bottom: calc(22px * var(--ui-scale));
  width: calc(58px * var(--ui-scale));
  height: calc(56px * var(--ui-scale));
  z-index: 6;
}
#hud-spellbook svg { width: calc(26px * var(--ui-scale)); height: calc(26px * var(--ui-scale)); }
#hud-spellbook b {
  font-size: calc(8.5px * var(--ui-scale));
  letter-spacing: 1px; color: var(--parch-dim); font-weight: normal;
}
#hud-spellbook.active {
  border-color: var(--gold-bright);
  box-shadow: 0 0 18px rgba(240,208,96,0.5);
}
/* the pack button stands beside the spellbook, so both are one click away */
#hud-inventory {
  position: absolute;
  left: calc(50% + 298px * var(--ui-scale));
  bottom: calc(22px * var(--ui-scale));
  width: calc(58px * var(--ui-scale));
  height: calc(56px * var(--ui-scale));
  z-index: 6;
}
#hud-inventory svg { width: calc(26px * var(--ui-scale)); height: calc(26px * var(--ui-scale)); }
#hud-inventory b {
  font-size: calc(8.5px * var(--ui-scale));
  letter-spacing: 1px; color: var(--parch-dim); font-weight: normal;
}
#hud-inventory.active {
  border-color: var(--gold-bright);
  box-shadow: 0 0 18px rgba(240,208,96,0.5);
}
#fx-vignette {
  background: radial-gradient(ellipse at center, rgba(0,0,0,0) 45%, rgba(0,0,0,0.55) 100%);
  z-index: 3;
}

.overlay-root {
  position: absolute; inset: 0;
  pointer-events: none;
  z-index: 10;
}
.overlay-root.active { pointer-events: auto; }

/* -----------------------------------------------------------------------
   LOADING SCREEN
   ----------------------------------------------------------------------- */
#loading {
  position: absolute; inset: 0;
  display: flex; align-items: center; justify-content: center;
  background: radial-gradient(circle at 50% 40%, #14102a 0%, #06040e 70%);
  z-index: 60;
  transition: opacity 0.7s ease;
}
#loading.hidden { opacity: 0; pointer-events: none; }
.load-inner { text-align: center; }
.load-inner h1 {
  font-size: 62px; margin: 6px 0 0; letter-spacing: 16px;
  color: var(--gold-bright);
  text-shadow: 0 0 22px rgba(200,163,60,0.6), 0 4px 0 #2a1f10;
}
.load-inner h2 {
  font-size: 20px; margin: 2px 0 22px; letter-spacing: 8px;
  color: var(--parch-dim); font-weight: normal;
}
.load-inner small { display: block; margin-top: 16px; color: var(--gold-dim); letter-spacing: 3px; }
.load-bar {
  width: min(520px, 70vw); height: 12px; margin: 0 auto;
  border: 2px solid var(--gold-dim); border-radius: 8px;
  background: rgba(10,8,16,0.8); overflow: hidden;
  box-shadow: inset 0 0 12px rgba(0,0,0,0.8);
}
.load-bar i {
  display: block; height: 100%; width: 0%;
  background: linear-gradient(90deg, #6a4a1a, var(--gold), #fff0b0);
  box-shadow: 0 0 14px rgba(240,208,96,0.8);
  transition: width 0.2s ease;
}
.load-rune {
  width: 74px; height: 74px; margin: 0 auto 10px;
  border: 3px solid var(--violet); border-radius: 50%;
  border-top-color: transparent; border-bottom-color: transparent;
  animation: spin 2.6s linear infinite;
  box-shadow: 0 0 26px rgba(176,123,255,0.6);
}
@keyframes spin { to { transform: rotate(360deg); } }

#rotate-hint { display: none; }

/* -----------------------------------------------------------------------
   GENERIC UI PIECES
   ----------------------------------------------------------------------- */
.btn {
  display: block; width: 100%;
  margin: 6px 0; padding: 11px 18px;
  font-family: inherit; font-size: 17px; letter-spacing: 3px;
  color: var(--parch);
  background: linear-gradient(180deg, rgba(58,48,72,0.95), rgba(24,19,32,0.98));
  border: 2px solid var(--gold-dim);
  border-radius: 8px;
  cursor: pointer; position: relative;
  transition: all 0.16s ease;
  text-shadow: 0 1px 0 #000;
}
.btn:hover {
  color: #fff8e0;
  border-color: var(--gold-bright);
  background: linear-gradient(180deg, rgba(84,68,104,0.98), rgba(38,30,50,1));
  box-shadow: 0 0 18px rgba(200,163,60,0.45), inset 0 0 12px rgba(200,163,60,0.15);
  transform: translateY(-1px);
}
.btn:active { transform: translateY(1px); }
.btn.small { font-size: 13px; padding: 6px 10px; letter-spacing: 1px; width: auto; display: inline-block; margin: 3px; }
.btn.danger { border-color: var(--blood); }
.btn.primary { border-color: var(--gold-bright); }
.btn:disabled { opacity: 0.42; cursor: not-allowed; }

.panel {
  background:
    linear-gradient(180deg, rgba(46,38,58,0.97), rgba(18,14,26,0.98));
  border: 3px solid var(--gold);
  border-radius: 12px;
  box-shadow: 0 0 0 1px rgba(255,230,170,0.18) inset, 0 18px 60px rgba(0,0,0,0.75), 0 0 60px rgba(120,80,200,0.12);
  padding: 16px;
  position: relative;
}
.panel::before {
  content: '';
  position: absolute; inset: 6px;
  border: 1px solid rgba(200,163,60,0.35);
  border-radius: 8px;
  pointer-events: none;
}
.panel h2 {
  margin: 0 0 10px; font-size: 22px; letter-spacing: 5px;
  color: var(--gold-bright); text-align: center; font-weight: normal;
  text-shadow: 0 0 16px rgba(200,163,60,0.5);
}
.panel h3 {
  margin: 12px 0 6px; font-size: 15px; letter-spacing: 2px;
  color: var(--gold); font-weight: normal;
  border-bottom: 1px solid rgba(200,163,60,0.3); padding-bottom: 4px;
}
.panel p, .panel li { font-size: 13.5px; line-height: 1.5; color: var(--parch-dim); }
.panel .close {
  position: absolute; top: 8px; right: 12px;
  cursor: pointer; color: var(--gold); font-size: 22px; line-height: 1;
}
.panel .close:hover { color: #fff; }

.tabs { display: flex; gap: 6px; margin-bottom: 10px; flex-wrap: wrap; }
.tab {
  padding: 6px 12px; font-size: 13px; letter-spacing: 1.5px;
  border: 1.5px solid var(--gold-dim); border-radius: 6px;
  background: rgba(20,16,28,0.8); cursor: pointer; color: var(--parch-dim);
}
.tab.active, .tab:hover { color: #fff6dc; border-color: var(--gold-bright); background: rgba(70,56,90,0.9); }

.row { display: flex; gap: 12px; align-items: flex-start; }
.col { flex: 1; min-width: 0; }
.muted { color: #8f8676; }
.gold-text { color: var(--gold-bright); }
.center { text-align: center; }
.scroll { overflow-y: auto; padding-right: 6px; }
.scroll::-webkit-scrollbar { width: 10px; }
.scroll::-webkit-scrollbar-track { background: rgba(10,8,16,0.6); border-radius: 5px; }
.scroll::-webkit-scrollbar-thumb { background: linear-gradient(180deg, var(--gold-dim), #4a3a18); border-radius: 5px; }

.slot {
  width: 52px; height: 52px; position: relative;
  border: 2px solid var(--gold-dim); border-radius: 7px;
  background: linear-gradient(180deg, rgba(40,34,50,0.9), rgba(16,12,22,0.95));
  cursor: pointer; transition: all 0.12s ease;
}
.slot:hover { border-color: var(--gold-bright); box-shadow: 0 0 12px rgba(200,163,60,0.4); }
.slot.selected { border-color: #fff0b0; box-shadow: 0 0 16px rgba(255,240,176,0.6); }
.slot .stack {
  position: absolute; right: 3px; bottom: 1px; font-size: 11px;
  color: #fff; text-shadow: 0 0 4px #000, 1px 1px 0 #000;
}
.slot .key {
  position: absolute; left: 3px; top: 1px; font-size: 10px; color: var(--gold);
}
.slot canvas { width: 100%; height: 100%; display: block; border-radius: 5px; }
.slot.empty { opacity: 0.55; }
.grid { display: grid; grid-template-columns: repeat(8, 52px); gap: 5px; }
.grid.wide { grid-template-columns: repeat(10, 52px); }

.bar {
  height: 14px; border: 2px solid var(--gold-dim); border-radius: 7px;
  background: rgba(8,6,14,0.9); overflow: hidden; position: relative; margin: 3px 0;
}
.bar i { display: block; height: 100%; width: 0%; transition: width 0.25s ease; }
.bar span {
  position: absolute; inset: 0; text-align: center; font-size: 10.5px;
  line-height: 12px; color: #fff; text-shadow: 1px 1px 0 #000;
}
.bar.hp i { background: linear-gradient(180deg, #e05a5a, #8a1a1a); }
.bar.mp i { background: linear-gradient(180deg, #6fa0ff, #23408a); }
.bar.xp i { background: linear-gradient(180deg, #ffd166, #8a6a1a); }

.stat-line { display: flex; justify-content: space-between; font-size: 13px; padding: 2px 4px; border-bottom: 1px dashed rgba(200,163,60,0.16); }
.stat-line b { color: #dff0ff; font-weight: normal; }

.tooltip {
  position: fixed; z-index: 40; pointer-events: none;
  background: rgba(14,11,22,0.97); border: 2px solid var(--gold);
  border-radius: 8px; padding: 8px 12px; max-width: 320px;
  box-shadow: 0 10px 34px rgba(0,0,0,0.8);
}
.tooltip p { margin: 2px 0; }

/* -----------------------------------------------------------------------
   MENU SCREENS
   ----------------------------------------------------------------------- */
.screen {
  position: absolute; inset: 0;
  display: flex; align-items: center; justify-content: center;
  padding: 20px;
}
.screen.dim { background: radial-gradient(ellipse at 50% 45%, rgba(20,14,40,0.55), rgba(4,3,10,0.9)); }
.menu-wrap { width: min(560px, 92vw); }
.menu-title {
  text-align: center; margin-bottom: 18px;
}
.menu-title h1 {
  font-size: clamp(34px, 6vw, 68px); letter-spacing: 12px; margin: 0;
  color: var(--gold-bright);
  text-shadow: 0 0 30px rgba(200,163,60,0.55), 0 0 60px rgba(176,123,255,0.35), 0 5px 0 #241a0a;
  animation: titleGlow 4.5s ease-in-out infinite;
}
.menu-title h2 {
  font-size: clamp(12px, 2vw, 20px); letter-spacing: 10px; margin: 4px 0 0;
  color: var(--parch-dim); font-weight: normal;
}
.menu-title .studio { font-size: 12px; letter-spacing: 4px; color: var(--gold-dim); margin-top: 10px; }
@keyframes titleGlow {
  0%, 100% { text-shadow: 0 0 30px rgba(200,163,60,0.5), 0 5px 0 #241a0a; }
  50% { text-shadow: 0 0 46px rgba(240,208,96,0.85), 0 0 90px rgba(176,123,255,0.5), 0 5px 0 #241a0a; }
}
.menu-version { text-align: center; font-size: 11px; color: #6a6252; margin-top: 14px; letter-spacing: 2px; }

/* Character creation */
.form-row { display: flex; align-items: center; gap: 10px; margin: 8px 0; }
.form-row label { width: 130px; font-size: 13px; color: var(--gold); letter-spacing: 1px; }
.form-row input[type=text] {
  flex: 1; padding: 8px 10px; font-family: inherit; font-size: 15px;
  background: rgba(10,8,16,0.9); color: var(--parch);
  border: 2px solid var(--gold-dim); border-radius: 6px;
}
.swatches { display: flex; gap: 6px; flex-wrap: wrap; }
.swatch {
  width: 28px; height: 28px; border-radius: 50%; cursor: pointer;
  border: 2px solid rgba(0,0,0,0.6); box-shadow: 0 0 0 1px rgba(200,163,60,0.4);
}
.swatch.selected { box-shadow: 0 0 0 3px var(--gold-bright), 0 0 14px rgba(240,208,96,0.7); }
.school-pick { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 6px; }
.school {
  padding: 8px 12px; border: 2px solid var(--gold-dim); border-radius: 8px;
  cursor: pointer; font-size: 13px; letter-spacing: 1px; background: rgba(18,14,26,0.85);
}
.school:hover, .school.selected { border-color: var(--gold-bright); color: #fff; box-shadow: 0 0 14px rgba(200,163,60,0.4); }
.preview-canvas { display: block; margin: 0 auto; }

/* Credits */
.credits-scroll { max-height: 62vh; overflow-y: auto; }
.credits-scroll h3 { color: var(--gold-bright); letter-spacing: 3px; margin-top: 18px; }
.credits-scroll li { list-style: none; }
.credits-scroll ul { padding-left: 12px; margin: 4px 0; }

/* Keybinds table */
.keys { width: 100%; border-collapse: collapse; font-size: 13px; }
.keys td { padding: 3px 6px; border-bottom: 1px dashed rgba(200,163,60,0.15); }
.keys td:first-child { color: var(--gold-bright); width: 130px; white-space: nowrap; }

/* Options */
.opt-row { display: flex; align-items: center; gap: 10px; margin: 9px 0; font-size: 13px; }
.opt-row > span:first-child { width: 140px; color: var(--gold); }
.opt-row input[type=range] { flex: 1; accent-color: #c8a33c; }
.opt-row select {
  font-family: inherit; background: rgba(10,8,16,0.9); color: var(--parch);
  border: 2px solid var(--gold-dim); border-radius: 5px; padding: 4px 8px;
}
.opt-row .val { width: 46px; text-align: right; color: var(--parch-dim); }
.toggle {
  width: 46px; height: 22px; border-radius: 11px; border: 2px solid var(--gold-dim);
  background: rgba(10,8,16,0.9); position: relative; cursor: pointer;
}
.toggle i { position: absolute; top: 1px; left: 1px; width: 16px; height: 16px; border-radius: 50%; background: #6a6252; transition: all 0.18s ease; }
.toggle.on { border-color: var(--gold-bright); }
.toggle.on i { left: 25px; background: var(--gold-bright); box-shadow: 0 0 10px rgba(240,208,96,0.8); }

/* -----------------------------------------------------------------------
   HUD ADJACENT DOM (toasts, dialogue, banners)
   ----------------------------------------------------------------------- */
#toast-root {
  position: absolute; right: 16px; top: 96px; z-index: 20;
  display: flex; flex-direction: column; gap: 6px; align-items: flex-end;
  pointer-events: none;
}
.toast {
  padding: 7px 14px; font-size: 13px; letter-spacing: 0.5px;
  background: linear-gradient(180deg, rgba(40,32,52,0.94), rgba(14,11,22,0.95));
  border: 2px solid var(--gold-dim); border-left-width: 4px;
  border-radius: 6px; color: var(--parch);
  box-shadow: 0 6px 22px rgba(0,0,0,0.6);
  animation: toastIn 0.3s ease, toastOut 0.6s ease 3.4s forwards;
  max-width: 360px;
}
.toast.loot { border-left-color: #8fd8ff; }
.toast.quest { border-left-color: #ffd166; }
.toast.spell { border-left-color: #b07bff; }
.toast.warn { border-left-color: #ff8a4d; }
.toast.boss { border-left-color: #ff4d6d; color: #ffd8d8; }
.toast.level { border-left-color: #8fffc0; }
.toast.discovery { border-left-color: #cfe4ff; }
.toast.save { border-left-color: #f0d060; }
@keyframes toastIn { from { opacity: 0; transform: translateX(30px); } to { opacity: 1; transform: none; } }
@keyframes toastOut { to { opacity: 0; transform: translateX(30px); } }

.killfeed {
  position: absolute; right: 16px; bottom: 150px; z-index: 20;
  font-size: 12px; color: #e8dcc0; text-align: right; pointer-events: none;
  text-shadow: 0 1px 3px #000;
}
.killfeed div { opacity: 0.9; animation: fadeUp 2.4s ease forwards; }
@keyframes fadeUp { from { opacity: 0.95; } to { opacity: 0; transform: translateY(-10px); } }

.banner {
  position: absolute; left: 50%; top: 22%; transform: translateX(-50%);
  z-index: 22; text-align: center; pointer-events: none;
}
.banner h2 {
  margin: 0; font-size: clamp(22px, 4vw, 44px); letter-spacing: 10px;
  color: var(--gold-bright); font-weight: normal;
  text-shadow: 0 0 30px rgba(200,163,60,0.8), 0 4px 0 #2a1f10;
  animation: bannerIn 2.6s ease forwards;
}
.banner p { color: var(--parch-dim); letter-spacing: 4px; margin: 4px 0 0; }
@keyframes bannerIn {
  0% { opacity: 0; transform: scale(0.85); }
  15% { opacity: 1; transform: scale(1); }
  75% { opacity: 1; }
  100% { opacity: 0; transform: scale(1.06); }
}

/* Dialogue */
#dialogue-root.active { pointer-events: auto; }
.dlg-panel {
  position: absolute; left: 50%; bottom: 26px; transform: translateX(-50%);
  width: min(1000px, 94vw);
  display: flex; gap: 14px;
  background: linear-gradient(180deg, rgba(40,32,52,0.97), rgba(14,11,22,0.98));
  border: 3px solid var(--gold); border-radius: 12px;
  box-shadow: 0 0 0 1px rgba(255,230,170,0.2) inset, 0 20px 60px rgba(0,0,0,0.8);
  padding: 14px;
  animation: toastIn 0.25s ease;
}
.dlg-portrait { width: 136px; flex: none; text-align: center; }
.dlg-portrait canvas {
  width: 128px; height: 128px; border-radius: 10px;
  border: 2px solid var(--gold-dim);
  background: radial-gradient(circle at 50% 38%, #3a3156, #0c0a16 78%);
  box-shadow: inset 0 0 22px rgba(0,0,0,0.75), 0 0 14px rgba(200,163,60,0.18);
}
.dlg-who b { display: block; color: var(--gold-bright); font-size: 14px; letter-spacing: 1px; margin-top: 6px; }
.dlg-who span { display: block; font-size: 11px; color: #9a9080; letter-spacing: 1px; }
.dlg-body { flex: 1; min-width: 0; }
.dlg-text { margin: 0 0 10px; font-size: 15px; line-height: 1.6; color: #efe6cf; min-height: 46px; padding-right: 26px; }
/* every conversation can be ended from the panel itself, whatever it is
   saying - the button that guarantees it is never a dead end */
.dlg-close {
  position: absolute; top: 6px; right: 8px;
  width: 26px; height: 26px; padding: 0; line-height: 1;
  font-family: inherit; font-size: 14px; cursor: pointer;
  background: rgba(24,19,32,0.9); color: var(--parch);
  border: 1.5px solid var(--gold-dim); border-radius: 6px;
}
.dlg-close:hover { background: rgba(70,56,90,0.95); border-color: var(--gold-bright); color: #fff; }
.dlg-choices { display: flex; flex-direction: column; gap: 5px; }
.dlg-choice {
  text-align: left; font-family: inherit; font-size: 13.5px;
  padding: 7px 10px; border-radius: 6px; cursor: pointer;
  background: rgba(24,19,32,0.9); color: var(--parch);
  border: 1.5px solid var(--gold-dim);
}
.dlg-choice:hover { background: rgba(70,56,90,0.95); border-color: var(--gold-bright); color: #fff; }
.dlg-choice .num {
  display: inline-block; width: 18px; color: var(--gold);
}
.dlg-choice.kind-quest { border-color: #ffd166; }
.dlg-choice.kind-turnin { border-color: #8fffc0; }
.dlg-choice.kind-shop { border-color: #8fd8ff; }
.dlg-choice.kind-accept { border-color: #ffd166; }

/* Shop / lists */
.item-row {
  display: flex; gap: 10px; align-items: center;
  padding: 6px; border-bottom: 1px solid rgba(200,163,60,0.14);
  cursor: pointer;
}
.item-row:hover { background: rgba(70,56,90,0.4); }
.item-row canvas { width: 40px; height: 40px; flex: none; }
.item-row .info { flex: 1; min-width: 0; }
.item-row .info b { display: block; font-size: 13.5px; font-weight: normal; }
.item-row .info span { font-size: 11.5px; color: #9a9080; }
.item-row .price { color: var(--gold-bright); font-size: 13px; white-space: nowrap; }

/* Generic big panel layout */
.fullpanel {
  position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%);
  width: min(1180px, 96vw); max-height: 92vh;
  display: flex; flex-direction: column;
}
.fullpanel .body { flex: 1; overflow-y: auto; min-height: 0; }
.panel-foot { display: flex; justify-content: space-between; align-items: center; margin-top: 10px; gap: 10px; flex-wrap: wrap; }

/* world map panel */
#map-canvas { display: block; width: 100%; height: auto; border-radius: 8px; background: #0a0812; }

/* Death screen */
#death-screen h2 { color: #ff8a8a; text-shadow: 0 0 30px rgba(255,60,60,0.6); }

/* spell list */
.spell-row { display: flex; gap: 10px; align-items: flex-start; padding: 7px; border-bottom: 1px solid rgba(200,163,60,0.14); cursor: pointer; }
.spell-row:hover { background: rgba(70,56,90,0.35); }
.spell-row canvas { width: 38px; height: 38px; flex: none; }
.spell-row .info { flex: 1; }
.spell-row b { font-weight: normal; font-size: 14px; }
.spell-row.known b { color: #fff3d0; }
.spell-row.unknown { opacity: 0.5; }
.spell-cost { color: #8fd8ff; font-size: 12px; }
.school-block { margin-bottom: 12px; }
.school-head { display: flex; align-items: center; gap: 10px; }
.school-head h3 { flex: 1; margin: 0; }
.pips { display: flex; gap: 2px; }
.pip { width: 8px; height: 14px; border: 1px solid var(--gold-dim); border-radius: 2px; background: rgba(10,8,16,0.8); }
.pip.on { background: linear-gradient(180deg, var(--gold-bright), #8a6a1a); box-shadow: 0 0 8px rgba(240,208,96,0.7); }

.quest-card {
  border: 2px solid var(--gold-dim); border-radius: 8px; padding: 10px; margin-bottom: 8px;
  background: rgba(20,16,28,0.7);
}
.quest-card.main { border-color: var(--gold-bright); box-shadow: 0 0 18px rgba(200,163,60,0.22); }
.quest-card h4 { margin: 0 0 4px; font-size: 15px; color: var(--gold-bright); font-weight: normal; letter-spacing: 1px; }
.quest-card .obj { font-size: 12.5px; color: var(--parch-dim); margin: 3px 0; display: flex; justify-content: space-between; gap: 8px; }
.quest-card .obj.done { color: #8fffc0; text-decoration: line-through; }
.quest-card .obj .prog { color: #cfe4ff; }
.quest-card .reward { font-size: 12px; color: var(--gold); margin-top: 6px; }

@media (max-width: 760px) {
  .grid { grid-template-columns: repeat(6, 46px); }
  .slot { width: 46px; height: 46px; }
  .dlg-panel { flex-direction: column; }
  #toast-root { top: 70px; right: 8px; }
  /* side by side they would run off a narrow window: the pack stacks above */
  #hud-inventory { left: calc(50% + 232px * var(--ui-scale)); bottom: calc(88px * var(--ui-scale)); }
}
