/* Marilyn — LPS shell chrome + J&A-style filmstrip */
:root {
  --bg: #070b10;
  --panel: #10161e;
  --line: #243040;
  --text: #eef1f6;
  --muted: #9aa6b8;
  --dim: #6a7588;
  --cyan: #5ee7ff;
  --gold: #d4a84b;
  --safe-b: env(safe-area-inset-bottom, 0px);
  --safe-t: env(safe-area-inset-top, 0px);
}
* { box-sizing: border-box; margin: 0; padding: 0; }
html { -webkit-text-size-adjust: 100%; background: var(--bg); color-scheme: dark; }

/* Same column math as J&A: 8 thumbs before scroll */
body {
  --ja-thumb: 5.5rem;
  --ja-thumb-gap: 0.4rem;
  --ja-thumbs-n: 8;
  --shell-pad-x: 0.9rem;
  --shell-content-max: calc(
    (var(--ja-thumbs-n) * var(--ja-thumb)) +
    ((var(--ja-thumbs-n) - 1) * var(--ja-thumb-gap)) +
    (2 * var(--shell-pad-x))
  );
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  background: var(--bg); /* solid dark — no gradient haze */
  color: var(--text);
  line-height: 1.55;
  min-height: 100dvh;
  padding-bottom: calc(0.5rem + var(--safe-b));
}
a { color: var(--cyan); text-decoration: none; }
a:hover { text-decoration: underline; }

/* Column alignment (shell also sets this; keep in sync if shell loads first) */
header.bar > .bar-top,
header.bar > nav.topnav,
main.wrap,
.wrap,
.page-footer {
  width: 100%;
  max-width: var(--shell-content-max);
  margin-left: auto;
  margin-right: auto;
  padding-left: var(--shell-pad-x);
  padding-right: var(--shell-pad-x);
  box-sizing: border-box;
}

/* Don't fight shell bar — only page widgets below */
main.wrap {
  padding-top: 0.65rem;
  padding-bottom: 1.25rem;
}

h1.contest-page-title {
  /* shell owns type; ensure no local override fights */
  margin: 0 0 0.45rem;
}
main.wrap .dates {
  color: var(--gold);
  font-size: 0.95rem;
  font-weight: 600;
  margin: 0 0 0.85rem;
}
main.wrap .hint {
  color: var(--dim);
  font-size: 0.78rem;
  margin: 0 0 0.55rem;
  letter-spacing: 0.02em;
}
.prose {
  color: var(--muted);
  max-width: 40em;
  font-size: 0.98rem;
}
.prose p { margin-bottom: 0.9rem; }
.prose .sig {
  color: var(--text);
  font-weight: 600;
  margin-top: 1.1rem;
}

.hero {
  display: grid;
  grid-template-columns: minmax(0, 260px) 1fr;
  gap: 1.15rem;
  align-items: start;
  margin-bottom: 1.1rem;
}
.content-card.hero,
.hero {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 0.85rem 0.95rem;
}
.hero img {
  width: 100%;
  height: auto;
  border-radius: 10px;
  display: block;
  object-fit: contain;
  background: #0a1018;
}
.hero .cap {
  font-size: 0.78rem;
  color: var(--dim);
  margin-top: 0.4rem;
  text-align: center;
}
.note-box {
  margin-top: 1rem;
  padding: 0.75rem 0.9rem;
  border: 1px dashed var(--line);
  border-radius: 10px;
  font-size: 0.8rem;
  color: var(--dim);
  max-width: 40em;
}
.note-box strong { color: var(--muted); }

/* Filmstrip = J&A thumbscroll */
.viewer { margin-top: 0.1rem; width: 100%; }
.filmstrip {
  display: flex;
  gap: var(--ja-thumb-gap);
  overflow-x: auto;
  overflow-y: hidden;
  padding: 0.35rem 0 0.55rem;
  -webkit-overflow-scrolling: touch;
  scroll-snap-type: x proximity;
  width: 100%;
  box-sizing: border-box;
  border-bottom: 1px solid var(--line);
  margin-bottom: 0.65rem;
  scrollbar-width: thin;
  scrollbar-color: #2a3848 transparent;
}
.filmstrip::-webkit-scrollbar { height: 6px; }
.filmstrip::-webkit-scrollbar-thumb {
  background: #2a3848;
  border-radius: 3px;
}
.film-item {
  flex: 0 0 auto;
  width: var(--ja-thumb);
  padding: 0;
  border: 2px solid transparent;
  border-radius: 8px;
  background: #0a1018;
  cursor: pointer;
  overflow: hidden;
  scroll-snap-align: start;
  font-family: inherit;
  color: inherit;
  appearance: none;
  -webkit-appearance: none;
}
.film-item:hover { border-color: rgba(94, 231, 255, 0.35); }
.film-item.active { border-color: var(--cyan); }
.film-item img {
  display: block;
  width: 100%;
  height: 4.4rem;
  object-fit: cover;
  background: #0a1018;
}
/* Captions live on stage only (J&A pattern) */
.film-item .cap { display: none; }

.stage {
  width: 100%;
  text-align: center;
  margin-top: 0.1rem;
}
.stage-caption {
  font-size: clamp(1.05rem, 4vw, 1.25rem);
  font-weight: 600;
  color: #f0f4fa;
  margin: 0 0 0.55rem;
  min-height: 0;
  line-height: 1.35;
}
.stage-caption:empty { display: none; }
.stage img {
  display: block;
  width: auto;
  max-width: 100%;
  height: auto;
  max-height: min(72vh, 820px);
  margin: 0 auto;
  object-fit: contain;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: #0a1018;
  image-rendering: auto;
}

.notice-inline {
  width: 100%;
  text-align: center;
}
.notice-inline img {
  display: block;
  width: auto;
  max-width: 100%;
  height: auto;
  margin: 0 auto;
  border-radius: 10px;
  border: 1px solid var(--line);
}

/* Footer — shell .page-footer */
.page-footer {
  margin: 1.1rem auto 0;
  text-align: center;
  border: none;
}
.page-footer .last-updated,
.page-footer #lastUpdated {
  margin: 0;
  font: 600 0.78rem/1.35 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  letter-spacing: 0.02em;
  color: var(--dim);
}

@media (max-width: 520px) {
  .hero { grid-template-columns: 1fr; }
}
