/* Slice Parade: base (font, sizes, colors, buttons, top-right corner). Sizes in --u: portrait 1u = 1% of the stage width
   (reference designs: 941 px = 100u); landscape 1u = 1% of the height. --u and --sw come from src/ui/stage.js (14 px cap). Clean Fredoka 600 text,
   no outline. Stretchy pieces are 9 slices assembled on a canvas by src/lib/nine.js (border-image only describes the cut). */
@font-face {
  font-family: 'Fredoka';
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url(../fonts/fredoka-600-latin.woff2) format('woff2');
  unicode-range:
    U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191,
    U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: 'Fredoka';
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url(../fonts/fredoka-600-latin-ext.woff2) format('woff2');
  unicode-range:
    U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020,
    U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
/* Cyrillic (ru): Fredoka has none; Nunito (OFL, rounded) is used only for those letters, bundled in the package */
@font-face {
  font-family: 'Fredoka';
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url(../fonts/nunito-cyrillic-900.woff2) format('woff2');
  unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
}
:root {
  --u: min(1vmin, 11px); /* before the JS: src/ui/stage.js then sets --u, --sw */
  --sat: env(safe-area-inset-top, 0px);
  --sab: env(safe-area-inset-bottom, 0px);
  --sal: env(safe-area-inset-left, 0px);
  --sar: env(safe-area-inset-right, 0px);
  --ink: #1763d6;
  --ink-dk: #0f4bb0;
  --pink: #1fa5f7;
  --pink-dk: #0f7fd0; /* sky-blue kit: old names kept */
  --sky: #86c8f2;
  --pop: cubic-bezier(0.34, 1.56, 0.64, 1);
  /* Fredoka has no Cyrillic or CJK: system fallback, rounded and bold when available */
  --font:
    'Fredoka', 'Nunito', 'Arial Rounded MT Bold', 'Hiragino Maru Gothic ProN', 'Yu Gothic UI', 'Meiryo', 'Malgun Gothic',
    'Apple SD Gothic Neo', 'PingFang SC', 'Microsoft YaHei', system-ui, sans-serif;
  /* ONLY text-centering mechanism: the text box covers the whole piece and the text centers in it; --cap corrects the
     font (the ink of Fredoka capitals sits a hair below the middle of the line) and each art declares the offset of its face (--fd-*). */
  --cap: 0em;
  --corner: max(44px, calc(var(--u) * 10.8)); /* sound, gear, back */
}
/* ---- UI DESIGN SYSTEM (one place only). --lk = 1 in portrait and .8 in landscape (1u is 1% of the height
   in landscape: everything shrinks together, nothing is adjusted per screen). Spacing: 5 steps. Type: 4 steps (ratio ~1.22). Button: 2 heights, letter = 46% of the height. ---- */
body {
  --lk: 1;
  --sp-1: calc(var(--u) * 1.2 * var(--lk));
  --sp-2: calc(var(--u) * 2.4 * var(--lk));
  --sp-3: calc(var(--u) * 3.6 * var(--lk));
  --sp-4: calc(var(--u) * 4.8 * var(--lk));
  --sp-5: calc(var(--u) * 7.2 * var(--lk));
  --t1: calc(var(--u) * 4.1 * var(--lk)); /* body text: steps, hint, language switch */
  --t2: calc(var(--u) * 4.9 * var(--lk)); /* small button, language name, note, bar value */
  --t3: calc(var(--u) * 6 * var(--lk)); /* large button, value, list row, level number */
  --t4: calc(var(--u) * 7.4 * var(--lk)); /* ribbon title and highlight ("Level 7"): the highlight never exceeds the title */
  --bh-l: calc(var(--u) * 14.4 * var(--lk)); /* large button (letter --t3) */
  --bh-s: calc(var(--u) * 12.2 * var(--lk)); /* small button (letter --t2) */
  --rh: calc(var(--u) * 13 * var(--lk)); /* title ribbon, the same in every panel */
  --ch: calc(var(--u) * 7.2 * var(--lk)); /* height of the controls inside rows (switch and language button) */
  --gap-ico: 0.35em; /* gap between the icon and the word: always in em */
  /* offset of the face of each art (fraction of the piece height; negative = the face is higher than the piece center); an internal tool (not included) */
  --fd-main: -0.014;
  --fd-sub: -0.013;
  --fd-pink: -0.013;
  --fd-lang: -0.054;
  --fd-capsule: 0;
  --fd-band: -0.044;
  --fd-sq: -0.02;
}
body.land {
  --lk: 0.8;
}
:lang(ja),
:lang(ko),
:lang(zh-Hans) {
  --cap: 0.04em;
  font-weight: 800;
}
:lang(ko) {
  --cap: 0.065em;
} /* the system font ink sits higher; real bold (600 is not enough) */
.face:lang(ja),
.lbl:lang(ja),
.rowtxt:lang(ja),
.face:lang(ko),
.lbl:lang(ko),
.rowtxt:lang(ko),
.face:lang(zh-Hans),
.lbl:lang(zh-Hans),
.rowtxt:lang(zh-Hans) {
  -webkit-text-stroke: 0.04em currentColor;
  letter-spacing: 0.02em;
} /* same visual weight as the thickened Fredoka */
* {
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
}
html,
body {
  margin: 0;
  height: 100%;
  overflow: hidden;
  background: var(--sky);
}
body {
  font-family: var(--font);
  font-weight: 600;
  color: var(--ink);
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
  -webkit-touch-callout: none;
}
img {
  -webkit-user-drag: none;
  user-select: none;
}
p {
  margin: 0;
}
[hidden] {
  display: none !important;
}
button {
  font: inherit;
  color: inherit;
  border: 0;
  background: none;
  padding: 0;
  cursor: pointer;
  position: relative;
}
button:focus {
  outline: none;
}
button:focus-visible {
  outline: max(2px, calc(var(--u) * 0.5)) solid var(--ink);
  outline-offset: calc(var(--u) * 0.4);
  border-radius: 999px;
}

/* page background (src/ui/bg.js swaps it for the world scenery); covers the whole window, including the leftovers of an ultrawide screen */
#bg {
  position: fixed;
  inset: 0;
  background: linear-gradient(#7cc4f4, #bfe3f8 55%, #e4d6cc) center / cover no-repeat;
  transition: background-image 0.3s ease;
}
#stage {
  position: fixed;
  top: 0;
  bottom: 0;
  left: calc((100% - var(--sw, 100vw)) / 2);
  width: var(--sw, 100vw);
  overflow: hidden;
} /* no transform: the dimmed backdrop of the panels (fixed) covers the whole window */
#game-root {
  position: absolute;
  inset: 0;
  display: none;
}
body[data-screen='game'] #game-root {
  display: block;
}

/* ---- text ---- */
.face,
.lbl,
.rowtxt {
  font-kerning: none; /* the Fredoka kerning pulls the I into the V/N: "NIVEAUX" read as "NVEAUX" (fr/it/es) */
  letter-spacing: 0.005em;
  line-height: 1.15;
  white-space: nowrap;
  -webkit-text-stroke: 0.024em currentColor;
} /* same stroke as the letter color: thickens Fredoka 600 to the weight of the design (not an outline) */
.face {
  display: block;
  min-width: 0;
  max-width: 100%;
  text-align: center;
  pointer-events: none;
  translate: 0 calc(var(--cap) + var(--fd, 0) * var(--h, 0px) + var(--pd, 0px));
}
.ribbon .face {
  color: #fff;
  text-transform: uppercase;
  text-shadow: 0 0.05em 0 rgba(150, 16, 78, 0.5);
}
.pb .face {
  text-transform: uppercase;
}
.ct,
.ct .face {
  line-height: 1;
}
.ct {
  margin-block: -0.17em -0.17em;
}
:lang(ja) .ct,
:lang(zh-Hans) .ct {
  margin-block: -0.07em -0.07em;
} /* the ink of Japanese/Chinese is higher than that of Latin capitals */
:lang(ko) .ct {
  margin-block: -0.01em -0.01em;
} /* loose text (highlight, note): the box becomes the ink of the capitals, so the panel gaps are measured ink to ink */

/* ---- press (src/ui/uifx.js, startPress): data-down while the finger is on the button; sinks at once and springs back. `translate` and `scale` separate,
   never `transform` (the uifx.js entries use transform: one does not cancel the other). Attribute, not class: nine.js only looks at the class. ---- */
:is(button.pb, .sq, .x, .sw, .tile:not(.locked), .lrow) {
  transition:
    translate 0.34s cubic-bezier(0.22, 1.5, 0.4, 1),
    scale 0.34s cubic-bezier(0.22, 1.5, 0.4, 1),
    filter 0.12s;
}
:is(button.pb, .sq, .x, .sw, .tile, .lrow)[data-down] {
  transition-duration: 60ms;
  transition-timing-function: ease-out;
  filter: brightness(0.9);
}
:is(button.pb, .lrow)[data-down] {
  translate: 0 calc(var(--h) * 0.08);
  scale: 0.96 0.91;
}
:is(.sq, .x)[data-down] {
  scale: 0.86;
}
:is(.tile, .sw)[data-down] {
  scale: 0.92;
}
@media (hover: hover) {
  :is(button.pb, .lrow):not(:disabled, [data-down]):hover {
    translate: 0 -4%;
  }
  :is(.sq, .x):not(:disabled, [data-down]):hover {
    scale: 1.06;
  }
}
body.reduced :is(button.pb, .sq, .x, .sw, .tile, .lrow) {
  transition-duration: 1ms;
}
/* the menu and the level select stay drawn while they leave; what is leaving takes no touch and the screen holds the touch (nothing reaches the game) */
#s-menu[data-leaving],
#s-map[data-leaving] {
  display: flex;
  z-index: 8;
} /* above the game that is already coming in (the game table and HUD have their own z-index) */
:is(#s-menu, #s-map)[data-leaving] > * {
  pointer-events: none !important;
}
/* panel open over the menu: logo, panda, buttons and "tap to start" go offstage (the scenery stays) */
body.modal-open #s-menu:not([data-leaving]) :is(.logo, .hero, .menu-btns, .tap) {
  visibility: hidden;
}
.modal [data-out],
.modal [data-out] * {
  pointer-events: none !important;
}

/* ---- pill button: 9 slices, only the middle stretches. Icon and word are ONE inline group, centered on both axes, .35em gap, 1.1em icon;
   the letter comes from --fs on the whole button (fit.js shrinks the button, not the word: icon and gap shrink together). Two roles: large (main, pink) and small (sub). ---- */
.pb {
  --h: var(--bh-l);
  --fs: var(--t3);
  --fd: var(--fd-main);
  --art: 213;
  --edge: 67;
  --sc: calc(var(--h) / var(--art));
  --cw: calc(var(--sc) * var(--edge));
  --img: url(../assets/ui/btn-main.webp);
  --w: 0px;
  font-size: var(--fs);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--gap-ico);
  height: var(--h);
  min-width: min(var(--w), 100%);
  max-width: var(--wmax, none);
  padding-inline: var(--px, calc(var(--h) * 0.1));
  border: 0 solid transparent;
  border-width: 0 var(--cw);
  border-image: var(--img) 0 var(--edge) fill / 0 var(--cw);
}
.pb.sub {
  --h: var(--bh-s);
  --fs: var(--t2);
  --art: 197;
  --edge: 66;
  --fd: var(--fd-sub);
  --img: url(../assets/ui/btn-sub.webp);
}
.pb.pink {
  --art: 196;
  --edge: 72;
  --fd: var(--fd-pink);
  --img: url(../assets/ui/btn-pink.webp);
}
.pb.cta {
  --h: calc(var(--bh-l) * 1.18);
  --fs: var(--t4);
  --art: 196;
  --edge: 72;
  --fd: var(--fd-pink);
  --img: url(../assets/ui/btn-pink.webp);
}
.pb.cta .face {
  color: #fff;
  text-shadow: 0 0.045em 0 rgba(10, 80, 150, 0.35);
} /* main action = solid blue button, white letter */ /* the main action of the screen (PLAY, NEXT, AGAIN): same letter/height ratio, one step up */
.pb.lang {
  --art: 166;
  --edge: 65;
  --fd: var(--fd-lang);
  --img: url(../assets/ui/lang-off.webp);
}
.pb .face {
  flex: 0 0 auto;
  max-width: none;
  font-size: 1em;
  color: var(--ink);
  letter-spacing: 0.01em;
}
.pb.pink .face {
  color: #fff;
  text-shadow: 0 0.045em 0 rgba(10, 80, 150, 0.35);
}
.pb .ico {
  flex: none;
  width: 1.1em;
  height: 1.1em;
  object-fit: contain;
  pointer-events: none;
  translate: 0 calc(var(--fd) * var(--h) + var(--pd, 0px));
}
.pb::after {
  content: '';
  position: absolute;
  left: calc(var(--cw) * -1);
  right: calc(var(--cw) * -1);
  top: 50%;
  height: max(100%, 44px);
  translate: 0 -50%;
}

/* ---- square button (sound, gear, back, arrows): btn-square art, blue icon in the middle of the face ---- */
.sq {
  --s: var(--corner);
  width: var(--s);
  height: var(--s);
  flex: none;
  background: url(../assets/ui/btn-square.webp) center / 100% 100% no-repeat;
}
.sq .ic {
  position: absolute;
  left: 24%;
  top: 22%;
  width: 52%;
  height: 52%;
  object-fit: contain;
  pointer-events: none;
}
.sq:disabled {
  opacity: 0.6;
  cursor: default;
}
.sq::before,
.x::before,
.sw::before,
.slider::before {
  content: '';
  position: absolute;
  left: 50%;
  top: 50%;
  translate: -50% -50%;
  width: max(100%, 44px);
  height: max(100%, 44px);
}

/* ---- top-right corner: sound and gear, the same place on every screen (above the scene, below the panels) ---- */
#corner {
  position: absolute;
  z-index: 5;
  top: calc(var(--sat) + var(--u) * 2);
  right: calc(var(--sar) + var(--u) * 2.2);
  display: flex;
  gap: calc(var(--u) * 1.8);
}
body[data-screen='none'] #corner {
  visibility: hidden;
}
/* in the game the design (03) has both buttons smaller (9.4% of the width) so the goal plaque fits; on the others 10.8% (designs 01, 02, 12), always 44 px at least */
body[data-screen='game'] {
  --corner: max(44px, calc(var(--u) * 9.4));
}
body[data-screen='game'] #corner {
  gap: calc(var(--u) * 0.8);
}

/* 9 slices assembled on a canvas: the .nine class turns off the browser border-image and uses the pasted image as background */
.nine {
  border-image: none !important;
  background-size: 100% 100% !important;
  background-origin: border-box !important;
  background-clip: border-box !important;
  background-repeat: no-repeat !important;
}

/* ---- screens ---- */
.screen {
  position: absolute;
  inset: 0;
  display: none;
  padding: var(--sat) var(--sar) var(--sab) var(--sal);
}
body[data-screen='start'] #s-menu,
body[data-screen='menu'] #s-menu,
body[data-screen='map'] #s-map {
  display: flex;
}

/* less motion: every ENTRY becomes 1 ms (never none: with none it plays again when the option is turned off and the screen flashes).
   Only the infinite loops (breathing, pulsing, little hand) use none: they are listed next to each one, in .loop-off below. */
body.reduced,
body.reduced * {
  animation-duration: 1ms !important;
  animation-delay: 0s !important;
}
body.reduced :is(.tap, .panda, .how-art > *, #b-next.live, .deco-panda, .stub-pulse) {
  animation: none !important;
}

/* End of css/base.css (complete file). */
