/* ══════════════════════════════════════
   Onboarding — 3-screen force-through
   Claude Design v2 · Nugget Nihongo
══════════════════════════════════════ */

/* Fullscreen overlay */
#onboardingOverlay {
  position: fixed;
  inset: 0;
  z-index: 9000;
  background: var(--bg);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  animation: ob-fadein 0.3s ease;
}
#onboardingOverlay.ob-hidden { display: none; }

@keyframes ob-fadein {
  from { opacity: 0; }
  to   { opacity: 1; }
}

/* Top row: progress pills + skip */
.ob-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: max(env(safe-area-inset-top, 0px), 0.75rem) 1.25rem 0.75rem;
}
.ob-dots {
  display: flex;
  gap: 5px;
}
.ob-dot {
  height: 6px;
  border-radius: 100px;
  background: var(--surface-3);
  transition: width 0.3s cubic-bezier(0.34,1.56,0.64,1), background 0.3s;
  width: 6px;
}
.ob-dot.active  { width: 20px; background: var(--accent); }
.ob-dot.done    { background: var(--accent-green, #4ADE80); }

.ob-btn-skip {
  background: none; border: none;
  color: var(--muted); font-size: 0.78rem;
  font-family: var(--font-ui); cursor: pointer;
  padding: 0.4rem 0.5rem;
  transition: color 0.18s;
}
.ob-btn-skip:hover { color: var(--text); }

/* Scrollable body */
.ob-body {
  flex: 1; overflow-y: auto; padding: 0.75rem 1.25rem 0;
  display: flex; flex-direction: column;
}

/* Glyph display */
.ob-glyph {
  font-family: var(--font-jp-display, 'Shippori Mincho', serif);
  font-size: clamp(5rem, 22vw, 7rem);
  font-weight: 700;
  color: var(--accent-hot, #FBBF24);
  line-height: 0.9;
  letter-spacing: -0.05em;
  text-shadow: 0 0 40px rgba(245,158,11,0.28);
  margin-bottom: 0.25rem;
  user-select: none;
}

/* Screen text */
.ob-eyebrow {
  font-size: 0.65rem; font-weight: 700;
  letter-spacing: 0.16em; text-transform: uppercase;
  color: var(--accent-hot, #FBBF24); margin-top: 1rem;
}
.ob-title {
  font-size: clamp(1.4rem, 5.5vw, 1.75rem);
  font-weight: 800; color: var(--text-bright, var(--text));
  letter-spacing: -0.02em; line-height: 1.2;
  margin: 0.4rem 0 0.5rem;
}
.ob-sub {
  font-size: 0.85rem; color: var(--muted);
  line-height: 1.55; margin-bottom: 1.25rem;
}

/* Option cards (level + goal screens) */
.ob-options {
  display: flex; flex-direction: column; gap: 8px;
  margin-bottom: 1rem;
}
.ob-option-card {
  display: flex; align-items: center; gap: 0.85rem;
  padding: 0.95rem 1rem;
  border-radius: var(--radius, 14px);
  border: 1px solid var(--border);
  background: var(--surface-2);
  cursor: pointer;
  text-align: left;
  color: var(--text);
  font-family: var(--font-ui);
  transition: border-color 0.18s, background 0.18s, box-shadow 0.18s;
  -webkit-tap-highlight-color: transparent;
}
.ob-option-card:hover { border-color: var(--border-2); }
.ob-option-card.selected {
  border-color: var(--border-strong, rgba(245,158,11,0.42));
  background: rgba(245,158,11,0.08);
  box-shadow: 0 0 0 1px var(--border-strong, rgba(245,158,11,0.3));
}

/* Radio circle */
.ob-radio {
  width: 20px; height: 20px; border-radius: 50%; flex-shrink: 0;
  border: 2px solid var(--border-2);
  display: flex; align-items: center; justify-content: center;
  transition: border-color 0.18s, background 0.18s;
}
.ob-option-card.selected .ob-radio {
  border-color: var(--accent); background: var(--accent);
}
.ob-radio-check {
  display: none; color: #1a0f00;
}
.ob-option-card.selected .ob-radio-check { display: block; }

.ob-option-text { flex: 1; }
.ob-option-label { font-size: 0.9rem; font-weight: 700; color: var(--text-bright, var(--text)); }
.ob-option-sub   { font-size: 0.7rem; color: var(--muted); margin-top: 2px; }

/* Slider screen */
.ob-slider-wrap {
  background: var(--surface-2); border: 1px solid var(--border-2);
  border-radius: var(--radius-lg, 20px);
  padding: 1.5rem 1.25rem;
  text-align: center; margin-bottom: 1rem;
}
.ob-slider-val {
  font-size: 3rem; font-weight: 800;
  color: var(--accent-hot, #FBBF24);
  font-family: var(--font-mono, ui-monospace, monospace);
  letter-spacing: -0.02em; line-height: 1;
}
.ob-slider-unit { font-size: 1rem; color: var(--muted); font-weight: 500; margin-left: 4px; }
.ob-slider-input {
  width: 100%; margin-top: 1rem;
  accent-color: var(--accent);
  -webkit-appearance: none;
  height: 5px; border-radius: 100px;
  background: var(--surface-3);
  cursor: pointer;
}
.ob-slider-labels {
  display: flex; justify-content: space-between;
  font-size: 0.65rem; color: var(--muted); margin-top: 6px;
}
.ob-slider-hint {
  font-size: 0.75rem; color: var(--muted); line-height: 1.5;
  margin-top: 1rem; max-width: 280px; margin-left: auto; margin-right: auto;
}

/* Screen wrapper */
.ob-screen { display: none; flex-direction: column; }
.ob-screen.active { display: flex; animation: ob-slide-in 0.3s ease; }
@keyframes ob-slide-in {
  from { opacity: 0; transform: translateX(18px); }
  to   { opacity: 1; transform: translateX(0); }
}

/* Footer buttons */
.ob-footer {
  display: flex; gap: 8px;
  padding: 0.75rem 1.25rem max(env(safe-area-inset-bottom, 0px), 1.25rem);
}
.ob-btn-back {
  padding: 0.9rem 1.1rem;
  border-radius: var(--radius, 14px);
  background: var(--surface-2); border: 1px solid var(--border);
  color: var(--text); font-family: var(--font-ui);
  font-size: 0.9rem; font-weight: 600; cursor: pointer;
  transition: background 0.18s;
}
.ob-btn-back:hover { background: var(--surface-3); }

.ob-btn-next {
  flex: 1; padding: 0.9rem 1.25rem;
  border-radius: var(--radius, 14px);
  background: var(--grad); color: #1a0f00;
  border: none; font-family: var(--font-ui);
  font-size: 0.95rem; font-weight: 800; cursor: pointer;
  box-shadow: var(--shadow-glow);
  transition: opacity 0.18s, transform 0.15s;
}
.ob-btn-next:disabled {
  background: var(--surface-3); color: var(--muted);
  box-shadow: none; cursor: not-allowed;
}
.ob-btn-next:not(:disabled):active { transform: scale(0.98); }

/* Legacy compat — keep old classes working */
.ob-btn-primary {
  width: 100%; max-width: 320px;
  padding: 0.9rem 1.5rem; border-radius: 14px;
  background: var(--grad); color: #1a0f00;
  font-size: 1rem; font-weight: 700; border: none;
  cursor: pointer; box-shadow: var(--shadow-glow);
}
.ob-avatar {
  width: 72px; height: 72px; border-radius: 50%;
  background: var(--grad); display: flex; align-items: center;
  justify-content: center; font-size: 2rem;
  margin-bottom: 1.5rem; box-shadow: var(--shadow-glow);
}
