/* SleepSounds - Calming Soundscape Website */

:root {
  --font-sans: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 20px;
  --radius-full: 9999px;

  /* Default theme (Rainforest) */
  --theme-primary: #10b981;
  --theme-primary-hover: #059669;
  --theme-primary-active: #047857;
  --theme-bg-base: #06130d;
  --theme-bg-gradient: radial-gradient(circle at 50% 0%, #103322 0%, #06130d 75%);
  --theme-surface: #0c2017;
  --theme-surface-hover: #122d20;
  --theme-surface-active: #183d2c;
  --theme-border: #1a422f;
  --theme-border-active: #10b981;
  --theme-text-primary: #f0fdf4;
  --theme-text-muted: #86efac;
  --theme-text-subtle: #4ade80;
  --theme-glow: rgba(16, 185, 129, 0.28);
  --theme-card-shadow: 0 8px 24px rgba(0, 0, 0, 0.45);
}

/* 1. Rainforest Theme (Emerald Green) */
:root[data-sound="rainforest"] {
  --theme-primary: #10b981;
  --theme-primary-hover: #059669;
  --theme-primary-active: #047857;
  --theme-bg-base: #06130d;
  --theme-bg-gradient: radial-gradient(circle at 50% 0%, #103322 0%, #06130d 75%);
  --theme-surface: #0c2017;
  --theme-surface-hover: #122d20;
  --theme-surface-active: #183d2c;
  --theme-border: #1a422f;
  --theme-border-active: #10b981;
  --theme-text-primary: #f0fdf4;
  --theme-text-muted: #86efac;
  --theme-text-subtle: #4ade80;
  --theme-glow: rgba(16, 185, 129, 0.28);
}

/* 2. Birds Theme (Sunrise Amber) */
:root[data-sound="birds"] {
  --theme-primary: #f59e0b;
  --theme-primary-hover: #d97706;
  --theme-primary-active: #b45309;
  --theme-bg-base: #140f04;
  --theme-bg-gradient: radial-gradient(circle at 50% 0%, #302008 0%, #140f04 75%);
  --theme-surface: #201706;
  --theme-surface-hover: #2d2109;
  --theme-surface-active: #3b2c0d;
  --theme-border: #4d380f;
  --theme-border-active: #f59e0b;
  --theme-text-primary: #fffbeb;
  --theme-text-muted: #fde68a;
  --theme-text-subtle: #fbbf24;
  --theme-glow: rgba(245, 158, 11, 0.28);
}

/* 3. Storms Theme (Electric Storm Indigo) */
:root[data-sound="storms"] {
  --theme-primary: #a78bfa;
  --theme-primary-hover: #9d75f7;
  --theme-primary-active: #8b5cf6;
  --theme-bg-base: #080914;
  --theme-bg-gradient: radial-gradient(circle at 50% 0%, #191b3b 0%, #080914 75%);
  --theme-surface: #121429;
  --theme-surface-hover: #1a1d3b;
  --theme-surface-active: #23274e;
  --theme-border: #2e3366;
  --theme-border-active: #a78bfa;
  --theme-text-primary: #f5f3ff;
  --theme-text-muted: #c4b5fd;
  --theme-text-subtle: #a78bfa;
  --theme-glow: rgba(167, 139, 250, 0.28);
}

/* 4. Ocean Waves Theme (Sea Cyan) */
:root[data-sound="ocean"] {
  --theme-primary: #06b6d4;
  --theme-primary-hover: #0891b2;
  --theme-primary-active: #0e7490;
  --theme-bg-base: #040e16;
  --theme-bg-gradient: radial-gradient(circle at 50% 0%, #0a2436 0%, #040e16 75%);
  --theme-surface: #0a1b26;
  --theme-surface-hover: #102636;
  --theme-surface-active: #15344a;
  --theme-border: #1a425c;
  --theme-border-active: #06b6d4;
  --theme-text-primary: #ecfeff;
  --theme-text-muted: #a5f3fc;
  --theme-text-subtle: #67e8f9;
  --theme-glow: rgba(6, 182, 212, 0.28);
}

/* 5. Night Crickets Theme (Twilight Lavender) */
:root[data-sound="crickets"] {
  --theme-primary: #c084fc;
  --theme-primary-hover: #b87cf8;
  --theme-primary-active: #a855f7;
  --theme-bg-base: #0c0817;
  --theme-bg-gradient: radial-gradient(circle at 50% 0%, #201338 0%, #0c0817 75%);
  --theme-surface: #150e26;
  --theme-surface-hover: #1e1438;
  --theme-surface-active: #291b4a;
  --theme-border: #382463;
  --theme-border-active: #c084fc;
  --theme-text-primary: #faf5ff;
  --theme-text-muted: #d8b4fe;
  --theme-text-subtle: #c084fc;
  --theme-glow: rgba(192, 132, 252, 0.28);
}

/* 6. Gentle Stream Theme (Spring Sky Blue) */
:root[data-sound="stream"] {
  --theme-primary: #38bdf8;
  --theme-primary-hover: #0284c7;
  --theme-primary-active: #0369a1;
  --theme-bg-base: #040f18;
  --theme-bg-gradient: radial-gradient(circle at 50% 0%, #09273d 0%, #040f18 75%);
  --theme-surface: #081d2e;
  --theme-surface-hover: #0d2a42;
  --theme-surface-active: #113857;
  --theme-border: #17476e;
  --theme-border-active: #38bdf8;
  --theme-text-primary: #f0f9ff;
  --theme-text-muted: #bae6fd;
  --theme-text-subtle: #7dd3fc;
  --theme-glow: rgba(56, 189, 248, 0.28);
}

/* 7. Campfire Theme (Ember Orange) */
:root[data-sound="campfire"] {
  --theme-primary: #f97316;
  --theme-primary-hover: #ea580c;
  --theme-primary-active: #c2410c;
  --theme-bg-base: #140803;
  --theme-bg-gradient: radial-gradient(circle at 50% 0%, #331508 0%, #140803 75%);
  --theme-surface: #1f0d05;
  --theme-surface-hover: #2d1307;
  --theme-surface-active: #3d1b0a;
  --theme-border: #52240e;
  --theme-border-active: #f97316;
  --theme-text-primary: #fff7ed;
  --theme-text-muted: #fed7aa;
  --theme-text-subtle: #fdba74;
  --theme-glow: rgba(249, 115, 22, 0.28);
}

/* 8. Wind Theme (Mountain Breeze Slate) */
:root[data-sound="wind"] {
  --theme-primary: #94a3b8;
  --theme-primary-hover: #cbd5e1;
  --theme-primary-active: #64748b;
  --theme-bg-base: #090c10;
  --theme-bg-gradient: radial-gradient(circle at 50% 0%, #17202a 0%, #090c10 75%);
  --theme-surface: #0f161e;
  --theme-surface-hover: #16202c;
  --theme-surface-active: #1d2b3a;
  --theme-border: #28394c;
  --theme-border-active: #94a3b8;
  --theme-text-primary: #f8fafc;
  --theme-text-muted: #cbd5e1;
  --theme-text-subtle: #94a3b8;
  --theme-glow: rgba(148, 163, 184, 0.28);
}

/* 9. Soft Rain Theme (Rainy Sky Blue) */
:root[data-sound="soft-rain"] {
  --theme-primary: #60a5fa;
  --theme-primary-hover: #3b82f6;
  --theme-primary-active: #2563eb;
  --theme-bg-base: #060e19;
  --theme-bg-gradient: radial-gradient(circle at 50% 0%, #0f243c 0%, #060e19 75%);
  --theme-surface: #0c1a2e;
  --theme-surface-hover: #12253f;
  --theme-surface-active: #183152;
  --theme-border: #1e3d66;
  --theme-border-active: #60a5fa;
  --theme-text-primary: #eff6ff;
  --theme-text-muted: #bfdbfe;
  --theme-text-subtle: #93c5fd;
  --theme-glow: rgba(96, 165, 250, 0.28);
}

/* Base resets & smooth transitions */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html, body {
  min-height: 100vh;
  font-family: var(--font-sans);
  background-color: var(--theme-bg-base);
  background-image: var(--theme-bg-gradient);
  background-attachment: fixed;
  color: var(--theme-text-primary);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  transition: background 0.6s cubic-bezier(0.4, 0, 0.2, 1), color 0.6s ease;
}

a {
  color: inherit;
  text-decoration: none;
}

button, input, select {
  font: inherit;
  color: inherit;
}

button {
  background: none;
  border: none;
  cursor: pointer;
}

:focus-visible {
  outline: 2px solid var(--theme-primary);
  outline-offset: 3px;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* Layout container */
.app-container {
  max-width: 1080px;
  margin: 0 auto;
  padding: 24px 20px 140px;
  display: flex;
  flex-direction: column;
  gap: 32px;
}

/* Top bar: Site navigation */
.site-nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  width: 100%;
}

.nav-track {
  display: inline-flex;
  align-items: center;
  background: var(--theme-surface);
  border: 1px solid var(--theme-border);
  border-radius: var(--radius-full);
  padding: 4px;
  gap: 4px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.25);
  transition: all 0.3s ease;
}

.nav-item {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 14px;
  border-radius: var(--radius-full);
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--theme-text-muted);
  text-decoration: none;
  transition: all 0.25s ease;
  user-select: none;
}

.nav-item:hover {
  color: var(--theme-text-primary);
  background: var(--theme-surface-hover);
}

.nav-item.active {
  background: var(--theme-primary);
  color: var(--theme-bg-base);
  box-shadow: 0 0 12px var(--theme-glow);
}

.nav-icon {
  width: 1rem;
  height: 1rem;
  flex-shrink: 0;
}

.offline-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: var(--radius-full);
  background: rgba(255, 255, 255, 0.05);
  font-size: 0.8rem;
  color: var(--theme-text-muted);
}

.offline-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--theme-primary);
  box-shadow: 0 0 8px var(--theme-primary);
}

/* Header & SleepSounds Logo */
.header-brand {
  text-align: center;
  padding: 20px 0 10px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
}

.logo-wrapper {
  display: inline-flex;
  align-items: center;
  gap: 14px;
}

.logo-icon {
  width: 48px;
  height: 48px;
  filter: drop-shadow(0 0 16px var(--theme-glow));
  transition: filter 0.5s ease;
}

.logo-icon path,
.logo-icon circle {
  fill: var(--theme-primary);
  transition: fill 0.5s ease;
}

.logo-title {
  font-size: 2.5rem;
  font-weight: 800;
  letter-spacing: -0.03em;
  background: linear-gradient(135deg, #ffffff 30%, var(--theme-primary) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  text-shadow: 0 4px 20px var(--theme-glow);
  transition: all 0.5s ease;
}

.tagline {
  font-size: 1.15rem;
  color: var(--theme-text-muted);
  max-width: 580px;
  margin: 0 auto;
}

/* Sound Selection Grid */
.sound-selection-section {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.section-header {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  border-bottom: 1px solid var(--theme-border);
  padding-bottom: 10px;
}

.section-title {
  font-size: 1.25rem;
  font-weight: 700;
  letter-spacing: -0.01em;
  display: flex;
  align-items: center;
  gap: 8px;
}

.section-hint {
  font-size: 0.85rem;
  color: var(--theme-text-muted);
}

.sound-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 18px;
}

/* Sound Cards */
.sound-card {
  position: relative;
  background: var(--theme-surface);
  border: 1px solid var(--theme-border);
  border-radius: var(--radius-md);
  padding: 22px 20px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  cursor: pointer;
  box-shadow: var(--theme-card-shadow);
  transition: all 0.3s cubic-bezier(0.2, 0, 0, 1);
  user-select: none;
}

.sound-card:hover {
  background: var(--theme-surface-hover);
  border-color: rgba(255, 255, 255, 0.2);
  transform: translateY(-2px);
}

.sound-card.active {
  background: var(--theme-surface-active);
  border-color: var(--theme-border-active);
  box-shadow: 0 10px 28px var(--theme-glow), var(--theme-card-shadow);
}

.card-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.card-icon-container {
  width: 44px;
  height: 44px;
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.04);
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.sound-card.active .card-icon-container {
  background: var(--theme-primary);
  border-color: var(--theme-primary);
}

.card-icon {
  width: 24px;
  height: 24px;
  stroke: var(--theme-primary);
  stroke-width: 2;
  fill: none;
  stroke-linecap: round;
  stroke-linejoin: round;
  transition: stroke 0.3s ease;
}

.sound-card.active .card-icon {
  stroke: #ffffff;
}

.card-key-shortcut {
  font-size: 0.75rem;
  font-weight: 600;
  padding: 2px 7px;
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: var(--theme-text-muted);
}

.card-body {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.card-title {
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--theme-text-primary);
}

.card-desc {
  font-size: 0.88rem;
  color: var(--theme-text-muted);
  line-height: 1.4;
}

.card-status-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 4px;
  padding-top: 12px;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
}

.playing-bars {
  display: flex;
  align-items: flex-end;
  gap: 3px;
  height: 16px;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.sound-card.playing .playing-bars {
  opacity: 1;
}

.playing-bars span {
  width: 3px;
  height: 100%;
  background: var(--theme-primary);
  border-radius: 2px;
  animation: barBounce 1.2s infinite ease-in-out;
}

.playing-bars span:nth-child(2) { animation-delay: 0.2s; }
.playing-bars span:nth-child(3) { animation-delay: 0.4s; }
.playing-bars span:nth-child(4) { animation-delay: 0.1s; }

@keyframes barBounce {
  0%, 100% { height: 4px; }
  50% { height: 16px; }
}

.card-action-text {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--theme-text-muted);
}

/* Master Player Dock (Sticky Bottom) */
.player-dock {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: rgba(10, 15, 20, 0.88);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-top: 1px solid var(--theme-border);
  box-shadow: 0 -8px 32px rgba(0, 0, 0, 0.6);
  z-index: 100;
  padding: 14px 20px;
  transition: border-color 0.5s ease;
}

.player-inner {
  max-width: 1080px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 240px 1fr 340px;
  align-items: center;
  gap: 24px;
}

/* Dock Left: Now Playing Info */
.dock-now-playing {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.now-label {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--theme-text-muted);
}

.now-title {
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--theme-text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.now-status {
  font-size: 0.8rem;
  color: var(--theme-text-subtle);
  font-weight: 500;
}

/* Dock Center: Main Play Controls & Visualizer */
.dock-center-controls {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
}

.play-controls-row {
  display: flex;
  align-items: center;
  gap: 16px;
}

.play-button {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  background: var(--theme-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 16px var(--theme-glow);
  transition: all 0.25s cubic-bezier(0.2, 0, 0, 1);
}

.play-button:hover {
  background: var(--theme-primary-hover);
  transform: scale(1.06);
}

.play-button:active {
  background: var(--theme-primary-active);
  transform: scale(0.96);
}

.play-button svg {
  width: 24px;
  height: 24px;
  fill: #ffffff;
}

.hidden {
  display: none !important;
}

.visualizer-canvas {
  width: 260px;
  height: 26px;
  border-radius: 4px;
}

/* Dock Right: Volume & Sleep Timer */
.dock-right-settings {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 20px;
}

.volume-control-group {
  display: flex;
  align-items: center;
  gap: 8px;
}

.mute-btn {
  padding: 6px;
  border-radius: var(--radius-sm);
  color: var(--theme-text-muted);
  transition: color 0.2s;
}

.mute-btn:hover {
  color: var(--theme-text-primary);
}

.mute-btn svg {
  width: 20px;
  height: 20px;
  fill: currentColor;
}

.volume-slider {
  width: 90px;
  height: 6px;
  -webkit-appearance: none;
  appearance: none;
  background: rgba(255, 255, 255, 0.18);
  border-radius: 3px;
  outline: none;
  cursor: pointer;
}

.volume-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--theme-primary);
  cursor: pointer;
  box-shadow: 0 0 6px var(--theme-primary);
}

.volume-slider::-moz-range-thumb {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--theme-primary);
  border: none;
  cursor: pointer;
  box-shadow: 0 0 6px var(--theme-primary);
}

.volume-value {
  font-size: 0.8rem;
  font-variant-numeric: tabular-nums;
  color: var(--theme-text-muted);
  width: 34px;
}

.timer-group {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.timer-fieldset {
  border: none;
  display: flex;
  align-items: center;
  gap: 8px;
}

.timer-legend {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--theme-text-muted);
}

.timer-legend svg {
  width: 14px;
  height: 14px;
  stroke: currentColor;
  stroke-width: 2;
  fill: none;
}

.timer-pills {
  display: flex;
  align-items: center;
  gap: 3px;
  background: rgba(0, 0, 0, 0.45);
  padding: 3px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--theme-border);
}

.timer-pill {
  position: relative;
  cursor: pointer;
}

.timer-pill input {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
}

.timer-pill span {
  display: block;
  font-size: 0.75rem;
  font-weight: 600;
  padding: 3px 8px;
  border-radius: 4px;
  color: #f1f5f9;
  transition: all 0.2s ease;
}

.timer-pill input:checked + span {
  background: var(--theme-primary);
  color: #06130d;
  font-weight: 700;
}

:root[data-sound="storms"] .timer-pill input:checked + span {
  background: #c4b5fd;
  color: #0c0817;
}

:root[data-sound="birds"] .timer-pill input:checked + span {
  background: #fde68a;
  color: #1a1405;
}

:root[data-sound="ocean"] .timer-pill input:checked + span {
  background: #a5f3fc;
  color: #040e16;
}

:root[data-sound="crickets"] .timer-pill input:checked + span {
  background: #e9d5ff;
  color: #0c0817;
}

:root[data-sound="stream"] .timer-pill input:checked + span {
  background: #bae6fd;
  color: #040f18;
}

:root[data-sound="campfire"] .timer-pill input:checked + span {
  background: #fed7aa;
  color: #140803;
}

.timer-pill input:focus-visible + span {
  outline: 2px solid var(--theme-primary);
}

.timer-status {
  font-size: 0.72rem;
  color: var(--theme-primary);
  text-align: right;
  min-height: 1em;
}

/* Tips & Features Section */
.features-section {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 20px;
  padding: 24px;
  background: var(--theme-surface);
  border: 1px solid var(--theme-border);
  border-radius: var(--radius-lg);
  box-shadow: var(--theme-card-shadow);
  margin-top: 10px;
}

.feature-box {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.feature-box h2 {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--theme-text-primary);
}

.feature-box p {
  font-size: 0.88rem;
  color: var(--theme-text-muted);
}

.kbd-list {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 4px;
}

.kbd-list li {
  font-size: 0.82rem;
  color: var(--theme-text-muted);
}

kbd {
  font-family: monospace;
  font-size: 0.8rem;
  padding: 2px 6px;
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.15);
  color: var(--theme-text-primary);
}

/* Feature / Companion Banner */
.feature-banner {
  background: var(--theme-surface);
  border: 1px solid var(--theme-border);
  border-radius: var(--radius-md);
  padding: 1.25rem 1.5rem;
  box-shadow: var(--theme-card-shadow);
  transition: all 0.5s ease;
}

.feature-banner-content {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.feature-banner-title {
  font-size: 1.125rem;
  font-weight: 700;
  color: var(--theme-text-primary);
  line-height: 1.3;
}

.feature-banner-desc {
  font-size: 0.875rem;
  color: var(--theme-text-muted);
  margin-top: 0.25rem;
  line-height: 1.5;
}

.feature-banner-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  align-self: flex-start;
  padding: 0.55rem 1.15rem;
  border-radius: var(--radius-sm);
  background: var(--theme-surface-hover);
  border: 1px solid var(--theme-border);
  color: var(--theme-text-primary);
  font: 600 0.875rem var(--font-sans);
  text-decoration: none;
  transition: all 0.2s ease;
}

.feature-banner-btn:hover {
  background: var(--theme-primary);
  color: var(--theme-bg-base);
  border-color: var(--theme-primary);
  transform: translateY(-1px);
}

.feature-banner-btn .icon-arrow {
  width: 1rem;
  height: 1rem;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
  fill: none;
  transition: transform 0.2s ease;
}

.feature-banner-btn:hover .icon-arrow {
  transform: translateX(-3px);
}

@media (min-width: 48rem) {
  .feature-banner-content {
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
  }
  .feature-banner-btn {
    flex-shrink: 0;
    align-self: center;
  }
}

/* Footer */
.site-footer,
.footer {
  text-align: center;
  font-size: 0.875rem;
  color: var(--theme-text-muted);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.35rem;
  padding: 24px 0;
}

.footer .app-version {
  font-size: 0.75rem;
  opacity: 0.85;
}

/* Responsive adjustments */
@media (max-width: 860px) {
  .player-dock {
    padding: 10px 18px max(10px, env(safe-area-inset-bottom));
  }

  .player-inner {
    grid-template-columns: 1fr auto;
    gap: 12px 18px;
    align-items: center;
  }

  .dock-now-playing {
    text-align: left;
  }

  .dock-right-settings {
    grid-column: 1 / -1;
    justify-content: space-between;
    width: 100%;
    padding-top: 8px;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
  }

  .app-container {
    padding-bottom: 130px;
  }
}

/* Portrait / Vertically held mobile phone: compact sticky dock */
@media (max-width: 640px) {
  .player-dock {
    padding: 6px 12px max(6px, env(safe-area-inset-bottom));
    box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.6);
  }

  .player-inner {
    display: grid;
    grid-template-columns: 1fr auto;
    grid-template-areas:
      "info play"
      "controls controls";
    gap: 4px 10px;
    align-items: center;
  }

  .dock-now-playing {
    grid-area: info;
    text-align: left;
    display: flex;
    flex-direction: row;
    align-items: baseline;
    gap: 6px;
    min-width: 0;
  }

  .now-label {
    display: none;
  }

  .now-title {
    font-size: 0.92rem;
    font-weight: 700;
    max-width: 160px;
  }

  .now-status {
    font-size: 0.72rem;
  }

  .dock-center-controls {
    grid-area: play;
    flex-direction: row;
    gap: 0;
    justify-content: flex-end;
  }

  .play-controls-row {
    gap: 0;
  }

  .play-button {
    width: 40px;
    height: 40px;
    min-width: 40px;
    min-height: 40px;
    box-shadow: 0 2px 10px var(--theme-glow);
  }

  .play-button svg {
    width: 18px;
    height: 18px;
  }

  .visualizer-canvas {
    display: none;
  }

  .dock-right-settings {
    grid-area: controls;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 6px;
    width: 100%;
    padding-top: 3px;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
  }

  .volume-control-group {
    display: flex;
    align-items: center;
    gap: 2px;
    flex-shrink: 0;
  }

  .mute-btn {
    padding: 3px;
    min-width: 26px;
    min-height: 26px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
  }

  .mute-btn svg {
    width: 15px;
    height: 15px;
  }

  .volume-slider {
    width: 52px;
    height: 4px;
  }

  .volume-slider::-webkit-slider-thumb {
    width: 12px;
    height: 12px;
  }

  .volume-slider::-moz-range-thumb {
    width: 12px;
    height: 12px;
  }

  .volume-value {
    font-size: 0.7rem;
    width: 24px;
  }

  .timer-group {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 4px;
  }

  .timer-fieldset {
    padding: 0;
    margin: 0;
    border: none;
    min-width: 0;
    gap: 2px;
  }

  .timer-legend {
    display: none;
  }

  .timer-pills {
    padding: 2px;
    gap: 2px;
  }

  .timer-pill span {
    padding: 2px 5px;
    font-size: 0.68rem;
    min-height: 20px;
    display: inline-flex;
    align-items: center;
  }

  .timer-status {
    font-size: 0.68rem;
    min-height: 0;
    white-space: nowrap;
  }

  .timer-status:empty {
    display: none;
  }

  .app-container {
    padding-bottom: 88px;
  }
}

@media (max-width: 540px) {
  .site-nav {
    flex-direction: column;
    align-items: stretch;
    gap: 10px;
  }

  .nav-track {
    justify-content: center;
  }

  .offline-badge {
    align-self: center;
  }

  .logo-title {
    font-size: 2rem;
  }

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

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    transition: none !important;
    animation: none !important;
  }
}
