.onboarding-overlay {
  position: fixed;
  inset: 0;
  background: rgba(15, 14, 26, 0.92);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  z-index: 10000;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity 300ms ease;
  pointer-events: none;
}

.onboarding-overlay.visible {
  opacity: 1;
  pointer-events: auto;
}

body.onboarding-lock {
  overflow: hidden;
}

.onboarding-modal {
  background: var(--surface);
  border: 1px solid var(--surface2);
  border-radius: 16px;
  padding: 32px;
  max-width: 720px;
  width: 90vw;
  max-height: 90vh;
  overflow-y: auto;
}

.onboarding-modal-content {
  display: flex;
  gap: 24px;
  align-items: center;
  margin-bottom: 24px;
}

.onboarding-mascot {
  flex-shrink: 0;
}

.onboarding-mascot img {
  width: 200px;
  height: 200px;
  border-radius: 16px;
  object-fit: cover;
  animation: mascot-float 4s ease-in-out infinite alternate;
  box-shadow: 0 0 24px rgba(212, 168, 67, 0.3);
}

@keyframes mascot-float {
  from { transform: translateY(0); }
  to { transform: translateY(-8px); }
}

.onboarding-text {
  flex: 1;
  min-width: 0;
}

.onboarding-title {
  font-family: 'Cinzel', serif;
  color: var(--amber);
  font-size: 1.5rem;
  margin: 0 0 8px;
  line-height: 1.3;
}

.onboarding-subtitle {
  color: var(--text);
  font-family: 'Inter', sans-serif;
  font-size: 1rem;
  margin: 0;
  opacity: 0.85;
}

.onboarding-buttons {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-bottom: 16px;
}

.onboarding-path-btn {
  display: flex;
  align-items: center;
  gap: 14px;
  min-height: 64px;
  padding: 12px 18px;
  background: var(--amber);
  color: var(--bg);
  border: none;
  border-radius: 12px;
  cursor: pointer;
  text-align: left;
  font-family: 'Inter', sans-serif;
  font-size: 0.95rem;
  transition: background 200ms ease, transform 200ms ease;
}

.onboarding-path-btn:hover {
  background: var(--amber-grad);
  transform: translateX(4px);
}

.onboarding-path-btn:active {
  transform: translateX(2px);
}

.onboarding-path-btn.secondary {
  background: transparent;
  border: 1px solid var(--surface2);
  color: var(--text);
}

.onboarding-path-btn.secondary:hover {
  background: var(--surface2);
  border-color: var(--amber);
}

.path-icon {
  font-size: 1.5rem;
  flex-shrink: 0;
  width: 40px;
  text-align: center;
}

.path-text {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.path-text strong {
  font-size: 1rem;
  font-weight: 600;
}

.path-text span {
  font-size: 0.85rem;
  opacity: 0.75;
}

.onboarding-hint {
  color: var(--text);
  opacity: 0.5;
  font-size: 0.8rem;
  text-align: center;
  margin: 0;
  font-family: 'Inter', sans-serif;
}

/* Wovenkeep Bubble */
.tantu-bubble {
  position: fixed;
  bottom: 80px;
  right: 24px;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  overflow: hidden;
  cursor: pointer;
  z-index: 9000;
  box-shadow: 0 0 12px rgba(212, 168, 67, 0.4);
  transition: transform 200ms ease, opacity 300ms ease;
  opacity: 0;
  transform: scale(0.8);
}

.tantu-bubble.visible {
  opacity: 1;
  transform: scale(1);
}

.tantu-bubble:hover {
  transform: scale(1.05);
}

.tantu-bubble img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* Bubble Mini-Sheet */
.tantu-bubble-sheet {
  position: fixed;
  bottom: 144px;
  right: 24px;
  background: var(--surface);
  border: 1px solid var(--surface2);
  border-radius: 12px;
  padding: 8px;
  z-index: 9001;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5);
  min-width: 200px;
}

.bubble-sheet-item {
  display: block;
  width: 100%;
  padding: 10px 14px;
  background: none;
  border: none;
  color: var(--text);
  font-family: 'Inter', sans-serif;
  font-size: 0.9rem;
  text-align: left;
  cursor: pointer;
  border-radius: 8px;
  transition: background 150ms ease;
}

.bubble-sheet-item:hover {
  background: var(--surface2);
}

/* Toast */
.onboarding-toast {
  position: fixed;
  top: 20px;
  left: 50%;
  transform: translateX(-50%) translateY(-20px);
  background: var(--surface);
  border: 1px solid var(--amber);
  color: var(--text);
  padding: 12px 24px;
  border-radius: 10px;
  font-family: 'Inter', sans-serif;
  font-size: 0.9rem;
  z-index: 10001;
  opacity: 0;
  transition: opacity 300ms ease, transform 300ms ease;
  pointer-events: none;
}

.onboarding-toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

/* Mobile (375px+) */
@media (max-width: 600px) {
  .onboarding-modal {
    padding: 20px;
    width: 95vw;
    max-height: 95vh;
  }

  .onboarding-modal-content {
    flex-direction: column;
    text-align: center;
  }

  .onboarding-mascot img {
    width: 140px;
    height: 140px;
  }

  .onboarding-title {
    font-size: 1.2rem;
  }

  .onboarding-path-btn {
    min-height: 56px;
    padding: 10px 14px;
  }

  .tantu-bubble {
    bottom: 72px;
    right: 16px;
    width: 48px;
    height: 48px;
  }

  .tantu-bubble-sheet {
    bottom: 128px;
    right: 16px;
  }
}

/* === Walkthrough Spotlight + Popover (Issue #357) === */

.walkthrough-overlay {
  position: fixed;
  inset: 0;
  background: rgba(15, 14, 26, 0.65);
  z-index: 9500;
  pointer-events: none;
  opacity: 0;
  transition: opacity 300ms ease;
}

.walkthrough-overlay.active {
  opacity: 1;
}

.walkthrough-spotlight {
  position: relative;
  z-index: 9600;
  outline: 4px solid var(--amber);
  outline-offset: 4px;
  box-shadow: 0 0 20px rgba(232, 168, 56, 0.5);
  border-radius: 8px;
  transition: outline 300ms ease, box-shadow 300ms ease;
  pointer-events: auto;
}

.walkthrough-popover {
  position: fixed;
  z-index: 9700;
  background: var(--surface);
  border: 1px solid var(--amber);
  border-radius: 12px;
  padding: 16px;
  max-width: 340px;
  min-width: 240px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5);
  pointer-events: auto;
  transition: opacity 200ms ease;
}

.walkthrough-popover-header {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
}

.walkthrough-popover-mascot {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  object-fit: cover;
}

.walkthrough-popover-step {
  font-family: 'Inter', sans-serif;
  font-size: 0.75rem;
  color: var(--muted);
}

.walkthrough-popover-text {
  font-family: 'Inter', sans-serif;
  font-size: 0.9rem;
  color: var(--text);
  margin: 0 0 12px;
  line-height: 1.5;
}

.walkthrough-popover-actions {
  display: flex;
  justify-content: space-between;
  gap: 8px;
}

.walkthrough-btn-skip {
  background: none;
  border: none;
  color: var(--muted);
  font-family: 'Inter', sans-serif;
  font-size: 0.8rem;
  cursor: pointer;
  padding: 6px 12px;
  border-radius: 6px;
  transition: color 150ms ease;
}

.walkthrough-btn-skip:hover {
  color: var(--text);
}

.walkthrough-btn-next {
  background: var(--amber);
  color: var(--bg);
  border: none;
  font-family: 'Inter', sans-serif;
  font-size: 0.85rem;
  font-weight: 600;
  padding: 8px 16px;
  border-radius: 8px;
  cursor: pointer;
  transition: background 200ms ease;
}

.walkthrough-btn-next:hover {
  background: var(--amber-grad);
}

/* Popover arrow */
.walkthrough-popover.arrow-top::before {
  content: '';
  position: absolute;
  top: -8px;
  left: 50%;
  transform: translateX(-50%);
  width: 0;
  height: 0;
  border-left: 8px solid transparent;
  border-right: 8px solid transparent;
  border-bottom: 8px solid var(--amber);
}

.walkthrough-popover.arrow-bottom::after {
  content: '';
  position: absolute;
  bottom: -8px;
  left: 50%;
  transform: translateX(-50%);
  width: 0;
  height: 0;
  border-left: 8px solid transparent;
  border-right: 8px solid transparent;
  border-top: 8px solid var(--amber);
}

/* Sandbox badge */
.badge-sandbox {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-family: 'Inter', sans-serif;
  font-size: 0.7rem;
  font-weight: 600;
  background: var(--amber);
  color: var(--bg);
  padding: 2px 8px;
  border-radius: 6px;
  vertical-align: middle;
}

/* Mobile walkthrough adjustments */
@media (max-width: 600px) {
  .walkthrough-popover {
    max-width: calc(100vw - 32px);
    min-width: 200px;
    left: 16px !important;
    right: 16px;
  }

  .walkthrough-spotlight {
    outline-width: 3px;
    outline-offset: 2px;
  }
}

/* ==================== INVITE SHARE ==================== */
.invite-link-box {
  display: flex;
  align-items: center;
  gap: .5rem;
  background: var(--surface2);
  border: 1px solid var(--surface2);
  border-radius: 8px;
  padding: .5rem .6rem;
  margin-bottom: .4rem;
}

.invite-share-btn {
  display: inline-flex;
  align-items: center;
  gap: .3rem;
  padding: .5rem .9rem;
  border-radius: 8px;
  background: var(--surface2);
  color: var(--text);
  border: 1px solid var(--surface2);
  font-size: .875rem;
  text-decoration: none;
  cursor: pointer;
  transition: background .15s;
}

.invite-share-btn:hover {
  background: var(--bg);
}

.invite-qr-img {
  max-width: 200px;
  display: block;
  border-radius: 8px;
  border: 1px solid var(--surface2);
}

/* ==================== EMPTY STATES ==================== */
.empty-state-card {
  background: var(--surface);
  border: 1px solid var(--surface2);
  border-radius: 12px;
  padding: 32px;
  text-align: center;
  max-width: 500px;
  margin: 32px auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
}

.empty-state-mascot {
  width: 80px;
  height: 80px;
  border-radius: 12px;
  object-fit: cover;
  box-shadow: 0 0 16px rgba(212, 168, 67, 0.3);
}

.empty-state-icon {
  font-size: 2.5rem;
  opacity: 0.6;
}

.empty-state-hint {
  color: var(--text);
  opacity: 0.75;
  line-height: 1.5;
  max-width: 400px;
  margin: 0;
}

.empty-state-cta {
  display: flex;
  gap: 12px;
  margin-top: 8px;
  flex-wrap: wrap;
  justify-content: center;
}

@media (max-width: 600px) {
  .empty-state-card {
    padding: 20px;
  }

  .empty-state-mascot {
    width: 60px;
    height: 60px;
  }

  .empty-state-icon {
    font-size: 2rem;
  }
}
