/* Base: font, unit --u, background, buttons and plates. Every measure comes from --u (set by layout.js). */
@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: 4px;
  --cap: 0.07em; /* Fredoka draws capitals a little low: the label moves up this much to sit at the centre of the face */
  --navy: #14104f;
  --navy-2: #1f1a78;
  --gold: #ffd23e;
  --white: #fff;
  --ink: #1a1440;
  --green: #35c44e;
  --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);
  --pop: cubic-bezier(0.3, 1.6, 0.5, 1);
}
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  border-color: transparent;
  -webkit-tap-highlight-color: transparent;
}
html,
body {
  position: fixed;
  inset: 0;
  overflow: hidden;
  background: #150a3a;
  color: var(--white);
  font-family:
    Game, 'Hiragino Sans', 'Yu Gothic', 'Malgun Gothic', 'Microsoft YaHei', 'PingFang SC', system-ui, sans-serif;
  font-weight: 600;
  -webkit-user-select: none;
  user-select: none;
  touch-action: manipulation;
  overscroll-behavior: none;
}
button {
  font: inherit;
  color: inherit;
  border: 0;
  background: none;
  cursor: pointer;
}
button:focus,
.panel:focus {
  outline: none;
}
button:focus-visible {
  outline: calc(var(--u) * 0.5) solid #fff9;
  outline-offset: calc(var(--u) * 0.4);
  border-radius: calc(var(--u) * 2);
}
img {
  display: block;
  -webkit-user-drag: none;
}

#app {
  position: absolute;
  inset: 0;
  overflow: hidden;
}

/* screens: centred column, limited width (ultrawide does not stretch the HUD) */
.screen {
  position: absolute;
  z-index: 1;
  top: var(--sat);
  bottom: var(--sab);
  left: 50%;
  width: min(100%, calc(var(--u) * var(--maxw, 100)));
  transform: translateX(-50%);
  display: none;
  flex-direction: column;
  align-items: center;
  padding: calc(var(--u) * 2.5);
}
.screen.on {
  display: flex;
}
.land .screen {
  --maxw: 190;
}

/* ---- nine-slice buttons. The label covers the whole piece and centres on the FACE (--fy = offset of the face of the art). */
.btn {
  position: relative;
  display: grid;
  place-items: center;
  border-style: solid;
  border-width: calc(var(--u) * 3.6);
  border-image: var(--art) 62 fill / 1 / 0 stretch;
  min-height: calc(var(--u) * 12);
  min-width: calc(var(--u) * 30);
  font-size: calc(var(--u) * 4.6);
  line-height: 1;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  transition:
    transform 0.09s,
    filter 0.09s;
}
.btn > span {
  display: block;
  max-width: 100%;
  white-space: nowrap;
  transform: translateY(
    var(--fy, -0.02em)
  ); /* measured: the face of these buttons sits .05em below the centre of the box */
  text-shadow: 0 0.06em 0.08em #0006;
}
.btn.red {
  --art: url(../../assets/ui/btn-red.webp);
}
.btn.purple {
  --art: url(../../assets/ui/btn-purple.webp);
}
.btn.green {
  --art: url(../../assets/ui/btn-green.webp);
}
.btn.big {
  min-height: calc(var(--u) * 16);
  border-width: calc(var(--u) * 4.6);
  font-size: calc(var(--u) * 7.4);
}
.btn:active,
.ib:active,
.pill:active,
.power:active {
  transform: translateY(3%) scale(0.97);
  filter: brightness(0.86);
}
.nine {
  border-color: transparent !important;
  border-image: none !important;
  background-size: 100% 100% !important;
  background-origin: border-box !important;
  background-clip: border-box !important;
  background-repeat: no-repeat !important;
}

/* icon button (sound, gear, pause, back) */
.ib {
  position: absolute;
  z-index: 5;
  width: calc(var(--u) * 11);
  height: calc(var(--u) * 11);
  display: grid;
  place-items: center;
  background: url(../../assets/ui/btn-icon.webp) center / 100% 100% no-repeat;
  transition:
    transform 0.09s,
    filter 0.09s;
}
.ib i,
.ic,
.x i {
  display: block;
  width: 56%;
  height: 56%;
  background: var(--i) center / contain no-repeat;
}
#corner {
  position: absolute;
  z-index: 5;
  top: calc(var(--sat) + var(--u) * 2.5);
  right: calc(var(--sar) + var(--u) * 2.5);
  display: flex;
  gap: max(calc(var(--u) * 2), calc(44px - var(--u) * 11));
}
#corner .ib {
  position: relative;
}
/* finger: the piece can be smaller, the area that responds is 44 px ON SCREEN (so it divides by --ps, which shrinks the panel) */
.ib::after,
.x::after,
.btn::after,
.power::after,
.pill::after,
.pick button::after {
  content: '';
  position: absolute;
  --e: min(0px, calc((100% - 44px / var(--ps, 1)) / 2));
  inset: var(--e);
}
/* almost all the slack goes up, away from what comes below */
.x::after,
.pick button::after {
  inset: calc(var(--e) * 1.7) var(--e) calc(var(--e) * 0.3);
}
#b-left {
  top: calc(var(--sat) + var(--u) * 2.5);
  left: calc(var(--sal) + var(--u) * 2.5);
}
#b-left[hidden] {
  display: none;
}

/* plate: small label on top, value below */
.plate {
  border-style: solid;
  border-width: calc(var(--u) * 2);
  border-image: url(../../assets/ui/plate.webp) 40 fill / 1 / 0 stretch;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: calc(var(--u) * 0.5);
  line-height: 1;
  min-width: 0;
}
.plate > small {
  font-size: calc(var(--u) * 2.5);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #b9c2ff;
  white-space: nowrap;
}
.plate > b {
  font-size: calc(var(--u) * 4.6);
  font-weight: 600;
  color: var(--gold);
  white-space: nowrap;
}

/* ---- start and menu */
.logo {
  position: relative;
  z-index: 2;
  flex: none;
  width: calc(var(--u) * 74);
  margin-top: calc(var(--u) * 13);
  transform-origin: 50% -30%;
}
.logo > img {
  width: 100%;
  filter: drop-shadow(0 calc(var(--u) * 1) calc(var(--u) * 2) #0008);
}
.stagebox {
  flex: 1;
  min-height: 0;
  width: 100%;
  position: relative;
}
.stagebox .fox {
  position: absolute;
  left: 50%;
  bottom: 0;
  height: 100%;
  max-height: calc(var(--u) * 120);
  transform: translateX(-50%);
}
.stagebox .globe {
  position: absolute;
  left: calc(50% + var(--u) * 14);
  bottom: 2%;
  height: 62%;
  max-height: calc(var(--u) * 56);
}
#s-menu .stagebox .fox {
  left: 36%;
}
.tap {
  font-size: calc(var(--u) * 5.4);
  margin: calc(var(--u) * 6) 0 calc(var(--u) * 10);
  text-shadow: 0 0.08em 0.2em #000a;
  animation: breathe 1.6s ease-in-out infinite alternate;
}
@keyframes breathe {
  from {
    opacity: 0.55;
    transform: scale(0.98);
  }
  to {
    opacity: 1;
    transform: scale(1.02);
  }
}
.stats {
  display: flex;
  gap: calc(var(--u) * 2);
  margin: calc(var(--u) * 2) 0;
}
.stats .plate {
  width: calc(var(--u) * 30);
  height: calc(var(--u) * 11);
}
.menu-btns {
  display: flex;
  flex-direction: column;
  gap: calc(var(--u) * 2);
  width: calc(var(--u) * 68);
  margin-bottom: calc(var(--u) * 3);
}
.land .logo {
  width: calc(var(--u) * 62);
  margin-top: calc(var(--u) * 2);
}
.land .menu-btns {
  width: calc(var(--u) * 62);
  gap: calc(var(--u) * 1.4);
  margin-bottom: calc(var(--u) * 1);
}
.land .menu-btns .btn.big {
  min-height: calc(var(--u) * 13);
  font-size: calc(var(--u) * 6);
}
.land .menu-btns .btn {
  min-height: calc(var(--u) * 10);
}
.land #s-menu .stagebox,
.land #s-start .stagebox {
  position: absolute;
  inset: calc(var(--u) * 29) 0 calc(var(--u) * 3) 0;
  pointer-events: none;
}
.land #s-menu .stagebox .fox {
  left: calc(50% - var(--u) * 58);
  max-height: calc(var(--u) * 80);
}
.land #s-menu .stagebox .globe {
  left: calc(50% + var(--u) * 38);
  height: 70%;
}
.land #s-start .stagebox {
  bottom: calc(var(--u) * 14);
}
.land #s-menu .logo,
.land #s-start .logo {
  margin-bottom: auto;
}
.land .tap {
  margin: calc(var(--u) * 3) 0 calc(var(--u) * 5);
}

.reduced .tap {
  animation: none;
}
/* End of src/ui/base.css (complete file). */
