:root {
  font-family:
    ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono",
    monospace;
  color: #d9ec9e;
  background: #17291d;
  font-synthesis: none;
}
* {
  box-sizing: border-box;
}
html {
  min-height: 100%;
}
body {
  min-height: 100vh;
  margin: 0;
  background-color: #17291d;
  background-image:
    radial-gradient(
      circle at 50% 42%,
      rgba(87, 121, 72, 0.14),
      transparent 56%
    ),
    linear-gradient(rgba(113, 132, 91, 0.09) 1px, transparent 1px),
    linear-gradient(90deg, rgba(113, 132, 91, 0.09) 1px, transparent 1px);
  background-size:
    auto,
    22px 22px,
    22px 22px;
}
button {
  font: inherit;
}
button:focus-visible {
  outline: 3px solid #e98655;
  outline-offset: 4px;
}
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}
.app-shell {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  min-height: 100svh;
  max-width: 1800px;
  margin: auto;
  padding: 0 clamp(20px, 4vw, 60px);
}
.topbar {
  display: flex;
  align-items: center;
  flex: none;
  height: 72px;
  border-bottom: 1px solid rgba(185, 209, 144, 0.18);
}
.brand {
  display: flex;
  align-items: center;
  gap: 11px;
  color: #e7f4ba;
  font-size: 19px;
  font-weight: 900;
  letter-spacing: -0.08em;
}
.brand-dot {
  color: #e98655;
}
.brand-mark {
  display: grid;
  grid-template-columns: repeat(2, 8px);
  grid-template-rows: repeat(2, 8px);
  gap: 2px;
  transform: rotate(-12deg);
}
.brand-mark span {
  background: #d9ec9e;
}
.brand-mark span:nth-child(2) {
  background: #e98655;
}
.brand-mark span:nth-child(3) {
  background: #829c70;
}
.main-content {
  display: flex;
  flex: 1;
  min-height: 0;
}
.timer-section {
  display: flex;
  flex: 1;
  flex-direction: column;
  width: 100%;
  min-width: 0;
}
.display-screen {
  display: flex;
  flex: 1;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 280px;
  padding: 28px 0;
}
.display-heading {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: clamp(19px, 5vh, 42px);
  color: #a7bc86;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.16em;
}
.live-dot {
  width: 8px;
  height: 8px;
  background: #829876;
}
.is-running .live-dot {
  background: #d9ec9e;
  box-shadow: 0 0 12px #d9ec9e;
  animation: pulse 2s steps(2, end) infinite;
}
.time-display {
  display: flex;
  align-items: baseline;
  justify-content: center;
  max-width: 100%;
  white-space: nowrap;
  font-size: clamp(72px, 12vw, 178px);
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.095em;
  line-height: 1;
  text-shadow: 0 0 38px rgba(217, 236, 158, 0.14);
}
.time-centiseconds {
  margin-left: 6px;
  color: #a8bd81;
  font-size: 0.43em;
  letter-spacing: -0.075em;
}
.display-track {
  display: flex;
  width: min(66vw, 570px);
  gap: 8px;
  height: 5px;
  margin-top: clamp(25px, 6vh, 56px);
}
.display-track span {
  flex: 1;
  background: #3d5940;
}
.display-track span:nth-child(-n + 4) {
  background: #829c70;
}
.control-row {
  display: flex;
  gap: 12px;
  width: min(100%, 760px);
  margin: 0 auto;
}
.button {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 68px;
  border: 2px solid #829c70;
  border-radius: 0;
  background: #223b29;
  color: #d9ec9e;
  cursor: pointer;
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 0.08em;
  transition:
    background 0.12s,
    transform 0.12s;
}
.button:hover:not(:disabled) {
  background: #2d4b32;
  transform: translateY(-2px);
}
.button:active:not(:disabled) {
  transform: translateY(1px);
}
.button:disabled {
  border-color: #3e5940;
  color: #6f8568;
  cursor: not-allowed;
}
.button-primary {
  flex: 1.5;
  border-color: #d9ec9e;
  background: #d9ec9e;
  color: #17291d;
  box-shadow: 4px 4px 0 #6f8c5c;
}
.button-primary:hover:not(:disabled) {
  background: #e8f7b9;
}
.button-secondary {
  flex: 1;
}
.button-icon {
  font-size: 18px;
  line-height: 1;
}
.wake-status {
  display: flex;
  align-items: center;
  gap: 9px;
  width: fit-content;
  margin: 22px auto clamp(24px, 5vh, 46px);
  padding: 8px 10px;
  border: 1px solid transparent;
  background: transparent;
  color: #829876;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.1em;
}
.wake-status:disabled {
  cursor: default;
}
.wake-status:not(:disabled) {
  border-color: #5c7854;
  cursor: pointer;
}
.wake-status.is-active {
  color: #c5dda0;
}
.wake-indicator {
  width: 7px;
  height: 7px;
  background: #6c8265;
}
.wake-status.is-active .wake-indicator {
  background: #c5dda0;
  box-shadow: 0 0 8px #c5dda0;
}
.laps-section {
  width: min(100%, 760px);
  margin: 8px auto 48px;
}
.laps-heading {
  border-bottom: 1px solid #718a65;
  padding-bottom: 12px;
}
.laps-heading h2 {
  margin: 0;
  color: #d9ec9e;
  font-size: 19px;
  font-weight: 800;
}
.laps-heading h2 span {
  margin-left: 5px;
  color: #839b77;
  font-size: 12px;
}
.laps-list {
  max-height: 270px;
  overflow: auto;
  margin: 0;
  padding: 0;
  list-style: none;
}
.laps-list li {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 8px;
  padding: 15px 4px;
  border-bottom: 1px solid #3d5940;
  font-size: 13px;
  font-weight: 700;
}
.lap-index,
.lap-split {
  color: #91ab83;
}
.lap-split {
  text-align: center;
}
.lap-total {
  text-align: right;
  font-variant-numeric: tabular-nums;
}
@keyframes pulse {
  50% {
    opacity: 0.35;
  }
}
@media (max-width: 700px) {
  .topbar {
    height: 62px;
  }
  .display-screen {
    min-height: 250px;
  }
  .display-heading {
    margin-bottom: 25px;
    font-size: 9px;
  }
  .time-display {
    font-size: clamp(43px, 16vw, 84px);
  }
  .display-track {
    width: min(72vw, 390px);
    gap: 5px;
    height: 4px;
    margin-top: 33px;
  }
  .control-row {
    gap: 7px;
  }
  .button {
    min-height: 58px;
    gap: 5px;
    font-size: 10px;
    letter-spacing: 0.03em;
  }
  .button-icon {
    font-size: 15px;
  }
  .laps-list li {
    font-size: 11px;
  }
}
@media (max-width: 380px) {
  .button {
    font-size: 9px;
  }
}
@supports (padding: env(safe-area-inset-top)) {
  .app-shell {
    padding-left: max(clamp(20px, 4vw, 60px), env(safe-area-inset-left));
    padding-right: max(clamp(20px, 4vw, 60px), env(safe-area-inset-right));
  }
  .topbar {
    height: calc(72px + env(safe-area-inset-top));
    padding-top: env(safe-area-inset-top);
  }
  .wake-status {
    margin-bottom: max(24px, env(safe-area-inset-bottom));
  }
  @media (max-width: 700px) {
    .topbar {
      height: calc(62px + env(safe-area-inset-top));
    }
  }
}
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
}
