/* The Drone Hangar 4.0 Arcade — the bar is the menu.
   Committed single-theme: this is a dim room at night, in any OS theme. */

/* The Drone Hangar's own title face, the same file the mobile app, the
   overlay and the admin console ship. Served from this origin rather than
   a font CDN: the arcade's CSP allows Google Fonts only, and this face is
   not there - it is Typo-Graf's, public domain, fsType 0.
   swap, so the sign is readable immediately and simply restyles when the
   15 KB arrives; the fallback is a blackletter only as a last resort. */
@font-face{
  font-family:"Dyer Arts and Crafts";
  src:url("fonts/dyer-arts-and-crafts.woff2") format("woff2");
  font-weight:400;font-style:normal;font-display:swap;
}

:root{
  --ink:#07070a; --brick:#2a1416; --brick-dk:#1a0d0f;
  --paper:#f2ede3; --dim:#9a8f85;
  --red:#ff2b2b; --red-dp:#c01818; --blue:#4d8bff; --amber:#ffb347;
  --wood:#17131a;
  --display:"Barlow Condensed","Oswald",system-ui,sans-serif;
  --title:"Dyer Arts and Crafts",Georgia,"Times New Roman",serif;
  --neon:0 0 8px rgba(255,43,43,.9),0 0 26px rgba(255,43,43,.55),0 0 60px rgba(255,43,43,.28);
  --tv-w:min(34vw,340px);
  color-scheme:dark;
}
*{box-sizing:border-box}
html,body{height:100%}
body{
  margin:0;overflow:hidden;background:var(--ink);color:var(--paper);
  font-family:var(--display);-webkit-font-smoothing:antialiased;
}

/* ───────────────────────────── the room ──────────────────────────── */
.room{
  position:relative;height:100%;display:grid;
  grid-template-rows:auto 1fr auto;   /* sign | wall | counter */
  /* An implicit grid column is sized to max-content, and grid items default
     to min-width:auto, so the widest child - the rail of TVs - sets the width
     of the whole room. minmax(0,1fr) caps the column at the viewport and lets
     the rail scroll inside it, which is what it is for. Without this the sign
     and the counter are laid out in a 693px room on a 390px phone and simply
     hang off the right edge, silently, because the room is overflow:hidden. */
  grid-template-columns:minmax(0,1fr);
  /* brick wall + warm pools of light from the pendants */
  background:
    radial-gradient(ellipse 50% 30% at 15% 0%, rgba(255,160,90,.16), transparent 60%),
    radial-gradient(ellipse 50% 30% at 82% 0%, rgba(255,160,90,.13), transparent 60%),
    radial-gradient(ellipse 70% 45% at 50% 22%, rgba(255,43,43,.16), transparent 70%),
    linear-gradient(180deg,#140b0d 0%,var(--brick) 38%,var(--brick-dk) 78%,#0a0507 100%);
}
/* mortar lines */
.room::before{
  content:"";position:absolute;inset:0;pointer-events:none;opacity:.5;
  background:
    repeating-linear-gradient(0deg,transparent 0 46px,rgba(0,0,0,.55) 46px 50px),
    repeating-linear-gradient(90deg,transparent 0 96px,rgba(0,0,0,.4) 96px 100px);
  mask-image:linear-gradient(180deg,#000 0%,#000 62%,transparent 86%);
}
/* a little grain so the flats do not band */
.room::after{
  content:"";position:absolute;inset:0;pointer-events:none;opacity:.05;mix-blend-mode:overlay;
  background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='120' height='120'%3E%3Cfilter id='n'%3E%3CfeTurbulence baseFrequency='.85' numOctaves='3'/%3E%3C/filter%3E%3Crect width='120' height='120' filter='url(%23n)'/%3E%3C/svg%3E");
}

.ceiling{position:absolute;top:0;left:0;right:0;height:0;z-index:3}
.pendant{position:absolute;left:var(--x);top:0;width:2px;height:clamp(28px,5vh,56px);background:linear-gradient(#3a3038,#1a1418)}
.pendant::after{
  content:"";position:absolute;left:50%;top:100%;translate:-50% 0;
  width:34px;height:17px;border-radius:0 0 40px 40px;
  background:linear-gradient(180deg,var(--red-dp),#7d0f0f);
  box-shadow:0 14px 34px 6px rgba(255,150,90,.3),0 2px 0 rgba(255,220,180,.5) inset;
}

/* ───────────────────────────── the sign ──────────────────────────── */
.sign-wrap{position:relative;z-index:4;text-align:center;padding:clamp(1.4rem,5vh,3rem) 1rem .4rem}
.sign{
  display:inline-block;margin:0;padding:.25em .7em .35em;
  border:2px solid var(--red);border-radius:4px;
  background:linear-gradient(180deg,rgba(255,43,43,.3),rgba(140,10,10,.5));
  box-shadow:var(--neon),inset 0 0 30px rgba(255,80,80,.25);
  animation:flicker 9s steps(1,end) infinite;
}
.sign-text{
  font-family:var(--title);font-weight:400;
  /* Dyer runs wider and shorter than the blackletter it replaced, so it
     takes a slightly smaller size and a little tracking to sit in the
     same neon box without crowding the border. */
  font-size:clamp(1.35rem,4.6vw,3rem);line-height:1.2;letter-spacing:.02em;
  color:#fff;
  text-shadow:0 0 6px #fff,0 0 18px rgba(255,120,120,.9),0 0 44px rgba(255,43,43,.7);
}
.sign-sub{
  margin:.5rem 0 0;font-size:clamp(.7rem,1.6vw,.9rem);font-weight:600;
  letter-spacing:.55em;text-indent:.55em;text-transform:uppercase;color:var(--dim);
}
@keyframes flicker{
  0%,96%,100%{opacity:1}
  96.5%{opacity:.5}97%{opacity:1}97.4%{opacity:.35}97.7%{opacity:1}
}

/* ─────────────────────────── the wall of TVs ─────────────────────── */
.wall{position:relative;z-index:4;display:flex;align-items:center;min-height:0;min-width:0;padding:0 .25rem}
.rail{
  display:flex;gap:clamp(1rem,3vw,2.4rem);align-items:center;
  justify-content:safe center;
  overflow-x:auto;overflow-y:hidden;scroll-snap-type:x mandatory;
  scroll-behavior:smooth;
  /* generous block padding: the focused tile's glow is 34px and the wall
     bracket sits 14px above it, and overflow-y:hidden would clip both. */
  padding:clamp(2.6rem,6vh,3.6rem) max(16px,env(safe-area-inset-left,0px));
  width:100%;scrollbar-width:none;outline:none;
  /* A flex child defaults to min-width:auto, which means "never shrink below
     your content". This rail IS the horizontal scroller, so without this it
     refuses to narrow, widens .wall and .room past the viewport, and pushes
     the neon sign off-centre and half off a phone screen. The room is
     overflow:hidden, so the symptom is a sign sliding off the right edge
     rather than a scrollbar telling you what happened. */
  min-width:0;
}
.rail::-webkit-scrollbar{display:none}

.tv{
  position:relative;flex:0 0 var(--tv-w);scroll-snap-align:center;
  cursor:pointer;border:0;padding:0;background:none;color:inherit;
  transition:transform .35s ease,filter .35s ease;filter:brightness(.62) saturate(.8);
  text-align:left;
}
.tv[data-focus="1"]{transform:translateY(-6px) scale(1.045);filter:none}
.tv:focus-visible{outline:3px solid var(--blue);outline-offset:8px;border-radius:12px}

/* bracket holding it to the wall */
.tv::before{
  content:"";position:absolute;left:50%;top:-14px;translate:-50% 0;
  width:26%;height:16px;background:linear-gradient(#2b242c,#120f14);
  border-radius:3px 3px 0 0;box-shadow:0 6px 10px rgba(0,0,0,.6);
}
.cab{
  display:block;position:relative;aspect-ratio:16/9;border-radius:10px;overflow:hidden;
  background:#05050a;
  border:5px solid #121016;
  box-shadow:0 0 0 2px #241f29,0 22px 44px rgba(0,0,0,.72),
             inset 0 0 40px rgba(0,0,0,.9);
}
.cab img{width:100%;height:100%;object-fit:contain;background:#05050a;display:block}

/* CRT glass: scanlines, curvature vignette, travelling sheen */
.cab::after{
  content:"";position:absolute;inset:0;pointer-events:none;
  background:
    repeating-linear-gradient(0deg,rgba(0,0,0,.33) 0 1px,transparent 1px 3px),
    radial-gradient(ellipse 130% 120% at 50% 50%,transparent 52%,rgba(0,0,0,.72) 100%);
}
.cab::before{
  content:"";position:absolute;top:0;bottom:0;width:36%;z-index:2;pointer-events:none;
  background:linear-gradient(105deg,transparent,rgba(255,255,255,.1) 45%,transparent);
  animation:sheen 7.5s ease-in-out infinite;
}
@keyframes sheen{0%,72%{left:-40%}88%,100%{left:120%}}

.tv[data-focus="1"] .cab{
  box-shadow:0 0 0 2px #3a3340,0 26px 52px rgba(0,0,0,.8),
             0 0 34px var(--accent,#ff2b2b),0 0 90px rgba(77,139,255,.22);
}

/* a game that is not answering */
.tv[data-state="down"] .cab img,.tv[data-state="maintenance"] .cab img{opacity:0;}
.tv[data-state="down"] .cab,.tv[data-state="maintenance"] .cab{
  background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='80' height='80'%3E%3Cfilter id='s'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2'/%3E%3C/filter%3E%3Crect width='80' height='80' filter='url(%23s)' opacity='.32'/%3E%3C/svg%3E");
}
.tape{
  position:absolute;z-index:3;left:50%;top:50%;translate:-50% -50%;rotate:-6deg;
  background:#efe7d2;color:#1b1b1b;padding:.5em 1.1em;font-weight:700;
  letter-spacing:.14em;font-size:clamp(.6rem,1.5vw,.78rem);text-transform:uppercase;
  box-shadow:0 8px 18px rgba(0,0,0,.6);
}
.tape::before,.tape::after{
  content:"";position:absolute;top:-9px;width:34px;height:18px;
  background:rgba(226,214,186,.5);rotate:-8deg;
}
.tape::before{left:-10px}.tape::after{right:-10px;rotate:9deg}

.label{display:block;padding:.7rem .1rem 0}
.label .t{
  display:block;font-size:clamp(1rem,2.2vw,1.35rem);font-weight:600;letter-spacing:.02em;
  overflow:hidden;text-overflow:ellipsis;white-space:nowrap;
}
.label .k{
  display:block;font-size:.66rem;font-weight:600;letter-spacing:.24em;
  text-transform:uppercase;color:var(--red);min-height:1em;
}

.pan{
  position:relative;z-index:5;flex:none;width:clamp(30px,4vw,44px);height:clamp(54px,9vh,84px);
  border:1px solid #39313c;border-radius:4px;background:rgba(10,8,12,.6);color:var(--paper);
  font-size:1.6rem;line-height:1;cursor:pointer;backdrop-filter:blur(3px);
}
.pan:hover{background:rgba(255,43,43,.22);border-color:var(--red)}
.pan:disabled{opacity:.18;cursor:default}
.pan:focus-visible{outline:2px solid var(--blue);outline-offset:2px}

.empty{margin:auto;text-align:center;color:var(--dim);padding:2rem}
.empty b{display:block;color:var(--paper);font-size:1.3rem;margin-bottom:.4rem}

/* ─────────────────────────── the bar counter ─────────────────────── */
.counter{position:relative;z-index:4;margin-top:auto}
.underglow{
  position:absolute;left:0;top:-6px;width:clamp(120px,22vw,300px);height:12px;
  border-radius:50%;background:var(--blue);filter:blur(13px);opacity:.85;
  transition:transform .5s cubic-bezier(.4,0,.2,1),background .4s ease;
  will-change:transform;
}
.counter-top{
  height:clamp(14px,2.4vh,22px);
  background:linear-gradient(180deg,#2a2630,#15121a 55%,#0c0a10);
  box-shadow:0 -14px 30px rgba(255,43,43,.16),0 2px 0 rgba(255,255,255,.06) inset;
  border-top:1px solid #3a3440;
}
.counter-face{
  height:clamp(42px,9vh,96px);position:relative;
  background:linear-gradient(180deg,var(--wood),#0a080d);
  border-top:2px solid rgba(255,43,43,.5);
  box-shadow:0 -5px 26px rgba(255,43,43,.4);
  display:grid;place-items:center;
  padding-bottom:env(safe-area-inset-bottom,0px);
}
.plate{
  border:2px solid var(--blue);border-radius:3px;padding:.25em .9em;
  font-size:clamp(.6rem,1.5vw,.8rem);font-weight:600;letter-spacing:.3em;
  color:var(--red);background:rgba(5,5,12,.7);
  box-shadow:0 0 10px rgba(77,139,255,.6),inset 0 0 14px rgba(77,139,255,.18);
}
.plate b{color:var(--blue);font-weight:600}

.now{
  position:absolute;left:0;right:0;bottom:clamp(74px,13vh,136px);z-index:5;
  text-align:center;pointer-events:none;
  padding:0 max(16px,env(safe-area-inset-left,0px));
}
.now .d{
  display:inline-block;max-width:min(52ch,90vw);color:var(--dim);
  font-size:clamp(.82rem,1.7vw,.98rem);line-height:1.45;
  text-shadow:0 2px 10px #000;
}
.now .m{display:block;margin-top:.25rem;font-size:.68rem;letter-spacing:.2em;text-transform:uppercase;color:#6d6a75}

/* ───────────────────────── the projector screen ──────────────────── */
.projector{position:fixed;inset:0;z-index:50}
.projector[hidden]{display:none}
.backdrop{
  position:absolute;inset:0;background:rgba(3,2,5,.86);opacity:0;
  transition:opacity .45s ease;backdrop-filter:blur(3px);
}
.projector.open .backdrop{opacity:1}

.deck{
  position:absolute;left:50%;top:0;translate:-50% 0;
  width:min(96vw,1500px);height:100%;
  display:grid;grid-template-rows:auto 1fr;justify-items:center;
  transform:translateY(-101%);
  transition:transform .78s cubic-bezier(.2,1.12,.32,1);
  will-change:transform;
}
.projector.open .deck{transform:translateY(0)}
.projector.closing .deck{transition:transform .4s cubic-bezier(.55,0,.85,.2)}

.housing{
  position:relative;width:min(96vw,1500px);height:clamp(14px,2.2vh,22px);
  background:linear-gradient(180deg,#45404c,#1d1a22 60%,#100e14);
  border-radius:0 0 5px 5px;box-shadow:0 10px 26px rgba(0,0,0,.8);
}
.housing-cap{position:absolute;top:0;left:-10px;width:12px;height:100%;background:#2a2630;border-radius:0 0 3px 3px}
.housing-cap.r{left:auto;right:-10px}

.fabric{
  /* align-self:start matters: in the deck's 1fr row this would otherwise
     stretch, dropping the weight bar and its pull cord off the bottom. */
  align-self:start;
  position:relative;width:min(88vw,1320px);
  display:grid;grid-template-rows:auto auto;
  padding:0 0 clamp(14px,3vh,28px);
  min-height:0;
}
.surface{
  position:relative;width:100%;aspect-ratio:16/9;max-height:calc(100dvh - 215px);
  margin-inline:auto;background:#04040a;
  border:1px solid #4a4652;border-top:0;
  box-shadow:0 30px 70px rgba(0,0,0,.85),inset 0 0 70px rgba(0,0,0,.6);
  overflow:hidden;
}
.frame{position:absolute;inset:0}
.frame iframe{width:100%;height:100%;border:0;display:block;background:#04040a}

.boot{
  position:absolute;inset:0;display:grid;place-content:center;justify-items:center;gap:.5rem;
  background:#06060c;z-index:2;transition:opacity .4s ease .15s;
}
.boot.gone{opacity:0;pointer-events:none}
.boot-title{font-size:clamp(1.2rem,3.2vw,2rem);font-weight:600;letter-spacing:.1em;text-transform:uppercase;text-shadow:var(--neon)}
.boot-note{font-size:.7rem;letter-spacing:.3em;text-transform:uppercase;color:var(--dim);animation:blink 1.1s steps(2,end) infinite}
@keyframes blink{50%{opacity:.15}}

.weight-bar{
  position:relative;width:100%;height:clamp(10px,1.6vh,16px);margin-top:-1px;
  background:linear-gradient(180deg,#3b3742,#17141c);
  box-shadow:0 8px 20px rgba(0,0,0,.7);
}
.cord{
  position:absolute;right:clamp(14px,4vw,54px);top:100%;
  background:none;border:0;padding:0 10px 14px;cursor:pointer;
  display:flex;flex-direction:column;align-items:center;
}
.cord-line{width:2px;height:clamp(26px,5vh,46px);background:linear-gradient(#cfc7b8,#8a8275)}
.cord-knob{
  width:16px;height:16px;border-radius:50%;
  background:radial-gradient(circle at 35% 30%,#ff6b6b,var(--red-dp));
  box-shadow:0 0 10px rgba(255,43,43,.9);
}
.cord:hover .cord-line{height:clamp(32px,6.2vh,58px)}
.cord-line{transition:height .22s ease}
.cord:focus-visible{outline:2px solid var(--blue);outline-offset:4px;border-radius:4px}

@media (max-width:560px){
  :root{--tv-w:min(74vw,330px)}
  .surface{max-height:calc(100dvh - 165px)}
  .fabric{width:94vw}
}

@media (prefers-reduced-motion:reduce){
  *{animation:none!important}
  .deck,.backdrop,.tv,.underglow{transition:none!important}
  .rail{scroll-behavior:auto}
}
