:root {
  --sky1: #bfe9ff;
  --sky2: #fff6d6;
  --grass: #6cc24a;
  --grass-dark: #4e9a33;
  --ink: #2d2a32;
  --muted: #6b6475;
  --card: #ffffff;
  --green: #2bb673;
  --green-d: #1f8f59;
  --orange: #ff8a3d;
  --orange-d: #e06a1c;
  --red: #ef5350;
  --radius: 22px;
  --shadow: 0 6px 0 rgba(0, 0, 0, .12), 0 10px 24px rgba(0, 0, 0, .08);
  --font: 'Hind Siliguri', 'Noto Sans Bengali', 'SolaimanLipi', 'Kalpurush', 'Nirmala UI', 'Vrinda', sans-serif;
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; height: 100%; }
body {
  font-family: var(--font);
  color: var(--ink);
  background: linear-gradient(180deg, var(--sky1) 0%, var(--sky2) 70%);
  overflow-x: hidden;
  min-height: 100dvh;
  user-select: none;
  -webkit-user-select: none;
}
[hidden] { display: none !important; }

/* Background decorations */
#sky { position: fixed; inset: 0; pointer-events: none; z-index: 0; }
.sun { position: absolute; top: 18px; right: 22px; width: 64px; height: 64px; border-radius: 50%;
  background: radial-gradient(circle, #ffe066 55%, #ffd43b 56%); box-shadow: 0 0 40px #ffe58a; }
.cloud { position: absolute; background: #fff; border-radius: 50px; opacity: .9; height: 28px; }
.cloud::before, .cloud::after { content: ''; position: absolute; background: #fff; border-radius: 50%; }
.cloud.c1 { width: 110px; top: 60px; left: -120px; animation: drift 40s linear infinite; }
.cloud.c2 { width: 80px; top: 130px; left: -90px; animation: drift 55s linear infinite 12s; }
.cloud::before { width: 46px; height: 46px; top: -22px; left: 16px; }
.cloud::after { width: 34px; height: 34px; top: -14px; left: 50px; }
@keyframes drift { to { transform: translateX(calc(100vw + 260px)); } }
#grass { position: fixed; left: 0; right: 0; bottom: 0; height: 56px; z-index: 0; pointer-events: none;
  background:
    radial-gradient(circle at 10px 0, transparent 12px, var(--grass) 13px) 0 0 / 22px 56px repeat-x;
  border-bottom: 18px solid var(--grass-dark); }

#app { position: relative; z-index: 1; max-width: 560px; margin: 0 auto; padding: 16px 16px 90px; }
.screen { animation: pop .25s ease-out; }
@keyframes pop { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

h1, h2 { text-align: center; margin: 8px 0 14px; }
h2 { font-size: 1.6rem; }
.logo { font-size: 2.6rem; margin-top: 28px; color: var(--green-d); text-shadow: 0 3px 0 #fff; }
.tagline, .hint { text-align: center; font-size: 1.25rem; color: var(--muted); margin: 0 0 16px; }

/* Buttons */
.btn { font-family: inherit; font-size: 1.2rem; font-weight: 700; border: 0; border-radius: var(--radius);
  padding: 14px 18px; background: #fff; color: var(--ink); box-shadow: var(--shadow); cursor: pointer;
  transition: transform .08s; touch-action: manipulation; }
.btn:active { transform: translateY(4px); box-shadow: 0 2px 0 rgba(0, 0, 0, .12); }
.btn-big { display: block; width: 100%; font-size: 1.45rem; padding: 18px; min-height: 64px; margin: 12px 0; }
.btn-green { background: var(--green); color: #fff; }
.btn-orange { background: var(--orange); color: #fff; }
.btn-round { width: 64px; height: 64px; border-radius: 50%; font-size: 1.8rem; padding: 0; }
.btn-back { font-family: inherit; font-size: 1.5rem; width: 52px; height: 52px; border: 0; border-radius: 50%;
  background: #fff; box-shadow: var(--shadow); cursor: pointer; flex: none; }
.btn-back:active { transform: translateY(3px); }

.topbar { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 10px; min-height: 52px; }
.topbar > div:last-child { min-width: 52px; text-align: right; }
.me { font-size: 1.3rem; font-weight: 700; flex: 1; text-align: center; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.flowers-total { font-size: 1.2rem; font-weight: 700; background: #fff; border-radius: 30px; padding: 6px 12px; box-shadow: var(--shadow); }

/* Profiles */
.profile-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 14px; margin-bottom: 8px; }
.profile { position: relative; background: #fff; border-radius: var(--radius); box-shadow: var(--shadow); padding: 16px 8px;
  text-align: center; cursor: pointer; border: 0; font-family: inherit; }
.profile .av { font-size: 3.2rem; display: block; }
.profile .nm { font-size: 1.25rem; font-weight: 700; display: block; margin-top: 4px; word-break: break-word; }
.profile .fl { font-size: 1rem; color: var(--muted); }
.profile .del { position: absolute; top: 6px; right: 6px; width: 30px; height: 30px; border-radius: 50%; border: 0;
  background: #f3eef7; color: var(--muted); font-size: .9rem; cursor: pointer; }

.name-input { display: block; width: 100%; font-family: inherit; font-size: 1.6rem; text-align: center; padding: 14px;
  border-radius: var(--radius); border: 4px solid #fff; box-shadow: var(--shadow); outline: none; margin-bottom: 18px; }
.name-input:focus { border-color: var(--green); }
.avatar-pick { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; margin-bottom: 8px; }
.avatar-pick button { font-size: 2.4rem; padding: 10px 0; border-radius: 18px; border: 4px solid transparent; background: #fff;
  box-shadow: var(--shadow); cursor: pointer; }
.avatar-pick button.sel { border-color: var(--green); background: #e7f8ee; }

/* Levels */
.level-list { display: grid; gap: 14px; }
.level { display: flex; align-items: center; gap: 14px; text-align: left; width: 100%; border: 0; font-family: inherit;
  background: #fff; border-radius: var(--radius); box-shadow: var(--shadow); padding: 16px; cursor: pointer; border-left: 12px solid var(--c); }
.level .lt { font-size: 2.6rem; width: 70px; height: 70px; border-radius: 18px; display: grid; place-items: center; background: var(--c); color: #fff; flex: none; }
.level .ti { font-size: 1.5rem; font-weight: 700; display: block; }
.level .su { color: var(--muted); font-size: 1.05rem; }
.bar { height: 12px; border-radius: 8px; background: #eee; margin-top: 8px; overflow: hidden; }
.bar > i { display: block; height: 100%; background: var(--c); border-radius: 8px; }

/* Garden bed in level menu */
.garden-bed { display: grid; grid-template-columns: repeat(auto-fill, minmax(62px, 1fr)); gap: 8px; background: #8d5a3b;
  border-radius: var(--radius); padding: 12px; box-shadow: inset 0 6px 0 rgba(0, 0, 0, .15), var(--shadow); margin-bottom: 8px; }
.plot { background: #a46b47; border-radius: 14px; text-align: center; padding: 4px 0 6px; color: #fff; }
.plot .pl { font-size: 1.7rem; display: block; line-height: 1.3; }
.plot .lt { font-size: 1.05rem; font-weight: 700; }
.level-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }

/* Cards */
.card { background: var(--card); border-radius: 28px; box-shadow: var(--shadow); padding: 20px; text-align: center; position: relative; }
.big-letter { font-size: 7rem; font-weight: 700; line-height: 1.1; color: var(--orange-d); }
.pic { font-size: 5.5rem; line-height: 1.2; min-height: 6.6rem; word-break: break-all; }
.pic.many { font-size: 2.6rem; }
.word { font-size: 2.4rem; font-weight: 700; margin: 6px 0 12px; }
/* The hidden letter stays in the text (transparent) so Bangla vowel signs still join to it. */
.word .blank { color: transparent; background: #ffe3cc; border-bottom: 5px dashed var(--orange); border-radius: 8px 8px 0 0; }
.word .filled { color: var(--green-d); background: #d9f5e4; border-radius: 8px; }
.learn-card .btn-round, .q-card .btn-round { position: absolute; right: 14px; top: 14px; }
.learn-nav { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.learn-strip { display: flex; flex-wrap: wrap; gap: 6px; justify-content: center; margin-top: 6px; }
.learn-strip button { font-family: inherit; font-size: 1.3rem; font-weight: 700; width: 48px; height: 48px; border: 0; border-radius: 12px;
  background: #fff; box-shadow: 0 3px 0 rgba(0, 0, 0, .12); cursor: pointer; }
.learn-strip button.cur { background: var(--orange); color: #fff; }

/* Play */
.pots { display: flex; gap: 2px; flex: 1; min-width: 0; justify-content: center; }
#screen-play .topbar > div:last-child { min-width: 0; }
.pot { flex: 1 1 0; max-width: 26px; min-width: 0; height: 34px; display: grid; place-items: end center; font-size: 1.15rem; position: relative; }
.pot::after { content: ''; position: absolute; bottom: 0; left: 2px; right: 2px; height: 12px; background: #c0703f; border-radius: 0 0 8px 8px; }
.pot span { position: relative; bottom: 9px; z-index: 1; animation: grow .5s ease-out; }
.pot.cur::after { background: var(--orange); box-shadow: 0 0 0 3px #fff; }
@keyframes grow { from { transform: scale(0) translateY(10px); } to { transform: scale(1); } }
.q-help { text-align: center; font-size: 1.25rem; font-weight: 700; color: var(--muted); margin: 14px 0 8px; }
.seeds { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.seed { font-family: inherit; font-size: 3.2rem; font-weight: 700; min-height: 96px; border: 0; border-radius: 50% 50% 46% 46% / 60% 60% 40% 40%;
  background: linear-gradient(180deg, #ffe9a8, #f5c26b); box-shadow: var(--shadow); cursor: pointer; color: #5a3a12; touch-action: manipulation; }
.seed:active { transform: translateY(4px); }
.seed.right { background: linear-gradient(180deg, #b8f0c9, #5ccf8a); color: #fff; animation: bounce .5s; }
.seed.wrong { background: #e9e4ea; color: #b0a8b5; animation: shake .4s; pointer-events: none; }
@keyframes shake { 20%, 60% { transform: translateX(-8px); } 40%, 80% { transform: translateX(8px); } }
@keyframes bounce { 40% { transform: scale(1.18); } 70% { transform: scale(.95); } }
.praise { text-align: center; font-size: 1.8rem; font-weight: 700; min-height: 2.6rem; margin-top: 12px; color: var(--green-d); }
.praise.oops { color: var(--orange-d); }

/* Result */
.stars { text-align: center; font-size: 3.6rem; letter-spacing: 6px; }
.stars .off { filter: grayscale(1); opacity: .3; }
.result-garden { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px; font-size: 2.2rem; margin: 12px 0; }
.result-garden span { animation: grow .5s ease-out both; }
.result-text { text-align: center; font-size: 1.3rem; color: var(--muted); }

.net-status { position: fixed; left: 50%; bottom: 12px; transform: translateX(-50%); z-index: 5; background: #2d2a32; color: #fff;
  padding: 8px 16px; border-radius: 30px; font-size: .95rem; }

.confetti { position: fixed; top: -20px; font-size: 1.6rem; z-index: 9; pointer-events: none; animation: fall 1.6s ease-in forwards; }
@keyframes fall { to { transform: translateY(105vh) rotate(540deg); opacity: .6; } }

@media (max-width: 380px) {
  .big-letter { font-size: 5.5rem; }
  .pic { font-size: 4.4rem; min-height: 5.4rem; }
  .seed { font-size: 2.6rem; min-height: 84px; }
  .word { font-size: 2rem; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
