* { box-sizing: border-box; margin: 0; padding: 0; }

html, body {
  height: 100%;
  background: #0b1026;
  overflow: hidden;
  overscroll-behavior: none;
  -webkit-user-select: none;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
}

body {
  font-family: ui-serif, "New York", "Iowan Old Style", Georgia, serif;
  color: #fff;
}

canvas {
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100vh;
  height: 100dvh;
  display: block;
  touch-action: none;
  cursor: ew-resize;
}

.top {
  position: fixed;
  top: calc(env(safe-area-inset-top) + 22px);
  left: 24px;
  right: 24px;
  pointer-events: none;
  animation: rise 2.4s cubic-bezier(.2,.7,.2,1) both .4s;
}

h1 {
  font-weight: 400;
  font-style: italic;
  font-size: 30px;
  letter-spacing: .01em;
  text-shadow: 0 1px 18px rgba(0,0,0,.25);
}

.count {
  margin-top: 4px;
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", system-ui, sans-serif;
  font-size: 12px;
  letter-spacing: .14em;
  text-transform: uppercase;
  opacity: .62;
}

.bottom {
  position: fixed;
  left: 24px;
  right: 24px;
  bottom: calc(env(safe-area-inset-bottom) + 22px);
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  pointer-events: none;
  animation: rise 2.4s cubic-bezier(.2,.7,.2,1) both .8s;
}

.clock {
  font-size: 44px;
  font-weight: 300;
  line-height: 1;
  font-variant-numeric: tabular-nums;
  text-shadow: 0 2px 24px rgba(0,0,0,.3);
}

.ampm {
  font-size: 15px;
  margin-left: 6px;
  font-style: italic;
  opacity: .75;
}

.replay {
  pointer-events: auto;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 11px 18px 11px 14px;
  border: 1px solid rgba(255,255,255,.28);
  border-radius: 999px;
  background: rgba(255,255,255,.1);
  -webkit-backdrop-filter: blur(14px) saturate(140%);
  backdrop-filter: blur(14px) saturate(140%);
  color: #fff;
  font: 500 14px/1 -apple-system, BlinkMacSystemFont, system-ui, sans-serif;
  letter-spacing: .03em;
  cursor: pointer;
  transition: transform .2s ease, background .3s ease;
}
.replay:hover { background: rgba(255,255,255,.18); }
.replay:active { transform: scale(.95); }
.replay svg {
  width: 17px; height: 17px;
  fill: none; stroke: currentColor; stroke-width: 2;
  stroke-linecap: round; stroke-linejoin: round;
}
.replay.spin svg { animation: spin .7s cubic-bezier(.3,.7,.3,1); }

.hint {
  position: fixed;
  left: 0; right: 0;
  bottom: calc(env(safe-area-inset-bottom) + 96px);
  text-align: center;
  font: 13px/1 -apple-system, BlinkMacSystemFont, system-ui, sans-serif;
  letter-spacing: .06em;
  color: rgba(255,255,255,.7);
  pointer-events: none;
  opacity: 0;
  transition: opacity 1.2s ease;
}
.hint.show { opacity: 1; }

@keyframes rise {
  from { opacity: 0; transform: translateY(10px); filter: blur(4px); }
  to   { opacity: 1; transform: none; filter: none; }
}
@keyframes spin { to { transform: rotate(-360deg); } }

@media (min-width: 700px) {
  h1 { font-size: 38px; }
  .clock { font-size: 56px; }
  .top, .bottom { left: 40px; right: 40px; }
}
