/* Desktop keeps the existing tools. Phones tuck them into the unused margin. */
#arena .tool-buttons{display:contents}
#arena :is(#toolsToggle,#toolsDismiss)[hidden],#arena #toolButtons[hidden]{display:none!important}
#arena[data-compact-tools="false"] #toolsToggle{display:none}
#arena[data-compact-tools="true"] .toolbar{
 left:var(--tools-left,12px);top:var(--tools-top,12px);right:auto;bottom:auto;
 width:88px;height:44px;display:block;z-index:20;gap:0;
}
#arena[data-compact-tools="true"] #toolsToggle{
 position:relative;width:88px;height:44px;padding:8px;font-size:14px;white-space:nowrap;
 background:#142332;border-color:#5c7184;color:#e6edf5;
}
#arena[data-compact-tools="true"] #toolsDismiss{
 position:fixed;inset:0;width:100vw;height:100dvh;max-width:none;max-height:none;
 padding:0;margin:0;border:0;border-radius:0;background:transparent;transform:none;z-index:-1;
}
#arena[data-compact-tools="true"] .tool-buttons{
 position:absolute;right:0;top:52px;width:min(264px,calc(100vw - 24px));
 max-height:min(var(--tools-height,220px),calc(100dvh - 88px - env(safe-area-inset-top) - env(safe-area-inset-bottom)));overflow-y:auto;overscroll-behavior:contain;touch-action:pan-y;
 display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:6px;padding:8px;
 border:1px solid #687c8f;background:#0b1522f5;border-radius:5px;box-shadow:0 8px 24px #0006;
}
#arena[data-compact-tools="true"] .toolbar[data-direction="up"] .tool-buttons{top:auto;bottom:52px}
#arena[data-compact-tools="true"] .toolbar[data-anchor="center"]{top:auto;bottom:max(14px,env(safe-area-inset-bottom))}
#arena[data-compact-tools="true"] .toolbar[data-anchor="center"] .tool-buttons{right:50%;transform:translateX(50%)}
#arena[data-compact-tools="true"] .toolbar .tool-buttons button{min-height:44px;min-width:0;padding:8px 6px;font-size:14px;line-height:1.35;white-space:normal;touch-action:pan-y}
#arena[data-compact-tools="true"] #pauseBtn{font-size:14px}
#arena[data-compact-tools="true"] #pauseBtn::after{content:' 一時停止'}
#arena[data-compact-tools="true"] #hud{gap:8px}
#arena[data-compact-tools="true"] .event-title{padding:5px 7px;max-width:none;flex:1}
#arena[data-compact-tools="true"] .event-title h1{font-size:16px;line-height:1.3;margin:4px 0;overflow-wrap:anywhere}
#arena[data-compact-tools="true"] .event-title>span{font-size:12px;line-height:1.35;letter-spacing:0}
#arena[data-compact-tools="true"] .event-title p{font-size:12px;line-height:1.4;margin:3px 0 0}
#arena[data-compact-tools="true"] .event-title b{font-size:12px;margin-left:0}
#arena[data-compact-tools="true"] #runnerNickname{display:none}
#arena[data-compact-tools="true"] #trophyToast{min-height:44px;padding:7px 9px;gap:8px;box-shadow:none}
#arena[data-compact-tools="true"] #trophyToast .trophy-icon{width:19px;height:24px}
#arena[data-compact-tools="true"] #trophyToast small{font-size:12px;line-height:1.3}
#arena[data-compact-tools="true"] #trophyToastName{font-size:14px;line-height:1.35}
#arena[data-compact-tools="true"] #trophyToastTier{display:none}
