:root { font-family: system-ui,-apple-system,"Segoe UI",sans-serif; color-scheme:dark; color:#f8f6ec; background:#0b1821; }
* { box-sizing:border-box; }
html,body,#app { width:100%;height:100%;margin:0;overflow:hidden; }
body { background:#091822; }
button { font:inherit; cursor:pointer; touch-action:manipulation; }
button:focus-visible,summary:focus-visible { outline:3px solid #efd58d; outline-offset:3px; }
#game { display:block;position:fixed;inset:0;width:100%;height:100%;border:0;background:#091822; }
#loading { position:absolute;z-index:11;inset:0;display:grid;place-content:center;justify-items:center;gap:21px;background:radial-gradient(ellipse at 50% 25%,#264747 0%,#102631 48%,#07121d 100%);transition:opacity .32s ease; }
#loading.is-done { opacity:0;pointer-events:none; }
#loading img { filter:drop-shadow(0 13px 22px #0006);border-radius:23px; }
.loading-copy { display:grid;gap:8px;align-items:center;text-align:center;padding:0 20px; }
.loading-copy b { font-size:clamp(16px,4vw,25px);letter-spacing:.13em; }
.loading-copy span { color:#b6c8c8;font-size:13px; }
.loading-pulse { width:175px;height:3px;background:#a5bdc32c;border-radius:4px;overflow:hidden; }
.loading-pulse i { display:block;width:40%;height:100%;background:#e2c47f;animation:travel 1.6s ease-in-out infinite alternate; }
@keyframes travel { from { transform:translateX(0) } to { transform:translateX(260%) } }
.menu-open { position:fixed;right:max(0px,env(safe-area-inset-right));top:46%;width:35px;height:47px;z-index:12;border:1px solid #e6d3ad99;border-right:0;border-radius:12px 0 0 12px;background:#1a303bc9;box-shadow:-2px 6px 18px #0006;color:#f9e9c4;font-size:18px;line-height:1;backdrop-filter:blur(8px);transition:background .15s,transform .15s; }
.menu-open:hover { background:#314b55;transform:translateX(-2px); }
.menu-open[aria-expanded=true] { opacity:0;pointer-events:none; }
#panel-backdrop { position:fixed;z-index:19;inset:0;background:#050d16a1;backdrop-filter:blur(2px); }
#app-panel { position:fixed;z-index:20;right:max(9px,env(safe-area-inset-right));top:50%;transform:translateY(-50%);width:min(360px,calc(100vw - 22px));max-height:calc(100dvh - 24px);overflow-y:auto;padding:17px;border-radius:19px;border:1px solid #d6ba836e;box-shadow:0 25px 85px #000b;background:linear-gradient(155deg,#25444d 0%,#132930 65%,#0d1d28 100%); }
.panel-head { display:flex;align-items:center;gap:11px; }
.panel-head img { border-radius:12px;flex-shrink:0; }
.panel-head div {flex:1;min-width:0; }
.eyebrow {color:#e6c88c;font-size:9px;font-weight:800;letter-spacing:.15em; }
h1 {margin:3px 0 0;font-size:17px;line-height:1.2; }
.panel-head p {margin:5px 0 0;color:#a6c1bd;font-size:11px; }
.icon-button { border:0;background:#ffffff16;color:#f5e9d8;border-radius:9px;width:32px;height:33px;align-self:start; }
.version-row { display:flex;gap:5px;flex-wrap:wrap;justify-content:space-between;margin:19px 0;padding:9px 0;border-top:1px solid #ffffff24;border-bottom:1px solid #ffffff24;font-size:11px;color:#c5d5d3; }
#connection-badge {color:#e4c78b; }
.panel-actions {display:grid;gap:8px; }
.panel-actions button { min-height:45px;padding:10px 12px;border:1px solid #a7bbbc45;border-radius:10px;background:#2c4a5399;color:#f3f0e8;text-align:left;font-size:13px;font-weight:650; }
.panel-actions button:hover {background:#496773b3;border-color:#acc3c38c; }
.panel-actions button.primary {background:#d7ac68;color:#183037;border-color:#edcd8b; }
.panel-actions button.primary:hover {background:#e9bf7e; }
.panel-actions button span {display:inline-flex;justify-content:center;align-items:center;width:22px;margin-right:8px;font-size:19px;vertical-align:middle; }
.update-status {min-height:44px;margin:12px 0;padding:10px 11px;background:#0d1e26a3;color:#b9cfcd;border:1px solid #ffffff19;border-radius:9px;font-size:12px;line-height:1.4; }
.update-status.available { color:#f8e4ba;border-color:#f6cb798a;background:#453c29; }
.help-details {font-size:12px;color:#b7c8c9; }
.help-details summary {cursor:pointer;color:#f1d8a6;font-weight:680; }
.help-details p {margin:8px 0;line-height:1.5; }
#app-panel footer {margin-top:12px;color:#93aaa9;font-size:10px;line-height:1.5;border-top:1px solid #ffffff1a;padding-top:10px; }
#toast { position:fixed;z-index:25;bottom:calc(22px + env(safe-area-inset-bottom));left:50%;transform:translateX(-50%);width:max-content;max-width:calc(100vw - 25px);padding:11px 16px;border:1px solid #dbc38c77;border-radius:12px;background:#163038f4;color:#fff4d8;box-shadow:0 11px 45px #0009;text-align:center;font-size:13px;pointer-events:none; }
[hidden] {display:none!important; }
@media (max-width:440px) { #app-panel{width:calc(100vw - 18px);right:9px;} .menu-open{width:29px;height:42px;font-size:16px;top:48%;} }
@media (max-height:570px){ #app-panel { width:min(440px,calc(100vw - 18px));padding:12px; } .panel-actions {grid-template-columns:repeat(2,minmax(0,1fr));} .panel-actions button {font-size:11px;min-height:42px;padding:7px;line-height:1.15;} .panel-actions button span {margin-right:1px;} .version-row{margin:8px 0;} #app-panel footer{margin-top:7px;} }
@media (prefers-reduced-motion:reduce) { .loading-pulse i{animation:none;} #loading{transition:none;} }
