/* ── Reset & Variables ──────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --bg:        #0d0a1a;
  --text:      #e8d5a3;
  --text-dim:  rgba(232, 213, 163, 0.55);
  --gold:      #c9a227;
  --purple:    #6b3fa0;
}

/* ── Base ──────────────────────────────────────────────────────── */
body {
  min-height: 100svh;
  background-color: var(--bg);
  color: var(--text);
  font-family: 'Cinzel', Georgia, serif;
  overflow: hidden;
}

/* ── Background image ──────────────────────────────────────────── */
#video-bg {
  position: fixed;
  inset: 0;
  z-index: -3;
  pointer-events: none;
  overflow: hidden;
}

#bg-img {
  position: absolute;
  inset: -5%;
  background: center center / cover no-repeat;
  animation: ken-burns 22s ease-in-out infinite alternate;
}

@keyframes ken-burns {
  0%   { transform: scale(1.0)  translate(0%,    0%); }
  33%  { transform: scale(1.06) translate(-1.5%, -0.8%); }
  66%  { transform: scale(1.04) translate(1%,    0.5%); }
  100% { transform: scale(1.08) translate(-0.5%, 1%); }
}

/* ── Fog & vignette ────────────────────────────────────────────── */
#video-fog {
  position: fixed;
  inset: 0;
  z-index: -2;
  pointer-events: none;
  background: rgba(13, 10, 26, 0.58);
}

.fog-layer {
  position: absolute;
  inset: -10%;
  pointer-events: none;
}

.fog-a {
  background:
    radial-gradient(ellipse 100% 55% at 10% 70%, rgba(255,255,255,0.09) 0%, transparent 60%),
    radial-gradient(ellipse 75%  45% at 85% 25%, rgba(107,63,160,0.22)  0%, transparent 55%),
    radial-gradient(ellipse 60%  70% at 50% 95%, rgba(13,10,26,0.75)    0%, transparent 65%);
  animation: fog-drift-a 28s ease-in-out infinite;
}

.fog-b {
  background:
    radial-gradient(ellipse 85% 50% at 65% 60%, rgba(255,255,255,0.07) 0%, transparent 55%),
    radial-gradient(ellipse 65% 40% at 20% 20%, rgba(107,63,160,0.16)  0%, transparent 50%);
  animation: fog-drift-b 38s ease-in-out infinite reverse;
}

.fog-c {
  background:
    radial-gradient(ellipse 120% 50% at 50% 100%, rgba(13,10,26,0.88) 0%, transparent 60%),
    radial-gradient(ellipse 120% 40% at 50%   0%, rgba(13,10,26,0.70) 0%, transparent 50%),
    radial-gradient(ellipse 80%  80% at 50%  50%, rgba(13,10,26,0.25) 0%, transparent 70%);
}

.fog-vignette {
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse 100% 100% at 50% 50%, transparent 15%, rgba(13,10,26,0.92) 100%);
}

@keyframes fog-drift-a {
  0%, 100% { transform: translateX(0%)   translateY(0%); }
  30%       { transform: translateX(2.5%) translateY(-1.5%); }
  65%       { transform: translateX(-2%)  translateY(1%); }
}

@keyframes fog-drift-b {
  0%, 100% { transform: translateX(0%)    scale(1); }
  40%       { transform: translateX(-3.5%) scale(1.04); }
  75%       { transform: translateX(2%)    scale(0.97); }
}

/* ── HUD — top-left text ───────────────────────────────────────── */
#hud {
  position: fixed;
  top: 1.6rem;
  left: 1.8rem;
  z-index: 10;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  line-height: 1.5;
}

#hud p {
  font-family: inherit;
  font-size: 0.78rem;
  letter-spacing: 0.06em;
  color: var(--text-dim);
  text-shadow: 0 1px 8px rgba(0,0,0,0.9);
  padding: 0;
}

#presence strong { color: var(--text-dim); font-weight: 400; }

/* ── Countdown — centered ──────────────────────────────────────── */
#countdown {
  position: fixed;
  top: 38%;
  left: 50%;
  transform: translateX(-50%);
  z-index: 10;
  font-family: 'Cinzel', Georgia, serif;
  font-size: 1.45rem;
  letter-spacing: 0.14em;
  color: var(--text);
  text-shadow: 0 1px 12px rgba(0,0,0,0.95);
  white-space: nowrap;
  text-align: center;
}

#countdownLocal {
  position: fixed;
  top: calc(38% + 2.4rem);
  left: 50%;
  transform: translateX(-50%);
  z-index: 10;
  font-family: 'Cinzel', Georgia, serif;
  font-size: 0.8rem;
  letter-spacing: 0.08em;
  color: var(--text-dim);
  opacity: 1;
  filter: brightness(1.35);
  text-shadow: 0 1px 8px rgba(0,0,0,0.9);
  white-space: nowrap;
  text-align: center;
}

#musicControls {
  position: fixed;
  bottom: 2.8rem;
  right: 2rem;
  z-index: 10;
  display: flex;
  align-items: center;
  gap: 0.7rem;
}

#musicBtn {
  cursor: pointer;
  font-family: 'Cinzel', Georgia, serif;
  font-size: 0.78rem;
  letter-spacing: 0.06em;
  color: var(--text-dim);
  background: none;
  border: none;
  padding: 0;
  white-space: nowrap;
  transition: color 0.2s;
  text-shadow: 0 1px 6px rgba(0,0,0,0.8);
}
#musicBtn:hover { color: var(--text); }
#musicBtn.active { color: var(--gold); }

#volumeSlider {
  -webkit-appearance: none;
  appearance: none;
  width: 72px;
  height: 3px;
  border-radius: 2px;
  background: rgba(232,213,163,0.2);
  outline: none;
  cursor: pointer;
  opacity: 0.6;
  transition: opacity 0.2s;
}
#volumeSlider:hover { opacity: 1; }
#volumeSlider::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--gold);
  cursor: pointer;
}
#volumeSlider::-moz-range-thumb {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--gold);
  border: none;
  cursor: pointer;
}

.dot {
  display: inline-block;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--gold);
  margin-right: 5px;
  vertical-align: middle;
  animation: blink 2.5s ease-in-out infinite;
}
.dot-off { background: var(--text-dim); animation: none; }

@keyframes blink {
  0%, 100% { opacity: 1; }
  50%       { opacity: 0.2; }
}

/* ── Star — centered in the scene ─────────────────────────────── */
#starBtn {
  position: fixed;
  bottom: 3rem;
  left: 3rem;
  z-index: 10;
  background: none;
  border: none;
  cursor: pointer;
  padding: 1rem;
  transition: transform 0.15s ease;
}

#starBtn:hover {
  transform: scale(1.1);
}

#starBtn.pulse {
  transform: scale(1.22);
}

#starBtn img {
  display: block;
  width: 110px;
  height: 110px;
  object-fit: contain;
  filter:
    drop-shadow(0 0 14px rgba(201,162,39,0.5))
    drop-shadow(0 0 35px rgba(201,162,39,0.2));
  transition: filter 0.25s ease;
}

#starBtn:hover img {
  filter:
    drop-shadow(0 0 22px rgba(201,162,39,0.8))
    drop-shadow(0 0 55px rgba(201,162,39,0.35));
}

/* ── Bottom credits ────────────────────────────────────────────── */
#credits {
  position: fixed;
  bottom: 1.4rem;
  left: 50%;
  transform: translateX(-50%);
  z-index: 10;
  font-size: 0.65rem;
  color: var(--text-dim);
  text-shadow: 0 1px 6px rgba(0,0,0,0.9);
  letter-spacing: 0.04em;
  text-align: center;
  width: calc(100% - 3rem);
  white-space: normal;
  line-height: 1.7;
}

#credits a {
  color: inherit;
  text-decoration: none;
  transition: color 0.15s;
}
#credits a:hover { color: var(--text); }

/* ── Floating star particles ───────────────────────────────────── */
.star-particle {
  position: fixed;
  width: 64px;
  height: 64px;
  object-fit: contain;
  pointer-events: none;
  z-index: 999;
  animation: float-up 1.1s ease-out forwards;
}

@keyframes float-up {
  0%   { transform: translateY(0)      scale(1)   rotate(0deg);   opacity: 0.95; }
  100% { transform: translateY(-200px) scale(0.1) rotate(320deg); opacity: 0;    }
}

/* ── Small screens ─────────────────────────────────────────────── */
@media (max-width: 540px) {
  #musicControls {
    bottom: auto;
    top: 1.6rem;
    right: 1.4rem;
  }
  #countdown { font-size: 1.05rem; }
  #countdownLocal { top: calc(38% + 1.9rem); font-size: 0.7rem; }
  #bg-img { animation: ken-burns-still 12s ease-in-out infinite alternate; }
}

@keyframes ken-burns-still {
  0%   { transform: scale(1.0) translate(0%, 0%); }
  100% { transform: scale(1.1) translate(-1%, -0.5%); }
}
