@keyframes victoryCharStageMove {
  0% {
    transform: translate3d(0, 0, 0);
  }
  to {
    transform: translate3d(-30%, 0, 0);
  }
}
@keyframes victoryCharOverlapMaskOn {
  0% {
    -webkit-mask-image: none;
    mask-image: none;
  }
  to {
    -webkit-mask-image: linear-gradient(
      to right,
      #000 0,
      #000 54%,
      rgba(0, 0, 0, 0.6) 64%,
      rgba(0, 0, 0, 0.18) 72%,
      transparent 79%
    );
    mask-image: linear-gradient(
      to right,
      #000 0,
      #000 54%,
      rgba(0, 0, 0, 0.6) 64%,
      rgba(0, 0, 0, 0.18) 72%,
      transparent 79%
    );
  }
}
@keyframes victoryCharShake {
  0%,
  18%,
  84%,
  to {
    transform: translate3d(0, 0, 0);
  }
  24% {
    transform: translate3d(-10px, -8px, 0);
  }
  30% {
    transform: translate3d(11px, 7px, 0);
  }
  36% {
    transform: translate3d(-9px, 6px, 0);
  }
  42% {
    transform: translate3d(9px, -7px, 0);
  }
  48% {
    transform: translate3d(-7px, -5px, 0);
  }
  54% {
    transform: translate3d(7px, 5px, 0);
  }
  60% {
    transform: translate3d(-6px, 4px, 0);
  }
  66% {
    transform: translate3d(6px, -4px, 0);
  }
  72% {
    transform: translate3d(-4px, -3px, 0);
  }
  78% {
    transform: translate3d(4px, 3px, 0);
  }
}
@keyframes victoryCharNormalSwap {
  0% {
    opacity: 1;
  }
  to {
    opacity: 0;
  }
}
@keyframes victoryCharUpReveal {
  0% {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}
@keyframes victoryCharFadeIn {
  0% {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}
@keyframes victoryCharFlashBurst {
  0%,
  56%,
  72%,
  to {
    opacity: 0;
  }
  60% {
    opacity: 0.25;
  }
  64% {
    opacity: 1;
  }
}
@keyframes victoryScreenFlashBurst {
  0%,
  to {
    opacity: 0;
  }
  12%,
  88% {
    opacity: 0.98;
  }
}
@keyframes victoryResultReveal {
  0% {
    opacity: 0;
    transform: translate3d(20%, 0, 0);
  }
  to {
    opacity: 1;
    transform: translate3d(0, 0, 0);
  }
}
#game-wrapper,
#gameCanvas {
  position: relative;
  width: 100%;
  height: 1260px;
}
#gameCanvas {
  display: block;
  position: absolute;
  top: 0;
  left: 0;
  width: 750px;
  background-image: url(../images/battle/bg.webp);
  background-size: 100% calc(100% + 20px);
  background-position: center -20px;
  background-repeat: no-repeat;
}
.ui-layer {
  width: 100%;
  padding: 6px 8px;
  box-sizing: border-box;
  display: flex;
  justify-content: space-between;
  align-items: center;
  text-shadow: 1px 1px 2px #000;
  z-index: 10;
}
#ui-top {
  top: -28px;
  height: 173px;
}
.top-left-deco,
.ui-bg,
.ui-layer {
  position: absolute;
  left: 0;
  pointer-events: none;
}
.ui-bg {
  top: 0;
  width: 100%;
  height: 100%;
  z-index: 1;
  object-fit: fill;
}
.top-left-deco {
  top: 28px;
  height: 260px;
  width: auto;
  z-index: 2;
}
#pause-timer-group,
.card-container {
  position: absolute;
  top: 50%;
  z-index: 5;
  display: flex;
  align-items: center;
}
#pause-timer-group {
  left: 15px;
  transform: translateY(-50%);
}
#btn-pause {
  position: relative;
  z-index: 2;
  background: 0 0;
  border: 0;
  padding: 0;
  pointer-events: auto;
  cursor: pointer;
  min-height: unset;
  -webkit-tap-highlight-color: transparent;
}
#btn-pause img {
  width: 81px;
  height: 81px;
  display: block;
}
#ui-bottom {
  bottom: -28px;
  height: 229px;
}
#ui-bottom .ui-bg {
  top: 28px;
  object-fit: fill;
}
#battle-cr {
  position: absolute;
  bottom: 40px;
  left: 0;
  width: 100%;
  z-index: 10;
  pointer-events: none;
}
.card-container {
  left: 50%;
  transform: translate(-50%, -50%) scale(1.5);
  gap: 8px;
}
#cards-cpu {
  left: calc(50% + 4px);
  top: calc(50% - 2px);
}
#cards-player {
  position: absolute;
  left: 50%;
  top: 105px;
  transform: translate(-50%, -50%) scale(1.9);
}
#cards-player .card:first-child {
  transform: translateX(-3px);
}
#cards-player .card:last-child {
  transform: translateX(3px);
}
.card {
  position: relative;
  width: 64px;
  height: 64px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  overflow: visible;
}
.card-frame-base,
.card-portrait {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 3;
}
.card-portrait {
  top: 12.4%;
  left: 12.4%;
  width: 75.2%;
  height: 75.2%;
  z-index: 1;
  object-fit: cover;
}
.card-frame-color {
  position: absolute;
  top: 3%;
  left: 3%;
  width: 94%;
  height: 94%;
  z-index: 2;
}
.lvl-wrap {
  position: absolute;
  bottom: -15px;
  left: 50%;
  transform: translateX(-50%);
  width: 32px;
  height: 33px;
  z-index: 4;
  display: flex;
  justify-content: center;
  align-items: center;
}
.lvl-bg {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 1;
}
#timer-display-text,
.lvl {
  color: #fff;
  font-weight: 700;
  line-height: 1;
}
.lvl {
  position: relative;
  z-index: 2;
  font-size: 10px;
  text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.5);
  margin-top: 0;
}
.exp-bar {
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 0%;
  transition: height 0.2s;
  z-index: 2;
  display: none !important;
}
.card.red .exp-bar {
  background-color: rgba(231, 76, 60, 0.5);
}
.card.blue .exp-bar {
  background-color: rgba(52, 152, 219, 0.5);
}
.card.green .exp-bar {
  background-color: rgba(46, 204, 113, 0.5);
}
.card.max .lvl {
  color: #f1c40f;
}
.card.max .exp-bar {
  height: 100% !important;
  background-color: rgba(255, 215, 0, 0.3);
}
.auto-switch input,
.stats {
  display: none;
}
.auto-switch {
  display: inline-block;
  cursor: pointer;
  pointer-events: auto;
  position: absolute;
  right: -10px;
  top: 50%;
  transform: translateY(calc(-50% + 5px));
  z-index: 20;
}
.auto-switch .auto-btn-img {
  height: 70px;
  width: auto;
  transition: opacity 0.2s;
}
.timer-container {
  position: relative;
  margin-left: -44px;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
}
.timer-frame {
  height: 59px;
  width: auto;
  display: block;
}
#timer-display-text {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  font-size: 22px;
  letter-spacing: 0;
  -webkit-text-stroke: 2px #000;
  text-shadow: 0 0 4px #000;
  font-family: inherit;
  margin-left: 25px;
}
#pause-screen.hidden,
#timer-display {
  display: none;
}
#game-over-screen {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.9);
  display: none;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  z-index: 100;
  pointer-events: auto;
}
#game-over-text {
  font-size: 40px;
  color: #f1c40f;
  margin-bottom: 16px;
  text-align: center;
}
#pause-screen,
.pause-content {
  display: flex;
  flex-direction: column;
  align-items: center;
}
#pause-screen {
  background: rgba(0, 0, 0, 0.67);
  justify-content: center;
  z-index: 100;
  pointer-events: auto;
}
.pause-content {
  position: relative;
  width: 600px;
  height: 417px;
  top: -52px;
  transform: scale(0.9);
}
#pause-screen,
.pause-bg {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
}
.pause-bg {
  z-index: 1;
  pointer-events: none;
}
.pause-hint,
.pause-title {
  position: relative;
  z-index: 2;
  width: 450px;
  height: auto;
  margin-top: -40px;
}
.pause-hint {
  width: 280px;
  margin-top: -5px;
}
#btn-resume {
  position: absolute;
  z-index: 2;
  bottom: 50px;
  background: 0 0;
  border: 0;
  padding: 0;
  cursor: pointer;
  min-height: unset;
}
#btn-resume img {
  width: 220px;
  height: auto;
  display: block;
}
.hp-bar-container {
  z-index: 4;
  pointer-events: none;
}
#hp-bar-cpu {
  top: 127px;
}
#hp-bar-player {
  bottom: 160px;
}
.hp-bar-container,
.hp-bg-line,
.hp-bg-main {
  position: absolute;
  left: 0;
  width: 100%;
}
#hp-bar-cpu .hp-bg-line {
  top: 22px;
  height: 12px;
  z-index: 2;
}
#hp-bar-cpu .hp-bg-main {
  top: 1px;
  height: 36px;
  z-index: 1;
}
#hp-bar-cpu .hp-segments {
  position: absolute;
  top: 1px;
  left: 0;
  width: 100%;
  height: 31px;
  z-index: 3;
  display: flex;
  justify-content: center;
  align-items: center;
}
#hp-bar-player .hp-bg-line {
  bottom: 23px;
  height: 12px;
  z-index: 2;
}
#hp-bar-player .hp-bg-main {
  bottom: 1px;
  height: 36px;
  z-index: 1;
}
#hp-bar-player .hp-segments {
  position: absolute;
  bottom: 1px;
  left: 0;
  width: 100%;
  height: 31px;
  z-index: 3;
  display: flex;
  justify-content: center;
  align-items: center;
}
.hp-segment {
  width: 11.55%;
  height: 85%;
  background-size: 100% 100%;
  background-position: center;
  background-repeat: no-repeat;
  transition: opacity 0.2s ease-out;
  transform: scaleX(1.09);
}
.cpu-seg {
  background-image: url(../images/battle/xuetiao_hong.webp);
}
.player-seg {
  background-image: url(../images/battle/xuetiao_lan.webp);
  transform: scaleX(1.23);
}
.hp-segment.hidden {
  opacity: 0;
}
#deco-top-right,
.items-box {
  position: absolute;
  pointer-events: none;
}
#deco-top-right {
  top: 28px;
  right: 0;
  height: 270px;
  width: auto;
  z-index: 7;
  transform: scale(0.63);
  transform-origin: top right;
}
.items-box {
  z-index: 6;
}
#box-items-cpu {
  top: 28px;
  right: 0;
  width: 210px;
  height: 184px;
}
.items-bg,
.items-box .item-slot .item-bg {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
}
.items-bg {
  object-fit: fill;
}
.items-grid {
  position: relative;
  width: 100%;
  height: 100%;
}
.items-box .item-slot {
  position: absolute;
  width: 41px;
  height: 41px;
}
.cpu-items-slots .item-slot {
  transform: scale(1.2);
}
.player-items-slots .item-slot {
  transform: scale(1.5);
}
.items-box .item-slot .item-bg {
  z-index: 1;
}
.items-box .item-slot .item-icon {
  position: absolute;
  top: 10%;
  left: 10%;
  width: 80%;
  height: 80%;
  z-index: 2;
  object-fit: contain;
}
.cpu-items-slots .item-slot .item-icon {
  transform: scale(1.1);
}
.cpu-items-slots .item-slot .item-bg {
  transform: scale(0.7);
}
.player-items-slots .item-slot .item-icon {
  transform: scale(1.3);
}
.player-items-slots .item-slot .item-bg {
  transform: scale(0.9);
}
#deco-bottom-base,
#deco-ui-bottom-top {
  position: absolute;
  top: 10px;
  left: 0;
  width: 100%;
  height: auto;
  z-index: 5;
  pointer-events: none;
}
#deco-bottom-base {
  top: -13px;
  z-index: 7;
}
#box-items-player {
  top: -60px;
  left: 15px;
  width: 161px;
  height: 443px;
  transform: scale(0.7);
  transform-origin: center left;
}
#box-items-player .items-bg {
  top: 72px;
  left: 20px;
  transform: scale(1.48);
}
.player-items-slots .item-slot:nth-child(1) {
  bottom: 283px;
  left: 2px;
}
.player-items-slots .item-slot:nth-child(2) {
  bottom: 269px;
  left: 60px;
}
.player-items-slots .item-slot:nth-child(3) {
  bottom: 250px;
  left: 118px;
}
.cpu-items-slots .item-slot:nth-child(1) {
  top: 35px;
  right: 131px;
}
.cpu-items-slots .item-slot:nth-child(2) {
  top: 47px;
  right: 85px;
}
.cpu-items-slots .item-slot:nth-child(3) {
  top: 59px;
  right: 35px;
}
#defeat-screen,
#defeat-time-text {
  display: flex;
  justify-content: center;
  align-items: center;
}
#defeat-screen {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.67);
  z-index: 100;
  pointer-events: auto;
  touch-action: manipulation;
}
#defeat-screen.hidden {
  display: none;
}
#defeat-screen .defeat-bg,
#victory-screen .defeat-bg {
  position: absolute;
  left: 0;
  width: 100%;
  height: auto;
  z-index: 1;
  pointer-events: none;
  transform: scaleY(1.07);
  transform-origin: top center;
}
#victory-screen .defeat-bg {
  top: 407px;
}
#defeat-screen .defeat-char,
#victory-screen .defeat-char {
  position: absolute;
  top: 0;
  left: -25%;
  width: 100%;
  height: calc(100% + 70px);
  object-fit: cover;
  object-position: center calc(50% + 35px);
  z-index: 2;
  pointer-events: none;
}
#victory-screen .victory-char-stage {
  position: absolute;
  inset: 0;
  z-index: 2;
  pointer-events: none;
  overflow: hidden;
}
#victory-screen .victory-screen-flash {
  position: absolute;
  inset: 0;
  z-index: 4;
  pointer-events: none;
  background: #fff;
  opacity: 0;
}
#victory-screen .victory-char-inner {
  position: absolute;
  top: -24%;
  left: -24%;
  width: 150%;
  height: calc(150% + 70px);
  transform-origin: center center;
}
#victory-screen .victory-char-layer {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
  object-position: center bottom;
  pointer-events: none;
  background: 0 0;
}
#victory-screen .victory-char-up {
  opacity: 0;
}
#victory-screen .victory-char-flash {
  display: none;
}
#defeat-screen .defeat-right-panel,
#victory-screen .defeat-right-panel {
  position: absolute;
  top: 0;
  right: 0;
  width: 50%;
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding-top: 410px;
  z-index: 3;
}
#victory-screen .defeat-right-panel {
  background: 0 0;
}
#victory-screen .victory-panel-blur {
  display: none;
}
#defeat-screen .defeat-title,
#victory-screen .defeat-title {
  width: 240px;
  height: auto;
  margin-bottom: 0;
  transform: translate(-26px, -28px);
}
#defeat-screen .defeat-time-group,
#victory-screen .defeat-time-group,
.victory-code-group {
  display: flex;
  flex-direction: column;
  align-items: center;
  margin-bottom: 40px;
}
#defeat-screen .defeat-time-title,
#victory-screen .defeat-time-title {
  width: 180px;
  height: auto;
  margin-bottom: 10px;
  transform: translate(-29px, -25px) scale(1.05);
}
#defeat-time-text {
  font-size: 28px;
  color: #fff;
  line-height: 1;
  text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.5);
  transform: translate(-30px, -38px);
  background-image: url(../images/battle/frame_time.webp);
  background-size: contain;
  background-position: center;
  background-repeat: no-repeat;
  width: 300px;
  height: 75px;
}
#defeat-screen .defeat-hint {
  width: 240px;
  height: auto;
  margin-bottom: 40px;
  transform: translate(-35px, -60px) scale(0.93);
}
#defeat-screen button,
#victory-screen button {
  background: 0 0;
  border: 0;
  padding: 0;
  margin-bottom: 20px;
  cursor: pointer;
}
#defeat-screen button img,
#victory-screen button img {
  width: 260px;
  height: auto;
  display: block;
}
#defeat-screen .defeat-bg {
  top: 404px;
  transform: none;
}
#defeat-screen .defeat-title {
  transform: translate(-26px, -24px) scale(1.06);
}
#btn-defeat-retry {
  transform: translate(-30px, -67px);
}
#btn-defeat-home {
  transform: translate(-30px, -62px);
}
#victory-screen,
#victory-time-text {
  display: flex;
  justify-content: center;
  align-items: center;
}
#victory-screen {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.67);
  z-index: 100;
  pointer-events: auto;
  touch-action: manipulation;
}
#victory-screen.hidden {
  display: none;
}
#victory-screen .defeat-bg,
#victory-screen .defeat-right-panel {
  opacity: 0;
}
#victory-time-text {
  font-size: 28px;
  color: #fff;
  line-height: 1;
  text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.5);
  transform: translate(-25px, -40px);
  background-image: url(../images/battle/frame_time.webp);
  background-size: contain;
  background-position: center;
  background-repeat: no-repeat;
  width: 300px;
  height: 75px;
}
.victory-code-group {
  margin-top: -10px;
  margin-bottom: 30px;
}
.victory-code-title {
  width: 116px;
  height: auto;
  margin-bottom: 18px;
  transform: translate(-24px, -61px) scale(0.97);
  transform-origin: left center;
}
.victory-code-row {
  display: flex;
  align-items: center;
  gap: 6px;
  background-image: url(../images/battle/frame_time.webp);
  background-size: contain;
  background-position: center;
  background-repeat: no-repeat;
  width: 300px;
  height: 75px;
  justify-content: center;
  transform: translate(-30px, -80px);
}
.victory-code-row input {
  width: 140px;
  padding: 0;
  font-size: 30px;
  border: 0;
  background: 0 0;
  color: #fff;
  text-align: center;
  pointer-events: auto;
  transform: translateX(20px);
}
#btn-victory-copy {
  min-height: unset !important;
  margin-bottom: 0 !important;
  transform: translateX(50px);
}
#btn-victory-copy img {
  width: 34px !important;
  height: auto;
}
#btn-victory-retry {
  transform: translate(-28px, -83px);
}
#btn-victory-home {
  transform: translate(-30px, -73px);
}
#btn-victory-share {
  transform: translate(-27px, -43px) scale(1.15);
}
#btn-victory-share img {
  width: 130px !important;
  height: auto;
}
#defeat-screen.overlay-intro-playing .defeat-char,
#pause-screen.overlay-intro-playing .pause-content,
#screen-game.screen-intro-playing #ui-top {
  animation: slideInFromLeftSoft var(--screen-intro-duration) linear both;
}
#defeat-screen.overlay-intro-playing .defeat-right-panel,
#screen-game.screen-intro-playing #ui-bottom {
  animation: slideInFromRightSoft var(--screen-intro-duration) linear both;
}
#defeat-screen.overlay-intro-playing,
#pause-screen.overlay-intro-playing {
  animation: fadeInOverlaySoft 0.2s ease-out both;
}
#victory-screen.overlay-intro-playing .defeat-char {
  animation: centerPopBurstToLeft 0.8s ease-out both;
}
#victory-screen.overlay-intro-playing {
  animation: overlayFadeIn 0.8s ease-out both;
}
#victory-screen.overlay-intro-playing .victory-char-stage {
  animation:
    victoryCharStageMove 0.7s ease-out 3.1s both,
    victoryCharOverlapMaskOn 0.01s linear 3.1s both;
}
#victory-screen.overlay-intro-playing .victory-char-inner {
  animation:
    victoryCharFadeIn 1s ease-out 0s both,
    victoryCharShake 1.15s ease-out 1s both;
}
#victory-screen.overlay-intro-playing .victory-char-normal {
  animation: victoryCharNormalSwap 0.01s linear 2.26s both;
}
#victory-screen.overlay-intro-playing .victory-char-up {
  animation: victoryCharUpReveal 0.01s linear 2.26s both;
}
#victory-screen.overlay-intro-playing .victory-char-flash {
  animation: victoryCharFlashBurst 1.2s ease-out both;
}
#victory-screen.overlay-intro-playing .victory-screen-flash {
  animation: victoryScreenFlashBurst 0.3s ease-out 2.15s both;
}
#victory-screen.overlay-intro-playing .defeat-bg {
  animation: victoryResultReveal 0.32s ease-out 3.25s both;
}
#victory-screen.overlay-intro-playing .defeat-right-panel {
  animation: victoryResultReveal 0.32s ease-out 3.31s both;
}
