/* 色は場面で切り替える：C2 パステル（基本・推し活）／C1 ラベンダー（音楽）／C3 ミント×ピーチ（旅行・食） */
.pal-c2 { --bg:#fff6fa; --card:#ffffff; --ink:#4a3d6e; --sub:#8a7fa6; --a:#f7a8cb; --a2:#c9bff5; --a3:#ffe39a; --soft:#ffeaf3; --line:#f1dceb; }
.pal-c1 { --bg:#efeaf9; --card:#fbf9ff; --ink:#3f346c; --sub:#7d73a3; --a:#b7a6f0; --a2:#f7b8d6; --a3:#ffe9a0; --soft:#e6defa; --line:#ddd3f3; }
.pal-c3 { --bg:#eef8f5; --card:#ffffff; --ink:#34524c; --sub:#6e8c86; --a:#ff9f8a; --a2:#9fd9c8; --a3:#ffd98a; --soft:#e0f3ed; --line:#d2ebe3; }

* { box-sizing: border-box; }
html, body { margin: 0; }
body { background: var(--bg); color: var(--ink); font-family: "Zen Maru Gothic", system-ui, sans-serif; font-weight: 500; line-height: 1.6; transition: background .3s; padding-bottom: 80px; }
button { font: inherit; color: inherit; cursor: pointer; }
.ko { font-family: "Gowun Dodum", "Apple SD Gothic Neo", "Noto Sans KR", sans-serif; }

.top { display: flex; align-items: center; justify-content: space-between; padding: 12px 16px; max-width: 560px; margin: 0 auto; }
.logo { background: none; border: 0; font-weight: 900; font-size: 18px; display: flex; align-items: center; gap: 8px; padding: 0; }
.mark { display: inline-grid; place-items: center; width: 30px; height: 30px; border-radius: 9px; background: var(--a); color: #fff; font-family: "Gowun Dodum", sans-serif; }
.streak { font-weight: 700; font-size: 14px; background: var(--a3); padding: 4px 12px; border-radius: 99px; }

main { max-width: 560px; margin: 0 auto; padding: 0 16px; }
h1 { font-size: 22px; font-weight: 900; margin: 8px 0 4px; }
h2 { font-size: 17px; font-weight: 700; margin: 24px 0 8px; }
.sub { color: var(--sub); font-size: 14px; margin: 0; }

.box { background: var(--card); border: 2px solid var(--line); border-radius: 20px; padding: 16px; margin: 12px 0; }
.menu-item { display: flex; align-items: center; gap: 12px; width: 100%; text-align: left; background: var(--card); border: 2px solid var(--line); border-radius: 18px; padding: 14px 16px; margin: 10px 0; }
.menu-item .num { width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; font-weight: 900; background: var(--soft); flex: none; }
.menu-item b { display: block; }
.menu-item small { color: var(--sub); }
.menu-item.done { opacity: .55; }
.menu-item.done .num { background: var(--a2); color: #fff; }

.btn { display: inline-block; border: 0; border-radius: 99px; padding: 12px 22px; font-weight: 700; background: var(--ink); color: #fff; }
.btn.ghost { background: var(--soft); color: var(--ink); }
.btn.small { padding: 8px 14px; font-size: 14px; }
.btn.wide { width: 100%; }
.btn:active { transform: scale(.97); }

.bar { height: 10px; background: var(--soft); border-radius: 99px; overflow: hidden; }
.bar i { display: block; height: 100%; background: var(--a); border-radius: 99px; }

/* 学習カード */
.progress-line { display: flex; align-items: center; gap: 10px; margin: 4px 0 12px; }
.progress-line .bar { flex: 1; }
.card { background: var(--card); border: 2px solid var(--line); border-radius: 24px; overflow: hidden; }
.card .ill { display: block; width: 100%; height: 150px; }
.card .body { padding: 16px 18px 20px; text-align: center; }
.tag { display: inline-block; font-size: 12px; padding: 2px 10px; border-radius: 99px; background: var(--soft); color: var(--sub); }
.big { font-size: 40px; line-height: 1.3; margin: 8px 0 2px; word-break: keep-all; }
.big.letter { font-size: 84px; }
.yomi { color: var(--sub); font-size: 16px; }
.ja { font-size: 19px; font-weight: 700; margin-top: 10px; }
.note { text-align: left; background: var(--soft); border-radius: 14px; padding: 10px 14px; margin-top: 12px; font-size: 14px; }
.note .ex { display: block; margin-top: 4px; color: var(--sub); }
.hidden-ans { margin-top: 14px; }
.voice { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; margin-top: 14px; }
.voice .rec.on { background: #ff6b8a; color: #fff; }
.heard { font-size: 13px; color: var(--sub); margin-top: 8px; min-height: 1em; }
.link { background: none; border: 0; color: var(--sub); text-decoration: underline; font-size: 14px; margin-top: 10px; }
.unchecked { font-size: 11px; color: var(--sub); margin-top: 8px; }

.rate { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin: 14px 0; }
.rate button { border: 0; border-radius: 16px; padding: 14px 4px; font-weight: 700; }
.rate .r1 { background: #ffd6dc; color: #8a2f45; }
.rate .r2 { background: var(--a3); color: #6b5410; }
.rate .r3 { background: var(--a2); color: #2f2a5c; }
.pal-c3 .rate .r3 { color: #1f4a40; }
.rate small { display: block; font-weight: 500; font-size: 11px; opacity: .8; }

/* ハングル表 */
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(64px, 1fr)); gap: 8px; }
.cell { background: var(--card); border: 2px solid var(--line); border-radius: 14px; padding: 8px 4px; text-align: center; }
.cell b { display: block; font-size: 26px; font-family: "Gowun Dodum", sans-serif; }
.cell small { color: var(--sub); font-size: 12px; }
.cell.ok { background: var(--a2); border-color: var(--a2); }
.cell.lock { opacity: .35; }

/* 記録 */
.stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.stat { background: var(--card); border: 2px solid var(--line); border-radius: 16px; padding: 12px 6px; text-align: center; }
.stat b { display: block; font-size: 26px; font-weight: 900; }
.stat small { color: var(--sub); font-size: 12px; }
.week { display: flex; align-items: flex-end; gap: 6px; height: 110px; padding-top: 8px; }
.week div { flex: 1; text-align: center; font-size: 11px; color: var(--sub); }
.week i { display: block; background: var(--a); border-radius: 6px 6px 2px 2px; margin-bottom: 4px; min-height: 3px; }

.col { text-align: left; }
.col p { font-size: 16px; line-height: 1.9; }

.tabs { position: fixed; left: 0; right: 0; bottom: 0; display: flex; background: var(--card); border-top: 2px solid var(--line); padding: 6px 6px calc(6px + env(safe-area-inset-bottom)); justify-content: center; }
.tabs button { flex: 1; max-width: 140px; background: none; border: 0; padding: 8px 0; font-size: 13px; color: var(--sub); border-radius: 12px; }
.tabs button.on { color: var(--ink); background: var(--soft); font-weight: 700; }

.toast { position: fixed; left: 50%; top: 20px; transform: translateX(-50%); background: var(--ink); color: #fff; padding: 10px 18px; border-radius: 99px; font-size: 14px; z-index: 9; }
.pop { animation: pop .35s ease; }
@keyframes pop { 0% { transform: scale(.94); opacity: .4; } 100% { transform: scale(1); opacity: 1; } }
.cell.mid { background: var(--soft); border-color: var(--a2); }
.cell .dots { display: block; font-size: 10px; letter-spacing: 1px; color: var(--sub); }
.tag.lv-done { background: var(--a2); color: var(--ink); }
.tag.lv-mid, .tag.lv-start { background: var(--a3); color: var(--ink); }
.foot { max-width: 560px; margin: 40px auto 0; padding: 0 16px; font-size: 12px; color: var(--sub); text-align: center; line-height: 2; }
.foot a { color: var(--sub); }
.notice { background: var(--card); border: 2px solid var(--a3); border-radius: 18px; padding: 12px 16px; margin: 12px 0; font-size: 14px; }
.notice p, .notice ol { margin: 6px 0; } .notice ol { padding-left: 20px; }
.notice-link { display: block; margin: 10px 0; padding: 10px 14px; border-radius: 14px; background: var(--soft); color: var(--ink); font-size: 13px; text-decoration: none; }
.notice-link::after { content: " →"; }
.input { width: 100%; font: inherit; padding: 12px 14px; border: 2px solid var(--line); border-radius: 14px; margin: 8px 0 4px; background: #fff; color: var(--ink); }
.err { color: #c0395a; font-size: 13px; min-height: 1.2em; margin-bottom: 6px; }
.kw { position: relative; display: inline; background: none; border: 0; padding: 0 1px; margin: 0; font: inherit; color: var(--ink); border-bottom: 2px dotted var(--a); cursor: pointer; }
.kw rt { font-size: 10px; color: var(--sub); font-family: "Zen Maru Gothic", sans-serif; }
.kw.open::after { content: attr(data-ja); position: absolute; left: 50%; bottom: calc(100% + 6px); transform: translateX(-50%); width: max-content; max-width: 220px; background: var(--ink); color: #fff; font-family: "Zen Maru Gothic", sans-serif; font-size: 12px; line-height: 1.5; padding: 5px 10px; border-radius: 10px; z-index: 5; white-space: normal; text-align: center; }
.big.q-ja { font-size: 28px; line-height: 1.5; }
.big-yomi { font-size: 30px; font-weight: 700; color: var(--ink); }
.card img.ill { object-fit: cover; background: var(--soft); }
