@import url("https://fonts.googleapis.com/css2?family=Baloo+2:wght@500;600;700;800&family=Be+Vietnam+Pro:wght@400;500;600;700;800&display=swap");

:root {
  --ink: #2b1f16;
  --muted: #6b5344;
  --pink: #ff6b9d;
  --yellow: #ffd54a;
  --lime: #7ed957;
  --sky: #4fc3f7;
  --orange: #ff9f43;
  --card: #ffffff;
  --shadow: 0 12px 32px rgba(60, 30, 20, .10);
}
* { box-sizing: border-box; }
html, body { margin: 0; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body {
  font-family: "Be Vietnam Pro", "Segoe UI", sans-serif;
  color: var(--ink);
  background: #fff8f0;
  font-size: 17px;
  line-height: 1.55;
  overflow-x: hidden;
  min-height: 100%;
}
h1, h2, h3, h4, .brand-name, .tab, .btn, button {
  font-family: "Baloo 2", "Be Vietnam Pro", sans-serif;
}
h1 { font-size: clamp(2.2rem, 5vw, 3.4rem); line-height: 1.15; margin: 0 0 12px; }
h2 { font-size: clamp(1.8rem, 3vw, 2.4rem); margin: .2rem 0 .5rem; }
.section-title { text-align: center; font-size: 2rem; margin: 36px 0 18px; }

.top {
  position: sticky; top: 0; z-index: 10;
  background: #fff;
  display: flex; justify-content: space-between; align-items: center;
  padding: 10px 28px; gap: 12px;
  box-shadow: 0 4px 18px rgba(0,0,0,.06);
}
.top, .tabs, main { max-width: 1200px; margin-left: auto; margin-right: auto; }
.top { max-width: none; }
.brand { display: flex; gap: 12px; align-items: center; text-decoration: none; color: inherit; }
.logo-img { width: 56px; height: 56px; border-radius: 50%; }
.brand-name { display: block; font-size: 1.35rem; font-weight: 800; }
.brand small, .brand span:last-child { color: var(--muted); font-size: .9rem; }
.top-actions { display: flex; gap: 8px; flex-wrap: wrap; }

button, .btn {
  border: 0; border-radius: 999px; padding: 12px 20px;
  font-weight: 700; font-size: 1rem; cursor: pointer;
  background: #fff; color: var(--ink); box-shadow: var(--shadow);
  text-decoration: none; display: inline-block;
}
.ghost { background: #fff3cd; }
.subscribe { background: #ff4d6d; color: #fff; box-shadow: 0 8px 18px rgba(255,77,109,.35); }

.tabs {
  display: flex; gap: 8px; padding: 16px 24px 8px; flex-wrap: wrap; justify-content: center;
}
.tab { background: #fff; }
.tab.active { background: var(--sky); color: #083344; }
.timer-label { text-align: center; font-weight: 800; color: #c92a2a; }

main { padding: 8px 24px 64px; }
.panel, .game { display: none; }
.panel.active, .game.active { display: block; }
.muted { color: var(--muted); }

.banner {
  position: relative; overflow: hidden;
  border-radius: 36px; min-height: 300px;
  background:
    radial-gradient(circle at 15% 20%, #ffe066 0 18%, transparent 19%),
    radial-gradient(circle at 90% 10%, #ff9aa2 0 14%, transparent 15%),
    linear-gradient(120deg, #baf0c8, #fff3bf 42%, #a5d8ff);
  box-shadow: var(--shadow);
  display: grid; grid-template-columns: 200px 1fr; gap: 12px;
  align-items: center; padding: 28px 36px; margin-bottom: 28px;
}
.banner img { width: 180px; filter: drop-shadow(0 12px 16px rgba(0,0,0,.12)); }
.banner p { font-size: 1.15rem; max-width: 40rem; }

.hero { display: grid; grid-template-columns: 1.25fr .85fr; gap: 20px; }
.hero-text, .video-wrap, canvas, .color-stage, .animal-card, .parent-grid article, .profile, .game-shell {
  background: var(--card); border-radius: 28px; box-shadow: var(--shadow);
}
.hero-text, .parent-grid article, .profile { padding: 24px; }
.video-wrap { position: relative; padding-top: 56.25%; overflow: hidden; }
.video-wrap iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.watch-player { margin-top: 16px; max-width: 860px; }

.friends, .video-grid, .char-picks {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(168px, 1fr)); gap: 16px;
}
.friend, .vcard, .cpick {
  background: #fff; border-radius: 28px; padding: 12px 10px 16px; text-align: center;
  box-shadow: var(--shadow); cursor: pointer; border: 3px solid transparent;
}
.friend img, .cpick img { width: 100%; height: 190px; object-fit: contain; background: #fffaf3; border-radius: 20px; }
.friend h4, .vcard h4 { margin: 8px 0 0; font-size: 1.2rem; }
.cpick.active, .friend.active { border-color: var(--pink); }

.profile {
  display: grid; grid-template-columns: 260px 1fr; gap: 24px; margin-top: 20px;
  background: linear-gradient(180deg, #fff, #fff8ee);
}
.profile .avatar { width: 100%; height: auto; object-fit: contain; }
.profile h3 { font-size: 2.1rem; margin: 0 0 8px; }
.facts { display: grid; grid-template-columns: 1fr 1fr; gap: 8px 16px; padding: 0; }
.facts div { background: #fff4e6; border-radius: 16px; padding: 10px 12px; }
.facts b { display: block; font-size: .82rem; color: var(--muted); }

.toolbar, .subtabs, .stamps, .row-btns { display: flex; flex-wrap: wrap; gap: 8px; margin: 10px 0; align-items: center; }
.swatches { display: flex; flex-wrap: wrap; gap: 8px; }
.swatch { width: 36px; height: 36px; border-radius: 50%; border: 3px solid #fff; box-shadow: var(--shadow); cursor: pointer; }
.swatch.selected { outline: 3px solid #333; }
.color-stage { padding: 16px; max-width: 440px; background: #fff; }
.color-stage svg, #colorCanvas { width: 100%; height: auto; cursor: pointer; }
#drawCanvas { width: 100%; max-width: 900px; touch-action: none; background: #fff; border-radius: 18px; }

.game-shell { padding: 16px; }
.drop-row, .piece-row, .choices { display: flex; gap: 12px; flex-wrap: wrap; justify-content: center; margin: 12px 0; }
.drop {
  min-width: 130px; min-height: 110px; border: 4px dashed #fab005;
  border-radius: 20px; display: grid; place-items: center; font-weight: 800;
}
.drop.ok { border-style: solid; border-color: #40c057; background: #ebfbee; }
.shape-btn, .veg { width: 86px; height: 86px; border-radius: 20px; font-size: 42px; display: grid; place-items: center; box-shadow: var(--shadow); }
.animal-emoji { font-size: 96px; text-align: center; }
.animal-card { padding: 20px; max-width: 540px; margin: 0 auto; text-align: center; }
.status { font-weight: 800; font-size: 1.2rem; text-align: center; }
.parent-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); gap: 16px; }
.overlay { position: fixed; inset: 0; background: rgba(40,20,10,.45); display: grid; place-items: center; z-index: 20; padding: 16px; }
.hidden { display: none !important; }
.overlay-card { background: #fff; border-radius: 28px; padding: 24px; max-width: 440px; width: 100%; text-align: center; box-shadow: var(--shadow); }
.overlay-logo { width: 96px; }
.big { font-size: 2rem; font-weight: 700; margin: 8px 0; }
.plate { min-height: 120px; border: 6px dashed #ffd43b; border-radius: 50%; max-width: 280px; margin: 12px auto; display: flex; gap: 6px; justify-content: center; align-items: center; font-size: 40px; background: #fff; }
footer { text-align: center; padding: 12px 16px 40px; color: var(--muted); }
footer img { width: 52px; }
@media (max-width: 820px) {
  .banner, .hero, .profile, .facts { grid-template-columns: 1fr; }
  .top { flex-direction: column; align-items: flex-start; position: relative; }
  .banner { min-height: 0; padding: 20px; }
  .banner img { width: 96px; }
  main { padding: 8px 14px 48px; }
  .tabs { padding: 10px 12px; justify-content: flex-start; overflow-x: auto; flex-wrap: nowrap; -webkit-overflow-scrolling: touch; }
  .tab { flex: 0 0 auto; }
  .friend img, .cpick img { max-height: 150px; }
  iframe { max-width: 100%; }
}

.friend img, .cpick img, .profile .avatar {
  border-radius: 50%;
  background: #fff;
  object-fit: cover;
  aspect-ratio: 1;
  height: auto;
}
.friend img, .cpick img { height: auto; max-height: 200px; }

.alphabet {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(92px, 1fr));
  gap: 10px;
  margin: 16px 0 24px;
}
.letter-btn {
  aspect-ratio: 1;
  border-radius: 22px;
  font-size: clamp(1.6rem, 4vw, 2.1rem);
  font-weight: 800;
  line-height: 1.05;
  background: #fff;
  box-shadow: var(--shadow);
}
.letter-btn.active { outline: 4px solid #ff6b9d; transform: translateY(-2px); }
.letter-detail {
  background: #fff; border-radius: 28px; padding: 20px; box-shadow: var(--shadow);
  text-align: center;
}
.letter-pair {
  font-family: "Baloo 2", "Be Vietnam Pro", sans-serif;
  font-size: clamp(4rem, 12vw, 7rem);
  margin: 0;
  letter-spacing: .08em;
  color: #1c7ed6;
}
.word-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 12px;
  margin-top: 12px;
}
.word-card {
  background: #fff8ee; border-radius: 22px; padding: 16px 8px;
  box-shadow: var(--shadow); cursor: pointer;
}
.word-card .emo { font-size: 64px; line-height: 1.1; }
.word-card p { margin: 8px 0 0; font-weight: 800; font-size: 1.25rem; }
.letter-quiz {
  font-family: "Baloo 2", sans-serif;
  font-size: clamp(5rem, 16vw, 8rem);
  text-align: center;
  color: #e64980;
  background: #fff;
  border-radius: 28px;
  margin: 12px auto;
  max-width: 280px;
  box-shadow: var(--shadow);
}
.nav-toggle { display: none; }
.lyric { text-align: center; font-size: 1.25rem; font-weight: 700; }
#certCanvas { max-width: 100%; height: auto; background: #fff; border-radius: 16px; margin-top: 12px; }
.village { background: linear-gradient(180deg, #d8f3dc, #fff); border-radius: 28px; padding: 12px; }
@media (max-width: 820px) {
  .nav-toggle { display: none; }
  .tabs { display: flex; flex-wrap: wrap; }
}
