:root {
  color-scheme: light;
  --paper: #e9e7e0;
  --panel: #f7f5ee;
  --ink: #1e2531;
  --muted: #555d68;
  --line: #c5c4ba;
  --copper: #d88962;
  --glass: #1c2638;
  --lit: #fff2d3;
  --teal: #356c5d;
  --no: #992e28;
  font: 16px/1.45 "Instrument Sans", system-ui, sans-serif;
  color: var(--ink);
  background: var(--paper);
}
* { box-sizing: border-box }
body { margin: 0 }
[hidden] { display: none !important }
button, input { font: inherit }
button { cursor: pointer }
button:disabled { cursor: default }
button:focus-visible, a:focus-visible, input:focus-visible { outline: 3px solid #a24f25; outline-offset: 3px }
.ylare { max-width: 1136px; margin: auto; padding: clamp(12px,4vw,48px); }
.desk { display: grid; grid-template-columns: 1fr 1.06fr; border: 1px solid #a3a49b; border-radius: 24px; background: var(--panel); min-height: 490px; box-shadow: 0 12px 30px #24271c18; overflow: hidden }
.console { position: relative; display: grid; align-content: space-between; grid-template-rows: auto 1fr auto; min-height: 440px; gap: 24px; isolation: isolate; overflow: hidden; padding: clamp(19px,3.5vw,44px); color: var(--lit); background: var(--glass) }
.console canvas { position: absolute; z-index: -1; pointer-events: none; inset: 0; width: 100%; height: 100% }
.brand-bar, .display-top, .question-meta, .name-row { display: flex; align-items: center; gap: 12px; justify-content: space-between }
.wordmark { font: 800 2rem/1 "Instrument Sans", system-ui, sans-serif; letter-spacing: -.08em; white-space: nowrap }
.rewind { color: #f3a278; font-size: 1.35rem; letter-spacing: 0 }
.quiet { color: inherit; background: none; border: 1px solid #ffffff43; border-radius: 100px; font-size: .8rem; padding: 8px 11px; white-space: nowrap }
.quiet:hover { background: #ffffff1a }
.display { align-self: center }
.display-top, .track, .question-meta { font-family: "IBM Plex Mono", ui-monospace, monospace; font-size: .72rem; letter-spacing: .055em; font-weight: 600 }
.display-top { color: #f2a580 }
.display-main { font: 400 clamp(3.9rem,8vw,7.35rem)/.86 "Instrument Serif", Georgia, serif; letter-spacing: -.065em; margin: 16px 0 }
.display-hint { color: #fcf0d6d7; font-size: .9rem; max-width: 24ch; margin: 16px 0 0 }
.track { display: grid; grid-template-columns: repeat(7,1fr); gap: 5px }
.tick { text-align: center; color: #fff6d99c; padding-top: 5px; border-top: 2px solid #b9bad34a }
.tick.active { color: #ffbc91; border-color: #f3a278 }
.tick.correct { color: #a0e6c6; border-color: #86be9c }
.tick.miss { color: #f3abb0; border-color: #d57b83 }
.controls { padding: clamp(19px,3.5vw,45px); display: grid; align-content: center; min-width: 0 }
.panel { display: grid; gap: 12px; min-width: 0 }
button.primary, button.secondary { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 14px 17px; border-radius: 9px; border: 1px solid var(--ink); font-weight: 700; text-align: left }
button.primary { background: var(--ink); color: var(--lit) }
button.primary:hover { background: #323f54 }
button.secondary { background: transparent; color: var(--ink); border-color: #999d95 }
button.secondary:hover { background: #edebe1 }
#welcome button { font-size: 1.07rem }
#welcome .quiet-text { color: var(--muted); font-size: .81rem; margin: 2px 0 0 }
#ylare h1 { font-size: clamp(1.33rem,2.8vw,2.25rem); line-height: 1.1; letter-spacing: -.045em; margin: 2px 0 5px }
#ylare h2 { font-size: 1rem; margin: 0 }
#ylare p { overflow-wrap: anywhere }
.question-meta { color: var(--muted) }
.question-meta > span { white-space: nowrap }
progress { appearance: none; width: 100%; height: 6px; border: 0; overflow: hidden; border-radius: 10px; background: #dddcd1 }
progress::-webkit-progress-bar { background: #dddcd1 }
progress::-webkit-progress-value { background: #a85332 }
progress::-moz-progress-bar { background: #a85332 }
.answers { display: grid; gap: 8px }
.answer { display: grid; grid-template-columns: 26px 1fr auto; text-align: left; align-items: center; gap: 9px; min-height: 48px; padding: 8px 11px; color: var(--ink); background: #fffdf6; border: 1px solid #cfccbf; border-radius: 8px; line-height: 1.22; font-size: .9rem }
.answer:not(:disabled):hover { background: #f3e5d0; border-color: #ad704d }
.answer .key { display: grid; place-items: center; width: 24px; height: 24px; background: #ece9dc; border-radius: 5px; font: .75rem "IBM Plex Mono", ui-monospace, monospace }
.answer.correct { border-color: #54836d; background: #dfefe2 }
.answer.miss { border-color: #b15b4b; background: #fae7df }
.answer .percent { color: var(--muted); min-width: 0; white-space: nowrap; font-size: .72rem }
#feedback { font-size: .86rem; border-top: 1px solid var(--line); padding-top: 11px }
#feedback p { margin: 0 0 5px }
#verdict { font-weight: 800 }
#feedback a { color: #365c58; text-underline-offset: 3px }
#feedback button { margin-top: 11px; width: 100% }
.result-grid { display: flex; flex-wrap: wrap; gap: 4px; font: 1.1rem "IBM Plex Mono", monospace }
.result-grid span { display: grid; place-items: center; width: 28px; height: 29px; border-radius: 5px; background: #ece9dc }
.result-grid .right { color: var(--teal); background: #dfefe2 }
.result-grid .wrong { color: var(--no); background: #f8e5df }
#result-details, #result-status { margin: 0; color: var(--muted); font-size: .88rem }
#result-status:empty { display: none }
#board { border-top: 1px solid var(--line); padding-top: 9px }
#board-list { margin: 5px 0; padding-left: 23px; font-size: .89rem }
#board-list li { padding-left: 2px }
#name-form label { display: block; font-size: .76rem; margin-bottom: 5px }
#nickname { border: 1px solid #92998f; border-radius: 8px; padding: 6px 8px; background: #fffdf6; min-width: 0; flex: 1; color: var(--ink) }
.name-row button { padding: 7px 12px }
.result-actions { display: flex; flex-wrap: wrap; gap: 7px }
.result-actions button { flex: 1 auto; padding: 9px 12px }
#instructions { max-width: min(450px,calc(100% - 28px)); border: 1px solid #827f72; border-radius: 13px; padding: 24px; color: var(--ink); background: var(--panel) }
#instructions::backdrop { background: #121c2bb5 }
#instructions button { margin-top: 10px }
.site-header, .site-content, .site-footer { width: min(100% - 36px,1040px); margin-inline: auto }
.site-header { display: flex; align-items: center; justify-content: space-between; padding: 12px 0 }
.site-header a, .site-footer a { color: var(--ink); text-underline-offset: 4px }
.site-header strong { font-size: 1.5rem; letter-spacing: -.075em }
.game-frame { border:0; display:block; width:min(100%,1140px); margin-inline:auto; height: 665px }
.game-shell { text-align: center; padding: 20px; min-height: 375px; display: grid; place-content: center; gap: 10px }
.game-shell button { font: inherit; font-weight: 700; cursor: pointer; padding: 11px 20px }
.game-cover { grid-template-columns: minmax(0,300px) minmax(0,380px); align-items:center; gap:32px; min-height:600px }
.cover-example { width:100%; height:auto; aspect-ratio:375 / 575; object-fit:cover; object-position:top; border-radius:16px }
.cover-intro { min-width:0 }
.cover-intro h1 { font-size:clamp(2.5rem,6vw,4.5rem); margin:12px 0; letter-spacing:-.06em }
.cover-intro .quiet-text { color:var(--muted); font-size:.85rem }
.game-example { margin:24px 0; display:grid; justify-items:center; gap:12px }
.game-example img { display:block; width:min(100%,375px); height:auto; aspect-ratio:375 / 575; object-fit:cover; object-position:top; border-radius:16px }
.game-example figcaption { font-size:.85rem; color:var(--muted); text-align:center }
.site-content { max-width: 740px; padding: 12px 0 40px }
.site-content h1, .site-content h2 { letter-spacing: -.045em; line-height: 1.1 }
.site-content h1 { font-size: clamp(1.7rem,5vw,3rem) }
.site-content h2 { margin-block: 2em .5em }
.site-footer { border-top:1px solid var(--line); padding: 16px 0; display: flex; flex-wrap: wrap; gap: 14px; font-size: .82rem }
.game-actions { display:flex; flex-wrap:wrap; align-items:center; gap:12px; padding-block:16px }
.game-actions button, .comments button { border:1px solid var(--line); border-radius:8px; background:var(--lit); color:var(--ink); padding:9px 15px }
.game-actions [aria-pressed="true"] { background:var(--ink); color:var(--lit) }
.comments form, .comments label { display:grid; gap:8px }
.comments form { gap:16px }
.comments input, .comments textarea { width:100%; max-width:100%; font:inherit; color:var(--ink); background:var(--lit); border:1px solid var(--line); border-radius:8px; padding:10px }
.comments textarea { min-height:110px; resize:vertical }
.comments button { justify-self:start }
.comments ul { padding:0; list-style:none }
.comments li { padding:16px 0; border-bottom:1px solid var(--line); overflow-wrap:anywhere }
.comments p { margin-block:4px }
@media (max-width: 700px) {
  .game-cover { grid-template-columns: minmax(0,1fr); gap:14px; min-height:0 }
  .cover-intro { order:-1 }
  .cover-example { width:min(100%,210px); justify-self:center }
  .cover-intro h1 { margin:6px 0 }
  .desk { grid-template-columns: 1fr; min-height: auto; border-radius: 16px }
  .console { min-height: clamp(205px,54vw,260px); gap: 14px; padding: 16px 19px }
  .display-main { font-size: clamp(3.1rem,13vw,5.2rem); margin-block: 9px }
  .display-hint { margin-top: 7px }
  .console .display-top, .track { font-size: .64rem }
  .controls { padding: 16px }
  .game-frame { height: 800px }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .01ms !important }
}
