/* Base: font, colors, art buttons (9-slice), keys, switches, bars and veil.
   Loaded in order by index.html (01 to 06). Measurements in u = 1% of the screen height (the reference art is 941 px tall: 1u = 9.41 px).
   Colors taken from the reference art. Font: Lilita One (Latin) + Nunito 900 (Cyrillic and extended Latin), all OFL, bundled in the package; CJK falls back to system fonts. */

@font-face {
  font-family: 'Lilita One';
  font-style: normal;
  font-weight: 100 900;
  font-display: swap; /* weight 100-900 so the browser does not fake bold on top of an already heavy font */
  src: url(../assets/fonts/lilita-one-latin.woff2) format('woff2');
  unicode-range:
    U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+2074, U+20AC, U+2122, U+2191,
    U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: 'Nunito';
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url(../assets/fonts/nunito-latin-ext-900.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;
}
@font-face {
  font-family: 'Nunito';
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url(../assets/fonts/nunito-cyrillic-900.woff2) format('woff2');
  unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
}
:root {
  --ui: 0.88; /* overall interface scale (the HUD was too large) */
  --u: calc(
    min(1vh, calc(100vw / 177.78)) * var(--ui)
  ); /* 16:9 fits entirely: by height, or by width if the screen is squarer */
  --tap: 40px; /* minimum touch target */
  --ft: 1.14; /* text scale: the reference lettering is wider and heavier */
  --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);
  --font:
    'Lilita One', 'Nunito', 'Arial Rounded MT Bold', 'Segoe UI', system-ui, 'Hiragino Maru Gothic ProN',
    'Hiragino Sans', 'Yu Gothic UI', 'Meiryo', 'Apple SD Gothic Neo', 'Malgun Gothic', 'PingFang SC', 'Microsoft YaHei',
    'Noto Sans CJK SC', sans-serif;
  --ink: #3a2416;
  --navy: #0a2230;
  --deep: #0a3d52;
  --glass: #0f5a6e;
  --aqua: #8ff3ff;
  --aqua2: #2fc9d6;
  --aqua3: #139aae;
  --yellow: #ffd23a;
  --amber: #ffc233;
  --orange: #ff8a1f;
  --green: #3fe08a;
  --gray: #6f8fa6;
  --txt: #fff;
  --outline: calc(var(--u) * 0.42); /* text outline */
}
* {
  box-sizing: border-box;
  min-width: 0;
  -webkit-tap-highlight-color: transparent;
}
html,
body {
  margin: 0;
  height: 100%;
  overflow: hidden;
  background: #0a3d52;
  overscroll-behavior: none;
}
body {
  paint-order: stroke fill;
  font: 600 calc(var(--u) * 2.1)/1.25 var(--font);
  letter-spacing: 0.005em;
  color: var(--txt);
  -webkit-user-select: none;
  user-select: none;
  touch-action: none;
}
#app {
  position: fixed;
  inset: 0;
  overflow: hidden;
  background: #0a3d52;
}
canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
}
#view {
  position: absolute;
  inset: 0;
  will-change: transform;
}
#vig {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: radial-gradient(ellipse at 50% 55%, transparent 62%, rgba(3, 20, 40, 0.12) 100%);
}
[hidden] {
  display: none !important;
}
b,
strong {
  font-weight: 700;
}
button {
  font: inherit;
  color: inherit;
  cursor: pointer;
  border: 0;
  background: none;
  padding: 0;
  margin: 0;
}
button:focus-visible,
input:focus-visible {
  outline: calc(var(--u) * 0.4) solid var(--aqua);
  outline-offset: 2px;
  border-radius: 12px;
}

/* white text with a dark outline (HUD, buttons, titles) */
.otx,
.btn,
h2,
h3.out,
.stamp,
.hud-score b,
.hud-speed b,
.cVal b,
.cVal i,
.banner,
.popBtn,
.flipBtn,
.logo {
  -webkit-text-stroke: var(--outline) var(--navy);
  paint-order: stroke fill;
  text-shadow: 0 calc(var(--u) * 0.3) calc(var(--u) * 0.5) rgba(0, 20, 40, 0.55);
}

/* navy veil behind pause, settings, language (the game darkens and the HUD hides) */
#veil {
  position: absolute;
  inset: 0;
  z-index: 6;
  background: rgba(10, 31, 58, 0.55);
  backdrop-filter: blur(3px);
  -webkit-backdrop-filter: blur(3px);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.18s;
}
body.veil #veil {
  opacity: 1;
}
#hud.hidden-veil {
  visibility: hidden;
}

/* 9-slice pieces: nine.js pastes the slices onto a canvas (no seam hairline); the CSS defines art, slice and corner size */
.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 ---------- */
.btn {
  --h: max(calc(var(--u) * 6.9), var(--tap));
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  height: var(--h);
  padding: 0 calc(var(--h) * 0.5);
  border: 0 solid transparent;
  line-height: 1.05;
  font-weight: 700;
  font-size: calc(var(--u) * 3);
  letter-spacing: 0.01em;
  text-transform: none;
  white-space: nowrap;
  border-image: url(../assets/ui/btn-sec.webp) 58 fill / calc(var(--h) / 2) stretch;
  transition: transform 0.08s;
}
.btn:active {
  border-image-source: url(../assets/ui/btn-sec-down.webp);
  transform: translateY(3%);
}
.btn > span,
.toggle > span {
  display: block;
  max-width: 100%;
  min-width: 0;
  overflow: hidden;
  text-overflow: clip;
}
.btn.primary {
  --h: max(calc(var(--u) * 10.8), var(--tap));
  border-image: url(../assets/ui/btn-primary.webp) 67 fill / calc(var(--h) / 2) stretch;
  font-size: calc(var(--u) * 5.6);
}
.btn.primary:active {
  border-image-source: url(../assets/ui/btn-primary-down.webp);
}
.btn.primary:not(.big) {
  --h: max(calc(var(--u) * 8.2), var(--tap));
  font-size: calc(var(--u) * 4.2);
}
.btn.mini {
  --h: max(calc(var(--u) * 5.4), var(--tap));
  font-size: calc(var(--u) * 2.5);
  border-image: url(../assets/ui/chip.webp) 56 fill / calc(var(--h) / 2) stretch;
}
.btn.mini:active {
  border-image-source: url(../assets/ui/chip.webp);
}

/* music/effects switches: pill with a green light (on) or gray (off) */
.toggle {
  --h: max(calc(var(--u) * 5.8), var(--tap));
  display: inline-flex;
  align-items: center;
  height: var(--h);
  padding: 0 calc(var(--h) * 0.5) 0 calc(var(--h) * 1.15);
  border: 0 solid transparent;
  font-weight: 700;
  font-size: max(11px, calc(var(--u) * 2.4));
  line-height: 1;
  white-space: nowrap;
  border-image: url(../assets/ui/toggle-off.webp) 56 fill / calc(var(--h) / 2) stretch;
  -webkit-text-stroke: calc(var(--u) * 0.3) var(--navy);
  paint-order: stroke fill;
}
.toggle[aria-pressed='true'] {
  border-image-source: url(../assets/ui/toggle-on.webp);
}
.toggle > i {
  display: none;
}

/* keys (<kbd>) drawn with the chip art */
kbd {
  --kh: calc(var(--u) * 3.7 * var(--ft) / 1.16);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: var(--kh);
  height: var(--kh);
  padding: 0 0.6em;
  margin: 0 0.12em;
  border: 0 solid transparent;
  font: inherit;
  font-weight: 700;
  font-size: 0.92em;
  line-height: 1;
  border-image: url(../assets/ui/key.webp) 70 fill / calc(var(--kh) * 0.4) stretch;
  -webkit-text-stroke: 0.08em var(--navy);
  paint-order: stroke fill;
  vertical-align: middle;
}
/* drawn arrows (the HUD arrow rotated): never a text character */
.ar {
  display: inline-block;
  width: 1.05em;
  height: 1.05em;
  margin: 0 0.05em;
  vertical-align: -0.2em;
  background: url(../assets/ui/ico-curl.webp) center / contain no-repeat;
}
.ar-u {
  transform: rotate(90deg);
}
.ar-d {
  transform: rotate(-90deg);
}
.ar-r {
  transform: rotate(180deg);
}
.ar-dl {
  transform: rotate(-45deg);
}
.ar-u + .ar-d {
  margin-left: -0.55em;
}
kbd .ar {
  width: 1.15em;
  height: 1.15em;
  margin: 0;
  vertical-align: middle;
}

/* on/off switch (settings) */
.switch {
  --h: max(calc(var(--u) * 5.3), 32px);
  width: calc(var(--h) * 2.27);
  height: var(--h);
  border: 0 solid transparent;
  border-image: url(../assets/ui/switch-off.webp) 47 fill / calc(var(--h) / 2) stretch;
  flex: none;
}
.switch[aria-pressed='true'] {
  border-image-source: url(../assets/ui/switch-on.webp);
}
.switch > i {
  display: none;
}

/* arrow (previous/next language) */
.arrow {
  --h: max(calc(var(--u) * 5.6), var(--tap));
  width: var(--h);
  height: var(--h);
  border: 0 solid transparent;
  border-image: url(../assets/ui/arrow-a.webp) 70 fill / calc(var(--h) * 0.36) stretch;
  display: grid;
  place-items: center;
  flex: none;
}
.arrow svg {
  width: 52%;
  height: 52%;
  fill: none;
  stroke: #fff;
  stroke-width: 4.2;
  stroke-linecap: round;
  stroke-linejoin: round;
  filter: drop-shadow(0 0 1px var(--navy)) drop-shadow(0 0 1px var(--navy));
}
.arrow:active {
  transform: translateY(3%);
}

/* volume bar: track + green fill (both in 9 slices) + knob */
.slider {
  --h: max(calc(var(--u) * 3.2), 22px);
  position: relative;
  height: var(--h);
  border: 0 solid transparent;
  border-image: url(../assets/ui/slider-track.webp) 39 fill / calc(var(--h) / 2) stretch;
  flex: 1;
}
.slider .fill {
  position: absolute;
  left: 0;
  top: 6%;
  height: 88%;
  width: max(var(--v, 50%), var(--h));
  border: 0 solid transparent;
  border-image: url(../assets/ui/slider-fill.webp) 39 fill / calc(var(--h) / 2) stretch;
  pointer-events: none;
}
.slider input {
  position: absolute;
  left: calc(var(--u) * -0.6);
  top: 0;
  width: calc(100% + var(--u) * 1.2);
  height: 100%;
  margin: 0;
  opacity: 1;
  background: none;
  -webkit-appearance: none;
  appearance: none;
  touch-action: pan-y;
}
.slider input::-webkit-slider-runnable-track {
  background: none;
  height: 100%;
}
.slider input::-moz-range-track {
  background: none;
  height: 100%;
}
.slider input::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: calc(var(--h) * 1.1);
  height: calc(var(--h) * 1.1);
  margin-top: calc(var(--h) * -0.05);
  background: url(../assets/ui/slider-knob.webp) center / contain no-repeat;
  border: 0;
} /* field with the track height: knob at the center */
.slider input::-moz-range-thumb {
  width: calc(var(--h) * 1.1);
  height: calc(var(--h) * 1.1);
  background: url(../assets/ui/slider-knob.webp) center / contain no-repeat;
  border: 0;
  border-radius: 0;
}

/* round glass button with icon (HUD and menu) */
.roundbtn {
  --d: max(calc(var(--u) * 10.6), 44px);
  width: var(--d);
  height: var(--d);
  display: grid;
  place-items: center;
  background: url(../assets/ui/round-a.webp) center / 100% 100% no-repeat;
  flex: none;
  transition: transform 0.08s;
}
.roundbtn:active {
  transform: scale(0.94) translateY(3%);
}
.roundbtn svg {
  width: 46%;
  height: 46%;
  overflow: visible;
}
.roundbtn .ico-fill {
  fill: #fff;
  stroke: var(--navy);
  stroke-width: 1.7;
  stroke-linejoin: round;
  paint-order: stroke fill;
}
.roundbtn .ico-line {
  fill: none;
  stroke: #fff;
  stroke-width: 2.4;
  stroke-linecap: round;
  filter: drop-shadow(0 0 1px var(--navy));
}
.roundbtn .ico-hole {
  fill: #1aa4b6;
  stroke: var(--navy);
  stroke-width: 1.2;
}

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