/* 검정 바탕 + 네온 강조색 하나(기본 하늘, 사용자가 바꿀 수 있다). 색을 채우지 않고 글자와 선으로 강조한다. 모서리는 각지게. */
:root {
  color-scheme: dark;
  --bg: #0a0a0a;
  --surface: #161616;
  --surface-2: #242424;
  --ink: #ffffff;
  --ink-2: #e9e8d2;
  --ink-3: #9c9c92;
  --line: #2c2c2c;
  --accent: #4fe3ff; /* 기본 강조색. 내 계정의 "강조색"에서 고르면 index.html 의 짧은 스크립트가 이 값을 덮어쓴다 */
  --accent-ink: #0a0a0a;
  --r: 3px;        /* 버튼·태그 */
  --r-card: 6px;   /* 카드·영상 */
  --font-ko: "Pretendard Variable", Pretendard, "Malgun Gothic", system-ui, sans-serif;
  --font-jp: "Zen Kaku Gothic New", "Yu Gothic", "Meiryo", sans-serif; /* 유튜브 영상과 같은 글씨체 */
  /* 급수 색: 쉬움(초록) → 어려움(빨강) */
  --n5: #4fd08a; --n4: #7fd0c0; --n3: #7fb2ff; --n2: #c89bff; --n1: #ff7a8a; --n0: #8a8a8a;
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  background: var(--bg); color: var(--ink);
  font-family: var(--font-ko); font-size: 15px; line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  display: grid; grid-template-columns: 200px minmax(0, 1fr); min-height: 100vh;
}
a { color: inherit; }
button, input, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
[lang="ja"] { font-family: var(--font-jp); }
h1 { margin: 0; font-size: 28px; letter-spacing: -.01em; }
h1 small { font-size: 16px; font-weight: 500; color: var(--ink-3); margin-left: 6px; }
h2 { margin: 32px 0 12px; font-size: 18px; }
.sub { margin: 4px 0 20px; color: var(--ink-3); }
.search { width: 100%; height: 42px; margin: 0 0 16px; padding: 0 2px; border: 0; border-bottom: 1px solid var(--line); border-radius: 0; background: none; color: inherit; font: inherit; font-size: 16px; }
.search:focus { outline: none; border-color: var(--accent); }
.muted { color: var(--ink-3); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

/* ---------- 옆 메뉴 ---------- */
.side {
  position: sticky; top: 0; align-self: start; height: 100vh;
  display: flex; flex-direction: column; padding: 20px 0;
  background: #000; border-right: 1px solid var(--line);
}
.side a { display: flex; align-items: center; gap: 10px; text-decoration: none; padding: 10px 20px 10px 17px; color: var(--ink-3); font-weight: 700; border-left: 3px solid transparent; white-space: nowrap; }
.side svg { width: 20px; height: 20px; flex: none; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.side-bottom { margin-top: auto; display: flex; flex-direction: column; padding-top: 8px; border-top: 1px solid var(--line); }
.avatar { width: 28px; height: 28px; flex: none; display: grid; place-items: center; border-radius: var(--r); background: var(--accent); color: var(--accent-ink); font-size: 14px; font-weight: 700; }
.avatar.big { width: 56px; height: 56px; font-size: 26px; border-radius: var(--r-card); }
.who { display: flex; flex-direction: column; min-width: 0; line-height: 1.3; }
.who b, .who small { overflow: hidden; text-overflow: ellipsis; }
.who b { color: var(--ink); }
.who small { font-size: 11px; font-weight: 400; }
.side a:hover { color: var(--ink); }
.side a.on { color: var(--ink); border-left-color: var(--accent); }
.side .brand { font-size: 22px; color: var(--ink); border-left-color: transparent; gap: 12px; margin-bottom: 16px; }
.side .brand::before {
  content: ""; width: 18px; height: 18px; flex: none; border-radius: 50%;
  background: radial-gradient(circle, #000 0 15%, var(--accent) 16% 38%, #000 39% 46%, var(--accent) 47% 100%);
}
.count { color: var(--accent); font-size: 13px; }
.page { min-width: 0; display: flex; flex-direction: column; min-height: 100vh; }
main { padding: 28px 32px 48px; max-width: 1200px; width: 100%; margin: 0 auto; flex: 1; }
/* 넓은 화면: 옆 메뉴는 아이콘만 보이다가 커서를 올리면(또는 키보드로 들어가면) 본문 위로 펼쳐진다 */
@media (min-width: 861px) {
  body { grid-template-columns: 60px minmax(0, 1fr); }
  .side { width: 60px; overflow: hidden; z-index: 30; transition: width .15s ease; }
  .side:hover, .side:focus-within { width: 220px; box-shadow: 16px 0 40px rgba(0, 0, 0, .5); }
  .side a > span { transition: opacity .15s ease; }
  .side:not(:hover):not(:focus-within) a > span { opacity: 0; }   /* 접힌 동안 글자가 가장자리로 비치지 않게 */
}

/* ---------- 급수 표시: 색 글자 + 테두리 ---------- */
.lv, .ty { display: inline-block; padding: 0 6px; border: 1px solid; border-radius: var(--r); font-size: 11px; font-weight: 700; line-height: 18px; white-space: nowrap; letter-spacing: .02em; }
.lv { color: var(--n0); }
.lv5 { color: var(--n5); } .lv4 { color: var(--n4); } .lv3 { color: var(--n3); }
.lv2 { color: var(--n2); } .lv1 { color: var(--n1); }
.ty { color: var(--ink-3); }
.dist { display: flex; height: 20px; max-width: 520px; border-radius: var(--r); overflow: hidden; margin-bottom: 20px; gap: 1px; }
.dist span { color: #000; font-size: 11px; font-weight: 700; text-align: center; line-height: 20px; min-width: 4px; }
.dist .lv5 { background: var(--n5); } .dist .lv4 { background: var(--n4); } .dist .lv3 { background: var(--n3); }
.dist .lv2 { background: var(--n2); } .dist .lv1 { background: var(--n1); }

/* ---------- 홈 ---------- */
.card-artist { color: var(--ink-3); font-size: 13px; }
.card-meta { margin-top: 6px; font-size: 13px; color: var(--ink-2); display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }

/* ---------- 곡 ---------- */
.back { display: inline-block; margin-bottom: 12px; color: var(--ink-3); text-decoration: none; font-size: 14px; }
.back:hover { color: var(--ink); }
.song-head .sub { margin-bottom: 12px; }
.stage { display: grid; grid-template-columns: minmax(0, 3fr) minmax(280px, 2fr); gap: 20px; align-items: start; }
.video { aspect-ratio: 16 / 9; background: #000; border-radius: var(--r-card); overflow: hidden; }
.video iframe { width: 100%; height: 100%; display: block; border: 0; }
.ctrl { display: flex; align-items: center; gap: 6px; margin-top: 10px; }
/* 재생 조작: 상자 없이 아이콘과 글자만 */
.ctrl button { min-width: 40px; height: 40px; border: 0; background: none; color: var(--ink-3); font-weight: 700; font-size: 13px; display: grid; place-items: center; }
.ctrl button:hover { color: var(--ink); }
.ctrl #play { color: var(--ink); }
.ctrl #play:hover { color: var(--accent); }
.ctrl #play svg { width: 30px; height: 30px; }
.ctrl #mute svg { width: 22px; height: 22px; }
.ctrl #vol { flex: none; width: 84px; margin-left: 0; }
@media (pointer: coarse) { .ctrl #vol { display: none; } } /* 휴대폰은 기기 볼륨 버튼을 쓴다 */
.ctrl input[type=range] { flex: 1; accent-color: var(--accent); min-width: 0; margin: 0 6px; }
.time { font-size: 13px; color: var(--ink-3); font-variant-numeric: tabular-nums; white-space: nowrap; }
.now { border: 1px solid var(--line); border-top: 2px solid var(--accent); border-radius: var(--r-card); padding: 14px 16px 16px; max-height: 70vh; overflow: auto; }
.now h2 { margin: 0 0 12px; font-size: 13px; color: var(--accent); letter-spacing: .04em; }
.now .items { grid-template-columns: 1fr; }

/* ---------- 급수 필터: 밑줄 탭 ---------- */
.chips { display: flex; flex-wrap: wrap; gap: 0 4px; margin-bottom: 16px; border-bottom: 1px solid var(--line); }
.chip { border: 0; border-bottom: 2px solid transparent; margin-bottom: -1px; padding: 8px 10px; background: none; color: var(--ink-3); font-size: 14px; font-weight: 700; }
.chip:hover { color: var(--ink); }
.chip b { font-weight: 500; font-size: 12px; margin-left: 2px; opacity: .7; }
.chip.on { color: var(--ink); border-bottom-color: var(--accent); }

/* ---------- 표현 카드 ---------- */
/* 한 줄에 최대 3칸. 칸이 넓어야 긴 표현도 같은 모양을 유지한다 */
.items { display: grid; grid-template-columns: repeat(auto-fill, minmax(340px, 1fr)); gap: 8px; }
.grp + .grp { margin-top: 32px; }
/* 묶음 제목: 급수 글자는 카드에 있으니 여기서는 급수 색 선과 개수만 둔다 */
.grp h3 { margin: 0 0 10px; display: flex; align-items: center; gap: 10px; }
.grp h3::before { content: ""; flex: 1; height: 2px; background: currentColor; opacity: .55; }
.lv0 { color: var(--n0); }
.grp h3 small { color: var(--ink-3); font-weight: 500; font-size: 13px; }
.hint { margin: -6px 0 12px; font-size: 13px; color: var(--ink-3); }
.item { background: var(--surface); border-radius: var(--r-card); padding: 12px 14px; display: flex; flex-direction: column; gap: 2px; user-select: none; -webkit-user-select: none; -webkit-touch-callout: none; }
.item.saved { box-shadow: inset 3px 0 0 var(--accent); } /* 단어장에 담긴 표현 */
.play { border: 0; background: none; padding: 4px; margin-top: 4px; color: var(--ink-3); display: grid; }
.play:hover { color: var(--accent); }
.play svg { width: 16px; height: 16px; }
/* 첫 줄: 표기·읽기 | 태그 | ▶ . 태그와 ▶ 는 늘 오른쪽 위에 고정되고, 긴 표기는 왼쪽 칸 안에서만 줄을 바꾼다 */
.item-top { display: grid; grid-template-columns: minmax(0, 1fr) auto auto auto; align-items: start; gap: 8px; }
/* 카드의 급수 태그는 단어장 담기 버튼이다. 담으면 색이 채워지고 + 가 ✓ 로 바뀐다 */
button.lv { background: none; cursor: pointer; font-family: inherit; }
button.lv:hover { background: var(--surface-2); }
button.lv.on { color: #000; }
button.lv5.on { background: var(--n5); border-color: var(--n5); } button.lv4.on { background: var(--n4); border-color: var(--n4); }
button.lv3.on { background: var(--n3); border-color: var(--n3); } button.lv2.on { background: var(--n2); border-color: var(--n2); }
button.lv1.on { background: var(--n1); border-color: var(--n1); } button.lv0.on { background: var(--n0); border-color: var(--n0); }
.head { display: flex; flex-wrap: wrap; align-items: baseline; gap: 0 8px; min-width: 0; }
.tags { display: flex; gap: 4px; padding-top: 7px; }
.tags:empty { display: none; }
.w { font-size: 20px; font-weight: 700; }
.r, .alt { color: var(--ink-3); font-size: 13px; }
.m { color: var(--ink-2); }
/* 한글 발음: 읽기 글자에 커서를 올리거나 누르면 말풍선으로 뜬다 */
.pron { position: relative; border: 0; background: none; padding: 0; cursor: help; font-family: var(--font-jp); }
.pron::after {
  content: attr(data-pron); display: none; position: absolute; left: 0; bottom: calc(100% + 4px); z-index: 5;
  padding: 2px 8px; border-radius: var(--r); background: var(--ink); color: #000;
  font: 700 13px var(--font-ko); white-space: nowrap; pointer-events: none;
}
.pron.show::after, .pron:focus-visible::after { display: block; }
@media (hover: hover) { .pron:hover::after { display: block; } }
/* 테스트 답 화면: 글자 모양은 둘레의 글을 따르고, 문장의 발음은 길어서 줄을 바꾼다 */
.drill-ans .pron { font: inherit; color: inherit; text-align: left; }
.drill-ans p:has(> .pron) { margin-top: 30px; } /* 말풍선이 윗줄을 가리지 않게 그 높이만큼 띄운다 */
.pron-long::after { white-space: normal; width: max-content; max-width: 86vw; }
.also { font-size: 12px; color: var(--ink-3); }
.also a { color: var(--ink-2); }
.also a:hover, .more:hover { color: var(--accent); }
.more { border: 0; background: none; padding: 4px 0; margin: -4px 0; font-size: 12px; color: var(--ink-2); text-decoration: underline; }

/* ---------- 표현이 나오는 노래 목록 창 ---------- */
dialog { width: min(480px, 92vw); max-height: 80vh; padding: 0; border: 1px solid var(--line); border-radius: var(--r-card); background: var(--surface); color: var(--ink); }
dialog[open] { display: flex; flex-direction: column; }
dialog::backdrop { background: rgba(0, 0, 0, .6); }
dialog header { display: flex; align-items: center; justify-content: space-between; padding: 12px 8px 12px 16px; border-bottom: 1px solid var(--line); }
dialog h2 { margin: 0; font-size: 16px; }
dialog header button { border: 0; background: none; width: 36px; height: 36px; color: var(--ink-3); }
dialog header button:hover { color: var(--ink); }
/* 사용법 안내 창: 위는 그림, 아래는 설명과 버튼 */
#guide { width: min(440px, 92vw); }
.guide-art input { width: min(280px, 70vw); height: 46px; padding: 0 12px; border: 1px solid var(--line); border-radius: var(--r); background: var(--surface); color: var(--ink); font: inherit; font-size: 18px; text-align: center; }
.guide-art .tts-vol { width: min(320px, 76vw); }
.guide-art { height: 190px; display: grid; place-content: center; justify-items: center; gap: 14px; padding: 0 20px; background: var(--bg); border-bottom: 1px solid var(--line); }
.guide-logo { display: flex; align-items: center; gap: 14px; font-size: 56px; font-weight: 900; letter-spacing: -.04em; line-height: 1; }
.guide-logo .auth-disc { width: 52px; height: 52px; margin: 0; }
.guide-lv { margin: 0; display: flex; gap: 6px; }
.guide-card { width: min(320px, 76vw); }
.guide-save { margin: 0; display: flex; align-items: center; gap: 14px; color: var(--ink-3); font-size: 20px; }
.guide-save .lv { font-size: 16px; line-height: 30px; padding: 0 12px; }
.guide-save .lv.on { color: #000; background: var(--n5); border-color: var(--n5); }
.guide-body { padding: 20px; }
.guide-body h2 { font-size: 19px; }
.guide-text { margin: 8px 0 0; min-height: 4.8em; color: var(--ink-2); }
.guide-dots { margin: 12px 0 0; display: flex; gap: 6px; }
.guide-dots i { width: 6px; height: 6px; border-radius: 50%; background: var(--line); }
.guide-dots i.on { background: var(--accent); }
.guide-btns { display: flex; gap: 8px; margin-top: 16px; }
.guide-btns .btn { flex: 1; }
.guide-btns .btn.primary { flex: 2; }
.rows { overflow: auto; }
.row { display: flex; align-items: center; gap: 12px; padding: 8px 16px; text-decoration: none; }
.row + .row { border-top: 1px solid var(--line); }
.row:hover { background: var(--surface-2); }
.row img { width: 64px; aspect-ratio: 16 / 9; object-fit: cover; border-radius: var(--r); background: var(--surface-2); flex: none; }
.row-text { display: flex; flex-direction: column; min-width: 0; line-height: 1.35; }
.row-text b, .row-text small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.row-text small { color: var(--ink-3); }
.row-time { margin-left: auto; color: var(--ink-3); font-size: 13px; font-variant-numeric: tabular-nums; white-space: nowrap; }
.row:hover .row-time { color: var(--accent); }

/* ---------- 로그인 · 회원가입 · 계정 ---------- */
.auth { min-height: calc(100vh - 200px); display: grid; grid-template-columns: minmax(0, 1fr) 400px; gap: 56px; align-items: center; max-width: 960px; margin: 0 auto; }
.auth-hero { position: relative; }
/* 로고의 원을 크게 키운 무늬. 글자 뒤에 깔린다 */
.auth-hero::before {
  content: ""; position: absolute; z-index: -1; width: 640px; aspect-ratio: 1; left: -210px; top: 50%; transform: translateY(-50%); border-radius: 50%;
  background: repeating-radial-gradient(circle, transparent 0 30px, color-mix(in srgb, var(--accent) 9%, transparent) 30px 32px);
  -webkit-mask-image: radial-gradient(circle, #000 35%, transparent 70%); mask-image: radial-gradient(circle, #000 35%, transparent 70%);
}
.auth-disc {
  display: block; width: 64px; height: 64px; margin-bottom: 20px; border-radius: 50%;
  background: radial-gradient(circle, var(--bg) 0 15%, var(--accent) 16% 38%, var(--bg) 39% 46%, var(--accent) 47% 100%);
}
.auth-word { margin: 0; font-size: clamp(72px, 9vw, 128px); font-weight: 900; line-height: 1; letter-spacing: -.04em; }
.auth-tag { margin: 14px 0 18px; font-size: 20px; font-weight: 700; color: var(--ink-2); }
.auth-lv { margin: 0; display: flex; gap: 6px; }
.auth-lv .lv { font-size: 12px; line-height: 22px; padding: 0 9px; }
.auth .form { max-width: none; padding: 36px 32px 28px; border: 1px solid var(--line); border-radius: var(--r-card); background: var(--surface); }
.auth .form h1 { font-size: 26px; }
.auth .form input { background: var(--bg); }
.steps { display: flex; gap: 4px; margin: 4px 0 0; }
.steps i { flex: 1; height: 3px; background: var(--line); }
.steps i.on { background: var(--accent); }
.consent { margin: 0; padding: 4px 12px; border: 1px solid var(--line); border-radius: var(--r); display: flex; flex-direction: column; }
.form label.check { flex-direction: row; align-items: center; gap: 10px; padding: 8px 0; font-size: 13px; cursor: pointer; }
.form label.check.all { border-bottom: 1px solid var(--line); color: var(--ink); font-weight: 700; }
.form label.check input { width: 18px; height: 18px; padding: 0; flex: none; accent-color: var(--accent); }
.form textarea { padding: 10px 12px; border: 1px solid var(--line); border-radius: var(--r); background: var(--surface); font-size: 15px; line-height: 1.6; resize: vertical; }
.form textarea:focus { outline: none; border-color: var(--accent); }
.form.wide { max-width: 560px; }
.form-foot.split { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.btn.as-link { display: grid; place-items: center; text-decoration: none; }

/* 단어장 요약: 목록 위의 한 줄. 누르면 급수별·노래별 숫자가 펼쳐진다 */
.vocab-sum { margin-bottom: 20px; border: 1px solid var(--line); border-radius: var(--r-card); background: var(--surface); }
.vocab-sum summary { display: flex; align-items: center; gap: 16px; padding: 12px 16px; cursor: pointer; list-style: none; }
.vocab-sum summary::-webkit-details-marker { display: none; }
.vocab-sum .big-num { font-size: 26px; font-weight: 900; line-height: 1; white-space: nowrap; }
.big-num small { margin-left: 3px; font-size: 13px; font-weight: 500; color: var(--ink-3); }
.sum-text { font-size: 13px; color: var(--ink-2); white-space: nowrap; }
.vocab-sum .dist { flex: 1; height: 8px; max-width: none; margin: 0; }
.dist .lv0 { background: var(--n0); }
.fold { font-size: 13px; color: var(--ink-3); white-space: nowrap; }
.fold::after { content: "자세히 ▾"; }
.vocab-sum[open] .fold::after { content: "접기 ▴"; }
.vocab-sum summary:hover .fold { color: var(--ink); }
.vocab-more { display: flex; flex-wrap: wrap; gap: 12px 32px; align-items: center; padding: 12px 16px 14px; border-top: 1px solid var(--line); }
.lv-list { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 6px 14px; }
.lv-list li { display: flex; align-items: center; gap: 6px; }
.lv-list b { font-size: 13px; color: var(--ink-2); }
.song-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.song-chips a { padding: 3px 10px; border: 1px solid var(--line); border-radius: var(--r); font-size: 13px; color: var(--ink-2); text-decoration: none; }
.song-chips a:hover { color: var(--ink); border-color: var(--ink-3); }
.song-chips b { margin-left: 4px; color: var(--accent); }
.links a span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.empty { max-width: 460px; margin-top: 24px; padding: 28px 24px; border: 1px solid var(--line); border-radius: var(--r-card); background: var(--surface); display: flex; flex-direction: column; gap: 16px; }
.empty-title { margin: 0; font-size: 18px; font-weight: 700; }
.empty ol { margin: 0; padding-left: 20px; color: var(--ink-2); display: flex; flex-direction: column; gap: 6px; }

/* 내 계정: 칸을 나눠 화면을 채운다 */
.account { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 16px; margin-top: 20px; align-items: start; }
.panel { padding: 20px; border: 1px solid var(--line); border-radius: var(--r-card); background: var(--surface); }
.panel h2 { margin: 0 0 4px; font-size: 16px; }
.panel.form { max-width: none; }
.panel.form input { background: var(--bg); }
.panel.profile { grid-column: 1 / -1; display: flex; align-items: center; gap: 16px; }
a.panel.profile { text-decoration: none; }
a.panel.profile .end { margin-left: auto; color: var(--ink-3); font-size: 22px; }
.panel.profile + .btn { margin: 12px 0 28px; }
.panel.profile .name-row { display: flex; align-items: center; gap: 6px; }
.panel.profile .name { font-size: 20px; }
.panel.profile .edit { width: 32px; height: 32px; flex: none; display: grid; place-items: center; border: 0; background: none; color: var(--ink-3); cursor: pointer; }
.panel.profile .edit:hover { color: var(--accent); }
.panel.profile .edit svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.panel.profile .name input { width: min(260px, 60vw); height: 36px; padding: 0 10px; border: 1px solid var(--accent); border-radius: var(--r); background: var(--bg); font-size: 18px; font-weight: 700; outline: none; }
.panel.profile p { margin: 0; font-size: 13px; }
.links { display: flex; flex-direction: column; margin-top: 8px; }
.links a { display: flex; justify-content: space-between; padding: 10px 0; border-top: 1px solid var(--line); text-decoration: none; color: var(--ink-2); }
.links a:hover { color: var(--ink); }
.links a::after { content: "›"; color: var(--ink-3); }
.links a b { margin-left: auto; margin-right: 10px; color: var(--accent); font-weight: 700; }
.form { max-width: 360px; display: flex; flex-direction: column; gap: 12px; }
.form .sub { margin: 0 0 8px; }
.form label { display: flex; flex-direction: column; gap: 4px; font-size: 13px; color: var(--ink-2); }
.form input { height: 42px; padding: 0 12px; border: 1px solid var(--line); border-radius: var(--r); background: var(--surface); font-size: 15px; }
.form input:focus { outline: none; border-color: var(--accent); }
.form input[readonly] { color: var(--ink-3); }
.btn { height: 42px; border: 1px solid var(--line); border-radius: var(--r); background: none; font-weight: 700; }
.btn:hover { border-color: var(--ink-3); }
.btn:disabled { opacity: .5; cursor: default; }
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.btn.kakao { background: #fee500; border-color: #fee500; color: #191919; }
.btn.danger { color: var(--n1); }
.or { display: flex; align-items: center; gap: 10px; color: var(--ink-3); font-size: 12px; }
.or::before, .or::after { content: ""; flex: 1; height: 1px; background: var(--line); }
.error { margin: 0; color: var(--n1); font-size: 13px; }
.notice { margin: 0; color: var(--n5); font-size: 13px; }
.stats { display: flex; flex-wrap: wrap; gap: 12px 40px; margin: 8px 0 28px; }
.stats div { display: flex; flex-direction: column; }
.stats b { font-size: 32px; line-height: 1.1; font-variant-numeric: tabular-nums; }
.stats span { font-size: 13px; color: var(--ink-3); }
.tbl-wrap { overflow-x: auto; margin: 0 0 32px; }
.tbl { width: 100%; border-collapse: collapse; font-size: 14px; }
.tbl th { padding: 8px 12px 8px 4px; border-bottom: 1px solid var(--line); text-align: left; font-size: 12px; font-weight: 500; color: var(--ink-3); white-space: nowrap; }
.tbl td { padding: 12px 12px 12px 4px; border-bottom: 1px solid var(--line); vertical-align: top; white-space: nowrap; }
.tbl tbody tr:hover { background: var(--surface); }
.tbl td.wide { white-space: normal; min-width: 200px; max-width: 420px; overflow-wrap: anywhere; }
.tbl .num { text-align: right; font-variant-numeric: tabular-nums; }
.tbl .dim { color: var(--ink-3); }
.tbl td small { display: block; margin-top: 2px; font-size: 12px; color: var(--ink-3); white-space: normal; }
.tbl .acts { text-align: right; }
.tbl .acts .btn-text { padding: 0 0 0 12px; }
.tbl select { max-width: 150px; height: 28px; padding: 0 6px; border: 1px solid var(--line); border-radius: var(--r); background: var(--bg); color: var(--ink-2); font: inherit; font-size: 12px; }
.sug[hidden] { display: none; }
.sug { display: flex; flex-direction: column; margin-top: -8px; }
.sug button { padding: 10px 4px; border: 0; border-bottom: 1px solid var(--line); background: none; color: var(--ink); font: inherit; font-size: 15px; text-align: left; }
.sug button:hover b, .sug button:hover { color: var(--accent); }
.sug a { padding: 10px 4px; border-bottom: 1px solid var(--line); font-size: 15px; text-decoration: none; }
.sug small { margin-left: 6px; font-size: 12px; color: var(--ink-3); }
.form-foot { margin: 4px 0 0; font-size: 13px; color: var(--ink-3); }
.form-foot a { color: var(--ink); }

.toast { position: fixed; left: 50%; bottom: 28px; transform: translateX(-50%); background: var(--ink); color: #000; padding: 8px 16px; border-radius: var(--r); font-weight: 700; z-index: 50; display: flex; align-items: center; gap: 14px; white-space: nowrap; }
.toast[hidden] { display: none; }
.toast button { border: 0; border-left: 1px solid #bbb; background: none; padding: 0 0 0 14px; color: #000; font-weight: 700; text-decoration: underline; }

/* ---------- 좁은 화면 ---------- */
@media (max-width: 860px) {
  :root { --ink-3: #b4b4a8; }                 /* 폰: 흐린 글자를 한 단계 밝게, 본문 글자를 조금 크게 */
  body { display: block; font-size: 16px; }
  /* 노래 목록: 작은 표지 + 오른쪽 글자. 한 화면에 여러 곡이 보인다 */
  .card-meta { margin-top: 4px; }
  .page { min-height: 0; }
  main { padding: 20px 16px 40px; }
  .vocab-sum summary { flex-wrap: wrap; gap: 6px 12px; }
  .vocab-sum .dist { order: 9; flex-basis: 100%; }
  .auth { min-height: 0; grid-template-columns: 1fr; gap: 20px; max-width: 440px; }
  .auth-hero::before { display: none; }
  .auth-hero { display: grid; grid-template-columns: auto 1fr; align-items: center; column-gap: 12px; }
  .auth-disc { width: 40px; height: 40px; margin: 0; grid-row: span 2; }
  .auth-word { font-size: 34px; }
  .auth-tag { margin: 0; font-size: 13px; }
  .auth-lv { display: none; }
  .auth .form { padding: 24px 20px 20px; }
  .stage { grid-template-columns: 1fr; }
  .now { max-height: none; }
}

/* ---------- 폰 (앱 포함): 영상과 "지금 나오는 표현"을 위에 붙여 두고, 목록만 그 아래에서 스크롤한다 ---------- */
@media (max-width: 860px) {
  .stage { position: sticky; top: 0; z-index: 10; display: block; margin: 0 -16px; background: var(--bg); border-bottom: 1px solid var(--line); }
  .video { border-radius: 0; }                /* 영상은 화면 폭을 꽉 채운다 */
  .ctrl { margin: 2px 8px 0; }
  .ctrl button { height: 36px; }

  /* 지금 나오는 표현: 카드 대신 한 줄에 하나. "표기 읽기 급수 ······ 뜻" */
  .now { border: 0; border-top: 1px solid var(--line); border-radius: 0; padding: 6px 16px 8px; max-height: 30vh; overflow: auto; }
  .now h2 { margin: 0 0 2px; font-size: 11px; }
  .now .items { gap: 0; }
  .now .item { flex-direction: row; align-items: baseline; gap: 10px; padding: 5px 0 5px 8px; background: none; border-radius: 0; }
  .now .item + .item { border-top: 1px solid var(--line); }
  .now .item-top { display: flex; align-items: baseline; gap: 6px; flex: none; max-width: 62%; }
  .now .head { flex-wrap: nowrap; gap: 0 6px; }
  .now .w { font-size: 17px; }
  .now .r, .now .alt { font-size: 12px; white-space: nowrap; }
  .now .tags { padding-top: 0; align-self: center; }
  .now .m { margin-left: auto; text-align: right; font-size: 14px; }
  .now .ty, .now .play, .now .also { display: none; }  /* 좁은 줄에서는 급수만 남긴다. 나머지는 아래 목록에 있다 */
  .now .muted { margin: 4px 0; font-size: 13px; }
}

/* ---------- 총 단어장 · 테스트 ---------- */
.quiz { max-width: 520px; margin: 0 auto; }
.quiz h1 { font-size: 22px; }
.quiz-top { display: flex; justify-content: space-between; margin: 0 0 8px; font-size: 13px; color: var(--ink-3); }
/* 트랙: 번호 01~10 과 그 아래 줄. 한 문제를 풀 때마다 한 칸이 찬다 */
.trk { display: flex; gap: 4px; margin: 0 0 6px; padding: 0; list-style: none; font-size: 11px; font-variant-numeric: tabular-nums; color: var(--ink-3); transition: opacity .4s; }
.trk li { flex: 1; min-width: 0; text-align: center; transition: color .3s; }
.trk:has(li:nth-child(11)), .trk-line:has(i:nth-child(11)) { gap: 2px; } .trk:has(li:nth-child(11)) { font-size: 9px; } /* 카드 20장 */
.trk li.ok { color: var(--n5); } .trk li.no { color: var(--n1); } .trk li.cur { color: var(--ink); font-weight: 700; }
.trk-line { display: flex; gap: 4px; height: 3px; margin-bottom: 20px; transform-origin: left center; transition: gap .4s; }
.trk-line i { flex: 1; position: relative; background: var(--surface-2); transition: background .4s; }
.trk-line i::after { content: ''; position: absolute; inset: 0; background: var(--accent); transform: scaleX(0); transform-origin: left; transition: transform .35s ease-out, background .4s; }
.trk-line i.ok::after { background: var(--n5); transform: none; }
.trk-line i.no::after { background: var(--n1); transform: none; }
.trk-line i.cur::after { transform: scaleX(.35); } .trk-line i.re::after { transform: none; }
.trk li.miss { color: var(--ink-3); }
.trk-line i.miss::after { background: var(--n1); opacity: .35; transform: none; } /* 두 번째도 틀린 칸: 흐리게 남는다 */
.trk-line.all { gap: 0; } .trk-line.all i { background: var(--accent); } .trk-line.all i::after { background: var(--accent); transform: none; }
.trk-line.all i.miss { background: var(--surface-2); }
@keyframes trk-in { from { opacity: 0; } }
.flash { position: relative; min-height: 300px; padding: 20px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px; border: 1px solid var(--line); border-radius: var(--r-card); background: var(--surface); text-align: center; cursor: pointer; user-select: none; -webkit-user-select: none; touch-action: pan-y; transition: transform .17s ease, opacity .17s ease, border-color .1s; }
.flash[data-dir="yes"] { border-color: var(--n5); } .flash[data-dir="no"] { border-color: var(--n1); }
.flash .tags { position: absolute; top: 14px; left: 14px; display: flex; gap: 6px; }
.flash p { margin: 0; }
.flash-w { font-family: var(--font-jp); font-size: 44px; font-weight: 700; line-height: 1.25; overflow-wrap: anywhere; }
.flash-a { visibility: hidden; }
.flash.open .flash-a { visibility: visible; }
.flash-r { font-family: var(--font-jp); color: var(--ink-3); }
.flash .flash-m { margin-top: 6px; font-size: 20px; font-weight: 700; color: var(--accent); }
.flash-hint { position: absolute; bottom: 14px; font-size: 12px; color: var(--ink-3); }
.flash.open .flash-hint { display: none; }
.quiz-btns { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin: 12px 0; }
.quiz-btns .btn { height: 48px; }
.quiz-btns .no { color: var(--n1); } .quiz-btns .yes { color: var(--n5); }
.quiz-scene { display: flex; align-items: center; justify-content: center; gap: 6px; height: 42px; border: 1px solid var(--line); border-radius: var(--r); text-decoration: none; font-size: 14px; font-weight: 700; color: var(--ink-2); }
.quiz-scene:hover { border-color: var(--ink-3); }
.quiz-scene svg { width: 14px; height: 14px; flex: none; }
.quiz-tip { margin: 14px 0 0; font-size: 12px; color: var(--ink-3); text-align: center; }
.quiz-res { display: flex; gap: 20px; margin: 8px 0 16px; font-size: 16px; font-weight: 700; }
.quiz-res b { font-size: 26px; }
@media (max-width: 860px) {
  .flash { min-height: 46vh; }
}

/* 테스트에서 노래로 넘어왔을 때만 뜨는 돌아가기 버튼 */
.quiz-return { display: inline-grid; padding: 0 16px; margin-bottom: 12px; border-color: var(--accent); color: var(--accent); }
/* 밀 때 카드 위에 찍히는 도장 */
.stamp { position: absolute; top: 18px; padding: 2px 10px; border: 2px solid; border-radius: var(--r); font-size: 20px; font-weight: 900; opacity: 0; transition: opacity .1s; }
.stamp.yes { left: 18px; color: var(--n5); transform: rotate(-10deg); }
.stamp.no { right: 18px; color: var(--n1); transform: rotate(10deg); }
.flash[data-dir="yes"] .stamp.yes, .flash[data-dir="no"] .stamp.no { opacity: 1; }
.flash[data-dir="yes"] .tags, .flash[data-dir="no"] .tags { visibility: hidden; }
.tip-touch { display: none; }
@media (pointer: coarse) { .tip-touch { display: inline; } .tip-key { display: none; } }

/* 맞힌 횟수, 아는 단어 목록(취소) */
.flash-n { position: absolute; top: 16px; right: 14px; font-size: 12px; color: var(--ink-3); }
.flash[data-dir="yes"] .flash-n, .flash[data-dir="no"] .flash-n { visibility: hidden; }
.known-box summary { padding: 12px; cursor: pointer; font-weight: 700; }
.known-box summary small { margin-left: 8px; font-weight: 400; color: var(--ink-3); }
.known-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 0 16px; padding: 0 12px 8px; }
.known-row { display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 8px; padding: 6px 0; border-top: 1px solid var(--line); font-size: 14px; }
.known-row b { font-family: var(--font-jp); }
.known-row span { color: var(--ink-3); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.known-row button { height: 28px; padding: 0 10px; border: 1px solid var(--line); border-radius: var(--r); background: none; font-size: 12px; font-weight: 700; }
.known-row button:hover { border-color: var(--ink-3); }

button.quiz-scene { width: 100%; background: none; cursor: pointer; }
.known-tools { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 16px; padding: 0 12px 10px; }
.known-tools input { flex: 1 1 200px; height: 36px; padding: 0 10px; border: 1px solid var(--line); border-radius: var(--r); background: var(--bg); }
.known-tools .chips { margin: 0; border: 0; }
.known-list > p, .known-list > .btn { grid-column: 1 / -1; margin: 8px 0; }

/* ---------- 단어장 묶음 화면, 단어 테스트 화면 ---------- */
.known-row { grid-template-columns: 28px auto 1fr auto auto; }
.known-row small { color: var(--ink-3); font-size: 12px; white-space: nowrap; }
@media (max-width: 860px) { .side a[data-nav] { padding-left: 12px; padding-right: 12px; } }

/* 줄 목록: 네모 칸 없이 선으로만 나눈다 (단어장, 단어 테스트) */
.menu { max-width: 720px; margin: 0 0 28px; border-top: 1px solid var(--line); }
.menu-row { display: grid; grid-template-columns: 1fr auto; align-items: center; gap: 2px 16px; min-height: 64px; padding: 12px 4px; border-bottom: 1px solid var(--line); text-decoration: none; }
a.menu-row:hover { background: var(--surface); }
.menu-row b { font-size: 17px; }
button.menu-row { width: 100%; border: 0; border-bottom: 1px solid var(--line); background: none; color: inherit; font: inherit; text-align: left; cursor: pointer; }
.menu-row .btn.end { height: 36px; padding: 0 14px; }
.account-menu { margin-top: 20px; }
.menu-row small { grid-column: 1; color: var(--ink-3); font-size: 13px; line-height: 1.4; }
.menu-row .end { grid-column: 2; grid-row: 1 / span 2; display: flex; align-items: center; gap: 10px; color: var(--ink-2); font-size: 14px; font-weight: 700; white-space: nowrap; }
a.menu-row .end::after, button.menu-row .end::after { content: "›"; color: var(--ink-3); font-size: 22px; font-weight: 400; line-height: 1; }
.menu-row .end.hot { color: var(--accent); }
.menu-row .end.go { height: 36px; padding: 0 18px; border-radius: var(--r); background: var(--accent); color: var(--accent-ink); }
.menu-row .end.go::after { content: none; }
.menu-row.off b { color: var(--ink-2); } .menu-row.off .end { color: var(--ink-3); font-weight: 400; }
.menu-h { max-width: 720px; display: flex; justify-content: space-between; align-items: baseline; margin: 0 0 8px; padding: 0 4px; font-size: 13px; color: var(--ink-3); }
.menu-h small { font-size: 12px; font-weight: 400; }
.lv-row { grid-template-columns: 62px 1fr auto; min-height: 52px; }
/* 큰 타일: 홈 카드처럼 줄 대신 둥근 덩어리 (단어장, 테스트 고르기). 단어장은 첫 줄(오늘의 테스트)이 한 줄 다 쓰는 강조색 타일 */
.menu.big { border: 0; display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: 18px; }
.menu.big .menu-row { border: 0; border-radius: 18px; background: var(--surface-2); min-height: 118px; padding: 18px; display: flex; flex-direction: column; justify-content: flex-end; align-items: flex-start; gap: 4px; }
.menu.big a.menu-row:hover { background: var(--surface-2); filter: brightness(1.15); }
.menu.big .menu-row b { font-size: 18px; word-break: keep-all; }
.menu.big .menu-row .end:empty { display: none; }
.menu.big .menu-row .end.go { margin-top: 8px; }
.menu.big .lv-row i { align-self: stretch; background: var(--line); }
.menu.big .lv-row .end { min-width: 0; font-weight: 700; }
.menu.big .lv-row .end::after { content: none; }
.menu.big.hub:first-of-type > :first-child { grid-column: 1 / -1; min-height: 170px; background: var(--accent); }
.menu.big.hub:first-of-type > :first-child, .menu.big.hub:first-of-type > :first-child * { color: var(--accent-ink); }
.menu.big.hub:first-of-type > :first-child b { font-size: 28px; }
.menu.big.hub:first-of-type > :first-child .end.go, .menu.big.hub:first-of-type > :first-child .btn { background: none; border: 1.5px solid var(--accent-ink); }
.menu.big.hub:first-of-type > :nth-child(2), .menu.big.hub:last-of-type > * { grid-column: 1 / -1; min-height: 0; } /* 1층 오답 노트, 4층 장기 기억 테스트는 혼자 한 줄 */
.lv-row .lv { justify-self: start; }
.lv-row i { height: 4px; background: var(--surface-2); }
.lv-row i u { display: block; height: 100%; background: currentColor; }
.lv-row .end { grid-column: 3; grid-row: 1; min-width: 78px; justify-content: flex-end; font-weight: 500; }
.known-box { max-width: 720px; margin: 0 0 24px; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.known-box summary { padding: 16px 4px; }
.known-tools, .known-list { padding-left: 4px; padding-right: 4px; }

/* 넓은 화면: 줄 목록 두 개를 나란히 놓아 오른쪽이 비지 않게 한다 */

/* ---------- 간소화: 색은 강조색 하나, 버튼은 채우지 않는다 ---------- */
h1 { letter-spacing: -.02em; }
.side { border-right: 0; border-bottom: 0; }
.item, .flash, .now { border: 0; }
.now { background: var(--surface); }
/* 주 버튼: 채우지 않고 테두리와 글자만 강조색 */
.btn.primary, .menu-row .end.go { background: none; border: 1px solid var(--accent); color: var(--accent); }
.btn.primary:hover, a.menu-row:hover .end.go { background: color-mix(in srgb, var(--accent) 12%, transparent); }
.quiz-btns .yes { border-color: var(--accent); color: var(--accent); }
.quiz-btns .no { color: var(--ink); }
.flash .flash-m { color: var(--ink); }
.quiz-scene { border: 0; color: var(--ink-3); }
/* 단어장에 담은 급수 태그: 채우지 않고 옅게 깔기만 한다 */
button.lv.on { color: inherit; }
button.lv5.on, button.lv4.on, button.lv3.on, button.lv2.on, button.lv1.on, button.lv0.on { background: color-mix(in srgb, currentColor 16%, transparent); border-color: currentColor; }
button.lv5.on { color: var(--n5); } button.lv4.on { color: var(--n4); } button.lv3.on { color: var(--n3); } button.lv2.on { color: var(--n2); } button.lv1.on { color: var(--n1); } button.lv0.on { color: var(--n0); }
/* 그래프는 급수 색을 쓰지 않는다: 진도 막대는 강조색 하나, 급수 분포는 밝기 단계 */
.lv-row i u { background: var(--accent); }
.dist .lv5 { background: #f2f2f2; } .dist .lv4 { background: #bdbdbd; } .dist .lv3 { background: #8a8a8a; }
.dist .lv2 { background: #5c5c5c; } .dist .lv1 { background: #3a3a3a; } .dist .lv0 { background: #2a2a2a; }
.dist .lv2, .dist .lv1, .dist .lv0 { color: #fff; }
/* 강조색 고르기 (내 계정 화면) */
.tint { display: flex; gap: 14px; padding: 4px 2px; }
.tint button { width: 28px; height: 28px; padding: 0; border: 0; border-radius: var(--r); background: var(--c); }
.tint button[aria-pressed="true"] { outline: 2px solid var(--ink); outline-offset: 2px; }
.tint .bg-pick { border: 1px solid var(--line); }

/* ---------- 흰 바탕 (화면 설정에서 고름, accent.js 가 html 에 data-theme="light" 를 붙인다) ---------- */
:root[data-theme="light"] {
  color-scheme: light;
  --bg: #fafaf7; --surface: #ffffff; --surface-2: #f0efe9;
  --ink: #111111; --ink-2: #2a2a26; --ink-3: #6b6b63; --line: #e3e2da;
  --accent-ink: #ffffff;
  --n5: #1f9d5c; --n4: #18917f; --n3: #2f6fd6; --n2: #8a4fd8; --n1: #d8384f; --n0: #7a7a7a;
}
[data-theme="light"] .side { background: var(--surface); }
[data-theme="light"] .side .brand::before { background: radial-gradient(circle, var(--bg) 0 15%, var(--accent) 16% 38%, var(--bg) 39% 46%, var(--accent) 47% 100%); }
[data-theme="light"] .side:hover, [data-theme="light"] .side:focus-within { box-shadow: 16px 0 40px rgba(0, 0, 0, .08); }
[data-theme="light"] button.lv.on, [data-theme="light"] .guide-save .lv.on, [data-theme="light"] .toast, [data-theme="light"] .toast button { color: #fff; }
[data-theme="light"] .toast button { border-left-color: #555; }
[data-theme="light"] .dist .lv5 { background: #d9d8d0; color: #111; } [data-theme="light"] .dist .lv4 { background: #b4b3aa; color: #111; }
[data-theme="light"] .dist .lv3 { background: #87867e; color: #fff; } [data-theme="light"] .dist .lv2 { background: #5c5b55; }
[data-theme="light"] .dist .lv1 { background: #3a3a36; } [data-theme="light"] .dist .lv0 { background: #222; }
[data-theme="light"] dialog::backdrop { background: rgba(0, 0, 0, .35); }

/* 로그인하지 않은 사람에게 보여 주는 단어장 안내 */
.gate { max-width: 520px; display: flex; flex-direction: column; gap: 14px; }
.gate p { margin: 0; }
.gate-title { font-size: 18px; font-weight: 700; }
.gate ul { margin: 0; padding-left: 20px; color: var(--ink-2); display: flex; flex-direction: column; gap: 6px; }
.gate-btns { display: flex; gap: 8px; margin-top: 6px; }
.gate-btns .btn { flex: 1; }

/* 이해도, 구간 반복·속도, 듣고 고르기 */
.know { color: var(--accent); white-space: nowrap; }
.ctrl2 { display: flex; gap: 4px; margin-top: 2px; }
.ctrl2 button { height: 36px; padding: 0 12px; border: 0; background: none; color: var(--ink-3); font-size: 13px; font-weight: 700; }
.ctrl2 button:hover { color: var(--ink); }
.ctrl2 button.on { color: var(--accent); }

/* ---------- 노래 화면: 새 곡을 크게, 나머지는 타일 ---------- */
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.hero { display: grid; grid-template-columns: minmax(0, 520px) minmax(0, 1fr); gap: 28px; align-items: end; margin-bottom: 40px; text-decoration: none; }
.hero img { width: 100%; aspect-ratio: 16 / 9; object-fit: cover; border-radius: var(--r-card); background: var(--surface-2); }
.hero-text { display: flex; flex-direction: column; gap: 4px; padding-bottom: 6px; min-width: 0; }
.hero-label { color: var(--accent); font-size: 13px; font-weight: 700; }
.hero-title { font-size: 34px; line-height: 1.2; letter-spacing: -.02em; }
.hero-title small { display: block; margin-top: 4px; font-size: 15px; font-weight: 500; letter-spacing: 0; color: var(--ink-3); }
.shelf-h { margin: 0 0 12px; font-size: 18px; }
.tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 24px 16px; margin-bottom: 40px; }
.shelf { display: flex; gap: 16px; margin-bottom: 40px; padding-bottom: 4px; overflow-x: auto; scrollbar-width: none; }
.shelf::-webkit-scrollbar { display: none; }
.shelf .tile { flex: 0 0 190px; scroll-snap-align: start; }
/* 곡이 반쯤 잘려 보이지 않게: 넓은 화면은 3곡이나 4곡이 딱 맞게 보이고 버튼으로 통째로 넘긴다. 폰은 손으로 끌면 곡 단위로 멈춘다 */
.shelf { scroll-snap-type: x mandatory; }
@media (min-width: 861px) { .shelf .tile { flex-basis: calc((100% - 32px) / 3); } }
@media (min-width: 1300px) { .shelf .tile { flex-basis: calc((100% - 48px) / 4); } }
.tile { display: flex; flex-direction: column; gap: 2px; min-width: 0; text-decoration: none; }
.tile img { width: 100%; aspect-ratio: 16 / 9; object-fit: cover; border-radius: var(--r-card); margin-bottom: 6px; background: var(--surface-2); transition: opacity .15s; }
/* 첫 화면: 노래 목록을 받는 동안 index.html 의 회색 블록(홈 모양)을 보여 준다. route() 가 #app 을 채우면 사라진다 */
.skel i { display: block; background: var(--surface-2); border-radius: var(--r); animation: skel 1s ease-in-out infinite alternate; }
.skel .sk-img { width: 100%; aspect-ratio: 16 / 9; border-radius: var(--r-card); margin-bottom: 8px; }
.skel .sk-t { height: 1.6em; width: 70%; margin-bottom: 10px; }
.skel .sk-s { height: .9em; width: 40%; margin-bottom: 16px; }
.skel .sk-now { height: 260px; border-radius: var(--r-card); }
/* 노래 화면: 유튜브 영상이 뜨기 전까지 영상 칸도 회색으로 깜빡인다 */
.video:not(:has(iframe)) { background: var(--surface-2); animation: skel 1s ease-in-out infinite alternate; }
@keyframes skel { to { opacity: .45; } }
@media (prefers-reduced-motion: reduce) { .skel i, .video { animation: none; } }
.tile:hover img, .hero:hover img { opacity: .85; }
.tile b { font-size: 15px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tile small { color: var(--ink-3); font-size: 12px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ---------- 단어장: 제목 옆 아이콘, 난이도 버튼 ---------- */
.head-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; max-width: 720px; margin-bottom: 12px; }
.head-row h1 { margin: 0; }
/* 공유 고르기 창: 스토리 카드 미리보기 + 두 버튼 */
.share-sheet { width: min(360px, calc(100vw - 32px)); padding: 20px; border: 1px solid var(--line); border-radius: 18px; background: var(--bg); color: var(--ink); text-align: center; }
.share-sheet img { display: block; height: min(52vh, 480px); margin: 0 auto 12px; border-radius: 12px; }
.share-sheet .quiz-btns { justify-content: center; }
/* 체력: 칸 다섯, 찬 칸은 강조색. 단어장 제목 옆과 체력이 없을 때 화면 */
.energy { display: inline-flex; align-items: center; gap: 4px; margin-right: auto; }
.energy i { width: 8px; height: 16px; border-radius: 3px; background: var(--line); }
.energy i.on { background: var(--accent); }
.energy small { margin-left: 6px; font-size: 12px; color: var(--ink-3); }
.quiz > .energy { margin: 4px 0 12px; }
/* 메뉴의 체력: 오른쪽 위. 웹(1100px 이상)은 위 메뉴 오른쪽 계정 옆, 그보다 좁으면 화면 오른쪽 위에 떠 있다. 문제를 푸는 동안은 숨긴다 */
.side a.energy-nav { gap: 0; }
.side a.energy-nav[hidden], body:has(.quiz #dQ) .side a.energy-nav { display: none; }
.energy-nav .energy { margin: 0; }
.energy-nav .energy i { width: 6px; height: 13px; border-radius: 2px; }
@media (max-width: 1099px) {
  .side a.energy-nav { position: fixed; top: calc(env(safe-area-inset-top) + 10px); right: 12px; bottom: auto; left: auto; z-index: 45; flex: none; width: auto; height: auto; padding: 6px 10px; border: 1px solid var(--line); border-radius: 999px; background: var(--bg); }
  .energy-nav .energy small { font-size: 11px; }
  body:has(#energyNav:not([hidden])) .head-row { padding-right: 150px; } /* 제목 줄 오른쪽 도구를 체력 자리만큼 비킨다 */
}
.head-tools { display: flex; gap: 2px; margin-right: -8px; }
.head-tools a { display: flex; align-items: center; gap: 6px; height: 40px; padding: 0 8px; text-decoration: none; font-size: 13px; font-weight: 700; color: var(--ink-2); }
.head-tools a:hover { color: var(--ink); }
.head-tools svg { width: 20px; height: 20px; flex: none; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.head-tools b { color: var(--accent); }
.more-mark { height: 1px; }
.panel .menu { max-width: none; margin-bottom: 0; }
.panel .menu-h { max-width: none; margin-top: 12px; }
.panel.fold summary { cursor: pointer; font-weight: 700; }
.panel.fold[open] summary { margin-bottom: 8px; }
.tab { display: none; }

/* ---------- 폰: 메뉴를 화면 아래 탭으로 ---------- */
@media (max-width: 860px) {
  body { padding-bottom: calc(58px + env(safe-area-inset-bottom)); }
  .side { position: fixed; left: 0; right: 0; top: auto; bottom: 0; z-index: 40; height: auto; flex-direction: row; padding: 0 0 env(safe-area-inset-bottom); border-top: 1px solid var(--line); background: #000; }
  .side .brand, .side #reportLink, .who { display: none; }
  .side-bottom { display: contents; }
  .side a { flex: 1; flex-direction: column; justify-content: center; gap: 3px; height: 58px; padding: 0; border: 0; font-size: 11px; }
  .side a.on { color: var(--accent); }
  .side a > svg { width: 22px; height: 22px; }
  .side .count { display: none; }
  .side .avatar { width: 22px; height: 22px; font-size: 12px; }
  .tab { display: inline; }
  .toast { bottom: calc(72px + env(safe-area-inset-bottom)); }
  .hero { grid-template-columns: 1fr; gap: 12px; margin: -20px -16px 32px; }
  .hero img { border-radius: 0; }
  .hero-text { padding: 0 16px; }
  .hero-title { font-size: 26px; }
  .tiles { grid-template-columns: 1fr 1fr; gap: 20px 12px; margin-bottom: 32px; }
  .shelf { margin: 0 -16px 32px; padding: 0 16px 4px; gap: 16px; scroll-padding-left: 16px; }
  .shelf .tile { flex-basis: calc((100vw - 48px) / 2); } /* 두 곡이 딱 들어온다: 양옆 여백 16 + 16, 사이 16. 셋째 곡은 화면 밖에서 시작한다 */
  .head-tools span { display: none; }
  .head-tools a { padding: 0 10px; }
}

/* 지금 나오는 표현: 재생 버튼은 제목 옆에 하나만 둔다. 카드마다 있던 것은 숨긴다(같은 줄이라 모두 같은 곳으로 간다) */
.now h2 { display: flex; align-items: center; gap: 6px; }
.now .play { display: none; }
.now-play { display: grid; place-items: center; width: 28px; height: 28px; padding: 0; border: 0; background: none; color: var(--accent); }
.now-play[hidden] { display: none; }
.now-play svg { width: 16px; height: 16px; }
.now-play:hover { color: var(--ink); }

/* ---------- 고르기·조각 맞추기 테스트 ---------- */
.drill-how { margin: 0 0 10px; font-size: 13px; color: var(--ink-3); }
.drill-how, .drill-ctx { text-align: center; }
.drill-word { text-align: center; margin: 40px 0 28px; font-family: var(--font-jp); font-size: 60px; font-weight: 700; line-height: 1.25; overflow-wrap: anywhere; }
.drill-word:has(+ .drill-ctx) { margin-bottom: 6px; }
.drill-ctx { margin: 0 0 20px; font-family: var(--font-jp); font-size: 18px; color: var(--ink-2); overflow-wrap: anywhere; }
.drill-ctx b { color: var(--accent); }
.drill-word small { font-size: 16px; font-weight: 500; color: var(--ink-3); }
.drill-word.ko { font-family: var(--font-ko); font-size: 28px; }
.drill-opts { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.drill-opts .btn { height: auto; min-height: 104px; padding: 12px; border: 0; border-radius: 18px; background: var(--surface-2); justify-content: center; text-align: center; font-size: 19px; word-break: keep-all; }
.drill-opts .btn small { color: var(--ink-3); font-weight: 500; }
.drill-opts .btn:disabled, .pieces .btn:disabled { opacity: .45; cursor: default; }
.drill-opts .btn.ok { background: var(--n5); color: #0a0a0a; opacity: 1; }
.drill-opts .btn.no { background: var(--n1); color: #0a0a0a; opacity: 1; }
.piece-line { min-height: 52px; margin-bottom: 14px; border-bottom: 1px solid var(--line); font-family: var(--font-jp); font-size: 30px; font-weight: 700; letter-spacing: .08em; }
/* 넣은 조각: 글자처럼 보이지만 누르면 빠진다 */
.piece-line button { border: 0; background: none; padding: 0; color: inherit; font: inherit; letter-spacing: inherit; cursor: pointer; }
.piece-line.sent button { margin-right: .35em; }
.pieces { display: flex; flex-wrap: wrap; gap: 8px; }
.pieces .piece { width: 52px; height: 52px; font-family: var(--font-jp); font-size: 22px; }
.btn-text { border: 0; background: none; padding: 8px 0; color: var(--ink-3); font-size: 13px; font-weight: 700; text-decoration: none; white-space: nowrap; }
.btn-text:hover { color: var(--accent); }
.btn-text.on { color: var(--accent); }
.drill-ans { margin-top: 18px; padding-top: 14px; border-top: 1px solid var(--line); }
.drill-ans p { margin: 0 0 6px; }
.drill-ans b { font-family: var(--font-jp); font-size: 20px; }
.drill-ans .btn { width: 100%; height: 48px; margin-top: 10px; }
/* 풀이가 길어 화면 아래로 밀려도 다음 버튼은 화면 바닥에 붙어 늘 보인다. 둘레를 바탕색으로 덮어 뒤 글자가 비치지 않게 */
.drill-ans #dNext { position: sticky; bottom: 12px; z-index: 5; background-color: var(--bg); box-shadow: 0 0 0 12px var(--bg); }
@media (max-width: 860px) { .drill-ans #dNext { bottom: calc(58px + env(safe-area-inset-bottom) + 10px); } } /* 아래 메뉴 위에 */
.drill-res { font-weight: 700; }
.drill-video { margin-top: 18px; }
.drill-ans .drill-video { margin: 10px 0 4px; }
/* 연속 학습 화면: 화면 전체를 덮는다. 재생 막대 모양 */
.streak { position: fixed; inset: 0; z-index: 200; background: var(--bg); display: flex; flex-direction: column; justify-content: center; gap: 20px;
  padding: 32px max(24px, calc(50vw - 210px)); padding-bottom: calc(32px + env(safe-area-inset-bottom)); }
/* 돌아가는 LP판: 연속 화면과 안내 화면이 같이 쓴다 */
.lp { width: 120px; height: 120px; flex: none; border: 1px solid var(--line); border-radius: 50%; animation: lp-spin 3.6s linear infinite;
  background:
    radial-gradient(circle, var(--bg) 0 3px, var(--accent) 4px 22px, transparent 23px),
    conic-gradient(from 20deg, transparent 0 30deg, rgba(255, 255, 255, .13) 50deg, transparent 70deg 210deg, rgba(255, 255, 255, .13) 230deg, transparent 250deg),
    repeating-radial-gradient(circle, #131313 0 2px, #1d1d1d 2px 4px); }
@keyframes lp-spin { to { transform: rotate(360deg); } }
/* ---------- 이달의 LP: 판(선 하나가 하루)과 커버(글자 하나). 색은 --c (그 달 글자의 급수 색) ---------- */
.lp-disc .pl { fill: #0d0d0d; stroke: #2a2a2a; }
.lp-disc .g { fill: none; stroke: #2b2b2b; stroke-width: 1; }
.lp-disc .g.on { stroke: var(--c); stroke-width: 1.3; }
.lp-disc .lab { fill: var(--c); }
.lp-disc .hole { fill: #000; }
.lp-disc .g-miss { fill: none; stroke: #0d0d0d; stroke-opacity: .85; stroke-width: 1.8; animation: trk-in .5s ease-out; } /* 두 번째도 틀린 칸은 홈에서 흐리게 */
/* 끊긴 홈을 이은 결과 화면: 어둠이 걷히고 그 홈이 하얗게 한 번 빛난 뒤 판 색으로 */
.fix-lp { margin: 4px 0 18px; text-align: center; }
.fix-lp svg { width: 200px; height: 200px; }
.fix-lp .sub { margin: 10px 0 0; }
.lp-disc .g-miss.fixing { animation: fix-out .9s .7s ease-in forwards; }
.lp-disc .g.fixed { animation: fix-flash 1.4s 1.2s ease-out both; }
.fix-lp svg { animation: fix-glow 1.4s 1.2s ease-out; }
@keyframes fix-out { to { opacity: 0; } }
@keyframes fix-flash { 0% { stroke: var(--c); } 30% { stroke: #fff; stroke-width: 6; } 100% { stroke: var(--c); stroke-width: 1.3; } }
@keyframes fix-glow { 30% { filter: drop-shadow(0 0 18px var(--c)) brightness(1.3); } }
@media (prefers-reduced-motion: reduce) { .lp-disc .g-miss.fixing { animation: none; opacity: 0; } .lp-disc .g.fixed, .fix-lp svg { animation: none; } }
.lp-fly { fill: none; stroke: var(--c); stroke-width: 2.2; stroke-linecap: round; }
.streak-lp { width: 100%; max-width: 360px; height: auto; flex: none; margin-left: -24px; }
.lp-set { --w: 150px; position: relative; width: calc(var(--w) * 1.5); height: var(--w); }
.lp-set > .lp-disc { position: absolute; left: calc(var(--w) * .54); top: calc(var(--w) * .03); width: calc(var(--w) * .94); height: calc(var(--w) * .94); }
.lp-cover { position: absolute; left: 0; top: 0; width: var(--w); height: var(--w); background: #000; border: 1px solid var(--line); overflow: hidden; }
.lp-set.none .lp-cover { background: none; border-style: dashed; }
.lp-meta { position: absolute; top: calc(var(--w) * .045); font-size: calc(var(--w) * .04); letter-spacing: .14em; color: var(--ink-3); white-space: nowrap; }
.lp-meta.tl { left: calc(var(--w) * .055); } .lp-meta.tr { right: calc(var(--w) * .055); }
.lp-meta b { color: var(--c, var(--ink-3)); }
.lp-read { position: absolute; right: calc(var(--w) * .055); top: calc(var(--w) * .155); writing-mode: vertical-rl; font-family: var(--font-jp); font-weight: 700; font-size: calc(var(--w) * .058); letter-spacing: .3em; color: var(--c); }
.lp-k { position: absolute; left: calc(var(--w) * -.01); bottom: calc(var(--w) * -.02); /* 아래로 많이 넘기면 貶 처럼 아래 획이 많은 글자가 잘려 깨져 보인다 */ font-family: var(--font-jp); font-weight: 900; font-size: calc(var(--w) * .87); line-height: 1; color: var(--ink); }
.lp-big .lp-set { --w: min(240px, 58vw); margin: 8px 0 20px; }
.lp-shelf { display: flex; flex-wrap: wrap; gap: 24px 12px; }
.lp-shelf .lp-set { --w: 104px; }
.lp-shelf small { display: block; margin-top: 6px; font-size: 12px; color: var(--ink-3); }
.lp-shelf small.now { color: var(--ink); font-weight: 700; }
/* 끝난 해: 책등으로 꽂혀 있다가 누르면 펼쳐진다 */
.lp-shelf + .shelf-h { margin-top: 40px; }
/* 내 뮤즈: 고르는 화면의 노래 칸은 버튼, 다 판 노래 판의 커버는 곡 제목 */
.muse-pick h1 { font-size: 34px; margin: 12px 0 10px; }
.muse-pick .sub { max-width: 560px; margin-bottom: 28px; }
button.tile { border: 0; padding: 0; background: none; color: inherit; font: inherit; text-align: left; cursor: pointer; }
.tile.on img { outline: 3px solid var(--accent); outline-offset: 2px; }
.lp-set.muse .lp-k { left: 8%; right: 8%; bottom: 9%; font-size: calc(var(--w) * .15); line-height: 1.2; word-break: keep-all; overflow-wrap: anywhere; }.lp-year { border-bottom: 1px solid var(--ink-3); margin-bottom: 20px; }
.lp-year summary { display: flex; align-items: flex-end; gap: 14px; padding: 0 4px; cursor: pointer; list-style: none; }
.lp-year summary::-webkit-details-marker { display: none; }
.lp-year summary b { margin-left: auto; font-size: 22px; line-height: 1.5; }
.lp-year summary small { font-size: 13px; color: var(--ink-3); line-height: 2.6; }
.lp-spines { display: flex; align-items: flex-end; gap: 3px; }
.lp-spines i { position: relative; flex: none; width: 22px; height: 104px; border: 1px solid var(--c); background: #000; }
.lp-spines i.full { background: var(--c); }
.lp-spines i.disc::before { content: ''; position: absolute; left: 50%; top: 32px; width: 5px; height: 5px; margin-left: -2.5px; border-radius: 50%; background: var(--c); }
.lp-spines i.none { border: 1px dashed var(--line); background: none; height: 96px; }
.lp-spines u { position: absolute; left: 0; right: 0; bottom: 5px; text-align: center; font-size: 9px; font-style: normal; text-decoration: none; color: var(--ink-3); }
.lp-spines em { position: absolute; left: 0; right: 0; top: 7px; text-align: center; font-family: var(--font-jp); font-style: normal; font-weight: 900; font-size: 16px; line-height: 1; color: var(--ink); }
.lp-spines i.full u { color: #000; font-weight: 700; }
.lp-spines i.full em { color: #000; }
.lp-year[open] { border-bottom: 0; }
.lp-year[open] summary { border-bottom: 1px solid var(--ink-3); margin-bottom: 20px; }
/* 폰: 책등 열두 개가 너비를 거의 채워서, 해와 모은 수는 책등 위 줄로 올린다 */
@media (max-width: 600px) {
  .lp-year summary { flex-wrap: wrap; gap: 0 14px; }
  .lp-spines { order: 2; flex-basis: 100%; }
  .lp-year summary b { margin-left: 0; }
  .lp-year summary small { margin-left: auto; }
}
.no-song { grid-column: 1 / -1; }
.shelf-h .btn { height: 34px; padding: 0 12px; font-size: 13px; }
.shelf-h small { font-size: 13px; font-weight: 500; color: var(--ink-3); }
@media (prefers-reduced-motion: reduce) { .lp { animation: none; } }
.shelf-h { display: flex; align-items: center; justify-content: space-between; }
.shelf-nav { display: flex; gap: 6px; }
.shelf-nav[hidden] { display: none; }
.shelf-nav button { width: 32px; height: 32px; padding: 0; border: 1px solid var(--line); border-radius: var(--r); background: none; color: var(--ink-2); font-size: 18px; line-height: 1; cursor: pointer; }
.shelf-nav button:hover { border-color: var(--ink-3); }
.tts-vol { display: flex; align-items: center; gap: 14px; width: 100%; }
.tts-vol input { flex: 1; min-width: 0; accent-color: var(--accent); }
.drill-say { display: flex; flex-wrap: wrap; gap: 0 20px; }
.streak-top { margin: 0; font-size: 13px; font-weight: 700; letter-spacing: .08em; color: var(--accent); }
.streak-n { margin: 0; font-size: 28px; font-weight: 700; line-height: 1; }
.streak-n b { font-size: 132px; letter-spacing: -.04em; margin-right: 6px; display: inline-block; animation: streak-in .5s cubic-bezier(.2, .9, .3, 1) both; }
@keyframes streak-in { from { transform: translateY(24px); opacity: 0; } }
.streak-bar { list-style: none; display: flex; gap: 4px; margin: 8px 0 0; padding: 0; font-size: 12px; color: var(--ink-3); }
.streak-bar li { flex: 1; display: flex; flex-direction: column; gap: 10px; position: relative; }
.streak-bar i { height: 3px; background: var(--surface-2); }
.streak-bar .on i { background: var(--accent); transform-origin: left; animation: streak-fill .6s .25s ease-out both; }
@keyframes streak-fill { from { transform: scaleX(0); } }
.streak-bar .st-now { color: var(--ink); font-weight: 700; }
.streak-bar .st-now::after { content: ''; position: absolute; right: -2px; top: -5px; width: 13px; height: 13px; border-radius: 50%; background: var(--accent); }
@media (prefers-reduced-motion: reduce) { .streak-n b, .streak-bar .on i { animation: none; } }
.streak-msg { margin: 0; line-height: 1.7; color: var(--ink-2); }
.streak .btn { width: 100%; height: 50px; margin-top: 12px; }
/* 이해도 바: 나의 한 곡의 표현마다 막대 하나. 아는 단어 = 꽉 참, 익히는 중 = 반, 아직 = 바닥 */
.mbar { margin: 6px 0 24px; }
.mbar-top { display: flex; align-items: baseline; gap: 2px; margin: 0 0 12px; }
.mbar-top b { font-size: 44px; font-weight: 800; line-height: 1; color: var(--accent); font-variant-numeric: tabular-nums; }
.mbar-top b + b { font-size: 22px; }
.mbar-top span { margin-left: 8px; color: var(--ink-2); }
.mbar-strip { display: flex; gap: 2px; height: 32px; align-items: flex-end; }
.mbar-strip i { flex: 1; height: 100%; border-radius: 2px; background: var(--surface-2); transform: scaleY(.3); transform-origin: bottom; transition: transform .3s cubic-bezier(.2, .9, .3, 1.4), background .3s; }
.mbar-strip i.s1 { background: color-mix(in srgb, var(--accent) 45%, transparent); transform: scaleY(.6); }
.mbar-strip i.s2 { background: var(--accent); transform: none; }
.mbar-leg { display: flex; gap: 14px; margin: 10px 0 0; font-size: 13px; color: var(--ink-3); }
.mbar-leg em { font-style: normal; color: var(--ink); }
.grow .mbar-strip { height: 56px; }
.grow .streak-n b { font-size: 100px; } /* 소수 한 자리(29.1)라 연속 일수보다 작게 */
.grow-sub { margin: -8px 0 0; color: var(--ink-2); }
.grow-sub em { font-style: normal; font-weight: 700; color: var(--accent); }
@media (prefers-reduced-motion: reduce) { .mbar-strip i { transition: none; } }
/* 이번 달의 단어 고르기 화면(#/lpword). 왼쪽 큰 글자가 커버에 새겨질 한자 */
.lpw-list { display: flex; flex-direction: column; gap: 8px; margin: 18px 0; }
.lpw-opt { display: flex; align-items: center; gap: 16px; padding: 12px 8px 12px 14px; border-radius: 14px; background: var(--surface-2); }
.lpw-opt .heart { margin-left: auto; width: 44px; height: 44px; }
.lpw-opt .heart svg { width: 26px; height: 26px; }
/* 하트: 빈 하트 = 고를 수 있음, 채운 하트 = 지금 이번 달의 단어 */
.heart, .known-row .heart { display: grid; place-items: center; width: 28px; height: 28px; padding: 0; border: 0; border-radius: 50%; background: none; color: var(--ink-3); cursor: pointer; }
.heart svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2; }
.heart:hover { color: var(--ink); }
.heart.on { color: var(--n1); }
.heart.on svg { fill: currentColor; animation: heart-pop .35s cubic-bezier(.2, .9, .3, 1.4); }
@keyframes heart-pop { from { transform: scale(.6); } }
@media (prefers-reduced-motion: reduce) { .heart.on svg { animation: none; } }
a.lp-big { display: block; color: inherit; }
.lpw-opt > b { min-width: 44px; text-align: center; font-family: var(--font-jp); font-weight: 900; font-size: 40px; line-height: 1; }
.lpw-opt span { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.lpw-opt span b { font-size: 18px; }
.lpw-opt small { color: var(--ink-3); overflow-wrap: anywhere; }
.tile-head { display: flex; align-items: center; gap: 8px; min-width: 0; }
.tile-head b { flex: 1; min-width: 0; }
.menu-row small.warn { color: var(--n1); }
/* 문장 공부 (임시) */
.tag-demo { margin-left: 6px; padding: 1px 7px; border: 1px solid var(--line); border-radius: 999px; font-size: 11px; font-weight: 600; color: var(--ink-3); vertical-align: middle; }
.drill-ans ruby { ruby-position: over; }
.drill-ans rt { font-size: 11px; font-weight: 500; color: var(--ink-3); }
.drill-full { font-family: var(--font-jp); font-size: 22px; font-weight: 700; line-height: 2; }
.drill-ko { margin: 0 0 8px; font-size: 17px; color: var(--ink-2, var(--ink-3)); }
.drill-sent { margin: 0 0 24px; font-family: var(--font-jp); font-size: 26px; font-weight: 700; line-height: 1.5; overflow-wrap: anywhere; }
.drill-sent u { text-decoration: none; color: var(--accent); }
.piece-line.sent { font-size: 22px; letter-spacing: 0; line-height: 52px; }
.pieces .piece.wide { width: auto; padding: 0 14px; font-size: 18px; }
.ex { margin-top: 4px; font-size: 13px; color: var(--ink-3); }
.ex span { font-family: var(--font-jp); color: var(--ink-2); margin-right: 6px; }
.now .ex { display: none; }
.quiz .row { display: flex; align-items: center; gap: 12px; padding: 10px 0; margin-bottom: 8px; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); text-decoration: none; }
.head-row h2 { margin: 0; }

/* 지금 나오는 표현의 "다시 듣기": 제목 줄 오른쪽 끝, 흐린 글자 */
.now h2 { justify-content: space-between; }
.now-play { width: auto; height: 24px; gap: 4px; grid-auto-flow: column; color: var(--ink-3); font-size: 12px; font-weight: 500; letter-spacing: 0; }
.now-play svg { width: 11px; height: 11px; }
.now-play:hover { color: var(--accent); }

/* ---------- 넓은 화면을 채우기: 노래 화면 오른쪽에 공부 줄과 진도, 단어장은 두 줄 ---------- */
.home-side { margin-bottom: 32px; }
.home-side .menu { margin-bottom: 20px; }
.only-wide { display: none; }
@media (min-width: 1100px) {
  .home { display: grid; grid-template-columns: minmax(0, 1fr) 340px; grid-template-areas: "hero side" "rest side"; gap: 0 48px; align-items: start; }
  .home .hero { grid-area: hero; grid-template-columns: minmax(0, 1fr); gap: 14px; }
  .home-side { grid-area: side; }
  .home-rest { grid-area: rest; min-width: 0; }
  .only-wide { display: block; }
  .split { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 0 56px; align-items: start; max-width: 1200px; }
  .split .menu, .split .known-box, .split .menu-h { max-width: none; }
  .split .known-box { margin-top: 0; }
}

/* 폰: 테스트의 문제, 답, 예문, 버튼, "다음"이 영상을 틀지 않으면 한 화면에 들어오게 사이를 줄인다 (360x740 기준) */
@media (max-width: 600px) {
  .trk-line { margin-bottom: 10px; }  .back:has(+ .quiz) { margin-bottom: 6px; }
  .drill-how { margin-bottom: 6px; }
  .drill-ko { margin-bottom: 4px; }
  .drill-sent { margin-bottom: 14px; }
  .drill-full { line-height: 1.6; }
  .drill-word { margin: 24px 0 18px; font-size: 52px; }
  .drill-word.ko { font-size: 26px; }
  .drill-opts { gap: 8px; }
  .drill-opts .btn { min-height: 84px; padding: 8px 10px; font-size: 17px; }
  .drill-ans { margin-top: 10px; padding-top: 10px; }
  .drill-ans p:has(> .pron) { margin-top: 22px; }
  .drill-ans .btn { height: 44px; margin-top: 6px; }
  .drill-say { gap: 0 14px; }
  /* 문제를 푸는 화면은 화면 높이를 딱 채운다: "다음"이 아래 메뉴 바로 위에 오고, 남는 자리는 문제 위로 보내 보기와 버튼을 아래로 내린다.
     답 자리는 답을 고르기 전에도 비워 두어서(250px) 답이 나올 때 문제가 덜 움직인다. 62px = 위 여백 20 + 돌아가기 줄 28 + 아래 여백 14 */
  main:has(> .quiz #dQ) { padding-bottom: 14px; }
  .quiz:has(#dQ) { display: flex; flex-direction: column; min-height: calc(100vh - 120px); min-height: calc(100dvh - 58px - env(safe-area-inset-bottom) - 62px); }
  .quiz #dQ { margin-top: auto; }
  .quiz #dAns { display: flex; flex-direction: column; min-height: 250px; }
  .quiz #dAns[hidden] { visibility: hidden; }
  .quiz #dAns > .btn.primary { margin-top: auto; }
}

/* ---------- 웹(1100px 이상): 위 글자 메뉴, 그림 옆 큰 제목, 한 줄 띠, 네 줄 노래 목록. 폰·앱은 그대로 ---------- */
@media (min-width: 1100px) {
  /* 위 메뉴: 아이콘 대신 글자 */
  body { grid-template-columns: minmax(0, 1fr); }
  .side, .side:hover, .side:focus-within { position: sticky; top: 0; width: auto; height: 64px; flex-direction: row; align-items: stretch; padding: 0 max(40px, calc((100vw - 1320px) / 2 + 40px)); background: var(--bg); border-bottom: 1px solid var(--line); box-shadow: none; overflow: visible; }
  .side a { align-items: center; padding: 0 16px; border-left: 0; font-size: 14px; }
  .side a[data-nav] > svg { display: none; }
  .side:not(:hover):not(:focus-within) a > span { opacity: 1; }
  .side a.on { box-shadow: inset 0 -2px var(--accent); }
  .side .brand { margin: 0 28px 0 0; padding-left: 0; font-size: 20px; }
  .side-bottom { flex-direction: row; margin: 0 0 0 auto; padding: 0; border-top: 0; }
  .page { min-height: calc(100vh - 64px); }
  main { max-width: 1320px; padding: 28px 40px 80px; }

  /* 새 노래: 그림 옆에 큰 제목, 왼쪽에 세로로 "오늘의 신곡" */
  .home { display: block; }
  .home .hero { grid-template-columns: auto minmax(0, 1.1fr) minmax(0, 1fr); gap: 0 44px; align-items: center; margin: 0; padding: 28px 0 56px; }
  .home .hero::before { content: "오늘의 신곡"; writing-mode: vertical-rl; align-self: stretch; padding-right: 14px; border-right: 1px solid var(--line); font-size: 13px; font-weight: 700; letter-spacing: .4em; color: var(--accent); }
  .home .hero-label { display: none; }
  .home .hero-text { gap: 10px; padding: 0; }
  .home .hero-title { font-family: var(--font-jp); font-size: clamp(48px, 5.2vw, 76px); font-weight: 900; line-height: 1.08; letter-spacing: -.03em; }
  .home .hero-title small { margin-top: 14px; font-family: var(--font-ko); font-size: 24px; font-weight: 700; color: var(--ink-2); }
  .home .hero .card-artist { font-size: 16px; }
  .home .hero .card-meta { margin-top: 14px; }

  /* 한 줄 띠: 오늘의 테스트 + 이어서 공부하기(노래가 중심) */
  .home-side { display: grid; grid-template-columns: 300px minmax(0, 1fr); gap: 0 48px; align-items: center; margin: 0 0 72px; padding: 22px 0; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
  .home-side .menu { margin: 0; }
  .home-side .menu-row { border-bottom: 0; }
  .home-side .going { min-width: 0; }
  .home-side .shelf { margin-bottom: 0; }

  /* 모든 노래: 제목 왼쪽, 찾기 오른쪽, 네 줄 */
  .home-rest { display: grid; grid-template-columns: minmax(0, 1fr) minmax(280px, 400px); gap: 0 40px; align-items: end; }
  .home-rest > * { grid-column: 1 / -1; }
  .home-rest .shelf-h { font-size: 28px; letter-spacing: -.02em; }
  .home-rest .shelf-h:has(+ #sq) { grid-column: 1; margin: 0; }
  .home-rest #sq { grid-column: 2; margin: 0; }
  .home-rest #sSort { margin: 20px 0 24px; }
  .home-rest .tiles { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 44px 24px; }
}

/* ---------- 홈: 엔피츠 인스타 · 내한 공연 ---------- */
#enp .shelf-h small { margin-left: 8px; margin-right: auto; }
.nh-h { margin-bottom: 4px; }
#enp { margin-top: 20px; }
.ig-row { display: flex; gap: 12px; margin-bottom: 24px; overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: none; }
.ig-row::-webkit-scrollbar { display: none; }
.ig-card { flex: 0 0 58%; max-width: 240px; display: flex; flex-direction: column; gap: 6px; min-width: 0; scroll-snap-align: start; text-decoration: none; color: var(--ink-2); }
.ig-card img { width: 100%; aspect-ratio: 4 / 5; object-fit: cover; border-radius: 16px; background: var(--line); }
.ig-card small { font-size: 12px; color: var(--ink-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.nh-list { margin-bottom: 40px; }
.nh-row { display: grid; grid-template-columns: 52px minmax(0, 1fr) auto; gap: 12px; align-items: baseline; padding: 12px 0; border-top: 1px solid var(--line); }
.nh-row b { font-size: 20px; font-variant-numeric: tabular-nums; }
.nh-row span { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.nh-row i { display: flex; flex-wrap: wrap; gap: 2px 4px; font-size: 13px; font-style: normal; color: var(--ink-3); }
.nh-row i a { color: var(--accent); text-decoration: none; }
.nh-row small { font-size: 12px; color: var(--ink-3); text-align: right; }
.nh-row small.soon { color: var(--n1); font-weight: 700; }
@media (max-width: 860px) { .ig-row { margin: 0 -16px 24px; padding: 0 16px; scroll-padding-left: 16px; } .ig-card { max-width: none; } }
