/* Realms of Alderyn - HUD, screens and shell styling. All colour work is original. */
:root {
  --ink: #e8e4d8;
  --ink-dim: #a8a294;
  --panel: #101418e6;
  --panel-soft: #161c21c7;
  --edge: #d6be8447;
  --edge-strong: #d6be848c;
  --gold: #e2bc6c;
  --blue: #4f9dff;
  --red: #e0574b;
  --green: #6dcb70;
  --shadow: 0 10px 30px #00000073;
  --ui-font: "Segoe UI", "Trebuchet MS", system-ui, -apple-system, sans-serif;
}
* {
  box-sizing: border-box;
}
html, body {
  height: 100%;
  color: var(--ink);
  font-family: var(--ui-font);
  -webkit-font-smoothing:antialiased;
  background: #0a0d10;
  margin: 0;
  padding: 0;
  overflow: hidden;
}
#app {
  position: fixed;
  inset: 0;
}
#game-root {
  position: absolute;
  inset: 0;
}
#game-root canvas {
  display: block;
}
#ui-root {
  pointer-events: none;
  z-index: 10;
  position: absolute;
  inset: 0;
}
#ui-root>* {
  pointer-events: none;
}
#screen-root {
  z-index: 40;
  background: radial-gradient(1200px 700px at 50% -10%, #48688047, #0000 60%), linear-gradient(#0b0f13 0%, #0a0d10 100%);
  justify-content: center;
  align-items: center;
  padding: 24px;
  display: none;
  position: absolute;
  inset: 0;
}
#screen-root:empty {
  display: none;
}
.hud {
  -webkit-user-select:none;
  user-select: none;
  flex-direction: column;
  justify-content: space-between;
  font-size: 13px;
  display: flex;
  position: absolute;
  inset: 0;
}
.hud-top {
  pointer-events: none;
  background: linear-gradient(#090c0feb, #090c0f8c 70%, #0000);
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  display: flex;
}
.hud-top>* {
  pointer-events: auto;
}
.hud-res {
  gap: 6px;
  display: flex;
}
.res-chip, .pop-chip, .age-chip, .clock-chip, .player-chip {
  background: var(--panel);
  border: 1px solid var(--edge);
  box-shadow: var(--shadow);
  font-variant-numeric: tabular-nums;
  border-radius: 6px;
  align-items: center;
  gap: 6px;
  padding: 5px 10px;
  display: inline-flex;
}
.res-chip i {
  opacity: .9;
  font-style: normal;
}
.res-chip b {
  color: var(--gold);
  font-weight: 600;
}
.pop-chip b {
  color: var(--ink);
}
.pop-chip.warn {
  border-color: #e0574bbf;
}
.pop-chip.warn b {
  color: #ff8e80;
}
.age-chip b {
  color: #cfe3ff;
  letter-spacing: .04em;
  text-transform: uppercase;
  font-size: 11px;
}
.clock-chip {
  color: var(--ink-dim);
  font-variant-numeric: tabular-nums;
}
.hud-spacer {
  flex: auto;
}
.player-chip {
  letter-spacing: .02em;
  font-weight: 600;
}
.hud-btn {
  appearance: none;
  border: 1px solid var(--edge);
  background: var(--panel);
  color: var(--ink);
  font: inherit;
  cursor: pointer;
  box-shadow: var(--shadow);
  border-radius: 6px;
  padding: 5px 10px;
}
.hud-btn:hover {
  border-color: var(--edge-strong);
  background: #222a32f2;
}
.hud-btn b {
  color: var(--gold);
  font-weight: 600;
}
.hud-alerts {
  pointer-events: none;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  display: flex;
  position: absolute;
  top: 62px;
  left: 50%;
  transform: translate(-50%);
}
.alert {
  color: #f0ead9;
  box-shadow: var(--shadow);
  background: #0c1014db;
  border: 1px solid #d6be8459;
  border-radius: 999px;
  padding: 5px 12px;
  font-size: 12.5px;
  animation: .16s ease-out alert-in;
}
@keyframes alert-in {
  0% {
    opacity: 0;
    transform: translateY(-6px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}
.placement-banner {
  color: #d9f0d8;
  max-width: 320px;
  box-shadow: var(--shadow);
  background: #1c241eeb;
  border: 1px solid #78c88280;
  border-radius: 8px;
  padding: 8px 12px;
  font-size: 12.5px;
  position: absolute;
  top: 62px;
  right: 16px;
}
.placement-banner b {
  color: #b9f0b4;
}
.hud-bottom {
  pointer-events: none;
  background: linear-gradient(#0000, #080b0e99 30%, #080b0ef2);
  align-items: stretch;
  gap: 10px;
  padding: 10px 12px 12px;
  display: flex;
}
.hud-bottom>* {
  pointer-events: auto;
}
.minimap-wrap {
  background: var(--panel);
  border: 1px solid var(--edge);
  box-shadow: var(--shadow);
  border-radius: 8px;
  padding: 6px;
  position: relative;
}
.minimap {
  cursor: crosshair;
  width: 200px;
  height: 200px;
  image-rendering: pixelated;
  border-radius: 4px;
  display: block;
}
.minimap-note {
  letter-spacing: .06em;
  text-transform: uppercase;
  color: #e8e4d88c;
  pointer-events: none;
  font-size: 10px;
  position: absolute;
  bottom: 8px;
  left: 50%;
  transform: translate(-50%);
}
.hud-panels {
  flex: auto;
  grid-template-columns: minmax(220px, 1fr) minmax(320px, 2.1fr);
  align-items: stretch;
  gap: 10px;
  min-width: 0;
  max-height: 214px;
  display: grid;
}
.hud-info, .hud-commands {
  background: var(--panel);
  border: 1px solid var(--edge);
  box-shadow: var(--shadow);
  border-radius: 8px;
  min-height: 96px;
  padding: 10px 12px;
  overflow: auto;
}
.hud-info {
  font-size: 12.5px;
}
.info-title {
  letter-spacing: .01em;
  margin-bottom: 6px;
  font-size: 14px;
  font-weight: 600;
}
.info-sub {
  color: var(--ink-dim);
  margin-top: 4px;
  line-height: 1.45;
}
.info-role {
  font-style: italic;
}
.info-perks {
  flex-wrap: wrap;
  gap: 4px;
  margin-top: 7px;
  display: flex;
}
.perk {
  border: 1px solid var(--edge);
  color: var(--ink);
  letter-spacing: .02em;
  white-space: nowrap;
  background: #fff0d212;
  border-radius: 999px;
  align-items: center;
  padding: 1px 7px;
  font-size: 11px;
  line-height: 16px;
  display: inline-flex;
}
.info-hp {
  background: #ffffff1f;
  border-radius: 4px;
  height: 7px;
  margin: 4px 0 2px;
  overflow: hidden;
}
.info-hp span {
  background: linear-gradient(90deg, #4fbf63, #8fe08a);
  height: 100%;
  display: block;
}
.mini-btn {
  appearance: none;
  border: 1px solid var(--edge);
  color: var(--ink);
  font: inherit;
  cursor: pointer;
  background: 0 0;
  border-radius: 4px;
  padding: 0 6px;
  font-size: 11px;
}
.hud-commands {
  flex-wrap: wrap;
  align-items: flex-start;
  gap: 10px;
  padding: 8px 10px;
  display: flex;
}
.cmd-hint {
  color: var(--ink-dim);
  padding: 8px 2px;
  font-size: 12px;
}
.cmd-group {
  flex-wrap: wrap;
  align-items: center;
  gap: 4px;
  display: flex;
}
.cmd-label {
  letter-spacing: .14em;
  text-transform: uppercase;
  color: #e8e4d880;
  flex: 0 0 100%;
  font-size: 10px;
}
.cmd-btn {
  appearance: none;
  border: 1px solid var(--edge);
  min-width: 118px;
  color: var(--ink);
  font: inherit;
  cursor: pointer;
  text-align: left;
  background: linear-gradient(#2c363ee6, #1a2127f2);
  border-radius: 6px;
  align-items: center;
  gap: 6px;
  padding: 5px 7px;
  font-size: 12px;
  display: flex;
}
.cmd-btn:hover:not(:disabled) {
  border-color: var(--edge-strong);
  background: linear-gradient(#3a4650f2, #20282ffa);
}
.cmd-btn:disabled {
  opacity: .45;
  cursor: not-allowed;
}
.cmd-btn.done {
  opacity: .6;
}
.cmd-icon {
  object-fit: cover;
  width: 26px;
  height: 26px;
  image-rendering: pixelated;
  background: #00000059;
  border-radius: 4px;
  flex: 0 0 26px;
}
.cmd-text {
  flex-direction: column;
  min-width: 0;
  line-height: 1.15;
  display: flex;
}
.cmd-text b {
  white-space: nowrap;
  text-overflow: ellipsis;
  font-size: 12px;
  font-weight: 600;
  overflow: hidden;
}
.cmd-text i {
  color: var(--ink-dim);
  white-space: nowrap;
  text-overflow: ellipsis;
  font-size: 10.5px;
  font-style: normal;
  overflow: hidden;
}
.screen {
  width: min(1040px, 100%);
  max-height: 100%;
  overflow: auto;
}
.menu-screen {
  text-align: center;
  flex-direction: column;
  align-items: center;
  gap: 26px;
  display: flex;
}
.menu-hero h1 {
  letter-spacing: .06em;
  text-transform: uppercase;
  color: #f2ecdc;
  text-shadow: 0 8px 30px #000c;
  margin: 0;
  font-size: clamp(38px, 7vw, 74px);
  font-weight: 700;
}
.menu-hero h1 span {
  color: var(--gold);
  letter-spacing: .32em;
  font-size: .62em;
  display: block;
}
.menu-tag {
  max-width: 620px;
  color: var(--ink-dim);
  margin: 12px auto 0;
  font-size: 14.5px;
  line-height: 1.6;
}
.menu-actions {
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
  display: flex;
}
.menu-foot {
  color: #e8e4d873;
  justify-content: center;
  align-items: center;
  gap: 18px;
  font-size: 11.5px;
  display: flex;
}
.menu-foot .ver {
  letter-spacing: .12em;
  text-transform: uppercase;
}
.btn {
  appearance: none;
  border: 1px solid var(--edge-strong);
  min-width: 132px;
  color: var(--ink);
  font: inherit;
  cursor: pointer;
  box-shadow: var(--shadow);
  background: linear-gradient(#2e3840eb, #181f25f5);
  border-radius: 8px;
  padding: 10px 18px;
  font-size: 14px;
}
.btn:hover {
  border-color: var(--gold);
  transform: translateY(-1px);
}
.btn-primary {
  color: #14100a;
  background: linear-gradient(#caa257, #8c6a2c);
  border-color: #ffe6b48c;
  font-weight: 700;
}
.btn-primary:hover {
  filter: brightness(1.08);
}
.btn.danger {
  color: #ffb4a9;
  border-color: #e0574b99;
}
.btn.tiny {
  min-width: 0;
  padding: 6px 10px;
  font-size: 13px;
}
.setup-screen, .pane-screen, .overlay-card {
  background: var(--panel);
  border: 1px solid var(--edge);
  border-radius: 14px;
  padding: 20px 22px;
  box-shadow: 0 24px 60px #0000008c;
}
.setup-screen {
  width: min(920px, 100%);
}
.lobby-screen {
  width: min(1000px, 100%);
}
.setup-screen h2, .pane-screen h2, .overlay-card h2 {
  letter-spacing: .1em;
  text-transform: uppercase;
  color: #f0e6cf;
  margin: 0 0 14px;
  font-size: 22px;
}
.setup-grid {
  grid-template-columns: 1fr 1fr;
  gap: 18px;
  display: grid;
}
.setup-left, .setup-right {
  flex-direction: column;
  gap: 10px;
  display: flex;
}
.setup-screen label, .pane-screen label {
  color: var(--ink-dim);
  flex-direction: column;
  gap: 4px;
  font-size: 12px;
  display: flex;
}
.setup-screen input, .setup-screen select, .pane-screen input[type=range] {
  font: inherit;
  color: var(--ink);
  border: 1px solid var(--edge);
  background: #080c0fdb;
  border-radius: 6px;
  padding: 8px 10px;
  font-size: 13.5px;
}
.setup-screen select {
  cursor: pointer;
}
.seed-row {
  gap: 6px;
  display: flex;
}
.seed-row input {
  flex: auto;
  min-width: 0;
}
.hint {
  color: #e8e4d880;
  font-size: 11.5px;
  line-height: 1.5;
}
.setup-preview {
  grid-template-columns: 256px 1fr;
  align-items: end;
  gap: 14px;
  margin-top: 16px;
  display: grid;
}
.setup-preview canvas {
  border: 1px solid var(--edge);
  width: 256px;
  height: 256px;
  image-rendering: pixelated;
  background: #0f1316;
  border-radius: 10px;
}
.preview-note {
  color: var(--ink-dim);
  max-width: 460px;
  padding-bottom: 10px;
  font-size: 12.5px;
  line-height: 1.6;
}
.preview-note b {
  color: var(--gold);
}
.setup-actions, .pane-actions {
  justify-content: flex-end;
  gap: 10px;
  margin-top: 18px;
  display: flex;
}
.pane-screen {
  width: min(760px, 100%);
}
.pane-body {
  flex-direction: column;
  gap: 12px;
  font-size: 13.5px;
  line-height: 1.6;
  display: flex;
}
.pane-body h3 {
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--gold);
  margin: 6px 0 2px;
  font-size: 13px;
}
.pane-body p {
  color: var(--ink-dim);
  margin: 0;
}
.row {
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  flex-direction: row!important;
}
.row span {
  color: var(--ink);
  font-size: 13.5px;
}
.row input[type=range] {
  flex: 0 0 220px;
}
.help-cols {
  grid-template-columns: 1fr 1fr;
  gap: 18px;
  display: grid;
}
kbd {
  border: 1px solid var(--edge);
  color: #f0e6cf;
  background: #0006;
  border-radius: 4px;
  padding: 1px 5px;
  font-family: ui-monospace, Consolas, monospace;
  font-size: 11.5px;
}
.overlay-screen {
  justify-content: center;
  display: flex;
}
.overlay-card {
  text-align: center;
  width: min(560px, 100%);
}
.overlay-card.wide {
  text-align: left;
  width: min(760px, 100%);
}
.overlay-card.wide h2 {
  text-align: center;
}
.end-screen.won .overlay-card h2 {
  color: #a9e79b;
}
.end-screen.lost .overlay-card h2 {
  color: #ff9d90;
}
.score-table {
  border-collapse: collapse;
  width: 100%;
  margin: 14px 0 4px;
  font-size: 13px;
}
.score-table th, .score-table td {
  text-align: left;
  border-bottom: 1px solid #d6be8429;
  padding: 7px 8px;
}
.score-table th {
  letter-spacing: .12em;
  text-transform: uppercase;
  color: #e8e4d88c;
  font-size: 10.5px;
}
.score-table td.num, .score-table th.num {
  text-align: right;
  font-variant-numeric: tabular-nums;
}
.score-table tr.you td {
  background: #4f9dff1f;
}
.dot {
  vertical-align: middle;
  border-radius: 50%;
  width: 9px;
  height: 9px;
  margin-right: 8px;
  display: inline-block;
}
.toast {
  border: 1px solid var(--edge-strong);
  color: var(--ink);
  box-shadow: var(--shadow);
  background: #101418f2;
  border-radius: 999px;
  padding: 9px 16px;
  font-size: 13px;
  animation: .18s ease-out alert-in;
  position: fixed;
  bottom: 26px;
  left: 50%;
  transform: translate(-50%);
}
.online-lead {
  color: var(--ink-dim);
  max-width: 68ch;
  margin: 0 0 16px;
  font-size: 13px;
  line-height: 1.6;
}
.online-grid {
  grid-template-columns: 1fr 1fr;
  gap: 18px;
  display: grid;
}
.online-card {
  background: #0a0e128c;
  border: 1px solid #d6be842e;
  border-radius: 10px;
  flex-direction: column;
  gap: 10px;
  padding: 14px 16px;
  display: flex;
}
.online-card h3 {
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--gold);
  margin: 0 0 2px;
  font-size: 11.5px;
}
.online-or {
  color: #e8e4d866;
  text-align: center;
  letter-spacing: .08em;
  font-size: 11px;
}
.btn.wide {
  justify-content: center;
  width: 100%;
}
.invite-row {
  gap: 6px;
  display: flex;
}
.invite-row input {
  letter-spacing: 0;
  width: 100%;
  min-width: 0;
  color: var(--ink);
  border: 1px solid var(--edge);
  text-overflow: ellipsis;
  background: #080c0fdb;
  border-radius: 6px;
  flex: auto;
  padding: 8px 10px;
  font-family: ui-monospace, Cascadia Mono, Consolas, monospace;
  font-size: 11.5px;
}
.invite-actions {
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  margin-top: 8px;
  display: flex;
}
.invite-actions .btn {
  white-space: nowrap;
  flex: none;
}
.invite-hint {
  color: #e8e4d880;
  font-size: 11.5px;
  line-height: 1.5;
}
.seat-list {
  flex-direction: column;
  gap: 6px;
  margin: 0;
  padding: 0;
  list-style: none;
  display: flex;
}
.seat-list li {
  color: var(--ink);
  background: #ffffff05;
  border: 1px solid #d6be8424;
  border-radius: 8px;
  align-items: center;
  gap: 8px;
  padding: 7px 10px;
  font-size: 13px;
  display: flex;
}
.seat-list li.you {
  background: #4f9dff1a;
  border-color: #4f9dff8c;
}
.seat-list b {
  font-weight: 600;
}
.seat-tag {
  letter-spacing: .1em;
  text-transform: uppercase;
  color: #e8e4d873;
  margin-left: auto;
  font-size: 10.5px;
}
.lobby-screen .setup-grid {
  grid-template-columns: 1.15fr 1fr;
}
@media (max-width:900px) {
  .hud-panels {
    grid-template-columns: 1fr;
  }
  .hud-info {
    display: none;
  }
  .minimap {
    width: 132px;
    height: 132px;
  }
  .setup-grid, .help-cols, .setup-preview, .online-grid, .lobby-screen .setup-grid {
    grid-template-columns: 1fr;
  }
  .setup-preview canvas {
    width: 100%;
    max-width: 256px;
  }
  .res-chip {
    padding: 4px 7px;
  }
}

/* ---------------------------------------------------------------- quest tracker */
.hud-quest {
  position: absolute;
  top: 62px;
  left: 12px;
  max-width: 300px;
  padding: 9px 12px;
  border-radius: 8px;
  background: var(--panel);
  border: 1px solid var(--edge);
  box-shadow: var(--shadow);
  font-size: 12px;
  pointer-events: none;
}
.quest-title { font-size: 11px; letter-spacing: 0.09em; text-transform: uppercase; color: var(--gold); margin-bottom: 7px; }
.quest-row { display: grid; grid-template-columns: 16px 1fr; gap: 4px; align-items: start; padding: 2px 0; }
.quest-tick { color: var(--ink-dim); }
.quest-row.done .quest-tick { color: var(--green); }
.quest-row.done .quest-label { color: var(--ink-dim); text-decoration: line-through; }
.quest-label { line-height: 1.4; }
.quest-count { color: var(--gold); font-variant-numeric: tabular-nums; }
.quest-bar { grid-column: 2; height: 3px; border-radius: 999px; background: rgba(232, 228, 216, 0.12); overflow: hidden; }
.quest-bar i { display: block; height: 100%; background: var(--gold); border-radius: 999px; }
@media (max-width: 720px) {
  .hud-quest { top: 58px; left: 8px; max-width: 240px; font-size: 11px; }
}

/* ---------------------------------------------------------------- campaign world map */
.world-screen { width: min(1100px, 100%); }

.world-head {
  display: grid;
  grid-template-columns: 1fr minmax(180px, 280px) auto auto auto auto;
  gap: 16px;
  align-items: center;
  padding: 14px 18px;
  border: 1px solid var(--edge);
  border-radius: 10px;
  background: var(--panel);
  box-shadow: var(--shadow);
}
.world-id { display: flex; flex-direction: column; }
.world-id b { font-size: 18px; letter-spacing: 0.02em; }
.world-id span { color: var(--ink-dim); font-size: 11px; letter-spacing: 0.12em; text-transform: uppercase; }
.world-level { display: flex; flex-direction: column; gap: 4px; }
.world-level-num { font-size: 12px; color: var(--gold); letter-spacing: 0.06em; text-transform: uppercase; }
.xp-bar { height: 5px; border-radius: 999px; overflow: hidden; background: rgba(232, 228, 216, 0.14); }
.xp-bar i { display: block; height: 100%; border-radius: 999px; background: linear-gradient(90deg, var(--gold), #f6d99a); }
.world-xp { font-size: 11px; color: var(--ink-dim); font-variant-numeric: tabular-nums; }
.world-gold { color: var(--gold); font-weight: 600; font-variant-numeric: tabular-nums; }

.world-body {
  display: grid;
  grid-template-columns: minmax(260px, 0.9fr) minmax(0, 1.4fr);
  gap: 14px;
  margin-top: 14px;
  align-items: start;
}
.world-list { display: flex; flex-direction: column; gap: 14px; max-height: 58vh; overflow: auto; padding-right: 4px; }
.region h3 { margin: 0 0 2px; font-size: 11px; letter-spacing: 0.12em; text-transform: uppercase; color: var(--gold); }
.region-line { margin: 0 0 4px; color: var(--ink-dim); font-size: 11.5px; line-height: 1.45; }
.region-ladder { margin: 0 0 8px; color: #9c8f74; font-size: 11px; letter-spacing: 0.02em; font-variant-numeric: tabular-nums; }
.region.complete h3 { color: #bfe6b0; }
.region.complete .region-ladder { color: #8fbf84; }

.quest-card {
  display: flex;
  flex-direction: column;
  gap: 4px;
  width: 100%;
  margin-bottom: 7px;
  padding: 9px 12px;
  border: 1px solid var(--edge);
  border-radius: 8px;
  background: var(--panel-soft);
  color: var(--ink);
  font: inherit;
  text-align: left;
  cursor: pointer;
}
.quest-card:hover { border-color: var(--edge-strong); }
.quest-card.active { border-color: var(--gold); background: rgba(226, 188, 108, 0.1); }
.quest-card.locked { opacity: 0.55; }
.qc-title { font-weight: 600; font-size: 13.5px; }
.quest-card.cleared .qc-title { color: #cfe8c7; }
.qc-meta { display: flex; justify-content: space-between; gap: 8px; color: var(--ink-dim); font-size: 11px; }

.quest-detail {
  padding: 18px 20px;
  border: 1px solid var(--edge);
  border-radius: 10px;
  background: var(--panel);
  box-shadow: var(--shadow);
}
.quest-detail h2 { margin: 0 0 4px; font-size: 22px; }
.quest-region { margin: 0 0 10px; color: var(--gold); font-size: 11px; letter-spacing: 0.1em; text-transform: uppercase; }
.world-blurb { margin: 0 0 12px; color: var(--ink-dim); font-size: 13.5px; line-height: 1.55; }
.quest-brief { margin: 0 0 16px; padding-left: 18px; color: var(--ink-dim); font-size: 13px; line-height: 1.55; }
.quest-detail h3 { margin: 14px 0 6px; font-size: 11px; letter-spacing: 0.12em; text-transform: uppercase; color: var(--gold); }
.quest-detail .menu-actions { margin-top: 16px; }

.obj-list { list-style: none; margin: 0 0 12px; padding: 0; font-size: 13px; }
.obj-list li { display: flex; gap: 8px; align-items: baseline; padding: 3px 0; }
.obj-tick { width: 14px; color: var(--ink-dim); }
.obj-list li.done { color: var(--ink-dim); }
.obj-list li.done .obj-tick { color: var(--green); }

.reward-row { display: flex; flex-wrap: wrap; gap: 8px; margin: 10px 0; }
.reward {
  padding: 2px 9px;
  border: 1px solid var(--edge);
  border-radius: 999px;
  background: rgba(226, 188, 108, 0.09);
  color: var(--gold);
  font-size: 12px;
}
.reward.soft { color: var(--ink-dim); background: transparent; }
.locked-note { color: #ffb4a8; }
.world-foot { margin-top: 12px; color: var(--ink-dim); font-size: 11.5px; text-align: center; }

.end-quest {
  margin: 14px 0 4px;
  padding: 12px 14px;
  border: 1px solid var(--edge);
  border-radius: 8px;
  background: rgba(226, 188, 108, 0.05);
}
.end-quest h3 { margin: 0 0 8px; font-size: 15px; color: var(--gold); }
.end-quest .obj-list { margin-bottom: 6px; }
.level-up { margin: 4px 0 0; color: var(--gold); font-weight: 600; }
.menu-profile { color: var(--gold); }

@media (max-width: 860px) {
  .world-body { grid-template-columns: 1fr; }
  .world-head { grid-template-columns: 1fr auto; }
  .world-level, .world-gold { grid-column: 1 / -1; }
}

/* ---------------------------------------------------------------- capital city */
.capital-screen { width: min(1100px, 100%); }
.capital-body { margin-top: 14px; }
.capital-perks {
  margin: 0 0 14px;
  padding: 10px 14px;
  border: 1px solid var(--edge);
  border-left: 3px solid var(--gold);
  border-radius: 8px;
  background: rgba(226, 188, 108, 0.06);
  color: var(--ink);
  font-size: 13px;
  line-height: 1.5;
}
.cap-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 12px;
  max-height: 58vh;
  overflow: auto;
  padding-right: 4px;
}
.cap-card {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 14px 16px;
  border: 1px solid var(--edge);
  border-radius: 10px;
  background: var(--panel-soft);
}
.cap-card header { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; }
.cap-card h3 { margin: 0; font-size: 15px; }
.cap-cost { color: var(--gold); font-size: 11.5px; font-variant-numeric: tabular-nums; white-space: nowrap; }
.cap-card p { margin: 0; color: var(--ink-dim); font-size: 12.5px; line-height: 1.5; }
.cap-card .cap-actions { margin-top: auto; }
.cap-card.owned { border-color: rgba(126, 196, 132, 0.5); background: rgba(126, 196, 132, 0.06); }
.cap-card.owned h3 { color: #cfe8c7; }
.cap-card.locked { opacity: 0.6; }
.cap-card.poor .cap-cost { color: #ffb4a8; }
.cap-card.tier-2 { border-left: 3px solid rgba(226, 188, 108, 0.55); }
.cap-supply {
  margin-top: 12px;
  padding: 12px 16px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  border: 1px dashed rgba(226, 188, 108, 0.45);
  border-radius: 10px;
  background: rgba(226, 188, 108, 0.05);
}
.cap-supply header { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; }
.cap-supply h3 { margin: 0; font-size: 15px; }
.cap-supply p { margin: 0; color: var(--ink-dim); font-size: 12.5px; line-height: 1.5; }
@media (max-width: 860px) {
  .cap-grid { grid-template-columns: 1fr; max-height: none; }
}

/* ---------------------------------------------------------------- tech tree */
.tech-body { margin-top: 14px; }
.tech-branches {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  align-items: start;
}
.tech-branch { display: flex; flex-direction: column; gap: 10px; }
.tech-branch-head h2 {
  margin: 0;
  font-size: 12px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--gold);
}
.tech-branch-head p { margin: 2px 0 0; color: var(--ink-dim); font-size: 11.5px; line-height: 1.45; }
.tech-branch .cap-card { gap: 6px; padding: 12px 14px; }
.tech-branch .cap-card h3 { font-size: 14px; }
.tech-signature { margin-top: 16px; padding-top: 12px; border-top: 1px dashed var(--edge); }
.tech-signature h2 {
  margin: 0 0 8px;
  font-size: 11px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--gold);
}
.tech-signature .cap-card { max-width: 380px; }
@media (max-width: 980px) {
  .tech-branches { grid-template-columns: 1fr; }
  .tech-signature .cap-card { max-width: none; }
}

/* Civ chapters on the world map: visible to every realm, fightable by one. */
.quest-card.civ .qc-title::after {
  content: ' ⚔';
  color: var(--gold, #e2bc6c);
}
.quest-card.foreign {
  opacity: 0.75;
}
.quest-card.foreign .qc-meta span:last-child {
  color: #b9a98a;
  font-style: italic;
}
.quest-civ {
  margin: 2px 0 8px;
  font-size: 12px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: #e2bc6c;
}
.commander-sworn {
  margin: 10px 0 0;
  padding-left: 10px;
  border-left: 2px solid rgba(226, 188, 108, 0.6);
  color: #f2dfae;
  font-size: 13px;
}

/* Campaign acts and the grade ladder: par time on the card, letter on the end screen. */
.qc-grade {
  display: inline-block;
  min-width: 13px;
  margin-right: 5px;
  padding: 0 4px;
  border-radius: 4px;
  border: 1px solid var(--edge-strong);
  font-size: 10.5px;
  font-weight: 700;
  line-height: 14px;
  text-align: center;
  color: var(--gold);
  background: rgba(226, 188, 108, 0.12);
}
.grade-par { color: #b9a98a; font-style: italic; }
.grade-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 8px 0 2px;
}
.grade-badge {
  flex: none;
  width: 30px;
  height: 30px;
  border-radius: 8px;
  border: 1px solid var(--edge-strong);
  background: rgba(226, 188, 108, 0.1);
  color: var(--gold);
  font-size: 17px;
  font-weight: 700;
  line-height: 28px;
  text-align: center;
}
.grade-badge.g-S { color: #ffe9a6; border-color: rgba(255, 233, 166, 0.75); background: rgba(255, 233, 166, 0.14); }
.grade-badge.g-A { color: #cfe8c7; border-color: rgba(160, 214, 150, 0.6); }
.grade-badge.g-B { color: #c8dbe6; border-color: rgba(150, 190, 214, 0.5); }
.grade-badge.g-C { color: #c9c2b4; }
.grade-badge.g-D { color: #cf9a8d; border-color: rgba(207, 154, 141, 0.5); }
.grade-note { color: var(--ink-dim); font-size: 12.5px; line-height: 1.45; }

