:root {
  color-scheme: dark;
  --bg: #100f18;
  --panel: #191722;
  --ink: #f4f0f5;
  --soft: #c3bdce;
  --muted: #ada6b9;
  --line: #34313f;
  --lilac: #dbc5ff;
  --sans: "Inter", "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
  --serif:
    "STIX Two Text", "Noto Serif CJK SC", "Songti SC", "Source Han Serif SC",
    "SimSun", serif;
}
* {
  box-sizing: border-box;
}
body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  background: radial-gradient(ellipse at 50% -65%, #332744 0%, var(--bg) 71%);
  font-family: var(--sans);
  font-size: 1rem;
  -webkit-font-smoothing: antialiased;
}
button {
  font: inherit;
  cursor: pointer;
  color: inherit;
  background: none;
  border: 0;
  -webkit-tap-highlight-color: transparent;
}
button:focus-visible,
a:focus-visible {
  outline: 2px solid #e9ccff;
  outline-offset: 3px;
}
button:disabled {
  opacity: 0.36;
  cursor: default;
}
[hidden] {
  display: none !important;
}
.icon-bank {
  position: absolute;
  width: 0;
  height: 0;
  overflow: hidden;
  pointer-events: none;
}
.icon {
  display: block;
  flex: none;
  width: 19px;
  height: 19px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.65;
  stroke-linecap: round;
  stroke-linejoin: round;
  pointer-events: none;
}
.mast,
main {
  max-width: 1740px;
  width: 100%;
  margin: auto;
  padding-inline: clamp(18px, 3.55vw, 68px);
}
.mast {
  height: clamp(68px, 8.8vh, 90px);
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.brand,
.mast nav,
.pill,
.quiet,
.round,
.zoom,
.tools-left,
.stage-actions,
.collection-head,
.collection-label,
.collection-options,
.panel-head,
.viewer-top {
  display: flex;
  align-items: center;
}
.brand {
  gap: 11px;
  color: #f3eafd;
}
.brand-flare {
  width: 38px;
  height: 38px;
  color: var(--lilac);
}
.wordmark {
  font:
    italic 2.15rem/1 Georgia,
    "Times New Roman",
    serif;
  letter-spacing: -0.065em;
  padding-right: 0.12em;
}
.mast nav {
  gap: 22px;
}
.pill,
.quiet,
.round,
.zoom {
  justify-content: center;
  transition:
    background 0.18s,
    color 0.18s,
    border-color 0.18s,
    transform 0.18s;
}
.pill {
  min-height: 44px;
  border-radius: 99px;
  padding: 0 19px;
  gap: 9px;
  font-size: 0.93rem;
  font-weight: 600;
  letter-spacing: 0.035em;
}
.primary {
  color: #2b1c3a;
  background: var(--lilac);
}
.primary:hover {
  background: #eadbff;
}
.primary:active,
.replay:active {
  transform: scale(0.97);
}
.quiet {
  color: var(--soft);
  min-height: 44px;
  gap: 8px;
  font-size: 0.9rem;
  padding: 0 3px;
}
.quiet:hover {
  color: #fff;
}
#help-button { min-width: 44px; flex-shrink: 0; }
.quiet .icon {
  width: 17px;
  height: 17px;
}
.stage {
  position: relative;
  isolation: isolate;
  height: clamp(420px, 62svh, 780px);
  overflow: hidden;
  border-radius: 20px;
  border: 1px solid #3a3447;
  background: #141124;
  box-shadow: 0 12px 45px #0002;
}
.stage canvas {
  display: block;
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  touch-action: none;
  cursor: grab;
}
.stage canvas:active {
  cursor: grabbing;
}
.stage-caption {
  position: absolute;
  z-index: 1;
  top: clamp(24px, 3.25vw, 54px);
  left: clamp(24px, 3.3vw, 58px);
  pointer-events: none;
  text-shadow: 0 2px 16px #141021;
}
.sky-meta {
  display: flex;
  align-items: center;
  gap: 12px;
}
.album-badge {
  position: relative;
  display: inline-flex;
  align-items: center;
  pointer-events: auto;
  border-radius: 20px;
  border: 1px solid #c8b6e43e;
  background: #211b32bc;
  color: #e3d5f0;
  font-size: 0.86rem;
  line-height: 1.2;
  letter-spacing: 0.08em;
}
.album-badge select {
  appearance: none;
  -webkit-appearance: none;
  min-height: 44px;
  border: 0;
  border-radius: inherit;
  padding: 7px 31px 7px 13px;
  font: inherit;
  background: transparent;
  color: inherit;
  cursor: pointer;
}
.album-badge select:focus-visible {
  outline: 2px solid var(--lilac);
  outline-offset: 3px;
}
.album-badge option {
  background: var(--panel);
  color: var(--ink);
}
.select-chevron {
  position: absolute;
  right: 10px;
  width: 13px;
  height: 13px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.6;
  pointer-events: none;
}
.pattern-name {
  color: #fff0df;
  font-size: 0.86rem;
  letter-spacing: 0.08em;
  text-shadow: 0 1px 3px #080611, 0 0 8px #100b19;
}
h1,
h2,
p {
  margin: 0;
}
.stage-caption h1, .stage-caption p {
  transition: opacity .25s ease;
}
.close-view .stage-caption h1, .close-view .stage-caption p {
  opacity: 0;
}
.stage-caption h1 {
  font: 500 clamp(44px, 4.65vw, 80px) / 1.2 var(--serif);
  letter-spacing: 0.07em;
  color: #fff7fa;
  margin: 13px 0 9px;
}
.stage-caption p {
  font-size: clamp(0.86rem, 1vw, 1.02rem);
  color: #d1c8da;
  letter-spacing: 0.045em;
}
.home-music {
  position: absolute;
  z-index: 2;
  top: clamp(24px, 3.25vw, 54px);
  right: clamp(16px, 2.4vw, 40px);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  min-height: 44px;
  padding: 0 13px;
  border: 1px solid #b9a2c554;
  border-radius: 99px;
  background: #171524db;
  color: #e8d9ed;
  font-size: .85rem;
  white-space: nowrap;
}
.home-music .icon { width: 15px; height: 15px; }
.home-music .music-on, .home-music[aria-pressed="true"] .music-off { display: none; }
.home-music[aria-pressed="true"] .music-on { display: block; }
.home-music[aria-pressed="true"] { color: #ffe1a7; border-color: #dfb57680; }
.gesture-tip {
  position: absolute;
  inset: auto 0 74px;
  color: #e3d9e8;
  text-align: center;
  font-size: .78rem;
  text-shadow: 0 1px 5px #090817;
  pointer-events: none;
  transition: opacity .55s;
}
.gesture-tip.dismissed, .close-view .gesture-tip { opacity: 0; }
.stage-actions {
  position: absolute;
  z-index: 2;
  left: clamp(16px, 2.4vw, 40px);
  right: clamp(16px, 2.4vw, 40px);
  bottom: clamp(16px, 2.1vw, 31px);
  justify-content: space-between;
  pointer-events: none;
}
.stage-actions button,
.zoom-group {
  pointer-events: auto;
}
.tools-left {
  gap: 10px;
}
.replay,
.round,
.zoom-group {
  border: 1px solid #c3aad04d;
  background: #1b1829d9;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}
.replay {
  color: #f2e7fb;
  font-size: 0.88rem;
  font-weight: 500;
  min-height: 44px;
  padding-inline: 16px;
}
.replay .icon {
  color: #dfbaff;
}
.replay:hover,
.round:hover,
.zoom:hover {
  background: #3b3249;
}
.pill.phoenix { color: #ffe0aa; border-color: #e3bd7970; background: #2f2630e0; }
.round {
  width: 44px;
  height: 44px;
  flex: none;
  border-radius: 50%;
  padding: 0;
}
.zoom-group {
  display: flex;
  border-radius: 50px;
  padding: 0 2px;
}
.zoom {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  color: #e6dced;
}
.collection {
  padding: 24px 0 25px;
}
.collection-head {
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 13px;
}
.collection-label {
  gap: 13px;
}
.collection-label h2,
.panel-head h2 {
  font: 500 1.48rem/1.3 var(--serif);
  letter-spacing: 0.065em;
}
#photo-count {
  font-size: 0.84rem;
  color: var(--muted);
  border-left: 1px solid #46404f;
  padding-left: 12px;
}
.collection-options {
  gap: 20px;
}
.filmstrip {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: clamp(130px, 12.5vw, 224px);
  gap: 12px;
  overflow-x: auto;
  overscroll-behavior-inline: contain;
  scroll-snap-type: x proximity;
  padding: 3px 3px 9px;
  margin-inline: -3px;
  scrollbar-width: thin;
  scrollbar-color: #49414f transparent;
}
.photo-tile {
  position: relative;
  padding: 0;
  text-align: start;
  min-width: 0;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 8px;
  border: 0;
  background: transparent;
  scroll-snap-align: start;
}
.photo-tile .frame {
  display: block;
  position: relative;
  aspect-ratio: 1.7;
  overflow: hidden;
  isolation: isolate;
  background: #24212d;
  border-radius: 9px;
}
.frame::after {
  content: "";
  position: absolute;
  inset: 0;
  border: 1px solid #f1e5ff24;
  border-radius: inherit;
  transition: border-color 0.2s;
}
.photo-tile img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition:
    transform 0.3s,
    filter 0.3s;
}
.photo-tile:hover img {
  transform: scale(1.05);
  filter: brightness(1.12);
}
.photo-tile:hover .frame::after {
  border-color: #e2c7ffa8;
}
.tile-name {
  font-size: 0.84rem;
  letter-spacing: 0.025em;
  line-height: 1.4;
  color: var(--soft);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
dialog {
  color: var(--ink);
  font-family: var(--sans);
}
dialog::backdrop {
  background: #090714cd;
  backdrop-filter: blur(9px);
}
.panel,
#lightbox {
  border: 1px solid #484052;
  border-radius: 20px;
  background: #191621;
  box-shadow: 0 25px 100px #0009;
  padding: 0;
}
.panel {
  width: min(790px, calc(100vw - 32px));
  max-height: 85dvh;
}
.panel-head {
  position: sticky;
  top: 0;
  z-index: 2;
  background: #191621;
  justify-content: space-between;
  padding: 17px 23px;
  border-bottom: 1px solid var(--line);
}
.panel-head .round {
  width: 44px;
  height: 44px;
}
.guide-panel {
  width: min(480px, calc(100vw - 24px));
  max-height: calc(100dvh - 24px);
}
.guide-panel .panel-head {
  padding: 8px 12px 8px 18px;
}
.guide-panel h2 {
  font: 500 1.3rem/1.4 var(--serif);
}
.help-body {
  padding: 20px;
}
.help-body p {
  text-wrap: pretty;
  font-size: 0.95rem;
  line-height: 1.7;
  color: var(--soft);
}
.help-body p + p {
  margin-top: 17px;
}
.help-body strong {
  display: block;
  color: var(--ink);
  font-size: 1rem;
  margin-bottom: 2px;
}
.all-photos {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 21px 13px;
  padding: 22px;
}
#lightbox {
  width: min(1000px, calc(100vw - 30px));
  max-height: 92dvh;
  overflow: auto;
}
.viewer-top {
  justify-content: space-between;
  padding: 12px 17px;
}
.viewer-top span {
  font-size: 0.85rem;
  color: var(--soft);
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.075em;
}
.viewer-image {
  position: relative;
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 100px;
  background: #0c0b10;
}
#full-photo {
  display: block;
  max-width: 100%;
  width: auto;
  height: auto;
  max-height: 65dvh;
  object-fit: contain;
  cursor: zoom-out;
  touch-action: pan-y;
}
.viewer-image button {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  z-index: 1;
}
.previous {
  left: 12px;
}
.next {
  right: 12px;
}
.viewer-caption {
  padding: 15px 20px 17px;
}
.viewer-caption h2 {
  font: 500 1.24rem/1.35 var(--serif);
  overflow-wrap: anywhere;
}
.viewer-caption p {
  font-size: 0.81rem;
  color: var(--muted);
  line-height: 1.5;
  overflow-wrap: anywhere;
}
.viewer-caption p:not(:empty) {
  margin-top: 5px;
}
.viewer-caption a {
  color: #d4b7ef;
}
.viewer-caption .license { white-space: nowrap; }
.panel, #lightbox { scrollbar-color: #665b72 #191621; scrollbar-width: thin; }
.import-note { margin-top: 6px; color: #f2d7ab; font-size: .86rem; line-height: 1.6; }
#toast {
  position: fixed;
  z-index: 8;
  left: 50%;
  bottom: max(18px, env(safe-area-inset-bottom));
  transform: translateX(-50%);
  max-width: min(90vw, 600px);
  width: max-content;
  border-radius: 15px;
  background: #2b2437;
  color: var(--ink);
  box-shadow: 0 4px 28px #0005;
  font-size: 0.9rem;
  line-height: 1.5;
}
#toast:not(:empty) {
  padding: 11px 18px;
  border: 1px solid #63516e;
}
@media (max-width: 650px) {
  .mast,
  main {
    padding-inline: 14px;
  }
  .mast {
    height: 66px;
  }
  .brand {
    gap: 7px;
  }
  .brand-flare {
    width: 31px;
    height: 31px;
  }
  .wordmark {
    font-size: 1.92rem;
  }
  .mast nav {
    gap: 10px;
  }
  .top-help {
    gap: 4px;
    white-space: nowrap;
  }
  .primary {
    padding-inline: 15px;
    font-size: 0.89rem;
  }
  .stage {
    height: clamp(408px, 64svh, 640px);
    border-radius: 16px;
  }
  .stage-caption {
    left: 14px;
    top: 12px;
  }
  .home-music { right: 11px; top: 12px; padding: 0 10px; gap: 5px; }
  .sky-meta { gap: 7px; }
  .stage-caption h1 {
    font-size: 2.55rem;
    margin: 8px 0 4px;
    letter-spacing: 0.06em;
  }
  .stage-caption p {
    font-size: 0.84rem;
  }
  .album-badge,
  .pattern-name {
    font-size: 0.82rem;
  }
  .stage-actions {
    left: 12px;
    right: 12px;
    bottom: 13px;
  }
  .tools-left {
    gap: 7px;
  }
  .pill.replay {
    padding-inline: 13px;
  }
  .collection {
    padding-top: 12px;
  }
  .collection-head {
    margin-bottom: 5px;
  }
  .collection-label {
    gap: 9px;
  }
  .collection-label h2 {
    font-size: 1.32rem;
  }
  #photo-count {
    padding-left: 9px;
  }
  .collection-options {
    gap: 10px;
  }
  .quiet {
    font-size: 0.82rem;
  }
  .filmstrip {
    grid-auto-columns: clamp(112px, 33vw, 155px);
    gap: 9px;
  }
  .tile-name {
    font-size: 0.78rem;
  }
  .all-photos {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    padding: 14px;
  }
  .viewer-image .round {
    width: 44px;
    height: 44px;
  }
  .viewer-image .previous {
    left: 5px;
  }
  .viewer-image .next {
    right: 5px;
  }
}
@media (max-width: 400px) {
  .top-help { min-width: 44px; flex: 0 0 44px; }
  .top-help span { display: none; }
  .top-help .icon { width: 21px; height: 21px; }
}
@media (max-width: 370px) {
  .brand-flare { width: 25px; height: 25px; }
  .wordmark { font-size: 1.58rem; }
  #choose-button { gap: 4px; flex-shrink: 0; white-space: nowrap; }
  .stage-caption { right: 12px; }
  .sky-meta .pattern-name { position: absolute; right: 0; top: 59px; }
  .brand-flare { width: 25px; height: 25px; }
  .wordmark { font-size: 1.58rem; }
  #choose-button { gap: 4px; flex-shrink: 0; white-space: nowrap; }
  .stage-caption { right: 12px; }
  .sky-meta .pattern-name { position: absolute; right: 0; top: 59px; }
  .stage-actions { left: 8px; right: 8px; }
  .tools-left { gap: 4px; }
  .tools-left .pill { padding-inline: 8px; gap: 4px; }
  .tools-left .replay .icon { display: none; }
  .mast nav {
    gap: 6px;
  }
  .mast .primary {
    padding-inline: 10px;
  }
}
@media (max-height: 520px) and (orientation: landscape) {
  .mast {
    height: 54px;
  }
  .stage {
    height: clamp(290px, 72svh, 400px);
  }
  .stage-caption {
    top: 14px;
  }
  .stage-caption h1 {
    font-size: 2.4rem;
  }
  .stage-actions {
    bottom: 10px;
  }
  .collection {
    padding-top: 8px;
  }
}
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    transition: none !important;
    animation: none !important;
  }
}
