*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }

:root {
  --deep: #0e3a2b;
  --deep-2: #15543f;
  --cream: #f8f3e7;
  --dim: rgba(248, 243, 231, .66);
  --line: rgba(248, 243, 231, .2);
  --c: 678.584;
}

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px 16px 28px;
  font-family: "PingFang SC", "Hiragino Sans GB", "Noto Sans SC", "Microsoft YaHei", system-ui, sans-serif;
  color: var(--cream);
  background: radial-gradient(130% 90% at 50% 0%, #fffdf7 0%, #f4edda 55%, #ebe1ca 100%);
}

.app { width: 100%; max-width: 25rem; }

.panel {
  background: linear-gradient(165deg, var(--deep-2), var(--deep) 62%);
  border-radius: 2rem;
  padding: 1.75rem 1.5rem 1.5rem;
  box-shadow: 0 24px 50px -26px rgba(14, 58, 43, .6), inset 0 1px 0 rgba(255, 255, 255, .09);
}

.head { text-align: center; }
.brand { margin: 0; font-size: clamp(1.05rem, 5.2vw, 1.25rem); font-weight: 600; letter-spacing: .12em; text-indent: .12em; white-space: nowrap; }
.tagline { margin: .45rem 0 1.3rem; font-size: .78rem; letter-spacing: .1em; color: var(--dim); }

.modes {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: .3rem;
  padding: .3rem;
  background: rgba(255, 255, 255, .07);
  border-radius: .95rem;
}

.mode {
  min-height: 44px;
  border: 0;
  border-radius: .7rem;
  background: transparent;
  color: var(--dim);
  font: inherit;
  font-size: .85rem;
  cursor: pointer;
  transition: background .2s, color .2s;
}
.mode.is-on { background: var(--cream); color: var(--deep); font-weight: 600; }

.dial { position: relative; width: 100%; max-width: 15.5rem; margin: 1.6rem auto 1rem; aspect-ratio: 1 / 1; }
.ring { display: block; width: 100%; height: 100%; transform: rotate(-90deg); }
.ring circle { fill: none; stroke-width: 10; }
.track { stroke: rgba(248, 243, 231, .16); }
.bar {
  stroke: var(--cream);
  stroke-linecap: round;
  stroke-dasharray: var(--c);
  stroke-dashoffset: 0;
  transition: stroke-dashoffset .25s linear;
}

.readout {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: .3rem;
}
.time { margin: 0; font-size: clamp(2.7rem, 14vw, 3.2rem); font-weight: 600; font-variant-numeric: tabular-nums; }
.state { margin: 0; font-size: .78rem; letter-spacing: .14em; color: var(--dim); }

.notice {
  margin: 0 0 1rem;
  padding: .7rem .9rem;
  border-radius: .8rem;
  background: rgba(248, 243, 231, .12);
  font-size: .82rem;
  text-align: center;
}

.controls { display: grid; grid-template-columns: 1.4fr 1fr; gap: .6rem; }
.btn {
  min-height: 50px;
  border: 1px solid transparent;
  border-radius: .9rem;
  font: inherit;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: transform .12s ease, background .2s, border-color .2s;
}
.btn:active { transform: scale(.985); }
.start { background: var(--cream); color: var(--deep); }
.reset { background: transparent; color: var(--cream); border-color: var(--line); }

:focus-visible { outline: 2px solid var(--cream); outline-offset: 2px; }

.tip { margin: 1rem 0 0; font-size: .72rem; line-height: 1.6; text-align: center; color: rgba(248, 243, 231, .5); }

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; }
}
