/* standalone site */
:root { --ds-page: #120d2e; --ds-ink: #fff; --ds-ink-2: #d6d1f5; --ds-hairline: rgba(255,255,255,.15); }
*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; }
body { font-family: 'Cairo', system-ui, -apple-system, 'Segoe UI', Tahoma, sans-serif; color: #fff; background-color: #120d2e; background-image: radial-gradient(900px 500px at 15% -10%, rgba(90,40,200,.35), transparent), radial-gradient(800px 500px at 100% 0%, rgba(255,46,147,.2), transparent); background-attachment: fixed; -webkit-tap-highlight-color: transparent; line-height: 1.5; }
button, input { font-family: inherit; }
.site-head { position: sticky; top: 0; z-index: 10; display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 16px; background: rgba(18, 13, 46, .82); backdrop-filter: blur(10px); border-bottom: 1px solid rgba(255,255,255,.08); }
.brand { display: inline-flex; align-items: center; gap: 10px; border: 0; background: none; color: #fff; font-size: 1.25rem; font-weight: 800; cursor: pointer; padding: 6px 4px; min-height: 44px; }
.brand-i { display: inline-flex; align-items: center; justify-content: center; width: 38px; height: 38px; border-radius: 12px; background: linear-gradient(135deg, #ff2e93, #7a3cff); font-size: 1.3rem; box-shadow: 0 3px 0 rgba(0,0,0,.3); }
.lang-sw { display: inline-flex; align-items: center; min-height: 40px; padding: 0 16px; border-radius: 99px; background: rgba(255,255,255,.12); color: #fff; text-decoration: none; font-weight: 700; }
.lang-sw:hover { background: rgba(255,255,255,.2); }
.site-foot { text-align: center; color: #b9b3e6; padding: 8px 16px 36px; font-size: .95rem; }
button { -webkit-appearance: none; appearance: none; }
.file-button { border: 0; font-family: inherit; }
/* base game layout */
.gm-box { display: flex; flex-direction: column; gap: 16px; align-items: center; text-align: center; }
.gm-help { margin: 0; max-width: 440px; line-height: 1.6; font-size: 1rem; }
.gm-stats { display: flex; gap: 10px; flex-wrap: wrap; justify-content: center; font-weight: 700; margin: 0; }
.gm-msg { margin: 0; font-weight: 800; }
.gm-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; width: min(100%, 360px); }
.gm-card { aspect-ratio: 1; display: flex; align-items: center; justify-content: center; padding: 0; font-size: clamp(1.7rem, 9vw, 2.3rem); border-radius: 16px; cursor: pointer; font-family: inherit; }
.g48 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; width: min(100%, 360px); padding: 8px; border-radius: 16px; touch-action: none; outline: none; box-sizing: border-box; }
.g48-tile { aspect-ratio: 1; display: flex; align-items: center; justify-content: center; font-weight: 800; font-size: clamp(1.1rem, 6vw, 1.8rem); border-radius: 10px; }
.g48-pad { display: flex; flex-direction: column; align-items: center; gap: 8px; width: min(100%, 360px); }
.g48-pad > div { display: flex; gap: 8px; justify-content: center; }
.sn { display: grid; grid-template-columns: repeat(14, 1fr); width: min(100%, 360px); aspect-ratio: 1; border-radius: 14px; overflow: hidden; touch-action: none; outline: none; box-sizing: border-box; }
.sn-c { display: flex; align-items: center; justify-content: center; font-size: clamp(.6rem, 3vw, 1rem); line-height: 1; min-width: 0; }
.gm-grid.mo, .gm-grid.ttt { grid-template-columns: repeat(3, 1fr); }
.gx { --bg: #1b1546; --bg2: #2a1f6b; --ink: #fff; --soft: #d6d1f5; color: var(--ink); }
.gx-hero { position: relative; overflow: hidden; border-radius: 22px; padding: 28px 20px 24px; text-align: center; background: linear-gradient(135deg, #ff2e93 0%, #7a3cff 55%, #00c2ff 100%); background-size: 200% 200%; animation: gx-bg 8s ease infinite; box-shadow: 0 10px 30px rgba(122, 60, 255, .35); }
.gx-title, .gx-sub, .gx-badge { position: relative; z-index: 1; }
.gx-title { margin: 0; font-size: clamp(2rem, 9vw, 3.2rem); line-height: 1.1; font-weight: 900; color: #fff; text-shadow: 0 3px 0 rgba(0, 0, 0, .25); letter-spacing: -.5px; }
.gx-sub { margin: 10px 0 14px; color: #fff; opacity: .92; font-size: 1.05rem; }
.gx-badge { display: inline-block; padding: 6px 16px; border-radius: 99px; background: #ffe14d; color: #3b2300; font-weight: 800; box-shadow: 0 3px 0 #c79a00; }
.gx-fl { position: absolute; font-size: 2rem; opacity: .85; animation: gx-float 4s ease-in-out infinite; }
.gx-fl.f1 { bottom: 8%; left: 5%; } .gx-fl.f2 { bottom: 8%; right: 5%; animation-delay: .8s; } .gx-fl.f3 { top: 12%; left: 4%; animation-delay: 1.6s; } .gx-fl.f4 { top: 12%; right: 4%; animation-delay: 2.2s; }
@media (max-width: 700px) { .gx-fl.f3, .gx-fl.f4 { display: none; } .gx-fl { font-size: 1.6rem; } }
.gx-h { margin: 0; font-size: 1.5rem; font-weight: 800; color: #fff; }
.gx-pick { margin: 22px 0 12px; }
.mn-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; }
@media (min-width: 700px) { .mn-grid { grid-template-columns: repeat(3, 1fr); } }
@media (min-width: 1000px) { .mn-grid { grid-template-columns: repeat(4, 1fr); } }
.mn-tile { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px; min-height: 120px; padding: 14px 8px; border: 0; border-radius: 20px; color: #fff; font: inherit; font-weight: 800; font-size: 1.05rem; cursor: pointer; box-shadow: 0 6px 0 rgba(0, 0, 0, .22); transition: transform .15s, box-shadow .15s; animation: gx-pop .5s both; }
.mn-tile:hover, .mn-tile:focus-visible { transform: translateY(-4px) rotate(-1deg) scale(1.03); box-shadow: 0 10px 0 rgba(0, 0, 0, .22); }
.mn-tile:active { transform: translateY(3px); box-shadow: 0 2px 0 rgba(0, 0, 0, .22); }
.mn-i { font-size: 2.6rem; line-height: 1; filter: drop-shadow(0 3px 0 rgba(0, 0, 0, .2)); }
.mn-tile.c0 { background: linear-gradient(135deg, #ff5f6d, #ff2e93); } .mn-tile.c1 { background: linear-gradient(135deg, #ffb703, #ff7b00); }
.mn-tile.c2 { background: linear-gradient(135deg, #22d17a, #00a86b); } .mn-tile.c3 { background: linear-gradient(135deg, #2d8cff, #5a4bff); }
.mn-tile.c4 { background: linear-gradient(135deg, #a45bff, #6a2cff); } .mn-tile.c5 { background: linear-gradient(135deg, #00c2ff, #0077ff); }
.mn-tile.c6 { background: linear-gradient(135deg, #ff7eb3, #ff4f81); }
.gx-panel { margin-top: 20px; padding: 18px; border-radius: 22px; background: linear-gradient(160deg, var(--bg2), var(--bg)); box-shadow: 0 10px 30px rgba(23, 18, 58, .35); animation: gx-pop .35s both; }
.gx-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; justify-content: space-between; margin-bottom: 14px; }
.gx-panel .gx-h { color: #fff; }
.gx-back { border: 0; border-radius: 99px; padding: 10px 16px; min-height: 44px; font: inherit; font-weight: 700; background: #ffe14d; color: #3b2300; cursor: pointer; box-shadow: 0 3px 0 #c79a00; }
.gx-panel .gm-box { display: flex; flex-direction: column; gap: 14px; align-items: center; text-align: center; }
.gx-panel .gm-help { color: var(--soft); max-width: 460px; }
.gx-panel .gm-stats { gap: 12px; flex-wrap: wrap; justify-content: center; }
.gx-panel .gm-stats span { background: rgba(255, 255, 255, .12); padding: 6px 14px; border-radius: 99px; color: #fff; }
.gx-panel .gm-msg { color: #ffe14d; font-size: 1.15rem; animation: gx-pop .4s both; }
.gx-panel .file-button { background: linear-gradient(135deg, #ff2e93, #7a3cff); color: #fff; border: 0; font-weight: 800; border-radius: 99px; min-height: 44px; padding: 0 20px; box-shadow: 0 4px 0 rgba(0, 0, 0, .3); cursor: pointer; }
.gx-panel .file-button:active { transform: translateY(2px); }
.gx-panel .gm-grid { margin: 0 auto; }
.gx-panel .gm-card { border: 0; background: linear-gradient(135deg, #3b2f86, #2a2163); color: #fff; box-shadow: 0 4px 0 rgba(0, 0, 0, .3); transition: transform .15s; }
.gx-panel .gm-card:hover { transform: translateY(-2px); }
.gx-panel .gm-card.is-done { opacity: 1; background: linear-gradient(135deg, #22d17a, #00a86b); animation: gx-pop .4s; }
.gx-panel .gm-grid.ttt .gm-card { font-size: 2.4rem; color: #ffe14d; }
.gx-panel .gm-grid.mo .gm-card { background: linear-gradient(135deg, #6b4a2b, #3e2a17); }
.g48 { margin: 0 auto; background: #2a2163; } .g48-tile { background: #3b2f86; color: #fff; animation: gx-pop .2s; }
.g48-tile.v2 { background: #00c2ff; } .g48-tile.v4 { background: #2d8cff; } .g48-tile.v8 { background: #a45bff; } .g48-tile.v16 { background: #ff2e93; } .g48-tile.v32 { background: #ff7b00; }
.g48-tile.v64 { background: #ff3b5c; } .g48-tile.v128, .g48-tile.v256, .g48-tile.v512, .g48-tile.v1024, .g48-tile.v2048 { background: #ffd23f; color: #3b2300; box-shadow: 0 0 18px #ffd23f; }
.sn { margin: 0 auto; background: #1e1750; border: 3px solid #7a3cff; }
.sn-c.body { background: #22d17a; border-radius: 4px; } .sn-c.head { background: #00ffa3; border-radius: 6px; box-shadow: 0 0 8px #00ffa3; }
.cm-word { font-size: clamp(2.4rem, 12vw, 4rem); font-weight: 900; padding: 14px 24px; border-radius: 18px; background: #fff; min-width: 200px; animation: gx-pop .25s both; }
.cm-opts { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; width: min(100%, 360px); }
.cm-sw { aspect-ratio: 1; border: 4px solid #fff; border-radius: 18px; cursor: pointer; box-shadow: 0 4px 0 rgba(0, 0, 0, .3); }
.cm-sw:active { transform: translateY(2px); }
.ng-row { display: flex; gap: 10px; align-items: center; }
.ng-in { width: 130px; min-height: 48px; border-radius: 14px; border: 3px solid #7a3cff; background: #fff; color: #17123a; font-size: 1.4rem; font-weight: 800; text-align: center; }
.ng-msg { min-height: 1.6em; font-size: 1.5rem; }
.sm-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; width: min(100%, 300px); }
.sm-pad { aspect-ratio: 1; border: 0; border-radius: 24px; opacity: .45; cursor: pointer; transition: opacity .1s, transform .1s, box-shadow .1s; }
.sm-pad.on { opacity: 1; transform: scale(1.06); box-shadow: 0 0 28px currentColor, 0 0 0 4px #fff; }
.rp-show { display: flex; gap: 18px; align-items: center; font-size: 3.4rem; min-height: 80px; animation: gx-pop .3s both; color: #fff; }
.rp-show b { font-size: 1.1rem; color: var(--soft); }
.rp-opts { display: flex; gap: 14px; }
.rp-btn { width: 76px; height: 76px; font-size: 2.2rem; border: 0; border-radius: 22px; background: linear-gradient(135deg, #3b2f86, #2a2163); cursor: pointer; box-shadow: 0 4px 0 rgba(0, 0, 0, .3); transition: transform .15s; }
.rp-btn:hover { transform: translateY(-3px) scale(1.06); }
.sl-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; width: min(100%, 300px); }
.sl-t { aspect-ratio: 1; border: 0; border-radius: 16px; font-size: 2rem; font-weight: 900; color: #fff; background: linear-gradient(135deg, #2d8cff, #7a3cff); cursor: pointer; box-shadow: 0 4px 0 rgba(0, 0, 0, .3); transition: transform .12s; }
.sl-t.gap { background: transparent; box-shadow: none; cursor: default; }
.lo-grid { display: grid; grid-template-columns: repeat(5, 1fr); gap: 8px; width: min(100%, 320px); }
.lo-c { aspect-ratio: 1; border: 0; border-radius: 14px; background: #2a2163; cursor: pointer; transition: background .2s, box-shadow .2s, transform .12s; }
.lo-c.on { background: #ffe14d; box-shadow: 0 0 18px #ffe14d; transform: scale(1.04); }
.rx-box { width: min(100%, 360px); min-height: 220px; border: 0; border-radius: 24px; font: inherit; font-size: 1.4rem; font-weight: 800; color: #fff; cursor: pointer; background: #3b2f86; box-shadow: 0 6px 0 rgba(0, 0, 0, .3); }
.rx-box.wait { background: #ff3b5c; } .rx-box.go { background: #22d17a; transform: scale(1.03); } .rx-box.early { background: #ff7b00; } .rx-box.res { background: #2d8cff; }
.qz-q { margin: 0; font-size: 1.3rem; font-weight: 800; color: #fff; animation: gx-pop .3s both; }
.qz { display: flex; flex-direction: column; gap: 10px; width: min(100%, 380px); }
.qz-a { min-height: 52px; border: 0; border-radius: 16px; font: inherit; font-weight: 700; font-size: 1.05rem; color: #fff; background: linear-gradient(135deg, #3b2f86, #2a2163); cursor: pointer; box-shadow: 0 4px 0 rgba(0, 0, 0, .3); }
.qz-a.ok { background: linear-gradient(135deg, #22d17a, #00a86b); } .qz-a.bad { background: linear-gradient(135deg, #ff3b5c, #c4122f); }
.gm-stats, .gm-help, .gm-msg { margin: 0; }
@keyframes gx-bg { 0%, 100% { background-position: 0% 50%; } 50% { background-position: 100% 50%; } }
@keyframes gx-float { 0%, 100% { transform: translateY(0) rotate(0); } 50% { transform: translateY(-12px) rotate(8deg); } }
@keyframes gx-pop { 0% { transform: scale(.8); opacity: 0; } 70% { transform: scale(1.05); } 100% { transform: scale(1); opacity: 1; } }
@media (prefers-reduced-motion: reduce) { .gx *, .gx { animation: none !important; transition: none !important; } }
.cf { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; width: min(100%, 370px); padding: 8px; background: #2d5bff; border-radius: 16px; box-shadow: 0 5px 0 #1a3bb5; }
.cf-col { display: flex; flex-direction: column; gap: 4px; padding: 0; border: 0; background: transparent; cursor: pointer; }
.cf-d { display: block; aspect-ratio: 1; border-radius: 50%; background: #17123a; }
.cf-d.p1 { background: #ff3b5c; box-shadow: inset 0 -3px 0 rgba(0,0,0,.25); animation: gx-pop .3s; } .cf-d.p2 { background: #ffd23f; box-shadow: inset 0 -3px 0 rgba(0,0,0,.2); animation: gx-pop .3s; }
.hg-word { display: flex; gap: 8px; justify-content: center; flex-wrap: wrap; }
.hg-l { display: inline-flex; align-items: center; justify-content: center; width: 44px; height: 54px; border-bottom: 4px solid #ffe14d; font-size: 2rem; font-weight: 900; color: #fff; }
.hg-keys { display: flex; flex-wrap: wrap; gap: 6px; justify-content: center; max-width: 400px; }
.hg-k { width: 40px; height: 44px; border: 0; border-radius: 10px; font: inherit; font-weight: 800; color: #fff; background: linear-gradient(135deg, #3b2f86, #2a2163); cursor: pointer; box-shadow: 0 3px 0 rgba(0,0,0,.3); }
.hg-k.ok { background: #22d17a; } .hg-k.bad { background: #ff3b5c; opacity: .6; } .hg-k:disabled { cursor: default; }
.tp-btn { width: 180px; height: 180px; border-radius: 50%; border: 0; font-size: 4rem; cursor: pointer; background: linear-gradient(135deg, #ff2e93, #ff7b00); box-shadow: 0 8px 0 rgba(0,0,0,.3), 0 0 30px rgba(255,46,147,.5); transition: transform .06s; }
.tp-btn:active { transform: scale(.94) translateY(4px); box-shadow: 0 3px 0 rgba(0,0,0,.3); } .tp-btn.on { animation: gx-pop .2s; } .tp-btn:disabled { background: #3b2f86; box-shadow: none; }
.hl-num { font-size: 5rem; font-weight: 900; color: #ffe14d; text-shadow: 0 4px 0 rgba(0,0,0,.3); animation: gx-pop .3s both; }
.ms { display: grid; grid-template-columns: repeat(8, 1fr); gap: 3px; width: min(100%, 360px); }
.ms-c { aspect-ratio: 1; border: 0; border-radius: 8px; font: inherit; font-weight: 900; font-size: 1.1rem; background: linear-gradient(135deg, #5a4bff, #7a3cff); color: #fff; cursor: pointer; padding: 0; }
.ms-c.open { background: #2a2163; cursor: default; } .ms-c.boom { background: #ff3b5c; }
.ms-c.n1 { color: #00c2ff; } .ms-c.n2 { color: #22d17a; } .ms-c.n3 { color: #ff5f6d; } .ms-c.n4 { color: #ffd23f; } .ms-c.n5, .ms-c.n6, .ms-c.n7, .ms-c.n8 { color: #ff7eb3; }
.ms-flag { border: 0; border-radius: 99px; padding: 6px 14px; min-height: 36px; font: inherit; font-weight: 700; background: rgba(255,255,255,.12); color: #fff; cursor: pointer; } .ms-flag.on { background: #ffe14d; color: #3b2300; }
.bb-area { position: relative; width: min(100%, 360px); height: 300px; border-radius: 18px; background: linear-gradient(180deg, #00c2ff, #2d5bff); overflow: hidden; display: flex; align-items: center; justify-content: center; }
.bb-hint { font-size: 4rem; opacity: .7; }
.bb { position: absolute; width: 54px; height: 54px; border-radius: 50%; border: 2px solid rgba(255,255,255,.8); cursor: pointer; animation: gx-pop .25s both; padding: 0; }

/* polish */
.gx { max-width: 860px; margin: 0 auto; padding: 8px 16px 28px; box-sizing: border-box; }
.gx-hero { padding: 26px 18px 22px; margin-bottom: 8px; }
.mn-sec { margin-top: 26px; }
.gx-pick { margin: 0 0 12px; font-size: 1.25rem; display: flex; align-items: center; gap: 10px; }
.gx-pick::after { content: ''; flex: 1; height: 2px; border-radius: 2px; background: linear-gradient(90deg, #7a3cff55, transparent); }
[dir="rtl"] .gx-pick::after { background: linear-gradient(270deg, #7a3cff55, transparent); }
.mn-tile { min-height: 112px; box-sizing: border-box; text-align: center; line-height: 1.3; }
.mn-tile > span { display: block; max-width: 100%; }
.mn-n { font-size: 1rem; }
.gx-panel { padding: 20px 16px 24px; margin-top: 4px; }
.gx-panel .gm-help { color: #e1ddff; }
.gx-panel .gm-stats span { font-size: .95rem; }
.gx-panel .file-button, .gx-back { font-size: 1rem; }
.gx-bar { margin-bottom: 18px; }
.gx-h { line-height: 1.25; }
@media (max-width: 420px) { .gx-panel { padding: 16px 12px 20px; } .mn-tile { min-height: 104px; } .gx-title { font-size: 2rem; } }
.gm-card:focus-visible, .mn-tile:focus-visible, .gx-back:focus-visible, .qz-a:focus-visible, .file-button:focus-visible { outline: 3px solid #ffe14d; outline-offset: 2px; }

.gx-panel { border: 1px solid rgba(255,255,255,.1); }
.gx-hero { margin-top: 8px; }
.gm-card { border: 0; color: #fff; }

/* extra games */
.n5-q{font-size:2.4rem;font-weight:900;text-align:center;margin:14px 0;min-height:3rem;letter-spacing:.08em}
.n5-opts,.n5-tiles,.n5-built{display:flex;flex-wrap:wrap;gap:10px;justify-content:center;margin:10px 0}
.n5-pad{display:grid;grid-template-columns:repeat(5,1fr);gap:8px;margin:10px 0}
.n5-opt{background:linear-gradient(135deg,#3b82ff,#7c3aed);color:#fff;border:0;border-radius:16px;min-width:56px;padding:14px 16px;font-family:inherit;font-weight:800;font-size:1.4rem;box-shadow:0 5px 0 rgba(0,0,0,.3);cursor:pointer}
.n5-opt:active{transform:translateY(3px);box-shadow:0 2px 0 rgba(0,0,0,.3)}
.n5-opt:disabled{opacity:.3}
.n5-grid{display:grid;gap:8px;margin:12px auto;max-width:360px}
.n5-cell{aspect-ratio:1;border:0;border-radius:14px;background:rgba(255,255,255,.09);font-size:1.7rem;cursor:pointer;color:#fff;font-family:inherit;font-weight:800}
.n5-cell.num{background:linear-gradient(135deg,#ff6a3d,#ff2d7a);font-size:1.5rem}
.n5-cell.gone{opacity:.15}
.n5-cell.hit{outline:3px solid #ffd23f}
.n5-dice{display:flex;gap:24px;justify-content:center;font-size:5rem;line-height:1;margin:12px 0}
.n5-built{min-height:64px;font-size:2rem;font-weight:900;background:rgba(255,255,255,.07);border-radius:16px;padding:8px;align-items:center}
.n5-built .ph{opacity:.4}
.about{max-width:640px;margin:28px auto 0;padding:0 8px;line-height:1.9;opacity:.85;font-size:.95rem}
.n5-card{width:92px;height:128px;border:0;border-radius:18px;font-size:2.6rem;background:linear-gradient(135deg,#7c3aed,#ff2d7a);box-shadow:0 6px 0 rgba(0,0,0,.3);cursor:pointer}
.n5-hanoi{display:flex;gap:10px;justify-content:center;margin:14px 0}
.n5-peg{width:30%;max-width:110px;height:150px;background:rgba(255,255,255,.07);border:2px solid transparent;border-radius:14px;display:flex;flex-direction:column;justify-content:flex-end;align-items:center;gap:4px;padding:6px 0;cursor:pointer}
.n5-peg.sel{border-color:#ffd23f}
.n5-disc{height:22px;border-radius:11px;background:linear-gradient(90deg,#3b82ff,#a45bff)}
.n5-disc.d1{width:40%}.n5-disc.d2{width:65%;background:linear-gradient(90deg,#22d17a,#3b82ff)}.n5-disc.d3{width:90%;background:linear-gradient(90deg,#ff8a2b,#ff2d7a)}
.n5-field{position:relative;height:300px;background:rgba(255,255,255,.06);border-radius:16px;margin:12px 0;overflow:hidden}
.n5-target{position:absolute;width:56px;height:56px;border-radius:50%;border:0;font-size:1.9rem;background:#ff2d7a;box-shadow:0 0 18px #ff2d7a;cursor:pointer}
.n5-grid,.n5-hanoi,.n5-field{width:100%;box-sizing:border-box}
.n5-peg{flex:1 1 0;width:auto}
