
:root{
  --shell-height:72px;
  --shell-gold:#d8b77d;
  --shell-gold-soft:#ead8b8;
  --shell-bg:rgba(7,6,6,.97);
  --shell-purple:#c891f0;
}
html,body{margin:0;width:100%;height:100%;background:#080604}
body.has-site-shell{
  padding-top:var(--shell-height);
  overflow:hidden;
}
.site-shell{
  position:fixed;
  z-index:10000;
  inset:0 0 auto 0;
  height:var(--shell-height);
  display:grid;
  grid-template-columns:minmax(220px,1fr) auto minmax(220px,1fr);
  align-items:center;
  gap:18px;
  padding:8px 22px;
  background:
    linear-gradient(180deg,rgba(17,14,11,.99),rgba(5,5,5,.98));
  border-bottom:1px solid rgba(216,183,125,.55);
  box-shadow:0 4px 18px rgba(0,0,0,.68);
  color:var(--shell-gold-soft);
  font-family:Georgia,serif;
}
.site-brand-group{
  min-width:0;
  display:flex;
  align-items:center;
  justify-content:flex-start;
  gap:10px;
  height:100%;
  overflow:hidden;
}
.site-brand{display:flex;flex-direction:column;align-items:flex-start;justify-content:center;text-decoration:none;white-space:nowrap;line-height:.95;text-shadow:0 2px 8px #000;flex:0 1 auto;min-width:0}
.site-brand-logo{
  display:block;
  flex:0 0 auto;
  width:auto;
  height:54px;
  max-width:52px;
  object-fit:contain;
  pointer-events:none;
  user-select:none;
  -webkit-user-drag:none;
  filter:drop-shadow(0 2px 5px rgba(0,0,0,.78));
}
.brand-swingali{color:#c891f0;font-family:"Rye",Georgia,serif;font-size:clamp(.82rem,1.22vw,1.16rem);letter-spacing:.055em;text-shadow:0 0 9px rgba(200,145,240,.42),0 2px 8px #000}
.brand-presents{margin-top:5px;align-self:center;color:#d8b77d;font:700 clamp(.47rem,.62vw,.62rem)/1 Georgia,serif;letter-spacing:.16em}
.site-countdown{
  display:flex;
  align-items:center;
  justify-content:center;
  gap:12px;
  min-width:370px;
}
.countdown-label{
  font-family:"Rye",Georgia,serif;
  font-size:.68rem;
  letter-spacing:.08em;
  color:var(--shell-gold);
  white-space:nowrap;
}
.countdown-units{display:flex;gap:12px}
.countdown-unit{
  min-width:48px;
  text-align:center;
  border-left:1px solid rgba(216,183,125,.3);
  padding-left:12px;
}
.countdown-unit:first-child{border-left:0;padding-left:0}
.countdown-number{
  display:block;
  font-size:1.22rem;
  line-height:1;
  color:#f0d7a6;
  font-variant-numeric:tabular-nums;
}
.countdown-name{
  display:block;
  margin-top:3px;
  font-size:.52rem;
  letter-spacing:.08em;
  text-transform:uppercase;
  color:rgba(234,216,184,.68);
}
.site-location{
  justify-self:end;
  text-align:right;
  line-height:1.15;
}
.location-label{
  display:block;
  font-size:.5rem;
  letter-spacing:.14em;
  text-transform:uppercase;
  color:rgba(234,216,184,.5);
}
.location-name{
  display:block;
  margin-top:3px;
  font-family:"Rye",Georgia,serif;
  font-size:clamp(.72rem,1vw,.92rem);
  color:var(--shell-gold-soft);
  text-shadow:0 0 9px rgba(200,145,240,.18),0 2px 7px #000;
}
/* Critical rule: rooms occupy ONLY the viewport below the permanent bar.
   Existing artwork ratios, cover behavior, hotspot percentages and internal
   interactions remain unchanged inside this reduced viewport. */
body.has-site-shell main,
body.has-site-shell .foyer,
body.has-site-shell .archives-room,
body.has-site-shell .workshop-room,
body.has-site-shell .radio-room,
body.has-site-shell .hollow{
  height:calc(100vh - var(--shell-height)) !important;
  height:calc(100svh - var(--shell-height)) !important;
  max-height:calc(100vh - var(--shell-height));
}

@media(max-width:820px){
  :root{--shell-height:86px}
  .site-shell{
    grid-template-columns:1fr 1fr;
    grid-template-rows:auto auto;
    gap:5px 12px;
    padding:7px 12px;
  }
  .site-brand-group{grid-column:1;grid-row:1;gap:7px}
  .site-brand-logo{height:41px;max-width:40px}
  .site-location{grid-column:2;grid-row:1}
  .site-countdown{
    grid-column:1 / 3;grid-row:2;
    min-width:0;gap:8px;
  }
  .countdown-label{font-size:.55rem}
  .countdown-units{gap:8px}
  .countdown-unit{min-width:39px;padding-left:8px}
  .countdown-number{font-size:.95rem}
}

.ambience-bar{
  position:fixed;z-index:10002;left:50%;bottom:9px;transform:translateX(-50%);
  width:min(500px,42vw);min-height:28px;
  display:grid;grid-template-columns:auto minmax(90px,1fr) 82px 30px minmax(80px,105px);
  align-items:center;gap:7px;padding:4px 8px;
  background:rgba(7,6,7,.92);border:1px solid rgba(216,183,125,.46);border-radius:4px;
  box-shadow:0 4px 16px rgba(0,0,0,.58),0 0 10px rgba(193,116,241,.10);
  color:#d8b77d;font-family:Georgia,serif
}
.ambience-title{font-size:.52rem;letter-spacing:.07em;font-weight:700;white-space:nowrap}.ambience-name{font-size:.60rem;color:#c891f0;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.ambience-meter{height:18px;display:flex;align-items:center;justify-content:center;gap:3px;overflow:visible}
.ambience-meter i{display:block;width:3px;height:5px;border-radius:2px;background:#a868d1;opacity:.46;transform-origin:center;animation:ambiencePulse .92s ease-in-out infinite;animation-delay:calc(var(--i)*-.065s);animation-play-state:paused}
.ambience-bar.is-playing .ambience-meter i{animation-play-state:running;opacity:1;box-shadow:0 0 5px rgba(193,116,241,.55)}
@keyframes ambiencePulse{0%,100%{height:4px}25%{height:15px}50%{height:8px}75%{height:18px}}
.ambience-toggle{width:26px;height:24px;border:1px solid rgba(216,183,125,.36);border-radius:4px;color:#e8d1a7;background:rgba(20,13,21,.8);cursor:pointer}
.ambience-toggle:disabled{opacity:.38;cursor:default}
.ambience-volume{-webkit-appearance:none;appearance:none;width:100%;height:16px;background:transparent;cursor:pointer}
.ambience-volume:focus{outline:none}
.ambience-volume::-webkit-slider-runnable-track{height:4px;border-radius:4px;background:linear-gradient(90deg,#6f3b8d,#b875df);box-shadow:inset 0 0 2px #000}
.ambience-volume::-webkit-slider-thumb{-webkit-appearance:none;appearance:none;width:14px;height:14px;margin-top:-5px;border-radius:50%;border:1px solid #e6c99a;background:#b875df;box-shadow:0 0 8px rgba(193,116,241,.75)}
.ambience-volume::-moz-range-track{height:4px;border-radius:4px;background:#7f499d}
.ambience-volume::-moz-range-thumb{width:14px;height:14px;border-radius:50%;border:1px solid #e6c99a;background:#b875df;box-shadow:0 0 8px rgba(193,116,241,.75)}
.ambience-volume:disabled{opacity:.32;cursor:default}
.ambience-bar.is-silent .ambience-meter{opacity:.25}
@media(max-width:900px){
  .ambience-bar{left:auto;right:10px;transform:none;width:min(390px,48vw);grid-template-columns:1fr 65px 28px 90px}
  .ambience-title{display:none}
}
@media(max-width:650px){
  .ambience-bar{left:10px;right:10px;bottom:8px;width:auto;grid-template-columns:1fr 28px 90px}
  .ambience-meter{display:none}
  .gs-back-foyer{bottom:48px !important}
}

/* Countdown decorations only */
.site-countdown{position:relative}
.countdown-pumpkin-img{
 display:block;flex:0 0 auto;width:auto;height:46px;max-width:50px;
 object-fit:contain;margin:0 3px;align-self:center;
 filter:drop-shadow(0 2px 3px rgba(0,0,0,.78))
}
.countdown-victorian{
 position:relative;display:block;flex:0 0 23px;width:23px;height:46px;
 opacity:.82;pointer-events:none
}
.countdown-victorian::before{
 content:"";position:absolute;inset:4px 2px;
 border-left:2px solid rgba(176,133,70,.78);
 border-top:2px solid rgba(176,133,70,.78);
 border-radius:12px 0 0 0;
 box-shadow:-2px -2px 0 rgba(45,29,16,.72)
}
.countdown-victorian::after{
 content:"";position:absolute;left:7px;top:11px;width:10px;height:10px;
 border:1px solid rgba(151,108,60,.78);border-radius:50% 2px 50% 2px;
 transform:rotate(-25deg);
 box-shadow:7px 9px 0 -3px rgba(176,133,70,.58),
            4px 18px 0 -4px rgba(176,133,70,.46)
}
.countdown-victorian-right{transform:scaleX(-1)}
.countdown-victorian-left{margin-right:1px}
.countdown-victorian-right{margin-left:1px}
@media(max-width:1100px){
 .countdown-pumpkin-img{height:39px;max-width:43px}
 .countdown-victorian{flex-basis:18px;width:18px;height:40px}
}
@media(max-width:860px){
 .countdown-victorian{display:none}
 .countdown-pumpkin-img{height:33px;max-width:37px}
}

@media(max-width:520px){
  .site-brand-group{gap:5px}
  .site-brand-logo{height:34px;max-width:33px}
  .brand-swingali{font-size:.76rem}
  .brand-presents{font-size:.43rem;letter-spacing:.12em}
}


/* ============================================================
   TGS MOBILE COMPATIBILITY 14A
   Mobile-only compatibility layer. Desktop geometry is untouched.
   ============================================================ */

@media (max-width:820px){
  html,body{max-width:100%;overflow-x:hidden}

  /* Permanent shell: keep brand/logo inside its own column on narrow phones. */
  .site-shell{
    grid-template-columns:minmax(0,1fr) minmax(0,1fr);
    column-gap:8px;
    padding-left:8px;
    padding-right:8px;
  }
  .site-brand-group{
    min-width:0;
    max-width:100%;
    gap:4px;
    overflow:hidden;
  }
  .site-brand{
    flex:1 1 auto;
    min-width:0;
    overflow:hidden;
  }
  .brand-swingali{
    display:block;
    max-width:100%;
    overflow:hidden;
    text-overflow:clip;
    font-size:clamp(.60rem,2.65vw,.76rem);
    letter-spacing:.025em;
  }
  .brand-presents{
    margin-top:3px;
    font-size:.40rem;
    letter-spacing:.09em;
  }
  .site-brand-logo{
    flex:0 0 30px;
    width:30px;
    max-width:30px;
    height:31px;
  }

  /* JS-applied fit class: artwork and hotspot coordinates keep one geometry. */
  .gs-mobile-fit-stage{
    position:relative !important;
    margin-left:auto !important;
    margin-right:auto !important;
    min-width:0 !important;
    min-height:0 !important;
    overflow:hidden !important;
    flex:none !important;
  }

  /* Keep room titles inside the fitted composition. */
  .gs-mobile-fit-stage .realm-title,
  .gs-mobile-fit-stage .castle-title,
  .gs-mobile-fit-stage .ll-title{
    max-width:92% !important;
    white-space:normal !important;
    text-align:center !important;
    font-size:clamp(.72rem,3vw,1rem) !important;
  }

  /* Touch devices do not have hover. Keep existing markers available, enlarge
     only very small hit areas slightly without moving their coordinate anchors. */
  @media (pointer:coarse){
    .archive-hotspot,
    .workshop-hotspot,
    .radio-hotspot,
    .ll-hotspot,
    .veil-hotspot,
    .gallery-hotspot,
    .hotspot{
      -webkit-tap-highlight-color:transparent;
      touch-action:manipulation;
    }
  }

  /* About and Notice Board already use aspect-ratio stages. Keep them bounded
     beneath the permanent shell and above the ambience bar. */
  .about-room,
  .notice-room{
    max-width:100vw !important;
    overflow:hidden !important;
  }
  .about-stage,
  .notice-stage{
    max-width:100% !important;
    max-height:calc(100svh - var(--shell-height) - 58px) !important;
  }

  /* Local Hauntings selection becomes a normal vertical mobile flow.
     This removes fixed desktop side-lanes that overlap on phones. */
  body[data-location*="LOCAL HAUNTINGS — CHOOSE YOUR PATH"]{
    overflow-y:auto !important;
    overflow-x:hidden !important;
  }
  body[data-location*="LOCAL HAUNTINGS — CHOOSE YOUR PATH"] .local-hauntings-room{
    min-height:calc(100svh - var(--shell-height)) !important;
    padding:12px 10px 76px !important;
    display:flex !important;
    flex-direction:column !important;
    align-items:center !important;
    gap:12px !important;
    overflow:visible !important;
  }
  body[data-location*="LOCAL HAUNTINGS — CHOOSE YOUR PATH"] .field-reports-hotspot,
  body[data-location*="LOCAL HAUNTINGS — CHOOSE YOUR PATH"] .featured-haunts-hotspot,
  body[data-location*="LOCAL HAUNTINGS — CHOOSE YOUR PATH"] .portal-patrons-art-button{
    position:relative !important;
    inset:auto !important;
    left:auto !important;
    right:auto !important;
    top:auto !important;
    bottom:auto !important;
    transform:none !important;
    margin:4px auto !important;
  }
  body[data-location*="LOCAL HAUNTINGS — CHOOSE YOUR PATH"] .field-reports-hotspot{
    width:min(250px,64vw) !important;
  }
  body[data-location*="LOCAL HAUNTINGS — CHOOSE YOUR PATH"] .featured-haunts-hotspot{
    width:min(250px,58vw) !important;
    height:auto !important;
    aspect-ratio:960/1728 !important;
  }
  body[data-location*="LOCAL HAUNTINGS — CHOOSE YOUR PATH"] .portal-patrons-art-button{
    width:min(430px,88vw) !important;
  }
  body[data-location*="LOCAL HAUNTINGS — CHOOSE YOUR PATH"] .portal-patrons-pointer{
    display:none !important;
  }
  body[data-location*="LOCAL HAUNTINGS — CHOOSE YOUR PATH"] .selection-layer{
    width:min(620px,96vw) !important;
    transform:none !important;
    margin:0 auto !important;
  }

  /* Long-form pages stay readable instead of becoming miniature desktop pages. */
  .community-wrap,
  .registry-wrap,
  .patronage-shell{
    width:min(100%,96vw) !important;
    max-width:100% !important;
  }
  .shop-intro,
  .shop-shelves,
  .shop-toolbar{
    width:min(100%,94vw) !important;
    max-width:100% !important;
  }

  /* Theater controls remain touchable if the room stage is fitted by JS. */
  .watch-room .player-console{
    max-width:100% !important;
  }
  .watch-room .player-console button{
    min-height:40px !important;
    touch-action:manipulation;
  }
  .watch-room .seek-control,
  .watch-room .volume-control{
    min-width:0 !important;
    max-width:100% !important;
  }
}

@media (max-width:520px){
  .site-shell{column-gap:6px}
  .site-brand-logo{
    flex-basis:27px;
    width:27px;
    max-width:27px;
    height:28px;
  }
  .brand-swingali{
    font-size:clamp(.54rem,2.75vw,.66rem);
    letter-spacing:.015em;
  }
  .brand-presents{font-size:.36rem}

  .countdown-label{font-size:.49rem}
  .countdown-units{gap:5px}
  .countdown-unit{min-width:33px;padding-left:5px}
  .countdown-number{font-size:.84rem}
  .countdown-name{font-size:.45rem}

  .shop-grid{grid-template-columns:repeat(2,minmax(0,1fr)) !important}
}

@media (max-width:380px){
  .site-brand-logo{
    flex-basis:24px;
    width:24px;
    max-width:24px;
    height:25px;
  }
  .brand-swingali{font-size:.53rem}
  .brand-presents{font-size:.34rem}
  .shop-grid{grid-template-columns:1fr !important}
}

/* Very short landscape phones: reclaim vertical space from the shell without
   changing desktop/tablet presentation. */
@media (max-height:500px) and (orientation:landscape) and (max-width:950px){
  :root{--shell-height:60px}
  .site-shell{
    height:var(--shell-height);
    grid-template-columns:minmax(0,1fr) auto minmax(0,1fr);
    grid-template-rows:1fr;
    gap:6px;
    padding:4px 8px;
  }
  .site-brand-group{grid-column:1;grid-row:1}
  .site-location{grid-column:3;grid-row:1}
  .site-countdown{grid-column:2;grid-row:1;gap:5px}
  .site-brand-logo{height:30px;max-width:29px}
  .brand-swingali{font-size:.60rem}
  .brand-presents{font-size:.34rem}
  .countdown-label{display:none}
  .countdown-pumpkin-img{height:27px;max-width:30px}
  .countdown-units{gap:4px}
  .countdown-unit{min-width:31px;padding-left:4px}
  .countdown-number{font-size:.80rem}
  .countdown-name{font-size:.40rem}
  .site-location .location-label{display:none}
  .location-name{font-size:.62rem}
  .ambience-bar{bottom:5px;min-height:25px}
}
