/* Chalk — deliberately bare. Nothing is clickable. You can't keep it. */

:root {
  --ground: #f4f1ea;   /* soft off-white, the chalkboard's opposite */
  --ink: #23201b;
  --faint: #8a8377;
  --rule: #d9d3c6;
  --alarm: #7a2e2e;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--ground);
  color: var(--ink);
  font-family: Georgia, "Iowan Old Style", "Palatino Linotype", serif;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

/* No selection, no long-press save, no dragging the image off. */
body {
  user-select: none;
  -webkit-user-select: none;
}

main {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  /* Tightened, not redesigned: the gap and the page padding were half the
     reason a six-beat scene ran off the bottom. */
  gap: 0.85rem;
  padding: 4vh 5vw;
  max-width: 60rem;
  margin: 0 auto;
}

h1 {
  font-weight: normal;
  font-size: 1.1rem;
  letter-spacing: 0.42em;
  text-transform: lowercase;
  color: var(--faint);
  margin: 0 0 1rem;
  padding-left: 0.42em; /* balance the tracking */
}

.scene-no {
  margin: 0 0 0.35rem;
  font-size: 0.8rem;
  letter-spacing: 0.24em;
  text-transform: uppercase;
  color: var(--faint);
}

/* The scene title. */
.prompt {
  font-size: clamp(1.5rem, 4.4vw, 2.35rem);
  line-height: 1.32;
  margin: 0;
  max-width: 22em;
  min-height: 1.32em;
}

/* --- the comic ---------------------------------------------------------
   Panels read as a grid of boxes, like a comic page: each is its own numbered
   frame rather than a line in a running strip. The art line is what you'd see,
   the dialogue sits under it like a bubble, SFX shouts. Boxes reflow to one
   column when the screen is narrow. */
.panels {
  list-style: none;
  counter-reset: panel;
  margin: 1.25rem 0 0;
  padding: 0;
  width: 100%;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(17rem, 1fr));
  gap: 0.9rem;
  text-align: left;
}

.panel {
  counter-increment: panel;
  position: relative;
  border: 1px solid var(--rule);
  border-radius: 4px;
  padding: 2.5rem 1.1rem 1.1rem;
}

.panel::before {
  content: counter(panel);
  position: absolute;
  left: 0.8rem;
  top: 0.8rem;
  font-size: 0.72rem;
  letter-spacing: 0.06em;
  color: var(--faint);
  border: 1px solid var(--rule);
  border-radius: 2px;
  width: 1.4rem;
  height: 1.4rem;
  display: grid;
  place-items: center;
}

.panel-art {
  margin: 0;
  font-size: 0.98rem;
  line-height: 1.45;
}

.panel-say {
  margin: 0.45rem 0 0;
  font-size: 0.94rem;
  line-height: 1.4;
  padding-left: 0.7rem;
  border-left: 2px solid var(--rule);
}

.panel-say .who {
  font-variant: small-caps;
  letter-spacing: 0.06em;
  color: var(--faint);
  margin-right: 0.4rem;
}

.panel-sfx {
  margin: 0.24rem 0 0;
  font-family: "Helvetica Neue", Arial, sans-serif;
  font-weight: 700;
  font-style: italic;
  letter-spacing: 0.1em;
  font-size: 0.92rem;
  opacity: 0.8;
}

.cliff {
  width: 100%;
  text-align: left;
  margin: 0 0 0.9rem;
  padding-top: 0.8rem;
  border-top: 1px solid var(--rule);
  font-size: 1rem;
  line-height: 1.45;
  font-style: italic;
}

/* The clip, centred, on its own — wide letterbox band, the scene's opening shot. */
.stage-media {
  width: min(100%, 46rem);
}

canvas#mark,
video#clip {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 5 / 2;
  object-fit: cover;
  pointer-events: none;    /* nothing clickable */
  border-radius: 2px;
}

/* These id selectors outrank the UA [hidden] rule, so restore it explicitly —
   otherwise the mark and the clip would both show at once. */
canvas#mark[hidden],
video#clip[hidden] {
  display: none;
}

.subtle {
  font-size: 0.8rem;
  opacity: 0.75;
}

.meta {
  margin: 0;
  font-size: 0.95rem;
  color: var(--faint);
  font-style: italic;
}

.runs {
  width: 100%;
  margin-top: 0.5rem;
}

.runs hr {
  border: none;
  border-top: 1px solid var(--rule);
  width: min(100%, 26rem);
  margin: 0.6rem auto 1.1rem;
}

.runs-label {
  font-size: 0.8rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--faint);
  margin: 0 0 0.6rem;
}

.runs-list {
  font-size: 0.85rem;
  color: var(--faint);
  line-height: 1.9;
  margin: 0;
  max-width: 30rem;
  margin-inline: auto;
}

.runs-note {
  font-size: 0.72rem;
  color: var(--faint);
  font-style: italic;
  opacity: 0.8;
  margin: 0.5rem 0 0;
}

.banner {
  margin-top: 1.5rem;
  padding: 0.9rem 1.2rem;
  border: 1px solid var(--alarm);
  color: var(--alarm);
  font-style: italic;
  font-size: 1rem;
  border-radius: 2px;
  max-width: 26rem;
}

@media (prefers-color-scheme: dark) {
  :root {
    --ground: #1a1814;
    --ink: #ece7dc;
    --faint: #8f887a;
    --rule: #34302a;
    --alarm: #d98a8a;
  }
}
