/* =====================================================================
   LOWER — the floor marked "Lower": hero, elevator panel, game bays
   ===================================================================== */

/* ------------------------------------------------------------------ hero */
.lw-hero { position: relative; padding: clamp(56px, 9vw, 120px) 0 clamp(40px, 6vw, 80px); }
.lw-hero-grid { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, .75fr); gap: clamp(32px, 5vw, 80px); align-items: center; }
.lw-intro .h-display { margin: 18px 0 22px; }
.lw-note { margin-top: 14px; max-width: 54ch; }
.lw-index { list-style: none; margin-top: 34px; border-top: 1px solid var(--hair); }
.lw-index a {
  display: grid; grid-template-columns: 44px minmax(0, 1fr) auto; align-items: baseline; gap: 14px;
  padding: 16px 4px; border-bottom: 1px solid var(--hair); transition: background .3s, padding .3s var(--ease-out);
}
.lw-index a:hover { background: rgba(230, 192, 105, .05); padding-left: 12px; }
.lw-index span { color: var(--gold); font-size: 12px; letter-spacing: .14em; }
.lw-index b { font-family: var(--f-display); font-weight: 400; font-size: clamp(1.4rem, 2.4vw, 1.9rem); line-height: 1.1; }
.lw-index em { font-style: normal; font-family: var(--f-mono); font-size: 11.5px; letter-spacing: .08em; color: var(--ink-3); text-align: right; }
@media (max-width: 980px) {
  .lw-hero-grid { grid-template-columns: minmax(0, 1fr); }
  .lw-elevator { max-width: 420px; }
}
@media (max-width: 520px) {
  .lw-index a { grid-template-columns: 34px minmax(0, 1fr); }
  .lw-index em { grid-column: 2; text-align: left; }
}

/* -------------------------------------------------------- elevator panel */
.lift-panel {
  position: relative; padding: 28px 26px 22px; border-radius: 22px;
  background:
    radial-gradient(120% 70% at 50% 0%, rgba(230, 192, 105, .12), transparent 60%),
    linear-gradient(180deg, #0f2331, #071520);
  border: 1px solid var(--line-2);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .06), 0 40px 80px -40px rgba(0, 0, 0, .8), 0 0 0 6px rgba(230, 192, 105, .05);
}
.lift-panel .corner { position: absolute; width: 14px; height: 14px; border-color: var(--gold); opacity: .6; }
.lift-panel .corner.tl { top: 10px; left: 10px; border-top: 1px solid; border-left: 1px solid; }
.lift-panel .corner.tr { top: 10px; right: 10px; border-top: 1px solid; border-right: 1px solid; }
.lift-panel .corner.bl { bottom: 10px; left: 10px; border-bottom: 1px solid; border-left: 1px solid; }
.lift-panel .corner.br { bottom: 10px; right: 10px; border-bottom: 1px solid; border-right: 1px solid; }
.lift-dial { width: 100%; height: auto; margin-bottom: 18px; }
.lift-needle { transform-box: view-box; transform-origin: 120px 122px; transform: rotate(-62deg); transition: transform 1.6s cubic-bezier(.3, 1.5, .5, 1); }
.lw-elevator.in .lift-needle { transform: rotate(58deg); transition-delay: .5s; }
.lift-panel.is-going .lift-needle { animation: needle-shiver 1.2s ease-in-out; }
@keyframes needle-shiver { 0%, 100% { transform: rotate(58deg); } 30% { transform: rotate(63deg); } 60% { transform: rotate(56deg); } }
.lift-buttons { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; justify-items: center; }
.lift-btn {
  width: 62px; height: 62px; border-radius: 50%; display: grid; place-items: center;
  font-family: var(--f-mono); font-size: 12px; letter-spacing: .06em; color: #2a1c06;
  background: radial-gradient(circle at 35% 30%, #f7e3a4, #c99a3e 55%, #6e5320 100%);
  box-shadow: inset 0 -3px 6px rgba(0, 0, 0, .35), inset 0 2px 2px rgba(255, 255, 255, .45), 0 6px 14px -6px rgba(0, 0, 0, .8);
  transition: transform .15s, box-shadow .3s, filter .3s;
}
.lift-btn:hover { filter: brightness(1.08); }
.lift-btn:active, .lift-btn.is-pressed { transform: translateY(2px) scale(.97); box-shadow: inset 0 3px 6px rgba(0, 0, 0, .45), 0 2px 6px -4px rgba(0, 0, 0, .8); }
.lift-btn.is-lit {
  font-size: 10.5px; color: #1b1305; letter-spacing: .12em; text-transform: uppercase;
  box-shadow: inset 0 -3px 6px rgba(0, 0, 0, .3), inset 0 2px 2px rgba(255, 255, 255, .5), 0 0 0 3px rgba(230, 192, 105, .25), 0 0 28px rgba(247, 227, 164, .55);
  animation: lit 2.4s ease-in-out infinite;
}
@keyframes lit { 50% { box-shadow: inset 0 -3px 6px rgba(0, 0, 0, .3), inset 0 2px 2px rgba(255, 255, 255, .5), 0 0 0 5px rgba(230, 192, 105, .18), 0 0 44px rgba(247, 227, 164, .8); } }
.lift-bell { color: var(--coral); font-size: 18px; }
.lift-plate { margin-top: 20px; padding-top: 14px; border-top: 1px solid var(--hair); text-align: center; font-size: 10px; letter-spacing: .16em; text-transform: uppercase; color: var(--ink-4); }
@media (prefers-reduced-motion: reduce) { .lift-btn.is-lit { animation: none; } .lift-needle { transition: none; } }

/* ------------------------------------------------------------------ bays */
.bay-section { padding-top: clamp(40px, 6vw, 80px); }
.bay { display: grid; grid-template-columns: minmax(0, 1fr) minmax(300px, 380px); gap: clamp(18px, 2.4vw, 32px); margin-top: 28px; align-items: start; }
.bay-flip { grid-template-columns: minmax(300px, 380px) minmax(0, 1fr); }
.bay-flip .bay-stage { order: 2; }
.bay-flip .bay-side { order: 1; }
@media (max-width: 980px) {
  .bay, .bay-flip { grid-template-columns: minmax(0, 1fr); }
  .bay-flip .bay-stage, .bay-flip .bay-side { order: 0; }
}

.bay-stage {
  position: relative; overflow: hidden; isolation: isolate;
  aspect-ratio: 16 / 11; min-height: 380px; max-height: 82vh; width: 100%;
  border-radius: var(--r); border: 1px solid var(--line);
  background:
    radial-gradient(70% 60% at 50% 38%, rgba(42, 111, 134, .26), transparent 70%),
    radial-gradient(60% 40% at 50% 105%, rgba(230, 192, 105, .14), transparent 70%),
    linear-gradient(180deg, #06192a, #020a11);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .05), 0 40px 80px -40px rgba(0, 0, 0, .8);
}
.bay-stage::before {
  /* deco sunburst behind the object */
  content: ''; position: absolute; inset: 0; z-index: -1; pointer-events: none; opacity: .4;
  background: repeating-conic-gradient(from 180deg at 50% 100%, rgba(230, 192, 105, .12) 0deg 1deg, transparent 1deg 8deg);
  mask-image: radial-gradient(circle at 50% 100%, #000 0%, #000 30%, transparent 70%);
}
.bay-tall { aspect-ratio: 4 / 5; max-height: 86vh; }
@media (max-width: 980px) { .bay-stage { aspect-ratio: 4 / 5; min-height: 0; max-height: 78vh; } }
.bay-canvas { position: absolute; inset: 0; }
.lower-canvas { display: block; width: 100% !important; height: 100% !important; max-width: none; touch-action: pan-y; cursor: grab; outline: none; }
.bay.is-grabbing .lower-canvas { cursor: grabbing; }
.bay-stage.is-live .bay-boot { opacity: 0; visibility: hidden; }

.bay-boot {
  position: absolute; inset: 0; display: grid; place-content: center; justify-items: center; gap: 14px; z-index: 2;
  font-size: 11px; letter-spacing: .3em; text-transform: uppercase; color: var(--gold);
  transition: opacity .6s, visibility .6s; pointer-events: none;
}
.bay-boot i { width: 46px; height: 46px; border-radius: 50%; border: 1px solid var(--line); border-top-color: var(--gold-hi); animation: spin 1.1s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.bay.is-failed .bay-boot i { display: none; }
.bay.is-failed .bay-boot { color: var(--coral); }

.bay-hint {
  position: absolute; left: 50%; top: 16px; transform: translateX(-50%); z-index: 3; pointer-events: none;
  font-size: 10.5px; letter-spacing: .2em; text-transform: uppercase; color: var(--ink-3); white-space: nowrap;
  transition: opacity .6s;
}
.bay-stage:not(.is-live) .bay-hint, .bay.is-playing .bay-hint, .bay.is-touched .bay-hint, .bay.has-played .bay-hint { opacity: 0; }
.bay-hud { position: absolute; left: 16px; right: 16px; bottom: 16px; z-index: 3; display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.bay [hidden] { display: none !important; }
.bay-hud small { font-family: var(--f-mono); font-size: 10px; letter-spacing: .08em; color: var(--ink-3); margin-left: 2px; }
.bay-hud .btn:disabled { opacity: .45; pointer-events: none; }
.bay-full { position: absolute; top: 12px; right: 12px; z-index: 4; background: rgba(2, 10, 17, .6); backdrop-filter: blur(8px); }

.bay-top {
  position: absolute; top: 14px; left: 16px; right: 64px; z-index: 3; display: flex; align-items: center; gap: 18px; flex-wrap: wrap;
  font-size: 11px; letter-spacing: .14em; text-transform: uppercase; color: var(--ink-3); pointer-events: none;
}
.bay-top b { color: var(--gold-hi); font-weight: 500; font-variant-numeric: tabular-nums; }
.bay-timer { flex: 1; min-width: 80px; height: 3px; border-radius: 2px; background: rgba(160, 205, 220, .14); overflow: hidden; }
.bay-timer i { display: block; height: 100%; width: 100%; background: linear-gradient(90deg, var(--gold-deep), var(--gold-hi)); transform-origin: left; }
.bay-timer.low i { background: var(--coral); }

.bay-card {
  position: absolute; z-index: 5; left: 50%; top: 50%; transform: translate(-50%, -50%);
  width: min(420px, calc(100% - 32px)); padding: 26px 26px 24px; border-radius: 16px; text-align: center;
  background: rgba(3, 13, 21, .86); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
  border: 1px solid var(--line-2); box-shadow: 0 30px 60px -20px rgba(0, 0, 0, .8);
  display: grid; justify-items: center; gap: 12px;
}
.bay-card[hidden] { display: none; }
.bay-card .eyebrow { justify-content: center; }
.bay-card-title { font-size: clamp(1.6rem, 3vw, 2.2rem); line-height: 1.08; }
.bay-card-title em { font-style: italic; color: var(--gold-hi); }
.bay-card .btn { margin-top: 6px; }
.bay-stage:not(.is-live) .bay-card { display: none; }

.bay-ping {
  position: absolute; right: 18px; bottom: 18px; z-index: 4; width: 64px; height: 64px; border-radius: 50%;
  border: 1px solid rgba(70, 227, 203, .5); color: var(--bio); font-size: 26px; background: rgba(2, 16, 22, .7);
  box-shadow: 0 0 24px rgba(70, 227, 203, .25);
}
.bay-ping.cooling { opacity: .4; }

/* one line of commentary, bottom centre */
.bay-note {
  position: absolute; left: 50%; bottom: 18px; z-index: 4; transform: translate(-50%, 8px); opacity: 0; pointer-events: none;
  width: max-content; max-width: calc(100% - 40px); text-align: center; padding: 9px 14px; border-radius: 10px;
  font-size: 11.5px; letter-spacing: .04em; line-height: 1.45; color: var(--gold-hi);
  background: rgba(3, 13, 21, .85); border: 1px solid var(--line); transition: opacity .35s, transform .35s var(--ease-out);
}
.bay-note.on { opacity: 1; transform: translate(-50%, 0); }

/* census run: zone banners */
.cr-banner {
  position: absolute; left: 50%; top: 22%; z-index: 4; transform: translate(-50%, 10px); opacity: 0; pointer-events: none;
  display: grid; justify-items: center; gap: 6px; text-align: center; width: max-content; max-width: calc(100% - 40px);
  transition: opacity .5s, transform .6s var(--ease-out);
}
.cr-banner.on { opacity: 1; transform: translate(-50%, 0); }
.cr-banner b { font-family: var(--f-display); font-weight: 400; font-size: clamp(1.5rem, 3.4vw, 2.4rem); color: var(--gold-hi); line-height: 1.05; text-shadow: 0 2px 18px rgba(0, 0, 0, .7); }
.cr-banner span { font-family: var(--f-mono); font-size: 11px; letter-spacing: .16em; text-transform: uppercase; color: var(--ink-2); text-shadow: 0 1px 8px rgba(0, 0, 0, .8); }
.cr-depth b { font-size: 15px; }

/* the side card */
.bay-side { display: grid; gap: 16px; }
.bay-side .h-1 { margin-top: 2px; }
.bay-quote { font-size: 1.32rem; line-height: 1.3; font-style: italic; color: var(--gold-hi); padding-left: 14px; border-left: 1px solid var(--line-2); }
.bay-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(96px, 1fr)); gap: 10px; padding: 14px 0; border-top: 1px solid var(--hair); border-bottom: 1px solid var(--hair); }
.bay-stats dt { font-family: var(--f-mono); font-size: 10px; letter-spacing: .18em; text-transform: uppercase; color: var(--ink-3); }
.bay-stats dd { white-space: nowrap; font-size: clamp(1.3rem, 2vw, 1.7rem); color: var(--ink); margin-top: 4px; font-variant-numeric: tabular-nums; }

/* ------------------------------------------------------------- theater */
html.lw-theater { overflow: hidden; }
.bay.is-theater .bay-stage {
  position: fixed; inset: 0; z-index: 1040; aspect-ratio: auto; max-height: none; min-height: 0;
  border-radius: 0; border: 0; transform: none !important; opacity: 1 !important;
  height: 100vh; height: 100dvh;
}
.bay.is-theater .lower-canvas { touch-action: none; }
.bay.is-theater .bay-full { top: max(12px, env(safe-area-inset-top)); right: max(12px, env(safe-area-inset-right)); }
.bay.is-theater .bay-top { top: max(16px, env(safe-area-inset-top)); }
.bay.is-theater .bay-hud { bottom: max(16px, env(safe-area-inset-bottom)); }
