:root {
  --blue: #1677ff;
  --red: #ef4444;
  --text: #111827;
  --muted: #6b7280;
  --border: #e5e7eb;
  --bg: #ffffff;
}

* {
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
}

html,
body {
  margin: 0;
  width: 100%;
  height: 100%;
  overflow: hidden;
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Display", "Helvetica Neue",
    Arial, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
}

button,
input,
select {
  font: inherit;
}

.app {
  width: 100%;
  height: 100svh;
  height: 100dvh;
  max-width: 430px;
  margin: 0 auto;
  padding: calc(env(safe-area-inset-top) + 22px) 22px
    calc(env(safe-area-inset-bottom) + 18px);

  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 26px;
}

.timer-area {
  width: 100%;
  text-align: center;
  margin-top: -20px;
}

.timer {
  font-size: clamp(84px, 24vw, 116px);
  line-height: 0.95;
  font-weight: 900;
  letter-spacing: -0.065em;
  color: #000;
}

.current-item {
  margin-top: 14px;
  font-size: 21px;
  line-height: 1.2;
  font-weight: 800;
  color: var(--muted);
}

.big-btn {
  width: min(46vw, 184px);
  height: min(46vw, 184px);
  border: none;
  border-radius: 999px;
  color: white;
  font-size: 30px;
  font-weight: 900;
  box-shadow: 0 16px 34px rgba(0, 0, 0, 0.16);
  transition: transform 0.12s ease, background 0.2s ease;
}

.big-btn:active {
  transform: scale(0.96);
}

.big-btn.idle {
  background: var(--blue);
}

.big-btn.running {
  background: var(--red);
}

.panel {
  width: 100%;
  display: grid;
  gap: 10px;
}

.select-row,
.add-row {
  display: grid;
  grid-template-columns: 1fr 72px;
  gap: 10px;
}

select,
input {
  width: 100%;
  height: 46px;
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 0 14px;
  background: #f9fafb;
  color: var(--text);
  outline: none;
  font-size: 16px;
}

select:focus,
input:focus {
  border-color: var(--blue);
  background: white;
}

.small-btn {
  height: 46px;
  border: none;
  border-radius: 14px;
  background: #eef4ff;
  color: var(--blue);
  font-weight: 900;
}

.small-btn.danger {
  background: #fff1f2;
  color: var(--red);
}

@media (max-height: 700px) {
  .app {
    padding-top: calc(env(safe-area-inset-top) + 14px);
    padding-bottom: calc(env(safe-area-inset-bottom) + 12px);
    gap: 18px;
  }

  .timer-area {
    margin-top: -8px;
  }

  .timer {
    font-size: clamp(72px, 21vw, 94px);
  }

  .current-item {
    font-size: 18px;
    margin-top: 8px;
  }

  .big-btn {
    width: min(40vw, 158px);
    height: min(40vw, 158px);
    font-size: 26px;
  }

  select,
  input,
  .small-btn {
    height: 42px;
  }
}
