/* Forno Nights base styles (font, sizing, colors, buttons, top right corner). In portrait, 1u = 1% of the stage width.
   In the reference design, 941 px = 100u. In landscape, 1u = 1% of the height. src/ui/stage.js sets --u and --sw (14 px cap).
   Fredoka 600 text has no outline. The flat CSS interface follows the reference design with solid buttons and white icons,
   plus white cards with no border or bevel. A soft shadow separates controls from the background. */
@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);
  /* Reference design colors (basil green 66,171,61 and orange 252,142,3), darkened for contrast with white text.
     --basil with white is 4,6:1 (small text >= 4,5). --oven with white is 3,3:1 (large buttons only, text >= 19 px: >= 3). */
  --basil: #2b8540;
  --basil-dk: #1f6a31;
  --leaf: #3fa33a;
  --oven: #e8650c;
  --oven-dk: #c4520a;
  --ink: #1f4a2a; /* Dark text on the white card (9:1). */
  --mute: #5d6b60;
  --track: #dde4de;
  --row: #eef3ee;
  --sky: #241c2e;
  --lift: 0 calc(var(--u) * 0.5) calc(var(--u) * 1.6) rgba(25, 18, 10, 0.3); /* A soft shadow lifts the button off the background. */
  --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;
}
/* Tall layout (body.tall): src/ui/stage.js recalculates the steps below. Start, menu and level select use --um. Panels use --up for extra height. */
body.tall :is(#s-menu, #s-map) {
  --u: var(--um);
}
body.tall .modal:not(.result) {
  --u: var(--up);
}
body,
body.tall :is(#s-menu, #s-map, .modal:not(.result)) {
  --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;
  --fd-sub: 0;
  --fd-pink: 0;
  --fd-lang: 0;
  --fd-capsule: 0;
  --fd-band: 0;
  --fd-sq: 0; /* Flat control: the face fills the box. */
}
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(--oven);
  outline-offset: calc(var(--u) * 0.4);
}

/* 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(#1d2a4a, #3a2a3a 55%, #5a3a2a) 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;
}
.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.06em -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.06);
  scale: 0.96 0.93;
}
: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;
}
/* When a panel opens over the menu, the logo, mascot, buttons and "toque para começar" are hidden. The background stays visible. */
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;
}

/* ---- Flat button with one color, rounded corners, white text and a soft shadow. The white icon and label form a row centered on both axes,
   with a .35em gap and a 1.1em icon. --fs sets the font size for the whole button. fit.js shrinks the button as a unit.
   Secondary buttons are green (main, sub). Primary buttons are orange (cta, pink). Each role has its own height and text size. ---- */
.pb {
  --h: var(--bh-l);
  --fs: var(--t3);
  --bg: var(--basil);
  --w: 0px;
  --cw: 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.36));
  border-radius: calc(var(--h) * 0.3);
  background: var(--bg);
  color: #fff;
  box-shadow: var(--lift);
}
.pb.sub {
  --h: var(--bh-s);
  --fs: var(--t2);
}
.pb.pink {
  --bg: var(--oven);
  --fs: max(var(--t3), 19.5px);
} /* White text on orange starts at 19 px (large text contrast >= 3:1). */
.pb.cta {
  --h: calc(var(--bh-l) * 1.18);
  --fs: var(--t4);
  --bg: var(--oven);
}
.pb .face {
  flex: 0 0 auto;
  max-width: none;
  font-size: 1em;
  color: #fff;
  letter-spacing: 0.01em;
}
.pb .ico {
  flex: none;
  width: 1.1em;
  height: 1.1em;
  object-fit: contain;
  pointer-events: none;
  translate: 0 var(--pd, 0px);
}
.pb::after {
  content: '';
  position: absolute;
  left: 0;
  right: 0;
  top: 50%;
  height: max(100%, 44px);
  translate: 0 -50%;
} /* Minimum touch target of 44 px. */

/* ---- Round buttons (sound, settings, back, arrows) use flat green with a centered white icon. ---- */
.sq {
  --s: var(--corner);
  width: var(--s);
  height: var(--s);
  flex: none;
  border-radius: 50%;
  background: var(--basil);
  box-shadow:
    0 0 0 1px rgba(15, 30, 18, 0.25),
    0 calc(var(--u) * 0.5) calc(var(--u) * 2) rgba(10, 8, 4, 0.5);
} /* A slightly stronger shadow keeps the button visible over the pale ivy in the menu-pc corner. */
.sq .ic {
  position: absolute;
  left: 25%;
  top: 25%;
  width: 50%;
  height: 50%;
  object-fit: contain;
  pointer-events: none;
}
.sq:disabled {
  opacity: 0.45;
  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);
}

/* ---- 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, .mascot, .how-art > *, #b-next.live, .deco-mascot, .stub-pulse) {
  animation: none !important;
}

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