:root {
  --night: #091225;
  --night-deep: #050a12;
  --glass: rgba(11, 18, 29, 0.9);
  --glass-light: rgba(20, 31, 47, 0.9);
  --moonstone: #d7d5c8;
  --moonstone-bright: #f4f1e8;
  --muted: #9eacbb;
  --brass: #9b7838;
  --gold: #f2c35b;
  --gold-soft: #c9a35a;
  --teal: #63e5d7;
  --teal-bright: #a8fff5;
  --indigo: #6557d9;
  --health: #b93258;
  --health-dark: #631d36;
  --mana: #318ac4;
  --mana-dark: #174266;
  --danger: #d6535d;
  --success: #71c58a;
  --panel-radius: 3px;
  --shadow: 0 18px 55px rgba(0, 0, 0, 0.58);
  --ui-font: "Segoe UI", Inter, system-ui, -apple-system, sans-serif;
  --display-font: Georgia, "Times New Roman", serif;
}

* {
  box-sizing: border-box;
}

html,
body {
  width: 100%;
  height: 100%;
  margin: 0;
  overflow: hidden;
  background: var(--night-deep);
  color: var(--moonstone-bright);
  font-family: var(--ui-font);
}

body {
  user-select: none;
  -webkit-tap-highlight-color: transparent;
}

button,
input {
  font: inherit;
}

button {
  color: inherit;
}

button:focus-visible,
input:focus-visible,
canvas:focus-visible {
  outline: 2px solid var(--teal);
  outline-offset: 3px;
}

input {
  user-select: text;
}

.is-hidden {
  display: none !important;
}

.screen {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
}

.noscript {
  position: fixed;
  z-index: 9999;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 2rem;
  color: white;
  background: #091225;
}

.eyebrow,
.kicker {
  margin: 0 0 0.65rem;
  color: var(--gold);
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.25em;
  text-transform: uppercase;
}

.stone-panel,
.glass-panel {
  border: 1px solid rgba(155, 120, 56, 0.78);
  background:
    linear-gradient(135deg, rgba(215, 213, 200, 0.08), transparent 28%),
    linear-gradient(180deg, rgba(20, 31, 47, 0.96), rgba(7, 13, 22, 0.97));
  box-shadow:
    inset 0 0 0 1px rgba(215, 213, 200, 0.08),
    inset 0 0 28px rgba(99, 229, 215, 0.025),
    var(--shadow);
}

.stone-panel::before,
.glass-panel::before {
  content: "";
  pointer-events: none;
  position: absolute;
  inset: 4px;
  border: 1px solid rgba(215, 213, 200, 0.07);
}

.glass-panel {
  background:
    linear-gradient(135deg, rgba(215, 213, 200, 0.055), transparent 24%),
    linear-gradient(180deg, rgba(12, 20, 33, 0.9), rgba(5, 10, 17, 0.91));
  backdrop-filter: blur(12px) saturate(0.8);
}

.primary-button,
.ghost-button,
.text-button,
.back-button {
  border: 0;
  cursor: pointer;
}

.primary-button {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  min-height: 3.3rem;
  padding: 0.8rem 1.15rem;
  overflow: hidden;
  border: 1px solid #c69a4a;
  border-radius: 2px;
  color: #11141a;
  background:
    linear-gradient(100deg, rgba(255, 255, 255, 0.3), transparent 30%),
    linear-gradient(180deg, #f0c766, #b88435);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.38),
    0 8px 24px rgba(0, 0, 0, 0.35);
  font-family: var(--display-font);
  font-size: 0.96rem;
  font-weight: 700;
  letter-spacing: 0.03em;
  transition: transform 120ms ease, filter 120ms ease, box-shadow 120ms ease;
}

.primary-button::before {
  content: "";
  position: absolute;
  inset: -100% auto -100% -40%;
  width: 28%;
  transform: rotate(18deg);
  background: linear-gradient(90deg, transparent, rgba(255,255,255,.42), transparent);
  transition: left 500ms ease;
}

.primary-button:hover::before {
  left: 120%;
}

.primary-button:hover {
  filter: brightness(1.08);
  box-shadow: 0 10px 32px rgba(242, 195, 91, 0.16);
  transform: translateY(-1px);
}

.primary-button:active {
  transform: scale(0.985);
}

.primary-button:disabled {
  cursor: wait;
  filter: grayscale(0.8);
  opacity: 0.7;
}

/* Boot */

.boot-screen {
  z-index: 1000;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background:
    radial-gradient(circle at 50% 46%, rgba(43, 73, 102, 0.58), transparent 34%),
    radial-gradient(circle at 50% 50%, #14233a, #05080f 68%);
}

.boot-screen::after {
  content: "";
  position: absolute;
  inset: 0;
  opacity: 0.14;
  background-image:
    linear-gradient(rgba(99,229,215,.25) 1px, transparent 1px),
    linear-gradient(90deg, rgba(99,229,215,.25) 1px, transparent 1px);
  background-size: 72px 72px;
  mask-image: radial-gradient(circle at center, black, transparent 62%);
}

.boot-vignette {
  position: absolute;
  inset: 0;
  background: radial-gradient(circle, transparent 38%, rgba(0,0,0,.76));
}

.boot-mark {
  position: relative;
  z-index: 1;
  display: grid;
  width: 9rem;
  height: 9rem;
  margin-bottom: 1.8rem;
  place-items: center;
}

.crest-ring {
  position: absolute;
  inset: 0;
  border: 2px solid rgba(155, 120, 56, 0.75);
  border-radius: 50%;
  box-shadow: 0 0 28px rgba(99, 229, 215, 0.12);
}

.crest-ring::before,
.crest-ring::after {
  content: "";
  position: absolute;
  inset: 17%;
  border: 1px solid rgba(99, 229, 215, 0.68);
  border-radius: 50%;
}

.crest-ring-a {
  animation: spin 12s linear infinite;
}

.crest-ring-a::before {
  transform: rotateX(68deg);
}

.crest-ring-a::after {
  transform: rotateY(68deg);
}

.crest-ring-b {
  inset: 10%;
  border-style: dashed;
  animation: spinReverse 8s linear infinite;
}

.crest-core,
.wordmark-rune {
  display: grid;
  place-items: center;
  color: var(--gold);
  font-family: var(--display-font);
  text-shadow: 0 0 22px rgba(242, 195, 91, 0.55);
}

.crest-core {
  font-size: 3.7rem;
}

.boot-screen h1 {
  z-index: 1;
  margin: 0;
  color: var(--moonstone-bright);
  font-family: var(--display-font);
  font-size: clamp(2.3rem, 5vw, 4.4rem);
  font-weight: 400;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.boot-screen .eyebrow,
.boot-message,
.boot-progress {
  z-index: 1;
}

.boot-progress {
  width: min(23rem, 70vw);
  height: 3px;
  margin-top: 2.5rem;
  overflow: hidden;
  background: rgba(255,255,255,.1);
}

.boot-progress span {
  display: block;
  width: 0;
  height: 100%;
  background: linear-gradient(90deg, var(--indigo), var(--teal), var(--gold));
  box-shadow: 0 0 15px var(--teal);
  transition: width 350ms ease;
}

.boot-message {
  color: var(--muted);
  font-size: 0.76rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

/* Title and account */

.title-screen {
  min-height: 100%;
  overflow: auto;
  background:
    linear-gradient(90deg, rgba(3, 7, 13, 0.9) 0%, rgba(3, 7, 13, 0.52) 46%, rgba(3, 7, 13, 0.62) 100%),
    url("../img/title-arcane-highlands.png") center center / cover no-repeat;
}

.title-overlay {
  position: fixed;
  inset: 0;
  pointer-events: none;
  background:
    radial-gradient(circle at 68% 66%, transparent 0, rgba(4,8,15,.05) 35%, rgba(4,8,15,.55) 95%),
    linear-gradient(180deg, rgba(3,7,13,.42), transparent 22%, transparent 70%, rgba(3,7,13,.78));
}

.title-header,
.character-header {
  position: relative;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: min(1440px, calc(100% - 5rem));
  margin: 0 auto;
  padding: 1.55rem 0;
}

.wordmark {
  display: flex;
  gap: 0.85rem;
  align-items: center;
  color: inherit;
  text-decoration: none;
}

.wordmark-rune {
  width: 2.55rem;
  height: 2.55rem;
  border: 1px solid var(--brass);
  border-radius: 50%;
  background: radial-gradient(circle, rgba(99,229,215,.15), transparent 66%);
  font-size: 1.45rem;
}

.wordmark b,
.wordmark small {
  display: block;
}

.wordmark b {
  font-family: var(--display-font);
  font-size: 1.2rem;
  font-weight: 500;
  letter-spacing: 0.11em;
  text-transform: uppercase;
}

.wordmark small {
  margin-top: 0.15rem;
  color: var(--gold-soft);
  font-size: 0.58rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
}

.server-pill {
  display: flex;
  gap: 0.55rem;
  align-items: center;
  padding: 0.55rem 0.8rem;
  border: 1px solid rgba(215,213,200,.15);
  border-radius: 99px;
  color: #d9e0e2;
  background: rgba(4, 9, 16, 0.56);
  backdrop-filter: blur(9px);
  font-size: 0.72rem;
}

.status-dot {
  width: 0.47rem;
  height: 0.47rem;
  border-radius: 50%;
  background: var(--gold);
  box-shadow: 0 0 10px var(--gold);
}

.server-pill.is-online .status-dot {
  background: var(--success);
  box-shadow: 0 0 10px var(--success);
}

.server-pill.is-offline .status-dot {
  background: var(--danger);
  box-shadow: 0 0 10px var(--danger);
}

.title-content {
  position: relative;
  z-index: 2;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(22rem, 29rem);
  gap: clamp(3rem, 9vw, 9rem);
  align-items: center;
  width: min(1280px, calc(100% - 5rem));
  min-height: calc(100% - 9rem);
  margin: -1rem auto 0;
  padding: 3rem 0 6rem;
}

.title-copy {
  max-width: 37rem;
  text-shadow: 0 3px 24px rgba(0,0,0,.75);
}

.title-copy h1 {
  margin: 0 0 1.4rem;
  font-family: var(--display-font);
  font-size: clamp(3.6rem, 7vw, 7rem);
  font-weight: 400;
  line-height: 0.88;
  letter-spacing: -0.05em;
}

.title-copy h1 em {
  color: var(--gold);
  font-weight: 400;
}

.title-copy > p:not(.eyebrow) {
  max-width: 34rem;
  color: #c6ced4;
  font-size: clamp(0.9rem, 1.2vw, 1.05rem);
  line-height: 1.75;
}

.world-features {
  display: flex;
  gap: 0;
  margin-top: 2.3rem;
}

.world-features span {
  padding: 0 1.5rem;
  border-left: 1px solid rgba(215,213,200,.22);
  color: var(--muted);
  font-size: 0.67rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.world-features span:first-child {
  padding-left: 0;
  border-left: 0;
}

.world-features b {
  display: block;
  margin-bottom: 0.18rem;
  color: var(--moonstone-bright);
  font-family: var(--display-font);
  font-size: 1.45rem;
  font-weight: 400;
}

.auth-card {
  position: relative;
  padding: 1.45rem 1.7rem 1.6rem;
}

.auth-tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  margin: -0.2rem -0.15rem 1.7rem;
  border-bottom: 1px solid rgba(215,213,200,.13);
}

.auth-tab {
  position: relative;
  padding: 0.75rem 0.4rem;
  border: 0;
  color: var(--muted);
  background: transparent;
  cursor: pointer;
  font-size: 0.74rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.auth-tab::after {
  content: "";
  position: absolute;
  right: 15%;
  bottom: -1px;
  left: 15%;
  height: 2px;
  transform: scaleX(0);
  background: var(--gold);
  transition: transform 160ms ease;
}

.auth-tab.is-active {
  color: var(--moonstone-bright);
}

.auth-tab.is-active::after {
  transform: scaleX(1);
}

.panel-heading {
  margin-bottom: 1.25rem;
}

.panel-heading h2,
.character-form-area h1 {
  margin: 0.15rem 0 0.35rem;
  font-family: var(--display-font);
  font-size: 1.65rem;
  font-weight: 400;
}

.panel-heading p,
.character-intro {
  margin: 0;
  color: var(--muted);
  font-size: 0.76rem;
  line-height: 1.55;
}

.auth-form label,
.character-name-field {
  display: block;
  margin: 0 0 0.85rem;
}

.auth-form label > span,
.character-name-field > span {
  display: block;
  margin-bottom: 0.35rem;
  color: #c7ced3;
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: 0.04em;
}

.auth-form input,
.character-name-field input,
.bank-money-row input {
  width: 100%;
  height: 2.8rem;
  padding: 0 0.85rem;
  border: 1px solid rgba(158,172,187,.25);
  border-radius: 2px;
  color: var(--moonstone-bright);
  background: rgba(2, 6, 12, 0.54);
  box-shadow: inset 0 2px 8px rgba(0,0,0,.35);
  transition: border-color 140ms ease, box-shadow 140ms ease;
}

.auth-form input:focus,
.character-name-field input:focus,
.bank-money-row input:focus {
  border-color: rgba(99,229,215,.65);
  outline: 0;
  box-shadow: inset 0 2px 8px rgba(0,0,0,.35), 0 0 0 3px rgba(99,229,215,.08);
}

.form-error {
  min-height: 1rem;
  margin: 0.6rem 0;
  color: #ff8f97;
  font-size: 0.72rem;
}

.auth-divider {
  display: flex;
  gap: 0.8rem;
  align-items: center;
  margin: 1rem 0;
  color: #75818c;
  font-size: 0.65rem;
  text-transform: uppercase;
}

.auth-divider::before,
.auth-divider::after {
  content: "";
  height: 1px;
  flex: 1;
  background: rgba(158,172,187,.16);
}

.ghost-button {
  display: flex;
  gap: 0.8rem;
  align-items: center;
  width: 100%;
  padding: 0.75rem 0.9rem;
  border: 1px solid rgba(99,229,215,.24);
  border-radius: 2px;
  color: #e8eeee;
  background: rgba(99,229,215,.045);
  text-align: left;
  transition: border-color 140ms ease, background 140ms ease;
}

.ghost-button:hover {
  border-color: rgba(99,229,215,.55);
  background: rgba(99,229,215,.09);
}

.ghost-button span:not(.button-rune) {
  display: flex;
  flex-direction: column;
}

.ghost-button small {
  margin-top: 0.12rem;
  color: var(--muted);
  font-size: 0.64rem;
}

.button-rune {
  color: var(--teal);
  font-size: 1.4rem;
  text-shadow: 0 0 12px rgba(99,229,215,.5);
}

.title-footer {
  position: fixed;
  z-index: 2;
  right: 2.5rem;
  bottom: 1.1rem;
  left: 2.5rem;
  display: flex;
  gap: 1.4rem;
  align-items: center;
  color: rgba(215,213,200,.52);
  font-size: 0.61rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.title-footer button {
  margin-left: auto;
  border: 0;
  color: inherit;
  background: none;
  cursor: pointer;
  text-transform: inherit;
}

/* Character selection */

.character-screen {
  overflow: auto;
  background: #070d16;
}

.character-art,
.character-shade {
  position: fixed;
  inset: 0;
}

.character-art {
  background: url("../img/character-creation.png") center / cover no-repeat;
}

.character-shade {
  background:
    linear-gradient(90deg, rgba(4,8,15,.95) 0%, rgba(4,8,15,.72) 40%, rgba(4,8,15,.12) 73%),
    linear-gradient(180deg, rgba(4,8,15,.35), transparent 60%, rgba(4,8,15,.58));
}

.character-header {
  position: relative;
}

.text-button,
.back-button {
  padding: 0.5rem;
  color: #b9c3ca;
  background: transparent;
  font-size: 0.72rem;
}

.text-button:hover,
.back-button:hover {
  color: var(--teal);
}

.character-content {
  position: relative;
  z-index: 2;
  display: flex;
  align-items: center;
  width: min(1440px, calc(100% - 5rem));
  min-height: calc(100% - 6rem);
  margin: 0 auto;
}

.character-form-area {
  position: relative;
  width: min(35rem, 45vw);
  max-height: calc(100vh - 9rem);
  padding: 2rem;
  overflow: auto;
}

.character-form-area h1 {
  font-size: 2.3rem;
}

.character-list {
  display: grid;
  gap: 0.65rem;
  margin: 1.6rem 0 1.2rem;
}

.character-card {
  position: relative;
  display: grid;
  grid-template-columns: 3.2rem 1fr auto;
  gap: 0.9rem;
  align-items: center;
  padding: 0.8rem 0.9rem;
  overflow: hidden;
  border: 1px solid rgba(158,172,187,.16);
  color: inherit;
  background: rgba(5,10,17,.5);
  cursor: pointer;
  text-align: left;
  transition: border-color 150ms ease, transform 150ms ease, background 150ms ease;
}

.character-card:hover {
  transform: translateX(3px);
  border-color: rgba(242,195,91,.5);
  background: rgba(30,32,38,.75);
}

.character-card-icon {
  display: grid;
  width: 3.2rem;
  height: 3.2rem;
  border: 1px solid var(--brass);
  border-radius: 50%;
  place-items: center;
  color: var(--gold);
  background: radial-gradient(circle, rgba(99,229,215,.13), rgba(5,10,17,.75));
  font-size: 1.4rem;
}

.character-card strong,
.character-card small {
  display: block;
}

.character-card strong {
  font-family: var(--display-font);
  font-size: 1.05rem;
  font-weight: 400;
}

.character-card small {
  margin-top: 0.2rem;
  color: var(--muted);
  font-size: 0.66rem;
}

.character-card > span:last-child {
  color: var(--gold);
}

.character-empty {
  padding: 1.4rem;
  border: 1px dashed rgba(158,172,187,.22);
  color: var(--muted);
  text-align: center;
  font-size: 0.75rem;
}

.back-button {
  margin: -0.5rem 0 1rem -0.5rem;
}

.character-name-field {
  margin: 1.2rem 0;
}

.origin-choices {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.65rem;
  margin: 1rem 0;
}

.origin-card {
  position: relative;
  display: grid;
  grid-template-columns: 2.5rem 1fr;
  gap: 0.7rem;
  padding: 0.85rem;
  border: 1px solid rgba(158,172,187,.2);
  color: var(--moonstone-bright);
  background: rgba(4,9,16,.56);
  cursor: pointer;
  text-align: left;
}

.origin-card:hover,
.origin-card.is-selected {
  border-color: var(--origin-colour, var(--gold));
  background: linear-gradient(135deg, color-mix(in srgb, var(--origin-colour) 13%, transparent), rgba(4,9,16,.68));
}

.origin-card.is-selected::after {
  content: "✓";
  position: absolute;
  top: 0.4rem;
  right: 0.5rem;
  color: var(--origin-colour);
  font-weight: 700;
}

.origin-icon {
  display: grid;
  height: 2.5rem;
  border: 1px solid color-mix(in srgb, var(--origin-colour) 70%, transparent);
  border-radius: 50%;
  place-items: center;
  color: var(--origin-colour);
  font-size: 1.15rem;
}

.origin-card strong,
.origin-card small,
.origin-card em {
  display: block;
}

.origin-card strong {
  font-family: var(--display-font);
  font-weight: 400;
}

.origin-card em {
  margin-top: 0.08rem;
  color: var(--origin-colour);
  font-size: 0.56rem;
  font-style: normal;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.origin-card small {
  grid-column: 1 / -1;
  color: var(--muted);
  font-size: 0.62rem;
  line-height: 1.45;
}

/* Game */

.game-screen {
  background: #101923;
}

#worldCanvas {
  display: block;
  width: 100%;
  height: 100%;
  cursor: crosshair;
}

.world-wash {
  position: absolute;
  inset: 0;
  pointer-events: none;
  box-shadow: inset 0 0 110px rgba(0,0,0,.52);
}

.hud-character,
.quest-tracker,
.currency-strip,
.hotbar-shell,
.hud-navigation,
.minimap-shell,
.side-panel,
.interaction-prompt,
.action-progress {
  position: absolute;
  z-index: 10;
}

.hud-character {
  top: 1rem;
  left: 1rem;
  display: flex;
  gap: 0.8rem;
  align-items: center;
  width: 20.5rem;
  height: 5.6rem;
  padding: 0.55rem 0.75rem;
}

.portrait-frame {
  position: relative;
  display: grid;
  flex: 0 0 4.3rem;
  width: 4.3rem;
  height: 4.3rem;
  border: 2px solid var(--brass);
  border-radius: 50%;
  background: radial-gradient(circle at 50% 35%, #31445d, #0a101a 70%);
  box-shadow: inset 0 0 0 2px rgba(215,213,200,.12), 0 0 18px rgba(0,0,0,.35);
  place-items: center;
}

.portrait-frame::after {
  content: "";
  position: absolute;
  inset: -6px;
  border: 1px solid rgba(155,120,56,.36);
  border-radius: 50%;
}

.portrait-rune {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  color: var(--teal);
  background-image: url("../img/game-v2/origin-portraits.png");
  background-repeat: no-repeat;
  background-size: 200% 200%;
  font-family: var(--display-font);
  font-size: 2rem;
  text-shadow: 0 0 16px rgba(99,229,215,.65);
}

.portrait-level {
  position: absolute;
  right: -0.35rem;
  bottom: -0.35rem;
  display: grid;
  width: 2.25rem;
  height: 1.55rem;
  border: 1px solid var(--brass);
  border-radius: 50%;
  place-items: center;
  color: var(--gold);
  background: #080d15;
  font-family: var(--display-font);
  padding: 0 0.25rem;
  border-radius: 0.8rem;
  font-size: 0.58rem;
  letter-spacing: 0.03em;
}

.combat-overview {
  display: grid;
  grid-template-columns: 5.2rem 1fr;
  gap: 1rem;
  align-items: center;
  margin-bottom: 1rem;
  padding: 1rem;
  border: 1px solid rgba(242,195,91,.3);
  background: linear-gradient(135deg, rgba(242,195,91,.11), rgba(99,229,215,.04));
}

.combat-level-orb {
  display: grid;
  width: 5rem;
  height: 5rem;
  border: 2px solid var(--brass);
  border-radius: 50%;
  background: radial-gradient(circle at 45% 35%, #34475b, #080d15 72%);
  box-shadow: inset 0 0 18px rgba(242,195,91,.12), 0 0 20px rgba(0,0,0,.3);
  place-content: center;
  text-align: center;
}

.combat-level-orb small {
  color: var(--gold-soft);
  font-size: 0.52rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.combat-level-orb strong {
  color: var(--gold);
  font-family: var(--display-font);
  font-size: 1.8rem;
  font-weight: 400;
}

.combat-progress-copy {
  min-width: 0;
}

.combat-progress-copy > strong {
  font-size: 0.76rem;
}

.combat-progress-copy > small {
  display: block;
  margin-top: 0.45rem;
  color: var(--muted);
  font-size: 0.62rem;
  line-height: 1.45;
}

.combat-progress-track {
  height: 0.55rem;
  margin-top: 0.55rem;
  overflow: hidden;
  border: 1px solid rgba(215,213,200,.15);
  background: rgba(0,0,0,.48);
}

.combat-progress-track span {
  display: block;
  height: 100%;
  background: linear-gradient(90deg, #8a6628, var(--gold), var(--teal));
}

.combat-skill-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.45rem;
  margin-bottom: 1rem;
}

.combat-skill-grid > div {
  display: flex;
  justify-content: space-between;
  padding: 0.55rem 0.65rem;
  border: 1px solid rgba(158,172,187,.13);
  background: rgba(255,255,255,.025);
  font-size: 0.68rem;
}

.combat-skill-grid strong {
  color: var(--gold);
}

.status-stack {
  min-width: 0;
  flex: 1;
}

.character-line {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: 0.35rem;
}

.character-line strong {
  overflow: hidden;
  font-family: var(--display-font);
  font-size: 0.93rem;
  font-weight: 400;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.character-line span {
  color: var(--gold-soft);
  font-size: 0.52rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.status-bar {
  position: relative;
  height: 0.72rem;
  margin: 0.22rem 0;
  overflow: hidden;
  border: 1px solid rgba(215,213,200,.16);
  border-radius: 1px;
  background: rgba(0,0,0,.56);
  box-shadow: inset 0 1px 4px rgba(0,0,0,.7);
}

.status-bar > span {
  display: block;
  width: 50%;
  height: 100%;
  transition: width 240ms ease;
}

.status-bar b {
  position: absolute;
  inset: -1px 0 0;
  color: rgba(255,255,255,.9);
  font-size: 0.5rem;
  font-weight: 600;
  line-height: 0.72rem;
  text-align: center;
  text-shadow: 0 1px 2px #000;
}

.health-bar > span {
  background: linear-gradient(90deg, var(--health-dark), var(--health));
}

.mana-bar > span {
  background: linear-gradient(90deg, var(--mana-dark), var(--mana));
}

.xp-bar {
  height: 0.48rem;
}

.xp-bar > span {
  background: linear-gradient(90deg, #846528, var(--gold));
}

.xp-bar b {
  line-height: 0.48rem;
  font-size: 0.42rem;
}

.quest-tracker {
  top: 7.25rem;
  left: 1rem;
  width: 18rem;
  overflow: hidden;
}

.quest-tracker header {
  display: grid;
  grid-template-columns: 1.8rem 1fr auto;
  gap: 0.55rem;
  align-items: center;
  padding: 0.7rem 0.75rem;
  border-bottom: 1px solid rgba(158,172,187,.13);
}

.quest-tracker header small,
.quest-tracker header h2 {
  display: block;
  margin: 0;
}

.quest-tracker header small {
  color: var(--muted);
  font-size: 0.48rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.quest-tracker header h2 {
  overflow: hidden;
  color: var(--gold);
  font-family: var(--display-font);
  font-size: 0.82rem;
  font-weight: 400;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.panel-icon {
  color: var(--gold);
  font-size: 1.2rem;
  text-shadow: 0 0 12px rgba(242,195,91,.45);
}

.quest-tracker header button {
  border: 0;
  color: var(--muted);
  background: none;
  cursor: pointer;
}

.tracked-quest-body {
  padding: 0.65rem 0.8rem 0.75rem;
}

.tracked-quest-body p {
  margin: 0.25rem 0;
  color: #d6dce0;
  font-size: 0.66rem;
  line-height: 1.45;
}

.objective-row {
  display: grid;
  grid-template-columns: 0.85rem 1fr auto;
  gap: 0.4rem;
  align-items: start;
  margin: 0.4rem 0;
  color: #c5cdd2;
  font-size: 0.64rem;
}

.objective-row::before {
  content: "◇";
  color: var(--gold-soft);
}

.objective-row.is-complete {
  color: var(--success);
}

.objective-row.is-complete::before {
  content: "◆";
}

.minimap-shell {
  top: 0.8rem;
  right: 1rem;
  width: 12.2rem;
  height: 14.8rem;
  pointer-events: none;
}

.minimap-shell::before,
.minimap-shell::after {
  content: "";
  position: absolute;
  top: 0;
  right: 0;
  width: 12rem;
  height: 12rem;
  border: 2px solid var(--brass);
  border-radius: 50%;
  box-shadow:
    inset 0 0 0 4px rgba(7,13,22,.78),
    inset 0 0 0 6px rgba(215,213,200,.1),
    0 8px 32px rgba(0,0,0,.55);
}

.minimap-shell::after {
  top: 0.45rem;
  right: 0.45rem;
  width: 11.1rem;
  height: 11.1rem;
  border: 1px solid rgba(215,213,200,.22);
}

#minimapCanvas {
  position: absolute;
  top: 0.55rem;
  right: 0.55rem;
  display: block;
  width: 10.9rem;
  height: 10.9rem;
  border-radius: 50%;
}

.minimap-compass span {
  position: absolute;
  z-index: 2;
  display: grid;
  width: 1.25rem;
  height: 1.25rem;
  place-items: center;
  color: var(--gold);
  background: #080e17;
  font-family: var(--display-font);
  font-size: 0.68rem;
}

.minimap-compass span:nth-child(1) { top: -0.1rem; right: 5.36rem; }
.minimap-compass span:nth-child(2) { top: 5.35rem; right: -0.08rem; }
.minimap-compass span:nth-child(3) { top: 10.85rem; right: 5.36rem; }
.minimap-compass span:nth-child(4) { top: 5.35rem; left: -0.08rem; }

.minimap-title {
  position: absolute;
  top: 12.25rem;
  right: 0;
  width: 12rem;
  text-align: center;
  text-shadow: 0 2px 8px #000;
}

.minimap-title strong,
.minimap-title small {
  display: block;
}

.minimap-title strong {
  color: var(--moonstone-bright);
  font-family: var(--display-font);
  font-size: 0.82rem;
  font-weight: 400;
  letter-spacing: 0.04em;
}

.minimap-title small {
  margin-top: 0.1rem;
  color: var(--muted);
  font-size: 0.52rem;
}

.minimap-map-button {
  position: absolute;
  z-index: 3;
  top: 9.25rem;
  right: 0.25rem;
  display: grid;
  width: 2.2rem;
  height: 2.2rem;
  border: 1px solid var(--brass);
  border-radius: 50%;
  color: var(--gold);
  background: #080e17;
  cursor: pointer;
  place-items: center;
  pointer-events: auto;
}

.currency-strip {
  top: 15.7rem;
  right: 1.3rem;
  display: flex;
  gap: 0.7rem;
  padding: 0.42rem 0.65rem;
}

.currency-strip > span {
  display: grid;
  grid-template-columns: auto auto;
  column-gap: 0.25rem;
  align-items: center;
}

.currency-strip b {
  color: var(--moonstone-bright);
  font-family: var(--display-font);
  font-size: 0.73rem;
  font-weight: 400;
  font-variant-numeric: tabular-nums;
}

.currency-strip small {
  grid-column: 2;
  color: var(--muted);
  font-size: 0.43rem;
  text-transform: uppercase;
}

.coin {
  display: block;
  grid-row: 1 / 3;
  width: 0.85rem;
  height: 0.85rem;
  border-radius: 50%;
  box-shadow: inset 0 0 0 2px rgba(255,255,255,.14);
}

.gold-coin { background: linear-gradient(135deg, #fff0a0, #b27d23); }
.silver-coin { background: linear-gradient(135deg, #edf2f4, #73808a); }

.zone-banner {
  position: absolute;
  z-index: 12;
  top: 2.2rem;
  left: 50%;
  width: min(28rem, 60vw);
  padding: 0.9rem;
  opacity: 0;
  pointer-events: none;
  transform: translate(-50%, -18px);
  text-align: center;
  text-shadow: 0 2px 12px #000;
  transition: opacity 450ms ease, transform 450ms ease;
}

.zone-banner::before,
.zone-banner::after {
  content: "";
  display: inline-block;
  width: 4rem;
  height: 1px;
  margin: 0 0.8rem 0.25rem;
  background: linear-gradient(90deg, transparent, var(--gold));
}

.zone-banner::after {
  background: linear-gradient(90deg, var(--gold), transparent);
}

.zone-banner.is-visible {
  opacity: 1;
  transform: translate(-50%, 0);
}

.zone-banner span,
.zone-banner strong,
.zone-banner small {
  display: block;
}

.zone-banner span {
  color: var(--gold-soft);
  font-size: 0.53rem;
  letter-spacing: 0.22em;
  text-transform: uppercase;
}

.zone-banner strong {
  margin: 0.18rem 0;
  font-family: var(--display-font);
  font-size: 1.65rem;
  font-weight: 400;
  letter-spacing: 0.08em;
}

.zone-banner small {
  color: #c3cbd0;
  font-size: 0.62rem;
}

.interaction-prompt {
  bottom: 10rem;
  left: 50%;
  display: flex;
  gap: 0.65rem;
  align-items: center;
  padding: 0.5rem 0.85rem 0.5rem 0.55rem;
  border: 1px solid rgba(242,195,91,.55);
  background: rgba(6,11,19,.88);
  box-shadow: var(--shadow);
  transform: translateX(-50%);
}

kbd {
  display: inline-grid;
  min-width: 1.35rem;
  height: 1.35rem;
  padding: 0 0.24rem;
  border: 1px solid rgba(215,213,200,.26);
  border-radius: 2px;
  color: var(--moonstone-bright);
  background: linear-gradient(#28313b, #0a1018);
  box-shadow: 0 2px 0 #030609;
  font-family: var(--ui-font);
  font-size: 0.6rem;
  place-items: center;
}

.interaction-prompt span small,
.interaction-prompt span b {
  display: block;
}

.interaction-prompt span small {
  color: var(--muted);
  font-size: 0.46rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.interaction-prompt span b {
  margin-top: 0.08rem;
  font-family: var(--display-font);
  font-size: 0.7rem;
  font-weight: 400;
}

.action-progress {
  bottom: 9.8rem;
  left: 50%;
  width: 18rem;
  padding: 0.65rem 0.75rem;
  transform: translateX(-50%);
}

.action-progress > div:first-child {
  display: flex;
  gap: 0.55rem;
  align-items: center;
  margin-bottom: 0.45rem;
}

.action-progress p {
  margin: 0;
}

.action-progress small,
.action-progress b {
  display: block;
}

.action-progress small {
  color: var(--muted);
  font-size: 0.48rem;
  text-transform: uppercase;
}

.action-progress b {
  font-family: var(--display-font);
  font-size: 0.72rem;
  font-weight: 400;
}

#actionIcon {
  color: var(--teal);
  font-size: 1.1rem;
}

.action-progress-track {
  height: 0.32rem;
  overflow: hidden;
  background: rgba(0,0,0,.6);
}

.action-progress-track span {
  display: block;
  width: 0;
  height: 100%;
  background: linear-gradient(90deg, var(--indigo), var(--teal));
  box-shadow: 0 0 8px var(--teal);
}

.hotbar-shell {
  bottom: 1rem;
  left: 50%;
  padding: 0.4rem;
  transform: translateX(-50%);
}

.hotbar {
  display: flex;
  gap: 0.32rem;
}

.ability {
  position: relative;
  width: 4.05rem;
  height: 4.05rem;
  padding: 0;
  overflow: hidden;
  border: 1px solid rgba(155,120,56,.72);
  color: white;
  background:
    radial-gradient(circle at 50% 35%, rgba(99,229,215,.22), transparent 48%),
    linear-gradient(145deg, #1e2941, #080d16);
  cursor: pointer;
  box-shadow: inset 0 0 0 2px rgba(215,213,200,.05);
  transition: transform 100ms ease, border-color 100ms ease, filter 100ms ease;
}

.ability:nth-child(1) { --ability: #e0a249; }
.ability:nth-child(2) { --ability: #66b7d7; }
.ability:nth-child(3) { --ability: #7566e4; }
.ability:nth-child(4) { --ability: #71c58a; }
.ability:nth-child(5) { --ability: #60dacc; }

.ability:hover {
  z-index: 2;
  transform: translateY(-3px);
  border-color: var(--gold);
  filter: brightness(1.14);
}

.ability:active {
  transform: scale(0.96);
}

.ability.is-cooling {
  filter: saturate(.35) brightness(.7);
}

.ability-art {
  display: block;
  height: 100%;
  background-image:
    linear-gradient(to top, rgba(3,7,13,.45), transparent 52%),
    url("../img/game-v2/icon-atlas.png");
  background-repeat: no-repeat;
  background-size: 400% 400%;
  filter: saturate(.94) contrast(1.04);
}

.ability-1 .ability-art { background-position: 0 0; }
.ability-2 .ability-art { background-position: 33.333% 0; }
.ability-3 .ability-art { background-position: 66.666% 0; }
.ability-4 .ability-art { background-position: 100% 0; }
.ability-5 .ability-art { background-position: 0 33.333%; }

.ability kbd {
  position: absolute;
  top: 0.16rem;
  left: 0.16rem;
  min-width: 1rem;
  height: 1rem;
  border-color: rgba(255,255,255,.14);
  color: #e9eeee;
  background: rgba(0,0,0,.55);
  box-shadow: none;
  font-size: 0.48rem;
}

.ability small {
  position: absolute;
  right: 0.2rem;
  bottom: 0.16rem;
  left: 0.2rem;
  overflow: hidden;
  color: rgba(255,255,255,.68);
  font-size: 0.43rem;
  letter-spacing: 0.04em;
  text-overflow: ellipsis;
  text-transform: uppercase;
  white-space: nowrap;
}

.ability > i {
  position: absolute;
  inset: 0;
  transform: translateY(100%);
  background: rgba(2,5,9,.7);
  pointer-events: none;
}

.target-frame {
  position: absolute;
  bottom: calc(100% + 0.55rem);
  left: 50%;
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 0.2rem 0.6rem;
  width: 13rem;
  padding: 0.45rem 0.6rem;
  border: 1px solid rgba(214,83,93,.5);
  background: rgba(6,10,16,.9);
  transform: translateX(-50%);
}

.target-frame span {
  font-family: var(--display-font);
  font-size: 0.68rem;
}

.target-frame small {
  color: var(--muted);
  font-size: 0.5rem;
}

.target-frame > div {
  grid-column: 1 / -1;
  height: 0.32rem;
  background: rgba(0,0,0,.6);
}

.target-frame i {
  display: block;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, #6c2438, var(--danger));
  transition: width 180ms ease;
}

.hud-navigation {
  right: 1rem;
  bottom: 1rem;
  display: flex;
  padding: 0.35rem;
}

.hud-navigation button {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 0.08rem;
  align-items: center;
  min-width: 3.8rem;
  padding: 0.35rem 0.35rem 0.26rem;
  border: 0;
  color: #a9b3bc;
  background: transparent;
  cursor: pointer;
}

.hud-navigation button:hover,
.hud-navigation button.is-active {
  color: var(--gold);
}

.hud-navigation button span {
  font-family: var(--display-font);
  font-size: 1.35rem;
}

.hud-navigation button small {
  font-size: 0.43rem;
  letter-spacing: 0.07em;
  text-transform: uppercase;
}

.hud-navigation button kbd {
  position: absolute;
  top: 0.05rem;
  right: 0.05rem;
  min-width: 0.8rem;
  height: 0.8rem;
  color: rgba(215,213,200,.4);
  background: none;
  box-shadow: none;
  font-size: 0.4rem;
}

.chat-panel {
  position: absolute;
  z-index: 10;
  bottom: 1rem;
  left: 1rem;
  width: 20rem;
}

.chat-messages {
  max-height: 8rem;
  padding: 0.5rem;
  overflow: auto;
  mask-image: linear-gradient(transparent, black 25%);
  text-shadow: 0 1px 4px #000;
}

.chat-message {
  margin: 0.24rem 0;
  color: #c9d0d4;
  font-size: 0.62rem;
  line-height: 1.35;
}

.chat-message strong {
  color: var(--gold-soft);
  font-weight: 600;
}

.chat-message.is-system,
.chat-message.is-system strong {
  color: var(--teal);
}

.chat-input-row {
  display: grid;
  grid-template-columns: 2.3rem 1fr 2.2rem;
  height: 2.25rem;
  border: 1px solid rgba(155,120,56,.5);
  background: rgba(5,10,17,.84);
  backdrop-filter: blur(8px);
}

.chat-input-row button {
  border: 0;
  color: var(--gold-soft);
  background: transparent;
  cursor: pointer;
}

.chat-input-row input {
  min-width: 0;
  border: 0;
  color: #eef1f0;
  background: transparent;
  outline: 0;
  font-size: 0.65rem;
}

/* Game windows */

.side-panel {
  top: 1rem;
  right: 1rem;
  bottom: 5.9rem;
  width: min(28rem, calc(100vw - 2rem));
  overflow: hidden;
  animation: panelIn 160ms cubic-bezier(.2,.8,.2,1);
}

.side-panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 4.2rem;
  padding: 0.75rem 1rem;
  border-bottom: 1px solid rgba(155,120,56,.45);
  background: linear-gradient(90deg, rgba(99,229,215,.04), transparent);
}

.side-panel-header small,
.side-panel-header h2 {
  display: block;
  margin: 0;
}

.side-panel-header small {
  color: var(--gold-soft);
  font-size: 0.52rem;
  letter-spacing: 0.17em;
  text-transform: uppercase;
}

.side-panel-header h2 {
  margin-top: 0.18rem;
  font-family: var(--display-font);
  font-size: 1.22rem;
  font-weight: 400;
}

.side-panel-header button,
.dialogue-close {
  display: grid;
  width: 2rem;
  height: 2rem;
  border: 1px solid rgba(155,120,56,.55);
  color: var(--muted);
  background: rgba(0,0,0,.22);
  cursor: pointer;
  font-size: 1.35rem;
  place-items: center;
}

.side-panel-header button:hover,
.dialogue-close:hover {
  color: var(--gold);
  border-color: var(--gold);
}

.side-panel-content {
  height: calc(100% - 4.2rem);
  padding: 0.9rem;
  overflow: auto;
}

.panel-section-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin: 0.4rem 0 0.65rem;
  color: var(--moonstone);
  font-family: var(--display-font);
  font-size: 0.82rem;
  font-weight: 400;
}

.panel-section-title small {
  color: var(--muted);
  font-family: var(--ui-font);
  font-size: 0.5rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.inventory-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 0.38rem;
}

.item-slot {
  position: relative;
  display: grid;
  aspect-ratio: 1;
  border: 1px solid rgba(158,172,187,.19);
  color: #ccd5d7;
  background:
    linear-gradient(145deg, rgba(255,255,255,.035), transparent),
    rgba(1,5,9,.45);
  cursor: pointer;
  box-shadow: inset 0 1px 8px rgba(0,0,0,.45);
  place-items: center;
}

.item-slot:hover,
.item-slot.is-selected {
  z-index: 2;
  border-color: var(--rarity, var(--gold));
  box-shadow: inset 0 0 12px color-mix(in srgb, var(--rarity) 13%, transparent), 0 0 10px rgba(0,0,0,.3);
}

.item-slot .item-icon {
  color: var(--rarity, #cdd4d6);
  font-family: var(--display-font);
  font-size: 1.45rem;
  text-shadow: 0 0 12px color-mix(in srgb, var(--rarity) 50%, transparent);
}

.item-slot .item-icon.item-icon-art,
.item-icon-art {
  display: block;
  width: 82%;
  height: 82%;
  border-radius: 2px;
  background-image: url("../img/game-v2/icon-atlas.png");
  background-repeat: no-repeat;
  background-size: 400% 400%;
  box-shadow: inset 0 0 10px rgba(3,7,13,.26);
  font-size: 0;
}

.item-slot .item-icon.item-icon-art.item-icon-art-secondary,
.item-icon-art.item-icon-art-secondary {
  background-image: url("../img/game-v2/icon-atlas-secondary.png");
}

.item-detail-header .item-icon-art {
  width: 3.2rem;
  height: 3.2rem;
  flex: 0 0 3.2rem;
}

.item-slot .item-quantity {
  position: absolute;
  right: 0.25rem;
  bottom: 0.18rem;
  font-size: 0.55rem;
  font-weight: 700;
  text-shadow: 0 1px 3px #000;
}

.rarity-common { --rarity: #c8d0d2; }
.rarity-uncommon { --rarity: #71c58a; }
.rarity-rare { --rarity: #66b7e0; }
.rarity-epic { --rarity: #a98af0; }
.rarity-legendary { --rarity: #f2c35b; }

.inventory-empty {
  display: grid;
  grid-column: 1 / -1;
  min-height: 11rem;
  color: var(--muted);
  font-size: 0.7rem;
  place-items: center;
}

.item-detail {
  margin-top: 0.85rem;
  padding: 0.75rem;
  border: 1px solid rgba(158,172,187,.14);
  background: rgba(1,5,9,.28);
}

.item-detail-header {
  display: flex;
  gap: 0.65rem;
  align-items: center;
}

.item-detail-header > span {
  display: grid;
  width: 2.7rem;
  height: 2.7rem;
  border: 1px solid var(--rarity);
  color: var(--rarity);
  font-size: 1.3rem;
  place-items: center;
}

.item-detail h3,
.item-detail p {
  margin: 0;
}

.item-detail h3 {
  color: var(--rarity);
  font-family: var(--display-font);
  font-size: 0.9rem;
  font-weight: 400;
}

.item-detail small {
  color: var(--muted);
  font-size: 0.5rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.item-detail p {
  margin-top: 0.6rem;
  color: #bbc4ca;
  font-size: 0.62rem;
  line-height: 1.5;
}

.item-actions {
  display: flex;
  gap: 0.45rem;
  margin-top: 0.7rem;
}

.small-button {
  padding: 0.42rem 0.65rem;
  border: 1px solid rgba(155,120,56,.5);
  color: #dedfd8;
  background: rgba(155,120,56,.1);
  cursor: pointer;
  font-size: 0.58rem;
}

.small-button:hover {
  border-color: var(--gold);
  color: var(--gold);
}

.small-button.danger {
  border-color: rgba(214,83,93,.45);
  color: #ff9ea3;
}

.skills-summary {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.55rem;
  margin-bottom: 0.9rem;
}

.summary-card {
  padding: 0.75rem;
  border: 1px solid rgba(158,172,187,.14);
  background: rgba(1,5,9,.28);
}

.summary-card small,
.summary-card strong {
  display: block;
}

.summary-card small {
  color: var(--muted);
  font-size: 0.5rem;
  text-transform: uppercase;
}

.summary-card strong {
  margin-top: 0.2rem;
  color: var(--gold);
  font-family: var(--display-font);
  font-size: 1.2rem;
  font-weight: 400;
}

.skill-list {
  display: grid;
  gap: 0.38rem;
}

.skill-row {
  display: grid;
  grid-template-columns: 2.4rem 1fr auto;
  gap: 0.65rem;
  align-items: center;
  padding: 0.55rem 0.65rem;
  border: 1px solid rgba(158,172,187,.13);
  background: rgba(1,5,9,.25);
}

.skill-icon {
  display: grid;
  width: 2.2rem;
  height: 2.2rem;
  border: 1px solid rgba(99,229,215,.24);
  color: var(--teal);
  background: rgba(99,229,215,.04);
  place-items: center;
}

.skill-row strong,
.skill-row small {
  display: block;
}

.skill-row strong {
  font-family: var(--display-font);
  font-size: 0.72rem;
  font-weight: 400;
}

.skill-row small {
  margin-top: 0.15rem;
  color: var(--muted);
  font-size: 0.5rem;
}

.skill-level {
  color: var(--gold);
  font-family: var(--display-font);
  font-size: 1.1rem;
}

.skill-progress {
  grid-column: 2 / 4;
  height: 0.24rem;
  overflow: hidden;
  background: rgba(0,0,0,.5);
}

.skill-progress span {
  display: block;
  height: 100%;
  background: linear-gradient(90deg, var(--indigo), var(--teal));
}

.quest-card {
  margin-bottom: 0.65rem;
  padding: 0.75rem;
  border: 1px solid rgba(158,172,187,.14);
  background: rgba(1,5,9,.27);
}

.quest-card.is-ready {
  border-color: rgba(113,197,138,.5);
}

.quest-card.is-completed {
  opacity: 0.62;
}

.quest-card header {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.quest-card h3 {
  margin: 0;
  color: var(--gold);
  font-family: var(--display-font);
  font-size: 0.92rem;
  font-weight: 400;
}

.quest-status {
  color: var(--muted);
  font-size: 0.48rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.quest-card > p {
  margin: 0.45rem 0 0.65rem;
  color: #b8c2c8;
  font-size: 0.6rem;
  line-height: 1.5;
}

.reward-row {
  display: flex;
  gap: 0.8rem;
  margin-top: 0.6rem;
  color: var(--gold-soft);
  font-size: 0.53rem;
}

.bank-columns {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.8rem;
}

.bank-column {
  min-width: 0;
}

.bank-column .inventory-grid {
  grid-template-columns: repeat(3, 1fr);
}

.bank-money {
  margin-bottom: 1rem;
  padding: 0.8rem;
  border: 1px solid rgba(155,120,56,.28);
  background: rgba(155,120,56,.055);
}

.bank-balances {
  display: flex;
  justify-content: space-between;
  margin-bottom: 0.65rem;
  color: #d6d9d5;
  font-size: 0.62rem;
}

.bank-balances b {
  color: var(--gold);
  font-family: var(--display-font);
  font-weight: 400;
}

.bank-money-row {
  display: grid;
  grid-template-columns: 1fr auto auto;
  gap: 0.35rem;
}

.bank-money-row input {
  height: 2rem;
}

.shop-list {
  display: grid;
  gap: 0.45rem;
}

.shop-row {
  display: grid;
  grid-template-columns: 2.5rem 1fr auto;
  gap: 0.65rem;
  align-items: center;
  padding: 0.55rem;
  border: 1px solid rgba(158,172,187,.13);
  background: rgba(1,5,9,.25);
}

.shop-row > span {
  display: grid;
  width: 2.4rem;
  height: 2.4rem;
  border: 1px solid var(--rarity);
  color: var(--rarity);
  place-items: center;
}

.shop-row strong,
.shop-row small {
  display: block;
}

.shop-row strong {
  font-family: var(--display-font);
  font-size: 0.7rem;
  font-weight: 400;
}

.shop-row small {
  margin-top: 0.12rem;
  color: var(--muted);
  font-size: 0.5rem;
}

.world-map {
  position: relative;
  min-height: 100%;
  overflow: hidden;
  border: 1px solid rgba(155,120,56,.3);
  background: #07101a url("../img/world-map.png") center / contain no-repeat;
}

.world-map::after {
  content: "";
  display: block;
  padding-top: 66.666%;
}

.map-tour {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.45rem;
}

.map-tour .small-button {
  justify-content: center;
}

.map-tour .small-button.is-current {
  border-color: var(--teal);
  color: var(--teal-bright);
  box-shadow: inset 0 0 12px rgba(99,229,215,.12);
}

.map-marker {
  position: absolute;
  display: grid;
  width: 1.4rem;
  height: 1.4rem;
  transform: translate(-50%, -50%) rotate(45deg);
  border: 2px solid var(--gold);
  color: #091225;
  background: var(--gold);
  box-shadow: 0 0 16px rgba(242,195,91,.7);
  place-items: center;
}

.map-marker::after {
  content: "";
  width: 0.42rem;
  height: 0.42rem;
  transform: rotate(-45deg);
  border-radius: 50%;
  background: #091225;
}

.map-legend {
  position: absolute;
  right: 0.5rem;
  bottom: 0.5rem;
  left: 0.5rem;
  display: flex;
  gap: 0.35rem;
  flex-wrap: wrap;
  justify-content: center;
}

.map-legend span {
  padding: 0.3rem 0.45rem;
  border: 1px solid rgba(215,213,200,.14);
  color: #d8dede;
  background: rgba(5,10,17,.78);
  font-size: 0.48rem;
}

.settings-list {
  display: grid;
  gap: 0.55rem;
}

.setting-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.65rem 0.7rem;
  border: 1px solid rgba(158,172,187,.13);
  background: rgba(1,5,9,.25);
}

.setting-row strong,
.setting-row small {
  display: block;
}

.setting-row strong {
  font-family: var(--display-font);
  font-size: 0.72rem;
  font-weight: 400;
}

.setting-row small {
  margin-top: 0.12rem;
  color: var(--muted);
  font-size: 0.5rem;
}

.toggle {
  position: relative;
  width: 2.6rem;
  height: 1.3rem;
  border: 1px solid rgba(158,172,187,.24);
  border-radius: 99px;
  background: #151d26;
  cursor: pointer;
}

.toggle::after {
  content: "";
  position: absolute;
  top: 0.17rem;
  left: 0.18rem;
  width: 0.84rem;
  height: 0.84rem;
  border-radius: 50%;
  background: #7d8992;
  transition: left 130ms ease, background 130ms ease;
}

.toggle.is-on {
  border-color: rgba(99,229,215,.5);
  background: rgba(99,229,215,.12);
}

.toggle.is-on::after {
  left: 1.46rem;
  background: var(--teal);
}

.controls-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.35rem;
  margin-top: 0.7rem;
}

.control-line {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.45rem;
  color: var(--muted);
  font-size: 0.55rem;
  background: rgba(255,255,255,.02);
}

/* Dialogue, notifications and death */

.modal-backdrop {
  position: absolute;
  z-index: 50;
  inset: 0;
  background: rgba(2,5,9,.36);
  backdrop-filter: blur(2px);
}

.dialogue-modal {
  position: absolute;
  z-index: 51;
  right: 50%;
  bottom: 3rem;
  display: grid;
  grid-template-columns: 7rem 1fr;
  gap: 1.2rem;
  width: min(42rem, calc(100vw - 2rem));
  padding: 1.1rem;
  transform: translateX(50%);
  animation: dialogueIn 180ms cubic-bezier(.2,.8,.2,1);
}

.dialogue-portrait {
  display: grid;
  min-height: 9rem;
  border: 1px solid rgba(155,120,56,.6);
  color: var(--teal);
  background:
    radial-gradient(circle at 50% 38%, rgba(99,229,215,.2), transparent 45%),
    linear-gradient(160deg, #26364e, #070c14);
  font-family: var(--display-font);
  font-size: 3.2rem;
  text-shadow: 0 0 24px rgba(99,229,215,.55);
  place-items: center;
}

.dialogue-copy {
  min-width: 0;
}

.dialogue-copy > small {
  color: var(--gold-soft);
  font-size: 0.53rem;
  letter-spacing: 0.13em;
  text-transform: uppercase;
}

.dialogue-copy h2 {
  margin: 0.2rem 0 0.55rem;
  font-family: var(--display-font);
  font-size: 1.25rem;
  font-weight: 400;
}

.dialogue-copy p {
  margin: 0;
  color: #c4cdd2;
  font-family: var(--display-font);
  font-size: 0.78rem;
  line-height: 1.62;
}

.dialogue-actions {
  display: flex;
  gap: 0.5rem;
  margin-top: 1rem;
}

.dialogue-actions .primary-button {
  width: auto;
  min-height: 2.3rem;
  padding: 0.55rem 0.9rem;
  font-size: 0.68rem;
}

.dialogue-close {
  position: absolute;
  top: 0.55rem;
  right: 0.55rem;
}

.toast-stack {
  position: absolute;
  z-index: 80;
  top: 7rem;
  left: 50%;
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
  align-items: center;
  width: min(25rem, calc(100vw - 2rem));
  pointer-events: none;
  transform: translateX(-50%);
}

.toast {
  min-width: 14rem;
  padding: 0.65rem 0.9rem;
  border: 1px solid rgba(155,120,56,.55);
  color: #e9edeb;
  background: rgba(6,11,19,.93);
  box-shadow: var(--shadow);
  font-size: 0.65rem;
  text-align: center;
  animation: toastIn 180ms ease;
}

.toast.is-success {
  border-color: rgba(113,197,138,.65);
}

.toast.is-error {
  border-color: rgba(214,83,93,.7);
}

.toast strong {
  color: var(--gold);
}

.game-tooltip {
  position: fixed;
  z-index: 100;
  width: 14rem;
  padding: 0.65rem;
  pointer-events: none;
  border: 1px solid rgba(155,120,56,.65);
  color: #c7d0d3;
  background: rgba(5,9,16,.96);
  box-shadow: var(--shadow);
  font-size: 0.6rem;
  line-height: 1.45;
}

.game-tooltip strong {
  display: block;
  margin-bottom: 0.22rem;
  color: var(--gold);
  font-family: var(--display-font);
  font-size: 0.78rem;
  font-weight: 400;
}

.death-overlay {
  position: absolute;
  z-index: 90;
  inset: 0;
  display: grid;
  color: #d9d7d1;
  background: radial-gradient(circle, rgba(83,19,47,.42), rgba(2,4,8,.92));
  backdrop-filter: grayscale(1) blur(3px);
  place-items: center;
  text-align: center;
}

.death-overlay > div {
  width: min(24rem, calc(100vw - 2rem));
}

.death-overlay > div > span {
  color: var(--danger);
  font-size: 3rem;
  text-shadow: 0 0 22px rgba(214,83,93,.6);
}

.death-overlay h2 {
  margin: 0.5rem 0;
  font-family: var(--display-font);
  font-size: 2rem;
  font-weight: 400;
}

.death-overlay p {
  margin: 0 0 1.4rem;
  color: var(--muted);
  font-size: 0.72rem;
}

.mobile-controls {
  display: none;
}

@keyframes spin { to { transform: rotate(360deg); } }
@keyframes spinReverse { to { transform: rotate(-360deg); } }
@keyframes panelIn {
  from { opacity: 0; transform: translateX(12px); }
  to { opacity: 1; transform: translateX(0); }
}
@keyframes dialogueIn {
  from { opacity: 0; transform: translate(50%, 14px); }
  to { opacity: 1; transform: translate(50%, 0); }
}
@keyframes toastIn {
  from { opacity: 0; transform: translateY(-8px); }
  to { opacity: 1; transform: translateY(0); }
}

@media (max-width: 1120px) {
  .title-content {
    grid-template-columns: minmax(0, 1fr) minmax(21rem, 25rem);
    gap: 3rem;
  }

  .title-copy h1 {
    font-size: clamp(3.2rem, 7vw, 5rem);
  }

  .hud-navigation button {
    min-width: 3.15rem;
  }

  .hud-navigation button small {
    display: none;
  }

  .chat-panel {
    width: 16rem;
  }

  .quest-tracker {
    width: 16rem;
  }
}

@media (max-width: 820px) {
  .title-screen {
    background-position: 38% center;
  }

  .title-header,
  .character-header,
  .title-content,
  .character-content {
    width: calc(100% - 2rem);
  }

  .title-content {
    display: block;
    padding: 2rem 0 6rem;
  }

  .title-copy {
    margin-bottom: 2rem;
  }

  .title-copy h1 {
    font-size: clamp(3.2rem, 16vw, 5rem);
  }

  .auth-card {
    max-width: 30rem;
  }

  .title-footer {
    right: 1rem;
    left: 1rem;
  }

  .character-art {
    background-position: 62% center;
  }

  .character-shade {
    background: rgba(3,7,13,.72);
  }

  .character-form-area {
    width: 100%;
    max-height: none;
  }

  .hud-character {
    top: 0.5rem;
    left: 0.5rem;
    width: 15.5rem;
  }

  .quest-tracker,
  .currency-strip,
  .hud-navigation kbd {
    display: none;
  }

  .minimap-shell {
    top: 0.45rem;
    right: 0.35rem;
    transform: scale(.72);
    transform-origin: top right;
  }

  .chat-panel {
    bottom: 6.5rem;
    left: 0.5rem;
    width: 15rem;
  }

  .chat-messages {
    max-height: 5rem;
  }

  .hotbar-shell {
    bottom: 0.55rem;
    padding: 0.28rem;
  }

  .ability {
    width: 3.15rem;
    height: 3.15rem;
  }

  .ability-art {
    font-size: 1.3rem;
  }

  .ability small {
    display: none;
  }

  .hud-navigation {
    top: auto;
    right: 0.5rem;
    bottom: 0.55rem;
  }

  .hud-navigation button:nth-child(-n+4) {
    display: none;
  }

  .interaction-prompt,
  .action-progress {
    bottom: 5.4rem;
  }

  .side-panel {
    top: 0.5rem;
    right: 0.5rem;
    bottom: 4.5rem;
    width: calc(100vw - 1rem);
  }

  .dialogue-modal {
    bottom: 0.5rem;
    grid-template-columns: 4rem 1fr;
    gap: 0.8rem;
  }

  .dialogue-portrait {
    min-height: 7rem;
    font-size: 2rem;
  }

  .mobile-controls {
    position: absolute;
    z-index: 18;
    right: 0;
    bottom: 0;
    left: 0;
    display: block;
    pointer-events: none;
  }

  .joystick {
    position: absolute;
    bottom: 5.8rem;
    left: 1rem;
    width: 5.4rem;
    height: 5.4rem;
    border: 1px solid rgba(215,213,200,.2);
    border-radius: 50%;
    background: rgba(5,10,17,.42);
    pointer-events: auto;
    touch-action: none;
  }

  .joystick span {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 2.25rem;
    height: 2.25rem;
    transform: translate(-50%, -50%);
    border: 1px solid rgba(99,229,215,.45);
    border-radius: 50%;
    background: rgba(99,229,215,.12);
    box-shadow: 0 0 16px rgba(99,229,215,.14);
  }

  #mobileInteract,
  #mobileAttack {
    position: absolute;
    right: 1rem;
    bottom: 6rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: 4.2rem;
    height: 4.2rem;
    border: 1px solid rgba(242,195,91,.55);
    border-radius: 50%;
    color: var(--gold);
    background: rgba(5,10,17,.72);
    pointer-events: auto;
  }

  #mobileAttack {
    right: 5.7rem;
    bottom: 4.3rem;
    color: #ef8e75;
    border-color: rgba(214,83,93,.55);
  }

  #mobileInteract small,
  #mobileAttack small {
    font-size: 0.42rem;
    text-transform: uppercase;
  }

  .zone-banner {
    top: 6rem;
  }
}

@media (max-width: 520px) {
  .title-header {
    padding-top: 1rem;
  }

  .server-pill {
    padding: 0.45rem;
  }

  .server-pill span:last-child {
    display: none;
  }

  .title-content {
    padding-top: 1rem;
  }

  .title-copy h1 {
    margin-bottom: 0.8rem;
    font-size: 3.35rem;
  }

  .title-copy > p:not(.eyebrow) {
    font-size: 0.8rem;
    line-height: 1.55;
  }

  .world-features {
    margin-top: 1.3rem;
  }

  .auth-card {
    padding: 1rem;
  }

  .origin-choices {
    grid-template-columns: 1fr;
  }

  .hud-character {
    width: 13.7rem;
    height: 4.6rem;
  }

  .portrait-frame {
    flex-basis: 3.35rem;
    width: 3.35rem;
    height: 3.35rem;
  }

  .character-line span {
    display: none;
  }

  .minimap-shell {
    transform: scale(.58);
  }

  .chat-panel {
    display: none;
  }

  .hud-navigation {
    display: none;
  }

  .ability {
    width: 2.75rem;
    height: 2.75rem;
  }

  .ability kbd {
    display: none;
  }

  .interaction-prompt,
  .action-progress {
    bottom: 4.3rem;
  }

  .bank-columns {
    grid-template-columns: 1fr;
  }

  .inventory-grid {
    grid-template-columns: repeat(4, 1fr);
  }

  .dialogue-modal {
    display: block;
  }

  .dialogue-portrait {
    float: left;
    width: 3.5rem;
    min-height: 3.5rem;
    margin: 0 0.7rem 0.4rem 0;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
