/* ─── Fonts ─── */
@import url('https://fonts.googleapis.com/css2?family=Syne:wght@400;500;600;700;800&family=Space+Grotesk:wght@300;400;500;600;700&family=JetBrains+Mono:wght@300;400;500&family=Inter:wght@200;300;400;500&display=swap');

/* ─── World Navigation Orb ─── */
.world-nav {
  position: fixed;
  bottom: 32px;
  right: 32px;
  z-index: 9999;
  pointer-events: auto;
}

.world-nav__orb {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  cursor: pointer;
  transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.4s ease;
  position: relative;
}

.world-nav__orb:hover {
  transform: scale(1.15);
}

.world-nav__menu {
  position: absolute;
  bottom: 64px;
  right: 0;
  opacity: 0;
  pointer-events: none;
  transform: translateY(10px) scale(0.95);
  transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
  display: flex;
  flex-direction: column;
  gap: 8px;
  align-items: flex-end;
}

.world-nav__menu.open {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0) scale(1);
}

.world-nav__item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px 16px 8px 12px;
  border-radius: 24px;
  background: rgba(10, 10, 20, 0.85);
  backdrop-filter: blur(20px);
  border: 1px solid rgba(255,255,255,0.08);
  cursor: pointer;
  transition: all 0.3s ease;
  white-space: nowrap;
}

.world-nav__item:hover {
  background: rgba(20, 20, 40, 0.95);
  border-color: rgba(255,255,255,0.2);
  transform: translateX(-4px);
}

.world-nav__dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  flex-shrink: 0;
}

.world-nav__label {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 13px;
  font-weight: 400;
  letter-spacing: 0.05em;
  color: rgba(255,255,255,0.7);
}

.world-nav__item:hover .world-nav__label {
  color: rgba(255,255,255,1);
}

.world-nav__item.active .world-nav__label {
  color: #fff;
  font-weight: 500;
}

/* ─── AI Panel ─── */
.ai-panel {
  position: fixed;
  left: 0;
  top: 0;
  bottom: 0;
  width: 380px;
  background: rgba(8, 8, 16, 0.92);
  backdrop-filter: blur(30px);
  border-right: 1px solid rgba(255,255,255,0.06);
  z-index: 9998;
  transform: translateX(-100%);
  transition: transform 0.5s cubic-bezier(0.16, 1, 0.3, 1);
  display: flex;
  flex-direction: column;
  font-family: 'Space Grotesk', sans-serif;
}

.ai-panel.open {
  transform: translateX(0);
}

.ai-panel__tab {
  position: absolute;
  right: -40px;
  top: 50%;
  transform: translateY(-50%);
  width: 40px;
  height: 100px;
  background: rgba(8, 8, 16, 0.92);
  backdrop-filter: blur(30px);
  border: 1px solid rgba(255,255,255,0.06);
  border-left: none;
  border-radius: 0 8px 8px 0;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  writing-mode: vertical-rl;
  font-size: 12px;
  letter-spacing: 0.2em;
  color: rgba(255,255,255,0.5);
  transition: color 0.3s ease;
}

.ai-panel__tab:hover {
  color: rgba(255,255,255,0.9);
}

.ai-panel__header {
  padding: 24px;
  border-bottom: 1px solid rgba(255,255,255,0.06);
}

.ai-panel__title {
  font-family: 'Syne', sans-serif;
  font-size: 18px;
  font-weight: 700;
  color: #fff;
  margin-bottom: 4px;
}

.ai-panel__subtitle {
  font-size: 12px;
  color: rgba(255,255,255,0.4);
  letter-spacing: 0.1em;
}

.ai-panel__body {
  flex: 1;
  overflow-y: auto;
  padding: 24px;
}

.ai-panel__input-wrap {
  padding: 20px 24px;
  border-top: 1px solid rgba(255,255,255,0.06);
}

.ai-panel__input {
  width: 100%;
  padding: 12px 16px;
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 8px;
  color: #fff;
  font-family: 'Space Grotesk', sans-serif;
  font-size: 14px;
  outline: none;
  transition: border-color 0.3s ease;
  resize: none;
}

.ai-panel__input:focus {
  border-color: rgba(255,255,255,0.3);
}

.ai-panel__input::placeholder {
  color: rgba(255,255,255,0.25);
}

.ai-panel__actions {
  display: flex;
  gap: 8px;
  margin-top: 12px;
  flex-wrap: wrap;
}

.ai-panel__action-btn {
  padding: 6px 14px;
  border-radius: 16px;
  font-size: 12px;
  background: rgba(255,255,255,0.06);
  color: rgba(255,255,255,0.6);
  border: 1px solid rgba(255,255,255,0.08);
  transition: all 0.2s ease;
}

.ai-panel__action-btn:hover {
  background: rgba(255,255,255,0.12);
  color: #fff;
}

.ai-panel__response {
  margin-top: 16px;
  padding: 16px;
  background: rgba(255,255,255,0.03);
  border-radius: 8px;
  border: 1px solid rgba(255,255,255,0.05);
}

.ai-panel__response-text {
  font-size: 13px;
  line-height: 1.6;
  color: rgba(255,255,255,0.7);
}

/* ─── Controls Panel ─── */
.controls {
  position: fixed;
  top: 24px;
  right: 24px;
  z-index: 9997;
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px;
  min-width: 240px;
  background: rgba(8, 8, 16, 0.85);
  backdrop-filter: blur(20px);
  border: 1px solid rgba(255,255,255,0.06);
  border-radius: 12px;
  overflow: hidden;
  transition: opacity 0.3s ease;
}

.controls.hidden {
  opacity: 0;
  pointer-events: none;
}

.controls__header {
  padding: 12px 16px;
  border-bottom: 1px solid rgba(255,255,255,0.06);
  color: rgba(255,255,255,0.5);
  letter-spacing: 0.1em;
  font-size: 10px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.controls__toggle {
  font-size: 10px;
  color: rgba(255,255,255,0.3);
  cursor: pointer;
}

.controls__group {
  padding: 12px 16px;
  border-bottom: 1px solid rgba(255,255,255,0.03);
}

.controls__label {
  display: flex;
  justify-content: space-between;
  align-items: center;
  color: rgba(255,255,255,0.5);
  margin-bottom: 6px;
}

.controls__value {
  color: rgba(255,255,255,0.8);
}

.controls__slider {
  width: 100%;
  height: 4px;
  -webkit-appearance: none;
  appearance: none;
  background: rgba(255,255,255,0.08);
  border-radius: 2px;
  outline: none;
}

.controls__slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: #fff;
  cursor: pointer;
  border: 2px solid rgba(0,0,0,0.3);
}

/* ─── Loading Screen ─── */
.loader {
  position: fixed;
  inset: 0;
  background: #030308;
  z-index: 99999;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  transition: opacity 0.8s ease;
}

.loader.fade-out {
  opacity: 0;
  pointer-events: none;
}

.loader__text {
  font-family: 'Syne', sans-serif;
  font-size: 14px;
  letter-spacing: 0.3em;
  color: rgba(255,255,255,0.4);
}

/* ─── Responsive ─── */
@media (max-width: 768px) {
  .ai-panel { width: 100%; }
  .controls { top: auto; bottom: 80px; right: 12px; left: 12px; min-width: auto; }
  .world-nav { bottom: 16px; right: 16px; }
}
