:root {
  color-scheme: dark;
  --bg: #0a0a0a;
  --bg-soft: #121212;
  --fg: #f3efe8;
  --muted: #9f988d;
  --line: rgba(243, 239, 232, 0.14);
  --line-strong: rgba(243, 239, 232, 0.24);
  --accent: #f3efe8;
  --radius: 26px;
  --shell-pad: clamp(16px, 2.3vw, 30px);
  --shadow: 0 30px 80px rgba(0, 0, 0, 0.34);
  font-family: Inter, Arial, Helvetica, sans-serif;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  height: 100%;
  background:
    radial-gradient(circle at top left, rgba(255, 255, 255, 0.06), transparent 28%),
    radial-gradient(circle at bottom right, rgba(255, 255, 255, 0.03), transparent 30%),
    linear-gradient(180deg, #0f0f0f 0%, #090909 55%, #060606 100%);
  color: var(--fg);
}

body {
  min-height: 100vh;
  min-height: 100dvh;
  overflow: hidden;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background:
    linear-gradient(rgba(255, 255, 255, 0.03) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.012) 1px, transparent 1px);
  background-size: 100% 6px, 6px 100%;
  opacity: 0.16;
}

.app-shell {
  height: 100vh;
  height: 100dvh;
  display: flex;
  align-items: stretch;
  justify-content: center;
  padding: var(--shell-pad);
}

.hero-panel {
  width: min(1100px, 100%);
  max-height: calc(100dvh - (var(--shell-pad) * 2));
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  gap: clamp(10px, 1.7vh, 18px);
  min-height: 0;
}

.eyebrow {
  margin: 0;
  text-transform: uppercase;
  letter-spacing: 0.5em;
  font-size: clamp(0.68rem, 0.9vw, 0.92rem);
  color: var(--muted);
  padding-left: 0.15em;
}

.wheel {
  display: grid;
  grid-template-rows: minmax(0, 1fr) auto;
  gap: clamp(10px, 1.5vh, 18px);
  min-height: 0;
}

.wheel-current,
.wheel-item {
  border: 1px solid var(--line);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.04), rgba(255, 255, 255, 0.01)),
    rgba(15, 15, 15, 0.92);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  backdrop-filter: blur(12px);
}

.wheel-current {
  min-height: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: clamp(24px, 4vw, 44px);
  position: relative;
  overflow: hidden;
}

.wheel-current::after {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(140deg, transparent 0%, rgba(255, 255, 255, 0.05) 48%, transparent 52%),
    radial-gradient(circle at top left, rgba(255, 255, 255, 0.07), transparent 34%);
  transform: translateX(-120%);
  animation: sweep 13s linear infinite;
}

.wheel-current::before {
  content: "";
  position: absolute;
  inset: 18px;
  border-radius: calc(var(--radius) - 12px);
  border: 1px solid rgba(243, 239, 232, 0.06);
}

.next-type {
  margin: 0 0 1.5vh;
  font-size: clamp(1rem, 2vw, 2rem);
  font-weight: 700;
  letter-spacing: 0.38em;
  text-transform: uppercase;
  position: relative;
  z-index: 1;
}

.countdown {
  margin: 0;
  font-size: clamp(3.5rem, 11vw, 8rem);
  line-height: 0.88;
  font-weight: 800;
  letter-spacing: -0.06em;
  position: relative;
  z-index: 1;
}

.next-time {
  margin: 1.8vh 0 0;
  font-size: clamp(0.95rem, 1.45vw, 1.35rem);
  color: var(--muted);
  letter-spacing: 0.24em;
  text-transform: uppercase;
  position: relative;
  z-index: 1;
}

.wheel-track {
  display: grid;
  gap: clamp(8px, 1vh, 12px);
  min-height: 0;
  overflow: hidden;
}

.wheel-item {
  display: grid;
  grid-template-columns: 1.2fr 1fr auto;
  align-items: center;
  gap: 1rem;
  padding: clamp(0.7rem, 1.4vw, 1rem) clamp(1rem, 1.8vw, 1.35rem);
  min-height: 0;
}

.wheel-item:nth-child(1) {
  opacity: 0.9;
}

.wheel-item:nth-child(2) {
  opacity: 0.72;
}

.wheel-item:nth-child(3),
.wheel-item:nth-child(n + 4) {
  opacity: 0.5;
}

.item-type,
.item-clock,
.item-in {
  margin: 0;
  text-transform: uppercase;
}

.item-type {
  font-size: clamp(0.9rem, 1.2vw, 1.05rem);
  font-weight: 700;
  letter-spacing: 0.24em;
}

.item-clock,
.item-in {
  font-size: clamp(0.84rem, 1vw, 0.96rem);
  color: var(--muted);
  letter-spacing: 0.18em;
}

.notification-panel {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: clamp(0.9rem, 1.4vw, 1.1rem) clamp(1rem, 1.8vw, 1.3rem);
  border: 1px solid var(--line);
  border-radius: calc(var(--radius) - 8px);
  background: rgba(255, 255, 255, 0.028);
}

.notification-label,
.notification-status {
  margin: 0;
}

.notification-label {
  text-transform: uppercase;
  letter-spacing: 0.34em;
  color: var(--muted);
  font-size: 0.72rem;
}

.notification-status {
  margin-top: 0.25rem;
  font-size: clamp(0.9rem, 1vw, 1rem);
  font-weight: 600;
}

.notification-button {
  border: 1px solid var(--line-strong);
  background: transparent;
  color: var(--fg);
  padding: 0.8rem 1.15rem;
  min-width: 140px;
  border-radius: 999px;
  font-size: 0.84rem;
  font-weight: 700;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  cursor: pointer;
  transition: transform 150ms ease, background 150ms ease, color 150ms ease, border-color 150ms ease;
}

.notification-button:hover,
.notification-button:focus-visible {
  background: var(--accent);
  color: var(--bg);
  transform: translateY(-1px);
  border-color: var(--accent);
}

.notification-button:disabled {
  opacity: 0.45;
  cursor: not-allowed;
  transform: none;
}

body.alarm-blink {
  animation: invertBlink 0.28s linear 8;
}

@keyframes invertBlink {
  0%,
  100% {
    background: #020202;
    color: #f4f4f4;
    filter: invert(0);
  }

  50% {
    background: #f7f7f7;
    color: #050505;
    filter: invert(1);
  }
}

@keyframes sweep {
  from {
    transform: translateX(-120%);
  }

  to {
    transform: translateX(120%);
  }
}

@media (max-width: 720px) {
  body {
    overflow-y: auto;
  }

  .app-shell {
    height: auto;
    min-height: 100vh;
    min-height: 100dvh;
  }

  .hero-panel {
    max-height: none;
    gap: 12px;
  }

  .wheel-current {
    min-height: 42vh;
    padding: 24px 20px;
  }

  .wheel-item {
    grid-template-columns: 1fr;
    gap: 0.35rem;
  }

  .notification-panel {
    flex-direction: column;
    align-items: stretch;
  }

  .notification-button {
    width: 100%;
  }
}
