/* 듀오링고식 화면: 한 화면에 한 걸음. 본문 부품(상자·표·UML 그림)은 book.css */
:root {
  color-scheme: light;
  --g: #58cc02; --gd: #58a700; --gs: #d7ffb8; --b: #1cb0f6; --bd: #1899d6; --line: #e5e5e5; --ink: #3c3c3c; --mute: #777; --red: #d83a3a;
  --f-round: "Nunito", "Noto Sans KR", system-ui, sans-serif;
  --f-body: "Noto Sans KR", "Apple SD Gothic Neo", "Malgun Gothic", system-ui, sans-serif;
  --bg: #fff; --text: #3c3c3c;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; background: #fff; color: var(--ink); font: 17px/1.75 var(--f-body); word-break: keep-all; overflow-wrap: anywhere; }
#top { position: sticky; top: 0; z-index: 30; background: #fff; display: flex; align-items: center; gap: 16px; max-width: 1040px; margin: 0 auto; padding: 14px 16px; min-height: 58px; }
.brand { font: 900 20px var(--f-round); color: var(--gd); text-decoration: none; }
#x { color: #afafaf; font: 800 22px/1 var(--f-round); text-decoration: none; padding: 6px; border-radius: 8px; }
#x:hover { color: var(--mute); }
#bar { flex: 1; height: 16px; border-radius: 99px; background: var(--line); overflow: hidden; }
#bar i { display: block; height: 100%; width: 0; background: var(--g); border-radius: 99px; transition: width .35s cubic-bezier(.3,.7,.4,1.2);
  box-shadow: inset 0 -4px 0 rgba(0,0,0,.08), inset 0 4px 0 rgba(255,255,255,.25); }
#where { font: 800 13px var(--f-round); color: var(--mute); white-space: nowrap; max-width: 40vw; overflow: hidden; text-overflow: ellipsis; }
#app { max-width: 760px; margin: 0 auto; padding: 8px 16px 120px; }

/* 단추 */
button { font: 800 15px var(--f-round); border: 2px solid var(--line); border-bottom-width: 4px; border-radius: 14px; background: #fff; color: var(--ink); padding: 10px 18px; cursor: pointer; }
button:active { border-bottom-width: 2px; transform: translateY(2px); }
button:disabled { opacity: .45; cursor: default; }
button.go { background: var(--g); border-color: var(--gd); color: #fff; }

/* 홈 */
.home h1 { font: 900 28px var(--f-round); margin: 16px 0 4px; }
.home > p { color: var(--mute); margin: 0 0 8px; }
.unit { border-radius: 18px; padding: 16px 20px; color: #fff; margin: 34px 0 22px; background: var(--c); box-shadow: 0 4px 0 var(--cd); }
.unit b { font: 900 20px var(--f-round); display: block; }
.unit span { font: 700 14px var(--f-round); opacity: .92; }
.path { list-style: none; margin: 0; padding: 0; display: grid; gap: 24px; justify-items: center; }
.path li { display: grid; justify-items: center; gap: 6px; text-align: center; }
.path li:nth-child(4n+2) { transform: translateX(-56px); } .path li:nth-child(4n+4) { transform: translateX(56px); }
.node { width: 78px; height: 72px; border-radius: 50%; display: grid; place-items: center; text-decoration: none; position: relative;
  background: var(--c); box-shadow: 0 7px 0 var(--cd); font: 900 26px var(--f-round); color: #fff; }
.node:active { transform: translateY(5px); box-shadow: 0 2px 0 var(--cd); }
.node.todo { background: var(--cs); color: var(--c); }
.node.fin::after { content: "✓"; position: absolute; right: -6px; top: -6px; width: 26px; height: 26px; border-radius: 50%; background: #ffc800; color: #fff; font: 900 15px/26px var(--f-round); }
.node svg { position: absolute; inset: -8px; width: calc(100% + 16px); height: calc(100% + 16px); transform: rotate(-90deg); pointer-events: none; }
.node svg circle { fill: none; stroke-width: 6; stroke-linecap: round; }
.path .t { font: 800 15px var(--f-round); color: var(--ink); max-width: 260px; }
.path .s { font: 700 13px var(--f-round); color: var(--mute); max-width: 280px; }
.u-intro { --c: #ff9600; --cd: #cd7900; --cs: #fff4e0; } .u-create { --c: #1cb0f6; --cd: #1899d6; --cs: #ddf4ff; }
.u-struct { --c: #58cc02; --cd: #58a700; --cs: #e5f9d4; } .u-behave { --c: #ce82ff; --cd: #a568cc; --cs: #f1e6ff; } .u-wrap { --c: #ffb800; --cd: #d99a00; --cs: #fff4cc; }

/* 화면 */
.screen .chip { display: inline-block; font: 800 13px var(--f-round); color: var(--mute); background: #f4f4f4; border-radius: 99px; padding: 1px 12px; margin: 6px 0 4px; }
.screen > h1 { font: 900 26px/1.35 var(--f-round); margin: 6px 0 16px; text-wrap: balance; }
.body { font-size: 17px; }
.body p, .body li { max-width: none; }
.body h3 { font: 900 20px var(--f-round); margin: 22px 0 8px; }
.body h2 { font: 900 22px var(--f-round); margin: 18px 0 8px; }
.body ul, .body ol { padding-left: 1.4em; }
.body .callout { margin: 16px 0; }
.body .lead-in::before { content: none; }
.cover { text-align: center; padding: 24px 0 8px; }
.cover .part { display: inline-block; font: 900 14px var(--f-round); color: var(--gd); background: var(--gs); border-radius: 99px; padding: 2px 14px; }
.cover .subtitle { font: 800 20px/1.5 var(--f-round); color: var(--ink); margin: 18px auto 0; max-width: 28em; }
.lead { font-weight: 700; }
ol.qs { padding-left: 0; list-style: none; counter-reset: q; }
ol.qs li { counter-increment: q; border: 2px solid var(--line); border-bottom-width: 4px; border-radius: 16px; padding: 12px 14px 8px; margin: 12px 0; }
ol.qs li::before { content: counter(q); display: inline-grid; place-items: center; width: 26px; height: 26px; margin-right: 8px; border-radius: 50%; background: var(--b); color: #fff; font: 900 14px var(--f-round); }
ol.qs textarea, .mine textarea { display: block; width: 100%; margin: 8px 0 4px; border: 2px solid var(--line); border-radius: 12px; padding: 8px 10px; font: 16px/1.6 var(--f-body); resize: vertical; }
.mine label { display: block; font: 800 14px var(--f-round); color: var(--mute); margin-top: 14px; }
.sol { border-top: 3px dashed var(--line); padding-top: 6px; }
.body .exercise { border: 0; padding: 0; }
.body pre:not(.pr-pre):not(.pr-hl):not(.pr-gutter-pre) { background: var(--code-bg); border: 1px solid var(--border); border-radius: 12px; padding: 12px; overflow-x: auto; }
.body figure.diagram { margin: 16px 0; }
.body figure.diagram svg { width: 100%; height: auto; }
.endmark { text-align: center; font-size: 56px; margin: 30px 0 0; }

/* 아래 단추 */
.foot { position: fixed; left: 0; right: 0; bottom: 0; background: #fff; border-top: 2px solid var(--line); padding: 12px 16px calc(12px + env(safe-area-inset-bottom, 0px)); z-index: 25; }
.foot > div { max-width: 760px; margin: 0 auto; display: flex; justify-content: space-between; gap: 12px; }
.foot button { min-width: 120px; padding: 12px 22px; font-size: 16px; border-radius: 16px; }
.foot button.go { flex: 1; max-width: 260px; }
#toast { position: fixed; left: 50%; bottom: 90px; transform: translateX(-50%); max-width: min(560px, 92vw); background: #3c3c3c; color: #fff; border-radius: 14px; padding: 10px 16px; font-size: 15px; z-index: 40; box-shadow: 0 6px 20px rgba(0,0,0,.25); }
dfn.term { cursor: pointer; }
@media (max-width: 640px) { .path li:nth-child(4n+2) { transform: translateX(-28px); } .path li:nth-child(4n+4) { transform: translateX(28px); } #where { display: none; } }
