/* ============================================
   RUSSKIVERSE — MAIN STYLES
   ============================================ */

* { margin: 0; padding: 0; box-sizing: border-box; -webkit-tap-highlight-color: transparent; }

html, body {
  height: 100%;
  background: var(--rv-bg);
  color: var(--rv-text-primary);
  font-family: var(--rv-font-body);
  overscroll-behavior-y: contain;
  transition: background var(--rv-dur-base) var(--rv-ease), color var(--rv-dur-base) var(--rv-ease);
}

body { -webkit-font-smoothing: antialiased; overflow-x: hidden; }

img { max-width: 100%; display: block; }
button { font-family: inherit; border: none; background: none; cursor: pointer; }
a { text-decoration: none; color: inherit; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.001ms !important; transition-duration: 0.001ms !important; }
}

/* ---------- Layout shell ---------- */
#app {
  max-width: 480px;
  margin: 0 auto;
  min-height: 100vh;
  position: relative;
  display: flex;
  flex-direction: column;
}

.rv-page {
  flex: 1;
  padding: var(--rv-space-4) var(--rv-space-4) 120px;
  display: none;
  animation: rvFadeUp var(--rv-dur-slow) var(--rv-ease);
}
.rv-page.active { display: block; }

@keyframes rvFadeUp {
  from { opacity: 0; transform: translateY(14px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ---------- Aurora ribbon (signature background motif) ----------
   A slow-drifting gradient band evoking the winter aurora / Northern Lights over
   Moscow rooftops. Sits fixed behind all content, very low opacity, GPU-only
   (transform + opacity), never intercepts input. */
.rv-aurora {
  position: fixed;
  inset: -20% -20% auto -20%;
  height: 60vh;
  pointer-events: none;
  z-index: 0;
  background:
    radial-gradient(60% 50% at 20% 20%, rgba(196,30,58,0.16), transparent 60%),
    radial-gradient(50% 40% at 80% 10%, rgba(169,214,229,0.28), transparent 60%),
    radial-gradient(40% 30% at 50% 40%, rgba(201,162,39,0.10), transparent 60%);
  filter: blur(40px);
  animation: rvAuroraDrift 22s ease-in-out infinite alternate;
  will-change: transform;
}
[data-theme="dark"] .rv-aurora { opacity: 0.7; }

@keyframes rvAuroraDrift {
  from { transform: translate3d(-2%, 0, 0) scale(1); }
  to   { transform: translate3d(3%, 2%, 0) scale(1.08); }
}

/* ---------- Glass surfaces ---------- */
.rv-glass {
  background: var(--rv-glass);
  border: 1px solid var(--rv-glass-border);
  backdrop-filter: var(--rv-blur-md);
  -webkit-backdrop-filter: var(--rv-blur-md);
  border-radius: var(--rv-radius-md);
  box-shadow: var(--rv-shadow);
}

.rv-card {
  position: relative;
  z-index: 1;
  padding: var(--rv-space-5);
  border-radius: var(--rv-radius-md);
  background: var(--rv-glass);
  border: 1px solid var(--rv-glass-border);
  backdrop-filter: var(--rv-blur-sm);
  -webkit-backdrop-filter: var(--rv-blur-sm);
  box-shadow: var(--rv-shadow);
  transition: transform var(--rv-dur-fast) var(--rv-ease), box-shadow var(--rv-dur-fast) var(--rv-ease);
}
.rv-card:active { transform: scale(0.98); }

/* ---------- Splash screen ---------- */
#rv-splash {
  position: fixed;
  inset: 0;
  z-index: 999;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: var(--rv-space-4);
  background: linear-gradient(160deg, var(--rv-midnight) 0%, #071227 100%);
  transition: opacity var(--rv-dur-slow) var(--rv-ease), visibility var(--rv-dur-slow);
}
#rv-splash.rv-hide { opacity: 0; visibility: hidden; pointer-events: none; }

.rv-splash-mark {
  width: 92px; height: 92px;
  border-radius: 26px;
  background: rgba(255,255,255,0.08);
  border: 1px solid rgba(255,255,255,0.25);
  backdrop-filter: blur(14px);
  display: flex; align-items: center; justify-content: center;
  font-family: var(--rv-font-display);
  font-size: 2.1rem;
  color: var(--rv-ice);
  box-shadow: 0 0 60px rgba(169,214,229,0.35);
  animation: rvSplashIn 1.1s var(--rv-ease) both, rvGlow 2.4s ease-in-out 1.1s infinite alternate;
}
@keyframes rvSplashIn {
  0%   { opacity: 0; transform: scale(0.6) rotate(-8deg); }
  60%  { opacity: 1; transform: scale(1.06) rotate(2deg); }
  100% { opacity: 1; transform: scale(1) rotate(0); }
}
@keyframes rvGlow {
  from { box-shadow: 0 0 40px rgba(169,214,229,0.25); }
  to   { box-shadow: 0 0 70px rgba(169,214,229,0.55); }
}
.rv-splash-title {
  font-family: var(--rv-font-display);
  color: var(--rv-snow);
  font-size: var(--rv-fs-lg);
  letter-spacing: 0.02em;
  opacity: 0;
  animation: rvFadeUp 0.9s var(--rv-ease) 0.5s forwards;
}
.rv-splash-tagline {
  color: var(--rv-ice);
  font-size: var(--rv-fs-sm);
  letter-spacing: 0.14em;
  text-transform: uppercase;
  opacity: 0;
  animation: rvFadeUp 0.9s var(--rv-ease) 0.75s forwards;
}

/* ---------- Top bar (minimal, transparent — hero carries the brand weight) ---------- */
.rv-topbar {
  position: sticky; top: 0; z-index: 10;
  display: flex; align-items: center; justify-content: space-between;
  padding: var(--rv-space-4) var(--rv-space-4) var(--rv-space-2);
  background: transparent;
}
.rv-brand { display: flex; align-items: center; gap: 8px; font-family: var(--rv-font-display); font-size: var(--rv-fs-sm); color: var(--rv-text-secondary); letter-spacing: 0.04em; }
.rv-brand .material-symbols-rounded { color: var(--rv-crimson); font-size: 20px; }
.rv-avatar-btn {
  width: 36px; height: 36px; border-radius: 50%;
  background: var(--rv-gradient-cta); color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-family: var(--rv-font-display); font-size: var(--rv-fs-sm);
  box-shadow: var(--rv-glow-crimson);
  transition: transform var(--rv-dur-fast) var(--rv-ease);
}
.rv-avatar-btn:active { transform: scale(0.92); }

/* ---------- Floating glass navigation ---------- */
.rv-nav {
  position: fixed; left: var(--rv-space-4); right: var(--rv-space-4); bottom: var(--rv-space-4); z-index: 20;
  max-width: 448px; margin: 0 auto;
  display: flex; justify-content: space-around; align-items: center;
  padding: 8px; border-radius: var(--rv-radius-full);
  background: var(--rv-glass);
  backdrop-filter: var(--rv-blur-lg);
  -webkit-backdrop-filter: var(--rv-blur-lg);
  border: 1px solid var(--rv-glass-border);
  box-shadow: var(--rv-shadow-lg);
}
.rv-nav-indicator {
  position: absolute; top: 8px; bottom: 8px; left: 8px;
  width: calc((100% - 16px) / 5);
  border-radius: var(--rv-radius-full);
  background: var(--rv-gradient-cta);
  box-shadow: var(--rv-glow-crimson);
  transform: translateX(0);
  transition: transform var(--rv-dur-base) var(--rv-ease);
  will-change: transform;
  z-index: 0;
}
.rv-nav-item {
  position: relative; z-index: 1;
  display: flex; flex-direction: column; align-items: center; gap: 1px;
  padding: 8px 4px; flex: 1;
  border-radius: var(--rv-radius-full);
  color: var(--rv-text-muted);
  font-size: 10px;
  transition: color var(--rv-dur-fast) var(--rv-ease);
}
.rv-nav-item.active { color: #fff; }
.rv-nav-item .material-symbols-rounded { font-size: 20px; }

/* ---------- Typography helpers ---------- */
.rv-h1 { font-family: var(--rv-font-display); font-size: var(--rv-fs-xl); line-height: 1.15; }
.rv-h2 { font-family: var(--rv-font-display); font-size: var(--rv-fs-md); margin-bottom: var(--rv-space-3); }
.rv-eyebrow { font-size: var(--rv-fs-xs); letter-spacing: 0.12em; text-transform: uppercase; color: var(--rv-text-muted); }
.rv-muted { color: var(--rv-text-secondary); font-size: var(--rv-fs-sm); }

/* ---------- Word / insight card contents ---------- */
.rv-scroll-row { display: flex; gap: var(--rv-space-3); overflow-x: auto; padding-bottom: var(--rv-space-2); scrollbar-width: none; }
.rv-scroll-row::-webkit-scrollbar { display: none; }

.rv-word-card { min-width: 220px; }
.rv-word-ru { font-family: var(--rv-font-display); font-size: var(--rv-fs-lg); color: var(--rv-text-primary); }
.rv-word-stress { color: var(--rv-crimson); }
.rv-word-pron { font-family: var(--rv-font-mono); font-size: var(--rv-fs-xs); color: var(--rv-text-muted); }
.rv-word-meaning { margin-top: var(--rv-space-2); font-size: var(--rv-fs-sm); color: var(--rv-text-secondary); }
.rv-tag {
  display: inline-block; font-size: var(--rv-fs-xs); padding: 2px 10px;
  border-radius: var(--rv-radius-full); background: var(--rv-ice-2); color: var(--rv-midnight);
  margin-right: 4px;
}
[data-theme="dark"] .rv-tag { background: rgba(169,214,229,0.15); color: var(--rv-ice); }

/* ---------- Search ---------- */
.rv-search {
  display: flex; align-items: center; gap: var(--rv-space-2);
  padding: var(--rv-space-3) var(--rv-space-4); margin-bottom: var(--rv-space-4);
}
.rv-search input { flex: 1; background: none; border: none; outline: none; font-size: var(--rv-fs-base); color: var(--rv-text-primary); }
.rv-search .material-symbols-rounded { color: var(--rv-text-muted); }

/* ---------- Buttons ---------- */
.rv-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  padding: 12px 22px; border-radius: var(--rv-radius-full);
  font-size: var(--rv-fs-sm); font-weight: 600;
  transition: transform var(--rv-dur-fast) var(--rv-ease);
}
.rv-btn-primary { background: linear-gradient(135deg, var(--rv-crimson), var(--rv-crimson-2)); color: #fff; box-shadow: 0 10px 24px rgba(196,30,58,0.3); }
.rv-btn-primary:active { transform: scale(0.96); }
.rv-btn-ghost { background: var(--rv-glass); border: 1px solid var(--rv-glass-border); color: var(--rv-text-primary); }

/* ---------- Empty state ---------- */
.rv-empty { text-align: center; padding: var(--rv-space-7) var(--rv-space-4); color: var(--rv-text-muted); }

/* ---------- Speaker button (TTS) ---------- */
.rv-speak-btn {
  width: 34px; height: 34px; border-radius: var(--rv-radius-full);
  display: flex; align-items: center; justify-content: center;
  background: rgba(196,30,58,0.1); color: var(--rv-crimson);
  transition: transform var(--rv-dur-fast) var(--rv-ease);
}
.rv-speak-btn:active { transform: scale(0.9); }
.rv-speak-btn .material-symbols-rounded { font-size: 18px; }

/* ============================================
   HERO SECTION (signature: Matryoshka progress rings)
   ============================================ */
.rv-hero {
  position: relative;
  border-radius: var(--rv-radius-lg);
  background: var(--rv-gradient-hero);
  padding: var(--rv-space-5) var(--rv-space-5) var(--rv-space-6);
  overflow: hidden;
  box-shadow: var(--rv-shadow-lg);
  margin-bottom: var(--rv-space-5);
}
.rv-hero::before {
  content: '';
  position: absolute; inset: 0;
  background: radial-gradient(120% 80% at 100% 0%, rgba(169,214,229,0.18), transparent 60%);
  pointer-events: none;
}
.rv-hero-top { position: relative; z-index: 1; display: flex; justify-content: space-between; align-items: flex-start; }
.rv-hero-greeting { color: rgba(247,249,252,0.65); font-size: var(--rv-fs-xs); letter-spacing: 0.1em; text-transform: uppercase; }
.rv-hero-name { font-family: var(--rv-font-display); color: var(--rv-snow); font-size: var(--rv-fs-lg); margin-top: 4px; }
.rv-hero-streak-pill {
  display: flex; align-items: center; gap: 4px;
  background: rgba(255,255,255,0.1); border: 1px solid rgba(255,255,255,0.18);
  padding: 6px 12px; border-radius: var(--rv-radius-full);
  font-size: var(--rv-fs-xs); color: var(--rv-snow); font-weight: 600;
}
.rv-hero-streak-pill .material-symbols-rounded { font-size: 15px; color: #FFA94D; }

.rv-rings-wrap { position: relative; z-index: 1; display: flex; justify-content: center; margin: var(--rv-space-5) 0 var(--rv-space-4); }
.rv-rings-center { position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%); text-align: center; }
.rv-rings-center b { display: block; font-family: var(--rv-font-display); font-size: var(--rv-fs-xl); color: var(--rv-snow); line-height: 1; }
.rv-rings-center span { font-size: 10px; color: rgba(247,249,252,0.6); text-transform: uppercase; letter-spacing: 0.08em; }
.rv-rings-legend { position: relative; z-index: 1; display: flex; justify-content: center; gap: var(--rv-space-4); margin-top: 4px; }
.rv-rings-legend div { display: flex; align-items: center; gap: 6px; font-size: 11px; color: rgba(247,249,252,0.75); }
.rv-rings-legend i { width: 8px; height: 8px; border-radius: 50%; display: inline-block; }

.rv-mission-card {
  position: relative; z-index: 1;
  background: rgba(255,255,255,0.08); border: 1px solid rgba(255,255,255,0.14);
  border-radius: var(--rv-radius-md); padding: var(--rv-space-4);
  backdrop-filter: var(--rv-blur-sm);
}
.rv-mission-card .rv-eyebrow { color: rgba(247,249,252,0.55); }
.rv-mission-title { color: var(--rv-snow); font-size: var(--rv-fs-sm); margin-top: 4px; font-weight: 600; }
.rv-mission-bar-track { height: 6px; border-radius: var(--rv-radius-full); background: rgba(255,255,255,0.15); margin-top: 10px; overflow: hidden; }
.rv-mission-bar-fill { height: 100%; border-radius: var(--rv-radius-full); background: var(--rv-gradient-gold); transition: width var(--rv-dur-slow) var(--rv-ease); }

/* ============================================
   DAILY INSIGHTS CAROUSEL
   ============================================ */
.rv-insight-row {
  display: flex; gap: var(--rv-space-3); overflow-x: auto;
  scroll-snap-type: x mandatory; padding-bottom: 4px; margin-bottom: var(--rv-space-5);
  scrollbar-width: none;
}
.rv-insight-row::-webkit-scrollbar { display: none; }
.rv-insight-card {
  scroll-snap-align: start; min-width: 78%;
  padding: var(--rv-space-4);
}
.rv-insight-card .rv-eyebrow { display: flex; align-items: center; gap: 6px; }
.rv-insight-card .rv-eyebrow .material-symbols-rounded { font-size: 14px; color: var(--rv-crimson); }

/* ============================================
   FEATURE GRID (home modules)
   ============================================ */
.rv-feature-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: var(--rv-space-3); }
.rv-feature-card {
  display: flex; flex-direction: column; align-items: flex-start; gap: 8px;
  padding: var(--rv-space-4); text-align: left; min-height: 108px;
}
.rv-feature-icon {
  width: 40px; height: 40px; border-radius: 14px;
  display: flex; align-items: center; justify-content: center;
  background: var(--rv-gradient-cta); color: #fff;
  box-shadow: var(--rv-glow-crimson);
}
.rv-feature-icon.ice { background: linear-gradient(135deg, var(--rv-ice), #7FBFD4); box-shadow: var(--rv-glow-ice); color: var(--rv-midnight); }
.rv-feature-icon.gold { background: var(--rv-gradient-gold); box-shadow: 0 0 20px rgba(201,162,39,0.35); color: var(--rv-midnight); }
.rv-feature-icon .material-symbols-rounded { font-size: 20px; }
.rv-feature-title { font-family: var(--rv-font-display); font-size: var(--rv-fs-sm); }
.rv-feature-sub { font-size: 11px; color: var(--rv-text-muted); line-height: 1.3; }

/* ============================================
   PROFILE PAGE
   ============================================ */
.rv-profile-hero {
  position: relative; border-radius: var(--rv-radius-lg);
  background: var(--rv-gradient-hero); padding: var(--rv-space-6) var(--rv-space-5) var(--rv-space-5);
  text-align: center; overflow: hidden; box-shadow: var(--rv-shadow-lg); margin-bottom: var(--rv-space-4);
}
.rv-profile-hero::before {
  content: ''; position: absolute; inset: 0;
  background: radial-gradient(100% 60% at 50% 0%, rgba(169,214,229,0.2), transparent 60%);
}
.rv-avatar-ring {
  position: relative; z-index: 1; width: 88px; height: 88px; margin: 0 auto 14px;
  border-radius: 50%; padding: 4px;
  background: conic-gradient(var(--rv-ice), var(--rv-crimson), var(--rv-gold), var(--rv-ice));
  animation: rvRingSpin 6s linear infinite;
}
@media (prefers-reduced-motion: reduce) { .rv-avatar-ring { animation: none; } }
.rv-avatar-ring-inner {
  width: 100%; height: 100%; border-radius: 50%;
  background: var(--rv-midnight);
  display: flex; align-items: center; justify-content: center;
  font-family: var(--rv-font-display); font-size: 1.8rem; color: var(--rv-snow);
}
@keyframes rvRingSpin { from { transform: rotate(0); } to { transform: rotate(360deg); } }
.rv-profile-name { position: relative; z-index: 1; font-family: var(--rv-font-display); color: var(--rv-snow); font-size: var(--rv-fs-md); }
.rv-profile-handle { position: relative; z-index: 1; color: rgba(247,249,252,0.6); font-size: var(--rv-fs-sm); margin-top: 2px; }
.rv-premium-badge {
  position: relative; z-index: 1; display: inline-flex; align-items: center; gap: 5px;
  margin-top: 10px; padding: 5px 14px; border-radius: var(--rv-radius-full);
  background: rgba(201,162,39,0.18); border: 1px solid rgba(201,162,39,0.45);
  color: #E8C766; font-size: 11px; font-weight: 600; letter-spacing: 0.04em;
}
.rv-premium-badge .material-symbols-rounded { font-size: 13px; }

.rv-quote-card { text-align: center; padding: var(--rv-space-5); margin-bottom: var(--rv-space-4); }
.rv-quote-ru { font-family: var(--rv-font-display); font-size: var(--rv-fs-md); line-height: 1.4; }
.rv-quote-id { color: var(--rv-text-secondary); font-size: var(--rv-fs-sm); margin-top: 8px; font-style: italic; }

.rv-profile-stats { display: grid; grid-template-columns: repeat(2, 1fr); gap: var(--rv-space-3); margin-bottom: var(--rv-space-4); }
.rv-profile-stat-card { padding: var(--rv-space-4); }
.rv-profile-stat-card .material-symbols-rounded { font-size: 18px; color: var(--rv-crimson); }
.rv-profile-stat-card b { display: block; font-family: var(--rv-font-display); font-size: var(--rv-fs-lg); margin-top: 6px; }
.rv-profile-stat-card span { font-size: 11px; color: var(--rv-text-muted); }

.rv-level-progress { padding: var(--rv-space-4); margin-bottom: var(--rv-space-4); }
.rv-level-bar-track { height: 8px; border-radius: var(--rv-radius-full); background: var(--rv-ice-2); margin-top: 10px; overflow: hidden; }
[data-theme="dark"] .rv-level-bar-track { background: rgba(169,214,229,0.15); }
.rv-level-bar-fill { height: 100%; border-radius: var(--rv-radius-full); background: var(--rv-gradient-cta); transition: width var(--rv-dur-slow) var(--rv-ease); }

.rv-achievement-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--rv-space-3); margin-bottom: var(--rv-space-4); }
.rv-achievement {
  display: flex; flex-direction: column; align-items: center; gap: 6px;
  padding: var(--rv-space-3); text-align: center;
}
.rv-achievement-icon {
  width: 44px; height: 44px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  background: var(--rv-gradient-gold); color: var(--rv-midnight);
  box-shadow: 0 0 18px rgba(201,162,39,0.35);
}
.rv-achievement.locked .rv-achievement-icon { background: var(--rv-steel-2); color: var(--rv-bg); box-shadow: none; opacity: 0.5; }
.rv-achievement.locked .rv-achievement-label { opacity: 0.45; }
.rv-achievement-label { font-size: 10px; color: var(--rv-text-secondary); line-height: 1.2; }

.rv-streak-strip { display: flex; justify-content: space-between; padding: var(--rv-space-4); margin-bottom: var(--rv-space-4); }
.rv-streak-day { display: flex; flex-direction: column; align-items: center; gap: 6px; }
.rv-streak-dot { width: 26px; height: 26px; border-radius: 50%; background: var(--rv-ice-2); display: flex; align-items: center; justify-content: center; }
[data-theme="dark"] .rv-streak-dot { background: rgba(169,214,229,0.12); }
.rv-streak-dot.done { background: var(--rv-gradient-cta); box-shadow: var(--rv-glow-crimson); }
.rv-streak-dot .material-symbols-rounded { font-size: 14px; color: var(--rv-text-muted); }
.rv-streak-dot.done .material-symbols-rounded { color: #fff; }
.rv-streak-day span { font-size: 10px; color: var(--rv-text-muted); }

/* ============================================
   SKELETON LOADERS
   ============================================ */
.rv-skeleton {
  position: relative; overflow: hidden;
  background: var(--rv-glass);
  border-radius: var(--rv-radius-md);
}
.rv-skeleton::after {
  content: '';
  position: absolute; inset: 0;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.25), transparent);
  transform: translateX(-100%);
  animation: rvShimmer 1.4s ease-in-out infinite;
}
@keyframes rvShimmer { to { transform: translateX(100%); } }
.rv-skeleton-line { height: 12px; border-radius: 6px; background: rgba(120,130,150,0.18); margin-bottom: 8px; }

/* ============================================
   PERFORMANCE: skip offscreen layout/paint for long lists
   ============================================ */
.rv-list-card {
  content-visibility: auto;
  contain-intrinsic-size: 0 168px;
  contain: layout style paint;
}

/* ============================================
   PRONUNCIATION VISIBILITY TOGGLE
   ============================================ */
body.rv-hide-pron .rv-word-pron { display: none; }

/* ============================================
   STORY SYSTEM: clickable words
   ============================================ */
.rv-story-text { line-height: 2; font-size: var(--rv-fs-md); }
.rv-story-word {
  cursor: pointer; border-radius: 4px; padding: 1px 2px;
  transition: background var(--rv-dur-fast) var(--rv-ease), color var(--rv-dur-fast) var(--rv-ease);
}
.rv-story-word:active, .rv-story-word:hover { background: rgba(196,30,58,0.14); color: var(--rv-crimson); }

/* ============================================
   WORD LOOKUP MODAL
   ============================================ */
.rv-modal-overlay {
  position: fixed; inset: 0; z-index: 300;
  display: flex; align-items: flex-end; justify-content: center;
  background: rgba(6,18,36,0); backdrop-filter: blur(0px);
  transition: background var(--rv-dur-base) var(--rv-ease), backdrop-filter var(--rv-dur-base) var(--rv-ease);
  pointer-events: none;
}
.rv-modal-overlay.open { background: rgba(6,18,36,0.55); backdrop-filter: blur(4px); pointer-events: auto; }
.rv-modal-sheet {
  width: 100%; max-width: 480px;
  background: var(--rv-bg-elevated); border-radius: 24px 24px 0 0;
  padding: var(--rv-space-5); box-shadow: var(--rv-shadow-lg);
  transform: translateY(100%); transition: transform var(--rv-dur-base) var(--rv-ease);
}
.rv-modal-overlay.open .rv-modal-sheet { transform: translateY(0); }

/* ============================================
   PRONUNCIATION LAB
   ============================================ */
.rv-plab-tabs { display: flex; gap: 8px; margin: 16px 0; }
.rv-plab-tab {
  flex: 1; padding: 10px; border-radius: var(--rv-radius-full); text-align: center;
  font-size: var(--rv-fs-xs); font-weight: 600; background: var(--rv-glass); border: 1px solid var(--rv-glass-border); color: var(--rv-text-secondary);
}
.rv-plab-tab.active { background: var(--rv-gradient-cta); color: #fff; border-color: transparent; box-shadow: var(--rv-glow-crimson); }

.rv-plab-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.rv-plab-letter { padding: 14px 8px; text-align: center; }
.rv-plab-letter-glyph { font-family: var(--rv-font-display); font-size: 1.6rem; color: var(--rv-crimson); }
.rv-plab-letter-sound { font-size: 10px; color: var(--rv-text-muted); margin-top: 6px; line-height: 1.3; min-height: 26px; }
.rv-plab-letter-example { font-size: 11px; margin-top: 6px; color: var(--rv-text-secondary); }

.rv-plab-syl-row { display: flex; flex-wrap: wrap; gap: 8px; }
.rv-plab-syl {
  padding: 8px 12px; border-radius: 12px; background: var(--rv-ice-2); color: var(--rv-midnight);
  font-family: var(--rv-font-mono); font-size: var(--rv-fs-sm); text-align: center; line-height: 1.5;
}
[data-theme="dark"] .rv-plab-syl { background: rgba(169,214,229,0.15); color: var(--rv-ice); }
.rv-plab-syl span { display: block; font-size: 10px; opacity: 0.7; }

/* ============================================
   GLOBAL SEARCH
   ============================================ */
.rv-search-result-group { margin-bottom: var(--rv-space-4); }
.rv-search-result-group h3 { font-size: 11px; text-transform: uppercase; letter-spacing: 0.08em; color: var(--rv-text-muted); margin-bottom: 8px; }

/* ============================================
   FLASHCARD 3D FLIP
   ============================================ */
.rv-flip-scene { perspective: 1200px; min-height: 260px; touch-action: pan-y; }
.rv-flip-card {
  position: relative; width: 100%; min-height: 260px;
  transform-style: preserve-3d;
  transition: transform 500ms cubic-bezier(0.22, 1, 0.36, 1);
  cursor: pointer;
}
.rv-flip-card.flipped { transform: rotateY(180deg); }
.rv-flip-card.swiping { transition: none; }
.rv-flip-face {
  position: absolute; inset: 0;
  backface-visibility: hidden;
  border-radius: var(--rv-radius-lg);
  background: var(--rv-glass); border: 1px solid var(--rv-glass-border);
  backdrop-filter: var(--rv-blur-md); -webkit-backdrop-filter: var(--rv-blur-md);
  box-shadow: var(--rv-shadow-lg);
  padding: var(--rv-space-5);
  display: flex; flex-direction: column; justify-content: center; align-items: center; text-align: center;
}
.rv-flip-back { transform: rotateY(180deg); }

.rv-install-banner {
  display: flex; align-items: center; gap: 12px;
  margin-bottom: var(--rv-space-4);
}

/* ---------- Focus visibility ---------- */
button:focus-visible, input:focus-visible, .rv-nav-item:focus-visible {
  outline: 2px solid var(--rv-ice); outline-offset: 2px;
}
