.pulse-mode-select{display:none}.pulse-game[data-state="idle"] #pulse-start{visibility:hidden;pointer-events:none}.pulse-game[data-state="idle"] .pulse-mode-select{display:flex;position:absolute;z-index:5;left:50%;top:var(--title-horizon,60%);transform:translate(-50%,-50%);gap:12px;width:min(88%,440px)}
.pulse-mode-select button{flex:1;min-height:74px;border:1px solid #8ce8f899;border-radius:12px;background:#061923e8;color:#edfcff;font:500 16px 'Space Grotesk',sans-serif;letter-spacing:.07em;cursor:pointer;box-shadow:0 0 20px #38d9ec12}.pulse-mode-select button span{display:block;margin-top:8px;font-size:9px;letter-spacing:.14em;color:#9bb8c6}.pulse-mode-select button:hover{background:#153743;border-color:#d5fcff}
#pulse-endless{box-sizing:border-box;position:fixed;inset:0;margin:0;width:100%;max-width:none;height:100%;height:100dvh;max-height:none;padding:0;border:0;background:#040b12;color:#fff;font-family:'Space Grotesk','Noto Sans JP',sans-serif;overscroll-behavior:contain}#pulse-endless::backdrop{background:#040b12}
.endless-shell{box-sizing:border-box;width:min(100%,760px);height:100%;margin:auto;display:flex;flex-direction:column;align-items:center;padding:max(16px,env(safe-area-inset-top)) 20px max(18px,env(safe-area-inset-bottom));overflow:auto}.endless-header{display:flex;align-items:center;justify-content:space-between;width:100%;flex-shrink:0}.endless-header>span{color:#91edff;font-size:11px;letter-spacing:.2em}.endless-header .pulse-close{flex:0 0 44px;width:44px;height:44px;display:grid;place-items:center;padding:0}
#endless-title{margin:10px 0 18px;width:min(85%,360px);flex-shrink:0}#endless-title img{display:block;width:100%;height:auto}.endless-stats{display:flex;width:min(100%,420px);justify-content:space-around;gap:20px;text-align:center;flex-shrink:0}.endless-stats span{display:block;font-size:10px;letter-spacing:.14em;color:#8aa8b9}.endless-stats strong{font-size:clamp(20px,3.5vh,30px);font-weight:500;font-variant-numeric:tabular-nums;overflow-wrap:anywhere}
.endless-stage{width:min(100%,480px);position:relative;flex:1;min-height:0;display:flex;flex-direction:column;align-items:center;justify-content:center}.endless-arena{position:relative;display:block;box-sizing:border-box;flex-shrink:0;width:min(100%,49dvh);aspect-ratio:1;border:0;padding:0;background:none;color:white;touch-action:manipulation;-webkit-tap-highlight-color:transparent;cursor:pointer}.endless-arena:disabled{opacity:1;cursor:default}.endless-arena:focus{outline:none}.endless-arena svg{display:block;width:100%;height:100%;overflow:visible;fill:none}.endless-beacon-glow{stroke:#6de8ff;stroke-width:6;opacity:.15}.endless-beacon{stroke:#9cefff;stroke-width:2;filter:drop-shadow(0 0 3px #4bd9ef)}.endless-pulse{stroke:#e7fcff;stroke-width:2;transform-origin:200px 200px;will-change:transform;vector-effect:non-scaling-stroke}.endless-center{position:absolute;inset:0;display:flex;flex-direction:column;align-items:center;justify-content:center;pointer-events:none;font:500 clamp(25px,5dvh,44px)/1.05 'Space Grotesk',sans-serif}.endless-center b{font:inherit}.endless-center>span{font-size:.6em;margin:2px}.endless-feedback{height:32px;line-height:32px;font-size:23px;letter-spacing:.08em;flex-shrink:0}.endless-timing{height:24px;font-size:11px;line-height:24px;color:#b1cad5;flex-shrink:0}.endless-wave{opacity:0;stroke:#bdfaff;stroke-width:2;transform-origin:200px 200px}.endless-shell[data-hit="perfect"] .endless-wave{animation:endless-hit .4s ease-out}.endless-shell[data-hit="perfect"] .endless-feedback{color:#b9faff;text-shadow:0 0 12px #53e5ff}.endless-shell[data-hit="miss"] .endless-pulse{visibility:hidden}.endless-shell[data-state="countdown"] .endless-pulse{visibility:hidden}.endless-shell[data-state="countdown"] .endless-center{font-size:clamp(60px,12dvh,100px)}
@keyframes endless-hit{from{opacity:.85;transform:scale(1)}to{opacity:0;transform:scale(calc(1.6 * var(--endless-impact,1)))}}
.endless-actions{display:flex;flex-direction:column;align-items:center;gap:12px;flex-shrink:0;padding-top:16px;width:100%;margin-top:auto}.endless-actions button{width:min(100%,300px);min-height:44px;border:1px solid #689da9;border-radius:30px;background:#0b202b;color:#effcff;font:500 12px 'Space Grotesk',sans-serif;letter-spacing:.12em;cursor:pointer}.endless-actions button:hover{background:#153743}.endless-return{display:none}.endless-shell[data-state="finished"] .endless-return{display:block}.endless-result[hidden]{display:none}.endless-result{text-align:center;margin:auto 0;line-height:1.8;width:100%}.endless-result>p:first-child{color:#8ce9fb;font-size:12px;letter-spacing:.16em}.endless-result h3{font-size:clamp(24px,5vw,40px);margin:16px 0 8px;overflow-wrap:anywhere}.endless-breakdown{font-size:14px}.endless-counts{margin-top:18px}.endless-ending{color:#9fb8c6;font-size:12px}.endless-shell[data-state="finished"] :is(.endless-stage,.endless-stats){display:none}
@media(max-height:650px){.endless-shell{padding-top:8px;padding-bottom:8px}#endless-title{margin:4px 0 8px;width:240px}.endless-arena{width:min(100%,43dvh)}.endless-actions{padding-top:8px}.endless-result{line-height:1.4}.endless-result h3{margin:6px 0}.endless-counts{margin-top:8px}}
@media(prefers-reduced-motion:reduce){.endless-shell[data-hit="perfect"] .endless-wave{animation:none}}

.pulse-mode-select button{padding:14px 6px}

.pulse-game[data-state="idle"] .pulse-mode-select{flex-direction:column;width:min(78%,300px);gap:12px}.pulse-mode-select button{flex:none;width:100%;min-height:68px}
.endless-center .endless-pulse-label{font-size:12px;letter-spacing:.13em;color:#9defff;margin-bottom:6px}.endless-center .endless-pulse-number{color:#9defff}.endless-stats{gap:12px}.endless-stats>div{min-width:0}.endless-shell[data-hit="great"] .endless-feedback{color:#e5faff}

/* Decorative layers never move the beacon or receive taps. */
#pulse-endless{overflow-x:clip}.endless-burst{pointer-events:none;fill:none;stroke-linecap:round}.endless-burst circle,.endless-burst path{opacity:0}.endless-burst circle{transform-origin:200px 200px}.endless-burst path{transform-origin:0 0}.endless-shell[data-hit="perfect"] .endless-wave{animation:none;opacity:0}
.endless-burst circle{filter:drop-shadow(0 0 3px #a4f4ff88)}

.endless-penalty{margin:10px 0 0;color:#a6bdcc;font:10px/1.5 'Space Grotesk',sans-serif;letter-spacing:.1em;flex-shrink:0}.endless-penalty strong{color:#e1f7ff;font-weight:500;font-variant-numeric:tabular-nums;margin-left:6px}.endless-shell[data-state="finished"] .endless-penalty{display:none}.endless-cleared{color:#fff;font-size:22px;margin-top:16px;font-variant-numeric:tabular-nums}
.endless-actions .endless-return{width:auto;min-height:0;border:0;border-bottom:1px solid #577681;border-radius:0;padding:6px 2px;background:none;color:#9dc5d1;font:11px/1.4 'Space Grotesk',sans-serif;letter-spacing:.08em;margin:20px 0 0}.endless-actions .endless-return:hover{background:none;color:#efffff}

.pulse-game[data-state="idle"] .pulse-mode-select{width:min(82%,300px);gap:14px;top:calc(var(--title-horizon,60%) + 34px)}
.pulse-mode-select .mode-start{min-height:54px;font-size:18px}.mode-slider{display:flex;align-items:center;justify-content:space-between;touch-action:pan-y;user-select:none;width:100%;color:#e6fbff;padding:6px 0;border-bottom:1px solid #82dcea44}.pulse-mode-select .mode-slider button{width:42px;min-height:42px;padding:0;flex:none;background:none;box-shadow:none;border:0;font-size:28px;color:#9defff}.mode-name{font:500 14px 'Space Grotesk',sans-serif;letter-spacing:.14em}.mode-dots{text-align:center;font-size:9px;letter-spacing:8px;color:#9defff}
.endless-header{gap:8px}.endless-header .endless-sound{flex:0 0 44px;width:44px;height:44px;margin-right:auto}.endless-header .pulse-help-button{font:500 12px 'Space Grotesk',sans-serif;letter-spacing:.06em;height:44px;white-space:nowrap;padding:0 12px}
.endless-penalty{font-size:13px}.endless-penalty strong{font-size:17px}.endless-share{display:none}.endless-shell[data-state="finished"] .endless-share{display:block}
.endless-actions .endless-restart{width:auto;min-height:48px;padding:12px 36px;border:1px solid #a2f7ff;border-radius:30px;background:#09232b;color:#f0ffff;box-shadow:inset 0 0 12px #1ddcff18,0 0 5px #80efff70,0 0 22px #1ddcff25;font:500 12px 'Space Grotesk',sans-serif;letter-spacing:.12em}.endless-actions .endless-restart:hover{background:#103743}
.endless-actions :is(.endless-share,.endless-return){width:auto;min-height:0;border:0;border-bottom:1px solid #577681;border-radius:0;padding:6px 2px;background:none;color:#9dc5d1;font:500 12px/1.4 'Space Grotesk',sans-serif;letter-spacing:.12em;margin:7px 0 0}.endless-actions .endless-return{margin-top:20px}.endless-actions .endless-share:hover{background:none;color:#efffff}
.endless-shell[data-state="panel"] .endless-stage{visibility:hidden}.endless-shell[data-state="panel"] .endless-share{display:none}
.pulse-score-tabs{display:flex;gap:8px;margin:4px 0 16px}.pulse-score-tabs button{flex:1;min-height:44px;border:1px solid #4b6975;border-radius:8px;background:transparent;color:#b3c9d3;font:500 12px 'Space Grotesk',sans-serif}.pulse-score-tabs button[aria-selected="true"]{color:#fff;border-color:#9defff;background:#153642}.pulse-scores .pulse-help-top{gap:10px}.pulse-scores .pulse-help-top h2{margin-right:auto}.pulse-scores #pulse-ranks-reset{font-size:10px;white-space:nowrap}.pulse-scores .daily-reset{border:0;margin:0;padding:0}.mode-guide-heading{color:#9defff!important;border-bottom:1px solid #68909b55;padding-bottom:10px;margin-top:24px!important}
@media(max-width:600px){.endless-shell{padding-left:14px;padding-right:14px}.endless-header{gap:6px}.endless-header .pulse-help-button{font-size:11px;padding:0 8px;letter-spacing:0}.endless-actions .endless-restart{min-height:44px;padding:10px 30px}.pulse-scores .pulse-help-top{gap:6px;padding-inline:12px}.pulse-scores .pulse-help-top h2{font-size:16px}.pulse-scores #pulse-ranks-reset{font-size:9px;padding-inline:5px}.endless-actions{gap:6px}.endless-actions .endless-return{margin-top:12px}}
/* Shared title control: retain the original circular beacon as the START target. */
.pulse-game[data-state="idle"] .pulse-mode-select{inset:0;width:auto;transform:none;display:block;pointer-events:none}
.pulse-mode-select .mode-start{position:absolute;left:50%;top:var(--title-horizon);transform:translate(-50%,-50%);width:calc(var(--title-beacon-size)*.5);height:calc(var(--title-beacon-size)*.5);min-height:0;padding:0 0 0 .18em;border:0;border-radius:50%;background:radial-gradient(circle,#06192370,transparent 70%);box-shadow:none;color:#efffff;font:500 clamp(13px,1.8dvh,16px)/1 'Space Grotesk',sans-serif;letter-spacing:.18em;text-shadow:0 0 6px #6cf2ff,0 0 18px #19d9ff;pointer-events:auto}
.pulse-mode-select .mode-start:hover{background:#06263250;border:0;text-shadow:0 0 8px #c6ffff,0 0 24px #21dfff}
.mode-switch{position:absolute;left:50%;top:calc(var(--title-horizon) + var(--title-beacon-size)*.463 + 20px);transform:translateX(-50%);display:flex;width:min(76vw,290px);padding:4px;border:1px solid #5e93a066;border-radius:30px;background:#06121dd9;pointer-events:auto;isolation:isolate}
.mode-switch::before{content:'';position:absolute;inset:4px auto 4px 4px;width:calc(50% - 4px);border:1px solid #96e8f099;border-radius:24px;background:#16343e;box-sizing:border-box;transition:transform .22s ease;z-index:-1}
.mode-switch[data-mode="endless"]::before{transform:translateX(100%)}
.pulse-mode-select .mode-switch button{flex:1;width:50%;min-height:40px;padding:0 6px;border:0;border-radius:24px;background:none;box-shadow:none;color:#7898a5;font:500 11px/1 'Space Grotesk',sans-serif;letter-spacing:.09em;transition:color .2s}
.pulse-mode-select .mode-switch button[aria-pressed="true"]{color:#ecfcff}.pulse-mode-select .mode-switch button:hover{background:none;color:#fff}
.endless-shell{padding-top:88px}.endless-header{position:absolute;top:24px;left:clamp(20px,5vw,72px);right:clamp(20px,5vw,72px);width:auto;gap:12px}
.endless-header .endless-sound{width:40px;height:40px;flex:0 0 40px}.endless-header .pulse-close{width:46px;height:46px;flex:0 0 46px}.endless-header .pulse-help-button{height:40px;padding:0 16px;font-size:12px;letter-spacing:.12em}
@media(max-width:600px){.endless-shell{padding-top:76px}.endless-header{top:16px;left:20px;right:20px;gap:6px}.endless-header .endless-sound,.endless-header .pulse-close{width:44px;height:44px;flex:0 0 44px}.endless-header .pulse-help-button{height:44px;font-size:11px;letter-spacing:0;padding:0 8px}}
@media(max-width:350px){.endless-header{gap:4px}.endless-header .pulse-help-button{padding:0 5px}}
@media(prefers-reduced-motion:reduce){.mode-switch::before{transition:none}}
/* Match STANDARD's lower control inset (outer padding plus content padding). */
.endless-shell{padding-bottom:28px}
@media(max-width:600px){.endless-shell{padding-bottom:calc(max(12px,env(safe-area-inset-bottom)) * 2)}}
/* Share mode headings use the same hierarchy for both modes. */
.pulse-share-header h2{font-size:20px;letter-spacing:.1em}
/* Both in-play restart controls share one viewport anchor. */
.pulse-game:is([data-state="playing"],[data-state="paused"],[data-state="countdown"]) #pulse-start,
.endless-shell:is([data-state="playing"],[data-state="feedback"],[data-state="paused"],[data-state="countdown"]) .endless-restart{position:fixed;left:50%;bottom:max(24px,env(safe-area-inset-bottom));transform:translateX(-50%);margin:0;z-index:6}
.endless-shell:is([data-state="playing"],[data-state="feedback"],[data-state="paused"],[data-state="countdown"]) .endless-actions{min-height:64px;box-sizing:border-box}
/* Finished controls follow STANDARD's content flow, not the viewport bottom. */
.endless-shell[data-state="finished"] .endless-result{margin:auto 0 0}
.endless-shell[data-state="finished"] .endless-actions{margin:0 0 auto;padding:0;gap:0;min-height:0}
.endless-shell[data-state="finished"] .endless-restart{position:static;transform:none;flex:none;margin:12px 0;min-height:48px;padding:12px 36px;border-radius:30px;font:500 12px/normal 'Space Grotesk',sans-serif;letter-spacing:.12em}
.endless-shell[data-state="finished"] :is(.endless-share,.endless-return){flex:none;width:auto;min-height:0;padding:6px 2px;margin:7px 0 0;font:500 12px/1.4 'Space Grotesk',sans-serif;letter-spacing:.12em;color:#9dc5d1;background:none;border:0;border-bottom:1px solid #577681;border-radius:0;box-shadow:none}
.endless-shell[data-state="finished"] .endless-return{margin-top:20px}
.endless-shell[data-state="finished"] .endless-restart:hover{background:#103743;box-shadow:inset 0 0 14px #1ddcff25,0 0 8px #80efff99,0 0 28px #1ddcff44}
.endless-shell[data-state="finished"] :is(.endless-share,.endless-return):hover{background:none}
.endless-shell[data-state="finished"] :is(.endless-share,.endless-return):focus:not(:focus-visible){outline:none;box-shadow:none}
@media(max-width:600px){.endless-shell[data-state="finished"] .endless-restart{min-height:44px;padding:10px 30px}.endless-shell[data-state="finished"] .endless-return{margin-top:12px}}
@media(max-height:650px){.endless-shell[data-state="finished"] .endless-restart{margin-block:6px}}
/* Add four lines above restart while keeping the action group in place. */
.endless-shell[data-state="finished"]{--endless-result-gap:80px}
.endless-shell[data-state="finished"] .endless-result{transform:translateY(calc(-1 * var(--endless-result-gap)))}
@media(max-height:650px){.endless-shell[data-state="finished"]{--endless-result-gap:48px}}
/* STANDARD typography and HUD treatment. */
.endless-stats{width:min(100%,400px);justify-content:space-between;gap:20px;text-align:left;padding:10px 10px;border-top:1px solid #70e8f526;border-bottom:1px solid #70e8f526;background:linear-gradient(110deg,#10223163,#0a182033);box-shadow:inset 0 1px #d9fcff0c,0 12px 28px #00000025}
.endless-stats span{font:500 10px/1.6 'Space Grotesk',sans-serif;letter-spacing:.16em;color:#8ab8c5}.endless-stats strong{font:500 clamp(22px,3dvh,28px)/1.25 'Space Grotesk',sans-serif;font-variant-numeric:tabular-nums;color:#fff;text-shadow:none}
.endless-result .endless-breakdown,.endless-result .endless-counts{font:500 15px/1.65 'Space Grotesk',sans-serif;letter-spacing:.04em;color:#fff}.endless-result>p:first-child{font-size:14px}
/* A fixed square and absolute feedback slots prevent intrinsic text sizes or disabled state from shifting the beacon. */
.endless-shell{--endless-arena-size:min(49dvh,480px,calc(100vw - 28px))}
.endless-stage{display:block;flex:1;min-height:0;width:min(100%,480px)}
.endless-arena,.endless-arena:disabled{position:absolute;left:50%;top:40%;transform:translate(-50%,-50%);width:var(--endless-arena-size);height:var(--endless-arena-size);min-width:0;max-width:none;aspect-ratio:1;line-height:1;transition:none;animation:none;appearance:none;-webkit-appearance:none}
.endless-arena svg{width:100%;height:100%;aspect-ratio:1;pointer-events:none}
.endless-feedback{position:absolute;left:0;right:0;top:calc(40% + var(--endless-arena-size)*.2 + 24px);height:44px;line-height:44px;text-align:center;font-size:28px;margin:0;white-space:nowrap}
.endless-timing{position:absolute;left:0;right:0;top:calc(40% + var(--endless-arena-size)*.2 + 68px);height:24px;line-height:24px;text-align:center;font-size:13px;margin:0;white-space:nowrap}
@media(max-width:600px){.endless-stats{gap:12px;padding-inline:6px}.endless-result .endless-breakdown,.endless-result .endless-counts{font-size:14px}.endless-stage{flex:1}.endless-feedback{font-size:26px}}
@media(max-height:650px){.endless-shell{--endless-arena-size:min(40dvh,360px,calc(100vw - 28px))}.endless-arena,.endless-arena:disabled{top:35%}.endless-feedback{top:calc(35% + var(--endless-arena-size)*.2 + 12px)}.endless-timing{top:calc(35% + var(--endless-arena-size)*.2 + 56px)}}
/* CLEAR RECORDS confirmation sits directly below the dialog toolbar. */
.pulse-scores>.daily-reset{margin:0;padding:0 24px;border:0}
.pulse-scores>.daily-reset:has(#pulse-ranks-confirm[hidden]):not(:has(#pulse-ranks-reset-status:not(:empty))){display:none}
.pulse-scores>.daily-reset .pulse-ranks-confirm{margin:12px 0 4px;font:13px/1.7 'Space Grotesk','Noto Sans JP',sans-serif;color:#d5e7ee}
.pulse-scores>.daily-reset .pulse-ranks-confirm p{margin:0 0 12px}
[data-dialog-focus-target="true"]:focus{outline:none!important;box-shadow:none!important}
.pulse-share-header h2{font-size:clamp(14px,3.8vw,18px);line-height:1.35;letter-spacing:.07em}
@media(max-width:600px){.pulse-scores>.daily-reset{padding-inline:12px}}
/* Match STANDARD's 48% countdown dimmer without moving the beacon. */
.endless-shell[data-state="countdown"]::after{content:'';position:fixed;inset:0;background:rgba(0,0,0,.48);z-index:20;pointer-events:none}
.endless-shell[data-state="countdown"] .endless-arena{z-index:21}
.endless-shell[data-state="countdown"] .endless-arena svg{opacity:.52}
.endless-shell[data-state="countdown"] .endless-center{color:#fff;text-shadow:0 0 12px #70e8f533}
.endless-shell[data-state="countdown"] .endless-header{z-index:22}

.endless-shell[data-hit="good"] .endless-feedback{font-size:24px;color:#a6bdcc;text-shadow:none}
/* Reuse STANDARD's LAST SCORE highlight and edge animation verbatim. */
.endless-shell[data-last-beaten="true"] #endless-last{animation:last-score-glow 1.2s ease-out both}
.endless-shell[data-last-beaten="true"] .pulse-last-cell::after{animation:last-score-edge 1.2s ease-out both}
.endless-shell:is([data-state="panel"],[data-state="paused"]) #endless-last,
.endless-shell:is([data-state="panel"],[data-state="paused"]) .pulse-last-cell::after{animation-play-state:paused}
@media(prefers-reduced-motion:reduce){.endless-shell[data-last-beaten="true"] #endless-last{animation:none;color:#79f2ff;text-shadow:none}.endless-shell[data-last-beaten="true"] .pulse-last-cell::after{animation:none}}

/* Share STANDARD's floor/edge artwork and intensity; results retain the quiet base. */
#pulse-endless{isolation:isolate;--music-low:0;--music-high:0;background:radial-gradient(ellipse at 50% 48%,#11212e,#070b14 72%)}
#pulse-endless[data-state="panel"]>.pulse-atmosphere,#pulse-endless[data-state="closed"]>.pulse-atmosphere{display:none}

#pulse-help .guide-game-heading{margin:0 0 24px;color:#9defff;font:500 22px/1.3 'Space Grotesk',sans-serif;letter-spacing:.07em}
#pulse-help .pulse-guide-tabs{margin:28px 0 22px}
#guide-standard-panel[hidden],#guide-endless-panel[hidden]{display:none!important}
#guide-standard-panel>p:first-child,#guide-endless-panel>p:first-child{margin-top:0}

/* Mode navigation: a shared tab rail instead of separate outlined buttons. */
.pulse-score-tabs{gap:0;border-bottom:1px solid #6b929b50}
.pulse-score-tabs button{position:relative;border:0;border-radius:0;background:transparent;min-height:48px;color:#8ba5b0;letter-spacing:.08em;cursor:pointer;box-shadow:none}
.pulse-score-tabs button[aria-selected="true"]{color:#dffaff;background:linear-gradient(0deg,#6de6f014,transparent 80%);border:0;box-shadow:none}
.pulse-score-tabs button::after{content:"";position:absolute;bottom:-1px;left:18%;right:18%;height:2px;background:transparent;transition:background .18s}
.pulse-score-tabs button[aria-selected="true"]::after{background:#8ce8f2}
.pulse-score-tabs button:hover{color:#efffff;background-color:#8ce8f208}
.pulse-score-tabs button:focus-visible{outline:1px solid #8ce8f2;outline-offset:-4px}
#pulse-help .guide-game-heading{margin-top:12px}
