/* ============================================================
   BRAD'S — AFTER HOURS.  The iPhone edition (touch devices).

   A ground-up app, not the desktop room. Everything is gated on the
   `.is-app` class that mobile.js puts on <html> for touch/narrow
   devices, so it survives rotation to landscape (the cinema needs it)
   and never touches the desktop room.
   ============================================================ */

:root {
  --safe-t: env(safe-area-inset-top, 0px);
  --safe-b: env(safe-area-inset-bottom, 0px);
  --safe-l: env(safe-area-inset-left, 0px);
  --safe-r: env(safe-area-inset-right, 0px);
}

/* Stand the whole desktop room down — the app rebuilds what it needs. */
.is-app .stage,
.is-app .marquee,
.is-app .videowall,
.is-app .jukebox,
.is-app .staffdoor,
.is-app .attendant,
.is-app .attendant__bubble,
.is-app .attmenu,
.is-app .tipscreen,
.is-app .deck,
.is-app .hint,
.is-app .foot { display: none !important; }

.is-app body { overflow: hidden; }

/* The scene is the living backdrop; deepen the floor so the app reads. */
.is-app .scene::after {
  background:
    radial-gradient(ellipse 135% 80% at 50% 30%, rgba(5,2,4,0.05) 0%, rgba(5,2,4,0.4) 55%, rgba(5,2,4,0.9) 100%),
    linear-gradient(to top, rgba(5,2,4,0.95) 0%, rgba(5,2,4,0.55) 20%, rgba(5,2,4,0.05) 46%);
}

/* Top bar (reused .nav) as a real app header. */
.is-app .nav {
  padding: calc(var(--safe-t) + 0.55rem) 0.9rem 0.6rem;
  font-size: 0.78rem;
  background: linear-gradient(to bottom, rgba(5,2,4,0.92), rgba(5,2,4,0.4) 70%, transparent);
}

/* ============================================================
   THE APP SHELL
   ============================================================ */
.app {
  position: fixed;
  inset: 0;
  z-index: 2;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: calc(var(--safe-t) + 3.1rem) max(1rem, var(--safe-r))
           calc(var(--safe-b) + 1rem) max(1rem, var(--safe-l));
  pointer-events: none; /* the scene shows through the gaps; children re-enable */
}
.app > * { pointer-events: auto; }

/* Hero: the neon sign, compact, up top. */
.app__hero {
  flex: 0 0 auto;
  display: grid;
  justify-items: center;
  transform: scale(0.62);
  transform-origin: top center;
  margin-bottom: -1.4rem;
  pointer-events: none;
}
.app .sign__caps { font-size: min(clamp(3rem, 13vw, 5rem), 22vw); }

/* ---- THE DECK (turntable) ---- */
.app__deck {
  flex: 1 1 auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  width: 100%;
  gap: 0.4rem;
  touch-action: pan-y; /* let vertical scroll pass, capture horizontal swipes */
  -webkit-user-select: none; user-select: none;
}
.deck2__platter {
  position: relative;
  width: min(62vw, 15rem);
  aspect-ratio: 1;
  display: grid;
  place-items: center;
}
.deck2__record {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  filter: drop-shadow(0 14px 30px rgba(5,2,4,0.85)) drop-shadow(0 0 26px rgba(255,46,200,0.22));
}
.deck2__record svg { width: 100%; height: 100%; display: block; }
.rec__vinyl { fill: #08040a; stroke: rgba(255,246,251,0.1); stroke-width: 1; }
.rec__groove { fill: none; stroke: rgba(255,246,251,0.06); stroke-width: 1; }
.rec__label { fill: var(--label, var(--pink)); filter: brightness(0.9); }
.rec__spindle { fill: var(--tube-core); }
.rec__hole { fill: #08040a; }
.deck2__record--spin { animation: rec-spin 3.2s linear infinite; }
@keyframes rec-spin { to { transform: rotate(360deg); } }
.deck2__record--inL { animation: rec-in-l 0.4s cubic-bezier(0.2,0.8,0.3,1); }
.deck2__record--inR { animation: rec-in-r 0.4s cubic-bezier(0.2,0.8,0.3,1); }
@keyframes rec-in-l { 0% { transform: translateX(38%) rotate(-30deg); opacity: 0.2; } 100% { transform: none; opacity: 1; } }
@keyframes rec-in-r { 0% { transform: translateX(-38%) rotate(30deg); opacity: 0.2; } 100% { transform: none; opacity: 1; } }

.deck2__labeltext {
  position: absolute;
  font-family: var(--font-machine);
  font-size: 0.5rem;
  letter-spacing: 0.14em;
  color: rgba(5,2,4,0.92);
  font-weight: 700;
  pointer-events: none;
}
.deck2__glyph {
  position: absolute;
  font-size: 3rem;
  color: rgba(255,246,251,0.92);
  text-shadow: 0 2px 10px rgba(5,2,4,0.9);
  pointer-events: none;
}
.deck2__glyph[hidden] { display: none; }

.deck2__now { text-align: center; margin-top: 0.9rem; max-width: 90vw; }
.deck2__title {
  font-family: var(--font-tube);
  font-size: clamp(1.4rem, 6.5vw, 2.1rem);
  letter-spacing: 0.04em;
  color: var(--tube-core);
  text-shadow: var(--glow-pink);
  line-height: 1;
  text-transform: uppercase;
}
.deck2__artist {
  font-family: var(--font-machine);
  font-size: 0.76rem;
  letter-spacing: 0.14em;
  color: var(--amber);
  margin-top: 0.35rem;
  text-transform: uppercase;
}
.deck2__spectrum {
  display: flex; align-items: flex-end; gap: 2px;
  height: 20px; margin-top: 0.5rem; width: min(66vw, 16rem);
}
.deck2__spectrum i {
  flex: 1; height: 100%;
  background: linear-gradient(to top, var(--blue), var(--pink));
  transform: scaleY(var(--v, 0.05)); transform-origin: bottom;
  box-shadow: 0 0 5px rgba(69,200,255,0.4);
}
.deck2__hint {
  font-family: var(--font-machine);
  font-size: 0.66rem; letter-spacing: 0.2em;
  color: var(--amber-dim); margin-top: 0.5rem;
  animation: hint-pulse 2.6s ease-in-out infinite;
}
@keyframes hint-pulse { 50% { opacity: 0.4; } }

/* ---- THE DOCK (two full-screen doors) ---- */
.app__dock {
  flex: 0 0 auto;
  display: flex; gap: 0.7rem; width: 100%;
  max-width: 26rem;
}
.dockbtn {
  flex: 1;
  display: flex; flex-direction: column; align-items: center; gap: 0.25rem;
  padding: 0.7rem 0.5rem;
  min-height: 60px;
  font-family: var(--font-machine);
  background: rgba(13,7,12,0.72);
  -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px);
  border: 1px solid rgba(255,177,78,0.32);
  color: var(--amber);
  cursor: pointer;
}
.dockbtn__ico { font-size: 1.5rem; line-height: 1; }
.dockbtn__lbl { font-size: 0.66rem; letter-spacing: 0.16em; }
.dockbtn--att { border-color: rgba(255,46,200,0.4); }
.dockbtn--att:active { background: rgba(255,46,200,0.12); }
.dockbtn--wall:active { background: rgba(69,200,255,0.12); }
.dockbtn:focus-visible { outline: 2px solid var(--blue); outline-offset: 2px; }

/* ---- Transient toast (his unprompted asides) ---- */
.app__toast {
  position: fixed;
  left: 50%; bottom: calc(6.2rem + var(--safe-b));
  transform: translateX(-50%) translateY(8px);
  max-width: min(20rem, 90vw);
  padding: 0.5rem 0.8rem;
  background: rgba(13,7,12,0.94);
  border: 1px solid rgba(255,177,78,0.35);
  font-family: var(--font-machine); font-size: 0.7rem; line-height: 1.4;
  color: var(--amber); text-align: center;
  opacity: 0; transition: opacity 0.25s ease-out, transform 0.25s ease-out;
  pointer-events: none; z-index: 6;
}
.app__toast--in { opacity: 1; transform: translateX(-50%) translateY(0); }

/* ============================================================
   SW-1PR — the full-screen attendant
   ============================================================ */
.att2 {
  position: fixed; inset: 0; z-index: 12;
  display: flex; flex-direction: column;
  padding: calc(var(--safe-t)) max(0px, var(--safe-r)) calc(var(--safe-b)) max(0px, var(--safe-l));
  background:
    radial-gradient(ellipse 90% 60% at 50% 32%, rgba(40,16,25,0.7), transparent 70%),
    rgba(6,3,5,0.94);
  -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px);
  opacity: 0; transition: opacity 0.24s ease-out;
}
.att2[hidden] { display: none; }
.att2--in { opacity: 1; }
.att2__bar {
  display: flex; justify-content: space-between; align-items: center;
  padding: 0.7rem 1rem;
  font-family: var(--font-machine); font-size: 0.8rem; letter-spacing: 0.1em; color: var(--amber);
}
.att2__status { color: var(--blue); font-weight: 400; margin-left: 0.3rem; text-shadow: 0 0 6px rgba(69,200,255,0.5); }
.att2--rage .att2__status { color: var(--red); }
.att2__close {
  width: 44px; height: 44px; font-size: 1.2rem;
  background: none; border: 1px solid rgba(255,177,78,0.3); color: var(--amber); cursor: pointer;
}
.att2__stage {
  flex: 1 1 auto; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 1rem;
  padding: 0.5rem 1rem;
}
.att2__bust { width: min(52vw, 12rem); height: auto; filter: drop-shadow(0 10px 26px rgba(5,2,4,0.85)); }
.a2 {}
.a2-body { fill: var(--shell-deep); stroke: var(--amber-dim); stroke-width: 2; }
.a2-neck { fill: var(--surface); stroke: var(--amber-dim); stroke-width: 1.5; }
.a2-dome { fill: var(--shell); stroke: var(--amber-dim); stroke-width: 2; }
.a2-socket { fill: var(--ink-deep); stroke: rgba(69,200,255,0.5); stroke-width: 1; }
.a2-eye { fill: var(--blue); filter: drop-shadow(0 0 6px rgba(69,200,255,0.9)); transform-box: fill-box; transform-origin: center; animation: a2-blink 4.4s ease-in-out infinite; }
@keyframes a2-blink { 0%,92%,100% { transform: scaleY(1); } 95% { transform: scaleY(0.1); } }
.a2-ant { stroke: var(--amber-dim); stroke-width: 2; }
.a2-tip { fill: var(--red); animation: a2-tip 1.4s steps(1) infinite; }
@keyframes a2-tip { 50% { opacity: 0.2; } }
.a2-bow { fill: var(--pink); filter: drop-shadow(0 0 5px rgba(255,46,200,0.7)); }
.a2-knot { fill: var(--tube-core); }
.a2-led { fill: var(--blue); opacity: 0.25; }
.a2-led1 { animation: a2-led 1.3s steps(1) infinite; }
.a2-led2 { animation: a2-led 1.3s steps(1) 0.45s infinite; }
.a2-led3 { animation: a2-led 1.3s steps(1) 0.9s infinite; }
@keyframes a2-led { 50% { opacity: 0.95; } }
.a2-fork { stroke: var(--amber-dim); stroke-width: 2.5; }
/* mood shifts the eye toward red as he heats up */
.att2__bust--t1 .a2-eye { fill: var(--amber); filter: drop-shadow(0 0 6px rgba(255,177,78,0.9)); }
.att2__bust--t2 .a2-eye { fill: var(--amber); filter: drop-shadow(0 0 9px rgba(255,177,78,1)) brightness(1.15); }
.att2__bust--t3 .a2-eye, .att2--rage .a2-eye { fill: var(--red); filter: drop-shadow(0 0 8px rgba(255,48,64,1)); animation: none; }
.att2__bust--slam { animation: a2-slam 0.15s ease-out; }
@keyframes a2-slam { 50% { transform: translateY(4px) rotate(-2deg); } }
.att2--rage .att2__bust { animation: a2-rage 0.5s ease-in-out; }
@keyframes a2-rage { 25% { transform: rotate(-4deg) scale(1.04); } 75% { transform: rotate(4deg) scale(1.04); } }

.att2__speech {
  min-height: 3.2em;
  max-width: 22rem;
  text-align: center;
  font-family: var(--font-machine); font-size: 0.98rem; line-height: 1.4;
  color: var(--amber);
  text-shadow: 0 1px 3px rgba(5,2,4,0.9);
}
.att2--rage .att2__speech { color: var(--red); text-shadow: 0 0 10px rgba(255,48,64,0.6); }
.att2__speech--pop { animation: a2-pop 0.16s ease-out; }
@keyframes a2-pop { 0% { opacity: 0; transform: translateY(5px); } 100% { opacity: 1; transform: none; } }

.att2__pad {
  flex: 0 0 auto;
  display: flex; align-items: end; justify-content: center; gap: 0.5rem;
  padding: 0.6rem 0.8rem 0.4rem;
}
.a2btn {
  display: flex; flex-direction: column; align-items: center; gap: 0.15rem;
  min-width: 52px; min-height: 56px;
  padding: 0.5rem 0.4rem;
  font-size: 1.35rem;
  font-family: var(--font-machine);
  background: rgba(13,7,12,0.8); border: 1px solid rgba(255,177,78,0.3); color: var(--amber);
  cursor: pointer;
}
.a2btn span { font-size: 0.52rem; letter-spacing: 0.1em; }
.a2btn--big { border-color: var(--pink); color: var(--tube-core); box-shadow: 0 0 14px rgba(255,46,200,0.25); }
.a2btn--tip { border-color: rgba(255,177,78,0.5); }
.a2btn:active { transform: translateY(1px); }
.a2btn:focus-visible { outline: 2px solid var(--blue); outline-offset: 2px; }

.att2__tip { position: absolute; inset: 0; display: grid; place-items: center; padding: 1rem; background: rgba(5,2,4,0.7); z-index: 2; }
.att2__tip[hidden] { display: none; }
.att2__tipcard { width: min(20rem,100%); padding: 1.1rem 1.2rem 1.2rem; background: rgba(13,7,12,0.97); border: 1px solid rgba(255,177,78,0.4); font-family: var(--font-machine); text-align: center; }
.att2__tiphead { letter-spacing: 0.24em; color: var(--tube-core); text-shadow: 0 0 8px rgba(69,200,255,0.6); }
.att2__tipsub { margin-top: 0.25rem; font-size: 0.68rem; color: var(--amber-dim); }
.att2__tipgrid { display: grid; grid-template-columns: repeat(2,1fr); gap: 0.5rem; margin-top: 0.9rem; }
.att2__tipgrid button { font: inherit; font-family: var(--font-machine); font-size: 1rem; padding: 0.7rem; min-height: 52px; color: var(--amber-dim); background: rgba(5,2,4,0.6); border: 1px solid rgba(255,177,78,0.25); }
.att2__tipgrid button:disabled { opacity: 0.4; }
.att2__tipyes { color: var(--tube-core) !important; border-color: var(--pink) !important; box-shadow: 0 0 14px rgba(255,46,200,0.35); cursor: pointer; }
.att2__tipno { margin-top: 0.6rem; width: 100%; font: inherit; font-family: var(--font-machine); font-size: 0.66rem; padding: 0.55rem; color: var(--amber-dim); background: none; border: 1px dashed rgba(255,177,78,0.25); opacity: 0.5; text-decoration: line-through; }

/* ============================================================
   THE WALL — rotate-to-cinema
   ============================================================ */
.cine {
  position: fixed; inset: 0; z-index: 14;
  background: rgba(4,2,4,0.97);
  opacity: 0; transition: opacity 0.24s ease-out;
}
.cine[hidden] { display: none; }
.cine--in { opacity: 1; }

/* Portrait: the rotate prompt. */
.cine__prompt {
  position: absolute; inset: 0;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 0.7rem;
  padding: 2rem;
  text-align: center;
}
.cine__rotate svg { width: 5.5rem; height: 5.5rem; }
.cine__rotate rect { fill: none; stroke: var(--pink); stroke-width: 3; filter: drop-shadow(0 0 6px rgba(255,46,200,0.6)); }
.cine__rotate path { stroke: var(--blue); stroke-width: 3; }
.cine__rotate { animation: cine-tilt 2.4s ease-in-out infinite; }
@keyframes cine-tilt { 0%,60%,100% { transform: rotate(0); } 78% { transform: rotate(-88deg); } 88% { transform: rotate(-88deg); } }
.cine__big { font-family: var(--font-tube); font-size: clamp(2rem,10vw,3.4rem); letter-spacing: 0.06em; color: var(--tube-core); text-shadow: var(--glow-pink); text-transform: uppercase; }
.cine--rick .cine__big { text-shadow: var(--glow-red); }
.cine__sub { font-family: var(--font-machine); font-size: 0.9rem; letter-spacing: 0.16em; color: var(--amber); text-transform: uppercase; }
.cine__close { margin-top: 1rem; min-height: 44px; padding: 0.6rem 1.2rem; font-family: var(--font-machine); font-size: 0.72rem; letter-spacing: 0.1em; color: var(--amber-dim); background: none; border: 1px dashed rgba(255,177,78,0.3); cursor: pointer; }
.cine--rick .cine__close { display: none; }

/* The stage (video) only shows when live (landscape). */
.cine__stage { position: absolute; inset: 0; display: none; }
.cine--live .cine__prompt { display: none; }
.cine--live .cine__stage { display: block; }
.cine__screen { position: absolute; inset: 0; background: #000; }
.cine__screen iframe { width: 100%; height: 100%; border: 0; display: block; }
.cine__exit { position: absolute; top: calc(var(--safe-t) + 0.6rem); right: calc(var(--safe-r) + 0.6rem); width: 44px; height: 44px; font-size: 1.1rem; color: var(--tube-core); background: rgba(5,2,4,0.6); border: 1px solid rgba(255,246,251,0.3); cursor: pointer; z-index: 2; }
.cine--rick .cine__exit { display: none; }
.cine__bezel { position: absolute; bottom: calc(var(--safe-b) + 0.6rem); left: 50%; transform: translateX(-50%); z-index: 2; }
.cine__knob { font-family: var(--font-machine); font-size: 0.72rem; letter-spacing: 0.16em; color: var(--amber); background: rgba(5,2,4,0.7); border: 1px solid rgba(255,177,78,0.4); padding: 0.6rem 1.1rem; min-height: 44px; cursor: pointer; }
.cine--rick .cine__bezel { display: none; }

@media (prefers-reduced-motion: reduce) {
  .deck2__record--spin, .cine__rotate, .deck2__hint, .a2-eye, .a2-tip, .a2-led1, .a2-led2, .a2-led3 { animation: none !important; }
  .att2, .cine { transition: none; }
}
