/* ---------------------------------------------------------------------------
   360° VR Video Player — styles
   Keep the UI minimal: a full-bleed canvas with a start overlay and the
   WebXR "Enter VR" button. Everything else is the rendered scene.
--------------------------------------------------------------------------- */

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
  height: 100%;
  width: 100%;
  overflow: hidden;
  background: #000;
  color: #fff;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}

/* The Three.js renderer appends its <canvas> to <body>. */
canvas {
  display: block;
  position: fixed;
  inset: 0;
}

/* --- Start overlay ------------------------------------------------------- */
#overlay {
  position: fixed;
  inset: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: center;
  background: radial-gradient(circle at 50% 35%, #1a2233 0%, #05070d 70%);
  transition: opacity 0.4s ease;
}

#overlay.hidden {
  opacity: 0;
  pointer-events: none;
}

.overlay-card {
  text-align: center;
  padding: 2rem 2.5rem;
  max-width: 90vw;
}

.overlay-card h1 {
  margin: 0 0 0.5rem;
  font-size: clamp(1.5rem, 4vw, 2.4rem);
  font-weight: 600;
  letter-spacing: 0.5px;
}

.overlay-card p {
  margin: 0.5rem 0;
  color: #b9c2d0;
  line-height: 1.5;
}

.overlay-card .hint {
  margin-top: 1.5rem;
  font-size: 0.85rem;
  color: #7b879b;
}

#start-btn {
  margin-top: 1rem;
  padding: 0.85rem 2.4rem;
  font-size: 1.1rem;
  font-weight: 600;
  color: #05070d;
  background: #5ad1ff;
  border: none;
  border-radius: 999px;
  cursor: pointer;
  transition: transform 0.15s ease, background 0.15s ease;
}

#start-btn:hover {
  background: #84ddff;
  transform: translateY(-1px);
}

#start-btn:active {
  transform: translateY(0);
}

#start-btn:disabled {
  background: #3a4a5a;
  color: #8a97a8;
  cursor: default;
  transform: none;
}

/* --- WebXR "Enter VR" button -------------------------------------------- */
/* The button is generated by three's VRButton helper; we position the
   container so it sits centered near the bottom of the screen. */
#vr-button-container {
  position: fixed;
  bottom: 24px;
  left: 0;
  right: 0;
  z-index: 30;
  display: flex;
  justify-content: center;
  pointer-events: none; /* the button itself re-enables pointer events */
}

#vr-button-container > * {
  pointer-events: auto;
}

/* --- Toast notifications ------------------------------------------------- */
#toast {
  position: fixed;
  bottom: 90px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 40;
  max-width: 90vw;
  padding: 0.7rem 1.2rem;
  background: rgba(20, 24, 33, 0.95);
  border: 1px solid #2c3a4d;
  border-radius: 10px;
  font-size: 0.9rem;
  color: #e6ecf5;
  text-align: center;
  transition: opacity 0.3s ease;
}

#toast.hidden {
  opacity: 0;
  pointer-events: none;
}

/* --- Diagnostics overlay (?debug=1 only) -------------------------------- */
#debug-panel {
  position: fixed;
  top: 12px;
  left: 12px;
  z-index: 50;
  width: min(360px, 80vw);
  max-height: 80vh;
  overflow: hidden;
  padding: 10px 12px;
  background: rgba(8, 11, 18, 0.88);
  border: 1px solid #2c3a4d;
  border-radius: 10px;
  font-family: ui-monospace, "Cascadia Code", Consolas, monospace;
  font-size: 12px;
  line-height: 1.5;
  color: #cdd6e3;
  pointer-events: none; /* never block interaction with the scene */
}

#debug-panel .dbg-title {
  font-weight: 700;
  color: #5ad1ff;
  letter-spacing: 0.5px;
  margin-bottom: 6px;
}

#debug-panel .dbg-hint {
  font-weight: 400;
  color: #6b7890;
}

#debug-panel #dbg-state > div {
  display: flex;
  justify-content: space-between;
  gap: 10px;
}

#debug-panel .dbg-k {
  color: #7b879b;
}

#debug-panel .dbg-v {
  color: #e6ecf5;
  text-align: right;
  word-break: break-all;
}

#debug-panel .dbg-log-title {
  margin: 8px 0 4px;
  color: #7b879b;
  text-transform: uppercase;
  font-size: 10px;
  letter-spacing: 1px;
}

#debug-panel #dbg-log {
  max-height: 40vh;
  overflow-y: auto;
}

#debug-panel .dbg-ok {
  color: #67e0a3;
}
#debug-panel .dbg-warn {
  color: #f4c66a;
}
#debug-panel .dbg-err {
  color: #ff7a7a;
}
#debug-panel .dbg-info {
  color: #9fb0c7;
}
