:root { color-scheme: light; font-family: 'Malgun Gothic', 'Apple SD Gothic Neo', sans-serif; color: #342e2c; background: #fbf8f2; }
* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; }
button, input { font: inherit; }
button { cursor: pointer; }
button:disabled { cursor: default; opacity: .55; }
button:focus-visible, a:focus-visible, input:focus-visible, .print-summary:focus-visible { outline: 3px solid #6a3e71; outline-offset: 3px; }
.skip-link { position: absolute; top: -80px; left: 12px; z-index: 5; padding: 12px; background: #fff; color: #3f2547; }
.skip-link:focus { top: 8px; }
.topbar { height: 76px; display: flex; justify-content: space-between; align-items: center; gap: 20px; padding: 0 max(6vw,24px); border-bottom: 1px solid #eadfd0; background: #fffdf9; }
.brand { display: flex; align-items: center; gap: 10px; font-weight: 800; }
.brand-mark { width: 23px; height: 23px; border: 4px solid #87544f; border-radius: 5px; box-shadow: inset 0 0 0 3px #fffdf9; background: #87544f; }
.topbar a { min-height: 44px; display: flex; align-items: center; color: #673d3a; font-size: 14px; font-weight: 700; text-underline-offset: 4px; }
.page { max-width: 1220px; margin: 0 auto; padding: 54px 28px 76px; }
.intro { display: grid; grid-template-columns: minmax(0,1fr) minmax(0,1fr); gap: 50px; align-items: center; min-height: 570px; }
.intro-copy { padding-left: 14px; }
.eyebrow, .panel-kicker { color: #744b42; font-size: 14px; font-weight: 800; letter-spacing: .03em; }
h1, h2, p { margin: 0; }
h1 { font-size: clamp(30px,4vw,50px); line-height: 1.25; letter-spacing: -.04em; margin: 15px 0 22px; }
h2 { font-size: 22px; line-height: 1.35; letter-spacing: -.02em; }
.lead { font-size: 20px; line-height: 1.7; font-weight: 700; }
.intro-note, .subtitle, .guide, .finish-note { color: #5a4c45; line-height: 1.7; }
.intro-note { margin-top: 16px; }
fieldset { border: 0; padding: 0; margin: 27px 0 24px; }
legend { font-size: 15px; font-weight: 800; margin-bottom: 10px; }
.settings { display: flex; flex-wrap: wrap; gap: 10px; }
.settings label { min-height: 48px; display: flex; align-items: center; gap: 8px; padding: 10px 13px; border: 1px solid #c5a89e; border-radius: 9px; background: #fffdf9; cursor: pointer; font-weight: 700; }
input[type='radio'] { width: 19px; height: 19px; accent-color: #87544f; }
.button { min-height: 50px; padding: 12px 20px; border: 1px solid transparent; border-radius: 9px; font-weight: 800; }
.primary { background: #70433f; color: #fff; }
.secondary { background: #fffdf9; color: #5d3431; border-color: #bd9e95; }
.outline { background: transparent; color: #5d3431; border-color: #a98780; }
.intro-art { border-radius: 22px; background: #f1e6d7; min-height: 390px; display: flex; flex-direction: column; justify-content: center; align-items: center; padding: 18px; }
.intro-art svg { display: block; width: 100%; max-height: 360px; }
.intro-art span { color: #70483e; font-size: 14px; font-weight: 800; padding-bottom: 8px; }
.game-heading { display: flex; justify-content: space-between; align-items: end; gap: 24px; margin-bottom: 28px; }
.game-heading h1 { font-size: 32px; margin: 10px 0 8px; }
.layout { display: grid; grid-template-columns: minmax(260px, .8fr) minmax(0,1.45fr); gap: 18px; align-items: start; }
.tool-card, .paper-card, .complete-banner { background: #fffdf9; border: 1px solid #e7d9c7; border-radius: 16px; padding: 25px; }
.tool-card h2, .paper-card h2 { margin: 6px 0 10px; }
.guide { font-size: 15px; }
.dot-grid { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 8px; max-width: 260px; margin: 20px auto 14px; }
.dot-button { min-width: 44px; min-height: 62px; display: flex; align-items: center; justify-content: center; gap: 8px; border: 1px solid #c8ada3; border-radius: 10px; background: #fbf6ef; color: #503d39; font-size: 13px; font-weight: 800; }
.dot-button[aria-pressed='true'] { border: 2px solid #70433f; background: #f7e9e2; }
.dot-mark { display: inline-block; width: 24px; height: 24px; border: 2px dashed #80675e; border-radius: 50%; background: #fffdf9; }
.dot-mark.on { border: 2px solid #70433f; background: #70433f; box-shadow: inset 0 0 0 4px #f7e9e2; }
.pattern-summary { min-height: 24px; font-size: 14px; font-weight: 700; color: #563c35; line-height: 1.6; }
.size-controls { border-top: 1px solid #e8ddd1; padding-top: 18px; margin-top: 18px; }
.size-controls p { font-weight: 800; margin-bottom: 8px; }
.size-controls div { display: flex; gap: 8px; }
.size-controls button { min-width: 66px; min-height: 46px; border-radius: 8px; border: 1px solid #b69487; color: #5d3431; background: #fff; font-weight: 800; }
.size-controls button[aria-pressed='true'] { border: 2px solid #70433f; background: #f6e7de; }
.size-controls small { display: block; margin-top: 9px; color: #5a4c45; line-height: 1.6; }
.work-area { display: grid; gap: 14px; }
.card-heading { display: flex; align-items: start; justify-content: space-between; gap: 12px; }
.badge { padding: 7px 10px; background: #f7eae1; border-radius: 20px; color: #693f39; font-size: 12px; font-weight: 800; }
.paper { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 8px; margin-top: 18px; padding: 14px; border: 1px solid #d6c3a9; background: #f7f0e3; border-radius: 6px; }
.print-place { position: relative; min-width: 44px; min-height: 125px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 7px; padding: 12px 5px; border: 1px dashed #b29483; border-radius: 5px; background: #fffaf1; color: #5c4940; }
.print-place:hover { background: #f9ece1; }
.place-label { font-size: 12px; font-weight: 800; }
.place-caption, .empty-place { font-size: 12px; color: #66514b; font-weight: 700; }
.print-preview { display: grid; grid-template-columns: repeat(2,1fr); gap: 5px; border: 2px solid #a76a5a; padding: 6px; border-radius: 4px; }
.print-preview.small { width: 46px; }
.print-preview.large { width: 62px; }
.print-dot { width: 100%; aspect-ratio: 1; border: 1px dashed #b49c92; border-radius: 50%; }
.print-dot.on { border: 1px solid #87544f; background: #87544f; }
.complete-banner { background: #f5ede2; }
.complete-banner p { color: #5a4c45; margin: 8px 0 14px; line-height: 1.6; }
.status { min-height: 28px; color: #603a34; font-weight: 800; line-height: 1.6; }
.actions { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.text-button { min-height: 48px; padding: 10px; border: 0; background: transparent; color: #603a34; text-decoration: underline; text-underline-offset: 4px; font-weight: 700; }
.stopped { max-width: 580px; min-height: 490px; margin: auto; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; }
.stopped h1 { font-size: 32px; }
.stopped > p { line-height: 1.7; }
.stopped .button { margin-top: 24px; }
.finish-note { margin-top: 20px; font-size: 13px; }
.finish-mark { width: 54px; height: 54px; border: 4px solid #87544f; border-radius: 9px; margin-bottom: 25px; background: radial-gradient(circle at 30% 30%,#87544f 4px,transparent 5px),radial-gradient(circle at 70% 70%,#87544f 4px,transparent 5px); }
footer { display: flex; justify-content: space-between; gap: 16px; max-width: 1220px; margin: 0 auto; padding: 22px 28px; color: #64544d; font-size: 13px; border-top: 1px solid #ebdfd1; }
dialog { width: min(420px,calc(100% - 32px)); border: 1px solid #d1b9aa; border-radius: 16px; padding: 0; color: #342e2c; background: #fffdf9; }
dialog::backdrop { background: rgba(40,28,25,.45); }
.dialog-content { padding: 30px; }
.dialog-content h2 { margin: 10px 0; }
.dialog-content p { line-height: 1.7; }
.dialog-content .button { margin-top: 22px; }
@media (max-width: 760px) { .topbar { height: 64px; padding: 0 18px; } .page { padding: 34px 18px 48px; } .intro, .layout { grid-template-columns: 1fr; } .intro { gap: 25px; min-height: 0; } .intro-copy { padding: 0; } .intro-art { min-height: 270px; } .intro-art svg { max-height: 280px; } .game-heading { align-items: start; flex-direction: column; } .tool-card, .paper-card, .complete-banner { padding: 19px; } footer { padding: 18px; } }
@media (max-width: 380px) { .paper-card { padding: 13px; } .paper { padding: 6px; gap: 5px; } .actions .primary { width: 100%; } }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; scroll-behavior: auto !important; } }
.sr-only { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
#memory-host svg { max-width: 100%; height: auto; }
