/* ---------------- Three.js Canvas ---------------- */

#webgl {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 1;
  pointer-events: auto;
}

/* ---------------- Top Scroll Progress Bar ---------------- */

.progress-bar-container {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 3px;
  background: rgba(255, 255, 255, 0.04);
  z-index: 100;
  pointer-events: none;
}

.progress-bar {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, var(--accent-gold), var(--accent), var(--accent-cyan));
  box-shadow: 0 0 12px var(--accent-glow);
  transition: width 0.1s linear;
}

/* ---------------- Top HUD Header ---------------- */

.hero-ui {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 50;
  padding: 24px 36px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  pointer-events: none;
}

.logo {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  padding: 8px 16px;
  background: rgba(16, 22, 16, 0.78);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid rgba(184, 229, 63, 0.25);
  border-radius: var(--radius-full);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.4);
  pointer-events: auto;
  user-select: none;
}

.logo-bug {
  color: var(--accent);
  font-size: 16px;
  animation: logoPulse 2.4s ease-in-out infinite;
  display: inline-block;
}

.logo-text {
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 0.18em;
  color: #ffffff;
}

.version-tag {
  font-size: 9px;
  letter-spacing: 0.08em;
  padding: 2px 7px;
  background: rgba(184, 229, 63, 0.15);
  color: var(--accent);
  border-radius: var(--radius-full);
  border: 1px solid rgba(184, 229, 63, 0.3);
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 12px;
  pointer-events: auto;
}

/* ---------------- Floating Scroll Hint ---------------- */

.scroll-hint {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 20;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  pointer-events: none;
  transition: opacity 0.5s ease;
}

.scroll-text {
  font-size: 9px;
  letter-spacing: 0.22em;
  color: rgba(255, 255, 255, 0.5);
}

.mouse-icon {
  width: 20px;
  height: 32px;
  border: 1.5px solid rgba(184, 229, 63, 0.5);
  border-radius: 12px;
  position: relative;
  display: flex;
  justify-content: center;
}

.mouse-wheel {
  width: 3px;
  height: 6px;
  background: var(--accent);
  border-radius: 2px;
  position: absolute;
  top: 5px;
  animation: mouseScroll 1.8s ease-in-out infinite;
}

.scroll-hint i {
  display: block;
  width: 1px;
  height: 35px;
  background: linear-gradient(to bottom, var(--accent), transparent);
  animation: scrollLine 1.8s ease-in-out infinite;
}

/* ---------------- Floating Chapter Dock ---------------- */

.chapter-dock {
  position: fixed;
  right: 28px;
  top: 50%;
  transform: translateY(-50%);
  z-index: 40;
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 12px 8px;
  background: rgba(14, 18, 14, 0.7);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid rgba(184, 229, 63, 0.15);
  border-radius: var(--radius-full);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5);
}

.dock-item {
  position: relative;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: transparent;
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: var(--text-muted);
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 500;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.dock-num {
  font-family: var(--font-mono);
  font-size: 11px;
}

.dock-item:hover {
  border-color: var(--accent);
  color: #fff;
  transform: scale(1.15);
  background: rgba(184, 229, 63, 0.1);
}

.dock-item.active {
  background: var(--accent);
  color: #111511;
  font-weight: 700;
  border-color: var(--accent);
  box-shadow: 0 0 16px var(--accent-glow);
  transform: scale(1.1);
}

.dock-tooltip {
  position: absolute;
  right: 48px;
  top: 50%;
  transform: translateY(-50%) translateX(6px);
  background: rgba(14, 18, 14, 0.92);
  backdrop-filter: blur(12px);
  border: 1px solid rgba(184, 229, 63, 0.3);
  color: #ffffff;
  padding: 4px 10px;
  border-radius: var(--radius-sm);
  font-size: 10px;
  letter-spacing: 0.1em;
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  transition: all 0.2s ease;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.5);
}

.dock-item:hover .dock-tooltip {
  opacity: 1;
  transform: translateY(-50%) translateX(0);
}

/* ---------------- Shortcuts Modal ---------------- */

.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}

.modal-backdrop.open {
  opacity: 1;
  pointer-events: auto;
}

.modal-card {
  width: 90%;
  max-width: 420px;
  background: #131a13;
  border: 1px solid rgba(184, 229, 63, 0.3);
  border-radius: var(--radius-lg);
  padding: 28px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.8), 0 0 30px rgba(184, 229, 63, 0.1);
  transform: scale(0.95);
  transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.modal-backdrop.open .modal-card {
  transform: scale(1);
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
}

.modal-header h3 {
  font-size: 13px;
  letter-spacing: 0.18em;
  color: var(--accent);
  margin: 0;
}

.modal-close {
  background: transparent;
  border: none;
  color: rgba(255, 255, 255, 0.5);
  font-size: 16px;
  cursor: pointer;
  padding: 4px;
}

.modal-close:hover {
  color: #fff;
}

.modal-body {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.shortcut-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 12px;
  color: var(--text-muted);
}
