:root {
  color-scheme: light;
  --ink: #202e40;
  --muted: #526174;
  --paper: #f7f5ee;
  --white: #fff;
  --blue: #3976c6;
  --blue-dark: #245a9e;
  --orange: #d77a2b;
  --purple: #7955a6;
  --green: #3b8c62;
  --line: #d8dde2;
  --soft: #eef2f7;
  --shadow: 0 14px 32px rgb(25 45 75 / 9%);
  font-family: "Noto Sans KR", "Malgun Gothic", system-ui, sans-serif;
  font-synthesis: none;
  text-rendering: optimizeLegibility;
}
* { box-sizing: border-box; }
body { margin: 0; color: var(--ink); background: var(--paper); line-height: 1.5; }
a { color: var(--blue-dark); text-underline-offset: .2em; }
button, select { font: inherit; }
button, .button { min-height: 52px; display: inline-flex; align-items: center; justify-content: center; gap: .45rem; padding: .7rem 1rem; border: 2px solid var(--blue-dark); border-radius: 14px; background: var(--blue-dark); color: var(--white); font-weight: 800; text-decoration: none; cursor: pointer; }
button:hover, .button:hover { background: #194a86; }
button.secondary, .button.secondary { background: var(--white); color: var(--blue-dark); }
button.warn { border-color: #8b3838; background: #8b3838; }
button:disabled { opacity: .5; cursor: not-allowed; }
button[aria-disabled="true"] { opacity: .7; cursor: progress; }
button:focus-visible, a:focus-visible, select:focus-visible, [tabindex]:focus-visible { outline: 4px solid #e5a642; outline-offset: 3px; }
.skip-link { position: fixed; z-index: 30; top: 12px; left: 12px; transform: translateY(-150%); padding: .7rem 1rem; border-radius: 12px; background: white; }
.skip-link:focus { transform: translateY(0); }
.site-header { position: sticky; top: 0; z-index: 20; display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: .65rem max(16px, calc((100vw - 1240px) / 2)); border-bottom: 1px solid var(--line); background: rgb(247 245 238 / 96%); backdrop-filter: blur(10px); }
.brand { display: flex; align-items: center; gap: .65rem; color: var(--ink); font-weight: 900; text-decoration: none; line-height: 1.15; }
.brand small { display: block; margin-top: .2rem; color: var(--muted); font-size: .72rem; font-weight: 600; }
.brand-mark { display: grid; place-items: center; width: 44px; height: 44px; border-radius: 13px; color: white; background: var(--blue); font-size: 1.5rem; }
.site-header nav, .site-footer nav { display: flex; gap: .35rem; align-items: center; }
.site-header nav a { display: inline-flex; min-height: 44px; align-items: center; padding: .45rem .7rem; border-radius: 12px; color: var(--ink); font-weight: 750; text-decoration: none; white-space: nowrap; }
.site-header nav a:hover { background: #e8edf4; }
main { min-height: calc(100vh - 155px); }
#app { width: min(1240px, 100%); margin: 0 auto; padding: 1.2rem 16px 3rem; }
.site-footer { display: flex; justify-content: space-between; align-items: center; gap: 1rem; padding: 1rem max(16px, calc((100vw - 1240px) / 2)); background: #eaeef3; color: var(--muted); font-size: .9rem; }
.site-footer p { margin: 0; }
.eyebrow { margin: 0; color: var(--blue-dark); font-size: .8rem; font-weight: 900; letter-spacing: .08em; }
.page-head { display: flex; justify-content: space-between; align-items: start; gap: 1rem; margin: .35rem 0 1.1rem; }
.page-title { margin: .15rem 0 0; font-size: clamp(1.7rem, 4vw, 2.65rem); line-height: 1.2; letter-spacing: -.03em; }
.storage-banner { margin: .5rem 0; padding: .65rem .9rem; border-radius: 12px; background: #edf3fc; color: #304f76; }
.hero { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(200px, .75fr); gap: 1rem; align-items: center; padding: clamp(1.25rem, 4vw, 2.8rem); border: 1px solid #d5dfeb; border-radius: 28px; background: linear-gradient(125deg, #eaf1fb 0%, #f1f4f8 60%, #fff0db 100%); }
.hero h2 { max-width: 14ch; margin: .45rem 0 .7rem; font-size: clamp(2rem, 5vw, 4rem); line-height: 1.08; letter-spacing: -.04em; }
.hero p { max-width: 58ch; color: #40536a; font-size: 1.08rem; }
.hero-visual { display: grid; min-height: 220px; place-items: center; }
.hero-visual .hero-mascot { position: relative; display: grid; width: 190px; aspect-ratio: 1; place-items: center; overflow: hidden; border: 10px solid #d8e5f4; border-radius: 42px; background: radial-gradient(circle at 50% 45%, #f7fbff 0 44%, #eaf2fc 45% 100%); box-shadow: var(--shadow); transform: rotate(3deg); }
.hero-mascot::before { position: absolute; top: 13%; right: 14%; width: 25px; aspect-ratio: 1; border: 4px solid #31445a; border-radius: 50%; background: #f3b448; content: ""; }
.hero-mascot svg { position: relative; width: 76%; height: 76%; }
.section-heading { display: flex; justify-content: space-between; align-items: end; gap: 1rem; margin: 1.8rem 0 .8rem; }
.section-heading h2 { margin: .2rem 0; font-size: clamp(1.35rem, 3vw, 2rem); }
.section-heading p { margin: .2rem 0; color: var(--muted); }
.notice { padding: .85rem 1rem; border: 1px solid #e9ce99; border-left: 6px solid var(--orange); border-radius: 14px; background: #fff7e9; color: #654519; }
.notice strong { display: block; }
.notice p { margin: .2rem 0 0; }
.panel { margin: .9rem 0; padding: clamp(1rem, 2.5vw, 1.4rem); border: 1px solid var(--line); border-radius: 20px; background: var(--white); box-shadow: 0 5px 18px rgb(25 45 75 / 4%); }
.panel h2, .panel h3 { margin-top: 0; }
.panel p:last-child, .panel ul:last-child { margin-bottom: 0; }
.feature-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: .9rem; }
.feature-card { display: flex; min-height: 190px; flex-direction: column; gap: .55rem; padding: 1.05rem; border: 1px solid var(--line); border-radius: 20px; background: white; box-shadow: 0 5px 14px rgb(25 45 75 / 4%); }
.feature-card h3 { margin: .1rem 0; font-size: 1.2rem; line-height: 1.25; }
.feature-card p { margin: 0; color: var(--muted); }
.feature-card .card-action { margin-top: auto; padding-top: .4rem; }
.pill { display: inline-flex; align-items: center; padding: .2rem .58rem; border-radius: 999px; background: #eef2f7; color: #40536a; font-size: .78rem; font-weight: 850; }
.pill.move { background: #e5effb; color: #265991; }
.pill.turn { background: #ffeedf; color: #8e4e1c; }
.pill.repeat { background: #f0e9f8; color: #604187; }
.pill.success { background: #e2f4e9; color: #286a45; }
.toolbar { display: flex; flex-wrap: wrap; gap: .6rem; align-items: center; margin: .75rem 0; }
.toolbar button, .toolbar .button { min-width: 120px; }
.columns { display: grid; grid-template-columns: minmax(0, .85fr) minmax(0, 1.15fr); gap: .9rem; align-items: start; }
.workspace { display: grid; grid-template-columns: minmax(320px, .95fr) minmax(320px, 1.05fr); gap: .9rem; align-items: start; }
.workspace-column { min-width: 0; }
.palette { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .55rem; }
.block-button { min-height: 60px; justify-content: start; text-align: left; }
.block-button.move { border-color: var(--blue); background: #e8f1fc; color: #224d7e; }
.block-button.move:hover { background: #d9e8f8; }
.block-button.turn { border-color: var(--orange); background: #fff0e3; color: #75421b; }
.block-button.turn:hover { background: #ffe4ce; }
.block-button.repeat { border-color: var(--purple); background: #f1eafa; color: #553b79; }
.block-button.repeat:hover { background: #e7dcf3; }
.program-list { display: grid; gap: .55rem; margin: .75rem 0; padding: 0; list-style: none; }
.program-item { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: .55rem; align-items: center; padding: .6rem; border: 2px solid #d7dce3; border-left-width: 7px; border-radius: 14px; background: #fbfcfe; }
.program-item.is-active { outline: 4px solid #f0bd58; outline-offset: 1px; }
.current-step-label { display: inline-flex; align-items: center; width: fit-content; padding: .12rem .45rem; border-radius: 999px; background: #fff0bd; color: #5b4512; font-size: .76rem; font-weight: 900; white-space: nowrap; }
.program-item.move { border-left-color: var(--blue); }
.program-item.turn { border-left-color: var(--orange); }
.program-item.repeat { border-left-color: var(--purple); }
.block-title { display: flex; align-items: center; gap: .55rem; font-weight: 850; }
.block-icon { display: grid; width: 36px; height: 36px; flex: 0 0 36px; place-items: center; border-radius: 10px; background: #eef2f7; font-size: 1.2rem; }
.block-actions { display: flex; flex-wrap: wrap; justify-content: end; gap: .25rem; }
.block-actions button { min-width: 44px; min-height: 44px; padding: .35rem; border-radius: 10px; font-size: .85rem; }
.repeat-body { grid-column: 1 / -1; margin-left: 1.6rem; padding: .55rem .7rem; border-left: 3px dashed #aa91c5; background: #faf7fd; }
.repeat-body ol { margin: .3rem 0; padding-left: 1.4rem; }
.repeat-step { padding: .12rem .25rem; }
.repeat-step.is-active { border-radius: 7px; background: #fff0bd; color: #493d20; font-weight: 850; }
.repeat-step.is-active .current-step-label { margin-left: .35rem; }
.repeat-controls { display: flex; flex-wrap: wrap; gap: .4rem; margin-top: .35rem; }
.repeat-controls button { min-height: 44px; padding: .35rem .6rem; border-color: #7955a6; background: white; color: #553b79; }
.empty-program { padding: 1.3rem .8rem; border: 2px dashed #b8c4d1; border-radius: 14px; color: var(--muted); text-align: center; }
.maze-wrap { padding: .8rem; border-radius: 18px; background: #e9edf1; }
.maze-board { display: grid; width: min(100%, 490px); margin: auto; grid-template-columns: minmax(0, 1fr); gap: 4px; padding: 5px; border-radius: 13px; background: #cdd5df; }
.maze-board.field { background: #96b77e; }
.maze-board.islands { background: #6f9eac; }
.maze-board.zigzag { background: #c29b5f; }
.maze-board.crossroads { background: #9b88b9; }
.maze-board.garden { background: #79a982; }
.maze-board.field .maze-cell:not(.wall):not(.start):not(.goal):not(.visited) { background: #f3f8e9; }
.maze-board.islands .maze-cell:not(.wall):not(.start):not(.goal):not(.visited) { background: #edf7f8; }
.maze-board.zigzag .maze-cell:not(.wall):not(.start):not(.goal):not(.visited) { background: #fff6e5; }
.maze-board.crossroads .maze-cell:not(.wall):not(.start):not(.goal):not(.visited) { background: #f5f0fc; }
.maze-board.garden .maze-cell:not(.wall):not(.start):not(.goal):not(.visited) { background: #eef8ed; }
.maze-board [role="row"] { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 4px; }
.maze-cell { display: grid; min-width: 0; aspect-ratio: 1; place-items: center; border-radius: 8px; background: #fff; color: #36475b; font-size: clamp(.8rem, 2.4vw, 1.45rem); }
.maze-cell.wall { background: #506176; box-shadow: inset 0 0 0 2px #3b4958; }
.maze-cell.start { box-shadow: inset 0 0 0 3px #3976c6; }
.maze-cell.goal { background: #e4f3e8; box-shadow: inset 0 0 0 3px #3b8c62; }
.maze-cell.visited { background: #dbe9fa; }
.maze-character { position: relative; display: grid; place-items: center; width: 88%; height: 88%; padding: .08rem; border-radius: 7px; background: #fff3dc; }
.maze-character > svg { width: 84%; height: 84%; }
.maze-character .facing { position: absolute; z-index: 1; top: 0; right: 0; display: grid; width: 1.15em; aspect-ratio: 1; place-items: center; border: 1px solid #c5d7ed; border-radius: 50%; background: white; color: var(--blue-dark); font-size: clamp(.48rem, 1.25vw, .72rem); font-weight: 900; line-height: 1; }
.maze-meta { display: flex; flex-wrap: wrap; justify-content: space-between; gap: .5rem; margin: .5rem 0; color: var(--muted); font-weight: 700; }
.execution-status { min-height: 3rem; margin: .55rem 0 0; padding: .65rem .8rem; border-radius: 12px; background: #edf2f8; color: #314b69; }
.execution-status[data-kind="error"] { border-left: 5px solid #ad4c2e; background: #fff0e9; color: #7b3520; font-weight: 700; }
.execution-status[data-kind="success"] { background: #e9f6ed; color: #286342; }
.speed-control { display: inline-flex; align-items: center; gap: .5rem; }
.speed-control select, .select-control { min-height: 48px; padding: .5rem .7rem; border: 1px solid #aeb8c4; border-radius: 12px; background: white; color: var(--ink); }
.hint-box { min-height: 3rem; margin-top: .65rem; padding: .7rem .85rem; border-radius: 12px; background: #fff5de; color: #61491f; }
.concept-shelf { margin-top: 1.4rem; }
.concept-shelf-header { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 1rem; align-items: center; margin-bottom: .7rem; padding: 1rem 1.1rem; border: 1px solid var(--line); border-left: 6px solid var(--blue); border-radius: 18px; background: #fff; }
.concept-shelf.turn .concept-shelf-header { border-left-color: #7955a5; }
.concept-shelf.repeat .concept-shelf-header { border-left-color: #34785c; }
.shelf-copy h2 { margin: 0; font-size: 1.35rem; }
.shelf-copy > p:not(.eyebrow) { max-width: 56rem; margin: .45rem 0 0; color: var(--muted); line-height: 1.5; }
.shelf-copy .shelf-block-cue { color: var(--ink); font-size: .94rem; }
.shelf-summary { display: grid; justify-items: end; gap: .45rem; }
.shelf-summary > span { max-width: 17rem; color: var(--muted); font-size: .83rem; text-align: right; }
.level-grid { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: .6rem; }
.level-card { display: flex; min-height: 112px; flex-direction: column; align-items: start; gap: .25rem; padding: .7rem; border: 1px solid var(--line); border-radius: 14px; background: white; text-decoration: none; }
.level-card[data-recommended="true"] { border-color: #426fb2; box-shadow: 0 0 0 2px #d9e7fa; }
.level-card strong { font-size: 1rem; }
.level-card small { color: var(--muted); }
.level-card.completed { border-color: #67a77e; background: #eff8f1; }
.map-options, .character-options { display: flex; flex-wrap: wrap; gap: .5rem; }
.choice-chip { min-height: 48px; border-color: #aeb8c4; background: white; color: var(--ink); }
.choice-chip[aria-pressed="true"] { border-color: var(--blue-dark); outline: 3px solid #c9dbf2; }
.character-options .choice-chip { justify-content: flex-start; padding-inline: .7rem; }
.character-choice-art { display: grid; width: 2.15rem; height: 2.15rem; flex: 0 0 2.15rem; place-items: center; }
.character-choice-art svg { width: 100%; height: 100%; }
.guide-list { display: grid; gap: .6rem; padding-left: 1.3rem; }
.data-list { display: grid; gap: .5rem; padding: 0; list-style: none; }
.data-list li { padding: .7rem .85rem; border: 1px solid var(--line); border-radius: 12px; background: white; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }
@media (max-width: 900px) {
  .workspace, .columns { grid-template-columns: 1fr; }
  .level-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}
@media (max-width: 700px) {
  .site-header { align-items: start; flex-direction: column; gap: .45rem; }
  .site-header nav { width: 100%; overflow-x: auto; }
  .site-header nav a { flex: 1 0 auto; justify-content: center; }
  .hero { grid-template-columns: 1fr; }
  .hero-visual { min-height: 125px; }
  .hero-visual .hero-mascot { width: 125px; border-width: 7px; border-radius: 30px; }
  .hero-mascot::before { width: 18px; border-width: 3px; }
  .feature-grid { grid-template-columns: 1fr; }
  .concept-shelf-header { grid-template-columns: 1fr; }
  .shelf-summary { justify-items: start; }
  .shelf-summary > span { max-width: none; text-align: left; }
  .level-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .site-footer { align-items: start; flex-direction: column; }
}
@media (max-width: 430px) {
  .palette { grid-template-columns: 1fr 1fr; }
  .level-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .toolbar button, .toolbar .button { flex: 1 1 100%; }
  .maze-board { gap: 3px; }
  .maze-cell { border-radius: 5px; }
  .program-item { grid-template-columns: 1fr; }
  .block-actions { justify-content: start; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}
