/* GTA CLOCK - MINIMALIST BESPOKE AESTHETIC */

:root {
  --bg-core: #09050e;
  --sunset-pink: #ff2a8d;
  --sunset-orange: #ff8e3c;
  --sunset-violet: #8e2de2;

  --ps-blue: #0070d1;
  --xbox-green: #107c10;

  --text-pure: #ffffff;
  --text-muted: rgba(255, 255, 255, 0.75);
  --text-dim: rgba(255, 255, 255, 0.5);

  --font-display: 'Space Grotesk', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-body: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;

  /* User-customizable scales (Customize panel) */
  --digit-scale: 1;
  --emblem-scale: 1;
}

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

html,
body {
  width: 100%;
  height: 100%;
  min-height: 100vh;
  background-color: var(--bg-core);
  color: var(--text-pure);
  font-family: var(--font-body);
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

/* Background Layers - Brightened & Vibrant */
.backdrop-wrapper {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  overflow: hidden;
  /* Contain backdrop paint so the per-second countdown transitions
     can't cause repaint-coupled shimmer on the background layers. */
  isolation: isolate;
  contain: strict;
  content-visibility: auto;
}

.backdrop-art {
  position: absolute;
  inset: -15px;
  background-image: url('/backgrounds/01/full.jpg');
  background-size: cover;
  background-position: center 30%;
  filter: brightness(0.72) contrast(1.06) saturate(1.18);
  transform: scale(1.02);
  animation: subtleBreathe 20s ease-in-out infinite alternate;
  /* Dedicated compositor layer: backdrop geometry stays put while
     content above it animates. */
  will-change: transform;
  -webkit-backface-visibility: hidden;
  backface-visibility: hidden;
}

@keyframes subtleBreathe {
  0% {
    transform: scale(1.02);
  }

  100% {
    transform: scale(1.05) translateY(-4px);
  }
}

.backdrop-vignette {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse at 50% 45%, rgba(12, 6, 20, 0.15) 0%, rgba(10, 5, 16, 0.45) 55%, rgba(8, 4, 12, 0.78) 85%, #08040c 100%),
    linear-gradient(to bottom, rgba(8, 4, 12, 0.35) 0%, transparent 20%, rgba(8, 4, 12, 0.55) 75%, #08040c 100%);
}

.backdrop-bloom {
  position: absolute;
  top: 18%;
  left: 50%;
  transform: translateX(-50%);
  width: 600px;
  height: 320px;
  background: radial-gradient(circle, rgba(255, 42, 141, 0.18) 0%, rgba(255, 142, 60, 0.08) 50%, transparent 70%);
  /* 80px blur is a full-screen paint cost on every frame while backdrops
     animate — 48px keeps the glow with ~40% less blur work. Hidden entirely
     via body.hide-bloom when the user disables it. */
  filter: blur(48px);
  contain: strict;
}

/* Hero Center Stage */
.hero-stage {
  position: relative;
  z-index: 10;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 40px 20px;
  /* Keep countdown paint contained in its own stacking context. */
  isolation: isolate;
}

.hero-content {
  width: 100%;
  max-width: 860px;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}

/* Emblem */
.hero-logo-wrap {
  margin-bottom: 24px;
  user-select: none;
}

.gta-emblem {
  height: calc(88px * var(--emblem-scale, 1));
  width: auto;
  object-fit: contain;
  /* Single drop-shadow: the second 16px glow doubled filter cost for little gain. */
  filter: drop-shadow(0 8px 30px rgba(255, 42, 141, 0.45));
  transition: transform 0.3s ease;
}

.gta-emblem:hover {
  transform: scale(1.02);
}

/* Clock Display */
.clock-display {
  width: 100%;
  margin-bottom: 28px;
}

.digits-row {
  display: flex;
  align-items: flex-start;
  justify-content: center;
  gap: 18px;
}

.digit-cell {
  display: flex;
  flex-direction: column;
  align-items: center;
}

/* Unit Digits Container */
.unit-digits {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  position: relative;
}

/* Single Character Slot (Independent Per-Digit Sliding) */
.char-slot {
  position: relative;
  height: calc(94px * var(--digit-scale, 1));
  width: calc(54px * var(--digit-scale, 1));
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}

.char-val {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-display);
  font-size: calc(92px * var(--digit-scale, 1));
  font-weight: 700;
  line-height: 1;
  letter-spacing: -1px;
  color: #ffffff;
  /* Crisp, refined drop shadow that does not bleed or muddy adjacent elements */
  text-shadow: 0 3px 8px rgba(0, 0, 0, 0.7), 0 1px 2px rgba(0, 0, 0, 0.85);
  font-variant-numeric: tabular-nums;
  will-change: transform, opacity;
  /* transform/opacity only: keeps digit slides on the compositor. */
  transition: transform 0.68s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.6s ease;
  contain: layout paint;
}

.char-val.current {
  transform: translateY(0);
  opacity: 1;
}

.char-val.slide-out {
  transform: translateY(-100%);
  opacity: 0;
}

.char-val.slide-in-start {
  transform: translateY(100%);
  opacity: 0;
}

/* Colon Separator - Centered with dedicated breathing space */
.sep {
  height: calc(94px * var(--digit-scale, 1));
  width: calc(20px * var(--digit-scale, 1));
  margin: 0 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-display);
  font-size: calc(44px * var(--digit-scale, 1));
  font-weight: 700;
  line-height: 1;
  color: rgba(255, 255, 255, 0.35);
  user-select: none;
  /* Clean shadow without hazy blur overlap */
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.6);
  animation: sepPulse 1.2s ease-in-out infinite;
  transform: translateY(-3px);
}

@keyframes sepPulse {

  0%,
  100% {
    opacity: 0.6;
  }

  50% {
    opacity: 0.2;
  }
}

.label {
  font-family: var(--font-display);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 3.5px;
  color: var(--text-muted);
  text-shadow: 0 2px 6px rgba(0, 0, 0, 0.8);
  margin-top: 8px;
}

/* ---------- Secondary (pre-load) countdown block ---------- */
.clock-secondary {
  margin-top: -10px;
  margin-bottom: 24px;
  padding: 16px 10px 14px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.09);
  border-radius: 18px;
}

.secondary-title {
  font-family: var(--font-display);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 2.5px;
  text-transform: uppercase;
  color: #ff9ed2;
  text-align: center;
  margin-bottom: 10px;
  text-shadow: 0 2px 6px rgba(0, 0, 0, 0.8);
}

.digits-compact {
  gap: 10px;
}

.digits-compact .char-slot {
  height: calc(52px * var(--digit-scale, 1));
  width: calc(30px * var(--digit-scale, 1));
}

.digits-compact .char-val {
  font-size: calc(50px * var(--digit-scale, 1));
}

.digits-compact .sep {
  height: calc(52px * var(--digit-scale, 1));
  width: calc(12px * var(--digit-scale, 1));
  font-size: calc(26px * var(--digit-scale, 1));
}

.digits-compact .label {
  font-size: 9px;
  letter-spacing: 2.5px;
  margin-top: 6px;
}

/* Passed-event celebration line under the main digits */
.event-note {
  text-align: center;
  font-family: var(--font-display);
  font-size: 15px;
  font-weight: 700;
  letter-spacing: 0.4px;
  color: #2ed573;
  text-shadow: 0 2px 8px rgba(0, 0, 0, 0.85);
  margin: 2px 0 12px;
}

/* ---------- Countdown target strip (3-way, reuses preset-strip-btn) ---------- */
.target-strip {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 6px;
}

.clock-meta {
  margin-top: 16px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  font-size: 14px;
  font-weight: 500;
  color: var(--text-muted);
  text-shadow: 0 2px 8px rgba(0, 0, 0, 0.85);
  flex-wrap: wrap;
}

.meta-date {
  color: #ffffff;
  font-weight: 600;
  letter-spacing: 0.2px;
}

.meta-dot {
  color: rgba(255, 255, 255, 0.35);
}

.meta-tz-btn {
  background: transparent;
  border: none;
  padding: 2px 6px;
  border-radius: 6px;
  color: #ff9ed2;
  font-family: inherit;
  font-weight: 600;
  font-size: 13px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  transition: all 0.2s ease;
  text-shadow: inherit;
}

.meta-tz-btn:hover {
  background: rgba(255, 158, 210, 0.12);
  color: #ffffff;
  text-shadow: 0 0 10px rgba(255, 42, 141, 0.6);
}

.tz-chevron {
  opacity: 0.7;
  transition: transform 0.2s ease, opacity 0.2s ease;
}

.meta-tz-btn:hover .tz-chevron {
  opacity: 1;
  transform: translateY(1px);
}

/* Platforms Pre-Order Hub */
.platforms-hub {
  width: 100%;
  max-width: 580px;
  margin-bottom: 28px;
}

.platforms-dock {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 14px;
}

.platform-card {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 22px;
  background: linear-gradient(145deg, rgba(24, 13, 36, 0.75) 0%, rgba(14, 8, 22, 0.88) 100%);
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 14px;
  text-decoration: none;
  /* backdrop-filter forces a backdrop snapshot per card — keep it only where
     legibility needs it; cards already have an opaque gradient. */
  box-shadow: 0 8px 26px rgba(0, 0, 0, 0.5);
  transition: transform 0.25s ease, box-shadow 0.25s ease, border-color 0.25s ease;
  contain: layout paint;
}

.platform-brand {
  display: flex;
  align-items: center;
}

.brand-logo {
  height: 23px;
  width: auto;
  max-width: 130px;
  object-fit: contain;
  filter: brightness(0) invert(1);
  opacity: 0.95;
  transition: opacity 0.2s ease, transform 0.2s ease;
}

.platform-action {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-family: var(--font-display);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 1.2px;
  color: var(--text-pure);
  background: rgba(255, 255, 255, 0.08);
  padding: 6px 11px;
  border-radius: 6px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  transition: all 0.2s ease;
}

.platform-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 14px 34px rgba(0, 0, 0, 0.6);
}

.ps5-card:hover {
  border-color: rgba(0, 112, 209, 0.6);
  box-shadow: 0 14px 34px rgba(0, 0, 0, 0.6), 0 0 24px rgba(0, 112, 209, 0.35);
}

.ps5-card:hover .platform-action {
  background: rgba(0, 112, 209, 0.35);
  border-color: rgba(0, 112, 209, 0.6);
}

.xbox-card:hover {
  border-color: rgba(16, 124, 16, 0.6);
  box-shadow: 0 14px 34px rgba(0, 0, 0, 0.6), 0 0 24px rgba(16, 124, 16, 0.35);
}

.xbox-card:hover .platform-action {
  background: rgba(16, 124, 16, 0.35);
  border-color: rgba(16, 124, 16, 0.6);
}

/* Action Hub: Calendar & Browser Alert Pills */
.action-hub {
  width: 100%;
  max-width: 480px;
}

.action-pills {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  flex-wrap: wrap;
}

.action-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 11px 22px;
  background: rgba(18, 10, 28, 0.78);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 9999px;
  color: var(--text-pure);
  font-family: var(--font-display);
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.3px;
  cursor: pointer;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.45);
  transition: transform 0.2s cubic-bezier(0.4, 0, 0.2, 1), background 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
  contain: layout paint;
}

.action-pill svg {
  color: rgba(255, 255, 255, 0.7);
  transition: color 0.2s ease, transform 0.2s ease;
}

.action-pill:hover {
  background: rgba(28, 14, 42, 0.9);
  border-color: rgba(255, 42, 141, 0.5);
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(255, 42, 141, 0.25);
}

.action-pill:hover svg {
  color: #ffffff;
  transform: scale(1.08);
}

.cal-pill:hover {
  border-color: rgba(255, 142, 60, 0.55);
  box-shadow: 0 8px 24px rgba(255, 142, 60, 0.25);
}

.action-feedback {
  min-height: 20px;
  margin-top: 10px;
  font-size: 13px;
  font-weight: 500;
  text-shadow: 0 1px 4px rgba(0, 0, 0, 0.8);
}

.action-feedback.success {
  color: #2ed573;
}

.action-feedback.error {
  color: #ff4757;
}

/* Calendar Modal */
.cal-modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.72);
  backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  z-index: 100;
}

.cal-modal-box {
  width: 100%;
  max-width: 400px;
  background: linear-gradient(160deg, #180d26 0%, #0d0616 100%);
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 18px;
  padding: 24px;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.75), 0 0 30px rgba(255, 42, 141, 0.2);
}

.cal-modal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
}

.cal-modal-head h3 {
  font-family: var(--font-display);
  font-size: 18px;
  font-weight: 700;
}

.cal-modal-close {
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-size: 24px;
  cursor: pointer;
  line-height: 1;
}

.cal-modal-close:hover {
  color: #ffffff;
}

.cal-modal-info {
  font-size: 13px;
  color: var(--text-muted);
  line-height: 1.5;
  margin-bottom: 20px;
}

.cal-event-toggle {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 6px;
  margin-bottom: 16px;
}

.cal-options {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.cal-link-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 10px;
  color: #ffffff;
  text-decoration: none;
  font-family: var(--font-display);
  font-size: 13.5px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
}

.cal-link-btn:hover {
  background: rgba(255, 42, 141, 0.2);
  border-color: rgba(255, 42, 141, 0.5);
  transform: translateY(-1px);
}

/* Timezone Selector Modal */
.tz-modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  z-index: 100;
}

.tz-modal-box {
  width: 100%;
  max-width: 460px;
  background: linear-gradient(160deg, #1a0e28 0%, #0c0616 100%);
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 18px;
  padding: 22px;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.8), 0 0 30px rgba(255, 42, 141, 0.2);
  max-height: 85vh;
  display: flex;
  flex-direction: column;
}

.tz-modal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
}

.tz-modal-head h3 {
  font-family: var(--font-display);
  font-size: 18px;
  font-weight: 700;
  color: #ffffff;
}

.tz-modal-close {
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-size: 24px;
  cursor: pointer;
  line-height: 1;
}

.tz-modal-close:hover {
  color: #ffffff;
}

.tz-modal-info {
  font-size: 12.5px;
  color: var(--text-muted);
  line-height: 1.4;
  margin-bottom: 14px;
}

.tz-search-wrap {
  position: relative;
  display: flex;
  align-items: center;
  margin-bottom: 12px;
}

.tz-search-icon {
  position: absolute;
  left: 12px;
  color: rgba(255, 255, 255, 0.45);
  pointer-events: none;
}

.tz-search-wrap input {
  width: 100%;
  padding: 10px 14px 10px 36px;
  background: rgba(0, 0, 0, 0.4);
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 10px;
  color: #ffffff;
  font-family: var(--font-body);
  font-size: 13.5px;
  outline: none;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.tz-search-wrap input:focus {
  border-color: var(--sunset-pink);
  box-shadow: 0 0 14px rgba(255, 42, 141, 0.35);
}

.tz-quick-row {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  margin-bottom: 12px;
}

.tz-chip {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: rgba(255, 255, 255, 0.85);
  font-family: var(--font-display);
  font-size: 11.5px;
  font-weight: 500;
  padding: 5px 11px;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.15s ease;
}

.tz-chip:hover,
.tz-chip.active {
  background: rgba(255, 42, 141, 0.22);
  border-color: rgba(255, 42, 141, 0.55);
  color: #ffffff;
}

.tz-list {
  flex: 1;
  overflow-y: auto;
  max-height: 250px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding-right: 4px;
}

.tz-list::-webkit-scrollbar {
  width: 6px;
}

.tz-list::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.2);
  border-radius: 3px;
}

.tz-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 9px 12px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid transparent;
  border-radius: 8px;
  color: #ffffff;
  font-size: 13px;
  cursor: pointer;
  transition: all 0.15s ease;
  text-align: left;
}

.tz-item:hover,
.tz-item.active {
  background: rgba(255, 42, 141, 0.16);
  border-color: rgba(255, 42, 141, 0.4);
}

.tz-item-name {
  font-weight: 500;
}

.tz-item-offset {
  color: #ff9ed2;
  font-family: var(--font-display);
  font-size: 11.5px;
  font-weight: 600;
}

.hidden {
  display: none !important;
}

/* Responsive */
@media (max-width: 768px) {
  .hero-stage {
    padding: 40px 14px;
  }

  .gta-emblem {
    height: calc(68px * var(--emblem-scale, 1));
  }

  .digits-row {
    gap: 8px;
  }

  .char-slot {
    height: calc(56px * var(--digit-scale, 1));
    width: calc(30px * var(--digit-scale, 1));
  }

  .char-val {
    font-size: calc(54px * var(--digit-scale, 1));
  }

  .sep {
    height: calc(56px * var(--digit-scale, 1));
    width: calc(14px * var(--digit-scale, 1));
    margin: 0 3px;
    font-size: calc(28px * var(--digit-scale, 1));
    transform: translateY(-2px);
  }

  .label {
    font-size: 9.5px;
    letter-spacing: 2px;
  }

  .platforms-dock {
    grid-template-columns: 1fr;
    gap: 10px;
  }

  .action-pills {
    flex-direction: column;
    width: 100%;
    max-width: 280px;
  }

  .action-pill {
    width: 100%;
  }
}

@media (max-width: 400px) {
  .digits-row {
    gap: 4px;
  }

  .char-slot {
    height: calc(46px * var(--digit-scale, 1));
    width: calc(25px * var(--digit-scale, 1));
  }

  .char-val {
    font-size: calc(44px * var(--digit-scale, 1));
  }

  .sep {
    height: calc(46px * var(--digit-scale, 1));
    width: calc(10px * var(--digit-scale, 1));
    margin: 0 1px;
    font-size: calc(22px * var(--digit-scale, 1));
    transform: translateY(-2px);
  }
}

/* ---------- Top-Right Utility Bar ---------- */
.topbar {
  position: fixed;
  top: 18px;
  right: 20px;
  z-index: 50;
  display: flex;
  gap: 10px;
}

.icon-btn {
  width: 40px;
  height: 40px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: rgba(18, 10, 28, 0.72);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 50%;
  color: rgba(255, 255, 255, 0.85);
  cursor: pointer;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.45);
  transition: transform 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease, color 0.2s ease;
}

.icon-btn:hover {
  border-color: rgba(255, 42, 141, 0.55);
  color: #ffffff;
  transform: translateY(-1px);
  box-shadow: 0 8px 24px rgba(255, 42, 141, 0.25);
}

.icon-btn.active {
  border-color: rgba(255, 42, 141, 0.7);
  color: #ff9ed2;
}

/* ---------- Infused speaker volume pill ---------- */
/* The wrap holds the 40px circle's place in the topbar so the sliders icon
   never shifts; the pill expands leftward behind the button on hover. */
.sound-wrap {
  position: relative;
  width: 40px;
  height: 40px;
  flex-shrink: 0;
}

.sound-wrap .icon-btn {
  position: relative;
  z-index: 1;
}

.sound-slider-pill {
  position: absolute;
  top: 0;
  right: 0;
  height: 40px;
  width: 40px;
  display: flex;
  align-items: center;
  padding: 0 46px 0 16px; /* reserve the right end for the icon */
  background: rgba(18, 10, 28, 0.92);
  border: 1px solid transparent;
  border-radius: 20px;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.45);
  opacity: 0;
  pointer-events: none;
  overflow: hidden;
  transition: width 0.22s cubic-bezier(0.37, 0, 0.63, 1), opacity 0.15s ease, border-color 0.2s ease;
}

.sound-wrap.expanded .sound-slider-pill {
  width: 178px;
  opacity: 1;
  pointer-events: auto;
  border-color: rgba(255, 42, 141, 0.35);
}

/* Melt the button into the pill while expanded — one continuous unit. */
.sound-wrap.expanded .icon-btn,
.sound-wrap.expanded .icon-btn:hover {
  background: transparent;
  border-color: transparent;
  box-shadow: none;
  transform: none;
}

.sound-slider-pill input[type="range"] {
  width: 100%;
  min-width: 0;
  /* Mirrored: mute (0) at the very right, full volume (100) at the left. */
  direction: rtl;
  accent-color: #ff2a8d;
  cursor: pointer;
}

/* ---------- Customization Panel (dropdown below the topbar) ---------- */
.custom-panel {
  position: fixed;
  top: 70px;
  right: 20px;
  z-index: 90;
  width: 300px;
  max-width: calc(100vw - 40px);
  max-height: calc(100vh - 100px);
  overflow-y: auto;
  background: linear-gradient(160deg, rgba(26, 14, 40, 0.97) 0%, rgba(12, 6, 22, 0.97) 100%);
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 16px;
  padding: 18px;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.75), 0 0 30px rgba(255, 42, 141, 0.18);
}

.custom-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 6px;
}

.custom-head h3 {
  font-family: var(--font-display);
  font-size: 16px;
  font-weight: 700;
}

.custom-close {
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-size: 22px;
  cursor: pointer;
  line-height: 1;
}

.custom-close:hover {
  color: #ffffff;
}

.custom-section-title {
  font-family: var(--font-display);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: #ff9ed2;
  margin: 14px 0 8px;
}

.bg-presets {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}

.bg-preset {
  display: flex;
  flex-direction: column;
  gap: 5px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 10px;
  padding: 6px;
  color: rgba(255, 255, 255, 0.85);
  font-family: var(--font-body);
  font-size: 10.5px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.15s ease;
}

.bg-preset img {
  width: 100%;
  height: 48px;
  object-fit: cover;
  border-radius: 6px;
  display: block;
}

.bg-none-thumb {
  width: 100%;
  height: 48px;
  border-radius: 6px;
  display: block;
  background: var(--bg-core);
  border: 1px dashed rgba(255, 255, 255, 0.25);
}

.bg-preset:hover {
  border-color: rgba(255, 42, 141, 0.5);
}

.bg-preset.active {
  border-color: var(--sunset-pink);
  box-shadow: 0 0 12px rgba(255, 42, 141, 0.4);
}

.bg-more-btn {
  grid-column: 1 / -1;
  background: transparent;
  border: none;
  color: #ff9ed2;
  font-family: var(--font-display);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  padding: 4px 0 0;
  text-align: center;
}

.bg-more-btn:hover {
  color: #ffffff;
  text-decoration: underline;
}

.toggle-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.toggle-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 13px;
  color: rgba(255, 255, 255, 0.9);
  cursor: pointer;
  padding: 2px 0;
}

.toggle-row input {
  display: none;
}

.toggle-track {
  position: relative;
  width: 34px;
  height: 19px;
  border-radius: 9999px;
  background: rgba(255, 255, 255, 0.14);
  border: 1px solid rgba(255, 255, 255, 0.16);
  transition: all 0.18s ease;
  flex-shrink: 0;
}

.toggle-track::after {
  content: '';
  position: absolute;
  top: 2px;
  left: 2px;
  width: 13px;
  height: 13px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.75);
  transition: all 0.18s ease;
}

.toggle-row input:checked + .toggle-track {
  background: rgba(255, 42, 141, 0.55);
  border-color: rgba(255, 42, 141, 0.8);
}

.toggle-row input:checked + .toggle-track::after {
  left: 17px;
  background: #ffffff;
}

.slider-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.slider-row {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 13px;
  color: rgba(255, 255, 255, 0.9);
}

.slider-row em {
  font-style: normal;
  color: #ff9ed2;
  font-weight: 600;
}

.slider-row input[type='range'] {
  width: 100%;
  accent-color: var(--sunset-pink);
  cursor: pointer;
}

.custom-reset {
  width: 100%;
  margin-top: 16px;
  padding: 10px;
  background: rgba(255, 255, 255, 0.07);
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 10px;
  color: #ffffff;
  font-family: var(--font-display);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
}

.custom-reset:hover {
  background: rgba(255, 42, 141, 0.2);
  border-color: rgba(255, 42, 141, 0.5);
}

/* ---------- Customization visibility states ---------- */
body.bg-none .backdrop-art {
  display: none;
}

body.hide-emblem .hero-logo-wrap {
  display: none;
}

body.hide-meta .clock-meta {
  display: none;
}

body.hide-platforms .platforms-hub {
  display: none;
}

body.hide-labels .clock-display .label {
  display: none;
}

body.hide-actions .action-hub {
  display: none;
}

body.hide-bloom .backdrop-bloom {
  display: none;
}

@media (max-width: 480px) {
  .topbar {
    top: 12px;
    right: 12px;
  }

  .custom-panel {
    top: 62px;
    right: 12px;
  }
}

/* Users who prefer reduced motion: freeze ambient animation and make
   digit changes instant instead of sliding. */
@media (prefers-reduced-motion: reduce) {
  .backdrop-art {
    animation: none !important;
  }

  .sep {
    animation: none !important;
  }

  .char-val {
    transition: none !important;
  }
}

/* ---------- Artwork Slideshow (GTA loading-screen style) ---------- */
/* Two stacked layers crossfade while each runs a slow Ken Burns drift. */
.backdrop-art.crossfading {
  transition: opacity 1.6s ease;
}

.backdrop-art.slide-hidden {
  opacity: 0;
}

.backdrop-art.slide-visible {
  opacity: 1;
}

/* Subtle zoom/pan drifts, held slightly longer than each slide (10s hold /
   12s drift) so the motion continues underneath the crossfade — like the game. */
@keyframes kb-zoom-in {
  from { transform: scale(1.03) translate(0, 0); }
  to { transform: scale(1.14) translate(-1%, -1%); }
}

@keyframes kb-zoom-out {
  from { transform: scale(1.14) translate(1%, 1%); }
  to { transform: scale(1.03) translate(0, 0); }
}

@keyframes kb-pan-left {
  from { transform: scale(1.12) translate(1.5%, 0); }
  to { transform: scale(1.12) translate(-1.5%, 0); }
}

@keyframes kb-pan-right {
  from { transform: scale(1.12) translate(-1.5%, 0.5%); }
  to { transform: scale(1.12) translate(1.5%, -0.5%); }
}

/* Gentle ease-in-out (kept in sync with PX_EASE in app.js): steady cruise
   through the hold, soft landing at the slide change — GTA V style. */
.backdrop-art.kb-zoom-in {
  animation: kb-zoom-in 12s cubic-bezier(0.37, 0, 0.63, 1) forwards;
}

.backdrop-art.kb-zoom-out {
  animation: kb-zoom-out 12s cubic-bezier(0.37, 0, 0.63, 1) forwards;
}

.backdrop-art.kb-pan-left {
  animation: kb-pan-left 12s cubic-bezier(0.37, 0, 0.63, 1) forwards;
}

.backdrop-art.kb-pan-right {
  animation: kb-pan-right 12s cubic-bezier(0.37, 0, 0.63, 1) forwards;
}

.slideshow-row {
  margin-top: 10px;
}

/* ---------- Parallax Stage (folder packs) ---------- */
/* Sits above the flat crossfade layers; fades in/out as a whole while the
   two depth layers inside drift against each other on their own. */
.parallax-stage {
  position: absolute;
  inset: 0;
  opacity: 0;
  transition: opacity 1s ease;
  pointer-events: none;
  isolation: isolate;
}

.parallax-stage.px-on {
  opacity: 1;
}

.px-layer {
  position: absolute;
  /* Oversized so depth translation never exposes an edge. */
  inset: -70px;
  background-size: cover;
  background-position: center 30%;
  background-repeat: no-repeat;
  will-change: transform;
  /* Compositor hint: translated/scaled every 10s glide, never repainted. */
  transform: translateZ(0);
  -webkit-backface-visibility: hidden;
  backface-visibility: hidden;
  contain: strict;
}

.px-back {
  filter: brightness(0.72) contrast(1.06) saturate(1.18);
}

.px-front {
  background-color: transparent;
}

@media (prefers-reduced-motion: reduce) {
  .parallax-stage {
    transition: none;
  }
}

.custom-hint {
  font-size: 11px;
  color: var(--text-dim);
  margin-top: 4px;
  line-height: 1.4;
}

/* ---------- Music Panel ---------- */
.now-playing {
  display: flex;
  align-items: center;
  gap: 12px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 12px;
  padding: 10px 12px;
  margin-top: 4px;
}

.play-btn {
  width: 38px;
  height: 38px;
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: rgba(255, 42, 141, 0.25);
  border: 1px solid rgba(255, 42, 141, 0.6);
  border-radius: 50%;
  color: #ffffff;
  cursor: pointer;
  transition: all 0.18s ease;
}

.play-btn:hover {
  background: rgba(255, 42, 141, 0.45);
  transform: scale(1.05);
}

/* ---------- Play progress ring (display-only, surrounds play button) ---------- */
.play-ring-wrap {
  position: relative;
  width: 46px;
  height: 46px;
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.play-ring {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.play-ring-bg {
  fill: none;
  stroke: rgba(255, 255, 255, 0.15);
  stroke-width: 3;
}

.play-ring-fg {
  fill: none;
  stroke: #ff2a8d;
  stroke-width: 3;
  stroke-linecap: round;
  transform: rotate(-90deg);
  transform-origin: center;
}

/* ---------- Loop mode button ---------- */
.loop-btn {
  margin-left: auto;
  width: 32px;
  height: 32px;
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 50%;
  color: rgba(255, 255, 255, 0.6);
  cursor: pointer;
  transition: all 0.18s ease;
}

.loop-btn:hover {
  border-color: rgba(255, 42, 141, 0.55);
  color: #ffffff;
}

.loop-btn.active {
  border-color: rgba(255, 42, 141, 0.7);
  color: #ff9ed2;
  background: rgba(255, 42, 141, 0.16);
}

.track-meta {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.track-label {
  font-family: var(--font-display);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: #ff9ed2;
}

.track-name {
  font-size: 13.5px;
  font-weight: 600;
  color: #ffffff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.track-list {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.track-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 9px 12px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid transparent;
  border-radius: 8px;
  color: #ffffff;
  font-size: 13px;
  cursor: pointer;
  transition: all 0.15s ease;
  text-align: left;
  width: 100%;
}

.track-item:hover,
.track-item.active {
  background: rgba(255, 42, 141, 0.16);
  border-color: rgba(255, 42, 141, 0.4);
}

.track-item .track-play-state {
  color: #ff9ed2;
  font-size: 11px;
  flex-shrink: 0;
  width: 30px;
}

.track-item .track-item-name {
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.track-empty {
  padding: 14px;
  text-align: center;
  color: rgba(255, 255, 255, 0.4);
  font-size: 12.5px;
}

.volume-row {
  margin-top: 14px;
}

/* ---------- Preset Strip (inside Customize panel, 2x2 grid) ---------- */
.preset-strip {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 6px;
}

.preset-strip-btn {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 8px;
  color: rgba(255, 255, 255, 0.85);
  font-family: var(--font-display);
  font-size: 11px;
  font-weight: 600;
  padding: 8px 6px;
  min-height: 32px;
  cursor: pointer;
  transition: all 0.15s ease;
  text-align: center;
  line-height: 1.3;
}

.preset-strip-btn:hover {
  border-color: rgba(255, 42, 141, 0.5);
  color: #ffffff;
}

.preset-strip-btn.active {
  background: rgba(255, 42, 141, 0.25);
  border-color: var(--sunset-pink);
  color: #ffffff;
}

/* ---------- First-Visit Onboarding ---------- */
.onboard-overlay {
  position: fixed;
  inset: 0;
  z-index: 300;
  background: rgba(5, 2, 10, 0.82);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  overflow-y: auto;
}

.onboard-box {
  width: 100%;
  max-width: 880px;
  background: linear-gradient(160deg, rgba(26, 14, 40, 0.98) 0%, rgba(12, 6, 22, 0.98) 100%);
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 20px;
  padding: 28px;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.8), 0 0 40px rgba(255, 42, 141, 0.15);
  text-align: center;
}

.onboard-box h2 {
  font-family: var(--font-display);
  font-size: 22px;
  font-weight: 700;
}

.onboard-sub {
  font-size: 13px;
  color: var(--text-muted);
  margin-top: 6px;
  margin-bottom: 20px;
}

.preset-cards {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  align-items: stretch;
}

.preset-card {
  display: flex;
  flex-direction: column;
  gap: 8px;
  height: 100%;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 14px;
  padding: 10px;
  cursor: pointer;
  transition: all 0.18s ease;
  color: #ffffff;
  font-family: var(--font-body);
  text-align: center;
  align-items: stretch;
}

.preset-card:hover {
  border-color: var(--sunset-pink);
  transform: translateY(-3px);
  box-shadow: 0 10px 26px rgba(255, 42, 141, 0.3);
}

.preset-name {
  font-family: var(--font-display);
  font-size: 13px;
  font-weight: 700;
}

.preset-desc {
  font-size: 11px;
  color: var(--text-muted);
  line-height: 1.4;
  /* Fixed two-line block so names/descriptions baseline-align across cards
     regardless of how each description wraps. */
  min-height: 2.8em;
}

/* Schematic mini preview of the page under each preset */
.preset-preview {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 11;
  border-radius: 8px;
  overflow: hidden;
  background: var(--bg-core);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  padding: 6px 4px;
  /* Equal-height anchor: every card's preview occupies the same box so the
     digit rows land at the same height despite differing row sets. */
  flex: 1 0 auto;
}

.preset-preview.has-bloom {
  box-shadow: inset 0 0 18px rgba(255, 42, 141, 0.35);
}

.preset-preview img.pv-bg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0.55;
}

.preset-preview > *:not(img.pv-bg) {
  position: relative;
}

.pv-logo {
  height: 12px;
  width: auto;
  object-fit: contain;
  filter: brightness(0) invert(1);
}

.pv-digits {
  display: flex;
  gap: 3px;
  align-items: center;
  font-family: var(--font-display);
  font-weight: 700;
  color: #ffffff;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.8);
  line-height: 1;
}

.pv-sep {
  opacity: 0.5;
  font-size: 0.55em;
}

.pv-labels {
  display: flex;
  gap: 6px;
  font-family: var(--font-display);
  font-size: 4px;
  font-weight: 700;
  letter-spacing: 1px;
  color: rgba(255, 255, 255, 0.7);
}

.pv-meta {
  width: 62%;
  height: 4px;
  border-radius: 2px;
  background: rgba(255, 255, 255, 0.35);
}

.pv-platforms {
  display: flex;
  gap: 3px;
  width: 78%;
}

.pv-platforms span {
  flex: 1;
  height: 9px;
  border-radius: 3px;
  background: rgba(255, 255, 255, 0.14);
  border: 1px solid rgba(255, 255, 255, 0.2);
}

.pv-actions {
  display: flex;
  gap: 3px;
}

.pv-actions span {
  width: 26px;
  height: 8px;
  border-radius: 9999px;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.2);
}

.onboard-skip {
  margin-top: 20px;
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-family: var(--font-display);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
}

.onboard-skip:hover {
  color: #ffffff;
  text-decoration: underline;
}

@media (max-width: 760px) {
  .preset-cards {
    grid-template-columns: repeat(2, 1fr);
  }

  .onboard-box {
    padding: 20px;
  }
}