:root{color-scheme:dark;--bg:#0b0f14;--panel:#141b24;--line:#243040;--fg:#e6edf5;--muted:#9fb0c3;--hdr:52px;--gh:max(620px,calc(100vh - var(--hdr) - 20px))}
@supports (height:100dvh){:root{--gh:max(620px,calc(100dvh - var(--hdr) - 20px))}}
*{box-sizing:border-box}
html,body{margin:0}
body{background:var(--bg);color:var(--fg);font:16px/1.6 system-ui,-apple-system,"Segoe UI",Roboto,sans-serif}
a{color:#7db4ff}
.top{height:var(--hdr);display:flex;align-items:center;justify-content:space-between;gap:12px;padding:0 16px;border-bottom:1px solid var(--line)}
.top .l{display:flex;align-items:center;gap:10px;min-width:0}
.top a.brand{color:var(--fg);text-decoration:none;font-weight:800;font-size:18px;letter-spacing:.2px;white-space:nowrap}
.top a.brand:hover{color:#fff;text-decoration:underline}
.top .sep{color:var(--line);font-size:20px}
.top h1{margin:0;font-size:16px;font-weight:700;color:var(--muted);white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.btn{height:34px;padding:0 14px;border:1px solid var(--line);border-radius:10px;background:var(--panel);color:var(--fg);font:600 14px system-ui,sans-serif;cursor:pointer}
.btn:hover{border-color:#3a4a5e}
.btn:focus-visible{outline:3px solid #1f66e8;outline-offset:2px}
.btn[hidden]{display:none}
.top .r{display:flex;align-items:center;gap:8px;flex:none}
.btn.ib{display:inline-flex;align-items:center;justify-content:center;width:38px;padding:0;text-decoration:none}

/* row: ad | content | ad */
.stage{display:flex;justify-content:center;align-items:center;gap:20px;padding:10px 16px;min-height:calc(var(--gh) + 20px)}
.game{flex:none;height:var(--gh);width:min(100%,max(380px,calc((var(--gh) - 150px) * .5625 + 40px)));border:0;border-radius:14px;background:#000;display:block}
/* wide (landscape) game such as Racing Simulator: fills the space between the ad columns */
.game.land{flex:1 1 0;min-width:0;width:auto;max-width:calc(var(--gh) * 1.8)}

/* home page: the two games sit right at the top */
.stage.home{align-items:flex-start;min-height:0;padding-top:12px}
.homemain{flex:1 1 0;min-width:0;max-width:900px}
.hero h1{margin:0;font-size:clamp(26px,3.6vw,34px);line-height:1.15;letter-spacing:.2px}
.hero p{margin:4px 0 12px;color:#c9d5e2}
.cards{display:grid;grid-template-columns:repeat(auto-fit,minmax(280px,1fr));gap:18px}
.card{display:flex;flex-direction:column;background:var(--panel);border:1px solid var(--line);border-radius:16px;overflow:hidden;text-decoration:none;color:inherit;transition:transform .15s,border-color .15s,box-shadow .15s}
.card:hover{transform:translateY(-3px);border-color:#3a6fd8;box-shadow:0 10px 30px rgba(0,0,0,.45)}
.card:focus-visible{outline:3px solid #1f66e8;outline-offset:3px}
.card img,.card video{display:block;width:100%;height:auto;aspect-ratio:1/1;object-fit:cover;background:#000}
/* the title picture is always there; the preview video fades in over it only once it is really playing, so a video that cannot play (an iPad in Low Power Mode, say) never shows as a black box */
.card .shot{display:block;position:relative;width:100%;aspect-ratio:1/1;background:#0b0f14;overflow:hidden}
.card .shot img,.card .shot video{position:absolute;inset:0;width:100%;height:100%;aspect-ratio:auto;background:transparent}
.card .shot video{opacity:0;transition:opacity .2s}
.card .shot video.on{opacity:1}
.card .body{display:flex;flex-direction:column;gap:6px;padding:12px 16px 14px;flex:1}
.card h2{margin:0;font-size:22px;line-height:1.2}
.card p{margin:0;color:#c9d5e2;font-size:15px;line-height:1.5;flex:1}
.card .play{align-self:flex-start;margin-top:6px;padding:7px 18px;border-radius:999px;background:#1f66e8;color:#fff;font-weight:700;font-size:15px}
.card:hover .play{background:#3a7bff}
.tags{display:flex;flex-wrap:wrap;gap:6px;margin-top:2px}
.tags span{font-size:12px;padding:2px 9px;border:1px solid var(--line);border-radius:999px;color:var(--muted)}

/* below 900px wide: no side columns, one box under the content */
@media (max-width:899px){
 .stage{display:block;padding:0;min-height:0}
 .stage.home{padding:16px 16px 0}
 .game{width:100%;height:max(560px,calc(100vh - var(--hdr)));border-radius:0}
 @supports (height:100dvh){.game{height:max(560px,calc(100dvh - var(--hdr)))}}
 .game.land{width:100%;max-width:none;height:max(340px,calc(100vh - var(--hdr)))}
 @supports (height:100dvh){.game.land{height:max(340px,calc(100dvh - var(--hdr)))}}
}
@media (max-width:560px){.top .sep,.top h1{display:none}}
@media (max-height:480px) and (max-width:899px){:root{--hdr:42px}.top{padding:0 12px}.btn{height:30px}}

/* text under the game */
.info{max-width:760px;margin:0 auto;padding:28px 16px 8px}
.info h2{font-size:20px;margin:28px 0 8px}
.info h2:first-child{margin-top:0}
.info p{margin:0 0 12px;color:#c9d5e2}
.keys{width:100%;border-collapse:collapse;margin:8px 0 4px;font-size:15px}
.keys th,.keys td{text-align:left;padding:8px 10px;border-bottom:1px solid var(--line);vertical-align:top}
.keys th{width:38%;color:var(--muted);font-weight:600}
kbd{display:inline-block;min-width:24px;padding:1px 7px;border:1px solid #3a4a5e;border-bottom-width:2px;border-radius:6px;background:var(--panel);font:600 13px ui-monospace,Menlo,Consolas,monospace;text-align:center}
.more{display:flex;flex-wrap:wrap;gap:10px;margin-top:10px}
.more a.btn{display:inline-flex;align-items:center;height:40px;text-decoration:none}
footer{max-width:760px;margin:24px auto 0;padding:18px 16px 36px;border-top:1px solid var(--line);color:var(--muted);font-size:14px}
footer a{margin-right:14px}
.btn.lk{display:inline-flex;align-items:center;text-decoration:none}
.btn.big{height:44px;padding:0 20px;font-size:16px;background:#1f66e8;border-color:#1f66e8;color:#fff}
.btn.big:hover{background:#3a7bff;border-color:#3a7bff}
details{border-bottom:1px solid var(--line);padding:2px 0}
summary{cursor:pointer;padding:10px 0;font-weight:600;list-style-position:inside}
summary:focus-visible{outline:3px solid #1f66e8;outline-offset:2px;border-radius:6px}
details p{margin:0 0 12px;padding-left:2px}

/* home page: the Play offline icon in the top right, and the box that opens under it */
.top{position:relative}
.btn.dlh{display:inline-flex;align-items:center;gap:7px;border-color:#3a6fd8}
.btn.dlh.done{border-color:#2f9e5b;color:#8fe0b0}
.btn.dl,.btn.dlh.busy{background:linear-gradient(90deg,#1f66e8 var(--p,0%),var(--panel) var(--p,0%))}
.btn.dlh.busy{cursor:progress}
.btn.dlh[hidden],.btn.dl[hidden]{display:none}
.btn.dl{display:inline-flex;align-items:center;gap:8px;height:42px;padding:0 18px;font-size:15px;border-color:#3a6fd8}
.btn.dl:hover:not(:disabled){background:#1f66e8;border-color:#3a7bff}
.btn.dl.busy{cursor:progress}
.btn.dl.done{background:var(--panel);border-color:#2f9e5b;color:#8fe0b0;cursor:default}
.btn.dl:disabled{opacity:1}
.pop{position:absolute;top:calc(100% + 8px);right:16px;z-index:30;width:min(340px,calc(100vw - 32px));padding:14px;background:var(--panel);border:1px solid #3a4a5e;border-radius:14px;box-shadow:0 14px 40px rgba(0,0,0,.55)}
.pop[hidden]{display:none}
.pop .note{margin:10px 0 0;color:#c9d5e2;font-size:14px;line-height:1.5}
.pop .note[hidden]{display:none}
@media (max-width:560px){#dlopenlabel{display:none}.btn.dlh{width:38px;padding:0;justify-content:center}}

/* full screen: the game fills the whole screen. The Exit button is hidden until the player taps close to the top right
   corner of the game (corner.js tells site.js), then it shows for a few seconds. */
.exitfs{display:none}
.stage:fullscreen{display:block;padding:0;gap:0;min-height:0;background:#000}
.stage:fullscreen .game,.stage:fullscreen .game.land{display:block;width:100%;max-width:none;height:100%;margin:0;border-radius:0}
.stage:fullscreen .exitfs{display:inline-flex;align-items:center;justify-content:center;gap:7px;position:absolute;top:max(8px,env(safe-area-inset-top));right:max(8px,env(safe-area-inset-right));z-index:5;height:38px;padding:0 14px;border:1px solid rgba(255,255,255,.35);border-radius:10px;background:rgba(14,19,26,.92);color:#fff;font:600 14px system-ui,sans-serif;cursor:pointer;opacity:0;visibility:hidden;transition:opacity .15s,visibility .15s}
.stage:fullscreen .exitfs.show{opacity:1;visibility:visible}
.stage:fullscreen .exitfs:hover{background:#1f66e8;border-color:#fff}
.exitfs:focus-visible{outline:3px solid #1f66e8;outline-offset:2px}
