/* ============================================
   BÉ TÔ MÀU HỌC TẬP - Screen Styles
   v2: Bigger drawing, 2-col visual exercises
   ============================================ */

:root {
  --primary: #6C5CE7;
  --primary-light: #A29BFE;
  --primary-dark: #5A4BD1;
  --secondary: #FD79A8;
  --accent: #00CEC9;

  --gradient-1: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  --gradient-3: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
  --gradient-4: linear-gradient(135deg, #43e97b 0%, #38f9d7 100%);

  --bg-body: #F0F3F8;
  --card-bg: #FFFFFF;
  --text-dark: #2D3436;
  --text-medium: #636E72;
  --text-light: #B2BEC3;

  --shadow-xs: 0 1px 3px rgba(0,0,0,0.06);
  --shadow-sm: 0 2px 8px rgba(0,0,0,0.08);
  --shadow-md: 0 4px 16px rgba(0,0,0,0.12);
  --shadow-lg: 0 8px 32px rgba(0,0,0,0.16);
  --shadow-xl: 0 16px 48px rgba(0,0,0,0.2);
  --shadow-glow: 0 4px 20px rgba(108, 92, 231, 0.35);

  --radius-xs: 6px;
  --radius-sm: 10px;
  --radius-md: 14px;
  --radius-lg: 20px;
  --radius-xl: 28px;
  --radius-full: 9999px;

  --font: 'Nunito', 'Segoe UI', sans-serif;
  --transition: all 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

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

body {
  font-family: var(--font);
  background: var(--bg-body);
  color: var(--text-dark);
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

#print-container { display: none; }

/* ===== HEADER ===== */
.app-header {
  background: var(--gradient-1);
  padding: 28px 24px 24px;
  text-align: center;
  color: white;
  position: relative;
  overflow: hidden;
}

.header-bg-shapes { position: absolute; inset: 0; pointer-events: none; }

.bg-shape {
  position: absolute; font-size: 2rem; opacity: 0.15;
  animation: float 6s ease-in-out infinite;
}
.shape-1 { top: 10%; left: 8%; }
.shape-2 { top: 20%; right: 10%; animation-delay: 1s; }
.shape-3 { bottom: 15%; left: 15%; animation-delay: 2s; }
.shape-4 { bottom: 20%; right: 20%; animation-delay: 3s; }
.shape-5 { top: 50%; left: 50%; animation-delay: 4s; }

@keyframes float {
  0%, 100% { transform: translateY(0) rotate(0deg); }
  33% { transform: translateY(-12px) rotate(5deg); }
  66% { transform: translateY(6px) rotate(-3deg); }
}

.header-content { position: relative; z-index: 1; }
.app-header h1 { font-size: 2.2rem; font-weight: 900; text-shadow: 0 2px 8px rgba(0,0,0,0.2); }
.subtitle { font-size: 1rem; font-weight: 600; opacity: 0.92; margin-top: 6px; }
.subtitle-small { font-size: 0.82rem; opacity: 0.75; margin-top: 4px; font-style: italic; }

/* ===== CUSTOM TOPIC SECTION ===== */
.custom-section { max-width: 900px; margin: 0 auto; padding: 20px 24px 16px; }
.custom-header { text-align: center; margin-bottom: 16px; }
.custom-header h2 { font-size: 1.4rem; font-weight: 800; margin-bottom: 4px; }
.custom-subtitle { font-size: 0.88rem; color: var(--text-medium); }
.custom-input-wrapper { max-width: 600px; margin: 0 auto 16px; }

.custom-input-group {
  display: flex; align-items: center;
  background: var(--card-bg); border: 2px solid #E0E0E0;
  border-radius: var(--radius-xl); padding: 4px 4px 4px 16px;
  box-shadow: var(--shadow-sm); transition: var(--transition);
}
.custom-input-group:focus-within { border-color: var(--primary); box-shadow: var(--shadow-glow); }
.input-icon { font-size: 1.2rem; margin-right: 8px; flex-shrink: 0; }

.custom-input-group input {
  flex: 1; border: none; outline: none;
  font-family: var(--font); font-size: 1rem; font-weight: 600;
  color: var(--text-dark); background: transparent;
  padding: 10px 8px; min-width: 0;
}
.custom-input-group input::placeholder { color: var(--text-light); font-weight: 400; }

.btn-generate {
  flex-shrink: 0; background: var(--gradient-1); color: white; border: none;
  padding: 10px 20px; border-radius: var(--radius-lg);
  font-family: var(--font); font-size: 0.9rem; font-weight: 700;
  cursor: pointer; transition: var(--transition); white-space: nowrap;
}
.btn-generate:hover { transform: scale(1.03); box-shadow: var(--shadow-glow); }

.topic-suggestions {
  display: flex; flex-wrap: wrap; gap: 6px;
  justify-content: center; margin-bottom: 16px;
}
.suggestion-group { display: contents; }
.suggestion-group-label {
  width: 100%; font-size: 0.7rem; font-weight: 800; color: var(--text-light);
  text-transform: uppercase; letter-spacing: 1px; margin-top: 8px; text-align: center;
}

.topic-pill {
  display: inline-flex; align-items: center; gap: 3px;
  padding: 6px 14px; border: 1.5px solid #E8E8E8;
  border-radius: var(--radius-full); background: var(--card-bg);
  font-family: var(--font); font-size: 0.82rem; font-weight: 600;
  color: var(--text-dark); cursor: pointer; transition: var(--transition);
}
.topic-pill:hover { border-color: var(--primary-light); background: #F3F0FF; transform: translateY(-2px); }
.topic-pill.active { background: var(--primary); color: white; border-color: var(--primary); }

#custom-preview { margin-top: 16px; animation: slideUp 0.35s ease-out; }
@keyframes slideUp {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: translateY(0); }
}

.custom-preview-bar {
  display: flex; justify-content: space-between; align-items: center;
  margin-bottom: 12px; padding: 8px 16px;
  background: var(--card-bg); border-radius: var(--radius-md); box-shadow: var(--shadow-xs);
}
.custom-preview-title { font-weight: 800; font-size: 1rem; }
.custom-preview-actions { display: flex; gap: 8px; align-items: center; }

.btn-close-preview {
  background: none; border: 2px solid #E0E0E0;
  padding: 10px 16px; border-radius: 50px;
  font-size: 0.95rem; font-weight: 700; cursor: pointer; display: flex;
  align-items: center; justify-content: center; gap: 6px;
  transition: var(--transition); font-family: var(--font); color: var(--text-medium);
}
.btn-close-preview:hover { border-color: #FF6B6B; color: #FF6B6B; background: #FFF0F0; }
.custom-preview-content { display: flex; justify-content: center; }

.no-match-msg { text-align: center; padding: 20px; color: var(--text-medium); }
.no-match-msg .no-match-icon { font-size: 2.5rem; display: block; margin-bottom: 8px; }

/* ===== SECTION DIVIDER ===== */
.section-divider { text-align: center; margin: 8px 24px 4px; position: relative; }
.section-divider::before {
  content: ''; position: absolute; top: 50%; left: 0; right: 0; height: 2px;
  background: linear-gradient(90deg, transparent, #D0D0D0, transparent);
}
.divider-text {
  position: relative; background: var(--bg-body);
  padding: 0 20px; font-size: 1rem; font-weight: 800; color: var(--text-medium);
}

/* ===== WEEK TABS ===== */
.week-tabs {
  display: flex; gap: 10px; padding: 16px 24px 8px;
  justify-content: center; flex-wrap: wrap;
}

.week-tab {
  display: flex; flex-direction: column; align-items: center; gap: 2px;
  padding: 14px 22px; border: 2px solid transparent;
  border-radius: var(--radius-lg); background: var(--card-bg);
  cursor: pointer; transition: var(--transition);
  box-shadow: var(--shadow-sm); min-width: 110px; font-family: var(--font);
  position: relative; overflow: hidden;
}
.week-tab::after {
  content: ''; position: absolute; bottom: 0; left: 0; right: 0; height: 3px;
  background: var(--gradient-1); transform: scaleX(0); transition: transform 0.3s;
}
.week-tab:hover { transform: translateY(-3px); box-shadow: var(--shadow-md); }
.week-tab:hover::after { transform: scaleX(1); }

.week-tab.active {
  background: var(--gradient-1); color: white;
  box-shadow: var(--shadow-glow); transform: translateY(-2px);
}
.week-tab.active::after { display: none; }

.tab-emoji { font-size: 1.6rem; line-height: 1; }
.tab-label { font-size: 0.78rem; font-weight: 800; text-transform: uppercase; letter-spacing: 0.5px; }
.tab-theme { font-size: 0.72rem; opacity: 0.8; font-weight: 600; }

/* ===== DAYS GRID ===== */
.days-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(145px, 1fr));
  gap: 16px; padding: 16px 24px; max-width: 1000px; margin: 0 auto;
}

.day-card {
  background: var(--card-bg); border-radius: var(--radius-md);
  padding: 20px 14px 16px; text-align: center;
  cursor: pointer; transition: var(--transition);
  box-shadow: var(--shadow-sm); position: relative;
  overflow: hidden; border: 2px solid transparent;
}
.day-card::before {
  content: ''; position: absolute; top: 0; left: 0; right: 0; height: 4px;
  background: var(--gradient-1); opacity: 0; transition: opacity 0.3s;
}
.day-card:hover {
  transform: translateY(-5px) scale(1.02);
  box-shadow: var(--shadow-lg); border-color: var(--primary-light);
}
.day-card:hover::before { opacity: 1; }

.day-card-emoji { font-size: 2.8rem; margin-bottom: 8px; display: block; }
.day-card:hover .day-card-emoji { animation: wiggle 0.5s ease-in-out; }
@keyframes wiggle {
  0%, 100% { transform: scale(1.15) rotate(-5deg); }
  25% { transform: scale(1.15) rotate(5deg); }
  75% { transform: scale(1.15) rotate(3deg); }
}

.day-card-day { font-size: 0.72rem; color: var(--primary); font-weight: 800; text-transform: uppercase; letter-spacing: 1px; }
.day-card-title { font-size: 1.02rem; font-weight: 700; margin-top: 4px; }
.day-card-subtitle { font-size: 0.78rem; color: var(--text-light); font-style: italic; margin-top: 2px; }
.day-card-subjects { display: flex; gap: 4px; justify-content: center; margin-top: 10px; }

.subject-tag {
  font-size: 0.58rem; padding: 2px 6px; border-radius: var(--radius-full);
  font-weight: 700; text-transform: uppercase; letter-spacing: 0.3px;
}
.subject-tag.math { background: #FFF3E0; color: #E65100; }
.subject-tag.eng { background: #E3F2FD; color: #1565C0; }
.subject-tag.viet { background: #FCE4EC; color: #C62828; }

/* ===== WEEK ACTIONS ===== */
.week-actions {
  text-align: center; padding: 8px 24px 16px;
  display: flex; gap: 12px; justify-content: center; flex-wrap: wrap;
}

.btn-action {
  border: none; padding: 14px 28px; border-radius: var(--radius-xl);
  font-size: 0.95rem; font-weight: 700; cursor: pointer;
  font-family: var(--font); transition: var(--transition);
  display: inline-flex; align-items: center; gap: 6px;
}
.btn-print-week { background: var(--gradient-3); color: white; box-shadow: 0 4px 16px rgba(79,172,254,0.4); }
.btn-print-week:hover { transform: translateY(-2px); box-shadow: 0 6px 24px rgba(79,172,254,0.5); }
.btn-print-all { background: var(--card-bg); color: var(--text-dark); border: 2px solid #E0E0E0 !important; }
.btn-print-all:hover { border-color: var(--primary) !important; color: var(--primary); transform: translateY(-2px); }
.btn-print-custom { background: var(--gradient-4); color: #1a5c3a; box-shadow: 0 4px 16px rgba(67,233,123,0.3); }
.btn-print-custom:hover { transform: translateY(-2px); }

/* ===== FOOTER ===== */
.app-footer { text-align: center; padding: 16px 24px 28px; font-size: 0.85rem; color: var(--text-medium); }
.app-footer p { background: rgba(255,255,255,0.7); display: inline-block; padding: 10px 20px; border-radius: var(--radius-md); }
.footer-compat { margin-top: 6px; font-size: 0.75rem !important; color: var(--text-light) !important; background: none !important; padding: 0 !important; }

/* ===== PREVIEW SCREEN ===== */
.preview-toolbar {
  position: sticky; top: 0; z-index: 100;
  background: rgba(255,255,255,0.92); backdrop-filter: blur(12px);
  display: flex; align-items: center; justify-content: space-between;
  padding: 10px 20px; box-shadow: var(--shadow-sm);
}
.btn-toolbar {
  background: var(--card-bg); border: 2px solid #E8E8E8;
  padding: 8px 16px; border-radius: var(--radius-sm);
  cursor: pointer; font-family: var(--font); font-weight: 700; font-size: 0.85rem;
  transition: var(--transition); color: var(--text-dark);
}
.btn-toolbar:hover { border-color: var(--primary); color: var(--primary); }
.btn-toolbar:disabled { opacity: 0.35; cursor: not-allowed; }
.btn-toolbar.btn-print-single { background: var(--primary); color: white; border-color: var(--primary); }
.btn-toolbar.btn-print-single:hover { background: var(--primary-dark); }
.btn-nav { width: 40px; padding: 8px; text-align: center; }
.toolbar-center { flex: 1; text-align: center; }
.toolbar-title { font-weight: 800; font-size: 1rem; }
.toolbar-actions { display: flex; gap: 6px; align-items: center; }
.preview-content { padding: 28px 24px; display: flex; justify-content: center; background: var(--bg-body); min-height: calc(100vh - 60px); }

/* ==========================================================
   WORKSHEET - Maximized for A4 print
   ========================================================== */
.worksheet {
  background: white; width: 210mm; min-height: 297mm;
  padding: 6mm 8mm; /* tighter padding */
  box-shadow: var(--shadow-xl); border-radius: 3px;
  font-size: 11pt; line-height: 1.4;
  position: relative; color: #1a1a1a;
  display: flex; flex-direction: column;
}

/* --- Compact Header (2 lines max) --- */
.ws-header {
  border-bottom: 2.5px solid #222;
  padding-bottom: 3px; margin-bottom: 4px;
}
.ws-header-row {
  display: flex; justify-content: space-between; align-items: center;
  flex-wrap: wrap; gap: 4px;
}
.ws-day-badge {
  background: #222; color: white; padding: 2px 10px;
  border-radius: 8px; font-size: 9pt; font-weight: 800;
}
.ws-week-badge { font-size: 9pt; color: #444; font-weight: 700; }
.ws-name-field { font-size: 9.5pt; color: #555; }
.ws-name-line {
  display: inline-block; border-bottom: 1.5px solid #555;
  min-width: 120px; margin-left: 3px;
}
.ws-title {
  font-size: 18pt; font-weight: 900; text-align: center;
  margin: 2px 0 0; letter-spacing: -0.3px;
}

/* --- LARGE Drawing Area --- */
.ws-drawing {
  text-align: center;
  flex: 1; /* take all available space */
  display: flex; align-items: center; justify-content: center;
  padding: 4px 0;
  min-height: 500px;
}
.ws-drawing svg, .ws-drawing img {
  max-width: 96%;
  max-height: 650px; /* Maximize size for A4 */
  width: auto; height: auto;
  object-fit: contain;
}

/* --- 2-Column Exercise Grid --- */
.ws-exercises {
  display: grid;
  grid-template-columns: 1fr 1fr; /* 2 columns, not 3 */
  gap: 0;
  border-top: 2.5px solid #444;
  border-bottom: 2.5px solid #444;
  margin: 3px 0;
}
.ws-exercise {
  padding: 6px 8px;
}
.ws-exercise:first-child {
  border-right: 1.5px solid #ccc;
}
.ws-exercise h3 {
  font-size: 11pt; font-weight: 800;
  margin-bottom: 4px; padding-bottom: 3px;
  border-bottom: 1px dashed #bbb;
}

/* --- Exercise Elements (bigger for kids) --- */
.exercise-instruction {
  font-size: 10pt; margin-bottom: 4px; font-weight: 700; line-height: 1.3;
}

.count-objects {
  display: flex; gap: 6px; flex-wrap: wrap;
  margin: 5px 0; font-size: 22pt; line-height: 1;
}
.count-options {
  display: flex; gap: 14px; margin: 5px 0; flex-wrap: wrap;
}
.count-option {
  font-size: 14pt; font-weight: 700;
  display: flex; align-items: center; gap: 4px;
}
.option-circle {
  display: inline-block; width: 22px; height: 22px;
  border: 2.5px solid #333; border-radius: 50%;
}

.match-container { margin: 4px 0; }
.match-row {
  display: flex; justify-content: space-between; align-items: center;
  margin: 5px 0; font-size: 18pt;
}
.match-left { font-weight: 700; }
.match-dots { flex: 1; border-bottom: 2px dotted #aaa; margin: 0 10px; height: 1px; }
.match-right { font-size: 18pt; }

.pattern-row {
  display: flex; gap: 8px; align-items: center;
  margin: 5px 0; font-size: 20pt; flex-wrap: wrap;
}
.pattern-blank {
  width: 36px; height: 36px;
  border: 3px dashed #999; border-radius: 6px;
  display: inline-block;
}

.compare-groups {
  display: flex; justify-content: space-around; align-items: flex-end;
  margin: 5px 0;
}
.compare-group { text-align: center; }
.compare-group-big { font-size: 36pt; }
.compare-group-small { font-size: 20pt; }
.compare-label { font-size: 9pt; color: #888; font-weight: 700; margin-top: 2px; }

.math-equation { font-size: 20pt; font-weight: 800; text-align: center; margin: 8px 0; }
.math-blank { display: inline-block; width: 44px; border-bottom: 3px solid #333; }

/* Trace numbers (only numbers, not letters) */
.trace-word {
  display: flex; gap: 6px; justify-content: center;
  margin: 5px 0; flex-wrap: wrap;
}
.trace-char {
  font-size: 30pt; font-weight: 900; color: #d0d0d0;
  width: 44px; height: 48px; text-align: center; line-height: 48px;
  border: 2.5px dashed #ccc; border-radius: 8px;
  display: inline-flex; align-items: center; justify-content: center;
}
.trace-blank {
  width: 44px; height: 48px;
  border: 2.5px dashed #bbb; border-radius: 8px;
}

.write-lines { margin: 5px 0; }
.write-line { border-bottom: 1.5px dashed #aaa; height: 30px; margin: 3px 0; }

/* Find-circle exercise */
.find-grid {
  display: flex; gap: 10px; flex-wrap: wrap;
  margin: 5px 0; font-size: 22pt; justify-content: center;
}
.find-item {
  width: 46px; height: 46px; display: flex;
  align-items: center; justify-content: center;
  border: 2.5px solid #ddd; border-radius: 50%;
}

.mini-svg {
  display: inline-flex; align-items: center; justify-content: center;
  width: 1.6em; height: 1.6em; vertical-align: middle;
}
.mini-svg svg { width: 100%; height: 100%; }
.silhouette svg path,
.silhouette svg circle,
.silhouette svg ellipse,
.silhouette svg rect,
.silhouette svg polygon,
.silhouette svg polyline,
.silhouette svg line {
  fill: #222 !important;
  stroke: #222 !important;
}

.read-sentence {
  font-size: 12pt; font-weight: 600; text-align: center;
  margin: 6px 0; padding: 6px;
  border: 1.5px dashed #ccc; border-radius: 6px; line-height: 1.5;
}

/* --- Parent Tip + Vocabulary --- */
.ws-parent-section {
  display: flex; gap: 0;
  font-size: 8.5pt; color: #444;
  margin-top: 3px;
  border: 1px solid #ccc; border-radius: 5px;
  overflow: hidden;
}
.ws-vocab {
  flex: 1; padding: 4px 8px;
  background: #f0f0f0; border-right: 1px solid #ccc;
  line-height: 1.4;
}
.ws-tip {
  flex: 1; padding: 4px 8px;
  background: #fafafa;
  line-height: 1.4;
}
.ws-parent-section strong { font-weight: 800; }

.ws-footer {
  text-align: center; font-size: 7pt; color: #bbb;
  margin-top: 3px; padding-top: 2px; border-top: 1px solid #eee;
}

/* ===== UTILITIES ===== */
.hidden { display: none !important; }

/* ===== RESPONSIVE ===== */
@media (max-width: 768px) {
  .app-header { padding: 20px 16px 18px; }
  .app-header h1 { font-size: 1.5rem; }
  .custom-section { padding: 16px 14px 12px; }
  .custom-input-group { flex-wrap: wrap; border-radius: var(--radius-md); padding: 4px; }
  .custom-input-group input { width: 100%; }
  .btn-generate { width: 100%; margin-top: 2px; border-radius: var(--radius-md); text-align: center; }
  .week-tabs { padding: 12px 12px 6px; gap: 6px; }
  .week-tab { min-width: 78px; padding: 10px 12px; }
  .days-grid { grid-template-columns: repeat(auto-fill, minmax(110px, 1fr)); gap: 10px; padding: 12px; }
  .preview-toolbar { flex-wrap: wrap; gap: 6px; padding: 8px 12px; }
  .toolbar-center { order: -1; flex-basis: 100%; text-align: center; }
  .preview-content { padding: 12px 8px; }
  .worksheet { width: 100%; min-height: auto; padding: 14px; box-shadow: var(--shadow-md); }
  .ws-drawing { min-height: 280px; }
  .ws-drawing svg { max-height: 300px; }
  .ws-exercises { grid-template-columns: 1fr; }
  .ws-exercise:first-child { border-right: none; border-bottom: 1px dashed #ccc; }
  .week-actions { flex-direction: column; align-items: center; gap: 8px; }
  .btn-action { width: 100%; max-width: 280px; justify-content: center; }
  .custom-preview-bar { flex-direction: column; gap: 8px; text-align: center; }
  .ws-parent-section { flex-direction: column; }
  .ws-vocab { border-right: none; border-bottom: 1px solid #ccc; }
}

.custom-section-card {
    max-width: 600px;
    margin: 40px auto;
    padding: 40px 20px;
    background: white;
    border-radius: 20px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.1);
}

.btn-group-vertical {
    display: flex;
    flex-direction: column;
    gap: 20px;
    margin-top: 30px;
}

.btn-boy {
    background: linear-gradient(135deg, #4facfe, #00f2fe);
    font-size: 16pt;
    padding: 20px;
    border-radius: 15px;
    box-shadow: 0 8px 15px rgba(0, 242, 254, 0.3);
}

.btn-girl {
    background: linear-gradient(135deg, #ff9a9e, #fecfef);
    color: #c2185b;
    font-size: 16pt;
    padding: 20px;
    border-radius: 15px;
    border: 2px solid #f8bbd0;
    box-shadow: 0 8px 15px rgba(255, 154, 158, 0.4);
}

.btn-reset {
    background: #fff0f0;
    color: #d32f2f;
    font-size: 13pt;
    padding: 15px;
    border-radius: 15px;
    border: 2px dashed #ffcdd2;
    box-shadow: none;
    transition: all 0.3s ease;
}

.btn-reset:hover {
    background: #ffebee;
    border-color: #ef5350;
    transform: translateY(-2px);
}

.custom-preview-container {
    max-width: 800px;
    margin: 0 auto;
}

.btn-random-container {
    text-align: center;
    margin-top: 20px;
    padding-bottom: 20px;
}

.btn-random {
    background: linear-gradient(135deg, #fbc2eb, #a6c1ee);
    font-size: 14pt;
    padding: 15px 30px;
    border-radius: 12px;
    box-shadow: 0 5px 15px rgba(166, 193, 238, 0.4);
    color: #333;
}

.icon-use {
    width: 2.6rem;
    height: 2.6rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin: 0 4px;
}
.icon-use svg {
    width: 100%;
    height: 100%;
    fill: none;
    stroke: #111;
}
.icon-use.silhouette svg {
    fill: #111;
}

/* ============================================
   BOTTOM NAVIGATION BAR (iOS Tab Bar style)
   ============================================ */
.bottom-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: 72px;
    background: rgba(255, 255, 255, 0.96);
    backdrop-filter: blur(24px);
    -webkit-backdrop-filter: blur(24px);
    display: flex;
    justify-content: space-around;
    align-items: center;
    box-shadow: 0 -2px 24px rgba(0, 0, 0, 0.08);
    z-index: 9000;
    padding-bottom: env(safe-area-inset-bottom, 0px);
    border-top: 1px solid rgba(0, 0, 0, 0.06);
}

.bnav-tab {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 3px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 6px 20px;
    border-radius: 14px;
    transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
    font-family: var(--font);
    -webkit-tap-highlight-color: transparent;
    position: relative;
}

.bnav-tab:active {
    transform: scale(0.9);
}

.bnav-icon {
    font-size: 1.7rem;
    line-height: 1;
    transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.bnav-label {
    font-size: 0.68rem;
    font-weight: 700;
    color: #aaa;
    transition: color 0.3s ease;
    letter-spacing: 0.3px;
}

.bnav-tab.active {
    background: linear-gradient(135deg, rgba(108, 92, 231, 0.12), rgba(253, 121, 168, 0.1));
}

.bnav-tab.active .bnav-icon {
    transform: scale(1.15);
}

.bnav-tab.active .bnav-label {
    color: var(--primary);
    font-weight: 800;
}

/* Bounce animation on tab switch */
@keyframes tabBounce {
    0% { transform: scale(1); }
    40% { transform: scale(1.25); }
    100% { transform: scale(1.15); }
}

.bnav-tab.active .bnav-icon {
    animation: tabBounce 0.4s ease-out;
}

/* ============================================
   SCREEN SWITCHING
   ============================================ */
.app-screen {
    display: none;
    padding-bottom: 85px; /* space for bottom nav */
    min-height: 100vh;
}

.app-screen.active-screen {
    display: block;
    animation: screenFadeIn 0.3s ease-out;
}

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

.hidden-screen {
    display: none !important;
}

/* ============================================
   CONFETTI CANVAS OVERLAY
   ============================================ */
.confetti-canvas {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 10000;
}
