/* Grid-first game lobby. The live player and its controls keep their existing flow. */
body{background:#090a08;color:#f4f3e9}
body:not(.arcade-expanded) main:has(.cabinet:not(.expanded)),.site-header{max-width:1200px}
.cabinet:not(.expanded){border:2px solid #6b622d;background:#10120e;border-radius:28px 28px 16px 16px;box-shadow:0 25px 90px #0009,0 0 65px #ffe4300a}
.cabinet:not(.expanded) .marquee{padding:14px 18px;background:#11130f;border-bottom:1px solid #ffe43035;color:#ffe430}
.cabinet:not(.expanded) .marquee h1{font-size:36px;gap:12px;margin:6px 0;letter-spacing:2px}
.cabinet:not(.expanded) .marquee h1 img{width:100px;background:transparent;padding:0}
.cabinet:not(.expanded) .edition,.cabinet:not(.expanded) .marquee-note{font-size:12px;letter-spacing:1.5px;color:#b8b99e}
.cabinet:not(.expanded) .screen-bezel{padding:16px 20px;background:linear-gradient(135deg,#465064 0%,#151b26 13%,#080b12 50%,#333e50 100%);border-bottom:1px solid #465164}
.cabinet:not(.expanded) .screen{border:7px solid #05080c;border-radius:28px;background:#090a08;box-shadow:0 0 0 2px #586479,0 8px 22px #000b,inset 0 0 40px #000}
#selection{padding:20px;background:#090a08}
/* Retain the existing non-interactive reflection, static scanlines and vignette. */
#selection::before,#selection::after{display:block}
#selection .selection-heading{margin-bottom:20px;gap:16px}
#selection .selection-heading h2{font-size:25px;line-height:1.15}
#selection .selection-heading .eyebrow{font-size:12px;letter-spacing:1.3px}
#selection .arcade-sort{font-size:12px;color:#c7bf91}
#menu-sound{min-height:44px;padding:10px 12px;border:1px solid #ffe43065;border-radius:8px;background:#171a10;color:#ffe430;font-size:14px;white-space:nowrap;align-self:flex-end}
#selection .hall-link a{font-size:14px;background:#171a10;color:#ffe430;border:1px solid #ffe43065}
#selection .hall-link>span{font-size:12px;color:#b8b9ac}
#selection .game-grid{grid-template-columns:repeat(3,minmax(0,1fr));gap:18px;align-items:stretch}
#selection .game-card{display:flex;flex-direction:column;min-width:0;position:relative;border:1px solid #ffe43035;border-radius:12px;background:#11130f;opacity:1;overflow:hidden;transition:border-color .15s ease}
#selection .game-card:hover{transform:none;background:#151811;border-color:#ffe43090}
#selection .game-card[data-selected=true],#selection .game-card:focus-within{border-color:#ffe430;box-shadow:0 0 0 1px #ffe43018}
#selection .game-grid .game-card .art{display:block;flex:none;width:100%;height:auto;min-height:0;aspect-ratio:16/9;background:#070906;overflow:hidden}
#selection .game-grid .game-card .art img{display:block;width:100%;height:100%;padding:0;object-fit:contain;object-position:center;filter:none;image-rendering:auto}
#selection .game-card .card-copy{display:flex;flex:1;flex-direction:column;align-items:stretch;justify-content:flex-start;padding:14px;gap:7px;text-align:left}
#selection .game-card .genre{display:block;order:0;font-size:12px;line-height:1.35;letter-spacing:.06em;color:#d5c966}
#selection .game-card h3{display:block;order:1;min-height:0;margin:0;font-size:21px;line-height:1.15;text-align:left;color:#f6f5ed}
#selection .game-card .creator-credit{order:2;font-size:12px;line-height:1.4;color:#c0c2b4}
#selection .game-card .card-copy>p{display:block;order:3;margin:0;font-size:14px;line-height:1.5;color:#c0c2b4}
#selection .game-card .game-platform{display:block;order:4;width:auto;min-height:0;padding:0;margin:0;border:0;background:none;font-size:12px;line-height:1.4;font-weight:400;text-align:left;color:#d7d9c9}
#selection .game-card .game-platform-note{display:block;order:4;font-size:12px;line-height:1.4;margin:0;color:#c0c2b4}
#selection .game-card .play-count{grid-column:2;grid-row:1;position:static;display:block;min-width:0;max-width:none;margin:0;font-size:12px;line-height:1.4;text-align:center;color:#c0c2b4}
#selection .card-actions{display:grid;grid-template-columns:minmax(78px,1fr) minmax(0,1fr) minmax(78px,1fr);order:6;align-items:center;gap:8px;margin-top:auto;padding-top:9px}
#selection .game-card .game-launch{grid-column:1;grid-row:1;justify-self:start;display:inline-flex;align-items:center;justify-content:center;gap:7px;min-height:44px;min-width:78px;margin:0;padding:10px 13px;border:2px solid #861b29;border-radius:8px;background:linear-gradient(#a72433,#741423);color:#fff6df;font-size:14px;font-weight:800;line-height:1.2;letter-spacing:.04em;box-shadow:0 3px 0 #34080e,inset 0 1px 0 #ec7a8650}
#selection .game-launch::before{content:'';width:0;height:0;border-top:4px solid transparent;border-bottom:4px solid transparent;border-left:6px solid currentColor;flex:none}
#selection .game-launch:hover:not(:disabled){background:linear-gradient(#b82b3b,#861a2b)}
#selection .game-launch:active:not(:disabled){transform:translateY(2px);box-shadow:0 1px 0 #34080e,inset 0 1px 2px #0005}
#selection .game-launch:disabled{background:#292b23;border-color:#5d604c;color:#b8bba9;box-shadow:none;cursor:default;font-size:12px;letter-spacing:0}
#selection .game-launch:disabled::before{display:none}
#selection .game-scores{grid-column:3;grid-row:1;justify-self:end;min-height:44px;padding:6px 0;border:0;background:none;color:#ffe430;font-size:14px;line-height:1.3;text-align:right;text-decoration:underline;text-underline-offset:4px}
#selection button:focus-visible,#selection a:focus-visible{outline:2px solid #fff3a8;outline-offset:3px}
.catalog-position{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip-path:inset(50%);white-space:nowrap}
#selection .save-note{font-size:13px;line-height:1.5;color:#b8b9ac;margin-top:22px}
#player-controls{scroll-margin-top:12px}
.cabinet:not(.expanded) .cabinet-base{background:#0c0e0a;color:#aaad9b;padding:12px 20px}
@media(max-width:950px){#selection .game-grid{grid-template-columns:repeat(2,minmax(0,1fr))}}
@media(max-width:700px){
 main:has(.cabinet:not(.expanded)){padding:0 12px 28px}.site-header{padding:12px 16px}
 .cabinet:not(.expanded){border-radius:18px}
 .cabinet:not(.expanded) .screen-bezel{padding:8px}
 .cabinet:not(.expanded) .screen{border-width:4px;border-radius:20px}
 #selection{padding:12px}
 #selection .selection-heading{column-gap:12px;row-gap:14px}
 #selection .selection-heading h2{font-size:23px}
 #selection .selection-heading .hall-link{max-width:150px}
 #selection .selection-heading .hall-link a{font-size:14px;white-space:normal;text-align:center}
 #selection .selection-heading .hall-link>span{font-size:12px}
 #selection .selection-heading .arcade-sort{grid-column:1;grid-row:2}
 #menu-sound{grid-column:2;grid-row:2;justify-self:end;align-self:end}
 #selection .game-grid{gap:12px}
 #selection .game-card .card-copy{padding:12px;gap:6px}
 #selection .game-card h3{font-size:18px}
 #selection .card-actions{gap:6px}
 #selection .game-card .game-launch{min-width:70px;padding:10px}
 #selection .game-scores{margin-left:auto}
 .cabinet:not(.expanded) .marquee h1{font-size:29px}
 .cabinet:not(.expanded) .marquee h1 img{width:86px}
 .cabinet:not(.expanded) .edition,.cabinet:not(.expanded) .marquee-note{font-size:12px;letter-spacing:.08em}
}
@media(max-width:559px){#selection .game-grid{grid-template-columns:minmax(0,1fr)}}
@media(max-width:379px){
 #selection .selection-heading .arcade-sort{grid-column:1/-1}
 #menu-sound{grid-column:1/-1;grid-row:3;justify-self:start}
}
@media(prefers-reduced-motion:reduce){#selection .game-card{transition:none}#selection .game-launch:active:not(:disabled){transform:none}}

/* Keep the live game above the catalog, with one iframe throughout browsing. */
.cabinet.playing:not(.expanded) #selection{border-top:1px solid #586479;scroll-margin-top:12px}
.cabinet.playing #selection,.cabinet.playing #selection *{-webkit-user-select:text;user-select:text;-webkit-touch-callout:default}
#selection .game-card[data-playing=true]{border-color:#ffe430;box-shadow:inset 0 0 0 1px #ffe43055}
#selection .playing-label{order:-1;align-self:flex-start;padding:4px 7px;border:1px solid #ffe43065;border-radius:4px;color:#ffe430;font-size:12px;font-weight:700;line-height:1.3}
#catalog-title:focus-visible{outline:2px solid #fff3a8;outline-offset:5px}

/* Illuminated marquee and coordinated lobby controls. Geometry stays unchanged. */
.cabinet:not(.expanded) .marquee{
 position:relative;isolation:isolate;
 background:radial-gradient(ellipse at 50% 0,#c09c3626,transparent 68%),linear-gradient(180deg,#27271b 0%,#15170f 40%,#10120d 100%);
 border-bottom-color:#b69a50;
 box-shadow:inset 0 1px 0 #fff1b56b,inset 0 -1px 0 #f2cb685c,inset 0 -8px 16px #b58c1712;
 color:#ffeb8a;
}
.cabinet:not(.expanded) .marquee::before{
 content:'';position:absolute;inset:5px 7px;z-index:-1;pointer-events:none;
 border:1px solid #b79d5866;border-radius:19px 19px 3px 3px;
 box-shadow:0 0 9px #efc75b1f,inset 0 1px 0 #fff3c321,inset 0 -1px 0 #0008;
}
.cabinet:not(.expanded) .marquee h1{color:#ffeb8a;text-shadow:0 1px 1px #000,0 0 18px #efc75b26}
.cabinet:not(.expanded) .marquee h1 img{filter:drop-shadow(0 1px 1px #000) drop-shadow(0 0 8px #e8c2501f)}
.cabinet:not(.expanded) .edition,.cabinet:not(.expanded) .marquee-note{color:#cbc4a5}
#selection .selection-heading .eyebrow{color:#c7bd92;text-shadow:none}
#selection .arcade-sort{color:#bdbca9}
#selection .arcade-sort select,#menu-sound,#selection .hall-link a{
 border-color:#77735b;background:linear-gradient(180deg,#22251c,#171a13);
 color:#e2deca;box-shadow:inset 0 1px 0 #f5edc50d,0 1px 2px #0005;
}
#selection .arcade-sort select:hover,#menu-sound:hover,#selection .hall-link a:hover{
 border-color:#b4a568;background:linear-gradient(180deg,#2b2e21,#1d2117);color:#fff0b2;
}
#selection .arcade-sort select:focus-visible,#menu-sound:focus-visible,#selection .hall-link a:focus-visible{
 outline:2px solid #fff3a8;outline-offset:3px;
}
#selection .arcade-sort option{background:#171a13;color:#e2deca}
#selection .hall-link>span{color:#b8b9ac}
/* End illuminated marquee and lobby controls. */

/* Recessed screen treatment: browsing chrome only, never the active player. */
.cabinet:not(.playing):not(.expanded):not(:fullscreen) .screen-bezel{
 padding:22px 28px 34px;
 background:linear-gradient(135deg,#41443d 0%,#232620 18%,#131610 55%,#080b07 82%,#30342a 100%);
 border-bottom:1px solid #72776280;
 box-shadow:inset 0 2px 0 #c6cab024,inset 0 -10px 14px #020402;
}
.cabinet:not(.playing):not(.expanded):not(:fullscreen) .screen{
 position:relative;isolation:isolate;border:8px solid #030603;border-radius:26px;background:#080a07;
 box-shadow:0 0 0 1px #92977b80,0 5px 0 #020402,0 12px 18px #000a,inset 0 0 0 1px #66705250;
}
/* Stationary glass stays on the rim while the catalogue moves beneath it. */
.cabinet:not(.playing):not(.expanded):not(:fullscreen) #selection::before,
.cabinet:not(.playing):not(.expanded):not(:fullscreen) #selection::after{display:none}
.cabinet:not(.playing):not(.expanded):not(:fullscreen) .screen::before,
.cabinet:not(.playing):not(.expanded):not(:fullscreen) .screen::after{
 content:'';position:absolute;inset:0;z-index:3;pointer-events:none;border-radius:18px;
}
.cabinet:not(.playing):not(.expanded):not(:fullscreen) .screen::before{
 background:linear-gradient(122deg,#ffffff0b,transparent 22%,transparent 80%,#e4ecc805);
 box-shadow:inset 0 2px 0 #dce1be24,inset 0 -5px 16px #000a,inset 0 0 32px #0005;
}
.cabinet:not(.playing):not(.expanded):not(:fullscreen) .screen::after{
 background:repeating-linear-gradient(to bottom,transparent 0,transparent 3px,#0000000a 3px,#0000000a 4px);
}
#selection:focus-visible{outline:2px solid #fff0a0;outline-offset:-4px}
/* Only roomy desktop browsing gets an inner scroll area. Starting a game
   removes every size bound through the existing .playing state. */
@media(min-width:1100px) and (min-height:850px){
 .cabinet:not(.playing):not(.expanded):not(:fullscreen){height:min(940px,calc(100svh - 130px));display:flex;flex-direction:column}
 .cabinet:not(.playing):not(.expanded):not(:fullscreen) .marquee,
 .cabinet:not(.playing):not(.expanded):not(:fullscreen) .cabinet-base{flex:none}
 .cabinet:not(.playing):not(.expanded):not(:fullscreen) .screen-bezel{flex:1;min-height:0;display:flex;flex-direction:column}
 .cabinet:not(.playing):not(.expanded):not(:fullscreen) .screen{flex:1;min-height:0;display:flex;flex-direction:column}
 .cabinet:not(.playing):not(.expanded):not(:fullscreen) #selection{
  flex:1;min-height:0;overflow-y:scroll;scrollbar-gutter:stable;scrollbar-width:auto;scrollbar-color:#a99c68 #12160f;
 }
 .cabinet:not(.playing):not(.expanded):not(:fullscreen) #selection::-webkit-scrollbar{width:13px}
 .cabinet:not(.playing):not(.expanded):not(:fullscreen) #selection::-webkit-scrollbar-track{background:#12160f;border-left:1px solid #65704444}
 .cabinet:not(.playing):not(.expanded):not(:fullscreen) #selection::-webkit-scrollbar-thumb{background:#a99c68;border:3px solid #12160f;border-radius:9px}
 .cabinet:not(.playing):not(.expanded):not(:fullscreen) #selection::-webkit-scrollbar-thumb:hover{background:#d5c77f}
}
@media(max-width:700px){
 .cabinet:not(.playing):not(.expanded):not(:fullscreen) .screen-bezel{padding:8px 8px 14px}
 .cabinet:not(.playing):not(.expanded):not(:fullscreen) .screen{border-width:4px;border-radius:20px}
}

/* Equal side tracks keep Sort games centered independently of the action widths. */
#selection .lobby-actions{display:contents}
@media(min-width:701px){#menu-sound{align-self:flex-start}}
@media(min-width:1050px){
 #selection .selection-heading{display:grid;grid-template-columns:minmax(0,1fr) 170px minmax(0,1fr);align-items:start}
 #selection .selection-heading>div:first-child{min-width:0;align-self:center}
 #selection .selection-heading .arcade-sort{margin:0;min-width:0}
 #selection .lobby-actions{display:flex;justify-content:flex-end;align-items:flex-start;gap:16px;min-width:0}
 #selection .lobby-actions .hall-link{flex:none}
}
@media(max-width:379px){
 #selection .selection-heading>div:first-child{grid-column:1/-1;grid-row:1}
 #selection .selection-heading .hall-link{grid-column:1/-1;grid-row:2;justify-self:start;align-items:flex-start;max-width:none}
 #selection .selection-heading .hall-link a{white-space:nowrap}
 #selection .selection-heading .arcade-sort{grid-row:3}
 #menu-sound{grid-row:4}
}
.cabinet:not(.expanded) .cabinet-base{gap:12px;flex-wrap:wrap}
