:root { color-scheme: light; font-family: 'Malgun Gothic','Apple SD Gothic Neo',system-ui,sans-serif; color: #253c35; background: #f7f5ed; line-height: 1.6; font-synthesis: none; }
* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; min-width: 280px; }
button, input { font: inherit; }
button { cursor: pointer; }
button:focus-visible, input:focus-visible, a:focus-visible, [tabindex='-1']:focus-visible { outline: 3px solid #a84e2c; outline-offset: 4px; }
button:disabled { opacity: .55; cursor: default; }
.skip-link { position: absolute; top: -100px; left: 12px; z-index: 10; padding: 12px; background: #fff; color: #1f4435; }
.skip-link:focus { top: 12px; }
.topbar { max-width: 1350px; height: 76px; margin: auto; padding: 0 48px; display: flex; align-items: center; justify-content: space-between; gap: 15px; border-bottom: 1px solid #dfe5da; }
.brand { display: flex; align-items: center; gap: 11px; font-size: 15px; font-weight: 800; letter-spacing: -.03em; }
.brand-mark { display: inline-block; width: 26px; height: 26px; border: 3px solid #426e59; border-radius: 5px; position: relative; }
.brand-mark::after { content: ''; position: absolute; inset: 4px; border-left: 2px solid #426e59; border-top: 2px solid #426e59; transform: rotate(45deg); }
.hub-link { color: #345b48; font-size: 13px; font-weight: 800; min-height: 44px; display: flex; align-items: center; text-underline-offset: 4px; }
.page { max-width: 1200px; min-height: calc(100vh - 145px); margin: auto; padding: 50px 30px 70px; }
.intro { display: grid; grid-template-columns: 1fr 1fr; align-items: center; gap: 8%; min-height: 555px; }
.intro-copy { padding: 10px 0 25px 28px; }
.eyebrow, .panel-kicker { margin: 0 0 16px; color: #3d6b55; font-size: 12px; font-weight: 800; letter-spacing: .07em; }
h1, h2, p { overflow-wrap: break-word; }
h1 { margin: 0; font-size: clamp(36px,4.8vw,62px); line-height: 1.24; letter-spacing: -.055em; }
h1 span { color: #a47841; }
.lead { color: #4b6558; font-size: 17px; line-height: 1.9; margin: 23px 0 0; }
.intro-note { border-left: 3px solid #bb9963; padding-left: 14px; margin: 22px 0; color: #4b6558; font-size: 14px; }
fieldset { border: 0; padding: 0; margin: 21px 0; min-width: 0; }
legend { margin-bottom: 8px; font-size: 14px; font-weight: 800; }
.settings { display: flex; flex-wrap: wrap; gap: 9px; }
.settings label { display: flex; align-items: center; gap: 8px; min-height: 48px; padding: 9px 14px; border: 1px solid #c3d2c4; border-radius: 9px; background: #fffefa; font-size: 14px; font-weight: 700; cursor: pointer; }
.settings input { width: 18px; height: 18px; margin: 0; accent-color: #386a53; }
.button { min-height: 52px; display: inline-flex; justify-content: center; align-items: center; gap: 16px; border: 1px solid transparent; border-radius: 10px; padding: 12px 20px; font-weight: 800; transition: background-color .15s; }
.primary { background: #315e4c; color: #fff; }
.primary:hover { background: #234b3b; }
.secondary, .outline { background: #fffefa; color: #315747; border-color: #a8bdad; }
.secondary:hover, .outline:hover { background: #edf5ec; }
.arrow { display: inline-block; position: relative; width: 15px; height: 10px; }
.arrow::before { content: ''; position: absolute; width: 13px; height: 2px; background: currentColor; top: 4px; left: 0; }
.arrow::after { content: ''; position: absolute; width: 6px; height: 6px; border-top: 2px solid; border-right: 2px solid; transform: rotate(45deg); top: 1px; right: 1px; }
.intro-art { min-height: 470px; position: relative; display: flex; align-items: center; justify-content: center; border-radius: 28px; background: #edf2e9; overflow: hidden; }
.intro-art svg { display: block; width: min(100%, 500px); }
.intro-art > span { position: absolute; bottom: 25px; color: #4b6558; font-size: 12px; letter-spacing: .05em; }
.game-heading { display: flex; justify-content: space-between; align-items: end; gap: 20px; margin-bottom: 30px; }
.game-heading .eyebrow { margin-bottom: 10px; }
.game-heading h1 { font-size: clamp(28px,3.5vw,42px); }
.separator { color: #4e6959; padding: 0 6px; }
.subtitle { margin: 7px 0 0; color: #4b6558; }
.layout { display: grid; grid-template-columns: minmax(220px,.8fr) minmax(0,1.8fr); gap: 20px; align-items: start; }
.guide-card { border: 1px solid #d4e1d3; border-radius: 17px; background: #eaf2e8; padding: 25px; }
.panel-kicker { margin-bottom: 5px; }
.guide-card h2, .work-card h2, .complete-banner h2 { margin: 0; font-size: 20px; letter-spacing: -.035em; }
.guide-copy, .guide-note { color: #4b6558; font-size: 16px; line-height: 1.75; }
.guide-copy { margin: 10px 0 18px; }
.paper-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.paper-actions .button { flex: 1; padding: 10px; }
.tools { display: grid; grid-template-columns: 1fr; gap: 8px; border-top: 1px solid #cbdcce; margin-top: 20px; padding-top: 16px; }
.tool-heading { margin: 0 0 3px; font-size: 16px; font-weight: 800; }
.tool { display: flex; align-items: center; gap: 12px; min-height: 52px; padding: 8px 13px; border: 1px solid #b8cdb9; border-radius: 9px; color: #294c3b; background: #fffefa; font-weight: 800; text-align: left; }
.tool[aria-pressed='true'] { border: 2px solid #386b4f; background: #f0f7ed; }
.guide-note { margin: 15px 0 0; }
.shape { display: inline-block; width: 27px; height: 27px; background: #497a62; flex: none; }
.shape.circle { border-radius: 50%; }
.shape.triangle { background: #987344; clip-path: polygon(50% 2%,98% 93%,2% 93%); }
.shape.triangle-down { transform: rotate(180deg); }
.eraser { width: 27px; height: 20px; border: 2px solid #6b7464; border-radius: 4px; background: #e5d2b4; transform: rotate(-12deg); flex: none; }
.work-area { display: grid; gap: 14px; }
.work-card, .complete-banner { border: 1px solid #dfe6dc; border-radius: 16px; padding: 24px 27px; background: #fffefa; }
.card-heading { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.badge { padding: 5px 10px; background: #edf4ea; color: #365c48; border-radius: 18px; font-size: 12px; font-weight: 800; white-space: nowrap; }
.cut-count { margin: 12px 0 0; color: #4b6558; font-size: 16px; font-weight: 700; }
.next-step { margin: 12px 0 0; padding: 12px 14px; border-left: 4px solid #386b4f; border-radius: 5px; background: #edf4ea; color: #253c35; font-size: 16px; font-weight: 700; line-height: 1.6; }
.paper-stage { min-height: 280px; display: flex; align-items: center; justify-content: center; padding: 25px 10px; margin-top: 16px; border-radius: 13px; background: #edf3e9; }
.paper { --columns: 4; display: grid; grid-template-columns: repeat(var(--columns),minmax(0,1fr)); width: min(100%,460px); padding: 7px; gap: 3px; border: 2px solid #c6b38c; border-radius: 6px; background: #e8d9b8; box-shadow: 0 8px 0 #d6c7a8; transition: max-width .3s ease; }
.paper.folded { max-width: 280px; }
.paper.unfolded { max-width: 460px; }
.cell { min-width: 0; min-height: 44px; aspect-ratio: 1.4 / 1; padding: 5px; border: 1px dashed #baa982; border-radius: 3px; display: flex; align-items: center; justify-content: center; background: #fbf6e9; }
button.cell { min-width: 44px; }
button.cell:hover { background: #f1f8ec; border-color: #558367; }
.cell .shape { width: min(55%,30px); height: auto; aspect-ratio: 1; }
.pattern-summary { color: #385b47; line-height: 1.7; font-size: 16px; font-weight: 700; margin: 16px 0 0; }
.hint { margin: 10px 0 0; color: #4d6558; font-size: 13px; }
.complete-banner { background: #edf5eb; }
.complete-banner p:not(.panel-kicker) { color: #456451; margin: 8px 0 16px; }
.status { min-height: 1.6em; margin: 0; padding: 0 4px; color: #315a45; font-size: 16px; font-weight: 700; }
.actions { display: flex; flex-wrap: wrap; align-items: center; gap: 9px; }
.text-button { min-height: 48px; padding: 10px; border: 0; background: transparent; color: #486358; text-decoration: underline; text-underline-offset: 4px; font-weight: 700; }
.stopped { max-width: 620px; margin: 55px auto; padding: 65px 25px; text-align: center; border: 1px solid #dfe6dc; border-radius: 23px; background: #fffefa; }
.stopped h1 { font-size: clamp(32px,4vw,46px); }
.stopped > p:not(.eyebrow) { color: #4b6558; }
.stopped .button { margin-top: 18px; }
.finish-note { margin-top: 24px; font-size: 13px; }
.finish-mark { width: 58px; height: 58px; margin: 0 auto 22px; border-radius: 50%; background: #e5f0e5; position: relative; }
.finish-mark::after { content: ''; position: absolute; width: 24px; height: 13px; border-left: 3px solid #47775c; border-bottom: 3px solid #47775c; transform: rotate(-45deg); left: 17px; top: 17px; }
.footer { max-width: 1200px; margin: auto; padding: 20px 30px 28px; border-top: 1px solid #e0e6dc; color: #4b6558; font-size: 13px; font-weight: 600; display: flex; justify-content: space-between; gap: 10px; }
dialog { width: min(420px,calc(100vw - 32px)); border: 0; border-radius: 18px; padding: 0; color: #253c35; box-shadow: 0 24px 80px #182c2460; }
dialog::backdrop { background: #15271dbc; }
.dialog-content { padding: 35px; }
.dialog-content h2 { margin: 0; font-size: 25px; }
.dialog-content p:not(.eyebrow) { color: #4b6558; margin: 14px 0 24px; }
@media (max-width: 760px) { .topbar { padding: 0 18px; height: 64px; } .page { padding: 34px 18px 48px; } .intro, .layout { grid-template-columns: 1fr; } .intro { gap: 28px; } .intro-copy { padding: 0 4px; } .intro-art { min-height: 300px; } .intro-art svg { max-height: 340px; } .game-heading { align-items: start; flex-direction: column; } .guide-card, .work-card, .complete-banner { padding: 20px; } .tools { grid-template-columns: repeat(3,minmax(0,1fr)); } .tool-heading { grid-column: 1 / -1; } .tool { flex-direction: column; justify-content: center; gap: 5px; font-size: 14px; } .footer { padding: 18px; } }
@media (max-width: 430px) { .work-card { padding: 14px; } .paper-stage { padding: 20px 2px; min-height: 220px; } .paper { padding: 4px; gap: 2px; } .actions .primary { width: 100%; } .paper-actions { flex-direction: column; } .tools { gap: 5px; } .tool { padding: 8px 3px; } }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; } }
.sr-only { position: absolute; width: 1px; height: 1px; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
#memory-host { margin: 0 0 20px; }
.memory svg { display: block; width: min(100%, 400px); height: auto; margin: 0 auto; }
