:root {
  color-scheme: dark;
  --ui-bg: rgba(20, 18, 16, 0.55);
  --ui-fg: rgba(255, 255, 255, 0.92);
  --ui-dim: rgba(255, 255, 255, 0.35);
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  height: 100%;
  overflow: hidden;
  background: #000;
  font-family: "DM Sans", system-ui, sans-serif;
}

body.idle { cursor: none; }

#stage {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
}

#empty {
  position: fixed;
  inset: 0;
  margin: 0;
  display: grid;
  place-items: center;
  color: rgba(255, 255, 255, 0.5);
  font-size: 16px;
}
#empty[hidden] { display: none; }

/* Hover target over the timer, and the controls that appear beside it.
   --cx, --cy, --r are the timer's center and radius in CSS pixels. */
#hit {
  position: fixed;
  left: calc(var(--cx) - var(--r) - 12px);
  top: calc(var(--cy) - var(--r) - 12px);
  width: calc(var(--r) * 2 + 24px);
  height: calc(var(--r) * 2 + 24px);
  border-radius: 50%;
  border: 0;
  padding: 0;
  background: transparent;
  cursor: pointer;
}
#hit:focus-visible { outline: 2px solid var(--ui-dim); outline-offset: -6px; }

#controls {
  position: fixed;
  right: calc(100vw - var(--cx) + var(--r) + 16px);
  top: var(--cy);
  transform: translate(8px, -50%);
  display: flex;
  align-items: center;
  gap: 2px;
  padding: 4px;
  border-radius: 999px;
  background: var(--ui-bg);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease, transform 0.25s ease;
}
#hud.open #controls {
  opacity: 1;
  pointer-events: auto;
  transform: translate(0, -50%);
}

#controls button {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border: 0;
  padding: 0;
  border-radius: 50%;
  background: transparent;
  color: var(--ui-fg);
  cursor: pointer;
}
#controls button:hover { background: rgba(255, 255, 255, 0.12); }
#controls button:focus-visible { outline: 2px solid var(--ui-dim); outline-offset: -2px; }

#controls svg {
  width: 20px;
  height: 20px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}
#controls svg .fill { fill: currentColor; stroke: none; }

.volume {
  display: flex;
  align-items: center;
  padding: 0 6px 0 2px;
  margin: 0 2px;
  border-left: 1px solid rgba(255, 255, 255, 0.14);
  border-right: 1px solid rgba(255, 255, 255, 0.14);
}
.volume[hidden] { display: none; }
/* Volume: four bars of rising height, filled up to the current level. */
#controls .volume .bar {
  display: flex;
  align-items: flex-end;
  justify-content: center;
  width: 12px;
  height: 36px;
  padding-bottom: 9px;
  border-radius: 3px;
}
#controls .volume .bar:hover { background: transparent; }
.bar span {
  width: 5px;
  border-radius: 1.5px;
  background: var(--ui-dim);
  transition: background 0.15s;
}
.bar[data-level="0.25"] span { height: 7px; }
.bar[data-level="0.5"] span { height: 11px; }
.bar[data-level="0.75"] span { height: 15px; }
.bar[data-level="1"] span { height: 19px; }
.bar.on span { background: var(--ui-fg); }
.bar:hover span { background: rgba(255, 255, 255, 0.7); }
.bar.on:hover span { background: #fff; }
[data-playing="true"] .icon-play,
[data-playing="false"] .icon-pause,
[data-muted="true"] .icon-sound,
[data-muted="false"] .icon-muted,
[data-fullscreen="true"] .icon-enter,
[data-fullscreen="false"] .icon-exit { display: none; }

@media (prefers-reduced-motion: reduce) {
  #controls { transition: none; }
}
