/* 숫자드럼 uses the shared game palette, controls and 14px type floor. */
.rhythm-card-art{background:radial-gradient(ellipse at center,#4c317066,transparent 75%),#211a3e}
.rhythm-card-pads{display:grid;grid-template-columns:repeat(2,58px);gap:9px;transform:rotate(-7deg)}
.rhythm-card-pads span{display:grid;place-items:center;width:58px;height:45px;border:1px solid #51d9ef88;border-radius:10px;color:var(--left);background:#1a334c;box-shadow:0 4px 0 #0a0b21;font-size:29px;font-weight:900}
.rhythm-card-pads span:nth-child(even){border-color:#ff87bd88;color:var(--right);background:#3b2343}
.rhythm-copy{color:#d2c4e5;font-size:14px;line-height:1.8}
.rhythm-demo{display:grid;grid-template-columns:1fr 1fr;gap:16px;width:min(100%,320px);margin:21px auto 17px}
.rhythm-demo-hand{padding:16px 10px;border:1px solid #51d9ef70;border-radius:15px;color:var(--left);background:#1a2c45;box-shadow:0 4px 0 #0b0b22;text-align:center}
.rhythm-demo-hand.right{border-color:#ff87bd70;color:var(--right);background:#34203d}
.rhythm-demo-hand strong{font-size:14px}
.rhythm-demo-dots{display:flex;align-items:center;justify-content:center;gap:14px;height:38px;margin-top:10px}
.rhythm-demo-dots i{width:18px;height:18px;border:2px solid currentColor;border-radius:50%;opacity:.4;transition:opacity .08s,background .08s}
.rhythm-demo-dots i.is-on{background:currentColor;opacity:1;box-shadow:0 0 12px currentColor}
.rhythm-demo-button{min-height:46px}
.rhythm-demo-status{min-height:44px;margin:12px 0 19px;color:#c9b5df;font-size:14px;line-height:1.6;text-align:center}
.rhythm-rules{gap:14px}
.rhythm-start-note{display:flex;align-items:center;justify-content:space-between;gap:10px;margin:19px 0 13px;color:#cebbe6;font-size:14px;line-height:1.5}
.rhythm-key-help{margin-top:13px;color:#c5afd8;font-size:14px;line-height:1.6;text-align:center}

.rhythm-shell.rhythm-play{position:relative;display:grid;grid-template-columns:minmax(0,1fr) auto;grid-template-rows:40px 32px minmax(0,1fr) 44px;grid-template-areas:"header header" "hud hud" "paper paper" "beat beat";gap:6px 8px;width:min(100%,800px);height:100dvh;min-height:0;margin:0 auto;padding:max(8px,env(safe-area-inset-top)) 8px max(8px,env(safe-area-inset-bottom));border:0;border-radius:0;background:transparent}
.rhythm-play .game-header{grid-area:header;height:40px;min-height:40px;margin:0;gap:8px}
.rhythm-play .game-header .brand{display:none}
.rhythm-play .game-header>.tiny-label{display:block;flex:1;min-width:0;color:#e2c9ff;font-family:inherit;font-size:14px;font-weight:850;text-align:left;letter-spacing:0}
.rhythm-play .game-header .end-button{flex:0 0 auto;min-height:40px;padding:8px 11px;font-size:14px;line-height:1.3}
.rhythm-hud{grid-area:hud;display:grid;grid-template-columns:1.2fr 1fr .8fr;align-items:center;gap:8px;height:32px;padding:0 5px;border-bottom:1px solid #66487a}
.rhythm-hud>div{display:flex;align-items:center;gap:5px;min-width:0;white-space:nowrap}
.rhythm-hud>div:nth-child(2){justify-content:center}
.rhythm-hud>div:last-child{justify-content:flex-end}
.rhythm-hud span{color:#cbb5df;font-size:14px;line-height:1.2}
.rhythm-hud strong{color:#efe1ff;font-size:18px;font-weight:900;line-height:1;letter-spacing:-.4px;font-variant-numeric:tabular-nums}
.rhythm-hud small{margin-left:3px;color:#d3bce9;font-size:14px;letter-spacing:0}
.rhythm-paper-wrap{grid-area:paper;position:relative;min-width:0;min-height:0;width:100%;height:100%;margin:0}
.rhythm-paper{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:10px;width:100%;height:100%;min-height:0}
.rhythm-hand{display:grid;grid-template-rows:minmax(0,1fr);min-width:0;min-height:0;color:var(--left)}
.rhythm-hand.right{color:var(--right)}
.rhythm-hand-heading{display:flex;align-items:center;justify-content:space-between;gap:5px;min-width:0;line-height:1.2;font-variant-numeric:tabular-nums}
.rhythm-hand-heading strong{font-size:14px;font-weight:800;white-space:nowrap;letter-spacing:-.5px}
.rhythm-hand-heading>span{color:#ddc9ee;font-size:14px;white-space:nowrap}
.rhythm-pads{display:grid;grid-template-rows:repeat(4,minmax(0,1fr));gap:6px;min-height:0}
.rhythm-pad{position:relative;display:flex;align-items:center;justify-content:space-between;gap:8px;width:100%;height:100%;min-height:48px;overflow:hidden;padding:8px 11px;border:1px solid #576078;border-radius:13px;color:#b5c2d4;background:linear-gradient(#23283f,#1a1c33);box-shadow:0 3px 0 #080a20,inset 0 1px 0 #d8eeff0a;touch-action:none;user-select:none;-webkit-user-select:none}
.right .rhythm-pad{border-color:#65516d;color:#cbb1ce;background:linear-gradient(#32253d,#271c32)}
.rhythm-pad-number{font-size:clamp(32px,4dvh,42px);font-weight:900;line-height:1}
.rhythm-pad.is-target{border-color:#7feaff;color:var(--left);background:linear-gradient(#23475e,#1b334d);box-shadow:0 3px 0 #071426,0 0 12px #51d9ef18,inset 0 1px 0 #a4f1ff22}
.right .rhythm-pad.is-target{border-color:#ffaad0;color:var(--right);background:linear-gradient(#59344e,#3c2541);box-shadow:0 3px 0 #1c0d28,0 0 12px #ff87bd18,inset 0 1px 0 #ffd2e722}
.rhythm-pad.is-held{transform:translateY(2px);box-shadow:0 1px 0 #090819,inset 0 2px 7px #05031566}
.rhythm-touch-mark{position:absolute;z-index:3;width:40px;height:40px;border:2px solid #a5f1ff;border-radius:50%;background:#51d9ef26;box-shadow:0 0 13px #51d9ef58;transform:translate(-50%,-50%);pointer-events:none;animation:rhythm-touch-fade .65s linear forwards}
.rhythm-touch-mark:after{content:"";position:absolute;left:50%;top:50%;width:7px;height:7px;border-radius:50%;background:#c2f6ff;transform:translate(-50%,-50%)}
.right .rhythm-touch-mark{border-color:#ffc4e1;background:#ff87bd24;box-shadow:0 0 13px #ff87bd58}
.right .rhythm-touch-mark:after{background:#ffd4e8}
.rhythm-touch-mark[data-input="keyboard"]{border-radius:9px}
@keyframes rhythm-touch-fade{0%{opacity:.95;transform:translate(-50%,-50%) scale(.8)}100%{opacity:0;transform:translate(-50%,-50%) scale(1.35)}}
@keyframes rhythm-touch-fade-static{0%{opacity:.95}100%{opacity:0}}
.rhythm-pad-number{position:relative;z-index:1}
.rhythm-pad.is-demo-cue{border-color:#b5f5ff;box-shadow:inset 0 0 28px #51d9ef50,0 0 12px #51d9ef45}
.right .rhythm-pad.is-demo-cue{border-color:#ffd0e5;box-shadow:inset 0 0 28px #ff87bd50,0 0 12px #ff87bd45}
#rhythm-turn{font-size:14px;line-height:1.2;color:#e1c9f5;font-weight:850;white-space:nowrap}
.rhythm-play[data-phase="perform"] #rhythm-turn{color:#c2f6ff}
.rhythm-beat{grid-area:beat;display:flex;align-items:center;justify-content:center;gap:8px;min-width:0;min-height:44px;margin:0;color:#d5bee9;font-size:14px;line-height:1.3}
.rhythm-beat-light{width:14px;height:14px;flex:0 0 14px;border:2px solid #bb97df;border-radius:50%;background:#342043}
.rhythm-beat-light.is-pulse{background:#d5b9fa;box-shadow:0 0 9px #b78af06b}
.rhythm-feedback{position:absolute;left:50%;top:calc(max(8px,env(safe-area-inset-top)) + 122px);z-index:5;max-width:calc(100% - 32px);min-height:0;margin:0;padding:6px 11px;border-radius:10px;color:#f4c9e0;background:#28152ee8;font-size:14px;line-height:1.35;text-align:center;pointer-events:none;opacity:0;transform:translateX(-50%)}
.rhythm-feedback[data-tone="hint"]{opacity:1}
.rhythm-play .rhythm-key-help{display:none}
.rhythm-share-panel .share-dialog{display:flex;flex-direction:column;gap:16px}
.rhythm-share-panel .share-dialog>*{flex-shrink:0;margin:0}
.rhythm-share-panel .share-header{gap:12px}
.rhythm-share-media{width:100%;min-width:0}
.rhythm-share-panel .rhythm-share-status{font-size:14px;line-height:1.7}
@media(max-width:350px){
  .rhythm-hand-heading strong{font-size:14px;letter-spacing:-.65px}
  .rhythm-pad{padding-right:9px;padding-left:10px}
  .rhythm-start-note{align-items:flex-start;flex-direction:column;gap:5px}
}

@media(prefers-reduced-motion:reduce){.rhythm-demo-dots i,.rhythm-pad{transition:none!important}.rhythm-demo-dots i.is-on,.rhythm-subticks i.is-current,.rhythm-beat-light.is-pulse,.rhythm-pad.is-cue{box-shadow:none}.rhythm-touch-mark{animation-name:rhythm-touch-fade-static}}
.rhythm-play[data-phase="prepare"] .rhythm-paper{opacity:.4}
.rhythm-pad.is-demo-cue:after{content:"";position:absolute;left:50%;top:50%;width:42px;height:42px;border:3px solid currentColor;border-radius:50%;background:currentColor;opacity:.65;transform:translate(-50%,-50%);box-shadow:0 0 20px currentColor;pointer-events:none}

.rhythm-touch-mark:after{content:none}
.rhythm-hit-symbol{position:absolute;inset:0;display:grid;place-items:center;color:#f6f5ff;font-size:24px;font-style:normal;font-weight:900;line-height:1}
.rhythm-touch-mark[data-hit="false"]{border-color:#ffa5c8;background:#e6578e30;box-shadow:0 0 16px #eb638751}
.rhythm-hit-timing{position:absolute;left:4px;right:4px;top:17px;height:5px;border-radius:3px;background:#ffd0e855}
.rhythm-hit-timing:after{content:"";position:absolute;left:50%;top:-5px;height:15px;width:2px;background:#fff}
.rhythm-hit-timing b{position:absolute;top:-3px;width:10px;height:10px;border-radius:50%;background:#ffb6d3;transform:translateX(-50%)}
.rhythm-share-panel{padding:8px}
.rhythm-share-panel .share-dialog{width:400px;max-height:calc(100dvh - 16px);padding:12px;border-color:#4a3b61;border-radius:18px;background:#171321;box-shadow:none;gap:12px}
.rhythm-share-panel .rhythm-share-media{border:0;overflow:hidden;border-radius:12px;background:#11101c}
.rhythm-share-panel .share-preview{border:0;border-radius:0}
.rhythm-share-actions{display:flex;gap:8px}
.rhythm-share-actions>button{flex:1;min-height:44px;margin:0!important}


.rhythm-shell.rhythm-play{grid-template-rows:40px 32px 24px minmax(0,1fr) 48px;grid-template-areas:"header header" "hud hud" "beat beat" "paper paper" "actions actions"}
.rhythm-play .rhythm-beat{min-height:24px}
.rhythm-play-actions{grid-area:actions;display:flex;margin:0}
.rhythm-play-actions>.end-button{width:100%;min-height:48px;padding:12px 16px;font-size:14px;line-height:1.4}
.rhythm-pair-picker{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:8px;margin:0 0 20px}
.rhythm-pair-picker button{display:flex;align-items:center;justify-content:center;gap:7px;min-height:64px;padding:8px;border:1px solid #5b4b70;border-radius:13px;background:#211b31}
.rhythm-pair-picker button[aria-pressed="true"]{border:2px solid #c18bf5;background:#49305f;box-shadow:inset 0 0 0 2px #c18bf533}
.rhythm-pair-picker strong{color:var(--left);font-size:25px;line-height:1}
.rhythm-pair-picker strong:last-child{color:var(--right)}
.rhythm-pair-picker span{color:#b4a2c7;font-size:14px}
.intro-preview-flow{display:flex;align-items:center;justify-content:center;gap:12px;margin:0 0 14px;font-size:14px;font-weight:800;color:#a89ab9}
.intro-preview-flow>[data-preview-phase]{padding:8px 18px;border:1px solid transparent;border-radius:10px}
.intro-preview-flow>.is-active{color:#f5eaff;border-color:#bb8be5;background:#573471}
.rhythm-intro-guide[data-phase="perform"] [data-preview-phase="perform"].is-active{color:#d5f8ff;border-color:#6bcbdc;background:#203b50}
.rhythm-intro-guide .intro-guide-pad{min-height:86px;touch-action:auto;pointer-events:none}
.intro-preview-touch{position:absolute;left:50%;top:50%;display:grid;place-items:center;width:40px;height:40px;border:2px solid currentColor;border-radius:50%;background:#0d112bd9;opacity:0;transform:translate(-50%,-50%) scale(.8);transition:opacity .05s,transform .09s}
.intro-guide-pad.is-preview-hit .intro-preview-touch{opacity:1;transform:translate(-50%,-50%) scale(1)}
.intro-guide-pad.is-preview-hit{border-color:currentColor;box-shadow:inset 0 0 24px #51d9ef30}
.intro-guide-pad.right.is-preview-hit{box-shadow:inset 0 0 24px #ff87bd30}
@media(max-height:640px){.rhythm-intro-guide .intro-guide-pad{min-height:68px}.intro-preview-flow{margin-bottom:10px}.rhythm-intro:not(.rhythm-practice-picker) .game-heading{font-size:36px;margin:12px 0 8px}}
@media(prefers-reduced-motion:reduce){.intro-preview-touch{transition:none;transform:translate(-50%,-50%)}.intro-guide-pad.is-preview-hit{box-shadow:none}}
@media(max-height:650px){.rhythm-pair-picker button{min-height:56px}}
