:root{
  --sky-top:#8fd8f0;
  --sky-bottom:#c9f0d9;
  --grass:#7fc06b;
  --grass-dark:#5fa350;
  --sun:#ffd166;
  --coral:#ff7a6b;
  --card:#ffffff;
  --ink:#2c4a3e;
  --ink-soft:#5c7568;
  --shadow: 0 8px 0 rgba(44,74,62,0.12);
}
*{box-sizing:border-box;}
html{
  -webkit-text-size-adjust: 100%;
}
body{
  margin:0;
  font-family:'Nunito', sans-serif;
  background: linear-gradient(180deg, var(--sky-top) 0%, var(--sky-bottom) 55%, var(--grass) 55%, var(--grass-dark) 100%);
  min-height:100vh;
  overflow-x:hidden;
  position:relative;
  -webkit-tap-highlight-color: transparent;
}

/* floating clouds */
.cloud{
  position:absolute;
  background:#fff;
  border-radius:50px;
  opacity:0.85;
}
.cloud::before, .cloud::after{
  content:"";
  position:absolute;
  background:#fff;
  border-radius:50%;
}
.c1{width:90px;height:34px;top:6%;left:5%;}
.c1::before{width:50px;height:50px;top:-24px;left:10px;}
.c1::after{width:36px;height:36px;top:-16px;left:50px;}
.c2{width:70px;height:26px;top:14%;right:8%;}
.c2::before{width:38px;height:38px;top:-18px;left:8px;}
.c2::after{width:28px;height:28px;top:-12px;left:36px;}
.c3{width:60px;height:22px;top:3%;left:42%;}
.c3::before{width:32px;height:32px;top:-16px;left:6px;}
.c3::after{width:24px;height:24px;top:-10px;left:30px;}

.sun{
  position:absolute;
  top:4%;
  right:14%;
  width:70px;
  height:70px;
  border-radius:50%;
  background: radial-gradient(circle at 35% 35%, #fff2c9, var(--sun));
  box-shadow: 0 0 0 10px rgba(255,209,102,0.25);
}

header{
  position:relative;
  text-align:center;
  padding: 34px 20px 10px;
  z-index:2;
}
h1{
  font-family:'Baloo 2', sans-serif;
  font-weight:800;
  font-size: clamp(30px, 6vw, 52px);
  color:var(--ink);
  margin:0;
  text-shadow: 3px 3px 0 rgba(255,255,255,0.6);
  letter-spacing:1px;
}
h1 span{ color: var(--coral); }
.subtitle{
  font-weight:700;
  color: var(--ink-soft);
  margin-top:6px;
  font-size: clamp(14px, 2.2vw, 18px);
}

.progress-wrap{
  position:relative;
  z-index:2;
  max-width:420px;
  margin: 18px auto 6px;
  padding: 0 20px;
}
.progress-track{
  background: rgba(255,255,255,0.6);
  border-radius: 20px;
  height:16px;
  overflow:hidden;
  box-shadow: inset 0 2px 4px rgba(0,0,0,0.08);
}
.progress-fill{
  height:100%;
  width:0%;
  background: linear-gradient(90deg, var(--sun), var(--coral));
  border-radius:20px;
  transition: width 0.5s cubic-bezier(.34,1.56,.64,1);
}
.progress-label{
  text-align:center;
  font-weight:800;
  color:var(--ink);
  font-size:14px;
  margin-top:6px;
}

.grid{
  position:relative;
  z-index:2;
  max-width: 1100px;
  margin: 18px auto 60px;
  padding: 0 22px;
  display:grid;
  grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
  gap: 16px;
}

.card{
  background: var(--card);
  border: none;
  border-radius: 22px;
  padding: 14px 8px 12px;
  box-shadow: var(--shadow);
  cursor:pointer;
  display:flex;
  flex-direction:column;
  align-items:center;
  gap:6px;
  transform: translateY(0);
  transition: transform 0.15s ease, box-shadow 0.15s ease;
  font-family:inherit;
  position:relative;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
  width:100%;
}
@media (hover: hover){
  .card:hover{
    transform: translateY(-4px);
    box-shadow: 0 12px 0 rgba(44,74,62,0.12);
  }
}
.card:active, .card.bounce{
  transform: translateY(4px) scale(0.96);
  box-shadow: 0 4px 0 rgba(44,74,62,0.12);
}
.card .art{
  position:relative;
  width: 64px;
  height: 64px;
  display:flex;
  align-items:center;
  justify-content:center;
}
.card .emoji{
  font-size: 46px;
  line-height:1;
  filter: drop-shadow(0 3px 2px rgba(0,0,0,0.08));
}
.card .photo{
  position:absolute;
  inset:0;
  width:100%;
  height:100%;
  object-fit: cover;
  border-radius: 14px;
  opacity:0;
  transform: scale(0.9);
  transition: opacity 0.3s ease, transform 0.3s ease;
  pointer-events:none;
}
.card .photo.show{
  opacity:1;
  transform: scale(1);
}
.card .name-id{
  font-family:'Baloo 2', sans-serif;
  font-weight:700;
  color: var(--ink);
  font-size:15px;
  text-transform:capitalize;
}
.card .name-en{
  color: var(--ink-soft);
  font-size:11px;
  font-weight:600;
  text-transform:uppercase;
  letter-spacing:0.5px;
}
.card.learned::after{
  content:"⭐";
  position:absolute;
  top:-8px;
  right:-6px;
  font-size:20px;
  filter: drop-shadow(0 2px 1px rgba(0,0,0,0.15));
}

.bubble{
  position: fixed;
  left:50%;
  bottom: 30px;
  transform: translateX(-50%) translateY(20px);
  background: var(--card);
  color: var(--ink);
  font-family:'Baloo 2', sans-serif;
  font-weight:700;
  font-size: 22px;
  padding: 14px 28px;
  border-radius: 40px;
  box-shadow: 0 10px 30px rgba(0,0,0,0.18);
  opacity:0;
  pointer-events:none;
  transition: opacity 0.25s ease, transform 0.25s ease;
  z-index: 10;
  white-space:nowrap;
  max-width: 92vw;
  overflow: hidden;
  text-overflow: ellipsis;
}
.bubble.show{
  opacity:1;
  transform: translateX(-50%) translateY(0);
}
.bubble .emo{ margin-right:8px; }

.house{
  position:absolute;
  bottom: 18px;
  left: 30px;
  font-size: 56px;
  z-index:1;
  opacity:0.9;
}
.tree{
  position:absolute;
  bottom: 10px;
  right: 26px;
  font-size: 64px;
  z-index:1;
  opacity:0.9;
}

footer{
  position:relative;
  z-index:2;
  text-align:center;
  padding-bottom: 24px;
  color: rgba(255,255,255,0.85);
  font-weight:700;
  font-size:13px;
}

/* celebration overlay */
.overlay{
  position: fixed;
  inset: 0;
  background: rgba(44, 74, 62, 0.55);
  display:flex;
  align-items:center;
  justify-content:center;
  z-index: 50;
  opacity:0;
  pointer-events:none;
  transition: opacity 0.35s ease;
}
.overlay.show{
  opacity:1;
  pointer-events:auto;
}
.celebrate-card{
  background: var(--card);
  border-radius: 32px;
  padding: 40px 32px 32px;
  max-width: 380px;
  width: 88%;
  text-align:center;
  box-shadow: 0 20px 0 rgba(44,74,62,0.18);
  transform: scale(0.8) translateY(20px);
  transition: transform 0.4s cubic-bezier(.34,1.56,.64,1);
}
.overlay.show .celebrate-card{
  transform: scale(1) translateY(0);
}
.celebrate-emoji{
  font-size: 64px;
  margin-bottom: 6px;
  display:inline-block;
  animation: wiggle 1.2s ease-in-out infinite;
}
@keyframes wiggle{
  0%, 100%{ transform: rotate(-6deg); }
  50%{ transform: rotate(6deg); }
}
.celebrate-title{
  font-family:'Baloo 2', sans-serif;
  font-weight:800;
  font-size: 26px;
  color: var(--ink);
  margin: 8px 0 6px;
}
.celebrate-text{
  color: var(--ink-soft);
  font-weight:700;
  font-size: 15px;
  margin-bottom: 22px;
  line-height:1.5;
}
.celebrate-btn{
  font-family:'Baloo 2', sans-serif;
  font-weight:700;
  font-size: 17px;
  color:#fff;
  background: linear-gradient(90deg, var(--coral), #ff9a6b);
  border:none;
  padding: 14px 30px;
  border-radius: 40px;
  cursor:pointer;
  box-shadow: 0 6px 0 rgba(200,90,70,0.4);
  transition: transform 0.12s ease, box-shadow 0.12s ease;
}
.celebrate-btn:hover{ transform: translateY(-2px); }
.celebrate-btn:active{
  transform: translateY(4px);
  box-shadow: 0 2px 0 rgba(200,90,70,0.4);
}

.confetti-piece{
  position: fixed;
  top: -30px;
  font-size: 22px;
  z-index: 55;
  pointer-events:none;
  animation-name: fall;
  animation-timing-function: linear;
  animation-fill-mode: forwards;
}
@keyframes fall{
  to{ transform: translateY(110vh) rotate(360deg); }
}

@media (prefers-reduced-motion: reduce){
  .card, .bubble, .progress-fill, .celebrate-emoji{ transition:none; animation:none; }
  .confetti-piece{ display:none; }
}

/* ---------- responsif untuk layar kecil (HP) ---------- */
@media (max-width: 600px){
  header{ padding: 24px 16px 8px; }
  .subtitle{ padding: 0 10px; }

  .sun{ width:44px; height:44px; top:3%; right:8%; box-shadow: 0 0 0 6px rgba(255,209,102,0.25); }
  .c1{ width:60px; height:22px; }
  .c1::before{ width:34px; height:34px; }
  .c1::after{ width:24px; height:24px; }
  .c2{ width:46px; height:18px; }
  .c2::before{ width:26px; height:26px; }
  .c2::after{ width:18px; height:18px; }
  .c3{ display:none; }

  .house{ font-size:36px; left:12px; bottom:10px; }
  .tree{ font-size:42px; right:12px; bottom:6px; }

  .grid{
    grid-template-columns: repeat(auto-fill, minmax(96px, 1fr));
    gap: 10px;
    padding: 0 14px;
    margin: 14px auto 48px;
  }
  .card{ padding: 10px 6px 10px; border-radius: 18px; }
  .card .art{ width:52px; height:52px; }
  .card .emoji{ font-size:36px; }
  .card .name-id{ font-size:13px; }
  .card .name-en{ font-size:9px; }

  .bubble{
    font-size: 17px;
    padding: 10px 20px;
    bottom: 18px;
  }

  .celebrate-card{ padding: 30px 22px 24px; }
  .celebrate-emoji{ font-size:52px; }
  .celebrate-title{ font-size:21px; }
  .celebrate-text{ font-size:13.5px; }
  .celebrate-btn{ font-size:15px; padding:12px 24px; }
}

@media (max-width: 360px){
  .grid{ grid-template-columns: repeat(auto-fill, minmax(84px, 1fr)); gap:8px; }
  .card .art{ width:44px; height:44px; }
  .card .emoji{ font-size:30px; }
}
