.scene {
  position: absolute;
  inset: 0;
  overflow: hidden;
}
/* the same room twice, once in each theme; the light one is cut to a circle around the bulb */
.room {
  position: absolute;
  inset: 0;
  background: var(--card);
  overflow: hidden;
}
.room.theme-light {
  will-change: clip-path;
}

.lamp {
  position: absolute;
  left: 50%;
  top: 0;
  width: 0;
  height: 0;
  transform-origin: 0 0;
  will-change: transform;
}
.head {
  position: absolute;
  left: 0;
  top: 0;
  will-change: transform;
}
.cap {
  position: absolute;
  left: -9px;
  top: -10px;
  width: 18px;
  height: 14px;
  border-radius: 5px 5px 0 0;
  background: var(--muted-2);
}
.shade {
  position: absolute;
  left: -62px;
  top: 0;
  width: 124px;
  height: 66px;
  border-radius: 62px 62px 12px 12px / 58px 58px 12px 12px;
  background: var(--object);
}
.bulb {
  position: absolute;
  left: -19px;
  top: 44px;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: var(--fill-3);
  will-change: transform;
}
/* lit: the system yellow on the bulb in a plain light room. The colour stays on the bulb, never a halo behind it (Noah, 12 Nov 2026) */
.theme-light .bulb {
  background: var(--yellow);
}

.rope {
  position: absolute;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  overflow: visible;
  pointer-events: none;
}
.rope path {
  fill: none;
  stroke: var(--muted-2);
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.bead {
  position: absolute;
  left: -8px;
  top: -3px;
  width: 16px;
  height: 30px;
  border-radius: var(--r-pill);
  background: var(--inverse);
  transform-origin: 8px 3px;
  will-change: transform;
}

/* the one real control: it sits on the bead and follows it */
.grab {
  position: absolute;
  left: -22px;
  top: -12px;
  width: 44px;
  height: 52px;
  border: 0;
  border-radius: var(--r-row);
  background: transparent;
  cursor: grab;
  touch-action: none;
  will-change: transform;
  -webkit-tap-highlight-color: transparent;
}
.grab.is-held {
  cursor: grabbing;
}
.grab:focus-visible {
  outline: 2px solid var(--muted);
  outline-offset: 0;
}

#wake-first {
  --wake-ink:#252525;
  --wake-muted:#555;
  --wake-pause:#4b4b4b;
  --s1: 8px;
  --s2: 16px;
  --s3: 24px;
  --s4: 32px;
  --s5: 40px;
  --gutter: var(--s5);
  --r-pill: 999px;
  --r-row: 8px;
  --muted: #999;
  container-type: inline-size;
  border-radius: 8px;
  overflow: hidden;
  font-family: WantedUI, sans-serif;
  font-weight: 500;
}
#wake-first * {
  box-sizing: border-box;
}
#wake-first [hidden] {
  display: none !important;
}
.theme-dark {
  --card: #171717;
  --muted-2: #888;
  --object: #444;
  --fill-3: #555;
  --inverse: #eee;
}
.theme-light {
  visibility: hidden;
  --card: #fafafa;
  --muted-2: #898989;
  --object: #292929;
  --yellow: #ddd;
  --inverse: #343434;
}
.theme-light .shade {
  background: repeating-linear-gradient(
    93deg,
    #262626 0 5px,
    #323232 6px,
    #292929 9px
  );
}
#wake-first .scene {
  position: relative;
  inset: auto;
  min-height: 592px;
  padding: 272px var(--gutter) var(--s5);
  color: #202020;
  touch-action: pan-x;
}
.night {
  position: absolute;
  top: 280px;
  inset-inline: var(--gutter);
  text-align: center;
  color: #eee;
  font-size: 18px;
  animation: pull-invite 4.2s ease-in-out infinite;
  pointer-events: none;
}
@keyframes pull-invite {
  0%,
  18%,
  100% {
    transform: translateY(0);
  }
  60% {
    transform: translateY(var(--s1));
  }
}
.copy {
  position: relative;
  display: grid;
  justify-items: center;
  gap: var(--s4);
  text-align: center;
  animation: appear 0.8s ease-out;
}
@keyframes appear {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}
.intro,
.next {
  width: min(100%, 280px);
  display: grid;
  justify-items: center;
}
#wake-first h1,
#wake-first h2,
#wake-first p {
  margin: 0;
}
.tagline {
  font-size: 18px;
  line-height: 24px;
  color: #444;
}
#wake-first h1 {
  margin-top: var(--s2);
  font:
    900 84px/1.06 WakeBlack,
    sans-serif;
  letter-spacing: -0.085em;
}
.prepare {
  width: 100%;
  height: 44px;
  margin-top: var(--s5);
}
.player-dock {
  width: max-content;
  max-width: 100%;
  z-index: 1;
}
.next {
  gap: var(--s2);
}
.next h2 {
  font-family: WantedUI, sans-serif;
  font-weight: 500;
  font-size: 28px;
}
.levels {
  display: flex;
  gap: var(--s1);
}
.next button {
  font: inherit;
  border: 1px solid #ccc;
  background: #fff;
  color: #222;
  border-radius: 8px;
  min-height: 44px;
  padding: 0 var(--s2);
  cursor: pointer;
}
.next [aria-pressed="true"] {
  background: #222;
  color: #fff;
}
.next p:empty {
  display: none;
}
@container (max-width:619px) {
  #wake-first .scene {
    --gutter: var(--s4);
    min-height: 560px;
  }
  .tagline {
    font-size: 16px;
  }
  #wake-first h1 {
    font-size: 65px;
  }
}
@media (prefers-reduced-motion: reduce) {
  .night,
  .copy {
    animation: none;
  }
}
.exchange {
  position: absolute;
  inset: 0;
  z-index: 8;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

#wake-first .next {
  width: 100%;
  display: block;
  justify-items: normal;
}
#wake-first .scene.choosing {
  padding-top: 48px;
}
#wake-first .scene.choosing .room > * {
  opacity: 0;
}
#wake-first .scene.choosing .grab {
  visibility: hidden;
}
#wake-first .room > * {
  transition: opacity 0.35s ease;
}

#wake-first .traveller {
  position: absolute;
  z-index: 5;
  pointer-events: none;
  background: #222;
  transform-origin: 0 0;
}
@container (max-width:600px) {
  #wake-first .scene.choosing {
    padding: 32px 16px;
  }
}

#wake-first .scene.choosing {
  padding-top: 56px;
}

@container (max-width:600px) {
  #wake-first .scene.choosing {
    padding-top: 32px;
  }
}
#wake-first .scene.choosing {
  padding: 24px 16px 32px;
  background: var(--card, #fafafa);
}
#wake-first .next {
  width: 100%;
  text-align: center;
}
.print-host {
  text-align: left;
  width: 100%;
}
#wake-first .return-home {
  margin-top: 16px;
  border: 0;
  background: transparent;
  font: inherit;
  font-size: 14px;
  color: inherit;
  text-decoration: underline;
  padding: 10px 16px;
  cursor: pointer;
}
#wake-first {
  width: 100%;
  color-scheme: light;
}
#wake-first {
  border-radius: 0;
  --page-gutter: clamp(18px, 4vw, 72px);
}
#wake-first .scene {
  --intro-top: clamp(264px, 43svh, 580px);
  min-height: 100svh;
  padding: var(--intro-top) var(--page-gutter) 40px;
}
#wake-first .night {
  top: var(--intro-top);
  font-size: clamp(18px, 2vw, 28px);
}
#wake-first h1 {
  font-size: clamp(84px, 10vw, 152px);
}
#wake-first .tagline {
  font-size: clamp(18px, 2vw, 28px);
  line-height: 1.4;
}
#wake-first .intro {
  width: min(100%, 320px);
}
#wake-first .scene.choosing {
  padding: clamp(230px, 26svh, 320px) var(--page-gutter) 24px;
}
#wake-first .scene.choosing .room > * {
  opacity: 1;
}
#wake-first .scene.choosing .grab {
  visibility: visible;
  z-index: 2;
}
#wake-first .next {
  width: min(100%, max(820px, min(83vw, 95svh)));
}
#wake-first .choosing .copy {
  gap: 24px;
}
#wake-first .return-home {
  margin-top: 24px;
}
#wake-first #wake-play-study {
  width: min(100%, 590px);
  background: transparent;
}
#wake-first .scene.playing .player-dock {
  display: none;
}
#wake-first .scene.playing {
  padding: clamp(108px, 15svh, 155px) clamp(4px, 2vw, 24px) 0;
}
.playing .room {
  transform: scale(0.52);
  transform-origin: 50% 0;
  background: transparent;
}
#wake-first .scene.playing {
  background: #fafafa;
}
#wake-first .scene.playing::after {
  content: "";
  position: absolute;
  inset: 0;
  background: #181818;
  opacity: 0;
  transition: opacity 0.62s ease-in-out;
  pointer-events: none;
  z-index: 2;
}
#wake-first .scene.playing.dark-game::after {
  opacity: 1;
}
#wake-first .scene.playing .room {
  z-index: 3;
  height: 260px;
  pointer-events: none;
}
#wake-first .scene.playing .grab,
#wake-first .scene.playing .night {
  z-index: 4;
}

@media (prefers-reduced-motion: reduce) {
  #wake-first .scene.playing::after {
    transition: none;
  }
}
.playing .night {
  top: 145px;
}
