@import url("https://fonts.googleapis.com/css2?family=Cinzel:wght@400;500;600;700;800&family=DM+Sans:wght@400;500;600;700&display=swap");
:root {
  font-family: "DM Sans", sans-serif;
  color: #e9e1d6;
  background: #100d12;
  font-synthesis: none;
  text-rendering: optimizeLegibility;
  --bg: #100d12;
  --panel: #17131a;
  --panel-2: #1d1820;
  --panel-3: #26202a;
  --line: #3a3039;
  --text: #e9e1d6;
  --muted: #9b8e99;
  --gold: #c4a46a;
  --gold-bright: #ead19a;
  --red: #b75a62;
  --green: #8ca88b;
  --blue: #849fce;
  --font-display: "Cinzel", Georgia, serif;
  --font-body: "DM Sans", sans-serif;
  color-scheme: dark;
}
* {
  box-sizing: border-box;
}
html,
body,
#app {
  margin: 0;
  min-height: 100%;
  width: 100%;
}
body {
  min-width: 320px;
  background: var(--bg);
}
button,
input,
select {
  font: inherit;
}
button {
  cursor: pointer;
}
button:disabled {
  opacity: 0.38;
  cursor: not-allowed;
  filter: grayscale(0.5);
}
button:focus-visible,
input:focus-visible,
select:focus-visible {
  outline: 2px solid var(--gold-bright);
  outline-offset: 3px;
}
button:active:not(:disabled) {
  transform: translateY(1px);
}
.muted {
  color: var(--muted);
}
.small {
  font-size: 0.76rem;
  line-height: 1.55;
}
.eyebrow {
  font: 600 0.65rem var(--font-body);
  letter-spacing: 0.2em;
  color: var(--gold);
  text-transform: uppercase;
}
.version {
  font-size: 0.62rem;
  letter-spacing: 0.12em;
  color: #756975;
}
.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  border: 1px solid var(--line);
  padding: 0.82rem 1.05rem;
  color: var(--text);
  background: #211b23;
  transition:
    background 0.2s,
    border-color 0.2s,
    color 0.2s;
  text-align: center;
}
.button:hover:not(:disabled) {
  border-color: var(--gold);
  background: #2b222a;
}
.button span {
  color: var(--gold);
}
.button-primary {
  background: var(--gold);
  border-color: var(--gold);
  color: #171118;
  font-weight: 700;
}
.button-primary span {
  color: #171118;
}
.button-primary:hover:not(:disabled) {
  background: var(--gold-bright);
  color: #171118;
}
.button-outline {
  background: transparent;
  border-color: #65545f;
}
.button-quiet {
  background: transparent;
}
.button-large {
  min-height: 54px;
  padding: 1rem 1.35rem;
  font-size: 0.85rem;
}
.button-small {
  padding: 0.55rem 0.7rem;
  font-size: 0.72rem;
  gap: 0.35rem;
}
.full-width {
  width: 100%;
}
.text-button {
  border: 0;
  background: transparent;
  color: var(--gold);
  font-size: 0.72rem;
  padding: 0.4rem 0;
}
.text-button:hover {
  color: var(--gold-bright);
}
.icon-button {
  display: inline-grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border: 1px solid var(--line);
  background: var(--panel);
  color: #c9bac7;
  font-size: 1.1rem;
}
.icon-button:hover {
  border-color: var(--gold);
  color: var(--gold);
}
/* Title screen */
.title-screen {
  position: relative;
  min-height: 100vh;
  overflow: hidden;
  display: grid;
  grid-template-columns: minmax(300px, 1fr) minmax(360px, 1fr);
  grid-template-rows: 58px 1fr;
  padding: 0 clamp(1.2rem, 5vw, 5.5rem);
  background: radial-gradient(
    ellipse at 25% 48%,
    #30202c 0,
    #18121b 42%,
    #0d0b10 76%
  );
}
.title-topline {
  grid-column: 1/-1;
  display: flex;
  align-items: center;
  gap: 1rem;
  border-bottom: 1px solid #3a2b36;
  color: #938390;
  font-size: 0.63rem;
  letter-spacing: 0.17em;
  z-index: 2;
}
.sigil,
.brand-sigil {
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border: 1px solid var(--gold);
  color: var(--gold);
  font: 600 0.8rem var(--font-display);
  letter-spacing: -0.08em;
}
.title-topline .version {
  margin-left: auto;
}
.title-copy {
  grid-column: 1;
  grid-row: 2;
  align-self: center;
  max-width: 650px;
  padding: 3rem 0 4.5rem;
  z-index: 2;
}
.title-copy h1,
.setup-heading h1 {
  font: 500 clamp(3.4rem, 7vw, 6.8rem)/0.98 var(--font-display);
  letter-spacing: -0.065em;
  margin: 1.1rem 0;
  color: #f0e6da;
}
.title-copy h1 span {
  display: block;
  color: var(--gold);
  font-size: 1.04em;
}
.tagline {
  font: 500 clamp(0.9rem, 1.4vw, 1.12rem) var(--font-display);
  color: #c8b9c1;
  letter-spacing: 0.025em;
  margin: 1.7rem 0 0.85rem;
}
.intro-copy {
  color: #978a96;
  font-size: 0.86rem;
  line-height: 1.9;
  max-width: 400px;
}
.title-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-top: 2rem;
}
.title-foot {
  display: flex;
  align-items: center;
  gap: 1.2rem;
  flex-wrap: wrap;
  margin-top: 4.5rem;
  padding-top: 1.2rem;
  border-top: 1px solid #3a2b36;
  color: #7f707e;
  font-size: 0.57rem;
  letter-spacing: 0.11em;
}
.title-foot .text-button {
  margin-left: auto;
}
.title-art {
  grid-column: 2;
  grid-row: 2;
  position: relative;
  min-height: 650px;
  align-self: stretch;
  overflow: hidden;
  isolation: isolate;
}
.title-art:before {
  content: "";
  position: absolute;
  inset: 10% 0 0;
  background: radial-gradient(
    ellipse at 50% 58%,
    #6c3e46 0,
    #30202d 22%,
    transparent 61%
  );
  opacity: 0.75;
}
.moon {
  position: absolute;
  width: min(27vw, 330px);
  aspect-ratio: 1;
  border-radius: 50%;
  left: 50%;
  top: 17%;
  transform: translateX(-50%);
  background: radial-gradient(
    circle at 36% 30%,
    #f0d9b0,
    #b88c79 38%,
    #694453 69%,
    #211824 72%
  );
  box-shadow:
    0 0 70px #c18b6a33,
    0 0 150px #8c4f6833;
  opacity: 0.75;
}
.mountain {
  position: absolute;
  bottom: 0;
  width: 120%;
  height: 56%;
  left: -10%;
  clip-path: polygon(
    0 72%,
    10% 58%,
    19% 69%,
    31% 35%,
    41% 60%,
    53% 21%,
    67% 62%,
    78% 34%,
    90% 63%,
    100% 50%,
    100% 100%,
    0 100%
  );
}
.mountain-back {
  background: #211923;
  bottom: 7%;
  filter: drop-shadow(0 -4px 20px #a05e6833);
}
.mountain-front {
  background: linear-gradient(150deg, #17131b, #0b090d 70%);
  height: 44%;
  clip-path: polygon(
    0 53%,
    17% 43%,
    28% 57%,
    43% 25%,
    55% 54%,
    67% 38%,
    81% 59%,
    100% 33%,
    100% 100%,
    0 100%
  );
}
.crown-mark {
  position: absolute;
  top: 35%;
  left: 50%;
  transform: translate(-50%, -50%);
  font-size: clamp(6rem, 13vw, 12rem);
  line-height: 1;
  color: #d2b77e;
  text-shadow:
    0 0 18px #d5a56e44,
    0 0 60px #b35c7244;
  opacity: 0.92;
}
.art-rune {
  position: absolute;
  color: #c4a46a;
  opacity: 0.7;
  font-size: 1.2rem;
}
.rune-one {
  top: 25%;
  left: 18%;
}
.rune-two {
  top: 54%;
  right: 13%;
  font-size: 2rem;
}
.rune-three {
  top: 68%;
  left: 22%;
}
/* Character creation */
.setup-screen {
  max-width: 1440px;
  margin: auto;
  padding: 0 clamp(1rem, 4vw, 4rem) 4rem;
}
.simple-header {
  height: 64px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--line);
}
.setup-heading {
  text-align: center;
  padding: 3.5rem 0 2.3rem;
}
.setup-heading h1 {
  font-size: clamp(2.8rem, 5vw, 4.4rem);
  margin: 0.8rem 0;
}
.setup-heading > p:last-child {
  color: var(--muted);
  font-size: 0.9rem;
}
.class-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 0.8rem;
}
.class-card {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  text-align: left;
  min-height: 300px;
  padding: 1.1rem;
  border: 1px solid #3b303b;
  background: linear-gradient(150deg, #1c1720, #151118);
  color: var(--text);
  transition:
    border-color 0.2s,
    transform 0.2s,
    background 0.2s;
}
.class-card:hover {
  border-color: #8a6c63;
  transform: translateY(-3px);
}
.class-card.selected {
  border-color: var(--gold);
  background: linear-gradient(150deg, #30242a, #1a151c);
  box-shadow: inset 0 0 0 1px #c4a46a2b;
}
.class-icon {
  display: grid;
  place-items: center;
  width: 50px;
  height: 50px;
  border: 1px solid #51404a;
  background: #231b26;
  color: var(--gold);
  font-size: 1.6rem;
  margin-bottom: 1.3rem;
}
.class-role {
  font-size: 0.58rem;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--gold);
}
.class-card > strong {
  font: 600 1.3rem var(--font-display);
  margin: 0.5rem 0;
}
.class-epithet {
  color: #b3a4b0;
  font-size: 0.68rem;
  min-height: 2.2em;
}
.class-description {
  font-size: 0.72rem;
  line-height: 1.7;
  color: #8f828f;
  margin: 1rem 0;
  flex: 1;
}
.class-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  color: #c6b6c1;
  font-size: 0.62rem;
  border-top: 1px solid var(--line);
  padding-top: 0.8rem;
  width: 100%;
}
.character-bottom {
  max-width: 700px;
  margin: 2.2rem auto 0;
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.75rem;
}
.field-label {
  font-size: 0.65rem;
  letter-spacing: 0.16em;
  color: var(--gold);
}
.field-label span {
  color: var(--muted);
  letter-spacing: 0;
}
.character-bottom input {
  width: 100%;
  padding: 0.95rem 1rem;
  background: #19141b;
  border: 1px solid var(--line);
  color: var(--text);
}
.selected-ability {
  display: flex;
  gap: 1rem;
  padding: 1rem;
  border: 1px solid var(--line);
  background: #17131a;
  margin: 0.5rem 0 1rem;
}
.ability-symbol {
  font-size: 1.6rem;
  color: var(--gold);
}
.selected-ability strong {
  display: block;
  font: 600 1rem var(--font-display);
  margin: 0.4rem 0;
}
.selected-ability p {
  font-size: 0.78rem;
  color: var(--muted);
  line-height: 1.6;
  margin: 0.3rem 0;
}
.character-bottom > .button {
  width: 100%;
}
/* Game layout */
.game-shell {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: var(--bg);
}
.game-header {
  height: 64px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0 clamp(1rem, 2.5vw, 2.5rem);
  border-bottom: 1px solid var(--line);
  background: #130f15;
}
.brand-lockup {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  border: 0;
  background: transparent;
  color: var(--text);
  text-align: left;
  padding: 0;
}
.brand-lockup > span:last-child {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
}
.brand-lockup strong {
  font: 600 0.75rem var(--font-display);
  letter-spacing: 0.1em;
}
.brand-lockup small {
  font-size: 0.56rem;
  color: var(--muted);
  letter-spacing: 0.17em;
}
.brand-sigil {
  width: 34px;
  height: 34px;
}
.header-center {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  font-size: 0.68rem;
  letter-spacing: 0.14em;
  color: #b6a6b4;
}
.live-dot {
  display: inline-block;
  width: 6px;
  height: 6px;
  background: #9cae85;
  border-radius: 50%;
  box-shadow: 0 0 9px #9cae8588;
}
.header-divider {
  color: #5e4c5b;
}
.header-actions {
  display: flex;
  gap: 0.45rem;
}
.game-layout {
  display: grid;
  grid-template-columns: 245px minmax(350px, 1fr) 225px;
  gap: 0;
  flex: 1;
  min-height: calc(100vh - 106px);
}
.left-rail,
.right-rail {
  padding: 1.25rem 1rem;
  background: #151118;
  min-width: 0;
}
.left-rail {
  border-right: 1px solid var(--line);
}
.right-rail {
  border-left: 1px solid var(--line);
}
.panel-label {
  display: flex;
  justify-content: space-between;
  align-items: center;
  color: #a495a3;
  font-size: 0.59rem;
  letter-spacing: 0.15em;
  font-weight: 700;
}
.panel-label span {
  color: #665663;
  font-size: 0.55rem;
}
.hero-avatar {
  position: relative;
  display: grid;
  place-items: center;
  width: 92px;
  height: 92px;
  margin: 1.4rem auto 0.7rem;
  border: 1px solid #5b4650;
  border-radius: 50%;
  background: radial-gradient(circle, #3d2936, #211722 62%, #17121a);
  color: var(--gold);
  font-size: 2.8rem;
}
.hero-avatar:before {
  content: "";
  position: absolute;
  inset: 7px;
  border: 1px solid #7a5d5a;
  border-radius: 50%;
}
.avatar-glow {
  position: absolute;
  inset: -10px;
  border-radius: 50%;
  background: #9c5a6522;
  filter: blur(13px);
}
.hero-avatar small {
  position: absolute;
  bottom: -5px;
  background: #30222a;
  border: 1px solid #6d5258;
  color: var(--gold-bright);
  padding: 0.25rem 0.45rem;
  font-size: 0.56rem;
  letter-spacing: 0.1em;
}
.hero-name {
  text-align: center;
  font: 600 1.2rem var(--font-display);
  margin: 0.6rem 0 0.35rem;
}
.hero-class {
  text-align: center;
  color: #9e8b9c;
  font-size: 0.58rem;
  letter-spacing: 0.1em;
  line-height: 1.6;
  margin: 0 0 1.6rem;
}
.stat-block {
  margin: 1.1rem 0;
}
.stat-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.4rem;
  font-size: 0.57rem;
  color: #a495a3;
  letter-spacing: 0.1em;
}
.stat-heading strong {
  font-size: 0.7rem;
  color: #e3d8df;
  letter-spacing: 0;
}
.stat-heading i {
  font-style: normal;
  font-weight: 400;
  color: #817380;
}
.meter {
  height: 5px;
  background: #302630;
  overflow: hidden;
  margin-top: 0.5rem;
}
.meter span {
  display: block;
  height: 100%;
  transition: width 0.25s ease;
}
.hp-meter span {
  background: linear-gradient(90deg, #8d3e4a, #d16c70);
}
.mana-meter span {
  background: linear-gradient(90deg, #455e9a, #8aa9e3);
}
.xp-meter span {
  background: linear-gradient(90deg, #887046, #e1c37f);
}
.quick-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.3rem;
  padding: 0.85rem 0.1rem;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  margin: 1.35rem 0;
}
.quick-stats > div {
  display: flex;
  align-items: center;
  flex-direction: column;
  gap: 0.3rem;
}
.quick-stats span {
  color: var(--gold);
  font-size: 0.9rem;
}
.quick-stats small {
  font-size: 0.5rem;
  color: var(--muted);
  letter-spacing: 0.06em;
}
.quick-stats strong {
  font-size: 0.8rem;
}
.inventory-mini {
  margin: 1.4rem 0;
}
.inventory-mini .panel-label {
  margin-bottom: 0.8rem;
}
.gear-row {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  margin: 0.65rem 0;
}
.gear-icon {
  display: grid;
  place-items: center;
  flex-shrink: 0;
  width: 37px;
  height: 37px;
  border: 1px solid #4b3a49;
  background: #211923;
  color: var(--gold);
  font-size: 1.15rem;
}
.armor-icon {
  color: #9ba9c6;
}
.gear-row > span:last-child {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  min-width: 0;
}
.gear-row small,
.inventory-item small {
  font-size: 0.52rem;
  letter-spacing: 0.1em;
  color: #8c7b8b;
}
.gear-row strong {
  font-size: 0.7rem;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.gear-row em {
  font-size: 0.6rem;
  color: #8b7a88;
  font-style: normal;
}
.left-rail > .button {
  font-size: 0.7rem;
  padding: 0.75rem 0.6rem;
}
.dungeon-main {
  min-width: 0;
  padding: 1.3rem clamp(0.9rem, 2vw, 2rem) 1.5rem;
  max-width: 1000px;
  width: 100%;
  margin: 0 auto;
}
.dungeon-overline {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.8rem;
}
.floor-chip {
  border: 1px solid #5a444e;
  padding: 0.35rem 0.6rem;
  color: var(--gold);
  font-size: 0.62rem;
  letter-spacing: 0.13em;
}
.scene-panel {
  position: relative;
  isolation: isolate;
  min-height: 270px;
  height: clamp(270px, 32vh, 380px);
  overflow: hidden;
  border: 1px solid #4a3542;
  background: radial-gradient(
    ellipse at 50% 42%,
    #51303a 0,
    #2b1d2a 28%,
    #19131d 64%,
    #0d0b10 100%
  );
}
.scene-panel:before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, #1b121b22, #0b090d88);
  z-index: -1;
}
.scene-grain {
  position: absolute;
  inset: 0;
  opacity: 0.18;
  background-image: radial-gradient(#bfa08d 0.6px, transparent 0.7px);
  background-size: 9px 9px;
  mask-image: linear-gradient(transparent, #000);
}
.scene-orb {
  position: absolute;
  width: 160px;
  height: 160px;
  border-radius: 50%;
  top: 4%;
  left: 50%;
  transform: translateX(-50%);
  background: radial-gradient(
    circle,
    #e1b990 0,
    #a15b68 36%,
    #6b394d 61%,
    transparent 72%
  );
  opacity: 0.48;
  filter: blur(2px);
}
.scene-arch {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  border: 10px solid #3c2935;
  border-bottom: 0;
  border-radius: 50% 50% 0 0;
  box-shadow:
    inset 0 0 22px #0b090d,
    0 0 0 1px #8c5d6040;
}
.arch-outer {
  width: 52%;
  height: 80%;
  top: 10%;
  border-width: 15px;
}
.arch-inner {
  width: 34%;
  height: 64%;
  top: 22%;
  border-width: 8px;
  border-color: #241b27;
}
.scene-floor {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 34%;
  background: linear-gradient(180deg, #17111a00, #0a080cdd 75%);
  clip-path: polygon(
    0 42%,
    15% 22%,
    35% 54%,
    50% 12%,
    66% 49%,
    85% 22%,
    100% 40%,
    100% 100%,
    0 100%
  );
}
.scene-symbol {
  position: absolute;
  top: 37%;
  left: 50%;
  transform: translate(-50%, -50%);
  font-size: clamp(3.5rem, 7vw, 6rem);
  color: #d7b785;
  text-shadow:
    0 0 24px #d3a46d66,
    0 0 60px #b55d7066;
  z-index: 1;
}
.in-combat .scene-symbol {
  color: #d38b8d;
  text-shadow:
    0 0 25px #ce4f6066,
    0 0 60px #bd3f5466;
}
.scene-caption {
  position: absolute;
  left: 1rem;
  right: 1rem;
  bottom: 1.1rem;
  text-align: center;
  z-index: 2;
}
.scene-caption > span {
  font-size: 0.54rem;
  letter-spacing: 0.2em;
  color: var(--gold);
}
.scene-caption h2 {
  font: 500 clamp(1.15rem, 2.4vw, 1.8rem) var(--font-display);
  margin: 0.35rem 0;
  color: #f1e6da;
  text-shadow: 0 2px 8px #000;
}
.scene-caption p {
  font-size: 0.7rem;
  color: #b3a1ad;
  margin: 0.25rem auto 0;
  max-width: 420px;
  line-height: 1.5;
}
.scene-coordinate {
  position: absolute;
  top: 0.8rem;
  left: 0.9rem;
  font-size: 0.5rem;
  letter-spacing: 0.14em;
  color: #8b7587;
}
.scene-coordinate span {
  color: var(--gold);
}
.enemy-strip {
  display: grid;
  grid-template-columns: minmax(140px, 1fr) minmax(150px, 1.2fr);
  gap: 1rem;
  padding: 0.85rem 1rem;
  background: #1c151e;
  border: 1px solid #4a303a;
  border-top: 0;
}
.enemy-identity {
  display: flex;
  align-items: center;
  gap: 0.8rem;
  min-width: 0;
}
.enemy-glyph {
  display: grid;
  place-items: center;
  width: 43px;
  height: 43px;
  border: 1px solid #6b3e48;
  background: #2a1a24;
  color: #d58d8b;
  font-size: 1.6rem;
}
.enemy-identity > div {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  min-width: 0;
}
.enemy-identity strong {
  font: 500 0.95rem var(--font-display);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.enemy-vitals {
  align-self: center;
}
.enemy-meter span {
  background: linear-gradient(90deg, #812f40, #c75b66);
}
.status-list {
  display: flex;
  gap: 0.35rem;
  flex-wrap: wrap;
  margin-top: 0.4rem;
}
.status-pill {
  font-size: 0.54rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: #d5a7a1;
  border: 1px solid #71404a;
  padding: 0.2rem 0.35rem;
}
.room-summary {
  display: flex;
  align-items: center;
  gap: 0.8rem;
  padding: 0.9rem 1rem;
  background: #19141b;
  border: 1px solid var(--line);
  border-top: 0;
}
.summary-mark {
  font-size: 1.5rem;
  color: var(--gold);
}
.room-summary strong {
  display: block;
  font: 500 0.9rem var(--font-display);
  margin: 0.2rem 0;
}
.room-summary p {
  margin: 0;
  font-size: 0.69rem;
  color: var(--muted);
  line-height: 1.5;
}
.game-over-banner {
  display: flex;
  align-items: center;
  gap: 0.8rem;
  padding: 1rem;
  background: #25151b;
  border: 1px solid #63343d;
}
.game-over-banner > span {
  font-size: 2rem;
  color: var(--red);
}
.game-over-banner > div {
  flex: 1;
}
.game-over-banner strong {
  font: 500 0.95rem var(--font-display);
}
.game-over-banner p {
  font-size: 0.7rem;
  color: var(--muted);
  line-height: 1.5;
  margin: 0.3rem 0;
}
.game-over-banner .button {
  font-size: 0.68rem;
}
.action-area {
  margin-top: 1.4rem;
}
.action-area > .panel-label {
  margin-bottom: 0.7rem;
}
.combat-actions {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.55rem;
}
.action-card {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  text-align: left;
  gap: 0.4rem;
  min-height: 115px;
  padding: 0.85rem 0.75rem;
  border: 1px solid #3e303f;
  background: linear-gradient(150deg, #211923, #18131b);
  color: var(--text);
  transition:
    border-color 0.2s,
    background 0.2s;
}
.action-card:hover:not(:disabled) {
  border-color: #a07c6c;
  background: #2b2029;
}
.action-card.primary-action {
  border-color: #92744d;
  background: linear-gradient(145deg, #392b2a, #241b23);
}
.action-icon {
  color: var(--gold);
  font-size: 1.25rem;
}
.action-card strong {
  font-size: 0.72rem;
  line-height: 1.3;
}
.action-card small {
  font-size: 0.58rem;
  color: #9a8b99;
  line-height: 1.45;
}
.action-card kbd {
  position: absolute;
  right: 0.5rem;
  top: 0.45rem;
  font-size: 0.55rem;
  color: #756476;
  border: 1px solid #4b3a4b;
  padding: 0.1rem 0.25rem;
}
.action-card b {
  color: var(--gold);
  font-weight: 500;
}
.action-escape {
  background: #19151a;
}
.explore-actions {
  display: flex;
  gap: 0.6rem;
  flex-wrap: wrap;
}
.explore-actions .button-primary {
  flex: 1;
}
.explore-actions .button {
  font-size: 0.7rem;
}
.chronicle {
  margin-top: 1.45rem;
}
.chronicle .panel-label {
  margin-bottom: 0.7rem;
}
.log-list {
  border-top: 1px solid var(--line);
}
.log-entry {
  display: flex;
  gap: 0.65rem;
  align-items: flex-start;
  padding: 0.52rem 0.15rem;
  border-bottom: 1px solid #2b222d;
  font-size: 0.67rem;
  line-height: 1.55;
  color: #a89aa7;
}
.log-entry > span {
  width: 14px;
  flex-shrink: 0;
  color: #8b7488;
  text-align: center;
}
.log-entry p {
  margin: 0;
}
.log-crit,
.log-danger {
  color: #d18b8c;
}
.log-ability,
.log-level {
  color: #d6bd82;
}
.log-heal {
  color: #9ab99b;
}
.log-loot,
.log-victory {
  color: #d1b77e;
}
.log-achievement {
  color: #e3c88a;
  background: #2c241b;
  padding: 0.6rem;
}
.log-story {
  color: #c2adb8;
}
.right-rail .panel-label {
  margin-bottom: 1rem;
}
.run-stat {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin: 0.9rem 0;
}
.run-stat-icon {
  display: grid;
  place-items: center;
  width: 37px;
  height: 37px;
  border: 1px solid #493644;
  background: #211923;
  color: var(--gold);
  font-size: 1rem;
}
.run-stat > div {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
}
.run-stat small {
  font-size: 0.52rem;
  letter-spacing: 0.1em;
  color: #938291;
}
.run-stat strong {
  font: 500 1.25rem var(--font-display);
}
.rail-divider {
  height: 1px;
  background: var(--line);
  margin: 1.3rem 0;
}
.empty-relics {
  text-align: center;
  padding: 1rem 0.4rem 1.3rem;
}
.empty-relics > span {
  font-size: 1.8rem;
  color: #766077;
}
.empty-relics p {
  font-size: 0.7rem;
  margin: 0.5rem 0;
  color: #b2a2b0;
}
.empty-relics small {
  display: block;
  font-size: 0.62rem;
  line-height: 1.7;
  color: #807280;
}
.relic-list {
  display: grid;
  gap: 0.6rem;
}
.relic-item {
  display: flex;
  gap: 0.6rem;
  align-items: flex-start;
}
.relic-item > span {
  color: var(--gold);
  font-size: 1.1rem;
}
.relic-item div {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
}
.relic-item strong {
  font-size: 0.7rem;
}
.relic-item small {
  font-size: 0.6rem;
  line-height: 1.5;
  color: var(--muted);
}
.achievement-progress p {
  font-size: 0.65rem;
  line-height: 1.6;
  color: #9c8b9a;
}
.achievement-meter span {
  background: linear-gradient(90deg, #7e6941, #d9bc78);
}
.achievement-progress .text-button {
  font-size: 0.65rem;
}
.rail-bottom {
  margin-top: 2rem;
  padding-top: 1rem;
  border-top: 1px solid var(--line);
  font-size: 0.52rem;
  letter-spacing: 0.05em;
  color: #8d7c8b;
  line-height: 2;
}
.rail-bottom .live-dot {
  margin-right: 0.35rem;
  width: 5px;
  height: 5px;
}
.rail-bottom .text-button {
  display: block;
}
.game-footer {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.8rem 1.5rem;
  border-top: 1px solid var(--line);
  font-size: 0.52rem;
  letter-spacing: 0.11em;
  color: #776976;
}
.game-footer i {
  color: var(--gold);
  font-style: normal;
}
/* Modals */
.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 20;
  display: grid;
  place-items: center;
  padding: 1rem;
  background: #08060bd9;
  backdrop-filter: blur(8px);
  overflow: auto;
}
.modal {
  width: min(620px, 100%);
  max-height: min(85vh, 850px);
  overflow: auto;
  border: 1px solid #5a4555;
  background: #17121a;
  box-shadow: 0 30px 100px #0009;
}
.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.2rem 1.35rem;
  border-bottom: 1px solid var(--line);
}
.modal-header h2 {
  font: 500 1.45rem var(--font-display);
  margin: 0.45rem 0 0;
}
.modal-close {
  font-size: 1.5rem;
}
.modal-content {
  padding: 1.25rem 1.35rem;
}
.modal-intro {
  font-size: 0.8rem;
  color: #a999a7;
  line-height: 1.6;
  margin: 0 0 1rem;
}
.modal-footer {
  display: flex;
  justify-content: flex-end;
  padding: 0 1.35rem 1.2rem;
}
.slot-list {
  display: grid;
  gap: 0.65rem;
  margin-bottom: 1rem;
}
.slot-card {
  padding: 0.85rem;
  border: 1px solid var(--line);
  background: #1e1721;
}
.slot-number {
  font-size: 0.55rem;
  color: var(--gold);
  letter-spacing: 0.16em;
}
.slot-name {
  font: 500 0.95rem var(--font-display);
  margin: 0.4rem 0;
}
.slot-card .muted {
  font-size: 0.67rem;
}
.slot-actions {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
  margin-top: 0.8rem;
}
.inventory-detail {
  display: grid;
  gap: 0.7rem;
}
.inventory-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.8rem;
  border: 1px solid var(--line);
  background: #1e1721;
}
.inventory-item > div {
  flex: 1;
  min-width: 0;
}
.inventory-item strong {
  display: block;
  font: 500 0.85rem var(--font-display);
  margin: 0.25rem 0;
}
.inventory-item p {
  font-size: 0.66rem;
  color: var(--muted);
  line-height: 1.5;
  margin: 0.2rem 0;
}
.inventory-item .button {
  white-space: nowrap;
}
.potion-icon {
  color: #d49b87;
}
.inventory-footer {
  display: flex;
  justify-content: space-between;
  padding-top: 1rem;
  margin-top: 1rem;
  border-top: 1px solid var(--line);
  font-size: 0.8rem;
  color: var(--muted);
}
.inventory-footer strong {
  color: var(--gold);
}
.achievement-list {
  display: grid;
  gap: 0.55rem;
}
.achievement-card {
  display: flex;
  align-items: center;
  gap: 0.8rem;
  padding: 0.75rem;
  border: 1px solid var(--line);
  background: #1c161f;
}
.achievement-card > span {
  font-size: 1.4rem;
  color: #6b5c6c;
}
.achievement-card.earned {
  border-color: #766344;
  background: #282119;
}
.achievement-card.earned > span {
  color: var(--gold);
}
.achievement-card > div {
  flex: 1;
}
.achievement-card strong {
  font: 500 0.8rem var(--font-display);
}
.achievement-card p {
  font-size: 0.65rem;
  color: var(--muted);
  margin: 0.3rem 0 0;
}
.achievement-card > small {
  font-size: 0.5rem;
  letter-spacing: 0.08em;
  color: #8b7a89;
}
.achievement-card.earned > small {
  color: var(--gold);
}
.settings-list {
  display: grid;
  gap: 1.1rem;
}
.settings-list > label:not(.toggle-row) {
  display: grid;
  gap: 0.5rem;
  font-size: 0.76rem;
  color: #c9bac7;
}
.settings-list select {
  padding: 0.7rem;
  background: #211923;
  border: 1px solid var(--line);
  color: var(--text);
}
.toggle-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
}
.toggle-row span {
  display: grid;
  gap: 0.25rem;
}
.toggle-row strong {
  font-size: 0.8rem;
}
.toggle-row small {
  font-size: 0.66rem;
  color: var(--muted);
}
.toggle-row input {
  accent-color: var(--gold);
  width: 18px;
  height: 18px;
}
.help-copy p {
  font-size: 0.78rem;
  color: #b6a6b4;
  line-height: 1.8;
  margin: 0 0 0.85rem;
}
.help-copy strong {
  color: var(--gold-bright);
}
.merchant-offer {
  display: flex;
  align-items: center;
  gap: 0.8rem;
  padding: 1rem;
  border: 1px solid var(--line);
  background: #211923;
}
.merchant-offer > div {
  flex: 1;
}
.merchant-offer strong {
  font: 500 0.9rem var(--font-display);
}
.merchant-offer p,
.merchant-offer small {
  display: block;
  font-size: 0.67rem;
  color: var(--muted);
  line-height: 1.5;
}
.toast {
  position: fixed;
  bottom: 1.2rem;
  left: 50%;
  transform: translateX(-50%);
  z-index: 50;
  max-width: calc(100vw - 2rem);
  padding: 0.85rem 1.1rem;
  background: #2a202a;
  border: 1px solid var(--gold);
  color: var(--text);
  font-size: 0.76rem;
  box-shadow: 0 10px 40px #0009;
}
/* Themes */
html[data-theme="ember"] {
  --bg: #160d0d;
  --panel: #201414;
  --panel-2: #2b1919;
  --panel-3: #3a2020;
  --line: #503033;
  --gold: #d49a65;
  --gold-bright: #efbf88;
}
html[data-theme="terminal"] {
  --bg: #07110d;
  --panel: #0b1912;
  --panel-2: #102319;
  --panel-3: #163021;
  --line: #234632;
  --text: #d6efdf;
  --muted: #86a994;
  --gold: #7bd99b;
  --gold-bright: #b5f5c9;
  --red: #e07878;
  --green: #8ca88b;
}
html[data-theme="terminal"] .title-screen {
  background: radial-gradient(
    ellipse at 25% 48%,
    #153d2a 0,
    #0a2016 42%,
    #06100b 76%
  );
}
html[data-theme="terminal"] .scene-panel {
  filter: saturate(0.7);
}
.reduced-motion *,
.reduced-motion *:before,
.reduced-motion *:after {
  animation: none !important;
  transition: none !important;
  scroll-behavior: auto !important;
}
@media (min-width: 1500px) {
  .game-layout {
    grid-template-columns: 270px minmax(450px, 1fr) 250px;
  }
  .dungeon-main {
    padding-left: 2.5rem;
    padding-right: 2.5rem;
  }
  .left-rail,
  .right-rail {
    padding: 1.5rem 1.35rem;
  }
}
@media (max-width: 1100px) {
  .game-layout {
    grid-template-columns: 210px minmax(320px, 1fr);
  }
  .right-rail {
    display: none;
  }
  .left-rail {
    padding: 0.9rem;
  }
  .class-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
  .class-card {
    min-height: 260px;
  }
  .title-screen {
    grid-template-columns: 1fr 0.8fr;
  }
  .title-art {
    min-height: 600px;
  }
  .combat-actions {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .action-card {
    min-height: 95px;
  }
}
@media (max-width: 760px) {
  .title-screen {
    display: flex;
    flex-direction: column;
    padding: 0 1.1rem;
  }
  .title-topline {
    height: 55px;
    font-size: 0.5rem;
    letter-spacing: 0.1em;
  }
  .title-topline .version {
    display: none;
  }
  .title-copy {
    padding: 2rem 0 2.5rem;
    order: 2;
  }
  .title-copy h1 {
    font-size: clamp(3.2rem, 14vw, 5.5rem);
  }
  .title-art {
    order: 1;
    min-height: 230px;
    width: 100%;
    flex: none;
  }
  .moon {
    width: 160px;
    top: 8%;
  }
  .crown-mark {
    font-size: 6rem;
    top: 45%;
  }
  .mountain {
    height: 65%;
  }
  .mountain-back {
    bottom: 3%;
  }
  .mountain-front {
    height: 50%;
  }
  .title-foot {
    margin-top: 2.4rem;
  }
  .title-foot span:nth-child(2) {
    display: none;
  }
  .setup-screen {
    padding: 0 1rem 2rem;
  }
  .simple-header {
    height: 56px;
  }
  .simple-header .eyebrow {
    display: none;
  }
  .setup-heading {
    padding: 2.2rem 0 1.5rem;
  }
  .setup-heading h1 {
    font-size: 3rem;
  }
  .class-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.55rem;
  }
  .class-card {
    min-height: 245px;
    padding: 0.8rem;
  }
  .class-icon {
    width: 42px;
    height: 42px;
    margin-bottom: 0.9rem;
  }
  .class-card > strong {
    font-size: 1.1rem;
  }
  .class-description {
    font-size: 0.68rem;
  }
  .class-stats {
    font-size: 0.55rem;
  }
  .game-header {
    height: 58px;
    padding: 0 0.75rem;
  }
  .brand-lockup strong {
    font-size: 0.62rem;
  }
  .brand-lockup small {
    font-size: 0.48rem;
  }
  .brand-sigil {
    width: 30px;
    height: 30px;
  }
  .header-center {
    font-size: 0.55rem;
    letter-spacing: 0.08em;
    gap: 0.35rem;
  }
  .header-actions {
    gap: 0.25rem;
  }
  .icon-button {
    width: 32px;
    height: 32px;
  }
  .game-layout {
    display: flex;
    flex-direction: column;
    min-height: 0;
  }
  .left-rail {
    display: grid;
    grid-template-columns: 65px 1fr;
    gap: 0.25rem 0.75rem;
    align-items: center;
    padding: 0.75rem;
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }
  .left-rail > .panel-label,
  .hero-avatar,
  .hero-name,
  .hero-class {
    grid-column: 1;
  }
  .left-rail > .panel-label {
    font-size: 0.5rem;
  }
  .left-rail > .panel-label span {
    display: none;
  }
  .hero-avatar {
    width: 55px;
    height: 55px;
    margin: 0.25rem 0;
    font-size: 1.7rem;
  }
  .hero-avatar small {
    font-size: 0.45rem;
  }
  .hero-name {
    grid-column: 2;
    grid-row: 2;
    text-align: left;
    margin: 0;
    align-self: end;
  }
  .hero-class {
    grid-column: 2;
    grid-row: 2;
    text-align: left;
    align-self: start;
    margin: 1.7rem 0 0;
    font-size: 0.49rem;
  }
  .left-rail .stat-block {
    grid-column: 1/-1;
    margin: 0.3rem 0;
  }
  .stat-heading {
    font-size: 0.51rem;
  }
  .stat-heading strong {
    font-size: 0.61rem;
  }
  .quick-stats {
    grid-column: 1/-1;
    margin: 0.3rem 0;
    padding: 0.45rem;
  }
  .quick-stats > div {
    flex-direction: row;
    justify-content: center;
    gap: 0.35rem;
  }
  .quick-stats small {
    font-size: 0.46rem;
  }
  .quick-stats strong {
    font-size: 0.7rem;
  }
  .inventory-mini {
    grid-column: 1/-1;
    margin: 0.3rem 0;
  }
  .inventory-mini .panel-label {
    margin-bottom: 0.3rem;
  }
  .gear-row {
    display: inline-flex;
    width: 49%;
    margin: 0.2rem 0;
  }
  .gear-row .gear-icon {
    width: 30px;
    height: 30px;
  }
  .gear-row strong {
    font-size: 0.6rem;
  }
  .gear-row em {
    font-size: 0.53rem;
  }
  .left-rail > .button {
    grid-column: 1/-1;
  }
  .dungeon-main {
    padding: 0.85rem 0.75rem 1.2rem;
  }
  .scene-panel {
    height: 280px;
    min-height: 250px;
  }
  .scene-caption {
    bottom: 0.8rem;
  }
  .scene-caption h2 {
    font-size: 1.25rem;
  }
  .enemy-strip {
    grid-template-columns: 1fr;
    padding: 0.75rem;
    gap: 0.65rem;
  }
  .enemy-identity strong {
    font-size: 0.82rem;
  }
  .action-area {
    margin-top: 1rem;
  }
  .combat-actions {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.45rem;
  }
  .action-card {
    min-height: 100px;
    padding: 0.65rem;
  }
  .action-card strong {
    font-size: 0.68rem;
  }
  .action-card small {
    font-size: 0.56rem;
  }
  .explore-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
  }
  .explore-actions .button-primary {
    grid-column: 1/-1;
  }
  .chronicle {
    margin-top: 1.1rem;
  }
  .game-footer {
    font-size: 0.45rem;
    padding: 0.7rem;
    gap: 0.5rem;
  }
  .game-footer span:nth-child(2) {
    display: none;
  }
  .modal-content {
    padding: 1rem;
  }
  .modal-header {
    padding: 1rem;
  }
  .inventory-item {
    flex-wrap: wrap;
  }
  .inventory-item > div {
    min-width: calc(100% - 55px);
    flex: 1;
  }
  .inventory-item .button {
    margin-left: 3rem;
  }
  .slot-actions .button {
    flex: 1;
  }
  .title-actions {
    display: grid;
    grid-template-columns: 1fr;
  }
  .title-foot {
    font-size: 0.48rem;
  }
  .title-foot .text-button {
    margin-left: 0;
  }
}
@media (max-width: 390px) {
  .class-grid {
    grid-template-columns: 1fr;
  }
  .class-card {
    min-height: 0;
  }
  .class-description {
    margin: 0.6rem 0;
  }
  .class-icon {
    margin-bottom: 0.5rem;
  }
  .header-center {
    display: none;
  }
  .game-header {
    justify-content: space-between;
  }
  .title-copy h1 {
    font-size: 3.1rem;
  }
  .title-topline {
    gap: 0.6rem;
  }
  .scene-panel {
    height: 250px;
  }
  .game-footer span:last-child {
    display: none;
  }
}
@media (prefers-reduced-motion: reduce) {
  *,
  *:before,
  *:after {
    scroll-behavior: auto !important;
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
}
