:root {
  --bg: #050508;
  --ink: rgba(255, 255, 255, 0.82);
  --mute: rgba(255, 255, 255, 0.52);
}
*, *::before, *::after { box-sizing: border-box; }
html, body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: "SF Pro Display", "SF Pro Text", system-ui, -apple-system, "Segoe UI", sans-serif;
  -webkit-font-smoothing: antialiased;
}
html, body { overflow-x: hidden; }
html.is-scrubbing, body.is-scrubbing { overflow: hidden; touch-action: none; }
.nav {
  position: fixed;
  top: max(0.9rem, calc(env(safe-area-inset-top) + 0.55rem));
  left: max(0.9rem, calc(env(safe-area-inset-left) + 0.55rem));
  z-index: 30;
}

.nav-btn {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  width: 2.45rem;
  height: 2.45rem;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  padding: 0.58rem 0.52rem;
  margin: 0;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 0.72rem;
  background: transparent;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.28),
    0 10px 28px rgba(0, 0, 0, 0.28);
  cursor: pointer;
}

.nav-btn::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  border-radius: inherit;
  background: rgba(255, 255, 255, 0.07);
  backdrop-filter: blur(22px) saturate(1.55);
  -webkit-backdrop-filter: blur(22px) saturate(1.55);
  pointer-events: none;
}

.nav-btn span {
  display: block;
  width: 100%;
  height: 1.5px;
  flex: 0 0 1.5px;
  border-radius: 2px;
  background: rgba(255, 255, 255, 0.82);
  transform-origin: center;
  transition: transform 0.22s ease, opacity 0.18s ease;
}

.nav.is-open .nav-btn span:nth-of-type(1) { transform: translateY(6.5px) rotate(45deg); }
.nav.is-open .nav-btn span:nth-of-type(2) {
  opacity: 0;
  visibility: hidden;
  transform: scaleX(0);
}
.nav.is-open .nav-btn span:nth-of-type(3) { transform: translateY(-6.5px) rotate(-45deg); }

.nav-list {
  position: relative;
  isolation: isolate;
  margin: 0.45rem 0 0;
  padding: 0.32rem;
  list-style: none;
  min-width: 10.6rem;
  background: transparent;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 0.85rem;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.16),
    0 14px 32px rgba(0, 0, 0, 0.34);
}

.nav-list::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  border-radius: inherit;
  background: rgba(8, 8, 14, 0.72);
  backdrop-filter: blur(22px) saturate(1.55);
  -webkit-backdrop-filter: blur(22px) saturate(1.55);
  pointer-events: none;
}

.nav-list a {
  display: block;
  padding: 0.55rem 0.72rem;
  color: rgba(255, 255, 255, 0.82);
  text-decoration: none;
  border-radius: 0.58rem;
  font-size: 0.92rem;
  letter-spacing: 0.01em;
}

.nav-list a:hover {
  color: rgba(255, 255, 255, 0.96);
  background: rgba(255, 255, 255, 0.08);
}

.nav-btn:focus-visible,
.nav-list a:focus-visible {
  outline: 2px solid rgba(190, 220, 255, 0.7);
  outline-offset: 2px;
}
.page { max-width: none; margin: 0 auto; padding: 4.4rem 1rem 1.5rem; }
.cluster { width: 100%; }
.lead { flex: 0 0 auto; }
.lead h1 { margin: 0 0 0.25rem; font-size: clamp(1.7rem, 5vw, 2.6rem); font-weight: 560; letter-spacing: -0.03em; }
.meta, .hint { margin: 0 0 0.3rem; color: var(--mute); line-height: 1.45; }
.meta { font-size: 0.92rem; }
.pick { margin: 0.45rem 0 0; height: 3.35rem; overflow: hidden; color: var(--ink); }
.pick strong { display: block; font-size: 1.05rem; margin-bottom: 0.15rem; }
.board { display: flex; flex-direction: column; }
.stage {
  margin-top: 0.45rem;
  width: max-content;
  max-width: 100%;
  display: flex;
  flex-direction: column;
}
.transport {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 0.4rem;
  margin-top: 0.4rem;
  min-width: 0;
  width: 100%;
}
.transport-controls {
  display: flex;
  flex-wrap: nowrap;
  align-items: center;
  gap: 0.4rem 0.55rem;
  min-width: 0;
  width: 100%;
}
.transport button {
  flex: 0 0 auto;
  margin: 0;
  padding: 0.32rem 0.62rem;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 0.5rem;
  background: rgba(255, 255, 255, 0.07);
  color: var(--ink);
  font: inherit;
  font-size: 0.86rem;
  letter-spacing: 0.01em;
  cursor: pointer;
  touch-action: manipulation;
}
.transport button:hover { background: rgba(255, 255, 255, 0.12); color: #fff; }
.transport button:focus-visible {
  outline: 2px solid rgba(190, 220, 255, 0.7);
  outline-offset: 2px;
}
.fps {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  gap: 0.35rem;
  margin: 0;
  padding: 0.22rem 0.45rem;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 0.5rem;
  background: rgba(255, 255, 255, 0.07);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.16);
  cursor: pointer;
}
.fps input[type="range"] {
  width: 4.2rem;
  margin: 0;
  accent-color: #fb923c;
}
.fps-label {
  flex: 0 0 auto;
  min-width: 3.4rem;
  color: var(--mute);
  font-size: 0.82rem;
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.01em;
  white-space: nowrap;
}
.fps:focus-within {
  outline: 2px solid rgba(190, 220, 255, 0.7);
  outline-offset: 2px;
}
.scrub {
  flex: 0 0 auto;
  min-width: 0;
  width: 100%;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin: 0;
}
.scrub-track {
  position: relative;
  flex: 1 1 auto;
  min-width: 0;
  width: 100%;
  height: 1.45rem;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.12);
  touch-action: none;
  cursor: pointer;
  user-select: none;
  -webkit-user-select: none;
}
.scrub-native {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  margin: 0;
  opacity: 0;
  pointer-events: none;
}
.scrub-track:focus-visible {
  outline: 2px solid rgba(190, 220, 255, 0.7);
  outline-offset: 2px;
}
.scrub-fill {
  position: absolute;
  left: 0;
  top: 50%;
  height: 4px;
  width: 0;
  transform: translateY(-50%);
  border-radius: 999px;
  background: #fb923c;
  pointer-events: none;
}
.scrub-thumb {
  position: absolute;
  top: 50%;
  left: 0;
  width: 1rem;
  height: 1rem;
  margin-left: -0.5rem;
  transform: translateY(-50%);
  border-radius: 50%;
  background: #fb923c;
  box-shadow: 0 0 0 2px rgba(5, 5, 8, 0.55);
  pointer-events: none;
}
.scrub-track.is-scrubbing {
  cursor: grabbing;
}
.playhead {
  flex: 0 0 auto;
  min-width: 7.2rem;
  color: var(--mute);
  font-size: 0.82rem;
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.01em;
  white-space: nowrap;
}
body.is-timeline .heights { display: none; }
body.is-timeline .inc-block > summary { pointer-events: none; }
body.is-timeline .inc-block > summary::before { visibility: hidden; }
body.is-timeline .inc-block > summary .chk.inc { pointer-events: auto; }
body.is-timeline .hint-today { display: none; }
body:not(.is-timeline) .hint-timeline { display: none; }
canvas {
  display: block;
  flex-shrink: 0;
  touch-action: none; cursor: grab;
  background: #0a0a10; border-radius: 10px;
  aspect-ratio: 1 / 1;
}
canvas.drag { cursor: grabbing; }
.side { width: 100%; }
.filters {
  display: flex; flex-direction: column; align-items: flex-start;
  gap: 0.15rem; margin-top: 1rem;
}
@media (orientation: landscape) {
  html, body { height: 100svh; height: 100dvh; overflow: hidden; }
  .page {
    height: 100svh;
    height: 100dvh;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0.4rem 0.6rem 0.4rem 3.6rem;
  }
  .cluster {
    width: max-content;
    max-width: 100%;
    max-height: 100%;
    display: flex;
    flex-direction: column;
    min-height: 0;
  }
  .lead { width: 100%; }
  .board {
    flex-direction: row;
    align-items: center;
    gap: 1.1rem;
    min-height: 0;
  }
  .stage { margin-top: 0; flex: 0 0 auto; display: flex; flex-direction: column; }
  .side {
    width: 22rem;
    max-width: 42vw;
    flex-shrink: 0;
    max-height: 100%;
    overflow-x: hidden;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior: contain;
  }
  .filters { margin-top: 0; }
  .lead h1 { font-size: 1.7rem; }
  .pick { height: 3.35rem; }
}
@media (orientation: landscape) and (max-height: 560px) {
  .lead { display: none; }
  .side { width: min(20rem, 40vw); }
  .playhead { min-width: 0; }
}
.chk {
  display: inline-flex; align-items: center; gap: 0.45rem;
  font-size: 1.08rem; color: var(--ink); cursor: pointer; user-select: none;
}
.chk input { width: 1.45em; height: 1.45em; accent-color: #f97316; }
.chk em { color: rgba(255, 255, 255, 0.34); font-style: normal; font-size: 0.92rem; margin-left: 0.15rem; }
.chk.all { font-weight: 560; padding: 0.2rem 0; }
.swatch {
  width: 0.7rem; height: 0.7rem; border-radius: 50%;
  display: inline-block; flex-shrink: 0;
}
.inc-block {
  width: 100%;
  border-top: 1px solid rgba(255,255,255,0.06);
  padding: 0.15rem 0 0.2rem;
}
.inc-block > summary {
  list-style: none;
  cursor: pointer;
  display: flex; align-items: center; gap: 0.35rem;
  padding: 0.28rem 0;
}
.inc-block > summary::-webkit-details-marker { display: none; }
.inc-block > summary::before {
  content: "▸";
  color: rgba(255,255,255,0.55);
  width: 1.2em; flex-shrink: 0;
  font-size: 2.05rem;
  line-height: 0.9;
}
.inc-block[open] > summary::before { content: "▾"; }
.inc-block .chk.inc { font-weight: 540; }
.heights {
  display: flex; flex-direction: column; gap: 0.18rem;
  padding: 0.1rem 0 0.35rem 1.7rem;
}
.hint {
  margin-top: 0.85rem;
  font-size: 0.94rem;
}
.hint p {
  display: block;
  margin: 0;
  white-space: normal;
}
.hint p + p { margin-top: 0.55rem; }
.hint a {
  display: inline;
  color: rgba(255, 255, 255, 0.58);
  text-underline-offset: 2px;
}
.hint a:hover { color: #fff; }
