/* DESIGN RULE (owner, 2026-12-04): ALL added colours must be PASTEL tones matching the logo CI.
   Pastel fill + dark same-hue text (keeps contrast readable). Strong brand red only for the logo word "grow". */
/* Nihongrow LIFF — mobile first. Big kana, big buttons, one thing per screen. System fonts only (fast). */
/* Prompt font (Cadson Demak, SIL OFL 1.1 — free for commercial use), self-hosted: fast, no third-party requests. */
@font-face{font-family:Prompt;font-style:normal;font-weight:400;font-display:swap;src:url(fonts/prompt-thai-400-normal.woff2) format('woff2');unicode-range:U+02D7,U+0303,U+0331,U+0E01-0E5B,U+200C-200D,U+25CC}
@font-face{font-family:Prompt;font-style:normal;font-weight:400;font-display:swap;src:url(fonts/prompt-latin-400-normal.woff2) format('woff2');unicode-range:U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+0304,U+0308,U+0329,U+2000-206F,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD}
@font-face{font-family:Prompt;font-style:normal;font-weight:600;font-display:swap;src:url(fonts/prompt-thai-600-normal.woff2) format('woff2');unicode-range:U+02D7,U+0303,U+0331,U+0E01-0E5B,U+200C-200D,U+25CC}
@font-face{font-family:Prompt;font-style:normal;font-weight:600;font-display:swap;src:url(fonts/prompt-latin-600-normal.woff2) format('woff2');unicode-range:U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+0304,U+0308,U+0329,U+2000-206F,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD}
@font-face{font-family:Prompt;font-style:normal;font-weight:700;font-display:swap;src:url(fonts/prompt-thai-700-normal.woff2) format('woff2');unicode-range:U+02D7,U+0303,U+0331,U+0E01-0E5B,U+200C-200D,U+25CC}
@font-face{font-family:Prompt;font-style:normal;font-weight:700;font-display:swap;src:url(fonts/prompt-latin-700-normal.woff2) format('woff2');unicode-range:U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+0304,U+0308,U+0329,U+2000-206F,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD}
:root {
  /* Nihongrow CI (from logo): charcoal "Nihon", sun red "grow", sakura pink, Fuji sky blue, white */
  --bg: #FFFFFF; --card: #FFFFFF; --ink: #35353B; --muted: #707078; --line: #ECE7EA;
  --brand: #F04A4C; --brand-dark: #A8323A; --brand-soft: #FFE9EA; --coral: #FFC4C5; --coral-press: #FFB0B2;
  --sakura: #F7A8B8; --sakura-soft: #FDEEF1; --sky: #2C6FA8; --sky-soft: #E3F0FB; --sky-fill: #CDE4F7;
  --green: #2F7D48; --green-soft: #DDF3E3; --green-line: #9AD7AE; --teal: var(--sky); --teal-soft: var(--sky-soft);
  --purple: #5E35B1; --orange: var(--brand); --orange-soft: var(--sakura-soft); --red: #B23A3C; --red-soft: #FFE3E3; --red-line: #F4A9AA;
  --radius: 22px; --shadow: 0 6px 18px rgba(53, 53, 59, .08);
  --tap: 64px; --font: Prompt, system-ui, -apple-system, "Segoe UI", "Noto Sans Thai", "Noto Sans JP", "Hiragino Sans", sans-serif;
  --jp: "Hiragino Sans", "Noto Sans JP", "Yu Gothic", "Noto Sans CJK JP", system-ui, sans-serif;
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; height: 100%; }
body {
  background: var(--bg); color: var(--ink); font-family: var(--font); font-size: 19px; line-height: 1.5;
  display: flex; flex-direction: column; min-height: 100dvh;
  padding: env(safe-area-inset-top) env(safe-area-inset-right) env(safe-area-inset-bottom) env(safe-area-inset-left);
  background-image: radial-gradient(circle at 94% 4%, var(--sakura-soft) 0 52px, transparent 53px), linear-gradient(180deg, transparent 78%, var(--sakura-soft) 90%, var(--sky-soft) 100%);
  background-attachment: fixed;
}
.top { display: flex; align-items: center; gap: 10px; padding: 12px 16px 4px; min-height: 56px; }
.logo { width: 40px; height: 40px; flex: none; }
.brand { font-weight: 700; font-size: 22px; flex: 1; letter-spacing: -.2px; }
.brand .b1 { color: var(--ink); } .brand .b2 { color: var(--brand); }
.streak { background: var(--orange-soft); color: var(--orange); border-radius: 999px; padding: 4px 12px; font-size: 17px; white-space: nowrap; }
.icon-btn { width: 44px; height: 44px; border: 0; border-radius: 14px; background: var(--card); box-shadow: var(--shadow);
  font-size: 30px; line-height: 1; color: var(--ink); cursor: pointer; }
main { flex: 1; display: flex; flex-direction: column; padding: 8px 16px 20px; max-width: 560px; width: 100%; margin: 0 auto; }
.screen { flex: 1; display: flex; flex-direction: column; gap: 14px; animation: in .18s ease-out; }
.screen.center { align-items: center; justify-content: center; text-align: center; }
@keyframes in { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
.spacer { flex: 1; }
.muted { color: var(--muted); }
.lead { font-size: 21px; font-weight: 600; margin: 0; }
h1 { font-size: 26px; margin: 4px 0 0; line-height: 1.3; }
h2 { font-size: 21px; margin: 0; }
.big-emoji { font-size: 72px; }

/* Cards */
.card { background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); padding: 18px; }
.hello { display: flex; flex-direction: column; gap: 6px; }
.bar { height: 14px; background: var(--line); border-radius: 999px; overflow: hidden; }
.bar > i { display: block; height: 100%; background: linear-gradient(90deg, #FAD0D9, #F7A8B8); border-radius: 999px; transition: width .4s; }
.stat-row { display: flex; justify-content: space-between; font-size: 17px; color: var(--muted); }

/* Buttons — thumb sized */
.btn { width: 100%; min-height: var(--tap); border: 0; border-radius: 18px; font: inherit; font-size: 21px; font-weight: 700;
  padding: 14px 18px; cursor: pointer; display: flex; align-items: center; justify-content: center; gap: 10px;
  transition: transform .06s; touch-action: manipulation; }
.btn:active { transform: scale(.98); }
.btn.primary { background: var(--coral); color: var(--brand-dark); box-shadow: 0 6px 14px rgba(240, 74, 76, .16); }
.btn.primary:active { background: var(--coral-press); }
.btn.teal { background: var(--sky-fill); color: var(--sky); }
.btn.soft { background: var(--card); color: var(--ink); box-shadow: var(--shadow); }
.btn.big { min-height: 84px; font-size: 23px; flex-direction: column; gap: 2px; }
.btn.big small { font-size: 16px; font-weight: 500; opacity: .9; }
.btn[disabled] { opacity: .55; }
.actions { display: flex; flex-direction: column; gap: 12px; margin-top: auto; }

/* Kana flash card */
.kana-card { background: var(--card); border-radius: 28px; box-shadow: var(--shadow); padding: 18px 12px 22px; text-align: center;
  display: flex; flex-direction: column; align-items: center; gap: 4px; border: 3px solid transparent; cursor: pointer; user-select: none; }
.kana-card:active { border-color: var(--sakura); }
.kana { font-family: var(--jp); font-size: clamp(132px, 46vw, 230px); line-height: 1.05; font-weight: 600; color: var(--ink); }
.romaji { font-size: 40px; font-weight: 700; color: #E06466; letter-spacing: .5px; }
.thai { font-size: 26px; color: var(--muted); }
.speak { margin-top: 6px; display: inline-flex; align-items: center; gap: 8px; background: var(--sky-soft); color: var(--sky);
  border-radius: 999px; padding: 8px 18px; font-size: 19px; font-weight: 700; }
.dots { display: flex; justify-content: center; gap: 8px; }
.dots i { width: 11px; height: 11px; border-radius: 50%; background: var(--line); }
.dots i.on { background: var(--sakura); }
.note { font-size: 15px; color: var(--muted); text-align: center; }

/* Question */
.qhead { display: flex; align-items: center; gap: 12px; }
.qhead .bar { flex: 1; }
.qhead b { font-size: 17px; color: var(--muted); min-width: 52px; text-align: right; }
.prompt { background: var(--card); border-radius: 28px; box-shadow: var(--shadow); text-align: center; padding: 12px 10px 18px; }
.prompt .kana { font-size: clamp(120px, 42vw, 210px); }
.prompt .ask { font-size: 20px; color: var(--muted); }
.prompt .romaji-big { font-size: clamp(64px, 22vw, 104px); font-weight: 700; color: #E06466; line-height: 1.15; }
.options { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.opt { min-height: 92px; border-radius: 20px; border: 3px solid var(--line); background: var(--card); font: inherit; cursor: pointer;
  font-size: 34px; font-weight: 700; color: var(--ink); box-shadow: var(--shadow); touch-action: manipulation; position: relative; }
.opt.jp { font-family: var(--jp); font-size: 52px; font-weight: 600; }
.opt.right { border-color: var(--green-line); background: var(--green-soft); color: var(--green); }
.opt.wrong { border-color: var(--red-line); background: var(--red-soft); color: var(--red); }
.opt.right::after { content: "✓"; position: absolute; top: 6px; right: 12px; font-size: 22px; color: var(--green); }
.opt.wrong::after { content: "✗"; position: absolute; top: 6px; right: 12px; font-size: 22px; color: var(--red); }
.feedback { border-radius: 18px; padding: 12px 16px; font-size: 20px; font-weight: 700; display: flex; flex-wrap: wrap; align-items: center; gap: 2px 10px; }
.feedback small { flex-basis: 100%; }
.feedback.ok { background: var(--green-soft); color: var(--green); }
.feedback.no { background: var(--red-soft); color: var(--red); }
.feedback small { display: block; font-weight: 500; font-size: 17px; color: var(--ink); }

/* Done + progress */
.done { text-align: center; }
.chips { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; }
.chip { background: var(--card); box-shadow: var(--shadow); border-radius: 16px; padding: 10px 14px; font-size: 18px; font-weight: 700; }
.grid-stats { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.tile { background: var(--card); border-radius: 18px; box-shadow: var(--shadow); padding: 14px; }
.tile b { display: block; font-size: 32px; line-height: 1.1; }
.tile span { color: var(--muted); font-size: 16px; }

.spinner { width: 46px; height: 46px; border-radius: 50%; border: 5px solid var(--sakura-soft); border-top-color: var(--sakura); animation: spin 0.9s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }


/* ---------- v1.3: vocabulary draw, lesson list, word cards (pastel) ---------- */
:root { --lav: #E9E0FB; --lav-ink: #5B3FA8; --lav-deep: #CDBDF3; --mint: #DDF3E3; --peach: #FFE7D6; }
.btn.gacha { background: linear-gradient(135deg, #EFE6FD, #FDE3EC); color: var(--lav-ink); box-shadow: 0 6px 14px rgba(91, 63, 168, .14); }
.btn.mini { width: auto; min-height: 44px; padding: 8px 14px; font-size: 17px; border-radius: 14px; background: var(--sky-fill); color: var(--sky); }
.btn.mini.primary { background: var(--coral); color: var(--brand-dark); box-shadow: none; }
.row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.pulse { animation: pulse 1.6s ease-in-out infinite; }
@keyframes pulse { 50% { transform: scale(1.03); box-shadow: 0 8px 22px rgba(91, 63, 168, .22); } }
.pop { animation: pop .5s cubic-bezier(.2, 1.6, .4, 1) both; }
@keyframes pop { from { transform: scale(.3) rotate(-15deg); opacity: 0; } }

/* lesson list */
.lesson-list { display: flex; flex-direction: column; gap: 10px; }
.lesson-row { display: flex; align-items: center; gap: 12px; background: var(--card); border-radius: 18px; box-shadow: var(--shadow); padding: 12px 14px; }
.lesson-row.locked { opacity: .55; box-shadow: none; background: #FAF8F9; }
.lesson-row.current { outline: 3px solid var(--coral); }
.lesson-num { width: 44px; height: 44px; flex: none; border-radius: 50%; display: grid; place-items: center; font-weight: 700; font-size: 19px;
  background: var(--sakura-soft); color: var(--brand-dark); }
.lesson-row.done .lesson-num { background: var(--green-soft); color: var(--green); }
.lesson-text { flex: 1; display: flex; flex-direction: column; min-width: 0; }
.lesson-text b { font-size: 18px; line-height: 1.3; }
.lesson-text span { font-size: 15px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.lock { font-size: 22px; }

/* gacha stage */
.gacha-stage { position: relative; height: 250px; border-radius: 28px; overflow: hidden;
  background: radial-gradient(circle at 50% 40%, #FFFFFF 0 30%, #F6EEFF 60%, #FDE8EF 100%); box-shadow: var(--shadow); }
.gacha-cards { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; }
.gcard { position: absolute; width: 92px; height: 128px; border-radius: 16px; transition: transform .5s cubic-bezier(.2, .9, .3, 1.2);
  transform: translateX(calc((var(--k) - 2) * 18px)) rotate(calc((var(--k) - 2) * 7deg)); animation: float 2.4s ease-in-out infinite;
  animation-delay: calc(var(--k) * -.4s); }
@keyframes float { 50% { margin-top: -10px; } }
.gcard-back, .gcard-front { position: absolute; inset: 0; border-radius: 16px; display: flex; flex-direction: column; align-items: center; justify-content: center;
  box-shadow: 0 6px 14px rgba(91, 63, 168, .18); }
.gcard-back { background: repeating-linear-gradient(45deg, #E9E0FB 0 10px, #F6F0FF 10px 20px); border: 3px solid #FFFFFF; color: var(--lav-ink);
  font-size: 46px; font-weight: 700; }
.spinning .gcard { animation: shuffle .45s ease-in-out infinite alternate; animation-delay: calc(var(--k) * -.09s); }
@keyframes shuffle {
  0% { transform: translateX(calc((var(--k) - 2) * 40px)) translateY(-18px) rotate(calc((var(--k) - 2) * -14deg)) scale(1.05); }
  100% { transform: translateX(calc((2 - var(--k)) * 40px)) translateY(14px) rotate(calc((var(--k) - 2) * 14deg)); }
}
.gcard.flip { position: relative; width: 17%; max-width: 92px; height: 120px; margin: 0 1.2%; transform: none; animation: deal .55s cubic-bezier(.2, 1.4, .4, 1) both;
  animation-delay: calc(var(--k) * .22s); }
@keyframes deal { from { transform: translateY(80px) rotateY(180deg) scale(.6); opacity: 0; } 60% { transform: translateY(-8px) rotateY(0) scale(1.06); opacity: 1; } }
.gcard-front { background: #FFFFFF; border: 3px solid var(--lav-deep); padding: 4px; text-align: center; }
.gcard-front b { font-family: var(--jp); font-size: 21px; font-weight: 600; line-height: 1.2; word-break: keep-all; }
.gcard-front span { font-size: 13px; color: var(--muted); line-height: 1.2; margin-top: 4px; }
.sparkles i { position: absolute; left: 50%; top: 50%; width: 10px; height: 10px; border-radius: 50%; opacity: 0;
  background: hsl(calc(300 + var(--k) * 15), 80%, 82%); }
.spinning .sparkles i, .revealed .sparkles i { animation: burst 1.1s ease-out infinite; animation-delay: calc(var(--k) * .12s); }
.revealed .sparkles i { animation-iteration-count: 1; }
@keyframes burst { 0% { opacity: 1; transform: translate(-50%, -50%) scale(.4); }
  100% { opacity: 0; transform: translate(calc(cos(calc(var(--k) * 45deg)) * 140px), calc(sin(calc(var(--k) * 45deg)) * 110px)) scale(1.2); } }

/* word list + word card */
.word-list { display: flex; flex-direction: column; gap: 10px; }
.word-row { display: grid; grid-template-columns: auto auto 1fr auto; align-items: baseline; gap: 10px; width: 100%; text-align: left; font: inherit;
  background: var(--card); border: 0; border-radius: 18px; box-shadow: var(--shadow); padding: 14px 16px; cursor: pointer; }
.word-row b { font-family: var(--jp); font-size: 30px; font-weight: 600; }
.word-row span { font-size: 19px; }
.word-row i { font-style: normal; font-size: 20px; }
.word-card { gap: 2px; }
.kanji { font-family: var(--jp); font-size: 22px; color: var(--muted); }
.word { font-family: var(--jp); font-size: clamp(64px, 22vw, 108px); font-weight: 600; line-height: 1.15; color: var(--ink); }
.word.long { font-size: clamp(52px, 16vw, 84px); }
.meaning { font-size: 30px; font-weight: 700; color: var(--brand-dark); }
.meaning-big { font-size: clamp(36px, 11vw, 52px); font-weight: 700; color: var(--brand-dark); line-height: 1.25; padding: 18px 6px 6px; }
.example { background: linear-gradient(135deg, #F6F0FF, #FDEEF1); border-radius: 22px; padding: 14px 16px; cursor: pointer; }
.ex-label { font-size: 15px; color: var(--lav-ink); font-weight: 600; }
.ex-ja { font-family: var(--jp); font-size: 26px; line-height: 1.5; margin-top: 4px; }
.ex-romaji { font-size: 16px; color: var(--muted); }
.ex-th { font-size: 20px; margin-top: 2px; }

/* vocabulary options */
.options.one-col { grid-template-columns: 1fr; }
.opt.vocab { font-size: 24px; min-height: 64px; }
.opt.vocab.jp { font-size: 36px; min-height: 84px; }


/* ---------- v1.3.1: navigation + layout fixes (owner feedback) ---------- */
.home-btn { font-size: 22px; }
.actions.sticky { position: sticky; bottom: 0; z-index: 5; margin-top: auto; padding: 14px 0 calc(8px + env(safe-area-inset-bottom));
  background: linear-gradient(to bottom, rgba(255, 255, 255, 0), #FFFFFF 26%); }
.hint { margin: 0; font-size: 15px; color: var(--muted); text-align: center; }
.credit { margin: 4px 0 0; font-size: 11px; color: #A9A9B0; text-align: center; letter-spacing: .2px; }
.btn.ghost { background: transparent; color: var(--muted); box-shadow: none; min-height: 52px; font-size: 18px; font-weight: 600; }
.banner { background: var(--sakura-soft); color: var(--brand-dark); border-radius: 16px; padding: 10px 14px; font-size: 17px; font-weight: 600; }
.courses { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.course { display: flex; flex-direction: column; align-items: flex-start; gap: 4px; text-align: left; font: inherit; cursor: pointer;
  background: var(--card); border: 3px solid transparent; border-radius: 20px; box-shadow: var(--shadow); padding: 12px 14px; color: var(--ink); }
.course.on { border-color: var(--coral); background: #FFF8F8; }
.course-icon { font-family: var(--jp); font-size: 30px; line-height: 1; }
.course b { font-size: 19px; }
.course-sub { font-size: 15px; color: var(--muted); }
.course .bar { width: 100%; height: 10px; margin-top: 4px; }
.vocab-panel { display: flex; flex-direction: column; gap: 12px; }
.vocab-panel p { margin: 0; }
.lesson-list { gap: 8px; }
.lesson-row { padding: 9px 12px; }
.lesson-num { width: 38px; height: 38px; font-size: 17px; }
.lesson-text b { font-size: 17px; }
/* tighter word card so "ถัดไป" fits on a phone screen */
.word-card { padding: 12px 10px 14px; }
.word { font-size: clamp(56px, 18vw, 92px); }
.word.long { font-size: clamp(46px, 14vw, 72px); }
.meaning { font-size: 26px; }
.example { padding: 10px 14px; }
.ex-ja { font-size: 22px; }
.ex-th { font-size: 18px; }
.kana { font-size: clamp(120px, 40vw, 200px); }
@media (prefers-reduced-motion: reduce) { * { animation: none !important; transition: none !important; } .gcard.flip { opacity: 1; } }
