:root {
  color-scheme: dark;
  --button-1-color: #9bd8ff;
  --button-2-color: #ff8f9d;
  --button-3-color: #77b8ff;
  --button-4-color: #ff9de2;
  --button-5-color: #80f0df;
  --button-6-color: #c2a6ff;
}

* { box-sizing: border-box; }

html,
body {
  width: 100%;
  height: 100%;
  min-height: 100%;
  margin: 0;
  overflow: hidden;
  overscroll-behavior: none;
  background: #050209;
}

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

body {
  min-height: 100svh;
  min-height: 100dvh;
  touch-action: none;
}

.brand-title {
  position: fixed;
  z-index: 5;
  top: max(28px, env(safe-area-inset-top));
  left: max(34px, env(safe-area-inset-left));
  color: #fff;
  font-family: Didot, "Bodoni MT", "Times New Roman", serif;
  font-size: clamp(1.25rem, 2.1vw, 2rem);
  font-weight: 500;
  line-height: 1;
  letter-spacing: 0.22em;
  white-space: nowrap;
  background: linear-gradient(115deg, #fff 10%, #d9d1e5 48%, #fff 78%);
  background-clip: text;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  filter: drop-shadow(0 2px 7px rgba(0, 0, 0, 0.85));
  pointer-events: none;
  user-select: none;
}

.music-player {
  position: fixed;
  z-index: 5;
  top: auto;
  bottom: 110px;
  left: 50%;
  width: min(92vw, 520px);
  padding: 22px;
  color: #fff;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: linear-gradient(145deg, rgba(5, 3, 9, 0.82), rgba(15, 8, 22, 0.72));
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 22px;
  box-shadow: 0 18px 55px rgba(0, 0, 0, 0.38);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  transform: translateX(-50%);
  opacity: 0;
  visibility: hidden;
  transition: opacity 220ms ease, visibility 220ms ease, margin-top 300ms ease;
}

.music-player.is-ready { opacity: 1; visibility: visible; }

.player-controls { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; }
.player-options { display: flex; justify-content: center; gap: 7px; margin-top: 8px; }
.player-options .player-button { min-height: 31px; padding: 0 12px; font-size: 0.64rem; border-radius: 8px; }

.player-button {
  min-height: 45px;
  padding: 0 9px;
  color: #ddd3e7;
  font: 650 0.75rem/1 system-ui, sans-serif;
  letter-spacing: 0.02em;
  background: rgba(255, 255, 255, 0.07);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 11px;
  cursor: pointer;
  transition: background 160ms ease, transform 160ms ease, color 160ms ease;
}

.player-button:hover { color: #fff; background: rgba(255, 255, 255, 0.14); transform: translateY(-1px); }
.player-button--primary { color: #fff; background: linear-gradient(135deg, rgba(183, 77, 255, 0.7), rgba(116, 69, 218, 0.65)); }
.player-button.is-active { color: #fff; background: rgba(177, 82, 247, 0.55); border-color: rgba(224, 177, 255, 0.42); }

.now-playing { display: flex; align-items: end; justify-content: space-between; gap: 15px; margin: 20px 2px 10px; }
.now-playing__details { min-width: 0; display: grid; gap: 3px; }
.now-playing__label { color: #bd91d9; font-size: 0.62rem; font-weight: 750; letter-spacing: 0.16em; }
.now-playing strong { overflow: hidden; font: 600 1rem/1.3 system-ui, sans-serif; text-overflow: ellipsis; white-space: nowrap; }
.player-time { flex: none; color: rgba(255, 255, 255, 0.62); font-size: 0.72rem; }

.progress-bar,
.volume-control input { accent-color: #c177ef; cursor: pointer; }
.progress-bar { display: block; width: 100%; height: 5px; margin: 0; }
.volume-control { display: flex; align-items: center; justify-content: flex-end; gap: 7px; margin: 11px 0 16px; font-size: 0.75rem; }
.volume-control input { width: 100px; height: 4px; }
.mute-button { display: grid; place-items: center; width: 28px; height: 28px; padding: 0; color: #fff; font-size: 0.82rem; background: rgba(255, 255, 255, 0.06); border: 0; border-radius: 50%; cursor: pointer; }
.mute-button:hover { background: rgba(255, 255, 255, 0.13); }
.mute-button.is-muted { background: rgba(193, 75, 119, 0.2); }

.playlist-wrap { overflow: hidden; border: 1px solid rgba(255, 255, 255, 0.07); border-radius: 14px; background: rgba(0, 0, 0, 0.22); }
.playlist-title { display: flex; justify-content: space-between; padding: 11px 14px; color: #cba8df; font-size: 0.68rem; font-weight: 750; letter-spacing: 0.14em; border-bottom: 1px solid rgba(255, 255, 255, 0.07); }
.playlist-title span { color: rgba(255, 255, 255, 0.42); font-weight: 500; letter-spacing: 0; }
.playlist { max-height: 190px; margin: 0; padding: 5px; overflow-y: auto; list-style: none; counter-reset: tracks; }
.playlist-item { counter-increment: tracks; display: grid; grid-template-columns: 30px 1fr auto; align-items: center; gap: 8px; width: 100%; padding: 9px; color: rgba(255, 255, 255, 0.68); background: transparent; border: 0; border-radius: 9px; text-align: left; cursor: pointer; }
.playlist-item::before { content: counter(tracks, decimal-leading-zero); color: rgba(255, 255, 255, 0.3); font-size: 0.66rem; }
.playlist-item:hover { color: #fff; background: rgba(255, 255, 255, 0.07); }
.playlist-item.is-playing { color: #fff; background: rgba(170, 76, 231, 0.2); }
.playlist-item.is-missing::after { content: "MP3 LIPSĂ"; color: #ff9aaf; font-size: 0.52rem; font-weight: 750; }
.playlist-empty { padding: 18px 14px; color: rgba(255, 255, 255, 0.5); font-size: 0.78rem; text-align: center; }

/* Player construit după modelul LotusSport */
.music-player { gap: 0; }
#npTitle { overflow: hidden; color: #fff; font-size: 1.05rem; font-weight: 600; text-align: center; text-overflow: ellipsis; white-space: nowrap; }
#npAction { margin: 5px 0 12px; color: #c177ef; font-size: 0.74rem; text-align: center; }
.music-player .plyr { --plyr-color-main: #9b59c5; --plyr-audio-controls-background: transparent; margin-bottom: 10px; }
.music-player .plyr__controls { padding-right: 4px; padding-left: 4px; color: #fff; }
.music-player .plyr__time { color: rgba(255, 255, 255, 0.72); }
.lotus-controls { display: flex; justify-content: center; gap: 7px; margin: 2px 0 12px; }
.lotus-controls button { padding: 5px 11px; color: #c9a4df; font-size: 0.875rem; background: transparent; border: 1px solid rgba(255, 255, 255, 0.1); border-radius: 8px; cursor: pointer; transition: 160ms ease; }
.lotus-controls button:hover { color: #fff; border-color: rgba(255, 255, 255, 0.3); }
.lotus-controls button.active { color: #e5a8ff; background: rgba(172, 78, 226, 0.18); border-color: rgba(211, 132, 255, 0.45); }
.playlist-toggle { display: block; width: max-content; margin: 0 auto; padding: 4px 14px; color: rgba(255, 255, 255, 0.68); font: 650 0.875rem/1 system-ui, sans-serif; background: rgba(255, 255, 255, 0.05); border: 1px solid rgba(255, 255, 255, 0.1); border-radius: 999px; cursor: pointer; transition: color 160ms ease, background 160ms ease, border-color 160ms ease; }
.playlist-toggle:hover,
.playlist-toggle[aria-expanded="true"] { color: #fff; background: rgba(169, 75, 222, 0.18); border-color: rgba(205, 134, 244, 0.35); }
.playlist-panel { max-height: 0; margin-top: 0; overflow: hidden; opacity: 0; visibility: hidden; transition: max-height 360ms ease, margin-top 220ms ease, opacity 180ms ease, visibility 180ms ease; }
.playlist-panel.is-open { max-height: 270px; margin-top: 12px; opacity: 1; visibility: visible; }
.track-search input { width: 100%; margin-bottom: 10px; padding: 10px 12px; color: #fff; font: 16px/1.2 system-ui, sans-serif; background: rgba(0, 0, 0, 0.28); border: 1px solid rgba(255, 255, 255, 0.08); border-radius: 9px; outline: none; touch-action: manipulation; }
.track-search input:focus { font-size: 16px !important; border-color: rgba(199, 125, 241, 0.48); }
#plList { max-height: 190px; margin: 0; padding: 4px; overflow-y: auto; list-style: none; border-top: 1px solid rgba(255, 255, 255, 0.08); }
#plList li { padding: 8px 9px; border-radius: 8px; cursor: pointer; transition: background 150ms ease; }
#plList li:hover { background: rgba(255, 255, 255, 0.06); }
#plList li.plSel { background: linear-gradient(90deg, rgba(166, 73, 221, 0.22), transparent); }
.plItem { display: grid; grid-template-columns: 28px minmax(0, 1fr) 45px; align-items: center; gap: 7px; }
.plNum { color: #c177ef; font-size: 0.75rem; }
.plTitle { overflow: hidden; color: rgba(255, 255, 255, 0.86); font-size: 0.875rem; text-overflow: ellipsis; white-space: nowrap; }
.plLength { color: rgba(255, 255, 255, 0.48); font-size: 0.75rem; text-align: right; }
#plList::-webkit-scrollbar { width: 6px; }
#plList::-webkit-scrollbar-thumb { background: rgba(255, 255, 255, 0.25); border-radius: 4px; }

.slideshow,
.slide {
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100vh;
  height: 100dvh;
}

.slideshow { z-index: 0; }

.slide {
  background-position: center;
  background-repeat: no-repeat;
  background-size: cover;
  opacity: 0;
  transform: scale(1.035);
  transition: opacity 2.4s ease-in-out, transform 8s ease-out;
  will-change: opacity, transform;
}

.slide::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(8, 1, 14, 0.34), transparent 45%);
}

.slide--visible { opacity: 1; transform: scale(1); }

.external-links {
  position: fixed;
  z-index: 4;
  bottom: max(32px, env(safe-area-inset-bottom));
  left: 50%;
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: clamp(6px, 0.8vw, 12px);
  width: min(96vw, 1320px);
  transform: translateX(-50%);
}

.external-link {
  isolation: isolate;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 0;
  min-height: 60px;
  padding: 0 clamp(14px, 1.6vw, 28px);
  overflow: hidden;
  color: #fff;
  font: 650 clamp(0.86rem, 1.3vw, 1.2rem)/1 system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  letter-spacing: 0.045em;
  text-decoration: none;
  background: rgba(0, 0, 0, 0.4);
  border: none;
  border-radius: 17px;
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.06), inset 0 1px rgba(255, 255, 255, 0.015);
  backdrop-filter: blur(5px);
  -webkit-backdrop-filter: blur(5px);
  transition: transform 180ms ease, border-color 180ms ease, background 180ms ease, box-shadow 180ms ease;
}

.external-link::before {
  content: "";
  position: absolute;
  z-index: -2;
  inset: 0;
  border-radius: inherit;
  background: radial-gradient(ellipse at 18% 35%, rgba(48, 67, 112, 0.38), transparent 38%), radial-gradient(ellipse at 78% 62%, rgba(61, 35, 91, 0.35), transparent 42%), linear-gradient(135deg, rgba(0, 0, 3, 0.92), rgba(8, 8, 16, 0.76), rgba(1, 1, 6, 0.9));
  opacity: 0.175;
}

.external-link::after {
  content: "";
  position: absolute;
  z-index: -1;
  inset: 0;
  border-radius: inherit;
  background: radial-gradient(circle, #fff 0 0.75px, transparent 1.2px), radial-gradient(circle, #fff 0 0.5px, transparent 1px), radial-gradient(circle, rgba(159, 214, 255, 0.95) 0 0.7px, transparent 1.2px), radial-gradient(circle, rgba(230, 210, 255, 0.95) 0 0.55px, transparent 1.05px), radial-gradient(circle, rgba(143, 200, 255, 0.85) 0 0.6px, transparent 1.1px);
  background-size: 105px 91px, 137px 113px, 169px 127px, 193px 149px, 151px 103px;
  background-position: 12px 18px, 58px 41px, 91px 9px, 27px 67px, 119px 32px;
  filter: drop-shadow(0 0 2px rgba(185, 220, 255, 0.9));
  animation: moving-stars 7s linear infinite;
}

.external-link > span { position: relative; z-index: 1; text-shadow: 0 1px 8px rgba(0, 0, 0, 0.75); }
.external-link:nth-child(1) { color: var(--button-1-color); }
.external-link:nth-child(2) { color: var(--button-2-color); }
.external-link:nth-child(3) { color: var(--button-3-color); }
.external-link:nth-child(4) { color: var(--button-4-color); }
.external-link:nth-child(5) { color: var(--button-5-color); }
.external-link:nth-child(6) { color: var(--button-6-color); }

.external-link:hover,
.external-link:focus-visible {
  transform: translateY(-4px);
  background: rgba(0, 0, 0, 0.7);
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.18), 0 0 7px rgba(98, 157, 211, 0.1);
  outline: none;
}

.ground-glow {
  position: fixed;
  z-index: 1;
  right: -10%;
  bottom: -100px;
  left: -10%;
  height: 220px;
  pointer-events: none;
  background: radial-gradient(ellipse at center, rgba(181, 82, 255, 0.18), transparent 68%);
  filter: blur(18px);
}

.cosmic-particles {
  position: fixed;
  z-index: 2;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
}

.cosmic-dot {
  position: absolute;
  bottom: -8px;
  width: 3px;
  height: 3px;
  border-radius: 50%;
  background: #d49aff;
  box-shadow: 0 0 5px rgba(213, 142, 255, 0.8), 0 0 12px rgba(183, 76, 255, 0.38);
  opacity: 0;
  animation: float-cosmic linear infinite;
  will-change: transform, opacity;
}

@keyframes float-cosmic {
  0% { transform: translate3d(0, 0, 0) scale(0.7); opacity: 0; }
  12% { opacity: var(--alpha, 0.8); }
  70% { opacity: calc(var(--alpha, 0.8) * 0.7); }
  100% { transform: translate3d(var(--drift, 0px), calc(var(--rise, 300px) * -1), 0) scale(1.1); opacity: 0; }
}

@keyframes moving-stars {
  0% { background-position: 12px 18px, 58px 41px, 91px 9px, 27px 67px, 119px 32px; opacity: 0.82; }
  100% { background-position: 12px -73px, 58px -72px, 91px -118px, 27px -82px, 119px -71px; opacity: 0.82; }
}

@media (max-width: 900px) {
  html,
  body { height: 100%; min-height: 100%; overflow-x: hidden; overflow-y: hidden; overscroll-behavior-y: none; }
  body { min-height: 100dvh; padding-bottom: max(10px, env(safe-area-inset-bottom)); touch-action: pan-y; }
  html.playlist-expanded,
  body.playlist-expanded { height: auto; overflow-y: auto; overscroll-behavior-y: auto; }
  .brand-title { top: max(20px, env(safe-area-inset-top)); left: max(20px, env(safe-area-inset-left)); font-size: clamp(1.05rem, 5vw, 1.35rem); letter-spacing: 0.18em; }
  .music-player { position: relative; top: auto; bottom: auto; left: auto; width: min(86vw, 520px); margin: clamp(68px, 9vh, 96px) auto 12px; padding: 14px; border-radius: 17px; transform: none; }
  .music-player.playlist-open { margin-top: clamp(20px, 6vh, 60px); }
  .player-button { min-height: 40px; font-size: 0.72rem; }
  .player-button > span:not(.button-icon) { display: none; }
  .player-options .player-button { min-width: 74px; min-height: 29px; }
  .player-options .player-button span { display: inline; }
  .now-playing { margin-top: 14px; }
  .playlist { max-height: min(24vh, 145px); }
  .track-search input { font-size: 16px !important; }
  .slide { background-position: 50% center; transform: scale(1.02); }
  .ground-glow { bottom: -70px; height: 170px; filter: blur(12px); }
  .cosmic-dot { box-shadow: 0 0 5px rgba(213, 142, 255, 0.72); }
  .external-links { position: relative; bottom: auto; left: auto; grid-template-columns: minmax(0, 1fr); gap: 7px; width: min(84vw, 500px); margin: 0 auto; transform: none; }
  .external-link { justify-content: center; min-height: 60px; padding: 0 22px; border-radius: 12px; font-size: clamp(0.88rem, 3.8vw, 1.05rem); letter-spacing: 0.035em; }
}

@media (max-height: 480px) and (orientation: landscape) {
  .external-links { grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 5px; width: 96vw; }
  .external-link { min-height: 44px; padding: 0 14px; font-size: 0.78rem; }
}

@media (max-width: 480px) and (orientation: portrait) { .slide { background-position: center center; } }
@media (min-width: 1600px) { .slide { background-position: center 42%; } }

@media (prefers-reduced-motion: reduce) {
  .slide { transform: none; transition: opacity 0.8s ease-in-out; }
  .cosmic-dot { display: none; }
  .external-link { transition: none; }
  .external-link::before,
  .external-link::after { animation: none; }
}
