/* Homepage library. Existing game rendering and save formats are unchanged. */
body.arcade-home{background:#0d1015;--accent-cyan:#c8ea80;--ink-accent:#c8ea80}
body.arcade-home::before{display:none}
.arcade-home .wrap{display:grid;grid-template-columns:248px minmax(0,1fr);gap:12px 16px;max-width:1860px;padding:0 20px 24px;align-items:start}
.arcade-home header{grid-column:1/-1;grid-row:1;min-height:48px;padding:8px 0;margin:0;gap:18px;border-color:#232a34}
.arcade-home .brand{font-size:19px;gap:8px;white-space:nowrap}.arcade-home .brand-mark{width:26px;height:26px;filter:none}.arcade-home .brand-word span{color:#c8ea80}.arcade-home .brand-badge{display:none}
.arcade-home header nav{margin-left:auto;gap:2px}.arcade-home nav a{font-size:13px;padding:6px 10px}
.arcade-home .language-picker{background:#161b22;border-color:#2b323c;backdrop-filter:none;border-radius:8px;padding:2px 8px}.arcade-home .language-picker>span{display:none}.arcade-home .language-picker select{min-height:26px;max-width:140px;font-size:12px}
.lobby-intro{display:none!important}
.game-library{grid-column:1;grid-row:2/span 4;position:sticky;top:12px;align-self:start;z-index:30;max-height:calc(100dvh - 24px);display:flex;flex-direction:column;min-width:0;border:1px solid #262e39;border-radius:12px;background:#141920;overflow:hidden}
.library-drawer{display:flex;flex-direction:column;min-height:0;max-height:100%}
.library-heading{display:flex;justify-content:space-between;align-items:center;gap:10px;padding:12px 14px;cursor:pointer;list-style:none;flex:0 0 auto}.library-heading::-webkit-details-marker{display:none}.library-label{display:block;font-size:14px;font-weight:650}.library-selection{display:none;font-size:12px;color:#aebbc7;margin-top:2px}
.library-total{display:flex;gap:6px;align-items:center;color:#8a97a6;font-size:12px}.library-total svg{width:15px;height:15px;transition:transform .15s}.library-drawer[open] .library-total svg{transform:rotate(180deg)}
.library-body{padding:0 8px 8px;display:flex;flex-direction:column;min-height:0;flex:1 1 auto}.library-search{display:flex;align-items:center;gap:7px;margin:0 4px 8px;border:1px solid #303845;border-radius:7px;padding:0 9px;background:#0e1319;color:#8392a3;flex:0 0 auto}.library-search:focus-within{border-color:#c8ea80;outline:2px solid #c8ea8026}.library-search svg{width:16px;height:16px;flex:0 0 auto}.library-search input{width:100%;min-width:0;height:36px;border:0;outline:0;color:#f0f4f8;background:transparent;font:inherit;font-size:12px}.library-search input::placeholder{color:#8491a2}
.library-filters{display:flex;flex-wrap:wrap;gap:4px;padding:0 4px;flex:0 0 auto}.library-filters button{min-height:28px;padding:4px 8px;font-size:11px;font-weight:500;color:#aab5c4;background:transparent;border:1px solid transparent;border-radius:6px}.library-filters button:hover{color:#fff;background:#232c37}.library-filters button[aria-pressed=true]{color:#deefb9;border-color:#48583a;background:#283125}
.library-results{padding:0 6px;font-size:10px;color:#8090a1;margin:8px 0 4px;flex:0 0 auto}
.arcade-home .game-tabs{display:grid;grid-template-columns:1fr 1fr;gap:3px 4px;padding:0 2px 2px;margin:0;overflow-x:hidden;overflow-y:auto;max-height:calc(100dvh - 205px);scrollbar-width:thin;scrollbar-color:#3c4858 transparent}
.arcade-home .game-tab{grid-column:1/-1;position:relative;display:flex;flex:0 0 auto;flex-direction:row;align-items:center;gap:10px;min-height:52px;padding:7px 9px;border-radius:8px;border:1px solid transparent;background:transparent;box-shadow:none;backdrop-filter:none;transform:none;overflow:visible}.arcade-home .game-tab[data-mini-game]{grid-column:span 1;min-height:40px;padding:5px 6px;gap:6px;background:#10151c;border-color:#202833;opacity:.88}.arcade-home .game-tab[data-mini-game]:hover{opacity:1;background:#1c242e;border-color:#333e4a}.arcade-home .game-tab[data-mini-game][aria-selected=true]{opacity:1;background:#263126;border-color:#637b45}.arcade-home .game-tab[data-mini-game] .pod-icon{width:22px;height:22px;padding:2px;border-radius:5px}.arcade-home .game-tab[data-mini-game] .cartridge-copy>span,.arcade-home .game-tab[data-mini-game] .cartridge-copy strong{font-size:11px;line-height:1.2}.arcade-home .game-tab[data-mini-game] .cartridge-copy small{font-size:7px;margin-top:2px}.arcade-home .game-tab[hidden]{display:none!important}.arcade-home .game-tab:hover{background:#1e2630;border-color:#333e4a;box-shadow:none;transform:none}.arcade-home .game-tab[aria-selected=true]{background:#263126;border-color:#637b45;box-shadow:none}
.arcade-home .game-tab .pod-icon,.arcade-home .game-tab .pixel-icon{display:block;width:30px;height:30px;margin:0;padding:3px;border:1px solid #303b47;border-radius:7px;background:#111820;transform:none;flex:0 0 auto}
.arcade-home .cartridge-copy{min-width:0}.arcade-home .cartridge-copy>span,.arcade-home .cartridge-copy strong{white-space:normal;font-size:12px;font-weight:560;line-height:1.3;overflow:visible;text-overflow:clip}.arcade-home .cartridge-copy small{display:block;color:#8593a4;font-size:8px;letter-spacing:.035em;margin-top:3px;white-space:normal;line-height:1.2}.arcade-home .selected-light,.arcade-home .cartridge-number{display:none}.arcade-home .new-game{display:block;position:absolute;right:7px;top:4px;left:auto;color:#d7eeb0;font:600 7px/1.1 var(--font-sans);letter-spacing:.04em;text-transform:uppercase}
.library-empty{font-size:12px;color:#a6b2bf;text-align:center;padding:20px 10px}.sr-only{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;border:0}
.arcade-home .game-panel{grid-column:2;grid-row:2;min-width:0;width:100%;display:grid;grid-template-columns:minmax(0,1fr) 216px;grid-template-rows:auto minmax(0,1fr);align-items:start;padding:10px 12px;gap:8px 14px;background:#141920;border:1px solid #262e39;border-radius:12px;box-shadow:none;backdrop-filter:none}
.arcade-home .player-bar{grid-column:1/-1;grid-row:1;min-height:34px;margin:0;padding:0 0 6px;border-bottom:1px solid #242c37}.arcade-home .player-bar h2{display:block;margin:0;font-size:18px;font-weight:650;letter-spacing:-.02em;line-height:1.25}.arcade-home .expand-player{min-height:30px;padding:4px 11px;font-size:11px;border-radius:6px;flex:0 0 auto}
.arcade-home .btn{background:#c8ea80;box-shadow:none;color:#172015;border-color:#c8ea80;border-radius:6px}.arcade-home .btn:hover:not(:disabled){box-shadow:none}.arcade-home .btn.ghost{background:#202833;border-color:#35404f;color:#e1e8ef}
.arcade-home .game-panel .game-play{grid-column:1;grid-row:2;height:clamp(380px,calc(100dvh - 165px),860px);padding:4px;background:#080c12;border:1px solid #222b36;border-radius:8px;overflow:hidden}.arcade-home .game-panel .stage{border:0;border-radius:3px;box-shadow:none}
.arcade-home .game-info{grid-column:2;grid-row:2;padding:0;max-height:none;overflow:visible}.arcade-home .game-info>.game-kicker,.arcade-home .game-info>.lede{display:none}
.arcade-home .hud{gap:7px;margin:0 0 12px}.arcade-home .hud>span{border-radius:7px;padding:9px;background:#0e141b;font-size:10px}.arcade-home .hud b{font-size:21px}.arcade-home .controls{gap:6px;margin:8px 0}.arcade-home .controls .btn{min-height:40px;font-size:12px}.arcade-home [data-role=status]{color:#c3d4e2;background:#1b2630;border-left-color:#8297ad;padding:9px;margin:10px 0}.arcade-home .instructions{padding:10px;border-radius:7px;background:#1a212a;margin:10px 0 0}.arcade-home .instructions summary{font-size:12px}.arcade-home .point-rule,.arcade-home .pause-note{font-size:11px}
.arcade-home .game-panel.bundled{grid-template-columns:minmax(0,1fr);grid-template-rows:auto auto auto}.arcade-home .bundled .game-play{height:clamp(420px,calc(100dvh - 165px),880px);padding:0}.arcade-home .stage--embed{height:100%;width:100%;min-height:0;max-width:none}.arcade-home .stage--embed iframe{display:block;width:100%;height:100%;min-height:0;max-width:none;border:0;border-radius:0}
.game-details{grid-column:1/-1;grid-row:3;border-top:1px solid #242c37;padding-top:6px}.game-details>summary{cursor:pointer;color:#99a8b8;font-size:11px;font-weight:500;padding:1px 0}.arcade-home .bundled .game-details .game-info{display:block;padding:12px 0 2px;font-size:13px}.arcade-home .bundled .game-info>.lede{display:block;max-width:75ch;margin-bottom:8px;font-size:14px;color:#d5dee7}.arcade-home .bundled .game-info>.note{margin:6px 0}.arcade-home .bundled .game-info>.pause-note{display:none}.arcade-home .bundled .game-info>.btn{margin-top:10px;min-height:34px;font-size:12px}
.arcade-home #game-aria-of-sorrow .game-play{width:100%!important;margin:0!important}
/* Phaser may finish booting after a quick switch. Keep a valid offscreen
   viewport while the shared lifecycle pauses its hidden simulation. */
.arcade-home #game-little-helper[hidden]{display:grid!important;position:fixed;left:-200vw;top:0;visibility:hidden;pointer-events:none;width:min(1100px,100vw);height:600px;z-index:-1;contain:layout paint style}
.arcade-home .record-drawer{grid-column:2;grid-row:3;min-width:0;width:100%;margin:0;border:1px solid #262e39;border-radius:12px;background:#141920;overflow:hidden}.record-drawer>summary{display:flex;align-items:center;gap:14px;cursor:pointer;list-style:none;padding:12px 16px;font-size:14px;font-weight:600}.record-drawer>summary::-webkit-details-marker{display:none}.record-summary-note{color:#8f9daa;margin-left:auto;font-size:12px;font-weight:400}.drawer-plus{width:20px;color:#b7c3ce;text-align:center;font-size:20px;font-weight:300;line-height:1;transition:transform .15s}.record-drawer[open] .drawer-plus{transform:rotate(45deg)}
.arcade-home .records{margin:0;max-width:none;border:0;border-top:1px solid #262e39;padding:16px;border-radius:0;box-shadow:none;background:transparent}.arcade-home .record-banner{display:none}.arcade-home .record-totals{display:grid;grid-template-columns:1fr 1fr;gap:12px;margin:14px 0}.arcade-home .record-totals>div{box-shadow:none;border:1px solid #2a3441;border-radius:10px;padding:16px 20px;background:#0f141c;backdrop-filter:none;position:static}.arcade-home .record-totals strong{font-size:clamp(26px,2.8vw,34px);margin-top:6px}
.arcade-home .game-bests{grid-template-columns:repeat(auto-fill,minmax(190px,1fr));gap:10px;margin:14px 0}.arcade-home .game-bests>div{background:#0f141c;border:1px solid #252f3b;border-radius:9px;padding:12px 14px}.arcade-home .records details{background:#0f141c;border:1px solid #252f3b;border-radius:10px;padding:14px 16px;margin-top:14px;backdrop-filter:none}
.arcade-home footer{grid-column:2;grid-row:4;display:flex;justify-content:center;gap:8px;flex-wrap:wrap;margin:0;padding:4px 0 0;border:0;font-size:11px;color:#8896a5}
.arcade-home .game-panel.is-expanded{grid-column:auto;grid-row:auto;grid-template-rows:32px minmax(0,1fr);height:100dvh;width:100vw;border:0;border-radius:0;gap:0;padding:env(safe-area-inset-top,0px) env(safe-area-inset-right,0px) env(safe-area-inset-bottom,0px) env(safe-area-inset-left,0px);background:#080c12}.arcade-home .is-expanded .player-bar{min-height:32px;height:32px;padding:0 10px;border-bottom:1px solid #1f2732;background:#0d1219}.arcade-home .is-expanded .player-bar h2{font-size:15px}.arcade-home .is-expanded .expand-player{min-height:24px;padding:2px 9px;font-size:11px}.arcade-home .is-expanded .game-play{height:100%;min-height:0;padding:0;border:0;border-radius:0}.arcade-home .is-expanded .game-details{display:none}.arcade-home .is-expanded .game-info{max-height:100%;overflow:auto;padding:8px}
@media(max-width:1200px){
 .arcade-home .wrap{grid-template-columns:220px minmax(0,1fr);gap:12px;padding:0 14px 16px}
 .arcade-home .game-panel:not(.bundled){grid-template-columns:1fr;grid-template-rows:auto auto auto}.arcade-home .game-panel:not(.bundled)>.game-info{grid-column:1;grid-row:3;display:grid;grid-template-columns:1fr 1fr;gap:0 14px}.arcade-home .game-info>.hud,.arcade-home .game-info>.controls{margin:0}.arcade-home .game-info>.instructions,.arcade-home .game-info>.point-rule,.arcade-home .game-info>.pause-note,.arcade-home .game-info>[data-role=status],.arcade-home .game-info>.aim{grid-column:1/-1}
 .arcade-home .is-expanded:not(.bundled)>.game-info{grid-column:2;grid-row:2;display:block}.arcade-home .game-panel.is-expanded:not(.bundled){grid-template-columns:minmax(0,1fr) 210px;grid-template-rows:32px minmax(0,1fr)}
}
@media(max-width:800px){
 .arcade-home .wrap{grid-template-columns:minmax(0,1fr);gap:5px;padding:0 3px 12px}
 .arcade-home header{min-height:34px;padding:3px 6px;gap:8px;flex-wrap:nowrap;border-bottom:1px solid #1e2630}
 .arcade-home .brand{font-size:15px;gap:6px}.arcade-home .brand-mark{width:20px;height:20px}.arcade-home header nav{display:none}
 .arcade-home .language-picker{margin-left:auto;padding:1px 4px;border-radius:6px}.arcade-home .language-picker select{font-size:11px;max-width:110px;min-height:24px}
 .game-library{position:sticky;top:0;z-index:80;grid-column:1;grid-row:2;max-height:none;overflow:visible;border-radius:7px;border-color:#26303c;background:#141920;box-shadow:0 4px 14px rgba(0,0,0,.45)}
 .library-drawer{position:relative;max-height:none}
 .library-heading{padding:5px 10px;min-height:34px;gap:8px}
 .library-heading>span:first-child{display:flex;align-items:center;gap:6px;min-width:0}
 .library-label{font-size:10px;color:#8fa0b3;font-weight:500;white-space:nowrap}
 .library-selection{display:inline-block;color:#c8ea80;font-size:13px;font-weight:650;margin:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
 .library-body{position:absolute;top:calc(100% + 4px);left:0;right:0;z-index:90;padding:8px;background:#141920;border:1px solid #2e3846;border-radius:10px;box-shadow:0 18px 42px rgba(0,0,0,.85)}
 .library-search input{height:38px;font-size:13px}.library-filters button{min-height:32px;font-size:11px;padding:4px 8px}
 .arcade-home .game-tabs{display:grid;grid-template-columns:1fr 1fr;gap:5px;max-height:clamp(160px,calc(100dvh - 200px),380px);padding:2px 2px 4px}
 .arcade-home .game-tab,.arcade-home .game-tab:not([data-mini-game]){grid-column:span 1;min-width:0;min-height:54px;padding:7px 7px;gap:7px;background:#1b222c;border-color:#2b3541}.arcade-home .game-tab[data-mini-game]{min-height:42px;padding:5px 6px;gap:6px;background:#12171f;border-color:#232c37}
 .arcade-home .game-tab .pod-icon,.arcade-home .game-tab .pixel-icon{width:26px;height:26px}
 .arcade-home .cartridge-copy>span,.arcade-home .cartridge-copy strong{font-size:11px}.arcade-home .cartridge-copy small{font-size:7px}
 .arcade-home .game-panel,.arcade-home .game-panel.bundled{grid-column:1;grid-row:3;scroll-margin-top:38px;display:grid;grid-template-columns:minmax(0,1fr);grid-template-rows:auto auto auto;gap:3px;padding:2px;border:1px solid #222b36;border-radius:8px;background:#10151c}
 .arcade-home .player-bar{grid-row:1;order:unset;padding:1px 6px 3px;min-height:28px;gap:6px}
 .arcade-home .player-bar h2{display:block;font-size:14px}
 .arcade-home .expand-player{font-size:11px;min-height:25px;padding:2px 10px;background:#c8ea80;color:#141d11;border-color:#c8ea80;font-weight:650}
 .arcade-home .game-panel .game-play{grid-row:2;order:unset;height:clamp(320px,calc(100dvh - 220px),680px);padding:2px;border-radius:6px}
 .arcade-home .game-panel.bundled .game-play{height:calc(100dvh - 102px);padding:0;border:0;border-radius:6px}
 .arcade-home .game-panel:not(.bundled)>.game-info{display:grid;grid-row:3;grid-column:1;grid-template-columns:1fr;gap:6px;width:100%;padding:2px 4px}
 .arcade-home .game-info>.hud{width:100%;display:flex;margin:0;gap:5px}.arcade-home .hud>span{padding:6px 8px;font-size:10px;border-radius:6px}.arcade-home .hud b{font-size:16px}
 .arcade-home .game-info>.controls{width:100%;display:flex;flex-wrap:wrap;margin:0;gap:5px}.arcade-home .controls .btn{flex:1 1 auto;min-height:40px;font-size:12px}.arcade-home .controls [data-role=save]{flex-basis:100%}
 .arcade-home .bundled .game-details{padding:4px 6px 2px}.arcade-home .bundled .game-info .instructions{display:block}.arcade-home .bundled .game-info{width:100%}.arcade-home .bundled .game-info .btn{font-size:12px}
 .arcade-home .record-drawer{grid-column:1;grid-row:4;border-radius:8px}.record-drawer>summary{padding:12px 14px;font-size:13px;gap:10px}.record-summary-note{font-size:10px}.arcade-home .records{padding:12px;margin:0}.arcade-home .record-totals{grid-template-columns:1fr 1fr;gap:8px;margin:10px 0}.arcade-home .record-totals>div{padding:12px 14px}.arcade-home .record-totals strong{font-size:22px}.arcade-home footer{grid-column:1;grid-row:5;font-size:10px;padding-top:6px}
 .arcade-home .game-panel.is-expanded,.arcade-home .game-panel.is-expanded:not(.bundled){grid-column:auto;grid-row:auto;display:flex;flex-direction:column;width:100vw;height:100dvh;gap:0;padding:env(safe-area-inset-top,0px) env(safe-area-inset-right,0px) env(safe-area-inset-bottom,0px) env(safe-area-inset-left,0px);border:0;border-radius:0;background:#060a0f}
 .arcade-home .is-expanded .player-bar{flex:0 0 auto;width:100%;min-height:28px;height:28px;padding:0 8px;background:#0c1118;border-bottom:1px solid #1e2732}
 .arcade-home .is-expanded .player-bar h2{font-size:13px}
 .arcade-home .is-expanded .expand-player{min-height:22px;padding:2px 8px;font-size:10px;background:#202833;color:#e1e8ef;border-color:#35404f}
 .arcade-home .is-expanded .game-play,.arcade-home .is-expanded.bundled .game-play{width:100%;flex:1 1 0;height:0;min-height:0;padding:0;border:0;border-radius:0}
 .arcade-home .is-expanded:not(.bundled)>.game-info{display:flex;flex-wrap:wrap;flex:0 0 auto;max-height:24dvh;overflow:auto;gap:4px;padding:4px}.arcade-home .is-expanded .instructions,.arcade-home .is-expanded .point-rule,.arcade-home .is-expanded .pause-note,.arcade-home .is-expanded [data-role=status]{display:none}.arcade-home .is-expanded .game-info>.hud,.arcade-home .is-expanded .game-info>.controls{flex:1 1 160px}.arcade-home .is-expanded .controls [data-role=save]{flex-basis:auto}
}
@media(max-width:360px){.arcade-home .wrap{padding-left:2px;padding-right:2px}.arcade-home .brand{font-size:14px;gap:4px}.arcade-home .language-picker select{max-width:102px}.arcade-home .game-tab{gap:5px;padding:6px 5px}.arcade-home .cartridge-copy>span,.arcade-home .cartridge-copy strong{font-size:10px}.record-summary-note{display:none}.drawer-plus{margin-left:auto}}
