:root {
  --bg-warm: #f5e9d4;
  --bg-warm-darker: #e8d8b8;
  --text: #2a1f15;
  --text-soft: #6b5b4a;
  --accent: #c98a4b;
  --accent-dark: #a06832;
  --bubble-bg: #fff8e8;
  --bubble-border: #c98a4b;
  --bubble-shadow: rgba(58, 38, 18, 0.18);
  --disclaimer: rgba(42, 31, 21, 0.55);
}

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

html, body {
  width: 100%;
  height: 100%;
  overflow: hidden;
  background: var(--bg-warm);
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Display", "Helvetica Neue", "Segoe UI", system-ui, "Noto Sans Georgian", sans-serif;
  color: var(--text);
  position: relative;
  user-select: none;
  -webkit-user-select: none;
}

/* ===== Scene container ===== */
#scene-container {
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100vh;
  cursor: pointer;
  background: linear-gradient(180deg, #fdf3df 0%, #e8d8b8 100%);
}

#scene-container canvas {
  display: block;
}

/* ===== Top bar ===== */
#top-bar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 20;
  padding: 14px 24px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: linear-gradient(180deg, rgba(245,233,212,0.95), rgba(245,233,212,0));
  pointer-events: none;
}

.brand {
  font-weight: 600;
  font-size: 14px;
  color: var(--text);
  letter-spacing: 0.3px;
}

.brand-sub {
  color: var(--text-soft);
  font-weight: 400;
  font-size: 12px;
  margin-left: 8px;
}

.disclaimer {
  font-size: 11px;
  color: var(--disclaimer);
  font-weight: 400;
}

/* ===== Speech bubble ===== */
#speech-bubble {
  position: fixed;
  bottom: 60px;
  left: 50%;
  transform: translateX(-50%);
  max-width: 540px;
  min-width: 320px;
  padding: 18px 22px;
  background: var(--bubble-bg);
  border: 2px solid var(--bubble-border);
  border-radius: 14px;
  box-shadow: 0 12px 32px var(--bubble-shadow);
  transition: opacity 0.35s ease, transform 0.35s ease;
  z-index: 30;
  pointer-events: none;
}

#speech-bubble::after {
  content: '';
  position: absolute;
  top: -10px;
  left: 50%;
  transform: translateX(-50%) rotate(45deg);
  width: 18px;
  height: 18px;
  background: var(--bubble-bg);
  border-left: 2px solid var(--bubble-border);
  border-top: 2px solid var(--bubble-border);
}

#speech-bubble.hidden {
  opacity: 0;
  transform: translateX(-50%) translateY(12px);
}

.bubble-name {
  font-weight: 600;
  font-size: 12px;
  color: var(--accent-dark);
  margin-bottom: 8px;
  text-transform: uppercase;
  letter-spacing: 0.8px;
}

.bubble-text {
  font-size: 16px;
  line-height: 1.55;
  color: var(--text);
}

/* ===== Controls ===== */
#controls {
  position: fixed;
  top: 14px;
  right: 14px;
  z-index: 25;
  display: flex;
  gap: 8px;
  padding-top: 30px;
}

.ctrl-btn {
  background: rgba(255, 248, 232, 0.95);
  border: 1.5px solid var(--accent);
  width: 44px;
  height: 44px;
  border-radius: 50%;
  font-size: 18px;
  cursor: pointer;
  transition: all 0.2s ease;
  color: var(--text);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 12px rgba(58, 38, 18, 0.12);
}

.ctrl-btn:hover {
  background: var(--accent);
  color: white;
  transform: scale(1.05);
}

.ctrl-btn.active {
  background: var(--accent);
  color: white;
}

/* ===== Loading overlay ===== */
#loading-overlay {
  position: fixed;
  inset: 0;
  background: var(--bg-warm);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 100;
  transition: opacity 0.5s ease;
}

#loading-overlay.hidden {
  opacity: 0;
  pointer-events: none;
}

.loader {
  text-align: center;
}

.loader-spinner {
  width: 48px;
  height: 48px;
  border: 3px solid var(--bg-warm-darker);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  margin: 0 auto 16px;
}

.loader-text {
  font-size: 14px;
  color: var(--text-soft);
  letter-spacing: 0.3px;
}

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

/* ===== Footer note ===== */
#footer-note {
  position: fixed;
  bottom: 12px;
  left: 0;
  right: 0;
  text-align: center;
  font-size: 11px;
  color: var(--text-soft);
  z-index: 20;
  pointer-events: none;
  opacity: 0.7;
}

/* ===== Responsive ===== */
@media (max-width: 768px) {
  #speech-bubble {
    max-width: calc(100vw - 32px);
    min-width: 0;
    padding: 14px 16px;
    bottom: 50px;
  }

  .bubble-text {
    font-size: 14px;
  }

  #top-bar {
    padding: 10px 14px;
  }

  .brand {
    font-size: 12px;
  }

  .brand-sub {
    display: none;
  }

  .disclaimer {
    font-size: 10px;
  }

  .ctrl-btn {
    width: 40px;
    height: 40px;
    font-size: 16px;
  }
}
