/* Fonts: Rubik for reading, a "Display" face for titles and numbers —
   Secular One for Hebrew (the same as the other kids apps) and Fredoka for English and digits. */
@font-face { font-family: Rubik; font-weight: 500; font-display: swap; src: url(/fonts/rubik-500-latin.woff2) format('woff2'); unicode-range: U+0000-00FF, U+2000-206F, U+2190-22FF; }
@font-face { font-family: Rubik; font-weight: 500; font-display: swap; src: url(/fonts/rubik-500-hebrew.woff2) format('woff2'); unicode-range: U+0590-05FF, U+FB1D-FB4F; }
@font-face { font-family: Rubik; font-weight: 700; font-display: swap; src: url(/fonts/rubik-700-latin.woff2) format('woff2'); unicode-range: U+0000-00FF, U+2000-206F, U+2190-22FF; }
@font-face { font-family: Rubik; font-weight: 700; font-display: swap; src: url(/fonts/rubik-700-hebrew.woff2) format('woff2'); unicode-range: U+0590-05FF, U+FB1D-FB4F; }
@font-face { font-family: Display; font-weight: 700; font-display: swap; src: url(/fonts/fredoka-700-latin.woff2) format('woff2'); unicode-range: U+0000-00FF, U+2000-206F, U+2190-22FF; }
@font-face { font-family: Display; font-weight: 700; font-display: swap; src: url(/fonts/secular-400-hebrew.woff2) format('woff2'); unicode-range: U+0590-05FF, U+FB1D-FB4F; }

:root {
  /* a risograph print: cobalt ink lines on cream paper, with fluorescent pink, sunflower and mint */
  --ink: #1F2A8F;
  --muted: #5A62A6;
  --cream: #FFF4DC;
  --paper: #FFFAEE;
  --cobalt: #2E4BDB;
  --cobalt-2: #3D5DF0;
  --pink: #FF4FA3;
  --pink-2: #E23A8D;
  --mint: #45D3A0;
  --mint-2: #8BE7C5;
  --sky: #2E4BDB;
  --sky-2: #C9D6FF;
  --grass: #45D3A0;
  --grass-2: #8BE7C5;
  --track: #FF4FA3;
  --sun: #FFD23F;
  --sun-2: #F2B51C;
  --coral: #FF4FA3;
  --blue: #4F7BFF;
  --leaf: #45D3A0;
  --berry: #FF7CC0;
  --wood: #FF4FA3;
  --wood-2: #E23A8D;
  --print: 7px 7px 0 var(--pink);
  --print-sm: 5px 5px 0 var(--pink);
  --line: 4px solid var(--ink);
  --display: Display, Rubik, system-ui, sans-serif;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body { font-family: Rubik, system-ui, -apple-system, 'Segoe UI', Arial, sans-serif; font-weight: 500; color: var(--ink); font-synthesis: none; }
button { font: inherit; color: inherit; cursor: pointer; border: 0; background: none; padding: 0; }
h1, h2, h3, .display { font-family: var(--display); font-weight: 700; letter-spacing: .2px; }
.math, .num { direction: ltr; unicode-bidi: isolate; font-variant-numeric: tabular-nums; }
.art, .char, .ic { display: block; flex: none; }
[hidden] { display: none !important; }

/* chunky outlined buttons, like stickers you can press */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 12px;
  font-family: var(--display); font-weight: 700; text-decoration: none; text-align: center;
  background: var(--cream); color: var(--ink); border: var(--line); border-radius: 999px;
  box-shadow: 0 5px 0 var(--ink); transition: transform .08s, box-shadow .08s;
}
/* printed paper: a speckle of ink and paper fibres laid over everything */
.grain { position: absolute; inset: 0; pointer-events: none; background: url(/img/grain.png) 0 0 / 384px 384px; }
/* the animals are die-cut stickers; a hat can sit on any of them */
.char.stk { display: flex; align-items: flex-end; justify-content: center; }
.stk .fig { position: relative; flex: none; aspect-ratio: var(--ar); max-width: 100%; max-height: 100%; }
.stk .fig.wide { width: 100%; height: auto; }
.stk .fig.tall { height: 100%; width: auto; }
.stk img { display: block; width: 100%; height: 100%; user-select: none; -webkit-user-drag: none; }
.stk .hat { position: absolute; aspect-ratio: 1; height: auto; overflow: visible; transform: translate(-50%, -86%) rotate(var(--r, 0deg)); }
.btn.primary { background: var(--sun); }
.btn:active:not(:disabled) { transform: translateY(4px); box-shadow: 0 1px 0 var(--ink); }
.btn:disabled { opacity: .45; box-shadow: none; transform: translateY(4px); }

@keyframes pop-in { 0% { transform: scale(.4); opacity: 0; } 70% { transform: scale(1.08); opacity: 1; } 100% { transform: scale(1); } }
@keyframes bounce { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-10%); } }
@keyframes bob { 0%, 100% { transform: translateY(0) rotate(-2deg); } 50% { transform: translateY(-6%) rotate(2deg); } }
@keyframes wobble { 0%, 100% { transform: rotate(0); } 25% { transform: rotate(-9deg); } 75% { transform: rotate(9deg); } }
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes dot { 0%, 80%, 100% { transform: translateY(0); } 40% { transform: translateY(-12px); } }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}

/* how-to pictures for the newer mini-games (the phone and the TV both show them) */
.d-odd { display: grid; grid-template-columns: repeat(3, 76px); grid-auto-rows: 76px; gap: 10px; justify-content: center; align-content: center; }
.d-odd > span { display: grid; place-items: center; background: var(--cream); border: 4px solid var(--ink); border-radius: 14px; box-shadow: 4px 4px 0 var(--pink); }
.d-odd > span svg { width: 54px; height: 54px; }
.d-odd > span.odd svg { filter: hue-rotate(150deg) saturate(1.3); }
.d-odd > span.odd { animation: oddglow 1.6s ease-in-out infinite; }
@keyframes oddglow { 0%, 45% { box-shadow: 4px 4px 0 var(--pink); transform: none; } 60%, 90% { box-shadow: 0 0 0 6px var(--sun), 4px 4px 0 var(--pink); transform: scale(1.12); } }
.d-odd .finger { position: absolute; left: calc(50% + 6px); top: 112px; }
.d-pairs { display: flex; gap: 12px; align-items: center; justify-content: center; }
.d-pairs .dc { position: relative; width: 56px; height: 76px; perspective: 400px; }
.d-pairs .dc i { position: absolute; inset: 0; display: grid; place-items: center; border: 4px solid var(--ink); border-radius: 10px; backface-visibility: hidden; -webkit-backface-visibility: hidden; animation: cardA 3.2s ease-in-out infinite; }
.d-pairs .dc .bk { background: repeating-linear-gradient(45deg, var(--pink) 0 8px, var(--pink-2) 8px 16px); }
.d-pairs .dc .fc { background: var(--cream); animation-name: cardB; }
.d-pairs .dc .fc svg { width: 44px; height: 44px; }
.d-pairs .c0 i, .d-pairs .c3 i { animation-delay: 1.4s; }
@keyframes cardA { 0%, 12% { transform: rotateY(0); } 20%, 92% { transform: rotateY(180deg); } 100% { transform: rotateY(360deg); } }
@keyframes cardB { 0%, 12% { transform: rotateY(180deg); } 20%, 92% { transform: rotateY(360deg); } 100% { transform: rotateY(540deg); } }
.d-pairs .finger { position: absolute; left: 92px; top: 112px; }
.d-catch { overflow: hidden; border-radius: 18px; border: 4px solid var(--ink); background: linear-gradient(#9DD8FF, #DFF4FF 80%, #45D3A0 80.5%); box-shadow: var(--print); direction: ltr; }
.d-catch span { position: absolute; }
.d-catch .dbasket { bottom: 4px; left: 20px; animation: basketgo 2.4s ease-in-out infinite; }
.d-catch .dfruit { left: 150px; top: -60px; animation: fruitfall 2.4s ease-in infinite; }
.d-catch .drock { left: 40px; top: -50px; animation: fruitfall 2.4s ease-in 1.2s infinite; }
@keyframes basketgo { 0%, 15% { transform: translateX(0); } 45%, 70% { transform: translateX(118px); } 100% { transform: translateX(0); } }
@keyframes fruitfall { 0% { transform: translateY(0); opacity: 1; } 62% { transform: translateY(170px); opacity: 1; } 66%, 100% { transform: translateY(176px); opacity: 0; } }
