/* ==========================================================================
   game-ui.css — Base layout for game container and UI overlay layer
   ========================================================================== */

/* Game container fills the viewport and anchors all layers */
.game-container {
  position: relative;
  width: 100vw;
  height: 100vh;
  overflow: hidden;
  background: var(--bg);
}

/* UI layer sits over the canvas; invisible to pointer events by default
   so clicks pass through to the 3D scene. Direct children re-enable
   pointer events so HUD elements remain interactive. */
#ui-layer {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 1;
}

#ui-layer > * {
  pointer-events: auto;
}

/* Canvas element — position explicitly so it sits below #ui-layer */
#game-container canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: var(--z-canvas);
  outline: none;
}

/* Utility: prevent text selection on UI elements during gameplay */
.game-container,
#ui-layer {
  -webkit-user-select: none;
  user-select: none;
}

/* Scrollbar styling for UI panels */
#ui-layer ::-webkit-scrollbar {
  width: 6px;
}

#ui-layer ::-webkit-scrollbar-track {
  background: transparent;
}

#ui-layer ::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.12);
  border-radius: var(--radius-pill);
}

#ui-layer ::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 255, 255, 0.2);
}

/* Ensure dropdown options are readable on dark backgrounds */
#ui-layer select option {
  background: var(--dark, #1c1917);
  color: var(--light, #f5f5f4);
}

.mobile-placement-controls {
    display: none;
}

@media (max-width: 767px) {
    .mobile-placement-controls {
        display: flex;
        position: fixed;
        bottom: calc(var(--toolbar-height) + 16px + var(--safe-bottom));
        left: 50%;
        transform: translateX(-50%);
        gap: 20px;
        z-index: 450;
    }

    .mobile-placement-btn {
        width: 56px;
        height: 56px;
        border-radius: 50%;
        border: 2px solid rgba(255, 255, 255, 0.2);
        display: flex;
        align-items: center;
        justify-content: center;
        font-size: 24px;
        cursor: pointer;
        box-shadow: 0 4px 16px rgba(0, 0, 0, 0.4);
        transition: transform 0.1s ease;
        -webkit-tap-highlight-color: transparent;
    }

    .mobile-placement-btn:active {
        transform: scale(0.92);
    }

    .mobile-placement-btn.confirm {
        background: linear-gradient(135deg, #22c55e, #16a34a);
        color: white;
    }

    .mobile-placement-btn.cancel {
        background: linear-gradient(135deg, #ef4444, #dc2626);
        color: white;
    }
}
