/* Glossy Toy: the pieces. Art comes from assets/; text is live. Each placed piece gets --w and --h from ui/stage.js,
   so its text and inner parts grow with it, exactly in the proportions of the design. */
@font-face {
  font-family: 'Fredoka';
  font-style: normal;
  font-weight: 300 700;
  font-display: swap;
  src: url(../assets/fonts/fredoka-latin-wght-normal.woff2) format('woff2');
  unicode-range:
    U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC,
    U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: 'Fredoka';
  font-style: normal;
  font-weight: 300 700;
  font-display: swap;
  src: url(../assets/fonts/fredoka-latin-ext-wght-normal.woff2) format('woff2');
  unicode-range:
    U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, 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: 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 {
  --u: 3.6px;
  --w: 100px;
  --h: 40px;
  --safe-t: env(safe-area-inset-top, 0px);
  --safe-b: env(safe-area-inset-bottom, 0px);
  --safe-l: env(safe-area-inset-left, 0px);
  --safe-r: env(safe-area-inset-right, 0px);
  --font:
    'Fredoka', 'Nunito', 'Hiragino Maru Gothic ProN', 'Yu Gothic', 'Malgun Gothic', 'PingFang SC', 'Microsoft YaHei',
    'Noto Sans CJK SC', system-ui, sans-serif;
  --o: #082b7e; /* colour of the letter outline, set by each piece */
}
* {
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
}
html,
body {
  margin: 0;
  height: 100%;
  background: #083bb1;
  color: #ffffff;
  font-family: var(--font);
  font-weight: 700;
  overflow: hidden;
  overscroll-behavior: none;
  touch-action: manipulation;
  user-select: none;
  -webkit-user-select: none;
}
button {
  font: inherit;
  color: inherit;
  cursor: pointer;
  padding: 0;
  border: 0;
  background: none;
}
img {
  display: block;
  -webkit-user-drag: none;
  pointer-events: none;
}
[hidden] {
  display: none !important;
}
i,
em {
  font-style: normal;
}
h1,
h2,
h3,
p {
  margin: 0;
  font-weight: 700;
}
[data-placed] {
  position: absolute !important;
  margin: 0 !important;
}

#app {
  position: fixed;
  inset: 0;
  overflow: hidden;
  overflow: clip;
} /* clip: nothing, not even focus, can scroll the stage */
#frame {
  position: absolute;
  inset: var(--safe-t) var(--safe-r) var(--safe-b) var(--safe-l);
  font-size: calc(var(--u) * 4.4);
}
/* the design's lettering: a dark outline all around and a 3D drop below (on every element, so each one uses its own --o) */
#frame * {
  text-shadow:
    0 0.085em 0 var(--o),
    0.04em 0 0 var(--o),
    -0.04em 0 0 var(--o),
    0 -0.04em 0 var(--o),
    0.03em 0.03em 0 var(--o),
    -0.03em 0.03em 0 var(--o),
    0.03em -0.03em 0 var(--o),
    -0.03em -0.03em 0 var(--o),
    0.03em 0.085em 0 var(--o),
    -0.03em 0.085em 0 var(--o);
}
.bg {
  position: absolute;
  inset: 0;
  background: #1d8a9b url(../assets/bg-p.webp) center / cover no-repeat;
}
.land .bg {
  background-image: url(../assets/bg-l.webp);
}
.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;
}

/* ---- pill (cap, middle, cap): the face is a little above the middle because of the thick bottom rim ---- */
.pill {
  border-style: solid;
  border-color: transparent;
  border-width: 0 calc(var(--h) * 0.5);
  border-image: url(../assets/ui/pill-yellow.webp) 0 80 fill / 0 calc(var(--h) * 0.5) stretch;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 0 0 calc(var(--h) * 0.07);
  font-size: calc(var(--h) * 0.56);
  line-height: 1;
  white-space: nowrap;
  --o: #cf8400;
  transition:
    transform 0.28s cubic-bezier(0.3, 1.8, 0.5, 1),
    filter 0.12s;
}
.pill > span {
  margin: 0 calc(var(--h) * -0.3);
  max-width: calc(100% + var(--h) * 0.6);
}
.pill.green {
  border-image-source: url(../assets/ui/pill-green.webp);
  --o: #1a8e54;
}
.pill.blue {
  border-image-source: url(../assets/ui/pill-blue.webp);
  --o: #186f7c;
}
.pill.violet {
  border-image-source: url(../assets/ui/pill-violet.webp);
  --o: #5f316e;
}
.pill.royal {
  border-image-source: url(../assets/ui/pill-royal.webp);
  --o: #052264;
}
.pill.caps {
  text-transform: uppercase;
}
/* the touch area is at least 46 px tall, whatever the size of the drawing */
.pill,
.navb,
.round {
  position: relative;
}
.pill::before,
.navb::before {
  content: '';
  position: absolute;
  left: 0;
  right: 0;
  top: min(0px, calc((var(--h) - 46px) / 2));
  bottom: min(0px, calc((var(--h) - 46px) / 2));
}
.pill:active,
.round:active,
.tile:active,
.navb:active,
.sq:active,
.citem:active {
  transform: translateY(3%) scale(0.96);
  filter: brightness(0.92);
  transition-duration: 0.05s;
}
.pill:disabled {
  filter: saturate(0.75) brightness(0.92);
}

/* ---- navy chip ---- */
.chip {
  border-style: solid;
  border-color: transparent;
  border-width: 0 calc(var(--h) * 0.5);
  border-image: url(../assets/ui/chip.webp) 0 80 fill / 0 calc(var(--h) * 0.5) stretch;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.32em;
  padding-bottom: calc(var(--h) * 0.05);
  font-size: calc(var(--h) * 0.6);
  line-height: 1;
  white-space: nowrap;
  --o: #041c54;
}
.chip > :first-child {
  margin-left: calc(var(--h) * -0.2);
}
.chip > :last-child {
  margin-right: calc(var(--h) * -0.2);
}
.chip b {
  font-variant-numeric: tabular-nums;
}

/* ---- round icon button (the touch area is at least 44 px, whatever the drawing) ---- */
.round {
  background: url(../assets/ui/round.webp) center / 100% 100% no-repeat;
  display: grid;
  place-items: center;
  transition:
    transform 0.28s cubic-bezier(0.3, 1.8, 0.5, 1),
    filter 0.12s;
  z-index: 90;
}
.round::before {
  content: '';
  position: absolute;
  left: 50%;
  top: 50%;
  width: max(100%, 46px);
  height: max(100%, 46px);
  transform: translate(-50%, -50%);
}
.round svg {
  width: 58%;
  height: 58%;
  fill: #ffffff;
  filter: drop-shadow(0 calc(var(--h) * 0.03) 0 rgba(3, 34, 107, 0.75));
  margin-bottom: 3%;
}
.round.on {
  filter: brightness(1.2) drop-shadow(0 0 calc(var(--h) * 0.14) #8ae3f1);
}
.sq {
  background: url(../assets/ui/sq.webp) center / 100% 100% no-repeat;
  display: grid;
  place-items: center;
  transition: transform 0.1s;
  flex: none;
  position: relative;
}
.sq::before {
  content: '';
  position: absolute;
  left: 50%;
  top: 50%;
  width: max(100%, 42px);
  height: max(100%, 42px);
  transform: translate(-50%, -50%);
}
.sq svg {
  width: 62%;
  height: 62%;
  fill: #ffffff;
}
.sq.off {
  filter: saturate(0.3) brightness(0.7);
}

/* ---- panels: nine pieces ---- */
.panel {
  --b: min(calc(var(--h) * 0.22), calc(var(--w) * 0.15), calc(var(--u) * 5.2));
  border-style: solid;
  border-color: transparent;
  border-width: var(--b);
  border-image: url(../assets/ui/panel-blue.webp) 108 fill / var(--b) stretch;
}
.panel.violet {
  border-image-source: url(../assets/ui/panel-violet.webp);
  --o: #472353;
}
.flow {
  display: flex;
  flex-direction: column;
}
.flow > * {
  margin-left: calc(var(--b) * -0.62);
  margin-right: calc(var(--b) * -0.62);
}
.flow > :first-child {
  margin-top: calc(var(--b) * -0.62);
}
.flow > :last-child {
  margin-bottom: calc(var(--b) * -0.62);
}

/* ---- tiles ---- */
.tile {
  border-style: solid;
  border-color: transparent;
  --c: calc(var(--h) * 0.2);
  border-width: var(--c);
  border-image: url(../assets/ui/tile.webp) 66 fill / var(--c) stretch;
  transition: transform 0.28s cubic-bezier(0.3, 1.8, 0.5, 1);
}
.tile.on {
  border-image-source: url(../assets/ui/tile-on.webp);
  border-image-slice: 84;
}
.navb {
  border-style: solid;
  border-color: transparent;
  --c: calc(var(--h) * 0.24);
  border-width: var(--c);
  border-image: url(../assets/ui/nav-violet.webp) 76 fill / var(--c) stretch;
  transition: transform 0.28s cubic-bezier(0.3, 1.8, 0.5, 1);
  --o: #522a5f;
}
.navb.royal {
  border-image-source: url(../assets/ui/nav-royal.webp);
  --o: #052264;
}
.land .navb {
  --c: calc(var(--h) * 0.5);
  border-width: 0 var(--c);
  border-image: url(../assets/ui/pill-violet.webp) 0 80 fill / 0 var(--c) stretch;
}
.land .navb.royal {
  border-image-source: url(../assets/ui/pill-royal.webp);
}
.stile {
  border-style: solid;
  border-color: transparent;
  --c: calc(var(--h) * 0.22);
  border-width: var(--c);
  border-image: url(../assets/ui/stat.webp) 74 fill / var(--c) stretch;
  --o: #0b2b74;
}

/* ---- switch ---- */
.sw {
  position: relative;
  flex: none;
  height: 86%;
  aspect-ratio: 2.45;
  background: url(../assets/ui/tog-off.webp) center / 100% 100% no-repeat;
}
.sw[aria-checked='true'] {
  background-image: url(../assets/ui/tog-on.webp);
}
.sw::after {
  content: '';
  position: absolute;
  top: 7%;
  left: 3%;
  height: 80%;
  aspect-ratio: 1;
  background: url(../assets/ui/knob.webp) center / 100% 100% no-repeat;
  transition: left 0.26s cubic-bezier(0.3, 1.6, 0.5, 1);
}
.sw[aria-checked='true']::after {
  left: 62%;
}
.sw i {
  position: absolute;
  top: 0;
  bottom: 8%;
  display: grid;
  place-items: center;
  width: 62%;
  font-size: 1em;
  text-transform: uppercase;
  --o: rgba(0, 0, 0, 0.35);
}
.sw i:first-child {
  left: 2%;
  display: none;
}
.sw i:last-child {
  right: 1%;
}
.sw[aria-checked='true'] i:first-child {
  display: grid;
}
.sw[aria-checked='true'] i:last-child {
  display: none;
}

/* ---- segmented control ---- */
.seg {
  display: flex;
  flex: none;
  height: 76%;
  padding: 0.1em;
  border-style: solid;
  border-color: transparent;
  border-width: 0 0.9em;
  border-image: url(../assets/ui/seg-track.webp) 0 84 fill / 0 0.9em stretch;
}
.seg button {
  margin: 0 -0.82em;
  padding: 0 1.05em 0.08em;
  height: 100%;
  white-space: nowrap;
  background-size: 100% 100%;
  --o: #082b7e;
  position: relative;
}
.seg button + button {
  margin-left: 0.2em;
}
.seg button[aria-pressed='true'] {
  background: url(../assets/ui/seg-sky.webp) center / 100% 100% no-repeat;
  --o: #186f7c;
}
.seg.mini button[aria-pressed='true'] {
  background-image: url(../assets/ui/seg-green.webp);
  --o: #1a8e54;
}

/* ---- slider ---- */
input[type='range'] {
  -webkit-appearance: none;
  appearance: none;
  background: transparent;
  margin: 0;
  flex: 1;
  min-width: 0;
  height: 100%;
  --v: 50%;
  --t: 0.46em;
}
input[type='range']::-webkit-slider-runnable-track {
  height: var(--t);
  background:
    url(../assets/ui/sl-fill.webp) left center / var(--v) 100% no-repeat,
    url(../assets/ui/sl-track.webp) center / 100% 100% no-repeat;
}
input[type='range']::-moz-range-track {
  height: var(--t);
  background:
    url(../assets/ui/sl-fill.webp) left center / var(--v) 100% no-repeat,
    url(../assets/ui/sl-track.webp) center / 100% 100% no-repeat;
}
input[type='range']::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 1.15em;
  height: 1.15em;
  margin-top: calc((var(--t) - 1.15em) / 2);
  background: url(../assets/ui/sl-knob.webp) center / 100% 100% no-repeat;
}
input[type='range']::-moz-range-thumb {
  width: 1.15em;
  height: 1.15em;
  border: 0;
  background: url(../assets/ui/sl-knob.webp) center / 100% 100% no-repeat;
}

/* ---- rows ---- */
.row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5em;
  flex: 1 1 0;
  min-height: 0;
}
.row > span {
  min-width: 0;
  line-height: 1.02;
}
.row small {
  display: block;
  font-size: 0.72em;
  font-weight: 500;
}

/* ---- title pill, ribbon, tabs, bubble ---- */
.ribbon {
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: calc(var(--h) * 0.62);
  line-height: 1;
  --o: #472353;
}
.ribbon span {
  position: relative;
  z-index: 1;
  flex: 1;
  min-width: 0;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  padding-bottom: calc(var(--h) * 0.07);
  white-space: nowrap;
  border-style: solid;
  border-color: transparent;
  border-width: 0 calc(var(--h) * 0.46);
  border-image: url(../assets/ui/title-pill.webp) 0 98 fill / 0 calc(var(--h) * 0.46) stretch;
}
.ribbon img {
  height: 100%;
  width: auto;
  flex: none;
  margin-right: calc(var(--h) * -0.26);
}
.ribbon img.flip {
  margin: 0 0 0 calc(var(--h) * -0.26);
}
.flip {
  transform: scaleX(-1);
}
.ribbon.big span {
  border: 0;
  background: url(../assets/ui/ribbon.webp) center / 100% 100% no-repeat;
  padding-bottom: calc(var(--h) * 0.25);
  border-image: none;
}
.tabs {
  display: flex;
  border-style: solid;
  border-color: transparent;
  border-width: 0 calc(var(--h) * 0.5);
  border-image: url(../assets/ui/tab-track.webp) 0 94 fill / 0 calc(var(--h) * 0.5) stretch;
  font-size: calc(var(--h) * 0.58);
}
.tabs button {
  flex: 1;
  min-width: 0;
  margin: 0 calc(var(--h) * -0.48);
  height: 100%;
  padding-bottom: calc(var(--h) * 0.07);
  background-size: 100% 100%;
  --o: #3b1e45;
  white-space: nowrap;
}
.tabs button + button {
  margin-left: calc(var(--h) * 0.5);
}
.tabs button.on {
  background: url(../assets/ui/tab-sky.webp) center / 100% 100% no-repeat;
  --o: #186f7c;
}
.tabs.three button.on {
  background-image: url(../assets/ui/tab-violet.webp);
  --o: #522a5f;
}
.bubble {
  background: url(../assets/ui/bubble.webp) center / 100% 100% no-repeat;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 0 calc(var(--w) * 0.08) calc(var(--h) * 0.12);
  font-size: calc(var(--h) * 0.36);
  line-height: 1.08;
  --o: #186f7c;
  pointer-events: none;
  z-index: 45;
}

.toast {
  position: absolute;
  left: 50%;
  bottom: 13%;
  transform: translateX(-50%);
  z-index: 95;
  --h: calc(var(--u) * 7.4);
  height: var(--h);
  font-size: calc(var(--h) * 0.5);
  max-width: 94%;
  pointer-events: none;
}
.veil {
  position: absolute;
  inset: 0;
  background: rgba(0, 13, 43, 0.66);
  z-index: 70;
  animation: fade 0.2s both;
}
@keyframes fade {
  from {
    opacity: 0;
  }
}
@keyframes pop {
  from {
    opacity: 0;
    scale: 0.86;
  }
  68% {
    opacity: 1;
    scale: 1.025;
  }
}
@keyframes breathe {
  50% {
    transform: scale(1.012, 1.03);
  }
}
@keyframes dukeCheer {
  50% {
    transform: scale(1.05, 1.04) translateY(-2%);
  }
}
@keyframes dukeHype {
  25% {
    transform: rotate(-1.2deg) scale(1.02);
  }
  75% {
    transform: rotate(1.2deg) scale(1.02);
  }
}
.duke {
  object-fit: contain;
  object-position: 50% 100%;
  transform-origin: 50% 100%;
  animation: breathe 3.2s ease-in-out infinite;
}
.duke[data-mood='cheer'] {
  animation: dukeCheer 0.5s ease-in-out infinite;
}
.duke[data-mood='hype'] {
  animation: dukeHype 0.32s ease-in-out infinite;
}
.reduced .duke,
.reduced .veil,
.reduced .panel,
.reduced .win,
.reduced .how,
.reduced .screen {
  animation: none !important;
  transition: none !important;
}
/* End of css/base.css (complete file). */
