/* 고1 남자를 위한 화면.
   파스텔·이모지·둥근 모서리를 다 걷어냈다.
   ずとまよ 의 밤 — 새까만 바탕, 크고 눌러 쓴 글자, 튀는 한 색.
   藤井風 의 결 — 흰색이 아니라 종이 같은 크림빛 글씨, 군더더기 없는 여백.
   귀여운 것이 하나도 없어야 한다. */
:root {
  --bg: #08080a;
  --bg2: #0d0d11;
  --card: #131318;
  --card2: #1b1b22;
  --ink: #f2efe9;
  --ink-soft: #7d7a76;
  --line: #26262e;
  --acc: #ff2d55;
  --acc-ink: #ffffff;
  --acc2: #4de1ff;
  --good: #3ddc84;
  --bad: #ff2d55;
  --warn: #ffb020;
  --shadow: 0 1px 0 #000, 0 18px 40px rgba(0,0,0,.7);
  --radius: 4px;
  --mono: 'SF Mono', 'JetBrains Mono', 'Consolas', 'D2Coding', ui-monospace, monospace;
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; height: 100%; }
body {
  background:
    radial-gradient(700px 420px at 78% -6%, rgba(255,45,85,.16) 0%, transparent 68%),
    radial-gradient(620px 400px at 12% 8%, rgba(77,225,255,.07) 0%, transparent 66%),
    linear-gradient(180deg, var(--bg) 0%, var(--bg2) 100%) fixed;
  color: var(--ink);
  font-family: 'Pretendard', 'Apple SD Gothic Neo', 'Noto Sans KR', system-ui, sans-serif;
  font-size: 17px; line-height: 1.5; -webkit-text-size-adjust: 100%;
}
/* 밤의 입자 — 아주 옅게 깔아 화면이 납작해 보이지 않게 한다. */
body::after {
  content: ''; position: fixed; inset: 0; pointer-events: none; z-index: 999; opacity: .04;
  background-image: repeating-linear-gradient(0deg, #fff 0 1px, transparent 1px 3px);
  mix-blend-mode: overlay;
}
#app { max-width: 560px; margin: 0 auto; height: 100vh; height: 100dvh;
  display: flex; flex-direction: column; }
.screen { padding: 18px 16px 28px; flex: 1; min-height: 0; display: flex; flex-direction: column; }
#home, #result { overflow-y: auto; }
#play { overflow: hidden; }
.hidden { display: none !important; }
button { font: inherit; font-weight: 700; cursor: pointer; border: 0; color: inherit; }

/* ── 시작 화면 ───────────────────────────────────────────────────── */
.hero { margin: 8px 0 18px; }
.hero h1 { font-size: 3.4rem; margin: 0; letter-spacing: -3px; line-height: .88;
  text-transform: uppercase; font-weight: 900; }
.hero h1 .mark { color: var(--acc); }
.hero h1 .sub { display: block; font-size: 1rem; letter-spacing: -.5px; font-weight: 800;
  text-transform: none; color: var(--ink-soft); margin-top: 12px; }
.hero-who { display: block; font-family: var(--mono); font-size: .6rem; letter-spacing: 4px;
  color: var(--acc); text-transform: uppercase; margin-bottom: 10px; }
.hero-who::after { content: ''; display: inline-block; width: 30px; height: 1px;
  background: var(--acc); vertical-align: middle; margin-left: 10px; }
.hero-sub { color: var(--ink-soft); font-size: .9rem; margin: 10px 0 0; }

.streak-row { display: flex; gap: 1px; margin: 16px 0; background: var(--line);
  border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.pill { flex: 1; background: var(--card); padding: 12px 4px; text-align: center; }
.pill b { display: block; font-family: var(--mono); font-size: 1.5rem; color: var(--acc); letter-spacing: -1px; }
.pill span { font-size: .62rem; color: var(--ink-soft); font-weight: 700; letter-spacing: .5px; }

.section-title { font-family: var(--mono); font-size: .66rem; color: var(--ink-soft);
  margin: 20px 2px 8px; font-weight: 700; letter-spacing: 2px; text-transform: uppercase; }
.section-title::before { content: '— '; color: var(--acc); }
.subjects, .modes, .levels { list-style: none; padding: 0; margin: 0; display: grid; gap: 8px; }
.subjects { grid-template-columns: 1fr 1fr; }
.subject-btn { width: 100%; background: var(--card); border-radius: var(--radius); padding: 14px 12px;
  text-align: left; border: 1px solid var(--line); box-shadow: var(--shadow); }
.subject-btn .icon { display: block; font-size: 1.3rem; line-height: 1.2; margin-bottom: 4px; filter: grayscale(.3); }
.subject-btn b { display: block; font-size: .98rem; }
.subject-btn > span:last-child { font-size: .68rem; color: var(--ink-soft); font-weight: 500; }
.subject-btn.on { border-color: var(--acc); background: var(--card2); }
.subject-btn.on b { color: var(--acc); }
.modes { grid-template-columns: 1fr; }
.levels { grid-template-columns: repeat(5, 1fr); }
.mode-btn, .level-btn { width: 100%; background: var(--card); border-radius: var(--radius);
  border: 1px solid var(--line); text-align: left; }
.mode-btn { padding: 13px 14px; display: flex; align-items: center; gap: 12px; }
.mode-btn .icon { font-size: 1.2rem; filter: grayscale(.4); }
.mode-btn b { display: block; font-size: .96rem; }
.mode-btn span { font-size: .72rem; color: var(--ink-soft); font-weight: 500; }
.level-btn { padding: 10px 2px; text-align: center; }
.level-btn b { display: block; font-family: var(--mono); font-size: 1.05rem; }
.level-btn span { font-size: .58rem; color: var(--ink-soft); font-weight: 700; }
.mode-btn.on, .level-btn.on { border-color: var(--acc); background: var(--card2); }
.mode-btn.on b, .level-btn.on b { color: var(--acc); }

.home-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 22px; }
.home-actions > .big-btn { grid-column: 1 / -1; }
.big-btn { background: var(--acc); color: var(--acc-ink); border-radius: var(--radius);
  padding: 17px 14px; font-size: 1rem; font-weight: 900; letter-spacing: 2px;
  text-transform: uppercase; box-shadow: none; }
.big-btn:active { transform: translateY(2px); opacity: .85; }
.big-btn:disabled { background: var(--card2); color: var(--ink-soft); box-shadow: none; }
.big-btn.wide, .ghost-btn.wide { width: 100%; margin-top: 12px; }
.ghost-btn { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 14px 10px; font-size: .88rem; color: var(--ink-soft); }
.ghost-btn:active { transform: translateY(1px); }
.tiny { font-family: var(--mono); font-size: .66rem; color: #5b6879; text-align: left;
  margin-top: 18px; line-height: 1.7; }

/* ── 문제 화면 ───────────────────────────────────────────────────── */
.bar { display: flex; align-items: center; gap: 10px; margin-bottom: 14px; }
.icon-btn { width: 38px; height: 38px; border-radius: var(--radius); background: var(--card);
  border: 1px solid var(--line); font-size: 1.1rem; color: var(--ink-soft); }
.progress { flex: 1; height: 6px; background: var(--card); border-radius: 2px; overflow: hidden; }
#progressBar { height: 100%; width: 0; background: var(--acc); transition: width .3s ease; }
.bar-score { font-family: var(--mono); font-size: .68rem; color: var(--ink-soft); letter-spacing: 1px; }
.bar-score b { font-size: 1.2rem; color: var(--acc); }

.boss-banner { background: linear-gradient(90deg, #3a0d0d, #1d2430); color: #ffb3b3;
  border: 1px solid #5b1a1a; border-radius: var(--radius); padding: 10px 14px;
  text-align: center; font-size: .8rem; letter-spacing: 1px; margin-bottom: 10px;
  font-family: var(--mono); animation: bossin .3s ease-out both; }
@keyframes bossin { from { transform: translateY(-8px); opacity: 0; } to { transform: none; opacity: 1; } }

.stage { flex: 1; min-height: 0; overflow-y: auto; display: flex; flex-direction: column; gap: 12px;
  padding-bottom: 8px; }

/* 「잠깐, 이거부터」 — 선수 관계로 한 칸 내려갈 때 */
.ladder-note { font-family: var(--mono); font-size: .74rem; color: var(--acc);
  border-left: 2px solid var(--acc); padding: 6px 0 6px 10px; letter-spacing: .5px; }
.ladder-note .rung { color: var(--ink-soft); margin-right: 8px; }

.q-card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 18px 16px; animation: pop .18s ease-out; }
@keyframes pop { from { transform: translateY(6px); opacity: 0; } to { transform: none; opacity: 1; } }
.q-label { font-family: var(--mono); font-size: .64rem; font-weight: 700; color: var(--acc);
  margin-bottom: 8px; letter-spacing: 1px; }
.q-ask { font-size: 1.25rem; font-weight: 800; line-height: 1.5; }
.q-ask .gap { display: inline-block; min-width: 84px; border-bottom: 3px solid var(--acc);
  margin: 0 4px; vertical-align: -3px; }
.q-hint { font-size: .8rem; color: var(--ink-soft); margin-top: 10px; }

.answer-area { display: flex; flex-direction: column; gap: 10px; }
.choices { display: grid; gap: 7px; }
.choice { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 15px 14px; text-align: left; font-size: 1.02rem; }
.choice:active { transform: translateY(1px); }
.choice.on { border-color: var(--acc); background: var(--card2); }
.choice.right { border-color: var(--good); background: #0c2117; color: #a8f5cd; }
.choice.wrong { border-color: var(--bad); background: #2a0d15; color: #ffb8c6; }
.choice.dim { opacity: .35; }

/* 직접 쓰기 */
.fill { display: flex; gap: 8px; }
.fill-in { flex: 1; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 15px 14px; font: inherit; font-weight: 700; color: var(--ink); }
.fill-in:focus { outline: none; border-color: var(--acc); }
.fill-in.right { border-color: var(--good); color: #b9ffd8; }
.fill-in.wrong { border-color: var(--bad); color: #ffc2c2; }
.fill .big-btn { padding: 15px 18px; }

/* 순서 세우기 · 서술형 조립 */
.order-line, .build-line { min-height: 58px; background: #0e131b; border: 1px dashed var(--line);
  border-radius: var(--radius); padding: 8px; display: flex; flex-wrap: wrap; gap: 6px; align-items: flex-start; }
.order-empty { color: #4d5a6c; font-size: .8rem; padding: 8px; }
.order-chip, .build-chip { background: var(--card2); border: 1px solid var(--line); border-radius: 8px;
  padding: 8px 10px; font-size: .86rem; text-align: left; }
.order-chip b { font-family: var(--mono); color: var(--acc); margin-right: 8px; }
.order-chip.right, .build-chip.right { border-color: var(--good); color: #b9ffd8; }
.order-chip.wrong, .build-chip.wrong { border-color: var(--bad); color: #ffc2c2; }
.order-pool, .build-pool { display: flex; flex-wrap: wrap; gap: 6px; }
.wcard { background: var(--card); border: 1px solid var(--line); border-radius: 8px;
  padding: 10px 12px; font-size: .92rem; }
.wcard:active { transform: translateY(1px); }
.wcard.on { border-color: var(--acc); background: var(--card2); }
.wcard.used { opacity: .25; }
.wcard.step { text-align: left; max-width: 100%; }
.wcard .ico { margin-right: 5px; }

/* 염기 채우기 */
.strand { display: flex; gap: 6px; justify-content: center; background: #0e131b;
  border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 8px; }
.base-col { display: grid; gap: 2px; justify-items: center; }
.base { width: 40px; height: 40px; display: grid; place-items: center; border-radius: 8px;
  font-family: var(--mono); font-size: 1.2rem; font-weight: 900; }
.base.given { background: var(--card2); border: 1px solid var(--line); color: var(--ink); }
.base.slot { background: #0b0e13; border: 1px dashed var(--line); color: #4d5a6c; }
.base.slot.filled { border-style: solid; border-color: var(--acc); color: var(--acc); }
.base.slot.right { border-color: var(--good); color: var(--good); }
.base.slot.wrong { border-color: var(--bad); color: var(--bad); }
.base-link { color: #34404f; font-size: .8rem; }
.base-keys { display: flex; gap: 8px; justify-content: center; }
.base-key { min-width: 56px; font-family: var(--mono); font-size: 1.05rem; font-weight: 900; }

/* 영어 조합 */
.combo { display: grid; gap: 10px; }
.combo-slots { display: flex; align-items: center; justify-content: center; gap: 10px;
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px; }
.slot { min-width: 104px; min-height: 50px; border-radius: 8px; border: 1px dashed var(--line);
  display: grid; place-items: center; font-size: 1.05rem; font-weight: 800; color: #4d5a6c; }
.slot.filled { border-style: solid; border-color: var(--acc); color: var(--ink); background: var(--card2); }
.slot-plus { font-family: var(--mono); color: var(--ink-soft); }
.card-row { display: flex; flex-wrap: wrap; gap: 6px; }
.card-row .row-label { width: 100%; font-family: var(--mono); font-size: .62rem;
  color: var(--ink-soft); letter-spacing: 1px; }

/* ── 채점 ────────────────────────────────────────────────────────── */
.verdict { position: fixed; left: 0; right: 0; bottom: 0; z-index: 20; padding: 16px 16px 22px;
  border-radius: 14px 14px 0 0; border-top: 2px solid; background: var(--card);
  box-shadow: 0 -14px 40px rgba(0,0,0,.6); max-width: 560px; margin: 0 auto;
  animation: slideup .22s cubic-bezier(.2,1.2,.4,1) both; max-height: 68dvh; overflow-y: auto; }
@keyframes slideup { from { transform: translateY(100%); } to { transform: none; } }
.verdict.ok { border-color: var(--good); }
.verdict.no { border-color: var(--bad); }
.v-head { font-family: var(--mono); font-size: .92rem; font-weight: 900; letter-spacing: 1px; }
.verdict.ok .v-head { color: var(--good); }
.verdict.no .v-head { color: var(--bad); }
.v-body { font-size: .95rem; margin-top: 10px; line-height: 1.6; }
.v-body b { color: var(--acc); }
.v-ex { margin-top: 10px; padding: 10px 12px; background: #0e131b; border-radius: 8px; font-size: .9rem; }
.v-ex i { display: block; font-style: normal; color: var(--ink-soft); font-size: .8rem; margin-top: 4px; }
.v-family { margin-top: 10px; font-size: .82rem; color: var(--ink-soft); }
.v-family b { color: var(--acc); }
.v-sibs { margin-top: 10px; display: grid; gap: 5px; }
.v-sib { font-size: .84rem; background: #0e131b; border-radius: 8px; padding: 8px 10px;
  border-left: 2px solid var(--line); }
.v-sib b { color: var(--ink); }
.v-keys { margin-top: 12px; display: flex; flex-wrap: wrap; gap: 6px; }
.key { font-family: var(--mono); font-size: .76rem; padding: 5px 9px; border-radius: 6px; }
.key.hit { background: #0f2a1c; color: #7dffb9; }
.key.miss { background: #2c1113; color: #ff9b9b; }
.v-mine { width: 100%; margin-top: 8px; font-size: .84rem; color: var(--ink-soft); }
.v-next { width: 100%; margin-top: 16px; }

/* ── 결과 ────────────────────────────────────────────────────────── */
.result-card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 24px 18px; }
.result-emoji { font-size: 2.6rem; filter: grayscale(.2); }
.result-card h2 { margin: 8px 0 4px; font-size: 1.8rem; letter-spacing: -1px; }
.result-why { color: var(--ink-soft); margin: 0 0 18px; font-size: .88rem; }
.result-nums { display: flex; gap: 1px; background: var(--line); border: 1px solid var(--line);
  border-radius: 8px; overflow: hidden; margin-bottom: 18px; }
.result-nums div { flex: 1; background: #0e131b; padding: 12px 4px; text-align: center; }
.result-nums b { display: block; font-family: var(--mono); font-size: 1.4rem; color: var(--acc); }
.result-nums span { font-size: .6rem; color: var(--ink-soft); font-weight: 700; }
.learned { list-style: none; padding: 0; margin: 0 0 18px; max-height: 240px; overflow-y: auto; }
.learned li { border-bottom: 1px solid var(--line); padding: 9px 2px; }
.learned b { font-size: .98rem; }
.learned span { display: block; font-size: .78rem; color: var(--ink-soft); }
.learned .miss { font-family: var(--mono); color: var(--bad); font-size: .6rem; letter-spacing: 1px; }
.result-actions { display: grid; gap: 8px; }
.confetti { display: none; }

/* ── 대화상자 ────────────────────────────────────────────────────── */
dialog { border: 1px solid var(--line); border-radius: var(--radius); padding: 22px;
  max-width: 480px; width: calc(100% - 32px); background: var(--card); color: var(--ink);
  max-height: 84dvh; box-shadow: 0 30px 80px rgba(0,0,0,.7); }
dialog::backdrop { background: rgba(0,0,0,.72); }
dialog h2 { margin-top: 0; letter-spacing: -.5px; }
.rules { padding-left: 18px; margin: 0 0 14px; }
.rules li { margin-bottom: 11px; font-size: .9rem; color: #c3cddb; }
.rules b { color: var(--ink); }
.rules i { font-style: normal; color: var(--acc); font-weight: 700; }
.part-list { display: grid; gap: 12px; margin: 14px 0; }
.part-group b { font-family: var(--mono); font-size: .88rem; color: var(--acc); letter-spacing: 1px; }
.part-sense { display: flex; gap: 8px; align-items: baseline; font-size: .84rem;
  padding: 5px 0 5px 8px; border-left: 1px solid var(--line); margin-top: 4px; }
.part-sense em { font-style: normal; font-weight: 800; }
.part-sense span { color: var(--ink-soft); }

.toast { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); z-index: 40;
  background: var(--acc); color: var(--acc-ink); padding: 10px 16px; border-radius: 8px;
  font-size: .84rem; font-weight: 800; }


/* ── 보상 — 리그 오브 레전드의 되먹임 ────────────────────────────── */
.tier { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 14px 14px 12px; margin: 18px 0 10px; }
.tier-head { display: flex; align-items: baseline; gap: 8px; }
.tier-head b { font-family: var(--mono); font-size: 1.35rem; font-weight: 900; letter-spacing: 1px; }
.tier-head span { margin-left: auto; font-family: var(--mono); font-size: 1.1rem; color: var(--ink); }
.tier-head em { font-style: normal; font-family: var(--mono); font-size: .6rem; color: var(--ink-soft); }
.tier-track { height: 5px; background: #0a0a0c; border-radius: 3px; overflow: hidden; margin: 10px 0 6px; }
#tierBar { height: 100%; width: 0; border-radius: 3px; transition: width .6s cubic-bezier(.2,1,.3,1); }
.tier-next { font-family: var(--mono); font-size: .62rem; color: var(--ink-soft); letter-spacing: .5px; }

/* ── 둥둥이 — 기록이 쌓이면 진화한다 ─────────────────────────────── */
.me { display: grid; grid-template-columns: 132px 1fr; gap: 14px; align-items: center;
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 12px 14px 14px 8px; margin: 18px 0 10px; }
.me .tier { background: none; border: 0; padding: 0; margin: 6px 0 0; }
.me-art { width: 132px; height: 132px; }
.me-art .avatar { width: 100%; height: 100%; display: block; overflow: visible; transform: scale(1.22); transform-origin: 50% 62%; }
.me-form b { display: block; font-family: var(--mono); font-size: .98rem; font-weight: 900; letter-spacing: 1px; }
.me-form span { font-size: .72rem; color: var(--ink-soft); }
.evo { margin-top: 10px; border-top: 1px solid var(--line); padding-top: 8px; }
.evo-title { font-family: var(--mono); font-size: .6rem; color: var(--ink-soft); letter-spacing: 1px; margin-bottom: 4px; }
.evo-title b { color: var(--ink); }
.evo-row { display: grid; grid-template-columns: 62px 1fr auto; gap: 8px; align-items: center;
  font-size: .64rem; color: var(--ink-soft); margin-top: 3px; }
.evo-row i { height: 3px; background: #0a0a0c; overflow: hidden; }
.evo-row u { display: block; height: 100%; background: var(--ink-soft); }
.evo-row em { font-style: normal; font-family: var(--mono); font-size: .6rem; }
.evo-row.done { color: var(--ink); }
.evo-row.done u { background: var(--good); }
.evo-row.done em { color: var(--good); }
.evo-pick { width: 100%; padding: 12px; font-size: .8rem; animation: pulse 1.6s ease-in-out infinite; }
@keyframes pulse { 50% { box-shadow: 0 0 0 4px rgba(255,45,85,.25); } }
.result-why .grow { color: var(--acc2); font-family: var(--mono); font-size: .8rem; }

/* 살아 있는 느낌 — 숨 쉬고, 눈 깜빡이고, 음파가 번진다 */
.avatar .av-eyes { animation: bdblink 3.8s infinite; }
.avatar .av-wave { animation: wave 1.8s ease-out infinite; transform-box: fill-box; transform-origin: right center; }
.avatar .av-wave.w2 { animation-delay: .4s; }
@keyframes wave { 0% { opacity: 0; transform: scale(.7); } 40% { opacity: 1; } 100% { opacity: 0; transform: scale(1.15); } }
.avatar .av-aura { animation: aura 3.2s ease-in-out infinite; }
@keyframes aura { 50% { opacity: .35; } }
.avatar .av-p { animation: rise 2.6s linear infinite; }
@keyframes rise { 0% { transform: translateY(0); opacity: 0; } 20% { opacity: 1; } 100% { transform: translateY(-120px); opacity: 0; } }


/* 진화 장면 — 이 게임에서 제일 큰 순간 */
.evo-scene { position: fixed; inset: 0; z-index: 80; background: rgba(4,4,6,.97);
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 14px;
  padding: 24px 18px; animation: fadein .3s ease-out both; overflow-y: auto; }
@keyframes fadein { from { opacity: 0; } }
.evo-art { width: min(300px, 70vw); aspect-ratio: 1; animation: charge .9s ease-in both; }
.evo-art .avatar { width: 100%; height: 100%; overflow: visible; }
@keyframes charge { 0% { filter: brightness(1); transform: scale(.94); } 90% { filter: brightness(2.4); transform: scale(1.02); } 100% { filter: brightness(1); } }
.evo-scene.flash::before { content: ''; position: fixed; inset: 0; background: #fff; pointer-events: none;
  animation: whiteout .7s ease-out both; }
@keyframes whiteout { 0% { opacity: .95; } 100% { opacity: 0; } }
.evo-scene.flash .evo-art { animation: born .7s cubic-bezier(.2,1.5,.4,1) both; }
@keyframes born { from { transform: scale(1.25); filter: brightness(3); } to { transform: none; filter: none; } }
.evo-text { text-align: center; display: grid; gap: 4px; }
.evo-text b { font-family: var(--mono); font-size: .8rem; letter-spacing: 6px; color: var(--acc); }
.evo-name { font-family: var(--mono); font-size: 2.2rem; font-weight: 900; letter-spacing: 2px; line-height: 1.1; }
.evo-ko { font-size: .95rem; color: var(--ink); }
.evo-why { font-family: var(--mono); font-size: .66rem; color: var(--ink-soft); margin-top: 6px; }
.evo-go { min-width: 220px; margin-top: 8px; }
.evo-head { text-align: center; display: grid; gap: 6px; max-width: 460px; }
.evo-head b { font-family: var(--mono); font-size: 1.6rem; letter-spacing: 4px; color: var(--acc); }
.evo-head span { font-size: .86rem; color: var(--ink-soft); }
.evo-paths { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; width: min(560px, 100%); }
.evo-path { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 12px 10px 14px; display: grid; gap: 4px; text-align: center; }
.evo-path:hover, .evo-path:focus-visible { border-color: var(--pc); outline: none; }
.evo-path .evo-prev { display: block; width: 100%; aspect-ratio: 1; }
.evo-path .evo-prev .avatar { width: 100%; height: 100%; }
.evo-path b { font-family: var(--mono); font-size: 1.2rem; letter-spacing: 2px; color: var(--pc); }
.evo-path em { font-style: normal; font-weight: 800; }
.evo-path span:last-child { font-size: .72rem; color: var(--ink-soft); line-height: 1.5; }

/* 호명 — 잘한 순간에 이름이 붙는다 */
.hype { position: fixed; inset: 0; display: grid; place-content: center; text-align: center;
  z-index: 60; pointer-events: none; }
.hype b { display: block; font-family: var(--mono); font-weight: 900; font-size: 2.3rem;
  letter-spacing: -1px; color: var(--acc); -webkit-text-stroke: 1px #000;
  text-shadow: 0 0 34px rgba(255,45,85,.65), 0 10px 30px #000;
  animation: hypein 1.1s cubic-bezier(.15,1.6,.35,1) both; }
.hype span { display: block; font-size: .8rem; color: var(--ink); letter-spacing: 6px; margin-top: 8px;
  animation: hypein 1.1s cubic-bezier(.15,1.6,.35,1) .06s both; }
.hype.big b { font-size: 3.2rem; }
.hype.big { animation: flashbg .5s ease-out both; }
.hype-shutdown b { color: #ffd75e; text-shadow: 0 0 34px rgba(255,215,94,.6), 0 10px 30px #000; }
.hype-comeback b, .hype-tier b { color: #4de1ff; text-shadow: 0 0 34px rgba(77,225,255,.6), 0 10px 30px #000; }
.hype-first b { color: #ff4d6d; }
@keyframes hypein {
  0% { transform: scale(2.6) rotate(-6deg); opacity: 0; filter: blur(10px); }
  26% { transform: scale(1) rotate(-2deg); opacity: 1; filter: blur(0); }
  72% { transform: scale(1.02) rotate(-2deg); opacity: 1; }
  100% { transform: scale(1.2) rotate(-2deg); opacity: 0; }
}
@keyframes flashbg {
  0% { background: rgba(255,45,85,.22); }
  100% { background: transparent; }
}
.shake { animation: shk .5s ease-in-out 1; }
.shake.hard { animation: shk .3s ease-in-out 3; }
@keyframes shk {
  0%,100% { transform: none; }
  25% { transform: translate(-5px, 2px); }
  75% { transform: translate(5px, -2px); }
}

/* 판 끝 등급 */
.result-emoji { font-family: var(--mono); font-size: 3.4rem; font-weight: 900; letter-spacing: -3px; }
.result-emoji.rank-S { color: #ffd75e; text-shadow: 0 0 30px rgba(255,215,94,.45); }
.result-emoji.rank-A { color: #4de1ff; }
.result-emoji.rank-B { color: var(--good); }
.result-emoji.rank-C, .result-emoji.rank-D { color: var(--ink-soft); }
.lp-gain { font-family: var(--mono); color: var(--acc); font-weight: 900; }

/* 숙련도 — 챔피언 숙련도와 같은 뜻 */
.mastery { float: right; font-size: .62rem; letter-spacing: 1px; color: #3a3a44; }
.mastery i { font-style: normal; font-family: var(--mono); margin-left: 3px; }
.mastery.m3 { color: #6a6a78; } .mastery.m4 { color: var(--good); }
.mastery.m5 { color: #4de1ff; } .mastery.m6 { color: #a86bff; }
.mastery.m7 { color: #ffd75e; }

/* 「아직」 — 오답에 붉은 낙인을 찍지 않는다 */
.verdict.no { border-color: var(--warn); }
.verdict.no .v-head { color: var(--warn); }
.choice.wrong { border-color: var(--warn); background: #2a1f0c; color: #ffdfa8; }
.fill-in.wrong { border-color: var(--warn); color: #ffdfa8; }
.order-chip.wrong, .build-chip.wrong { border-color: var(--warn); color: #ffdfa8; }
.base.slot.wrong { border-color: var(--warn); color: var(--warn); }
.learned .miss { color: var(--warn); }
.key.miss { background: #2a1f0c; color: #ffdfa8; }

/* ALMOST — 뜻은 맞았다. 부분 점수 */
.verdict.almost { border-color: var(--acc2); }
.verdict.almost .v-head { color: var(--acc2); }
.v-head { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; }
.v-points { font-size: .72rem; font-weight: 700; color: var(--ink-soft); letter-spacing: 0; }
.v-points b { font-size: 1.05rem; color: var(--ink); }
.v-note { margin-top: 8px; font-size: .84rem; padding: 7px 10px; background: #0e131b;
  border-left: 2px solid var(--line); border-radius: var(--radius); }
.v-note.bad { border-left-color: var(--warn); color: #ffdfa8; }
.v-note b { color: var(--ink); }

/* 낱말 세우기 */
.spell-line { display: flex; flex-wrap: wrap; justify-content: center; gap: 5px; padding: 14px 8px;
  background: #0e131b; border: 1px solid var(--line); border-radius: var(--radius); cursor: pointer; }
.spell-slot { width: 36px; height: 44px; display: grid; place-items: center; border-bottom: 2px solid var(--line);
  font-family: var(--mono); font-size: 1.3rem; font-weight: 900; color: var(--ink); }
.spell-slot.filled { border-color: var(--acc); }
.spell-slot.right { border-color: var(--good); color: #b9ffd8; }
.spell-slot.wrong { border-color: var(--warn); color: #ffdfa8; }
.spell-pool { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px; margin-top: 10px; }
.spell-tile { min-width: 46px; font-family: var(--mono); font-size: 1.1rem; font-weight: 900; border-radius: var(--radius); }

/* 짝짓기 */
.match { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.match-col { display: grid; gap: 7px; align-content: start; }
.match-a { font-family: var(--mono); font-weight: 800; }
.match .choice.right { opacity: .55; }

/* SCAN */
.scan-btn { grid-column: 1 / -1; text-align: left; }
.scan-btn b { font-family: var(--mono); color: var(--acc); margin-right: 8px; letter-spacing: 1px; }
.scan-btn.hot { border-color: var(--acc); background: #1a0d12; }
.boss-banner.scan { background: #0e131b; color: var(--ink-soft); border-left: 3px solid var(--acc); }
.skip-btn { color: var(--ink-soft); }
.result-emoji.rank-map { color: var(--acc); }
.learned .learned-head { font-family: var(--mono); font-size: .66rem; letter-spacing: 1px; color: var(--ink-soft);
  border-bottom: 0; padding-top: 16px; text-transform: uppercase; }
.learned .learned-more { font-size: .8rem; color: var(--ink-soft); }
.learned .tag-next { display: inline; float: right; font-family: var(--mono); font-size: .6rem;
  letter-spacing: 1px; color: var(--acc); }


/* ── 응원하는 녀석 ───────────────────────────────────────────────── */
.buddy { position: fixed; left: 12px; bottom: 12px; z-index: 55; pointer-events: none;
  display: flex; align-items: flex-end; gap: 8px;
  opacity: 0; transform: translateY(18px) scale(.9); transition: opacity .24s, transform .3s cubic-bezier(.2,1.5,.4,1); }
.buddy.show { opacity: 1; transform: none; }
.buddy-art { width: 62px; height: 62px; flex: 0 0 auto; filter: drop-shadow(0 8px 18px rgba(0,0,0,.7)); }
.buddy-art svg { width: 100%; height: 100%; display: block; }
.buddy.show.hit .buddy-art { animation: bdhit .5s cubic-bezier(.2,1.6,.4,1); }
.buddy.show.miss .buddy-art { animation: bdnod .7s ease-in-out; }
@keyframes bdhit { 0% { transform: translateY(0) scale(1); } 35% { transform: translateY(-10px) scale(1.08) rotate(-5deg); } 100% { transform: none; } }
@keyframes bdnod { 0%,100% { transform: rotate(0); } 30% { transform: rotate(6deg) translateY(3px); } 65% { transform: rotate(-3deg); } }
.buddy.show .bd-eye { animation: bdblink 3.4s infinite; }
@keyframes bdblink { 0%,92%,100% { opacity: 1; } 95% { opacity: .15; } }
.buddy-say { background: var(--card); border: 1px solid var(--line); border-left: 3px solid var(--who, var(--acc));
  border-radius: 4px; padding: 9px 12px; font-size: .84rem; font-weight: 700; white-space: nowrap;
  margin-bottom: 8px; box-shadow: 0 10px 26px rgba(0,0,0,.6); }

/* ── 넓은 화면 ───────────────────────────────────────────────────
   폰에서 만든 한 줄짜리 화면을 그대로 가운데 띄워 두면 PC 에서는 초라하다.
   가로를 벌리고, 시작 화면은 두 단으로 갈라 한눈에 다 들어오게 한다. */
@media (min-width: 520px) { body { font-size: 18px; } }

@media (min-width: 900px) {
  #app { max-width: 1080px; }
  .screen { padding: 32px 28px 36px; }

  .hero { margin: 10px 0 26px; }
  .hero h1 { font-size: 5rem; letter-spacing: -4px; }
  .hero h1 .sub { font-size: 1.25rem; }
  .hero-sub { font-size: 1rem; }

  .home-grid { display: grid; grid-template-columns: 1.05fr 1fr; gap: 32px; align-items: start; }
  .col-a, .col-b { min-width: 0; }
  .tier { margin-top: 0; }
  .tier-head b { font-size: 1.7rem; }
  .subjects { grid-template-columns: 1fr 1fr; }
  .subject-btn { padding: 20px 18px; }
  .subject-btn .icon { font-size: 1.7rem; }
  .subject-btn b { font-size: 1.1rem; }
  .home-actions { margin-top: 26px; }
  .section-title:first-child { margin-top: 0; }

  /* 문제 화면은 너무 넓으면 읽기 나빠진다. 가운데로 모으되 보기는 두 줄로. */
  #play, #result { max-width: 780px; width: 100%; margin: 0 auto; }
  .q-card { padding: 26px 24px; }
  .q-ask { font-size: 1.5rem; }
  .choices { grid-template-columns: 1fr 1fr; }
  .choices .choice { padding: 17px 16px; }
  .strand { padding: 20px; }
  .base { width: 48px; height: 48px; font-size: 1.35rem; }

  /* 채점 판도 바닥에 붙이지 않고 가운데 띄운다 */
  .verdict { width: min(780px, calc(100% - 48px)); max-width: none;
    left: 50%; right: auto; transform: translateX(-50%);
    border-radius: 10px; border: 1px solid; bottom: 22px; padding: 22px 24px;
    animation: sheetin .22s cubic-bezier(.2,1.2,.4,1) both; }
  @keyframes sheetin {
    from { transform: translate(-50%, 26px); opacity: 0; }
    to { transform: translate(-50%, 0); opacity: 1; }
  }
  .v-next { max-width: 260px; margin-left: auto; margin-right: 0; display: block; }

  .result-card { padding: 34px 30px; }
  .result-emoji { font-size: 4.4rem; }
  .learned { max-height: 320px; }
  .result-actions { grid-template-columns: 1fr 1fr; }

  .buddy { left: auto; right: 24px; bottom: 24px; flex-direction: row-reverse; }
  .buddy-art { width: 78px; height: 78px; }
  .buddy-say { font-size: .92rem; }
}

@media (min-width: 1200px) {
  #app { max-width: 1180px; }
  .hero h1 { font-size: 5.6rem; }
}
@media (prefers-reduced-motion: reduce) { * { animation: none !important; transition: none !important; } }

/* 응원단 이름표 */
.buddy-who { display: block; font-family: var(--mono); font-size: .56rem; letter-spacing: 2px; color: var(--who, var(--acc)); margin-bottom: 2px; }

/* ── 보상 — 좋아하는 노래 한 곡 ─────────────────────────────────── */
.mv-scene { position: fixed; inset: 0; z-index: 85; background: rgba(4,4,6,.96);
  display: flex; align-items: center; justify-content: center; padding: 20px 14px; animation: fadein .25s ease-out both; }
.mv-card { width: min(440px, 100%); background: var(--card); border: 1px solid var(--line); border-top: 2px solid var(--acc);
  border-radius: var(--radius); padding: 20px 18px; display: grid; gap: 10px; max-height: 92dvh; overflow-y: auto; }
.mv-tag { font-family: var(--mono); font-size: .68rem; letter-spacing: 2px; color: var(--acc); }
.mv-song b { display: block; font-size: 1.5rem; font-weight: 900; line-height: 1.2; }
.mv-song span { font-family: var(--mono); font-size: .7rem; color: var(--ink-soft); letter-spacing: 1px; }
.mv-actions { display: grid; gap: 8px; margin-top: 6px; }
.mv-actions a.ghost-btn { display: block; text-align: center; text-decoration: none; }
.mv-player { width: min(860px, 100%); display: grid; gap: 12px; }
.mv-frame { position: relative; width: 100%; aspect-ratio: 16 / 9; background: #000; border: 1px solid var(--line); }
.mv-frame iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.mv-now b { display: block; font-size: 1.2rem; font-weight: 900; }
.mv-now span { font-family: var(--mono); font-size: .68rem; color: var(--ink-soft); letter-spacing: 1px; }
.mv-list ol { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; counter-reset: mv; }
.mv-list li { counter-increment: mv; display: grid; grid-template-columns: 28px 1fr; align-items: center; }
.mv-list li::before { content: counter(mv, decimal-leading-zero); font-family: var(--mono); font-size: .62rem; color: var(--ink-soft); }
.mv-item { width: 100%; text-align: left; background: var(--card2); border: 1px solid var(--line); border-radius: var(--radius); padding: 9px 12px; }
.mv-item b, .mv-list li.locked b { display: block; font-size: .92rem; }
.mv-item span, .mv-list li.locked span { font-family: var(--mono); font-size: .6rem; color: var(--ink-soft); }
.mv-list li.locked > * { grid-column: 2; }
.mv-list li.locked { padding: 9px 12px 9px 0; opacity: .45; }
.mv-list li.locked b { grid-column: 2; }