:root {
  --bg-base: #0a0b0d;
  --gradient-start: #121418;
  --gradient-end: #07080a;
  --text-primary: #f4f1ea;
  --text-secondary: rgba(244, 241, 234, 0.66);
  --text-tertiary: rgba(244, 241, 234, 0.42);
  --panel-bg: rgba(10, 11, 13, 0.28);
  --panel-strong: rgba(10, 11, 13, 0.56);
  --panel-border: rgba(255, 255, 255, 0.08);
  --panel-border-strong: rgba(255, 255, 255, 0.12);
  --overlay: rgba(5, 6, 8, 0.28);
  --accent: #d8d0c4;
  --slider-fill: 0%;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html,
body {
  width: 100%;
  height: 100%;
  margin: 0;
  overflow: hidden;
}

body {
  position: relative;
  min-height: 100dvh;
  background: var(--bg-base);
  color: var(--text-primary);
  font-family:
    "SF Pro Display",
    "Inter",
    "Segoe UI",
    "Helvetica Neue",
    Arial,
    sans-serif;
  overflow: clip;
}

body.is-idle-cursor,
body.is-idle-cursor * {
  cursor: none !important;
}

button,
input,
select {
  font: inherit;
}

button {
  cursor: pointer;
}

[hidden] {
  display: none !important;
}

.background,
.background-gradient,
.background-image,
.background-video,
.background-overlay {
  position: absolute;
  inset: 0;
}

.background {
  position: fixed;
  overflow: hidden;
  cursor: pointer;
}

.background-gradient {
  background: linear-gradient(160deg, var(--gradient-start), var(--gradient-end));
}

.background-image,
.background-video {
  opacity: 0;
  transition: opacity 220ms ease;
}

.background-image.is-visible,
.background-video.is-visible {
  opacity: 1;
}

.background-image {
  overflow: hidden;
}

.background-image-media,
.background-video {
  position: absolute;
  left: var(--bg-media-left, 0%);
  top: var(--bg-media-top, 0%);
  width: var(--bg-media-width, 100%);
  height: var(--bg-media-height, 100%);
  object-fit: fill;
  transform: none;
}

.background-preview-media {
  position: absolute;
  left: var(--preview-media-left, 0%);
  top: var(--preview-media-top, 0%);
  width: var(--preview-media-width, 100%);
  height: var(--preview-media-height, 100%);
  object-fit: fill;
  transform: none;
  pointer-events: none;
}

.background-video {
  inset: auto;
  --bg-offset-x: var(--video-offset-x, 0%);
  --bg-offset-y: var(--video-offset-y, 0%);
  --bg-zoom: var(--video-zoom, 1);
}

.background-overlay {
  background:
    linear-gradient(180deg, rgba(0, 0, 0, 0.14), rgba(0, 0, 0, 0.24)),
    var(--overlay);
}

.app {
  --app-padding: clamp(20px, 3vw, 42px);
  position: relative;
  z-index: 1;
  width: 100vw;
  height: 100dvh;
  padding: var(--app-padding);
  pointer-events: none;
}

.clock {
  position: absolute;
  inset: 43% auto auto 50%;
  width: min(100%, calc(100vw - (var(--app-padding) * 2)));
  display: grid;
  place-items: center;
  align-content: center;
  gap: 12px;
  text-align: center;
  padding: 0 clamp(12px, 4vw, 48px);
  pointer-events: none;
  border-radius: 28px;
  transform: translate(-50%, -50%);
}

.clock-time {
  display: block;
  max-width: 100%;
  font-size: clamp(4.4rem, 11vw, 9rem);
  line-height: 0.92;
  letter-spacing: -0.09em;
  font-weight: 300;
  font-variant-numeric: tabular-nums lining-nums;
  white-space: nowrap;
  pointer-events: auto;
  cursor: pointer;
}

.clock-date {
  max-width: min(88vw, 740px);
  color: var(--text-secondary);
  font-size: clamp(1rem, 1.8vw, 1.35rem);
  line-height: 1.2;
  letter-spacing: 0.02em;
}

.clock-time:focus-visible {
  outline: 1px solid rgba(255, 255, 255, 0.2);
  outline-offset: 6px;
  border-radius: 18px;
}

.clock:hover .clock-date {
  color: rgba(244, 241, 234, 0.78);
}

.clock[data-clock-style="serene"] .clock-time {
  font-weight: 300;
  letter-spacing: -0.09em;
}

.clock[data-clock-style="serene"] .clock-date {
  letter-spacing: 0.02em;
  text-transform: none;
}

.clock[data-clock-style="editorial"] .clock-time {
  font-size: clamp(4.6rem, 10.8vw, 9.4rem);
  font-weight: 250;
  letter-spacing: -0.13em;
}

.clock[data-clock-style="editorial"] .clock-date {
  font-size: clamp(0.78rem, 1.05vw, 0.92rem);
  letter-spacing: 0.22em;
  text-transform: uppercase;
}

.clock[data-clock-style="mono"] .clock-time,
.clock-style-option[data-style="mono"] .clock-style-time,
.clock-style-current-preview[data-style="mono"] .clock-style-time,
.clock[data-clock-style="mono"] .clock-date,
.clock-style-option[data-style="mono"] .clock-style-date,
.clock-style-current-preview[data-style="mono"] .clock-style-date {
  font-family:
    "SFMono-Regular",
    "SF Mono",
    "Menlo",
    "Consolas",
    monospace;
}

.clock[data-clock-style="mono"] .clock-time {
  font-size: clamp(4rem, 9.8vw, 8.4rem);
  font-weight: 500;
  letter-spacing: -0.06em;
}

.clock[data-clock-style="mono"] .clock-date {
  font-size: clamp(0.88rem, 1.25vw, 1rem);
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.clock[data-clock-style="frame"] .clock-time {
  padding: 0.16em 0.2em 0.22em;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 0.34em;
  background: rgba(255, 255, 255, 0.04);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.03);
}

.clock[data-clock-style="frame"] .clock-date {
  font-size: clamp(0.92rem, 1.35vw, 1.08rem);
  letter-spacing: 0.08em;
}

.clock[data-clock-style="roman"] .clock-time,
.clock-style-option[data-style="roman"] .clock-style-time,
.clock-style-current-preview[data-style="roman"] .clock-style-time,
.clock[data-clock-style="roman"] .clock-date,
.clock-style-option[data-style="roman"] .clock-style-date,
.clock-style-current-preview[data-style="roman"] .clock-style-date {
  font-family:
    "Iowan Old Style",
    "Palatino Linotype",
    "Book Antiqua",
    "Times New Roman",
    ui-serif,
    serif;
}

.clock[data-clock-style="roman"] .clock-time {
  font-size: clamp(4.2rem, 10vw, 8.9rem);
  font-weight: 400;
  letter-spacing: -0.1em;
}

.clock[data-clock-style="roman"] .clock-date {
  font-size: clamp(0.84rem, 1.1vw, 0.98rem);
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.clock[data-clock-style="rounded"] .clock-time,
.clock-style-option[data-style="rounded"] .clock-style-time,
.clock-style-current-preview[data-style="rounded"] .clock-style-time,
.clock[data-clock-style="rounded"] .clock-date,
.clock-style-option[data-style="rounded"] .clock-style-date,
.clock-style-current-preview[data-style="rounded"] .clock-style-date {
  font-family:
    ui-rounded,
    "SF Pro Rounded",
    "Avenir Next Rounded",
    "Arial Rounded MT Bold",
    "Helvetica Rounded",
    sans-serif;
}

.clock[data-clock-style="rounded"] .clock-time {
  font-size: clamp(4.2rem, 10.6vw, 8.8rem);
  font-weight: 500;
  letter-spacing: -0.08em;
}

.clock[data-clock-style="rounded"] .clock-date {
  font-size: clamp(0.92rem, 1.4vw, 1.08rem);
  letter-spacing: 0.04em;
}

.clock[data-clock-style="display"] .clock-time {
  font-size: clamp(4.9rem, 11.8vw, 10rem);
  font-weight: 200;
  letter-spacing: -0.16em;
  text-transform: uppercase;
}

.clock[data-clock-style="display"] .clock-date {
  font-size: clamp(0.74rem, 0.98vw, 0.88rem);
  letter-spacing: 0.28em;
  text-transform: uppercase;
}

.clock[data-clock-style="condensed"] .clock-time,
.clock-style-option[data-style="condensed"] .clock-style-time,
.clock-style-current-preview[data-style="condensed"] .clock-style-time,
.clock[data-clock-style="condensed"] .clock-date,
.clock-style-option[data-style="condensed"] .clock-style-date,
.clock-style-current-preview[data-style="condensed"] .clock-style-date {
  font-family:
    "Arial Narrow",
    "Aptos Narrow",
    "Roboto Condensed",
    "Helvetica Neue",
    Arial,
    sans-serif;
}

.clock[data-clock-style="condensed"] .clock-time {
  font-size: clamp(4.6rem, 10vw, 8.8rem);
  font-weight: 400;
  letter-spacing: -0.14em;
}

.clock[data-clock-style="condensed"] .clock-date {
  font-size: clamp(0.8rem, 1.05vw, 0.94rem);
  letter-spacing: 0.18em;
  text-transform: uppercase;
}

.clock[data-clock-style="capsule"] .clock-time {
  padding: 0.12em 0.28em 0.18em;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.045);
  box-shadow:
    inset 0 0 0 1px rgba(255, 255, 255, 0.05),
    0 18px 40px rgba(0, 0, 0, 0.08);
}

.clock[data-clock-style="capsule"] .clock-date {
  font-size: clamp(0.86rem, 1.2vw, 1rem);
  letter-spacing: 0.08em;
}

.clock[data-clock-style="heritage"] .clock-time,
.clock-style-option[data-style="heritage"] .clock-style-time,
.clock-style-current-preview[data-style="heritage"] .clock-style-time {
  font-family:
    "Baskerville",
    "Iowan Old Style",
    "Palatino Linotype",
    "Times New Roman",
    ui-serif,
    serif;
}

.clock[data-clock-style="heritage"] .clock-time {
  font-size: clamp(4.35rem, 10.2vw, 9rem);
  font-weight: 400;
  letter-spacing: -0.11em;
}

.clock[data-clock-style="heritage"] .clock-date {
  font-size: clamp(0.8rem, 1.06vw, 0.96rem);
  letter-spacing: 0.22em;
  text-transform: uppercase;
}

.clock[data-clock-style="signal"] .clock-time {
  font-size: clamp(4.2rem, 10.2vw, 8.7rem);
  font-weight: 450;
  letter-spacing: -0.1em;
}

.clock[data-clock-style="signal"] .clock-date,
.clock-style-option[data-style="signal"] .clock-style-date,
.clock-style-current-preview[data-style="signal"] .clock-style-date {
  font-family:
    "SFMono-Regular",
    "SF Mono",
    "Menlo",
    "Consolas",
    monospace;
  font-size: clamp(0.78rem, 1.02vw, 0.92rem);
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.clock[data-clock-style="digital"] .clock-time,
.clock-style-option[data-style="digital"] .clock-style-time,
.clock-style-current-preview[data-style="digital"] .clock-style-time,
.clock[data-clock-style="digital"] .clock-date,
.clock-style-option[data-style="digital"] .clock-style-date,
.clock-style-current-preview[data-style="digital"] .clock-style-date {
  font-family:
    "SFMono-Regular",
    "SF Mono",
    "Menlo",
    "Consolas",
    monospace;
}

.clock[data-clock-style="digital"] .clock-time {
  font-size: clamp(3.9rem, 9.5vw, 8.1rem);
  font-weight: 600;
  letter-spacing: -0.04em;
  padding: 0.1em 0.16em 0.14em;
  border-radius: 0.28em;
  background: rgba(255, 255, 255, 0.03);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.05);
}

.clock[data-clock-style="digital"] .clock-date {
  font-size: clamp(0.8rem, 1vw, 0.94rem);
  letter-spacing: 0.18em;
  text-transform: uppercase;
}

.clock-style-modal {
  width: min(1080px, calc(100vw - 36px));
}

.clock-style-hero {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(300px, 360px);
  gap: 16px;
}

.clock-style-hero-copy,
.clock-style-current {
  display: grid;
  gap: 14px;
  padding: 20px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 22px;
  background:
    radial-gradient(circle at top left, rgba(255, 255, 255, 0.055), transparent 52%),
    rgba(255, 255, 255, 0.03);
}

.clock-style-hero-title {
  margin: 0;
  max-width: 26ch;
  font-size: clamp(1.18rem, 2vw, 1.62rem);
  line-height: 1.08;
  letter-spacing: -0.04em;
  font-weight: 500;
}

.clock-style-current-head,
.clock-style-option-head,
.clock-style-label-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.clock-style-current-name {
  font-size: 1.06rem;
  line-height: 1.1;
  letter-spacing: -0.02em;
  font-weight: 500;
}

.clock-style-current-description {
  margin: 0;
  color: var(--text-secondary);
  font-size: 0.88rem;
  line-height: 1.45;
}

.clock-style-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

.clock-style-option {
  position: relative;
  display: grid;
  gap: 14px;
  width: 100%;
  padding: 16px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 22px;
  color: var(--text-primary);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.035), rgba(255, 255, 255, 0.02)),
    rgba(255, 255, 255, 0.02);
  text-align: left;
  overflow: hidden;
  transition:
    transform 160ms ease,
    border-color 160ms ease,
    background-color 160ms ease;
}

.clock-style-option:hover {
  transform: translateY(-1px);
  border-color: rgba(255, 255, 255, 0.14);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.05), rgba(255, 255, 255, 0.025)),
    rgba(255, 255, 255, 0.03);
}

.clock-style-option.is-active {
  border-color: rgba(255, 255, 255, 0.2);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.06), rgba(255, 255, 255, 0.03)),
    rgba(255, 255, 255, 0.04);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.04);
}

.clock-style-preview {
  display: grid;
  gap: 8px;
  min-height: 154px;
  padding: 22px;
  border-radius: 18px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background:
    radial-gradient(circle at top center, rgba(255, 255, 255, 0.065), transparent 54%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.025), rgba(255, 255, 255, 0.015)),
    rgba(255, 255, 255, 0.02);
  align-content: center;
  text-align: center;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.015);
}

.clock-style-current-preview {
  min-height: 168px;
}

.clock-style-time {
  font-size: 2.8rem;
  line-height: 0.94;
  font-weight: 300;
  letter-spacing: -0.08em;
  font-variant-numeric: tabular-nums lining-nums;
  white-space: nowrap;
}

.clock-style-date {
  color: var(--text-secondary);
  font-size: 0.82rem;
  line-height: 1.2;
  letter-spacing: 0.06em;
}

.clock-style-meta,
.clock-style-state {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 0 10px;
  border-radius: 999px;
  font-size: 0.7rem;
  line-height: 1;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.clock-style-meta {
  color: var(--text-tertiary);
  background: rgba(255, 255, 255, 0.035);
}

.clock-style-state {
  color: var(--text-secondary);
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.025);
}

.clock-style-state.is-active {
  color: var(--text-primary);
  border-color: rgba(255, 255, 255, 0.14);
  background: rgba(255, 255, 255, 0.06);
}

.clock-style-option[data-style="editorial"] .clock-style-time,
.clock-style-current-preview[data-style="editorial"] .clock-style-time {
  font-size: 3rem;
  font-weight: 250;
  letter-spacing: -0.12em;
}

.clock-style-option[data-style="editorial"] .clock-style-date,
.clock-style-current-preview[data-style="editorial"] .clock-style-date {
  font-size: 0.72rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}

.clock-style-option[data-style="frame"] .clock-style-time,
.clock-style-current-preview[data-style="frame"] .clock-style-time {
  padding: 0.16em 0.22em 0.22em;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 0.42em;
  background: rgba(255, 255, 255, 0.04);
}

.clock-style-option[data-style="roman"] .clock-style-time,
.clock-style-option[data-style="roman"] .clock-style-date {
  font-family:
    "Iowan Old Style",
    "Palatino Linotype",
    "Book Antiqua",
    "Times New Roman",
    ui-serif,
    serif;
}

.clock-style-option[data-style="roman"] .clock-style-time,
.clock-style-current-preview[data-style="roman"] .clock-style-time {
  font-size: 2.9rem;
  font-weight: 400;
  letter-spacing: -0.1em;
}

.clock-style-option[data-style="roman"] .clock-style-date,
.clock-style-current-preview[data-style="roman"] .clock-style-date {
  font-size: 0.7rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.clock-style-option[data-style="rounded"] .clock-style-time,
.clock-style-option[data-style="rounded"] .clock-style-date {
  font-family:
    ui-rounded,
    "SF Pro Rounded",
    "Avenir Next Rounded",
    "Arial Rounded MT Bold",
    "Helvetica Rounded",
    sans-serif;
}

.clock-style-option[data-style="rounded"] .clock-style-time,
.clock-style-current-preview[data-style="rounded"] .clock-style-time {
  font-size: 2.8rem;
  font-weight: 500;
  letter-spacing: -0.08em;
}

.clock-style-option[data-style="display"] .clock-style-time,
.clock-style-current-preview[data-style="display"] .clock-style-time {
  font-size: 3.1rem;
  font-weight: 200;
  letter-spacing: -0.15em;
  text-transform: uppercase;
}

.clock-style-option[data-style="display"] .clock-style-date,
.clock-style-current-preview[data-style="display"] .clock-style-date {
  font-size: 0.72rem;
  letter-spacing: 0.22em;
  text-transform: uppercase;
}

.clock-style-option[data-style="condensed"] .clock-style-time,
.clock-style-current-preview[data-style="condensed"] .clock-style-time,
.clock-style-option[data-style="condensed"] .clock-style-date,
.clock-style-current-preview[data-style="condensed"] .clock-style-date {
  font-family:
    "Arial Narrow",
    "Aptos Narrow",
    "Roboto Condensed",
    "Helvetica Neue",
    Arial,
    sans-serif;
}

.clock-style-option[data-style="condensed"] .clock-style-time,
.clock-style-current-preview[data-style="condensed"] .clock-style-time {
  font-size: 2.85rem;
  font-weight: 400;
  letter-spacing: -0.14em;
}

.clock-style-option[data-style="condensed"] .clock-style-date,
.clock-style-current-preview[data-style="condensed"] .clock-style-date {
  font-size: 0.7rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}

.clock-style-option[data-style="capsule"] .clock-style-time,
.clock-style-current-preview[data-style="capsule"] .clock-style-time {
  padding: 0.14em 0.24em 0.18em;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.045);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.05);
}

.clock-style-option[data-style="capsule"] .clock-style-date,
.clock-style-current-preview[data-style="capsule"] .clock-style-date {
  font-size: 0.72rem;
  letter-spacing: 0.08em;
}

.clock-style-option[data-style="heritage"] .clock-style-time,
.clock-style-current-preview[data-style="heritage"] .clock-style-time {
  font-family:
    "Baskerville",
    "Iowan Old Style",
    "Palatino Linotype",
    "Times New Roman",
    ui-serif,
    serif;
  font-size: 2.95rem;
  font-weight: 400;
  letter-spacing: -0.11em;
}

.clock-style-option[data-style="heritage"] .clock-style-date,
.clock-style-current-preview[data-style="heritage"] .clock-style-date {
  font-size: 0.68rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
}

.clock-style-option[data-style="signal"] .clock-style-time,
.clock-style-current-preview[data-style="signal"] .clock-style-time {
  font-size: 2.7rem;
  font-weight: 500;
  letter-spacing: -0.1em;
}

.clock-style-option[data-style="signal"] .clock-style-date,
.clock-style-current-preview[data-style="signal"] .clock-style-date {
  font-family:
    "SFMono-Regular",
    "SF Mono",
    "Menlo",
    "Consolas",
    monospace;
  font-size: 0.68rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.clock-style-option[data-style="digital"] .clock-style-time,
.clock-style-option[data-style="digital"] .clock-style-date {
  font-family:
    "SFMono-Regular",
    "SF Mono",
    "Menlo",
    "Consolas",
    monospace;
}

.clock-style-option[data-style="digital"] .clock-style-time,
.clock-style-current-preview[data-style="digital"] .clock-style-time {
  font-size: 2.5rem;
  font-weight: 600;
  letter-spacing: -0.04em;
  padding: 0.16em 0.18em;
  border-radius: 0.36em;
  background: rgba(255, 255, 255, 0.04);
}

.clock-style-option[data-style="digital"] .clock-style-date,
.clock-style-current-preview[data-style="digital"] .clock-style-date {
  font-size: 0.68rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.clock-style-body {
  display: grid;
  gap: 8px;
}

.clock-style-label {
  font-size: 1.02rem;
  line-height: 1.2;
  letter-spacing: -0.02em;
  font-weight: 500;
}

.clock-style-description {
  color: var(--text-tertiary);
  font-size: 0.84rem;
  line-height: 1.45;
}

.player {
  position: absolute;
  left: 50%;
  bottom: var(--app-padding);
  width: min(560px, calc(100vw - (var(--app-padding) * 2)));
  display: grid;
  gap: 10px;
  padding: 14px 18px;
  border: 1px solid var(--panel-border);
  border-radius: 20px;
  background: var(--panel-bg);
  backdrop-filter: blur(10px);
  pointer-events: auto;
  cursor: pointer;
  transition:
    padding 180ms ease,
    gap 180ms ease,
    background-color 180ms ease,
    border-color 180ms ease;
  transform: translateX(-50%);
}

.player:hover,
.player.is-keyboard-expanded {
  gap: 14px;
  padding-top: 16px;
  padding-bottom: 16px;
}

.player-summary {
  display: grid;
  gap: 10px;
  min-width: 0;
}

.player-extra {
  display: grid;
  gap: 12px;
  max-height: 0;
  opacity: 0;
  overflow: hidden;
  visibility: hidden;
  pointer-events: none;
  transform: translateY(-8px);
  transition:
    max-height 220ms ease,
    opacity 160ms ease,
    transform 220ms ease,
    visibility 0s linear 220ms;
}

.player:hover .player-extra,
.player.is-keyboard-expanded .player-extra {
  max-height: 168px;
  opacity: 1;
  overflow: visible;
  visibility: visible;
  pointer-events: auto;
  transform: translateY(0);
  transition-delay: 0s;
}

.player:focus-visible,
.control-button:focus-visible,
.secondary-button:focus-visible,
.modal-close:focus-visible,
.background-option:focus-visible,
.clock-style-option:focus-visible,
.track-item:focus-visible,
.search-input:focus-visible,
.field-select select:focus-visible {
  outline: 1px solid rgba(255, 255, 255, 0.24);
  outline-offset: 2px;
}

.player.is-disconnected {
  border-color: rgba(255, 255, 255, 0.06);
}

.player-track {
  min-width: 0;
  color: var(--text-primary);
  font-size: 0.95rem;
  line-height: 1.2;
  letter-spacing: 0.01em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.player-times {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  color: var(--text-tertiary);
  font-size: 0.78rem;
  line-height: 1;
  font-variant-numeric: tabular-nums;
}

.player-controls,
.transport,
.volume,
.modal-header,
.music-toolbar {
  display: flex;
  align-items: center;
}

.player-controls {
  justify-content: space-between;
  gap: 16px;
}

.transport {
  gap: 8px;
}

.control-button,
.modal-close,
.secondary-button {
  border: 1px solid transparent;
  background: transparent;
  color: var(--text-secondary);
  transition:
    color 160ms ease,
    background-color 160ms ease,
    border-color 160ms ease;
}

.control-button:hover,
.modal-close:hover,
.secondary-button:hover {
  color: var(--text-primary);
  background: rgba(255, 255, 255, 0.04);
  border-color: rgba(255, 255, 255, 0.08);
}

.control-button {
  width: 38px;
  height: 38px;
  display: inline-grid;
  place-items: center;
  padding: 0;
  border-radius: 999px;
}

.control-button svg,
.volume svg {
  width: 18px;
  height: 18px;
}

.control-button-primary {
  color: var(--text-primary);
  border-color: rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.04);
}

.control-button:disabled {
  opacity: 0.45;
  cursor: default;
}

.volume {
  min-width: 140px;
  gap: 10px;
  color: var(--text-secondary);
}

@media (hover: none) {
  .player {
    gap: 14px;
    padding-top: 16px;
    padding-bottom: 16px;
  }

  .player-extra {
    max-height: 168px;
    overflow: visible;
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
    transform: translateY(0);
  }
}

.slider {
  appearance: none;
  height: 4px;
  border-radius: 999px;
  outline: none;
  background: linear-gradient(
    90deg,
    var(--accent) var(--slider-fill),
    rgba(255, 255, 255, 0.14) 0
  );
}

.slider::-webkit-slider-thumb {
  appearance: none;
  width: 12px;
  height: 12px;
  border: 0;
  border-radius: 50%;
  background: var(--text-primary);
}

.slider::-moz-range-thumb {
  width: 12px;
  height: 12px;
  border: 0;
  border-radius: 50%;
  background: var(--text-primary);
}

.slider::-moz-range-track {
  height: 4px;
  background: transparent;
}

.slider:disabled {
  opacity: 0.45;
}

.slider-progress {
  width: 100%;
}

.slider-volume {
  width: 92px;
}

.modal-shell {
  position: fixed;
  inset: 0;
  z-index: 5;
  display: grid;
  place-items: center;
  padding: 18px;
  overflow: hidden;
}

.modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.42);
  backdrop-filter: blur(10px);
}

.modal {
  position: relative;
  z-index: 1;
  width: min(760px, calc(100vw - 36px));
  max-height: min(80dvh, 760px);
  display: grid;
  gap: 18px;
  padding: 20px;
  border: 1px solid var(--panel-border-strong);
  border-radius: 22px;
  background: var(--panel-strong);
  backdrop-filter: blur(20px);
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-gutter: stable;
}

.modal-header {
  justify-content: space-between;
  gap: 16px;
}

.modal-kicker {
  margin: 0 0 6px;
  color: var(--text-tertiary);
  font-size: 0.76rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.modal-title {
  margin: 0;
  font-size: 1.35rem;
  font-weight: 500;
  line-height: 1.1;
  letter-spacing: -0.03em;
}

.modal-close,
.secondary-button {
  border-radius: 999px;
}

.modal-close {
  width: 38px;
  height: 38px;
  display: inline-grid;
  place-items: center;
  padding: 0;
}

.modal-close span {
  font-size: 1.3rem;
  line-height: 1;
}

.modal-status,
.modal-note {
  margin: 0;
  color: var(--text-secondary);
  font-size: 0.94rem;
  line-height: 1.45;
}

.modal-actions,
.bridge-help {
  display: grid;
  gap: 12px;
}

.background-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.background-option {
  display: grid;
  gap: 10px;
  padding: 12px;
  border: 1px solid var(--panel-border);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.03);
  color: var(--text-primary);
  text-align: left;
}

.background-option.is-active {
  border-color: rgba(255, 255, 255, 0.2);
  background: rgba(255, 255, 255, 0.05);
}

.background-option-card {
  display: grid;
  gap: 10px;
  width: 100%;
  padding: 0;
  border: 0;
  color: inherit;
  background: transparent;
  text-align: left;
}

.background-option-card:focus-visible,
.danger-button:focus-visible {
  outline: 1px solid rgba(255, 255, 255, 0.24);
  outline-offset: 2px;
}

.background-preview {
  position: relative;
  height: 120px;
  overflow: hidden;
  border-radius: 14px;
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.background-meta {
  display: grid;
  gap: 4px;
}

.background-option-actions {
  display: flex;
  justify-content: space-between;
  gap: 10px;
}

.background-option-actions .secondary-button {
  padding: 8px 12px;
}

.background-option-actions .secondary-button[hidden] {
  display: none !important;
}

.background-preview-media {
  pointer-events: none;
}

.background-label {
  font-size: 0.96rem;
  line-height: 1.2;
}

.background-type {
  color: var(--text-tertiary);
  font-size: 0.78rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.secondary-button,
.upload-button {
  width: fit-content;
  padding: 10px 14px;
}

.danger-button {
  color: rgba(255, 207, 207, 0.9);
}

.modal-editor {
  display: grid;
  width: calc(100vw - 36px);
  max-width: calc(100vw - 36px);
  height: calc(100dvh - 36px);
  max-height: calc(100dvh - 36px);
  grid-template-rows: auto minmax(0, 1fr);
  gap: 18px;
  padding: clamp(20px, 2.6vw, 28px);
  overflow: hidden;
}

.background-editor-layout {
  min-height: 0;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(280px, 320px);
  gap: 18px;
}

.background-editor-stage-panel,
.background-editor-card {
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 24px;
  background: rgba(255, 255, 255, 0.03);
}

.background-editor-stage-panel {
  min-height: 0;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  gap: 18px;
  padding: clamp(18px, 2.2vw, 24px);
  overflow: hidden;
}

.background-editor-stage-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}

.editor-title {
  margin: 0;
  font-size: clamp(1rem, 1.6vw, 1.18rem);
  line-height: 1.15;
  font-weight: 500;
  letter-spacing: -0.02em;
  max-width: 22ch;
}

.background-editor-meta {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
}

.background-editor-badge {
  display: inline-flex;
  align-items: center;
  padding: 8px 12px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 999px;
  color: var(--text-secondary);
  background: rgba(255, 255, 255, 0.03);
  font-size: 0.78rem;
  line-height: 1;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.background-editor-stage {
  min-height: 0;
  display: grid;
  place-items: center;
  padding: clamp(16px, 2.4vw, 28px);
  border-radius: 20px;
  background:
    radial-gradient(circle at 50% 50%, rgba(255, 255, 255, 0.035), transparent 68%),
    rgba(0, 0, 0, 0.14);
  overflow: hidden;
}

.background-editor-frame {
  position: relative;
  width: auto;
  height: min(100%, calc(100dvh - 250px));
  max-width: 100%;
  max-height: 100%;
  aspect-ratio: var(--editor-frame-aspect, 16 / 9);
  overflow: hidden;
  border-radius: 18px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.02);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.02);
  cursor: grab;
  touch-action: none;
}

.background-editor-frame.is-static {
  cursor: default;
}

.background-editor-frame.is-dragging {
  cursor: grabbing;
}

.background-editor-gradient {
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: linear-gradient(
    160deg,
    var(--editor-gradient-start, #121418),
    var(--editor-gradient-end, #07080a)
  );
}

.background-editor-media {
  position: absolute;
  display: block;
  width: var(--editor-media-width, 100%);
  height: var(--editor-media-height, 100%);
  left: var(--editor-media-left, 0%);
  top: var(--editor-media-top, 0%);
  object-fit: fill;
  transform: none;
  pointer-events: none;
}

.background-editor-crop {
  position: absolute;
  left: var(--editor-crop-left, 0%);
  top: var(--editor-crop-top, 0%);
  width: var(--editor-crop-width, 100%);
  height: var(--editor-crop-height, 100%);
  border-radius: 16px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.08);
  pointer-events: none;
}

.background-editor-guides {
  position: absolute;
  inset: 0;
  pointer-events: none;
  border-radius: inherit;
  background:
    linear-gradient(90deg, transparent 32.9%, rgba(255, 255, 255, 0.08) 33%, transparent 33.1%, transparent 66.9%, rgba(255, 255, 255, 0.08) 67%, transparent 67.1%),
    linear-gradient(transparent 32.9%, rgba(255, 255, 255, 0.08) 33%, transparent 33.1%, transparent 66.9%, rgba(255, 255, 255, 0.08) 67%, transparent 67.1%);
}

.background-editor-note {
  min-height: 2.9em;
}

.background-editor-sidebar {
  min-height: 0;
  display: grid;
  align-content: start;
  gap: 14px;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding-right: 2px;
}

.background-editor-card {
  display: grid;
  gap: 14px;
  align-content: start;
  padding: 18px;
}

.background-editor-gradient-controls,
.background-editor-media-controls {
  display: grid;
  gap: 14px;
}

.background-editor-reset {
  justify-self: stretch;
}

.editor-actions {
  display: flex;
  align-items: center;
  gap: 16px;
}

.editor-actions-stack {
  display: grid;
  gap: 10px;
}

.editor-actions-stack .secondary-button,
.background-editor-reset {
  width: 100%;
  justify-content: center;
}

.editor-actions-stack .danger-button {
  margin-left: 0;
}

.background-editor-note.is-error {
  color: rgba(255, 208, 208, 0.96);
}

.field-slider {
  gap: 10px;
}

.field {
  display: grid;
  gap: 8px;
}

.field span {
  color: var(--text-tertiary);
  font-size: 0.76rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.color-field {
  display: grid;
  grid-template-columns: 48px minmax(0, 1fr);
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border: 1px solid var(--panel-border);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.03);
}

.color-input {
  appearance: none;
  -webkit-appearance: none;
  width: 48px;
  height: 48px;
  padding: 0;
  border: 0;
  border-radius: 12px;
  background: transparent;
  overflow: hidden;
}

.color-input::-webkit-color-swatch-wrapper {
  padding: 0;
}

.color-input::-webkit-color-swatch,
.color-input::-moz-color-swatch {
  border: none;
  border-radius: 12px;
}

.color-value {
  min-width: 0;
  color: var(--text-primary);
  font-size: 0.92rem;
  font-weight: 500;
  letter-spacing: 0.03em;
  font-family:
    "SF Mono",
    "SFMono-Regular",
    "JetBrains Mono",
    "Menlo",
    monospace;
}

.field-select select,
.search-input {
  width: 100%;
  min-width: 0;
  padding: 12px 14px;
  border: 1px solid var(--panel-border);
  border-radius: 14px;
  color: var(--text-primary);
  background: rgba(255, 255, 255, 0.03);
}

.field-select {
  min-width: 0;
  flex: 1 1 auto;
}

.music-toolbar {
  gap: 12px;
  align-items: end;
}

.search-input::placeholder {
  color: rgba(244, 241, 234, 0.32);
}

.track-list {
  min-height: 220px;
  max-height: min(40dvh, 360px);
  display: grid;
  align-content: start;
  gap: 8px;
  padding-right: 2px;
  overflow: auto;
}

.track-item {
  display: grid;
  gap: 4px;
  width: 100%;
  padding: 12px 14px;
  border: 1px solid var(--panel-border);
  border-radius: 14px;
  color: var(--text-primary);
  background: rgba(255, 255, 255, 0.03);
  text-align: left;
}

.track-item.is-active {
  border-color: rgba(255, 255, 255, 0.2);
  background: rgba(255, 255, 255, 0.05);
}

.track-name {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  font-size: 0.94rem;
  line-height: 1.2;
}

.track-meta {
  color: var(--text-secondary);
  font-size: 0.84rem;
  line-height: 1.2;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.command-block {
  display: block;
  width: 100%;
  padding: 12px 14px;
  border: 1px solid var(--panel-border);
  border-radius: 14px;
  color: var(--text-primary);
  background: rgba(255, 255, 255, 0.03);
  font-family:
    "SFMono-Regular",
    "SF Mono",
    "Menlo",
    "Consolas",
    monospace;
  font-size: 0.84rem;
  line-height: 1.35;
  white-space: pre-wrap;
}

.empty-state {
  color: var(--text-secondary);
  font-size: 0.94rem;
  line-height: 1.45;
}

.editor-actions:not(.editor-actions-stack) {
  flex-wrap: wrap;
  justify-content: flex-start;
}

@media (max-width: 980px) {
  .modal-editor {
    overflow-y: auto;
  }

  .background-editor-layout {
    grid-template-columns: 1fr;
    grid-template-rows: minmax(0, 1fr) auto;
    align-content: start;
  }

  .background-editor-sidebar {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    overflow: visible;
  }
}

@media (max-width: 760px) {
  .app {
    --app-padding: 18px;
    padding: var(--app-padding);
  }

  .clock-time {
    font-size: clamp(3.8rem, 17vw, 6rem);
  }

  .clock-date {
    font-size: 0.95rem;
  }

  .player {
    width: min(560px, calc(100vw - (var(--app-padding) * 2)));
    padding: 14px 16px;
  }

  .player-controls,
  .music-toolbar {
    gap: 12px;
  }

  .volume {
    min-width: 120px;
  }

  .slider-volume {
    width: 78px;
  }

  .background-grid {
    grid-template-columns: 1fr;
  }

  .clock-style-hero,
  .clock-style-grid {
    grid-template-columns: 1fr;
  }

  .modal {
    width: calc(100vw - 24px);
    padding: 16px;
  }

  .modal-editor {
    width: calc(100vw - 24px);
    max-width: calc(100vw - 24px);
    height: calc(100dvh - 24px);
    max-height: calc(100dvh - 24px);
    gap: 14px;
    padding: 16px;
  }

  .background-editor-layout,
  .background-editor-sidebar {
    grid-template-columns: 1fr;
  }

  .background-editor-stage-panel,
  .background-editor-card {
    border-radius: 20px;
    padding: 16px;
  }

  .background-editor-stage-head {
    flex-direction: column;
    align-items: flex-start;
  }

  .background-editor-meta {
    justify-content: flex-start;
  }

  .background-editor-stage {
    padding: 14px;
  }

  .music-toolbar {
    flex-direction: column;
    align-items: stretch;
  }
}

@media (max-height: 760px) {
  .app {
    --app-padding: 18px;
    padding: var(--app-padding);
  }

  .clock {
    gap: 8px;
  }

  .clock-time {
    font-size: clamp(3.8rem, 10vh, 6.6rem);
  }

  .clock-date {
    font-size: 0.95rem;
  }

  .player {
    gap: 12px;
    padding: 14px 16px;
  }

  .modal {
    max-height: calc(100dvh - 24px);
  }

  .modal-editor {
    height: calc(100dvh - 24px);
    max-height: calc(100dvh - 24px);
  }

  .background-editor-frame {
    height: min(100%, calc(100dvh - 320px));
  }

  .track-list {
    max-height: min(34dvh, 280px);
  }
}

@media (max-height: 620px) {
  .clock-time {
    font-size: clamp(3.2rem, 9vh, 5.2rem);
  }

  .clock-date {
    font-size: 0.88rem;
  }

  .player {
    gap: 10px;
    padding: 12px 14px;
  }

  .control-button {
    width: 34px;
    height: 34px;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
  }
}
