:root {
  --ui-bg: rgba(0, 0, 0, 0.35);
  --ui-text: #ffffff;
  --ui-accent: #20c997;
  --ui-muted: #d0d0d0;
}

* {
  box-sizing: border-box;
}

html,
body {
  width: 100%;
  height: 100%;
  margin: 0;
  padding: 0;
  overflow: hidden;
  background-color: #2b2e36;
  font-family: "Verdana", "Tahoma", sans-serif;
}

.app {
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
}

.stage {
  position: relative;
  flex: 1;
  width: 100%;
  height: 100%;
}

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

.topbar {
  display: grid;
  grid-template-columns: 1fr 2fr 1fr;
  align-items: center;
  padding: 10px 16px 0 16px;
  color: var(--ui-text);
  z-index: 5;
  width: 100%;
}

.topbar h3 {
  margin: 0;
  text-align: center;
  font-size: 20px;
  font-weight: 300;
}

.nav-link {
  color: var(--ui-text);
  text-decoration: none;
  font-size: 16px;
}

.nav-link.hidden {
  visibility: hidden;
}

.page-selector {
  display: flex;
  gap: 12px;
  align-items: center;
  padding: 8px 16px;
  color: var(--ui-text);
  z-index: 5;
  width: 100%;
}

.page-selector select {
  max-width: 320px;
}

.canvas {
  position: absolute;
  inset: 0;
  background-position: center center;
  background-size: cover;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 20px 20px 120px 20px;
  gap: 12px;
  z-index: 2;
}

.button-grid {
  width: 100%;
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  align-items: center;
  justify-content: center;
  flex: 1;
}

.circle-btn {
  border-radius: 50%;
  width: 140px;
  height: 140px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.big-controls {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
}

.hidden {
  display: none;
}

.toolbar {
  position: absolute;
  bottom: 20px;
  left: 0;
  right: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  z-index: 5;
}

.slider-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  width: 280px;
}

.slider {
  width: 100%;
}

.slider-value {
  color: var(--ui-text);
  font-size: 12px;
}

.progress {
  width: 300px;
  height: 10px;
  background-color: rgba(0, 0, 0, 0.45);
  border-radius: 6px;
  overflow: hidden;
  display: none;
}

.progress-bar {
  height: 100%;
  width: 0%;
  background-color: var(--ui-accent);
}

.controls {
  display: flex;
  gap: 8px;
  align-items: center;
  justify-content: center;
}

.loading {
  position: absolute;
  inset: 0;
  background: rgba(255, 255, 255, 0.55);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10;
}

.loader {
  border: 16px solid rgba(45, 45, 45, 0.2);
  border-top: 16px solid #121212;
  border-radius: 50%;
  width: 120px;
  height: 120px;
  animation: spin 1.6s linear infinite;
}

@keyframes spin {
  0% {
    transform: rotate(0deg);
  }
  100% {
    transform: rotate(360deg);
  }
}

.progress-radial {
  stroke-linecap: round;
  transition: stroke-dashoffset 0s;
  transition-timing-function: ease-out;
  transform: rotate(-90deg);
  transform-origin: 50% 50%;
  cursor: pointer;
}

.txt-button {
  font-family: "Verdana", "Tahoma", sans-serif;
  font-weight: bold;
  fill: white;
  cursor: pointer;
}

.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 20;
}

.modal-card {
  width: min(360px, 92vw);
  background: #fefefe;
  color: #222;
  padding: 20px;
  border-radius: 12px;
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.3);
}

.video-wrap {
  width: 100%;
  display: flex;
  justify-content: center;
  padding: 10px 0;
}

.video-container {
  position: relative;
  width: min(960px, 100%);
  padding-bottom: 56.25%;
  height: 0;
  overflow: hidden;
}

.video-container iframe {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
}

.intro-overlay {
  position: fixed;
  inset: 0;
  background: radial-gradient(circle at top, rgba(10, 20, 35, 0.95), rgba(5, 10, 20, 0.98));
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 30;
}

.intro-card {
  width: min(520px, 92vw);
  background: rgba(255, 255, 255, 0.95);
  color: #1b1b1b;
  padding: 24px;
  border-radius: 16px;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.45);
}

.intro-card h2 {
  margin-top: 0;
}

.intro-controls {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin: 16px 0;
}

.intro-actions {
  display: flex;
  justify-content: flex-end;
}

.modal-card h4 {
  margin-top: 0;
}

.modal-actions {
  display: flex;
  justify-content: flex-end;
  margin-top: 16px;
}

@media screen and (max-width: 767px) {
  .topbar {
    grid-template-columns: 1fr;
    gap: 6px;
  }

  .topbar-left,
  .topbar-right {
    text-align: center;
  }

  .page-selector {
    justify-content: center;
  }

  .button-grid {
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  }
}
