/* Trâu Con Kể Chuyện — giao diện
   Cùng bảng màu, phông chữ, nút và thanh trên với Kho Báu Lời Ông Bà để các trang của trường trông như một nhà.
   Một giao diện sáng (giấy be), cố ý không có chế độ tối. */
:root {
  --paper: #F4F0EA; --paper-2: #ECE4D6; --card: #FFFDF8; --ink: #3A3B3C; --muted: #6E665C; --line: #E0D5C3;
  --straw: #DDAA55; --straw-l: #F3DFB4; --straw-xl: #FAEFD6; --wood: #C68B59; --wood-d: #8C5A31;
  --leaf: #6FA86A; --leaf-d: #3E7A47; --leaf-l: #E2EED8; --peach: #F2B28F; --peach-l: #FBE3D6;
  --good: #3B8148; --good-bg: #DCEFD7; --bad: #B9503D; --bad-bg: #FADCD4; --sky: #DCEEF0;
  --g-ct: #A0622A; --g-ct-bg: #F5E4C4; --g-tt: #BE5A48; --g-tt-bg: #F9DED3; --g-nn: #3E7A47; --g-nn-bg: #E2EED8;
  --font: 'Nunito', 'Arial Rounded MT Bold', 'Trebuchet MS', Arial, sans-serif;
  --r: 18px; --r-sm: 12px;
  --step--1: 0.875rem; --step-0: 1.0625rem; --step-1: 1.25rem; --step-2: 1.6rem; --step-3: 2.1rem; --step-4: clamp(2.1rem, 6vw, 3.4rem);
  --read: clamp(1.2rem, 1rem + 0.9vw, 1.5rem);
  color-scheme: light;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--paper); color: var(--ink); font-family: var(--font); font-size: var(--step-0); line-height: 1.55; font-weight: 600; }
body::before { content: ""; position: fixed; inset: 0 0 auto; height: env(safe-area-inset-top, 0px); z-index: 30; background: var(--card); }
img { max-width: 100%; }
a { color: inherit; }
button { font: inherit; color: inherit; cursor: pointer; }
:focus-visible { outline: 3px solid var(--straw); outline-offset: 2px; border-radius: 8px; }
h1, h2, h3 { font-weight: 900; line-height: 1.15; text-wrap: balance; margin: 0; }
p { margin: 0; }
.wrap { max-width: 1120px; margin: 0 auto; padding-left: max(16px, env(safe-area-inset-left, 0px)); padding-right: max(16px, env(safe-area-inset-right, 0px)); }
.vh { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ── thanh trên (giống Kho Báu) ── */
.top { position: sticky; top: env(safe-area-inset-top, 0px); z-index: 20; background: var(--card); border-bottom: 2px solid var(--line); }
.top .wrap { display: flex; align-items: center; gap: 14px; padding-block: 8px; }
.logo { display: block; flex: none; line-height: 0; }
.logo img { height: 46px; width: auto; }
.nav { display: flex; gap: 4px; flex: 1; min-width: 0; overflow-x: auto; scrollbar-width: none; }
.nav::-webkit-scrollbar { display: none; }
.nav a { flex: none; text-decoration: none; padding: 8px 12px; border-radius: 999px; font-weight: 800; font-size: 0.95rem; color: var(--muted); }
.nav a:hover { background: var(--paper); color: var(--ink); }
.nav a[aria-current="page"] { background: var(--ink); color: var(--card); }
.tools { display: flex; gap: 6px; align-items: center; flex: none; }
.pill { display: inline-flex; align-items: center; gap: 6px; padding: 6px 12px; border-radius: 999px; background: var(--straw-l); font-weight: 900; font-variant-numeric: tabular-nums; text-decoration: none; }
.pill svg { width: 20px; height: 20px; }
.icon-btn { width: 40px; height: 40px; border-radius: 50%; border: 2px solid var(--line); background: var(--card); display: grid; place-items: center; }
.icon-btn svg { width: 20px; height: 20px; }
.en-toggle { height: 40px; min-width: 44px; padding: 0 10px; border-radius: 999px; border: 2px solid var(--line); background: var(--card); font-weight: 900; font-size: 0.85rem; letter-spacing: .06em; color: var(--muted); }
.en-toggle[aria-pressed="true"] { background: var(--sky); border-color: #9CC7CF; color: var(--ink); }
@media (max-width: 760px) {
  .top .wrap { flex-wrap: wrap; row-gap: 4px; }
  .logo img { height: 38px; }
  .tools { margin-left: auto; }
  .nav { order: 3; flex-basis: 100%; padding-bottom: 4px; }
}
main { padding-block: 22px 40px; min-height: 60vh; }
.foot { padding-block: 26px 34px; text-align: center; color: var(--muted); font-size: var(--step--1); }
.foot .copy { opacity: .55; margin-top: 6px; font-size: 0.78rem; letter-spacing: .02em; }
.foot a { font-weight: 800; }

/* ── nút, chữ phụ ── */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 48px; padding: 10px 20px; border-radius: 999px; border: 2px solid var(--ink); background: var(--card); font-weight: 900; text-decoration: none; box-shadow: 0 3px 0 var(--ink); transition: transform .08s; text-align: center; }
.btn:active { transform: translateY(2px); box-shadow: 0 1px 0 var(--ink); }
.btn.primary { background: var(--straw); }
.btn.green { background: var(--leaf); color: #fff; }
.btn.small { min-height: 40px; padding: 6px 14px; font-size: 0.95rem; }
.btn.ghost { box-shadow: none; border-color: var(--line); }
.btn svg { width: 20px; height: 20px; flex: none; }
.btn[disabled] { opacity: .45; cursor: default; }
.row { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.row.end { justify-content: flex-end; }
.row.between { justify-content: space-between; }
.eyebrow { text-transform: uppercase; letter-spacing: .08em; font-size: 0.78rem; font-weight: 900; color: var(--wood-d); }
.muted { color: var(--muted); }
.en { display: none; color: #36616A; font-weight: 700; font-size: 0.95em; }
body.show-en .en { display: block; }
body.show-en span.en { display: inline; }
.en::before { content: "EN · "; font-weight: 900; font-size: .8em; letter-spacing: .05em; opacity: .7; }
.section { margin-top: 40px; }
.section-head { display: flex; align-items: baseline; gap: 12px; flex-wrap: wrap; margin-bottom: 16px; }
.section-head h2 { font-size: var(--step-2); }
.card { background: var(--card); border: 2px solid var(--line); border-radius: var(--r); padding: 18px; }
.tag { display: inline-flex; align-items: center; padding: 2px 10px; border-radius: 999px; font-size: 0.8rem; font-weight: 900; background: var(--g-ct-bg); color: var(--g-ct); }
.tag.tt { background: var(--g-tt-bg); color: var(--g-tt); }
.tag.nn { background: var(--g-nn-bg); color: var(--g-nn); }
.tag.day { background: var(--ink); color: var(--card); }

/* ── Trâu Con nói ── */
.trau-say { display: flex; align-items: flex-end; gap: 10px; }
.trau-say img { width: 96px; height: auto; flex: none; }
.trau-say .bub { position: relative; background: var(--card); border: 2px solid var(--ink); border-radius: 18px; padding: 10px 14px; font-weight: 800; margin-bottom: 22px; max-width: 640px; }
.trau-say .bub::before { content: ""; position: absolute; left: -10px; bottom: 14px; width: 16px; height: 16px; background: var(--card); border-left: 2px solid var(--ink); border-bottom: 2px solid var(--ink); transform: rotate(45deg); }
.trau-say.big img { width: 132px; }
.trau-say .bub .en { margin-top: 4px; }
@media (max-width: 560px) { .trau-say img { width: 74px; } .trau-say.big img { width: 100px; } }

/* ── trang đầu ── */
.hero { display: grid; grid-template-columns: auto 1fr; gap: 18px 26px; align-items: center; background: var(--card); border: 2px solid var(--line); border-radius: 26px; padding: 22px 26px; position: relative; overflow: hidden; }
.hero::after { content: ""; position: absolute; right: -60px; bottom: -80px; width: 260px; height: 260px; border-radius: 50%; background: var(--straw-xl); z-index: 0; }
.hero > * { position: relative; z-index: 1; }
.hero .mascot { width: clamp(120px, 20vw, 190px); }
.hero h1 { font-size: var(--step-4); letter-spacing: -.01em; }
.hero h1 span { color: var(--wood-d); }
.hero .lead { font-size: var(--step-1); margin-top: 6px; }
.hero .row { margin-top: 16px; }
.today-btn small { display: block; font-size: .8rem; font-weight: 800; opacity: .8; }
@media (max-width: 640px) { .hero { grid-template-columns: 1fr; text-align: center; padding: 18px; } .hero .mascot { margin: 0 auto; } .hero .row { justify-content: center; } }
.progress { display: flex; align-items: center; gap: 12px; margin-top: 14px; }
.bar { flex: 1; height: 14px; border-radius: 999px; background: var(--paper-2); overflow: hidden; max-width: 380px; }
.bar i { display: block; height: 100%; background: var(--leaf); border-radius: 999px; }

.filters { display: flex; flex-wrap: wrap; gap: 8px; }
.filters button { border: 2px solid var(--line); background: var(--card); border-radius: 999px; padding: 6px 14px; font-weight: 900; min-height: 40px; }
.filters button[aria-pressed="true"] { background: var(--ink); color: var(--card); border-color: var(--ink); }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 16px; }
.story-card { display: flex; flex-direction: column; background: var(--card); border: 2px solid var(--line); border-radius: var(--r); overflow: hidden; text-decoration: none; transition: transform .12s, box-shadow .12s; position: relative; }
.story-card:hover { transform: translateY(-3px); box-shadow: 0 8px 0 var(--line); }
.story-card .pic { aspect-ratio: 16 / 10; background: var(--sky); }
.story-card .pic svg { width: 100%; height: 100%; display: block; }
.story-card .body { padding: 10px 14px 14px; display: grid; gap: 6px; }
.story-card h3 { font-size: 1.15rem; }
.story-card .meta { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.story-card .day-badge { position: absolute; left: 10px; top: 10px; background: var(--card); border: 2px solid var(--ink); border-radius: 999px; padding: 2px 10px; font-weight: 900; font-size: .85rem; }
.story-card.today { border-color: var(--straw); box-shadow: 0 0 0 4px var(--straw-l); }
.story-card.today .day-badge { background: var(--straw); }
.story-card .done-badge { position: absolute; right: 10px; top: 10px; background: var(--leaf); color: #fff; border-radius: 999px; padding: 2px 10px; font-weight: 900; font-size: .8rem; }
.stars { display: inline-flex; gap: 2px; }
.stars svg { width: 16px; height: 16px; }
.guide-teaser { display: grid; grid-template-columns: auto 1fr auto; gap: 16px; align-items: center; }
.guide-teaser img { width: 80px; }
@media (max-width: 640px) { .guide-teaser { grid-template-columns: 1fr; text-align: center; } .guide-teaser img { margin: 0 auto; } }

/* ── trang truyện ── */
.story-head { display: grid; grid-template-columns: auto 1fr; gap: 6px 14px; align-items: center; }
.story-head .back { grid-row: span 2; }
.story-head h1 { font-size: var(--step-3); }
.story-head .row { gap: 8px; }
.steps { display: flex; gap: 6px; overflow-x: auto; padding: 14px 2px 6px; scrollbar-width: none; margin-top: 8px; }
.steps::-webkit-scrollbar { display: none; }
.steps a { flex: none; display: inline-flex; align-items: center; gap: 6px; text-decoration: none; border: 2px solid var(--line); background: var(--card); border-radius: 999px; padding: 6px 12px 6px 6px; font-weight: 900; font-size: .92rem; color: var(--muted); }
.steps a .n { width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center; background: var(--paper-2); color: var(--ink); font-size: .85rem; }
.steps a.done .n { background: var(--leaf); color: #fff; }
.steps a[aria-current="step"] { border-color: var(--ink); color: var(--ink); background: var(--straw-xl); }
.steps a[aria-current="step"] .n { background: var(--ink); color: var(--card); }
.panel { margin-top: 14px; }
.panel-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 14px; flex-wrap: wrap; margin-bottom: 14px; }
.panel-head h2 { font-size: var(--step-2); }
.panel-foot { display: flex; justify-content: space-between; gap: 10px; flex-wrap: wrap; margin-top: 22px; }

/* nhân vật */
.cover-big { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); gap: 18px; align-items: center; }
.cover-big .pic { border-radius: var(--r); overflow: hidden; border: 2px solid var(--line); aspect-ratio: 16 / 10; }
.cover-big .pic svg { width: 100%; height: 100%; display: block; }
@media (max-width: 760px) { .cover-big { grid-template-columns: 1fr; } }
.chars { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 14px; margin-top: 18px; }
.char { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 8px; background: var(--card); border: 2px solid var(--line); border-radius: var(--r); padding: 14px 12px 16px; }
.char .face { width: 104px; height: 104px; flex: none; border-radius: 50%; background: var(--straw-xl); border: 2px solid var(--line); overflow: hidden; }
.char .face svg { width: 100%; height: 100%; display: block; }
.char h3 { font-size: 1.1rem; }
.char p { font-size: .98rem; }
.char .trait { display: inline-block; margin-top: 4px; font-size: .8rem; font-weight: 900; color: var(--wood-d); background: var(--straw-xl); border-radius: 999px; padding: 1px 9px; }

/* ── sách lật ── */
.book-wrap { position: relative; }
.book { position: relative; perspective: 1800px; }
.sheet { position: relative; display: grid; grid-template-columns: 1.3fr 1fr; background: var(--card); border: 2px solid var(--line); border-radius: 10px 22px 22px 10px; box-shadow: 0 10px 0 -2px #E6DCCB, 0 12px 24px rgba(58, 59, 60, .10); min-height: 380px; overflow: hidden; transform-origin: left center; backface-visibility: hidden; }
.sheet::after { content: ""; position: absolute; top: 0; bottom: 0; left: 56.5%; width: 36px; transform: translateX(-50%); background: linear-gradient(90deg, rgba(0,0,0,0) 0%, rgba(140, 90, 49, .14) 48%, rgba(140, 90, 49, .2) 50%, rgba(140, 90, 49, .14) 52%, rgba(0,0,0,0) 100%); pointer-events: none; }
.sheet .pic { background: var(--sky); display: flex; }
.sheet .pic svg { width: 100%; height: 100%; display: block; min-height: 100%; }
.sheet .txt { padding: 26px 30px 22px 34px; display: flex; flex-direction: column; gap: 14px; }
.sheet .cap { font-size: var(--step-1); color: var(--wood-d); }
.sheet .story-text { font-size: var(--read); line-height: 1.75; font-weight: 700; }
.sheet .pno { margin-top: auto; display: flex; justify-content: space-between; align-items: center; color: var(--muted); font-size: .9rem; }
.sheet .corner { position: absolute; right: 0; bottom: 0; width: 46px; height: 46px; border: 0; padding: 0; background: linear-gradient(135deg, transparent 50%, var(--straw-l) 50%); border-top-left-radius: 10px; box-shadow: -2px -2px 4px rgba(0,0,0,.08); }
.sheet.cover { grid-template-columns: 1fr; background: var(--straw-xl); }
.sheet.cover::after { display: none; }
.sheet.cover .inner { display: grid; grid-template-columns: 1.2fr 1fr; align-items: center; gap: 22px; padding: 24px; }
.sheet.cover .pic { border-radius: 16px; overflow: hidden; border: 3px solid var(--card); box-shadow: 0 4px 0 var(--line); aspect-ratio: 16/10; }
.sheet.cover h2 { font-size: var(--step-3); }
.sheet.end .inner { grid-template-columns: auto 1fr; }
.sheet.end img { width: 150px; }
@media (max-width: 820px) {
  .sheet { grid-template-columns: 1fr; border-radius: 18px; min-height: 0; }
  .sheet::after { display: none; }
  .sheet .pic { aspect-ratio: 16 / 10; }
  .sheet .txt { padding: 18px 18px 22px; }
  .sheet.cover .inner { grid-template-columns: 1fr; padding: 16px; text-align: center; }
  .sheet.end .inner { grid-template-columns: 1fr; justify-items: center; }
}
.sheet.leave { position: absolute; inset: 0; z-index: 3; animation: turnOut .62s cubic-bezier(.45, .05, .55, .95) forwards; }
.sheet.enter { position: absolute; inset: 0; z-index: 3; animation: turnIn .62s cubic-bezier(.45, .05, .55, .95) forwards; }
@keyframes turnOut { 0% { transform: rotateY(0); filter: brightness(1); } 100% { transform: rotateY(-100deg); filter: brightness(.82); opacity: .2; } }
@keyframes turnIn { 0% { transform: rotateY(-100deg); filter: brightness(.82); opacity: .2; } 100% { transform: rotateY(0); filter: brightness(1); opacity: 1; } }
@media (prefers-reduced-motion: reduce) { .sheet.leave, .sheet.enter { animation-duration: .01s; } }
.book-ctrl { display: grid; grid-template-columns: auto 1fr auto; gap: 12px; align-items: center; margin-top: 18px; }
.dots { display: flex; justify-content: center; flex-wrap: wrap; gap: 6px; }
.dots button { width: 14px; height: 14px; border-radius: 50%; border: 2px solid var(--wood); background: var(--card); padding: 0; }
.dots button[aria-current="true"] { background: var(--wood); transform: scale(1.2); }
.dots button.seen { background: var(--straw-l); }
.mid-tools { display: flex; justify-content: center; gap: 8px; margin-top: 10px; flex-wrap: wrap; }

/* từ cần nhớ */
.w { background: linear-gradient(transparent 55%, var(--straw-l) 55%); border-bottom: 3px dotted var(--wood); padding: 0 2px; border-radius: 3px; cursor: pointer; font-weight: 900; color: var(--wood-d); border-top: 0; border-left: 0; border-right: 0; font: inherit; font-weight: 900; line-height: inherit; }
.w:hover, .w[aria-expanded="true"] { background: var(--straw-l); }
.word-chips { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.word-chips .lbl { font-size: .85rem; font-weight: 900; color: var(--muted); }
.wchip { display: inline-flex; align-items: center; gap: 6px; border: 2px solid var(--straw); background: var(--straw-xl); border-radius: 999px; padding: 4px 12px; font-weight: 900; min-height: 38px; }
.wchip svg { width: 16px; height: 16px; }
.wchip.got { background: var(--leaf-l); border-color: var(--leaf); }
.aside { display: flex; gap: 10px; align-items: flex-end; }
.aside img { width: 64px; flex: none; }
.aside .bub { background: var(--sky); border-radius: 14px; padding: 8px 12px; font-weight: 800; font-size: .98rem; }

.pop { position: fixed; z-index: 40; width: min(340px, calc(100vw - 24px)); background: var(--card); border: 2px solid var(--ink); border-radius: 18px; padding: 14px 16px; box-shadow: 0 8px 0 rgba(58,59,60,.15); }
.pop .w-big { font-size: 1.7rem; font-weight: 900; color: var(--wood-d); line-height: 1.2; }
.pop .mean { margin-top: 6px; font-weight: 700; }
.pop .en { display: block; margin-top: 6px; }
.pop .row { margin-top: 10px; }
.pop .x { position: absolute; right: 8px; top: 8px; width: 34px; height: 34px; border-radius: 50%; border: 0; background: var(--paper); font-weight: 900; }

/* thông điệp */
.message { display: grid; grid-template-columns: auto 1fr; gap: 20px; align-items: center; background: var(--leaf-l); border: 2px solid #B9D7A6; border-radius: 26px; padding: 24px; }
.message img { width: clamp(110px, 18vw, 170px); }
.message .big { font-size: clamp(1.3rem, 1rem + 1.4vw, 1.9rem); font-weight: 900; line-height: 1.35; margin-top: 6px; }
.saying { margin-top: 16px; background: var(--card); border-left: 6px solid var(--straw); border-radius: 12px; padding: 12px 16px; }
.saying b { font-size: 1.15rem; }
@media (max-width: 640px) { .message { grid-template-columns: 1fr; text-align: center; } .message img { margin: 0 auto; } }

/* xếp tranh */
.slots { display: grid; grid-template-columns: repeat(var(--n, 5), minmax(0, 1fr)); gap: 10px; }
.slot { position: relative; border: 3px dashed var(--wood); border-radius: 16px; background: var(--straw-xl); min-height: 120px; padding: 0; display: grid; place-items: center; }
.slot .num { position: absolute; left: 6px; top: 6px; z-index: 2; width: 28px; height: 28px; border-radius: 50%; background: var(--ink); color: var(--card); display: grid; place-items: center; font-weight: 900; font-size: .9rem; }
.slot.ok { border-style: solid; border-color: var(--good); background: var(--good-bg); }
.slot.no { border-style: solid; border-color: var(--bad); animation: shake .4s; }
.tray { display: grid; grid-template-columns: repeat(var(--n, 5), minmax(0, 1fr)); gap: 10px; margin-top: 16px; min-height: 120px; }
.pcard { border: 2px solid var(--line); border-radius: 14px; background: var(--card); padding: 0; overflow: hidden; text-align: left; width: 100%; display: flex; flex-direction: column; }
.pcard .pic svg { width: 100%; aspect-ratio: 16 / 10; display: block; }
.pcard .c { padding: 6px 8px 8px; font-weight: 900; font-size: .88rem; line-height: 1.25; }
.pcard.used { visibility: hidden; }
.slot .pcard { border: 0; border-radius: 12px; }
@media (max-width: 760px) {
  .slots, .tray { grid-template-columns: repeat(min(var(--n, 5), 3), minmax(0, 1fr)); }
  .slots.n4, .tray.n4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .slot { min-height: 96px; }
  .pcard .c { font-size: .8rem; }
}
.retell { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 12px; }
.retell .pcard .hint { display: none; padding: 0 8px 8px; font-weight: 700; font-size: .9rem; color: var(--muted); }
.retell .pcard.open .hint { display: block; }

/* trò chơi chọn */
.quiz { background: var(--card); border: 2px solid var(--line); border-radius: 22px; padding: 22px; }
.quiz .q { font-size: clamp(1.2rem, 1rem + 1vw, 1.6rem); font-weight: 900; line-height: 1.4; }
.quiz .q .blank { display: inline-block; min-width: 90px; border-bottom: 4px solid var(--wood); text-align: center; color: var(--leaf-d); }
.quiz .opts { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 10px; margin-top: 18px; }
.quiz .opts.words { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); }
.opt { min-height: 56px; border: 2px solid var(--ink); border-radius: 16px; background: var(--card); box-shadow: 0 3px 0 var(--ink); font-weight: 900; font-size: 1.1rem; padding: 10px 14px; text-align: left; }
.opts.words .opt { text-align: center; font-size: 1.25rem; }
.opt:active { transform: translateY(2px); box-shadow: 0 1px 0 var(--ink); }
.opt.ok { background: var(--good-bg); border-color: var(--good); box-shadow: 0 3px 0 var(--good); }
.opt.no { background: var(--bad-bg); border-color: var(--bad); box-shadow: 0 3px 0 var(--bad); animation: shake .4s; opacity: .6; }
.quiz .explain { margin-top: 16px; padding: 12px 16px; border-radius: 14px; background: var(--good-bg); font-weight: 700; }
.quiz .top-line { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin-bottom: 12px; color: var(--muted); font-weight: 900; }
.pips { display: flex; gap: 5px; }
.pips i { width: 12px; height: 12px; border-radius: 50%; background: var(--paper-2); }
.pips i.done { background: var(--leaf); }
.pips i.now { background: var(--straw); }
.flash { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 10px; margin-bottom: 18px; }
.fcard { perspective: 800px; border: 0; padding: 0; background: none; min-height: 110px; }
.fcard .in { position: relative; width: 100%; height: 100%; min-height: 110px; transition: transform .45s; transform-style: preserve-3d; }
.fcard.flip .in { transform: rotateY(180deg); }
.fcard .f, .fcard .b { position: absolute; inset: 0; border-radius: 16px; display: grid; place-items: center; padding: 10px; backface-visibility: hidden; text-align: center; }
.fcard .f { background: var(--straw-xl); border: 2px solid var(--straw); font-size: 1.35rem; font-weight: 900; color: var(--wood-d); }
.fcard .b { background: var(--card); border: 2px solid var(--leaf); transform: rotateY(180deg); font-size: .92rem; font-weight: 700; line-height: 1.35; }
.done-box { text-align: center; background: var(--card); border: 2px solid var(--line); border-radius: 22px; padding: 26px; }
.done-box img { width: 140px; }
.done-box h2 { margin-top: 8px; }
.done-box .row { justify-content: center; margin-top: 16px; }

/* suy ngẫm */
.feel { display: flex; flex-wrap: wrap; gap: 10px; }
.feel button { border: 2px solid var(--line); background: var(--card); border-radius: 16px; padding: 8px 14px; font-weight: 900; display: inline-flex; flex-direction: column; align-items: center; min-width: 92px; }
.feel button span { font-size: 1.8rem; line-height: 1.2; }
.feel button[aria-pressed="true"] { border-color: var(--ink); background: var(--straw-xl); }
.think { display: grid; gap: 18px; margin-top: 18px; }
.think label { font-weight: 900; font-size: 1.15rem; display: block; }
.think textarea { width: 100%; min-height: 120px; margin-top: 8px; border: 2px solid var(--line); border-radius: 16px; padding: 12px 14px; font: inherit; font-size: 1.1rem; background: #FFFEFB; resize: vertical; line-height: 1.6; }
.think textarea:focus { outline: none; border-color: var(--straw); }
.starters { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.starters button { border: 2px dashed var(--wood); background: var(--straw-xl); border-radius: 999px; padding: 4px 12px; font-weight: 800; font-size: .92rem; }

/* sổ từ, hướng dẫn */
.notebook { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 12px; }
.note { background: var(--card); border: 2px solid var(--line); border-radius: 16px; padding: 12px 14px; }
.note b { font-size: 1.25rem; color: var(--wood-d); }
.note small { display: block; color: var(--muted); font-weight: 800; margin-top: 4px; }
.guide { display: grid; gap: 14px; }
.guide .card h3 { font-size: 1.2rem; margin-bottom: 6px; }
.guide ol, .guide ul { margin: 6px 0 0; padding-left: 22px; }
.guide li { margin: 4px 0; }

@keyframes shake { 20%, 60% { transform: translateX(-6px); } 40%, 80% { transform: translateX(6px); } }
@keyframes pop { 50% { transform: scale(1.08); } }
.pulse { animation: pop .35s; }
.confetti { position: fixed; top: -12px; width: 10px; height: 14px; border-radius: 3px; z-index: 50; pointer-events: none; animation: fall 1.6s ease-in forwards; }
@keyframes fall { to { transform: translateY(105vh) rotate(540deg); opacity: .8; } }
#toast { position: fixed; left: 50%; bottom: calc(18px + env(safe-area-inset-bottom, 0px)); transform: translateX(-50%); z-index: 60; background: var(--ink); color: var(--card); padding: 10px 18px; border-radius: 999px; font-weight: 800; max-width: calc(100% - 32px); text-align: center; }
@media print { .top, .foot, .steps, .panel-foot, .tools { display: none !important; } }
