/* Tonight's teamwork becomes the next night's welcome. */
.night-stage .night-controls {
  grid-template-columns:repeat(5,minmax(0,1fr));
  gap:6px;
}
.night-stage .night-controls button {
  position:relative;
  min-width:0;
  min-height:53px;
  padding:7px 2px 9px;
  overflow:hidden;
}
.night-stage .night-controls button>small,
.night-stage .night-controls button>span { position:relative; z-index:1; }
.night-stage .night-controls button>span { white-space:nowrap; letter-spacing:-.2px; }
.night-stage .night-controls [data-night-step="4"]>small {
  font-family:var(--sans);
  font-size:9px;
  line-height:1.25;
  letter-spacing:.1px;
}
.night-stage [data-scene-timer] {
  position:absolute;
  inset:auto 0 0;
  display:block;
  height:3px;
  background:#0c3478;
  transform:scaleX(0);
  transform-origin:0 50%;
  pointer-events:none;
}
.night-stage .night-controls button:not([aria-pressed="true"]) [data-scene-timer] { visibility:hidden; }

/* Keep the scene's copy and next action in a stable, quiet reading area. */
.night-stage .stage-caption { min-height:187px; }
.stage-caption-top {
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:10px;
  min-height:16px;
}
.stage-caption-top #night-app {
  color:#f2d382;
  font:800 11px/1.45 var(--display);
  letter-spacing:.8px;
}
.stage-caption-top .stage-chapter {
  flex:none;
  color:#9db4d9;
  font:700 11px/1 var(--display);
  letter-spacing:1.1px;
  font-variant-numeric:tabular-nums;
}
.night-stage .stage-caption #night-copy { min-height:43px; }
.night-stage #night-feature-link {
  display:inline-flex;
  align-items:center;
  gap:15px;
  min-height:36px;
  margin-top:7px;
  padding:4px 0;
  color:#fff0bc;
  border-bottom:1px solid #efc76566;
  font-size:10px;
  font-weight:700;
  line-height:1.5;
  transition:color .3s,border-color .3s;
}
.night-stage #night-feature-link>span:last-child {
  font:18px/1 Arial;
  transition:translate .5s var(--fluid);
}
.night-stage #night-feature-link:hover { color:#fff7dc; border-color:#ffe4a4; }
.night-stage #night-feature-link:hover>span:last-child { translate:3px -2px; }
.night-stage #night-feature-link:focus-visible { outline-color:#f6d78d; outline-offset:5px; }

/* A genuine focal point, rather than another layer of competing effects. */
.night-stage .night-floor::before {
  content:"";
  position:absolute;
  inset:0;
  z-index:2;
  pointer-events:none;
  background:radial-gradient(ellipse at 72% 48%,#e4c47540,transparent 66%);
  opacity:0;
  transition:opacity .8s var(--soft);
}
.customer-memory {
  position:absolute;
  z-index:10;
  top:86px;
  right:14px;
  width:51%;
  max-width:232px;
  padding:13px 13px 10px;
  color:#112b53;
  background:linear-gradient(145deg,#fffdf5,#f5f3e6);
  border:1.5px solid #f2d593;
  border-radius:12px;
  box-shadow:0 6px 0 #0819364d,0 12px 28px #020b2573,0 0 27px #efc76520;
  opacity:0;
  visibility:hidden;
  pointer-events:none;
  transform-origin:40% 65%;
  transition:opacity .55s var(--soft),visibility 0s .55s;
}
.customer-memory::before {
  content:"";
  position:absolute;
  inset:0 0 auto;
  height:3px;
  border-radius:12px 12px 0 0;
  background:linear-gradient(90deg,#e7bc5d,#fff0c2,#afc9ef);
}
.memory-eyebrow {
  display:block;
  margin-bottom:8px;
  color:#486486;
  font:800 8px/1.3 var(--display);
  letter-spacing:1px;
}
.memory-person {
  display:flex;
  align-items:center;
  gap:9px;
  margin-bottom:10px;
}
.memory-avatar {
  display:grid;
  place-items:center;
  flex:none;
  width:36px;
  height:36px;
  border:2px solid #efce84;
  border-radius:50%;
  background:linear-gradient(135deg,#224d96,#0a2859);
  color:#ffdf91;
  box-shadow:0 0 0 3px #e6c57919;
  font:900 25px/1 var(--display);
}
.memory-person>div { min-width:0; }
.memory-person b { display:block; font-size:15px; line-height:1.4; font-weight:900; }
.memory-person small { display:block; margin-top:1px; color:#718096; font-size:8px; line-height:1.3; }
.memory-records { display:grid; gap:0; }
.memory-records>[data-memory-item] {
  display:grid;
  grid-template-columns:57px minmax(0,1fr) 13px;
  align-items:center;
  gap:5px;
  min-width:0;
  padding:7px 0;
  border-top:1px solid #173e7421;
  transform-origin:85% 50%;
}
.memory-records>[data-memory-item]>span {
  color:#63738a;
  font-size:9px;
  line-height:1.45;
  overflow-wrap:anywhere;
}
.memory-records strong {
  min-width:0;
  color:#133462;
  font-size:12px;
  line-height:1.5;
  font-weight:800;
  overflow-wrap:anywhere;
}
.memory-records [data-memory-item="visit"] strong { font:900 20px/1.1 var(--display); letter-spacing:.5px; }
.memory-records i {
  display:grid;
  place-items:center;
  width:13px;
  height:13px;
  border-radius:50%;
  color:#254b80;
  background:#e4c47555;
  font:900 9px/1 Arial;
  font-style:normal;
}
.memory-footer {
  margin-top:7px;
  padding-top:7px;
  border-top:1px solid #b9974e4a;
  color:#7d6429;
  font-size:9px;
  font-weight:800;
  line-height:1.45;
  text-align:center;
}
.memory-welcome {
  position:absolute;
  z-index:10;
  left:18px;
  bottom:18px;
  max-width:44%;
  display:grid;
  gap:3px;
  color:#fff0c0;
  opacity:0;
  visibility:hidden;
  pointer-events:none;
  text-shadow:0 2px 9px #04112f;
  transition:opacity .6s var(--soft),visibility 0s .6s;
}
.memory-welcome small { color:#b8ccec; font:800 9px/1.2 var(--display); letter-spacing:2px; }
.memory-welcome span { font-size:15px; font-weight:900; line-height:1.4; letter-spacing:-.3px; }
.night-stage[data-step="4"] .customer-memory,
.night-stage[data-step="4"] .memory-welcome { opacity:1; visibility:visible; transition-delay:0s; }
.night-stage[data-step="4"] .night-floor::before { opacity:1; }
.night-stage[data-step="4"] .show-word { opacity:.3; }
.night-stage[data-step="4"] .show-callout { top:86px; font-size:17px; padding:7px 10px; rotate:-5deg; }
.night-stage[data-step="4"] .show-callout>i { display:none; }
.night-stage[data-step="4"] .shift-system {
  transform:translate(-115%,75px) rotate(-4deg) scale(1.23);
  opacity:1;
  z-index:9;
}
.night-stage[data-step="4"] .shift-handy { transform:translate(15px,14px) scale(.9); opacity:.2; }
.night-stage[data-step="4"] .shift-order { transform:translate(8px,9px) scale(.88); opacity:.18; }
.night-stage[data-step="4"] .shift-manager { transform:translate(0,16px) scale(.88); opacity:.2; }
.night-stage .night-ticket { transition:transform 1.45s var(--fluid),rotate 1.45s var(--fluid),opacity .5s var(--soft); }
.night-stage .stage-message { transition:opacity .45s var(--soft),background .9s,box-shadow .9s; }
.night-stage[data-step="4"] .night-ticket { opacity:0; transform:translate(13px,-15px) scale(.8); }
.night-stage[data-step="4"] .stage-message { opacity:0; }
.night-stage[data-step="4"] .floor-counter,
.night-stage[data-step="4"] .floor-table { opacity:.35; }
.night-stage .floor-counter,.night-stage .floor-table { transition:opacity .65s var(--soft),background 1.5s var(--soft),box-shadow 1.5s var(--soft); }
.night-stage[data-step="4"] .halo-two { background:#efc76536; transform:scale(1.4); }
.night-stage[data-step="4"] .fs-one { left:28%; top:129px; }
.night-stage[data-step="4"] .fs-two { right:37%; top:309px; }

.night-next-chapter {
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:14px;
  margin-top:27px;
  padding:18px 1px 0;
  border-top:1px solid #8ba5cf59;
  color:#153d7a;
}
.night-next-chapter>span { min-width:0; }
.night-next-chapter small { display:block; color:#6c80a0; font:800 9px/1.4 var(--display); letter-spacing:1.5px; }
.night-next-chapter strong { display:block; margin-top:5px; font-size:12px; line-height:1.6; font-weight:800; }
.night-next-chapter>b {
  display:grid;
  place-items:center;
  flex:none;
  width:32px;
  height:32px;
  border:1px solid #bba467;
  border-radius:50%;
  background:#f8e5af;
  font:22px/1 Arial;
  transition:translate .55s var(--fluid),background .3s;
}
.night-next-chapter:hover>b { translate:0 4px; background:#f1ce72; }

@media(max-width:1000px) {
  .mobile-sticky {
    translate:0 0;
    opacity:1;
    visibility:visible;
    transition:translate .6s var(--fluid),opacity .3s var(--soft),visibility 0s;
  }
  .night-viewing .mobile-sticky:not(:focus-within) {
    translate:0 calc(100% + 30px);
    opacity:0;
    visibility:hidden;
    pointer-events:none;
    transition:translate .6s var(--fluid),opacity .25s var(--soft),visibility 0s .6s;
  }
  .night-viewing .mobile-sticky:focus-within {
    translate:0 0;
    opacity:1;
    visibility:visible;
    pointer-events:auto;
    transition-delay:0s;
  }
}
@media(max-width:540px) {
  .night-stage .night-controls { gap:5px; padding-inline:9px; }
  .night-stage .night-controls button { min-height:52px; }
  .night-stage .night-controls button>span { font-size:11px; }
  .night-stage .stage-caption { min-height:208px; }
  .night-stage .stage-caption #night-copy { min-height:63px; }
  .stage-caption-top #night-app { font-size:10px; letter-spacing:.4px; }
  .stage-caption-top .stage-chapter { font-size:10px; }
  .night-stage #night-feature-link { font-size:10px; }
  .customer-memory { top:85px; right:10px; width:57%; max-width:194px; padding:10px 10px 9px; border-radius:10px; }
  .memory-eyebrow { font-size:8px; letter-spacing:.7px; margin-bottom:7px; }
  .memory-person { gap:7px; margin-bottom:8px; }
  .memory-avatar { width:30px; height:30px; font-size:22px; }
  .memory-person b { font-size:13px; }
  .memory-person small { font-size:8px; }
  .memory-records>[data-memory-item] { grid-template-columns:minmax(0,1fr) 11px; column-gap:4px; row-gap:1px; padding:4px 0; }
  .memory-records>[data-memory-item]>span { grid-column:1; font-size:9px; line-height:1.2; }
  .memory-records strong { grid-column:1; font-size:11px; line-height:1.25; }
  .memory-records [data-memory-item="visit"] strong { font-size:18px; }
  .memory-records i { grid-column:2; grid-row:1 / 3; width:11px; height:11px; font-size:8px; }
  .memory-footer { margin-top:6px; padding-top:6px; font-size:9px; }
  .memory-welcome { left:13px; bottom:19px; max-width:40%; }
  .memory-welcome small { font-size:8px; letter-spacing:1.5px; }
  .memory-welcome span { font-size:12px; }
  .night-stage[data-step="4"] .show-callout { top:86px; left:11px; font-size:13px; padding:6px 8px; }
  .night-stage[data-step="4"] .shift-system { transform:translate(-119%,50px) rotate(-4deg) scale(1.23); }
  .night-stage[data-step="4"] .fs-one { left:28%; top:126px; }
  .night-stage[data-step="4"] .fs-two { top:289px; }
}
@media(max-width:370px) {
  .night-stage .night-controls { gap:5px; padding:9px 8px 11px; }
  .night-stage .night-controls button { min-height:52px; padding-inline:2px; }
  .night-stage .night-controls button>small { font-size:9px; }
  .night-stage .night-controls button>span { font-size:10px; letter-spacing:-.2px; }
  .night-stage .night-controls [data-night-step="4"]>small { font-size:8px; }
  .night-stage .stage-caption { min-height:206px; }
  .night-stage .stage-caption h3 { font-size:18px; letter-spacing:-.5px; }
  .night-stage .stage-caption #night-copy { font-size:11px; min-height:63px; }
  .stage-caption-top #night-app { font-size:9px; }
  .stage-caption-top .stage-chapter { font-size:9px; }
  .customer-memory { top:82px; right:8px; width:58%; padding:9px 8px 8px; }
  .memory-eyebrow { font-size:7.5px; margin-bottom:6px; letter-spacing:.4px; }
  .memory-person { gap:6px; margin-bottom:6px; }
  .memory-avatar { width:27px; height:27px; font-size:20px; }
  .memory-person b { font-size:12px; }
  .memory-person small { font-size:7.5px; }
  .memory-records>[data-memory-item] { grid-template-columns:minmax(0,1fr) 10px; column-gap:3px; row-gap:1px; padding:3px 0; }
  .memory-records>[data-memory-item]>span { font-size:8.5px; line-height:1.2; }
  .memory-records strong { font-size:10.5px; line-height:1.25; }
  .memory-records [data-memory-item="visit"] strong { font-size:17px; }
  .memory-records i { width:10px; height:10px; font-size:7px; }
  .memory-footer { font-size:8px; margin-top:5px; padding-top:5px; }
  .memory-welcome { left:11px; bottom:19px; max-width:36%; }
  .memory-welcome small { font-size:7px; letter-spacing:1.2px; }
  .memory-welcome span { font-size:10.5px; letter-spacing:-.3px; }
  .night-stage[data-step="4"] .show-callout { top:76px; left:8px; padding:5px 7px; font-size:11px; letter-spacing:-.5px; }
  .night-stage[data-step="4"] .shift-system { transform:translate(-119%,43px) rotate(-4deg) scale(1.23); }
  .night-stage[data-step="4"] .fs-one { left:27%; top:113px; }
  .night-stage[data-step="4"] .fs-two { top:271px; }
  .night-next-chapter { gap:10px; margin-top:24px; padding-top:15px; }
  .night-next-chapter strong { font-size:10.5px; }
  .night-next-chapter>b { width:29px; height:29px; font-size:20px; }
}
@media(prefers-reduced-motion:reduce) {
  .night-stage [data-scene-timer] { display:none; }
  .mobile-sticky,.night-next-chapter>b { transition:none!important; }
}
.motion-off .night-stage [data-scene-timer] { display:none; }

/* A visible label anchors every customer value before the record arrives. */
.night-stage .night-floor::before { inset:-20%; background:radial-gradient(ellipse at 55% 45%,#efcd7b42,transparent 60%); opacity:var(--glow-power); transform:translateX(var(--glow-x)); transition:opacity 1.2s,transform 1.4s var(--fluid); }
.memory-records>[data-memory-item]>span { color:#526783; font-size:10px; }
.memory-records>[data-memory-item] strong { transform-origin:0 50%; }
.memory-welcome em { display:block; margin-top:5px; color:#d1dff4; font-size:10px; line-height:1.6; font-style:normal; opacity:0; translate:0 5px; transition:opacity .7s,translate .7s; }
.night-stage[data-ending="true"] .memory-welcome em,.motion-off .memory-welcome em { opacity:1; translate:0 0; }
.night-stage[data-step="4"] .show-callout { top:58px; left:12px; font-size:15px; padding:6px 8px; }
.night-stage .stage-caption { min-height:171px; padding:15px 18px 16px; }
.night-stage .stage-caption h3 { font-size:23px; margin:5px 0 7px; }
.night-stage .stage-caption #night-copy { min-height:40px; font-size:12px; line-height:1.75; }
.night-stage #night-feature-link { min-height:34px; margin-top:4px; font-size:11px; }
.night-stage[data-step="4"] .customer-memory { top:77px; }
.night-stage .memory-records [data-memory-item="visit"] strong { font-size:14px; font-family:var(--sans); }
@media(max-width:540px) {
  .night-stage .night-controls button { min-height:46px; }
  .night-stage .stage-caption { min-height:145px; padding:11px 13px 12px; }
  .night-stage .stage-caption h3 { font-size:19px; line-height:1.4; margin:4px 0 6px; letter-spacing:-.5px; }
  .night-stage .stage-caption #night-copy { min-height:40px; font-size:12px; line-height:1.65; }
  .night-stage #night-feature-link { min-height:32px; margin-top:2px; font-size:11px; }
  .stage-caption-top #night-app { font-size:9px; }
  .stage-caption-top .stage-chapter { font-size:10px; }
  .customer-memory,.night-stage[data-step="4"] .customer-memory { top:61px; right:9px; width:57%; max-width:194px; padding:9px 9px 8px; }
  .memory-eyebrow { margin-bottom:6px; font-size:8px; }
  .memory-person { gap:7px; margin-bottom:6px; }
  .memory-avatar { width:29px; height:29px; font-size:17px; }
  .memory-person b { font-size:13px; }
  .memory-person small { font-size:8px; letter-spacing:-.3px; }
  .memory-records>[data-memory-item] { padding:4px 0; row-gap:1px; }
  .memory-records>[data-memory-item]>span { font-size:10px; line-height:1.25; }
  .memory-records strong { font-size:11px; line-height:1.35; }
  .night-stage .memory-records [data-memory-item="visit"] strong { font-size:12px; }
  .memory-footer { margin-top:5px; padding-top:5px; font-size:9px; }
  .memory-welcome { left:11px; bottom:13px; max-width:38%; }
  .memory-welcome small { font-size:8px; }
  .memory-welcome span { font-size:12px; }
  .memory-welcome em { font-size:8px; margin-top:4px; }
  .night-stage[data-step="4"] .show-callout { top:51px; left:9px; max-width:40%; font-size:12px; padding:6px 7px; }
  .night-stage[data-step="4"] .shift-system { transform:translate(-118%,42px) rotate(-4deg) scale(1.18); }
  .night-stage[data-step="4"] .fs-one { top:110px; }
  .night-stage[data-step="4"] .fs-two { top:240px; }
  .night-section .stage-bottom>p { font-size:10px; line-height:1.6; }
  .stage-replay,.night-section .stage-play { font-size:10px; min-height:38px; }
}
@media(max-width:370px) {
  .night-stage .night-controls button { min-height:46px; }
  .night-stage .stage-caption { min-height:148px; }
  .night-stage .stage-caption h3 { font-size:17px; letter-spacing:-.45px; }
  .night-stage .stage-caption #night-copy { min-height:40px; font-size:11px; line-height:1.7; }
  .customer-memory,.night-stage[data-step="4"] .customer-memory { top:60px; right:7px; width:58%; padding:8px 7px 7px; }
  .memory-person { gap:5px; }
  .memory-avatar { width:25px; height:25px; font-size:15px; }
  .memory-person b { font-size:12px; }
  .memory-person small { font-size:7px; }
  .memory-eyebrow { font-size:7px; }
  .memory-records>[data-memory-item]>span { font-size:9px; }
  .memory-records strong { font-size:10.5px; }
  .memory-footer { font-size:8px; }
  .night-stage[data-step="4"] .show-callout { font-size:11px; top:50px; left:7px; }
  .memory-welcome span { font-size:11px; }
  .memory-welcome em { font-size:7.5px; }
  .stage-actions { width:auto; }
}
@media(prefers-reduced-motion:reduce) { .memory-welcome em { opacity:1; translate:0 0; transition:none; } }

/* Settle the outer positions before the 650ms record handoff. */
.night-stage .shift-person { transition:transform .6s var(--fluid),opacity .45s var(--soft); }
.night-stage .night-ticket { transition:transform .6s var(--fluid),rotate .6s var(--fluid),opacity .45s var(--soft); }
.night-stage .ticket-rule { transform-origin:0 50%; }
/* During automatic playback, keep the existing quiet movement alive while
   the copy is readable. Explicit pause and offscreen states still stop it. */
.night-stage[data-phase="reading"][data-autoplay="on"][data-show-active="true"] :is(.club-lights *,.show-rays,.shift-person>.crew-sprite,.floor-spark,.floor-halo) { animation-play-state:running!important; }
