/* 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: #f6eed2;
  --gold: #e9c463;
  --gold-ink: #2a1c05;
  --em: #0f4a2c;
  --coal: #08130f;
  --dim: #9fb3a6;
  --foul: #ff8773;
  --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: #070a08;
  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: #070a08 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: brightness(1.15) 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: the label box covers the whole piece and the text centres in it. One mechanism, no per-button nudges. */
.btn {
  display: grid;
  place-items: center;
  width: 100%;
  height: calc(var(--u) * 13);
  min-height: 44px;
  padding: 0 calc(var(--u) * 1.5) var(--cap);
  border: solid transparent;
  border-width: calc(var(--u) * 3.6);
  border-image: url(../assets/ui/btn-green.webp) 44 fill;
  color: var(--ink);
  font-size: calc(var(--u) * 5.2);
  transition:
    transform 0.09s,
    filter 0.09s;
}
.btn.gold {
  border-image-source: url(../assets/ui/btn-gold.webp);
  color: var(--gold-ink);
}
.btn.small {
  width: 62%;
  height: calc(var(--u) * 9.5);
  font-size: calc(var(--u) * 3.8);
  justify-self: center;
}
.btn > span {
  display: block;
  width: 100%;
  text-align: center;
  white-space: nowrap;
  margin: calc(var(--u) * -3.6) 0;
  line-height: 1.15;
}
.btn:active {
  transform: translateY(3%) scale(0.98);
  filter: brightness(0.86);
}

.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.5);
  height: calc(var(--u) * 10.5);
  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 on the top edge, the X on the top right corner. */
.modal {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  background: #020604b8;
}
.modal.open {
  animation: fade 0.16s;
}
@keyframes fade {
  from {
    opacity: 0;
  }
}
.panel {
  position: relative;
  width: min(86vw, calc(var(--u) * 80));
  display: flex;
  flex-direction: column;
  gap: calc(var(--u) * 2.6);
  border: solid transparent;
  border-width: calc(var(--u) * 3);
  border-image: url(../assets/ui/panel.webp) 28 fill;
  padding: 0 calc(var(--u) * 2.5) calc(var(--u) * 2.5);
}
.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));
}
.band {
  margin: calc(var(--u) * -1.8) calc(var(--u) * -4.3) 0;
  height: calc(var(--u) * 11);
  display: grid;
  place-items: center;
  padding: 0 calc(var(--u) * 9) var(--cap);
  border: solid transparent;
  border-width: calc(var(--u) * 1.2) 0;
  border-image: url(../assets/ui/band.webp) 14 20 fill;
  font-size: calc(var(--u) * 5.6);
  font-weight: 600;
  color: var(--gold);
}
.band > span {
  display: block;
  width: 100%;
  text-align: center;
  white-space: nowrap;
  line-height: 1.15;
}
.x {
  position: absolute;
  z-index: 2;
  right: calc(var(--u) * -3 - var(--tap) / 2 + var(--u) * 1.5);
  top: calc(var(--u) * -3 - var(--tap) / 2 + var(--u) * 1.5);
  width: var(--tap);
  height: var(--tap);
  display: grid;
  place-items: center;
}
.x .ic {
  width: calc(var(--u) * 8.4);
  height: calc(var(--u) * 8.4);
}
.x:active {
  transform: scale(0.92);
}
.stack {
  display: grid;
  gap: calc(var(--u) * 2.4);
}

/* 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). */
