:root {
  --bg0: #0b0f14; --bg1: #121820; --panel: rgba(18, 24, 32, .72); --glass: rgba(20, 27, 36, .62);
  --line: rgba(255, 255, 255, .08); --line2: rgba(255, 255, 255, .14);
  --text: #eef2f7; --muted: #8b97a7; --dim: #5f6b7a;
  --accent: #00a6b2; --accent-ink: #062a2d; --blue: #4f8cff; --amber: #ffd447; --red: #ff6b6b;
  --radius: 14px; --font: "Pretendard", "Malgun Gothic", system-ui, sans-serif;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { margin: 0; height: 100%; background: var(--bg0); color: var(--text); font-family: var(--font); font-size: 14px; -webkit-font-smoothing: antialiased; }
button { font-family: inherit; }
#app { display: grid; grid-template-columns: 300px 1fr; height: 100vh; }
.app-body #app { height: calc(100vh - 56px); }
:focus-visible { outline: 2px solid var(--blue); outline-offset: 2px; }

/* ---------- 상단 바 */
.topbar { height: 56px; display: flex; align-items: center; gap: 18px; padding: 0 16px; background: rgba(18,24,32,.9); border-bottom: 1px solid var(--line); backdrop-filter: blur(12px); position: relative; z-index: 30; }
.brand-link { display: flex; align-items: center; gap: 9px; font-weight: 800; font-size: 17px; color: var(--text); text-decoration: none; }
.brand-link img { border-radius: 8px; }
.brand-link .on { color: var(--accent); }
.topnav { display: flex; gap: 4px; margin-left: 8px; }
.topnav-btn { background: transparent; border: 0; color: var(--muted); padding: 8px 12px; border-radius: 8px; font-size: 14px; cursor: pointer; }
.topnav-btn:hover { color: var(--text); background: rgba(255,255,255,.05); }
.topnav-btn.active { color: var(--text); background: rgba(255,255,255,.08); }
.top-right-tools { margin-left: auto; display: flex; align-items: center; gap: 12px; position: relative; }
.goal { display: flex; align-items: center; gap: 6px; font-size: 12px; color: var(--muted); }
.goal #goalText { font-variant-numeric: tabular-nums; }
.profile-btn { display: flex; align-items: center; gap: 8px; background: rgba(255,255,255,.06); border: 1px solid var(--line2); color: var(--text); border-radius: 999px; padding: 4px 12px 4px 4px; cursor: pointer; font-size: 13px; }
.pav { width: 28px; height: 28px; border-radius: 50%; background: linear-gradient(135deg, var(--accent), #007f88); display: grid; place-items: center; font-size: 15px; }
.menu { position: absolute; right: 0; top: 46px; width: 240px; background: #161c24; border: 1px solid var(--line2); border-radius: 12px; box-shadow: 0 16px 40px rgba(0,0,0,.5); padding: 6px; z-index: 40; }
.menu-head { padding: 10px 12px 8px; border-bottom: 1px solid var(--line); margin-bottom: 4px; font-weight: 700; }
.menu-head .muted { font-weight: 400; font-size: 11.5px; }
.menu-item { display: block; width: 100%; text-align: left; background: transparent; border: 0; color: var(--text); padding: 9px 12px; border-radius: 8px; font-size: 13.5px; cursor: pointer; text-decoration: none; font-family: inherit; }
.menu-item:hover { background: rgba(255,255,255,.06); }
.menu-item.danger { color: var(--red); }
@media (max-width: 900px) { .topnav { display: none; } .goal span { display: none; } }

/* 임베드(랜딩 미리보기): 상단바·사이드바 숨김 */
.embed .topbar, .embed #side, .embed #practiceBtn, .embed #learnBtn, .embed .hint { display: none !important; }
.embed #app { grid-template-columns: 1fr; grid-template-rows: 1fr; height: 100vh; }

/* ---------- 등급 */
.plan-badge { border-radius: 999px; padding: 4px 10px; font-size: 11px; font-weight: 800; letter-spacing: .5px; cursor: pointer; border: 1px solid var(--line2); background: rgba(255,255,255,.06); color: var(--muted); font-family: inherit; }
.plan-badge.pro { background: rgba(0,166,178,.18); border-color: rgba(0,166,178,.6); color: var(--accent); }
.plan-badge.premium { background: rgba(255,212,71,.18); border-color: rgba(255,212,71,.6); color: var(--amber); }
.list li.locked { opacity: .55; }
.list li.locked:hover { opacity: .8; }
.plans-mini { display: grid; gap: 8px; margin-top: 10px; }
.plan-mini { display: grid; grid-template-columns: 90px 1fr auto; align-items: center; gap: 10px; background: rgba(255,255,255,.05); border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; }
.plan-mini b { font-size: 13px; letter-spacing: .5px; } .plan-mini .pr { font-size: 12px; color: var(--muted); grid-column: 1; }
.plan-mini small { grid-column: 2; grid-row: 1 / span 2; font-size: 11.5px; color: var(--muted); line-height: 1.4; }
.plan-mini em, .plan-mini .btn { grid-column: 3; grid-row: 1 / span 2; font-style: normal; font-size: 11px; color: var(--accent); }
.plan-mini.cur { border-color: rgba(0,166,178,.5); }
.plan-mini.ok:not(.cur) { border-color: rgba(255,212,71,.45); }

/* ---------- 모달 / 토스트 */
.modal { position: fixed; inset: 0; z-index: 50; background: rgba(5,8,12,.6); display: grid; place-items: center; padding: 20px; }
.modal-box { width: min(460px, 100%); padding: 24px; }
.modal-box h2 { margin: 0 0 12px; font-size: 20px; }
.modal-box p { color: var(--muted); font-size: 14px; margin: 0 0 12px; line-height: 1.55; }
.field { display: grid; gap: 6px; margin: 12px 0; font-size: 13px; color: var(--muted); }
.field input, .field select { background: rgba(255,255,255,.05); border: 1px solid var(--line2); color: var(--text); border-radius: 10px; padding: 10px 12px; font-size: 15px; font-family: inherit; }
.field input:focus { border-color: var(--blue); outline: none; }
.emoji-row { display: flex; gap: 6px; flex-wrap: wrap; }
.emoji-row button { width: 40px; height: 40px; border-radius: 10px; border: 1px solid var(--line2); background: rgba(255,255,255,.05); font-size: 20px; cursor: pointer; }
.emoji-row button.on { background: rgba(0,166,178,.2); border-color: var(--accent); }
/* 보기 방식 선택(3D 아바타 / 뼈대) */
.view-choice { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 6px; }
.view-choice button { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 14px 10px 12px; border-radius: 14px; border: 1px solid var(--line2);
  background: rgba(255,255,255,.04); color: inherit; font: inherit; cursor: pointer; text-align: center; transition: border-color .15s, background .15s, transform .15s; }
.view-choice button:hover { transform: translateY(-1px); border-color: rgba(0,166,178,.6); }
.view-choice button.on { background: rgba(0,166,178,.16); border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent) inset; }
.view-choice svg { width: 64px; height: 64px; }
.view-choice b { font-size: 15px; }
.view-choice small { font-size: 12px; opacity: .72; line-height: 1.4; }
.view-choice button:disabled { opacity: .45; cursor: not-allowed; transform: none; }
.kbd { display: grid; grid-template-columns: auto 1fr; gap: 6px 14px; font-size: 13.5px; color: var(--muted); }
.kbd b { background: rgba(255,255,255,.08); border: 1px solid var(--line2); border-radius: 6px; padding: 1px 8px; font-size: 12px; color: var(--text); font-family: inherit; }
.toast { position: fixed; left: 50%; bottom: 28px; transform: translateX(-50%); background: #1e2631; border: 1px solid var(--line2); color: var(--text); padding: 10px 16px; border-radius: 10px; font-size: 13.5px; box-shadow: 0 10px 30px rgba(0,0,0,.5); z-index: 60; animation: toastIn .2s ease; }
@keyframes toastIn { from { opacity: 0; transform: translate(-50%, 8px); } to { opacity: 1; transform: translate(-50%, 0); } }

/* ---------- 사이드바 */
#side { background: var(--bg1); border-right: 1px solid var(--line); display: flex; flex-direction: column; min-height: 0; }
.brand { display: flex; align-items: center; gap: 12px; padding: 20px 18px 10px; }
.logo { width: 40px; height: 40px; border-radius: 12px; background: linear-gradient(135deg, var(--accent), #007f88); color: var(--accent-ink); font-weight: 800; font-size: 20px; display: grid; place-items: center; box-shadow: 0 6px 18px rgba(0, 166, 178, .25); }
#side h1 { margin: 0; font-size: 18px; font-weight: 700; letter-spacing: -.2px; }
.sub { margin: 2px 0 0; color: var(--muted); font-size: 12px; }
.search { margin: 8px 14px; display: flex; align-items: center; gap: 8px; background: rgba(255,255,255,.05); border: 1px solid var(--line); border-radius: 12px; padding: 0 12px; color: var(--muted); transition: border-color .15s, background .15s; }
.search:focus-within { border-color: rgba(79,140,255,.6); background: rgba(79,140,255,.06); }
.search input { flex: 1; background: transparent; border: 0; outline: 0; color: var(--text); font-size: 14px; padding: 11px 0; }
.search input::placeholder { color: var(--dim); }
.tabs { display: flex; gap: 6px; padding: 4px 14px 8px; }
.tab { flex: 1; background: transparent; border: 1px solid transparent; color: var(--muted); border-radius: 10px; padding: 7px 4px; font-size: 12.5px; cursor: pointer; transition: all .15s; }
.tab:hover { color: var(--text); background: rgba(255,255,255,.04); }
.tab.active { background: rgba(255,255,255,.07); color: var(--text); border-color: var(--line2); }
.count { background: var(--accent); color: var(--accent-ink); border-radius: 999px; padding: 0 6px; font-size: 11px; font-weight: 700; margin-left: 2px; }
.list { list-style: none; margin: 0; padding: 0 10px 12px; overflow-y: auto; flex: 1; scrollbar-width: thin; scrollbar-color: #2a3442 transparent; }
.list li { padding: 10px 12px; border-radius: 10px; cursor: pointer; display: flex; justify-content: space-between; align-items: center; font-size: 14.5px; transition: background .12s; }
.list li:hover { background: rgba(255,255,255,.05); }
.list li.sel { background: rgba(0,166,178,.14); box-shadow: inset 0 0 0 1px rgba(0,166,178,.45); }
.list li .id { color: var(--dim); font-size: 11px; font-variant-numeric: tabular-nums; }
.list li.done .g::after { content: "✓"; color: var(--accent); margin-left: 6px; font-size: 12px; }
.list .empty { color: var(--muted); font-size: 12.5px; padding: 14px 12px; cursor: default; line-height: 1.5; }
.side-foot { padding: 10px 18px 14px; color: var(--dim); font-size: 11px; border-top: 1px solid var(--line); }
.crumb { display: flex; align-items: center; gap: 8px; padding: 2px 14px 6px; font-size: 12.5px; color: var(--muted); }
.link { background: none; border: 0; color: var(--blue); cursor: pointer; font-size: 13px; padding: 4px 6px; border-radius: 6px; }
.link:hover { background: rgba(79,140,255,.1); }

/* 코스 목록 */
.list li.level { display: block; padding: 12px 12px 10px; }
.list li.level .lv { display: flex; align-items: center; gap: 10px; }
.list li.level .num { width: 30px; height: 30px; border-radius: 9px; background: rgba(255,255,255,.07); display: grid; place-items: center; font-weight: 800; font-size: 13px; color: var(--accent); }
.list li.level .t { font-weight: 700; font-size: 14.5px; }
.list li.level .s { color: var(--muted); font-size: 11.5px; margin-top: 2px; }
.list li.level .prog { height: 4px; border-radius: 999px; background: rgba(255,255,255,.08); margin-top: 10px; overflow: hidden; }
.list li.level .prog b { display: block; height: 100%; background: var(--accent); border-radius: 999px; }
.list li.lesson { padding: 10px 12px; }
.list li.lesson .k { font-size: 11px; color: var(--dim); margin-right: 8px; }
.list li.lesson.done .g::before { content: "✓ "; color: var(--accent); }
.list li.item { flex-direction: column; align-items: stretch; gap: 4px; }
.list li.item .ko { font-size: 14px; }
.list li.item .who { color: var(--amber); font-size: 11.5px; font-weight: 700; margin-right: 6px; }
.list li.item .gl { color: var(--muted); font-size: 11.5px; }
.list li.item.missing { opacity: .45; cursor: not-allowed; }
.list li.item .best { color: var(--accent); font-size: 11.5px; }
.list li.action { justify-content: center; background: rgba(0,166,178,.12); color: var(--accent); font-weight: 700; }
.list li.action:hover { background: rgba(0,166,178,.2); }
.list li.subhead { color: var(--muted); font-size: 12px; cursor: default; padding: 10px 12px 4px; }

/* 스테이지 오버레이 추가 */
.tag { display: inline-block; font-size: 11.5px; color: var(--accent); background: rgba(0,166,178,.12); border: 1px solid rgba(0,166,178,.35); border-radius: 999px; padding: 2px 10px; margin-bottom: 8px; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; pointer-events: auto; }
.chips span, .chips button { font-family: inherit; background: rgba(255,255,255,.08); border: 1px solid var(--line2); color: var(--text); border-radius: 999px; padding: 4px 11px; font-size: 13px; cursor: pointer; }
.chips .on { background: var(--accent); color: var(--accent-ink); border-color: transparent; font-weight: 700; }
.chips .miss { opacity: .45; text-decoration: line-through; cursor: not-allowed; }
.card { left: 22px; top: 150px; width: min(460px, calc(100% - 44px)); max-height: calc(100% - 260px); overflow: auto; padding: 18px 20px; pointer-events: auto; }
.card h2 { margin: 0 0 10px; font-size: 17px; }
.card p { margin: 0 0 10px; font-size: 13.5px; line-height: 1.6; color: #d9e0ea; }
.card .note { margin-top: 8px; font-size: 12px; color: var(--amber); background: rgba(255,212,71,.1); border-radius: 8px; padding: 8px 10px; }
.card-actions { margin-top: 12px; display: flex; justify-content: flex-end; }
.btn.small { padding: 6px 10px; font-size: 12px; }

/* 효과 */
#fx { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; z-index: 5; }
.float-text { position: absolute; transform: translate(-50%, -50%); font-size: 34px; font-weight: 900; pointer-events: none; animation: floatUp 1.1s ease-out forwards; text-shadow: 0 2px 12px rgba(0,0,0,.5); z-index: 6; }
@keyframes floatUp { 0% { opacity: 0; transform: translate(-50%, -30%) scale(.7); } 20% { opacity: 1; transform: translate(-50%, -50%) scale(1.1); } 100% { opacity: 0; transform: translate(-50%, -140%) scale(1); } }

/* 퀴즈 */
.quiz { right: 18px; top: 70px; width: min(380px, calc(100% - 36px)); padding: 16px 18px; pointer-events: auto; }
.quiz-top { display: flex; align-items: center; gap: 10px; font-size: 12.5px; color: var(--muted); }
.quiz-top #quizScore { margin-left: auto; color: var(--text); font-weight: 700; }
.combo { color: var(--amber); font-weight: 700; }
.quiz-timer { height: 5px; border-radius: 999px; background: rgba(255,255,255,.08); margin: 10px 0 12px; overflow: hidden; }
.quiz-timer b { display: block; height: 100%; width: 100%; background: linear-gradient(90deg, var(--accent), var(--blue)); border-radius: 999px; transition: width .2s linear; }
.quiz h3 { margin: 0 0 12px; font-size: 16px; }
.choices { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.choices button { font-family: inherit; font-size: 15px; font-weight: 700; padding: 14px 10px; border-radius: 12px; border: 1px solid var(--line2); background: rgba(255,255,255,.06); color: var(--text); cursor: pointer; transition: all .12s; }
.choices button:hover { background: rgba(255,255,255,.12); }
.choices button.ok { background: var(--accent); color: var(--accent-ink); border-color: transparent; }
.choices button.bad { background: rgba(255,107,107,.25); border-color: var(--red); }
.choices button:disabled { cursor: default; }
.quiz-foot { display: flex; justify-content: space-between; margin-top: 12px; }
.summary { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-bottom: 10px; }
.summary div { background: rgba(255,255,255,.05); border-radius: 10px; padding: 10px; text-align: center; }
.summary b { display: block; font-size: 22px; }
.summary span { font-size: 11.5px; color: var(--muted); }

/* 기록 탭 */
.list li.stats { display: block; padding: 6px 12px 22px; cursor: default; height: auto; }
.badge { min-height: 64px; }
.list li.stats:hover { background: transparent; }
.streak { display: flex; align-items: center; gap: 12px; background: linear-gradient(135deg, rgba(255,212,71,.18), rgba(255,107,107,.1)); border: 1px solid rgba(255,212,71,.35); border-radius: 12px; padding: 12px 14px; }
.streak .n { font-size: 30px; font-weight: 900; color: var(--amber); }
.streak .l { font-size: 12px; color: var(--muted); line-height: 1.4; }
.week { display: grid; grid-template-columns: repeat(7, 1fr); gap: 6px; margin: 12px 0 4px; align-items: end; height: 70px; }
.week div { display: flex; flex-direction: column; align-items: center; gap: 4px; height: 100%; justify-content: flex-end; }
.week i { width: 100%; background: rgba(255,255,255,.08); border-radius: 6px 6px 3px 3px; position: relative; min-height: 4px; }
.week i b { position: absolute; left: 0; right: 0; bottom: 0; background: var(--accent); border-radius: 6px 6px 3px 3px; }
.week span { font-size: 10px; color: var(--dim); }
.week .today span { color: var(--accent); font-weight: 700; }
.badges { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin-top: 10px; }
.badge { aspect-ratio: 1; border-radius: 12px; background: rgba(255,255,255,.05); border: 1px solid var(--line); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; font-size: 10px; color: var(--muted); text-align: center; padding: 4px; }
.badge .ic { font-size: 22px; }
.badge.on { background: rgba(0,166,178,.12); border-color: rgba(0,166,178,.5); color: var(--text); }
.badge:not(.on) .ic { filter: grayscale(1); opacity: .35; }
.list li.game { display: block; padding: 12px; }
.list li.game .t { font-weight: 700; font-size: 14.5px; }
.list li.game .s { color: var(--muted); font-size: 11.5px; margin-top: 3px; }
.list li.game.go { background: rgba(79,140,255,.12); }
.list li.game.go:hover { background: rgba(79,140,255,.2); }

/* 인식 자막 띠 */
.recog { left: 18px; right: 18px; bottom: 196px; padding: 10px 14px; }
.recog-main { display: flex; align-items: baseline; gap: 12px; }
.recog-state { font-size: 11px; color: var(--muted); border: 1px solid var(--line2); border-radius: 999px; padding: 2px 8px; }
.recog-state.on { color: var(--accent); border-color: var(--accent); }
#recogWord { font-size: 28px; font-weight: 800; letter-spacing: -.5px; }
#recogWord.low { color: var(--muted); }
.recog-alt { color: var(--muted); font-size: 12px; margin-left: auto; }
.recog-history { margin-top: 4px; color: var(--muted); font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.recog-history b { color: var(--text); font-weight: 600; margin-right: 10px; }
.fb-list { list-style: none; margin: 6px 0 0; padding: 0; display: flex; flex-wrap: wrap; gap: 6px; }
.fb-list:empty { display: none; }
.fb-list li { font-size: 12.5px; background: rgba(255,107,107,.14); border: 1px solid rgba(255,107,107,.4); color: #ffd1d1; border-radius: 999px; padding: 3px 10px; }
.fb-list li.h { background: transparent; border-color: transparent; color: var(--muted); padding-left: 0; }
.fb-list li.ok { background: rgba(0,166,178,.14); border-color: rgba(0,166,178,.45); color: var(--text); }

/* 드릴 HUD */
.drill { left: 18px; right: 18px; top: 70px; padding: 12px 14px; }
.drill-head { display: flex; align-items: baseline; gap: 12px; }
#drillStep { color: var(--muted); font-size: 12px; }
#drillWord { font-size: 26px; font-weight: 800; }
#drillBest { margin-left: auto; color: var(--accent); font-size: 12px; }
.drill-pass { display: grid; grid-template-columns: 1fr auto; align-items: center; gap: 10px; margin-top: 8px; font-size: 11.5px; color: var(--muted); }
.drill-pass i { display: block; height: 8px; border-radius: 999px; background: rgba(255,255,255,.08); overflow: hidden; }
.drill-pass b { display: block; height: 100%; width: 0; background: var(--accent); border-radius: 999px; transition: width .1s linear; }
.drill-actions { display: flex; gap: 8px; margin-top: 10px; }
.flash { animation: flash .6s ease; }
@keyframes flash { 0% { box-shadow: 0 0 0 0 rgba(0,166,178,.0); } 30% { box-shadow: 0 0 0 6px rgba(0,166,178,.55); } 100% { box-shadow: 0 0 0 0 rgba(0,166,178,0); } }

/* ---------- 첫 방문 60초 쇼케이스 */
body.intro #app { grid-template-columns: 1fr; }
body.intro #side { display: none; }
#stage.intro #viewer .overlay { display: none; }
#stage.intro #practice .score, #stage.intro #practice .top-right { display: none; }
.intro { position: absolute; inset: 0; z-index: 12; pointer-events: none; }
.intro-top { position: absolute; left: 24px; right: 24px; top: 18px; display: flex; align-items: center; gap: 14px; pointer-events: auto; }
.intro-dots { display: flex; gap: 6px; }
.intro-dots i { width: 28px; height: 5px; border-radius: 999px; background: rgba(255,255,255,.15); transition: background .3s; }
.intro-dots i.on { background: var(--accent); } .intro-dots i.done { background: rgba(0,166,178,.5); }
.intro-stepname { color: var(--muted); font-size: 12.5px; font-weight: 700; }
.intro-top .btn { margin-left: auto; }
.intro-cap { position: absolute; left: 50%; bottom: 46px; transform: translateX(-50%); width: min(760px, calc(100% - 48px)); text-align: center; pointer-events: auto; animation: capIn .6s cubic-bezier(.2,.9,.3,1); }
.intro-cap.swap { animation: capIn .6s cubic-bezier(.2,.9,.3,1); }
@keyframes capIn { from { opacity: 0; transform: translate(-50%, 24px); } to { opacity: 1; transform: translate(-50%, 0); } }
.intro-cap .eyebrow { color: var(--amber); font-size: 13px; font-weight: 800; letter-spacing: .14em; margin-bottom: 8px; }
.intro-cap h1 { margin: 0; font-size: clamp(30px, 4.4vw, 52px); font-weight: 900; letter-spacing: -1px; line-height: 1.15; text-shadow: 0 4px 30px rgba(0,0,0,.7); }
.intro-cap p { margin: 12px 0 0; font-size: 17px; color: #d9e0ea; text-shadow: 0 2px 12px rgba(0,0,0,.7); line-height: 1.55; }
.intro-acts { display: flex; justify-content: center; gap: 10px; margin-top: 18px; flex-wrap: wrap; }
.intro-acts .btn.primary { font-size: 17px; padding: 13px 26px; }
.intro-acts .pulse { animation: btnPulse 1.4s ease-in-out infinite; }
@keyframes btnPulse { 0%,100% { box-shadow: 0 0 0 0 rgba(0,166,178,.5); } 50% { box-shadow: 0 0 0 12px rgba(0,166,178,0); } }
#stage.intro #practice { position: relative; }
.intro-ok { position: absolute; left: 50%; top: 40%; transform: translate(-50%, -50%); font-size: 120px; z-index: 13; pointer-events: none; animation: checkPop 1.2s ease forwards; }

/* ---------- 홈 대시보드 */
.home { position: absolute; inset: 0; z-index: 9; overflow: auto; background: radial-gradient(1200px 700px at 60% 30%, #1a2330 0%, #0e1319 55%, #0b0f14 100%); }
.home-wrap { max-width: 1180px; margin: 0 auto; padding: 30px 36px 48px; display: grid; gap: 22px; }
.home-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.home-head .hello { font-size: 30px; font-weight: 800; letter-spacing: -.5px; }
.home-head .sub { color: var(--muted); font-size: 13.5px; margin-top: 6px; display: flex; gap: 8px; flex-wrap: wrap; }
.home-head .sub span { background: rgba(255,255,255,.05); border: 1px solid var(--line); border-radius: 999px; padding: 3px 11px; }
.home-head .sub span.accent { color: var(--accent); border-color: rgba(0,166,178,.4); background: rgba(0,166,178,.1); }
.home-head .sub button { font: inherit; cursor: pointer; color: var(--amber); background: rgba(255,212,71,.1); border: 1px solid rgba(255,212,71,.4); border-radius: 999px; padding: 3px 11px; }
.home-head .sub button:hover { background: rgba(255,212,71,.2); }
.home-start { position: relative; overflow: hidden; border-radius: 22px; padding: 28px 32px; background: linear-gradient(120deg, rgba(0,166,178,.28), rgba(18,59,93,.55) 60%, rgba(11,15,20,.6)); border: 1px solid rgba(0,166,178,.4); display: grid; grid-template-columns: 1fr auto; gap: 24px; align-items: center; }
.home-start::before { content: "▶"; position: absolute; right: -10px; top: -30px; font-size: 220px; color: rgba(0,166,178,.08); pointer-events: none; }
.home-start .eyebrow { color: var(--amber); font-size: 12.5px; font-weight: 800; letter-spacing: .12em; }
.home-start h2 { margin: 6px 0 4px; font-size: 28px; letter-spacing: -.5px; }
.home-start p { margin: 0 0 14px; color: #d9e0ea; font-size: 14.5px; }
.home-start .prog { height: 8px; border-radius: 999px; background: rgba(255,255,255,.1); overflow: hidden; max-width: 420px; }
.home-start .prog b { display: block; height: 100%; background: var(--accent); border-radius: 999px; }
.home-start .pt { color: var(--muted); font-size: 12px; margin-top: 6px; }
.home-start .acts { display: flex; flex-direction: column; gap: 10px; min-width: 190px; position: relative; }
.home-start .btn.primary { font-size: 17px; padding: 14px 22px; }
.home-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 14px; }
.home-card { position: relative; border-radius: 18px; padding: 18px 18px 16px; background: rgba(255,255,255,.04); border: 1px solid var(--line2); cursor: pointer; transition: transform .15s, background .15s, border-color .15s; display: grid; gap: 6px; align-content: start; min-height: 140px; }
.home-card:hover { transform: translateY(-3px); background: rgba(255,255,255,.07); border-color: rgba(0,166,178,.5); }
.home-card .ic { width: 44px; height: 44px; border-radius: 12px; display: grid; place-items: center; font-size: 24px; background: rgba(0,166,178,.14); margin-bottom: 4px; }
.home-card.game .ic { background: rgba(255,212,71,.14); } .home-card.review .ic { background: rgba(79,140,255,.16); } .home-card.cam .ic { background: rgba(192,132,252,.16); } .home-card.stats .ic { background: rgba(255,107,107,.14); }
.home-card .t { font-size: 17px; font-weight: 800; }
.home-card .s { color: var(--muted); font-size: 12.5px; line-height: 1.5; }
.home-card .m { color: var(--accent); font-size: 12.5px; font-weight: 700; margin-top: auto; }
.home-card .lock { position: absolute; right: 12px; top: 12px; font-size: 11px; background: rgba(255,255,255,.08); border-radius: 999px; padding: 2px 8px; color: var(--muted); }
.home h3 { margin: 0 0 12px; font-size: 15px; color: var(--muted); font-weight: 700; letter-spacing: .04em; }
.home-road ol { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(6, 1fr); gap: 10px; }
.home-road li { border-radius: 14px; padding: 12px 12px 10px; background: rgba(255,255,255,.04); border: 1px solid var(--line); cursor: pointer; transition: background .15s; }
.home-road li:hover { background: rgba(255,255,255,.08); }
.home-road li.cur { border-color: var(--accent); background: rgba(0,166,178,.1); }
.home-road li.done { border-color: rgba(0,166,178,.35); }
.home-road li.locked { opacity: .5; }
.home-road .num { width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; font-weight: 800; font-size: 13px; background: rgba(255,255,255,.08); margin-bottom: 8px; }
.home-road li.done .num, .home-road li.cur .num { background: var(--accent); color: var(--accent-ink); }
.home-road .t { font-size: 13.5px; font-weight: 700; }
.home-road .s { color: var(--muted); font-size: 11.5px; margin-top: 2px; }
.home-road .prog { height: 5px; border-radius: 999px; background: rgba(255,255,255,.08); margin-top: 10px; overflow: hidden; }
.home-road .prog b { display: block; height: 100%; background: var(--accent); }
.home-today .chips { margin-top: 0; }
.home-today .chips button { font-size: 14px; padding: 7px 14px; }
.home-today .chips button.done { border-color: rgba(0,166,178,.5); color: var(--accent); }
@media (max-width: 1000px) { .home-road ol { grid-template-columns: repeat(3, 1fr); } .home-start { grid-template-columns: 1fr; } }

/* ---------- 게임 허브 (사이드바) */
.list li.hero { display: block; padding: 0; overflow: hidden; border-radius: 14px; cursor: default; position: relative; }
.list li.hero img { display: block; width: 100%; aspect-ratio: 16/9; object-fit: cover; }
.list li.hero .hero-t { position: absolute; left: 12px; bottom: 10px; font-weight: 800; font-size: 15px; text-shadow: 0 2px 10px rgba(0,0,0,.6); }
.list li.card-g { display: grid; grid-template-columns: 44px 1fr auto; align-items: center; gap: 12px; padding: 12px; border: 1px solid var(--line2); }
.list li.card-g .ic { width: 44px; height: 44px; border-radius: 12px; background: rgba(0,166,178,.14); display: grid; place-items: center; font-size: 22px; }
.list li.card-g.shop .ic { background: rgba(255,212,71,.14); }
.list li.card-g .m { color: var(--accent); font-size: 11.5px; margin-top: 4px; }
.list li.card-g .t em { font-style: normal; font-size: 10px; background: var(--amber); color: #3a2a00; border-radius: 999px; padding: 1px 7px; margin-left: 6px; vertical-align: 2px; }
.list li.card-g .arrow { color: var(--dim); font-size: 22px; }

/* ---------- 수어 가게 (전체 화면 게임 모드) */
#stage { position: relative; }
#stage.shopmode { grid-template-columns: 1fr; }
#stage.shopmode #practice { display: none; }
#stage.shopmode #viewer { position: absolute; left: 18px; bottom: 18px; width: 240px; height: 230px; z-index: 14; border-radius: 14px; overflow: hidden; border: 1px solid var(--line2); background: #0e1319; box-shadow: 0 10px 30px rgba(0,0,0,.45); }
#stage.shopmode #viewer .overlay { display: none; }
#stage.shopmode #viewer::after { content: "아바타 시범 · 메뉴를 누르면 재생"; position: absolute; left: 10px; top: 8px; font-size: 11px; color: var(--muted); pointer-events: none; }
.sg { position: absolute; inset: 0; z-index: 10; display: grid; grid-template-rows: auto minmax(0, 1fr) auto; gap: 12px; padding: 12px 18px 16px; }
.sg-top { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; font-size: 13px; color: var(--muted); }
.sg-title { font-size: 22px; font-weight: 800; color: var(--text); }
.sg-top .pill { background: rgba(0,166,178,.14); color: var(--accent); border-radius: 999px; padding: 3px 11px; font-weight: 700; }
.sg-top .tips { color: var(--amber); font-weight: 800; font-size: 17px; }
.sg-top .combo { color: var(--amber); font-weight: 700; }
.sg-top .lives { margin-left: auto; color: var(--red); font-size: 20px; letter-spacing: 3px; }
.sg-top .lives i { font-style: normal; opacity: .25; }
.sg-main { display: grid; grid-template-columns: 1.15fr 1fr; gap: 14px; min-height: 0; }
.sg-scene { position: relative; border-radius: 18px; border: 1px solid var(--line2); background: linear-gradient(180deg, rgba(18,59,93,.5) 0%, rgba(18,59,93,.15) 60%, rgba(0,166,178,.08) 100%); overflow: hidden; }
.sg-scene .counter { position: absolute; left: 0; right: 0; bottom: 0; height: 58px; background: rgba(0,166,178,.16); border-top: 3px solid rgba(0,166,178,.55); }
.sg-scene .msg { position: absolute; left: 14px; right: 14px; bottom: 16px; text-align: center; font-size: 15px; font-weight: 700; color: var(--text); text-shadow: 0 1px 8px rgba(0,0,0,.6); z-index: 2; }
.sg-scene .msg.good { color: var(--accent); } .sg-scene .msg.bad { color: var(--red); } .sg-scene .msg.warn { color: var(--amber); }
.queue { position: absolute; right: 26px; bottom: 66px; display: flex; gap: 10px; font-size: 56px; line-height: 1; opacity: .32; }
.queue span:nth-child(2) { font-size: 46px; } .queue span:nth-child(3) { font-size: 38px; }
.sg-scene::before { content: attr(data-icon); position: absolute; right: 28px; top: 14px; font-size: 150px; line-height: 1; opacity: .1; pointer-events: none; }
.sg-scene::after { content: ""; position: absolute; left: 6%; right: 6%; top: 24%; height: 0; border-top: 2px dashed rgba(255,255,255,.06); pointer-events: none; }
.sg-sign { position: absolute; left: 20px; top: 16px; font-size: 13px; font-weight: 700; color: var(--muted); background: rgba(0,0,0,.25); border: 1px solid var(--line2); border-radius: 999px; padding: 4px 12px; }
.customer { position: absolute; left: 33%; bottom: 72px; width: 60%; transition: opacity .3s, transform .3s; }
.customer.empty { opacity: 0; transform: translateX(-30px); }
.customer.enter { animation: custIn .4s ease; }
@keyframes custIn { from { transform: translateX(-60px); opacity: 0; } to { transform: none; opacity: 1; } }
.customer .face { font-size: 104px; line-height: 1; }
.customer .bubble { position: absolute; left: 118px; bottom: 112px; min-width: 150px; padding: 14px 24px; background: #fff; color: #0b0f14; border-radius: 22px 22px 22px 6px; display: flex; align-items: baseline; gap: 12px; box-shadow: 0 10px 28px rgba(0,0,0,.4); white-space: nowrap; }
.customer .bubble::after { content: ""; position: absolute; left: -8px; bottom: 8px; border: 9px solid transparent; border-right-color: #fff; border-bottom-color: #fff; }
.customer .order { font-size: 36px; font-weight: 800; line-height: 1.1; letter-spacing: -.5px; }
.customer .order.second { font-size: 18px; font-weight: 700; color: #6b7684; }
.customer .order.second::before { content: "+ "; }
.customer .patience { position: absolute; left: 0; bottom: -16px; width: 100%; height: 10px; border-radius: 999px; background: rgba(255,255,255,.12); overflow: hidden; }
.customer .patience b { display: block; height: 100%; width: 100%; background: var(--accent); border-radius: 999px; transition: width .15s linear, background .3s; }
.customer .patience b.mid { background: var(--amber); } .customer .patience b.low { background: var(--red); }
.customer.happy .face { animation: hop .5s ease; } .customer.happy .bubble { background: #d6f7f0; }
.customer.angry .face { filter: hue-rotate(-30deg) saturate(1.5); animation: shake .4s ease; } .customer.angry .bubble { background: #ffd8d8; }
.customer.think .face { animation: shake .4s ease; }
@keyframes hop { 0%,100% { transform: none; } 40% { transform: translateY(-14px); } }
@keyframes shake { 0%,100% { transform: none; } 25% { transform: translateX(-6px); } 75% { transform: translateX(6px); } }
.sg-cam { position: relative; border-radius: 18px; overflow: hidden; border: 2px solid rgba(0,166,178,.55); background: #070a0e; box-shadow: 0 0 0 6px rgba(0,166,178,.08); }
.sg-cam .score, .sg-cam #drillHud { display: none !important; }
.sg-cam .recog { bottom: 14px; }
.menu-board { display: grid; grid-template-columns: repeat(auto-fill, minmax(104px, 1fr)); gap: 8px; }
.menu-board button { font-family: inherit; font-size: 16px; font-weight: 700; padding: 12px 8px; border-radius: 12px; border: 1px solid var(--line2); background: rgba(255,255,255,.06); color: var(--text); cursor: pointer; transition: all .12s; }
.menu-board button:hover { background: rgba(0,166,178,.18); border-color: rgba(0,166,178,.5); }
.sg-end { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); width: min(480px, 90%); max-height: none; z-index: 20; }
@media (max-width: 1100px) { .sg-main { grid-template-columns: 1fr 1fr; } .customer .face { font-size: 80px; } .customer .bubble { left: 92px; bottom: 90px; } .customer .order { font-size: 28px; } }

/* ---------- 수어 가게: 다이나믹 연출 */
.sg-scene { --tint: rgba(18,59,93,.5); background: linear-gradient(180deg, var(--tint) 0%, rgba(18,59,93,.12) 60%, rgba(0,166,178,.08) 100%); transition: background 1s; }
.sg-scene .amb { position: absolute; border-radius: 50%; background: radial-gradient(circle, rgba(0,166,178,.35), transparent 70%); pointer-events: none; animation: drift 9s ease-in-out infinite alternate; }
.sg-scene .a1 { width: 160px; height: 160px; left: 8%; top: 10%; } .sg-scene .a2 { width: 110px; height: 110px; left: 60%; top: 6%; animation-duration: 12s; background: radial-gradient(circle, rgba(255,212,71,.25), transparent 70%); }
.sg-scene .a3 { width: 220px; height: 220px; left: 35%; top: 30%; animation-duration: 15s; opacity: .6; } .sg-scene .a4 { width: 90px; height: 90px; left: 80%; top: 40%; animation-duration: 7s; background: radial-gradient(circle, rgba(79,140,255,.3), transparent 70%); }
.sg-scene .a5 { width: 130px; height: 130px; left: 15%; top: 50%; animation-duration: 11s; opacity: .5; }
@keyframes drift { from { transform: translate(0, 0) scale(1); } to { transform: translate(40px, -30px) scale(1.25); } }
.sg-scene.urgent { animation: urgent .6s ease-in-out infinite alternate; }
@keyframes urgent { from { box-shadow: inset 0 0 0 0 rgba(255,107,107,0); } to { box-shadow: inset 0 0 60px 8px rgba(255,107,107,.45); } }
.sg-scene.shake { animation: sceneShake .5s ease; }
@keyframes sceneShake { 0%,100% { transform: none; } 20% { transform: translate(-8px, 2px); } 40% { transform: translate(8px, -2px); } 60% { transform: translate(-5px, 1px); } 80% { transform: translate(5px, -1px); } }
.customer .face { display: inline-block; animation: bob 1.6s ease-in-out infinite; transform-origin: 50% 100%; }
@keyframes bob { 0%,100% { transform: translateY(0) rotate(-1deg); } 50% { transform: translateY(-6px) rotate(1deg); } }
.customer.impatient .face { animation: tap .45s ease-in-out infinite; }
@keyframes tap { 0%,100% { transform: translateY(0) rotate(-3deg); } 50% { transform: translateY(-4px) rotate(3deg); } }
.customer.furious .face { animation: fume .22s linear infinite; filter: saturate(1.4) hue-rotate(-20deg); }
@keyframes fume { 0%,100% { transform: translateX(-4px) rotate(-4deg); } 50% { transform: translateX(4px) rotate(4deg); } }
.customer.furious .bubble { animation: fume .25s linear infinite; }
.customer .mood { position: absolute; left: 10px; top: -36px; font-size: 30px; line-height: 1; animation: moodPop .3s ease; }
@keyframes moodPop { from { transform: scale(0); opacity: 0; } to { transform: scale(1); opacity: 1; } }
.customer.leave-happy { animation: leaveHappy .55s ease-in forwards; }
@keyframes leaveHappy { 0% { transform: none; opacity: 1; } 30% { transform: translateY(-24px) scale(1.05); } 100% { transform: translate(140px, -90px) scale(.6); opacity: 0; } }
.customer.leave-angry { animation: leaveAngry .65s ease-in forwards; }
@keyframes leaveAngry { 0% { transform: none; opacity: 1; } 100% { transform: translateX(-320px) rotate(-8deg); opacity: 0; } }
.customer.happy .face { animation: hop .5s ease; }
.sg-scene .msg.pop { animation: msgPop .35s ease; }
@keyframes msgPop { 0% { transform: scale(.85); opacity: .3; } 60% { transform: scale(1.06); } 100% { transform: none; opacity: 1; } }
.sg-top .tips.bump { animation: bump .3s ease; }
@keyframes bump { 0% { transform: scale(1); } 40% { transform: scale(1.3); color: #fff; } 100% { transform: scale(1); } }
.sg-top .combo.hot { animation: hot .5s ease-in-out infinite alternate; }
@keyframes hot { from { text-shadow: 0 0 0 rgba(255,140,66,0); } to { text-shadow: 0 0 14px rgba(255,140,66,.9); color: #ff8c42; } }
.sg-top .lives.hit { animation: hit .5s ease; }
@keyframes hit { 0%,100% { transform: none; } 25% { transform: scale(1.4) rotate(-8deg); } 60% { transform: scale(1.2) rotate(6deg); } }
.sg-top .rush-tag { background: #ff8c42; color: #2a1200; font-weight: 800; border-radius: 999px; padding: 3px 12px; animation: rushTag .5s ease-in-out infinite alternate; }
@keyframes rushTag { from { transform: scale(1); } to { transform: scale(1.08); box-shadow: 0 0 16px rgba(255,140,66,.8); } }
.sg.rush .sg-scene { box-shadow: 0 0 0 3px rgba(255,140,66,.6), 0 0 40px rgba(255,140,66,.35); }
.sg.rush .sg-cam { border-color: #ff8c42; box-shadow: 0 0 0 6px rgba(255,140,66,.15); }
.sg-coin { position: absolute; font-size: 22px; line-height: 1; z-index: 30; pointer-events: none; }
.sg-banner { position: absolute; left: 50%; top: 38%; transform: translate(-50%, -50%); z-index: 40; padding: 18px 40px; border-radius: 18px; font-size: 34px; font-weight: 900; letter-spacing: -.5px; color: #fff; background: rgba(0,166,178,.92); box-shadow: 0 20px 60px rgba(0,0,0,.5); animation: bannerIn 1.7s cubic-bezier(.2,.9,.3,1) forwards; pointer-events: none; white-space: nowrap; }
.sg-banner.rush { background: linear-gradient(90deg, #ff8c42, #ff4d4d); } .sg-banner.open { background: var(--navy, #123b5d); } .sg-banner.calm { background: rgba(18,59,93,.95); font-size: 24px; }
@keyframes bannerIn { 0% { transform: translate(-50%, -50%) scale(.3) rotate(-6deg); opacity: 0; } 15% { transform: translate(-50%, -50%) scale(1.08) rotate(1deg); opacity: 1; } 25% { transform: translate(-50%, -50%) scale(1); } 80% { transform: translate(-50%, -50%) scale(1); opacity: 1; } 100% { transform: translate(-50%, -70%) scale(.9); opacity: 0; } }
.sg-cam { transition: border-color .2s, box-shadow .2s; }
.sg-cam.ok { animation: camOk .7s ease; } .sg-cam.bad { animation: camBad .7s ease; }
@keyframes camOk { 0% { box-shadow: 0 0 0 0 rgba(0,166,178,0); border-color: #fff; } 30% { box-shadow: 0 0 0 14px rgba(0,166,178,.45), inset 0 0 80px rgba(0,166,178,.35); } 100% { box-shadow: 0 0 0 6px rgba(0,166,178,.08); } }
@keyframes camBad { 0% { border-color: #ff6b6b; transform: translateX(0); } 20% { transform: translateX(-8px); box-shadow: inset 0 0 80px rgba(255,107,107,.4); } 40% { transform: translateX(8px); } 60% { transform: translateX(-5px); } 80% { transform: translateX(5px); } 100% { transform: none; } }
.sg-cam.ok::after { content: "✓"; position: absolute; left: 50%; top: 40%; transform: translate(-50%, -50%); font-size: 140px; font-weight: 900; color: rgba(0,166,178,.85); animation: checkPop .7s ease forwards; pointer-events: none; }
@keyframes checkPop { 0% { transform: translate(-50%, -50%) scale(.2); opacity: 0; } 30% { transform: translate(-50%, -50%) scale(1.1); opacity: 1; } 100% { transform: translate(-50%, -70%) scale(1); opacity: 0; } }
.queue span { display: inline-block; animation: bob 2s ease-in-out infinite; }
.btn.icon { padding: 6px 9px; }

/* ---------- 스테이지 */
#stage { display: grid; grid-template-columns: 1fr; min-width: 0; background: radial-gradient(1200px 700px at 60% 30%, #1a2330 0%, #0e1319 55%, #0b0f14 100%); }
#stage.split { grid-template-columns: 1fr 1fr; }
#viewer, #practice { position: relative; min-width: 0; overflow: hidden; }
#practice { border-left: 1px solid var(--line); background: #070a0e; }
#c { width: 100%; height: 100%; display: block; }

.overlay { position: absolute; }
.top-left { left: 22px; top: 18px; pointer-events: none; }
.top-right { right: 18px; top: 18px; }
.bottom { left: 18px; right: 18px; bottom: 18px; }
.hint { right: 18px; bottom: 92px; color: var(--dim); font-size: 11.5px; pointer-events: none; }
#stage.split .hint { display: none; }
.glass { background: var(--glass); border: 1px solid var(--line2); border-radius: var(--radius); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); box-shadow: 0 10px 30px rgba(0,0,0,.35); }
#wordTitle { font-size: 40px; font-weight: 800; letter-spacing: -.5px; text-shadow: 0 2px 14px rgba(0,0,0,.55); line-height: 1.1; }
#wordMeta { color: var(--muted); font-size: 12.5px; margin-top: 6px; }
/* 동음이의어: 제목 옆 뜻 배지, 메타 줄의 '다른 뜻' 바로가기 */
.sense-badge { display: inline-block; vertical-align: middle; margin-left: 10px; padding: 3px 10px; border-radius: 999px; font-size: 14px; font-weight: 700; letter-spacing: 0;
  color: #04262a; background: var(--accent); text-shadow: none; }
.sense-other button { background: none; border: 0; padding: 0; color: var(--accent); font: inherit; text-decoration: underline; cursor: pointer; pointer-events: auto; }

#controls { display: flex; align-items: center; gap: 10px; padding: 10px 12px; flex-wrap: wrap; }
.icon-btn { width: 38px; height: 38px; border-radius: 10px; border: 1px solid var(--line2); background: rgba(255,255,255,.06); color: var(--text); display: grid; place-items: center; cursor: pointer; }
.icon-btn:hover { background: rgba(255,255,255,.1); }
#scrub { flex: 1; min-width: 120px; accent-color: var(--accent); height: 4px; }
#time { color: var(--muted); font-size: 12px; min-width: 84px; text-align: right; font-variant-numeric: tabular-nums; }
.pill-group { display: inline-flex; padding: 3px; border-radius: 10px; background: rgba(255,255,255,.05); border: 1px solid var(--line); }
.top-right.pill-group { padding: 4px; }
.pill-group button { background: transparent; border: 0; color: var(--muted); padding: 6px 11px; border-radius: 8px; cursor: pointer; font-size: 12.5px; transition: all .12s; }
.pill-group button:hover { color: var(--text); }
.pill-group button.on { background: rgba(255,255,255,.12); color: var(--text); box-shadow: 0 1px 2px rgba(0,0,0,.3); }
.pill-group button:disabled { opacity: .35; cursor: not-allowed; }
.btn { border-radius: 10px; padding: 8px 14px; font-size: 13px; cursor: pointer; border: 1px solid var(--line2); background: rgba(255,255,255,.06); color: var(--text); display: inline-flex; align-items: center; gap: 6px; transition: all .12s; }
.btn:hover { background: rgba(255,255,255,.1); }
.btn.primary { background: var(--accent); color: var(--accent-ink); border-color: transparent; font-weight: 700; }
.btn.primary:hover { filter: brightness(1.08); }
.btn.primary.done { background: rgba(255,255,255,.08); color: var(--muted); font-weight: 500; }
.btn.ghost.on { background: rgba(79,140,255,.18); border-color: rgba(79,140,255,.5); color: #cfe0ff; }
#learnBtn { margin-left: auto; }

/* ---------- 따라하기 */
.cam-wrap { position: absolute; inset: 0; }
#cam, #camOverlay { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
#cam.mirror, #camOverlay.mirror { transform: scaleX(-1); }
#practice .label { font-size: 13px; font-weight: 700; color: var(--text); text-shadow: 0 1px 8px rgba(0,0,0,.7); }
#practice .status { color: var(--muted); font-size: 12px; margin-top: 4px; text-shadow: 0 1px 8px rgba(0,0,0,.7); }
.score { display: grid; grid-template-columns: 92px 1fr; gap: 14px; align-items: center; padding: 14px 16px; }
.score .tip { grid-column: 1 / -1; color: var(--muted); font-size: 11.5px; line-height: 1.45; }
.ring { --p: 0; width: 84px; height: 84px; border-radius: 50%; display: grid; place-items: center; background: conic-gradient(var(--accent) calc(var(--p) * 1%), rgba(255,255,255,.08) 0); position: relative; }
.ring::before { content: ""; position: absolute; inset: 8px; border-radius: 50%; background: #121820; }
.ring span { position: relative; font-size: 22px; font-weight: 800; font-variant-numeric: tabular-nums; }
.bars { display: grid; gap: 7px; }
.bar { display: grid; grid-template-columns: 74px 1fr; align-items: center; gap: 8px; font-size: 12px; color: var(--muted); }
.bar i { display: block; height: 7px; border-radius: 999px; background: rgba(255,255,255,.08); overflow: hidden; }
.bar b { display: block; height: 100%; width: 0; background: linear-gradient(90deg, var(--blue), var(--accent)); border-radius: 999px; transition: width .15s; }

@media (max-width: 900px) {
  #app { grid-template-columns: 1fr; grid-template-rows: 42vh 58vh; }
  #side { border-right: 0; border-bottom: 1px solid var(--line); }
  #stage.split { grid-template-columns: 1fr; grid-template-rows: 1fr 1fr; }
  #practice { border-left: 0; border-top: 1px solid var(--line); }
  #wordTitle { font-size: 26px; }
  .hint { display: none; }
}

/* ---------- 모바일 (세로 폰): 사이드바 → 아래 탭 + 전체화면 서랍, 따라하기 위아래 분할 */
.mtabs { display: none; }
.drawer-close { display: none; }
@media (max-width: 760px) {
  html, body { font-size: 14px; }
  .app-body #app { grid-template-columns: 1fr; grid-template-rows: 1fr; height: calc(100dvh - 52px); padding-bottom: 60px; }
  .topbar { height: 52px; padding: 0 10px; gap: 8px; }
  .brand-link { font-size: 15px; } .brand-link img { width: 26px; height: 26px; }
  .goal { display: none; } .profile-btn #profileName { display: none; } .profile-btn { padding: 3px; }
  .menu { right: 0; width: 220px; }
  #side { display: none; }
  #side.open { display: flex; position: fixed; left: 0; right: 0; top: 52px; bottom: 60px; z-index: 25; border-right: 0; }
  .search { margin: 8px 10px 4px; }
  .tabs { padding: 4px 10px 6px; }
  .drawer-close { display: grid; place-items: center; position: absolute; right: 10px; top: 10px; width: 36px; height: 36px; border-radius: 10px; border: 1px solid var(--line2); background: rgba(255,255,255,.06); color: var(--text); font-size: 16px; z-index: 2; }
  #side.open .search { margin-right: 54px; }
  .mtabs { display: grid; grid-template-columns: repeat(5, 1fr); position: fixed; left: 0; right: 0; bottom: 0; height: 60px; background: rgba(18,24,32,.96); border-top: 1px solid var(--line); z-index: 26; padding-bottom: env(safe-area-inset-bottom); backdrop-filter: blur(12px); }
  .mtab { background: transparent; border: 0; color: var(--muted); font-size: 11px; display: grid; gap: 2px; place-items: center; cursor: pointer; }
  .mtab i { font-style: normal; font-size: 20px; line-height: 1; }
  .mtab.active { color: var(--accent); }
  /* 스테이지 */
  #stage { min-height: 0; max-height: 100%; }
  #stage.split { grid-template-columns: 1fr; grid-template-rows: minmax(0, 1fr) minmax(0, 1fr); }
  #stage.split #viewer, #stage.split #practice { min-height: 0; height: 100%; }
  #stage.split #practice { border-left: 0; border-top: 1px solid var(--line); }
  .top-left { left: 12px; top: 10px; } #wordTitle { font-size: 24px; } #wordMeta { font-size: 11px; margin-top: 2px; }
  .top-right.pill-group { right: 10px; top: 10px; } .pill-group button { padding: 5px 8px; font-size: 11.5px; }
  .bottom { left: 8px; right: 8px; bottom: 8px; } .hint { display: none; }
  #controls { gap: 6px; padding: 8px; } #time { display: none; } #avatar { display: none; } #scrub { min-width: 60px; }
  .btn.primary, .btn.ghost { padding: 8px 10px; font-size: 12.5px; }
  .card { left: 10px; top: 80px; width: calc(100% - 20px); max-height: calc(100% - 160px); padding: 14px; }
  .quiz { left: 10px; right: 10px; top: 60px; width: auto; padding: 12px; } .choices button { padding: 11px 6px; font-size: 14px; }
  .drill { top: 56px; } #drillWord { font-size: 20px; }
  /* 따라하기 */
  .score { grid-template-columns: 64px 1fr; gap: 10px; padding: 10px; } .ring { width: 60px; height: 60px; } .ring span { font-size: 16px; } .score .tip { display: none; }
  .recog { bottom: 118px; padding: 8px 10px; } .recog-main b { font-size: 18px; }
  #practice .top-left { top: 8px; } #practice .status { font-size: 11px; }
  /* 수어 가게 */
  .sg { padding: 8px 10px 10px; gap: 8px; }
  .sg-top { gap: 8px; font-size: 12px; } .sg-title { font-size: 16px; } .sg-top .tips { font-size: 14px; } .sg-top .lives { font-size: 16px; letter-spacing: 1px; }
  .sg-top #shopHint { display: none; }
  .sg-main { grid-template-columns: 1fr; grid-template-rows: 1fr 1.2fr; gap: 8px; }
  .customer { left: 30%; bottom: 52px; } .customer .face { font-size: 60px; } .customer .bubble { left: 66px; bottom: 66px; padding: 8px 14px; min-width: 90px; } .customer .order { font-size: 22px; } .customer .order.second { font-size: 14px; }
  .queue { font-size: 34px; bottom: 50px; right: 12px; } .sg-scene .counter { height: 44px; } .sg-scene .msg { bottom: 10px; font-size: 12.5px; } .sg-scene::before { font-size: 80px; }
  #stage.shopmode #viewer { width: 110px; height: 110px; left: 10px; bottom: 10px; } #stage.shopmode #viewer::after { content: "시범"; }
  .menu-board { grid-template-columns: repeat(auto-fill, minmax(72px, 1fr)); gap: 6px; } .menu-board button { font-size: 13px; padding: 8px 4px; }
  .sg-banner { font-size: 20px; padding: 12px 20px; white-space: normal; text-align: center; width: 90%; }
  /* 홈 */
  .home-wrap { padding: 16px 14px 24px; gap: 14px; }
  .home-head .hello { font-size: 21px; } .home-head .sub { font-size: 12px; }
  .home-start { padding: 18px; gap: 12px; grid-template-columns: 1fr; } .home-start h2 { font-size: 20px; } .home-start .acts { flex-direction: row; }
  .home-grid { grid-template-columns: 1fr 1fr; gap: 10px; } .home-card { min-height: 120px; padding: 14px; } .home-card .t { font-size: 15px; }
  .home-road ol { grid-template-columns: repeat(3, 1fr); gap: 8px; } .home-road li { padding: 10px; }
  /* 쇼케이스 */
  .intro-top { left: 12px; right: 12px; top: 10px; } .intro-cap { bottom: 64px; width: calc(100% - 24px); } .intro-cap h1 { font-size: 24px; } .intro-cap p { font-size: 14px; }
  .modal { padding: 12px; } .modal-box { padding: 18px; }
}
