/* Layout and containers */
#main-canvas {
  display: block;
  width: 100%;
  height: 100%;
  position: absolute;
  top: 0;
  left: 0;
  z-index: 0;
}

#ui-layer {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 10;
  pointer-events: none; /* Let clicks pass through to canvas where UI isn't present */
}

.screen {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  display: none;
  pointer-events: auto;
  transition: opacity 0.5s ease;
}

.screen.active-flex {
  display: flex;
}
.screen.active-block {
  display: block;
}

/* Start Screen Layout */
#start-screen {
  background: radial-gradient(circle at center, #1f2937 0%, #0d1117 80%);
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 2rem;
  z-index: 20;
}

/* HUD Layout */
#game-hud {
  pointer-events: none; /* Container passes clicks */
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.hud-bar {
  pointer-events: auto;
  padding: 1rem 2rem;
  display: flex;
  align-items: center;
  width: 100%;
  box-sizing: border-box;
}

.top-bar {
  justify-content: center;
  background: linear-gradient(180deg, rgba(0,0,0,0.8) 0%, rgba(0,0,0,0) 100%);
  padding-top: 1.5rem;
}

.bottom-bar {
  justify-content: space-between;
  padding-bottom: 1.5rem;
  background: linear-gradient(0deg, rgba(0,0,0,0.8) 0%, rgba(0,0,0,0) 100%);
}

/* Modal Layout */
.modal {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0,0,0,0.6);
  backdrop-filter: blur(4px);
  display: flex;
  justify-content: center;
  align-items: center;
  pointer-events: auto;
  z-index: 50;
}
.modal.hidden {
  display: none;
}