:root {
  --bg-primary: #0a0a0f;
  --bg-secondary: #14141f;
  --bg-tertiary: #1e1e2e;
  --text-primary: #ffffff;
  --text-secondary: #a0a0b0;
  --text-muted: #606070;
  --accent: #00d4ff;
  --accent-secondary: #00ff88;
  --danger: #ff4466;
  --focus-ring: #00d4ff;
  --focus-glow: rgba(0, 212, 255, 0.4);
  --radius-md: 12px;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html, body {
  width: 600px;
  height: 600px;
  overflow: hidden;
  background: #000;
  color: var(--text-primary);
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

#app {
  width: 100%;
  height: 100%;
  position: relative;
}

.screen {
  width: 100%;
  height: 100%;
  position: absolute;
  top: 0;
  left: 0;
  display: flex;
  flex-direction: column;
}

.screen.hidden {
  display: none;
}

.focusable {
  transition: all 0.15s ease;
  border: 2px solid transparent;
  cursor: pointer;
  outline: none;
}

.focusable:focus {
  border-color: var(--focus-ring);
  box-shadow: 0 0 20px var(--focus-glow);
}

.hidden {
  display: none !important;
}

/* ===================== Home screen ===================== */

.header {
  padding: 22px 30px 6px;
  display: flex;
  align-items: baseline;
  gap: 12px;
}

.title {
  font-size: 30px;
  font-weight: 600;
  letter-spacing: -0.5px;
  color: var(--text-primary);
}

.badge {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 2.5px;
  color: var(--bg-primary);
  background: var(--accent);
  padding: 3px 8px;
  border-radius: 4px;
}

.content {
  flex: 1;
  display: flex;
  flex-direction: column;
  padding: 6px 30px 16px;
  gap: 14px;
}

.preview-wrap {
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 4px 0;
}

.preview-glow {
  width: 88px;
  height: 88px;
  border-radius: 50%;
  background: #ffffff;
  box-shadow:
    0 0 28px rgba(255, 255, 255, 0.45),
    0 0 56px rgba(255, 255, 255, 0.22);
  transition: background 0.2s ease, box-shadow 0.2s ease;
}

.brightness-section {
  background: var(--bg-secondary);
  padding: 14px 16px;
  border-radius: var(--radius-md);
}

.brightness-label-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 10px;
}

.label {
  font-size: 13px;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 2px;
  font-weight: 600;
}

.label-value {
  font-size: 22px;
  font-weight: 700;
  color: var(--accent);
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.5px;
}

.brightness-bar {
  display: flex;
  gap: 6px;
  height: 16px;
}

.bar-segment {
  flex: 1;
  background: var(--bg-tertiary);
  border-radius: 3px;
  transition: background 0.15s ease;
}

.bar-segment.filled {
  background: var(--accent);
}

.button-row {
  display: flex;
  gap: 14px;
}

.btn-icon {
  flex: 1;
  min-height: 88px;
  background: var(--bg-secondary);
  color: var(--text-primary);
  border-radius: var(--radius-md);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  font-family: inherit;
}

.btn-icon-symbol {
  font-size: 34px;
  line-height: 1;
  font-weight: 300;
  color: var(--accent);
}

.btn-icon-label {
  font-size: 12px;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 1.5px;
  font-weight: 600;
}

.btn-primary {
  min-height: 88px;
  background: var(--accent);
  color: var(--bg-primary);
  border-radius: var(--radius-md);
  font-size: 22px;
  font-weight: 700;
  font-family: inherit;
  letter-spacing: 0.5px;
}

.btn-primary.focusable:focus {
  background: var(--accent);
  border-color: var(--text-primary);
  box-shadow: 0 0 28px var(--focus-glow);
}

.hint {
  padding: 8px 30px 14px;
  color: var(--text-muted);
  font-size: 12px;
  text-align: center;
  letter-spacing: 1px;
}

/* ===================== Active screen ===================== */

#active {
  background: #000;
}

.flashlight-surface {
  position: absolute;
  inset: 0;
  background: #ffffff;
  transition: background 0.15s ease;
}

.brightness-overlay {
  position: absolute;
  top: 40px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(0, 0, 0, 0.78);
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 18px;
  padding: 16px 24px 14px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease;
}

.brightness-overlay.visible {
  opacity: 1;
}

.overlay-bar-wrap {
  display: flex;
  align-items: center;
  gap: 14px;
}

.overlay-bar {
  display: flex;
  gap: 4px;
}

.overlay-bar .bar-segment {
  width: 10px;
  height: 16px;
  border-radius: 2px;
  background: rgba(255, 255, 255, 0.25);
  flex: 0 0 auto;
}

.overlay-bar .bar-segment.filled {
  background: #ffffff;
}

.overlay-label {
  color: #ffffff;
  font-size: 20px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  min-width: 56px;
  text-align: right;
  letter-spacing: -0.5px;
}

.overlay-hint {
  color: rgba(255, 255, 255, 0.7);
  font-size: 10px;
  letter-spacing: 2px;
  text-transform: uppercase;
  font-weight: 600;
}
