/* Reset and base */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

:root {
  --bg: #121212;
  --bg-flash: #1a2a1a;
  --box-hollow: #3a3a3a;
  --box-filled: #e0e0e0;
  --control-bg: #1e1e1e;
  --control-text: #888;
  --control-text-hover: #ccc;
  --focus-ring: #4a9eff;
}

html, body {
  height: 100%;
  width: 100%;
  overflow: hidden;
}

body {
  background-color: var(--bg);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  font-family: system-ui, -apple-system, sans-serif;
  transition: background-color 0.15s ease;
}

body.flash {
  background-color: var(--bg-flash);
}

/* Timer visual - concentric boxes */
.timer-visual {
  display: flex;
  align-items: center;
  justify-content: center;
}

.box {
  display: flex;
  align-items: center;
  justify-content: center;
  border: 2px solid var(--box-hollow);
  background-color: transparent;
  transition: background-color 0.3s ease, border-color 0.3s ease;
}

.box.filled {
  background-color: var(--box-filled);
  border-color: var(--box-filled);
}

/* Nested box sizes - small, centered */
.box-4 {
  width: 15vmin;
  height: 15vmin;
}

.box-3 {
  width: 11vmin;
  height: 11vmin;
}

.box-2 {
  width: 7vmin;
  height: 7vmin;
}

.box-1 {
  width: 3vmin;
  height: 3vmin;
}

/* Controls - hidden by default */
.controls {
  position: fixed;
  bottom: 2rem;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem 1rem;
  background-color: var(--control-bg);
  border-radius: 0.5rem;
  opacity: 0;
  transition: opacity 0.2s ease;
}

.controls.visible {
  opacity: 1;
}

/* Buttons */
.controls button {
  background: none;
  border: none;
  color: var(--control-text);
  cursor: pointer;
  padding: 0.5rem;
  border-radius: 0.25rem;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: color 0.15s ease;
}

.controls button:hover {
  color: var(--control-text-hover);
}

.controls button:focus-visible {
  outline: 2px solid var(--focus-ring);
  outline-offset: 2px;
}

.icon {
  width: 1.5rem;
  height: 1.5rem;
}

/* Play/Pause icon toggle */
#playPauseBtn .icon-pause {
  display: none;
}

#playPauseBtn.playing .icon-play {
  display: none;
}

#playPauseBtn.playing .icon-pause {
  display: block;
}

/* Mute icon toggle */
#muteBtn .icon-muted {
  display: none;
}

#muteBtn.muted .icon-unmuted {
  display: none;
}

#muteBtn.muted .icon-muted {
  display: block;
}

/* Inputs */
.controls input[type="number"] {
  width: 3.5rem;
  padding: 0.375rem 0.5rem;
  background-color: var(--bg);
  border: 1px solid var(--box-hollow);
  border-radius: 0.25rem;
  color: var(--control-text-hover);
  font-size: 0.875rem;
  text-align: center;
}

.controls input[type="number"]:focus-visible {
  outline: 2px solid var(--focus-ring);
  outline-offset: 1px;
}

.controls input[type="number"]:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.controls input[type="range"] {
  width: 4rem;
  height: 0.25rem;
  -webkit-appearance: none;
  appearance: none;
  background: var(--box-hollow);
  border-radius: 0.125rem;
  cursor: pointer;
}

.controls input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 0.75rem;
  height: 0.75rem;
  background: var(--control-text-hover);
  border-radius: 50%;
  cursor: pointer;
}

.controls input[type="range"]::-moz-range-thumb {
  width: 0.75rem;
  height: 0.75rem;
  background: var(--control-text-hover);
  border-radius: 50%;
  border: none;
  cursor: pointer;
}

.controls input[type="range"]:focus-visible {
  outline: 2px solid var(--focus-ring);
  outline-offset: 2px;
}
