:root {
  --bg: #060607;
  --ink: #f2e6c9;
  --dim: rgba(242, 230, 201, .52);
  --faint: rgba(242, 230, 201, .1);
  color-scheme: dark;
}
* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { background: var(--bg); color: var(--ink); }
body {
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Display", "Segoe UI", Inter, sans-serif;
  -webkit-font-smoothing: antialiased;
  min-height: 100svh;
}
main {
  max-width: 440px; margin: 0 auto; min-height: 100svh;
  padding: max(48px, env(safe-area-inset-top)) 24px max(28px, env(safe-area-inset-bottom));
  display: flex; flex-direction: column;
}
section { flex: 1; display: flex; flex-direction: column; align-items: center; text-align: center; animation: in .7s cubic-bezier(.2, .7, .2, 1) both; }
[hidden] { display: none !important; }
@keyframes in { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: none; } }

.moon { width: 120px; height: 120px; margin: 8vh 0 40px; }
h1 { font-size: 34px; line-height: 1.12; font-weight: 600; letter-spacing: -.02em; }
.lede { margin-top: 14px; color: var(--dim); font-size: 17px; line-height: 1.45; }
.setup { margin: 44px 0 20px; font-size: 17px; line-height: 2.2; color: var(--dim); }
.setup input, .setup select, #manual select {
  font: inherit; color: var(--ink); background: var(--faint); border: 0; border-radius: 10px;
  padding: 4px 10px; -webkit-appearance: none; appearance: none; text-align: center;
}
.setup input { width: 64px; }
button { font: inherit; cursor: pointer; border: 0; -webkit-tap-highlight-color: transparent; }
.primary {
  margin-top: auto; width: 100%; height: 56px; border-radius: 28px;
  background: var(--ink); color: var(--bg); font-size: 17px; font-weight: 600;
  transition: transform .15s ease;
}
.primary:active { transform: scale(.98); }
.text { background: none; color: var(--dim); font-size: 15px; padding: 14px 8px 0; }
.fine { color: var(--dim); font-size: 13px; line-height: 1.5; margin-top: 14px; }
#manual { width: 100%; margin-top: 18px; display: flex; flex-direction: column; gap: 12px; }
#manual select { width: 100%; height: 48px; font-size: 17px; }
#manual .primary { margin-top: 0; }

#result .fine:first-child { margin: 0 0 7vh; }
.label { color: var(--dim); font-size: 17px; }
.time { font-size: 88px; font-weight: 600; letter-spacing: -.045em; line-height: 1; margin-top: 10px; font-variant-numeric: tabular-nums; }
.time small { font-size: 26px; letter-spacing: 0; margin-left: 6px; font-weight: 500; color: var(--dim); }
.count { margin-top: 12px; font-size: 17px; font-variant-numeric: tabular-nums; }
.line { font-size: 19px; line-height: 1.4; margin-top: 6px; }
#dirLine { margin-top: 6vh; }
.row { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; width: 100%; margin: 6vh 0 32px; }
.row .v { font-size: 22px; font-weight: 600; font-variant-numeric: tabular-nums; }
.row .k { color: var(--dim); font-size: 12px; margin-top: 4px; line-height: 1.3; }
.note { margin-top: 18px; }

#finder { position: fixed; inset: 0; background: var(--bg); justify-content: center; z-index: 5; }
.ring { position: absolute; left: 50%; top: 50%; width: 84px; height: 84px; margin: -42px 0 0 -42px; border-radius: 50%; background: var(--faint); }
.dot {
  position: absolute; left: 50%; top: 50%; width: 30px; height: 30px; margin: -15px 0 0 -15px;
  border-radius: 50%; background: var(--ink); transition: transform .12s linear, opacity .2s;
}
.cue { position: absolute; left: 24px; right: 24px; bottom: 22vh; font-size: 22px; font-weight: 600; }
.close { position: absolute; left: 0; right: 0; bottom: max(28px, env(safe-area-inset-bottom)); }

footer { text-align: center; color: var(--dim); font-size: 12px; padding-top: 22px; }
footer a { color: inherit; }
