/* TypePlay PixiJS Arcade — bright, friendly, professional kids theme. */
:root {
  --bg0: #e8f6ff;
  --bg1: #fdf3e0;
  --ink: #22415e;
  --muted: #5b7a99;
  --card: #ffffff;
  --navy: #1b3a5c;
  --teal: #12b8c7;
  --mint: #34c98e;
  --sun: #ffb43d;
  --coral: #ff6b6b;
  --radius: 20px;
  --shadow: 0 8px 24px rgba(27, 58, 92, 0.12);
  --shadow-hover: 0 18px 40px rgba(18, 184, 199, 0.22);
  --font: "Trebuchet MS", "Segoe UI", sans-serif;
}
* { box-sizing: border-box; margin: 0; padding: 0; }
html { -webkit-text-size-adjust: 100%; }
body {
  font-family: var(--font);
  color: var(--ink);
  min-height: 0;
  /* Transparent: the arcade lives inside the Games page and uses its
     backdrop. Game cards keep their own surfaces. */
  background: transparent;
  overflow-x: hidden;
}
#bubbles { position: fixed; inset: 0; width: 100%; height: 100%; pointer-events: none; z-index: 0; }
.cloud { position: fixed; z-index: 0; pointer-events: none; background: #ffffff; opacity: 0.85; border-radius: 999px; animation: drift 70s linear infinite; box-shadow: 0 6px 18px rgba(27,58,92,.08); }
.cloud::before, .cloud::after { content: ""; position: absolute; background: #ffffff; border-radius: 50%; }
.cloud.c1 { width: 130px; height: 38px; top: 12%; left: -160px; }
.cloud.c1::before { width: 56px; height: 56px; top: -26px; left: 22px; }
.cloud.c1::after { width: 40px; height: 40px; top: -18px; left: 66px; }
.cloud.c2 { width: 100px; height: 30px; top: 26%; left: -140px; animation-duration: 95s; animation-delay: -30s; opacity: 0.7; }
.cloud.c2::before { width: 44px; height: 44px; top: -20px; left: 16px; }
.cloud.c2::after { width: 32px; height: 32px; top: -14px; left: 50px; }
@keyframes drift { from { transform: translateX(0); } to { transform: translateX(calc(100vw + 360px)); } }
.wrap { position: relative; z-index: 1; max-width: 1180px; margin: 0 auto; padding: 4px 22px 40px; }
.hero { text-align: center; margin-bottom: 18px; }
.brand { display: inline-block; font-size: 15px; font-weight: 900; letter-spacing: 5px; color: #0e8aa3; background: rgba(18,184,199,.12); border: 1.5px solid rgba(18,184,199,.55); border-radius: 999px; padding: 7px 22px; margin-bottom: 12px; }
.hero h1 { font-size: clamp(38px, 6vw, 62px); font-weight: 900; line-height: 1.02; color: var(--navy); }
.hero h1 .sun-word { color: var(--sun); text-shadow: 0 4px 14px rgba(255,180,61,.35); }
.subtitle { margin-top: 8px; font-size: clamp(16px, 2.4vw, 21px); font-weight: 700; color: var(--muted); }
.ready-pill { display: inline-block; margin-top: 12px; font-size: 14px; font-weight: 900; color: #158a54; background: rgba(52,201,142,.14); border: 2px solid rgba(52,201,142,.55); border-radius: 999px; padding: 5px 16px; }
#filters { display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; margin: 20px 0 24px; }
#filters button { font-family: var(--font); font-size: 15px; font-weight: 900; color: var(--navy); background: rgba(255,255,255,.85); border: 2px solid rgba(27,58,92,.18); border-radius: 999px; padding: 8px 18px; cursor: pointer; transition: transform .12s ease, background .12s ease, border-color .12s ease; }
#filters button:hover { transform: translateY(-2px); border-color: var(--teal); color: #0e8aa3; }
#filters button.active { background: var(--teal); border-color: var(--teal); color: #ffffff; box-shadow: 0 6px 16px rgba(18,184,199,.35); }
#filters button .count { display: inline-block; min-width: 24px; margin-left: 6px; font-size: 13px; background: rgba(27,58,92,.12); border-radius: 999px; padding: 1px 7px; }
#filters button.active .count { background: rgba(255,255,255,.25); }
#filters button:focus-visible { outline: 3px solid var(--sun); outline-offset: 2px; }
#grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(272px, 1fr)); gap: 22px; }
.card { background: var(--card); border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); border: 1.5px solid rgba(27,58,92,.1); display: flex; flex-direction: column; opacity: 0; animation: pop-in .45s ease forwards; transition: transform .15s ease, box-shadow .15s ease, border-color .15s ease; }
@keyframes pop-in { from { opacity: 0; transform: translateY(18px) scale(.97); } to { opacity: 1; transform: translateY(0) scale(1); } }
.card:not(.is-soon) { cursor: pointer; }
.card:not(.is-soon):hover, .card:not(.is-soon):focus-visible { transform: translateY(-6px) scale(1.015); box-shadow: var(--shadow-hover); border-color: rgba(18,184,199,.6); outline: none; }
.card.hidden, #empty.hidden { display: none; }
.cover { position: relative; line-height: 0; }
.cover svg { width: 100%; height: auto; display: block; }
.is-soon .cover::after { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, rgba(255,255,255,.05), rgba(27,58,92,.28)); pointer-events: none; }
.diff { position: absolute; top: 10px; left: 10px; font-size: 12px; font-weight: 900; color: #fff; border-radius: 999px; padding: 4px 12px; box-shadow: 0 2px 6px rgba(0,0,0,.25); z-index: 2; }
.diff.easy { background: #2bb673; } .diff.medium { background: #f59e1c; } .diff.hard { background: #ef5350; }
.ribbon { position: absolute; top: 12px; right: -34px; transform: rotate(38deg); font-size: 12px; font-weight: 900; letter-spacing: 1px; color: #fff; background: #7c8db5; padding: 5px 38px; box-shadow: 0 2px 6px rgba(0,0,0,.2); z-index: 2; }
.body { padding: 14px 16px 16px; display: flex; flex-direction: column; gap: 8px; flex: 1; }
.body h3 { font-size: 20px; font-weight: 900; color: var(--navy); line-height: 1.15; }
.desc { font-size: 14.5px; line-height: 1.45; color: var(--muted); font-weight: 700; flex: 1; }
.meta { display: flex; gap: 8px; }
.chip { font-size: 12px; font-weight: 900; text-transform: uppercase; letter-spacing: 1px; color: #0e8aa3; background: rgba(18,184,199,.14); border-radius: 999px; padding: 4px 12px; }
.play { display: block; text-align: center; text-decoration: none; font-size: 18px; font-weight: 900; letter-spacing: 1px; color: #fff; background: var(--btn, #2bb673); border-radius: 999px; padding: 11px 16px; box-shadow: 0 4px 0 rgba(27,58,92,.22); transition: transform .12s ease, filter .12s ease; }
.play:hover { transform: translateY(-2px); filter: brightness(1.08); }
.play:active { transform: translateY(2px); box-shadow: 0 1px 0 rgba(27,58,92,.22); }
.play:focus-visible { outline: 3px solid var(--sun); outline-offset: 2px; }
.play.soon { background: rgba(27,58,92,.1); color: #8aa0b5; box-shadow: none; cursor: default; font-size: 15px; }
#empty { text-align: center; background: var(--card); border-radius: var(--radius); padding: 34px 20px; font-size: 18px; font-weight: 700; color: var(--muted); box-shadow: var(--shadow); }
footer { text-align: center; margin-top: 30px; font-size: 14px; font-weight: 700; color: var(--muted); }
footer .heart { color: #ff6b8a; }
@media (max-width: 560px) {
  .wrap { padding: 18px 14px 30px; }
  #grid { grid-template-columns: 1fr; gap: 16px; }
  #filters { gap: 8px; margin: 14px 0 18px; }
  #filters button { font-size: 13px; padding: 7px 13px; }
  .brand { font-size: 12px; letter-spacing: 3px; }
  .body h3 { font-size: 18px; }
}
@media (prefers-reduced-motion: reduce) { .card { animation: none; opacity: 1; } .cloud { animation: none; } * { transition: none !important; } }

/* Dark mode — follows the site theme (body.dark synced from parent). */
body.dark {
  --ink: #dbe6f5;
  --muted: #8ba1bd;
  --card: #16283f;
  --navy: #e8f1fb;
  --shadow: 0 8px 24px rgba(0,0,0,.45);
  --shadow-hover: 0 18px 40px rgba(18,184,199,.25);
}
body.dark .cloud { background: #2a3f5e; opacity: .45; box-shadow: none; }
body.dark .cloud::before, body.dark .cloud::after { background: #2a3f5e; }
body.dark .brand { color: #7de3f0; background: rgba(18,184,199,.14); }
body.dark .hero h1 .sun-word { text-shadow: 0 4px 14px rgba(255,180,61,.25); }
body.dark .ready-pill { color: #7de8a0; background: rgba(52,201,142,.12); }
body.dark #filters button { color: var(--ink); background: rgba(255,255,255,.06); border-color: rgba(255,255,255,.16); }
body.dark #filters button:hover { border-color: var(--teal); color: #7de3f0; }
body.dark #filters button .count { background: rgba(255,255,255,.14); }
body.dark .card { border-color: rgba(255,255,255,.12); }
body.dark .chip { color: #7de3f0; }
body.dark .play.soon { background: rgba(255,255,255,.08); color: #7e92a8; }
body.dark #empty { box-shadow: var(--shadow); }
