* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  user-select: none;
  -webkit-user-select: none;
  -webkit-tap-highlight-color: transparent;
}

html, body {
  width: 100vw;
  height: 100vh;
  height: 100dvh;
  background-color: var(--bg-oled);
  color: var(--text-main);
  font-family: var(--font-sans);
  overflow: hidden;
  position: relative;
  touch-action: manipulation;
}

/* Software Brightness Multiplier Layer */
#dim-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100dvh;
  background-color: #000000;
  opacity: calc(1 - var(--screen-brightness));
  pointer-events: none;
  z-index: 900;
  transition: opacity 0.2s ease;
}

.hud-layer {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 10;
  pointer-events: none;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: calc(14px + env(safe-area-inset-top, 0px)) 18px calc(14px + env(safe-area-inset-bottom, 0px));
  transition: opacity 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}

.hud-layer.idle-dim {
  opacity: 0.12;
}

.hud-interactive {
  pointer-events: auto;
}