body { margin:0; background:#fbf2e6; color:#412f41; font:16px/1.45 "Trebuchet MS",system-ui,sans-serif; }
.beat { --ink:#412f41; --plum:#70465f; --line:#d6bfa1; --cream:#fffaf1; width:100%; max-width:990px; margin:auto; padding:clamp(11px,2.1vw,23px); }
.beat,.beat * { box-sizing:border-box; }
.beat [hidden] { display:none !important; }
.beat h1,.beat h2 { font-family:Georgia,serif; line-height:1.13; margin:0; }
.beat h1 { font-size:clamp(1.5rem,4vw,2.3rem); }
.beat h2 { font-size:clamp(1.32rem,3.4vw,2rem); }
.mast,.progress,.actions { display:flex; align-items:center; gap:.5rem; }
.mast { justify-content:space-between; margin-bottom:12px; }
.paper { border:1px solid var(--line); border-radius:19px; padding:clamp(11px,2.3vw,22px); background:var(--cream); }
.welcome { display:grid; grid-template-columns:minmax(0,1.1fr) minmax(0,1fr); align-items:center; gap:clamp(.8rem,3vw,2rem); }
.cover { display:block; width:100%; aspect-ratio:1.55; object-fit:cover; border-radius:13px; }
.welcome p,.desk p { margin:.55rem 0 .8rem; }
.beat button,.beat select { min-height:44px; font-family:inherit; line-height:1.18; font-size:.94rem; font-weight:700; cursor:pointer; }
.beat button:not(.pad),.beat select { padding:.48rem .78rem; border-radius:11px; }
.beat .primary { background:#75455e; color:white; border:1px solid #62364e; }
.beat .soft,.beat select { color:#573a4c; background:#fffdf6; border:1px solid #b9a78f; }
.beat :focus-visible { outline:3px solid #345e79; outline-offset:2px; }
.beat button:disabled { cursor:default; opacity:.55; }
.progress { justify-content:space-between; font-weight:700; font-size:.95rem; margin:0 0 .65rem; color:#5e4256; }
.progress progress { width:min(38%,140px); height:9px; accent-color:#805065; }
.layout { display:grid; grid-template-columns:minmax(0,.82fr) minmax(0,1fr); align-items:center; gap:clamp(13px,3.2vw,34px); }
.portrait-column { width:100%; max-width:352px; justify-self:center; padding:clamp(6px,.9vw,11px); background:#805952; border:1px solid #6b4b48; border-radius:50% 50% 17px 17px / 13% 13% 17px 17px; box-shadow:inset 0 0 0 3px #b69670; }
#portrait { position:relative; aspect-ratio:1; overflow:hidden; border-radius:50% 50% 8px 8px / 12% 12% 8px 8px; background:#edd5be; }
#mist,#brows { position:absolute; inset:0; display:block; width:100%; height:100%; }
#mist { object-fit:contain; }
#brows { pointer-events:none; }
#brows path { fill:#4d353c; stroke:#5e413f; stroke-width:.22; }
#portrait[data-move="wiggle"] #brows path { transform-box:fill-box; transform-origin:center; animation:wiggle .46s ease-in-out 1; }
#portrait[data-move="wiggle"] #right-brow { animation-direction:reverse; }
@keyframes wiggle { 0%,100% { transform:translateY(0) rotate(0); } 32% { transform:translateY(-1px) rotate(-6deg); } 68% { transform:translateY(1px) rotate(5deg); } }
#pose { color:#fff9ed; font:700 .98rem/1.25 Georgia,serif; text-align:center; padding:.37rem .2rem .09rem; }
.desk { min-width:0; }
#track { list-style:none; display:flex; flex-wrap:wrap; gap:5px; padding:0; margin:.5rem 0; }
#track:empty { display:none; }
#track li { display:grid; place-items:center; min-width:2.2rem; height:2rem; padding:0 .4rem; border:1px dashed #ad9b86; border-radius:9px; background:#faf0df; color:#594855; font-size:.83rem; font-weight:700; }
#track li.done { background:#e9eee0; border:1px solid #9bab86; color:#374d38; }
#track li.current { background:#f8e1b7; border:2px solid #8d602e; color:#55391f; }
#pads { border:0; padding:0; margin:.7rem 0; min-width:0; }
#pads legend { font-size:.91rem; font-weight:700; margin:0 0 .3rem; padding:0; }
#pad-grid { display:grid; grid-template-columns:repeat(4,minmax(0,1fr)); gap:5px; }
.pad { display:flex; align-items:center; justify-content:center; flex-direction:column; min-width:0; border-radius:11px; padding:4px; color:#493746; border:1px solid #baa2a4; background:#f9e9e5; }
.pad:nth-child(2) { background:#e1ebe8; }.pad:nth-child(3) { background:#eee6f0; }.pad:nth-child(4) { background:#f6edce; }
.pad svg { display:block; height:17px; width:46px; max-width:90%; stroke:#533e48; stroke-width:3.1; stroke-linecap:round; fill:none; }
.pad span { font-size:.85rem; }
.pad[aria-current="true"] { outline:2px solid #805b2e; outline-offset:-3px; }
.actions { flex-wrap:wrap; }
.desk #feedback { font-weight:700; color:#653f55; margin:.36rem 0 .55rem; }
#feedback:empty { display:none; }
#tempo-control { display:inline-flex; gap:.45rem; align-items:center; color:#604d58; flex-wrap:wrap; font-size:.85rem; margin-top:.6rem; }
.beat select { min-height:38px; font-weight:600; }
@media(hover:hover) { .beat button:hover:not(:disabled) { filter:brightness(.95); } }
@media(max-width:540px) {
 .welcome,.layout { grid-template-columns:1fr; }
 .cover { aspect-ratio:2.25; object-position:center 43%; }
 .portrait-column { max-width:min(55vw,220px); }
 .mast { margin-bottom:8px; }
 .layout { gap:9px; }
 .actions { gap:5px; }
}
@media(max-height:420px) and (min-width:460px) {
 .portrait-column { max-width:175px; } .layout { grid-template-columns:minmax(120px,.62fr) minmax(0,1fr); align-items:start; }
 .beat { padding:8px; } .paper { padding:9px; }
}
@media(prefers-reduced-motion:reduce) { #brows path { animation:none!important; } }
