/* Little Zoomer: a picture book. Cream paper, brown ink outlines, crayon colors, a round friendly font (Sniglet).
   Its own look. games.css loads first only for the shared rules (no selectable text, the back button's pop-up);
   everything you see is set here. */
@font-face { font-family: Sniglet; src: url(/fonts/sniglet-400.woff2) format('woff2'); font-weight: 400; font-display: swap; }
@font-face { font-family: Sniglet; src: url(/fonts/sniglet-800.woff2) format('woff2'); font-weight: 800; font-display: swap; }
:root {
  --paper: #fff4df; --card: #fffaf0; --ink: #3b2a20; --soft-ink: #7a6250; --red: #9b2f2a; --sun: #ffc93c;
  --sky: #9fd3ee; --leaf: #5aa35c; --pink: #f29a8a;
}
* { box-sizing: border-box; }
html, body.lz { height: 100%; margin: 0; overflow: hidden; overscroll-behavior: none; }
body.lz { background: var(--paper); color: var(--ink); font-family: Sniglet, "Trebuchet MS", system-ui, sans-serif; -webkit-tap-highlight-color: transparent; }
.lz #app { position: fixed; inset: 0; display: flex; flex-direction: column; }
.hidden { display: none !important; }
.muted { color: var(--soft-ink); }

button, .link { font: inherit; color: var(--ink); cursor: pointer; }
button { border: 3px solid var(--ink); border-radius: 18px 14px 20px 15px / 15px 20px 14px 18px; background: var(--card); padding: 10px 16px; min-height: 48px; font-weight: 800; font-size: 18px; box-shadow: 3px 4px 0 var(--ink); transition: transform .08s; }
button:active { transform: translate(2px, 3px); box-shadow: 1px 1px 0 var(--ink); }
button:focus-visible, .link:focus-visible { outline: 4px dashed var(--red); outline-offset: 3px; }
button[disabled] { opacity: .5; cursor: default; }
button.big { width: 100%; font-size: 26px; padding: 12px 18px; min-height: 64px; }
button.cta { background: var(--sun); }
button.soft { background: #f6e3c4; font-size: 17px; }
.link { background: none; border: 0; box-shadow: none; min-height: 44px; padding: 8px 10px; font-size: 16px; font-weight: 800; text-decoration: underline wavy var(--soft-ink) 1.5px; text-underline-offset: 5px; display: inline-flex; align-items: center; }
button.icon { min-width: 44px; min-height: 44px; padding: 4px 8px; font-size: 20px; border-radius: 50%; }

/* top bar */
.lz-top { position: absolute; top: 0; left: 0; right: 0; z-index: 20; display: flex; align-items: center; gap: 8px; padding: max(8px, env(safe-area-inset-top)) 10px 6px; pointer-events: none; }
.lz-top > * { pointer-events: auto; }
#back-slot:empty { display: none; }
/* back.js gives the arrow games.css's "quiet small" classes; keep it in this game's ink. */
button.back, button.back.quiet { color: var(--ink); background: var(--card); border: 3px solid var(--ink); box-shadow: 3px 4px 0 var(--ink); font-weight: 800; }
button.back { min-height: 44px; min-width: 44px; padding: 6px 14px 6px 10px; display: inline-flex; align-items: center; gap: 6px; font-size: 16px; }
.playing button.back { font-size: 0; gap: 0; padding: 6px; justify-content: center; }
.playing button.back span { font-size: 22px; }
.lz-top #sound { margin-left: auto; }
.playing #sound { display: none; }
#pause { margin-left: auto; }
.hud { flex: 1; min-width: 0; display: flex; align-items: center; gap: 10px; background: #fffaf0e6; border: 3px solid var(--ink); border-radius: 16px; padding: 4px 10px; box-shadow: 2px 3px 0 var(--ink); }
.hearts { display: flex; gap: 2px; font-size: 22px; line-height: 1; }
.hearts i { font-style: normal; color: #e0483f; }
.hearts i.gone { color: #3b2a2033; }
.hearts i.helmet { color: #3b78c2; }
.trip { position: relative; flex: 1; height: 12px; border: 2.5px solid var(--ink); border-radius: 99px; background: #f6e3c4; }
.trip i { position: absolute; inset: 0 auto 0 0; width: 0; border-radius: 99px; background: repeating-linear-gradient(-45deg, var(--sun) 0 6px, #ffd96a 6px 12px); }
.trip b { position: absolute; top: 50%; left: 0; width: 16px; height: 16px; transform: translate(-50%, -50%); border-radius: 50%; background: #f2cf6b; border: 2.5px solid var(--ink); }
.trip .flag { position: absolute; right: -6px; top: -14px; font-size: 18px; color: var(--red); }
.cookies { display: flex; align-items: center; gap: 4px; font-size: 20px; font-variant-numeric: tabular-nums; }
.ck { width: 20px; height: 20px; border-radius: 50%; background: radial-gradient(circle at 35% 40%, #5a3a22 0 2px, transparent 2.5px), radial-gradient(circle at 65% 60%, #5a3a22 0 2px, transparent 2.5px), #d9a35c; border: 2.5px solid var(--ink); }

#stage { position: relative; flex: 1; min-height: 0; }
#world { position: absolute; inset: 0; width: 100%; height: 100%; display: block; touch-action: none; }

/* pages over the moving world */
.page { position: absolute; inset: 0; z-index: 10; display: grid; place-items: center; padding: calc(max(8px, env(safe-area-inset-top)) + 56px) 16px max(16px, env(safe-area-inset-bottom)); overflow-y: auto; }
.on-home .page.home { background: linear-gradient(#fff4df00 40%, #fff4dfcc); }
.paper-card { width: min(440px, 100%); background: var(--card); border: 3px solid var(--ink); border-radius: 26px 22px 28px 20px / 20px 28px 22px 26px; padding: 20px; box-shadow: 5px 7px 0 var(--ink); display: flex; flex-direction: column; gap: 12px; position: relative; }
.paper-card::before { content: ""; position: absolute; top: -14px; left: 50%; width: 90px; height: 24px; transform: translateX(-50%) rotate(-2deg); background: #f7d6a8cc; border: 2px dashed #c9a676; }
.paper-card h2 { margin: 0; font-size: 28px; text-align: center; }
.paper-card p { margin: 0; text-align: center; }
.home .paper-card { align-self: end; }
@media (orientation: portrait) { .home .paper-card { align-self: start; } .home .tag { font-size: 15px; } }
.logo { margin: 0; text-align: center; font-size: clamp(40px, 12vw, 58px); line-height: .9; font-weight: 800; letter-spacing: .5px; }
.logo span { color: var(--red); display: block; font-size: .62em; transform: rotate(-4deg); }
.logo em { font-style: normal; color: var(--sun); -webkit-text-stroke: 2.5px var(--ink); paint-order: stroke fill; text-shadow: 3px 4px 0 var(--ink); display: inline-block; transform: rotate(2deg); }
.tag { font-size: 16px; }
.stars-total { text-align: center; font-size: 18px; min-height: 22px; }
.stars-total:empty { display: none; }
.row { display: flex; gap: 10px; }
.row > * { flex: 1; }
.small-row { justify-content: center; flex-wrap: wrap; gap: 0 14px; }
.small-row .link { white-space: nowrap; padding: 8px 6px; }
.small-row > * { flex: 0 1 auto; }
button.cta small { display: block; font-size: 15px; font-weight: 400; }
/* Easy / Normal / Hard: the picked one looks pressed into the page */
.paces { display: flex; gap: 8px; }
.paces button { flex: 1; min-height: 44px; padding: 4px 6px; font-size: 16px; background: #f6e3c4; box-shadow: 2px 3px 0 var(--ink); white-space: nowrap; }
.paces button[aria-pressed="true"] { background: #cfe6b6; transform: translate(2px, 3px); box-shadow: 0 0 0 var(--ink); }

/* ride list */
.ride-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.ride-list button { width: 100%; text-align: left; display: grid; grid-template-columns: 52px 1fr auto; gap: 10px; align-items: center; padding: 10px 12px; font-size: 19px; }
.ride-list .pic { width: 52px; height: 52px; border-radius: 14px; border: 2.5px solid var(--ink); display: grid; place-items: center; font-size: 28px; }
.ride-list small { display: block; font-weight: 400; font-size: 14px; color: var(--soft-ink); }
.ride-list .st { font-size: 18px; white-space: nowrap; letter-spacing: -2px; }
.ride-list .st i { font-style: normal; color: #3b2a2030; }
.ride-list .st i.on { color: var(--sun); -webkit-text-stroke: 1px var(--ink); }
.ride-list button.locked { background: #eee3cf; }

/* garage */
#garage-kid { width: 240px; height: 190px; align-self: center; }
.bikes { display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; }
.bikes button { width: 64px; height: 64px; border-radius: 50%; padding: 0; font-size: 14px; }
.bikes button.on { outline: 4px solid var(--sun); outline-offset: 2px; }
.bikes button.locked { opacity: .45; }

/* end card */
.end-card h2 { font-size: 32px; }
.end-sub { font-size: 17px; }
.end-stars { text-align: center; font-size: 46px; letter-spacing: 4px; }
.end-stars i { font-style: normal; display: inline-block; color: #3b2a2026; }
.end-stars i.on { color: var(--sun); -webkit-text-stroke: 2px var(--ink); animation: lz-pop .5s cubic-bezier(.2,1.8,.4,1) both; }
.end-stars i.on:nth-child(2) { animation-delay: .25s; }
.end-stars i.on:nth-child(3) { animation-delay: .5s; }
@keyframes lz-pop { from { transform: scale(0) rotate(-40deg); } to { transform: none; } }
.end-parts, .earned { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; font-size: 17px; }
.end-parts li { display: flex; justify-content: space-between; border-bottom: 2px dotted #c9a676; padding: 2px 0; }
.earned li { background: #fff1c4; border: 2px solid var(--ink); border-radius: 12px; padding: 4px 10px; text-align: center; }
.end-btns { display: grid; gap: 10px; }

.paused .paper-card { gap: 12px; }

/* place sign ("The Neighborhood!") during the Big Ride */
.place { position: absolute; z-index: 6; left: 50%; top: 22%; transform: translateX(-50%) rotate(-3deg); background: var(--sun); border: 3px solid var(--ink); border-radius: 14px; padding: 6px 18px; font-size: 26px; font-weight: 800; box-shadow: 3px 4px 0 var(--ink); animation: lz-pop .4s cubic-bezier(.2,1.8,.4,1); white-space: nowrap; }

/* hop and duck pads */
.pads { position: absolute; z-index: 8; left: 0; right: 0; bottom: 0; display: flex; justify-content: space-between; padding: 0 14px max(14px, env(safe-area-inset-bottom)); pointer-events: none; }
.pad { pointer-events: auto; width: 104px; height: 88px; border-radius: 28px; font-size: 18px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 0; background: #fffaf0d9; touch-action: none; user-select: none; -webkit-user-select: none; }
.pad span { font-size: 30px; line-height: 1; }
.pad.hop { background: #ffc93ce6; }
.pad.down { transform: translate(2px, 3px); box-shadow: 1px 1px 0 var(--ink); }
@media (pointer: fine) and (min-width: 900px) { .pads { display: none; } }

/* the how-to and tips */
.tip { position: absolute; z-index: 12; left: 50%; top: calc(max(8px, env(safe-area-inset-top)) + 64px); transform: translateX(-50%); width: min(420px, calc(100% - 24px)); display: flex; gap: 10px; align-items: center; background: var(--card); border: 3px solid var(--ink); border-radius: 16px; padding: 8px 8px 8px 14px; box-shadow: 3px 4px 0 var(--ink); font-size: 16px; }
.tip p { margin: 0; flex: 1; }
@media (orientation: landscape) { .playing .tip { top: auto; bottom: max(14px, env(safe-area-inset-bottom)); width: min(400px, calc(100% - 260px)); font-size: 14px; } }
.tip button { min-height: 40px; min-width: 40px; padding: 2px 8px; font-size: 16px; box-shadow: 2px 2px 0 var(--ink); }

/* the leave question (back.js and kit.js build it) */
.leave-ask { position: fixed; inset: 0; z-index: 50; background: #3b2a2099; display: grid; place-items: center; padding: 16px; }
.leave-ask .card { width: min(400px, 100%); background: var(--card); border: 3px solid var(--ink); border-radius: 24px; padding: 22px; box-shadow: 5px 7px 0 var(--ink); }
.leave-ask .card > * + * { margin-top: 12px; }
.leave-ask h2 { margin: 0; }
.leave-ask .stay { background: var(--sun); }

/* sign-in panel (account.js) */
.acct-card { text-align: center; }
.acct-card h2, .acct-card h3 { margin: 0; }
.acct-btns { display: grid; gap: 10px; }
.acct-btn { width: 100%; }
.acct-age { display: flex; gap: 8px; align-items: center; justify-content: center; font-size: 16px; }
.acct-age input { width: 22px; height: 22px; }
.acct-fine, .acct-kid { font-size: 14px; }
.acct-card a { color: var(--red); }

/* short screens (phones held sideways): tighter cards */
@media (max-height: 520px) {
  .page { padding-top: calc(max(6px, env(safe-area-inset-top)) + 52px); padding-bottom: 8px; }
  .paper-card { padding: 12px 16px; gap: 8px; }
  .paper-card::before { display: none; }
  .logo { font-size: 38px; }
  .tag { display: none; }
  button.big { min-height: 52px; font-size: 22px; padding: 6px 14px; }
  .paces button { min-height: 40px; font-size: 15px; }
  .pad { width: 92px; height: 72px; }
  .home .paper-card { align-self: center; margin-left: auto; }
  .end-stars { font-size: 34px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

/* Today's Ride */
button.today-btn { width: 100%; background: #bfe3f2; font-size: 20px; }
button.today-btn small { display: block; font-size: 14px; font-weight: 400; }
.rows { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; counter-reset: row; max-height: 46vh; overflow-y: auto; }
.rows li { counter-increment: row; display: grid; grid-template-columns: 34px 1fr auto; gap: 8px; align-items: center; font-size: 17px; border-bottom: 2px dotted #c9a676; padding: 4px 2px; }
.rows li::before { content: counter(row); font-weight: 800; color: var(--red); text-align: center; }
.rows li.me { background: #fff1c4; border-radius: 10px; }
.rows li.note { display: block; text-align: center; border: 0; }
.rows li.note::before { content: none; }
.end-place { font-size: 17px; }
.end-board { display: grid; gap: 6px; text-align: center; font-size: 16px; }
.name-row { display: flex; gap: 8px; }
.name-row input { flex: 1; min-width: 0; font: inherit; font-size: 18px; padding: 8px 12px; border: 3px solid var(--ink); border-radius: 14px; background: #fff; color: var(--ink); }
.name-row button { min-height: 44px; }
@media (max-height: 520px) { button.today-btn small { display: none; } button.today-btn { min-height: 44px; padding: 6px 12px; } }

/* The home fits one screen with the Easy / Normal / Hard row: short upright phones (360x640) get a tighter card;
   sideways phones get two columns (logo, difficulty and Ride! on the left; Pick a ride, Bike colors and Today's
   Ride on the right) with the small links across the bottom. */
@media (orientation: portrait) and (max-height: 720px) {
  .home .paper-card { gap: 8px; padding: 14px 16px; }
  .home .tag { font-size: 14px; }
  .home button.big { min-height: 56px; padding: 6px 14px; }
  .home .row .soft { font-size: 15px; padding: 8px; white-space: nowrap; }
  .home button.today-btn { padding: 6px 12px; }
  .home .small-row .link { min-height: 40px; }
}
@media (max-height: 520px) and (min-width: 560px) {
  .home .home-card { display: grid; grid-template-columns: 1fr 1fr; column-gap: 14px; row-gap: 8px; width: min(600px, 100%); align-items: center; }
  .home-card .logo { grid-column: 1; grid-row: 1; }
  .home-card .stars-total { grid-column: 1; grid-row: 2; font-size: 16px; }
  .home-card .paces { grid-column: 1; grid-row: 3; }
  .home-card #go-ride { grid-column: 1; grid-row: 4; }
  .home-card #go-daily { grid-column: 2; grid-row: 4; align-self: stretch; }
  .home-card .row:not(.small-row) { grid-column: 2; grid-row: 1 / 4; flex-direction: column; gap: 8px; align-self: stretch; justify-content: center; }
  .home-card .row:not(.small-row) .soft { flex: 0 0 auto; min-height: 48px; padding: 6px 10px; }
  .home-card .small-row { grid-column: 1 / -1; grid-row: 5; }
  .home-card .small-row .link { min-height: 40px; padding: 4px 6px; }
}
