:root {
  color-scheme: dark;
  --bg: #0f172a;
  --panel: rgba(15, 23, 42, 0.78);
  --panel-strong: rgba(30, 41, 59, 0.92);
  --text: #e5eefb;
  --muted: #95a3b8;
  --accent: #38bdf8;
  --accent-2: #a78bfa;
  --danger: #fb7185;
  --ok: #34d399;
  --ring: rgba(56, 189, 248, 0.38);
}

* { box-sizing: border-box; }

body {
  margin: 0;
  min-height: 100vh;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--text);
  background:
    radial-gradient(circle at 15% 15%, rgba(56, 189, 248, 0.22), transparent 28rem),
    radial-gradient(circle at 85% 25%, rgba(167, 139, 250, 0.18), transparent 24rem),
    linear-gradient(135deg, #020617, var(--bg));
}

button, input { font: inherit; }

.app {
  width: min(920px, calc(100% - 32px));
  margin: 0 auto;
  padding: 48px 0;
}

.hero { text-align: center; margin-bottom: 28px; }
.eyebrow { margin: 0 0 10px; color: var(--accent); font-size: 0.78rem; letter-spacing: 0.16em; text-transform: uppercase; font-weight: 800; }
h1 { margin: 0; font-size: clamp(2rem, 8vw, 4.8rem); line-height: 0.95; letter-spacing: -0.06em; }
.intro { max-width: 620px; margin: 18px auto 0; color: var(--muted); font-size: 1.05rem; line-height: 1.6; }

.panel {
  border: 1px solid rgba(148, 163, 184, 0.22);
  border-radius: 32px;
  background: linear-gradient(180deg, var(--panel), rgba(15, 23, 42, 0.56));
  box-shadow: 0 28px 90px rgba(2, 6, 23, 0.46);
  backdrop-filter: blur(18px);
  padding: clamp(20px, 4vw, 34px);
}

.tabs { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; padding: 8px; border-radius: 22px; background: rgba(2, 6, 23, 0.42); }
.tab { border: 0; border-radius: 16px; padding: 14px 18px; color: var(--muted); background: transparent; cursor: pointer; font-weight: 800; transition: 180ms ease; }
.tab.active { color: #03111e; background: linear-gradient(135deg, var(--accent), var(--accent-2)); box-shadow: 0 12px 28px rgba(56, 189, 248, 0.22); }

.display-card { margin: 28px 0 22px; padding: clamp(24px, 7vw, 48px); text-align: center; border-radius: 28px; background: var(--panel-strong); border: 1px solid rgba(148, 163, 184, 0.16); }
.mode-label { color: var(--muted); text-transform: uppercase; font-size: 0.78rem; font-weight: 900; letter-spacing: 0.18em; }
.display { display: block; margin-top: 10px; font-variant-numeric: tabular-nums; font-size: clamp(3.6rem, 16vw, 9rem); line-height: 1; letter-spacing: -0.08em; font-weight: 900; }
.display.finished { color: var(--ok); text-shadow: 0 0 30px rgba(52, 211, 153, 0.26); }

.timer-inputs { display: flex; justify-content: center; gap: 14px; margin-top: 24px; flex-wrap: wrap; }
.timer-inputs label { color: var(--muted); font-size: 0.9rem; font-weight: 700; }
.timer-inputs input { width: 92px; margin-left: 8px; padding: 10px 12px; border: 1px solid rgba(148, 163, 184, 0.22); border-radius: 14px; color: var(--text); background: rgba(2, 6, 23, 0.38); outline: none; }
.timer-inputs input:focus { border-color: var(--accent); box-shadow: 0 0 0 4px var(--ring); }
.hidden { display: none; }

.controls { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.button { min-height: 54px; border: 1px solid rgba(148, 163, 184, 0.2); border-radius: 18px; color: var(--text); background: rgba(30, 41, 59, 0.72); cursor: pointer; font-weight: 900; transition: transform 160ms ease, border-color 160ms ease, background 160ms ease; }
.button:hover, .quick-actions button:hover { transform: translateY(-1px); border-color: rgba(56, 189, 248, 0.5); }
.button.primary { color: #03111e; background: linear-gradient(135deg, var(--accent), var(--accent-2)); border: 0; }
.button.ghost { color: #fecdd3; background: rgba(251, 113, 133, 0.09); }

.quick-actions { display: none; grid-template-columns: repeat(4, 1fr); gap: 10px; margin-top: 14px; }
.quick-actions.visible { display: grid; }
.quick-actions button { border: 1px solid rgba(148, 163, 184, 0.18); border-radius: 14px; padding: 11px; color: var(--muted); background: rgba(2, 6, 23, 0.24); cursor: pointer; font-weight: 800; }

@media (max-width: 640px) {
  .app { width: min(100% - 20px, 920px); padding: 28px 0; }
  .controls, .quick-actions { grid-template-columns: 1fr; }
  .tabs { grid-template-columns: 1fr; }
}
