:root {
  --bg: #000;
  --panel: #090c11;
  --panel2: #151a22;
  --line: #343b47;
  --text: #fff;
  --muted: #b8c0cd;
  --lime: #eaff38;
}

body:not(.theme-light) {
  background-image: none;
}

.preset-grid {
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
}

#counterView,
#counterView .tool-top,
.count-stage {
  background: #000;
}

.count-stage {
  display: grid;
  grid-template-rows: auto auto minmax(0, 1fr) auto;
  justify-items: center;
  align-items: center;
  gap: 8px;
  padding: clamp(20px, 3vh, 34px) 20px 24px;
}

#counterView .tool-top {
  border-bottom-color: #343b47;
}

.tool-top > div {
  min-width: 0;
}

.tool-top .focus-toggle {
  width: auto;
  min-width: 158px;
  padding: 0 16px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  background: var(--lime);
  color: #080b0f;
  border: 2px solid var(--lime);
  font-weight: 900;
  white-space: nowrap;
  box-shadow: 0 0 0 3px #c9f65b20;
}

.tool-top .focus-toggle span {
  color: inherit;
  font-size: 20px;
}

.tool-top .focus-toggle[aria-pressed="true"] {
  background: #fff;
  border-color: #fff;
}

.site-footer {
  padding: 22px 18px calc(24px + env(safe-area-inset-bottom));
  border-top: 1px solid var(--line);
  color: var(--muted);
  text-align: center;
  font-size: 12px;
  line-height: 1.7;
}

.site-footer p {
  margin: 0;
}

.site-footer a {
  color: var(--text);
  font-weight: 800;
  text-decoration: none;
}

.focus-mode .site-footer {
  display: none;
}

.count-stage strong {
  align-self: center;
  max-width: 96%;
  color: var(--lime);
  font-family: "Arial Black", Pretendard, system-ui, sans-serif;
  font-size: min(46vh, 72vw);
  font-weight: 950;
  line-height: .78;
  letter-spacing: -.055em;
  text-rendering: geometricPrecision;
  -webkit-font-smoothing: antialiased;
}

.count-stage[data-digits="2"] strong {
  font-size: min(45vh, 57vw);
}

.count-stage[data-digits="3"] strong {
  font-size: min(42vh, 40vw);
}

.count-stage[data-digits="4"] strong {
  font-size: min(38vh, 30vw);
}

.status-pill {
  background: #fff;
  color: #000;
  font-size: 14px;
  font-weight: 950;
}

.count-stage > span:nth-child(2) {
  margin-top: 0;
  color: #fff;
  font-size: clamp(17px, 2.2vw, 24px);
  font-weight: 850;
}

.tap-hint b {
  color: var(--lime);
  font-size: clamp(18px, 2.2vw, 25px);
  font-weight: 950;
}

.tap-hint {
  position: static;
  bottom: auto;
  min-height: 58px;
  justify-content: center;
  padding: 4px 12px 8px;
  text-align: center;
}

.tap-hint small {
  color: #fff;
  font-size: clamp(14px, 1.5vw, 18px);
}

.count-stage i {
  height: 10px;
  background: #252b34;
}

.count-stage i span {
  background: var(--lime);
}

.prep-panel,
.rest-panel {
  background: #000f;
}

.prep-panel strong {
  font-family: "Arial Black", Pretendard, system-ui, sans-serif;
  font-size: min(38vh, 38vw);
  font-weight: 950;
}

.rest-panel strong {
  color: var(--lime);
  font-family: "Arial Black", Pretendard, system-ui, sans-serif;
  font-size: min(32vh, 28vw);
  font-weight: 950;
}

.timer-stage strong {
  color: #fff;
  font-family: "Arial Black", Pretendard, system-ui, sans-serif;
  font-size: min(36vh, 34vw);
  font-weight: 950;
}

.stopwatch-stage strong {
  font-size: min(30vh, 27vw);
}

@media (max-width: 760px) {
  .preset-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .tool-top {
    gap: 8px;
    padding-inline: 10px;
  }

  .tool-top .focus-toggle {
    min-width: 128px;
    padding-inline: 10px;
    gap: 5px;
    font-size: 13px;
  }

  .tool-top .focus-toggle span {
    font-size: 18px;
  }

  .site-footer {
    padding-bottom: calc(82px + env(safe-area-inset-bottom));
  }

  .count-stage {
    min-height: 430px;
    gap: 6px;
    padding: 18px 12px 20px;
  }

  .count-stage strong {
    font-size: min(44vh, 72vw);
  }

  .count-stage[data-digits="2"] strong {
    font-size: min(43vh, 57vw);
  }

  .count-stage[data-digits="3"] strong {
    font-size: min(39vh, 40vw);
  }

  .count-stage[data-digits="4"] strong {
    font-size: min(35vh, 30vw);
  }
}

@media (max-width: 360px) {
  .preset-grid {
    grid-template-columns: 1fr;
  }

  .tool-top .focus-toggle {
    min-width: 118px;
    padding-inline: 8px;
    font-size: 12px;
  }
}
