:root {
  --bg: #08131c;
  --text: #7de6ff;
  --hint: #b8f0ff;
  --muted: #7a8f9e;
  --accent: #14a38b;
  --panel: #0f1e2a;
  --line: #274255;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  min-height: 100vh;
  background: radial-gradient(circle at 10% 12%, #122d3d 0%, transparent 34%), var(--bg);
  color: #fff;
  font-family: "Space Grotesk", sans-serif;
}

.desc-app {
  min-height: 100vh;
  padding: max(0.9rem, env(safe-area-inset-top)) 1.1rem max(1rem, env(safe-area-inset-bottom));
  display: flex;
  flex-direction: column;
}

.desc-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.back-link {
  color: #9cb4c4;
  text-decoration: none;
  font-size: 1rem;
}

.icon-btn {
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #0d1b27;
  color: #d5ebf6;
  padding: 0.35rem 0.65rem;
  font-size: 1.1rem;
  cursor: pointer;
}

.desc-meta {
  margin-top: 1rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.primary-btn,
.ghost-btn {
  border: 0;
  border-radius: 999px;
  padding: 0.38rem 0.72rem;
  font-family: "Space Grotesk", sans-serif;
  font-weight: 700;
  cursor: pointer;
}

.primary-btn { background: var(--accent); color: #fff; }
.ghost-btn { background: transparent; color: #d6e6ef; border: 1px solid var(--line); }

.set-label {
  margin: 0;
  color: var(--muted);
  font-size: clamp(1.2rem, 2.2vw, 2rem);
}

#setValue {
  color: #6af0c6;
  font-size: clamp(1.9rem, 4vw, 4rem);
  font-weight: 700;
  padding-left: 0.22rem;
}

.timer-zone {
  flex: 1;
  margin-top: 0.4rem;
  border: 0;
  background: transparent;
  width: 100%;
  display: grid;
  place-items: center;
  align-content: center;
  cursor: pointer;
}

.timer-value {
  color: var(--text);
  font-family: "IBM Plex Mono", monospace;
  font-weight: 700;
  line-height: 0.9;
  font-size: min(84vw, 60vh);
  letter-spacing: -0.04em;
}

.timer-hint {
  margin-top: -0.3em;
  color: var(--hint);
  font-weight: 700;
  font-size: clamp(1.8rem, 4vw, 3.6rem);
}

.range-hint {
  margin-top: 0.6rem;
  color: #7fd8ef;
  font-size: clamp(0.9rem, 2.2vw, 1.2rem);
}

.timer-zone.running .timer-hint { visibility: hidden; }

.settings-panel {
  position: fixed;
  top: 1rem;
  right: 1rem;
  width: min(90vw, 360px);
  border: 1px solid var(--line);
  border-radius: 14px;
  background: rgba(15, 30, 42, 0.97);
  padding: 1rem;
  z-index: 40;
  display: none;
}

.settings-panel.open { display: block; }
.settings-panel h2 { margin: 0 0 0.7rem; }
.settings-panel label { display: block; margin: 0.45rem 0 0.25rem; color: #a9c6d7; }
.settings-panel input,
.settings-panel select {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0.45rem 0.55rem;
  background: #0a1722;
  color: #eef6fb;
  font-family: "IBM Plex Mono", monospace;
}
.settings-actions { margin-top: 0.8rem; display: flex; gap: 0.5rem; }

.set-flash {
  position: fixed;
  inset: 0;
  z-index: 60;
  display: none;
  align-items: center;
  justify-content: center;
  background: #ffffff;
  color: #0d1822;
}

.set-flash.visible { display: flex; animation: flashPulse 260ms steps(2, end) infinite; }
.set-flash p { margin: 0; font-size: clamp(3.2rem, 16vw, 12rem); font-weight: 700; }

.done-overlay {
  position: fixed;
  inset: 0;
  z-index: 70;
  display: none;
  align-items: center;
  justify-content: center;
  background: rgba(5, 13, 19, 0.84);
}

.done-overlay.visible { display: flex; }

.done-card {
  width: min(90vw, 420px);
  border: 1px solid var(--line);
  border-radius: 14px;
  background: rgba(16, 29, 40, 0.98);
  padding: 1rem;
  text-align: center;
}

.done-card h2 { margin: 0 0 0.4rem; }
.done-card p { margin: 0 0 0.9rem; color: #b3c9d7; }

@keyframes flashPulse {
  0%, 100% { background: #ffffff; color: #111; }
  50% { background: #111; color: #fff; }
}

@media (max-width: 780px) {
  .timer-value {
    font-size: min(74vw, 50vh);
    letter-spacing: -0.03em;
  }
  .timer-hint { font-size: clamp(1.4rem, 6vw, 2.4rem); }
}

@media (max-width: 480px) {
  .timer-value {
    font-size: min(66vw, 44vh);
    letter-spacing: -0.02em;
  }
}
