/* Dehayuk Biliar 8 Bola 3D — Ultra-Clean Miniclip / Apple Arcade 3D HUD
 * Zero duplicate bars, zero overlapping boxes, 100% full-bleed 3D table across 320px Mobile -> Desktop.
 */

/* 1. Full-bleed 100vh 3D canvas — strip the bulky legacy bottom wood dock & duplicate controls */
main {
  display: block !important;
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100vh;
}

#viewP1.view3d {
  position: fixed !important;
  inset: 0 !important;
  width: 100vw !important;
  height: 100vh !important;
  cursor: grab;
}
#viewP1.view3d:active {
  cursor: grabbing;
}

/* Keep native panel transparent & pointer-events-none so ONLY the sleek floating spin orb & camera pill show */
#panel.panel {
  position: fixed !important;
  inset: 0 !important;
  width: 100vw !important;
  height: 100vh !important;
  background: transparent !important;
  border: 0 !important;
  box-shadow: none !important;
  pointer-events: none !important;
  z-index: 99960;
}

/* Hide redundant legacy controls (replaced by our unified Top HUD + Miniclip Pull-Back Cue Bar!) */
#powerSliderContainer,
#menuDropdown,
#cueHit,
#lobbyContainer,
#botDebugOverlay,
.about-more {
  position: fixed !important;
  opacity: 0 !important;
  pointer-events: none !important;
  width: 1px !important;
  height: 1px !important;
  overflow: hidden !important;
  clip: rect(0 0 0 0) !important;
}

/* 2. Sleek Compact Floating Spin Ball Orb (Bottom-Left) — removes ugly brown wood square! */
#panel .aimControlColumn {
  position: fixed !important;
  left: 14px !important;
  bottom: 14px !important;
  width: auto !important;
  height: auto !important;
  margin: 0 !important;
  padding: 0 !important;
  pointer-events: auto !important;
  z-index: 99968;
}

#ballContainerWrapper.ballContainerWrapper {
  width: 68px !important;
  height: 68px !important;
  min-width: 68px !important;
  min-height: 68px !important;
  max-width: 68px !important;
  max-height: 68px !important;
  box-sizing: border-box !important;
  padding: 5px !important;
  border-radius: 50% !important;
  background: rgba(11, 17, 26, 0.88) !important;
  background-image: none !important;
  border: 1.5px solid rgba(43, 228, 142, 0.45) !important;
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.55) !important;
  backdrop-filter: blur(12px);
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  position: relative !important;
  overflow: visible !important;
}

#ballContainer.ballContainer {
  width: 56px !important;
  height: 56px !important;
  min-width: 56px !important;
  min-height: 56px !important;
  border-radius: 50% !important;
  position: relative !important;
}

#cueBall.cueBall {
  width: 56px !important;
  height: 56px !important;
  min-width: 56px !important;
  min-height: 56px !important;
}

#cueTip.cueTip {
  width: 14px !important;
  height: 14px !important;
}

#openElevation.openElevation {
  position: absolute !important;
  top: -6px !important;
  right: -6px !important;
  width: 24px !important;
  height: 24px !important;
  border-radius: 50% !important;
  border: 1px solid rgba(43, 228, 142, 0.55) !important;
  background: #0e1724 !important;
  color: #24ee89 !important;
  font: 900 13px/1 Inter, system-ui, sans-serif !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  padding: 0 !important;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.5) !important;
  cursor: pointer !important;
  z-index: 5 !important;
}

#tiltSliderContainer.tiltSliderContainer {
  position: fixed !important;
  left: 92px !important;
  bottom: 14px !important;
  width: 112px !important;
  height: 112px !important;
  border-radius: 16px !important;
  background: rgba(12, 18, 28, 0.94) !important;
  background-image: none !important;
  border: 1px solid rgba(43, 228, 142, 0.35) !important;
  box-shadow: 0 14px 36px rgba(0, 0, 0, 0.6) !important;
}

/* 3. Sleek Floating Camera Toggle Button (Bottom-Right) */
#panel .outerMenu {
  position: fixed !important;
  right: 14px !important;
  bottom: 14px !important;
  width: auto !important;
  height: auto !important;
  margin: 0 !important;
  padding: 0 !important;
  background: transparent !important;
  pointer-events: auto !important;
  z-index: 99968;
}

#camera.menuButton {
  width: 52px !important;
  height: 52px !important;
  min-width: 52px !important;
  min-height: 52px !important;
  margin: 0 !important;
  padding: 0 !important;
  border-radius: 50% !important;
  border: 1.5px solid rgba(255, 255, 255, 0.2) !important;
  background: rgba(12, 19, 30, 0.88) !important;
  background-image: none !important;
  color: #f3f8ff !important;
  font-size: 20px !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  backdrop-filter: blur(12px);
  box-shadow: 0 10px 26px rgba(0, 0, 0, 0.52) !important;
  cursor: pointer !important;
  transition: border-color 0.15s ease, transform 0.14s ease;
}
#camera.menuButton:hover {
  border-color: #24ee89 !important;
  transform: translateY(-1px);
}

/* 4. Crisp Frosted Scoreboard Pill (Top-Center under HUD — readable on EVERY background!) */
.tray-score-container {
  position: fixed !important;
  top: 52px !important;
  left: 50% !important;
  transform: translateX(-50%) !important;
  width: auto !important;
  padding: 4px 14px !important;
  border-radius: 999px !important;
  background: rgba(9, 14, 22, 0.82) !important;
  border: 1px solid rgba(255, 255, 255, 0.14) !important;
  backdrop-filter: blur(10px);
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.4) !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  gap: 14px !important;
  pointer-events: none !important;
  z-index: 99962 !important;
}
.tray-score-container:empty {
  display: none !important;
}
.tray-score-container .p1Score,
.tray-score-container .p2Score {
  font-family: Inter, system-ui, sans-serif !important;
  font-size: 11.5px !important;
  font-weight: 800 !important;
  color: #e8f3ff !important;
  text-shadow: none !important;
  flex-direction: row !important;
  gap: 5px !important;
}
.tray-score-container .is-active {
  color: #24ee89 !important;
}

#ballTray {
  top: 86px !important;
  z-index: 99961 !important;
}

/* 5. Contextual Status / Action Pill (Center Top HUD on Desktop; Bottom-Center on Mobile — ZERO overlap!) */
.mc-status-pill {
  position: fixed;
  top: 10px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 99992;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 36px;
  max-width: min(360px, calc(100vw - 460px));
  padding: 0 13px;
  border-radius: 999px;
  background: rgba(14, 21, 32, 0.9);
  border: 1px solid rgba(43, 228, 142, 0.34);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  color: #e6f2ff;
  font: 700 12px/1 Inter, system-ui, -apple-system, sans-serif;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.38);
  pointer-events: auto;
  transition: opacity 0.18s ease, border-color 0.18s ease, background 0.18s ease;
}
.mc-status-pill[hidden] {
  display: none !important;
}
.mc-status-pill > span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.mc-status-pill.is-charging {
  border-color: #f7c91c;
  background: rgba(24, 20, 8, 0.94);
  color: #ffe88f;
}
.mc-status-pill.is-place {
  border-color: #24ee89;
  background: rgba(8, 28, 19, 0.94);
  max-width: min(400px, calc(100vw - 400px));
}
.mc-place-quick-btn {
  padding: 6px 12px;
  border: 0;
  border-radius: 999px;
  background: linear-gradient(135deg, #24ee89, #13a962);
  color: #04190e;
  font: 900 11px/1 Inter, system-ui, sans-serif;
  cursor: pointer;
  white-space: nowrap;
  flex-shrink: 0;
  box-shadow: 0 4px 12px rgba(36, 238, 137, 0.35);
}
.mc-place-quick-btn:hover {
  filter: brightness(1.08);
}

/* 6. Signature Left-Side Vertical Miniclip Pull-Back Cue Power Bar */
.mc-cue-dock {
  position: fixed;
  left: 14px;
  top: 50%;
  transform: translateY(-54%);
  z-index: 99966;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 5px;
  user-select: none;
  -webkit-user-select: none;
  touch-action: none;
  transition: opacity 0.2s ease;
}
.mc-cue-dock[hidden],
.mc-fine-dock[hidden] {
  display: none !important;
}
.mc-cue-dock.is-disabled {
  opacity: 0.32;
  pointer-events: none;
}
.mc-cue-pct {
  min-width: 44px;
  padding: 3px 6px;
  border-radius: 8px;
  background: rgba(10, 15, 23, 0.9);
  border: 1px solid rgba(43, 228, 142, 0.35);
  color: #24ee89;
  font: 900 11px/1 Inter, system-ui, sans-serif;
  text-align: center;
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.45);
}
.mc-cue-slot {
  position: relative;
  width: 44px;
  height: 224px;
  border-radius: 22px;
  background: linear-gradient(180deg, rgba(11, 17, 26, 0.88) 0%, rgba(16, 24, 36, 0.92) 100%);
  border: 1.5px solid rgba(255, 255, 255, 0.18);
  box-shadow: inset 0 4px 14px rgba(0, 0, 0, 0.72), 0 12px 28px rgba(0, 0, 0, 0.5);
  overflow: hidden;
  cursor: grab;
}
.mc-cue-slot:active,
.mc-cue-dock.is-pulling .mc-cue-slot {
  cursor: grabbing;
  border-color: #24ee89;
  box-shadow: inset 0 4px 14px rgba(0, 0, 0, 0.72), 0 0 20px rgba(36, 238, 137, 0.34);
}
.mc-cue-fill {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 0%;
  background: linear-gradient(180deg, rgba(36, 238, 137, 0.55) 0%, rgba(247, 201, 28, 0.65) 55%, rgba(255, 74, 92, 0.88) 100%);
  pointer-events: none;
}
.mc-cue-ticks {
  position: absolute;
  inset: 10px 6px;
  background: repeating-linear-gradient(
    to bottom,
    rgba(255, 255, 255, 0.22) 0px,
    rgba(255, 255, 255, 0.22) 1px,
    transparent 1px,
    transparent 18px
  );
  pointer-events: none;
}
.mc-cue-stick {
  position: absolute;
  left: 50%;
  top: 10px;
  width: 13px;
  height: 204px;
  transform: translateX(-50%) translateY(0px);
  border-radius: 6px 6px 8px 8px;
  background: linear-gradient(
    180deg,
    #2da8ff 0%,
    #2da8ff 4%,
    #f6f2e8 4%,
    #f6f2e8 9%,
    #ecc88c 9%,
    #c69351 48%,
    #e2e8f0 48%,
    #e2e8f0 51%,
    #141b25 51%,
    #24ee89 55%,
    #111720 59%,
    #0a0f16 95%,
    #f5c453 95%,
    #f5c453 100%
  );
  box-shadow: inset 3px 0 4px rgba(255, 255, 255, 0.32), inset -3px 0 4px rgba(0, 0, 0, 0.55), 0 4px 10px rgba(0, 0, 0, 0.6);
  pointer-events: none;
  transition: transform 0.04s linear;
}
.mc-cue-label {
  padding: 3px 6px;
  border-radius: 7px;
  background: rgba(10, 15, 23, 0.84);
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: #cde0f5;
  font: 800 9px/1.1 Inter, system-ui, sans-serif;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  text-align: center;
}

/* 7. Right-Side Miniclip Fine-Aim Precision Wheel */
.mc-fine-dock {
  position: fixed;
  right: 14px;
  top: 50%;
  transform: translateY(-54%);
  z-index: 99966;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 5px;
  user-select: none;
  -webkit-user-select: none;
  touch-action: none;
}
.mc-fine-wheel {
  position: relative;
  width: 30px;
  height: 156px;
  border-radius: 15px;
  background: linear-gradient(180deg, rgba(12, 18, 28, 0.86) 0%, rgba(20, 29, 44, 0.9) 50%, rgba(12, 18, 28, 0.86) 100%);
  border: 1.5px solid rgba(255, 255, 255, 0.16);
  box-shadow: inset 0 2px 10px rgba(0, 0, 0, 0.65), 0 10px 24px rgba(0, 0, 0, 0.45);
  overflow: hidden;
  cursor: ns-resize;
}
.mc-fine-wheel:active {
  border-color: #24ee89;
}
.mc-fine-grooves {
  position: absolute;
  inset: 8px 5px;
  background: repeating-linear-gradient(
    to bottom,
    rgba(255, 255, 255, 0.34) 0px,
    rgba(255, 255, 255, 0.34) 2px,
    transparent 2px,
    transparent 12px
  );
  background-position-y: 0px;
  pointer-events: none;
}

/* 8. Tablet & Narrow Desktop (<= 880px): Status pill moves cleanly to bottom-center between Spin Orb & Camera! */
@media (max-width: 880px) {
  .mc-status-pill,
  .mc-status-pill.is-place {
    top: auto;
    bottom: 18px;
    min-height: 36px;
    max-width: calc(100vw - 168px);
    padding: 0 12px;
    font-size: 11px;
    gap: 6px;
    z-index: 99967;
  }
}

/* 9. Mobile (<= 600px) & Compact 320px iPhone SE: Razor-sharp, zero overlap, full-bleed 3D! */
@media (max-width: 600px) {
  .tray-score-container {
    top: 46px !important;
    padding: 3px 11px !important;
    gap: 10px !important;
  }
  .tray-score-container .p1Score,
  .tray-score-container .p2Score {
    font-size: 10.5px !important;
  }

  #panel .aimControlColumn {
    left: 10px !important;
    bottom: 10px !important;
  }
  #ballContainerWrapper.ballContainerWrapper {
    width: 54px !important;
    height: 54px !important;
    min-width: 54px !important;
    min-height: 54px !important;
    max-width: 54px !important;
    max-height: 54px !important;
    padding: 4px !important;
  }
  #ballContainer.ballContainer,
  #cueBall.cueBall {
    width: 44px !important;
    height: 44px !important;
    min-width: 44px !important;
    min-height: 44px !important;
  }
  #cueTip.cueTip {
    width: 11px !important;
    height: 11px !important;
  }
  #openElevation.openElevation {
    width: 20px !important;
    height: 20px !important;
    font-size: 11px !important;
    top: -4px !important;
    right: -4px !important;
  }
  #tiltSliderContainer.tiltSliderContainer {
    left: 72px !important;
    bottom: 10px !important;
    width: 96px !important;
    height: 96px !important;
  }

  #panel .outerMenu {
    right: 10px !important;
    bottom: 10px !important;
  }
  #camera.menuButton {
    width: 46px !important;
    height: 46px !important;
    min-width: 46px !important;
    min-height: 46px !important;
    font-size: 18px !important;
  }

  .mc-status-pill,
  .mc-status-pill.is-place {
    bottom: 14px;
    min-height: 34px;
    max-width: calc(100vw - 134px);
    padding: 0 10px;
    font-size: 10.5px;
  }
  .mc-place-quick-btn {
    padding: 5px 9px;
    font-size: 10px;
  }

  .mc-cue-dock {
    left: 8px;
    top: 48%;
  }
  .mc-cue-slot {
    width: 34px;
    height: 164px;
    border-radius: 17px;
  }
  .mc-cue-stick {
    width: 10px;
    height: 148px;
  }
  .mc-cue-pct {
    min-width: 34px;
    font-size: 9.5px;
    padding: 2px 4px;
  }

  .mc-fine-dock {
    right: 8px;
    top: 48%;
  }
  .mc-fine-wheel {
    width: 24px;
    height: 120px;
    border-radius: 12px;
  }
  .mc-cue-label {
    font-size: 7.5px;
    padding: 2px 4px;
  }
}

@media (max-width: 360px) {
  .mc-cue-slot {
    width: 30px;
    height: 136px;
  }
  .mc-cue-stick {
    width: 9px;
    height: 122px;
  }
  .mc-fine-wheel {
    width: 22px;
    height: 104px;
  }
  .mc-status-pill,
  .mc-status-pill.is-place {
    max-width: calc(100vw - 122px);
    font-size: 9.5px;
    padding: 0 8px;
  }
}
