/* Touch controls remain visible independently of desktop HUD decoration. */
body{touch-action:auto}
.touch-help{display:none}
:root[data-interface="mobile"] .touch-help{display:block;font-size:15px;line-height:1.6;color:#dfffab}
:root[data-interface="mobile"] .tutorial-keys,:root[data-interface="mobile"] .tutorial-steps article:nth-child(2){display:none}
#game,#game canvas,#stick{touch-action:none}
#autoDrinkButton{position:fixed;right:20px;bottom:230px;z-index:9;min-height:44px;padding:10px 14px;background:#071108;color:#deffab;border:2px solid #9ac847;border-radius:10px;font-weight:750;touch-action:manipulation}
#autoDrinkButton[aria-pressed=true]{background:#c3ff47;color:#102008}
.death,.death *{touch-action:pan-y}
:root[data-interface="mobile"] .hud{top:8px;left:8px;right:8px;gap:5px}:root[data-interface="mobile"] .brand{display:none}:root[data-interface="mobile"] .right-hud{width:100%;justify-content:space-around}:root[data-interface="mobile"] .game-tools{top:70px;left:8px;right:8px;max-width:none;flex-wrap:nowrap;overflow-x:auto;touch-action:pan-x;scrollbar-width:none;gap:4px}:root[data-interface="mobile"] .game-tools button{flex:0 0 auto;min-height:44px!important;font-size:12px!important}:root[data-interface="mobile"] .boosts,:root[data-interface="mobile"] .controls,:root[data-interface="mobile"] .auto-click-status,:root[data-interface="mobile"] .crosshair{display:none!important}:root[data-interface="mobile"] #stick{display:block!important;position:fixed;left:max(18px,env(safe-area-inset-left));bottom:calc(28px + env(safe-area-inset-bottom));width:120px;height:120px;z-index:10;border:3px solid #c3ff47;border-radius:50%;background:#071108b8;box-shadow:0 0 0 6px #07110855;user-select:none;-webkit-user-select:none}:root[data-interface="mobile"] #stick:after{content:'移動';position:absolute;left:0;right:0;bottom:7px;text-align:center;font-size:12px;color:#e2ffba;pointer-events:none}:root[data-interface="mobile"] #stickKnob{display:block;position:absolute;left:calc(50% - 23px);top:calc(50% - 23px);width:46px;height:46px;border-radius:50%;background:#c3ff47;border:3px solid #efffd3;box-shadow:0 2px 8px #0008;pointer-events:none}:root[data-interface="mobile"] #drinkButton{display:block!important;right:max(14px,env(safe-area-inset-right))!important;bottom:calc(22px + env(safe-area-inset-bottom))!important;width:104px!important;height:76px!important;z-index:10}:root[data-interface="mobile"] #drinkButton small{display:none}:root[data-interface="mobile"] #jumpButton{display:block!important;right:14px!important;bottom:calc(108px + env(safe-area-inset-bottom))!important;width:76px;height:50px;z-index:10}:root[data-interface="mobile"] #autoDrinkButton{right:14px;bottom:calc(170px + env(safe-area-inset-bottom));width:104px;min-height:46px;font-size:14px}:root[data-interface="mobile"] #rhythm.rhythm{bottom:calc(248px + env(safe-area-inset-bottom));width:calc(100vw - 36px);height:48px}:root[data-interface="mobile"] #rhythm.rhythm>small{display:none}:root[data-interface="mobile"] #rhythm.rhythm .timing-delta{top:53px}:root[data-interface="mobile"] .song-now{bottom:calc(310px + env(safe-area-inset-bottom));width:calc(100vw - 40px);padding-left:26px}:root[data-interface="mobile"] .song-now b{font-size:12px}:root[data-interface="mobile"] .song-now span{font-size:11px}:root[data-interface="mobile"] .combo-display{top:125px;right:10px;bottom:auto;min-width:55px}:root[data-interface="mobile"] #festivalHud{top:125px;left:8px;right:auto;bottom:auto;width:105px;padding:5px}:root[data-interface="mobile"] #festivalHud #festivalMap{width:93px;height:72px}:root[data-interface="mobile"] #festivalHud small,:root[data-interface="mobile"] #festivalHud span{display:none}:root[data-interface="mobile"] .notice{top:42%;max-width:85vw;min-width:0;pointer-events:none}


/* Layout follows mobile viewport/primary input, not an optional touchscreen on a PC. */
:root[data-interface="mobile"] #death{display:block;padding:54px 12px 20px;overflow-y:auto;overscroll-behavior:contain;height:100%;height:100dvh}:root[data-interface="mobile"] #death .death-layout{display:flex;flex-direction:column;width:100%;min-height:0;padding:0;gap:20px}:root[data-interface="mobile"] #death .death-main{width:100%;padding:0;flex:none}:root[data-interface="mobile"] #death .death-word{font-size:56px;line-height:1;margin:0 0 8px}:root[data-interface="mobile"] #death .death-main>p{margin:0 0 8px;font-size:14px}:root[data-interface="mobile"] #death .final-score{margin:0 auto 12px}:root[data-interface="mobile"] #death .final-score strong{font-size:36px}:root[data-interface="mobile"] #death .final-score em{font-size:16px}:root[data-interface="mobile"] #death .death-actions{display:flex;flex-direction:row;width:100%;gap:8px}:root[data-interface="mobile"] #death .death-actions button{flex:1;min-width:0;min-height:52px;padding:8px;font-size:16px}:root[data-interface="mobile"] #death .death-actions button span{display:none}:root[data-interface="mobile"] #death .leaderboard{position:static;inset:auto;transform:none;width:100%;max-width:none;max-height:none;margin:0;padding:12px;opacity:1;overflow:visible;flex:none}:root[data-interface="mobile"] #death .leaderboard h2{font-size:20px}:root[data-interface="mobile"] #death .leaderboard ol{max-height:40dvh;overflow-y:auto;touch-action:pan-y}:root[data-interface="mobile"] #death .leaderboard li{grid-template-columns:24px minmax(0,1fr) auto}:root[data-interface="mobile"] #death .leaderboard li b{min-width:0}:root[data-interface="mobile"] #death .screen-settings{position:absolute;top:8px;right:8px}


:root[data-interface="desktop"] #death .leaderboard{position:fixed;right:20px;left:auto;top:50%;bottom:auto;transform:translateY(-50%);width:340px;max-height:84vh;overflow:auto}


@media(max-height:540px) and (orientation:landscape){:root[data-interface="mobile"] #stick{width:96px;height:96px;bottom:18px}:root[data-interface="mobile"] .hud{right:50%;}:root[data-interface="mobile"] .game-tools{left:51%;top:8px;right:8px}:root[data-interface="mobile"] #rhythm.rhythm{width:40vw;bottom:66px}:root[data-interface="mobile"] .song-now{width:40vw;bottom:130px}:root[data-interface="mobile"] #autoDrinkButton{bottom:170px}:root[data-interface="mobile"] #festivalHud{display:none}:root[data-interface="mobile"] .combo-display{top:70px}
}


/* Desktop HUD and results have their own layout, independent of touch styling. */
:root[data-interface="desktop"] #stick,:root[data-interface="desktop"] #drinkButton,:root[data-interface="desktop"] #jumpButton{display:none!important}
:root[data-interface="desktop"] .hud{top:18px;left:20px;right:20px;gap:16px}
:root[data-interface="desktop"] .brand{display:flex}
:root[data-interface="desktop"] .game-tools{top:100px;left:auto;right:20px;max-width:calc(100vw - 40px);flex-wrap:wrap}
:root[data-interface="desktop"] #autoDrinkButton{bottom:28px;right:20px}
:root[data-interface="desktop"] #rhythm{width:min(48vw,580px);bottom:90px;transform:translateX(-50%)}
:root[data-interface="desktop"] .song-now{bottom:165px;width:min(48vw,580px)}
:root[data-interface="desktop"] #festivalHud{top:auto;left:auto;right:20px;bottom:95px;width:180px}
:root[data-interface="desktop"] #festivalMap{width:158px;height:123px}
:root[data-interface="desktop"] #death{padding:24px;display:grid;align-items:center}
:root[data-interface="desktop"] #death .death-layout{display:grid;width:100%;max-width:1180px;min-height:0;grid-template-columns:minmax(0,1fr) minmax(280px,340px);gap:24px}
:root[data-interface="desktop"] #death .death-main{min-width:0}
:root[data-interface="desktop"] #death .leaderboard{position:static;transform:none;inset:auto;width:100%;max-height:84dvh}
:root[data-interface="desktop"] #death .death-actions{display:flex;flex-direction:row;flex-wrap:wrap;justify-content:center}
.leaderboard li .rank{color:#b7cb97;font-size:14px}
.leaderboard li b{min-width:0}
:root[data-interface="mobile"] .game-tools{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));overflow:visible;gap:3px;top:65px}
:root[data-interface="mobile"] .game-tools button{width:100%;padding:2px;min-height:42px!important}
:root[data-interface="mobile"] #festivalHud,:root[data-interface="mobile"] .combo-display{top:158px}
:root[data-interface="mobile"] #rhythm{bottom:calc(216px + env(safe-area-inset-bottom))}
:root[data-interface="mobile"] .song-now{bottom:calc(280px + env(safe-area-inset-bottom))}
:root[data-interface="mobile"] .player-shell,:root[data-interface="mobile"] .settings-card,:root[data-interface="mobile"] .team-shell,:root[data-interface="mobile"] .intro-card,:root[data-interface="mobile"] .update-card{max-height:calc(100dvh - 24px);overflow-y:auto;overscroll-behavior:contain;touch-action:pan-y}
:root[data-interface="mobile"] .player-shell kbd,:root[data-interface="mobile"] .pause-screen>span{display:none}
:root[data-interface="mobile"] .player-shell footer{position:sticky;bottom:0;background:#071108;z-index:3}
@media(max-height:540px) and (orientation:landscape){
:root[data-interface="mobile"] .hud{right:53%}
:root[data-interface="mobile"] .game-tools{left:49%;right:8px;top:8px}
:root[data-interface="mobile"] #festivalHud{display:none}
:root[data-interface="mobile"] .combo-display{top:105px}
:root[data-interface="mobile"] #rhythm{width:42vw;bottom:70px}
:root[data-interface="mobile"] .song-now{width:42vw;bottom:142px}
:root[data-interface="mobile"] #autoDrinkButton{bottom:168px}
}

/* Notifications size to their text; never stretch between top and bottom. */
:root[data-interface] #notice{top:auto;bottom:calc(var(--lane-bottom) + 130px);width:max-content;height:auto;min-height:0;max-width:min(85vw,420px);padding:5px 10px;pointer-events:none}
:root[data-interface="mobile"] #notice{bottom:calc(314px + env(safe-area-inset-bottom))}
@media(max-height:540px) and (orientation:landscape){:root[data-interface="mobile"] #notice{bottom:172px}}
