:root {
  font-family: "Segoe UI", system-ui, sans-serif;
  color: #17354c;
  background: #edf5fb;
  --ink-muted: #416079;
  --line: #adc6d9;
  --mono: ui-monospace, Consolas, monospace;
  --palette-white: #fff;
  --palette-silver: #e2edf4;
  --palette-ice: #cdeaff;
  --palette-blue: #0868a4;
  --palette-navy: #17354c;
}

* { box-sizing: border-box; }
body { margin: 0; }
[hidden] { display: none !important; }
button { font: inherit; cursor: pointer; }
button:focus-visible { outline: 3px solid #195a85; outline-offset: 4px; }

.screen {
  display: grid;
  min-height: 100vh;
  min-height: 100svh;
  place-items: center;
  padding: 24px 16px;
  background:
    radial-gradient(ellipse at 78% 28%, #fff, transparent 54%),
    radial-gradient(ellipse at 12% 72%, #c8e2f6, transparent 58%),
    linear-gradient(145deg, #f8fcff, #dceaf4);
}

.frame { width: min(100%, 740px); }

.masthead, .panel-header, .footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.masthead { margin-bottom: 14px; padding-inline: 4px; }
h1 { margin: 0; font-size: clamp(1rem, 3vw, 1.25rem); font-weight: 650; }
.mark { margin-right: 4px; color: #286b94; }

.case-number, .channel, .trace, .state, .footer {
  font: 600 .7rem / 1.5 var(--mono);
  letter-spacing: .08em;
  color: var(--ink-muted);
}

.case-number, .channel { white-space: nowrap; }
.case-number { border: 1px solid var(--line); border-radius: 4px; padding: 4px 7px; }

.panel {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  padding: clamp(16px, 5vw, 38px);
  border: 1px solid #fff;
  border-radius: 22px;
  background: linear-gradient(140deg, #ffffffdb, #edf7ffb8);
  box-shadow: 0 24px 70px #416d9129, inset 0 0 0 1px #bcd3e366;
  backdrop-filter: blur(14px);
}

.panel-header {
  padding-bottom: 14px;
  border-bottom: 1px solid var(--line);
}

h2 { margin: 0; font-size: clamp(.85rem, 2.5vw, 1rem); font-weight: 600; }

.signal {
  display: inline-block;
  width: 7px;
  height: 7px;
  margin-left: 3px;
  border-radius: 50%;
  background: #327fac;
  box-shadow: 0 0 9px #67b7ea;
}

.orbit {
  position: absolute;
  z-index: -1;
  inset: 0;
  overflow: hidden;
  display: grid;
  grid-template-rows: minmax(0, 1fr);
  place-items: center;
  pointer-events: none;
  background: radial-gradient(ellipse at center, #ceeaffc2, transparent 63%);
}

.orbit svg { width: min(96%, clamp(270px, 68vw, 450px)); max-height: 100%; }
.orbit-halo { fill: none; stroke: #99c8e82c; stroke-width: 13; }
.orbit-track { fill: none; stroke: #76a7ca80; stroke-dasharray: 2 3; }
.orbit-pulse {
  fill: none;
  stroke: #329bd4;
  stroke-width: 1.5;
  stroke-linecap: round;
  stroke-dasharray: 9 91;
  opacity: 0;
}
.orbit-points { fill: #357fae; filter: drop-shadow(0 0 4px #64b9ef); }

.connecting .orbit svg { animation: expand-orbit 1.7s 2.5s ease-out both; }
.connecting .orbit-halo { animation: strengthen-halo .8s 1.65s ease-out both; }
.connecting .orbit-pulse { animation: send-pulse 2.45s linear both; }
.connecting .state { animation: receive-signal .55s 1.55s ease-out both; }
.connecting .years span, .connecting .recipients, .connecting .orbit-points circle {
  animation: reveal .3s var(--arrival) ease-out both;
}
.years span:nth-child(1) { --arrival: 2.55s; }
.years span:nth-child(2) { --arrival: 3.15s; }
.years span:nth-child(3) { --arrival: 3.75s; }
.recipients { --arrival: 4.5s; }
.orbit-points circle:nth-child(1) { --arrival: 4.65s; }
.orbit-points circle:nth-child(2) { --arrival: 4.8s; }
.orbit-points circle:nth-child(3) { --arrival: 4.95s; }
.orbit-points circle:nth-child(4) { --arrival: 5.1s; }
.orbit-points circle:nth-child(5) { --arrival: 5.25s; }
.orbit-points circle:nth-child(6) { --arrival: 5.4s; }
.orbit-points circle:nth-child(7) { --arrival: 5.55s; }
.orbit-points circle:nth-child(8) { --arrival: 5.7s; }

@keyframes expand-orbit { from { transform: scale(.88); } to { transform: scale(1); } }
@keyframes strengthen-halo { from { opacity: .45; } to { opacity: 1; } }
@keyframes send-pulse {
  0% { opacity: 0; stroke-dashoffset: 25; }
  10% { opacity: .85; }
  70% { opacity: .85; }
  100% { opacity: 0; stroke-dashoffset: -100; }
}
@keyframes receive-signal {
  0% { opacity: 0; transform: translateX(-2px); clip-path: inset(45% 0 30%); }
  20% { opacity: .55; transform: translateX(1px); clip-path: inset(20% 0 25%); }
  42%, 100% { opacity: 1; transform: none; clip-path: inset(0); }
}
@keyframes reveal { from { opacity: 0; } to { opacity: 1; } }

.transmission {
  display: grid;
  justify-items: center;
  align-content: center;
  gap: 9px;
  min-height: clamp(230px, 42vh, 340px);
  padding-block: 20px;
  text-align: center;
}

.transmission p { position: relative; margin: 0; min-height: 1lh; }
.state { font-size: .8rem; color: #22577c; }
.years { font-size: clamp(1.8rem, 9vw, 5.5rem); font-weight: 300; line-height: 1.16; white-space: nowrap; }
.years span { display: inline-block; }
.recipients { font-size: clamp(.875rem, 3vw, 1rem); color: var(--ink-muted); }

.typing::after {
  position: absolute;
  top: .2em;
  left: calc(100% + 4px);
  width: 2px;
  height: .85em;
  background: #327fac;
  content: "";
  animation: blink .8s step-end infinite;
}

@keyframes blink { 50% { opacity: 0; } }

.actions { display: grid; justify-items: center; min-height: 54px; }
.actions button { min-height: 48px; border-radius: 9px; }
.skip { padding: 8px 14px; border: 1px solid transparent; color: #285573; background: transparent; text-decoration: underline; text-underline-offset: 4px; }
.skip:hover { border-color: var(--line); }
.continue {
  width: min(100%, 315px);
  padding: 12px 20px;
  border: 1px solid #7aa5c6;
  background: linear-gradient(115deg, #fff, #d6ebfd);
  color: #17354c;
  box-shadow: 0 6px 24px #71a7d039;
  font-size: .9rem;
  font-weight: 650;
  letter-spacing: .12em;
  text-transform: uppercase;
}
.continue:hover { background: #cce6fa; }
.continue.arriving { animation: reveal .55s ease-out both; }
.continue span { margin-left: 12px; }
.notice { min-height: 1.5em; margin: 8px 0 0; text-align: center; color: var(--ink-muted); font-size: .875rem; line-height: 1.5; }
.footer { margin-top: 14px; padding-inline: 4px; }

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

@media (prefers-reduced-motion: reduce) {
  .connecting *, .typing::after, .continue.arriving { animation: none !important; }
}

.archive-brand { margin: 0; font-size: clamp(1rem, 3vw, 1.25rem); font-weight: 650; }
.archive h1 { letter-spacing: .09em; }
.archive-log {
  display: grid;
  gap: 7px;
  margin-block: 16px;
  padding: 10px 12px;
  border-inline-start: 2px solid #7aa5c6;
  background: #ffffff65;
  color: var(--ink-muted);
  font-size: .875rem;
  line-height: 1.4;
}
.archive-log p { margin: 0; }
.archive-log p:last-child { color: #22577c; font-weight: 600; }
.archive-photo {
  position: relative;
  height: clamp(190px, 70vw, 405px);
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: linear-gradient(145deg, #dcebf6, #f7fcff);
  touch-action: pan-y pinch-zoom;
}
.archive-photo img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
  background: inherit;
}
.archive-controls {
  display: grid;
  grid-template-columns: 48px 1fr 48px;
  align-items: center;
  gap: 8px;
  margin-top: 8px;
}
.archive-controls button {
  min-height: 48px;
  border: 1px solid #7aa5c6;
  border-radius: 9px;
  color: #22577c;
  background: #f4faff;
  font-size: 1.3rem;
}
.archive-controls button:hover { background: #dceefa; }
.archive-count { margin: 0; text-align: center; color: var(--ink-muted); font: 600 .78rem var(--mono); }
.archive-quote {
  margin: 16px auto;
  max-width: 34ch;
  color: #22577c;
  text-align: center;
  font-size: clamp(.95rem, 3vw, 1.12rem);
  line-height: 1.45;
}

@media (prefers-reduced-motion: no-preference) {
  .archive { animation: archive-in .3s ease-out both; }
  .archive-log p, .archive-content { animation: archive-reveal .35s ease-out both; }
  .archive-log p:nth-child(1) { animation-delay: .25s; }
  .archive-log p:nth-child(2) { animation-delay: 1.25s; }
  .archive-log p:nth-child(3) { animation-delay: 2.25s; }
  .archive-content { animation-delay: 3.15s; }
}
@keyframes archive-in { from { opacity: 0; transform: translateY(5px); } }
@keyframes archive-reveal { from { opacity: 0; visibility: hidden; } to { opacity: 1; visibility: visible; } }

.screen:has(> #archive-screen:not([hidden])) {
  background: #b1d5f2 url("../assets/images/signal-hall.jpg") center / cover fixed;
}

#archive-screen { width: min(100%, 1180px); color: #0c2451; }
#archive-screen .masthead {
  margin-bottom: 10px;
  padding: 10px 16px;
  border: 1px solid #effaff;
  border-radius: 12px;
  background: linear-gradient(105deg, #f6fbfff5, #c7e5ffd9);
  box-shadow: 0 0 16px #a2edff80;
  letter-spacing: .065em;
}
#archive-screen .panel {
  border-color: #f0fdff;
  background: linear-gradient(145deg, #eaf5ffec, #cde6f8df 54%, #edf8ffed);
  box-shadow: 0 0 26px #76e4ffc4, inset 0 0 24px #f4fbff;
  backdrop-filter: blur(10px);
}
#archive-screen .panel-header {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  border: 0;
  padding-bottom: 0;
}
#archive-title {
  grid-column: 2;
  padding: 5px clamp(14px, 4vw, 52px);
  border: 1px solid #1597d8;
  border-radius: 12px;
  background: linear-gradient(#f6fcff, #c7e5f8);
  box-shadow: 0 0 12px #72d8fc, inset 0 0 7px #fff;
  text-align: center;
  font-size: clamp(1.35rem, 4vw, 2.75rem);
  letter-spacing: .07em;
}
#archive-screen .channel {
  justify-self: end;
  padding: 4px 10px;
  border: 1px solid #f4fcff;
  border-radius: 20px;
  background: #e6f3ff;
  color: #173d67;
}
#archive-screen .archive-log {
  width: min(100%, 920px);
  margin-inline: auto;
  padding: 0;
  border: 0;
  background: transparent;
  color: inherit;
  font-size: clamp(.88rem, 1.8vw, 1.07rem);
}
#archive-screen .archive-gallery {
  display: grid;
  grid-template-columns: 48px minmax(0, 1fr) 48px;
  grid-template-areas: "previous photo next" ". count .";
  gap: 10px;
  align-items: center;
  width: min(100%, 1030px);
  margin-inline: auto;
}
#archive-screen .archive-photo {
  grid-area: photo;
  height: clamp(235px, 34vh, 375px);
  border: 2px solid #effcff;
  border-radius: 18px;
  background: radial-gradient(ellipse at center, #e6f2fa, #b8d8f2);
  box-shadow: 0 0 14px #70d7f9, 0 4px 22px #386e9c44;
}
#archive-screen .archive-controls { display: contents; }
#archive-screen .archive-prev { grid-area: previous; }
#archive-screen .archive-next { grid-area: next; }
#archive-screen .archive-count { grid-area: count; color: inherit; }
#archive-screen .archive-controls button {
  border-color: #f5fcff;
  background: linear-gradient(#f8fcff, #cfebfc);
  box-shadow: 0 0 10px #c4f3ff;
  color: #123562;
}
#archive-screen .archive-controls button:hover { background: #bde7ff; }
.archive-dots {
  grid-area: photo;
  align-self: end;
  justify-self: center;
  z-index: 1;
  display: flex;
  gap: 7px;
  margin-bottom: 10px;
  padding: 6px 9px;
  border-radius: 20px;
  background: #0b294bc4;
  pointer-events: none;
}
.archive-dots span { width: 8px; height: 8px; border: 1px solid #fff; border-radius: 50%; }
.archive-dots .is-current { background: #d8fbff; box-shadow: 0 0 8px 2px #48d7ff; }
#archive-screen .archive-quote {
  max-width: min(100%, 840px);
  padding: 8px 14px;
  border: 1px solid #f4fbff;
  border-radius: 10px;
  background: #f1f9ffa8;
  color: inherit;
  font: italic 600 clamp(1rem, 2vw, 1.25rem) / 1.4 Georgia, serif;
}
#find-participants {
  width: min(100%, 470px);
  min-height: 56px;
  border: 2px solid #b9f7ff;
  border-radius: 14px;
  background: linear-gradient(#147ebc, #074077);
  box-shadow: 0 0 14px #55cfff, inset 0 0 10px #91e9ff80;
  color: #fff;
  letter-spacing: .075em;
}
#find-participants:hover { background: linear-gradient(#187ab1, #092d66); }
.archive-hint { margin: 8px 0 0; text-align: center; font-style: italic; }
#archive-screen .footer { color: #0c2451; background: #e5f3ffeb; border-radius: 8px; padding: 5px 10px; }

@media (max-width: 600px) {
  .screen:has(> #archive-screen:not([hidden])) {
    background-image: url("../assets/images/signal-hall-mobile.jpg");
    background-position: 62% center;
  }
  #archive-screen .masthead { padding-inline: 9px; letter-spacing: 0; }
  #archive-screen .panel-header { grid-template-columns: minmax(0, 1fr) auto; }
  #archive-title { grid-column: 1; padding-inline: 5px; letter-spacing: .03em; }
  #archive-screen .channel { padding-inline: 6px; }
  #archive-screen .archive-gallery {
    grid-template-areas: "photo photo photo" "previous count next";
  }
  #archive-screen .archive-photo { height: clamp(200px, 67vw, 300px); }
  #find-participants { padding-inline: 8px; }
}

.participants { width: min(100%, 1040px); }
.participants h1 { font-size: clamp(1rem, 4vw, 1.5rem); letter-spacing: .06em; }
.participants-intro { margin: 14px 0 20px; color: var(--ink-muted); line-height: 1.5; }

.case-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 12px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.case-card {
  display: grid;
  grid-template-columns: minmax(0, 36%) minmax(0, 1fr);
  align-items: start;
  gap: 10px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 13px;
  background: linear-gradient(145deg, #ffffffdc, #e6f4fdda);
  box-shadow: 0 4px 14px #71a7d01a;
}

.case-portrait {
  display: block;
  width: 100%;
  aspect-ratio: 4 / 5;
  object-fit: contain;
  border: 1px solid #cfdfec;
  border-radius: 8px;
  background: #e9f3fa;
}

.case-label { color: var(--ink-muted); font: 600 .72rem var(--mono); letter-spacing: .08em; }
.case-details h2 { margin: 5px 0 9px; font-size: .95rem; overflow-wrap: anywhere; }
.case-open {
  min-height: 44px;
  width: 100%;
  padding: 6px;
  border: 1px solid #7aa5c6;
  border-radius: 8px;
  color: #17354c;
  background: linear-gradient(115deg, #fff, #d6ebfd);
  text-transform: uppercase;
  font-size: .72rem;
  font-weight: 650;
  letter-spacing: .05em;
}
.case-open:hover { background: #cce6fa; }
.case-notice { margin: 0; color: var(--ink-muted); font-size: .8rem; line-height: 1.35; }
.case-notice:not(:empty) { margin-top: 8px; }

@media (min-width: 560px) {
  .case-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (min-width: 800px) {
  .case-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .case-card { grid-template-columns: minmax(0, 1fr); }
  .case-details h2 { min-height: 2.5em; }
}

@media (prefers-reduced-motion: no-preference) {
  .case-card { animation: case-reveal .35s ease-out both; animation-delay: var(--case-delay, 0s); }
  .case-card:nth-child(2) { --case-delay: .07s; }
  .case-card:nth-child(3) { --case-delay: .14s; }
  .case-card:nth-child(4) { --case-delay: .21s; }
  .case-card:nth-child(5) { --case-delay: .28s; }
  .case-card:nth-child(6) { --case-delay: .35s; }
  .case-card:nth-child(7) { --case-delay: .42s; }
  .case-card:nth-child(8) { --case-delay: .49s; }
}
@keyframes case-reveal { from { opacity: 0; transform: translateY(6px); } }

.screen:has(> #participants-screen:not([hidden])) {
  background: #b1d5f2 url("../assets/images/signal-hall.jpg") center / cover fixed;
}
#participants-screen { width: min(100%, 1260px); color: #0c2451; }
#participants-screen .masthead, #participants-screen .footer {
  padding: 9px 14px;
  border: 1px solid #effaff;
  border-radius: 10px;
  background: linear-gradient(105deg, #f6fbfff5, #c7e5ffeb);
  box-shadow: 0 0 14px #a2edff85;
}
#participants-screen .footer { color: inherit; }
#participants-screen .panel {
  border-color: #effcff;
  background: linear-gradient(145deg, #eaf5ffec, #cde6f8df 54%, #edf8ffed);
  box-shadow: 0 0 26px #76e4ffc4, inset 0 0 24px #f4fbff;
  backdrop-filter: blur(10px);
}
#participants-screen .panel-header {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  padding-bottom: 0;
  border: 0;
}
#participants-title {
  grid-column: 2;
  padding: 6px clamp(12px, 4vw, 52px);
  border: 1px solid #1597d8;
  border-radius: 12px;
  background: linear-gradient(#f6fcff, #c7e5f8);
  box-shadow: 0 0 12px #72d8fc, inset 0 0 7px #fff;
  text-align: center;
  font-size: clamp(1.25rem, 4vw, 2.75rem);
}
#participants-screen .channel {
  justify-self: end;
  padding: 4px 8px;
  border: 1px solid #f4fcff;
  border-radius: 20px;
  background: #e6f3ff;
}
#participants-screen .participants-intro { text-align: center; color: inherit; font-weight: 600; }
#participants-screen .case-grid { gap: 17px 14px; }
#participants-screen .case-card {
  position: relative;
  border-color: #f5fcff;
  background: linear-gradient(150deg, #f4fbfff2, #c5e5f9d9);
  box-shadow: 0 0 9px #81dfff, inset 0 0 8px #fff;
}
#participants-screen .case-card::before {
  position: absolute;
  top: -5px;
  left: 14px;
  width: 42px;
  height: 5px;
  border: 1px solid #effcff;
  border-bottom: 0;
  border-radius: 5px 7px 0 0;
  background: #e7f7ff;
  content: "";
}
#participants-screen .case-portrait { border-color: #f3fcff; }
#participants-screen .case-label {
  display: inline-block;
  padding: 3px 8px;
  border: 1px solid #f4fcff;
  border-radius: 16px;
  background: #e6f4ff;
  color: inherit;
}
#participants-screen .case-open {
  border-color: #b9f7ff;
  background: linear-gradient(#147ebc, #074077);
  color: #fff;
}
#participants-screen .case-open:hover { background: linear-gradient(#187ab1, #092d66); }
.participants-hint {
  margin: 20px 0 0;
  padding: 10px;
  border: 1px solid #f4fcff;
  border-radius: 12px;
  background: #eaf6ffb0;
  text-align: center;
}
@media (min-width: 1060px) {
  #participants-screen .case-card { grid-template-columns: minmax(0, 40%) minmax(0, 1fr); }
}
@media (max-width: 600px) {
  .screen:has(> #participants-screen:not([hidden])) {
    background-image: url("../assets/images/signal-hall-mobile.jpg");
    background-position: 62% center;
  }
  #participants-screen .masthead { padding-inline: 9px; }
  #participants-screen .panel-header { grid-template-columns: minmax(0, 1fr) auto; }
  #participants-title { grid-column: 1; padding-inline: 5px; letter-spacing: .035em; }
}

.invitation { overflow-wrap: anywhere; }
.invitation .panel-header { flex-wrap: wrap; }
.invitation h1 { letter-spacing: .06em; }
#invitation-name { margin: 18px 0 12px; font-size: clamp(1.2rem, 5vw, 1.8rem); }
.invitation-quote {
  margin: 0;
  padding: 12px 15px;
  border-inline-start: 2px solid #7aa5c6;
  background: #ffffff85;
  color: #22577c;
  font-size: clamp(1rem, 4vw, 1.25rem);
  line-height: 1.5;
}
#invitation-text { margin: 18px 0; white-space: pre-wrap; line-height: 1.6; }
.invitation-event {
  margin: 20px 0;
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: linear-gradient(145deg, #ffffffb5, #dff1fcaa);
  box-shadow: 0 4px 20px #71a7d02b;
}
.invitation-event h2 { letter-spacing: .08em; }
.invitation-event dl {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 180px), 1fr));
  gap: 12px;
  margin: 12px 0 0;
}
.invitation-event dt { color: var(--ink-muted); font-size: .8rem; }
.invitation-event dd { margin: 4px 0 0; font-weight: 600; }
.invitation-back { display: block; min-height: 44px; margin-inline: auto; border-radius: 8px; }
#attendance-screen .invitation-quote { margin-block: 18px; }
.meeting-location p { margin: 8px 0; }
.meeting-location .case-label { display: block; }
.meeting-coordinates { font: 600 1rem / 1.5 var(--mono); }
#meeting-copy { min-height: 44px; }
.meeting-navigator { display: grid; place-items: center; min-height: 48px; border-radius: 9px; text-align: center; text-decoration: none; }
.meeting-navigator:focus-visible { outline: 3px solid #195a85; outline-offset: 4px; }

.screen:has(> .final-secret:not([hidden]), > .final-disconnect:not([hidden])) {
  background: #c7e1f4 url("../assets/images/signal-hall.jpg") center / cover;
}
.final-secret, .final-disconnect { text-align: center; color: #0c2451; }
.final-secret .panel, .final-disconnect .panel {
  border-color: #effcff;
  background: linear-gradient(145deg, #f4fbfff4, #cde6f8e8);
  box-shadow: 0 0 26px #76e4ffc4, inset 0 0 24px #f4fbff;
}
.final-secret h1, .final-disconnect h1 {
  font-size: clamp(1.25rem, 4vw, 2.2rem);
  letter-spacing: .06em;
  overflow-wrap: anywhere;
}
.final-secret p { margin: 20px auto; max-width: 34ch; font-size: clamp(1.05rem, 3vw, 1.45rem); line-height: 1.5; }
#secret-coordinates, #finish-connection { min-height: 48px; }
#secret-coordinates {
  border: 2px solid #b9f7ff;
  border-radius: 12px;
  background: linear-gradient(#147ebc, #074077);
  box-shadow: 0 0 14px #55cfff;
  color: #fff;
}
#secret-coordinates:hover { background: linear-gradient(#187ab1, #092d66); }
#disconnect-number, #disconnect-farewell {
  margin: 14px 0;
  font-size: clamp(3rem, 12vw, 6rem);
  font-weight: 700;
  line-height: 1.15;
  text-shadow: 0 0 20px #8be7ff;
}
#disconnect-farewell { color: #f4fcff; text-shadow: 0 2px 16px #103254, 0 0 18px #2d9ad5; }
.final-disconnect.is-ending .panel { animation: disconnect-fade 3s ease-in both; }
.screen:has(> .final-disconnect.is-ended:not([hidden])) { background: #06101e; }
.final-disconnect.is-ended { color: #eaf8ff; }
#reopen-coordinates {
  min-height: 44px;
  margin-top: 20px;
  border: 1px solid #7299b5;
  border-radius: 9px;
  padding: 8px 12px;
  color: #caebff;
}
#reopen-coordinates:focus-visible { outline-color: #a1e9ff; }
.disconnect-overlay {
  position: fixed;
  inset: 0;
  z-index: 100;
  pointer-events: none;
  animation: disconnect-dark 150ms step-end both;
}
.disconnect-image, .disconnect-flash, .disconnect-dot { position: absolute; }
.disconnect-image {
  inset: 0;
  display: grid;
  place-items: center;
  background: #d6f7ff url("../assets/images/signal-hall.jpg") center / cover;
  box-shadow: 0 0 28px #73e4ff;
  transform-origin: center;
  animation: disconnect-collapse 460ms 150ms both;
}
.disconnect-image span {
  color: #f4fcff;
  font-size: clamp(3rem, 12vw, 6rem);
  font-weight: 700;
  text-shadow: 0 2px 16px #103254;
}
.disconnect-flash {
  inset: 0;
  background: radial-gradient(ellipse at center, #f5fcff, #b6e9fc);
  animation: disconnect-flash 150ms ease-out both;
}
.disconnect-dot {
  top: 50%;
  left: 50%;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #f5ffff;
  box-shadow: 0 0 14px 4px #77e9ff;
  transform: translate(-50%, -50%);
  opacity: 0;
  animation: disconnect-dot 100ms 510ms ease-out forwards;
}
#disconnect-ended:not([hidden]) { animation: disconnect-appear 260ms ease-out both; }
@keyframes disconnect-fade {
  65% { opacity: .95; box-shadow: 0 0 10px #76e4ff55; }
  to { opacity: .55; box-shadow: 0 0 2px #76e4ff22; }
}
@keyframes disconnect-dark { to { background: #06101e; } }
@keyframes disconnect-flash {
  0%, 100% { opacity: 0; }
  42% { opacity: .85; }
}
@keyframes disconnect-collapse {
  0% { opacity: 1; transform: scale(1); }
  54% { transform: scale(1, .006); background-image: none; animation-timing-function: ease-in; }
  78% { opacity: 1; transform: scale(.003, .006); background-image: none; }
  79%, 100% { opacity: 0; transform: scale(.003, .006); background-image: none; }
}
@keyframes disconnect-dot {
  from { opacity: 1; transform: translate(-50%, -50%) scale(1); }
  to { opacity: 0; transform: translate(-50%, -50%) scale(.1); }
}
@keyframes disconnect-appear { from { opacity: 0; } to { opacity: 1; } }
@media (max-width: 600px) {
  .screen:has(> .final-secret:not([hidden]), > .final-disconnect:not([hidden])) {
    background-image: url("../assets/images/signal-hall-mobile.jpg");
  }
  .screen:has(> .final-disconnect.is-ended:not([hidden])) { background: #06101e; }
  .disconnect-image { background-image: url("../assets/images/signal-hall-mobile.jpg"); }
}
@media (prefers-reduced-motion: reduce) {
  .final-disconnect.is-ending .panel { animation: none; }
  .disconnect-overlay { display: none; }
  #disconnect-ended:not([hidden]) { animation: none; }
}

.screen:has(> #invitation-screen:not([hidden])) {
  background: #b1d5f2 url("../assets/images/signal-hall.jpg") center / cover fixed;
}
#invitation-screen { width: min(100%, 1140px); color: #0c2451; }
#invitation-screen .masthead, #invitation-screen .footer {
  padding: 9px 14px;
  border: 1px solid #effaff;
  border-radius: 10px;
  background: linear-gradient(105deg, #f6fbfff5, #c7e5ffeb);
  box-shadow: 0 0 14px #a2edff85;
}
#invitation-screen .footer { color: inherit; }
#invitation-screen .panel {
  border-color: #effcff;
  background: linear-gradient(145deg, #eaf5ffec, #cde6f8df 54%, #edf8ffed);
  box-shadow: 0 0 26px #76e4ffc4, inset 0 0 24px #f4fbff;
  backdrop-filter: blur(10px);
}
#invitation-screen .panel-header {
  display: grid;
  grid-template-columns: 1fr minmax(0, auto) 1fr;
  border: 0;
  padding: 0;
}
#invitation-title {
  grid-column: 2;
  padding: 7px clamp(12px, 4vw, 48px);
  border: 1px solid #1597d8;
  border-radius: 12px;
  background: linear-gradient(#f6fcff, #c7e5f8);
  box-shadow: 0 0 12px #72d8fc, inset 0 0 7px #fff;
  text-align: center;
  font-size: clamp(1.2rem, 4vw, 2.5rem);
}
#invitation-screen .channel {
  justify-self: end;
  padding: 4px 8px;
  border: 1px solid #f4fcff;
  border-radius: 20px;
  background: #e6f3ff;
}
.invitation-identity {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  gap: 8px 14px;
  margin-block: 16px;
  text-align: center;
}
.invitation-identity #invitation-name { margin: 0; }
.invitation-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 2.4fr);
  align-items: start;
  gap: 16px;
}
.invitation-portrait, .invitation-letter {
  border: 1px solid #effcff;
  border-radius: 15px;
  background: #edf8ffbf;
  box-shadow: 0 0 13px #77dfff, inset 0 0 9px #fff;
}
.invitation-portrait { display: block; width: 100%; aspect-ratio: 1; object-fit: contain; }
.invitation-letter { min-width: 0; padding: clamp(12px, 2.5vw, 24px); }
.invitation-letter #invitation-text { margin-bottom: 0; }
#invitation-attend {
  width: min(100%, 420px);
  min-height: 56px;
  border: 2px solid #b9f7ff;
  border-radius: 14px;
  background: linear-gradient(#147ebc, #074077);
  box-shadow: 0 0 14px #55cfff, inset 0 0 10px #91e9ff80;
  color: #fff;
}
#invitation-attend:hover { background: linear-gradient(#187ab1, #092d66); }
@media (max-width: 600px) {
  .screen:has(> #invitation-screen:not([hidden])) {
    background-image: url("../assets/images/signal-hall-mobile.jpg");
    background-position: 62% center;
  }
  #invitation-screen .panel-header { grid-template-columns: minmax(0, 1fr); }
  #invitation-title { grid-column: 1; }
  #invitation-screen .channel { grid-row: 1; justify-self: center; }
  .invitation-layout { grid-template-columns: minmax(0, 1fr); }
  .invitation-portrait { width: min(100%, 170px); justify-self: center; }
}

.screen.intro-active { padding: 0; background: var(--palette-silver); }

.signal-intro {
  position: relative;
  isolation: isolate;
  display: grid;
  width: 100%;
  min-height: max(620px, 100svh);
  grid-template-rows: auto 1fr auto;
  justify-items: center;
  overflow: hidden;
  color: var(--palette-navy);
}

.signal-hall {
  position: absolute;
  inset: 0;
  z-index: -2;
}

.signal-hall img { display: block; width: 100%; height: 100%; object-fit: cover; }

.signal-brand, .signal-console {
  width: min(calc(100% - 32px), 520px);
  border: 1px solid #fff;
  border-radius: 14px;
  background: #f5fbfff0;
  box-shadow: 0 6px 26px #17354c36;
}

.signal-brand {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  margin-top: 16px;
  padding: 9px 14px;
}

.signal-sphere {
  position: relative;
  align-self: center;
  width: clamp(180px, 26vw, 310px);
  aspect-ratio: 1;
  border: 1px solid #e9fbff;
  border-radius: 50%;
  background: radial-gradient(circle, #2c85b24d, #7fd5ff38 67%, #d8f8ff82 72%, transparent 74%);
  box-shadow: inset 0 0 24px #c1f5ff, 0 0 26px #6ce6ffb0;
}

.signal-ring, .signal-particles, .signal-portrait {
  position: absolute;
  pointer-events: none;
}

.signal-ring {
  inset: -8%;
  border: 1px dashed #dbf8ffd9;
  border-inline-color: transparent;
  border-radius: 50%;
  box-shadow: 0 0 8px #8deaff90;
  animation: signal-spin 24s linear infinite;
}

.signal-ring:nth-child(2) {
  inset: 5%;
  border-style: solid;
  border-block-color: transparent;
  animation: signal-spin 17s linear infinite reverse;
}

.signal-portrait {
  inset: 7% 10%;
  width: 80%;
  height: 86%;
  object-fit: contain;
  opacity: .87;
  filter: grayscale(1) sepia(.25) hue-rotate(155deg) saturate(2) contrast(1.08);
  mask-image: radial-gradient(ellipse at 50% 47%, #000 52%, transparent 76%);
}

.signal-particles {
  inset: 3%;
  border-radius: 50%;
  background:
    radial-gradient(circle, #d5faff 1px, transparent 1.8px) 0 0 / 23px 19px,
    repeating-linear-gradient(0deg, transparent 0 6px, #c8f7ff5c 7px, transparent 8px);
  opacity: .35;
  mask-image: radial-gradient(circle, transparent 12%, #000 55%, transparent 72%);
}

.signal-console {
  margin-bottom: 20px;
  padding: 12px clamp(12px, 3vw, 24px);
  text-align: center;
}

.signal-messages { display: grid; justify-items: center; gap: 4px; }
.signal-messages p { min-height: 1.4em; margin: 0; line-height: 1.4; }
.signal-messages p:first-child { font-weight: 750; letter-spacing: .05em; font-size: clamp(.82rem, 3vw, 1.03rem); }
.signal-messages p:nth-child(2) { color: var(--palette-blue); font: 600 .82rem / 1.4 var(--mono); }
.signal-messages p:last-child { font-size: .9rem; }
.signal-typing::after { content: "▏"; color: var(--palette-blue); animation: blink .8s step-end infinite; }
.signal-controls { display: grid; align-items: center; min-height: 84px; margin-top: 8px; }
.signal-controls .skip { justify-self: center; min-height: 44px; }
#signal-activate { min-height: 48px; box-shadow: 0 0 17px #61b5e78c; }
#signal-activate:active { transform: scale(.98); }
#signal-hint { margin: 6px 0 0; color: var(--ink-muted); font-size: .8rem; }

.signal-scanning .signal-hall { animation: signal-fade .85s ease-out both; }
.signal-scanning .signal-sphere { animation: signal-fade .75s .12s ease-out both; }
.signal-scanning .signal-portrait { animation: signal-reveal 1.45s 3s ease-out both; }
.signal-pulse { animation: signal-button .85s ease-out; }
.signal-activating .signal-sphere { animation: signal-transfer .85s ease-in-out both; }
.signal-activating .signal-ring { animation-duration: 1.6s; }
.signal-activating .signal-portrait { animation: signal-dissolve .85s ease-in-out both; }
.signal-activating .signal-particles { animation: signal-lines .85s ease-out both; }

@keyframes signal-spin { to { transform: rotate(1turn); } }
@keyframes signal-fade { from { opacity: 0; } to { opacity: 1; } }
@keyframes signal-reveal {
  from { opacity: 0; clip-path: inset(0 0 94%); }
  45% { opacity: .48; }
  to { opacity: .87; clip-path: inset(0); }
}
@keyframes signal-button {
  42% { box-shadow: 0 0 24px 5px #72caffb3; }
}
@keyframes signal-transfer {
  35% { box-shadow: inset 0 0 38px #e0fbff, 0 0 46px #95edff; }
  to { opacity: 0; transform: scale(1.08); }
}
@keyframes signal-dissolve {
  32% { opacity: 1; }
  to { opacity: 0; clip-path: inset(48% 0 48%); transform: scaleX(1.12); }
}
@keyframes signal-lines {
  48% { opacity: .9; }
  to { opacity: 0; transform: scaleX(1.3); }
}

@media (max-width: 600px) {
  .signal-intro { min-height: 100svh; align-content: start; grid-template-rows: auto auto auto; }
  .signal-brand { margin-block: 12px 8px; }
  .signal-hall {
    position: relative;
    inset: auto;
    grid-row: 2;
    grid-column: 1;
    width: 100%;
    aspect-ratio: 16 / 9;
  }
  .signal-brand { grid-row: 1; grid-column: 1; }
  .signal-sphere { grid-row: 2; grid-column: 1; align-self: center; width: clamp(108px, 32vw, 186px); margin-bottom: 6%; }
  .signal-console { grid-row: 3; grid-column: 1; margin-block: 12px 18px; }
}

@media (prefers-reduced-motion: reduce) {
  .signal-intro *, .signal-typing::after { animation: none !important; }
  #signal-activate:active { transform: none; }
}
