/* ═══════════════════════════════════════════════════
   SUMAIYA'S LEARNING WORLD — KID-FRIENDLY STYLES
   Pastel colors · Soft shadows · Playful UI
═══════════════════════════════════════════════════ */

/* ─── VARIABLES ──────────────────────────────────── */
:root {
  --pink:        #FF8FAB;
  --pink-light:  #FFDDE8;
  --pink-soft:   #FFF0F5;
  --blue:        #72B6F7;
  --blue-light:  #DBF0FF;
  --blue-soft:   #F0F8FF;
  --yellow:      #FFD166;
  --yellow-light:#FFF4CC;
  --yellow-soft: #FFFBF0;
  --purple:      #C39BF5;
  --purple-light:#EEE0FF;
  --purple-soft: #F9F4FF;
  --green:       #6DD99A;
  --green-light: #D4F5E4;
  --mint:        #7FE0CE;
  --coral:       #FF9A7B;
  --white:       #FFFFFF;
  --card-bg:     #FFFFFF;
  --page-bg:     #FEF8FF;
  --text-dark:   #3D2B5E;
  --text-mid:    #6B5A82;
  --text-light:  #9C88B0;
  --shadow-soft: 0 8px 32px rgba(120, 80, 180, 0.10);
  --shadow-card: 0 4px 24px rgba(120, 80, 180, 0.12);
  --shadow-hover: 0 12px 40px rgba(120, 80, 180, 0.20);
  --radius:      24px;
  --radius-sm:   14px;
  --font-main:   'Baloo 2', 'Nunito', sans-serif;
  --font-body:   'Nunito', sans-serif;
}

/* ─── RESET & BASE ───────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; }

body {
  font-family: var(--font-body);
  background: var(--page-bg);
  color: var(--text-dark);
  min-height: 100vh;
  overflow-x: hidden;
  line-height: 1.6;
}

/* ─── LOGIN SCREEN STYLES ────────────────────────── */
#login-screen {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  min-height: 100vh;
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 20px;
}

#login-screen .card {
  background: white;
  border-radius: 20px;
  padding: 40px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
  text-align: center;
  max-width: 400px;
  width: 100%;
}

#login-screen h1 {
  color: #333;
  margin-bottom: 10px;
  font-size: 1.8rem;
  font-family: var(--font-main);
}

#login-screen .subtitle {
  color: #666;
  margin-bottom: 30px;
  font-size: 1rem;
}

#login-screen .input-group {
  margin-bottom: 20px;
  text-align: left;
}

#login-screen .input-group label {
  display: block;
  color: #555;
  margin-bottom: 8px;
  font-weight: 600;
}

#login-screen .input-group input {
  width: 100%;
  padding: 15px;
  border: 2px solid #e0e0e0;
  border-radius: 10px;
  font-size: 1rem;
  transition: border-color 0.3s;
  font-family: var(--font-body);
}

#login-screen .input-group input:focus {
  outline: none;
  border-color: #667eea;
}

#login-screen .btn-primary {
  width: 100%;
  padding: 15px;
  border: none;
  border-radius: 10px;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: transform 0.2s, box-shadow 0.2s;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
}

#login-screen .btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 5px 20px rgba(0, 0, 0, 0.2);
}

/* ─── BACKGROUND BUBBLES ─────────────────────────── */
.bg-bubbles {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  overflow: hidden;
}

.bg-bubbles span {
  position: absolute;
  border-radius: 50%;
  opacity: 0.18;
  animation: floatBubble linear infinite;
}
.bg-bubbles span:nth-child(1)  { width:120px; height:120px; background:var(--pink);   left:5%;   bottom:-150px; animation-duration:18s; animation-delay:0s; }
.bg-bubbles span:nth-child(2)  { width:80px;  height:80px;  background:var(--blue);   left:20%;  bottom:-100px; animation-duration:14s; animation-delay:3s; }
.bg-bubbles span:nth-child(3)  { width:200px; height:200px; background:var(--purple); left:55%;  bottom:-250px; animation-duration:22s; animation-delay:1s; }
.bg-bubbles span:nth-child(4)  { width:60px;  height:60px;  background:var(--yellow); left:75%;  bottom:-80px;  animation-duration:12s; animation-delay:5s; }
.bg-bubbles span:nth-child(5)  { width:140px; height:140px; background:var(--mint);   left:88%;  bottom:-170px; animation-duration:20s; animation-delay:2s; }
.bg-bubbles span:nth-child(6)  { width:90px;  height:90px;  background:var(--coral);  left:40%;  bottom:-120px; animation-duration:16s; animation-delay:7s; }
.bg-bubbles span:nth-child(7)  { width:50px;  height:50px;  background:var(--green);  left:62%;  bottom:-70px;  animation-duration:11s; animation-delay:4s; }
.bg-bubbles span:nth-child(8)  { width:170px; height:170px; background:var(--pink);   left:10%;  bottom:-200px; animation-duration:25s; animation-delay:9s; }

@keyframes floatBubble {
  0%   { transform: translateY(0) scale(1);    opacity: .18; }
  50%  { transform: translateY(-60vh) scale(1.1); opacity: .22; }
  100% { transform: translateY(-110vh) scale(1); opacity: 0; }
}

/* ─── SCREEN MANAGEMENT ──────────────────────────── */
.screen {
  width: 100%;
  min-height: 100vh;
}

#home-screen, #write-screen, #view-screen {
  position: relative;
  z-index: 1;
}

.hidden {
  display: none !important;
}

/* ─── PAGE WRAPPER ───────────────────────────────── */
.page-wrapper {
  position: relative;
  z-index: 1;
  max-width: 960px;
  margin: 0 auto;
  padding: 28px 20px 60px;
  display: flex;
  flex-direction: column;
  gap: 28px;
}

/* ─── REVEAL ANIMATION ───────────────────────────── */
.reveal {
  opacity: 0;
  transform: translateY(28px);
  animation: revealUp .65s cubic-bezier(.22,.68,0,1.2) forwards;
  animation-delay: var(--delay, 0s);
}

@keyframes revealUp {
  to { opacity: 1; transform: translateY(0); }
}

/* ─── SECTION TITLE ──────────────────────────────── */
.section-title {
  font-family: var(--font-main);
  font-size: 1.45rem;
  font-weight: 800;
  color: var(--text-dark);
  margin-bottom: 14px;
  letter-spacing: -.3px;
}

/* ═══════════════════════════════════════════════════
   1. HEADER
═══════════════════════════════════════════════════ */
.header-card {
  background: linear-gradient(135deg, #FFD6E8 0%, #C8E6FF 60%, #E8D5FF 100%);
  border-radius: var(--radius);
  padding: 28px 32px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  box-shadow: var(--shadow-soft), inset 0 1px 0 rgba(255,255,255,.7);
  position: relative;
  overflow: hidden;
}

.header-card::before {
  content: '';
  position: absolute;
  top: -40px; right: -40px;
  width: 180px; height: 180px;
  background: radial-gradient(circle, rgba(255,255,255,.45) 0%, transparent 70%);
  border-radius: 50%;
}

.header-left {
  display: flex;
  align-items: center;
  gap: 20px;
}

/* Avatar */
.avatar-wrap {
  position: relative;
  flex-shrink: 0;
}

.avatar {
  width: 84px;
  height: 84px;
  border-radius: 50%;
  background: linear-gradient(145deg, #fff0f8, #ffe4f5);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 3rem;
  box-shadow: 0 6px 20px rgba(200,100,160,.25), 0 0 0 4px #fff, 0 0 0 8px rgba(255,143,171,.3);
  animation: avatarPulse 3s ease-in-out infinite;
}

@keyframes avatarPulse {
  0%,100% { transform: scale(1); }
  50%      { transform: scale(1.04); }
}

.avatar-badge {
  position: absolute;
  bottom: 0; right: 0;
  background: var(--yellow);
  border: 3px solid #fff;
  border-radius: 50%;
  width: 26px; height: 26px;
  display: flex; align-items: center; justify-content: center;
  font-size: .9rem;
  box-shadow: 0 2px 8px rgba(0,0,0,.15);
  animation: badgeBounce 2s ease-in-out infinite;
}

@keyframes badgeBounce {
  0%,100% { transform: translateY(0); }
  50%      { transform: translateY(-4px); }
}

/* Header text */
.header-text { display: flex; flex-direction: column; gap: 2px; }

.greeting {
  font-family: var(--font-body);
  font-size: 1rem;
  font-weight: 700;
  color: var(--text-mid);
  letter-spacing: .3px;
}

.username {
  font-family: var(--font-main);
  font-size: 2.2rem;
  font-weight: 800;
  color: var(--text-dark);
  line-height: 1.1;
  letter-spacing: -1px;
}

.name-bloom {
  display: inline-block;
  animation: bloom 3s ease-in-out infinite;
}

@keyframes bloom {
  0%,100% { transform: rotate(-10deg) scale(1); }
  50%      { transform: rotate(10deg) scale(1.2); }
}

.tagline {
  font-size: .95rem;
  font-weight: 600;
  color: var(--text-mid);
}

/* Header right */
.header-right {
  display: flex;
  flex-direction: column;
  gap: 12px;
  align-items: flex-end;
}

.header-stat {
  background: rgba(255,255,255,.6);
  backdrop-filter: blur(8px);
  border-radius: 16px;
  padding: 8px 18px;
  display: flex;
  align-items: center;
  gap: 8px;
  box-shadow: 0 2px 12px rgba(0,0,0,.08);
  min-width: 110px;
}

.stat-icon { font-size: 1.3rem; }
.stat-value { font-family: var(--font-main); font-size: 1.5rem; font-weight: 800; color: var(--text-dark); line-height: 1; }
.stat-label { font-size: .75rem; font-weight: 700; color: var(--text-mid); }

.btn-logout-sm {
  background: linear-gradient(135deg, #fa709a 0%, #fee140 100%);
  color: white;
  border: none;
  border-radius: 20px;
  padding: 8px 16px;
  font-family: var(--font-main);
  font-size: 0.85rem;
  font-weight: 700;
  cursor: pointer;
  transition: transform 0.2s;
}

.btn-logout-sm:hover {
  transform: scale(1.05);
}

/* ═══════════════════════════════════════════════════
   2. EVENT CARD
═══════════════════════════════════════════════════ */
.event-card {
  background: linear-gradient(120deg, #FFF4CC, #FFE0F0 60%, #E8E0FF);
  border-radius: var(--radius);
  padding: 22px 28px;
  display: flex;
  align-items: center;
  gap: 20px;
  box-shadow: var(--shadow-card);
  position: relative;
  overflow: hidden;
  transition: transform .25s ease, box-shadow .25s ease;
  cursor: pointer;
}

.event-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-hover);
}

.event-ribbon {
  position: absolute;
  top: 0; right: 0;
  background: linear-gradient(135deg, var(--pink), #ff6b8a);
  color: #fff;
  font-family: var(--font-main);
  font-size: .75rem;
  font-weight: 800;
  padding: 4px 14px;
  border-radius: 0 var(--radius) 0 16px;
  letter-spacing: .5px;
}

.event-emoji-big {
  font-size: 3.2rem;
  animation: eventBounce 2s ease-in-out infinite;
  flex-shrink: 0;
}

@keyframes eventBounce {
  0%,100% { transform: translateY(0) rotate(-5deg); }
  50%      { transform: translateY(-8px) rotate(5deg); }
}

.event-info { flex: 1; }
.event-name {
  font-family: var(--font-main);
  font-size: 1.5rem;
  font-weight: 800;
  color: var(--text-dark);
  line-height: 1.2;
}
.event-sub {
  font-size: .95rem;
  font-weight: 600;
  color: var(--text-mid);
  margin-top: 2px;
}

.event-countdown {
  background: rgba(255,255,255,.7);
  border-radius: 18px;
  padding: 14px 20px;
  text-align: center;
  box-shadow: 0 2px 12px rgba(0,0,0,.08);
  flex-shrink: 0;
}
.countdown-number {
  font-family: var(--font-main);
  font-size: 2.8rem;
  font-weight: 900;
  color: var(--pink);
  line-height: 1;
}
.countdown-label { font-size: .75rem; font-weight: 700; color: var(--text-mid); }

/* ═══════════════════════════════════════════════════
   3. STREAK SECTION
═══════════════════════════════════════════════════ */
.streak-card {
  background: var(--card-bg);
  border-radius: var(--radius);
  padding: 28px;
  display: flex;
  align-items: center;
  gap: 0;
  box-shadow: var(--shadow-card);
  overflow: hidden;
}

.streak-flame-area {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
}

.flame-icon {
  font-size: 3.5rem;
  animation: flameDance .8s ease-in-out infinite alternate;
  filter: drop-shadow(0 4px 8px rgba(255, 140, 0, .4));
}

@keyframes flameDance {
  from { transform: scale(1) rotate(-3deg); }
  to   { transform: scale(1.12) rotate(3deg); }
}

.streak-count {
  font-family: var(--font-main);
  font-size: 3rem;
  font-weight: 900;
  color: #FF6B35;
  line-height: 1;
}
.streak-desc { font-size: .9rem; font-weight: 700; color: var(--text-mid); text-align: center; }

.streak-divider {
  width: 2px;
  height: 80px;
  background: linear-gradient(to bottom, transparent, #E8D5FF, transparent);
  margin: 0 24px;
  border-radius: 2px;
}

.stars-area {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
}
.stars-count {
  font-family: var(--font-main);
  font-size: 1.8rem;
  font-weight: 900;
  color: var(--text-dark);
}
.stars-desc { font-size: .85rem; font-weight: 700; color: var(--text-mid); }
.star-row { display: flex; gap: 4px; margin-top: 4px; }
.star { font-size: 1.2rem; }
.star.filled { animation: starTwinkle 2s ease-in-out infinite; }
.star.filled:nth-child(1) { animation-delay: 0s; }
.star.filled:nth-child(2) { animation-delay: .2s; }
.star.filled:nth-child(3) { animation-delay: .4s; }
.star.filled:nth-child(4) { animation-delay: .6s; }
.star.filled:nth-child(5) { animation-delay: .8s; }
.star.dim { opacity: .3; }
@keyframes starTwinkle {
  0%,100% { transform: scale(1); filter: brightness(1); }
  50%      { transform: scale(1.25); filter: brightness(1.3); }
}

.progress-area {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding-left: 24px;
  border-left: 2px solid #F0E8FF;
}
.progress-label { font-size: .85rem; font-weight: 700; color: var(--text-mid); }
.progress-track {
  background: var(--purple-light);
  border-radius: 30px;
  height: 14px;
  overflow: hidden;
}
.progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--purple), #ff8fab);
  border-radius: 30px;
  position: relative;
  animation: growBar 1s cubic-bezier(.22,.68,0,1.2) forwards;
  animation-delay: .5s;
  transform-origin: left;
  transform: scaleX(0);
}
@keyframes growBar {
  to { transform: scaleX(1); }
}
.progress-fill::after {
  content: '';
  position: absolute;
  right: 0; top: 0; bottom: 0;
  width: 14px;
  background: rgba(255,255,255,.5);
  border-radius: 50%;
  animation: progressGlow 1.5s ease-in-out infinite;
}
@keyframes progressGlow {
  0%,100% { opacity: .5; }
  50%      { opacity: 1; }
}
.progress-emoji-row {
  display: flex;
  justify-content: space-between;
  font-size: 1.1rem;
}

/* ═══════════════════════════════════════════════════
   4. LEARNING SECTION
═══════════════════════════════════════════════════ */
.learning-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
}

.learn-card {
  border-radius: var(--radius);
  padding: 20px;
  box-shadow: var(--shadow-card);
  display: flex;
  flex-direction: column;
  gap: 10px;
  transition: transform .25s ease, box-shadow .25s ease;
  position: relative;
  overflow: hidden;
}

.learn-card:hover {
  transform: translateY(-5px) scale(1.01);
  box-shadow: var(--shadow-hover);
}

.word-card {
  background: linear-gradient(145deg, var(--yellow-soft), var(--yellow-light));
  border: 2px solid rgba(255,209,102,.4);
}
.sentence-card {
  background: linear-gradient(145deg, var(--blue-soft), var(--blue-light));
  border: 2px solid rgba(114,182,247,.4);
}
.fact-card {
  background: linear-gradient(145deg, var(--green-light), #E8FFF3);
  border: 2px solid rgba(109,217,154,.4);
}
.ayah-card {
  background: linear-gradient(145deg, var(--purple-soft), var(--purple-light));
  border: 2px solid rgba(195,155,245,.4);
}

.learn-card-header {
  display: flex;
  align-items: center;
  gap: 8px;
}
.learn-icon { font-size: 1.2rem; }
.learn-tag {
  font-family: var(--font-main);
  font-size: .75rem;
  font-weight: 800;
  color: var(--text-mid);
  text-transform: uppercase;
  letter-spacing: .8px;
}
.learn-word {
  font-family: var(--font-main);
  font-size: 2rem;
  font-weight: 900;
  color: var(--text-dark);
  letter-spacing: -1px;
}
.learn-body {
  font-size: .95rem;
  font-weight: 600;
  color: var(--text-mid);
  line-height: 1.6;
}
.learn-sentence { font-style: italic; font-size: 1rem; color: var(--text-dark); }
.ayah-text {
  font-size: 1rem;
  font-style: italic;
  color: var(--text-dark);
  font-weight: 700;
}

/* ═══════════════════════════════════════════════════
   5. JOURNAL / NOTES SECTION
═══════════════════════════════════════════════════ */
.journal-card {
  background: var(--card-bg);
  border-radius: var(--radius);
  padding: 24px;
  box-shadow: var(--shadow-card);
  border: 2px solid rgba(195,155,245,.2);
  display: flex;
  flex-direction: column;
  gap: 14px;
}

#write-screen .journal-card {
  max-width: 700px;
  margin: 0 auto;
}

#write-screen h1 {
  font-family: var(--font-main);
  color: var(--text-dark);
  margin-bottom: 10px;
}

.journal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.journal-date {
  font-family: var(--font-main);
  font-size: 1rem;
  font-weight: 800;
  color: var(--text-dark);
}
.journal-mood {
  font-size: .9rem;
  font-weight: 700;
  color: var(--text-mid);
}

.mood-picker {
  display: flex;
  gap: 8px;
}
.mood-btn {
  background: var(--purple-light);
  border: 2px solid transparent;
  border-radius: 12px;
  width: 44px; height: 44px;
  font-size: 1.3rem;
  cursor: pointer;
  transition: transform .2s, border-color .2s, background .2s;
  display: flex; align-items: center; justify-content: center;
}
.mood-btn:hover, .mood-btn.active {
  border-color: var(--purple);
  background: var(--purple-soft);
  transform: scale(1.15);
}

/* REQUIRED TEXTAREA - id="note" */
textarea#note, textarea#note-write {
  width: 100%;
  min-height: 140px;
  border: 2px dashed rgba(195,155,245,.5);
  border-radius: var(--radius-sm);
  padding: 16px;
  font-family: var(--font-body);
  font-size: 1rem;
  font-weight: 600;
  color: var(--text-dark);
  background: var(--purple-soft);
  resize: vertical;
  outline: none;
  transition: border-color .2s, box-shadow .2s;
  line-height: 1.7;
}

textarea#note::placeholder, textarea#note-write::placeholder {
  color: var(--text-light);
}

textarea#note:focus, textarea#note-write:focus {
  border-color: var(--purple);
  box-shadow: 0 0 0 4px rgba(195,155,245,.2);
}

.journal-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.journal-hint { font-size: .85rem; font-weight: 700; color: var(--text-light); }

.save-btn {
  background: linear-gradient(135deg, var(--purple), #b07ae8);
  color: #fff;
  border: none;
  border-radius: 50px;
  padding: 11px 28px;
  font-family: var(--font-main);
  font-size: 1rem;
  font-weight: 800;
  cursor: pointer;
  box-shadow: 0 4px 16px rgba(195,155,245,.5);
  transition: transform .2s, box-shadow .2s;
  letter-spacing: .3px;
}
.save-btn:hover {
  transform: translateY(-2px) scale(1.04);
  box-shadow: 0 8px 24px rgba(195,155,245,.6);
}
.save-btn:active { transform: scale(.97); }

.message {
  margin-top: 10px;
  font-size: 0.95rem;
  text-align: center;
  font-weight: 600;
}

.message.success {
  color: #27ae60;
}

.message.error {
  color: #e74c3c;
}

/* ═══════════════════════════════════════════════════
   6. GAMES SECTION
═══════════════════════════════════════════════════ */
.games-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
}

.game-card {
  border-radius: var(--radius);
  padding: 24px 20px 20px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  box-shadow: var(--shadow-card);
  cursor: pointer;
  transition: transform .25s ease, box-shadow .25s ease;
  position: relative;
  overflow: hidden;
  text-align: center;
}

.game-card:hover {
  transform: translateY(-6px) scale(1.02);
  box-shadow: var(--shadow-hover);
}

.game-math { background: linear-gradient(145deg, #FFF0D5, #FFE0A0); border: 2px solid rgba(255,209,102,.5); }
.game-word { background: linear-gradient(145deg, #D5F0FF, #A8DEFF); border: 2px solid rgba(114,182,247,.5); }
.game-quiz { background: linear-gradient(145deg, #F0D5FF, #DDB0FF); border: 2px solid rgba(195,155,245,.5); }

.game-bg-shape {
  position: absolute;
  top: -20px; right: -20px;
  width: 80px; height: 80px;
  border-radius: 50%;
  background: rgba(255,255,255,.3);
}

.game-icon {
  font-size: 3rem;
  animation: gameFloat 3s ease-in-out infinite;
  position: relative;
  z-index: 1;
}
.game-card:nth-child(2) .game-icon { animation-delay: .5s; }
.game-card:nth-child(3) .game-icon { animation-delay: 1s; }

@keyframes gameFloat {
  0%,100% { transform: translateY(0); }
  50%      { transform: translateY(-8px); }
}

.game-name {
  font-family: var(--font-main);
  font-size: 1.15rem;
  font-weight: 800;
  color: var(--text-dark);
  line-height: 1.2;
}
.game-desc {
  font-size: .85rem;
  font-weight: 600;
  color: var(--text-mid);
}

.game-meta {
  display: flex;
  gap: 8px;
  justify-content: center;
  margin-top: 4px;
}
.game-level, .game-coins {
  background: rgba(255,255,255,.6);
  border-radius: 20px;
  padding: 3px 10px;
  font-size: .75rem;
  font-weight: 800;
  color: var(--text-mid);
}

.play-btn {
  margin-top: 8px;
  background: var(--text-dark);
  color: #fff;
  border: none;
  border-radius: 50px;
  padding: 9px 22px;
  font-family: var(--font-main);
  font-size: .9rem;
  font-weight: 800;
  cursor: pointer;
  transition: transform .2s, box-shadow .2s;
  letter-spacing: .3px;
  box-shadow: 0 4px 12px rgba(0,0,0,.2);
}
.play-btn:hover {
  transform: scale(1.06);
  box-shadow: 0 6px 20px rgba(0,0,0,.3);
}
.game-math .play-btn  { background: #E5830A; }
.game-word .play-btn  { background: #2E86D0; }
.game-quiz .play-btn  { background: #8B44D4; }

/* ─── FOOTER ─────────────────────────────────────── */
.site-footer {
  text-align: center;
  padding: 16px;
  font-size: .9rem;
  font-weight: 700;
  color: var(--text-light);
  letter-spacing: .2px;
}

/* ═══════════════════════════════════════════════════
   NOTES LIST (View Screen)
═══════════════════════════════════════════════════ */
.notes-list-container {
  background: var(--card-bg);
  border-radius: var(--radius);
  padding: 20px;
  box-shadow: var(--shadow-card);
  max-height: 500px;
  overflow-y: auto;
}

.note-item {
  background: linear-gradient(145deg, var(--pink-soft), var(--purple-soft));
  border-radius: var(--radius-sm);
  padding: 16px;
  margin-bottom: 12px;
  border-left: 4px solid var(--purple);
  transition: transform 0.2s;
}

.note-item:hover {
  transform: translateX(4px);
}

.note-content {
  color: var(--text-dark);
  line-height: 1.6;
  margin-bottom: 8px;
  white-space: pre-wrap;
  font-weight: 600;
}

.note-date {
  color: var(--text-light);
  font-size: 0.8rem;
  font-weight: 700;
}

.loading {
  color: var(--text-mid);
  text-align: center;
  padding: 30px;
  font-weight: 600;
}

.empty {
  color: var(--text-light);
  text-align: center;
  padding: 40px;
  font-weight: 600;
}

/* ─── UTILITY BUTTONS ────────────────────────────── */
.btn-secondary {
  background: #f0f0f0;
  color: #555;
  border: none;
  border-radius: 10px;
  padding: 12px 24px;
  font-family: var(--font-main);
  font-size: 1rem;
  font-weight: 700;
  cursor: pointer;
  transition: transform 0.2s, box-shadow 0.2s;
  width: 100%;
}

.btn-secondary:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0,0,0,.1);
}

.button-group {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

/* ─── ERROR MESSAGE ──────────────────────────────── */
.error {
  color: #e74c3c;
  margin-top: 10px;
  font-size: 0.9rem;
  font-weight: 600;
}

/* ═══════════════════════════════════════════════════
   RESPONSIVE — TABLET
═══════════════════════════════════════════════════ */
@media (max-width: 768px) {
  .page-wrapper { padding: 18px 14px 50px; gap: 20px; }

  /* Header */
  .header-card { flex-direction: column; align-items: flex-start; padding: 22px; }
  .header-right { flex-direction: row; align-self: stretch; justify-content: space-between; }
  .header-stat { flex: 1; justify-content: center; }
  .username { font-size: 1.8rem; }

  /* Streak */
  .streak-card { flex-direction: column; gap: 16px; }
  .streak-divider { width: 80%; height: 2px; margin: 0 auto; }
  .progress-area { border-left: none; border-top: 2px solid #F0E8FF; padding-left: 0; padding-top: 16px; width: 100%; }

  /* Learning */
  .learning-grid { grid-template-columns: 1fr; }

  /* Games */
  .games-grid { grid-template-columns: 1fr; }

  /* Event */
  .event-card { flex-wrap: wrap; }
}

/* ═══════════════════════════════════════════════════
   RESPONSIVE — MOBILE
═══════════════════════════════════════════════════ */
@media (max-width: 480px) {
  .header-left { flex-direction: column; align-items: flex-start; }
  .header-right { flex-direction: column; }
  .username { font-size: 1.6rem; }
  .mood-picker { flex-wrap: wrap; }
  .event-countdown { align-self: flex-start; }
  .section-title { font-size: 1.25rem; }
  .learn-word { font-size: 1.6rem; }
  
  #login-screen .card {
    padding: 25px;
  }
  
  #login-screen h1 {
    font-size: 1.5rem;
  }
}

/* ─── SCROLLBAR ──────────────────────────────────── */
::-webkit-scrollbar { width: 8px; }
::-webkit-scrollbar-track { background: var(--pink-soft); }
::-webkit-scrollbar-thumb { background: var(--pink); border-radius: 8px; }

/* ─── SELECTION ──────────────────────────────────── */
::selection { background: var(--pink-light); color: var(--text-dark); }
