@import url('https://fonts.googleapis.com/css2?family=Cinzel:wght@600;700&family=Crimson+Text:wght@400;600&display=swap');

:root {
  --bg: #15120f;
  --panel: #211b16;
  --panel-2: #2b231c;
  --ink: #efe3c2;
  --muted: #b9a98b;
  --gold: #c89b4a;
  --red: #9f4a3f;
  --border: #55432f;
  --shadow: rgba(0, 0, 0, 0.45);
}

* { box-sizing: border-box; }
html, body { min-height: 100%; }

body {
  margin: 0;
  color: var(--ink);
  background:
    radial-gradient(circle at top, rgba(115, 81, 44, 0.18), transparent 32rem),
    linear-gradient(rgba(0,0,0,.38), rgba(0,0,0,.38)),
    repeating-linear-gradient(0deg, #17130f 0, #17130f 3px, #14100d 3px, #14100d 6px);
  font-family: "Crimson Text", Georgia, serif;
  font-size: 18px;
}

button { font: inherit; }

.game-shell {
  width: min(780px, calc(100% - 24px));
  margin: 14px auto;
  display: grid;
  gap: 9px;
}

.game-header,
.crown-panel,
.factions,
.realm-state,
.event-card,
.choices,
.game-footer {
  border: 1px solid var(--border);
  background: linear-gradient(145deg, rgba(43, 35, 28, .97), rgba(29, 24, 20, .97));
  box-shadow: 0 10px 28px var(--shadow);
}

.game-header {
  min-height: 78px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  padding: 12px 18px;
  border-bottom: 3px double var(--gold);
}

h1, h2 { margin: 0; font-family: "Cinzel", Georgia, serif; }
h1 {
  color: #f4d891;
  font-size: clamp(1.8rem, 6vw, 2.7rem);
  letter-spacing: .04em;
  text-shadow: 0 2px 0 #5f421d;
}
h2 { color: #e3c57f; font-size: clamp(1.2rem, 4vw, 1.65rem); }

.eyebrow,
.speaker-role {
  margin: 0 0 3px;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: .14em;
  font-size: .68rem;
}

.reign-counter { min-width: 78px; text-align: center; }
.reign-counter span,
.reign-counter strong { display: block; }
.reign-counter span {
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: .1em;
  font-size: .65rem;
}
.reign-counter strong {
  color: #f4d891;
  font-family: "Cinzel", Georgia, serif;
  font-size: 1.5rem;
}

.crown-panel { padding: 11px 15px 10px; border-color: #7c6036; }
.crown-title,
.meter-top {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 8px;
}
.crown-title span {
  color: #f4d891;
  font-family: "Cinzel", Georgia, serif;
  text-transform: uppercase;
  letter-spacing: .08em;
  font-size: .78rem;
}
.crown-title strong { color: #f4d891; }
.crown-panel p {
  margin: 6px 0 0;
  color: var(--muted);
  font-size: .76rem;
}

.factions {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
}
.faction { padding: 10px 12px 12px; border-right: 1px solid var(--border); }
.faction:last-child { border-right: 0; }
.meter-top { margin-bottom: 5px; }
.meter-top span {
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: .08em;
  font-size: .63rem;
}
.meter-top strong { font-size: .88rem; }
.meter-track {
  height: 8px;
  border: 1px solid #6c5638;
  background: #15110e;
  overflow: hidden;
}
.meter-fill {
  width: 45%;
  height: 100%;
  background: linear-gradient(90deg, #76562a, var(--gold));
  transition: width .25s ease;
}
.crown-track { height: 10px; }
.crown-fill { background: linear-gradient(90deg, #9b702e, #e0b65d); }

.realm-state {
  display: grid;
  grid-template-columns: 1fr 1fr;
}
.realm-state > div {
  padding: 9px 14px;
  display: flex;
  justify-content: space-between;
  gap: 12px;
}
.realm-state > div:first-child { border-right: 1px solid var(--border); }
.realm-state span {
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: .08em;
  font-size: .68rem;
}
.realm-state strong { color: #e3c57f; }

.event-card {
  min-height: 275px;
  padding: 20px 26px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  text-align: center;
  position: relative;
}
.event-card.crisis { border-color: var(--red); }
.portrait {
  width: 92px;
  height: 92px;
  margin-bottom: 12px;
  display: grid;
  place-items: center;
  border: 1px solid #82673e;
  background:
    radial-gradient(circle, rgba(200,155,74,.19), transparent 57%),
    linear-gradient(135deg, #31261d, #17120f);
  color: #d8b56b;
  font-size: 3.4rem;
  text-shadow: 0 4px 16px #000;
}
.event-text {
  width: min(100%, 570px);
  margin: 14px auto 0;
  font-size: 1.14rem;
  line-height: 1.42;
}
.crisis-badge {
  position: absolute;
  top: 10px;
  right: 12px;
  margin: 0;
  padding: 3px 7px;
  color: #f1c0b8;
  border: 1px solid var(--red);
  font-family: "Cinzel", Georgia, serif;
  font-size: .62rem;
  letter-spacing: .12em;
}

.choices {
  padding: 10px;
  display: grid;
  grid-template-columns: 1fr;
  gap: 7px;
}
button {
  min-height: 46px;
  border: 1px solid #82673e;
  background: linear-gradient(#4b3a28, #34271d);
  color: var(--ink);
  padding: 9px 13px;
  cursor: pointer;
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.04);
}
button:hover,
button:focus-visible {
  background: linear-gradient(#624a30, #403021);
  border-color: var(--gold);
  outline: none;
}
button:disabled {
  cursor: not-allowed;
  opacity: .42;
  border-color: var(--border);
}
.choice-button {
  font-family: "Cinzel", Georgia, serif;
  font-size: .82rem;
  letter-spacing: .015em;
}
.choice-button small {
  display: block;
  margin-top: 3px;
  color: var(--muted);
  font-family: "Crimson Text", Georgia, serif;
  font-size: .82rem;
}

.game-footer {
  min-height: 50px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 8px 12px;
}
.game-footer p { margin: 0; color: var(--muted); font-size: .78rem; }
.small-button { min-height: 34px; padding: 6px 10px; white-space: nowrap; font-size: .78rem; }

dialog {
  width: min(500px, calc(100% - 32px));
  border: 1px solid var(--gold);
  background: #211b16;
  color: var(--ink);
  padding: 24px;
  box-shadow: 0 20px 70px #000;
}
dialog::backdrop { background: rgba(0,0,0,.78); }
dialog p { line-height: 1.5; }
dialog button { width: 100%; margin-top: 8px; }

@media (max-width: 620px) {
  body { font-size: 16px; }
  .game-shell { width: min(100% - 12px, 780px); margin: 6px auto; gap: 6px; }
  .game-header { min-height: 62px; padding: 8px 11px; }
  .crown-panel { padding: 8px 10px; }
  .crown-panel p { display: none; }
  .faction { padding: 7px 5px 8px; }
  .meter-top { justify-content: center; }
  .meter-top strong { display: none; }
  .meter-top span { font-size: .52rem; }
  .realm-state > div { padding: 7px 9px; }
  .event-card { min-height: 235px; padding: 15px 13px; }
  .portrait { width: 76px; height: 76px; margin-bottom: 10px; font-size: 2.8rem; }
  .event-text { margin-top: 10px; font-size: 1.02rem; }
  .choices { padding: 7px; gap: 5px; }
  button { min-height: 42px; padding: 8px 10px; }
  .choice-button { font-size: .74rem; }
  .game-footer { min-height: 42px; }
  .game-footer p { font-size: .7rem; }
}


/* HOW TO PLAY */

.footer-buttons {
  display: flex;
  gap: 0.65rem;
  flex-wrap: wrap;
  justify-content: center;
}

.help-dialog {
  max-width: 560px;
}

.help-dialog h2 {
  margin-top: 0.2rem;
}

.help-rules {
  text-align: left;
  margin: 1.1rem 0;
}

.help-rules p {
  margin: 0.75rem 0;
  line-height: 1.5;
}

.help-goal {
  text-align: center;
  margin: 1.25rem 0;
  font-size: 1.05rem;
}


/* GATED OPPORTUNITIES */

.event-card.opportunity {
  border-color: var(--gold);
}

.event-card.opportunity .crisis-badge {
  color: var(--gold);
}


.autosave-note {
  display: inline-block;
  margin-left: 0.35rem;
  color: var(--muted);
  font-size: 0.9em;
}


/* SITE / COMMUNITY DIALOGS */

.update-list,
.petition-prompts {
  text-align: left;
  margin: 1rem 0 1.25rem;
}

.update-entry {
  border-top: 1px solid var(--border);
  padding-top: 0.85rem;
}

.update-entry h3 {
  margin: 0 0 0.5rem;
  font-size: 1rem;
}

.update-entry ul {
  margin: 0.5rem 0 0 1.2rem;
  padding: 0;
}

.update-entry li {
  margin: 0.35rem 0;
  line-height: 1.45;
}

.update-note,
.petition-note {
  color: var(--muted);
  line-height: 1.5;
}

.petition-prompts p {
  padding-bottom: 0.75rem;
  margin-bottom: 0.75rem;
  border-bottom: 1px solid var(--border);
  line-height: 1.45;
}

.secondary-dialog-button {
  margin-top: 0.65rem;
}

/* THE REALM */
.realm-summary {
  margin: 14px 0;
  padding: 10px 14px;
  border: 1px solid rgba(83, 62, 38, 0.45);
  background: rgba(255, 248, 224, 0.35);
  font-size: 0.9rem;
  line-height: 1.45;
}
.realm-summary-title {
  margin-bottom: 5px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.realm-summary div + div { margin-top: 2px; }
