/* සිරිත් මල්දම — styles */
:root {
  --bg: #fff8ec;
  --bg2: #ffefd2;
  --card: #ffffff;
  --ink: #2f2118;
  --ink2: #6b5a4b;
  --line: #f1dfc1;
  --brand: #f59e0b;
  --brand-d: #b45309;
  --yes: #16a34a;
  --no: #dc2626;
  --c: #f59e0b;
  --r: 22px;
  --shadow: 0 10px 28px -14px rgba(120, 60, 10, .35);
  --font: 'Noto Sans Sinhala', 'Baloo 2', 'Iskoola Pota', 'Nirmala UI', system-ui, sans-serif;
  --serif: 'Noto Serif Sinhala', 'Noto Sans Sinhala', 'Iskoola Pota', serif;
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  margin: 0; min-height: 100vh; display: flex; flex-direction: column;
  font-family: var(--font); color: var(--ink); line-height: 1.7;
  background: var(--bg);
  background-image: radial-gradient(circle at 12% 0%, #fff1cf 0, transparent 38%), radial-gradient(circle at 95% 12%, #ffe3ec 0, transparent 30%), radial-gradient(circle at 60% 100%, #e3f6e6 0, transparent 40%);
  background-attachment: fixed;
}
h1, h2, h3, p { margin: 0; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; cursor: pointer; }
:focus-visible { outline: 3px solid #2563eb; outline-offset: 3px; border-radius: 8px; }
.skip { position: absolute; left: -999px; top: 8px; background: #fff; padding: 8px 14px; border-radius: 10px; z-index: 99; }
.skip:focus { left: 8px; }
#app { flex: 1; width: 100%; max-width: 1180px; margin: 0 auto; padding: 18px 16px 40px; outline: none; }

/* ---------- header ---------- */
.top { position: sticky; top: 0; z-index: 30; background: rgba(255, 252, 245, .94); backdrop-filter: blur(10px); border-bottom: 3px solid var(--line); }
.top-in { max-width: 1180px; margin: 0 auto; padding: 8px 16px; display: flex; align-items: center; gap: 12px; }
.brand { display: flex; align-items: center; gap: 10px; flex: none; }
.brand-mark { width: 46px; height: 46px; display: grid; place-items: center; font-size: 26px; border-radius: 16px; background: linear-gradient(135deg, #fde68a, #fdba74); box-shadow: inset 0 -3px 0 rgba(0, 0, 0, .08); }
.brand-text b { display: block; font-size: 1.2rem; font-weight: 900; line-height: 1.25; color: #7c2d12; }
.brand-text small { display: block; font-size: .74rem; color: var(--ink2); font-weight: 700; line-height: 1.2; }
.nav { display: flex; gap: 6px; margin: 0 auto; }
.nav a { display: flex; align-items: center; gap: 6px; padding: 8px 14px; border-radius: 999px; font-weight: 800; font-size: .95rem; color: #7c2d12; border: 2px solid transparent; transition: background .15s, transform .15s; }
.nav a:hover { background: #ffedc9; transform: translateY(-1px); }
.nav a.active { background: var(--brand); color: #fff; box-shadow: 0 4px 0 var(--brand-d); }
.top-tools { display: flex; align-items: center; gap: 8px; flex: none; }
.pill { padding: 6px 12px; border-radius: 999px; background: #fff; border: 2px solid #fbcfe8; font-weight: 800; font-size: .9rem; color: #9d174d; white-space: nowrap; }
.icon-btn { width: 42px; height: 42px; border-radius: 14px; border: 2px solid var(--line); background: #fff; font-size: 1.15rem; }
.icon-btn:hover { background: #ffedc9; }

.brand-logo { width: 50px; height: 50px; flex: none; border-radius: 50%; object-fit: cover; border: 3px solid #e7c873; box-shadow: 0 3px 8px rgba(60, 40, 0, .3); background: #1d2b1c; }
.school { display: flex; align-items: center; gap: 12px; margin-bottom: 12px; }
.school img { width: 56px; height: 56px; border-radius: 50%; object-fit: cover; border: 3px solid #e7c873; box-shadow: 0 3px 8px rgba(60, 40, 0, .3); }
.school b { display: block; font-family: 'Baloo 2', var(--font); font-weight: 800; color: #5b4300; line-height: 1.25; font-size: 1.05rem; }
.school small { display: block; color: var(--ink2); font-weight: 700; line-height: 1.4; }
.foot-school { display: inline-flex; align-items: center; gap: 12px; text-align: left; margin-bottom: 10px; }
.foot-school img { width: 64px; height: 64px; border-radius: 50%; object-fit: cover; border: 3px solid #e7c873; }
.foot-school b { display: block; font-family: 'Baloo 2', var(--font); color: #5b4300; font-size: 1.05rem; line-height: 1.3; }
.foot-school span { font-size: .85rem; font-weight: 700; }

/* ---------- buttons, chips ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 11px 20px; border-radius: 999px; border: 0; background: var(--brand); color: #fff; font-weight: 900; font-size: 1rem; line-height: 1.3; box-shadow: 0 5px 0 var(--brand-d); transition: transform .12s, box-shadow .12s, filter .12s; text-align: center; }
.btn:hover { filter: brightness(1.05); transform: translateY(-1px); }
.btn:active { transform: translateY(4px); box-shadow: 0 1px 0 var(--brand-d); }
.btn.big { padding: 15px 28px; font-size: 1.2rem; }
.btn.small { padding: 7px 14px; font-size: .88rem; box-shadow: none; }
.btn.ghost { background: #fff; color: #7c2d12; border: 2px solid #f6d59a; box-shadow: 0 4px 0 #f6d59a; }
.btn.ghost.small { box-shadow: none; }
.btn.danger { color: #991b1b; border-color: #fecaca; margin-top: 12px; }
.btn.off { opacity: .35; pointer-events: none; }
.chip { display: inline-flex; align-items: center; gap: 6px; padding: 6px 14px; border-radius: 999px; border: 2px solid color-mix(in srgb, var(--c) 45%, #fff); background: color-mix(in srgb, var(--c) 12%, #fff); color: color-mix(in srgb, var(--c) 60%, #1b1208); font-weight: 800; font-size: .9rem; line-height: 1.4; white-space: nowrap; }
a.chip:hover, button.chip:hover { background: color-mix(in srgb, var(--c) 24%, #fff); }
.chip.solid, .chip.active { background: var(--c); border-color: var(--c); color: #fff; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chips.scroll { flex-wrap: nowrap; overflow-x: auto; padding: 4px 2px 10px; margin: 0 -2px; scrollbar-width: thin; }

.pill-part { background: #fef3c7; color: #92400e; border-radius: 999px; padding: 1px 8px; margin-right: 4px; font-size: .78rem; }
.parts { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin-bottom: 16px; }
.part-tab { display: flex; align-items: center; gap: 12px; padding: 10px 18px; border-radius: 20px; background: #fff; border: 3px solid var(--line); transition: transform .15s, border-color .15s; }
.part-tab:hover { transform: translateY(-2px); border-color: #f6d59a; }
.part-tab.on { border-color: var(--brand); background: linear-gradient(135deg, #fff7e0, #ffedc4); box-shadow: 0 5px 0 #f1c878; }
.part-ico { font-size: 2rem; line-height: 1; }
.part-tab b { display: block; white-space: nowrap; font-weight: 900; font-size: 1.15rem; color: #7c2d12; line-height: 1.3; }
.part-tab small { display: block; font-weight: 800; color: #9d174d; line-height: 1.3; }

/* ---------- hero ---------- */
.hero { display: grid; grid-template-columns: 1fr 1.05fr; gap: 28px; align-items: center; padding: 26px; border-radius: 32px; background: linear-gradient(135deg, #fff, #fff4dc); border: 3px solid var(--line); box-shadow: var(--shadow); }
.eyebrow { display: inline-block; padding: 4px 14px; border-radius: 999px; background: #dcfce7; color: #166534; font-weight: 800; font-size: .85rem; margin-bottom: 8px; }
.hero h1 { font-family: var(--serif); font-size: clamp(2.4rem, 6vw, 4rem); font-weight: 800; line-height: 1.3; color: #7c2d12; text-wrap: balance; }
.lead { font-size: 1.12rem; color: var(--ink2); margin: 10px 0 20px; font-weight: 600; }
.lead b { color: #be185d; }
.hero-cta { display: flex; flex-wrap: wrap; gap: 12px; margin-bottom: 20px; }
.hero-cta.center { justify-content: center; }
.hero-art { display: block; border-radius: 24px; overflow: hidden; border: 5px solid #fff; box-shadow: 0 16px 34px -16px rgba(120, 60, 10, .5); transform: rotate(1.2deg); transition: transform .25s; }
.hero-art:hover { transform: rotate(0) scale(1.01); }
.meter { display: flex; align-items: center; gap: 12px; font-weight: 800; color: #9d174d; }
.meter-bar { flex: 1; height: 14px; border-radius: 999px; background: #fde7c3; overflow: hidden; box-shadow: inset 0 2px 3px rgba(0, 0, 0, .08); }
.meter-bar i { display: block; height: 100%; border-radius: 999px; background: linear-gradient(90deg, #f472b6, #fb923c, #facc15); transition: width .5s; }

.how { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin: 22px 0 6px; }
.how-card { background: #fff; border: 3px solid var(--line); border-radius: var(--r); padding: 16px; text-align: center; }
.how-card span { font-size: 2.2rem; display: block; line-height: 1.2; }
.how-card b { display: block; font-size: 1.08rem; font-weight: 900; color: #7c2d12; }
.how-card p { font-size: .9rem; color: var(--ink2); line-height: 1.5; }

.block { margin-top: 30px; }
.block.first { margin-top: 6px; }
.block-head { margin-bottom: 14px; }
.block-head h1, .block-head h2 { font-size: clamp(1.5rem, 3.4vw, 2rem); font-weight: 900; color: #7c2d12; line-height: 1.4; }
.block-head p { color: var(--ink2); font-weight: 600; }
.sec { font-size: 1.3rem; font-weight: 900; color: #7c2d12; margin: 28px 0 12px; }

/* ---------- garland ---------- */
.lvl { background: #fff; border: 3px solid color-mix(in srgb, var(--c) 35%, #fff); border-radius: var(--r); padding: 14px 16px 16px; margin-bottom: 14px; }
.lvl-head { display: flex; align-items: center; gap: 12px; margin-bottom: 8px; }
.lvl-ico { width: 48px; height: 48px; flex: none; display: grid; place-items: center; font-size: 1.6rem; border-radius: 16px; background: color-mix(in srgb, var(--c) 18%, #fff); }
.lvl-head h3 { font-size: 1.1rem; font-weight: 900; line-height: 1.35; color: color-mix(in srgb, var(--c) 65%, #1b1208); }
.lvl-head p { font-size: .88rem; color: var(--ink2); line-height: 1.4; }
.lvl-count { margin-left: auto; flex: none; font-weight: 900; padding: 4px 12px; border-radius: 999px; background: color-mix(in srgb, var(--c) 14%, #fff); color: color-mix(in srgb, var(--c) 65%, #1b1208); }
.vine { display: flex; flex-wrap: wrap; gap: 6px 4px; padding: 6px 2px 0; background: repeating-linear-gradient(90deg, #86c46a 0 10px, transparent 10px 16px) 0 38px / 100% 3px repeat-x; background-size: 16px 3px; background-position: 0 40px; background-repeat: repeat-x; }
.bloom { position: relative; width: 64px; height: 64px; display: grid; place-items: center; border-radius: 50%; transition: transform .18s; }
.bloom svg { position: absolute; inset: 0; width: 100%; height: 100%; }
.bloom b { position: relative; font-family: 'Baloo 2', var(--font); font-weight: 800; font-size: 1rem; color: #a08a6c; }
.bloom.on b { color: #7c2d12; }
.bloom:hover { transform: scale(1.14) rotate(8deg); z-index: 2; }
.bloom.on svg { filter: drop-shadow(0 3px 4px rgba(0, 0, 0, .18)); }

/* ---------- poem page ---------- */
.poem-top { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; margin-bottom: 10px; }
.crumbs { display: flex; flex-wrap: wrap; gap: 8px; }
.poem-head { display: flex; align-items: center; gap: 16px; margin-bottom: 16px; }
.num { flex: none; width: 74px; height: 74px; display: grid; place-items: center; border-radius: 24px; background: var(--c); color: #fff; font-family: 'Baloo 2', var(--font); font-weight: 800; font-size: 2.2rem; line-height: 1; box-shadow: 0 6px 0 color-mix(in srgb, var(--c) 70%, #000); transform: rotate(-4deg); }
.poem-head h1 { font-size: clamp(1.6rem, 4.4vw, 2.6rem); font-weight: 900; line-height: 1.35; color: #4a2410; text-wrap: balance; }
.poem-head .sub { color: var(--ink2); font-weight: 700; font-family: 'Baloo 2', var(--font); font-size: 1.05rem; line-height: 1.3; }
.poem-icon { margin-left: auto; font-size: 2.6rem; line-height: 1; }
.poem-grid { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); gap: 22px; align-items: start; }
.scene-card { margin: 0; background: #fff; border-radius: 28px; padding: 10px; border: 3px solid var(--line); box-shadow: var(--shadow); position: sticky; top: 84px; }
.scene-card figcaption { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; padding: 10px 4px 4px; }
.lg { padding: 3px 12px; border-radius: 999px; font-weight: 900; font-size: .88rem; }
.lg.no { background: #fee2e2; color: #991b1b; border: 2px dashed #f87171; }
.lg.yes { background: #dcfce7; color: #166534; border: 2px solid #4ade80; }
.lg.step { background: #fef3c7; color: #92400e; border: 2px solid #fbbf24; }
.poem-side { display: grid; gap: 14px; }
.card { background: var(--card); border: 3px solid var(--line); border-radius: var(--r); padding: 16px 18px 18px; position: relative; }
.card-tag { display: inline-block; font-weight: 900; font-size: .85rem; padding: 2px 12px; border-radius: 999px; background: #fef3c7; color: #92400e; margin-bottom: 8px; }
.verse-card { background: linear-gradient(180deg, #fffdf6, #fff6e0); border-color: #f6d59a; }
.verse { font-family: var(--serif); font-weight: 700; font-size: clamp(1.25rem, 2.6vw, 1.6rem); line-height: 2; color: #3a1d0c; padding-right: 8px; }
.verse .line { display: block; animation: rise .5s both; }
.verse .line:nth-child(odd) { color: #7c2d12; }
.listen { position: absolute; right: 14px; top: 12px; padding: 7px 14px; font-size: .9rem; background: #0ea5e9; box-shadow: 0 4px 0 #0369a1; }
.listen.on { background: #0369a1; animation: pulse 1s infinite; }
.meaning-card { border-color: #bfe3ff; background: #f4faff; }
.meaning-card .card-tag { background: #dbeafe; color: #1e40af; }
.meaning-card p { font-size: 1.08rem; font-weight: 600; }
.promise-card { border-color: #bbf7d0; background: #f3fdf5; text-align: center; }
.promise-card .card-tag { background: #dcfce7; color: #166534; }
.promise { font-size: 1.22rem; font-weight: 900; color: #14532d; margin-bottom: 12px; line-height: 1.6; text-wrap: balance; }
.learn { background: #22c55e; box-shadow: 0 5px 0 #15803d; }
.promise-card.on { background: #fff0f7; border-color: #f9a8d4; }
.promise-card.on .learn { background: #ec4899; box-shadow: 0 5px 0 #9d174d; }
.more { background: #fff; border: 2px solid var(--line); border-radius: 18px; padding: 0 16px; }
.more summary { cursor: pointer; font-weight: 800; padding: 12px 0; color: #7c2d12; }
.more p { padding-bottom: 12px; color: var(--ink2); font-size: .98rem; }
.more p.ask { color: #1e40af; }
.pager { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 22px; }
.nav-btn { flex: none; min-width: 120px; }
.nav-btn.next { background: #22c55e; box-shadow: 0 5px 0 #15803d; }
.dots { display: flex; flex-wrap: wrap; gap: 7px; justify-content: center; }
.dot { width: 15px; height: 15px; border-radius: 50%; background: #f1e1c4; border: 2px solid #e2cba0; }
.dot.on { background: #f472b6; border-color: #db2777; }
.dot.now { outline: 3px solid var(--c); outline-offset: 2px; }

/* favourites (pairs with assets/js/favourites.js) */
.fav-btn { display: inline-grid; place-items: center; grid-auto-flow: column; gap: 8px; width: 52px; height: 52px; flex: none; padding: 0; border-radius: 50%; border: 3px solid #fecdd3; background: #fff; color: #e11d48; transition: transform .15s, background .15s, border-color .15s; }
.fav-btn svg { width: 26px; height: 26px; fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linejoin: round; }
.fav-btn:hover { transform: scale(1.08); border-color: #fb7185; }
.fav-btn.on { background: #ffe4e6; border-color: #fb7185; }
.fav-btn.on svg { fill: currentColor; }
.fav-btn.pulse svg { animation: favPop .45s cubic-bezier(.2, 1.7, .4, 1); }
.fav-btn.with-label { width: auto; border-radius: 999px; padding: 0 18px 0 14px; font-weight: 900; font-size: .95rem; }
.fav-btn.small { width: 40px; height: 40px; border-width: 2px; box-shadow: 0 3px 8px rgba(0, 0, 0, .18); }
.fav-btn.small svg { width: 20px; height: 20px; }
.poem-head .fav-btn { margin-left: auto; }
.tile-wrap { position: relative; display: flex; }
.tile-wrap > .tile { flex: 1; min-width: 0; }
.tile-wrap > .fav-btn { position: absolute; top: 10px; right: 10px; z-index: 2; }
.tile-wrap .tile-done { right: 58px; }
.fav-pill { border-color: #fecdd3; color: #be123c; }
.fav-pill.has { background: #fff1f2; }
.fav-pill.active { background: #e11d48; border-color: #e11d48; color: #fff; }
.fav-empty { text-align: center; background: #fff; border: 3px dashed #fecdd3; border-radius: 28px; padding: 36px 20px; display: grid; gap: 8px; justify-items: center; }
.fav-empty span { font-size: 3.4rem; line-height: 1; }
.fav-empty b { font-size: 1.25rem; font-weight: 900; color: #7c2d12; }
.fav-empty p { color: var(--ink2); font-weight: 600; margin-bottom: 8px; }
.fav-total { font-weight: 800; color: #be123c; }
.fav-icon { display: grid; place-items: center; height: 100%; font-size: 4rem; }
.sec small { font-weight: 800; color: var(--ink2); font-size: .9rem; }
@keyframes favPop { 0% { transform: scale(.4); } 100% { transform: scale(1); } }

/* tests */
.lvl-head .test-btn { flex: none; }
.lvl-count { margin-left: auto; }
.test-btn { display: inline-flex; align-items: center; gap: 6px; padding: 6px 14px; border-radius: 999px; font-weight: 900; font-size: .9rem; background: var(--c); color: #fff; box-shadow: 0 4px 0 color-mix(in srgb, var(--c) 65%, #000); white-space: nowrap; }
.test-btn small { background: rgba(255, 255, 255, .28); padding: 0 8px; border-radius: 999px; font-family: 'Baloo 2', var(--font); }
.test-btn.locked { background: #efe6d5; color: #8a7a62; box-shadow: none; }
.test-btn.won { background: linear-gradient(135deg, #fbbf24, #f59e0b); box-shadow: 0 4px 0 #b45309; }
.final-card { display: flex; align-items: center; gap: 16px; padding: 18px 22px; border-radius: var(--r); background: linear-gradient(135deg, #fff7e0, #ffe9b8); border: 3px solid #fbbf24; box-shadow: 0 6px 0 #f1c878; }
.final-card.locked { background: #faf5ea; border-color: var(--line); box-shadow: none; }
.final-card.won { background: linear-gradient(135deg, #fef3c7, #fde68a); }
.final-ico { font-size: 2.6rem; line-height: 1; }
.final-card b { display: block; font-weight: 900; font-size: 1.2rem; color: #7c2d12; line-height: 1.4; }
.final-card small { display: block; font-weight: 700; color: var(--ink2); }
.exam-intro, .exam-end { text-align: center; background: #fff; border: 3px solid var(--line); border-radius: 30px; padding: 26px 20px 32px; box-shadow: var(--shadow); max-width: 720px; margin-left: auto; margin-right: auto; }
.exam-intro h1, .exam-end h1 { font-size: clamp(1.7rem, 5vw, 2.5rem); font-weight: 900; color: #7c2d12; line-height: 1.4; }
.exam-sub, .exam-say { font-weight: 700; color: var(--ink2); margin-bottom: 14px; }
.exam-rules { list-style: none; margin: 0 0 16px; padding: 0; display: grid; gap: 8px; text-align: left; }
.exam-rules li { display: grid; grid-template-columns: 58px 1fr; gap: 12px; align-items: center; padding: 8px 14px; border-radius: 16px; background: #fffaf0; border: 2px solid var(--line); font-weight: 700; }
.exam-rules b { font-family: 'Baloo 2', var(--font); font-size: 1.4rem; text-align: center; color: #7c2d12; }
.exam-rules li.ok { background: #f0fdf4; border-color: #bbf7d0; } .exam-rules li.ok b { color: #15803d; }
.exam-rules li.no { background: #fef2f2; border-color: #fecaca; } .exam-rules li.no b { color: #b91c1c; }
.exam-rules li.win { background: #fffbeb; border-color: #fde68a; }
.exam-status { font-weight: 700; color: var(--ink2); margin-bottom: 14px; }
.review { text-align: left; background: #eff6ff; border: 3px solid #bfdbfe; border-radius: 22px; padding: 16px 18px; margin: 0 0 16px; display: grid; gap: 8px; }
.review h2 { font-size: 1.15rem; font-weight: 900; color: #1e40af; }
.review p { font-weight: 600; color: var(--ink2); }
.review .btn { justify-self: start; }
.review-link { display: flex; gap: 10px; align-items: baseline; padding: 10px 14px; border-radius: 14px; background: #fff; border: 2px solid #bfdbfe; font-weight: 800; }
.review-link:hover { border-color: #2563eb; }
.review-link b { font-family: 'Baloo 2', var(--font); color: #2563eb; }
.exam-score { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin: 0 0 18px; }
.exam-score div { border-radius: 18px; padding: 10px; background: #fffaf0; border: 3px solid var(--line); }
.exam-score b { display: block; font-family: 'Baloo 2', var(--font); font-size: 2.2rem; line-height: 1.1; color: #7c2d12; }
.exam-score small { font-weight: 800; color: var(--ink2); }
.exam-score .ok { background: #f0fdf4; border-color: #bbf7d0; } .exam-score .ok b { color: #15803d; }
.exam-score .no { background: #fef2f2; border-color: #fecaca; } .exam-score .no b { color: #b91c1c; }
.exam-end.win { border-color: #fbbf24; background: linear-gradient(180deg, #fffdf3, #fff3c4); }
.exam-bar { display: flex; align-items: center; gap: 12px; font-weight: 900; color: #7c2d12; margin-bottom: 12px; flex-wrap: wrap; }
.exam-bar .meter-bar { min-width: 80px; }
.exam-pts, .exam-bad { padding: 4px 14px; border-radius: 999px; font-family: 'Baloo 2', var(--font); font-size: 1.1rem; }
.exam-pts { background: #fef3c7; border: 2px solid #fbbf24; }
.exam-bad { background: #f0fdf4; border: 2px solid #bbf7d0; color: #15803d; }
.exam-bad.some { background: #fef2f2; border-color: #fecaca; color: #b91c1c; }
.exam-ask { font-size: clamp(1.25rem, 3.4vw, 1.8rem); font-weight: 900; color: #4a2410; line-height: 1.5; margin-bottom: 12px; text-wrap: balance; }
.exam-head { font-weight: 900; font-size: 1.15rem; color: var(--c); margin-bottom: 8px; }
.exam-head.big { font-size: clamp(1.4rem, 4vw, 2rem); text-align: center; color: #7c2d12; background: #fff; border: 3px solid var(--line); border-radius: 22px; padding: 14px; }
.exam-body { display: grid; gap: 16px; }
.exam-body.kind-name, .exam-body.kind-verse { grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); align-items: start; }
.exam-pic { position: static; }
.exam-pic.tall { max-width: 340px; justify-self: center; width: 100%; }
.exam-pic svg *, .exam-opt svg * { animation: none !important; }
.exam-verse .verse .gap { color: #b45309; letter-spacing: .2em; }
.exam-opts { display: grid; gap: 10px; opacity: .45; transition: opacity .3s; }
.exam-opts.ready { opacity: 1; }
.exam-opts.kind-pick, .exam-opts.kind-judge { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.exam-opts.kind-judge { max-width: 760px; margin: 0 auto; width: 100%; }
.exam-opts.kind-judge.tall { max-width: 560px; }
.exam-opt { display: flex; align-items: center; gap: 12px; text-align: left; padding: 12px 16px; border-radius: 18px; border: 3px solid var(--line); background: #fff; font-weight: 800; font-size: 1.05rem; line-height: 1.5; color: var(--ink); transition: transform .12s, border-color .12s; }
.exam-opt:hover:not(:disabled) { border-color: var(--brand); transform: translateY(-2px); }
.exam-opt:disabled { cursor: default; }
.exam-opt.yn { justify-content: center; font-size: 1.5rem; padding: 22px 12px; }
.exam-opt.pic { position: relative; padding: 6px; display: block; }
.exam-opt.pic .opt-k { position: absolute; top: 10px; left: 10px; z-index: 1; box-shadow: 0 2px 6px rgba(0, 0, 0, .2); }
.exam-opt.right { border-color: var(--yes); background: #dcfce7; }
.exam-opt.wrong { border-color: var(--no); background: #fee2e2; animation: shake .35s; }
.exam-after { margin-top: 16px; display: flex; align-items: center; gap: 16px; flex-wrap: wrap; }
.exam-after p { font-weight: 900; font-size: 1.1rem; flex: 1; min-width: 200px; }
.gain, .loss { display: inline-block; font-family: 'Baloo 2', var(--font); font-size: 1.5rem; padding: 0 12px; border-radius: 999px; margin-right: 6px; animation: pop .5s cubic-bezier(.2, 1.6, .4, 1) both; }
.gain { background: #dcfce7; color: #15803d; } .loss { background: #fee2e2; color: #b91c1c; }
.me-tests { font-weight: 800; color: #92400e; }

/* please-wait layer */
.busy { position: fixed; inset: 0; z-index: 200; display: grid; place-items: center; padding: 20px; background: rgba(58, 29, 12, .62); backdrop-filter: blur(3px); font-family: 'Baloo 2', 'Nunito', system-ui, sans-serif; cursor: wait; }
.busy[hidden] { display: none; }
.busy-box { background: #fff; border-radius: 30px; border: 4px solid #fbbf24; padding: 28px 26px 24px; max-width: 420px; width: 100%; text-align: center; box-shadow: 0 30px 60px -20px rgba(0, 0, 0, .5); outline: none; }
.busy-box h2 { font-size: 1.7rem; font-weight: 800; color: #7c2d12; margin: 12px 0 6px; line-height: 1.3; }
.busy-box p { font-weight: 600; color: var(--ink2); line-height: 1.6; }
.busy-time { min-height: 1.6em; margin-top: 10px; color: #b45309 !important; font-weight: 800 !important; }
.busy-spin { width: 92px; height: 92px; margin: 0 auto; border-radius: 50%; border: 8px solid #fde7c3; border-top-color: #f59e0b; display: grid; place-items: center; animation: spin 1s linear infinite; }
.busy-spin span { font-size: 2.2rem; animation: spin 1s linear infinite reverse; }
body.is-busy { overflow: hidden; }
@media (prefers-reduced-motion: reduce) { .busy-spin, .busy-spin span { animation: glow 1.4s ease-in-out infinite !important; } }

/* progress tracking (pairs with assets/js/tracker.js) */
.pill[hidden] { display: none; }
.me-pill { border-color: #bfdbfe; color: #1e40af; max-width: 150px; overflow: hidden; text-overflow: ellipsis; }
.me-pill.in { background: #eff6ff; }
.me-pill.active { background: #2563eb; border-color: #2563eb; color: #fff; }
.me-forms { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; align-items: start; }
.me-form { display: grid; gap: 14px; }
.me-form h2 { font-size: 1.3rem; font-weight: 900; color: #7c2d12; }
.me-form label { display: grid; gap: 4px; font-weight: 800; color: #4a2410; }
.me-form label small { font-weight: 700; color: var(--ink2); }
.me-form input { font: inherit; font-weight: 700; padding: 12px 16px; border-radius: 16px; border: 3px solid var(--line); background: #fffdf7; color: var(--ink); min-width: 0; width: 100%; }
.me-form input:focus { outline: 0; border-color: var(--brand); }
.me-note { font-size: .88rem; color: var(--ink2); font-weight: 600; line-height: 1.6; }
.me-msg { margin-top: 12px; font-weight: 800; min-height: 1.6em; }
.me-msg.bad { color: #b91c1c; } .me-msg.ok { color: #166534; }
.me-card { background: #fff; border: 3px solid var(--line); border-radius: 28px; padding: 22px; box-shadow: var(--shadow); display: grid; gap: 16px; }
.me-top { display: grid; grid-template-columns: 130px 1fr; gap: 20px; align-items: center; }
.me-top h2 { font-size: clamp(1.5rem, 4vw, 2.2rem); font-weight: 900; color: #4a2410; line-height: 1.3; }
.me-place { font-weight: 700; color: var(--ink2); }
.me-points { display: inline-flex; align-items: baseline; gap: 8px; margin-top: 8px; padding: 6px 18px; border-radius: 999px; background: linear-gradient(135deg, #fef3c7, #fde68a); border: 3px solid #fbbf24; }
.me-points span { font-size: 1.4rem; } .me-points b { font-family: 'Baloo 2', var(--font); font-size: 2rem; line-height: 1; color: #92400e; } .me-points small { font-weight: 800; color: #92400e; }
.me-code { text-align: center; background: #eff6ff; border: 3px dashed #93c5fd; border-radius: 20px; padding: 12px; display: grid; gap: 2px; }
.me-code b { font-family: 'Baloo 2', ui-monospace, monospace; font-size: 2.2rem; letter-spacing: .3em; color: #1e40af; line-height: 1.2; padding-left: .3em; }
.me-code small { font-weight: 700; color: #1e40af; }
.me-rows { display: grid; gap: 8px; }
.me-row { display: grid; grid-template-columns: 110px 1fr auto auto; gap: 12px; align-items: center; padding: 10px 14px; border-radius: 16px; background: #fffaf0; border: 2px solid var(--line); font-weight: 800; }
.me-row:hover { border-color: var(--brand); }
.me-sync { font-weight: 800; color: var(--ink2); }

.consent { border: 3px solid #bfdbfe; background: #f5f9ff; border-radius: 20px; padding: 14px 16px 16px; display: grid; gap: 12px; margin: 0; min-width: 0; }
.consent legend { font-weight: 900; color: #1e40af; padding: 0 8px; font-size: 1.02rem; }
.me-form label.tick { grid-template-columns: 30px 1fr; align-items: start; gap: 10px; font-weight: 700; font-size: .95rem; line-height: 1.6; }
.me-form label.tick input { width: 26px; height: 26px; padding: 0; margin-top: 3px; accent-color: #2563eb; }
[lang="en"] { font-family: 'Baloo 2', system-ui, sans-serif; color: var(--ink2); font-weight: 600; }
.consent-more summary { cursor: pointer; font-weight: 800; color: #1e40af; }
.privacy ul { margin: 8px 0 0; padding-left: 20px; display: grid; gap: 10px; font-size: .92rem; line-height: 1.6; font-weight: 600; }
.poem-head .sub, .tile-body, .more p[lang="en"] { color: inherit; }

.en-page, .en-page input, .en-page button, .en-page .btn, .me-pill { font-family: 'Baloo 2', 'Nunito', system-ui, sans-serif; }
.en-page [lang="en"], .en-page { color: inherit; }
.en-page .block-head p, .en-page .me-note, .en-page .me-place { color: var(--ink2); }
.en-page .privacy ul { font-weight: 500; }

/* Dhamma citations */
.dear { font-weight: 800 !important; color: #1e40af; font-size: .95rem !important; margin-bottom: 2px; }
.more p.src-note { color: #7c2d12; }
.dhamma-card { border-color: #f3d58a; background: linear-gradient(180deg, #fffdf3, #fff7dc); }
.dhamma-card .card-tag { background: #7c2d12; color: #fff3c4; }
.ref { padding: 4px 0 2px; }
.ref + .ref { border-top: 2px dashed #f3d58a; margin-top: 12px; padding-top: 12px; }
.ref-head { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 10px; margin-bottom: 6px; }
.ref-head b { font-weight: 900; color: #7c2d12; font-size: 1.02rem; }
.ref-head span { font-size: .82rem; font-weight: 700; color: var(--ink2); }
.pali { font-family: var(--serif); font-weight: 700; color: #92400e; line-height: 1.85; font-size: 1.02rem; padding: 8px 14px; border-left: 4px solid #f59e0b; background: rgba(255, 255, 255, .7); border-radius: 0 12px 12px 0; margin-bottom: 8px; }
.ref-si { margin: 0 0 8px; font-weight: 600; font-size: 1.02rem; line-height: 1.8; color: #3a1d0c; }
.ref-si.verse-si { font-family: var(--serif); }
.ref-link { display: inline-block; font-weight: 800; font-size: .88rem; color: #1d4ed8; text-decoration: underline; text-underline-offset: 3px; }
.ref-more { margin-top: 10px; }
.ref-more summary { cursor: pointer; font-weight: 800; color: #7c2d12; padding: 6px 0; }
.ref-by { font-size: .78rem; color: var(--ink2); font-weight: 700; margin-top: 10px; }
.ref-article { display: flex; align-items: center; gap: 10px; margin-top: 12px; padding: 10px 14px; border-radius: 16px; background: #fff; border: 2px solid #f3d58a; }
.ref-article:hover { border-color: var(--brand); }
.ref-article > span:first-child { font-size: 1.5rem; }
.ref-article small { display: block; font-size: .74rem; font-weight: 800; color: var(--ink2); line-height: 1.3; }
.ref-article b { display: block; font-weight: 900; color: #7c2d12; line-height: 1.45; }
.tile-ref { position: absolute; top: 10px; left: 10px; width: 30px; height: 30px; display: grid; place-items: center; background: #7c2d12; color: #fff3c4; border-radius: 50%; font-size: 1rem; box-shadow: 0 3px 8px rgba(0, 0, 0, .2); }
.src-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 12px; }
.src-list a { color: #1d4ed8; text-decoration: underline; text-underline-offset: 3px; }
.src-list span { display: block; color: var(--ink2); font-weight: 600; font-size: .95rem; }
body.present .dhamma-card .ref-more, body.present .ref-article { display: none; }

/* classroom / big screen mode */
body.present .top, body.present .foot, body.present .more, body.present .crumbs { display: none; }
body.present #app { max-width: none; padding: 14px 22px; }
body.present .poem-grid { grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr); }
body.present .verse { font-size: clamp(1.6rem, 2.8vw, 2.6rem); }
body.present .meaning-card p { font-size: clamp(1.1rem, 1.6vw, 1.6rem); }
body.present .poem-top { justify-content: flex-end; }

/* ---------- gallery ---------- */
.search { display: flex; align-items: center; gap: 10px; background: #fff; border: 3px solid var(--line); border-radius: 999px; padding: 6px 18px; margin-bottom: 10px; max-width: 520px; }
.search input { flex: 1; border: 0; outline: 0; background: none; font: inherit; font-weight: 700; padding: 8px 0; min-width: 0; color: var(--ink); }
.search:focus-within { border-color: var(--brand); }
.tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 16px; margin-top: 8px; }
.tile { position: relative; background: #fff; border-radius: 22px; border: 3px solid var(--line); overflow: hidden; transition: transform .18s, box-shadow .18s, border-color .18s; display: flex; flex-direction: column; }
.tile:hover { transform: translateY(-4px) rotate(-.6deg); box-shadow: var(--shadow); border-color: var(--c); }
.thumb { aspect-ratio: 4 / 3; background: #fff6e0; padding: 6px; }
.thumb svg *, .grow-pic svg * { animation: none !important; }
.tile-body { padding: 8px 14px 14px; display: grid; gap: 2px; }
.tile-num { font-family: 'Baloo 2', var(--font); font-weight: 800; color: var(--c); font-size: 1.05rem; line-height: 1.1; }
.tile-body b { font-weight: 900; line-height: 1.45; font-size: 1.02rem; }
.tile-body small { color: var(--ink2); font-weight: 700; font-size: .8rem; }
.tile-done { position: absolute; top: 10px; right: 10px; width: 38px; height: 38px; display: grid; place-items: center; background: #fff; border-radius: 50%; font-size: 1.3rem; box-shadow: 0 3px 8px rgba(0, 0, 0, .18); }
.empty { grid-column: 1 / -1; text-align: center; padding: 40px 10px; font-weight: 800; color: var(--ink2); }

/* ---------- taraka ---------- */
.me { display: grid; grid-template-columns: 220px 1fr; gap: 24px; align-items: center; background: #fff; border: 3px solid var(--line); border-radius: 28px; padding: 22px; box-shadow: var(--shadow); }
.me-text h2 { font-size: clamp(1.2rem, 2.6vw, 1.6rem); font-weight: 900; margin: 10px 0 14px; line-height: 1.5; color: #4a2410; }
.portrait { width: 100%; height: auto; display: block; }
.stars-line { margin-top: 12px; font-weight: 800; color: var(--ink2); }
.stars-line.big { font-size: 2.6rem; line-height: 1.2; margin: 6px 0 14px; }
.star { color: #e7d7b7; }
.star.on { color: #f59e0b; text-shadow: 0 2px 0 #b45309; }
.grow { display: grid; grid-template-columns: repeat(5, 1fr); gap: 12px; }
.grow-card { background: #fff; border: 3px solid color-mix(in srgb, var(--c) 35%, #fff); border-radius: 22px; padding: 12px; text-align: center; display: grid; gap: 2px; transition: transform .18s; }
.grow-card:hover { transform: translateY(-4px); }
.grow-card.now { border-color: var(--c); box-shadow: 0 0 0 4px color-mix(in srgb, var(--c) 22%, #fff); }
.grow-card b { font-weight: 900; color: color-mix(in srgb, var(--c) 65%, #1b1208); }
.grow-card span { font-weight: 800; font-size: .92rem; line-height: 1.4; }
.grow-card small { color: var(--ink2); font-weight: 700; }
.grow-card em { font-style: normal; font-weight: 800; font-size: .85rem; color: var(--ink2); }
.grow-card .meter-bar { height: 10px; margin-top: 4px; }
.grow-pic { padding: 4px 14px; }
.grow-pic.locked { filter: grayscale(.85) opacity(.6); }
.badges { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
.badge { display: grid; grid-template-columns: 44px 1fr; grid-template-rows: auto auto; column-gap: 10px; align-items: center; background: #fff; border: 2px solid var(--line); border-radius: 18px; padding: 10px 12px; opacity: .62; }
.badge span { grid-row: 1 / 3; width: 44px; height: 44px; display: grid; place-items: center; font-size: 1.5rem; border-radius: 14px; background: #f6efe2; }
.badge b { font-family: 'Baloo 2', var(--font); line-height: 1; color: var(--ink2); }
.badge small { font-weight: 800; line-height: 1.35; font-size: .8rem; }
.badge.on { opacity: 1; border-color: color-mix(in srgb, var(--c) 45%, #fff); background: color-mix(in srgb, var(--c) 7%, #fff); }
.badge.on span { background: color-mix(in srgb, var(--c) 20%, #fff); }
.badge.on b { color: var(--c); }

/* ---------- quiz ---------- */
.quiz-intro { text-align: center; background: #fff; border: 3px solid var(--line); border-radius: 30px; padding: 30px 20px 36px; box-shadow: var(--shadow); max-width: 640px; margin-left: auto; margin-right: auto; }
.quiz-intro h1 { font-size: clamp(1.8rem, 5vw, 2.6rem); font-weight: 900; color: #7c2d12; }
.quiz-intro p { font-weight: 700; color: var(--ink2); margin-bottom: 14px; }
.quiz-art { width: 180px; margin: 0 auto 8px; }
.quiz-bar { display: flex; align-items: center; gap: 14px; font-weight: 900; color: #7c2d12; margin-bottom: 16px; }
.quiz-grid { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); gap: 22px; align-items: start; }
.quiz .scene-card { position: static; }
.q-txt { display: grid; place-items: center; aspect-ratio: 4 / 3; font-size: 7rem; background: linear-gradient(135deg, #fef3c7, #fde7f3); }
.quiz-q { font-size: clamp(1.2rem, 2.8vw, 1.6rem); font-weight: 900; line-height: 1.5; margin-bottom: 14px; color: #4a2410; }
.opts { display: grid; gap: 10px; }
.opt { display: flex; align-items: center; gap: 12px; text-align: left; padding: 12px 16px; border-radius: 18px; border: 3px solid var(--line); background: #fff; font-weight: 800; font-size: 1.05rem; line-height: 1.5; transition: transform .12s, border-color .12s; }
.opt:hover:not(:disabled) { border-color: var(--brand); transform: translateX(4px); }
.opt-k { flex: none; width: 38px; height: 38px; display: grid; place-items: center; border-radius: 12px; background: #fef3c7; color: #92400e; font-weight: 900; }
.opt.right { border-color: var(--yes); background: #dcfce7; }
.opt.right .opt-k { background: var(--yes); color: #fff; }
.opt.wrong { border-color: var(--no); background: #fee2e2; animation: shake .35s; }
.opt.wrong .opt-k { background: var(--no); color: #fff; }
.opt:disabled { cursor: default; }
.quiz-after { margin-top: 16px; }
.quiz-after p { font-weight: 900; font-size: 1.1rem; margin-bottom: 10px; }

/* ---------- guide ---------- */
.guide { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 14px; }
.guide h3 { font-weight: 900; color: #7c2d12; margin-bottom: 4px; font-size: 1.1rem; }
.guide p { color: var(--ink2); font-weight: 600; }
.no-t { color: var(--no); } .yes-t { color: var(--yes); }

/* ---------- footer, toast, confetti ---------- */
.foot { text-align: center; padding: 22px 16px 30px; color: var(--ink2); font-size: .92rem; border-top: 3px solid var(--line); background: rgba(255, 255, 255, .6); }
.foot-sub { font-size: .84rem; }
.toast { visibility: hidden; opacity: 0; position: fixed; left: 50%; bottom: 24px; transform: translate(-50%, 140%); background: #3a1d0c; color: #fff; padding: 12px 22px; border-radius: 999px; font-weight: 800; z-index: 60; transition: transform .3s, opacity .3s, visibility .3s; max-width: calc(100vw - 32px); text-align: center; box-shadow: 0 10px 30px rgba(0, 0, 0, .3); }
.toast.show { transform: translate(-50%, 0); visibility: visible; opacity: 1; }
.fx { position: fixed; inset: 0; pointer-events: none; overflow: hidden; z-index: 55; }
.fx i { position: absolute; top: -20px; width: 10px; height: 16px; border-radius: 3px; animation: drop 2.4s ease-in forwards; }

/* ---------- pictures ---------- */
.scene-svg { width: 100%; height: auto; display: block; border-radius: 18px; }
.scene-svg .emo { font-family: 'Apple Color Emoji', 'Segoe UI Emoji', 'Noto Color Emoji', sans-serif; }
.scene-svg .si { font-family: var(--font); }
.scene-svg .muted { filter: saturate(.55); }
.spin-slow { animation: spin 60s linear infinite; }
.spin { transform-box: fill-box; transform-origin: center; animation: spin 24s linear infinite; }
.glow { animation: glow 2.6s ease-in-out infinite; }
.twinkle { animation: twinkle 2.2s ease-in-out infinite; }
.floaty { animation: floaty 3s ease-in-out infinite; }
.drift { animation: drift 9s ease-in-out infinite alternate; }
.wag { transform-box: fill-box; transform-origin: 100% 100%; animation: wag .5s ease-in-out infinite alternate; }
.flutter { animation: flutter 1.6s ease-in-out infinite; }
.bounce { animation: bounce 1.1s ease-in-out infinite; }
.flame { transform-box: fill-box; transform-origin: 50% 100%; animation: flame .7s ease-in-out infinite alternate; }
.steam { animation: steam 2s ease-in-out infinite; }
.fall { animation: fall 1.2s linear infinite; }
.flow { stroke-dasharray: 6 5; animation: dash .6s linear infinite; }
.pop { animation: pop .5s cubic-bezier(.2, 1.6, .4, 1) both; }

@keyframes spin { to { transform: rotate(360deg); } }
@keyframes glow { 50% { opacity: .2; } }
@keyframes twinkle { 50% { opacity: .25; } }
@keyframes floaty { 50% { transform: translateY(-6px); } }
@keyframes drift { to { transform: translateX(14px); } }
@keyframes wag { to { transform: rotate(22deg); } }
@keyframes flutter { 50% { transform: translate(3px, -5px); } }
@keyframes bounce { 50% { transform: translateY(-9px); } }
@keyframes flame { to { transform: scale(1.08, .92); } }
@keyframes steam { 0% { opacity: 0; transform: translateY(3px); } 50% { opacity: 1; } 100% { opacity: 0; transform: translateY(-5px); } }
@keyframes fall { 0% { transform: translateY(-4px); opacity: 0; } 30% { opacity: 1; } 100% { transform: translateY(12px); opacity: 0; } }
@keyframes dash { to { stroke-dashoffset: -11; } }
@keyframes pop { from { transform: scale(0); } }
@keyframes rise { from { opacity: 0; transform: translateY(8px); } }
@keyframes pulse { 50% { filter: brightness(1.25); } }
@keyframes shake { 25% { transform: translateX(-6px); } 75% { transform: translateX(6px); } }
@keyframes drop { to { transform: translateY(110vh) rotate(720deg); opacity: .7; } }

/* ---------- responsive ---------- */
@media (max-width: 1400px) {
  .pill-part { display: none; }
  .nav { gap: 2px; }
  .nav a { padding: 8px 10px; }
  .top-in { gap: 8px; }
  .brand-text small { font-size: .68rem; }
}
@media (max-width: 1080px) {
  .top-in { flex-wrap: wrap; }
  .top-tools { margin-left: auto; }
  .nav { order: 3; width: 100%; margin: 0; justify-content: center; }
}
@media (max-width: 900px) {
  .exam-body.kind-name, .exam-body.kind-verse { grid-template-columns: 1fr; }
  .exam-pic.tall { max-width: 260px; }
  .me-forms { grid-template-columns: 1fr; }
  .me-top { grid-template-columns: 90px 1fr; gap: 14px; }
  .me-row { grid-template-columns: 1fr auto; }
  .me-row .meter-bar { grid-column: 1 / -1; order: 3; }
  .hero, .poem-grid, .quiz-grid { grid-template-columns: 1fr; }
  body.present .poem-grid { grid-template-columns: 1fr; }
  .hero { padding: 18px; }
  .hero-art { order: -1; transform: none; }
  .scene-card { position: static; }
  .how { grid-template-columns: repeat(2, 1fr); }
  .grow { grid-template-columns: repeat(2, 1fr); }
  .me { grid-template-columns: 1fr; text-align: center; }
  .me-pic { max-width: 200px; margin: 0 auto; }
  .poem-icon { display: none; }
}
@media (max-width: 760px) {
  .lvl-head { flex-wrap: wrap; }
  .lvl-head .test-btn { margin-left: 60px; }
  .exam-opt.yn { font-size: 1.2rem; padding: 16px 8px; }
  .exam-score b { font-size: 1.7rem; }
  .exam-rules li { grid-template-columns: 44px 1fr; padding: 8px 10px; font-size: .92rem; }
  .parts { gap: 6px; }
  .part-tab { padding: 6px 8px; gap: 6px; border-radius: 16px; }
  .part-ico { font-size: 1.2rem; }
  .part-tab b { font-size: .88rem; }
  .part-tab small { font-size: .7rem; }
  .pill-part { display: none; }
  .top-in { flex-wrap: wrap; gap: 6px 10px; padding: 6px 12px; }
  .brand-mark { width: 38px; height: 38px; font-size: 21px; border-radius: 12px; }
  .brand-text small { font-size: .62rem; }
  .brand-logo { width: 40px; height: 40px; }
  .top-tools { margin-left: auto; }
  .nav { order: 3; width: 100%; margin: 0; justify-content: space-between; gap: 2px; }
  .nav a { flex: 1; flex-direction: column; gap: 0; padding: 4px 2px; font-size: .74rem; border-radius: 14px; line-height: 1.4; justify-content: center; }
  .nav a span:first-child { font-size: 1.2rem; }
  #app { padding: 14px 12px 32px; }
  .num { width: 58px; height: 58px; font-size: 1.7rem; border-radius: 18px; }
  .poem-head { gap: 12px; }
  .pager { flex-wrap: wrap; }
  .dots { order: 3; width: 100%; }
  .nav-btn { flex: 1; min-width: 0; }
  .bloom { width: 54px; height: 54px; }
  .tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .tile-body { padding: 6px 10px 10px; }
  .tile-body b { font-size: .9rem; }
  .listen { position: static; margin-top: 10px; }
  .fav-btn.with-label { width: 46px; height: 46px; padding: 0; border-radius: 50%; }
  .fav-btn.with-label .fav-label { display: none; }
  .tile-wrap > .fav-btn { top: 6px; right: 6px; }
  .tile-wrap .tile-done { right: 50px; top: 6px; }
  .pill { padding: 5px 9px; font-size: .82rem; }
  .me-pill { max-width: 96px; }
  .top-tools { gap: 5px; }
  .badges { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .scene-card { padding: 6px; border-radius: 22px; }
}
@media (max-width: 400px) {
  .part-ico { display: none; }
  .part-tab { padding: 6px 6px; justify-content: center; text-align: center; min-width: 0; }
  .parts { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .me-pill { max-width: 74px; }
  .brand-text b { font-size: 1.02rem; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
}
@media print {
  .fav-btn, .fav-pill, .me-pill { display: none !important; }
  .parts { display: none !important; }
  .top { position: static; border: 0; }
  .nav, .top-tools, .foot, .pager, .poem-top, .listen, .learn, .toast, .fx { display: none !important; }
  body { background: #fff; }
  .poem-grid { grid-template-columns: 1fr 1fr; }
  .scene-card { position: static; box-shadow: none; }
  .more { display: none; }
  .ref-link, .ref-article { text-decoration: none; }
  * { animation: none !important; }
}
