:root {
  color-scheme: dark;
  font-family: "Segoe UI", Arial, sans-serif;
  background: #101e20;
  color: #f3eee3;
  font-synthesis: none;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
  --muted: #9eafaa;
  --gold: #b7aa8c;
  --panel: #172729;
  --button: #233638;
  --button-hover: #34494b;
}

* {
  box-sizing: border-box;
}

body {
  min-width: 320px;
  min-height: 100vh;
  min-height: 100svh;
  margin: 0;
  background:
    radial-gradient(ellipse at 50% 38%, rgb(38 60 59 / 27%), transparent 52%),
    #101e20;
}

button,
input {
  font: inherit;
}

.app-shell {
  width: min(100%, 900px);
  min-height: 100vh;
  min-height: 100svh;
  margin: 0 auto;
  padding: clamp(16px, 3vh, 28px) 20px 18px;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.masthead {
  flex: none;
  text-align: center;
}

.eyebrow {
  margin: 0 0 4px;
  color: var(--gold);
  font-size: 10px;
  letter-spacing: 0.08em;
}

h1 {
  margin: 0;
  color: #f3eee3;
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(28px, 4vh, 34px);
  font-weight: 400;
  line-height: 1.15;
}

.subtitle {
  margin: 3px 0 0;
  color: #7f9492;
  font-size: 12px;
  letter-spacing: 0.08em;
}

.watch-stage {
  position: relative;
  width: min(86vw, 62svh, 680px);
  aspect-ratio: 1;
  flex: none;
  margin: auto 0 0;
}

#watch {
  display: block;
  width: 100%;
  height: 100%;
}

.loading {
  position: absolute;
  inset: 50% auto auto 50%;
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  transform: translate(-50%, -50%);
}

.loading[hidden] {
  display: none;
}

.readout {
  flex: none;
  margin-top: 3px;
  text-align: center;
}

.clock {
  margin: 0;
  color: #efe7d6;
  font-family: Consolas, "Courier New", monospace;
  font-size: clamp(22px, 4vh, 28px);
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.04em;
}

.calendar {
  margin: 4px 0 0;
  color: #a9bbb8;
  font-size: 11px;
  letter-spacing: 0.035em;
}

.time-panel {
  width: min(100%, 540px);
  flex: none;
  display: flex;
  flex-wrap: wrap;
  align-items: end;
  justify-content: center;
  gap: 10px;
  margin-top: clamp(12px, 2vh, 20px);
}

.field {
  display: grid;
  gap: 5px;
}

.field label {
  color: var(--muted);
  font-size: 11px;
}

.field input {
  min-height: 38px;
  padding: 7px 10px;
  border: 1px solid #3a5050;
  border-radius: 5px;
  background: var(--panel);
  color: #eee8dc;
  accent-color: var(--gold);
}

.field input:focus-visible,
.button:focus-visible {
  outline: 2px solid #d1bd91;
  outline-offset: 2px;
}

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}

.button {
  min-height: 38px;
  padding: 0 13px;
  border: 1px solid transparent;
  border-radius: 5px;
  background: var(--button);
  color: #eee8dc;
  cursor: pointer;
  font-size: 12px;
  transition: background-color 120ms ease, border-color 120ms ease;
}

.button:hover {
  border-color: #526663;
  background: var(--button-hover);
}

.button-primary {
  background: #5b5140;
}

.button-primary:hover {
  background: #73664d;
}

.button-icon {
  width: 38px;
  padding: 0;
  font-size: 19px;
}

.status {
  min-height: 18px;
  flex: none;
  margin: 5px 0 0;
  color: #d5a17a;
  font-size: 11px;
  text-align: center;
}

.caption {
  flex: none;
  margin-top: 4px;
  color: #7f9492;
  font-size: 10px;
  text-align: center;
}

@media (max-width: 480px) {
  .app-shell {
    padding-right: 12px;
    padding-left: 12px;
  }

  .watch-stage {
    width: min(94vw, 57svh, 680px);
  }

  .time-panel {
    gap: 8px;
  }

  .field input {
    padding-right: 6px;
    padding-left: 6px;
  }

  .actions {
    width: 100%;
    justify-content: center;
  }
}

@media (max-height: 720px) and (min-width: 481px) {
  .watch-stage {
    width: min(56vw, 53svh, 540px);
  }

  .app-shell {
    padding-top: 10px;
    padding-bottom: 10px;
  }
}
