:root{
  --bg:#080c1c; --bg-2:#0d1330; --card:#141b38; --card-2:#1b2447;
  --line:rgba(255,255,255,.09); --text:#eef2ff; --muted:#a7b0d0;
  --accent:#19c3a0; --gold:#ffd23f; --radius:18px;
  --font:system-ui,-apple-system,"Segoe UI",Tahoma,"Noto Sans Arabic",Arial,sans-serif;
}
*{box-sizing:border-box}
html,body{margin:0;padding:0}
body{
  background:
    radial-gradient(120% 60% at 50% -10%, #1d2a63 0%, transparent 60%),
    radial-gradient(90% 50% at 100% 0%, rgba(25,195,160,.14) 0%, transparent 55%),
    var(--bg);
  color:var(--text); font-family:var(--font); line-height:1.6;
  -webkit-text-size-adjust:100%;
  min-height:100dvh;
}
a{color:inherit}
img{max-width:100%}
.shell{max-width:820px;margin:0 auto;padding:14px 16px 40px}
.top{display:flex;align-items:center;justify-content:space-between;gap:12px;padding-block:8px 16px}
.brand{display:inline-flex;align-items:center;gap:10px;text-decoration:none;font-weight:800;font-size:20px;letter-spacing:.2px}
.brand-mark{width:34px;height:34px;display:grid;place-items:center;border-radius:11px;display:grid;place-items:center;
  background:linear-gradient(150deg,#7dfcd6,#19c3a0);color:#052a22;font-size:17px;box-shadow:0 4px 14px rgba(25,195,160,.35)}
.lang{display:inline-flex;align-items:center;gap:7px;text-decoration:none;font-weight:700;font-size:14px;
  border:1px solid var(--line);background:rgba(255,255,255,.05);border-radius:999px;padding:8px 14px;min-height:40px}
.lang:hover{background:rgba(255,255,255,.1)}
.lang svg{opacity:.9}
.chip{display:inline-flex;align-items:center;gap:6px}
.chip svg{color:var(--accent)}
.game-icon svg{display:block}
.ico svg{display:block}
.best-line{display:flex;align-items:center;gap:7px;margin:12px 0 0;color:var(--muted);font-size:13.5px}
.best-line svg{color:var(--gold);flex:0 0 auto}
.hero{padding-block:18px 22px}
.hero h1{margin:0 0 10px;font-size:clamp(27px,7.4vw,40px);line-height:1.22;letter-spacing:-.2px}
.hero p{margin:0;color:var(--muted);font-size:16.5px;max-width:56ch}
.chips{display:flex;flex-wrap:wrap;gap:8px;margin-top:16px}
.chip{font-size:13.5px;font-weight:700;color:#d7ddf5;background:rgba(255,255,255,.06);
  border:1px solid var(--line);border-radius:999px;padding:6px 12px}
.section-title{font-size:15px;font-weight:800;letter-spacing:.4px;text-transform:uppercase;color:var(--muted);margin:26px 0 12px}
.games{display:grid;gap:12px}
.game-card{display:flex;align-items:center;gap:14px;text-decoration:none;background:linear-gradient(160deg,var(--card),var(--card-2));
  border:1px solid var(--line);border-radius:var(--radius);padding:14px;transition:transform .12s ease,border-color .12s ease}
.game-card:hover{border-color:rgba(255,255,255,.2)}
.game-card:active{transform:scale(.99)}
.game-icon{flex:0 0 auto;width:58px;height:58px;border-radius:16px;display:grid;place-items:center;font-size:29px;
  background:rgba(255,255,255,.07);border:1px solid var(--line)}
.game-info{flex:1 1 auto;min-width:0}
.game-name{margin:0;font-size:18px;font-weight:800;display:flex;align-items:center;gap:8px;flex-wrap:wrap}
.game-blurb{margin:2px 0 0;color:var(--muted);font-size:14.5px}
.badge{font-size:11.5px;font-weight:800;padding:2px 8px;border-radius:999px;background:rgba(255,210,63,.16);
  color:var(--gold);border:1px solid rgba(255,210,63,.3)}
.play-pill{flex:0 0 auto;font-weight:800;font-size:14px;color:#052a22;background:linear-gradient(#7dfcd6,#19c3a0);
  border-radius:999px;padding:9px 16px;box-shadow:0 3px 0 #0b7a66}
.game-head h1{margin:6px 0 8px;font-size:clamp(25px,6.8vw,36px);line-height:1.25}
.game-head p{margin:0;color:var(--muted);font-size:16px;max-width:56ch}
#game{margin-top:18px}
.game-head.compact h1{margin:2px 0 6px;font-size:clamp(22px,5.6vw,30px)}
.game-head.compact + .own-wrap #game{margin-top:8px}
.how{background:rgba(255,255,255,.04);border:1px solid var(--line);border-radius:var(--radius);padding:16px 18px;margin-top:20px}
.how h2{margin:0 0 8px;font-size:16px;letter-spacing:.2px}
.how ul{margin:0;padding-inline-start:20px;color:#d5dcf3;font-size:15px}
.how li+li{margin-top:6px}
.more{display:grid;gap:10px;margin-top:8px}
.more a{display:flex;align-items:center;gap:12px;text-decoration:none;background:rgba(255,255,255,.04);
  border:1px solid var(--line);border-radius:14px;padding:10px 12px}
.more a span.ico{width:38px;height:38px;border-radius:11px;display:grid;place-items:center;background:rgba(255,255,255,.07);font-size:19px}
.more a span.txt{font-weight:700;font-size:15.5px}
.foot{margin-top:34px;padding-top:18px;border-top:1px solid var(--line);color:var(--muted);font-size:13.5px}
.foot a{color:#cfd6ef}
.foot nav{display:flex;gap:16px;margin-top:8px;flex-wrap:wrap}
.doc h1{font-size:clamp(24px,6.4vw,32px);margin:8px 0 4px}
.doc h2{font-size:18px;margin:22px 0 6px}
.doc p,.doc li{color:#d5dcf3;font-size:15.5px}
.doc ul{padding-inline-start:20px}
.updated{color:var(--muted);font-size:13.5px;margin:0 0 10px}
.ad{margin:16px 0;text-align:center}
.ad[hidden]{display:none}
/* ad space: invisible 300x250 reservation so nothing shifts when the ad arrives, collapsed after ~2s if it never does */
.ad-slot{position:relative;display:flex;flex-direction:column;justify-content:center;align-items:center;gap:5px;
  max-width:100%;margin:18px auto;overflow:hidden}
/* the label is what stops the slot reading as one more card in the grid */
.ad-slot::before{content:'إعلان';font-size:10.5px;font-weight:800;letter-spacing:.06em;color:var(--muted);line-height:1}
html[lang="en"] .ad-slot::before{content:'Ad'}
.ad-slot[hidden]{display:none!important}
.ad-slot iframe{display:block;border:0;max-width:100%}
.ad-slot[data-adsterra="square"]{width:300px;min-height:250px}
.ad-slot[data-adsterra="square"] iframe{width:300px;height:250px}
.cat-grid>.ad-slot{grid-column:1/-1;margin:6px auto}
/* the labelled slot takes its whole row, so it reads as a banner row and not as one more card */
.ad-slot::before{width:100%;text-align:center}
main.own-page .ad-slot[data-adsterra="square"],.cat-grid>.ad-slot[data-adsterra="square"]{width:100%}
@media (min-width:640px){
  .shell{padding:20px 24px 60px}
  .games{grid-template-columns:1fr 1fr}
  .more{grid-template-columns:1fr 1fr}
  .game-card{height:100%}
}
@media (prefers-reduced-motion:reduce){*{transition:none!important;animation:none!important}}

/* --- catalog + network game pages --- */
.search-row{margin:14px 0 10px}
.search{width:100%;font:inherit;font-size:16px;color:var(--text);background:rgba(255,255,255,.06);
  border:1px solid var(--line);border-radius:14px;padding:12px 14px;min-height:46px;outline:none}
.search::placeholder{color:#8b95bb}
.search:focus{border-color:rgba(125,252,214,.5)}
.chips-scroll{overflow-x:auto;flex-wrap:nowrap;padding-bottom:6px;-webkit-overflow-scrolling:touch;scrollbar-width:none}
.chips-scroll::-webkit-scrollbar{display:none}
.chip-btn{font:inherit;font-size:13.5px;font-weight:700;color:#d7ddf5;background:rgba(255,255,255,.06);
  border:1px solid var(--line);border-radius:999px;padding:8px 14px;white-space:nowrap;cursor:pointer}
.chip-btn.on{background:linear-gradient(#7dfcd6,#19c3a0);color:#052a22;border-color:transparent}
.cat-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:10px;margin-top:6px}
.cat-card{display:flex;flex-direction:column;text-decoration:none;background:linear-gradient(160deg,var(--card),var(--card-2));
  border:1px solid var(--line);border-radius:14px;overflow:hidden;min-width:0}
.cat-card[hidden]{display:none}
.cat-card:active{transform:scale(.99)}
.cat-card{position:relative}
.cat-mb{position:absolute;top:6px;inset-inline-end:6px;background:rgba(6,10,26,.82);color:#ffd9a8;font-size:11px;font-weight:800;
  padding:3px 7px;border-radius:999px;border:1px solid rgba(255,217,168,.35);pointer-events:none}
.play-heavy{margin:10px 0 0;font-size:13.5px;font-weight:700;color:#ffd9a8;background:rgba(255,183,3,.1);
  border:1px solid rgba(255,183,3,.3);border-radius:12px;padding:9px 12px}
.heavy-ov{position:absolute;inset:0;z-index:3;display:flex;flex-direction:column;justify-content:flex-end;gap:8px;
  padding:16px;background:linear-gradient(180deg,rgba(5,8,20,.15),rgba(5,8,20,.94) 58%);text-align:center}
.heavy-ov p{margin:0;font-size:13.5px;line-height:1.5;color:#dfe6ff}
.hv-size{font-weight:800;color:#ffd9a8 !important;font-size:14.5px !important}
.cat-thumb{display:block;aspect-ratio:1/1;background:#0b1024;overflow:hidden}
.cat-thumb img{width:100%;height:100%;object-fit:cover;display:block}
.cat-name{font-size:13.5px;font-weight:800;padding:8px 10px 0;line-height:1.3;
  display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;overflow:hidden}
.cat-tag{font-size:11.5px;color:var(--muted);padding:3px 10px 10px}
.more-link{margin:14px 0 0;text-align:center;font-weight:800;font-size:15px}
.more-link a{color:#7dfcd6;text-decoration:none}
.empty{color:var(--muted);text-align:center;padding:22px 0}
.cat-line{margin:0;color:var(--muted);font-size:14px}
.cat-line a{color:#7dfcd6;text-decoration:none}
.play-wrap{--ar:1.6;position:relative;margin:16px 0 0;border-radius:var(--radius);overflow:hidden;width:100%;
  border:1px solid var(--line);background:#000;aspect-ratio:var(--ar);max-height:82vh}
.play-thumb{width:100%;height:100%;object-fit:cover;display:block;opacity:.55}
.play-wrap.playing .play-thumb{display:none}
.play-btn{position:absolute;inset:0;margin:auto;height:52px;width:max-content;display:inline-flex;align-items:center;gap:9px;
  font:inherit;font-size:16px;font-weight:800;color:#052a22;background:linear-gradient(#7dfcd6,#19c3a0);
  border:0;border-radius:999px;padding:0 26px;box-shadow:0 4px 0 #0b7a66;cursor:pointer}
.play-btn svg{fill:currentColor}
.play-frame{position:absolute;inset:0;width:100%;height:100%;border:0;display:block;background:#000}
.fs-btn{position:absolute;top:8px;left:8px;z-index:3;display:inline-flex;align-items:center;gap:6px;font:inherit;
  font-size:12.5px;font-weight:800;color:#052a22;background:rgba(125,252,214,.94);border:0;border-radius:999px;
  padding:8px 12px;min-height:34px;cursor:pointer;box-shadow:0 2px 8px rgba(0,0,0,.35)}
.fs-btn[hidden]{display:none}
.fs-btn svg{flex:0 0 auto}
.play-wrap:fullscreen,.play-wrap:-webkit-full-screen{width:100vw;height:100vh;max-height:none;aspect-ratio:auto;
  border:0;border-radius:0;margin:0;background:#000}
.play-hint{color:var(--muted);font-size:13px;margin:8px 0 0}
.frame-fail{position:absolute;inset:0;z-index:4;display:flex;flex-direction:column;justify-content:center;gap:8px;
  padding:18px 16px;background:rgba(7,12,32,.94);text-align:center}
.frame-fail[hidden]{display:none}
.ff-title{margin:0;font-size:15.5px;font-weight:800;color:#fff;line-height:1.35}
.ff-body{margin:0;font-size:13px;color:var(--muted);line-height:1.5}
.ff-actions{display:flex;flex-wrap:wrap;gap:8px;justify-content:center;margin:4px 0 0}
.ff-btn{display:inline-block;padding:9px 14px;border-radius:999px;background:#7dfcd6;color:#062018;
  font-weight:800;font-size:13px;text-decoration:none}
.ff-btn.ghost{background:transparent;color:#cfe3ff;border:1px solid rgba(207,227,255,.35)}
.play-note{color:var(--muted);font-size:13.5px;margin:10px 0 0}
.play-note a{color:#7dfcd6;font-weight:700}
.desc-en{color:#d5dcf3;font-size:15px;margin:0}
.provider{color:var(--muted);font-size:12.5px;margin:20px 0 0}
.provider a{color:#cfd6ef}
@media (max-width:639px){
  .play-wrap{margin-inline:-16px;width:calc(100% + 32px);border-radius:0;border-inline:0}
}
@media (min-width:640px){
  .cat-grid{grid-template-columns:repeat(3,minmax(0,1fr));gap:12px}
  .play-wrap{max-height:none}
  .chips-scroll{flex-wrap:wrap;overflow:visible}
}
.how-list{margin:0;padding-inline-start:20px}
.how-list li+li{margin-top:5px}
.how .desc-en{font-size:14.5px;line-height:1.55}

/* --- crumbs, facts, 404, recent --- */
.crumbs{margin:0 0 4px;font-size:13px;color:var(--muted)}
.crumbs a{color:#7dfcd6;text-decoration:none}
.facts{display:grid;grid-template-columns:1fr 1fr;gap:10px 14px;margin:10px 0 0}
.facts div{background:rgba(255,255,255,.04);border:1px solid var(--line);border-radius:12px;padding:9px 12px;min-width:0}
.facts dt{font-size:11.5px;font-weight:800;letter-spacing:.3px;text-transform:uppercase;color:var(--muted)}
.facts dd{margin:2px 0 0;font-size:14.5px;font-weight:700}
.err{padding-top:8px}
.doc .err-code{margin:0;font-size:clamp(64px,22vw,120px);font-weight:900;line-height:1;letter-spacing:-2px;
  background:linear-gradient(150deg,#7dfcd6,#19c3a0 60%,#4d8dff);-webkit-background-clip:text;background-clip:text;color:transparent}
.err-actions{display:flex;gap:10px;flex-wrap:wrap;margin:16px 0 0}
.btn{display:inline-flex;align-items:center;justify-content:center;min-height:44px;padding:0 20px;border-radius:999px;
  font-weight:800;font-size:15px;text-decoration:none;color:#052a22;background:linear-gradient(#7dfcd6,#19c3a0);box-shadow:0 3px 0 #0b7a66}
.btn.ghost{background:rgba(255,255,255,.06);color:var(--text);border:1px solid var(--line);box-shadow:none}
.err-en{color:var(--muted);font-size:14px;margin-top:14px}
.recent-ico{display:grid;place-items:center;color:var(--c,#19c3a0);background:rgba(255,255,255,.06)}
.cat-thumb img[data-src]{opacity:0}
.cat-thumb img{transition:opacity .18s ease}

/* --- actions, favorites, loader --- */
.hero-actions{display:flex;gap:10px;flex-wrap:wrap;margin:16px 0 0}
.hero-actions .btn{min-height:46px;font-size:15px}
.back-pill{display:inline-flex;align-items:center;gap:6px;min-height:40px;padding:0 14px 0 10px;margin:0 0 10px;
  border-radius:999px;background:rgba(255,255,255,.06);border:1px solid var(--line);text-decoration:none;
  font-size:13.5px;font-weight:700;color:#cfd6ef}
.back-pill svg{opacity:.85}
.head-actions{margin:12px 0 0}
/* Phones: the two page actions are a plain row in the page, not a bar floating over the content, so
   they never cover a line of text or the game itself. */
@media (max-width:639px){
  .head-actions{display:flex;gap:8px;margin:14px 0 0}
  .head-actions .fav-btn{flex:1 1 0;justify-content:center;min-height:44px}
}

.fav-btn{display:inline-flex;align-items:center;gap:7px;min-height:42px;padding:0 16px;border-radius:999px;cursor:pointer;
  font:inherit;font-size:14px;font-weight:800;color:#cfd6ef;background:rgba(255,255,255,.06);border:1px solid var(--line)}
.fav-btn svg{color:#ff8fab}
.fav-btn.on{background:rgba(255,143,171,.16);border-color:rgba(255,143,171,.45);color:#ffd0dc}
.chip-btn{min-height:40px;display:inline-flex;align-items:center}
.loader{position:absolute;inset:0;display:grid;place-items:center;background:rgba(5,10,30,.55);z-index:2}
.spin{width:36px;height:36px;border-radius:50%;border:3px solid rgba(255,255,255,.22);border-top-color:#7dfcd6;
  animation:spin .8s linear infinite;display:block}
@keyframes spin{to{transform:rotate(360deg)}}
@media (prefers-reduced-motion:reduce){.spin{animation:none;border-top-color:#7dfcd6}}

/* --- pagination --- */
.pager{display:flex;align-items:center;gap:8px;flex-wrap:wrap;margin:20px 0 0;justify-content:center}
.pg{min-height:40px;min-width:40px;display:inline-flex;align-items:center;justify-content:center;border-radius:12px;
  border:1px solid var(--line);background:rgba(255,255,255,.05);text-decoration:none;font-weight:700;font-size:14px;padding:0 10px}
.pg.on{background:linear-gradient(#7dfcd6,#19c3a0);color:#052a22;border-color:transparent}
.pg.wide{padding:0 14px}
.pg-nums{display:flex;gap:6px;flex-wrap:wrap;justify-content:center}

/* long-form content on our own game pages */
.lede{font-size:16.5px;line-height:1.75;color:#dfe5f8}
.faq-q{font-size:15.5px;font-weight:800;margin:16px 0 4px;color:#fff}
.faq-a{margin:0 0 6px;font-size:15px;line-height:1.7;color:#d5dcf3}

/* --- our own games: fullscreen frame --- */
.own-wrap{position:relative}
.own-wrap.fs-active{background:#080c1c;display:flex;align-items:center;justify-content:center;overflow:hidden}
.own-wrap:fullscreen,.own-wrap:-webkit-full-screen{background:#080c1c;display:flex;align-items:center;justify-content:center;overflow:hidden;width:100%;height:100%;padding:0;margin:0}
.own-wrap.fs-fake{position:fixed;inset:0;z-index:9999;background:#080c1c}
.own-wrap.fs-active #game{flex:0 0 100%;width:100%;transform-origin:center center}
.fs-exit{display:none;position:absolute;top:8px;right:8px;z-index:40;width:38px;height:38px;border-radius:50%;
  border:1px solid rgba(255,255,255,.25);background:rgba(8,12,28,.8);color:#fff;font-size:15px;line-height:1;cursor:pointer;align-items:center;justify-content:center}
.own-wrap:fullscreen .fs-exit,.own-wrap:-webkit-full-screen .fs-exit,.own-wrap.fs-fake .fs-exit{display:flex}
body.fs-lock{overflow:hidden}
/* short screens (phone browser with the address bar showing): keep the whole play area in view */
@media (max-height:640px){
  #game .pt-area{min-height:210px}
  #game .pi-keys{min-height:150px}
  #game .dr-pad{min-height:48px}
}
/* fullscreen: the game takes the full width and keeps its natural height; the rest of the screen
   is background instead of the game shrinking into a small box in the middle. The stage is sized
   from the screen height so it never overflows, and it is never scaled with a transform. */
.own-wrap.fs-active #game,.own-wrap:fullscreen #game,.own-wrap:-webkit-full-screen #game,.own-wrap.fs-fake #game{width:100%;height:100%;display:flex;align-items:center;justify-content:center;transform:none !important}
.own-wrap.fs-active #game .gs,.own-wrap:fullscreen #game .gs,.own-wrap.fs-fake #game .gs{max-width:none !important;width:100% !important;height:auto !important;padding:8px !important;margin:0 !important}
.own-wrap.fs-active #game .gs-stage,.own-wrap:fullscreen #game .gs-stage,.own-wrap.fs-fake #game .gs-stage{width:min(100%,calc((100vh - 16px) * 9 / 16)) !important;height:auto !important;max-height:none !important;aspect-ratio:9/16 !important;margin:0 auto !important;border-radius:14px !important}

/* fullscreen: use the height a phone gives us instead of leaving it empty */
.own-wrap.fs-active #game .pi-keys{height:auto}
.own-wrap.fs-active #game .pt-area{height:min(74vh,720px)}
.own-wrap.fs-active #game .dr-pad{height:min(18vh,110px)}

/* desktop: the game keeps the right column and the text column gets a short row of related
   games under the instructions, so the space beside a tall game is not left empty. */
.own-more{display:none}
@media (min-width:900px){
  main.own-page{display:grid;grid-template-columns:minmax(0,440px) minmax(0,1fr);gap:14px 36px;align-items:start}
  main.own-page .own-wrap{grid-column:1;grid-row:1 / span 5;position:sticky;top:16px}
  main.own-page .game-head{grid-column:2;grid-row:1}
  main.own-page .ad-slot{grid-column:2;grid-row:3;justify-self:center;align-self:start}
  main.own-page .own-more{display:block;grid-column:2;grid-row:2}
  main.own-page .own-more .section-title{margin:4px 0 10px}
  main.own-page .own-more .cat-grid{grid-template-columns:repeat(2,minmax(0,1fr));gap:12px;max-width:420px}
  main.own-page .how{grid-column:2}
  main.own-page > h2, main.own-page > .cat-grid, main.own-page > .chips{grid-column:1 / -1}
}

/* On a laptop the game column was 440px, so the instruments sat as a phone-sized card with dead
   space under them. Give the column more room and let the three instruments fill it. */
@media (min-width:1100px){
  main.own-page{grid-template-columns:minmax(0,560px) minmax(0,1fr)}
  main.own-page .pi-wrap,main.own-page .od-wrap,main.own-page .dr-wrap{max-width:100%}
  main.own-page .pi-keys{height:auto}
  main.own-page .dr-pad{height:min(15vh,104px)}
}

/* Every game stage inside our own game pages is capped by the space left under the page header,
   so the play area never runs past the fold on a phone or a laptop. */
#game [class$="-stage"]{max-height:calc(100vh - 360px)}
@media (min-width:900px){#game [class$="-stage"]{max-height:calc(100vh - 200px)}}
@media (max-width:420px){#game [class$="-stage"]{max-height:calc(100vh - 320px)}}

/* games hub (/games/): the educational group above the full grid */
.hub-list{display:grid;gap:12px;margin:8px 0 4px}
.hub-item{display:flex;flex-direction:column;padding:16px;border-radius:18px;text-decoration:none;color:inherit;
  background:linear-gradient(160deg,var(--card),var(--card-2));border:1px solid var(--line)}
.hub-item h2{margin:0 0 6px;font-size:19px;color:var(--text)}
.hub-item p{margin:0 0 10px;color:var(--muted);font-size:14.5px;line-height:1.75}
.hub-go{margin-top:auto;align-self:flex-start;display:inline-flex;align-items:center;min-height:38px;padding:0 18px;border-radius:999px;
  font-weight:800;font-size:14px;color:#052a22;background:linear-gradient(#7dfcd6,#19c3a0)}
@media(min-width:900px){.hub-list{grid-template-columns:repeat(3,minmax(0,1fr))}}
.hub-page{max-width:980px;margin:0 auto;padding:0 14px}
@media(min-width:900px){.hub-page .cat-grid{grid-template-columns:repeat(4,minmax(0,1fr));gap:12px}}
/* game pages and the games hub get a wider shell on a laptop: the text column was 176px beside a
   560px game, which is a column of single words rather than an article. */
@media (min-width:900px){.shell.wide{max-width:1040px}}
@media (min-width:1100px){.shell.wide{max-width:1180px}}

/* fullscreen for wide games (the piano): the stage takes the whole screen instead of a
   portrait column, so a landscape phone or a laptop gets a full-width keyboard. */
.own-wrap.fs-wide.fs-active #game .gs,
.own-wrap.fs-wide:fullscreen #game .gs,
.own-wrap.fs-wide:-webkit-full-screen #game .gs,
.own-wrap.fs-wide.fs-fake #game .gs{height:100% !important;padding:0 !important;max-width:none !important}
.own-wrap.fs-wide.fs-active #game .gs-stage,
.own-wrap.fs-wide:fullscreen #game .gs-stage,
.own-wrap.fs-wide:-webkit-full-screen #game .gs-stage,
.own-wrap.fs-wide.fs-fake #game .gs-stage{width:100% !important;height:100% !important;aspect-ratio:auto !important;max-height:none !important;border-radius:0 !important}
.own-wrap.fs-wide.fs-active #game .pi-keys,
.own-wrap.fs-wide:fullscreen #game .pi-keys,
.own-wrap.fs-wide:-webkit-full-screen #game .pi-keys,
.own-wrap.fs-wide.fs-fake #game .pi-keys{inset:52px 10px 64px}

@media (min-aspect-ratio:1/1){
  .own-wrap.fs-wide.fs-active #game .pi-keys,
  .own-wrap.fs-wide:fullscreen #game .pi-keys,
  .own-wrap.fs-wide:-webkit-full-screen #game .pi-keys,
  .own-wrap.fs-wide.fs-fake #game .pi-keys{top:0;bottom:0;height:min(calc(100% - 116px),calc((100vw - 20px)/16*6.5));margin:auto 0}
}
.own-wrap.fs-active #game .gs-hud,
.own-wrap:fullscreen #game .gs-hud,
.own-wrap:-webkit-full-screen #game .gs-hud,
.own-wrap.fs-fake #game .gs-hud{padding-right:48px !important}

@media (max-width:420px){
  #game .pi-foot{gap:4px}
  #game .pi-mini{padding:4px 6px;font-size:11px}
  #game .pi-oct{min-width:28px;font-size:11px}
}

/* phones: the two action buttons stay on one line and take less room, so the game itself
   gets the space instead of the header */
@media (max-width:520px){
  .own-page .head-actions{gap:6px;margin-top:10px}
  .own-page .fav-btn{white-space:nowrap;font-size:12.5px;padding:8px 12px;gap:6px}
}

@media (max-width:520px){
  .own-page .game-head h1{font-size:22px;line-height:1.22;margin:0 0 4px}
  .own-page .game-head p:not(.head-actions){display:none}
  .own-wrap:not(.fs-wide) #game .gs-stage{width:100% !important;height:auto !important;aspect-ratio:3/4 !important;max-height:none !important}
}
