/* Kids Playground: bright, chunky, toy-block feel. One stylesheet for every site page (not the games). */
:root {
  --bg: #fff7e8;
  --ink: #2a2140;
  --ink-soft: #6a5f80;
  --card: #ffffff;
  --line: #2a2140;
  --sun: #ffc93c;
  --sky: #4cc9f0;
  --grass: #3ecf6e;
  --berry: #ff5d8f;
  --violet: #7b5cff;
  --display: "Baloo 2", "Comic Sans MS", "Trebuchet MS", system-ui, sans-serif;
  --body: "Nunito", "Trebuchet MS", system-ui, sans-serif;
  --r: 22px;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; min-height: 100vh; background: var(--bg); color: var(--ink);
  font: 600 17px/1.5 var(--body);
  background-image: radial-gradient(circle at 12% 8%, #ffe3a3 0 90px, transparent 91px),
    radial-gradient(circle at 92% 18%, #c9f1ff 0 70px, transparent 71px),
    radial-gradient(circle at 80% 92%, #ffd6e4 0 110px, transparent 111px);
  background-attachment: fixed;
}
a { color: var(--violet); }
h1, h2, h3 { font-family: var(--display); font-weight: 800; line-height: 1.1; margin: 0; }
.wrap { max-width: 1080px; margin: 0 auto; padding: 0 16px; }

/* Language: every bilingual element carries data-l="pl" or data-l="en"; html[data-lang] picks one. */
html[data-lang="pl"] [data-l="en"], html[data-lang="en"] [data-l="pl"] { display: none !important; }

/* Header */
.top { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 18px 0 8px; }
.logo { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--ink); }
.logo-mark { width: 46px; height: 46px; transform: rotate(-8deg); transition: transform .2s; }
.logo:hover .logo-mark { transform: rotate(6deg) scale(1.08); }
.logo-text { display: flex; font: 800 30px/1 var(--display); -webkit-text-stroke: 5px var(--line); paint-order: stroke fill; letter-spacing: .02em; text-shadow: 0 3px 0 var(--line); }
.logo-text b { display: inline-block; font-weight: 800; }
.logo-text b:nth-child(5n+1) { color: var(--berry); transform: rotate(-6deg); } .logo-text b:nth-child(5n+2) { color: var(--sun); transform: translateY(-3px) rotate(4deg); }
.logo-text b:nth-child(5n+3) { color: var(--sky); transform: rotate(-3deg); } .logo-text b:nth-child(5n+4) { color: var(--grass); transform: translateY(2px) rotate(5deg); }
.logo-text b:nth-child(5n) { color: var(--violet); transform: translateY(-2px) rotate(-4deg); }
.lang { display: flex; border: 2.5px solid var(--line); border-radius: 999px; overflow: hidden; background: var(--card); flex-shrink: 0; }
.lang button { font: 800 15px var(--display); border: 0; background: none; padding: 6px 12px; cursor: pointer; color: var(--ink); }
html[data-lang="pl"] .lang [data-set="pl"], html[data-lang="en"] .lang [data-set="en"] { background: var(--sun); }

/* Hero */
.hero { padding: 28px 0 22px; text-align: center; }
.hero h1 { font-size: clamp(34px, 7vw, 60px); letter-spacing: -.02em; }
.hero h1 .w { display: inline-block; }
.hero h1 .w:nth-child(3n+1) { color: var(--berry); } .hero h1 .w:nth-child(3n+2) { color: var(--violet); } .hero h1 .w:nth-child(3n) { color: #12a3d0; }
.hero p { font-size: clamp(17px, 2.6vw, 21px); color: var(--ink-soft); max-width: 36ch; margin: 12px auto 0; text-wrap: balance; }

/* Game grid */
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(290px, 1fr)); gap: 22px; padding: 10px 0 40px; }
.card {
  display: flex; flex-direction: column; text-decoration: none; color: var(--ink); background: var(--card);
  border: 3px solid var(--line); border-radius: var(--r); overflow: hidden;
  box-shadow: 0 7px 0 var(--line); transition: transform .12s, box-shadow .12s;
}
.card:hover, .card:focus-visible { transform: translateY(-4px) rotate(-.6deg); box-shadow: 0 11px 0 var(--line); outline: none; }
.card:active { transform: translateY(4px); box-shadow: 0 3px 0 var(--line); }
.shot { position: relative; aspect-ratio: 16 / 10; background: var(--c, var(--sky)); border-bottom: 3px solid var(--line); overflow: hidden; display: grid; place-items: center; }
.shot img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.shot .emoji { font-size: 72px; }
.shot .badge { position: absolute; left: 12px; top: 12px; z-index: 1; font-size: 34px; background: var(--card); border: 3px solid var(--line); border-radius: 16px; width: 54px; height: 54px; display: grid; place-items: center; }
.body { padding: 14px 18px 18px; display: flex; flex-direction: column; gap: 6px; flex: 1; }
.body h2 { font-size: 25px; }
.by { margin: 0; color: var(--ink-soft); font-size: 15px; }
.by b { color: var(--c, var(--violet)); }
.desc { margin: 2px 0 6px; font-size: 16px; font-weight: 600; }
.tags { display: flex; flex-wrap: wrap; gap: 6px; margin-top: auto; }
.tags span { font-size: 13px; font-weight: 800; background: #f3eefc; border-radius: 999px; padding: 3px 10px; }
.play-btn {
  margin-top: 12px; align-self: flex-start; font: 800 20px var(--display); background: var(--grass); color: var(--ink);
  border: 3px solid var(--line); border-radius: 16px; padding: 6px 22px; box-shadow: 0 4px 0 var(--line);
}
.empty, .loading { text-align: center; color: var(--ink-soft); padding: 40px 0; grid-column: 1 / -1; }

/* The one ad slot (home page, below the games). Labelled, boxed, away from anything clickable in a game. */
.ad { margin: 0 0 36px; padding: 10px; border: 2px dashed #d8cfe8; border-radius: var(--r); min-height: 120px; }
.ad::before { content: "Reklama · Ad"; display: block; font-size: 12px; color: var(--ink-soft); margin-bottom: 6px; }

/* Info strip + footer */
.made { background: var(--card); border: 3px solid var(--line); border-radius: var(--r); padding: 18px 22px; display: flex; gap: 16px; align-items: center; margin-bottom: 36px; }
.made .big { font-size: 44px; }
.made p { margin: 0; }
footer { padding: 8px 0 32px; color: var(--ink-soft); font-size: 15px; display: flex; flex-wrap: wrap; gap: 8px 18px; justify-content: center; }
footer a { color: var(--ink-soft); }

/* Text pages (about, privacy, 404) */
.page { background: var(--card); border: 3px solid var(--line); border-radius: var(--r); padding: 24px clamp(18px, 4vw, 40px); margin: 18px 0 36px; box-shadow: 0 7px 0 var(--line); }
.page h1 { font-size: clamp(30px, 5vw, 42px); margin-bottom: 12px; }
.page h2 { font-size: 23px; margin: 22px 0 6px; }
.page p, .page li { max-width: 68ch; }
.btn { display: inline-block; font: 800 19px var(--display); text-decoration: none; color: var(--ink); background: var(--sun); border: 3px solid var(--line); border-radius: 16px; padding: 6px 20px; box-shadow: 0 4px 0 var(--line); }

/* Play page: a thin bar on top, the game fills the rest. */
body.play { background: #14102a; background-image: none; height: 100vh; height: 100dvh; display: flex; flex-direction: column; overflow: hidden; }
.bar { display: flex; align-items: center; gap: 10px; padding: 8px 12px; background: var(--bg); border-bottom: 3px solid var(--line); flex-shrink: 0; }
.bar .btn { font-size: 16px; padding: 3px 14px; box-shadow: 0 3px 0 var(--line); white-space: nowrap; }
.bar .title { flex: 1; min-width: 0; }
.bar .title h1 { font-size: 20px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bar .title .by { font-size: 13px; line-height: 1.2; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bar .icon { font-size: 20px; padding: 2px 10px; background: var(--card); }
#frame { flex: 1; width: 100%; border: 0; display: block; background: #14102a; }
@media (max-width: 520px) {
  .logo-text { font-size: 21px; }
  .bar .title .by, .bar .lang { display: none; }
}
@media (prefers-reduced-motion: reduce) { .card, .card:hover { transition: none; transform: none; } }
