/* Scenario Mapping Game — warm storybook theme. No external fonts or assets. */
:root {
  --ink: #232946;
  --paper: #f6eed9;
  --paper-2: #fffaf0;
  --night: #182036;
  --gold: #e8b860;
  --gold-deep: #c98f2d;
  --teal: #2e6f6a;
  --red-soft: #b3543f;
  --radius: 16px;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: Georgia, "Iowan Old Style", "Times New Roman", serif;
  background: var(--night);
  color: var(--ink);
  min-height: 100vh;
}
.topbar {
  display: flex; justify-content: space-between; align-items: center;
  padding: 12px 18px; color: var(--paper);
  max-width: 860px; margin: 0 auto;
}
.brand { font-weight: bold; letter-spacing: .04em; }
main { max-width: 860px; margin: 0 auto; padding: 0 16px 48px; }
.screen {
  background: var(--paper);
  border-radius: 22px;
  padding: 26px 24px 34px;
  box-shadow: 0 18px 50px rgba(0,0,0,.45);
}
[hidden] { display: none !important; }

h1 { font-size: 2rem; margin: .2em 0 .4em; }
h2 { font-size: 1.35rem; }
button { font-family: inherit; cursor: pointer; }
.ghost-btn {
  background: transparent; border: 1px solid rgba(246,238,217,.5); color: inherit;
  border-radius: 999px; padding: 8px 14px; font-size: .95rem;
}
.screen .ghost-btn { border-color: rgba(35,41,70,.35); }
.big-btn {
  display: inline-block; background: var(--gold); color: #2a1f05; border: none;
  border-radius: 999px; padding: 14px 26px; font-size: 1.05rem; font-weight: bold;
  min-height: 52px;
}
.big-btn:hover { background: var(--gold-deep); color: #fff; }
.big-btn:disabled { opacity: .45; cursor: not-allowed; }
.mid-btn {
  background: var(--teal); color: #fff; border: none; border-radius: 999px;
  padding: 11px 20px; font-size: 1rem; min-height: 48px;
}
.mid-btn:hover { filter: brightness(1.12); }

/* home */
.hero p { font-size: 1.08rem; line-height: 1.55; max-width: 34em; }
.shelf { display: grid; grid-template-columns: 1fr; gap: 16px; }
@media (min-width: 640px) { .shelf { grid-template-columns: 1fr 1fr; } }
.card {
  background: var(--paper-2); border: 2px solid #e4d5ae; border-radius: var(--radius);
  padding: 18px; display: flex; flex-direction: column; gap: 6px;
}
.card h3 { margin: 0; font-size: 1.25rem; }
.card .tagline { margin: 0; font-style: italic; }
.card .meta { margin: 0 0 8px; font-size: .85rem; opacity: .75; }
.card .big-btn { margin-top: auto; align-self: flex-start; }
.continue-note { font-size: 1.02rem; }
.foot-note { opacity: .65; font-size: .88rem; margin-top: 26px; }

/* play */
.play-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.play-head h2 { margin: 0; text-align: center; flex: 1; }
.picture {
  position: relative; overflow: hidden; border-radius: var(--radius);
  aspect-ratio: 16 / 9; margin: 16px 0 6px; background: #0e1526;
  box-shadow: inset 0 0 60px rgba(0,0,0,.5);
}
.picture .plate {
  position: absolute; inset: -4%; width: 108%; height: 108%; object-fit: cover;
  animation: pushin 26s ease-in-out infinite alternate, sway 9s ease-in-out infinite;
}
.picture.art-runaway .plate { filter: saturate(1.05); }
@keyframes pushin { from { transform: scale(1) } to { transform: scale(1.09) } }
@keyframes sway { 0%,100% { translate: 0 0 } 50% { translate: -6px 3px } }
.picture .rain {
  position: absolute; inset: -20%;
  background-image:
    repeating-linear-gradient(105deg, rgba(200,220,255,.20) 0 1px, transparent 1px 26px),
    repeating-linear-gradient(100deg, rgba(200,220,255,.12) 0 1px, transparent 1px 44px);
  animation: rainfall 0.55s linear infinite;
}
.picture[data-tension="3"] .rain { animation-duration: .32s; }
@keyframes rainfall { from { transform: translateY(-30px) } to { transform: translateY(30px) } }
.picture .glow {
  position: absolute; inset: 0; pointer-events: none;
  background: radial-gradient(ellipse 60% 45% at 50% 30%, rgba(255,205,110,.20), transparent 70%);
  animation: lampglow 4.5s ease-in-out infinite;
}
@keyframes lampglow { 0%,100% { opacity: .75 } 50% { opacity: 1 } }
.picture .speedlines { display: none; }
.picture.art-runaway .speedlines {
  display: block; position: absolute; inset: 0;
  background: repeating-linear-gradient(90deg, transparent 0 90px, rgba(255,255,255,.05) 90px 92px);
  animation: rainfall 0.4s linear infinite;
}
.picture.calm .plate, .picture.calm .rain, .picture.calm .glow { animation: none !important; }
.picture.calm .rain { display: none; }
@media (prefers-reduced-motion: reduce) {
  .picture .plate, .picture .rain, .picture .glow { animation: none !important; }
}
.place { font-style: italic; opacity: .75; margin: 8px 0 4px; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; margin: 6px 0 10px; }
.chip {
  background: var(--night); color: var(--paper); border-radius: 999px;
  padding: 6px 13px; font-size: .88rem;
}
.prose { font-size: 1.13rem; line-height: 1.65; }
body.large-text .prose { font-size: 1.32rem; }
.listen-row {
  display: flex; flex-wrap: wrap; gap: 12px; align-items: center; margin: 14px 0 18px;
}
.narrator-label { font-size: .9rem; display: flex; align-items: center; gap: 8px; }
.narrator-label select { font-size: 1rem; padding: 8px; border-radius: 8px; min-height: 44px; }
.choices { display: grid; gap: 12px; }
.choice {
  text-align: left; background: var(--paper-2); border: 2px solid var(--teal);
  border-radius: var(--radius); padding: 15px 18px; font-size: 1.06rem; line-height: 1.4;
  min-height: 56px; display: flex; flex-direction: column; gap: 5px;
}
.choice:hover { background: #eef7f2; }
.choice.closed { border-color: #b9ac8e; color: #6d6450; background: #efe7d2; cursor: not-allowed; }
.closed-reason { font-size: .88rem; font-style: italic; }

/* map */
.map-scroll { overflow-x: auto; background: var(--paper-2); border-radius: var(--radius); border: 2px solid #e4d5ae; }
#map-svg { min-width: 720px; width: 100%; height: auto; display: block; }
.map-line { fill: none; stroke: #a98d4f; stroke-width: 3; }
.map-node circle { fill: var(--paper); stroke: var(--teal); stroke-width: 3; cursor: pointer; }
.map-node.current circle { fill: var(--gold); stroke: var(--gold-deep); }
.map-node.ending circle { stroke: var(--red-soft); }
.map-node text { font-size: 11.5px; fill: var(--ink); font-family: inherit; }
.map-info { min-height: 2.6em; line-height: 1.45; }
.map-help { line-height: 1.5; }

/* mirror */
.mirror-head { text-align: center; }
.ending-card {
  background: var(--paper-2); border: 2px solid var(--gold); border-radius: var(--radius);
  padding: 20px;
}
.ending-card h3 { margin-top: 0; }
.ending-card p { line-height: 1.6; }
.mirror-line { font-style: italic; font-weight: bold; }
.mirror-block { margin-top: 20px; }
.mirror-block h4 { margin-bottom: 6px; }
.mirror-block ul { line-height: 1.55; padding-left: 1.2em; }
.mirror-actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 26px; }

/* settings */
.vol-list { display: grid; gap: 16px; margin: 18px 0; max-width: 480px; }
.vol-list label { display: flex; align-items: center; gap: 12px; font-size: 1.02rem; }
.vol-list input[type="range"] { flex: 1; min-height: 40px; }
.vol-list span { width: 2.4em; text-align: right; font-variant-numeric: tabular-nums; }
.toggle-list { display: grid; gap: 14px; margin-top: 22px; }
.toggle-list label { display: flex; gap: 10px; align-items: center; font-size: 1.02rem; min-height: 44px; }
.toggle-list input { width: 22px; height: 22px; }
