/* Kids Game Arcade store. Bright crayon-box look for elementary players: sunny paper,
   chunky rounded type, sticker cards with the games' own 2px-ink cartoon outline, big tap targets. */
/* the hidden attribute always wins over component display rules (search results, modals, steps) */
[hidden] { display: none !important; }
@font-face { font-family: "Fredoka"; src: url("/fonts/fredoka.woff2") format("woff2"); font-weight: 400 700; font-display: swap; }
:root {
  --bg: #fff8e1; --bg2: #ffffff; --card: #ffffff; --line: #2b1b0e; --soft: #ffe9b0; --text: #2b1b0e; --muted: #6b5640;
  --sky: #4cc9f0; --sky2: #3a86ff; --red: #ff595e; --orange: #ff924c; --yellow: #ffca3a; --green: #2fbf71; --blue: #3a86ff; --purple: #8a5cf6; --pink: #ff70a6;
  --accent: var(--yellow); --accent2: var(--green); --ink: #2b1b0e; --radius: 22px; --pop: 0 5px 0 var(--ink);
  color-scheme: light;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; color: var(--text); font: 500 17px/1.5 "Fredoka", ui-rounded, "Arial Rounded MT Bold", system-ui, sans-serif;
  background: var(--bg) radial-gradient(circle at 12px 12px, #ffe7a3 2.5px, transparent 3px) 0 0 / 34px 34px; }
a { color: inherit; }
img { display: block; max-width: 100%; height: auto; }
h1, h2, h3 { font-weight: 700; letter-spacing: .2px; }
.wrap { max-width: 1040px; margin: 0 auto; padding: 0 16px 32px; }

.top { position: sticky; top: 0; z-index: 10; display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: calc(10px + env(safe-area-inset-top)) 16px 10px; background: linear-gradient(180deg, var(--sky), #7ad7f5); border-bottom: 3px solid var(--ink); }
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; line-height: 1; }
.brand img { border-radius: 12px; border: 2px solid var(--ink); }
.brand span { display: flex; flex-direction: column; gap: 2px; }
.logo { font-size: 23px; font-weight: 700; letter-spacing: .5px; -webkit-text-stroke: 1.2px var(--ink); paint-order: stroke fill; text-shadow: 0 2px 0 var(--ink); white-space: nowrap; }
.logo i { font-style: normal; display: inline-block; }
.logo i:nth-child(6n+1) { color: var(--red); } .logo i:nth-child(6n+2) { color: var(--orange); transform: rotate(-6deg); }
.logo i:nth-child(6n+3) { color: var(--yellow); } .logo i:nth-child(6n+4) { color: var(--green); transform: rotate(5deg); }
.logo i:nth-child(6n+5) { color: var(--blue); } .logo i:nth-child(6n) { color: var(--pink); transform: rotate(-4deg); }
.logo .sp { width: .28em; }
.brand small { font-size: 12px; font-weight: 700; letter-spacing: 2.5px; color: #fff; text-shadow: 0 1px 0 var(--ink), 1px 0 0 var(--ink), -1px 0 0 var(--ink), 0 -1px 0 var(--ink); }

.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: 48px; padding: 0 22px; border-radius: 16px; border: 3px solid var(--ink);
  background: var(--bg2); color: var(--ink); font: 700 17px/1 "Fredoka", ui-rounded, system-ui, sans-serif; letter-spacing: .5px; text-decoration: none; cursor: pointer;
  box-shadow: var(--pop); transition: transform .08s, box-shadow .08s; }
.btn:active { transform: translateY(4px); box-shadow: 0 1px 0 var(--ink); }
.btn:focus-visible, .chip:focus-visible, .cardlink:focus-visible, input:focus-visible, .dot:focus-visible { outline: 4px solid var(--purple); outline-offset: 3px; }
.btn.primary, .btn.play { background: var(--green); color: #fff; -webkit-text-stroke: .6px var(--ink); paint-order: stroke fill; text-shadow: 0 2px 0 var(--ink); }
.btn.small { min-height: 40px; padding: 0 16px; font-size: 15px; border-radius: 13px; box-shadow: 0 4px 0 var(--ink); }
.top .btn.small { background: var(--yellow); }
.btn.wide { width: 100%; margin-top: 16px; }

.carousel { position: relative; margin: 18px 0 6px; }
.track { display: flex; overflow-x: auto; scroll-snap-type: x mandatory; gap: 12px; border-radius: var(--radius); border: 3px solid var(--ink); box-shadow: 0 6px 0 var(--ink); scrollbar-width: none; }
.track::-webkit-scrollbar { display: none; }
.slide { position: relative; flex: 0 0 100%; scroll-snap-align: center; overflow: hidden; text-decoration: none; background: var(--card); }
.slide img { width: 100%; aspect-ratio: 1200 / 630; object-fit: cover; }
.dots { display: flex; justify-content: center; gap: 10px; margin-top: 14px; }
.dot { width: 16px; height: 16px; border-radius: 50%; border: 2px solid var(--ink); background: #fff; padding: 0; cursor: pointer; }
.dot.on { background: var(--yellow); transform: scale(1.2); }

.intro h1 { font-size: clamp(28px, 6vw, 40px); line-height: 1.1; margin: 20px 0 6px; }
.intro h1 .hi { background: linear-gradient(transparent 58%, var(--yellow) 58%); padding: 0 4px; }
.intro p { color: var(--muted); margin: 0 0 14px; max-width: 640px; font-size: 18px; }
.controls { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin: 8px 0 18px; }
input[type=search] { flex: 1 1 220px; min-height: 50px; padding: 0 16px; border-radius: 16px; border: 3px solid var(--ink); background: #fff; color: var(--text); font: 500 18px "Fredoka", ui-rounded, system-ui, sans-serif; }
input[type=search]::placeholder { color: #9a8670; }
.chips { display: flex; gap: 8px; flex-wrap: wrap; }
.chip { min-height: 44px; padding: 0 18px; border-radius: 999px; border: 3px solid var(--ink); background: #fff; color: var(--ink); font: 700 16px "Fredoka", ui-rounded, system-ui, sans-serif; cursor: pointer; }
.chip.on { background: var(--yellow); box-shadow: 0 3px 0 var(--ink); }

.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 22px; }
.card { --c: var(--blue); background: var(--card); border: 3px solid var(--ink); border-radius: var(--radius); overflow: hidden; display: flex; flex-direction: column;
  box-shadow: 0 6px 0 var(--ink); transition: transform .15s; }
.card:nth-child(5n+1) { --c: var(--red); } .card:nth-child(5n+2) { --c: var(--blue); } .card:nth-child(5n+3) { --c: var(--green); }
.card:nth-child(5n+4) { --c: var(--purple); } .card:nth-child(5n) { --c: var(--orange); }
.card:hover { transform: rotate(-1deg) translateY(-3px); } .card:nth-child(even):hover { transform: rotate(1deg) translateY(-3px); }
.cardlink { text-decoration: none; display: block; flex: 1; }
.thumb { width: 100%; aspect-ratio: 1200 / 630; object-fit: cover; border-bottom: 3px solid var(--ink); }
.body { display: flex; gap: 12px; padding: 12px 14px 4px; }
.icon { width: 52px; height: 52px; aspect-ratio: 1; object-fit: cover; align-self: flex-start; border-radius: 14px; flex: 0 0 auto; border: 2px solid var(--ink); }
.icon.big { width: 92px; height: 92px; border-radius: 22px; border-width: 3px; box-shadow: 0 4px 0 var(--ink); }
.card h3 { margin: 0; font-size: 21px; line-height: 1.2; }
.card p { margin: 2px 0 6px; color: var(--muted); font-size: 15px; }
.tags { display: flex; flex-wrap: wrap; gap: 6px; }
.tag { font-size: 13px; font-weight: 600; padding: 2px 10px; border-radius: 999px; background: var(--soft); border: 2px solid var(--ink); color: var(--ink); }
.row { display: flex; justify-content: space-between; align-items: center; padding: 8px 14px 16px; background: color-mix(in srgb, var(--c) 18%, #fff); border-top: 2px dashed color-mix(in srgb, var(--c) 60%, var(--ink)); margin-top: 8px; }
.free { font-weight: 700; color: var(--ink); background: var(--yellow); border: 2px solid var(--ink); border-radius: 999px; padding: 1px 10px; font-size: 14px; letter-spacing: .5px; }
.empty { color: var(--muted); text-align: center; padding: 24px; font-size: 18px; }

.why { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 14px; margin-top: 32px; }
.why div { border: 3px solid var(--ink); border-radius: 18px; padding: 14px 16px; display: flex; flex-direction: column; box-shadow: 0 4px 0 var(--ink); }
.why div:nth-child(1) { background: #d7f5ff; } .why div:nth-child(2) { background: #dcf8e6; } .why div:nth-child(3) { background: #ffe1ec; }
.why b { font-size: 19px; } .why span { color: var(--muted); font-size: 15px; }

.back { display: inline-flex; align-items: center; min-height: 44px; margin: 10px 0 6px; color: var(--ink); text-decoration: none; font-weight: 700; font-size: 18px; }
.gamehero { width: 100%; aspect-ratio: 1200 / 630; object-fit: cover; border-radius: var(--radius); border: 3px solid var(--ink); box-shadow: 0 6px 0 var(--ink); }
.gamehead { display: flex; gap: 16px; align-items: center; margin: 20px 0 14px; }
.gamehead h1 { margin: 0; font-size: 32px; line-height: 1.1; }
.dev { margin: 4px 0 8px; color: var(--muted); }
.actions { display: flex; gap: 14px; flex-wrap: wrap; }
.actions .btn { flex: 1 1 140px; min-height: 60px; font-size: 22px; border-radius: 20px; }
.lead { font-size: 20px; margin: 18px 0; }
.shots { display: flex; gap: 14px; overflow-x: auto; scroll-snap-type: x mandatory; padding: 6px 2px 14px; }
.phone { margin: 0; flex: 0 0 auto; width: 180px; border: 6px solid var(--ink); border-radius: 24px; overflow: hidden; scroll-snap-align: start; background: #000; }
.phone:nth-child(odd) { transform: rotate(-1.5deg); } .phone:nth-child(even) { transform: rotate(1.5deg); }
.phone img { width: 100%; aspect-ratio: 9 / 16; object-fit: cover; }
.block { background: var(--card); border: 3px solid var(--ink); border-radius: var(--radius); padding: 16px 18px; margin-top: 18px; box-shadow: 0 5px 0 var(--ink); }
.block h2 { margin: 0 0 8px; font-size: 22px; }
.block p { margin: 0; color: var(--muted); }
.board { background: #fff6cc; }
.scores { list-style: none; margin: 10px 0 0; padding: 0; counter-reset: rank; }
.scores li { display: flex; justify-content: space-between; padding: 9px 4px; border-bottom: 2px dashed #e7cf86; font-variant-numeric: tabular-nums; font-size: 18px; }
.scores li:last-child { border-bottom: 0; }
.scores li.row-score::before { counter-increment: rank; content: counter(rank); width: 30px; height: 30px; margin-right: 10px; border-radius: 50%; border: 2px solid var(--ink);
  background: #fff; display: inline-flex; align-items: center; justify-content: center; font-weight: 700; font-size: 15px; }
.scores li.row-score:nth-child(1)::before { background: var(--yellow); } .scores li.row-score:nth-child(2)::before { background: #dfe6ee; } .scores li.row-score:nth-child(3)::before { background: #f3b27a; }
.scores .ini { flex: 1; font-weight: 700; letter-spacing: 3px; }
.muted { color: var(--muted); }
.info { display: grid; grid-template-columns: max-content 1fr; gap: 6px 16px; margin: 0; }
.info dt { color: var(--muted); } .info dd { margin: 0; overflow-wrap: anywhere; }

.foot { max-width: 1040px; margin: 0 auto; padding: 24px 16px calc(32px + env(safe-area-inset-bottom)); color: var(--muted); font-size: 15px; text-align: center; }
.build { opacity: .7; font-size: 12px; }
.owner { margin: 6px 0 0; font-weight: 700; color: var(--text); opacity: .85; }

.modal { position: fixed; inset: 0; z-index: 50; background: rgba(43,27,14,.45); display: flex; align-items: flex-end; justify-content: center; }
.modal[hidden] { display: none; }
.sheet { position: relative; width: min(560px, 100%); background: var(--bg); color: var(--text); border: 3px solid var(--ink); border-bottom: 0; border-radius: 26px 26px 0 0;
  padding: 22px 18px calc(22px + env(safe-area-inset-bottom)); max-height: 90vh; overflow: auto; }
@media (min-width: 640px) { .modal { align-items: center; } .sheet { border-radius: 26px; border-bottom: 3px solid var(--ink); box-shadow: 0 8px 0 var(--ink); } }
.sheet h2 { margin: 0 44px 6px 0; font-size: 24px; }
.grownup { margin: 0 0 12px; color: var(--muted); }
.close { position: absolute; top: 10px; right: 12px; width: 44px; height: 44px; border: 3px solid var(--ink); border-radius: 50%; background: #fff; color: var(--ink); font-size: 26px; line-height: 1; cursor: pointer; }
.tabs { display: flex; gap: 6px; margin-bottom: 12px; flex-wrap: wrap; }
.tabs button { min-height: 44px; padding: 0 14px; border-radius: 12px; border: 3px solid var(--ink); background: #fff; color: var(--ink); font: 700 15px "Fredoka", ui-rounded, system-ui, sans-serif; cursor: pointer; }
.tabs button[aria-selected=true] { background: var(--sky); }
.steps { margin: 0; padding-left: 24px; font-size: 18px; } .steps li { margin: 10px 0; } .steps[hidden] { display: none; }
.ico { display: inline-block; padding: 0 6px; border: 2px solid var(--ink); border-radius: 6px; background: #fff; }

@media (prefers-reduced-motion: reduce) { .card, .btn { transition: none; } .card:hover, .card:nth-child(even):hover { transform: none; } }
@media (max-width: 380px) { .logo { font-size: 19px; } .brand small { font-size: 10px; letter-spacing: 2px; } }

/* footer parents line and privacy page */
.parents { margin: 8px 0 0; } .parents a { font-weight: 700; color: var(--ink); }
.privacy h1 { font-size: 34px; margin: 10px 0 0; }
.privacy .kids { background: #d7f5ff; } .privacy .kids p { color: var(--ink); font-size: 19px; }
.privacy h3 { margin: 16px 0 4px; font-size: 18px; }
.privacy ul { margin: 4px 0; padding-left: 22px; color: var(--muted); } .privacy li { margin: 4px 0; }
.privacy .block p + p { margin-top: 8px; }

/* grown-ups page and parent gate */
.grownups h1 { font-size: 34px; margin: 10px 0 0; }
.grownups .story .icons { display: flex; gap: 10px; margin-top: 12px; flex-wrap: wrap; }
.grownups .story .icons img { border-radius: 14px; border: 2px solid var(--ink); }
.grownups .pays { margin: 4px 0 0; padding-left: 22px; color: var(--muted); } .grownups .pays li { margin: 4px 0; }
.grownups .support { background: #fffdf6; }
.grownups .note { color: var(--ink); font-weight: 600; margin: 0 0 12px; }
.grownups .fine { font-size: 14px; margin: 12px 0 0; }
.grownups .status { font-weight: 600; color: var(--ink); min-height: 1.5em; margin: 6px 0 0; }
.grownups .addr { font-weight: 600; margin-left: 6px; overflow-wrap: anywhere; }
.grownups .thanks { background: #dcf8e6; text-align: center; }
.grownups .thanks h2 { font-size: 28px; }
.grownups .thanks .btn { margin-top: 12px; }
/* tip buttons are deliberately not the green PLAY style kids know */
.tips { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.btn.tip { flex-direction: column; min-height: 76px; padding: 8px; background: #fff; gap: 2px; }
.btn.tip b { font-size: 26px; line-height: 1; }
.btn.tip span { font-size: 13px; font-weight: 600; color: var(--muted); }
.btn:disabled { opacity: .5; cursor: not-allowed; box-shadow: none; }
.gate .sheet h2 { margin-right: 52px; }
.gate label { display: block; font-size: 22px; font-weight: 700; margin: 6px 0 10px; }
.gaterow { display: flex; gap: 10px; }
.gaterow input { flex: 1; min-width: 0; min-height: 52px; padding: 0 14px; border-radius: 14px; border: 3px solid var(--ink); font: 700 24px "Fredoka", ui-rounded, system-ui, sans-serif; background: #fff; color: var(--ink); }
.gaterow input:focus-visible { outline: 4px solid var(--purple); outline-offset: 2px; }
.gate .hint { color: var(--muted); margin: 8px 0 0; }
.gatemsg { font-weight: 600; min-height: 1.5em; margin: 8px 0 0; }

.makebtn { min-height: 54px; font-size: 19px; margin-right: 8px; }

/* "New games by kids" row (filled by the Worker from approved wizard games) */
.kidgames h2 { font-size: 24px; margin: 6px 0 10px; }
.kidrow { display: flex; gap: 14px; overflow-x: auto; padding: 4px 2px 14px; scroll-snap-type: x mandatory; }
.kidcard { flex: 0 0 150px; scroll-snap-align: start; display: flex; flex-direction: column; align-items: center; text-align: center; gap: 4px; padding: 10px; background: #fff; border: 3px solid var(--ink); border-radius: 18px; box-shadow: 0 4px 0 var(--ink); text-decoration: none; }
.kidcard img { width: 110px; height: 110px; object-fit: contain; }
.kidcard b { font-size: 16px; line-height: 1.15; } .kidcard small { color: var(--muted); font-size: 13px; }
/* catalog pages */
.pager { display: flex; justify-content: center; flex-wrap: wrap; gap: 8px; margin: 18px 0 6px; }
.pager .pg { min-width: 48px; min-height: 48px; padding: 0 12px; border: 3px solid var(--ink); border-radius: 14px; background: #fff; font: 700 18px Fredoka, ui-rounded, system-ui, sans-serif; color: var(--ink); cursor: pointer; box-shadow: 0 3px 0 var(--ink); }
.pager .pg.on { background: var(--yellow); }
.pager .pg:disabled { opacity: .4; cursor: default; box-shadow: none; }
.controls .chips { flex-wrap: wrap; }
/* inside the installed arcade app kids just play: no "install this game" or "get the app" buttons */
@media (display-mode: standalone), (display-mode: fullscreen), (display-mode: minimal-ui) { [data-guide], #installStore { display: none !important; } }
.in-app [data-guide], .in-app #installStore { display: none !important; }
