:root {
  --ink: #e8ddc2;
  --muted: #aa9b7d;
  --blood: #a82f2f;
  --blood-bright: #d34a3f;
  --gold: #c6a15b;
  --black: #0b0908;
  --panel: #171310;
  --panel-light: #211a15;
  --line: #493c2e;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  background:
    radial-gradient(circle at 50% -10%, rgba(168, 47, 47, 0.2), transparent 40rem),
    repeating-linear-gradient(90deg, rgba(255, 255, 255, 0.012) 0, rgba(255, 255, 255, 0.012) 1px, transparent 1px, transparent 5px),
    var(--black);
  font-family: Georgia, "Times New Roman", serif;
}

button {
  font: inherit;
}

.page-shell {
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto;
  padding: 34px 0 24px;
}

.masthead {
  display: flex;
  align-items: center;
  gap: 20px;
  padding-bottom: 24px;
  border-bottom: 1px solid var(--line);
}

.sigil {
  display: grid;
  width: 74px;
  height: 74px;
  flex: 0 0 74px;
  place-items: center;
  border: 1px solid var(--blood);
  border-radius: 50%;
  color: var(--blood-bright);
  background: rgba(168, 47, 47, 0.08);
  box-shadow: 0 0 28px rgba(168, 47, 47, 0.18);
  font-size: 48px;
}

.eyebrow,
.speaker,
.decree-meta,
.economist-note span {
  margin: 0 0 5px;
  color: var(--gold);
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.13em;
  text-transform: uppercase;
}

h1,
h2,
p {
  margin-top: 0;
}

h1 {
  margin-bottom: 4px;
  font-size: clamp(34px, 6vw, 58px);
  font-weight: 500;
  line-height: 0.95;
}

.subtitle {
  margin-bottom: 0;
  color: var(--muted);
  font-style: italic;
}

.status-panel {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  margin: 24px 0;
}

.status-card,
.decree-card,
.chronicle-card,
.ending-card {
  border: 1px solid var(--line);
  background: linear-gradient(145deg, var(--panel-light), var(--panel));
  box-shadow: 0 14px 40px rgba(0, 0, 0, 0.2);
}

.status-card {
  padding: 14px;
}

.status-heading {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  font-weight: 700;
}

.status-card p {
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.35;
}

.meter {
  height: 7px;
  margin-top: 9px;
  overflow: hidden;
  border-radius: 10px;
  background: #080706;
}

.meter-fill {
  height: 100%;
  width: 0;
  border-radius: inherit;
  transition: width 500ms ease;
}

.favour { background: var(--blood-bright); }
.treasury { background: var(--gold); }
.prosperity { background: #648d64; }
.peace { background: #66819a; }

.game-grid {
  display: grid;
  grid-template-columns: minmax(0, 2fr) minmax(260px, 0.85fr);
  gap: 18px;
}

.decree-card,
.chronicle-card,
.ending-card {
  padding: clamp(22px, 4vw, 38px);
}

.decree-card h2,
.ending-card h2 {
  margin-bottom: 16px;
  font-size: clamp(28px, 5vw, 44px);
  font-weight: 500;
  line-height: 1.05;
}

.decree-meta {
  display: flex;
  justify-content: space-between;
  margin-bottom: 28px;
}

.speaker {
  color: var(--blood-bright);
}

blockquote {
  margin: 0 0 24px;
  padding: 14px 18px;
  border-left: 3px solid var(--blood);
  color: #f5ead2;
  background: rgba(0, 0, 0, 0.18);
  font-size: 18px;
  font-style: italic;
  line-height: 1.5;
}

.economist-note {
  margin-bottom: 24px;
}

.economist-note p {
  margin: 7px 0 0;
  color: var(--muted);
  line-height: 1.5;
}

.choices {
  display: grid;
  gap: 10px;
}

.choice-button,
.restart-button,
.opening button {
  border: 1px solid #62513c;
  color: var(--ink);
  background: #261e17;
  cursor: pointer;
}

.choice-button {
  padding: 15px 17px;
  text-align: left;
  transition: border-color 140ms ease, background 140ms ease, transform 140ms ease;
}

.choice-button:hover,
.choice-button:focus-visible {
  border-color: var(--gold);
  outline: none;
  background: #30251b;
  transform: translateX(3px);
}

.choice-title {
  display: block;
  margin-bottom: 4px;
  font-weight: 700;
}

.choice-description {
  display: block;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.4;
}

.chronicle-card h2 {
  margin-bottom: 6px;
  font-size: 24px;
  font-weight: 500;
}

.chronicle-help {
  padding-bottom: 14px;
  border-bottom: 1px solid var(--line);
  color: var(--muted);
  font-size: 13px;
}

#chronicle {
  margin: 0;
  padding-left: 20px;
}

#chronicle li {
  margin-bottom: 16px;
  padding-left: 5px;
  color: var(--muted);
  line-height: 1.4;
}

#chronicle strong {
  display: block;
  margin-bottom: 3px;
  color: var(--ink);
}

.ending-card {
  border-color: var(--blood);
  text-align: center;
}

.ending-card p:not(.eyebrow) {
  max-width: 700px;
  margin-right: auto;
  margin-left: auto;
  color: var(--muted);
  font-size: 18px;
  line-height: 1.55;
}

.restart-button,
.opening button {
  padding: 13px 20px;
  border-color: var(--blood);
  background: #541f1d;
  font-weight: 700;
}

footer {
  margin-top: 18px;
  padding: 18px 2px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.5;
}

.opening {
  position: fixed;
  z-index: 10;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 20px;
  background: rgba(4, 3, 3, 0.92);
  backdrop-filter: blur(8px);
}

.opening[hidden] {
  display: none;
}

.opening-panel {
  width: min(620px, 100%);
  padding: clamp(28px, 6vw, 56px);
  border: 1px solid var(--blood);
  background: var(--panel);
  box-shadow: 0 0 70px rgba(168, 47, 47, 0.18);
  text-align: center;
}

.opening-panel h2 {
  margin-bottom: 20px;
  font-size: clamp(34px, 7vw, 54px);
  font-weight: 500;
  line-height: 1;
}

.opening-panel p:not(.eyebrow) {
  color: var(--muted);
  font-size: 17px;
  line-height: 1.55;
}

@media (max-width: 850px) {
  .status-panel {
    grid-template-columns: repeat(2, 1fr);
  }

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

@media (max-width: 520px) {
  .page-shell {
    width: min(100% - 20px, 1180px);
    padding-top: 20px;
  }

  .masthead {
    align-items: flex-start;
  }

  .sigil {
    width: 52px;
    height: 52px;
    flex-basis: 52px;
    font-size: 34px;
  }

  .status-panel {
    grid-template-columns: 1fr;
  }

  .decree-meta {
    gap: 16px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .meter-fill,
  .choice-button {
    transition: none;
  }
}
