:root { color-scheme: light dark; --bg: #f6f5f1; --fg: #1b1b1f; --muted: #62626b; --card: #ffffff; --line: #dcdad2; --accent: #c82028; }
@media (prefers-color-scheme: dark) { :root { --bg: #101014; --fg: #eeeeea; --muted: #9a9aa4; --card: #1a1a20; --line: #2c2c34; --accent: #f06068; } }
:root { box-sizing: border-box; padding-top: env(safe-area-inset-top, 0px); padding-bottom: env(safe-area-inset-bottom, 0px); }
* { box-sizing: inherit; }
body { margin: 0; background: var(--bg); color: var(--fg); font: 16px/1.5 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; }
main { max-width: 36rem; margin: 0 auto; padding: 1.25rem; }
h1 { font-size: 1.4rem; margin: 0 0 .25rem; }
.muted { color: var(--muted); font-size: .9rem; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 1rem; margin: 1rem 0; }
.ok { color: #1c8a4a; } .bad { color: var(--accent); }

/* ---- Giao diện 2D (gói việc 6) ---- */
.top h1 { margin-bottom: 0; } .foot { margin: 1.5rem 0 .5rem; font-size: .75rem; text-align: center; }
.map { width: 100%; height: auto; display: block; margin: .75rem 0; touch-action: manipulation; }
.map-bg { fill: #dfe9d6; } .road { stroke: #c9c4b4; stroke-width: 22; fill: none; } .plaza { fill: #c9c4b4; }
@media (prefers-color-scheme: dark) { .map-bg { fill: #1d2a22; } .road, .plaza { fill: #2b2b33; stroke: #2b2b33; } .plaza { stroke: none; } }
.pin { cursor: pointer; outline: none; } .pin circle { fill: var(--card); stroke: var(--accent); stroke-width: 3; }
.pin.locked circle { stroke: var(--muted); stroke-dasharray: 5 4; } .pin.locked { opacity: .75; }
.pin.sel circle { stroke-width: 6; } .pin:focus-visible circle { stroke: var(--fg); stroke-width: 6; }
.emoji { font-size: 28px; } .lbl { font-size: 13px; font-weight: 600; fill: var(--fg); paint-order: stroke; stroke: var(--bg); stroke-width: 3px; }
.btn { font: inherit; min-height: 44px; padding: .5rem 1rem; border-radius: 10px; border: 1px solid var(--line); background: var(--card); color: var(--fg); cursor: pointer; }
.btn.primary { background: var(--accent); border-color: var(--accent); color: #fff; font-weight: 600; }
.btn.ghost { background: transparent; } .btn.choice { display: block; width: 100%; text-align: left; margin: .4rem 0; } .btn.choice small { display: block; color: var(--muted); }
.row { display: flex; gap: .6rem; align-items: center; flex-wrap: wrap; margin: .6rem 0; }
select, textarea { font: inherit; padding: .5rem; border-radius: 10px; border: 1px solid var(--line); background: var(--card); color: var(--fg); min-height: 44px; }
textarea { width: 100%; resize: vertical; margin-bottom: .5rem; }
.bar { display: flex; justify-content: space-between; align-items: center; } .chips { display: flex; gap: .4rem; } .chip { font-size: .8rem; padding: .15rem .55rem; border: 1px solid var(--line); border-radius: 99px; background: var(--card); }
.where { display: flex; flex-direction: column; margin: .5rem 0; }
.log { display: flex; flex-direction: column; gap: .5rem; margin: .5rem 0 1rem; }
.bubble { max-width: 88%; padding: .6rem .8rem; border-radius: 14px; border: 1px solid var(--line); background: var(--card); }
.bubble.me { align-self: flex-end; background: var(--accent); border-color: var(--accent); color: #fff; }
.bubble .who { font-size: .75rem; opacity: .7; } .bubble .de { font-size: 1.15rem; } .bubble .vi { font-size: .9rem; opacity: .8; margin-top: .2rem; }
.sys { align-self: center; font-size: .85rem; color: var(--muted); font-style: italic; text-align: center; }
.tag { font-size: .8rem; padding: .1rem .5rem; border-radius: 99px; border: 1px solid var(--line); }
.tag.tot { background: #1c8a4a; color: #fff; border-color: #1c8a4a; } .tag.tam { background: #d99a1a; color: #1b1b1f; border-color: #d99a1a; } .tag.canluyen { background: var(--accent); color: #fff; border-color: var(--accent); }
.axis p { margin: .2rem 0 .8rem; } .err { white-space: pre-wrap; font-size: .8rem; }

/* ---- Lưu trữ / từ cần ôn (gói việc 8) ---- */
.badge { font-size: 16px; } .words { list-style: none; padding: 0; margin: 0; } .words li { display: flex; justify-content: space-between; align-items: center; gap: .5rem; padding: .35rem 0; border-bottom: 1px solid var(--line); }
.words li:last-child { border-bottom: 0; }
.note { font-size: .8rem; color: var(--muted); margin: .25rem 0; } .note.warn { border: 1px solid var(--accent); border-radius: 8px; padding: .4rem .6rem; color: var(--fg); }
