* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html, body {
  width: 100%;
  height: 100%;
  overflow: hidden;
  background: #000;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Helvetica, sans-serif;
}

/* ── Preload thumbnail ── */

#preload {
  position: fixed;
  top: 0;
  left: 0;
  width: 1920px;
  height: 1080px;
  object-fit: cover;
  z-index: 6;
  opacity: 0;
  transition: opacity 0.5s ease;
  pointer-events: none;
}

#preload.visible {
  opacity: 1;
}

/* ── Fade overlay ── */

#fade {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: #000;
  opacity: 0;
  transition: opacity 1s ease;
  z-index: 5;
  pointer-events: none;
}

#fade.active {
  opacity: 1;
}

/* ── Loading screen ── */

#loading {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 9;
  opacity: 0;
  transition: opacity 0.4s ease;
  pointer-events: none;
}

#loading.visible {
  opacity: 1;
}

#loading-spinner {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 64px;
  height: 64px;
  margin: -32px 0 0 -32px;
}

/* The twelve-bar activity indicator: each bar sits one twelfth of a turn
   further round and starts its fade one twelfth of a cycle later, so the
   highlight walks the ring instead of a hard edge sweeping it. */
#loading-spinner i {
  position: absolute;
  top: 0;
  left: 50%;
  width: 5px;
  height: 16px;
  margin-left: -2.5px;
  border-radius: 2.5px;
  background: #fff;
  transform-origin: 2.5px 32px;
  transform: rotate(calc(var(--n) * 30deg));
  animation: aerial-bar-fade 1.2s linear infinite;
  animation-delay: calc(var(--n) * 0.1s - 1.2s);
}

@keyframes aerial-bar-fade {
  0% { opacity: 1; }
  100% { opacity: 0.15; }
}

/* ── On-screen log ── */

#logview {
  position: fixed;
  top: 24px;
  left: 24px;
  max-width: 1200px;
  z-index: 25;
  display: none;
  background: rgba(0, 0, 0, 0.75);
  border-radius: 8px;
  padding: 16px 20px;
  color: rgba(255, 255, 255, 0.85);
  font-size: 18px;
  line-height: 1.5;
  white-space: pre-wrap;
}

#logview.visible {
  display: block;
}

/* ── Video info (description = loader) ── */

#info {
  position: fixed;
  bottom: 60px;
  left: 60px;
  z-index: 8;
  opacity: 0;
  transition: opacity 1.5s ease;
  pointer-events: none;
  max-width: 800px;
}

#info.visible {
  opacity: 1;
}

#info-label {
  color: #fff;
  font-size: 34px;
  font-weight: 600;
  letter-spacing: 0.5px;
  text-shadow: 0 2px 16px rgba(0, 0, 0, 0.8), 0 0 4px rgba(0, 0, 0, 0.5);
  margin-bottom: 10px;
}

#info-description {
  color: rgba(255, 255, 255, 0.85);
  font-size: 21px;
  font-weight: 400;
  letter-spacing: 0.3px;
  line-height: 1.4;
  text-shadow: 0 1px 10px rgba(0, 0, 0, 0.7), 0 0 3px rgba(0, 0, 0, 0.4);
}

/* ── Settings menu ── */

#menu {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  z-index: 20;
  background: rgba(0, 0, 0, 0.88);
  border-radius: 16px;
  padding: 40px 50px;
  min-width: 520px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}

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

#menu-title {
  color: #fff;
  font-size: 28px;
  font-weight: 600;
  text-align: center;
  margin-bottom: 28px;
  letter-spacing: 1px;
}

.menu-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 14px 20px;
  border-radius: 10px;
  margin-bottom: 4px;
  transition: background 0.15s ease;
}

.menu-item.active {
  background: rgba(255, 255, 255, 0.15);
}

.menu-label {
  color: #fff;
  font-size: 22px;
  font-weight: 400;
  flex-shrink: 0;
}

.menu-value {
  margin-left: 24px;
  color: rgba(255, 255, 255, 0.9);
  font-size: 22px;
  font-weight: 500;
  min-width: 140px;
  max-width: 360px;
  text-align: right;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.menu-arrow {
  color: rgba(255, 255, 255, 0.35);
  font-size: 16px;
}

.menu-item.active .menu-arrow {
  color: rgba(255, 255, 255, 0.85);
}

#menu-hint {
  color: rgba(255, 255, 255, 0.35);
  font-size: 16px;
  text-align: center;
  margin-top: 24px;
  letter-spacing: 0.5px;
}
