@import url("https://fonts.googleapis.com/css2?family=Fraunces:wght@300;500;700&family=Josefin+Sans:wght@300;400;600&display=swap");

:root {
  --ui-size: clamp(64px, 6vw, 110px);
  --ui-gap: clamp(12px, 2vw, 28px);
  --panel-bg: rgba(10, 28, 20, 0.86);
  --glow: 0 0 30px rgba(255, 255, 255, 0.12);
}

* {
  box-sizing: border-box;
}

html, body {
  width: 100%;
  height: 100%;
  margin: 0;
  padding: 0;
  overflow: hidden;
  background: #050709;
  font-family: "Fraunces", serif;
  color: #f8f5f0;
}

#app {
  position: fixed;
  inset: 0;
  overflow: hidden;
  background: #050709;
}

#bg-video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: saturate(1.1) contrast(1.05);
}

#scene {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  touch-action: none;
}

.overlay {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  background: radial-gradient(circle at top, rgba(214, 196, 160, 0.55), rgba(150, 126, 92, 0.82));
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.4s ease;
  z-index: 20;
  overflow: hidden;
}

.overlay.visible {
  opacity: 1;
  pointer-events: auto;
}

.overlay::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image: url("assets/previews/background-01.png");
  background-size: cover;
  background-position: center;
  opacity: 0.28;
  filter: saturate(1.05);
  pointer-events: none;
  z-index: 0;
}

.magic-particles {
  position: absolute;
  inset: 0;
  z-index: 1;
  pointer-events: none;
}

.magic-particle {
  position: absolute;
  border-radius: 50%;
  background: radial-gradient(circle at 30% 30%, rgba(248, 245, 240, 0.6), rgba(248, 245, 240, 0));
  opacity: 0.25;
  filter: blur(0.5px);
  animation: floatParticle var(--duration) ease-in-out infinite;
  animation-delay: var(--delay);
}

@keyframes floatParticle {
  0% {
    transform: translateY(0) scale(0.95);
    opacity: 0.15;
  }
  50% {
    transform: translateY(-40px) scale(1.05);
    opacity: 0.35;
  }
  100% {
    transform: translateY(0) scale(0.95);
    opacity: 0.2;
  }
}


.start-card {
  font-family: "Josefin Sans", sans-serif;
  position: relative;
  display: grid;
  gap: 18px;
  align-items: center;
  justify-items: center;
  padding: 32px 42px;
  border-radius: 28px;
  background: transparent;
  box-shadow: none;
  border: none;
  text-align: center;
  opacity: 0;
  transform: scale(1.02);
  animation: startReveal 0.6s ease-out 0.1s forwards;
  z-index: 2;
}

.start-card > * {
  position: relative;
  z-index: 1;
}

@keyframes startReveal {
  to {
    opacity: 1;
    transform: scale(1);
  }
}

.play-halo {
  position: absolute;
  width: clamp(200px, 26vw, 280px);
  height: clamp(200px, 26vw, 280px);
  border-radius: 50%;
  top: 60%;
  left: 50%;
  transform: translate(-50%, -50%);
  background: radial-gradient(circle, rgba(248, 245, 240, 0.35), rgba(248, 245, 240, 0));
  filter: blur(2.4px);
  animation: haloPulse 3s ease-in-out infinite;
  pointer-events: none;
  z-index: 0;
}

@keyframes haloPulse {
  0% {
    transform: translate(-50%, -50%) scale(0.95);
    opacity: 0.18;
  }
  50% {
    transform: translate(-50%, -50%) scale(1.05);
    opacity: 0.32;
  }
  100% {
    transform: translate(-50%, -50%) scale(0.95);
    opacity: 0.18;
  }
}

.start-title {
  font-size: clamp(24px, 3vw, 40px);
  letter-spacing: 0.015em;
  text-transform: none;
  text-shadow: 0 10px 24px rgba(0, 0, 0, 0.5);
}

.start-subtitle {
  font-size: clamp(14px, 1.5vw, 20px);
  opacity: 0.75;
}

.load-indicator {
  display: none;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  border-radius: 999px;
  background: rgba(7, 10, 13, 0.42);
  border: 1px solid rgba(255, 255, 255, 0.24);
  box-shadow: 0 10px 22px rgba(0, 0, 0, 0.35);
}

.load-indicator.visible {
  display: flex;
}

.load-spinner {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  border: 2px solid rgba(248, 245, 240, 0.3);
  border-top-color: rgba(248, 245, 240, 0.95);
  animation: spinLoader 0.8s linear infinite;
}

@keyframes spinLoader {
  to {
    transform: rotate(360deg);
  }
}

.load-status {
  font-size: clamp(13px, 1.4vw, 18px);
  opacity: 0.92;
}

.load-progress {
  min-width: 3ch;
  text-align: right;
  font-size: clamp(13px, 1.4vw, 18px);
  font-weight: 600;
}

.start-button {
  width: clamp(90px, 12vw, 140px);
  height: clamp(90px, 12vw, 140px);
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.2);
  background: radial-gradient(circle at 30% 30%, rgba(255, 255, 255, 0.18), rgba(255, 255, 255, 0.02));
  cursor: pointer;
  display: grid;
  place-items: center;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.4);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.start-button:disabled {
  opacity: 0.5;
  cursor: progress;
  box-shadow: none;
}

.start-button:active {
  transform: scale(0.96);
}

.play-icon {
  width: 0;
  height: 0;
  border-left: 34px solid rgba(255, 255, 255, 0.9);
  border-top: 22px solid transparent;
  border-bottom: 22px solid transparent;
  margin-left: 8px;
}

.ui {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 10;
}

.icon-button {
  pointer-events: auto;
  background: rgba(5, 7, 9, 0.45);
  border: 1px solid rgba(255, 255, 255, 0.2);
  width: var(--ui-size);
  height: var(--ui-size);
  border-radius: 50%;
  display: grid;
  place-items: center;
  cursor: pointer;
  box-shadow: var(--glow);
  padding: 10px;
}

.icon-button img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

#exit-button {
  position: absolute;
  top: 20px;
  right: 20px;
}

#menu-button {
  position: absolute;
  bottom: 20px;
  right: 20px;
}

#menu-button.pulse {
  animation: menuPulse 2.2s ease-in-out infinite;
}

@keyframes menuPulse {
  0% {
    transform: scale(1);
    box-shadow: var(--glow);
  }
  50% {
    transform: scale(1.08);
    box-shadow: 0 0 40px rgba(248, 245, 240, 0.3);
  }
  100% {
    transform: scale(1);
    box-shadow: var(--glow);
  }
}

.toolbar {
  position: absolute;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: var(--ui-gap);
  pointer-events: auto;
  padding: 16px 24px;
  border-radius: 999px;
  background: rgba(7, 10, 13, 0.6);
  border: 1px solid rgba(255, 255, 255, 0.12);
  box-shadow: var(--glow);
}

.toolbar button {
  width: clamp(70px, 7vw, 110px);
  height: clamp(70px, 7vw, 110px);
  border-radius: 24px;
  border: none;
  background: transparent;
  padding: 0;
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}

.toolbar button img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  filter: drop-shadow(0 6px 12px rgba(0, 0, 0, 0.45));
}

.toolbar button.active {
  background: radial-gradient(circle at 50% 50%, rgba(248, 245, 240, 0.22), rgba(248, 245, 240, 0.04));
  box-shadow: 0 0 22px rgba(248, 245, 240, 0.36);
  transform: translateY(-2px);
}

.toolbar button.active img {
  filter: drop-shadow(0 8px 14px rgba(0, 0, 0, 0.5)) brightness(1.08);
}

.toolbar button.disabled {
  opacity: 0.35;
  pointer-events: none;
}

.volume-control {
  position: absolute;
  left: 20px;
  bottom: 24px;
  display: flex;
  align-items: center;
  gap: 14px;
  pointer-events: auto;
}

#volume-slider {
  width: clamp(140px, 16vw, 220px);
  accent-color: #e6d7b3;
  background: transparent;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}

.volume-control.open #volume-slider {
  opacity: 1;
  pointer-events: auto;
}

.panel {
  position: absolute;
  inset: 0;
  background: var(--panel-bg);
  backdrop-filter: blur(6px);
  display: grid;
  grid-template-rows: auto 1fr;
  padding: 24px;
  z-index: 15;
}

.panel.hidden {
  display: none;
}

.panel-header {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  margin-bottom: 18px;
}

.panel-title {
  font-size: clamp(20px, 2.6vw, 32px);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  display: none;
}

.panel-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 20px;
}

.panel-card {
  position: relative;
  border-radius: 24px;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.12);
  cursor: pointer;
  min-height: 140px;
  background: rgba(0, 0, 0, 0.2);
}

.panel-card::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(0deg, rgba(0, 0, 0, 0.65) 0%, rgba(0, 0, 0, 0) 55%);
  pointer-events: none;
}

.panel-card img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.panel-card span {
  position: absolute;
  inset-inline: 0;
  bottom: 16px;
  text-align: center;
  padding: 14px 16px 22px;
  font-family: "Josefin Sans", sans-serif;
  font-size: clamp(18px, 2.8vw, 28px);
  letter-spacing: 0.02em;
  color: #f8f5f0;
  text-shadow: 0 4px 12px rgba(0, 0, 0, 0.65);
  z-index: 1;
}

@media (max-width: 768px) {
  .toolbar {
    width: calc(100% - 32px);
    justify-content: space-around;
    padding: 12px;
  }
}
