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

html, body {
  width: 100%;
  height: 100%;
  overflow: hidden;
  background: #000;
  touch-action: manipulation;
}

#slideshow {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #000;
}

#slideshow img {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  max-width: 100%;
  max-height: 100%;
  width: auto;
  height: auto;
  object-fit: contain;
  object-position: center;
  opacity: 0;
  transition: none;
}

#slideshow img.active {
  opacity: 1;
}

#overlay {
  position: fixed;
  inset: 0;
  pointer-events: none;
  background: radial-gradient(ellipse at center, transparent 40%, rgba(0,0,0,0.35) 100%);
  z-index: 10;
}

#title {
  position: fixed;
  bottom: 2rem;
  left: 50%;
  transform: translateX(-50%);
  z-index: 20;
  font-family: "Georgia", "Times New Roman", serif;
  font-size: clamp(1rem, 3vw, 1.6rem);
  letter-spacing: 0.35em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.55);
  text-shadow: 0 2px 20px rgba(0,0,0,0.8);
  pointer-events: none;
  transition: opacity 0.6s ease;
}

#counter {
  position: fixed;
  top: 1.2rem;
  left: 1.5rem;
  z-index: 20;
  font-family: system-ui, sans-serif;
  font-size: 0.75rem;
  color: rgba(255,255,255,0.3);
  pointer-events: none;
}

#stop-btn {
  position: fixed;
  top: 1rem;
  right: 1rem;
  z-index: 100;
  width: 2.5rem;
  height: 2.5rem;
  border: 1px solid rgba(255, 255, 255, 0.35);
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.45);
  color: rgba(255, 255, 255, 0.85);
  font-size: 1.4rem;
  line-height: 1;
  cursor: pointer;
  display: none;
  align-items: center;
  justify-content: center;
  backdrop-filter: blur(4px);
  transition: background 0.2s ease, border-color 0.2s ease, transform 0.2s ease;
}

#stop-btn:hover {
  background: rgba(0, 0, 0, 0.7);
  border-color: rgba(255, 255, 255, 0.7);
  transform: scale(1.05);
}

#stop-btn.visible {
  display: flex;
}

#stop-btn,
#display-mode-btn,
#music-controls,
#speed-controls,
#counter {
  transition: opacity 0.45s ease;
}

body.slideshow-running.controls-hidden {
  cursor: none;
}

body.slideshow-running.controls-hidden #stop-btn.visible,
body.slideshow-running.controls-hidden #display-mode-btn.visible,
body.slideshow-running.controls-hidden #music-controls.visible,
body.slideshow-running.controls-hidden #speed-controls.visible,
body.slideshow-running.controls-hidden #counter {
  opacity: 0;
  pointer-events: none;
}

#music-controls {
  position: fixed;
  bottom: 5.5rem;
  left: 50%;
  transform: translateX(-50%);
  z-index: 100;
  display: none;
  align-items: center;
  gap: 0.65rem;
  padding: 0.55rem 0.9rem;
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.55);
  backdrop-filter: blur(6px);
}

#music-controls.visible {
  display: flex;
}

.music-ctrl-btn {
  width: 2.2rem;
  height: 2.2rem;
  border: 1px solid rgba(255, 255, 255, 0.25);
  border-radius: 50%;
  background: transparent;
  color: rgba(255, 255, 255, 0.85);
  font-size: 0.95rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  line-height: 1;
  flex-shrink: 0;
  transition: background 0.2s ease, border-color 0.2s ease, transform 0.2s ease;
}

.music-ctrl-btn svg {
  width: 1.05rem;
  height: 1.05rem;
  display: block;
  pointer-events: none;
}

.music-ctrl-btn:hover {
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 255, 255, 0.55);
  transform: scale(1.05);
}

.music-ctrl-btn--active {
  background: rgba(255, 255, 255, 0.15);
  border-color: rgba(255, 255, 255, 0.7);
  color: #fff;
}

.music-ctrl-btn--active:hover {
  background: rgba(255, 255, 255, 0.22);
}

#now-playing {
  font-family: system-ui, sans-serif;
  font-size: 0.72rem;
  color: rgba(255, 255, 255, 0.55);
  max-width: 180px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  padding: 0 0.25rem;
}

#speed-controls {
  position: fixed;
  top: 1rem;
  left: 50%;
  transform: translateX(-50%);
  z-index: 100;
  display: none;
  align-items: center;
  gap: 0.4rem;
  padding: 0.45rem 0.65rem;
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.55);
  backdrop-filter: blur(6px);
}

#speed-controls.visible {
  display: flex;
}

.speed-ctrl-btn {
  font-family: system-ui, sans-serif;
  font-size: 0.68rem;
  letter-spacing: 0.04em;
  padding: 0.35rem 0.6rem;
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 999px;
  background: transparent;
  color: rgba(255, 255, 255, 0.55);
  cursor: pointer;
  transition: all 0.2s ease;
}

.speed-ctrl-btn:hover {
  border-color: rgba(255, 255, 255, 0.45);
  color: rgba(255, 255, 255, 0.85);
}

.speed-ctrl-btn.active {
  background: rgba(255, 255, 255, 0.12);
  border-color: rgba(255, 255, 255, 0.65);
  color: #fff;
}

#start-screen {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  overflow-y: auto;
  padding: 2.5rem 1rem 3rem;
  background: #0a0a0a;
  cursor: default;
  transition: opacity 0.8s ease;
}

#start-screen.hidden {
  opacity: 0;
  pointer-events: none;
}

#start-screen h1 {
  font-family: "Georgia", serif;
  font-size: clamp(2rem, 6vw, 4rem);
  font-weight: 300;
  letter-spacing: 0.2em;
  color: #fff;
  text-transform: uppercase;
  margin-bottom: 1rem;
}

#start-screen p {
  font-family: system-ui, sans-serif;
  font-size: 0.9rem;
  color: rgba(255,255,255,0.45);
  letter-spacing: 0.15em;
}

#start-screen .my-loa-link {
  margin-top: 0.75rem;
  font-family: system-ui, sans-serif;
  font-size: 0.82rem;
  letter-spacing: 0.06em;
  color: rgba(255,255,255,0.5);
  text-decoration: none;
  transition: color 0.2s ease;
}

#start-screen .my-loa-link:hover {
  color: rgba(255,255,255,0.9);
}

#auth-bar {
  position: fixed;
  top: 1rem;
  right: 1rem;
  z-index: 110;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.auth-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-family: system-ui, sans-serif;
  font-size: 0.78rem;
  letter-spacing: 0.06em;
  padding: 0.5rem 0.95rem;
  border: 1px solid rgba(255,255,255,0.25);
  border-radius: 999px;
  background: rgba(0,0,0,0.35);
  color: rgba(255,255,255,0.85);
  text-decoration: none;
  backdrop-filter: blur(6px);
  transition: background 0.2s ease, border-color 0.2s ease, color 0.2s ease;
  white-space: nowrap;
}

.auth-btn:hover {
  background: rgba(255,255,255,0.1);
  border-color: rgba(255,255,255,0.55);
  color: #fff;
}

.auth-btn-primary {
  background: rgba(255,255,255,0.12);
  border-color: rgba(255,255,255,0.45);
}

body.slideshow-running #auth-bar {
  display: none;
}

#auth-bar .auth-user {
  font-size: 0.75rem;
  color: rgba(255,255,255,0.45);
  margin-right: 0.25rem;
}

#my-loa-promo {
  margin-top: 1.25rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.65rem;
  width: 100%;
  max-width: 360px;
}

#my-loa-promo p {
  letter-spacing: 0.08em;
  font-size: 0.82rem;
  text-align: center;
  color: rgba(255,255,255,0.45);
}

#my-loa-promo .auth-btn {
  width: 100%;
  max-width: 320px;
  min-height: 44px;
  padding: 0.65rem 1.25rem;
  font-size: 0.85rem;
  letter-spacing: 0.08em;
  white-space: normal;
  text-align: center;
  line-height: 1.3;
}

#speed-picker {
  margin-top: 2rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.75rem;
}

#speed-picker label {
  font-family: system-ui, sans-serif;
  font-size: 0.7rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: rgba(255,255,255,0.35);
}

#speed-options {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.5rem;
  max-width: 420px;
}

.speed-btn {
  font-family: system-ui, sans-serif;
  font-size: 0.78rem;
  letter-spacing: 0.05em;
  padding: 0.55rem 0.9rem;
  border: 1px solid rgba(255,255,255,0.2);
  border-radius: 999px;
  background: transparent;
  color: rgba(255,255,255,0.55);
  cursor: pointer;
  transition: all 0.2s ease;
}

.speed-btn:hover {
  border-color: rgba(255,255,255,0.45);
  color: rgba(255,255,255,0.85);
}

.speed-btn.active {
  background: rgba(255,255,255,0.12);
  border-color: rgba(255,255,255,0.65);
  color: #fff;
}

#music-picker {
  margin-top: 1.75rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.75rem;
  width: min(520px, 100%);
}

#music-picker label {
  font-family: system-ui, sans-serif;
  font-size: 0.7rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: rgba(255,255,255,0.35);
}

#track-list {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
  max-height: 220px;
  overflow-y: auto;
  padding-right: 0.25rem;
}

.track-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.65rem 0.85rem;
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: 10px;
  background: rgba(255,255,255,0.03);
  transition: border-color 0.2s ease, background 0.2s ease;
}

.track-item.active {
  border-color: rgba(255,255,255,0.45);
  background: rgba(255,255,255,0.08);
}

.track-item.previewing {
  border-color: rgba(120, 200, 255, 0.55);
}

.track-name {
  font-family: system-ui, sans-serif;
  font-size: 0.82rem;
  color: rgba(255,255,255,0.75);
  text-align: left;
  flex: 1;
  min-width: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.track-preview-btn {
  flex-shrink: 0;
  font-family: system-ui, sans-serif;
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 0.4rem 0.75rem;
  border: 1px solid rgba(255,255,255,0.25);
  border-radius: 999px;
  background: transparent;
  color: rgba(255,255,255,0.65);
  cursor: pointer;
  transition: all 0.2s ease;
}

.track-preview-btn:hover {
  border-color: rgba(255,255,255,0.5);
  color: #fff;
}

.track-item.previewing .track-preview-btn {
  border-color: rgba(120, 200, 255, 0.7);
  color: #fff;
  background: rgba(120, 200, 255, 0.12);
}

#start-btn {
  margin-top: 2rem;
  width: 64px;
  height: 64px;
  border: 1px solid rgba(255,255,255,0.3);
  border-radius: 50%;
  background: transparent;
  color: rgba(255,255,255,0.6);
  font-size: 1.4rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  animation: pulse 2s ease-in-out infinite;
  transition: border-color 0.2s ease, color 0.2s ease, transform 0.2s ease;
}

#start-btn:hover:not(:disabled) {
  border-color: rgba(255,255,255,0.6);
  color: #fff;
  transform: scale(1.06);
}

#start-btn:disabled {
  opacity: 0.35;
  cursor: not-allowed;
  animation: none;
}

@keyframes pulse {
  0%, 100% { transform: scale(1); opacity: 0.6; }
  50% { transform: scale(1.08); opacity: 1; }
}

#display-mode-btn {
  position: fixed;
  top: 1rem;
  right: 4rem;
  z-index: 100;
  width: 2.5rem;
  height: 2.5rem;
  border: 1px solid rgba(255, 255, 255, 0.35);
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.45);
  color: rgba(255, 255, 255, 0.85);
  cursor: pointer;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 0;
  backdrop-filter: blur(4px);
  transition: background 0.2s ease, border-color 0.2s ease, transform 0.2s ease, opacity 0.45s ease;
}

#display-mode-btn svg {
  width: 1.05rem;
  height: 1.05rem;
  display: block;
  pointer-events: none;
}

#display-mode-btn:hover {
  background: rgba(0, 0, 0, 0.7);
  border-color: rgba(255, 255, 255, 0.7);
  transform: scale(1.05);
}

#display-mode-btn.visible {
  display: flex;
}

body:not(.slideshow-running) #title,
body:not(.slideshow-running) #overlay {
  visibility: hidden;
}

body.slideshow-fullpage.slideshow-running,
body.slideshow-fullpage.slideshow-running #slideshow,
body.slideshow-native-fs-fallback.slideshow-running,
body.slideshow-native-fs-fallback.slideshow-running #slideshow {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  min-height: 100%;
  z-index: 50;
}

body.slideshow-fullpage.slideshow-running #slideshow,
body.slideshow-native-fs-fallback.slideshow-running #slideshow {
  z-index: 1;
}

.slideshow-page--play #start-screen {
  padding-top: 4.5rem;
}

.slideshow-page--play #start-screen h1 {
  font-size: clamp(1.4rem, 5vw, 2.5rem);
  letter-spacing: 0.15em;
  margin-bottom: 0.5rem;
  text-align: center;
  max-width: 90vw;
}

.slideshow-page--home #start-screen h1 {
  font-size: clamp(2rem, 6vw, 4rem);
  letter-spacing: 0.2em;
}

#user-nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 110;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.75rem 1rem;
  border-bottom: 1px solid rgba(255,255,255,0.08);
  background: rgba(10,10,10,0.92);
  backdrop-filter: blur(8px);
  font-family: system-ui, sans-serif;
}

#user-nav .nav-brand {
  font-family: Georgia, serif;
  font-size: 0.82rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: rgba(255,255,255,0.7);
  white-space: nowrap;
}

#user-nav .nav-user {
  font-size: 0.78rem;
  color: rgba(255,255,255,0.45);
  white-space: nowrap;
}

#user-nav .nav-links {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  flex-wrap: wrap;
  justify-content: flex-end;
}

#user-nav a {
  font-size: 0.78rem;
  color: rgba(255,255,255,0.75);
  text-decoration: none;
  padding: 0.35rem 0.7rem;
  border: 1px solid rgba(255,255,255,0.15);
  border-radius: 999px;
  transition: background 0.2s ease, color 0.2s ease, border-color 0.2s ease;
}

#user-nav a:hover {
  color: #fff;
  background: rgba(255,255,255,0.08);
  border-color: rgba(255,255,255,0.35);
}

#user-nav a.nav-primary {
  background: rgba(255,255,255,0.1);
  border-color: rgba(255,255,255,0.3);
}

body.slideshow-running #user-nav {
  opacity: 0;
  pointer-events: none;
}
