:root {
  --face: #0B0B0D;
  --on: #FFB000;
  --off: #3A2E12;
  --bg: #050506;
  --menu-bg: #15151a;
  --menu-fg: #f2f2f4;
  --menu-line: #2a2a31;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  height: 100%;
  background: var(--bg);
  color: var(--menu-fg);
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  -webkit-tap-highlight-color: transparent;
  overscroll-behavior: none;
}

.stage {
  height: 100%;
  min-height: 100dvh;
  display: grid;
  place-items: center;
  padding: max(16px, env(safe-area-inset-top)) 16px max(16px, env(safe-area-inset-bottom));
}

#dial {
  width: min(86vw, 86vh, 520px);
  height: auto;
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
  cursor: pointer;
  outline: none;
  display: block;
}
#dial:focus-visible .bezel { stroke: var(--on); }

/* SVG-prikker og elementer */
.dot-off { fill: var(--off); }
.dot-on  { fill: var(--on); }
.face    { fill: var(--face); }
.digit-off { fill: var(--off); opacity: .35; }
.digit-on  { fill: var(--on); }

.ui-icon {
  fill: none;
  stroke: var(--on);
  stroke-width: 6;
  stroke-linecap: round;
  stroke-linejoin: round;
  opacity: .78;
  cursor: pointer;
  transition: opacity .15s ease;
}
.ui-icon:hover, .ui-icon:active { opacity: 1; }
.ui-icon.muted { opacity: .3; }
.ui-hit { fill: transparent; cursor: pointer; }

#reset-group { cursor: pointer; }
#reset-group.hidden { display: none; }
#reset-group .ui-icon { stroke-width: 5; opacity: .6; }
#reset-group:hover .ui-icon { opacity: .95; }

/* Meny */
.backdrop {
  position: fixed; inset: 0;
  background: rgba(0,0,0,.55);
  backdrop-filter: blur(2px);
  z-index: 10;
}
.menu {
  position: fixed;
  left: 50%; bottom: 0;
  transform: translateX(-50%);
  width: min(440px, 100%);
  z-index: 11;
  padding: 0 12px calc(12px + env(safe-area-inset-bottom));
}
.menu-panel {
  background: var(--menu-bg);
  border: 1px solid var(--menu-line);
  border-radius: 20px;
  overflow: hidden;
  box-shadow: 0 20px 60px rgba(0,0,0,.5);
  animation: rise .22s ease;
}
@keyframes rise { from { transform: translateY(12px); opacity: 0; } to { transform: none; opacity: 1; } }

.menu-head {
  display: flex; align-items: center; justify-content: space-between;
  gap: 8px; padding: 14px 16px;
  border-bottom: 1px solid var(--menu-line);
}
.menu-head h1 { font-size: 16px; margin: 0; font-weight: 600; flex: 1; text-align: center; }

.icon-btn {
  appearance: none; border: 0; background: transparent;
  color: var(--menu-fg); font-size: 20px; line-height: 1;
  width: 36px; height: 36px; border-radius: 10px; cursor: pointer;
}
.icon-btn:hover { background: rgba(255,255,255,.08); }

.menu-row {
  appearance: none; border: 0; width: 100%;
  display: flex; align-items: center; justify-content: space-between;
  gap: 12px; padding: 16px; background: transparent;
  color: var(--menu-fg); font-size: 16px; cursor: pointer;
  border-bottom: 1px solid var(--menu-line);
}
.menu-row:last-child { border-bottom: 0; }
.menu-row:hover { background: rgba(255,255,255,.05); }
.menu-value { color: var(--on); font-size: 14px; }

.theme-list { padding: 8px; }
.theme-item {
  appearance: none; border: 1px solid transparent; width: 100%;
  display: flex; align-items: center; gap: 14px;
  padding: 12px 14px; background: transparent; color: var(--menu-fg);
  font-size: 16px; cursor: pointer; border-radius: 12px; text-align: left;
}
.theme-item:hover { background: rgba(255,255,255,.05); }
.theme-item[aria-current="true"] { border-color: var(--menu-line); background: rgba(255,255,255,.04); }
.theme-swatch {
  width: 40px; height: 40px; border-radius: 50%;
  display: grid; grid-template-columns: 1fr 1fr; gap: 3px;
  padding: 7px; flex: 0 0 auto;
}
.theme-swatch i { border-radius: 50%; display: block; }
.theme-name { flex: 1; }
.theme-check { color: var(--on); font-size: 18px; visibility: hidden; }
.theme-item[aria-current="true"] .theme-check { visibility: visible; }

@media (prefers-reduced-motion: reduce) {
  .menu-panel { animation: none; }
}
