:root {
  --bg-dark: #241512;
  --bordeaux: #682b2b;
  --bordeaux-light: #8d4944;
  --cream: #f2e4cf;
  --cream-soft: #ead8bf;
  --gold: #d0a766;
  --gold-light: #f2d18a;
  --gold-dark: #7a552c;
  --brown: #3f2924;
  --ink: #21120f;
  --glass: rgba(37, 22, 18, 0.56);
  --glass-light: rgba(255, 246, 230, 0.08);
  --line: rgba(208, 167, 102, 0.34);
  --shadow: rgba(0, 0, 0, 0.34);
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
  min-height: 100%;
}

body {
  font-family: "Cormorant Garamond", serif;
  color: var(--cream);
  background: var(--bg-dark);
  overflow-x: hidden;
}

/* SFONDO */

.bg-layer {
  position: fixed;
  inset: 0;
  background: url("../assets/images/sfondo-circus.jpg") center center / cover no-repeat;
  z-index: -3;
}

.bg-overlay {
  position: fixed;
  inset: 0;
  background:
    radial-gradient(circle at center, rgba(255, 236, 195, 0.12), transparent 48%),
    linear-gradient(to bottom, rgba(28, 13, 11, 0.48), rgba(28, 13, 11, 0.78));
  z-index: -2;
}

/* DECORAZIONI CADENTI */

.decorations {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 5;
  overflow: hidden;
}

.deco {
  position: absolute;
  top: -70px;
  opacity: 0;
  animation-name: floatDown;
  animation-timing-function: linear;
  animation-iteration-count: infinite;
  filter: drop-shadow(0 4px 8px rgba(0,0,0,0.26));
}

.star {
  color: var(--gold-light);
  font-size: 28px;
  text-shadow: 0 0 12px rgba(242, 209, 138, 0.35);
}

/* Fettina di torta disegnata in CSS, senza immagini */
.cake {
  width: 36px;
  height: 28px;
}

.cake::before {
  content: "";
  position: absolute;
  inset: 0;
  clip-path: polygon(0 100%, 100% 100%, 24% 0);
  background:
    linear-gradient(135deg, #f2dcc1 0 34%, #8d4944 34% 44%, #f2dcc1 44% 68%, #c79a5a 68% 100%);
  border: 1px solid rgba(122, 85, 44, 0.65);
  box-shadow: inset 0 -4px 0 rgba(104, 43, 43, 0.25);
}

.cake::after {
  content: "";
  position: absolute;
  width: 7px;
  height: 7px;
  right: 7px;
  top: 15px;
  border-radius: 50%;
  background: #7a1f25;
  box-shadow: 0 0 0 1px rgba(255,255,255,0.22);
}

.d1 { left: 6%;  animation-duration: 13s; animation-delay: 0s; }
.d2 { left: 18%; animation-duration: 15s; animation-delay: 2s; }
.d3 { left: 31%; animation-duration: 12s; animation-delay: 4s; }
.d4 { left: 46%; animation-duration: 16s; animation-delay: 1s; }
.d5 { left: 61%; animation-duration: 14s; animation-delay: 5s; }
.d6 { left: 74%; animation-duration: 17s; animation-delay: 3s; }
.d7 { left: 86%; animation-duration: 13s; animation-delay: 7s; }
.d8 { left: 94%; animation-duration: 18s; animation-delay: 6s; }

@keyframes floatDown {
  0% {
    transform: translateY(0) rotate(0deg) scale(0.92);
    opacity: 0;
  }

  10% {
    opacity: 0.42;
  }

  45% {
    opacity: 0.62;
  }

  100% {
    transform: translateY(120vh) rotate(24deg) scale(1);
    opacity: 0;
  }
}

/* CONTENITORE PRINCIPALE */

.shell {
  position: relative;
  z-index: 2;
  width: min(1060px, calc(100% - 28px));
  margin: 28px auto;
  padding: 24px;
  border: 1px solid var(--line);
  border-radius: 26px;
  background:
    linear-gradient(to bottom, rgba(42, 24, 20, 0.66), rgba(26, 15, 13, 0.56));
  backdrop-filter: blur(5px);
  box-shadow:
    0 18px 46px var(--shadow),
    inset 0 0 0 1px rgba(255,255,255,0.035);
}

/* HEADER */

.hero {
  text-align: center;
  margin-bottom: 26px;
}

.welcome-line {
  margin: 0 0 12px;
  font-family: "Ewert", serif;
  font-size: clamp(1.35rem, 3.2vw, 2.45rem);
  color: var(--gold-light);
  line-height: 1.35;
  letter-spacing: 0.03em;
  text-shadow:
    0 3px 10px rgba(0,0,0,0.34),
    0 0 16px rgba(208,167,102,0.18);
}

.hero h1 {
  margin: 0;
  font-family: "Rye", serif;
  font-size: clamp(2rem, 4.8vw, 3.85rem);
  line-height: 1.08;
  color: var(--cream);
  letter-spacing: 0.035em;
  text-shadow: 0 3px 12px rgba(0,0,0,0.38);
}

.subtitle {
  margin: 12px 0 0;
  font-size: clamp(1.1rem, 2.1vw, 1.55rem);
  color: var(--gold);
  font-weight: 700;
  letter-spacing: 0.025em;
}

/* VIDEO */

.book-section {
  display: flex;
  justify-content: center;
  margin-bottom: 30px;
}

.video-card {
  width: min(620px, 100%);
  text-align: center;
}

.video-trigger {
  all: unset;
  display: inline-block;
  cursor: pointer;
}

/* Cornice dorata vintage */
.video-frame {
  position: relative;
  display: inline-block;
  width: min(370px, 84vw);
  padding: 14px;
  border-radius: 28px;
  background:
    linear-gradient(135deg, #6d4421, #f2d18a 18%, #8c602e 38%, #f7df9d 54%, #6d4421 82%),
    radial-gradient(circle at center, rgba(255,255,255,0.25), transparent 60%);
  box-shadow:
    0 16px 36px rgba(0,0,0,0.34),
    inset 0 0 0 2px rgba(255,255,255,0.18),
    inset 0 0 0 6px rgba(91,52,25,0.42);
}

.video-frame::before {
  content: "";
  position: absolute;
  inset: 6px;
  border-radius: 22px;
  border: 1px dashed rgba(64, 34, 18, 0.52);
  pointer-events: none;
}

.video-frame::after {
  content: "";
  position: absolute;
  inset: 18px;
  border-radius: 16px;
  box-shadow: inset 0 0 22px rgba(0,0,0,0.34);
  pointer-events: none;
}

.intro-video {
  position: relative;
  z-index: 1;
  width: 100%;
  height: auto;
  display: block;
  border-radius: 16px;
  background: #000;
  border: 2px solid rgba(56, 31, 19, 0.82);
}

.video-caption {
  margin: 14px 0 6px;
  font-family: "Rye", serif;
  font-size: clamp(0.95rem, 2vw, 1.08rem);
  color: var(--cream);
  letter-spacing: 0.025em;
  text-shadow: 0 2px 8px rgba(0,0,0,0.32);
}

.video-invite {
  margin: 0 auto;
  max-width: 620px;
  font-size: clamp(1.08rem, 2vw, 1.35rem);
  color: var(--gold-light);
  font-style: italic;
  font-weight: 600;
}

/* PLAYER */

.player-section {
  margin-top: 20px;
}

.now-playing {
  width: min(680px, 100%);
  margin: 0 auto 16px;
  padding: 12px 16px;
  border: 1px solid rgba(208, 167, 102, 0.24);
  border-radius: 18px;
  background: rgba(255, 246, 230, 0.07);
  text-align: center;
}

.now-label {
  display: block;
  margin-bottom: 3px;
  font-family: "Rye", serif;
  font-size: 0.82rem;
  color: var(--gold);
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

#nowPlayingTitle {
  font-size: 1.18rem;
  font-weight: 700;
  color: var(--cream);
}

.player-controls {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: center;
  margin-bottom: 20px;
}

.control-btn {
  border: 1px solid rgba(208, 167, 102, 0.38);
  background:
    linear-gradient(to bottom, rgba(255,246,230,0.14), rgba(85,45,38,0.34));
  color: var(--cream);
  border-radius: 999px;
  padding: 10px 16px;
  font-family: "Cormorant Garamond", serif;
  font-size: 1.04rem;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 7px 16px rgba(0,0,0,0.16);
  transition:
    transform 0.18s ease,
    background 0.18s ease,
    border-color 0.18s ease;
}

.control-btn:hover {
  transform: translateY(-1px);
  border-color: rgba(242, 209, 138, 0.62);
  background:
    linear-gradient(to bottom, rgba(255,246,230,0.2), rgba(105,49,44,0.48));
}

.control-btn.main {
  background:
    linear-gradient(to bottom, rgba(208,167,102,0.42), rgba(104,43,43,0.72));
}

.control-btn.accent {
  background:
    linear-gradient(to bottom, rgba(141,73,68,0.72), rgba(80,34,34,0.78));
}

/* LISTA BRANI */

.track-header {
  display: grid;
  grid-template-columns: 56px 1.7fr 1fr 82px 100px;
  gap: 10px;
  align-items: center;
  padding: 0 12px 10px;
  color: var(--gold-light);
  font-size: 0.96rem;
  font-weight: 700;
  border-bottom: 1px solid rgba(208,167,102,0.24);
  margin-bottom: 10px;
  letter-spacing: 0.04em;
}

.track-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.track-item {
  display: grid;
  grid-template-columns: 56px 1.7fr 1fr 82px 100px;
  gap: 10px;
  align-items: center;
  padding: 10px 12px;
  margin-bottom: 8px;
  border-radius: 16px;
  background: rgba(255, 246, 230, 0.065);
  border: 1px solid rgba(208, 167, 102, 0.14);
  cursor: pointer;
  transition:
    background 0.18s ease,
    transform 0.18s ease,
    border-color 0.18s ease;
}

.track-item:hover {
  transform: translateY(-1px);
  background: rgba(255, 246, 230, 0.1);
  border-color: rgba(208, 167, 102, 0.32);
}

.track-item.active {
  background:
    linear-gradient(to right, rgba(104, 43, 43, 0.62), rgba(255,246,230,0.08));
  border-color: rgba(242, 209, 138, 0.42);
}

.track-play-btn {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  border: 1px solid rgba(208, 167, 102, 0.46);
  background: rgba(255, 246, 230, 0.12);
  color: var(--cream);
  font-size: 0.96rem;
  cursor: pointer;
}

.track-info {
  min-width: 0;
}

.track-title {
  display: block;
  font-size: 1.12rem;
  font-weight: 700;
  color: var(--cream);
}

.track-type,
.track-duration {
  font-size: 1rem;
  color: var(--cream-soft);
}

.track-download {
  display: inline-block;
  text-align: center;
  padding: 8px 10px;
  border-radius: 999px;
  text-decoration: none;
  color: var(--cream);
  background: rgba(63, 41, 36, 0.76);
  border: 1px solid rgba(208, 167, 102, 0.25);
  font-size: 0.95rem;
  font-weight: 700;
}

.track-download:hover {
  background: rgba(104, 43, 43, 0.9);
  border-color: rgba(242, 209, 138, 0.48);
}

/* CREDITI */

.credits {
  margin-top: 28px;
  padding-top: 18px;
  border-top: 1px solid rgba(208, 167, 102, 0.22);
  text-align: center;
  color: var(--cream-soft);
  font-size: 1rem;
}

.credits p {
  margin: 6px 0;
}

.credits strong {
  color: var(--gold-light);
}

/* MOBILE */

@media (max-width: 900px) {
  .shell {
    margin: 16px auto;
    padding: 18px;
  }

  .track-header {
    display: none;
  }

  .track-item {
    grid-template-columns: 48px 1fr;
    gap: 8px 10px;
    padding: 12px;
  }

  .track-type,
  .track-duration,
  .track-download {
    grid-column: 2;
  }

  .track-download {
    width: fit-content;
    margin-top: 2px;
  }
}

@media (max-width: 600px) {
  .shell {
    width: min(100% - 18px, 1060px);
    padding: 14px;
    border-radius: 20px;
  }

  .welcome-line {
    font-size: clamp(1.25rem, 7vw, 2.05rem);
  }

  .hero h1 {
    font-size: clamp(1.75rem, 9vw, 2.8rem);
  }

  .video-frame {
    width: min(330px, 88vw);
    padding: 11px;
    border-radius: 24px;
  }

  .video-frame::before {
    inset: 5px;
    border-radius: 19px;
  }

  .intro-video {
    border-radius: 14px;
  }

  .player-controls {
    gap: 8px;
  }

  .control-btn {
    flex: 1 1 calc(50% - 8px);
    padding: 10px 8px;
    font-size: 0.98rem;
  }

  .control-btn.accent {
    flex-basis: 100%;
  }

  .star {
    font-size: 24px;
  }

  .cake {
    width: 30px;
    height: 24px;
  }
}