/* style.css - styles for the Bingo 3D app */
body {
  margin: 0;
  padding: 0;
  font-family: Arial, sans-serif;
  /* Background image for the game. Place the provided image at: /images/bg.jpg */
  background-color: #000; /* fallback color while image loads */
  background-image: url('../images/bg.jpg');
  background-size: cover;
  background-position: center center;
  background-repeat: no-repeat;
  display: flex;
  flex-direction: column;
  height: 100vh;
}

/* Ensure html/body are full-height and disable page scroll to avoid the page moving under the canvas on mobile */
html,
body {
  height: 100%;
  margin: 0;
  padding: 0;
  overflow: hidden;
}

/* App container where Three.js renderer is mounted */
#app {
  width: 100vw;
  height: 100vh;
  position: relative;
  overflow: hidden;
}

/* Ensure canvas fills the #app area and removes inline gaps */
#app canvas {
  display: block;
  width: 100%;
  height: 100%;
}

/* Floor lights: round indicators that sit above the renderer at the bottom center
   They remain subtle when inactive and cycle colors while the tombola is spinning */
#floor-lights {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  bottom: 18px;
  display: flex;
  gap: 12px;
  z-index: 60; /* above canvas but below UI elements if any */
  pointer-events: none; /* do not block mouse events */
}
.floor-light {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  /* Invisible by default */
  background: transparent;
  box-shadow: none;
  opacity: 0;
  transition:
    background-color 0.35s ease,
    box-shadow 0.35s ease,
    transform 0.25s ease,
    opacity 0.25s ease;
  transform: translateY(0);
}

/* Active state: start a smooth cycling color animation and slightly lift the lights */
#floor-lights.active .floor-light {
  transform: translateY(-6px);
  animation: colorCycle 2.4s linear infinite;
  /* when active, make visible */
  opacity: 1;
  background: rgba(255, 255, 255, 0.06);
  box-shadow: 0 0 12px rgba(255, 255, 255, 0.04);
}

/* Stagger the animation so lights are not in perfect sync */
#floor-lights.active .floor-light:nth-child(1) {
  animation-delay: 0s;
}
#floor-lights.active .floor-light:nth-child(2) {
  animation-delay: 0.12s;
}
#floor-lights.active .floor-light:nth-child(3) {
  animation-delay: 0.24s;
}
#floor-lights.active .floor-light:nth-child(4) {
  animation-delay: 0.36s;
}
#floor-lights.active .floor-light:nth-child(5) {
  animation-delay: 0.48s;
}
#floor-lights.active .floor-light:nth-child(6) {
  animation-delay: 0.6s;
}

@keyframes colorCycle {
  0% {
    background: #ff4d4d;
    box-shadow: 0 0 18px #ff4d4d;
  }
  20% {
    background: #ffb84d;
    box-shadow: 0 0 18px #ffb84d;
  }
  40% {
    background: #6bff8a;
    box-shadow: 0 0 18px #6bff8a;
  }
  60% {
    background: #4dd7ff;
    box-shadow: 0 0 18px #4dd7ff;
  }
  80% {
    background: #b54dff;
    box-shadow: 0 0 18px #b54dff;
  }
  100% {
    background: #ff4d4d;
    box-shadow: 0 0 18px #ff4d4d;
  }
}

#controls {
  display: flex;
  justify-content: space-between;
  padding: 10px;
  background-color: #ddd;
}

#top {
  display: flex;
  height: 50vh;
}

#tombola-container,
#winball-container {
  flex: 1;
  height: 100%;
}

#board-container {
  height: 50vh;
  width: 100%;
}

/* Rotate overlay styles */
#rotate-overlay {
  position: fixed;
  inset: 0; /* top:0; right:0; bottom:0; left:0; */
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.45);
  z-index: 99999;
  pointer-events: auto;
  transition:
    opacity 220ms ease,
    transform 220ms ease,
    visibility 220ms;
}
#rotate-overlay.rotate-hidden {
  opacity: 0;
  visibility: hidden;
  transform: scale(0.99);
  pointer-events: none;
}
#rotate-overlay .rotate-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  padding: 18px 22px;
  border-radius: 12px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.06), rgba(255, 255, 255, 0.02));
  box-shadow:
    0 12px 36px rgba(0, 0, 0, 0.55),
    inset 0 1px 0 rgba(255, 255, 255, 0.02);
}
#rotate-overlay .rotate-icon {
  filter: drop-shadow(0 6px 18px rgba(0, 0, 0, 0.6));
}
#rotate-overlay .rotate-text {
  color: #fff;
  font-weight: 700;
  font-family: 'Segoe UI', Roboto, Arial, sans-serif;
  font-size: 18px;
  text-align: center;
  letter-spacing: 0.6px;
  text-shadow: 0 2px 6px rgba(0, 0, 0, 0.6);
}

/* Visibility is controlled by JavaScript so the overlay can appear on tablets
   that are touch-capable even if their CSS width is larger than a desktop breakpoint. */

@media (max-width: 420px) {
  #rotate-overlay .rotate-inner {
    padding: 16px;
  }
  #rotate-overlay .rotate-icon {
    width: 84px;
    height: 84px;
  }
  #rotate-overlay .rotate-text {
    font-size: 16px;
  }
}

/* Fullscreen button */
#fullscreen-btn {
  position: fixed;
  bottom: 12px;
  right: 12px;
  z-index: 2000;
  background: rgba(0, 0, 0, 0.6);
  color: #fff;
  padding: 8px 12px;
  border-radius: 8px;
  border: none;
  font-family: 'Segoe UI', Roboto, Arial, sans-serif;
  font-size: 16px;
  cursor: pointer;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.6);
}
@media (max-width: 420px) {
  #fullscreen-btn {
    bottom: 8px;
    right: 8px;
    font-size: 14px;
    padding: 6px 10px;
  }
}

/* Reset confirmation overlay */
#reset-confirm-overlay {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.7);
  z-index: 2147483647;
  pointer-events: auto;
}
#reset-confirm-overlay.reset-hidden {
  display: none;
}
.reset-inner {
  background: rgba(255, 255, 255, 0.95);
  padding: 20px;
  border-radius: 10px;
  text-align: center;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
  max-width: 300px;
  width: 90%;
}
.reset-inner p {
  margin: 0 0 15px 0;
  font-size: 18px;
  color: #333;
}
.reset-buttons {
  display: flex;
  gap: 10px;
  justify-content: center;
}
.reset-buttons button {
  padding: 10px 20px;
  border: none;
  border-radius: 5px;
  font-size: 16px;
  cursor: pointer;
}
#reset-yes {
  background: #d62828;
  color: white;
}
#reset-no {
  background: #666;
  color: white;
}

/* WebGL badge */
#webgl-badge {
  display: none;
  position: fixed;
  right: 12px;
  bottom: 12px;
  z-index: 2147483646;
  background: rgba(0, 0, 0, 0.6);
  color: #fff;
  padding: 8px 10px;
  border-radius: 8px;
  font-family: 'Segoe UI', Roboto, Arial, sans-serif;
  font-size: 12px;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.6);
  pointer-events: auto; /* allow tapping to open GL dump */
  cursor: pointer;
  max-width: 280px;
  white-space: nowrap;
  text-overflow: ellipsis;
  overflow: hidden;
}
@media (max-width: 420px) {
  #webgl-badge {
    right: 8px;
    bottom: 8px;
    font-size: 11px;
    padding: 6px 8px;
  }
}

/* GL dump overlay shown when user taps the webgl badge */
#gl-dump-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.85);
  color: #fff;
  z-index: 2147483647;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 18px;
  font-family: 'Segoe UI', Roboto, Arial, sans-serif;
}
#gl-dump-overlay .gl-dump-inner {
  max-width: 880px;
  width: calc(100% - 48px);
  max-height: 80vh;
  overflow: auto;
  background: rgba(18, 18, 18, 0.96);
  border-radius: 10px;
  padding: 16px;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.6);
}
#gl-dump-overlay pre {
  white-space: pre-wrap;
  word-break: break-word;
  font-size: 13px;
  line-height: 1.35;
  margin: 8px 0 12px 0;
}
.gl-dump-controls {
  display: flex;
  gap: 8px;
  justify-content: flex-end;
  align-items: center;
}
.gl-copy-btn,
.gl-close-btn {
  background: linear-gradient(180deg, #1f2937, #111827);
  color: #fff;
  padding: 8px 10px;
  border-radius: 6px;
  border: 1px solid rgba(255, 255, 255, 0.06);
  font-size: 13px;
  cursor: pointer;
}
.gl-copy-btn:active,
.gl-close-btn:active {
  transform: translateY(1px);
}
.gl-dump-note {
  font-size: 12px;
  opacity: 0.9;
}
