* {
  box-sizing: border-box;
}
html {
  background: #123e34;
  -webkit-tap-highlight-color: transparent;
  -webkit-text-size-adjust: 100%;
  overscroll-behavior: none;
}
body {
  margin: 0;
  height: 100dvh;
  display: grid;
  place-items: center;
  font-family: ui-rounded, "PingFang SC", "Microsoft Yahei", sans-serif;
  color: #fff4d9;
  overflow: hidden;
  padding: env(safe-area-inset-top) env(safe-area-inset-right)
    env(safe-area-inset-bottom) env(safe-area-inset-left);
}
#game {
  height: min(100%, 177.777vw);
  width: min(100vw, 56.25dvh);
  aspect-ratio: 9/16;
  position: relative;
  overflow: hidden;
  background: #307d49;
  box-shadow: 0 0 100px #061e20;
}
canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  touch-action: none;
}
#ui {
  position: absolute;
  inset: 0;
  pointer-events: none;
  container-type: inline-size;
}
button {
  font: inherit;
  font-weight: 800;
  color: #173b34;
  background: #ffe2a0;
  border: 2px solid #fff3c7;
  border-radius: 14px;
  box-shadow: 0 5px 0 #b48238;
  padding: 10px 16px;
  cursor: pointer;
  touch-action: manipulation;
  user-select: none;
  -webkit-user-select: none;
  -webkit-touch-callout: none;
  pointer-events: auto;
  transition: transform 100ms ease-out;
}
button:active {
  transform: translateY(3px);
  box-shadow: 0 2px 0 #b48238;
}
button:disabled {
  opacity: 0.6;
  cursor: default;
}
button:focus-visible {
  outline: 3px solid white;
  outline-offset: 4px;
}
.screen {
  position: absolute;
  inset: 0;
  font-size: 3.5cqw;
}
.top {
  position: absolute;
  left: 5%;
  right: 5%;
  top: 4%;
  display: flex;
  align-items: center;
  gap: 10px;
}
.back,
.mute {
  width: 44px;
  min-height: 44px;
  padding: 6px;
  border-radius: 50%;
  font-size: 22px;
}
.mute {
  margin-left: auto;
}
.money {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  font-weight: 800;
}
.chip {
  background: #143c32b8;
  border: 1px solid #96bd7c55;
  padding: 8px 12px;
  border-radius: 20px;
}
.title {
  position: absolute;
  top: 20%;
  width: 100%;
  text-align: center;
  margin: 0;
  font-size: 10cqw;
  font-weight: 1000;
  letter-spacing: 0.07em;
  color: #fff4cb;
  text-shadow:
    0 4px #154733,
    0 7px 0 #123d36;
}
.eyebrow {
  display: block;
  font-size: 3cqw;
  letter-spacing: 0.2em;
  color: #c9e5a0;
  margin-top: 8px;
}
.rank {
  position: absolute;
  top: 9%;
  left: 5%;
  width: 52%;
  font-size: 3.2cqw;
  text-align: left;
  color: #fff4d9;
  background: #194635bd;
  border-color: #83ac75;
  box-shadow: 0 4px #11392d;
  border-radius: 16px;
  padding: 12px;
}
.rank progress {
  width: 100%;
  height: 8px;
  accent-color: #f8d675;
}
.hero {
  position: absolute;
  left: 17%;
  top: 31%;
  width: 66%;
  aspect-ratio: 1;
  background-size: 400% 400%;
  background-repeat: no-repeat;
  filter: drop-shadow(0 15px 12px #082d3570);
  pointer-events: none;
}
.hero.small {
  width: 40%;
  left: 30%;
  top: 27%;
}
.nameplate {
  position: absolute;
  top: 69%;
  width: 100%;
  text-align: center;
  font-size: 6cqw;
  font-weight: 900;
}
.sides {
  position: absolute;
  left: 5%;
  right: 5%;
  top: 33%;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  pointer-events: none;
}
.sidecol {
  display: flex;
  flex-direction: column;
  gap: 20px;
}
.sidecol button {
  font-size: 3.2cqw;
  width: 66px;
  height: 66px;
  padding: 4px;
  border-radius: 18px;
  line-height: 1.5;
}
.bottom {
  position: absolute;
  left: 8%;
  right: 8%;
  bottom: 10%;
  display: flex;
  gap: 14px;
  justify-content: center;
}
.primary {
  background: #ffc96b;
  font-size: 5.5cqw;
  min-height: 58px;
  flex: 1;
}
.secondary {
  background: #bfe6d6;
  border-color: #e3fff3;
  box-shadow: 0 5px #568e77;
}
.sync {
  position: absolute;
  bottom: 2%;
  width: 100%;
  text-align: center;
  font-size: 2.7cqw;
  pointer-events: auto;
  color: #cee5ca;
  background: none;
  border: 0;
  box-shadow: none;
  padding: 8px;
}
.cards {
  position: absolute;
  left: 6%;
  right: 6%;
  top: 33%;
  display: flex;
  gap: 6%;
  height: 36%;
  pointer-events: auto;
}
.modecard {
  width: 47%;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  align-items: center;
  background: #286951;
  box-shadow: 0 6px #143b30;
  border: 3px solid #55896a;
  color: #fff4d9;
  padding: 12px;
  font-size: 4cqw;
}
.modecard.selected {
  border-color: #ffe6a0;
  background: #468556;
}
.mini-court {
  width: 90%;
  height: 70%;
  border: 3px solid #d0e2ac;
  background: repeating-linear-gradient(0deg, #6eac64 0 25%, #5b9b5a 25% 50%);
  position: relative;
  margin-bottom: 16px;
}
.mini-court:after {
  content: "";
  position: absolute;
  top: 50%;
  left: 0;
  right: 0;
  border-top: 2px dashed #eff0c8;
}
.mini-sprite {
  position: absolute;
  width: 70%;
  aspect-ratio: 1;
  background-size: 400%;
  left: 15%;
  top: 10%;
}
.mini-sprite.second {
  top: 48%;
}
.detail {
  font-size: 2.8cqw;
  font-weight: 500;
  line-height: 1.7;
  color: #d9efce;
}
.hud {
  position: absolute;
  left: 26%;
  right: 8%;
  top: 4%;
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: #143b328c;
  padding: 8px 14px;
  border-radius: 25px;
  font-weight: 900;
}
.hud strong {
  font-size: 5cqw;
}
.hint {
  position: absolute;
  left: 12%;
  right: 12%;
  bottom: 47%;
  text-align: center;
  background: #163e35cf;
  border: 1px solid #c0daa17a;
  border-radius: 15px;
  padding: 12px;
  pointer-events: none;
  font-size: 3.3cqw;
}
.charge {
  color: #fff5a5;
}
.overlay {
  position: absolute;
  inset: 0;
  background: #092b2be8;
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: auto;
  padding: 7%;
  font-size: 3.5cqw;
}
.panel {
  width: 100%;
  max-height: 90%;
  overflow: auto;
  background: #f7edce;
  color: #1d493b;
  padding: 24px;
  border-radius: 26px;
  border: 4px solid #94be8c;
  box-shadow: 0 12px 0 #061f1b;
}
.panel h2 {
  margin: 0 0 18px;
  font-size: 6cqw;
  text-align: center;
}
.panel p {
  line-height: 1.7;
}
.panel .row {
  display: flex;
  gap: 10px;
  margin: 12px 0;
}
.panel .row button {
  flex: 1;
}
.scroll {
  max-height: 50vh;
  overflow-y: auto;
  overscroll-behavior: contain;
}
.item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  border-bottom: 1px solid #d2caa6;
  padding: 10px 0;
}
.item button {
  font-size: 3cqw;
  padding: 8px;
}
.tabs {
  display: flex;
  gap: 10px;
  margin-bottom: 15px;
}
.tabs button {
  flex: 1;
}
.skinbar {
  position: absolute;
  top: 68%;
  left: 5%;
  right: 5%;
  display: flex;
  overflow-x: auto;
  gap: 10px;
  padding: 6px 4px 12px;
  pointer-events: auto;
  overscroll-behavior: contain;
  scroll-snap-type: x mandatory;
}
.skinbar button {
  flex: 0 0 64px;
  height: 68px;
  padding: 2px;
  border: 2px solid #9bbe87;
  background: #205542;
  box-shadow: 0 3px #112d27;
  scroll-snap-align: start;
}
.skinbar button.selected {
  border-color: #ffe798;
  background: #758e48;
}
.portrait {
  display: block;
  width: 100%;
  height: 100%;
  background-size: 400%;
  background-repeat: no-repeat;
}
.stats {
  position: absolute;
  top: 58%;
  left: 12%;
  right: 12%;
  text-align: center;
  font-size: 4cqw;
  line-height: 1.8;
}
.reward {
  position: absolute;
  left: 14%;
  right: 14%;
  top: 61%;
  padding: 18px;
  text-align: center;
  background: #164932b8;
  border-radius: 18px;
  line-height: 1.8;
  font-size: 4cqw;
}
.vs {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  font-size: 14cqw;
  font-weight: 1000;
  text-shadow: 0 6px #164b3c;
}
.matchname {
  position: absolute;
  left: 0;
  right: 0;
  text-align: center;
  font-size: 5cqw;
  font-weight: 900;
}
#toast {
  position: absolute;
  bottom: 20%;
  left: 10%;
  right: 10%;
  text-align: center;
  background: #0b302de8;
  border-radius: 20px;
  padding: 14px;
  font-size: 14px;
  pointer-events: none;
  opacity: 0;
}
#toast.show {
  opacity: 1;
}
#failure {
  position: absolute;
  inset: 0;
  background: #143e33;
  place-content: center;
  padding: 30px;
  text-align: center;
}
#failure:not([hidden]) {
  display: grid;
}
#failure h1 {
  font-size: 24px;
}
@media (hover: hover) and (pointer: fine) {
  button:hover:not(:disabled) {
    filter: brightness(1.08);
  }
}
@media (prefers-reduced-motion: reduce) {
  button {
    transition: none;
  }
}
