:root {
  color: #253d43;
  background: #e9e4d8;
  font-family: 'Malgun Gothic', system-ui, sans-serif;
  line-height: 1.6;
}
* { box-sizing: border-box; }
body { margin: 0; }
main { max-width: 1080px; margin: 0 auto; padding: clamp(18px, 4vw, 40px); }
button, a { font: inherit; }
button { min-width: 48px; min-height: 48px; padding: 10px 15px; border: 2px solid #718b80; border-radius: 9px; background: #fffdf7; color: #253d43; font-weight: 700; cursor: pointer; }
button:hover:not(:disabled) { border-color: #285e57; background: #edf6f0; }
button:disabled { opacity: .55; cursor: default; }
button:focus-visible, a:focus-visible, [tabindex='-1']:focus-visible { outline: 4px solid #9c482d; outline-offset: 3px; }
button.primary { color: #fff; border-color: #275c55; background: #275c55; }
button.primary:hover:not(:disabled) { background: #1e4943; }
a { color: #174d5c; }
[hidden] { display: none !important; }
h1, h2, h3, p { margin-top: 0; }
h1 { font-size: clamp(1.8rem, 4vw, 2.6rem); line-height: 1.25; margin-bottom: 16px; }
h2 { font-size: 1.35rem; }
h3 { font-size: 1.1rem; }
.menu, .poem-game { background: #fffdf7; border: 1px solid #d5c7b2; border-radius: 18px; padding: clamp(20px, 4vw, 38px); box-shadow: 0 5px 0 #d8cfbd; }
.hub { min-height: 48px; display: inline-flex; align-items: center; font-weight: 700; }
.intro { display: grid; grid-template-columns: minmax(0, 1fr) minmax(220px, .8fr); gap: 30px; align-items: center; padding: 20px 0 6px; }
.intro-copy { max-width: 36rem; }
.intro-art { width: 100%; max-width: 400px; justify-self: end; }
.eyebrow { color: #486c65; font-weight: 700; margin-bottom: 8px; }
.lead { font-size: clamp(1.2rem, 2.6vw, 1.6rem); line-height: 1.5; font-weight: 700; }
.note { max-width: 48ch; color: #49625e; }
#start { margin-top: 10px; }
.desk-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: baseline; gap: 8px; margin-top: 28px; }
.desk-head h2, .desk-head p { margin-bottom: 8px; }
.goal { font-weight: 700; color: #49625e; }
.lines { display: grid; gap: 16px; }
.line-card { border: 1px solid #d6c7ad; border-left: 6px solid #b7795a; border-radius: 8px; background: #fcf8ed; padding: clamp(15px, 3vw, 22px); }
.line-card h3 { color: #7c4d3a; margin-bottom: 6px; }
.line-summary { min-height: 2em; border-bottom: 1px solid #d9ceba; padding-bottom: 10px; font-size: 1.18rem; font-weight: 700; overflow-wrap: anywhere; }
.word-groups { display: grid; grid-template-columns: 1fr 1.5fr; gap: 18px; }
fieldset { min-width: 0; margin: 0; padding: 0; border: 0; }
legend { padding: 0; margin-bottom: 8px; font-weight: 700; }
.word-choices { display: flex; flex-wrap: wrap; gap: 8px; }
.word { display: inline-flex; align-items: center; justify-content: space-between; gap: 10px; text-align: left; }
.word-state { flex: none; border-radius: 5px; padding: 2px 6px; background: #e9ede7; color: #334f49; font-size: .875rem; line-height: 1.4; white-space: nowrap; }
.word[aria-pressed='true'] { color: #143e38; border-color: #246358; background: #d8ece2; box-shadow: inset 0 -3px 0 #77a99a; }
.word[aria-pressed='true'] .word-state { color: #fff; background: #275c55; }
.line-controls, .actions { display: flex; flex-wrap: wrap; gap: 8px; }
.line-controls { margin-top: 16px; }
.actions { margin-top: 16px; }
.main-actions { padding-top: 16px; border-top: 1px solid #d8d1c3; }
.result { margin-top: 24px; padding: clamp(18px, 4vw, 30px); border: 1px solid #c6b99f; border-radius: 10px; background: #fcf8ed; }
.result ol { padding-left: 2em; font-size: 1.2rem; font-weight: 700; line-height: 2; overflow-wrap: anywhere; }
.status { min-height: 2.5em; margin: 18px 0 0; padding: 10px 14px; border-left: 4px solid #39786b; background: #e7f2eb; font-weight: 700; }
dialog { width: min(90vw, 470px); padding: 24px; border: 2px solid #719287; border-radius: 14px; background: #fffdf7; color: #253d43; }
dialog::backdrop { background: #172c2bc2; }
.line-card.moved { animation: line-moved .18s ease-out; }
@keyframes line-moved { from { transform: translateY(5px); opacity: .85; } to { transform: translateY(0); opacity: 1; } }
@media (max-width: 640px) {
  main { padding: 12px; }
  .intro, .word-groups { grid-template-columns: 1fr; }
  .intro { gap: 12px; }
  .intro-art { max-width: 280px; justify-self: center; }
  .word-choices button { flex: 1 1 auto; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
}
