/* Strona Gry (public/pages/gry.html): neonowa arena (ciemna w ciemnym motywie, jasna w jasnym), mozaika jak na portalach z grami – 3 duże kafelki gier z animacją
   i kafelek-terminal „kolejne gry”. Animowane tylko transform/opacity. */
/* arena: neonowa siatka i poświaty; ciemna w ciemnym motywie, jasna w jasnym (reguły body.light na końcu pliku) */
.gx-arena { position: relative; isolation: isolate; overflow: hidden; color: #E8F4FF; min-height: 70vh;
  background: radial-gradient(50% 40% at 15% 10%, rgba(0,229,255,.16), transparent 70%), radial-gradient(50% 45% at 90% 25%, rgba(177,75,255,.18), transparent 70%), #060A18; }
.gx-arena::before { content: ''; position: absolute; inset: 0; z-index: -1; opacity: .55; pointer-events: none;
  background: linear-gradient(rgba(0,229,255,.07) 1px, transparent 1px) 0 0 / 100% 44px, linear-gradient(90deg, rgba(0,229,255,.07) 1px, transparent 1px) 0 0 / 44px 100%;
  -webkit-mask-image: linear-gradient(#000, transparent 85%); mask-image: linear-gradient(#000, transparent 85%); }
/* nagłówek jak na stronie Opinie (wielkość i odstępy ze stylów strony), tylko kolory areny */
.gx-arena .page-header[hidden] { display: none; }
.gx-arena .page-subtitle { font-size: min(1.1rem, 4.3vw); white-space: nowrap; }
.gx-arena .page-title { background: linear-gradient(90deg, #00E5FF, #B14BFF); -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent; }
body.light .gx-arena .page-title { background-image: linear-gradient(90deg, #0056CC, #7B2FBE); }
.gx-wrap { max-width: 860px; margin: 0 auto; padding: 4rem 2rem 4.5rem; }
.gx-grid { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); grid-auto-rows: 92px; gap: .75rem; }
.gx-grid[hidden] { display: none; }
.gx-t { position: relative; overflow: hidden; isolation: isolate; border-radius: 20px; min-width: 0; }
.gx-game { --c: #00D4FF; display: flex; flex-direction: column; justify-content: flex-end; gap: .25rem; padding: .8rem .95rem; text-decoration: none; color: #fff;
  background: radial-gradient(90% 90% at 75% 15%, color-mix(in srgb, var(--c) 30%, transparent), transparent 70%), linear-gradient(150deg, #0B1430, #120B2C);
  border: 1px solid color-mix(in srgb, var(--c) 40%, transparent); box-shadow: 0 18px 40px -26px var(--c); transition: transform .25s ease, border-color .25s ease, box-shadow .25s ease; }
.gx-game::before { content: ''; position: absolute; inset: 0; z-index: -2; opacity: .5; background: linear-gradient(color-mix(in srgb, var(--c) 9%, transparent) 1px, transparent 1px) 0 0 / 100% 26px, linear-gradient(90deg, color-mix(in srgb, var(--c) 9%, transparent) 1px, transparent 1px) 0 0 / 26px 100%; }
.gx-game::after { content: ''; position: absolute; inset: 0; z-index: 2; pointer-events: none; opacity: 0; transform: translateX(-60%) skewX(-16deg); transition: opacity .3s;
  background: linear-gradient(100deg, transparent 35%, rgba(255,255,255,.14) 50%, transparent 65%); }
.gx-game:hover, .gx-game:focus-visible { transform: translateY(-4px); border-color: var(--c); box-shadow: 0 24px 50px -24px var(--c); }
.gx-game:hover::after { opacity: 1; animation: gx-shine 1s ease; }
.gx-game:focus-visible { outline: 3px solid var(--c); outline-offset: 3px; }
.gx-art { position: absolute; inset: 0; z-index: -1; width: 100%; height: 100%; -webkit-mask-image: linear-gradient(#000 48%, transparent 76%); mask-image: linear-gradient(#000 48%, transparent 76%); }
.gx-chip { align-self: flex-start; padding: .14rem .5rem; border-radius: 999px; font: 600 .64rem 'Space Grotesk', sans-serif; letter-spacing: .06em; color: var(--c); background: rgba(5,8,18,.7); border: 1px solid color-mix(in srgb, var(--c) 40%, transparent); }
.gx-game h2 { margin: .2rem 0 0; font: 700 clamp(1.08rem, 1.8vw, 1.32rem)/1.15 'Space Grotesk', sans-serif; color: #fff; text-shadow: 0 2px 14px rgba(5,8,18,.9); }
.gx-game p { margin: 0; max-width: 38ch; font-size: .75rem; line-height: 1.4; color: #CFE0F5; text-shadow: 0 1px 8px rgba(5,8,18,.9); }
.gx-go { position: absolute; right: .7rem; top: .7rem; width: 32px; height: 32px; display: grid; place-items: center; border-radius: 50%; color: #05101F; background: var(--c); box-shadow: 0 0 22px -4px var(--c); transition: transform .25s ease; }
.gx-go svg { width: 15px; height: 15px; margin-left: 2px; }
.gx-game:hover .gx-go { transform: scale(1.1); }
.gx-lab { grid-column: span 4; grid-row: span 2; --c: #00E5FF; }
.gx-waz { grid-column: span 2; grid-row: span 2; --c: #FF9F43; }
.gx-sko { grid-column: span 2; grid-row: span 2; --c: #B14BFF; }
/* kafelek „więcej gier”: okno terminala, migający kursor, puste sloty na nowe gry migają po kolei */
.gx-more { --c: #22F59A; grid-column: span 4; grid-row: span 2; display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 1rem; padding: 2.4rem .95rem .7rem; color: #fff;
  background: linear-gradient(150deg, rgba(34,245,154,.08), rgba(0,229,255,.05)), #0A1024; border: 1px dashed rgba(34,245,154,.5); }
.gx-term { position: absolute; left: 0; right: 0; top: 0; display: flex; align-items: center; gap: .35rem; padding: .5rem .95rem; border-bottom: 1px solid rgba(34,245,154,.2); }
.gx-term i { width: 9px; height: 9px; border-radius: 50%; background: rgba(34,245,154,.45); }
.gx-term em { margin-left: .5rem; font: 400 .74rem 'Space Mono', monospace; color: rgba(207,224,245,.6); }
.gx-cmd { margin: 0; font: 700 .76rem 'Space Mono', monospace; color: var(--c); }
.gx-cmd b { display: inline-block; width: .55em; height: 1em; margin-left: .25em; vertical-align: -.15em; background: var(--c); }
.gx-more h2 { margin: .15rem 0 0; font: 700 clamp(1.05rem, 1.7vw, 1.25rem)/1.15 'Space Grotesk', sans-serif; color: #fff; }
.gx-more-t { display: flex; flex-direction: column; gap: .2rem; min-width: 0; }
.gx-slots { display: flex; gap: .45rem; }
.gx-slots i { width: 46px; height: 46px; display: grid; place-items: center; border-radius: 12px; font: 700 1rem 'Space Mono', monospace; color: var(--c); background: rgba(34,245,154,.06); border: 1px dashed rgba(34,245,154,.55); }
.gx-note { margin: 0; font-size: .78rem; line-height: 1.4; color: #CFE0F5; }
/* gra na stronie */
.gx-play { padding-top: 4.5rem; }
.gx-play .gry-pick { display: none; }   /* grę wybiera się w mozaice */
.gx-play[hidden] { display: none; }
.gx-back { display: flex; width: fit-content; align-items: center; gap: .5rem; margin: 0 auto 1rem; padding: .55rem 1rem; border-radius: 12px; cursor: pointer; font: 600 .92rem 'Space Grotesk', sans-serif; color: #00E5FF; background: rgba(5,8,18,.75); border: 1px solid rgba(0,229,255,.4); }
.gx-back:hover { border-color: #00E5FF; }
.gx-back:focus-visible { outline: 3px solid #00E5FF; outline-offset: 2px; }
.gx-back svg { width: 16px; height: 16px; }
.gx-pulse { transform-box: fill-box; transform-origin: center; }
@keyframes gx-shine { to { transform: translateX(60%) skewX(-16deg); } }
@media (prefers-reduced-motion: no-preference) {
  .gx-bob { animation: gx-bob 1.1s ease-in-out infinite; }
  .gx-flow { stroke-dasharray: 30 8; animation: gx-flow 1.4s linear infinite; }
  .gx-pulse { animation: gx-pulse 2.4s ease-in-out infinite; }
  .gx-cmd b { animation: gx-blink 1s steps(2) infinite; }
  .gx-slots i { animation: gx-slot 2.4s ease-in-out infinite; }
  .gx-slots i:nth-child(2) { animation-delay: .4s; } .gx-slots i:nth-child(3) { animation-delay: .8s; }
}
@keyframes gx-bob { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-34px); } }
@keyframes gx-slot { 0%, 100% { opacity: .35; } 35% { opacity: 1; } }
@keyframes gx-blink { 50% { opacity: 0; } }
@keyframes gx-flow { to { stroke-dashoffset: -38; } }
@keyframes gx-pulse { 0%, 100% { opacity: 1; transform: scale(1); } 50% { opacity: .6; transform: scale(.9); } }
@media (max-width: 768px) { .gx-wrap { padding: 2.5rem 1.5rem 3rem; } }
@media (max-width: 900px) {
  .gx-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); grid-auto-rows: 88px; gap: .65rem; }
  .gx-lab, .gx-waz, .gx-sko, .gx-more { grid-column: span 2; grid-row: span 2; }
  .gx-t { border-radius: 20px; }
  .gx-slots i { width: 38px; height: 38px; }
  .gx-slots i:nth-child(3) { display: none; }
}

/* jasny motyw: jasna arena i jasne kafelki, ten sam układ */
body.light .gx-arena { color: var(--text); background: radial-gradient(50% 40% at 15% 10%, rgba(0,163,196,.14), transparent 70%), radial-gradient(50% 45% at 90% 25%, rgba(123,47,190,.12), transparent 70%), #F4F7FC; }
body.light .gx-arena::before { background: linear-gradient(rgba(0,86,204,.07) 1px, transparent 1px) 0 0 / 100% 44px, linear-gradient(90deg, rgba(0,86,204,.07) 1px, transparent 1px) 0 0 / 44px 100%; }
body.light .gx-lab { --c: #0090B8; } body.light .gx-waz { --c: #E8590C; } body.light .gx-sko { --c: #7B2FBE; }
body.light .gx-game { color: #0F1A33; background: radial-gradient(90% 90% at 75% 15%, color-mix(in srgb, var(--c) 14%, transparent), transparent 70%), #fff; box-shadow: 0 16px 34px -26px var(--c); }
body.light .gx-game h2 { color: #0F1A33; text-shadow: none; }
body.light .gx-game p { color: #44506A; text-shadow: none; }
body.light .gx-chip { background: #fff; }
body.light .gx-go { color: #fff; }
body.light .gx-more { --c: #0B8F5A; color: #0F1A33; background: linear-gradient(150deg, rgba(11,143,90,.07), rgba(0,86,204,.05)), #fff; border-color: rgba(11,143,90,.5); }
body.light .gx-more h2 { color: #0F1A33; }
body.light .gx-note { color: #44506A; }
body.light .gx-term { border-bottom-color: rgba(11,143,90,.2); }
body.light .gx-term em { color: #5B6780; }
body.light .gx-back { color: #0056CC; background: #fff; border-color: rgba(0,86,204,.3); }

/* telefon: gry tylko w poziomie, na całym ekranie, bez paska menu i stopki; w pionie animacja „Obróć telefon” (iPhone nie pozwala obrócić strony z kodu).
   Sterowanie pod dwa kciuki: lewy kciuk ← →, prawy ↑ ↓ albo Skok; przyciski po bokach planszy (position: fixed), duże, bez zaznaczania i przewijania. */
.gx-rot { display: none; position: fixed; inset: 0; z-index: 3000; place-items: center; align-content: center; gap: .9rem; padding: 1.5rem; text-align: center; color: #E8F4FF; background: #060A18; }
.gx-rot-ico { position: relative; width: 120px; height: 120px; display: grid; place-items: center; }
.gx-rot-ph { width: 58px; height: 96px; color: #00E5FF; filter: drop-shadow(0 0 10px rgba(0,229,255,.5)); }
.gx-rot-arc { position: absolute; inset: 0; width: 100%; height: 100%; color: #B14BFF; }
.gx-rot b { font: 700 1.35rem/1.2 'Space Grotesk', sans-serif; }
.gx-rot span.gx-rot-t { max-width: 26ch; font-size: .95rem; line-height: 1.4; color: #CFE0F5; }
body.gx-phone.gx-playing { overflow: hidden; overscroll-behavior: none; }
body.gx-phone.gx-playing #nav, body.gx-phone.gx-playing footer.tf { display: none; }
body.gx-phone.gx-playing .gx-arena { min-height: 100svh; }
body.gx-phone.gx-playing .gx-wrap { max-width: none; padding: 0; }
body.gx-phone.gx-playing .gx-play { padding: 0; }
@media (orientation: portrait) { body.gx-phone:not(.gx-tablet).gx-playing .gx-rot { display: grid; } }
/* tablet w pionie: plansza na całą szerokość, pod nią duży krzyżak (bez paska menu i stopki, wszystko na ekranie) */
@media (orientation: portrait) {
  body.gx-tablet.gx-playing .gx-play { padding: .9rem 1rem 0; }
  body.gx-tablet.gx-playing .gx-back { width: 40px; height: 40px; margin: 0 .4rem 0 auto; padding: 0; justify-content: center; font-size: 0; flex: none; }
  body.gx-tablet.gx-playing .lab-pad { grid-template-columns: repeat(3, 84px); grid-template-rows: repeat(2, 76px); gap: .6rem; }
  body.gx-tablet.gx-playing .gs .lab-pad { grid-template-rows: 80px; }
}
/* tablet w poziomie: układ telefonu, większe przyciski */
@media (orientation: landscape) {
  body.gx-phone.gx-tablet.gx-playing .lab { max-width: none; }
  body.gx-phone.gx-tablet.gx-playing .lab-pad-btn { width: 88px; height: 88px; font-size: 1.8rem; }
  body.gx-phone.gx-tablet.gx-playing .lab-pad-btn.right, body.gx-phone.gx-tablet.gx-playing .gs-r { left: calc(max(14px, env(safe-area-inset-left)) + 98px); }
  body.gx-phone.gx-tablet.gx-playing .lab-pad-btn.left, body.gx-phone.gx-tablet.gx-playing .gs-l { left: max(14px, env(safe-area-inset-left)); }
  body.gx-phone.gx-tablet.gx-playing .lab-pad-btn.up { bottom: 116px; }
  body.gx-phone.gx-tablet.gx-playing .lab-pad-btn.down, body.gx-phone.gx-tablet.gx-playing .lab-pad-btn.up, body.gx-phone.gx-tablet.gx-playing .gs-j { right: max(14px, env(safe-area-inset-right)); }
  body.gx-phone.gx-tablet.gx-playing .gs-j { width: 124px; height: 124px; }
  body.gx-phone.gx-tablet.gx-playing .lab-stage, body.gx-phone.gx-tablet.gx-playing .gw .lab-stage { width: min(calc(100vw - 420px), calc((100svh - 62px) * var(--lab-ar, 1.65))); }
  body.gx-phone.gx-tablet.gx-playing .lab.has-over .lab-stage { width: min(calc(100vw - 24px), calc((100svh - 62px) * var(--lab-ar, 1.65))); }
}
@media (orientation: landscape) {
  body.gx-phone.gx-playing .lab { display: block; margin: 0; padding: .35rem max(.5rem, env(safe-area-inset-right)) 0 max(.5rem, env(safe-area-inset-left)); border: 0; border-radius: 0; background: none; box-shadow: none; }
  body.gx-phone.gx-playing .gx-back { position: fixed; left: max(.5rem, env(safe-area-inset-left)); top: .4rem; z-index: 40; width: 38px; height: 38px; margin: 0; padding: 0; justify-content: center; border-radius: 12px; font-size: 0; }
  body.gx-phone.gx-playing .lab-hud { margin: 0 0 .3rem 46px; padding: .22rem .5rem; }
  body.gx-phone.gx-playing .lab-stage, body.gx-phone.gx-playing .gw .lab-stage { width: min(calc(100vw - 330px), calc((100svh - 58px) * var(--lab-ar, 1.65))); margin: 0 auto; }
  body.gx-phone.gx-playing .lab.has-over .lab-stage { width: min(calc(100vw - 24px), calc((100svh - 58px) * var(--lab-ar, 1.65))); }
  body.gx-phone.gx-playing .lab.has-over .lab-cv { opacity: .25; }
  /* okna gry (start, zapowiedź poziomu, ciekawostka, koniec): cały ekran pod paskiem gry, start i zapowiedź w 2 kolumnach – przycisk widać bez przewijania */
  body.gx-phone.gx-playing .lab-over { position: fixed; inset: 54px 0 0; z-index: 25; padding: .2rem max(.9rem, env(safe-area-inset-right)) .5rem max(.9rem, env(safe-area-inset-left)); background: rgba(5, 8, 18, .96); -webkit-overflow-scrolling: touch; }
  body.gx-phone.gx-playing .lab-card { width: min(100%, 660px); padding: .2rem 0; border: 0; border-radius: 0; background: none; box-shadow: none; }
  body.gx-phone.gx-playing .lab-intro, body.gx-phone.gx-playing .lab-lvlcard { width: min(100%, 860px); display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.2fr); column-gap: 1.2rem; align-items: start; text-align: left; }
  body.gx-phone.gx-playing .lab-intro > *, body.gx-phone.gx-playing .lab-lvlcard > * { grid-column: 1; }
  body.gx-phone.gx-playing .lab-intro .lab-legend { grid-column: 2; grid-row: 1 / span 3; margin-bottom: .5rem; }
  body.gx-phone.gx-playing .lab-intro .lab-levels { grid-column: 2; grid-row: 4 / span 2; margin: 0; }
  body.gx-phone.gx-playing .lab-intro h3, body.gx-phone.gx-playing .lab-lvlcard h3 { font-size: 1.3rem; }
  body.gx-phone.gx-playing .lab-intro .esc-btn { grid-row: 4; }
  body.gx-phone.gx-playing .lab-lvlcard .lab-news { grid-column: 2; grid-row: 1 / span 5; margin: 0; }
  body.gx-phone.gx-playing .lab-intro .esc-btn, body.gx-phone.gx-playing .lab-lvlcard .esc-btn { justify-self: start; margin: 0; }
  body.gx-phone.gx-playing .lab-card .esc-btn { min-height: 44px; }
  body.gx-phone.gx-playing .gs-quiz { width: min(100%, 860px); }
  body.gx-phone.gx-playing .gs-ans { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  body.gx-phone.gx-playing .gs-a { padding: .45rem .55rem; gap: .45rem; font-size: .84rem; }
  body.gx-phone.gx-playing .lab.has-over .lab-pad { display: none; }
  body.gx-phone.gx-playing .lab-pad { display: contents; }
  body.gx-phone.gx-playing .lab-pad-btn { position: fixed; z-index: 30; width: 70px; height: 70px; margin: 0; border-radius: 22px; font-size: 1.5rem; color: #fff; background: rgba(255,255,255,.08); border: 1.5px solid rgba(0,229,255,.5);
    touch-action: none; -webkit-user-select: none; user-select: none; -webkit-touch-callout: none; -webkit-tap-highlight-color: transparent; }
  body.gx-phone.gx-playing .lab-pad-btn.on { background: rgba(0,229,255,.32); border-color: #00E5FF; transform: scale(.93); }
  body.gx-phone.gx-playing .lab-pad-btn.left, body.gx-phone.gx-playing .gs-l { left: max(10px, env(safe-area-inset-left)); bottom: 18px; }
  body.gx-phone.gx-playing .lab-pad-btn.right, body.gx-phone.gx-playing .gs-r { left: calc(max(10px, env(safe-area-inset-left)) + 78px); bottom: 18px; }
  body.gx-phone.gx-playing .lab-pad-btn.down { right: max(10px, env(safe-area-inset-right)); bottom: 18px; }
  body.gx-phone.gx-playing .lab-pad-btn.up { right: max(10px, env(safe-area-inset-right)); bottom: 96px; }
  body.gx-phone.gx-playing .gs-j { right: max(10px, env(safe-area-inset-right)); bottom: 18px; width: 100px; height: 100px; border-radius: 50%; flex-direction: column; gap: .1rem; font-size: 1.2rem; }
  body.gx-phone.gx-playing .gs-j span { font-size: .8rem; }
  /* jasny motyw: ciemny pasek gry jak plansza, przyciski niebieskie na jasnym tle */
  body.light.gx-phone.gx-playing .lab-hud { background: #0B1226; border-color: rgba(0,229,255,.3); }
  body.light.gx-phone.gx-playing .lab-pad-btn { color: #0056CC; background: rgba(0,86,204,.1); border-color: rgba(0,86,204,.55); }
  body.light.gx-phone.gx-playing .lab-pad-btn.on { color: #fff; background: #0056CC; border-color: #0056CC; }
}
@media (prefers-reduced-motion: no-preference) {
  .gx-rot-ph { animation: gx-rot 2.6s cubic-bezier(.6, 0, .3, 1) infinite; }
  .gx-rot-arc { animation: gx-arc 2.6s ease-in-out infinite; }
}
@keyframes gx-rot { 0%, 20% { transform: rotate(0); } 60%, 85% { transform: rotate(-90deg); } 100% { transform: rotate(-90deg); opacity: .4; } }
@keyframes gx-arc { 0%, 15% { opacity: 0; } 35%, 60% { opacity: 1; } 80%, 100% { opacity: 0; } }

/* komputer: gra mieści się w oknie bez przewijania strony (bez stopki, plansza dopasowana do wysokości); większa = przycisk „Pełny ekran” */
@media (hover: hover) and (pointer: fine) {
  body.gx-playing { overflow: hidden; }
  body.gx-playing footer.tf { display: none; }
  body.gx-playing .gx-arena { height: 100vh; min-height: 0; }
  body.gx-playing .gx-wrap { max-width: 1100px; padding: 0 1rem; }
  body.gx-playing .gx-play { padding-top: 4.9rem; }
  body.gx-playing .lab:not(.is-full) { position: relative; }
  body.gx-playing .gx-back { flex: none; margin: 0 auto; padding: .36rem .8rem; font-size: .82rem; white-space: nowrap; border-radius: 10px; }
  body.gx-playing .gx-back svg { width: 14px; height: 14px; }
  body.gx-playing .lab:not(.is-full) { padding-top: .6rem; padding-bottom: .5rem; }
  body.gx-playing .lab:not(.is-full) .lab-stage { width: min(100%, calc(max(240px, 100vh - 222px) * var(--lab-ar, 1.65))); margin-left: auto; margin-right: auto; }
  body.gx-playing .gw:not(.is-full) .lab-stage { width: min(100%, calc(max(220px, 100vh - 276px) * var(--lab-ar, 1.69))); }
  body.gx-playing .lab:not(.is-full) .lab-keys { margin-top: .35rem; }
}
.lab.is-full .gx-back { display: none; }
/* telefon poziomo, lista gier: nagłówek i odstępy jak w Opiniach, 2 kolumny niskich kafelków */
@media (max-height: 500px) and (orientation: landscape) {
  /* escape.css zmniejsza pasek menu i logo na telefonie poziomo – na tej stronie pasek ma być taki jak w Opiniach */
  body #nav { padding-top: 1.5rem !important; padding-bottom: 1.5rem !important; }
  body #nav.scrolled { padding-top: 1rem !important; padding-bottom: 1rem !important; }
  body #nav .logo-img { width: 48px !important; height: 48px !important; }
  .gx-wrap { max-width: none; padding: 4rem max(2rem, env(safe-area-inset-right)) 3rem max(2rem, env(safe-area-inset-left)); }
  .gx-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); grid-auto-rows: 66px; gap: .6rem; }
  .gx-lab, .gx-waz, .gx-sko, .gx-more { grid-column: span 1; grid-row: span 2; }
  .gx-game p { display: none; }
  .gx-note { display: none; }
  .gx-game { padding: .6rem .8rem; }
}
