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

:root {
  --primary: #FFE566;
  --blue: #7EC8E3;
  --green: #A8E6CF;
  --pink: #FFB3C6;
  --purple: #C3B1E1;
  --orange: #FFD1A0;
  --bg: #FFF9F0;
  --text: #3D3D3D;
  --radius: 20px;
  --shadow: 0 6px 20px rgba(0,0,0,0.10);
  --shadow-hover: 0 10px 30px rgba(0,0,0,0.15);
}

body {
  font-family: 'Nunito', sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  overflow-x: hidden;
}

/* ===== FLOATING STARS ===== */
.floating-stars { position: fixed; top:0; left:0; width:100%; height:100%; pointer-events:none; z-index:-1; overflow:hidden; }
.star { position:absolute; animation: floatStar linear infinite; opacity:0.5; font-size:20px; user-select:none; }
@keyframes floatStar {
  0%   { transform: translateY(110vh) rotate(0deg); opacity:0.6; }
  100% { transform: translateY(-10vh) rotate(360deg); opacity:0; }
}

/* ===== NAVBAR ===== */
.navbar {
  position: fixed; top:0; left:0; right:0; z-index:100;
  background: linear-gradient(135deg, #FFE566 0%, #FFD1A0 100%);
  display: flex; align-items:center; gap:8px;
  padding: 10px 20px;
  box-shadow: 0 4px 20px rgba(255,180,0,0.25);
  border-bottom: 3px solid rgba(255,255,255,0.6);
}

.nav-logo {
  display:flex; align-items:center; gap:8px; cursor:pointer;
  flex-shrink:0;
}
.logo-emoji { font-size:28px; animation: spinStar 4s linear infinite; display:inline-block; }
@keyframes spinStar { 0%{transform:rotate(0deg)} 100%{transform:rotate(360deg)} }
.logo-text { font-size:22px; font-weight:900; color:#3D3D3D; white-space:nowrap; }

.nav-links { display:flex; gap:6px; flex:1; justify-content:flex-end; }
.nav-btn {
  display:flex; flex-direction:column; align-items:center; gap:2px;
  background:rgba(255,255,255,0.6); border:2px solid rgba(255,255,255,0.8);
  border-radius:14px; padding:6px 10px; cursor:pointer;
  font-family:'Nunito',sans-serif; font-size:11px; font-weight:700; color:#3D3D3D;
  transition: all 0.2s; white-space:nowrap;
}
.nav-btn span:first-child { font-size:18px; }
.nav-btn:hover, .nav-btn.active {
  background: white; transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

.hamburger {
  display:flex; background:rgba(255,255,255,0.6); border:2px solid rgba(255,255,255,0.8);
  border-radius:14px; padding:6px 12px; font-size:26px;
  cursor:pointer; margin-left:auto; align-items:center; justify-content:center;
  transition: all 0.2s;
}
.hamburger:hover {
  background: white;
  box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

/* ===== MOBILE MENU ===== */
.mobile-menu {
  display:none; flex-direction:column; gap:6px;
  position:fixed; top:70px; left:0; right:0; z-index:99;
  background: #FFF9F0; padding:12px; border-bottom:3px solid #FFE566;
  box-shadow: 0 8px 20px rgba(0,0,0,0.1);
}
.mobile-menu.open { display:flex; }
.mobile-menu button {
  background: white; border:2px solid #FFE566; border-radius:12px;
  padding:10px 16px; font-family:'Nunito',sans-serif; font-size:15px;
  font-weight:700; text-align:left; cursor:pointer;
  transition: background 0.2s;
}
.mobile-menu button:hover { background:#FFE566; }

/* ===== PAGES ===== */
.page {
  display:none; 
  min-height:100vh; 
  padding: 90px 20px 10px;
  position:relative; 
  z-index:1;
  animation: fadeInUp 0.4s ease;
  width: 100%;
  overflow-x: hidden;
}

.page.active { display:block; }

/* Halaman menulis — lebih compact */
#page-menulis { padding-bottom: 20px; }
#page-menulis .page-header { margin-bottom: 12px; }
#page-menulis .sub-tabs    { margin-bottom: 14px; }

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

/* ===== HOME PAGE ===== */
.home-hero {
  text-align:center; padding:30px 20px 20px;
  display:flex; flex-direction:column; align-items:center; gap:12px;
}
.mascot-body {
  font-size:70px; animation: bounce 1.5s ease-in-out infinite;
  filter: drop-shadow(0 6px 12px rgba(255,200,0,0.4));
}
@keyframes bounce {
  0%,100% { transform:translateY(0) scale(1); }
  50%      { transform:translateY(-15px) scale(1.05); }
}
.mascot-speech {
  background:white; border-radius:20px; padding:8px 18px;
  font-size:14px; font-weight:700; color:#FF8C00;
  box-shadow:var(--shadow); position:relative;
  animation: popIn 0.5s ease 0.3s both;
}
.mascot-speech::before {
  content:''; position:absolute; top:-10px; left:50%; transform:translateX(-50%);
  border:5px solid transparent; border-bottom-color:white;
}
@keyframes popIn {
  from { opacity:0; transform:scale(0.5); }
  to   { opacity:1; transform:scale(1); }
}

.hero-title {
  font-size:clamp(28px,6vw,52px); font-weight:900; line-height:1.2;
  color:#3D3D3D;
}
.highlight {
  background: linear-gradient(135deg,#FF6B9D,#FFB300,#00C853);
  -webkit-background-clip:text; -webkit-text-fill-color:transparent;
  background-clip:text;
}
.hero-subtitle { font-size:18px; font-weight:600; color:#666; }

.home-cards {
  display:grid;
  grid-template-columns: repeat(auto-fill, minmax(220px,1fr));
  gap:20px; padding:20px 0;
  max-width:1100px; margin:0 auto;
}
.home-card {
  border-radius:24px; padding:28px 22px; cursor:pointer;
  transition: all 0.3s cubic-bezier(0.34,1.56,0.64,1);
  box-shadow:var(--shadow); position:relative; overflow:hidden;
  border:3px solid rgba(255,255,255,0.8);
}
.home-card::after {
  content:''; position:absolute; top:-40px; right:-40px;
  width:120px; height:120px; border-radius:50%;
  background:rgba(255,255,255,0.25);
}
.home-card:hover {
  transform: translateY(-8px) scale(1.03);
  box-shadow:var(--shadow-hover);
}
.card-blue  { background:linear-gradient(135deg,#7EC8E3,#B3E5F5); }
.card-green { background:linear-gradient(135deg,#A8E6CF,#C8F5E3); }
.card-yellow{ background:linear-gradient(135deg,#FFE566,#FFF3A0); }
.card-pink  { background:linear-gradient(135deg,#FFB3C6,#FFD5DF); }
.card-purple{ background:linear-gradient(135deg,#C3B1E1,#DDD0F5); }
.card-orange {
  background: linear-gradient(135deg, #FFB74D, #FFD54F);
}

.card-icon  { font-size:48px; margin-bottom:10px; }
.card-title { font-size:18px; font-weight:800; color:#3D3D3D; margin-bottom:6px; }
.card-desc  { font-size:13px; font-weight:600; color:rgba(61,61,61,0.7); }
.card-arrow { font-size:22px; margin-top:12px; font-weight:900; color:rgba(61,61,61,0.6); }

.home-footer { text-align:center; padding:20px; }
.stars-row   { font-size:28px; letter-spacing:4px; margin-bottom:6px; }
.home-footer p { font-size:16px; font-weight:700; color:#888; }

/* ===== PAGE HEADER ===== */
.page-header { text-align:center; margin-bottom:24px; }
.page-header h2 { font-size:clamp(24px,5vw,38px); font-weight:900; color:#3D3D3D; }
.page-header p  { font-size:15px; font-weight:600; color:#888; margin-top:4px; }

/* ===== SUB TABS ===== */
.sub-tabs {
  display:flex; gap:10px; justify-content:center; flex-wrap:wrap;
  margin-bottom:24px;
}
.sub-tab {
  padding:10px 22px; border-radius:50px; border:2px solid #ddd;
  background:white; font-family:'Nunito',sans-serif; font-size:14px;
  font-weight:700; cursor:pointer; transition:all 0.25s; color:#666;
}
.sub-tab.active, .sub-tab:hover {
  background:linear-gradient(135deg,#FFE566,#FFD1A0);
  border-color:#FFB300; color:#3D3D3D;
  box-shadow: 0 4px 12px rgba(255,179,0,0.35);
  transform:translateY(-2px);
}
.sub-content { 
  display:none; 
}

.sub-content.active { 
  display:block; 
  animation: fadeInUp 0.3s ease; 
}

.sub-hint { text-align:center; font-size:13px; font-weight:600; color:#888; margin-bottom:16px; }

/* ===== ALPHABET GRID ===== */
.alphabet-grid, .number-grid {
  display:grid;
  grid-template-columns: repeat(auto-fit, minmax(70px, 1fr));
  gap:10px;
  width:100%;
  max-width:860px;
  margin:0 auto;
  padding:0 12px;
  justify-content: center;
}

.alpha-card {
  background:white; border-radius:16px; padding:8px;
  text-align:center; cursor:pointer; transition:all 0.25s;
  box-shadow:var(--shadow); border:3px solid transparent;
  user-select:none; aspect-ratio:1/1;
  display:flex; flex-direction:column;
  align-items:center; justify-content:center; gap:4px;
}
.alpha-card:hover, .alpha-card:active {
  transform:scale(1.12); border-color:var(--primary);
  box-shadow:0 8px 24px rgba(0,0,0,0.15);
}
.alpha-card.playing { background:#FFE566; animation:pulse 0.4s ease; }
@keyframes pulse {
  0%,100%{transform:scale(1)} 50%{transform:scale(1.15)}
}
.alpha-letter       { font-size:32px; font-weight:900; color:#3D3D3D; line-height:1; }
.alpha-letter-small { font-size:20px; font-weight:700; color:#888;    line-height:1; }

/* ===== SPELL GRID ===== */
.spell-grid {
  display:grid; grid-template-columns:repeat(auto-fill,minmax(140px,1fr));
  gap:16px; max-width:900px; margin:0 auto;
}
.spell-card {
  background:white; 
  border-radius:18px; 
  padding:18px 14px;
  text-align:center; 
  cursor:pointer; 
  transition:all 0.25s;
  box-shadow:var(--shadow); 
  border:3px solid transparent;
  user-select:none;
}

.spell-card:hover { transform:translateY(-4px); border-color:var(--blue);
  box-shadow:0 8px 24px rgba(0,0,0,0.12); }
.spell-card.playing { 
  background:#E3F4FF; 
  animation:pulse 0.4s ease; 
}

.spell-emoji  { 
  font-size:40px; 
  margin-bottom:8px;
}

.spell-word   { 
  font-size:16px; 
  font-weight:800; 
  color:#3D3D3D; 
  margin-bottom:4px;
}

.spell-split  { font-size:12px; font-weight:600; color:#AAA; letter-spacing:2px; }

/* ===== ANIMAL GRID ===== */
.animal-grid {
  display:grid; grid-template-columns:repeat(auto-fill,minmax(150px,1fr));
  gap:16px; max-width:900px; margin:0 auto;
}
.animal-card {
  background:white; border-radius:20px; padding:20px 14px;
  text-align:center; cursor:pointer; transition:all 0.3s;
  box-shadow:var(--shadow); border:3px solid transparent; user-select:none;
}
.animal-card:hover { transform:translateY(-6px); border-color:var(--green);
  box-shadow:0 12px 30px rgba(0,0,0,0.12); }
.animal-emoji { font-size:52px; margin-bottom:10px; display:block; }
.animal-name  { font-size:15px; font-weight:800; color:#3D3D3D; }

/* ===== ANIMAL MODAL ===== */
.animal-modal {
  display:none; position:fixed; inset:0; z-index:200;
  background:rgba(0,0,0,0.45); backdrop-filter:blur(4px);
  align-items:center; justify-content:center; padding:20px;
}
.animal-modal.open { display:flex; animation:fadeIn 0.2s ease; }
@keyframes fadeIn { from{opacity:0}to{opacity:1} }

.modal-content {
  background:white; border-radius:28px; padding:32px 28px;
  max-width:380px; width:100%; text-align:center;
  box-shadow:0 20px 60px rgba(0,0,0,0.25);
  animation:slideUp 0.35s cubic-bezier(0.34,1.56,0.64,1);
  position:relative;
}
@keyframes slideUp {
  from{transform:translateY(60px);opacity:0}
  to{transform:translateY(0);opacity:1}
}
.modal-close {
  position:absolute; top:12px; right:16px;
  background:#FFE566; border:none; border-radius:50%; width:34px; height:34px;
  font-size:16px; font-weight:900; cursor:pointer; transition:background 0.2s;
}
.modal-close:hover { background:#FFD000; }
.modal-emoji { font-size:80px; margin-bottom:10px; }
.modal-name  { font-size:28px; font-weight:900; color:#3D3D3D; margin-bottom:16px; }

.modal-letters { display:flex; gap:8px; justify-content:center; flex-wrap:wrap; margin-bottom:20px; }
.modal-letter-card {
  width:42px; height:52px; background:#FFF3E0; border-radius:10px;
  display:flex; align-items:center; justify-content:center;
  font-size:20px; font-weight:900; color:#FF6B00; cursor:pointer;
  border:2px solid #FFCC80; transition:all 0.2s;
}
.modal-letter-card:hover, .modal-letter-card.playing {
  background:#FFE566; transform:scale(1.15); border-color:#FFB300;
}

.modal-buttons { display:flex; gap:10px; justify-content:center; flex-wrap:wrap; }
.modal-btn {
  padding:12px 20px; border-radius:50px; border:none; cursor:pointer;
  font-family:'Nunito',sans-serif; font-size:14px; font-weight:800;
  transition:all 0.25s; display:flex; align-items:center; gap:6px;
}
.btn-listen { background:linear-gradient(135deg,#7EC8E3,#B3E5F5); color:#1a1a1a; }
.btn-sound  { background:linear-gradient(135deg,#A8E6CF,#C8F5E3); color:#1a1a1a; }
.modal-btn:hover { transform:scale(1.06); box-shadow:0 6px 16px rgba(0,0,0,0.12); }

/* ===== WRITING PAGE ===== */
.write-layout {
  display:flex; flex-direction:column; align-items:center;
  gap:10px; max-width:400px; margin:0 auto;
}
.write-selector {
  display:flex; align-items:center; justify-content:center; gap:16px;
  width:100%;
}
.prev-char, .next-char {
  width:44px; height:44px; border-radius:50%; background:#FFE566;
  border:3px solid #FFB300; font-size:18px; font-weight:900; cursor:pointer;
  transition:all 0.2s; display:flex; align-items:center; justify-content:center;
  flex-shrink:0;
}
.prev-char:hover, .next-char:hover { background:#FFD000; transform:scale(1.1); }
.char-display {
  width:80px; height:80px; background:white; border-radius:18px;
  display:flex; align-items:center; justify-content:center;
  font-size:52px; font-weight:900; color:#ccc;
  box-shadow:var(--shadow); border:3px solid #eee;
}

.write-area {
  display:flex; justify-content:center; width:100%;
}
#writeCanvas, #writeCanvasNum {
  border-radius:18px; box-shadow:var(--shadow);
  border:4px solid #FFE566; cursor:crosshair;
  touch-action:none; background:white;
  width:min(240px, calc(100vw - 60px));
  height:min(240px, calc(100vw - 60px));
}

.write-controls { display:flex; gap:12px; justify-content:center; }
.write-btn {
  padding:11px 22px; border-radius:50px; border:none; cursor:pointer;
  font-family:'Nunito',sans-serif; font-size:15px; font-weight:800; transition:all 0.25s;
}
.clear-btn { background:#FFB3C6; color:#3D3D3D; }
.check-btn { background:linear-gradient(135deg,#A8E6CF,#56D98A); color:#1a1a1a; }
.write-btn:hover { transform:scale(1.06); box-shadow:0 6px 16px rgba(0,0,0,0.12); }

.write-feedback {
  text-align:center; font-size:20px; font-weight:800;
  min-height:32px; color:#3D3D3D;
}

/* ===== GAMES ===== */
.game-score {
  text-align:center; font-size:20px; font-weight:800; color:#3D3D3D;
  margin-bottom:14px;
}
.game-btn {
  display:block; margin:16px auto 0;
  padding:12px 28px; border-radius:50px;
  background:linear-gradient(135deg,#FFE566,#FFD1A0);
  border:2px solid #FFB300; cursor:pointer;
  font-family:'Nunito',sans-serif; font-size:16px; font-weight:800; color:#3D3D3D;
  transition:all 0.25s;
}
.game-btn:hover { transform:scale(1.05); box-shadow:0 6px 16px rgba(255,179,0,0.4); }

/* PUZZLE */
.puzzle-container { display:flex; justify-content:center; margin-bottom:10px; }
.puzzle-board {
  display:grid; grid-template-columns:repeat(3,1fr);
  gap:6px; width:300px; height:300px;
  background:#f0f0f0; padding:8px; border-radius:16px; box-shadow:var(--shadow);
}
.puzzle-piece {
  border-radius:10px; display:flex; align-items:center; justify-content:center;
  font-size:36px; cursor:pointer; transition:all 0.2s;
  font-weight:900; user-select:none;
  border:3px solid rgba(255,255,255,0.8);
}
.puzzle-piece:hover { transform:scale(1.05); }
.puzzle-piece.selected { border-color:#FF6B9D; transform:scale(1.08); box-shadow:0 4px 12px rgba(255,107,157,0.4); }
.puzzle-piece.empty { background:#e0e0e0; cursor:default; }
.puzzle-piece.correct { background:linear-gradient(135deg,#A8E6CF,#56D98A); }

/* TEBAK */
.tebak-container { text-align:center; }
.tebak-emoji { font-size:100px; margin:10px 0; animation:bounce 2s infinite; }
.tebak-question { font-size:18px; font-weight:700; color:#666; margin-bottom:16px; }
.tebak-options { display:grid; grid-template-columns:1fr 1fr; gap:10px; max-width:400px; margin:0 auto; }
.tebak-opt {
  padding:14px; border-radius:16px; border:3px solid #ddd;
  background:white; cursor:pointer;
  font-family:'Nunito',sans-serif; font-size:16px; font-weight:800; color:#3D3D3D;
  transition:all 0.25s;
}
.tebak-opt:hover { background:#FFF3E0; border-color:#FFB300; transform:scale(1.04); }
.tebak-opt.correct { background:#A8E6CF; border-color:#4CAF50; }
.tebak-opt.wrong   { background:#FFB3C6; border-color:#F44336; }

.tebak-result { text-align:center; padding:20px; }
.result-icon { font-size:64px; margin-bottom:8px; animation:bounce 1s ease; }
.result-text { font-size:20px; font-weight:800; color:#3D3D3D; margin-bottom:12px; }

/* COCOKKAN */
.cocok-container {
  display:grid; grid-template-columns:1fr 1fr;
  gap:20px; max-width:500px; margin:0 auto;
}
.cocok-col { display:flex; flex-direction:column; gap:10px; }
.cocok-col-title { font-size:14px; font-weight:700; color:#888; text-align:center; margin-bottom:4px; }
.cocok-item {
  padding:14px; border-radius:16px; border:3px solid #ddd;
  background:white; cursor:pointer; text-align:center;
  font-family:'Nunito',sans-serif; font-size:24px; font-weight:800;
  transition:all 0.25s; user-select:none;
}
.cocok-item:hover { border-color:#7EC8E3; background:#EBF7FB; transform:scale(1.04); }
.cocok-item.selected { border-color:#FF6B9D; background:#FFF0F5; transform:scale(1.06); }
.cocok-item.matched  { background:linear-gradient(135deg,#A8E6CF,#56D98A); border-color:#4CAF50; cursor:default; }
.cocok-item.wrong    { animation:shake 0.4s ease; }
@keyframes shake {
  0%,100%{transform:translateX(0)} 25%{transform:translateX(-8px)} 75%{transform:translateX(8px)}
}

/* ===== SETTINGS ===== */
.settings-container { max-width:600px; margin:0 auto; display:flex; flex-direction:column; gap:14px; }
.setting-card {
  background:white; border-radius:20px; padding:18px 22px;
  display:flex; align-items:center; gap:16px;
  box-shadow:var(--shadow); border:2px solid rgba(255,255,255,0.8);
}
.setting-icon { font-size:34px; flex-shrink:0; }
.setting-info { flex:1; }
.setting-info h3 { font-size:16px; font-weight:800; color:#3D3D3D; margin-bottom:2px; }
.setting-info p  { font-size:13px; font-weight:600; color:#888; }
.setting-control { display:flex; align-items:center; gap:8px; flex-shrink:0; }

input[type=range] {
  -webkit-appearance:none; width:120px; height:8px;
  border-radius:10px; background:#FFE566; outline:none;
}
input[type=range]::-webkit-slider-thumb {
  -webkit-appearance:none; width:22px; height:22px; border-radius:50%;
  background:#FFB300; cursor:pointer; border:3px solid white;
  box-shadow:0 2px 8px rgba(0,0,0,0.2);
}
#volumeVal, #speedVal { font-size:13px; font-weight:700; color:#666; min-width:50px; }

.theme-btns { display:flex; gap:8px; }
.theme-dot {
  width:32px; height:32px; border-radius:50%; border:3px solid white;
  cursor:pointer; transition:all 0.2s; box-shadow:0 2px 8px rgba(0,0,0,0.15);
}
.theme-dot.active, .theme-dot:hover { transform:scale(1.2); border-color:#666; }

/* Toggle Switch */
.toggle { position:relative; display:inline-block; width:52px; height:28px; }
.toggle input { opacity:0; width:0; height:0; }
.toggle-slider {
  position:absolute; inset:0; background:#ccc; border-radius:28px;
  cursor:pointer; transition:0.3s;
}
.toggle-slider::before {
  content:''; position:absolute; height:20px; width:20px;
  left:4px; bottom:4px; background:white; border-radius:50%;
  transition:0.3s; box-shadow:0 2px 6px rgba(0,0,0,0.2);
}
.toggle input:checked + .toggle-slider { background:#A8E6CF; }
.toggle input:checked + .toggle-slider::before { transform:translateX(24px); }

.name-input {
  padding:8px 14px; border:2px solid #ddd; border-radius:12px;
  font-family:'Nunito',sans-serif; font-size:14px; font-weight:700;
  color:#3D3D3D; outline:none; width:140px;
  transition:border-color 0.2s;
}
.name-input:focus { border-color:#FFB300; }

.reset-btn {
  padding:10px 20px; border-radius:50px; background:#FFB3C6; border:2px solid #FF80A0;
  font-family:'Nunito',sans-serif; font-size:14px; font-weight:800; cursor:pointer;
  transition:all 0.2s; color:#3D3D3D;
}
.reset-btn:hover { background:#FF80A0; transform:scale(1.05); }

.settings-footer { margin-top:30px; }
.app-info {
  background:white; border-radius:20px; padding:20px;
  display:flex; align-items:center; gap:16px;
  box-shadow:var(--shadow); max-width:600px; margin:0 auto;
}
.app-info-logo { font-size:40px; }
.app-info strong { font-size:16px; font-weight:800; color:#3D3D3D; }
.app-info p { font-size:13px; font-weight:600; color:#888; margin-top:2px; }

/* ===== CONFETTI ===== */
#confetti-container { position:fixed; inset:0; pointer-events:none; z-index:300; overflow:hidden; }
.confetti-piece {
  position:absolute; top:-20px; width:12px; height:12px; border-radius:3px;
  animation:confettiFall linear forwards;
}
@keyframes confettiFall {
  to { transform:translateY(110vh) rotate(720deg); opacity:0; }
}

/* ===== RESPONSIVE ===== */
@media(max-width:700px) {
  .nav-links { display:none; }
  .hamburger { display:block; }
  .home-cards { grid-template-columns:1fr 1fr; }
  .alphabet-grid { grid-template-columns:repeat(5,1fr); }
  .puzzle-board { width:270px; height:270px; }
  .tebak-options { grid-template-columns:1fr; }
  input[type=range] { width:80px; }
}
@media(max-width:400px) {
  .home-cards { grid-template-columns:1fr; }
  .alphabet-grid { grid-template-columns:repeat(4,1fr); }
}

.spell-modal {
  display:none;
  position:fixed;
  inset:0;
  background:rgba(0,0,0,0.5);
  z-index:200;
  justify-content:center;
  align-items:center;
}

.spell-modal.open {
  display:flex;
}

.spell-modal-content {
  background:white;
  padding:24px;
  border-radius:24px;
  text-align:center;
  max-width:350px;
}

.spell-modal-emoji {
  font-size:80px;
  margin-bottom:12px;
}

.spell-modal-letters {
  display:flex;
  gap:8px;
  justify-content:center;
  margin-bottom:16px;
}

.spell-modal-content {
  background: white;
  padding: 24px;
  border-radius: 24px;
  text-align: center;
  min-width: 300px;
  box-shadow: 0 20px 60px rgba(0,0,0,0.25);
  animation: popIn 0.25s ease;
}

@keyframes popIn {
  from { transform: scale(0.7); opacity: 0; }
  to { transform: scale(1); opacity: 1; }
}

.spell-modal-emoji {
  font-size: 70px;
  margin-bottom: 10px;
}

.spell-modal-letters {
  display: flex;
  gap: 10px;
  justify-content: center;
  margin: 18px 0;
}

/* Kartu huruf di modal */
.modal-letter-card {
  width: 44px;
  height: 54px;
  background: #FFF3E0;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  font-weight: 900;
  color: #FF6B00;
  cursor: pointer;
  border: 2px solid #FFCC80;
  transition: 0.2s;
}

.modal-letter-card:hover {
  transform: scale(1.1);
  background: #FFE566;
}

/* tombol */
.modal-btn {
  display: inline-block;
  padding: 12px 18px;
  margin: 6px;
  border-radius: 50px;
  border: none;
  font-weight: 800;
  cursor: pointer;
  font-family: Nunito, sans-serif;
  transition: 0.2s;
}

.btn-listen {
  background: linear-gradient(135deg,#7EC8E3,#B3E5F5);
}

.btn-close {
  background: #FFB3C6;
}

.modal-btn:hover {
  transform: scale(1.05);
}
/* =====================================
   MENGEJA - KARTU KALIMAT
   ===================================== */

.spell-sentence-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 16px;
  max-width: 900px;
  margin: 0 auto 24px auto;
}

.spell-sentence-card {
  border-radius: 18px;
  padding: 22px 18px;
  text-align: center;
  cursor: pointer;
  transition: all 0.25s;
  box-shadow: var(--shadow);
  border: 3px solid transparent;
  user-select: none;
}

.spell-sentence-card:hover {
  transform: translateY(-5px);
  border-color: var(--blue);
  box-shadow: 0 10px 28px rgba(0,0,0,0.13);
}

.spell-sentence-card.playing {
  animation: pulse 0.4s ease;
  filter: brightness(1.08);
}

.spell-sentence-text {
  font-size: 18px;
  font-weight: 900;
  color: #3D3D3D;
  line-height: 1.4;
}

/* AREA TOMBOL CUSTOM */
.spell-custom-area {
  display: flex;
  justify-content: center;
  margin: 8px 0 16px;
}

.custom-sentence-btn {
  background: linear-gradient(135deg, #7EC8E3, #A8E6CF);
  color: #1a1a2e;
  border: none;
  border-radius: 50px;
  padding: 13px 28px;
  font-size: 16px;
  font-weight: 800;
  font-family: inherit;
  cursor: pointer;
  box-shadow: 0 4px 14px rgba(126,200,227,0.4);
  transition: all 0.2s;
}

.custom-sentence-btn:hover {
  transform: translateY(-3px);
  box-shadow: 0 8px 20px rgba(126,200,227,0.5);
}

/* =====================================
   SPELL MODAL — BARU
   ===================================== */

.spell-modal {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.52);
  backdrop-filter: blur(4px);
  z-index: 300;
  justify-content: center;
  align-items: center;
  padding: 16px;
}

.spell-modal.open {
  display: flex;
  animation: fadeIn 0.2s ease;
}

.spell-modal-content {
  background: white;
  padding: 30px 24px 26px;
  border-radius: 28px;
  text-align: center;
  max-width: 480px;
  width: 100%;
  box-shadow: 0 24px 64px rgba(0,0,0,0.22);
  animation: slideUp 0.35s cubic-bezier(0.34,1.56,0.64,1);
  position: relative;
  overflow-y: auto;
  max-height: 90vh;
}

.spell-modal-close {
  position: absolute;
  top: 14px;
  right: 16px;
  background: #f0f0f0;
  border: none;
  border-radius: 50%;
  width: 34px;
  height: 34px;
  font-size: 16px;
  cursor: pointer;
  font-weight: 800;
  color: #666;
  transition: background 0.2s;
  display: flex;
  align-items: center;
  justify-content: center;
}

.spell-modal-close:hover { background: #FFB3C6; color: #c0392b; }

.spell-modal-sentence {
  font-size: 26px;
  font-weight: 900;
  color: #2d2d2d;
  margin: 8px 0 24px;
  line-height: 1.3;
}

/* Baris suku kata */
.spell-syllable-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 4px;
  justify-content: center;
  align-items: center;
  margin-bottom: 24px;
}

.syllable-card {
  background: #FFF3E0;
  border: 2px solid #FFCC80;
  border-radius: 14px;
  padding: 10px 14px;
  font-size: 20px;
  font-weight: 900;
  color: #E65100;
  cursor: pointer;
  user-select: none;
  transition: all 0.18s;
  min-width: 36px;
}

.syllable-card:hover {
  transform: scale(1.12);
  background: #FFE566;
  border-color: #FFB300;
}

.syllable-card.syl-playing {
  background: #FFD740;
  border-color: #FF6D00;
  transform: scale(1.18);
  box-shadow: 0 4px 16px rgba(255,109,0,0.35);
}

.syllable-card.syl-burst {
  animation: sylBurst 0.7s ease;
}

@keyframes sylBurst {
  0%   { transform: scale(1); }
  40%  { transform: scale(1.28); background: #FFE566; }
  100% { transform: scale(1); }
}

.syllable-sep {
  font-size: 20px;
  font-weight: 900;
  color: #BDBDBD;
  user-select: none;
  line-height: 1;
  padding: 0 2px;
}

/* Tombol Dengarkan */
.spell-listen-btn {
  background: linear-gradient(135deg, #FF6B00, #FFB300);
  color: white;
  border: none;
  border-radius: 50px;
  padding: 13px 30px;
  font-size: 17px;
  font-weight: 800;
  font-family: inherit;
  cursor: pointer;
  box-shadow: 0 4px 16px rgba(255,107,0,0.35);
  transition: all 0.2s;
  margin-top: 4px;
}

.spell-listen-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 22px rgba(255,107,0,0.45);
}

/* =====================================
   CUSTOM SENTENCE MODAL
   ===================================== */

.custom-modal-title {
  font-size: 22px;
  font-weight: 900;
  color: #2d2d2d;
  margin: 8px 0 6px;
}

.custom-modal-hint {
  font-size: 14px;
  color: #888;
  margin-bottom: 16px;
}

.custom-sentence-input {
  width: 100%;
  box-sizing: border-box;
  border: 3px solid #FFCC80;
  border-radius: 16px;
  padding: 13px 16px;
  font-size: 17px;
  font-family: inherit;
  font-weight: 700;
  color: #2d2d2d;
  outline: none;
  margin-bottom: 16px;
  transition: border 0.2s;
}

.custom-sentence-input:focus {
  border-color: #FF6B00;
}

.custom-modal-buttons {
  display: flex;
  justify-content: center;
}

.custom-error {
  font-size: 14px;
  color: #e53935;
  font-weight: 700;
  margin-top: 10px;
  min-height: 20px;
}

/* =====================================
   BELAJAR BERHITUNG
   ===================================== */

/* Kartu soal */
.hitung-card-wrap {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
  flex-wrap: wrap;
  margin: 28px auto 20px;
  max-width: 480px;
}

.hitung-num {
  background: white;
  border-radius: 20px;
  padding: 22px 28px;
  font-size: 46px;
  font-weight: 900;
  color: #2d2d2d;
  box-shadow: var(--shadow);
  border: 3px solid #FFCC80;
  min-width: 80px;
  text-align: center;
  line-height: 1;
}

.hitung-op {
  font-size: 40px;
  font-weight: 900;
  color: #FF6B00;
  padding: 0 4px;
}

.hitung-equals {
  font-size: 40px;
  font-weight: 900;
  color: #888;
}

.hitung-input {
  background: #FFF8E1;
  border: 3px solid #FFB300;
  border-radius: 20px;
  padding: 18px 20px;
  font-size: 40px;
  font-weight: 900;
  color: #E65100;
  width: 100px;
  text-align: center;
  outline: none;
  font-family: inherit;
  transition: border 0.2s, box-shadow 0.2s;
  -moz-appearance: textfield;
}
.hitung-input::-webkit-outer-spin-button,
.hitung-input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.hitung-input:focus {
  border-color: #FF6B00;
  box-shadow: 0 0 0 4px rgba(255,107,0,0.15);
}
.hitung-input.benar { border-color: #4CAF50; background: #E8F5E9; }
.hitung-input.salah  { border-color: #F44336; background: #FFEBEE; animation: shake 0.4s ease; }

@keyframes shake {
  0%,100% { transform: translateX(0); }
  20%      { transform: translateX(-8px); }
  40%      { transform: translateX(8px); }
  60%      { transform: translateX(-5px); }
  80%      { transform: translateX(5px); }
}

/* Kontrol cek / soal baru */
.hitung-controls {
  display: flex;
  gap: 12px;
  justify-content: center;
  flex-wrap: wrap;
  margin-top: 8px;
}

.hitung-btn-cek {
  background: linear-gradient(135deg, #4CAF50, #81C784);
  color: white;
  border: none;
  border-radius: 50px;
  padding: 13px 28px;
  font-size: 16px;
  font-weight: 800;
  font-family: inherit;
  cursor: pointer;
  box-shadow: 0 4px 14px rgba(76,175,80,0.35);
  transition: all 0.2s;
}
.hitung-btn-cek:hover { transform: translateY(-2px); box-shadow: 0 8px 20px rgba(76,175,80,0.45); }

.hitung-btn-next {
  background: linear-gradient(135deg, #7EC8E3, #5BA4CF);
  color: white;
  border: none;
  border-radius: 50px;
  padding: 13px 28px;
  font-size: 16px;
  font-weight: 800;
  font-family: inherit;
  cursor: pointer;
  box-shadow: 0 4px 14px rgba(126,200,227,0.35);
  transition: all 0.2s;
}
.hitung-btn-next:hover { transform: translateY(-2px); }

/* ===== KUIS ===== */
.quiz-progress-wrap {
  max-width: 440px;
  margin: 8px auto 4px;
  text-align: left;
}
.quiz-progress-label {
  font-size: 14px;
  font-weight: 700;
  color: #888;
  display: block;
  margin-bottom: 6px;
}
.quiz-progress-bar {
  background: #F0F0F0;
  border-radius: 50px;
  height: 10px;
  overflow: hidden;
}
.quiz-progress-fill {
  background: linear-gradient(90deg, #FFB300, #FF6B00);
  height: 100%;
  border-radius: 50px;
  transition: width 0.4s ease;
  width: 10%;
}
.quiz-score-wrap {
  text-align: center;
  font-size: 18px;
  font-weight: 800;
  color: #FF6B00;
  margin: 8px 0 0;
}

/* Pilihan jawaban kuis */
.quiz-options {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
  max-width: 400px;
  margin: 0 auto 16px;
}

.quiz-option-btn {
  background: white;
  border: 3px solid #FFCC80;
  border-radius: 18px;
  padding: 16px;
  font-size: 26px;
  font-weight: 900;
  color: #2d2d2d;
  cursor: pointer;
  font-family: inherit;
  transition: all 0.18s;
  box-shadow: 0 3px 10px rgba(0,0,0,0.08);
}
.quiz-option-btn:hover:not(:disabled) { transform: scale(1.06); border-color: #FF6B00; background: #FFF8E1; }
.quiz-option-btn.benar  { background: #E8F5E9; border-color: #4CAF50; color: #2E7D32; }
.quiz-option-btn.salah  { background: #FFEBEE; border-color: #F44336; color: #C62828; animation: shake 0.4s ease; }
.quiz-option-btn:disabled { cursor: not-allowed; opacity: 0.7; }

/* Hasil kuis akhir */
.quiz-result {
  text-align: center;
  padding: 24px 16px;
}
.quiz-result-icon { font-size: 64px; margin-bottom: 12px; }
.quiz-result-text { font-size: 20px; font-weight: 800; color: #2d2d2d; margin-bottom: 20px; line-height: 1.4; }

/* ===== CUSTOM SOAL ===== */
.custom-hitung-form {
  max-width: 500px;
  margin: 20px auto;
}
.custom-hitung-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 24px;
}
.custom-num-input {
  background: #FFF8E1;
  border: 3px solid #FFB300;
  border-radius: 16px;
  padding: 14px 12px;
  font-size: 32px;
  font-weight: 900;
  color: #E65100;
  width: 84px;
  text-align: center;
  outline: none;
  font-family: inherit;
  -moz-appearance: textfield;
}
.custom-num-input::-webkit-outer-spin-button,
.custom-num-input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.custom-num-input:focus { border-color: #FF6B00; box-shadow: 0 0 0 4px rgba(255,107,0,0.15); }
.custom-num-input.custom-answer { background: #EDE7F6; border-color: #7C4DFF; color: #4527A0; }
.custom-num-input.benar { border-color: #4CAF50; background: #E8F5E9; }
.custom-num-input.salah  { border-color: #F44336; background: #FFEBEE; animation: shake 0.4s ease; }

.custom-op-select {
  background: white;
  border: 3px solid #FFCC80;
  border-radius: 14px;
  padding: 12px 10px;
  font-size: 26px;
  font-family: inherit;
  font-weight: 700;
  cursor: pointer;
  outline: none;
  color: #FF6B00;
}
.custom-op-select:focus { border-color: #FF6B00; }

.custom-equals {
  font-size: 36px;
  font-weight: 900;
  color: #888;
}

/* ===== TOAST ===== */
.hitung-toast {
  position: fixed;
  bottom: 32px;
  left: 50%;
  transform: translateX(-50%) translateY(80px);
  background: #2d2d2d;
  color: white;
  padding: 14px 28px;
  border-radius: 50px;
  font-size: 16px;
  font-weight: 800;
  font-family: inherit;
  box-shadow: 0 8px 28px rgba(0,0,0,0.25);
  z-index: 999;
  pointer-events: none;
  opacity: 0;
  transition: all 0.35s cubic-bezier(0.34,1.56,0.64,1);
  white-space: nowrap;
}
.hitung-toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}
.hitung-toast.benar { background: linear-gradient(135deg, #4CAF50, #81C784); }
.hitung-toast.salah  { background: linear-gradient(135deg, #F44336, #E57373); }

/* =========================
   BERHITUNG TK (3–5 TAHUN)
   ========================= */

#page-berhitung {
  padding: 90px 20px 20px;
}

#page-berhitung .page-header {
  margin-bottom: 16px;
}

/* Tombol mode tambah/kurang */
.tk-mode-btns {
  display: flex;
  gap: 12px;
  justify-content: center;
  margin-bottom: 24px;
}

#page-berhitung .tk-mode-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 10px 24px;
  border-radius: 50px;
  border: 3px solid #FFD84D;
  background: white;
  font-family: 'Nunito', sans-serif;
  font-size: 16px;
  font-weight: 800;
  cursor: pointer;
  transition: all 0.2s;
  color: #3D3D3D;
  margin: 0;
}

#page-berhitung .tk-mode-btn:hover,
#page-berhitung .tk-mode-btn.active {
  background: linear-gradient(135deg, #FFE566, #FFD84D);
  transform: translateY(-2px);
  box-shadow: 0 4px 14px rgba(255,200,0,0.4);
}

/* Soal vertikal */
.tk-soal {
  text-align: center;
  margin: 0 0 20px;
}

.tk-block {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  background: white;
  border-radius: 28px;
  padding: 24px 32px;
  box-shadow: 0 6px 24px rgba(0,0,0,0.10);
  border: 3px solid #FFE566;
  min-width: 200px;
}

.tk-emoji-row {
  font-size: 36px;
  line-height: 1.4;
  letter-spacing: 4px;
  max-width: 280px;
  word-break: break-all;
  text-align: center;
}

.tk-operator {
  font-size: 36px;
  font-weight: 900;
  color: #FF8C00;
  line-height: 1;
}

.tk-question {
  font-size: 44px;
  font-weight: 900;
  color: #7EC8E3;
  background: #EEF9FF;
  border-radius: 16px;
  padding: 8px 28px;
  border: 3px dashed #7EC8E3;
  margin-top: 4px;
  min-width: 80px;
  min-height: 64px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s ease;
}

.tk-question.benar {
  background: #E8F5E9;
  border: 3px solid #4CAF50;
  animation: popIn 0.4s cubic-bezier(0.34,1.56,0.64,1);
}

.tk-answer-emoji {
  font-size: 28px;
  letter-spacing: 2px;
  line-height: 1.5;
  word-break: break-all;
  max-width: 260px;
  text-align: center;
  display: block;
  animation: popIn 0.4s cubic-bezier(0.34,1.56,0.64,1);
}

/* Pilihan jawaban */
.tk-options {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 14px;
  max-width: 300px;
  margin: 0 auto 20px;
}

.tk-btn {
  padding: 18px;
  font-size: 26px;
  border: 3px solid #FFD84D;
  border-radius: 20px;
  background: white;
  font-family: 'Nunito', sans-serif;
  font-weight: 900;
  cursor: pointer;
  transition: all 0.2s;
  color: #3D3D3D;
  box-shadow: 0 4px 12px rgba(0,0,0,0.08);
}

.tk-btn:hover {
  transform: scale(1.08);
  background: #FFE566;
  border-color: #FFB300;
  box-shadow: 0 6px 18px rgba(255,180,0,0.35);
}

.tk-btn.benar {
  background: #E8F5E9;
  border-color: #4CAF50;
  color: #2E7D32;
}

.tk-btn.salah {
  background: #FFEBEE;
  border-color: #F44336;
  animation: shake 0.4s ease;
}
/* ===== CONFETTI ANIMATION ===== */
@keyframes confettiFall {
  0%   { transform: translateY(0) rotate(0deg); opacity: 1; }
  100% { transform: translateY(100vh) rotate(720deg); opacity: 0; }
}

/* ===== CONFETTI ANIMATION ===== */
@keyframes confettiFall {
  0%   { transform: translateY(0) rotate(0deg); opacity: 1; }
  100% { transform: translateY(100vh) rotate(720deg); opacity: 0; }
}

/* ===== ANIMAL MODAL LETTERS ===== */
.modal-letter-btn {
  display: inline-flex; align-items: center; justify-content: center;
  width: 44px; height: 44px; border-radius: 12px;
  border: 3px solid rgba(255,255,255,0.7);
  font-family: 'Nunito', sans-serif; font-size: 20px; font-weight: 900;
  color: #3D3D3D; cursor: pointer; transition: all 0.2s;
  box-shadow: 0 3px 10px rgba(0,0,0,0.10);
}
.modal-letter-btn:hover, .modal-letter-btn.letter-pop {
  transform: scale(1.25) rotate(-5deg);
  box-shadow: 0 6px 16px rgba(0,0,0,0.18);
}
.modal-letter-sep {
  font-size: 22px; font-weight: 900; color: #bbb;
  display: inline-flex; align-items: center; padding: 0 4px;
}
#modalLetters {
  display: flex; flex-wrap: wrap; gap: 8px;
  justify-content: center; margin: 14px 0 8px;
}

/* ===== PUZZLE ===== */
.puzzle-slot {
  background: white; border: 3px dashed #FFCC80;
  border-radius: 18px; min-height: 90px;
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  cursor: pointer; transition: all 0.2s;
  padding: 8px;
}
.puzzle-slot:hover { background: #FFF8E1; border-color: #FFB300; transform: scale(1.04); }
.puzzle-slot.benar { background: #E8F5E9; border: 3px solid #4CAF50; }
.puzzle-slot.salah-flash { background: #FFEBEE; border-color: #F44336; animation: shake 0.4s ease; }
.puzzle-label { font-size: 13px; font-weight: 800; color: #888; text-align: center; margin-top: 4px; }
.puzzle-piece {
  background: white; border: 3px solid #7EC8E3;
  border-radius: 18px; min-height: 90px;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer; transition: all 0.25s;
  font-size: 48px;
}
.puzzle-piece:hover { transform: scale(1.08); box-shadow: 0 6px 18px rgba(0,0,0,0.15); }
.puzzle-piece.selected { border-color: #FF8C00; background: #FFF8E1; box-shadow: 0 0 0 4px rgba(255,140,0,0.3); transform: scale(1.1); }
.puzzle-piece.used { opacity: 0.3; cursor: not-allowed; pointer-events: none; }
.puzzle-emoji { font-size: 48px; }

/* ===== TEBAK GAMBAR ===== */
.tebak-btn {
  background: white; border: 3px solid #FFCC80; border-radius: 18px;
  padding: 12px 10px; font-family: 'Nunito', sans-serif;
  font-size: 15px; font-weight: 800; color: #3D3D3D;
  cursor: pointer; transition: all 0.2s;
  box-shadow: 0 3px 10px rgba(0,0,0,0.08);
}
.tebak-btn:hover:not(:disabled) { transform: scale(1.06); background: #FFF8E1; border-color: #FFB300; }
.tebak-btn.benar { background: #E8F5E9; border-color: #4CAF50; color: #2E7D32; }
.tebak-btn.salah { background: #FFEBEE; border-color: #F44336; animation: shake 0.4s ease; }
.tebak-btn:disabled { opacity: 0.7; cursor: not-allowed; }
#tebakOptions { display: grid; grid-template-columns: repeat(2,1fr); gap: 12px; max-width: 360px; margin: 0 auto 16px; }

/* ===== COCOKKAN ===== */
.cocok-btn {
  background: white; border: 3px solid #C3B1E1; border-radius: 16px;
  padding: 10px 18px; font-family: 'Nunito', sans-serif;
  font-size: 15px; font-weight: 800; color: #3D3D3D;
  cursor: pointer; transition: all 0.2s; min-width: 100px;
  box-shadow: 0 3px 10px rgba(0,0,0,0.07);
}
.cocok-btn:hover { transform: scale(1.06); }
.cocok-btn.cocok-selected { border-color: #FF8C00; background: #FFF8E1; box-shadow: 0 0 0 4px rgba(255,140,0,0.25); transform: scale(1.08); }
.cocok-btn.matched { background: #E8F5E9; border-color: #4CAF50; color: #2E7D32; pointer-events: none; }
.cocok-btn.salah { background: #FFEBEE; border-color: #F44336; animation: shake 0.4s ease; }

/* ===== PENGATURAN - nama + tombol simpan ===== */
.setting-name-row { display: flex; flex-direction: column; gap: 8px; align-items: flex-end; }
.save-name-btn {
  background: linear-gradient(135deg, #A8E6CF, #52D3AA);
  border: none; border-radius: 20px; padding: 8px 18px;
  font-family: 'Nunito', sans-serif; font-size: 13px; font-weight: 800;
  color: #1B5E40; cursor: pointer; transition: all 0.2s;
  box-shadow: 0 3px 10px rgba(0,0,0,0.10);
  white-space: nowrap;
}
.save-name-btn:hover { transform: scale(1.05); box-shadow: 0 5px 14px rgba(0,0,0,0.15); }
.setting-card-about:hover { transform: translateY(-2px); box-shadow: 0 8px 24px rgba(0,0,0,0.12); }
.about-modal-content { max-width: 380px; }

/* ===== ANIMAL CARD ===== */
.animal-card {
  border-radius: 20px; padding: 20px 12px; text-align: center;
  cursor: pointer; transition: all 0.25s;
  box-shadow: 0 4px 14px rgba(0,0,0,0.09);
  border: 3px solid rgba(255,255,255,0.7);
}
.animal-card:hover { transform: translateY(-6px) scale(1.04); box-shadow: 0 10px 28px rgba(0,0,0,0.14); }
.animal-emoji { font-size: 52px; margin-bottom: 8px; }
.animal-name { font-size: 15px; font-weight: 800; color: #3D3D3D; }
.animal-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(110px,1fr)); gap: 14px; max-width: 860px; margin: 0 auto; padding: 0 12px; }

/* shake animation */
@keyframes shake {
  0%,100% { transform: translateX(0); }
  20%,60%  { transform: translateX(-6px); }
  40%,80%  { transform: translateX(6px); }
}
