/* The full toolbar needs 1,268 CSS pixels; reserve 1,280 for the browser player. */
html.web-player { --minimum-game-width:1280px; height:100%; overflow-x:auto; overflow-y:hidden; scroll-behavior:auto; overscroll-behavior-x:contain; scrollbar-width:thin; scrollbar-color:#c997b6 var(--app-background); }
html.web-player::-webkit-scrollbar { display:block; height:10px; }
html.web-player::-webkit-scrollbar-thumb { background:#c997b6; border-radius:5px; }
html.web-player::-webkit-scrollbar-track { background:var(--app-background); }
.web-player body { min-width:var(--minimum-game-width); overflow:visible; }
.web-player .home-page { min-width:var(--minimum-game-width); }
/* Percent heights follow the space left by Windows' horizontal scrollbar.
   A 100dvh player extends behind that bar and clips the bottom instruments. */
.web-player body, .web-player .app-surface, .web-player .home-page { height:100%; min-height:0; }
.web-player .home-page.home-page .workspace-toolbar { flex-wrap:nowrap; }
.web-player .home-page.home-page .toolbar-status { flex:1 1 auto; justify-content:flex-end; }

/* Keep the desktop controls when the viewport is narrower than the player.
   Popups still use viewport media queries so they fit the visible window. */
@media(max-width:1279px) {
    .web-player .home-page .current-voice { display:block; }
    .web-player .home-page .transport-controls { display:flex; flex-wrap:nowrap; justify-content:normal; gap:12px; }
    .web-player .home-page .practice-controls { gap:7px; }
    .web-player .home-page .transport-controls .midi-open-button { display:flex; }
    .web-player .home-page .game-message { flex-basis:auto; padding:8px 16px; font-size:.76rem; }
    .web-player .home-page .keyboard-panel { padding:0 12px; }
}

/* Keep the player row consistent with the tablet, including its raised edge. */
.web-player .home-page.home-page .game-dashboard { border-bottom:1px solid #42132f; box-shadow:0 1px 2px #160b2140; position:relative; z-index:2; }
.web-player .home-page.home-page .score-display { display:flex; flex:1 0 100%; flex-wrap:nowrap; align-items:center; width:100%; min-width:0; height:46px; padding:1px 16px; gap:0; box-sizing:border-box; overflow-x:auto; overflow-y:hidden; box-shadow:inset 0 -1px #bd72a34d; }
.web-player .home-page.home-page .score-display>div { display:flex; flex:0 0 auto; flex-direction:row; align-items:center; min-width:0; height:26px; padding:0 12px; gap:8px; border:0; box-sizing:border-box; }
.web-player .home-page.home-page .score-display>div.game-view-zoom { display:flex; height:32px; padding:0 0 0 12px; gap:8px; }
.web-player .home-page.home-page .score-display>div+div { border-left:1px solid #c58bad80; }
.web-player .home-page.home-page .score-display>.player-name { height:44px; padding-left:0; padding-right:12px; }
.web-player .home-page.home-page .score-display .players-open-button { min-height:44px; max-width:160px; }
.web-player .home-page.home-page .score-display>div>span { font-size:14px; line-height:1.2; letter-spacing:0; text-transform:none; }
.web-player .home-page.home-page .score-display strong { width:auto; min-width:26px; height:auto; margin:0; padding:0; border:0; border-radius:0; background:none; box-shadow:none; color:var(--score-rose); font:500 24px/1 ui-monospace,SFMono-Regular,Consolas,monospace; text-shadow:none; }
.web-player .home-page.home-page .score-display strong[data-score=hits] { color:var(--score-hit); }
.web-player .home-page.home-page .score-display .accuracy strong { min-width:58px; }
.web-player .home-page.home-page.home-page .score-display :is(.app-master-volume,.game-view-zoom) input { width:120px; }
.web-player .home-page.home-page.home-page .score-display :is(.app-master-volume,.game-view-zoom) input::-webkit-slider-runnable-track { height:8px; }
.web-player .home-page.home-page.home-page .score-display :is(.app-master-volume,.game-view-zoom) input::-webkit-slider-thumb { margin-top:-4px; }
.web-player .home-page.home-page.home-page .score-display :is(.app-master-volume,.game-view-zoom) input::-moz-range-track { height:8px; }
.web-player .game-view-zoom label { display:flex; align-items:center; gap:4px; color:#e3c9df; font-size:12px; line-height:1; }
.web-player .game-view-zoom label svg { width:18px; height:18px; fill:none; stroke:currentColor; stroke-width:1.8; stroke-linecap:round; }
.web-player .game-view-zoom-reset { min-width:46px; min-height:32px; padding:0 2px; border:0; border-radius:3px; background:transparent; color:#fff0fa; font:12px/1 ui-monospace,SFMono-Regular,Consolas,monospace; cursor:pointer; }
.web-player .game-view-zoom-reset:active { background:#ffffff20; }
.web-player .game-view-zoom :is(input,button):focus-visible { outline:2px solid #fff0fa; outline-offset:2px; }

/* The status component follows the visible window while the game canvas pans. */
.web-player .home-page .status-viewport { position:sticky; left:0; width:100vw; max-width:100%; }
@media (max-width:1023px) {
    /* Keep the full status strip on one line and scroll it within the window. */
    .web-player .home-page .status-viewport { container-type:normal; overflow-x:auto; overscroll-behavior-x:contain; }
    .web-player .home-page .workspace-status { min-width:980px; height:48px; grid-template-columns:repeat(4,minmax(0,1fr)); grid-template-rows:minmax(0,1fr); }
    .web-player .home-page .workspace-status .status-group:nth-child(2) { padding-right:var(--group-padding); }
    .web-player .home-page .workspace-status .status-group:nth-child(3) { padding-left:var(--group-padding); }
    .web-player .home-page .workspace-status .status-group:nth-child(3)::before { display:block; }
}

/* Give the creator's introduction a clear place in the browser title row. */
.web-player .workspace-toolbar .title-about-button { height:28px; min-width:94px; justify-content:center; gap:7px; margin-left:8px; padding:0 13px; border:1px solid #753557; border-radius:999px; background:linear-gradient(135deg,#713552,#91466e); color:#fffafd; font-size:13px; font-weight:700; letter-spacing:.015em; box-shadow:inset 0 1px #ffffff35,0 2px 6px #71355224; transition:background-color 150ms ease,box-shadow 150ms ease; }
.web-player .workspace-toolbar .title-about-button>span { display:inline; }
.web-player .workspace-toolbar .title-about-button svg { width:21px; height:21px; flex:0 0 21px; stroke-width:2; transform-origin:center; }
.web-player .workspace-toolbar .title-about-button:hover { background:#68304d; color:#fff; box-shadow:inset 0 1px #ffffff35,0 2px 10px #71355245; }
.web-player .workspace-toolbar .title-about-button:focus-visible { outline:3px solid #b775a0; outline-offset:3px; }
@media(prefers-reduced-motion:no-preference) {
    .web-player .title-about-button svg { animation:about-welcome 2.4s ease-in-out 2; }
    body:has(#startup-splash:not(.leaving)) .title-about-button svg { animation-play-state:paused; }
    @keyframes about-welcome {
        0%,65%,100% { transform:rotate(0) scale(1); }
        18% { transform:rotate(-12deg) scale(1.12); }
        36% { transform:rotate(10deg) scale(1.12); }
        50% { transform:rotate(-5deg) scale(1.05); }
    }
}
@media(prefers-reduced-motion:reduce) { .web-player .workspace-toolbar .title-about-button { transition:none; } }

/* Match the native launch screen, sized to the visible window rather than the
   desktop game's minimum width. Keep keyboard focus off the covered controls. */
html:has(#startup-splash:not(.leaving)),html:has(#startup-splash:not(.leaving)) body { background:#071126; }
body:has(#startup-splash:not(.leaving)) .app-surface { visibility:hidden; }
#startup-splash { position:fixed; inset:0; z-index:9999; display:flex; flex-direction:column; align-items:center; justify-content:center; gap:12px; padding:24px; box-sizing:border-box; overflow:hidden; isolation:isolate; background:radial-gradient(circle at 50% 42%,#1b2152 0%,#071126 72%); color:#f5f4ff; text-align:center; font-family:-apple-system,BlinkMacSystemFont,"Segoe UI",sans-serif; }
#startup-splash::before { content:""; position:absolute; inset:-12px; z-index:-1; pointer-events:none; opacity:.7; background:radial-gradient(circle at 12% 19%,#c4dcff 0 1px,transparent 2px),radial-gradient(circle at 79% 12%,#c7afff 0 1px,transparent 2px),radial-gradient(circle at 91% 44%,#fff3d6 0 1px,transparent 2px),radial-gradient(circle at 22% 73%,#a7cfff 0 1px,transparent 2px),radial-gradient(circle at 70% 84%,#d5c3ff 0 1px,transparent 2px),radial-gradient(circle at 9% 49%,#c9b4f6 0 .7px,transparent 1.7px),radial-gradient(circle at 86% 72%,#b7deff 0 .7px,transparent 1.7px); }
#startup-splash .splash-artwork { position:relative; flex:none; width:min(72vmin,760px); height:min(72vmin,760px); overflow:hidden; border-radius:18px; }
#startup-splash img { display:block; width:100%; height:100%; object-fit:contain; }
#startup-splash h1 { margin:4px 0 0; font-size:clamp(22px,3.5vmin,38px); font-weight:750; letter-spacing:.03em; }
#startup-splash p { margin:0; color:#c7d6f8; font-size:clamp(14px,1.8vmin,18px); }
#startup-splash .splash-loading { display:flex; align-items:center; justify-content:center; gap:7px; height:8px; margin-top:2px; }
#startup-splash .splash-loading i { display:block; width:5px; height:5px; border-radius:50%; background:#c8bdff; opacity:.6; box-shadow:0 0 8px #b6a2ff60; }
@media(max-height:430px) {
    #startup-splash { gap:8px; padding:12px; }
    #startup-splash .splash-artwork { width:60vmin; height:60vmin; }
    #startup-splash h1 { font-size:22px; }
}
@media(prefers-reduced-motion:no-preference) {
    #startup-splash::before { animation:splash-starlight 2.3s ease-in-out 2; }
    #startup-splash .splash-loading i { animation:splash-beacon 1.2s ease-in-out 3; }
    #startup-splash .splash-loading i:nth-child(2) { animation-delay:160ms; }
    #startup-splash .splash-loading i:nth-child(3) { animation-delay:320ms; }
    @keyframes splash-starlight { 0%,100% { opacity:.45; transform:translate3d(0,0,0); } 50% { opacity:1; transform:translate3d(3px,-3px,0); } }
    @keyframes splash-beacon { 0%,100% { opacity:.45; transform:scale(.8); } 45% { opacity:1; transform:scale(1.2); } }
}
