:root {
  color-scheme: light;
  --ink: #20160e;
  --muted: #6f5b42;
  --paper: #ead9b8;
  --paper-light: #f6ead1;
  --border: rgba(87, 57, 28, 0.24);
  --oxblood: #7d1e27;
  --bottle: #174f4a;
  --gold: #c28a35;
  --blue: #2f5575;
  --shadow: 0 30px 80px rgba(10, 6, 3, 0.36);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background:
    linear-gradient(120deg, rgba(255, 255, 255, 0.04) 1px, transparent 1px) 0 0 / 36px 36px,
    radial-gradient(circle at 14% 10%, rgba(194, 138, 53, 0.34), transparent 24%),
    radial-gradient(circle at 80% 18%, rgba(47, 85, 117, 0.28), transparent 26%),
    linear-gradient(145deg, #110c09 0%, #2c2016 45%, #090705 100%);
}

button {
  font: inherit;
}

.shell {
  width: min(1240px, calc(100% - 32px));
  margin: 0 auto;
  padding: 30px 0;
}

.masthead {
  display: flex;
  justify-content: space-between;
  align-items: end;
  gap: 20px;
  margin-bottom: 18px;
  color: #fff0cf;
}

.eyebrow {
  margin: 0 0 8px;
  color: #f2bd62;
  font-size: 12px;
  font-weight: 760;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

h1,
h2,
h3 {
  margin: 0;
  font-family: "Noto Serif SC", serif;
  letter-spacing: 0;
}

h1 {
  font-size: clamp(30px, 4vw, 48px);
  line-height: 1.08;
}

.nav-links {
  display: flex;
  flex-wrap: wrap;
  justify-content: end;
  gap: 10px;
}

.nav-links a,
.utility-button,
.choice {
  border: 1px solid rgba(240, 190, 95, 0.42);
  color: #ffe8b7;
  background: rgba(87, 30, 23, 0.52);
  text-decoration: none;
  border-radius: 8px;
  transition:
    transform 160ms ease,
    background 160ms ease,
    border-color 160ms ease;
}

.nav-links a {
  padding: 9px 12px;
  font-size: 13px;
}

.nav-links a:hover,
.utility-button:hover,
.choice:hover {
  transform: translateY(-1px);
  border-color: rgba(255, 226, 151, 0.72);
  background: rgba(125, 30, 39, 0.72);
}

.game-frame {
  display: grid;
  grid-template-columns: 286px minmax(0, 1fr);
  min-height: 690px;
  border: 10px solid #261609;
  border-radius: 14px;
  overflow: hidden;
  box-shadow: var(--shadow);
}

.ledger {
  padding: 28px 24px;
  background:
    linear-gradient(rgba(54, 31, 13, 0.08) 1px, transparent 1px) 0 0 / 100% 30px,
    linear-gradient(160deg, #d2b47d, #f0dfbd 52%, #bd9659);
  border-right: 1px solid rgba(38, 22, 9, 0.38);
}

.crest {
  width: 54px;
  height: 54px;
  display: grid;
  place-items: center;
  margin-bottom: 20px;
  border: 2px solid rgba(70, 37, 14, 0.4);
  color: #fff0c8;
  background: linear-gradient(145deg, var(--oxblood), #2f5575);
  border-radius: 8px;
  font-family: "Noto Serif SC", serif;
  font-size: 28px;
  font-weight: 800;
  box-shadow: inset 0 0 24px rgba(0, 0, 0, 0.24);
}

.ledger h2 {
  font-size: 24px;
}

.stats {
  display: grid;
  gap: 10px;
  margin: 24px 0;
}

.stats div {
  display: flex;
  justify-content: space-between;
  align-items: center;
  min-height: 44px;
  padding: 0 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: rgba(255, 246, 222, 0.46);
}

.stats dt {
  color: var(--muted);
  font-size: 13px;
  font-weight: 650;
}

.stats dd {
  margin: 0;
  font-family: "Noto Serif SC", serif;
  font-size: 22px;
  font-weight: 800;
}

.inventory {
  padding-top: 12px;
  border-top: 1px solid rgba(87, 57, 28, 0.22);
}

.inventory h3 {
  font-size: 16px;
}

.inventory ul {
  min-height: 160px;
  margin: 12px 0 20px;
  padding: 0;
  list-style: none;
}

.inventory li {
  margin-bottom: 8px;
  padding: 8px 10px;
  border-left: 3px solid var(--gold);
  background: rgba(255, 246, 222, 0.42);
  font-size: 13px;
}

.utility-button {
  width: 100%;
  min-height: 42px;
  cursor: pointer;
}

.story-panel {
  padding: clamp(24px, 4vw, 42px);
  background:
    radial-gradient(circle at 76% 12%, rgba(255, 238, 176, 0.46), transparent 30%),
    linear-gradient(var(--border) 1px, transparent 1px) 0 100px / 100% 34px,
    var(--paper);
}

.passage-kicker {
  color: var(--oxblood);
  font-size: 12px;
  font-weight: 760;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.story-panel h2 {
  margin-top: 8px;
  font-size: clamp(28px, 4vw, 42px);
  line-height: 1.12;
}

.story-layout {
  display: grid;
  grid-template-columns: minmax(220px, 310px) minmax(0, 1fr);
  gap: clamp(22px, 4vw, 36px);
  align-items: start;
  margin-top: 28px;
}

.artifact-preview {
  margin: 0;
  padding: 12px;
  border: 1px solid rgba(87, 57, 28, 0.22);
  background: rgba(255, 248, 230, 0.52);
  box-shadow: 0 18px 38px rgba(67, 42, 18, 0.18);
}

.artifact-preview img {
  width: 100%;
  aspect-ratio: 4 / 5;
  object-fit: cover;
  display: block;
  border: 1px solid rgba(41, 24, 9, 0.18);
  background: #d0b789;
}

.artifact-preview figcaption {
  min-height: 42px;
  margin-top: 10px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
}

.story-text {
  max-width: 680px;
  font-family: "Noto Serif SC", serif;
  font-size: 19px;
  line-height: 1.85;
}

.story-text p {
  margin: 0 0 16px;
}

.story-text .note {
  padding: 12px 14px;
  border-left: 3px solid var(--blue);
  background: rgba(255, 248, 230, 0.46);
  font-family: Inter, system-ui, sans-serif;
  font-size: 14px;
  line-height: 1.6;
}

.choices {
  display: grid;
  gap: 10px;
  margin-top: 26px;
}

.choice {
  width: 100%;
  min-height: 48px;
  padding: 12px 14px;
  cursor: pointer;
  text-align: left;
  color: #fff2d0;
  background: linear-gradient(145deg, rgba(125, 30, 39, 0.86), rgba(23, 79, 74, 0.78));
}

.choice small {
  display: block;
  margin-top: 4px;
  color: rgba(255, 239, 196, 0.76);
  font-size: 12px;
}

@media (max-width: 860px) {
  .masthead,
  .game-frame,
  .story-layout {
    grid-template-columns: 1fr;
  }

  .masthead {
    display: grid;
    align-items: start;
  }

  .nav-links {
    justify-content: start;
  }

  .game-frame {
    display: grid;
  }

  .ledger {
    border-right: 0;
    border-bottom: 1px solid rgba(38, 22, 9, 0.38);
  }

  .inventory ul {
    min-height: 0;
  }
}
