:root {
  color-scheme: dark;
  font-family: "Segoe UI", system-ui, sans-serif;
  --page: #000;
  --text: #eff1ee;
  --muted: #a3aaa5;
  --line: #303531;
  --mint: #81e2a7;
  --clock-font: "Bahnschrift SemiCondensed", "Bahnschrift", "Arial Narrow", "Helvetica Neue", Arial, sans-serif;
}
* { box-sizing: border-box; }
body { margin: 0; overflow: hidden; color: var(--text); background: var(--page); }
button, input, select { font: inherit; }
button, select, a { -webkit-tap-highlight-color: transparent; }
button { cursor: pointer; }
button, a, input, select { outline-offset: 3px; }
:focus-visible { outline: 2px solid var(--mint); }
[hidden] { display: none !important; }
.symbols { position: absolute; width: 0; height: 0; overflow: hidden; }
#stage {
  position: fixed; inset: 0; padding: clamp(6px, 1.35vmin, 18px); container-type: size;
  display: grid; grid-template: minmax(0, 1fr) / minmax(0, 1fr);
  place-items: center; overflow: hidden; user-select: none;
}
#clock {
  --rows: 2; --gap: clamp(5px, .82cqmin, 12px);
  display: grid; grid-template: repeat(var(--rows), minmax(0, 1fr)) / minmax(0, 1fr);
  gap: var(--gap); height: 100%; max-height: calc(135cqw * var(--rows) + (var(--rows) - 1) * var(--gap));
  aspect-ratio: 1.78 / var(--rows); max-width: 100%; min-width: 0; outline: none;
}
.tile {
  position: relative; container-type: size; overflow: hidden; isolation: isolate;
  perspective: 1100px; border: 1px solid #353736; background: #151615;
  border-radius: clamp(6px, 1.6vmin, 25px);
  box-shadow: 0 1px 3px #0009;
}
.tile::after {
  content: ""; pointer-events: none; position: absolute; z-index: 4; inset-inline: 0; top: 50%;
  height: clamp(2px, 1.35cqh, 9px);
  transform: translateY(-50%); background: #090a09;
  box-shadow: 0 1px 0 #484a47;
}
.half { position: absolute; left: 0; width: 100%; height: 50%; overflow: hidden; backface-visibility: hidden; }
.half.top { top: 0; transform-origin: bottom center; background: linear-gradient(#1b1c1b, #171817); color: #f9faf7; }
.half.bottom { bottom: 0; transform-origin: top center; background: linear-gradient(#101110, #171817); color: #ebeeea; }
.half svg.figure {
  position: absolute; inset-inline: 0; width: 100%; height: 200%; display: block; overflow: visible;
  font-family: var(--clock-font); fill: currentColor; stroke: none;
  font-weight: 700; font-size: 100px; font-synthesis: none; font-variant-numeric: tabular-nums lining-nums;
}
html[data-palette]:not([data-palette="original"]) :is(.tile, .half.top, .half.bottom, #preview-clock) { background: #000; }
html[data-palette]:not([data-palette="original"]) .half { color: var(--camera-ink); }
html[data-palette]:not([data-palette="original"]) .tile::after { background: #000; }
.top .figure { top: 0; }
.bottom .figure { bottom: 0; }
.leaf { z-index: 2; visibility: hidden; }
.tile.turning .leaf { visibility: visible; }
.tile.turning .leaf.top { animation: turn-top 165ms ease-in both; }
.tile.turning .leaf.bottom { animation: turn-bottom 180ms 165ms ease-out both; }
@keyframes turn-top { from { transform: rotateX(0); } to { transform: rotateX(-90deg); filter: brightness(.58); } }
@keyframes turn-bottom { from { transform: rotateX(90deg); filter: brightness(.62); } to { transform: rotateX(0); } }
[data-font="sans"] { --clock-font: "Segoe UI", "Helvetica Neue", Arial, sans-serif; }
[data-font="mono"] { --clock-font: Consolas, "SFMono-Regular", "Liberation Mono", monospace; }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-delay: 0ms !important; transition-duration: .01ms !important; }
}
.chrome { position: fixed; z-index: 6; opacity: 0; pointer-events: none; transition: opacity 180ms; }
html[data-controls="visible"] .chrome { opacity: 1; }
html[data-controls="visible"] .chrome :is(button, select, a) { pointer-events: auto; }
html[data-controls="hidden"] body { cursor: none; }
.topbar {
  top: 0; left: 0; right: 0; display: flex; align-items: center; justify-content: space-between;
  padding: max(9px, env(safe-area-inset-top)) max(12px, env(safe-area-inset-right)) 13px max(14px, env(safe-area-inset-left));
  background: linear-gradient(#090a09ea, #090a09b8 74%, transparent);
}
.brand { display: flex; align-items: center; gap: 7px; font-size: 14px; font-weight: 630; letter-spacing: -.025em; }
.tools, .transport { display: flex; align-items: center; gap: 2px; }
.icon { display: inline-grid; place-items: center; flex-shrink: 0; width: 37px; height: 36px; padding: 0; border: none; border-radius: 8px; background: transparent; color: #d3d9d3; }
.icon:hover, .actions button:not(.save):hover { background: #303631; color: white; }
svg:not(.symbols) { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.65; stroke-linecap: round; stroke-linejoin: round; pointer-events: none; }
.bottom-bar { bottom: max(12px, env(safe-area-inset-bottom)); inset-inline: 0; display: flex; justify-content: center; }
.transport { max-width: calc(100% - 12px); border: 1px solid #424a43; border-radius: 30px; background: #121613f5; padding: 5px 7px; box-shadow: 0 4px 18px #0008; }
.transport .primary { background: var(--mint); color: #13281a; border-radius: 18px; width: 45px; }
.transport .primary:hover { background: #a4f2c1; color: #0c2113; }
#reset { color: #f69c93; }
.phase-wrap { display: flex; align-items: center; gap: 4px; padding-inline-start: 5px; }
#lamp { display: block; width: 6px; height: 6px; border-radius: 50%; background: var(--mint); flex: 0 0 6px; }
#lamp.break { background: #99c9e7; }
select { color-scheme: dark; cursor: pointer; color: var(--text); background: #181d19; }
#phase { width: 92px; padding: 6px 1px; border: 0; background-color: transparent; font-size: 13px; }
select option { color: var(--text); background: #181d19; }
.divider { width: 1px; height: 18px; margin-inline: 4px; background: var(--line); }
#notice { position: fixed; z-index: 8; left: 50%; transform: translateX(-50%); top: 55px; max-width: 90vw; padding: 7px 12px; border-radius: 6px; background: #242b25; font-size: 13px; text-align: center; }
#notice:empty { display: none; }
noscript { position: fixed; inset: 40% 10% auto; text-align: center; }
@media (max-width: 265px) {
  .brand span, .divider { display: none; }.transport { gap: 0; padding-inline: 4px; }.phase-wrap { padding: 0; }
  .icon { width: 29px; height: 32px; }.transport .primary { width: 34px; }#phase { width: 73px; font-size: 11px; }
}
