/* styles.css - Toy Chess: glossy toy look, mint and blue. 1rem = 10 screen units (--u), in portrait and landscape. */
@font-face {
  font-family: Fredoka;
  src: url(../assets/fonts/fredoka-latin-wght-normal.woff2) format('woff2');
  font-weight: 300 700;
  font-display: swap;
  unicode-range:
    U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+20AC, U+2122, U+2212, U+FEFF,
    U+FFFD;
}
@font-face {
  font-family: Fredoka;
  src: url(../assets/fonts/fredoka-latin-ext-wght-normal.woff2) format('woff2');
  font-weight: 300 700;
  font-display: swap;
  unicode-range:
    U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+1E00-1E9F, U+1EF2-1EFF, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: Nunito;
  src: url(../assets/fonts/nunito-cyrillic-900.woff2) format('woff2');
  font-weight: 900;
  font-display: swap;
  unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
}
:root {
  --u: clamp(2.8px, min(1vw, 0.56dvh), 13px);
  --mint: #8ef2c8;
  --mint2: #c9fbe5;
  --teal: #0f7a66;
  --teal2: #0a5a4c;
  --ink: #063f36;
  --blue: #1746c9;
  --navy: #0b2a7a;
  --orange: #ff8a00;
  --brick: #a84300;
  --gold: #ffc21a;
  --coral: #ff8f6b;
  --sq-l: #f4f7f8;
  --sq-d: #252a32;
  --ff:
    Fredoka, Nunito, 'Hiragino Maru Gothic ProN', 'Yu Gothic UI', 'Malgun Gothic', 'PingFang SC', 'Microsoft YaHei',
    system-ui, sans-serif;
  --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);
  --bs: min(9.2rem, calc(100dvh - 8.45rem - var(--sat) - var(--sab)));
  --mv: 190ms;
  --out: 0.028rem;
  --top: clamp(1.92rem, calc(100dvh - 17.4rem), 2.8rem);
  --ctl: clamp(1.72rem, calc(100dvh - 17rem), 2.05rem);
}
@media (min-aspect-ratio: 11/10) {
  :root {
    --u: clamp(2.8px, min(0.56vw, 1dvh), 13px);
    --bs: min(9.2rem, calc(100dvh - 0.7rem - var(--sat) - var(--sab)));
  }
}
* {
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
}
html {
  font-size: calc(var(--u) * 10);
  -webkit-text-size-adjust: 100%;
}
html,
body {
  margin: 0;
  height: 100%;
  background: #36b34a;
  overflow: hidden;
  overscroll-behavior: none;
  -webkit-user-select: none;
  user-select: none;
}
body {
  font: 500 0.4rem/1.2 var(--ff);
  color: #fff;
}
button {
  font: inherit;
  color: inherit;
  border: 0;
  background: none;
  padding: 0;
  cursor: pointer;
}
button:focus-visible,
input:focus-visible + .sw {
  outline: 0.05rem solid var(--gold);
  outline-offset: 0.03rem;
}
img {
  display: block;
  -webkit-user-drag: none;
}
#app {
  position: fixed;
  inset: 0;
}
#bg,
.bg {
  position: absolute;
  inset: 0;
}
.bg {
  background-size: cover;
  background-position: center;
  opacity: 0;
  transition: opacity 0.3s;
}
.bg.on {
  opacity: 1;
}
.b-menu {
  background-image: url(../assets/bg/menu-portrait.webp);
}
.b-game {
  background-image: url(../assets/bg/game-portrait.webp);
}
@media (min-aspect-ratio: 11/10) {
  .b-menu {
    background-image: url(../assets/bg/menu-landscape.webp);
  }
  .b-game {
    background-image: url(../assets/bg/game-landscape.webp);
  }
}
[data-nine] {
  background-size: 100% 100%;
  background-repeat: no-repeat;
}
.fit {
  display: block;
  max-width: 100%;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: clip;
  text-align: center;
  padding: 0.02rem 0.03rem;
}
.screen {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.3rem;
  padding: calc(var(--sat) + 0.2rem) calc(var(--sar) + 0.2rem) calc(var(--sab) + 0.2rem) calc(var(--sal) + 0.2rem);
  opacity: 0;
  visibility: hidden;
  transform: translateY(0.1rem);
  transition:
    opacity 0.22s,
    transform 0.22s,
    visibility 0s 0.22s;
}
.screen.on {
  opacity: 1;
  visibility: visible;
  transform: none;
  transition:
    opacity 0.22s,
    transform 0.22s;
}
body.reduced .screen,
body.reduced .bg {
  transition: none;
  transform: none;
}

/* buttons */
.btn {
  position: relative;
  min-width: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 1.46rem;
  min-height: 44px;
  padding: 0 0.6rem 0.12rem;
  font-weight: 700;
  font-size: 0.62rem;
  color: #fff;
  --oc: var(--navy);
  text-shadow:
    var(--out) 0 var(--oc),
    calc(var(--out) * -1) 0 var(--oc),
    0 var(--out) var(--oc),
    0 calc(var(--out) * -1) var(--oc),
    var(--out) var(--out) var(--oc),
    calc(var(--out) * -1) var(--out) var(--oc),
    var(--out) calc(var(--out) * -1) var(--oc),
    calc(var(--out) * -1) calc(var(--out) * -1) var(--oc),
    0 0.05rem 0 var(--oc);
  transition:
    transform 0.08s,
    filter 0.12s;
}
.btn[data-nine='btn-orange'] {
  --oc: var(--brick);
}
.btn[data-nine='btn-teal'] {
  --oc: var(--ink);
}
.btn[hidden] {
  display: none;
}
.btn:active,
.ib:active,
.chip:active,
.tile:active,
.bot:active,
.ptab:active {
  transform: translateY(0.03rem) scale(0.975);
  filter: brightness(0.93);
}
.btn:disabled {
  filter: saturate(0.45) brightness(0.85);
  pointer-events: none;
}
.btn em,
.ib em {
  position: absolute;
  right: -0.04rem;
  top: -0.06rem;
  min-width: 0.56rem;
  height: 0.56rem;
  padding: 0 0.08rem;
  border-radius: 0.3rem;
  background: var(--gold);
  box-shadow: 0 0 0 0.03rem #b86f00;
  color: #3b2400;
  font: 700 0.36rem/.56rem var(--ff);
  text-align: center;
  text-shadow: none;
}
.btn em:empty,
.ib em:empty {
  display: none;
}
.ib {
  position: relative;
  flex: none;
  width: 1.34rem;
  height: 1.34rem;
  min-width: 44px;
  min-height: 44px;
  display: grid;
  place-items: center;
  background: url(../assets/ui/round.webp) center/100% 100% no-repeat;
  transition:
    transform 0.08s,
    filter 0.12s;
}
.ib .ic {
  width: 60%;
  height: 60%;
  filter: drop-shadow(0 0.02rem 0 rgba(6, 26, 90, 0.75));
}
.ib:disabled {
  filter: saturate(0.35) brightness(0.9);
  opacity: 0.7;
  pointer-events: none;
}
.topbtns {
  position: fixed;
  z-index: 60;
  top: calc(var(--sat) + 0.16rem);
  right: calc(var(--sar) + 0.16rem);
  display: flex;
  gap: 0.12rem;
}
.topbtns.hide {
  display: none;
}
.stack {
  display: flex;
  flex-direction: column;
  gap: 0.18rem;
  width: min(100%, 8.7rem);
}
.logo {
  flex: none;
  object-fit: contain;
  filter: drop-shadow(0 0.06rem 0.08rem rgba(0, 40, 60, 0.4));
}
.pill {
  flex: none;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0;
  height: 0.94rem;
  padding: 0 0.42rem 0.05rem;
  font-weight: 700;
  font-size: 0.5rem;
  color: #fff;
  text-shadow: 0 0.04rem 0 var(--ink);
}

/* start and menu */
#s-splash {
  justify-content: center;
  gap: 0.5rem;
}
#s-splash .logo {
  width: 7.2rem;
  height: 8.2rem;
  margin-bottom: 4.6rem;
}
#s-splash .btn {
  width: 8.6rem;
  height: 1.95rem;
  font-size: 0.84rem;
}
#s-menu {
  justify-content: flex-start;
  padding-top: calc(var(--sat) + 0.5rem);
}
#s-menu .logo {
  width: 6.2rem;
  height: min(6.2rem, 30dvh);
}
#s-menu .btn {
  height: min(1.58rem, 8dvh);
  font-size: 0.68rem;
}
@media (max-aspect-ratio: 11/10) {
  #s-splash {
    justify-content: flex-end;
    padding-bottom: calc(var(--sab) + 1.5rem);
  }
  #s-splash .logo {
    position: absolute;
    top: calc(var(--sat) + 1.8rem);
    margin: 0;
  }
  #s-menu .stack {
    margin-top: 0.1rem;
  }
}

/* sub-screens */
.sub {
  gap: 0.16rem;
  justify-content: flex-start;
}
.subhead {
  position: relative;
  flex: none;
  width: min(100%, 9.6rem);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.08rem;
}
.subhead > .ib {
  position: absolute;
  left: 0;
  top: 0;
}
.logo.mini {
  width: 2.6rem;
  height: 2.95rem;
}
.subhead .pill {
  width: 8rem;
}
.bots {
  width: min(100%, 9.6rem);
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  gap: 0.07rem;
}
.bot {
  flex: 1;
  max-height: 1.96rem;
  min-height: 44px;
  display: flex;
  align-items: center;
  gap: 0.16rem;
  padding: 0 0.24rem 0 0.06rem;
  text-align: left;
  border-radius: 0.7rem;
  transition:
    transform 0.08s,
    box-shadow 0.12s;
}
.bot.on {
  box-shadow:
    0 0 0 0.05rem var(--gold),
    0 0.03rem 0.14rem rgba(255, 194, 26, 0.7);
}
.bot .av {
  width: 1.66rem;
  height: 1.66rem;
}
.av {
  position: relative;
  flex: none;
  display: block;
  width: 1.36rem;
  height: 1.36rem;
  border-radius: 50%;
  overflow: hidden;
  background: conic-gradient(var(--mint) 25%, var(--teal) 0 50%, var(--mint) 0 75%, var(--teal) 0) 0 0/0.32rem 0.32rem;
  box-shadow:
    0 0 0 0.05rem var(--gold),
    0 0 0 0.075rem #b86f00,
    0 0.05rem 0.08rem rgba(0, 40, 40, 0.4);
}
.av img {
  position: absolute;
  left: 50%;
  bottom: -8%;
  width: 118%;
  height: 118%;
  max-width: none;
  transform: translateX(-50%);
}
.av.me {
  background: var(--teal2);
}
.av.me img {
  bottom: 10%;
  width: 76%;
  height: 76%;
}
.bn {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
}
.bn .fit {
  text-align: left;
}
.bn b {
  font-size: 0.56rem;
  font-weight: 700;
  text-shadow: 0 0.03rem 0 var(--ink);
}
.bn small {
  font-size: 0.35rem;
  color: var(--mint2);
}
.lv {
  flex: none;
  display: flex;
}
.lv img {
  width: 0.6rem;
  height: 0.66rem;
  margin-left: -0.06rem;
}
.colorbar {
  flex: none;
  width: min(100%, 9.6rem);
  display: grid;
  grid-template-columns: 1fr;
  justify-items: center;
  gap: 0.1rem;
}
.lbl {
  font-weight: 700;
  font-size: 0.48rem;
  text-shadow: 0 0.03rem 0 var(--ink);
}
.seg {
  display: flex;
  gap: 0.08rem;
  width: 100%;
}
.chip {
  flex: 1;
  min-width: 0;
  height: 1.02rem;
  min-height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 0.2rem 0.03rem;
  font-weight: 600;
  font-size: 0.44rem;
  color: #fff;
  text-shadow: 0 0.025rem 0 var(--ink);
  transition: transform 0.08s;
}
.chip[data-nine='chip-on'] {
  color: #4a2d00;
  text-shadow: none;
}
.colorbar .btn {
  width: 6.8rem;
  height: 1.44rem;
  font-size: 0.72rem;
}
.learnwrap {
  flex: 1;
  min-height: 0;
  width: min(100%, 9.6rem);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.14rem;
}
.lb {
  --bs: min(8.4rem, calc(100dvh - 10.6rem - var(--sat) - var(--sab)));
  padding: 0.16rem !important;
}
.lside {
  width: 100%;
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
}
.ptabs {
  flex: none;
  display: flex;
  gap: 0.05rem;
}
.ptab {
  position: relative;
  flex: 1;
  min-width: 0;
  height: 1.1rem;
  min-height: 44px;
  background: url(../assets/ui/tile.webp) center/100% 100% no-repeat;
  transition: transform 0.08s;
}
.ptab.on {
  background-image: url(../assets/ui/tile-on.webp);
}
.ptab img {
  position: absolute;
  inset: 6%;
  width: 88%;
  height: 88%;
  object-fit: contain;
}
.plate {
  flex: 1;
  min-height: 2.2rem;
  max-height: 3.3rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.05rem;
  padding: 0.12rem 0.22rem;
  text-align: center;
}
.plate h3 {
  margin: 0;
  font-size: 0.6rem;
  font-weight: 700;
  text-shadow: 0 0.03rem 0 var(--ink);
}
.plate p {
  margin: 0;
  font-size: 0.41rem;
  line-height: 1.15;
  color: #eafff6;
}
.spec {
  display: flex;
  gap: 0.06rem;
  width: 100%;
  margin-top: 0.03rem;
}
.spec .btn {
  flex: 1;
  min-width: 0;
  height: 0.96rem;
  min-height: 44px;
  padding: 0 0.18rem 0.05rem;
  font-size: 0.39rem;
  font-weight: 600;
}
.spec .btn.on {
  filter: brightness(1.2);
}
.puzlist {
  flex: 1;
  min-height: 0;
  width: min(100%, 9.6rem);
  display: flex;
  flex-direction: column;
  gap: 0.12rem;
  overflow-y: auto;
  scrollbar-width: none;
}
.puzlist::-webkit-scrollbar {
  display: none;
}
.psec {
  flex: 1 1 0;
  min-height: 3.5rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.08rem;
  padding: 0.12rem 0.2rem 0.18rem;
}
.psec .pill {
  height: 0.84rem;
  width: 5rem;
  font-size: 0.46rem;
}
.tiles {
  width: 100%;
  flex: none;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  grid-auto-rows: 0.86rem;
  gap: 0.07rem;
}
.tile {
  position: relative;
  min-height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.48rem;
  text-shadow: 0 0.03rem 0 var(--ink);
  transition: transform 0.08s;
}
.tile .ic {
  position: absolute;
  right: 6%;
  bottom: 8%;
  width: 36%;
  height: 56%;
  object-fit: contain;
  filter: drop-shadow(0 0.02rem 0 var(--brick));
}
.tile[data-nine='tile-on'] {
  text-shadow: 0 0.03rem 0 var(--brick);
}
.tile.next {
  box-shadow: 0 0 0 0.05rem var(--gold);
  border-radius: 0.26rem;
}

/* game */
.game {
  padding: 0;
}
.gwrap {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.12rem;
  padding: calc(var(--sat) + 0.12rem) calc(var(--sar) + 0.04rem) calc(var(--sab) + 0.14rem) calc(var(--sal) + 0.04rem);
}
.puzhead {
  display: none;
}
.pcard {
  flex: none;
  width: min(100%, 9.76rem);
}
#c-top {
  padding-right: 3.1rem;
  height: var(--top);
  display: flex;
  align-items: center;
}
#c-top .pc-card {
  flex: 1;
}
.pc-card {
  display: flex;
  align-items: center;
  gap: 0.14rem;
  width: 100%;
  height: 1.12rem;
  padding: 0 0.3rem 0 0.1rem;
  transition: filter 0.15s;
}
.pc-card .av {
  width: 0.98rem;
  height: 0.98rem;
}
#c-top .pc-card {
  padding-left: 0;
}
#c-top .av {
  width: calc(var(--top) - 0.06rem);
  height: calc(var(--top) - 0.06rem);
  margin-left: 0.06rem;
}
#c-top .caps {
  justify-content: flex-start;
}
.pc-card.turn {
  filter: drop-shadow(0 0 0.08rem rgba(255, 224, 90, 0.95));
}
.nm {
  flex: none;
  max-width: 2.6rem;
  display: flex;
  flex-direction: column;
  min-width: 0;
}
.nm b {
  font-size: 0.5rem;
  font-weight: 700;
  text-align: left;
  text-shadow: 0 0.03rem 0 var(--ink);
}
.dots {
  display: none;
  gap: 0.05rem;
  height: 0.1rem;
  padding-left: 0.03rem;
}
.busy .dots {
  display: inline-flex;
}
.dots i {
  width: 0.09rem;
  height: 0.09rem;
  border-radius: 50%;
  background: var(--gold);
  animation: dot 1s infinite;
}
.dots i:nth-child(2) {
  animation-delay: 0.15s;
}
.dots i:nth-child(3) {
  animation-delay: 0.3s;
}
@keyframes dot {
  0%,
  60%,
  100% {
    opacity: 0.25;
  }
  30% {
    opacity: 1;
  }
}
body.reduced .dots i {
  animation: none;
  opacity: 0.8;
}
.caps {
  flex: 1;
  min-width: 0;
  height: 0.7rem;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  overflow: hidden;
}
.cp {
  flex: 0 1 0.46rem;
  min-width: 0.16rem;
  height: 0.5rem;
}
.cp img {
  width: 0.46rem;
  height: 0.5rem;
  max-width: none;
}
.lead {
  flex: none;
  margin-left: 0.1rem;
  padding: 0 0.12rem;
  border-radius: 0.2rem;
  background: rgba(0, 45, 40, 0.55);
  box-shadow: inset 0 0 0 0.02rem var(--mint);
  font-weight: 700;
  font-size: 0.32rem;
}
.bframe {
  position: relative;
  flex: none;
  padding: 0.14rem 0.14rem 0.42rem 0.42rem;
}
body.nocoords .bframe {
  padding: 0.16rem;
}
body.nocoords .rk,
body.nocoords .fl {
  display: none;
}
.rk,
.fl {
  position: absolute;
  display: flex;
  font-weight: 700;
  font-size: 0.27rem;
  color: var(--mint2);
}
.rk i,
.fl i {
  flex: 1;
  display: grid;
  place-items: center;
  font-style: normal;
}
.rk {
  left: 0.05rem;
  width: 0.37rem;
  top: 0.14rem;
  bottom: 0.42rem;
  flex-direction: column;
}
.fl {
  left: 0.42rem;
  right: 0.14rem;
  bottom: 0.05rem;
  height: 0.37rem;
}
.side {
  flex: 1;
  min-height: 0;
  width: min(100%, 9.76rem);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.08rem;
}
.status {
  flex: none;
  height: 0.6rem;
  display: flex;
  align-items: center;
  justify-content: center;
  visibility: hidden;
}
.status.on {
  visibility: visible;
  padding: 0 0.34rem;
  border-radius: 0.3rem;
  background: linear-gradient(#17917a, #0b6554);
  box-shadow:
    0 0 0 0.04rem var(--mint),
    0 0.03rem 0.06rem rgba(0, 50, 40, 0.5);
  font-weight: 700;
  font-size: 0.34rem;
  text-shadow: 0 0.025rem 0 var(--ink);
}
.status.chk {
  background: linear-gradient(#ff9c2a, #f26f00);
  box-shadow:
    0 0 0 0.04rem var(--gold),
    0 0.03rem 0.06rem rgba(120, 50, 0, 0.5);
  text-shadow: 0 0.025rem 0 var(--brick);
  font-size: 0.38rem;
}
.moves {
  flex: none;
  width: 100%;
  height: 0.94rem;
  padding: 0 0.36rem 0.03rem;
  display: flex;
  align-items: center;
}
.mvs {
  width: 100%;
  display: flex;
  gap: 0.16rem;
  overflow-x: auto;
  white-space: nowrap;
  scrollbar-width: none;
  align-items: center;
}
.mvs::-webkit-scrollbar {
  display: none;
}
.mv {
  flex: none;
  display: inline-flex;
  align-items: center;
  gap: 0.08rem;
  font-size: 0.4rem;
}
.mv i {
  color: var(--mint);
  font-style: normal;
}
.mv b {
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 0.01rem;
}
.fig img {
  width: 0.5rem;
  height: 0.54rem;
  margin-right: -0.02rem;
}
.ctrls {
  flex: 1;
  width: 100%;
  display: flex;
  justify-content: space-around;
  align-items: center;
}
.ctrls .ib {
  width: var(--ctl);
  height: var(--ctl);
}
.prog,
.pzbtns,
#g-back {
  display: none;
}
.m-puz #c-top,
.m-puz #c-bot,
.m-puz .moves,
.m-puz .ctrls,
.m-puz .status {
  display: none !important;
}
.m-puz .puzhead {
  position: relative;
  flex: none;
  width: min(100%, 9.6rem);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.07rem;
}
.m-puz #g-back {
  display: grid;
  position: absolute;
  left: 0;
  top: 0;
}
.puzhead .logo {
  width: 2.2rem;
  height: 2.5rem;
}
.puzhead .pill {
  width: 6.6rem;
  height: 0.86rem;
  font-size: 0.44rem;
}
.goal {
  margin: 0;
  width: 8.8rem;
  height: 0.86rem;
  padding: 0 0.3rem 0.02rem;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--ink);
  font-weight: 600;
  font-size: 0.42rem;
}
.m-puz .prog {
  display: flex;
  align-items: center;
  justify-content: center;
  flex: none;
  width: 5rem;
  height: 0.86rem;
  padding: 0 0.3rem 0.04rem;
  font-weight: 600;
  font-size: 0.42rem;
}
.prog.miss {
  filter: hue-rotate(-130deg) saturate(1.2);
}
.m-puz .pzbtns {
  flex: 1;
  width: 100%;
  display: flex;
  gap: 0.16rem;
  align-items: center;
  padding: 0 0.3rem;
}
.pzbtns .btn {
  flex: 1 1 0;
  height: 1.56rem;
  padding: 0 0.3rem 0.12rem;
  font-size: 0.7rem;
}
@media (max-aspect-ratio: 11/10) {
  .m-puz {
    --bs: min(9rem, calc(100dvh - 8.6rem - var(--sat) - var(--sab)));
  }
}

/* landscape */
@media (min-aspect-ratio: 11/10) {
  .stack {
    width: 7.4rem;
    gap: 0.1rem;
  }
  #s-splash {
    justify-content: flex-end;
    gap: 0.2rem;
    padding-bottom: calc(var(--sab) + 0.3rem);
  }
  #s-splash .logo {
    position: absolute;
    top: calc(var(--sat) + 0.1rem);
    width: 6rem;
    height: 6.9rem;
    margin: 0;
  }
  #s-splash .btn {
    width: 8.6rem;
    height: 1.62rem;
    padding: 0 0.46rem 0.12rem;
    font-size: 0.74rem;
  }
  #s-menu {
    padding-top: calc(var(--sat) + 0.14rem);
    gap: 0.1rem;
    justify-content: flex-start;
  }
  #s-menu .logo {
    flex: 0 1 3.3rem;
    width: 3rem;
    height: auto;
    min-height: 0;
  }
  #s-menu .stack {
    flex: none;
  }
  #s-menu .btn {
    height: 1.14rem;
    font-size: 0.54rem;
  }
  .sub {
    padding-top: calc(var(--sat) + 0.12rem);
  }
  .subhead {
    width: 100%;
    max-width: 17rem;
    flex-direction: row;
    justify-content: center;
    height: 1.34rem;
  }
  .subhead .logo.mini {
    position: absolute;
    left: 1.5rem;
    top: -0.04rem;
    width: 1.5rem;
    height: 1.6rem;
  }
  .subhead .pill {
    width: 7.2rem;
  }
  .bots {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    grid-auto-rows: 1fr;
    width: min(100%, 15.6rem);
    max-width: 15.6rem;
    gap: 0.1rem;
  }
  .bot {
    max-height: none;
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    grid-template-rows: auto auto;
    align-content: center;
    align-items: center;
    column-gap: 0.16rem;
    row-gap: 0.04rem;
    padding: 0.12rem 0.2rem;
    border-radius: 0.52rem;
  }
  .bot .av {
    grid-row: 1 / 3;
    width: 2.1rem;
    height: 2.1rem;
  }
  .bn {
    grid-column: 2;
  }
  .lv {
    grid-column: 2;
    justify-content: flex-start;
    padding-left: 0.05rem;
  }
  .lv img {
    width: 0.44rem;
    height: 0.5rem;
    margin-left: -0.04rem;
  }
  .bn b {
    font-size: 0.54rem;
  }
  .bot.on {
    box-shadow:
      0 0 0 0.05rem var(--gold),
      0 0 0.14rem rgba(255, 194, 26, 0.8);
  }
  .colorbar {
    width: min(100%, 15.6rem);
    max-width: 15.6rem;
    grid-template-columns: auto minmax(0, 1fr) 4.2rem;
    align-items: center;
    gap: 0.24rem;
  }
  .colorbar .btn {
    width: 100%;
    height: 1.14rem;
    font-size: 0.56rem;
  }
  .colorbar .chip {
    height: 0.94rem;
    font-size: 0.38rem;
  }
  .bot .av {
    grid-row: 1 / 3;
  }
  .learnwrap {
    flex-direction: row;
    justify-content: center;
    width: 100%;
    max-width: 16.6rem;
    gap: 0.3rem;
  }
  .lb {
    --bs: min(7.7rem, calc(100dvh - 2rem - var(--sat) - var(--sab)));
  }
  .lside {
    flex: 1;
    max-width: 8.2rem;
    height: 100%;
  }
  .plate {
    max-height: none;
  }
  .puzlist {
    flex-direction: row;
    align-items: center;
    width: min(100%, 16.4rem);
    max-width: 16.4rem;
    gap: 0.14rem;
    overflow: visible;
  }
  .psec {
    min-width: 0;
    min-height: 0;
  }
  .tiles {
    grid-auto-rows: 1.32rem;
    gap: 0.1rem;
  }
  .psec .pill {
    height: 0.86rem;
    font-size: 0.46rem;
  }
  .tile {
    font-size: 0.52rem;
  }
  /* board in the center of the screen: players and notice on the left, moves and buttons on the right, aligned to the frame height */
  .gwrap {
    --bh: calc(var(--bs) + 0.56rem);
    --cw: 5.6rem;
    inset: calc((100dvh - var(--bh)) / 2) 0 auto;
    height: var(--bh);
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
    grid-template-rows: auto minmax(0, 1fr) auto;
    column-gap: 0.3rem;
    row-gap: 0;
    padding: 0 calc(var(--sar) + 0.16rem) 0 calc(var(--sal) + 0.16rem);
  }
  .gwrap > .bframe {
    grid-column: 2;
    grid-row: 1 / -1;
    align-self: center;
  }
  .side {
    display: contents;
  }
  #c-top,
  #c-bot {
    grid-column: 1;
    justify-self: end;
    width: 100%;
    max-width: var(--cw);
    height: 1.3rem;
    padding-right: 0;
    display: flex;
    align-items: center;
  }
  #c-top {
    grid-row: 1;
    align-self: start;
  }
  #c-bot {
    grid-row: 3;
    align-self: end;
  }
  #c-top .pc-card,
  #c-bot .pc-card {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    grid-template-rows: auto auto;
    align-content: center;
    gap: 0 0.12rem;
    height: 1.24rem;
    padding: 0 0.24rem 0 0.08rem;
  }
  #c-top .av,
  #c-bot .av {
    grid-row: 1 / 3;
    width: 1.06rem;
    height: 1.06rem;
    margin-left: 0.02rem;
  }
  #c-top .nm,
  #c-bot .nm {
    max-width: 100%;
  }
  #c-top .caps,
  #c-bot .caps {
    justify-content: flex-start;
    height: 0.44rem;
  }
  #c-top .caps:empty,
  #c-bot .caps:empty {
    display: none;
  }
  #c-top .pc-card:has(.caps:empty) .av,
  #c-bot .pc-card:has(.caps:empty) .av {
    grid-row: 1;
  }
  .cp {
    flex: 0 1 0.36rem;
    min-width: 0.1rem;
    height: 0.4rem;
  }
  .cp img {
    width: 0.36rem;
    height: 0.4rem;
  }
  .lead {
    margin-left: 0.06rem;
  }
  .status {
    grid-column: 1;
    grid-row: 2;
    align-self: center;
    justify-self: end;
    width: 100%;
    max-width: var(--cw);
    height: 0.96rem;
  }
  .status.on {
    padding: 0 0.3rem;
    font-size: 0.5rem;
  }
  .status.chk {
    font-size: 0.56rem;
  }
  .moves {
    grid-column: 3;
    grid-row: 1;
    align-self: start;
    justify-self: start;
    width: 100%;
    max-width: var(--cw);
    height: 1rem;
    margin-top: 1.62rem;
  }
  .ctrls {
    grid-column: 3;
    grid-row: 3;
    justify-self: start;
    width: 100%;
    max-width: var(--cw);
    display: grid;
    grid-template-columns: repeat(2, auto);
    justify-content: center;
    align-items: end;
    gap: 0.14rem 0.3rem;
    padding: 0;
  }
  .ctrls .ib {
    width: 1.5rem;
    height: 1.5rem;
  }
  .m-puz .puzhead {
    grid-column: 1;
    grid-row: 1 / -1;
    align-self: stretch;
    justify-self: end;
    width: 100%;
    max-width: var(--cw);
    margin: 0;
    justify-content: center;
    gap: 0.16rem;
  }
  .m-puz .puzhead .logo {
    width: 2.1rem;
    height: 2.3rem;
  }
  .m-puz .goal,
  .m-puz .puzhead .pill {
    width: 100%;
  }
  .m-puz .goal {
    height: 1.12rem;
    font-size: 0.38rem;
  }
  .m-puz .prog {
    grid-column: 3;
    grid-row: 1;
    align-self: start;
    justify-self: start;
    width: 100%;
    max-width: var(--cw);
    height: 0.9rem;
    margin-top: 1.62rem;
  }
  .m-puz .pzbtns {
    grid-column: 3;
    grid-row: 3;
    flex: none;
    flex-direction: column;
    justify-self: start;
    align-self: end;
    width: 100%;
    max-width: var(--cw);
    padding: 0 !important;
    gap: 0.12rem;
  }
  .pzbtns .btn {
    flex: none;
    width: 100%;
    height: 1.2rem;
    padding: 0 0.26rem 0.1rem;
    font-size: 0.52rem;
  }
}

/* board */
.board {
  position: relative;
  width: var(--bs);
  height: var(--bs);
  border-radius: 0.14rem;
  overflow: hidden;
  touch-action: none;
}
.board .grid,
.board .pieces,
.board .fx,
.board .arrows {
  position: absolute;
  inset: 0;
}
.board .pieces,
.board .arrows,
.board .fx {
  pointer-events: none;
}
.board .arrows {
  width: 100%;
  height: 100%;
}
.sq {
  position: absolute;
  left: calc(var(--x) * 12.5%);
  top: calc(var(--y) * 12.5%);
  width: 12.5%;
  height: 12.5%;
}
.sq.lt {
  background: var(--sq-l);
}
.sq.dk {
  background: var(--sq-d);
}
.sq::before,
.sq::after {
  content: '';
  position: absolute;
  inset: 0;
  pointer-events: none;
}
.sq.last::before {
  inset: 3%;
  border-radius: 12%;
  background: rgba(255, 228, 77, 0.58);
  box-shadow: inset 0 0 0 0.025rem #ffd61f;
}
.sq.sel::before {
  inset: 3%;
  border-radius: 12%;
  background: rgba(255, 220, 40, 0.82);
  box-shadow:
    inset 0 0 0 0.035rem #ffc400,
    0 0 0.06rem rgba(255, 210, 40, 0.9);
}
.sq.hint::before {
  inset: 3%;
  border-radius: 12%;
  background: rgba(255, 240, 120, 0.75);
  box-shadow: inset 0 0 0 0.04rem #fff;
}
.sq.over::before {
  inset: 2%;
  border-radius: 12%;
  background: rgba(255, 235, 110, 0.5);
  box-shadow: inset 0 0 0 0.04rem #ffd61f;
}
.sq.chk::before {
  background: radial-gradient(
    circle,
    rgba(255, 143, 107, 0.95) 0 34%,
    rgba(255, 143, 107, 0.45) 56%,
    rgba(255, 143, 107, 0) 74%
  );
}
.sq.mate::before {
  background: radial-gradient(
    circle,
    rgba(255, 120, 86, 1) 0 42%,
    rgba(255, 143, 107, 0.4) 66%,
    rgba(255, 143, 107, 0) 80%
  );
}
.sq.tgt::after {
  inset: 34%;
  border-radius: 50%;
  background: #18b58f;
  box-shadow:
    0 0 0 0.02rem #fff,
    0 0.015rem 0.03rem rgba(0, 0, 0, 0.45);
}
.sq.cap::after {
  inset: 5%;
  border-radius: 50%;
  border: 0.055rem solid #18b58f;
  box-shadow:
    0 0 0 0.016rem #fff,
    inset 0 0 0 0.016rem #fff;
}
.pc {
  position: absolute;
  left: 0;
  top: 0;
  width: 12.5%;
  height: 12.5%;
  padding: 2%;
  transform: translate(calc(var(--x) * 100%), calc(var(--y) * 100%));
  will-change: transform;
}
.pc img {
  width: 100%;
  height: 100%;
  filter: drop-shadow(0 0.018rem 0.012rem rgba(0, 45, 40, 0.55));
}
.pc[data-code^='b'] img {
  filter: drop-shadow(0 0 0.012rem rgba(255, 255, 255, 0.95)) drop-shadow(0 0 0.012rem rgba(255, 255, 255, 0.7));
}
.pc.drag img,
.pc.drag[data-code^='b'] img {
  filter: drop-shadow(0 0 0.012rem rgba(255, 255, 255, 0.9)) drop-shadow(0 0.1rem 0.07rem rgba(0, 40, 40, 0.5));
}
.arrows .ar {
  stroke: #ffc21a;
  stroke-width: 2.4;
  stroke-linecap: round;
  opacity: 0.95;
}
.arrows .ah {
  fill: #ffc21a;
}
.fx .scrim {
  position: absolute;
  inset: 0;
  background: rgba(4, 50, 42, 0.55);
  pointer-events: auto;
}
.promo {
  position: absolute;
  left: calc(var(--x) * 12.5%);
  top: calc(var(--y) * 12.5%);
  width: 12.5%;
  height: 50%;
  display: flex;
  flex-direction: column;
  z-index: 20;
  pointer-events: auto;
  background: var(--mint);
  border-radius: 0.16rem;
  box-shadow:
    0 0 0 0.05rem var(--teal2),
    0 0 0 0.08rem var(--mint2),
    0 0.08rem 0.2rem rgba(0, 40, 40, 0.55);
  overflow: hidden;
}
.pbtn {
  flex: 1;
  padding: 6%;
  min-height: 0;
}
.pbtn.best {
  background: linear-gradient(#ffe36a, #ffc21a);
}
.pbtn:active {
  filter: brightness(0.92);
}
.pbtn img {
  width: 100%;
  height: 100%;
}

/* panels */
.modal {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: calc(var(--sat) + 0.16rem) calc(var(--sar) + 0.16rem) calc(var(--sab) + 0.16rem) calc(var(--sal) + 0.16rem);
  opacity: 0;
  visibility: hidden;
  transition:
    opacity 0.18s,
    visibility 0s 0.18s;
}
.modal.on {
  opacity: 1;
  visibility: visible;
  transition: opacity 0.18s;
}
.modal .scrim {
  position: absolute;
  inset: 0;
  background: rgba(4, 50, 42, 0.5);
}
.modal[data-k='pop'] .scrim,
.modal[data-k='settings'] .scrim {
  background: transparent;
}
.sheet {
  position: relative;
  width: min(100%, 8.6rem);
  max-height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.14rem;
  padding: 0.34rem 0.34rem 0.4rem;
  transform: translateY(0.14rem) scale(0.97);
  transition: transform 0.2s cubic-bezier(0.2, 0.9, 0.3, 1.15);
}
.modal.on .sheet {
  transform: none;
}
body.reduced .sheet {
  transition: none;
  transform: none;
}
.sheet > .pill {
  width: 72%;
}
.sheet .stack {
  width: 100%;
}
.sheet.pop {
  position: absolute;
  right: calc(var(--sar) + 0.14rem);
  top: calc(var(--sat) + 1.72rem);
  width: min(calc(100% - 0.3rem), 6.2rem);
  padding: 0.2rem 0.28rem 0.28rem;
  gap: 0.08rem;
  align-items: stretch;
  background: linear-gradient(#149078, #0b6654);
  border-radius: 0.5rem;
  box-shadow:
    inset 0 0 0 0.05rem var(--mint),
    0 0.1rem 0.24rem rgba(0, 40, 40, 0.5);
}
.sheet.pop::before {
  content: '';
  position: absolute;
  right: 1.86rem;
  top: -0.2rem;
  border: 0.14rem solid transparent;
  border-top: 0;
  border-bottom: 0.22rem solid var(--mint);
}
.ttl {
  margin: 0;
  text-align: center;
  font-size: 0.5rem;
  font-weight: 700;
  text-shadow: 0 0.03rem 0 var(--ink);
}
.vol {
  display: grid;
  grid-template-columns: 1.7rem 1fr;
  align-items: center;
  gap: 0.12rem;
  min-height: 0.9rem;
}
.vol .fit {
  text-align: left;
  font-weight: 600;
  font-size: 0.36rem;
  text-shadow: 0 0.025rem 0 var(--ink);
}
.sl {
  position: relative;
  height: 0.62rem;
}
.sl .tr,
.sl .fl {
  position: absolute;
  left: 0;
  top: 0.14rem;
  height: 0.34rem;
}
.sl .tr {
  width: 100%;
}
.sl .fl {
  width: max(0.34rem, var(--p));
}
.sl .kn {
  position: absolute;
  top: 0.02rem;
  left: calc((100% - 0.58rem) * var(--f, 0));
  width: 0.58rem;
  height: 0.58rem;
  background: url(../assets/ui/sknob.webp) center/100% 100% no-repeat;
  pointer-events: none;
  filter: drop-shadow(0 0.02rem 0.03rem rgba(0, 30, 60, 0.5));
}
.sl input {
  position: absolute;
  inset: -0.14rem 0;
  width: 100%;
  height: calc(100% + 0.28rem);
  margin: 0;
  opacity: 0;
  cursor: pointer;
}
.sl input:focus-visible ~ .kn {
  outline: 0.04rem solid var(--gold);
  border-radius: 50%;
}
.sheet.settings {
  width: min(100%, 9.5rem);
  padding: 0.24rem 0.26rem 0.3rem;
  gap: 0.08rem;
}
.sheet.settings > .pill {
  height: 0.86rem;
  font-size: 0.46rem;
}
.cols {
  width: 100%;
  min-height: 0;
  display: flex;
  flex-direction: column;
  gap: 0.07rem;
  overflow-y: auto;
  scrollbar-width: none;
}
.cols::-webkit-scrollbar {
  display: none;
}
.col {
  display: flex;
  flex-direction: column;
  gap: 0.07rem;
  align-items: stretch;
}
.col > .pill {
  align-self: center;
  width: 4.2rem;
  height: 0.66rem;
  font-size: 0.36rem;
}
.row {
  position: relative;
  flex: none;
  min-height: 44px;
  height: 0.98rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.12rem;
  padding: 0 0.16rem 0 0.3rem;
  color: var(--ink);
  font-weight: 600;
  font-size: 0.42rem;
  cursor: pointer;
}
.row .fit {
  flex: 1;
  min-width: 0;
  text-align: left;
}
.row input {
  position: absolute;
  opacity: 0;
  width: 1px;
  height: 1px;
}
.sw {
  position: relative;
  flex: none;
  width: 0.98rem;
  height: 0.48rem;
  background: url(../assets/ui/sw-off.webp) center/100% 100% no-repeat;
}
input:checked + .sw {
  background-image: url(../assets/ui/sw-on.webp);
}
.sw::after {
  content: '';
  position: absolute;
  left: 0.05rem;
  top: 0.05rem;
  width: 0.38rem;
  height: 0.38rem;
  background: url(../assets/ui/knob.webp) center/100% 100% no-repeat;
  transition: transform 0.14s;
}
input:checked + .sw::after {
  transform: translateX(0.5rem);
}
body.reduced .sw::after {
  transition: none;
}
.langs {
  display: flex;
  flex-direction: column;
  gap: 0.06rem;
  padding: 0.14rem 0.2rem 0.2rem;
}
.langs > .fit {
  padding-left: 0.1rem;
}
.langs > .fit {
  text-align: left;
  font-weight: 600;
  font-size: 0.42rem;
  text-shadow: 0 0.025rem 0 var(--ink);
}
.chips {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.05rem;
}
.chips .chip {
  height: 0.72rem;
  min-height: 32px;
  padding: 0 0.14rem 0.02rem;
  font-size: 0.33rem;
}
.crest {
  position: relative;
  flex: none;
  margin-top: -1.3rem;
  width: 3.1rem;
  height: 2.24rem;
  display: flex;
  justify-content: center;
}
.crest > img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  filter: drop-shadow(0 0.05rem 0.05rem rgba(120, 60, 0, 0.45));
}
.crest .lau {
  position: absolute;
  top: 1.8rem;
  width: 0.72rem;
  height: 0.94rem;
}
.lau.l {
  left: -1.5rem;
}
.lau.r {
  right: -1.5rem;
}
.crest.two {
  margin-top: -0.58rem;
  width: 3rem;
  height: 1.2rem;
  gap: 0.06rem;
}
.crest.two img {
  width: 48%;
}
.crest.face {
  margin-top: -1.3rem;
  width: 2.5rem;
  height: 2.5rem;
}
.crest .cm {
  position: absolute;
  z-index: 2;
  top: -0.26rem;
  left: 50%;
  width: 0.9rem;
  height: 0.66rem;
  transform: translateX(-50%);
}
.av.big {
  width: 2.4rem;
  height: 2.4rem;
}
.res {
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.06rem;
  text-align: center;
}
.res h2.big {
  width: 100%;
  margin: 0;
  padding: 0.05rem 0.06rem 0.1rem;
  font-size: 1.16rem;
  font-weight: 700;
  line-height: 1.22;
  color: #fff;
  --oc: var(--navy);
  text-shadow:
    0.035rem 0 var(--oc),
    -0.035rem 0 var(--oc),
    0 0.035rem var(--oc),
    0 -0.035rem var(--oc),
    0.03rem 0.03rem var(--oc),
    -0.03rem 0.03rem var(--oc),
    0.03rem -0.03rem var(--oc),
    -0.03rem -0.03rem var(--oc),
    0 0.07rem 0 var(--oc);
}
.res.win h2.big {
  color: #ffd331;
  --oc: #8a3e00;
}
.res .kind {
  margin: 0;
  min-width: 4.2rem;
  max-width: 92%;
  height: 0.8rem;
  padding: 0 0.34rem 0.02rem;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.42rem;
  letter-spacing: 0.01em;
  text-transform: uppercase;
}
.res .why {
  margin: 0;
  font-size: 0.37rem;
  line-height: 1.15;
  color: #eafff6;
}
.sheet.result {
  padding-top: 0.5rem;
  gap: 0.12rem;
  margin-top: 0.8rem;
  overflow: visible;
}
.sheet.result .btn {
  height: 1.14rem;
  font-size: 0.54rem;
}
.cf {
  position: absolute;
  width: 0.16rem;
  height: 0.24rem;
  border-radius: 0.03rem;
  transform: rotate(var(--r));
  pointer-events: none;
}
.cf.o {
  background: var(--orange);
}
.cf.b {
  background: #2c63ee;
}
.cf.g {
  background: var(--gold);
}
@media (min-aspect-ratio: 11/10) {
  .sheet.settings {
    width: min(100%, 15.6rem);
    max-height: 100%;
  }
  .cols {
    flex-direction: row;
    gap: 0.2rem;
  }
  .col {
    flex: 1;
    min-width: 0;
  }
  .chips {
    grid-template-columns: repeat(5, 1fr);
  }
  .chips .chip {
    height: 0.56rem;
    padding: 0 0.08rem 0.02rem;
    font-size: 0.25rem;
  }
  .row {
    height: 0.78rem;
    font-size: 0.36rem;
  }
  .langs > .fit {
    font-size: 0.36rem;
  }
  .sheet {
    width: min(100%, 6.6rem);
  }
  .sheet.small {
    padding: 0.24rem 0.3rem 0.3rem;
    gap: 0.1rem;
  }
  .sheet.small .btn {
    height: 0.92rem;
    font-size: 0.44rem;
  }
  .sheet.result {
    width: min(100%, 8.4rem);
    margin-top: 0.9rem;
    padding: 0.3rem 0.34rem 0.34rem;
    gap: 0.08rem;
  }
  .sheet.result .stack.two {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.1rem;
  }
  .sheet.result .stack.two .btn:first-child:nth-last-child(odd) {
    grid-column: 1 / -1;
  }
  .sheet.result .btn {
    height: 0.9rem;
    font-size: 0.44rem;
  }
  .crest {
    margin-top: -1.02rem;
    width: 1.9rem;
    height: 1.36rem;
  }
  .crest.face {
    margin-top: -1.14rem;
    width: 1.9rem;
    height: 1.9rem;
  }
  .av.big {
    width: 1.84rem;
    height: 1.84rem;
  }
  .res h2.big {
    font-size: 0.86rem;
  }
  .res .kind {
    height: 0.66rem;
    font-size: 0.34rem;
  }
  .res .why {
    font-size: 0.32rem;
  }
  .sheet.pop {
    width: 6.4rem;
  }
}
/* End of src/styles.css (complete file). */
