:root {
  color-scheme: light; 
  font-family: "Trebuchet MS", "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: #eef3f5;
  color: #1b2a33;
  height: 100%;
  overflow: hidden;
  overscroll-behavior: none;
}

html {
  height: 100%;
  overflow: hidden;
  overscroll-behavior: none;
}

.scene {
  position: relative;
  min-height: 100vh;
  overflow: hidden;
  touch-action: none;
}

.time-wheel {
  --wheel-angle: 0deg;
  position: absolute;
  top: 0.35rem;
  left: 50%;
  width: min(72vw, 560px);
  height: calc(min(72vw, 560px) / 2);
  transform: translateX(-50%);
  overflow: hidden;
  touch-action: none;
  z-index: 4;
  pointer-events: none;
  user-select: none;
}

.time-wheel__grip {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  overflow: visible;
  pointer-events: none;
}

.time-wheel__grip path {
  fill: none;
  stroke: rgba(255, 255, 255, 0.001);
  stroke-width: 44;
  stroke-linecap: round;
  vector-effect: non-scaling-stroke;
  pointer-events: stroke;
  cursor: grab;
}

.time-wheel__grip path:active {
  cursor: grabbing;
}

.time-wheel__arc {
  position: absolute;
  inset: 0;
  border: 2px solid rgba(255, 255, 255, 0.7);
  border-bottom: none;
  border-radius: 1000px 1000px 0 0;
  box-shadow: 0 0 0 1px rgba(50, 80, 120, 0.12), 0 10px 20px rgba(20, 30, 50, 0.08);
  background: linear-gradient(to bottom, rgba(255, 255, 255, 0.2), rgba(210, 235, 255, 0.04));
  pointer-events: none;
}

.time-wheel__dial {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  aspect-ratio: 1 / 1;
  transform: rotate(var(--wheel-angle));
  transform-origin: center;
  transition: transform 0.1s linear;
  pointer-events: none;
}

.time-wheel__icon {
  position: absolute;
  top: 50%;
  transform: translate(-50%, -50%);
  width: clamp(20px, 2.6vw, 30px);
  height: clamp(20px, 2.6vw, 30px);
  object-fit: contain;
  filter: drop-shadow(0 1px 3px rgba(20, 30, 40, 0.35));
  user-select: none;
  pointer-events: none;
}

.time-wheel__icon--sun {
  left: 6%;
  color: #ffd462;
}

.time-wheel__icon--moon {
  left: 94%;
  color: #d7dff7;
}

canvas {
  display: block;
  width: 100%;
  height: 100vh;
  touch-action: none;
}

.hud {
  position: absolute;
  inset: 1.5rem 1.5rem auto 1.5rem;
  z-index: 6;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  max-width: 420px;
  padding: 1rem 1.25rem;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.65);
  backdrop-filter: blur(10px);
  box-shadow: 0 12px 30px rgba(30, 50, 60, 0.12);
  transition: transform 0.3s ease, opacity 0.3s ease;
  transform: translateY(calc(-100% - 1rem));
  opacity: 0;
  pointer-events: none;
}

.menu-toggle {
  position: absolute;
  top: 1.5rem;
  left: 1.5rem;
  z-index: 7;
  border: 1px solid rgba(30, 50, 60, 0.3);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.85);
  padding: 0.4rem 0.65rem;
  font-size: 1.1rem;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.menu-toggle:focus-visible {
  outline: 2px solid rgba(30, 50, 60, 0.6);
  outline-offset: 2px;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.hud__row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.hud__row--meta {
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: rgba(30, 50, 60, 0.7);
}

h1 {
  font-size: 1.6rem;
  margin: 0;
}

.subtitle {
  margin: 0.2rem 0 0;
  color: rgba(30, 50, 60, 0.7);
}

.hint {
  margin: 0;
  font-size: 0.95rem;
  line-height: 1.4;
  color: rgba(30, 50, 60, 0.8);
}

.ghost {
  border: 1px solid rgba(30, 50, 60, 0.3);
  background: rgba(255, 255, 255, 0.7);
  border-radius: 999px;
  padding: 0.45rem 0.9rem;
  cursor: pointer;
  font-size: 0.85rem;
  transition: background 0.3s ease;
}

.ghost:hover {
  background: rgba(255, 255, 255, 0.95);
}

.dot {
  opacity: 0.5;
}

.hud.hud--open {
  transform: translateY(0);
  opacity: 1;
  pointer-events: auto;
}

@media (max-width: 640px) {
  .time-wheel {
    width: min(92vw, 460px);
    height: calc(min(92vw, 460px) / 2);
  }

  .hud {
    inset: 1rem;
    padding: 0.9rem 1rem;
  }

  .hud__row {
    flex-direction: column;
    align-items: flex-start;
  }

  .ghost {
    align-self: stretch;
  }
}
