/* scrollBeat web shell. Layering: YouTube iframe (z -100) beneath the
   transparent ebiten canvas (in-flow), page chrome above (z 1000+).
   The 100vw x 140vh / -20vh offset pushes the embed's letterbox bars
   off-screen for a full-bleed background video (rhythm-plus trick). */

* { box-sizing: border-box; }

/* The game's font (Jersey 10, OFL — synced from internal/assets/fonts
   by build.ps1) so the loading wordmark matches the in-game logo. */
@font-face {
  font-family: "Jersey 10";
  src: url("jersey10.ttf") format("truetype");
  font-display: swap;
}

html, body {
  margin: 0;
  padding: 0;
  height: 100%;
  overflow: hidden;
  background: #05060a;
  color: #fff;
  font-family: "Segoe UI", system-ui, sans-serif;
  -webkit-tap-highlight-color: transparent;
  user-select: none;
}

canvas { display: block; }

#yt-wrap {
  position: fixed;
  inset: 0;
  z-index: -100;
  overflow: hidden;
  pointer-events: none;
}

#yt-player {
  position: fixed;
  width: 100vw;
  height: 140vh;
  left: 0;
  top: -20vh;
  border: 0;
  pointer-events: none;
}

@media (max-aspect-ratio: 1/1) {
  /* Portrait: size by height and recenter (object-fit: cover for iframes). */
  #yt-player {
    width: 249vh;
    transform: translateX(calc(50vw - 124.5vh));
  }
}

/* Editor panel mode: the player sits above the opaque canvas so the
   video stays visible while its audio plays (inline sizes from app.js). */
#yt-wrap.panel {
  z-index: 50;
}

#yt-wrap.panel #yt-player {
  height: auto;
  box-shadow: 0 4px 30px rgba(0, 0, 0, 0.7);
  outline: 1px solid rgba(0, 176, 250, 0.4);
}

#yt-notice {
  position: fixed;
  bottom: 8px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 1000;
  font-size: 11px;
  opacity: 0.35;
  pointer-events: none;
  text-align: center;
  width: 90%;
}

/* Muted-autoplay notice: informational only, never blocks input. */
#unmute {
  position: fixed;
  bottom: 46px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 1500;
  font-size: 12px;
  letter-spacing: 2px;
  padding: 7px 18px;
  border-radius: 999px;
  border: 1px solid rgba(0, 176, 250, 0.5);
  background: rgba(5, 6, 10, 0.75);
  pointer-events: none;
  animation: pulse 2s ease-in-out infinite;
}

#buffering {
  position: fixed;
  top: 16px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 1500;
  font-size: 13px;
  letter-spacing: 2px;
  padding: 6px 16px;
  background: rgba(0, 0, 0, 0.6);
  border: 1px solid rgba(0, 176, 250, 0.5);
  animation: pulse 1.2s ease-in-out infinite;
}

#toast {
  position: fixed;
  top: 24px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 3000;
  max-width: 80vw;
  padding: 14px 24px;
  font-size: 14px;
  background: rgba(0, 118, 168, 0.9);
  box-shadow: 0 6px 30px rgba(0, 0, 0, 0.6);
  pointer-events: none;
}

#toast.error { background: rgba(160, 20, 40, 0.92); }

#bridge-pill {
  position: fixed;
  bottom: 10px;
  right: 12px;
  z-index: 1000;
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: 11px;
  letter-spacing: 1px;
  padding: 5px 12px;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.55);
  border: 1px solid rgba(255, 255, 255, 0.15);
  opacity: 0.75;
  cursor: pointer;
}

#bridge-pill:hover {
  opacity: 1;
  border-color: rgba(0, 176, 250, 0.6);
}

#bridge-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #666;
}

#bridge-pill.on #bridge-dot {
  background: #00b0fa;
  box-shadow: 0 0 8px #00b0fa;
}

#bridge-pill.off #bridge-dot { background: #a0303a; }

#loading {
  position: fixed;
  inset: 0;
  z-index: 5000;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  background: #05060a;
}

/* Two-tone wordmark in the game font, matching the title screen:
   "scroll" center-color cyan, "Beat" corner-color magenta. */
#loading .logo {
  font-family: "Jersey 10", "Segoe UI", system-ui, sans-serif;
  font-size: 72px;
  font-weight: 400;
  letter-spacing: 1px;
  color: #00b0fa;
}

#loading .logo span {
  color: #b400c1;
}

#loading .sub {
  font-size: 13px;
  letter-spacing: 3px;
  opacity: 0.5;
  animation: pulse 2s linear infinite;
}

@keyframes pulse {
  50% { opacity: 0.35; }
}
