/* Fonts, tokens and the shared pieces (buttons, panels). Sizes come from --u so every screen keeps the same proportions. */
@font-face {
  font-family: Game;
  font-weight: 100 900;
  font-display: swap;
  src: url(../assets/fonts/fredoka-latin-600.woff2) format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+2000-206F, U+20AC;
}
@font-face {
  font-family: Game;
  font-weight: 100 900;
  font-display: swap;
  src: url(../assets/fonts/fredoka-latin-ext-600.woff2) format('woff2');
  unicode-range: U+0100-02AF, U+1E00-1EFF;
}
@font-face {
  font-family: Game;
  font-weight: 100 900;
  font-display: swap;
  src: url(../assets/fonts/rubik-cyrillic-600.woff2) format('woff2');
  unicode-range: U+0400-04FF;
}

:root {
  --u: min(1vmin, 6px); /* the HUD stops growing on big screens */
  --cap: 0.08em; /* Fredoka draws its capitals a little low: every label lifts by half of this */
  --ink: #ffffff;
  --gold: #ffd92e;
  --gold-ink: #00474a;
  --face: #003e40;
  --edge: #ffc91f;
  --foul: #ffb08a;
  --wood: #4a1f0a;
  --tap: max(44px, calc(var(--u) * 11.5));
  --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);
}
* {
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
}
html,
body {
  margin: 0;
  height: 100%;
  overflow: hidden;
  background: var(--wood);
  color: var(--ink);
  user-select: none;
  -webkit-user-select: none;
  touch-action: none;
  font:
    600 calc(var(--u) * 4.4) / 1.15 Game,
    'Hiragino Sans',
    'Noto Sans CJK SC',
    'Microsoft YaHei',
    'Malgun Gothic',
    system-ui,
    sans-serif;
}
[hidden] {
  display: none !important;
}
button {
  font: inherit;
  color: inherit;
  cursor: pointer;
  border: 0;
  background: none;
  padding: 0;
}
button:focus {
  outline: none;
}
button:focus-visible {
  outline: 2px solid var(--gold);
  outline-offset: 2px;
  border-radius: 8px;
}
img {
  display: block;
  -webkit-user-drag: none;
}

#bg {
  position: fixed;
  inset: 0;
  background: var(--wood) url(../assets/bg/fundo-pe.webp) center / cover no-repeat;
  transition: filter 0.5s;
}
@media (min-aspect-ratio: 10/11) {
  #bg {
    background-image: url(../assets/bg/fundo-deitado.webp);
  }
}
#bg {
  transform: translateX(var(--pan, 0)) scale(var(--zoom, 1));
  will-change: transform;
}
body.cueview #bg {
  filter: blur(1.2px);
}
#gl {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
}
#app {
  position: fixed;
  inset: 0;
  pointer-events: none;
}
#app button,
#app .modal.open,
#power,
#spin,
#s-splash {
  pointer-events: auto;
}

/* nine.js glues the 9 slices into one image per piece (no 1px seams) and adds this class */
.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;
}

/* Buttons: pills that only stretch in their plain middle (the side slices are half the height of the drawing). The face ends
   above the lower rim, so the label lifts by --rim. One mechanism, no per-button nudges. */
.btn {
  --h: max(44px, calc(var(--u) * 13.4));
  --rim: 0.13;
  display: grid;
  place-items: center;
  width: 100%;
  height: var(--h);
  padding: 0 0 calc(var(--cap) + var(--h) * var(--rim));
  border: solid transparent;
  border-width: 0 calc(var(--h) / 1.94);
  border-image: url(../assets/ui/btn-green.webp) 0 82 fill;
  color: var(--ink);
  font-size: calc(var(--u) * 5.6);
  text-shadow: 0 0.06em 0.08em #0046;
  transition:
    transform 0.09s,
    filter 0.09s;
}
.btn.gold {
  border-image-source: url(../assets/ui/btn-gold.webp);
  color: var(--gold-ink);
  text-shadow: none;
}
.btn.small {
  --h: max(44px, calc(var(--u) * 10.4));
  width: 66%;
  font-size: calc(var(--u) * 4.2);
  justify-self: center;
}
.btn > span {
  display: block;
  width: calc(100% + var(--h) * 0.56);
  text-align: center;
  white-space: nowrap;
  margin: 0 calc(var(--h) * -0.28);
  line-height: 1.15;
}
.btn:active {
  transform: translateY(3%) scale(0.98);
  filter: brightness(0.9);
}

.ico {
  position: absolute;
  width: var(--tap);
  height: var(--tap);
  display: grid;
  place-items: center;
  transition:
    transform 0.09s,
    filter 0.09s;
}
.ico:active {
  transform: scale(0.92);
  filter: brightness(0.85);
}
.ic {
  display: block;
  width: calc(var(--u) * 10.9);
  height: calc(var(--u) * 10.9);
  background: center / contain no-repeat;
}
.ic-sound {
  background-image: url(../assets/ui/ico-sound.webp);
}
.ic-gear {
  background-image: url(../assets/ui/ico-gear.webp);
}
.ic-pause {
  background-image: url(../assets/ui/ico-pause.webp);
}
.ic-back {
  background-image: url(../assets/ui/ico-back.webp);
}
.ic-camera {
  background-image: url(../assets/ui/ico-camera.webp);
}
.ic-close {
  background-image: url(../assets/ui/ico-close.webp);
}
.ic-note {
  background-image: url(../assets/ui/gl-note.webp);
}
.ic-speaker {
  background-image: url(../assets/ui/gl-speaker.webp);
}
.ic-chevron {
  background-image: url(../assets/ui/gl-chevron.webp);
}
.ic-check {
  background-image: url(../assets/ui/gl-check.webp);
}

/* Panels: always centred on both axes; the title band sits inside the frame, the X on the top right corner.
   --b is the slice of the frame, --f the part of it that can be seen: the content starts at --f. */
.modal {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  background: #1a0a02c9;
}
.modal.open {
  animation: fade 0.16s;
}
@keyframes fade {
  from {
    opacity: 0;
  }
}
.panel {
  --b: calc(var(--u) * 6);
  --f: calc(var(--u) * 2.9);
  --in: calc(var(--f) - var(--b));
  position: relative;
  width: min(88vw, calc(var(--u) * 82));
  display: flex;
  flex-direction: column;
  gap: calc(var(--u) * 2.4);
  border: solid transparent;
  border-width: var(--b);
  border-image: url(../assets/ui/panel.webp) 76 fill;
}
.panel > * {
  margin-inline: calc(var(--in) + var(--u) * 2.4);
}
.panel > .btn {
  width: auto;
}
.panel > :last-child {
  margin-bottom: calc(var(--in) + var(--u) * 2.4);
}
.modal.open .panel.pop {
  animation: pop 0.22s cubic-bezier(0.2, 1.3, 0.4, 1);
}
@keyframes pop {
  from {
    transform: scale(0.94);
  }
}
.panel.wide {
  width: min(92vw, calc(var(--u) * 84));
}
.panel > .band {
  margin: var(--in) var(--in) 0;
  height: calc(var(--u) * 11);
  display: grid;
  place-items: center;
  padding: 0 calc(var(--u) * 8) var(--cap);
  overflow: hidden;
  border-radius: calc(var(--u) * 1.8) calc(var(--u) * 1.8) 0 0;
  border: solid transparent;
  border-width: calc(var(--u) * 1.6) 0;
  border-image: url(../assets/ui/band.webp) 20 0 fill;
  font-size: calc(var(--u) * 6.2);
  font-weight: 600;
  color: #fff;
  text-shadow: 0 0.06em 0.1em #7a240088;
}
.band > span {
  display: block;
  width: 100%;
  text-align: center;
  white-space: nowrap;
  line-height: 1.15;
}
.panel > .x {
  position: absolute;
  z-index: 2;
  margin: 0;
  right: calc(var(--b) * -1 - var(--tap) / 2 + var(--u) * 2.6);
  top: calc(var(--b) * -1 - var(--tap) / 2 + var(--u) * 2.6);
  width: var(--tap);
  height: var(--tap);
  display: grid;
  place-items: center;
}
.x .ic {
  width: calc(var(--u) * 10);
  height: calc(var(--u) * 10);
}
.x:active {
  transform: scale(0.92);
}
.stack {
  display: grid;
  gap: calc(var(--u) * 1.8);
}

/* Portrait: a tilted tile of the character's colour. The picture is cut at the sides and at the bottom of the tile; its ears rise above it. */
.port {
  --s: calc(var(--u) * 16);
  position: relative;
  display: block;
  flex: none;
  width: var(--s);
  height: var(--s);
  background: url(../assets/ui/tile-you.webp) center / contain no-repeat;
  transform: rotate(-5deg);
}
.port[data-who='milo'] {
  background-image: url(../assets/ui/tile-milo.webp);
}
.port[data-who='hazel'] {
  background-image: url(../assets/ui/tile-hazel.webp);
}
.port[data-who='bruno'] {
  background-image: url(../assets/ui/tile-bruno.webp);
}
.port > span {
  position: absolute;
  inset: -24% 9.5% 9.5%;
  display: flex;
  justify-content: center;
  align-items: flex-start;
  overflow: hidden;
  border-radius: 0 0 calc(var(--s) * 0.13) calc(var(--s) * 0.13);
}
.port img {
  flex: none;
  height: 124%;
  width: auto;
  margin-top: 7%;
}

/* Entrances end at once but stay the same animation. Never "animation: none" here: taking it away again replays the entrance and the whole screen flashes. */
body.reduced .panel.pop,
body.reduced .modal.open {
  animation-duration: 1ms;
}
body.reduced .btn,
body.reduced .ico {
  transition: none;
}
/* End of css/base.css (complete file). */
