/* Kaizen - style.css */
/* Premium Design System: Deep navy, warm gold, soft white, accent teal */
/* Mobile-first (375px) - 60fps animations using transform/opacity only */

:root {
  --navy: #1a1a2e;
  --navy-light: #232342;
  --navy-lighter: #2d2d50;
  --navy-deep: #12122a;
  --gold: #e2b714;
  --gold-light: #f0d060;
  --gold-orange: #f09819;
  --white: #f5f5f5;
  --white-dim: #c0c0c0;
  --teal: #16a085;
  --teal-emerald: #0ed2af;
  --purple: #8e44ad;
  --purple-deep: #6c3483;
  --coral: #ff6b6b;
  --cyan: #00d2ff;
  --bg: var(--navy);
  --card-bg: var(--navy-light);
  --text: var(--white);
  --text-dim: var(--white-dim);
  --nav-height: 68px;
  --progress-height: 3px;
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  --glass-bg: rgba(35, 35, 66, 0.6);
  --glass-border: rgba(255, 255, 255, 0.08);
  --cat-science: #3498ff;
  --cat-history: #f0a500;
  --cat-tech: #00d2ff;
  --cat-health: #2ecc71;
  --cat-business: #9b59b6;
  --cat-fun: #ff6b6b;
  --cat-self: #e2b714;
  --cat-news: #34495e;
  --cat-sports: #e67e22;
  --cat-brain: #a855f7;
}

.light-mode {
  --bg: #f0f0f5;
  --card-bg: #ffffff;
  --text: #1a1a2e;
  --text-dim: #666;
  --navy-light: #ffffff;
  --navy-lighter: #e8e8f0;
  --glass-bg: rgba(255, 255, 255, 0.7);
  --glass-border: rgba(0, 0, 0, 0.08);
}

* { margin: 0; padding: 0; box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body {
  height: 100%;
  overflow: hidden;
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  background: var(--bg);
  color: var(--text);
  -webkit-font-smoothing: antialiased;
}

/* Hide scrollbars globally on mobile */
::-webkit-scrollbar { width: 0; height: 0; }
* { scrollbar-width: none; }

.hidden { display: none !important; }

/* ===== KEYFRAMES ===== */
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes fadeInUp { from { transform: translateY(24px); opacity: 0; } to { transform: translateY(0); opacity: 1; } }
@keyframes fadeInScale { from { transform: scale(0.92); opacity: 0; } to { transform: scale(1); opacity: 1; } }
@keyframes slideUp { from { transform: translateY(30px); opacity: 0; } to { transform: translateY(0); opacity: 1; } }
@keyframes pulse { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.05); } }
@keyframes pulseGlow {
  0%, 100% { filter: drop-shadow(0 0 8px rgba(226, 183, 20, 0.3)); }
  50% { filter: drop-shadow(0 0 20px rgba(226, 183, 20, 0.6)); }
}
@keyframes heartBurst {
  0% { transform: scale(0); opacity: 1; }
  50% { transform: scale(1.4); opacity: 1; }
  100% { transform: scale(1); opacity: 0; }
}
@keyframes heartParticles {
  0% { transform: scale(0) rotate(0deg); opacity: 1; }
  100% { transform: scale(2) rotate(45deg); opacity: 0; }
}
@keyframes shake {
  0%, 100% { transform: translateX(0); }
  20% { transform: translateX(-8px); }
  40% { transform: translateX(8px); }
  60% { transform: translateX(-4px); }
  80% { transform: translateX(4px); }
}
@keyframes correctFlash {
  0% { box-shadow: 0 0 0 0 rgba(22, 160, 133, 0.6); }
  100% { box-shadow: 0 0 30px 10px rgba(22, 160, 133, 0); }
}
@keyframes wrongFlash {
  0% { box-shadow: 0 0 0 0 rgba(231, 76, 60, 0.6); }
  100% { box-shadow: 0 0 30px 10px rgba(231, 76, 60, 0); }
}
@keyframes slideInRight { from { transform: translateX(100%); opacity: 0; } to { transform: translateX(0); opacity: 1; } }
@keyframes slideOutLeft { from { transform: translateX(0); opacity: 1; } to { transform: translateX(-30%); opacity: 0; } }
@keyframes gradientShift {
  0% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
  100% { background-position: 0% 50%; }
}
@keyframes float {
  0%, 100% { transform: translateY(0) scale(1); opacity: 0.15; }
  50% { transform: translateY(-30px) scale(1.1); opacity: 0.25; }
}
@keyframes float2 {
  0%, 100% { transform: translateY(0) rotate(0deg); opacity: 0.1; }
  50% { transform: translateY(-20px) rotate(180deg); opacity: 0.2; }
}
@keyframes ripple {
  0% { transform: scale(0); opacity: 0.5; }
  100% { transform: scale(4); opacity: 0; }
}
@keyframes countUp {
  from { transform: translateY(10px); opacity: 0; }
  to { transform: translateY(0); opacity: 1; }
}
@keyframes skeletonShimmer {
  0% { background-position: -200% 0; }
  100% { background-position: 200% 0; }
}
@keyframes confettiFall {
  0% { transform: translateY(-10px) rotate(0deg); opacity: 1; }
  100% { transform: translateY(100vh) rotate(720deg); opacity: 0; }
}
@keyframes toastIn {
  from { transform: translateX(-50%) translateY(-20px); opacity: 0; }
  to { transform: translateX(-50%) translateY(0); opacity: 1; }
}
@keyframes toastOut {
  from { transform: translateX(-50%) translateY(0); opacity: 1; }
  to { transform: translateX(-50%) translateY(-20px); opacity: 0; }
}
@keyframes bounceIn {
  0% { transform: scale(0.3); opacity: 0; }
  50% { transform: scale(1.05); }
  70% { transform: scale(0.95); }
  100% { transform: scale(1); opacity: 1; }
}
@keyframes fireGlow {
  0%, 100% { text-shadow: 0 0 8px rgba(255, 100, 0, 0.6); }
  50% { text-shadow: 0 0 20px rgba(255, 100, 0, 0.9), 0 0 40px rgba(255, 50, 0, 0.4); }
}
@keyframes progressRing {
  from { stroke-dashoffset: 283; }
}
@keyframes cardFlipIn {
  from { transform: rotateY(90deg); opacity: 0; }
  to { transform: rotateY(0deg); opacity: 1; }
}
@keyframes tabSlide {
  from { transform: scaleX(0); }
  to { transform: scaleX(1); }
}
@keyframes navDotPulse {
  0%, 100% { opacity: 0.6; transform: translateX(-50%) scale(1); }
  50% { opacity: 1; transform: translateX(-50%) scale(1.2); }
}
@keyframes staggerIn {
  from { transform: translateY(20px) scale(0.95); opacity: 0; }
  to { transform: translateY(0) scale(1); opacity: 1; }
}
@keyframes screenPulseGreen {
  0% { box-shadow: inset 0 0 0 0 rgba(22, 160, 133, 0); }
  50% { box-shadow: inset 0 0 60px 10px rgba(22, 160, 133, 0.15); }
  100% { box-shadow: inset 0 0 0 0 rgba(22, 160, 133, 0); }
}
@keyframes screenPulseRed {
  0% { box-shadow: inset 0 0 0 0 rgba(231, 76, 60, 0); }
  50% { box-shadow: inset 0 0 60px 10px rgba(231, 76, 60, 0.15); }
  100% { box-shadow: inset 0 0 0 0 rgba(231, 76, 60, 0); }
}

/* ===== MICRO-INTERACTIONS ===== */
.press-scale { transition: transform 0.15s ease; }
.press-scale:active { transform: scale(0.95); }

/* ===== ONBOARDING ===== */
.screen {
  position: fixed; inset: 0;
  display: flex; align-items: center; justify-content: center;
  background: linear-gradient(135deg, #1a1a2e 0%, #2d1b69 50%, #1a1a2e 100%);
  background-size: 400% 400%;
  animation: gradientShift 8s ease infinite;
  z-index: 1000;
  overflow: hidden;
}

/* Floating zen circles */
.zen-circles {
  position: absolute; inset: 0; pointer-events: none; overflow: hidden;
}
.zen-circle {
  position: absolute;
  border-radius: 50%;
  border: 1px solid rgba(226, 183, 20, 0.15);
}
.zen-circle:nth-child(1) { width: 200px; height: 200px; top: 10%; left: -50px; animation: float 8s ease-in-out infinite; }
.zen-circle:nth-child(2) { width: 150px; height: 150px; top: 60%; right: -30px; animation: float 10s ease-in-out 2s infinite; }
.zen-circle:nth-child(3) { width: 100px; height: 100px; top: 30%; right: 20%; animation: float2 12s ease-in-out 1s infinite; }
.zen-circle:nth-child(4) { width: 80px; height: 80px; bottom: 20%; left: 15%; animation: float 9s ease-in-out 3s infinite; }
.zen-circle:nth-child(5) { width: 120px; height: 120px; top: 5%; right: 10%; animation: float2 11s ease-in-out 4s infinite; }

.onboarding-content {
  text-align: center;
  padding: 24px;
  max-width: 420px;
  width: 100%;
  max-height: 100vh;
  overflow-y: auto;
  position: relative;
  z-index: 2;
}

.splash-logo {
  margin-bottom: 8px;
  animation: fadeInScale 0.8s ease;
}
.logo-img {
  width: 160px; height: 160px;
  animation: pulseGlow 3s ease-in-out infinite;
}

.onboarding-subtitle {
  font-size: 18px; color: var(--gold); font-weight: 300;
  letter-spacing: 4px; text-transform: uppercase;
  margin-bottom: 12px;
  opacity: 0; animation: fadeInUp 0.6s ease 0.3s forwards;
}

.onboarding-desc {
  font-size: 14px; color: var(--text-dim); line-height: 1.6;
  margin-bottom: 24px;
  opacity: 0; animation: fadeInUp 0.6s ease 0.6s forwards;
}

.interests-grid {
  display: grid; grid-template-columns: repeat(2, 1fr);
  gap: 10px; margin-bottom: 16px;
  opacity: 0; animation: fadeInUp 0.6s ease 0.9s forwards;
}

.interest-chip {
  padding: 14px 8px;
  border-radius: 14px;
  background: var(--glass-bg);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 2px solid var(--glass-border);
  cursor: pointer;
  transition: transform 0.2s ease, border-color 0.3s ease, box-shadow 0.3s ease;
  font-size: 13px;
  display: flex; flex-direction: column; align-items: center; gap: 6px;
}
.interest-chip .chip-icon { font-size: 26px; transition: transform 0.3s ease; }
.interest-chip:active { transform: scale(0.93); }
.interest-chip:hover { transform: scale(1.03); }
.interest-chip.selected {
  border-color: var(--gold);
  background: rgba(226, 183, 20, 0.15);
  box-shadow: 0 0 20px rgba(226, 183, 20, 0.2);
}
.interest-chip.selected .chip-icon { transform: scale(1.15); }

.interest-hint {
  font-size: 12px; color: var(--text-dim); margin-bottom: 16px;
  opacity: 0; animation: fadeInUp 0.6s ease 1.1s forwards;
}

.btn-primary {
  width: 100%; padding: 16px; border: none; border-radius: 14px;
  background: linear-gradient(135deg, var(--gold), var(--gold-orange));
  color: var(--navy); font-size: 16px;
  font-weight: 700; cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.3s ease;
  position: relative; overflow: hidden;
  opacity: 0; animation: fadeInUp 0.6s ease 1.3s forwards;
}
.btn-primary:disabled { opacity: 0.4; cursor: not-allowed; }
.btn-primary:not(:disabled):active { transform: scale(0.97); }
.btn-primary:not(:disabled) {
  box-shadow: 0 4px 20px rgba(226, 183, 20, 0.3);
}
.btn-primary:not(:disabled):hover {
  box-shadow: 0 6px 30px rgba(226, 183, 20, 0.5);
}
/* Ripple effect */
.btn-primary .ripple {
  position: absolute; border-radius: 50%;
  background: rgba(255, 255, 255, 0.4);
  animation: ripple 0.6s ease-out forwards;
  pointer-events: none;
}

/* ===== DAILY PROGRESS BAR ===== */
.daily-progress-bar {
  position: fixed; top: var(--safe-top); left: 0; right: 0;
  height: var(--progress-height); background: var(--navy-lighter); z-index: 100;
}
.daily-progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--teal), var(--teal-emerald), var(--gold));
  background-size: 200% 100%;
  animation: gradientShift 3s ease infinite;
  width: 0%; transition: width 0.8s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ===== STREAK TOAST ===== */
.streak-toast {
  position: fixed; top: calc(var(--safe-top) + 12px); left: 50%; transform: translateX(-50%);
  background: var(--glass-bg);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid var(--glass-border);
  padding: 10px 20px; border-radius: 20px;
  font-size: 14px; font-weight: 600; z-index: 200;
  box-shadow: 0 8px 32px rgba(0,0,0,0.3);
  animation: toastIn 0.4s ease;
}
.streak-toast.hiding { animation: toastOut 0.3s ease forwards; }
.streak-fire { margin-right: 6px; animation: fireGlow 1.5s ease-in-out infinite; }

/* ===== TOAST NOTIFICATION SYSTEM ===== */
.toast-notification {
  position: fixed; top: calc(var(--safe-top) + 16px); left: 50%; transform: translateX(-50%);
  background: var(--glass-bg);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid var(--glass-border);
  padding: 12px 24px; border-radius: 16px;
  font-size: 13px; font-weight: 600; z-index: 300;
  box-shadow: 0 8px 32px rgba(0,0,0,0.3);
  animation: toastIn 0.4s ease;
  white-space: nowrap;
}
.toast-notification.toast-success { border-color: rgba(22, 160, 133, 0.4); }
.toast-notification.toast-info { border-color: rgba(226, 183, 20, 0.4); }
.toast-notification.hiding { animation: toastOut 0.3s ease forwards; }

/* ===== PAGES ===== */
.screens-container {
  position: fixed;
  top: calc(var(--safe-top) + var(--progress-height));
  left: 0; right: 0;
  bottom: calc(var(--nav-height) + var(--safe-bottom));
  overflow: hidden;
}
.page {
  position: absolute; inset: 0;
  overflow-y: auto; overflow-x: hidden;
  opacity: 0; pointer-events: none;
  transition: opacity 0.3s ease, transform 0.3s ease;
  transform: translateX(8px);
  -webkit-overflow-scrolling: touch;
}
.page.active {
  opacity: 1; pointer-events: auto;
  transform: translateX(0);
}

/* Status bar gradient overlay */
.page::before {
  content: ''; position: sticky; top: 0; left: 0; right: 0;
  display: block; height: 20px; z-index: 5;
  background: linear-gradient(var(--bg), transparent);
  pointer-events: none;
}
#page-home::before { display: none; }

.page-header {
  padding: 20px 20px 12px;
  position: sticky; top: 0; z-index: 10;
  background: var(--bg);
}
.page-header h1 {
  font-size: 30px; font-weight: 800;
  background: linear-gradient(135deg, var(--text) 0%, var(--gold) 100%);
  -webkit-background-clip: text; -webkit-text-fill-color: transparent;
  background-clip: text;
  animation: fadeInUp 0.5s ease;
}
.page-subtitle {
  font-size: 13px; color: var(--text-dim); margin-top: 4px;
  animation: fadeInUp 0.5s ease 0.1s both;
}

/* ===== HOME FEED (TikTok style) ===== */
.feed-container {
  height: 100%;
  overflow-y: scroll;
  scroll-snap-type: y mandatory;
  -webkit-overflow-scrolling: touch;
}

/* Top gradient overlay for status bar */
.feed-status-overlay {
  position: fixed;
  top: calc(var(--safe-top) + var(--progress-height));
  left: 0; right: 0; height: 60px;
  background: linear-gradient(rgba(0,0,0,0.5), transparent);
  pointer-events: none; z-index: 5;
}

.feed-card {
  height: 100%;
  scroll-snap-align: start;
  position: relative;
  display: flex; flex-direction: column;
  background: #000;
}

.feed-card iframe {
  flex: 1;
  width: 100%; height: 100%;
  border: none;
}

.feed-card-overlay {
  position: absolute; bottom: 0; left: 0; right: 0;
  padding: 80px 16px 20px;
  background: linear-gradient(transparent, rgba(0,0,0,0.85));
  pointer-events: none;
}

/* Glassmorphism text overlay */
.feed-card-text-glass {
  background: rgba(255, 255, 255, 0.08);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 14px;
  padding: 12px 14px;
}

.feed-card-title {
  font-size: 15px; font-weight: 700; color: #fff;
  margin-bottom: 8px; line-height: 1.3;
}

.feed-card-meta {
  display: flex; align-items: center; gap: 8px;
}

.category-pill {
  padding: 4px 12px; border-radius: 12px;
  font-size: 11px; font-weight: 700;
  color: #fff; letter-spacing: 0.3px;
}
/* Category pill gradients */
.cat-pill-science { background: linear-gradient(135deg, #2980b9, #3498ff); }
.cat-pill-history { background: linear-gradient(135deg, #d4880f, #f0a500); }
.cat-pill-technology { background: linear-gradient(135deg, #0097b2, #00d2ff); }
.cat-pill-health { background: linear-gradient(135deg, #1e8449, #2ecc71); }
.cat-pill-business { background: linear-gradient(135deg, #7d3c98, #a855f7); }
.cat-pill-fun { background: linear-gradient(135deg, #e74c3c, #ff6b6b); }
.cat-pill-self { background: linear-gradient(135deg, #c49b0e, #f0d060); color: var(--navy); }
.cat-pill-news { background: linear-gradient(135deg, #2c3e50, #546e7a); }
.cat-pill-sports { background: linear-gradient(135deg, #d35400, #f39c12); }
.cat-pill-brain { background: linear-gradient(135deg, #7d3c98, #a855f7); }

.feed-card-channel {
  font-size: 12px; color: rgba(255,255,255,0.7);
}

.feed-card-actions {
  position: absolute; right: 12px; bottom: 100px;
  display: flex; flex-direction: column; gap: 16px;
  pointer-events: auto;
}

.feed-action-btn {
  width: 48px; height: 48px;
  border-radius: 50%; border: none;
  background: rgba(255,255,255,0.12);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid rgba(255,255,255,0.1);
  display: flex; align-items: center; justify-content: center;
  font-size: 22px; cursor: pointer;
  transition: transform 0.2s ease, background 0.3s ease;
}
.feed-action-btn:active { transform: scale(0.85); }
.feed-action-btn.saved {
  background: rgba(226, 183, 20, 0.25);
  border-color: rgba(226, 183, 20, 0.3);
  box-shadow: 0 0 16px rgba(226, 183, 20, 0.2);
}
.feed-action-btn.share-bounce { animation: bounceIn 0.4s ease; }

/* ===== DISCOVER ===== */
/* Search bar */
.discover-search {
  padding: 0 16px 12px;
  animation: fadeInUp 0.4s ease;
}
.discover-search-input {
  width: 100%; padding: 12px 16px 12px 40px;
  border-radius: 14px; border: 1px solid var(--glass-border);
  background: var(--glass-bg);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  color: var(--text); font-size: 14px;
  font-family: inherit; outline: none;
  transition: border-color 0.3s ease, box-shadow 0.3s ease;
}
.discover-search-input:focus {
  border-color: var(--gold);
  box-shadow: 0 0 20px rgba(226, 183, 20, 0.15);
}
.discover-search-input::placeholder { color: var(--text-dim); }
.discover-search-wrap {
  position: relative;
}
.discover-search-icon {
  position: absolute; left: 14px; top: 50%; transform: translateY(-50%);
  font-size: 16px; pointer-events: none;
}

.discover-grid {
  display: grid; grid-template-columns: repeat(2, 1fr);
  gap: 12px; padding: 0 16px 100px;
}

.discover-card {
  border-radius: 18px; padding: 22px 14px;
  text-align: center; cursor: pointer;
  transition: transform 0.25s ease, box-shadow 0.3s ease;
  position: relative; overflow: hidden;
  border: 1px solid rgba(255,255,255,0.08);
}
.discover-card:active { transform: scale(0.95) perspective(600px) rotateX(2deg); }
.discover-card:hover { transform: scale(1.02); box-shadow: 0 8px 32px rgba(0,0,0,0.3); }
.discover-card-icon {
  font-size: 40px; margin-bottom: 8px;
  transition: transform 0.3s ease;
}
.discover-card:active .discover-card-icon { transform: scale(1.15) rotate(-5deg); }
.discover-card h3 { font-size: 15px; font-weight: 700; color: #fff; }
.discover-card p { font-size: 11px; color: rgba(255,255,255,0.7); margin-top: 4px; }

/* Staggered animation for discover cards */
.discover-card { opacity: 0; animation: staggerIn 0.4s ease forwards; }
.discover-card:nth-child(1) { animation-delay: 0.05s; }
.discover-card:nth-child(2) { animation-delay: 0.1s; }
.discover-card:nth-child(3) { animation-delay: 0.15s; }
.discover-card:nth-child(4) { animation-delay: 0.2s; }
.discover-card:nth-child(5) { animation-delay: 0.25s; }
.discover-card:nth-child(6) { animation-delay: 0.3s; }
.discover-card:nth-child(7) { animation-delay: 0.35s; }
.discover-card:nth-child(8) { animation-delay: 0.4s; }
.discover-card:nth-child(9) { animation-delay: 0.45s; }
.discover-card:nth-child(10) { animation-delay: 0.5s; }

.category-detail-header {
  display: flex; align-items: center; gap: 12px;
  padding: 20px 16px 12px;
  position: sticky; top: 0; background: var(--bg); z-index: 10;
}

.btn-back {
  width: 40px; height: 40px; border-radius: 50%;
  border: none;
  background: var(--glass-bg);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid var(--glass-border);
  color: var(--text); font-size: 18px; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: transform 0.15s ease;
}
.btn-back:active { transform: scale(0.9); }

.subcategory-pills {
  display: flex; gap: 8px; padding: 0 16px 12px;
  overflow-x: auto;
}

.sub-pill {
  padding: 7px 16px; border-radius: 20px;
  background: var(--glass-bg);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border: 1px solid var(--glass-border);
  font-size: 12px; font-weight: 600;
  white-space: nowrap; cursor: pointer;
  color: var(--text); transition: all 0.25s ease;
}
.sub-pill.active {
  background: linear-gradient(135deg, var(--gold), var(--gold-orange));
  color: var(--navy); border-color: transparent;
  box-shadow: 0 2px 12px rgba(226, 183, 20, 0.3);
}

.category-feed { padding: 0 16px 100px; }

.category-video-card {
  display: flex; gap: 12px; padding: 12px 0;
  border-bottom: 1px solid var(--navy-lighter);
  cursor: pointer;
  transition: transform 0.15s ease;
}
.category-video-card:active { transform: scale(0.98); }
.category-video-thumb {
  width: 120px; height: 68px; border-radius: 10px;
  background: var(--navy-lighter); flex-shrink: 0;
  overflow: hidden;
}
.category-video-thumb img { width: 100%; height: 100%; object-fit: cover; }
.category-video-info h4 { font-size: 13px; font-weight: 600; line-height: 1.4; }
.category-video-info p { font-size: 11px; color: var(--text-dim); margin-top: 4px; }

/* ===== NEWS ===== */
.news-tabs {
  display: flex; gap: 0; padding: 0 16px 12px;
  overflow-x: auto;
  position: relative;
}

.news-tab {
  padding: 8px 16px; border: none; background: none;
  color: var(--text-dim); font-size: 13px; font-weight: 600;
  cursor: pointer; white-space: nowrap; position: relative;
  transition: color 0.3s ease;
}
.news-tab.active { color: var(--gold); }
.news-tab-underline {
  position: absolute; bottom: 12px; height: 3px;
  background: linear-gradient(90deg, var(--gold), var(--gold-orange));
  border-radius: 2px;
  transition: left 0.3s cubic-bezier(0.4, 0, 0.2, 1), width 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  pointer-events: none;
}

.news-feed { padding: 0 16px 100px; }

/* Hero news card */
.news-card-hero {
  display: block; border-radius: 18px; overflow: hidden;
  margin-bottom: 16px; cursor: pointer; text-decoration: none; color: var(--text);
  background: var(--glass-bg);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid var(--glass-border);
  transition: transform 0.2s ease;
  animation: fadeInUp 0.5s ease;
}
.news-card-hero:active { transform: scale(0.98); }
.news-card-hero .hero-thumb {
  width: 100%; height: 180px; object-fit: cover;
}
.news-card-hero .hero-content { padding: 14px 16px; }
.news-card-hero h3 { font-size: 17px; font-weight: 700; line-height: 1.3; margin-bottom: 8px; }
.news-card-hero .news-meta { font-size: 12px; color: var(--text-dim); display: flex; align-items: center; gap: 8px; }
.news-source-icon { width: 16px; height: 16px; border-radius: 4px; vertical-align: middle; margin-right: 4px; }

.news-card {
  display: flex; gap: 12px; padding: 14px 0;
  border-bottom: 1px solid var(--navy-lighter);
  cursor: pointer; text-decoration: none; color: var(--text);
  transition: transform 0.15s ease;
}
.news-card:active { transform: scale(0.98); }
.news-thumb {
  width: 90px; height: 90px; border-radius: 12px;
  background: var(--navy-lighter); flex-shrink: 0;
  overflow: hidden;
}
.news-thumb img { width: 100%; height: 100%; object-fit: cover; }
.news-info { flex: 1; display: flex; flex-direction: column; justify-content: center; }
.news-info h4 { font-size: 14px; font-weight: 600; line-height: 1.4; margin-bottom: 6px; }
.news-meta { font-size: 11px; color: var(--text-dim); }
.news-meta span { margin-right: 8px; }

/* Skeleton loader - shimmer effect */
.skeleton-card {
  height: 90px; border-radius: 12px;
  background: linear-gradient(90deg, var(--navy-lighter) 25%, var(--navy-light) 50%, var(--navy-lighter) 75%);
  background-size: 200% 100%;
  animation: skeletonShimmer 1.5s ease infinite;
  margin-bottom: 12px;
}
.skeleton-hero {
  height: 240px; border-radius: 18px;
  background: linear-gradient(90deg, var(--navy-lighter) 25%, var(--navy-light) 50%, var(--navy-lighter) 75%);
  background-size: 200% 100%;
  animation: skeletonShimmer 1.5s ease infinite;
  margin-bottom: 16px;
}

/* ===== BRAIN TRAINING ===== */
.brain-sections {
  display: grid; grid-template-columns: repeat(2, 1fr);
  gap: 12px; padding: 0 16px 100px;
}

.brain-card {
  background: var(--glass-bg);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-radius: 18px;
  padding: 22px 14px; text-align: center;
  cursor: pointer;
  transition: transform 0.25s ease, box-shadow 0.3s ease;
  border: 1px solid var(--glass-border);
  position: relative; overflow: hidden;
}
.brain-card:active { transform: scale(0.94); }
.brain-card:hover { box-shadow: 0 8px 32px rgba(0,0,0,0.2); }
.brain-card:nth-child(5) { grid-column: span 2; }
.brain-card-icon { font-size: 36px; margin-bottom: 8px; }
.brain-card h3 { font-size: 15px; font-weight: 700; margin-bottom: 4px; }
.brain-card p { font-size: 11px; color: var(--text-dim); }

/* XP badge on brain cards */
.brain-xp-badge {
  position: absolute; top: 8px; right: 8px;
  background: linear-gradient(135deg, var(--gold), var(--gold-orange));
  color: var(--navy); font-size: 10px; font-weight: 800;
  padding: 3px 8px; border-radius: 10px;
}

/* Stagger brain cards */
.brain-card { opacity: 0; animation: staggerIn 0.4s ease forwards; }
.brain-card:nth-child(1) { animation-delay: 0.05s; }
.brain-card:nth-child(2) { animation-delay: 0.1s; }
.brain-card:nth-child(3) { animation-delay: 0.15s; }
.brain-card:nth-child(4) { animation-delay: 0.2s; }
.brain-card:nth-child(5) { animation-delay: 0.25s; }

.brain-view-header {
  display: flex; align-items: center; gap: 12px;
  padding: 20px 16px 12px;
  position: sticky; top: 0; background: var(--bg); z-index: 10;
}
.brain-view-header h2 { flex: 1; font-size: 20px; font-weight: 700; }
.brain-streak {
  font-size: 14px; font-weight: 700;
  background: var(--glass-bg);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border: 1px solid var(--glass-border);
  padding: 5px 14px;
  border-radius: 20px;
  display: flex; align-items: center; gap: 4px;
}
.brain-streak .fire-icon { animation: fireGlow 1.5s ease-in-out infinite; }

.brain-view-content { padding: 0 16px 100px; }

/* Math game - animated timer ring */
.math-problem {
  text-align: center; padding: 20px 0;
}
.math-timer-ring {
  width: 100px; height: 100px; margin: 0 auto 16px;
  position: relative;
}
.math-timer-ring svg { transform: rotate(-90deg); }
.math-timer-ring circle {
  fill: none; stroke-width: 6;
}
.math-timer-ring .ring-bg { stroke: var(--navy-lighter); }
.math-timer-ring .ring-fg {
  stroke: var(--teal);
  stroke-linecap: round;
  transition: stroke-dashoffset 1s linear, stroke 0.3s ease;
}
.math-timer-ring .ring-fg.warning { stroke: var(--coral); }
.math-timer-text {
  position: absolute; inset: 0;
  display: flex; align-items: center; justify-content: center;
  font-size: 22px; font-weight: 700;
}

.math-expression {
  font-size: 44px; font-weight: 800; margin-bottom: 20px;
  background: linear-gradient(135deg, var(--gold), var(--gold-orange));
  -webkit-background-clip: text; -webkit-text-fill-color: transparent;
  background-clip: text;
}
.math-input {
  width: 140px; padding: 14px; font-size: 26px; text-align: center;
  border: 2px solid var(--navy-lighter); border-radius: 14px;
  background: var(--glass-bg);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  color: var(--text);
  outline: none; font-family: inherit;
  transition: border-color 0.3s ease, box-shadow 0.3s ease;
}
.math-input:focus { border-color: var(--gold); box-shadow: 0 0 20px rgba(226, 183, 20, 0.15); }
.math-input.correct {
  border-color: var(--teal);
  animation: correctFlash 0.5s ease;
}
.math-input.wrong {
  border-color: #e74c3c;
  animation: shake 0.4s ease;
}
.math-score {
  margin-top: 16px; font-size: 14px; color: var(--text-dim);
}

/* Screen pulse feedback */
.screen-pulse-green { animation: screenPulseGreen 0.5s ease; }
.screen-pulse-red { animation: screenPulseRed 0.5s ease; }

/* Quiz - progress dots */
.quiz-progress-dots {
  display: flex; justify-content: center; gap: 6px;
  margin-bottom: 16px; padding-top: 8px;
}
.quiz-dot {
  width: 10px; height: 10px; border-radius: 50%;
  background: var(--navy-lighter);
  transition: background 0.3s ease, transform 0.3s ease;
}
.quiz-dot.active { background: var(--gold); transform: scale(1.2); }
.quiz-dot.correct { background: var(--teal); }
.quiz-dot.wrong { background: #e74c3c; }

.quiz-question {
  font-size: 19px; font-weight: 700; text-align: center;
  padding: 20px 0 20px; line-height: 1.4;
  animation: cardFlipIn 0.4s ease;
}
.quiz-options { display: flex; flex-direction: column; gap: 10px; }
.quiz-option {
  padding: 15px 18px; border-radius: 14px;
  background: var(--glass-bg);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border: 2px solid var(--glass-border);
  font-size: 15px; font-weight: 500; cursor: pointer;
  transition: all 0.25s ease;
  text-align: left; color: var(--text); font-family: inherit;
}
.quiz-option:active { transform: scale(0.97); }
.quiz-option.correct {
  border-color: var(--teal);
  background: rgba(22, 160, 133, 0.2);
  box-shadow: 0 0 20px rgba(22, 160, 133, 0.15);
}
.quiz-option.wrong {
  border-color: #e74c3c;
  background: rgba(231, 76, 60, 0.2);
  animation: shake 0.4s ease;
}
.quiz-progress {
  text-align: center; font-size: 12px; color: var(--text-dim);
  margin-bottom: 8px;
}
.quiz-score-final {
  text-align: center; padding: 40px 0;
  animation: bounceIn 0.5s ease;
}
.quiz-score-final .score-number {
  font-size: 68px; font-weight: 800;
  background: linear-gradient(135deg, var(--gold), var(--gold-orange));
  -webkit-background-clip: text; -webkit-text-fill-color: transparent;
  background-clip: text;
}
.quiz-score-final p { font-size: 16px; color: var(--text-dim); margin-top: 8px; }
.quiz-score-final .btn-primary { margin-top: 24px; opacity: 1; }

/* Confetti container */
.confetti-container {
  position: fixed; inset: 0; pointer-events: none; z-index: 400;
}
.confetti-piece {
  position: absolute; top: -10px;
  width: 10px; height: 10px; border-radius: 2px;
  animation: confettiFall 2s ease forwards;
}

/* Word of the day */
.word-card {
  background: var(--glass-bg);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-radius: 18px;
  padding: 32px 20px; text-align: center;
  border: 1px solid var(--glass-border);
  animation: fadeInScale 0.5s ease;
}
.word-main {
  font-size: 34px; font-weight: 800;
  background: linear-gradient(135deg, var(--gold), var(--gold-orange));
  -webkit-background-clip: text; -webkit-text-fill-color: transparent;
  background-clip: text;
  margin-bottom: 4px;
}
.word-origin { font-size: 12px; color: var(--text-dim); margin-bottom: 16px; font-style: italic; }
.word-meaning { font-size: 16px; line-height: 1.6; color: var(--text); }

/* Facts */
.fact-card {
  background: var(--glass-bg);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-radius: 18px;
  padding: 24px 20px; text-align: center;
  border: 1px solid var(--glass-border);
  margin-bottom: 16px;
  animation: fadeInScale 0.4s ease;
}
.fact-icon { font-size: 42px; margin-bottom: 12px; }
.fact-text { font-size: 15px; line-height: 1.7; }
.btn-next-fact {
  display: block; margin: 0 auto;
  padding: 12px 28px; border: none; border-radius: 24px;
  background: linear-gradient(135deg, var(--gold), var(--gold-orange));
  color: var(--navy);
  font-size: 14px; font-weight: 700; cursor: pointer;
  margin-top: 16px; transition: transform 0.15s ease;
  box-shadow: 0 4px 16px rgba(226, 183, 20, 0.3);
}
.btn-next-fact:active { transform: scale(0.93); }

/* ===== LEARN ===== */
.learn-subjects {
  display: grid; grid-template-columns: repeat(2, 1fr);
  gap: 12px; padding: 0 16px 100px;
}
.learn-subject-card {
  background: var(--glass-bg);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-radius: 18px;
  padding: 20px 14px; text-align: center;
  cursor: pointer;
  transition: transform 0.25s ease, box-shadow 0.3s ease;
  border: 1px solid var(--glass-border);
}
.learn-subject-card:active { transform: scale(0.95); }
.learn-subject-icon { font-size: 34px; margin-bottom: 6px; }
.learn-subject-card h4 { font-size: 15px; font-weight: 700; }
.learn-subject-card .progress-mini {
  height: 4px; background: var(--navy-lighter); border-radius: 2px;
  margin-top: 8px; overflow: hidden;
}
.learn-subject-card .progress-mini-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--teal), var(--teal-emerald));
  border-radius: 2px;
  transition: width 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

.lesson-card {
  background: var(--glass-bg);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-radius: 18px;
  padding: 24px 20px;
  border: 1px solid var(--glass-border);
  margin-bottom: 16px;
  animation: fadeInUp 0.4s ease;
}
.lesson-card h3 {
  font-size: 19px; font-weight: 700;
  background: linear-gradient(135deg, var(--gold), var(--gold-orange));
  -webkit-background-clip: text; -webkit-text-fill-color: transparent;
  background-clip: text;
  margin-bottom: 12px;
}
.lesson-card p { font-size: 14px; line-height: 1.7; color: var(--text); }
.lesson-nav {
  display: flex; justify-content: space-between; align-items: center;
  margin-top: 16px;
}
.lesson-nav button {
  padding: 11px 22px; border: none; border-radius: 12px;
  font-size: 13px; font-weight: 700; cursor: pointer;
  transition: transform 0.15s ease;
}
.lesson-nav button:active { transform: scale(0.93); }
.lesson-prev {
  background: var(--glass-bg);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border: 1px solid var(--glass-border);
  color: var(--text);
}
.lesson-next {
  background: linear-gradient(135deg, var(--gold), var(--gold-orange));
  color: var(--navy);
  box-shadow: 0 4px 16px rgba(226, 183, 20, 0.25);
}
.lesson-progress { font-size: 12px; color: var(--text-dim); }

/* ===== PROFILE ===== */
.profile-content { padding: 0 20px 100px; text-align: center; }

.profile-avatar {
  width: 88px; height: 88px; border-radius: 50%;
  background: linear-gradient(135deg, var(--navy-lighter), var(--navy-light));
  display: flex;
  align-items: center; justify-content: center;
  font-size: 42px; margin: 0 auto 12px;
  border: 2px solid var(--glass-border);
  box-shadow: 0 4px 24px rgba(0,0,0,0.3);
}

.profile-name {
  background: none; border: none; border-bottom: 2px solid var(--navy-lighter);
  color: var(--text); font-size: 22px; font-weight: 700;
  text-align: center; padding: 8px; width: 100%; max-width: 240px;
  font-family: inherit; outline: none;
  transition: border-bottom-color 0.3s ease;
}
.profile-name:focus { border-bottom-color: var(--gold); }

/* Streak flame display */
.profile-streak-flame {
  display: flex; align-items: center; justify-content: center;
  gap: 8px; margin: 16px 0;
  font-size: 20px; font-weight: 800;
}
.profile-streak-flame .flame-emoji {
  font-size: 32px;
  animation: fireGlow 1.5s ease-in-out infinite;
}
.profile-streak-flame .streak-count {
  background: linear-gradient(135deg, var(--gold), var(--gold-orange));
  -webkit-background-clip: text; -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* Animated circular progress ring */
.daily-goal-ring {
  width: 120px; height: 120px; margin: 0 auto 8px;
  position: relative;
}
.daily-goal-ring svg { transform: rotate(-90deg); }
.daily-goal-ring circle { fill: none; stroke-width: 8; }
.daily-goal-ring .ring-bg { stroke: var(--navy-lighter); }
.daily-goal-ring .ring-fg {
  stroke: url(#goalGradient);
  stroke-linecap: round;
  transition: stroke-dashoffset 1s cubic-bezier(0.4, 0, 0.2, 1);
}
.daily-goal-text {
  position: absolute; inset: 0;
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
}
.daily-goal-pct {
  font-size: 24px; font-weight: 800;
  background: linear-gradient(135deg, var(--teal), var(--teal-emerald));
  -webkit-background-clip: text; -webkit-text-fill-color: transparent;
  background-clip: text;
}
.daily-goal-label { font-size: 10px; color: var(--text-dim); }

.stats-grid {
  display: grid; grid-template-columns: repeat(2, 1fr);
  gap: 10px; margin: 20px 0;
}
.stat-card {
  background: var(--glass-bg);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-radius: 14px;
  padding: 18px 8px;
  border: 1px solid var(--glass-border);
  transition: transform 0.2s ease;
}
.stat-card:active { transform: scale(0.96); }
.stat-number {
  font-size: 30px; font-weight: 800;
  background: linear-gradient(135deg, var(--gold), var(--gold-orange));
  -webkit-background-clip: text; -webkit-text-fill-color: transparent;
  background-clip: text;
}
.stat-label { font-size: 11px; color: var(--text-dim); margin-top: 2px; font-weight: 500; }

.profile-section {
  text-align: left; margin-top: 24px;
}
.profile-section h3 { font-size: 17px; font-weight: 700; margin-bottom: 12px; }

.goal-setting {
  display: flex; justify-content: space-between; align-items: center;
  padding: 12px 0; border-bottom: 1px solid var(--navy-lighter);
}
.goal-setting label { font-size: 14px; font-weight: 500; }
.goal-stepper {
  display: flex; align-items: center; gap: 14px;
}
.stepper-btn {
  width: 34px; height: 34px; border-radius: 50%;
  border: none;
  background: var(--glass-bg);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border: 1px solid var(--glass-border);
  color: var(--text); font-size: 16px; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: all 0.2s ease;
}
.stepper-btn:active {
  background: linear-gradient(135deg, var(--gold), var(--gold-orange));
  color: var(--navy); border-color: transparent;
  transform: scale(0.9);
}
.goal-stepper span { font-size: 18px; font-weight: 700; min-width: 24px; text-align: center; }

.profile-interests {
  display: flex; flex-wrap: wrap; gap: 8px;
}
.profile-interest-tag {
  padding: 7px 14px; border-radius: 20px;
  font-size: 12px; font-weight: 600;
  cursor: pointer; transition: all 0.25s ease;
  border: 2px solid transparent;
}
.profile-interest-tag.active {
  border-color: var(--gold);
  box-shadow: 0 0 12px rgba(226, 183, 20, 0.2);
}

.saved-videos { min-height: 60px; }
.empty-state { font-size: 13px; color: var(--text-dim); text-align: center; padding: 20px; }

.saved-video-item {
  display: flex; align-items: center; gap: 12px;
  padding: 10px 0; border-bottom: 1px solid var(--navy-lighter);
}
.saved-video-item .thumb {
  width: 60px; height: 34px; border-radius: 8px;
  background: var(--navy-lighter); overflow: hidden;
}
.saved-video-item .thumb img { width: 100%; height: 100%; object-fit: cover; }
.saved-video-item span { font-size: 13px; flex: 1; font-weight: 500; }
.saved-video-item .remove-btn {
  background: none; border: none; color: var(--text-dim);
  font-size: 18px; cursor: pointer; padding: 4px;
  transition: color 0.2s;
}
.saved-video-item .remove-btn:active { color: var(--coral); }

/* iOS-style toggle with colour transition */
.toggle-row {
  display: flex; justify-content: space-between; align-items: center;
  padding: 12px 0;
}
.toggle {
  position: relative; width: 52px; height: 30px;
}
.toggle input { display: none; }
.toggle-slider {
  position: absolute; inset: 0; border-radius: 15px;
  background: var(--navy-lighter); cursor: pointer;
  transition: background 0.35s cubic-bezier(0.4, 0, 0.2, 1);
}
.toggle-slider::before {
  content: ''; position: absolute;
  width: 24px; height: 24px; border-radius: 50%;
  background: var(--white); top: 3px; left: 3px;
  transition: transform 0.35s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 2px 6px rgba(0,0,0,0.2);
}
.toggle input:checked + .toggle-slider {
  background: linear-gradient(135deg, var(--gold), var(--gold-orange));
}
.toggle input:checked + .toggle-slider::before { transform: translateX(22px); }

/* ===== BOTTOM NAV ===== */
.bottom-nav {
  position: fixed; bottom: var(--safe-bottom); left: 0; right: 0;
  height: var(--nav-height);
  background: var(--glass-bg);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  border-top: 1px solid var(--glass-border);
  display: flex; justify-content: space-around; align-items: center;
  z-index: 100;
}

.nav-btn {
  display: flex; flex-direction: column; align-items: center;
  gap: 2px; background: none; border: none;
  color: var(--text-dim); cursor: pointer;
  padding: 8px 12px; position: relative;
  transition: color 0.2s ease;
  -webkit-tap-highlight-color: transparent;
}
.nav-btn.active { color: var(--gold); }
.nav-icon {
  font-size: 22px;
  transition: transform 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}
.nav-btn.active .nav-icon { transform: scale(1.15); }
.nav-label { font-size: 10px; font-weight: 600; }

/* Gradient glow dot under active nav */
.nav-btn::after {
  content: ''; position: absolute; bottom: 2px; left: 50%;
  width: 5px; height: 5px; border-radius: 50%;
  background: linear-gradient(135deg, var(--gold), var(--gold-orange));
  transform: translateX(-50%) scale(0);
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 0 8px rgba(226, 183, 20, 0.5);
}
.nav-btn.active::after {
  transform: translateX(-50%) scale(1);
  animation: navDotPulse 2s ease-in-out infinite;
}

/* ===== HEART OVERLAY ===== */
.heart-overlay {
  position: fixed; inset: 0; z-index: 500;
  display: flex; align-items: center; justify-content: center;
  pointer-events: none;
}
.heart-anim {
  font-size: 100px;
  animation: heartBurst 0.7s ease forwards;
}
/* Heart particle effects */
.heart-particle {
  position: absolute; font-size: 20px;
  animation: heartParticles 0.8s ease forwards;
  pointer-events: none;
}

/* ===== RESPONSIVE ===== */
@media (min-width: 480px) {
  .interests-grid { grid-template-columns: repeat(3, 1fr); }
  .discover-grid { grid-template-columns: repeat(3, 1fr); }
}
