:root {
  color-scheme: light;
  --paper: #f7f5ef;
  --ink: #354c43;
  --muted: #6f7d70;
  --lcd-ink: #3c4c31;
  --accent: #b97850;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Noto Sans KR", sans-serif;
  color: var(--ink);
  background: var(--paper);
  font-synthesis: none;
  -webkit-tap-highlight-color: transparent;
}

* { box-sizing: border-box; }
body { margin: 0; overscroll-behavior: none; }
button, input { font: inherit; }
button { -webkit-appearance: none; appearance: none; }
button, a, input { touch-action: manipulation; }
button:focus-visible, a:focus-visible, input:focus-visible { outline: 2px solid #5b7c65; outline-offset: 4px; }
.page { min-height: 100svh; max-width: 1100px; margin: auto; padding: 30px 46px 22px; display: flex; flex-direction: column; }
.page-header { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.wordmark { display: flex; align-items: center; gap: 9px; text-decoration: none; color: var(--ink); font-size: 20px; font-weight: 750; letter-spacing: -.8px; }
.wordmark svg { width: 25px; height: 25px; fill: var(--ink); }
.wordmark .logo-eyes { fill: var(--paper); }
.version { border: 1px solid #d9ddd2; border-radius: 5px; margin-left: 2px; padding: 3px 5px; color: var(--muted); font: 10px ui-monospace, monospace; letter-spacing: 0; }
.header-note { font-size: 9px; letter-spacing: 1.7px; color: var(--muted); }
main { width: 100%; margin: auto; padding-top: 35px; }
.intro { text-align: center; margin-bottom: 27px; }
.eyebrow { color: var(--accent); font: 9px ui-monospace, monospace; letter-spacing: 2px; margin: 0 0 13px; }
h1 { margin: 0; font-size: 31px; font-weight: 650; letter-spacing: -1.6px; }
h1 > span { color: var(--accent); }
.intro-copy { color: var(--muted); font-size: 12px; line-height: 1.6; margin: 11px 0 0; letter-spacing: -.3px; }
.instrument { max-width: 528px; margin: auto; padding: 22px 28px 15px; background: #dfE8dc; border: 1px solid #c7d3c4; border-radius: 30px; box-shadow: inset 0 2px 0 #f2f6ed, inset 0 -5px 0 #c6d3c2, 0 8px 0 -3px #bac7b6, 0 16px 28px -15px #40513e40; user-select: none; -webkit-user-select: none; -webkit-touch-callout: none; }
.device-topline, .device-bottomline { display: flex; justify-content: space-between; align-items: center; font: 9px ui-monospace, monospace; letter-spacing: 1.8px; color: #5d715e; }
.device-topline { margin: 0 3px 15px; }
.device-topline > span { display: flex; align-items: center; }
.power-dot { display: inline-block; width: 5px; height: 5px; background: #789c63; border-radius: 50%; box-shadow: 0 0 0 3px #cfdcc9; margin-right: 9px; }
.tiny-star { font-size: 17px; margin-left: 13px; }
.lcd-frame { background: #bdcab5; border-radius: 15px; padding: 9px; box-shadow: inset 0 2px 4px #6b7c6355, 0 1px 0 #edf2e9; }
.lcd { position: relative; overflow: hidden; background-color: #b5c09a; background-image: linear-gradient(#7c91650c 1px, transparent 1px), linear-gradient(90deg, #7c91650c 1px, transparent 1px); background-size: 3px 3px; border: 1px solid #879774; border-radius: 8px; color: var(--lcd-ink); box-shadow: inset 0 2px 6px #687d5644; }
.lcd-topline, .lcd-bottomline { display: flex; justify-content: space-between; align-items: center; position: relative; z-index: 1; padding: 11px 13px 0; font: 9px ui-monospace, monospace; letter-spacing: 1px; }
.lcd-topline > span:first-child { display: flex; align-items: center; gap: 6px; }
.lcd-dot { display: inline-block; height: 4px; width: 4px; background: currentColor; }
.battery { display: flex; gap: 2px; border: 1px solid currentColor; padding: 2px; width: 22px; height: 10px; position: relative; }
.battery::after { content: ""; position: absolute; width: 2px; height: 4px; background: currentColor; top: 2px; right: -4px; }
.battery i { background: currentColor; width: 4px; }
#pet { width: 100%; height: 156px; display: block; object-fit: contain; image-rendering: pixelated; image-rendering: crisp-edges; }
.lcd-bottomline { padding: 0 13px 11px; font-size: 10px; letter-spacing: .2px; }
#last-note { font: 10px ui-monospace, monospace; }
.controls { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin: 17px 3px; }
.tuning { font: 9px ui-monospace, monospace; letter-spacing: .8px; white-space: nowrap; }
.tuning-mark { font-weight: bold; }
.control-separator { padding: 0 5px; color: #95a78f; }
.sound-controls { display: flex; align-items: center; gap: 12px; }
.sound-toggle { display: flex; align-items: center; gap: 5px; border: 0; color: var(--ink); background: transparent; padding: 8px 0; cursor: pointer; font: 8px ui-monospace, monospace; letter-spacing: .5px; min-height: 32px; }
.speaker-icon { height: 16px; width: 16px; fill: none; stroke: currentColor; stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; }
.sound-slash { display: none; }
.sound-toggle[aria-pressed="true"] .sound-waves { display: none; }
.sound-toggle[aria-pressed="true"] .sound-slash { display: block; }
.volume-control { display: flex; align-items: center; height: 32px; }
input[type="range"] { width: 55px; height: 24px; margin: 0; accent-color: #667e60; cursor: pointer; }
.keybed { position: relative; padding: 15px 10px 0; border-radius: 12px 12px 17px 17px; border: 1px solid #c1b298; background: repeating-linear-gradient(0deg, transparent 0 5px, #a6885c06 5px 6px), linear-gradient(105deg, #dfcfb3, #ebdcc1 48%, #dac7a9); box-shadow: inset 0 1px 3px #a2927a44, 0 1px 0 #f8f8ec; }
.keybed-heading { display: flex; justify-content: space-between; margin: 0 4px 15px; font: 8px ui-monospace, monospace; letter-spacing: 1.5px; color: #938368; }
.keyboard { position: relative; display: grid; grid-template-columns: repeat(17, minmax(0, 1fr)); height: 218px; isolation: isolate; touch-action: none; }
.bridge { position: absolute; left: 7px; right: 7px; top: 52px; height: 14px; border: 1px solid #8f846d; border-radius: 4px; background: linear-gradient(#a89d87, #cec5b0 50%, #8c836f); box-shadow: 0 4px 5px #66563833; display: flex; justify-content: space-between; padding: 4px; }
.bridge span { width: 4px; height: 4px; border-radius: 50%; background: #726955; }
.key { position: relative; display: block; min-width: 0; width: 100%; height: 100%; border: 0; background: none; padding: 0 2px; cursor: pointer; touch-action: none; color: #646d66; }
.tine { position: absolute; top: 0; left: 2px; right: 2px; height: var(--length); display: flex; align-items: center; flex-direction: column; border: 1px solid #9da49a; border-radius: 3px 3px 8px 8px; background: linear-gradient(90deg, #c4cbc2, #f7f9ef 29%, #e1e5db 65%, #bbc5b8); box-shadow: inset 0 1px 0 #fff, inset 0 -3px 1px #c0c7bb, 1px 5px 4px #655f4d2e; transition: transform 70ms ease-out, background 100ms, box-shadow 100ms; pointer-events: none; }
.tine::before { content: ""; position: absolute; top: 20px; left: -1px; right: -1px; height: 5px; background: linear-gradient(#eff2e9, #9aa494 50%, #b6bfae); border-top: 1px solid #838d7c; border-bottom: 1px solid #909b88; }
.key:nth-child(4n + 1) .tine::after { content: ""; width: 4px; height: 24px; position: absolute; top: 39px; border-radius: 2px; background: #b17b616b; }
.key.is-down .tine { transform: translateY(4px); background: linear-gradient(90deg, #b8c9a2, #e9f0ce 35%, #c1d1ab); box-shadow: inset 0 -1px 1px #9eaf90, 0 1px 2px #655f4d33; border-color: #829776; }
.key:focus-visible { outline: none; }
.key:focus-visible .tine { outline: 2px solid #617956; outline-offset: 1px; }
.key-mark { position: absolute; bottom: 15px; display: flex; align-items: center; flex-direction: column; gap: 5px; }
.degree { font: 600 12px ui-monospace, monospace; position: relative; line-height: 1; }
.octave { position: absolute; bottom: calc(100% + 2px); left: 50%; transform: translateX(-50%); font-size: 8px; letter-spacing: -1px; white-space: nowrap; }
.note-name { font: 8px ui-monospace, monospace; color: #7f897a; }
.keybed-signature { height: 40px; display: flex; align-items: center; justify-content: center; gap: 8px; color: #a18d6e; font: italic 9px Georgia, serif; letter-spacing: .6px; }
.keybed-signature > span { font: italic 20px Georgia, serif; }
.device-bottomline { margin: 16px 2px 0; font-size: 7px; letter-spacing: 1.3px; }
.speaker-grille { display: flex; align-items: center; gap: 3px; }
.speaker-grille i { display: block; height: 10px; width: 2px; border-radius: 2px; background: #a2b39c; box-shadow: 1px 0 0 #eef1e8; }
.speaker-grille i:nth-child(2n) { height: 14px; }
.device-screw { display: grid; place-items: center; border-radius: 50%; width: 9px; height: 9px; background: #cbd7c4; color: #91a28b; font: 9px monospace; }
.play-hint { text-align: center; color: var(--muted); font-size: 11px; margin: 23px 0 28px; line-height: 1.7; }
.play-hint > span { color: #b2b6a8; padding: 0 5px; }
.play-hint.has-error, .error-message { color: #9a4933; }
footer { display: flex; align-items: center; justify-content: space-between; color: #8d9485; font-size: 10px; padding-top: 12px; }
footer > span:last-child { font: 8px ui-monospace, monospace; letter-spacing: 1px; }
.footer-flower { font-size: 16px; margin-left: 8px; vertical-align: middle; color: #9aa38e; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; border: 0; }

@media (max-width: 600px) {
  .page { padding: max(18px, env(safe-area-inset-top)) max(12px, env(safe-area-inset-right)) max(16px, env(safe-area-inset-bottom)) max(12px, env(safe-area-inset-left)); }
  .page-header { padding: 0 7px; }
  .wordmark { font-size: 18px; }
  .header-note { display: none; }
  main { padding-top: 26px; }
  .intro { margin-bottom: 22px; }
  .eyebrow { font-size: 8px; letter-spacing: 1.5px; margin-bottom: 11px; }
  h1 { font-size: 27px; }
  .intro-copy { font-size: 11px; margin-top: 9px; }
  .instrument { padding: 18px 12px 14px; border-radius: 24px; }
  .device-topline { margin: 0 6px 12px; font-size: 8px; letter-spacing: 1.5px; }
  .lcd-frame { margin: 0 5px; padding: 7px; }
  #pet { height: clamp(88px, 12svh, 115px); }
  .lcd-topline { font-size: 8px; padding: 10px 10px 0; }
  .lcd-bottomline { font-size: 9px; padding: 0 10px 10px; }
  .controls { margin: 9px 6px; }
  .sound-controls { gap: 8px; }
  .tuning { font-size: 8px; letter-spacing: .2px; }
  .control-separator { padding: 0 2px; }
  .sound-toggle { font-size: 7px; min-height: 36px; }
  input[type="range"] { width: 42px; }
  .keybed { padding: 13px 3px 0; }
  .keybed-heading { font-size: 7px; margin: 0 9px 14px; letter-spacing: 1px; }
  .keyboard { height: clamp(155px, 22svh, 205px); }
  .bridge { top: 48px; left: 2px; right: 2px; }
  .tine { left: 1px; right: 1px; border-radius: 3px 3px 6px 6px; }
  .key:nth-child(4n + 1) .tine::after { top: 34px; height: 14px; }
  .degree { font-size: 11px; }
  .note-name { font-size: 8px; }
  .keybed-signature { height: 33px; font-size: 8px; }
  .device-bottomline { margin: 13px 6px 0; font-size: 6px; letter-spacing: 1px; }
  .play-hint { font-size: 10px; margin: 20px 0; }
  footer { padding: 8px 7px 0; font-size: 9px; }
  footer > span:last-child { font-size: 6px; letter-spacing: .5px; }
}

@media (max-width: 600px) and (max-height: 850px) {
  main { padding-top: 18px; }
  .intro { margin-bottom: 16px; }
  .eyebrow { margin-bottom: 8px; }
  .intro-copy { margin-top: 6px; }
  footer { display: none; }
}

@media (max-width: 600px) and (max-height: 740px) {
  .page { padding-top: max(12px, env(safe-area-inset-top)); padding-bottom: max(12px, env(safe-area-inset-bottom)); }
  main { padding-top: 12px; }
  .intro { margin-bottom: 12px; }
  .eyebrow { display: none; }
  h1 { font-size: 22px; }
  .intro-copy { margin-top: 5px; font-size: 10px; }
  .instrument { padding-top: 12px; padding-bottom: 12px; }
  .device-topline { margin-bottom: 8px; }
  #pet { height: 80px; }
  .controls { margin-top: 6px; margin-bottom: 6px; }
  .keyboard { height: clamp(120px, 23svh, 170px); }
  .key:nth-child(4n + 1) .tine::after { display: none; }
  .keybed-signature { height: 22px; }
  .device-bottomline { margin-top: 11px; }
  .play-hint { margin: 17px 0 10px; font-size: 9px; }
}

@media (max-width: 600px) and (max-height: 620px) {
  .intro-copy { display: none; }
  h1 { font-size: 20px; }
  #pet { height: 70px; }
  .controls { margin-top: 4px; margin-bottom: 4px; }
  .keybed-signature { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  .tine { transition: none; }
}
