@font-face {
  font-family: Schibsted;
  src: url("fonts/schibsted-grotesk.woff2");
}
* {
  box-sizing: border-box;
}
body {
  margin: 0;
  background: #f4f2ec;
  color: #16161a;
  font-family: Schibsted, system-ui, sans-serif;
}
header {
  padding: 22px 5vw;
  display: flex;
  justify-content: space-between;
  border-bottom: 1px solid #ccc;
}
a {
  color: inherit;
}
main {
  max-width: 1120px;
  margin: 50px auto;
  padding: 0 24px;
}
h1 {
  font-size: clamp(36px, 6vw, 68px);
  letter-spacing: -0.04em;
  margin: 16px 0;
}
h2 {
  font-size: 26px;
}
h1,
h2,
h3 {
  overflow-wrap: anywhere;
}
p {
  line-height: 1.6;
}
.eyebrow {
  color: #3158bd;
  letter-spacing: 0.15em;
  font-size: 13px;
  font-weight: bold;
}
.grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(270px, 1fr));
  gap: 24px;
}
.card {
  background: white;
  border: 1px solid #ddd9ce;
  border-radius: 18px;
  padding: 26px;
  margin: 20px 0;
}
label {
  display: block;
  margin: 18px 0 6px;
  font-weight: 600;
}
input:not([type="checkbox"]),
textarea,
select {
  width: 100%;
  padding: 13px;
  border: 1px solid #aaa;
  border-radius: 8px;
  font: inherit;
  background: white;
}
textarea {
  min-height: 170px;
}
button,
.button {
  display: inline-block;
  cursor: pointer;
  border: 0;
  border-radius: 8px;
  background: #244bd7;
  color: white;
  padding: 13px 19px;
  font: inherit;
  font-weight: 600;
  text-decoration: none;
  margin: 8px 8px 8px 0;
}
button.secondary {
  background: #e7e8ed;
  color: #202338;
}
button.danger {
  background: #a32939;
}
button:disabled {
  opacity: 0.5;
  cursor: wait;
}
small {
  display: block;
  color: #50545e;
  margin: 8px 0;
}
nav {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}
nav button {
  background: #e3e1d7;
  color: #222;
}
nav button[aria-current="true"] {
  background: #244bd7;
  color: white;
}
.secret {
  font-family: monospace;
  font-size: 26px;
  overflow-wrap: anywhere;
  background: #f0f2fa;
  padding: 20px;
}
.qr {
  background: white;
  padding: 16px;
  display: inline-block;
  margin: 16px 0;
}
.qr img {
  max-width: 100%;
  height: auto;
}
#notice {
  position: fixed;
  bottom: 16px;
  left: 5%;
  right: 5%;
  padding: 16px;
  border-radius: 10px;
  background: #172039;
  color: white;
  z-index: 10;
}
#notice:empty {
  display: none;
}
.links a {
  overflow-wrap: anywhere;
}
.display {
  background: #081727;
  color: white;
}
.display header {
  display: none;
}
.display main {
  max-width: none;
  margin: 0;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  text-align: center;
  padding: 5vw;
  background: radial-gradient(ellipse at 20% 20%, #164b5266, transparent 65%);
}
.display .scene {
  max-width: 1000px;
  font-size: clamp(28px, min(4.5vw, 5.5vh), 66px);
  line-height: 1.5;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}
.display main {
  padding: 4vh 5vw;
}
.display h1 {
  font-size: clamp(28px, min(5vw, 6vh), 68px);
}
.display.warm main {
  background: radial-gradient(ellipse at 20% 20%, #794023, transparent 65%);
}
.display.night main {
  background: #10142a;
}
.display .by {
  font-size: 22px;
  color: #cfdfeb;
}
.display .card {
  color: #16161a;
}
.display button {
  font-size: 18px;
}
.scene {
  animation: appear 1.5s ease;
}
@keyframes appear {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}
@media (prefers-reduced-motion: reduce) {
  *,
  *:before,
  *:after {
    animation: none !important;
    transition: none !important;
  }
}
:focus-visible {
  outline: 3px solid #d87816;
  outline-offset: 4px;
}
.session-layout {
  display: grid;
  grid-template-columns: minmax(240px, 1fr) minmax(270px, 1.5fr);
  gap: 24px;
}
.session-layout > * {
  min-width: 0;
}
details {
  margin: 20px 0;
}
summary {
  cursor: pointer;
  font-weight: 600;
  padding: 12px 0;
}
.trash-time {
  padding: 12px;
  background: #fff2de;
  border-radius: 8px;
}
@media (max-width: 700px) {
  .session-layout {
    grid-template-columns: 1fr;
  }
  .session-card {
    padding: 18px;
  }
}
input[type="checkbox"] {
  width: 20px;
  height: 20px;
  vertical-align: middle;
}
pre {
  white-space: pre-wrap;
  font-size: 12px;
}
/* Story Director: a fixed, local, calm palette/effect library. */
.story-stage {
  position: relative;
  isolation: isolate;
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  color: #fff;
  background: #081727;
  --light: #1a5a68;
  --base: #071927;
}
.story-light,
.story-dim {
  position: absolute;
  inset: 0;
  z-index: -2;
  pointer-events: none;
}
.story-light {
  background:
    radial-gradient(ellipse at 25% 30%, var(--light), transparent 70%),
    var(--base);
  opacity: 0.8;
}
.story-dim {
  z-index: -1;
  background: rgba(2, 8, 18, 0.68);
}
.story-content {
  width: 100%;
  max-width: 1000px;
  overflow-wrap: anywhere;
}
.story-content .by {
  color: #e3edf5;
}
.palette-winter-blue {
  --light: #235783;
  --base: #071d37;
}
.palette-aurora-teal {
  --light: #1d655a;
  --base: #082529;
}
.palette-ember-gold {
  --light: #815522;
  --base: #2b180c;
}
.palette-midnight {
  --light: #3c4274;
  --base: #0b1027;
}
.palette-soft-rose {
  --light: #733d62;
  --base: #29152c;
}
.display .story-stage {
  background: transparent;
}
.display .story-light,
.display .story-dim {
  position: fixed;
}
.effect-slow-glow .story-light {
  animation: storyGlow 18s ease-in-out infinite alternate;
}
.effect-aurora-drift .story-light {
  background:
    linear-gradient(120deg, transparent 10%, var(--light) 45%, transparent 80%),
    var(--base);
  background-size: 160% 160%;
  animation: storyAurora 32s ease-in-out infinite alternate;
}
.effect-warm-embers .story-light {
  background:
    radial-gradient(ellipse at 50% 90%, var(--light), transparent 75%),
    var(--base);
  animation: storyGlow 22s ease-in-out infinite alternate;
}
.effect-starfield .story-light {
  background:
    radial-gradient(circle at 20% 30%, #aec5dd66 1px, transparent 2px),
    radial-gradient(circle at 70% 60%, #aec5dd44 1px, transparent 2px),
    var(--base);
  background-size:
    120px 160px,
    180px 220px,
    auto;
  animation: storyStars 60s linear infinite alternate;
}
.effect-soft-rays .story-light {
  background:
    conic-gradient(
      from 30deg at 50% 100%,
      transparent,
      var(--light),
      transparent,
      var(--light),
      transparent
    ),
    var(--base);
  animation: storyGlow 26s ease-in-out infinite alternate;
}
.transition-none .scene {
  animation: none;
}
@keyframes storyGlow {
  from {
    opacity: 0.4;
  }
  to {
    opacity: 0.72;
  }
}
@keyframes storyAurora {
  from {
    background-position: 15% 20%;
  }
  to {
    background-position: 85% 60%;
  }
}
@keyframes storyStars {
  from {
    background-position:
      0 0,
      0 0,
      0 0;
  }
  to {
    background-position:
      8px 16px,
      -12px 8px,
      0 0;
  }
}
@media (prefers-reduced-motion: reduce) {
  .story-light {
    animation: none !important;
    opacity: 0.6 !important;
    background-position: 50% 50% !important;
  }
}
.presentation-summary {
  border-top: 1px solid #ddd;
  margin-top: 20px;
  padding-top: 16px;
}
.presentation-summary p {
  margin: 6px 0;
}
.presentation-status {
  font-weight: 600;
}
.director-dialog {
  max-width: 1160px;
  width: calc(100% - 32px);
  max-height: 94dvh;
  overflow: auto;
  border: 1px solid #bbb;
  border-radius: 18px;
  padding: 24px;
  background: #f4f2ec;
  color: #16161a;
}
.director-dialog::backdrop {
  background: #071021aa;
}
.director-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}
.director-top h2 {
  margin: 0;
}
.director-error {
  color: #9c1728;
  white-space: pre-wrap;
}
.director-preview {
  background: #071927;
  color: white;
  border-radius: 12px;
  overflow: hidden;
  min-height: 320px;
  display: flex;
  align-items: stretch;
  margin-top: 20px;
}
.director-preview .story-stage {
  padding: 24px;
  min-height: 320px;
}
.director-preview .scene {
  font-size: clamp(22px, 2.8vw, 36px);
  line-height: 1.5;
}
.director-preview:fullscreen {
  width: 100vw;
  height: 100dvh;
  border-radius: 0;
}
.director-preview:fullscreen .scene {
  font-size: clamp(28px, min(4.5vw, 5.5vh), 66px);
}
.director-controls {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}
.director-controls select {
  width: auto;
  max-width: 230px;
}
.director-scene {
  border: 1px solid #d5d2c8;
  padding: 16px;
  border-radius: 12px;
  background: white;
  margin-top: 18px;
}
.director-scene textarea {
  min-height: 90px;
}
.director-fields {
  display: grid;
  grid-template-columns: repeat(3, minmax(120px, 1fr));
  gap: 12px;
}
.display-accessibility {
  position: fixed;
  z-index: 20;
  right: 20px;
  bottom: 20px;
  font-size: 18px;
  background: #fff;
  color: #11203b;
  border: 2px solid #11203b;
}
.display-accessibility[hidden] { display: none; }
.display-audio-controls {
  position: fixed; z-index: 20; left: 16px; bottom: 16px; max-width: 420px;
  padding: 12px; background: #10243a; color: #fff; border-radius: 12px;
}
.display-audio-controls p { font-size: 16px; margin: 0 0 8px; }
.display-audio-controls[hidden] { display: none; }
.director-fields label {
  margin-top: 8px;
}
.director-summary {
  padding: 16px;
  background: #e8ecf6;
  border-radius: 10px;
}
.director-publish {
  padding: 18px;
  border: 2px solid #244bd7;
  border-radius: 12px;
  margin-top: 24px;
}
.director-versions {
  margin: 12px 0;
}
.director-dialog button:disabled {
  cursor: not-allowed;
}
@media (max-width: 700px) {
  .director-fields {
    grid-template-columns: 1fr 1fr;
  }
  .director-dialog {
    padding: 16px;
  }
  .director-top {
    align-items: flex-start;
  }
  .director-top h2 {
    font-size: 24px;
  }
  .director-controls button {
    padding: 12px;
  }
  .director-preview .scene {
    font-size: 24px;
  }
}
