/* Base: font, unit --u, text, round buttons, pills, arrows, stars. Measures in --u = 1% of the width of the portrait reference layout (or of the height, in landscape). */
/* Clean text: Fredoka 600 (Latin) and Rubik 600 (Cyrillic), no outline on the letters. */
@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: calc(min(100vw, 100vh * 0.5625) / 100);
  --ink: #6b1a4a;
  --turq: #27c9c4;
  --white: #fff;
  --cap: 0.025em;
  --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);
}
body.land {
  --u: calc(min(100vh, 100vw * 0.5625) / 100);
}
* {
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
}
html,
body {
  margin: 0;
  height: 100%;
  overflow: hidden;
  background: var(--turq);
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
}
body {
  font-family:
    Game, 'Hiragino Maru Gothic ProN', 'Yu Gothic', 'Malgun Gothic', 'Microsoft YaHei', 'PingFang SC', system-ui,
    sans-serif;
  font-weight: 600;
  color: var(--white);
}
#bgc,
#stage {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
}
button {
  font: inherit;
  color: inherit;
  border: 0;
  background: none;
  cursor: pointer;
  padding: 0;
}
img {
  display: block;
  -webkit-user-drag: none;
  user-select: none;
  pointer-events: none;
}
:focus {
  outline: none;
}
:focus-visible {
  outline: calc(var(--u) * 0.5) solid #fff;
  outline-offset: calc(var(--u) * 0.4);
  border-radius: 50%;
} /* keyboard only, round and discreet */
[hidden] {
  display: none !important;
}

/* Interface area: centered, never wider than the reference layout (an ultrawide screen does not stretch the HUD) */
#ui {
  position: fixed;
  top: 0;
  bottom: 0;
  left: 50%;
  translate: -50% 0;
  width: calc(var(--u) * 100);
  pointer-events: none;
}
body.land #ui {
  width: min(100vw, calc(var(--u) * 177.78));
}
#ui > *,
.screen > * {
  pointer-events: auto;
}
#ui > .screen:not(#s-start) {
  pointer-events: none;
} /* the screen itself lets touch pass through to the canvas (tapping a piece through the doll); only the children catch touch */
.screen {
  position: absolute;
  inset: 0;
  pointer-events: none;
  animation: scr 0.26s ease-out;
}
.screen > .slot {
  position: absolute;
  pointer-events: none;
}
@keyframes scr {
  from {
    opacity: 0;
  }
}

/* Text: white and clean. Legibility comes from the plate behind; the letters get only a short, soft shadow (--o = size, --og = strength of the halo).
   Text directly over the scene needs a stronger halo (--og: 1). No outline and no stroke. */
.lbl,
h2,
.sub,
.tag-l,
.ol,
.br-head b,
#lk-sub {
  --o: 0.17em;
  --oc: rgba(66, 10, 48, 0.62);
  --og: 0.45;
  font-weight: 600;
  color: #fff;
  line-height: 1;
  white-space: nowrap;
  text-align: center;
  letter-spacing: 0.012em;
  text-shadow:
    0 calc(var(--o) * 0.42) 0 var(--oc),
    0 0 calc(var(--o) * 1.1) rgba(66, 10, 48, var(--og)),
    0 0 calc(var(--o) * 2.6) rgba(66, 10, 48, calc(var(--og) * 0.6));
}
.lbl {
  position: relative;
  top: var(--cap);
  display: block;
  max-width: 100%;
}

/* system fonts for Japanese, Korean and Chinese sit higher on the line: they move down a little (measured in the language list) */
html[lang='ja'] .lbl,
html[lang='ko'] .lbl,
html[lang='zh-Hans'] .lbl,
.lbl[lang='ja'],
.lbl[lang='ko'],
.lbl[lang='zh-Hans'],
.pill[lang='ja'] .lbl,
.pill[lang='ko'] .lbl,
.pill[lang='zh-Hans'] .lbl {
  top: calc(var(--cap) + 0.17em);
}

/* Round button (the art already carries the icon) */
.rb {
  position: relative;
  width: calc(var(--u) * 12);
  height: calc(var(--u) * 12);
  flex: none;
  transition:
    transform 0.16s var(--pop),
    filter 0.16s;
}
.rb > img,
.arrow > img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}
.rb:active,
.pill:active,
.arrow:active,
.card:active,
.sw:active {
  transform: scale(0.92) translateY(3%);
  filter: brightness(0.92);
}
.rb.big {
  width: calc(var(--u) * 15);
  height: calc(var(--u) * 15);
}
.rb.pop,
.pill.pop,
.card.pop,
.cat.pop {
  animation: pop 0.3s var(--pop);
}
@keyframes pop {
  0% {
    scale: 0.86;
  }
  55% {
    scale: 1.1;
  }
  100% {
    scale: 1;
  }
}
.no {
  animation: no 0.3s;
}
@keyframes no {
  25% {
    translate: -5px 0;
  }
  75% {
    translate: 5px 0;
  }
}
.rb[disabled] {
  filter: saturate(0.75) brightness(0.97);
  opacity: 0.72;
} /* disabled: the same button, dimmer but legible */
#corner {
  position: absolute;
  top: calc(var(--sat) + var(--u) * 2.4);
  right: calc(var(--u) * 2.4);
  display: flex;
  gap: calc(var(--u) * 1.5);
  z-index: 6;
}
#corner .rb {
  width: calc(var(--u) * 11);
  height: calc(var(--u) * 11);
}
#b-back {
  position: absolute;
  top: calc(var(--sat) + var(--u) * 2.4);
  left: calc(var(--u) * 2.4);
  width: calc(var(--u) * 11);
  height: calc(var(--u) * 11);
  z-index: 6;
}
.arrow {
  position: relative;
  flex: none;
  width: calc(var(--u) * 7.5);
  height: calc(var(--u) * 7.5);
  transition:
    transform 0.16s var(--pop),
    filter 0.16s,
    opacity 0.16s;
}
.arrow[disabled] {
  opacity: 0.4;
  filter: saturate(0.5);
}

/* Pill (9 slices without a seam: nine.js): the head is half the height; the text centers on the face */
.pill {
  --ph: calc(var(--u) * 14);
  --fy: 0.035;
  position: relative;
  height: var(--ph);
  min-width: calc(var(--ph) * 1.9);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: calc(var(--ph) * 0.16);
  padding: 0 0 calc(var(--ph) * var(--fy));
  border-style: solid;
  border-color: transparent;
  border-width: 0 calc(var(--ph) * 0.5);
  border-image: url(../assets/ui/pill-green.webp) 0 76 fill / 0 calc(var(--ph) * 0.5) stretch;
  transition:
    transform 0.16s var(--pop),
    filter 0.16s;
}
.pill.yellow {
  border-image-source: url(../assets/ui/pill-yellow.webp);
}
.pill.teal {
  border-image-source: url(../assets/ui/pill-teal.webp);
}
.pill.red {
  border-image-source: url(../assets/ui/pill-red.webp);
}
.pill.blue {
  border-image-source: url(../assets/ui/pill-blue.webp);
}
.pill.lilac {
  border-image-source: url(../assets/ui/pill-lilac.webp);
}
.pill .lbl {
  font-size: calc(var(--ph) * 0.42);
  flex: 0 1 auto;
  min-width: 0;
}
.pill > img {
  height: 70%;
  width: auto;
  margin-top: -2%;
  flex: none;
}
/* white text on green, blue and light turquoise did not reach 3:1; the short shadow is now firmer (no outline).
   On the yellow pill (the lightest) the letters are dark, as on the light plates. */
.pill .lbl {
  text-shadow:
    0 min(0.07em, 2.5px) 0 rgba(40, 6, 30, 0.88),
    0 0 1.5px rgba(40, 6, 30, 0.7),
    0 0 min(0.19em, 3.5px) rgba(40, 6, 30, 0.95),
    0 0 min(0.44em, 7px) rgba(40, 6, 30, 0.5);
} /* firm but short halo: on large text (1920) it does not turn into an outline */
/* on dark glass white text already has 6:1 or more: the shadow stays minimal (from far away it looked like an outline) */
.panel h2,
.panel .br-head b,
.panel #lk-sub,
.panel .vol .lbl,
#gf-note {
  --oc: rgba(2, 30, 36, 0.55);
  --og: 0.2;
}
.pill.yellow .lbl {
  color: var(--ink);
  text-shadow: 0 0.05em 0 rgba(255, 255, 255, 0.55);
} /* yellow pill: dark letters (6.9:1); the blue went back to white */
/* action buttons: label never smaller than 19 px (large text, 3:1 target) */
.btns .pill .lbl,
.br-go .pill .lbl,
#start-btn .lbl,
.tabs .pill .lbl {
  font-size: max(19px, calc(var(--ph) * 0.42));
}
.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;
}

/* Stars */
.stars {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: calc(var(--u) * 1.4);
}
.stars img {
  width: calc(var(--u) * 12);
  aspect-ratio: 317 / 297;
  height: auto;
}
.stars img.off {
  opacity: 0.9;
}

#toast {
  position: fixed;
  left: 50%;
  bottom: calc(var(--sab) + var(--u) * 56);
  translate: -50% 0;
  z-index: 30;
  padding: calc(var(--u) * 2) calc(var(--u) * 4);
  max-width: 86vw;
  border-radius: 999px;
  background: rgba(107, 26, 74, 0.86);
  font-size: calc(var(--u) * 3.6);
  font-weight: 600;
  text-align: center;
  animation: toast 0.26s var(--pop);
  pointer-events: none;
}
@keyframes toast {
  from {
    opacity: 0;
    translate: -50% -30%;
  }
}

/* True "reduced motion": no spring, no animated entrance, no sway */
body.reduced *,
body.reduced *::before,
body.reduced *::after {
  animation: none !important;
  transition: none !important;
}
/* End of src/styles.css (complete file). */
