/*
Launcher layout adapted from https://github.com/th0mk/nfsu2-web
MIT License

Copyright (c) 2026 th0mk
Portions copyright (c) 2026 Talha Müderrisoğlu (the original recompiler and macOS runtime)

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
*/
@import url('./theme.css');
/* A first visit waits for its language (app.mjs) instead of flashing Russian text; without scripts the page shows after 2 s. */
html[data-pending-language] .app{visibility:hidden;animation:language-reveal 0s 2s forwards}@keyframes language-reveal{to{visibility:visible}}
.app{max-width:1184px;margin:0 auto;padding:24px 32px 48px;display:grid;grid-template-columns:384px minmax(0,1fr);gap:24px;align-items:start}
.top{grid-column:1/-1;display:flex;align-items:center;gap:16px 24px;position:relative;overflow:hidden;background:var(--frame);border-radius:12px;padding:24px 24px 28px}.top::after{content:'';position:absolute;inset:auto 0 0;height:4px;background:var(--ice)}body[data-phase="loading"] .top::after{background:linear-gradient(90deg,var(--ice),#244158,var(--ice));background-size:200% 100%;animation:loading 2s linear infinite}@keyframes loading{to{background-position:200% 0}}
.brand{flex:1;min-width:0}.brand h1{font-size:25px;line-height:32px;text-wrap:balance}.brand .hint{margin-top:4px}.top-end,.row{display:flex;align-items:center;flex-wrap:wrap;gap:8px}.top-end{flex:none}.top-end .btn{padding:0 12px}.language{position:relative;display:inline-flex}.language svg{position:absolute;left:12px;top:10px;width:20px;height:20px;fill:none;stroke:var(--muted);stroke-width:1.6;pointer-events:none}.language select{padding-left:40px}
.side{display:grid;gap:24px}.panel{min-width:0;padding:24px;border-radius:12px;background:var(--panel)}.status{font-size:32px;line-height:40px;margin:0;color:var(--ice)}body[data-phase="error"] .status{color:var(--bad)}.status-sub{color:var(--muted);margin:4px 0 24px;min-height:24px}.play{width:100%;display:flex;align-items:center;justify-content:center;gap:16px;height:48px;border:2px solid var(--ice);border-radius:8px;background:var(--ice-fill);color:var(--ice);box-shadow:0 0 12px var(--ice-glow);font-size:20px;font-weight:700;font-style:italic}.play:hover:not(:disabled){background:#294858}.play:disabled{box-shadow:none;border-color:var(--line);background:var(--field);color:var(--muted)}.play kbd{background:none;border-color:currentColor;color:inherit}.launch-panel>.text-button{display:block;margin:12px auto 20px}.quick-help p+p{margin-top:8px}
.tabs{display:flex;gap:24px;margin:-4px 0 24px;border-bottom:1px solid var(--line)}.tab{flex:none;height:44px;padding:0;border:0;background:none;color:var(--muted);font-size:20px;font-weight:700;font-style:italic;white-space:nowrap}.tab[aria-selected="true"]{color:var(--ice);box-shadow:0 3px var(--ice)}.tab:hover{color:var(--text)}.panel-head{display:flex;flex-wrap:wrap;align-items:center;justify-content:space-between;gap:8px 16px;margin-bottom:16px}.panel-head h2{margin:0}.panel-head .text-button{padding:0}.count{font-size:14px;font-style:normal;font-weight:400;color:var(--muted);margin-left:8px}
.save-actions{margin-bottom:16px}.file-button{position:relative;overflow:hidden}.file-button input{position:absolute;inset:0;opacity:0;width:100%;cursor:pointer}.file-button:focus-within{outline:2px solid var(--ice);outline-offset:3px}.file-button[aria-disabled="true"]{opacity:.5;cursor:not-allowed}.file-list,.lobby-list{display:grid;gap:8px;margin:24px 0 0}.file-row,.lobby-row,.joined{display:flex;align-items:center;justify-content:space-between;gap:12px;background:var(--field);padding:12px;border-radius:8px}.file-row>div,.lobby-row>div,.joined>div{min-width:0}.file-row strong,.lobby-row strong,.joined strong{display:block;color:var(--ice);overflow-wrap:anywhere}.file-row small,.lobby-row small{display:block;color:var(--muted);font-size:12px;overflow-wrap:anywhere}.file-row time{flex:none;color:var(--muted);font-size:12px}.empty{padding:8px 0;color:var(--muted)}.notice{font-size:14px;color:var(--bad);margin-top:16px;overflow-wrap:anywhere}.notice.success{color:var(--ice)}
.lobby-form{margin-top:24px}.lobby-form input,.private-room input{flex:1;min-width:80px}.joined{margin-top:20px;border:1px solid var(--ice)}.private-room{margin-top:24px}.private-room summary{cursor:pointer;color:var(--muted);padding:8px 0}.private-room form{margin-top:8px}.setting{display:flex;align-items:center;justify-content:space-between;gap:16px;padding:20px 0;min-height:72px}.setting+.setting{border-top:1px solid var(--line)}.setting strong{display:block;font-style:italic}.setting small{display:block;max-width:260px;font-size:14px;line-height:20px;color:var(--muted);margin-top:4px}.setting select{width:164px;flex-shrink:0;color:var(--ice)}.switch{appearance:none;width:56px;height:32px;flex:none;margin:0;padding:0;border:2px solid var(--edge);border-radius:16px;background:radial-gradient(circle at 14px 50%,var(--edge) 8px,transparent 9px),var(--field);cursor:pointer}.switch:checked{border-color:var(--ice);background:radial-gradient(circle at calc(100% - 14px) 50%,var(--ice) 8px,transparent 9px),var(--ice-fill);box-shadow:0 0 8px var(--ice-glow)}
.keys>div{display:flex;align-items:center;justify-content:space-between;gap:16px;padding:12px 0}.keys>div+div{border-top:1px solid var(--line)}.keys dt{order:1;flex:none}.keys dd{margin:0;font-size:14px}.keys+.hint{margin-top:20px}
/* Own chevron instead of the browser arrow, which sits against the border. */select{appearance:none;-webkit-appearance:none;background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12'%3E%3Cpath d='M2 4.5l4 4 4-4' fill='none' stroke='%23afc1d1' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");background-repeat:no-repeat;background-position:right 14px center;background-size:12px 12px;padding-right:38px}
.online-counts{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:16px;margin:0}.online-counts>div{display:flex;flex-direction:column-reverse;justify-content:flex-end;min-width:0}.online-counts>div+div{padding-left:16px;border-left:1px solid var(--line)}.online-counts dt{font-size:14px;line-height:20px;color:var(--muted);overflow-wrap:anywhere}.online-counts dd{margin:0;font-size:32px;line-height:40px;font-weight:700;font-style:italic;color:var(--ice);font-variant-numeric:tabular-nums}
.flag{display:inline-block;width:20px;height:20px;border-radius:50%;overflow:hidden;flex:none;box-shadow:0 0 0 1px var(--edge)}.flag svg{display:block;width:100%;height:100%}.lobby-group{display:flex;align-items:center;gap:10px;margin:16px 0 0;font-size:16px;line-height:24px;color:var(--text)}.lobby-group:first-child{margin-top:0}.joined strong{display:flex;align-items:center;gap:8px}.setting-value{font-weight:700;font-style:italic;color:var(--ice);flex-shrink:0}.setting small.setting-warning{color:var(--bad)}
.segmented{display:flex;flex-shrink:0;gap:2px;padding:4px;border-radius:10px;background:var(--field)}.segmented label{position:relative;flex:1}.segmented input{position:absolute;inset:0;width:100%;height:100%;margin:0;opacity:0;cursor:pointer}.segmented span{display:block;min-width:52px;padding:4px 10px;border:2px solid transparent;border-radius:8px;text-align:center;font-weight:700;font-style:italic;color:var(--muted);white-space:nowrap}.segmented input:checked+span{border-color:var(--ice);color:var(--ice);background:var(--ice-fill);box-shadow:0 0 8px var(--ice-glow)}.segmented input:focus-visible+span{outline:2px solid var(--ice);outline-offset:2px}.segmented input:disabled+span{opacity:.5}.segmented input:disabled{cursor:not-allowed}
.game-data-actions{margin-top:16px}.game-data-actions:not(:has(.btn:not([hidden]))){display:none}#game-data-status{margin-top:12px}.settings-footer{display:flex;justify-content:flex-end;margin-top:24px;padding-top:16px;border-top:1px solid var(--line)}
.settings-group{margin-top:8px;padding-top:24px;border-top:1px solid var(--line);font-size:18px;line-height:24px;color:var(--ice)}.settings-group+.hint{margin-top:4px}.range{display:flex;align-items:center;gap:10px;flex-shrink:0}.range small{margin:0;font-size:14px;line-height:20px;color:var(--muted)}.range input{width:144px;margin:0;accent-color:var(--ice);cursor:pointer}.range input:disabled{cursor:not-allowed;opacity:.5}.range input:focus-visible{outline:2px solid var(--ice);outline-offset:3px}
#game-view{position:fixed;inset:0;z-index:100;background:#000;display:flex;flex-direction:column;width:100%;height:100%;overflow:hidden}#game-view:fullscreen{width:100vw;height:100vh}#game-view:fullscreen .game-toolbar{display:none}#game-view:fullscreen #game-stage{cursor:none}.game-toolbar{flex:none;display:flex;gap:8px;align-items:center;min-height:44px;padding:5px 12px;background:var(--frame);color:var(--muted)}.game-toolbar strong{font-size:14px;margin-right:auto}.game-toolbar .btn{min-height:32px;font-size:13px;padding:0 10px;border-width:1px}#game-stage{position:relative;flex:1;min-height:0;display:flex;align-items:center;justify-content:center;overflow:hidden}#diagnostic-canvas{display:block;flex:none;outline:none;background:#000;touch-action:none}#game-loading{position:absolute;inset:0;display:grid;place-content:center;padding:24px;text-align:center;background:#000;color:var(--ice);pointer-events:none;font-size:18px}
 dialog{width:min(560px,calc(100% - 32px));padding:24px;border:1px solid var(--edge);border-radius:12px;background:var(--panel);color:var(--text)}dialog::backdrop{background:#000b}dialog ul{padding-left:20px;display:grid;gap:12px;margin:16px 0 0}dialog ul+.hint{margin-top:24px}dialog .credit a{color:inherit}.sr-only{position:absolute;width:1px;height:1px;padding:0;overflow:hidden;clip-path:inset(50%);white-space:nowrap;border:0}
@media(max-width:1100px){.app{grid-template-columns:320px minmax(0,1fr)}.top{align-items:flex-start}.top-end{justify-content:flex-end;max-width:350px}.tabs{gap:20px}.tab{font-size:17px}.brand h1{font-size:24px}}
@media(max-width:800px){.app{padding:16px;grid-template-columns:1fr;gap:16px}.top{flex-wrap:wrap;padding:20px}.brand{flex-basis:100%}.top-end{justify-content:flex-start;max-width:none}.side{gap:16px}.panel{padding:20px}.quick-help{display:none}.content{min-height:360px}.tabs{gap:24px}.tab{font-size:18px}.setting small{max-width:unset}}
@media(max-width:600px){.setting-wide{flex-direction:column;align-items:stretch}.setting-wide .segmented{width:100%}}
@media(max-width:420px){.top-end{flex:1 1 100%;min-width:0}.language svg,.top-end .btn svg{display:none}.language select{padding-left:12px}.range{gap:6px}.range input{width:92px}.range small{font-size:12px}.app{padding:12px}.top,.panel{padding:16px}.brand h1{font-size:23px;line-height:28px}.top-end{gap:6px}.top-end .btn,.language select{font-size:14px}.top-end .btn{padding:0 9px}.language select{padding-right:30px;background-position:right 10px center}.tabs{gap:0;justify-content:space-between}.tab{font-size:16px}.file-row{flex-wrap:wrap}.setting select{width:144px}.setting{gap:10px}.setting small{font-size:12px}.game-toolbar strong{font-size:11px}.game-toolbar{padding-inline:6px}.game-toolbar .btn{font-size:11px}}
@media(prefers-reduced-motion:reduce){body[data-phase="loading"] .top::after{animation:none}}
.about-card .tabs{gap:24px;justify-content:flex-start}.about-card .prose{overflow-wrap:anywhere}.about-card .prose p+p{margin-top:16px}
/* Keep the information available on phones, after the game controls. */
@media(max-width:800px){.side{display:contents}.content{order:1}.about-card{order:2}}
