:root { --bg:#0f1226; --bg2:#171b3a; --panel:#1f2450; --txt:#f5f6ff; --mut:#a9aed6; --acc:#ffc247; --acc2:#7c5cff; --r:18px; --gap:12px; --u:96px; color-scheme:dark; }
:root[data-theme="light"] { --bg:#e9fbf6; --bg2:#d3f5ec; --panel:#ffffff; --txt:#13203a; --mut:#546080; --acc:#e8890c; --acc2:#5b3df5; color-scheme:light; }
* { box-sizing:border-box; -webkit-tap-highlight-color:transparent; }
html,body { margin:0; background:var(--bg); color:var(--txt); font-family:"Trebuchet MS","Segoe UI",system-ui,sans-serif; }
body { min-height:100vh; background:radial-gradient(1200px 600px at 10% -10%, var(--bg2), transparent), var(--bg); }
a { color:inherit; text-decoration:none; } button { font:inherit; color:inherit; cursor:pointer; }
.skip { position:absolute; left:-999px; } .skip:focus { left:8px; top:8px; background:#000; color:#fff; padding:8px 12px; z-index:99; border-radius:8px; }
.shell { display:grid; grid-template-columns:var(--u) 1fr; gap:var(--gap); padding:var(--gap); max-width:1480px; margin:0 auto; }
.rail { position:sticky; top:var(--gap); align-self:start; display:flex; flex-direction:column; gap:var(--gap); }
.brand { background:var(--panel); border-radius:var(--r); padding:10px 6px 6px; text-align:center; box-shadow:0 4px 0 #0003; }
.brand b { display:block; font-size:15px; line-height:1; letter-spacing:.5px; color:var(--acc); } .brand small { display:block; font-size:10px; color:var(--mut); margin-top:3px; }
.brand .row { display:flex; justify-content:space-around; margin-top:8px; border-top:1px solid #ffffff1a; padding-top:6px; }
.ib { background:none; border:0; font-size:20px; padding:4px 8px; border-radius:10px; } .ib:hover,.ib:focus-visible { background:#ffffff1a; outline:none; }
.rail .tile { width:var(--u); height:var(--u); }
.main { min-width:0; }
.chips { display:flex; gap:8px; overflow-x:auto; padding:2px 0 var(--gap); scrollbar-width:none; } .chips::-webkit-scrollbar { display:none; }
.chip { flex:none; background:var(--panel); padding:8px 14px; border-radius:999px; font-weight:700; font-size:14px; border:2px solid transparent; } .chip:hover { border-color:var(--acc2); } .chip[aria-current="page"] { background:var(--acc); color:#2b1700; }
h1 { font-size:22px; margin:6px 0 var(--gap); } h2 { font-size:18px; margin:22px 0 10px; }
.grid { display:grid; grid-template-columns:repeat(auto-fill, minmax(var(--u), 1fr)); grid-auto-rows:var(--u); grid-auto-flow:dense; gap:var(--gap); }
.tile { position:relative; display:flex; align-items:center; justify-content:center; border-radius:var(--r); overflow:hidden; background:linear-gradient(145deg, var(--c1), var(--c2)); box-shadow:0 4px 0 #0003; transition:transform .12s ease; isolation:isolate; }
.tile:hover,.tile:focus-visible { transform:translateY(-3px) scale(1.03); outline:3px solid #fff8; z-index:2; }
.tile .th { position:absolute; inset:0; width:100%; height:100%; object-fit:cover; z-index:-1; } .tile .pv { position:absolute; inset:0; width:100%; height:100%; object-fit:cover; z-index:0; opacity:0; transition:opacity .15s; pointer-events:none; } .tile .pv.on { opacity:1; } .tile:has(.pv.on) .nm { opacity:1; }
.tile .th + .em { display:none; }
.tile .em { font-size:calc(var(--u) * .5); filter:drop-shadow(0 3px 2px #0005); }
.tile.s2 { grid-column:span 2; grid-row:span 2; } .tile.s2 .em { font-size:calc(var(--u) * 1.1); }
.tile .nm { position:absolute; left:0; right:0; bottom:0; padding:14px 6px 5px; font-size:12px; font-weight:800; text-align:center; background:linear-gradient(transparent,#000b); color:#fff; opacity:0; transition:opacity .15s; }
.tile:hover .nm,.tile:focus-visible .nm,.tile.s2 .nm { opacity:1; } .tile.s2 .nm { font-size:16px; }
.tile .bd { position:absolute; top:6px; left:6px; background:#0008; color:#fff; font-size:10px; font-weight:800; padding:2px 6px; border-radius:8px; }
.empty { color:var(--mut); padding:30px 0; }
/* game page */
.stage { display:grid; grid-template-columns:minmax(0,1fr); gap:var(--gap); }
.player { background:#000; border-radius:var(--r); overflow:hidden; box-shadow:0 6px 0 #0003; }
.frame { position:relative; width:100%; height:min(84vh, 820px); min-height:460px; background:#0b0d1a; }
.frame iframe { position:absolute; inset:0; width:100%; height:100%; border:0; background:#0b0d1a; }
.frame { overflow:hidden; }
.frame.fs { position:fixed; inset:0; z-index:60; height:100%; border-radius:0; }
.loading { position:absolute; inset:0; display:flex; flex-direction:column; align-items:center; justify-content:center; gap:14px; background:linear-gradient(145deg, var(--c1), var(--c2)); z-index:1; transition:opacity .3s; }
.loading .em { font-size:84px; } .loading .lart { width:104px; height:104px; border-radius:24px; box-shadow:0 6px 18px #0006; } .loading.off { opacity:0; pointer-events:none; }
.loading .btn { font-size:18px; padding:12px 28px; }
.bar { display:flex; align-items:center; gap:12px; background:var(--panel); padding:10px 14px; }
.bar .ttl { font-weight:800; font-size:18px; flex:1; min-width:0; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; } .bar .ttl small { display:block; font-weight:400; font-size:12px; color:var(--mut); }
.btn { background:var(--acc); color:#2b1700; border:0; border-radius:12px; padding:8px 14px; font-weight:800; } .btn.ghost { background:#ffffff14; color:var(--txt); } .btn[aria-pressed="true"] { background:var(--acc2); color:#fff; }
.cols { display:grid; grid-template-columns:minmax(0,1fr); gap:var(--gap); margin-top:var(--gap); }
.card { background:var(--panel); border-radius:var(--r); padding:6px 18px 18px; } .card p, .card li { color:var(--mut); line-height:1.55; } .card h2:first-child { margin-top:14px; }
details { border-top:1px solid #ffffff1a; padding:10px 0; } summary { cursor:pointer; font-weight:700; } details p { margin:8px 0 0; }
.crumbs { font-size:13px; color:var(--mut); margin:2px 0 8px; } .crumbs a:hover { color:var(--acc); }
.note { font-size:12px; color:var(--mut); margin-top:10px; }
footer { max-width:1480px; margin:26px auto 30px; padding:0 var(--gap); color:var(--mut); font-size:13px; display:flex; gap:16px; flex-wrap:wrap; } footer a:hover { color:var(--acc); }
/* search */
.search { position:fixed; inset:0; background:#000c; z-index:70; display:none; align-items:flex-start; justify-content:center; padding:8vh 14px; } .search.on { display:flex; }
.search .box { background:var(--panel); border-radius:var(--r); padding:14px; width:min(640px,100%); max-height:80vh; overflow:auto; }
.search input { width:100%; font:inherit; font-size:18px; padding:12px 14px; border-radius:12px; border:2px solid var(--acc2); background:var(--bg); color:var(--txt); }
.search .res { display:grid; grid-template-columns:repeat(auto-fill, minmax(86px, 1fr)); grid-auto-rows:86px; gap:10px; margin-top:12px; } .search .res .tile { --u:86px; }
@media (max-width:770px) {
  :root { --u:78px; --gap:10px; }
  .shell { grid-template-columns:1fr; } .rail { position:static; flex-direction:row; align-items:center; } .rail .tile { display:none; }
  .brand { display:flex; align-items:center; gap:10px; padding:8px 12px; flex:1; text-align:left; } .brand .row { margin:0 0 0 auto; border:0; padding:0; }
  .frame { height:min(78vh, 720px); min-height:420px; }
  .bar { flex-wrap:wrap; } .bar .ttl { flex-basis:100%; }
}
@media (min-width:1100px) { .cols { grid-template-columns:minmax(0,1fr) 340px; } .stage.wide { grid-template-columns:minmax(0,1fr); } }
@media (prefers-reduced-motion:reduce) { * { transition:none !important; animation:none !important; } }

/* game page */
body.gp { background:radial-gradient(900px 520px at 50% -8%, color-mix(in srgb, var(--g1) 45%, transparent), transparent 70%), radial-gradient(700px 500px at 100% 100%, color-mix(in srgb, var(--g2) 30%, transparent), transparent 70%), var(--bg); }
body.gp .shell { grid-template-columns:var(--u) minmax(0,1fr); }
.side { display:none; }
.gp .player { max-width:1040px; margin:0 auto; width:100%; }
.gp .frame { height:clamp(480px, calc(100vh - 150px), 860px); }
.gicon.art { background:none; box-shadow:none; overflow:hidden; } .gicon.art img { width:100%; height:100%; display:block; border-radius:12px; } .gicon { flex:none; width:44px; height:44px; border-radius:12px; display:flex; align-items:center; justify-content:center; font-size:26px; background:linear-gradient(145deg, var(--c1), var(--c2)); box-shadow:0 2px 0 #0004; }
.loading .ltitle { font-size:26px; font-weight:800; text-shadow:0 2px 0 #0004; }
.prog { width:min(260px, 60%); height:10px; border-radius:999px; background:#0004; overflow:hidden; } .prog i { display:block; height:100%; width:6%; background:#fff; border-radius:999px; transition:width .4s ease; }
.strip { max-width:1040px; margin:var(--gap) auto 0; width:100%; } .strip h2 { margin-top:8px; }
.gp .cols { max-width:1040px; margin-left:auto; margin-right:auto; }
@media (min-width:1280px) {
  body.gp .shell { grid-template-columns:var(--u) minmax(0,1fr) calc(var(--u) * 2 + var(--gap)); }
  .side { display:block; align-self:start; position:sticky; top:var(--gap); } .side .grid { grid-template-columns:repeat(2, var(--u)); }
  .strip { display:none; }
}
@media (max-width:770px) { body.gp .shell { grid-template-columns:1fr; } .gp .frame { height:clamp(440px, calc(100vh - 170px), 760px); } .gp .player { border-radius:var(--r); } .gicon { display:none; } }

/* responsive system (modelled on the captured poki.com layout, see docs/RESPONSIVE-EVIDENCE.md):
   fixed 94 px cells with a 16 px gap, centred, and the number of columns steps with the viewport width.
   Phones use fluid cells (4 or 6 per row) instead of bleeding off the edge. */
:root { --u:94px; --gap:16px; --cols:6; --sl:max(var(--gap), env(safe-area-inset-left)); --sr:max(var(--gap), env(safe-area-inset-right)); }
.shell { max-width:none; width:calc(var(--cols) * var(--u) + (var(--cols) - 1) * var(--gap)); padding-left:0; padding-right:0; }
@media (min-width:771px)  { :root { --cols:7; } }
@media (min-width:991px)  { :root { --cols:9; } }
@media (min-width:1211px) { :root { --cols:11; }
  body.gp .shell { grid-template-columns:var(--u) minmax(0,1fr) calc(var(--u) * 2 + var(--gap)); }
  .side { display:block; align-self:start; position:sticky; top:var(--gap); } .side .grid { grid-template-columns:repeat(2, var(--u)); } .strip { display:none; } }
@media (min-width:1321px) { :root { --cols:12; } }
@media (min-width:1541px) { :root { --cols:14; } }
@media (min-width:1871px) { :root { --cols:17; } }
@supports (height:100dvh) { .gp .frame { height:clamp(480px, calc(100dvh - 150px), 860px); } .frame.fs { height:100dvh; } }
footer { max-width:none; width:calc(var(--cols) * var(--u) + (var(--cols) - 1) * var(--gap)); }
@media (max-width:770px) {
  :root { --gap:10px; --cols:6; --u:clamp(72px, calc((100vw - var(--sl) - var(--sr) - (var(--cols) - 1) * var(--gap)) / var(--cols)), 110px); }
  .shell, footer { width:100%; padding-left:var(--sl); padding-right:var(--sr); max-width:none; }
  /* top row like the original: brand tile followed by game tiles, swipeable */
  .rail { display:grid; grid-auto-flow:column; grid-auto-columns:var(--u); gap:var(--gap); overflow-x:auto; scrollbar-width:none; padding-bottom:2px; } .rail::-webkit-scrollbar { display:none; }
  .rail .tile { display:flex; width:var(--u); height:var(--u); }
  .brand { display:block; width:var(--u); height:var(--u); padding:8px 4px 0; text-align:center; } .brand .row { margin-top:6px; padding-top:2px; border-top:1px solid #ffffff1a; } .brand b { font-size:13px; }
  .gp .player { border-radius:0; margin-left:calc(-1 * var(--sl)); margin-right:calc(-1 * var(--sr)); width:auto; max-width:none; }
  .gp .frame { height:clamp(440px, calc(100vh - 190px), 760px); }
  @supports (height:100dvh) { .gp .frame { height:clamp(440px, calc(100dvh - 190px), 760px); } }
  .gp .cols, .strip { max-width:none; }
}
@media (max-width:565px) { :root { --cols:4; } }
/* phone held sideways: the game takes the whole screen height */
@media (orientation:landscape) and (max-height:520px) {
  .gp .rail, .gp .strip, .gp .crumbs, .gp .side { display:none; }
  body.gp .shell { grid-template-columns:minmax(0,1fr); width:100%; padding-left:var(--sl); padding-right:var(--sr); }
  .gp .player { max-width:none; margin-left:0; margin-right:0; }
  .gp .frame { height:calc(100vh - 64px); min-height:0; }
  @supports (height:100dvh) { .gp .frame { height:calc(100dvh - 64px); } }
}
@media (pointer:coarse) { .btn, .ib, .chip { min-height:44px; } .ib { min-width:44px; } }
.ib { min-width:40px; min-height:40px; } footer a { display:inline-block; padding:10px 2px; } footer { gap:4px 14px; }
/* blocks of tiles never touch: the "continue playing" row and any grid that follows another one keep the same gap as the tiles themselves */
#recent:not(:empty) { margin-bottom:var(--gap); } #recent h2 { margin-top:6px; } .grid + .grid { margin-top:var(--gap); }
/* legal pages */
.card h2 { font-size:17px; margin:22px 0 6px; } .card ul { padding-left:20px; } .card a:not(.btn) { color:var(--acc); text-decoration:underline; text-underline-offset:2px; }
.card .actions { display:flex; gap:10px; flex-wrap:wrap; } .card .actions .btn { padding:10px 16px; }
.card table { width:100%; border-collapse:collapse; margin:8px 0; font-size:14px; } .card th, .card td { text-align:left; padding:8px 10px; border-bottom:1px solid #ffffff1a; vertical-align:top; color:var(--mut); } .card th { color:var(--txt); } .card code { font-size:13px; background:#ffffff14; padding:1px 5px; border-radius:6px; }
@media (max-width:560px) { .card table, .card thead, .card tbody, .card tr, .card th, .card td { display:block; } .card thead { display:none; } .card tr { border-bottom:1px solid #ffffff1a; padding:6px 0; } .card td { border:0; padding:2px 0; } }

footer button { background:none; border:0; padding:0; color:inherit; font:inherit; cursor:pointer; } footer button:hover { color:var(--acc); }

.adslot{margin:16px 0;min-height:90px;text-align:center}
.alist{margin:.4em 0 1em;padding-left:1.2em}
.alist li{margin:.25em 0}
.about-home{margin-top:28px}
