/* The Lantern Road — storybook lantern styling.
   House rules honored: no left-accent stripes, hairlines over shadows,
   accent (lantern gold) for emphasis only, eyebrow labels for structure.
   Rounder corners are a deliberate choice for this genuinely playful brand. */

:root {
  color-scheme: dark;
  --ink: #0d0b12;            /* night road */
  --ink-2: #16131f;          /* panel surface */
  --ink-3: #1f1a2b;          /* raised surface */
  --hairline: #35304a;
  --text: #e9e2d0;           /* candlelit paper */
  --text-dim: #a99f8c;
  --gold: #e0a93e;           /* lantern glow */
  --gold-soft: #f3d492;
  --shining: #7fd48a;
  --setback: #d4a45f;
  --thread: #d47f7f;
  --serif: Georgia, 'Iowan Old Style', 'Palatino Linotype', serif;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }

body {
  background: var(--ink);
  background-image: radial-gradient(ellipse 90% 55% at 50% -10%, #241c33 0%, transparent 60%);
  color: var(--text);
  font-family: var(--serif);
  font-size: 18px;
  line-height: 1.65;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.hidden { display: none !important; }

/* ---------- chrome ---------- */

.site-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 18px 22px;
  border-bottom: 1px solid var(--hairline);
}

.eyebrow {
  margin: 0;
  font-size: 12px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--gold);
}

.section-label { margin: 34px 0 10px; padding-top: 16px; border-top: 1px solid var(--hairline); }

.site-foot {
  padding: 26px 22px;
  border-top: 1px solid var(--hairline);
  color: var(--text-dim);
  font-size: 13px;
  text-align: center;
}
.site-foot p { margin: 0; }

main#app { flex: 1; display: flex; justify-content: center; padding: 28px 16px 60px; }

.panel { width: 100%; max-width: 760px; }
.panel.narrow { max-width: 440px; }
.panel.reading { max-width: 640px; }

h1 { font-size: 34px; line-height: 1.2; margin: 18px 0 8px; font-weight: normal; }
h2 { font-size: 26px; line-height: 1.25; margin: 4px 0 0; font-weight: normal; }
.sub { color: var(--text-dim); margin: 6px 0 22px; }

/* ---------- forms ---------- */

.stack { display: flex; flex-direction: column; gap: 12px; }

label { font-size: 13px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--text-dim); }

input, select {
  background: var(--ink-2);
  border: 1px solid var(--hairline);
  border-radius: 8px;
  color: var(--text);
  font-family: var(--serif);
  font-size: 18px;
  padding: 12px 14px;
  width: 100%;
}
input:focus, select:focus, button:focus-visible {
  outline: 2px solid var(--gold);
  outline-offset: 2px;
}

button {
  font-family: var(--serif);
  font-size: 17px;
  border-radius: 8px;
  padding: 12px 18px;
  cursor: pointer;
  border: 1px solid var(--hairline);
  background: var(--ink-3);
  color: var(--text);
}
button.primary {
  background: var(--gold);
  border-color: var(--gold);
  color: #241a05;
  font-weight: bold;
}
button.primary:hover { background: var(--gold-soft); }
button.big { padding: 15px 22px; font-size: 19px; margin-top: 10px; }
button.ghost { background: transparent; color: var(--text-dim); }
button.ghost:hover { color: var(--text); }

.msg { min-height: 1.4em; color: var(--text-dim); font-size: 15px; }
.msg.error { color: var(--thread); }

/* ---------- character creation ---------- */

.card-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }

.class-card {
  display: flex; flex-direction: column; gap: 4px;
  text-align: left;
  padding: 14px;
  background: var(--ink-2);
  border: 1px solid var(--hairline);
  border-radius: 10px;
}
.class-card.picked { border-color: var(--gold); background: var(--ink-3); }
.class-card .card-title { font-size: 19px; }
.class-card.picked .card-title { color: var(--gold-soft); }
.class-card .card-blurb { color: var(--text-dim); font-size: 14px; line-height: 1.4; }
.class-card .card-lean { font-size: 12px; letter-spacing: 0.1em; text-transform: uppercase; color: var(--gold); margin-top: 6px; }

.pick-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; }
.pick { display: flex; flex-direction: column; gap: 6px; }

/* ---------- home ---------- */

.char-strip { margin-top: 10px; }
.char-card {
  border: 1px solid var(--hairline);
  border-radius: 10px;
  padding: 16px 18px;
  background: var(--ink-2);
}
.char-name { margin: 0; font-size: 26px; color: var(--gold-soft); }
.char-class { margin: 2px 0 12px; text-transform: capitalize; color: var(--text-dim); }

.stat-row { display: flex; gap: 22px; }
.stat { display: flex; flex-direction: column; }
.stat-label { font-size: 11px; letter-spacing: 0.14em; text-transform: uppercase; color: var(--text-dim); }
.stat-value { font-size: 24px; color: var(--text); }

.world { margin-bottom: 18px; }
.world-name { margin: 8px 0 2px; font-size: 21px; }
.world-tagline { margin: 0 0 10px; color: var(--text-dim); font-size: 15px; }

.story-row {
  display: flex; justify-content: space-between; align-items: center; gap: 12px;
  padding: 12px 14px;
  border: 1px solid var(--hairline);
  border-radius: 8px;
  background: var(--ink-2);
  margin-bottom: 8px;
}

.charm-row { display: flex; flex-wrap: wrap; gap: 8px; }
.charm {
  border: 1px solid var(--gold);
  border-radius: 999px;
  color: var(--gold-soft);
  font-size: 14px;
  padding: 6px 14px;
}

.journal-list { display: flex; flex-direction: column; gap: 12px; }
.journal-entry {
  border: 1px solid var(--hairline);
  border-radius: 8px;
  padding: 12px 16px;
  background: var(--ink-2);
}
.journal-meta { margin: 0 0 4px; font-size: 12px; letter-spacing: 0.1em; text-transform: uppercase; color: var(--text-dim); }
.journal-text { margin: 0; font-style: italic; }

/* ---------- play ---------- */

.play-head {
  display: flex; justify-content: space-between; align-items: baseline; gap: 14px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--hairline);
  margin-bottom: 22px;
}
.chapter-count { color: var(--text-dim); font-size: 14px; white-space: nowrap; }

.passages { display: flex; flex-direction: column; gap: 16px; }
.passage {
  margin: 0;
  opacity: 0;
  animation: passage-in 0.9s ease forwards;
}
@keyframes passage-in {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: none; }
}
@media (prefers-reduced-motion: reduce) {
  .passage { animation: none; opacity: 1; }
}

.prompt { margin: 28px 0 14px; font-size: 20px; color: var(--gold-soft); }

.option {
  display: flex; justify-content: space-between; align-items: center; gap: 12px;
  text-align: left;
  padding: 14px 16px;
  background: var(--ink-2);
  border: 1px solid var(--hairline);
  border-radius: 10px;
  font-size: 17px;
  line-height: 1.45;
}
.option:hover { border-color: var(--gold); }
.option-roll {
  flex-shrink: 0;
  font-size: 11px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--gold);
  border: 1px solid var(--hairline);
  border-radius: 999px;
  padding: 4px 10px;
}

/* dice */
.dice-stage { text-align: center; margin: 30px 0; }
.die {
  width: 92px; height: 92px;
  margin: 0 auto 12px;
  display: flex; align-items: center; justify-content: center;
  font-size: 40px;
  color: var(--ink);
  background: var(--gold);
  border-radius: 18px;
  transform: rotate(45deg);
}
.die > * , .die { line-height: 1; }
.die { font-family: var(--serif); }
.die[data-tier='shining'] { background: var(--shining); }
.die[data-tier='setback'] { background: var(--setback); }
.die[data-tier='thread']  { background: var(--thread); }
.dice-detail { color: var(--text-dim); font-size: 15px; }

/* outcome tint: full hairline box, tinted background, per house rules */
.outcome-shining, .outcome-success, .outcome-setback, .outcome-thread {
  border: 1px solid var(--hairline);
  border-radius: 8px;
  padding: 14px 16px;
  background: var(--ink-2);
}
.outcome-shining { border-color: var(--shining); }
.outcome-setback { border-color: var(--setback); }
.outcome-thread  { border-color: var(--thread); }

#play-outcome { margin-top: 26px; }

.finale { text-align: center; margin-top: 34px; padding-top: 22px; border-top: 1px solid var(--hairline); }
.charm-name { font-size: 26px; color: var(--gold-soft); margin: 8px 0; }

/* ---------- small screens ---------- */

@media (max-width: 560px) {
  body { font-size: 17px; }
  h1 { font-size: 28px; }
  .card-grid, .pick-grid { grid-template-columns: 1fr; }
  .play-head { flex-direction: column; gap: 4px; }
  .story-row { flex-direction: column; align-items: stretch; text-align: center; }
}
