:root {
  --bg: #111313;
  --panel: #1a1b1b;
  --panel-2: #222323;
  --line: rgba(95, 255, 184, 0.2);
  --line-soft: rgba(255, 255, 255, 0.08);
  --green: #49e59f;
  --green-2: #2aa977;
  --red: #f03f67;
  --red-2: #a71942;
  --gold: #f0b223;
  --muted: #8c8f94;
  --cream: #dcd5c7;
  --cream-2: #bfb8aa;
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  /* Shared bottom-nav button dimensions for rank and fullscreen book screens. */
  --ui-bottom-nav-button-height: 52px;
  --ui-bottom-nav-button-radius: 17px;
  --ui-bottom-nav-button-font: 20px;
  --ui-bottom-nav-button-height-compact: 46px;
  --ui-bottom-nav-button-radius-compact: 14px;
  --ui-bottom-nav-button-font-compact: 18px;
  --ui-bottom-nav-return-column: minmax(0, 0.6fr);
  --ui-bottom-nav-main-column: minmax(0, 1fr);
  font-family:
    Inter, "Noto Sans SC", "Microsoft YaHei", system-ui, -apple-system,
    BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
}

html,
body {
  margin: 0;
  width: 100%;
  min-height: 100%;
  overflow: hidden;
  background: #060707;
  color: #eef7f0;
  user-select: none;
  -webkit-user-select: none;
}

input,
textarea {
  user-select: text;
  -webkit-user-select: text;
}

button {
  border: 0;
  padding: 0;
  color: inherit;
  font: inherit;
  cursor: pointer;
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.48;
  filter: grayscale(0.8);
}

#app {
  min-height: 100svh;
  width: 100vw;
  display: grid;
  place-items: center;
  overflow: hidden;
}

.game-shell {
  position: relative;
  width: 100%;
  max-width: 500px;
  height: 100svh;
  max-height: 1000px;
  overflow: hidden;
  isolation: isolate;
  background:
    radial-gradient(circle at 50% -10%, rgba(69, 238, 166, 0.1), transparent 32%),
    linear-gradient(180deg, #1b1c1c 0%, #111313 55%, #0c1010 100%);
  border: 0;
  border-radius: 0;
  box-shadow: 0 30px 90px rgba(0, 0, 0, 0.55);
}

.game-shell::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -2;
  background:
    repeating-linear-gradient(
      0deg,
      rgba(255, 255, 255, 0.025) 0,
      rgba(255, 255, 255, 0.025) 1px,
      transparent 1px,
      transparent 4px
    ),
    linear-gradient(90deg, rgba(255, 255, 255, 0.025), transparent 20%, transparent 80%, rgba(255, 255, 255, 0.025));
}

.game-shell::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  border-radius: inherit;
  box-shadow:
    inset 0 -140px 160px rgba(0, 0, 0, 0.26);
}

.start-shell {
  display: grid;
  place-items: center;
  padding: calc(36px + var(--safe-top)) 50px calc(36px + var(--safe-bottom));
}

.loading-shell {
  display: grid;
  place-items: center;
  padding: calc(32px + var(--safe-top)) 32px calc(32px + var(--safe-bottom));
  background: #f7e7ae var(--asset-bg-main, url("./assets/tex_bg_main.jpg")) center / cover no-repeat;
}

.loading-card {
  width: min(78%, 280px);
  display: grid;
  justify-items: center;
  gap: 12px;
  padding: 22px 20px;
  border: 2px solid rgba(126, 83, 35, 0.26);
  border-radius: 18px;
  background: rgba(255, 250, 226, 0.84);
  color: #704320;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.72),
    0 12px 28px rgba(101, 59, 19, 0.18);
}

.loading-mark {
  width: 58px;
  height: 58px;
  border-radius: 50%;
  background:
    radial-gradient(circle at 34% 28%, rgba(255, 255, 255, 0.74), transparent 34%),
    linear-gradient(180deg, #fff0a4, #efb953);
  box-shadow:
    inset 0 2px 0 rgba(255, 255, 255, 0.68),
    0 8px 18px rgba(163, 105, 32, 0.2);
}

.loading-card b {
  font-size: 20px;
  font-weight: 1000;
  line-height: 1;
}

.loading-bar {
  width: 100%;
  height: 14px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(130, 88, 40, 0.18);
  box-shadow:
    inset 0 1px 2px rgba(104, 69, 28, 0.2),
    inset 0 -1px 0 rgba(255, 255, 255, 0.7);
}

.loading-bar i {
  display: block;
  width: var(--loading, 0%);
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #f7d86f, #ef9f53);
  transition: width 120ms ease;
}

.loading-card span {
  color: rgba(107, 74, 34, 0.68);
  font-size: 13px;
  font-weight: 1000;
}

.start-card {
  width: 100%;
  display: grid;
  justify-items: center;
  gap: 24px;
}

.player-summary {
  position: absolute;
  left: 7.8%;
  top: calc(4.7% + var(--safe-top));
  z-index: 6;
  width: min(33%, 165px);
  aspect-ratio: 329 / 149;
  min-height: 0;
  display: grid;
  grid-template-columns: 33% minmax(0, 1fr);
  align-items: center;
  gap: 4px;
  padding: 8px 13px 9px 8px;
  border: 0;
  border-radius: 0;
  background: var(--asset-profile-bg, url("./assets/start@namebg.png")) center / contain no-repeat;
  box-shadow: none;
}

.player-summary > span {
  width: 100%;
  aspect-ratio: 1;
  display: grid;
  place-items: center;
  overflow: hidden;
  border-radius: 50%;
  background: transparent;
  font-size: 0;
}

.player-summary > span img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.player-summary b {
  min-width: 0;
  overflow: hidden;
  color: #7a4b2e;
  font-size: clamp(10px, 2.65vw, 14px);
  font-weight: 1000;
  text-align: left;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.player-summary div {
  min-width: 0;
  display: grid;
  gap: 2px;
}

.player-summary i {
  min-width: 0;
  overflow: hidden;
  color: #7a4b2e;
  font-style: normal;
  font-size: clamp(9px, 2.4vw, 13px);
  font-weight: 900;
  text-align: left;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.player-summary .summary-rank {
  display: inline-grid;
  grid-template-columns: auto minmax(0, auto);
  align-items: center;
  justify-content: start;
  gap: 3px;
}

.player-summary .summary-rank img {
  width: clamp(12px, 3vw, 17px);
  height: clamp(12px, 3vw, 17px);
  object-fit: contain;
}

.player-summary .summary-rank span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
}

.app-mark {
  width: 118px;
  height: 118px;
  display: grid;
  place-items: center;
  border: 4px solid rgba(73, 229, 159, 0.42);
  border-radius: 19px;
  color: var(--green);
  font-size: 66px;
  line-height: 1;
  text-shadow: 0 0 28px rgba(73, 229, 159, 0.38);
  box-shadow:
    inset 0 0 30px rgba(73, 229, 159, 0.08),
    0 0 26px rgba(73, 229, 159, 0.16);
}

.start-title {
  margin: 0;
  color: #9df1c4;
  font-size: clamp(44px, 11.5vw, 68px);
  font-weight: 1000;
  line-height: 0.9;
  letter-spacing: 0;
  text-shadow:
    0 4px 0 rgba(20, 91, 65, 0.7),
    0 0 26px rgba(73, 229, 159, 0.18);
}

.start-subtitle {
  margin: -18px 0 24px;
  color: var(--green-2);
  font-size: 18px;
  font-weight: 1000;
}

.settings-actions {
  width: 100%;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.setting-btn {
  min-width: 0;
  min-height: 76px;
  display: grid;
  align-content: center;
  gap: 5px;
  padding: 12px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 16px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.08), rgba(255, 255, 255, 0.025)),
    rgba(32, 33, 33, 0.9);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08);
  text-align: left;
}

.setting-btn b {
  min-width: 0;
  overflow: hidden;
  color: var(--green);
  font-size: 22px;
  font-weight: 1000;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.setting-btn i {
  color: #8c8f94;
  font-style: normal;
  font-size: 13px;
  font-weight: 1000;
}

.theme-box {
  width: 100%;
  display: grid;
  gap: 10px;
}

.theme-box > span {
  color: #d7dce0;
  font-size: 14px;
  font-weight: 900;
}

.theme-box button {
  width: 100%;
  min-height: 78px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 0 26px 0 20px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 16px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.08), rgba(255, 255, 255, 0.025)),
    rgba(32, 33, 33, 0.9);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08);
}

.theme-box b {
  color: var(--green);
  font-size: 26px;
  font-weight: 1000;
}

.theme-box i {
  flex: 0 0 auto;
  color: #8c8f94;
  font-style: normal;
  font-size: 16px;
  font-weight: 1000;
}

.style-box {
  width: 100%;
  display: grid;
  gap: 10px;
}

.style-box > span {
  color: #d7dce0;
  font-size: 14px;
  font-weight: 900;
}

.style-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.style-option {
  min-height: 66px;
  display: grid;
  align-content: center;
  gap: 4px;
  padding: 10px 12px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 16px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.07), rgba(255, 255, 255, 0.018)),
    rgba(26, 27, 27, 0.9);
  text-align: left;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08);
}

.style-option b {
  color: #edf5f0;
  font-size: 17px;
  font-weight: 1000;
}

.style-option i {
  color: #8c8f94;
  font-style: normal;
  font-size: 12px;
  font-weight: 900;
}

.style-option.active {
  border-color: rgba(73, 229, 159, 0.7);
  background:
    linear-gradient(180deg, rgba(73, 229, 159, 0.2), rgba(73, 229, 159, 0.06)),
    rgba(22, 34, 29, 0.95);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.12),
    0 0 20px rgba(73, 229, 159, 0.13);
}

.style-option.active b {
  color: var(--green);
}

.account-box {
  width: 100%;
  display: grid;
  gap: 10px;
}

.account-box > span {
  color: #d7dce0;
  font-size: 14px;
  font-weight: 900;
}

.account-row {
  min-height: 62px;
  display: grid;
  grid-template-columns: 58px 1fr;
  align-items: center;
  gap: 10px;
}

.profile-preview {
  width: 58px;
  height: 58px;
  display: grid;
  place-items: center;
  border-radius: 14px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.08), rgba(255, 255, 255, 0.02)),
    rgba(26, 27, 27, 0.9);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.12);
  font-size: 30px;
}

.profile-preview img,
.avatar-option img,
.leaderboard-row span img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.profile-name {
  min-width: 0;
  height: 58px;
  padding: 0 16px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 14px;
  outline: 0;
  background: rgba(18, 19, 19, 0.78);
  color: #edf5f0;
  font: inherit;
  font-size: 20px;
  font-weight: 1000;
}

.profile-name:focus {
  border-color: rgba(73, 229, 159, 0.72);
  box-shadow: 0 0 0 3px rgba(73, 229, 159, 0.12);
}

.avatar-grid {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 8px;
}

.avatar-option {
  aspect-ratio: 1;
  min-width: 0;
  overflow: hidden;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.055);
  font-size: 22px;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.08);
}

.avatar-option.active {
  background: rgba(73, 229, 159, 0.16);
  box-shadow:
    inset 0 0 0 2px rgba(73, 229, 159, 0.68),
    0 0 18px rgba(73, 229, 159, 0.12);
}

.start-btn {
  width: 100%;
  min-height: 80px;
  margin-top: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 18px;
  border: 3px solid rgba(73, 229, 159, 0.62);
  border-radius: 20px;
  background: rgba(17, 19, 19, 0.74);
  color: var(--green);
  font-size: 28px;
  font-weight: 1000;
  box-shadow: 0 0 24px rgba(73, 229, 159, 0.1);
}

.start-btn span {
  font-size: 25px;
}

.mode-actions {
  width: 100%;
  display: grid;
  gap: 12px;
}

.online-btn {
  min-height: 68px;
  border-color: rgba(240, 178, 35, 0.58);
  color: #ffe29a;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.1), rgba(255, 255, 255, 0.02)),
    rgba(38, 31, 15, 0.8);
  box-shadow: 0 0 22px rgba(240, 178, 35, 0.1);
}

.leaderboard-button {
  width: 100%;
  min-height: 56px;
  display: grid;
  align-content: center;
  gap: 3px;
  padding: 8px 14px;
  border: 1px solid rgba(255, 255, 255, 0.09);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.055);
}

.leaderboard-button b {
  color: var(--green);
  font-size: 17px;
  font-weight: 1000;
}

.leaderboard-button i {
  min-width: 0;
  overflow: hidden;
  color: #8f9695;
  font-style: normal;
  font-size: 12px;
  font-weight: 900;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.leaderboard-sheet {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  overflow: hidden;
}

.leaderboard-sheet-body {
  min-height: 0;
  overflow: auto;
}

.leaderboard {
  width: 100%;
  display: grid;
  gap: 8px;
  padding: 12px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 14px;
  background: rgba(0, 0, 0, 0.18);
}

.leaderboard-head,
.leaderboard-row {
  display: grid;
  align-items: center;
}

.leaderboard-head {
  grid-template-columns: 1fr auto;
}

.leaderboard-head b {
  color: var(--green);
  font-size: 15px;
  font-weight: 1000;
  text-align: left;
}

.leaderboard-head span {
  color: #8f9695;
  font-size: 12px;
  font-weight: 900;
}

.leaderboard-list {
  display: grid;
  gap: 10px;
}

.leaderboard-scope-tabs {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin-top: 2px;
}

.leaderboard-scope-tabs button {
  min-height: 42px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.06);
  color: #8f9695;
  font-size: 13px;
  font-weight: 1000;
}

.leaderboard-scope-tabs button.active {
  border-color: rgba(255, 226, 154, 0.42);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.16), transparent 48%),
    linear-gradient(180deg, rgba(240, 178, 35, 0.42), rgba(180, 112, 31, 0.36));
  color: #ffe29a;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.18);
}

.leaderboard-row {
  grid-template-columns: 28px 38px minmax(0, 1fr) minmax(96px, 32%) 54px;
  gap: 9px;
  min-height: 52px;
  padding: 8px 9px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.045);
}

.leaderboard-row > i,
.leaderboard-rank b {
  color: #8f9695;
  font-style: normal;
  font-size: 12px;
  font-weight: 900;
}

.leaderboard-row > i {
  min-width: 0;
  color: #ffe29a;
  font-size: 15px;
  text-align: center;
}

.leaderboard-avatar {
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  overflow: hidden;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.08);
  font-size: 21px;
}

.leaderboard-avatar img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.leaderboard-player,
.leaderboard-rank {
  min-width: 0;
  display: flex;
  align-items: center;
}

.leaderboard-player b {
  min-width: 0;
  overflow: hidden;
  color: #e9efe9;
  font-size: 13px;
  font-weight: 1000;
  text-align: left;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.leaderboard-rank {
  gap: 5px;
}

.leaderboard-rank img {
  width: 26px;
  height: 26px;
  object-fit: contain;
}

.leaderboard-rank b {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.leaderboard-row strong {
  color: #ffe29a;
  font-size: 16px;
  font-weight: 1000;
  text-align: right;
}

.leaderboard-empty {
  min-height: 34px;
  display: grid;
  place-items: center;
  color: #8f9695;
  font-size: 13px;
  font-weight: 900;
}

.battle-shell {
  display: grid;
  grid-template-rows: minmax(165px, 1fr) auto 220px;
}

.game-settings-btn {
  position: absolute;
  left: 10px;
  top: calc(10px + var(--safe-top));
  z-index: 5;
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  border-radius: 12px;
  background: rgba(18, 18, 18, 0.52);
  color: #d8dedc;
  font-size: 22px;
  font-weight: 1000;
  line-height: 1;
  box-shadow:
    inset 0 0 0 1px rgba(255, 255, 255, 0.08),
    0 10px 24px rgba(0, 0, 0, 0.22);
}

.combat-hud {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 60px minmax(0, 1fr);
  align-items: start;
  align-content: end;
  gap: 8px;
  padding: calc(24px + var(--safe-top)) 16px 12px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.09);
}

.unit {
  position: relative;
  display: grid;
  justify-items: center;
  gap: 5px;
  min-width: 0;
  transform: translate(var(--unit-x, 0), var(--unit-y, 0)) scale(var(--unit-scale, 1));
  transition: transform 80ms linear;
}

.gsap-motion .unit,
.gsap-motion .float,
.gsap-motion .shout {
  transition: none;
}

.gsap-motion .unit,
.gsap-motion .portrait,
.gsap-motion .float,
.gsap-motion .shout,
.gsap-motion .hand-slot.flipping,
.gsap-motion .hand-slot.flipping .tile {
  will-change: transform, opacity;
}

.unit.enemy {
  justify-self: stretch;
}

.portrait {
  width: min(23vw, 105px);
  max-width: 105px;
  height: 64px;
  display: grid;
  place-items: end center;
  padding-bottom: 2px;
  border: 2px solid rgba(91, 201, 132, 0.72);
  border-bottom: 0;
  border-radius: 12px 12px 0 0;
  background:
    radial-gradient(circle at 50% 18%, rgba(255, 255, 255, 0.12), transparent 36%),
    linear-gradient(180deg, rgba(91, 201, 132, 0.18), rgba(91, 201, 132, 0.04) 60%, rgba(0, 0, 0, 0.18)),
    rgba(22, 29, 25, 0.78);
  color: #f8fff8;
  font-size: 36px;
  line-height: 1;
  box-shadow:
    inset 0 0 18px rgba(91, 201, 132, 0.14),
    0 0 18px rgba(91, 201, 132, 0.16);
}

.unit-name {
  display: grid;
  justify-items: center;
  gap: 0;
  width: min(24vw, 112px);
  max-width: 112px;
  margin-top: -2px;
  text-align: center;
  text-shadow:
    0 2px 0 rgba(0, 0, 0, 0.65),
    0 0 8px rgba(0, 0, 0, 0.6);
}

.unit-name b {
  max-width: 100%;
  overflow: hidden;
  color: #fff;
  font-size: 12px;
  font-weight: 1000;
  line-height: 1.05;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.unit-name span {
  color: rgba(255, 255, 255, 0.7);
  font-size: 8px;
  font-weight: 900;
  line-height: 1.1;
}

.enemy-face {
  border-color: rgba(226, 92, 74, 0.78);
  background:
    radial-gradient(circle at 50% 18%, rgba(255, 255, 255, 0.12), transparent 36%),
    linear-gradient(180deg, rgba(226, 92, 74, 0.2), rgba(226, 92, 74, 0.05) 60%, rgba(0, 0, 0, 0.18)),
    rgba(29, 23, 22, 0.78);
  box-shadow:
    inset 0 0 18px rgba(226, 92, 74, 0.14),
    0 0 18px rgba(226, 92, 74, 0.17);
}

.unit.attack .portrait {
  animation: lunge 260ms ease;
}

.unit.hit .portrait {
  animation: shake 260ms ease;
}

.versus {
  align-self: start;
  justify-self: center;
  margin-top: 29px;
  color: #ffe38a;
  font-size: 32px;
  font-weight: 1000;
  line-height: 1;
  letter-spacing: 0;
  text-shadow:
    0 3px 0 #96641d,
    0 0 12px rgba(255, 225, 116, 0.72),
    0 8px 16px rgba(0, 0, 0, 0.45);
}

.hpbar,
.attackbar {
  position: relative;
  overflow: hidden;
  width: min(25vw, 119px);
  max-width: 119px;
  height: 15px;
  border-radius: 999px;
  background: rgba(10, 12, 10, 0.64);
  box-shadow:
    inset 0 0 0 1px rgba(255, 255, 255, 0.12),
    0 4px 9px rgba(0, 0, 0, 0.24);
}

.hpbar i,
.attackbar i {
  position: absolute;
  inset: 0 auto 0 0;
  border-radius: inherit;
  transition: width 140ms linear;
}

.player-hp i {
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.34), transparent 50%),
    linear-gradient(180deg, #91eda1, #60cf75);
}

.enemy-hp {
  width: min(25vw, 119px);
  max-width: 119px;
}

.enemy-hp i {
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.32), transparent 50%),
    linear-gradient(180deg, #ff8678, #e75b4e);
}

.player-hp span,
.enemy-hp span,
.attackbar span {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  color: white;
  font-size: 11px;
  font-weight: 1000;
  line-height: 1;
  text-shadow:
    0 1px 1px rgba(0, 0, 0, 0.5),
    0 2px 0 rgba(0, 0, 0, 0.18);
}

.attackbar {
  width: min(21vw, 97px);
  max-width: 97px;
  height: 6px;
  margin-top: -2px;
  opacity: 0.82;
}

.attackbar i {
  background: linear-gradient(90deg, #ff3c68, #ffc65b);
}

.attackbar span {
  display: none;
}

.float {
  position: absolute;
  top: -16px;
  z-index: 5;
  color: #fff;
  font-size: 18px;
  font-weight: 1000;
  text-shadow: 0 2px 8px rgba(0, 0, 0, 0.7);
  opacity: var(--fx-opacity, 1);
  transform: translateY(var(--fx-y, 0)) scale(var(--fx-scale, 1));
  transition:
    opacity 80ms linear,
    transform 80ms linear;
}

.damage-float {
  min-width: 54px;
  padding: 4px 8px;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.55);
}

.damage-float.tier-combo {
  color: #b9dcff;
  font-size: 21px;
}

.damage-float.tier-heavy {
  color: #ffe29a;
  font-size: 24px;
  text-shadow: 0 0 16px rgba(240, 178, 35, 0.72);
}

.damage-float.tier-legend {
  color: #ffd2e1;
  font-size: 27px;
  text-shadow: 0 0 20px rgba(255, 79, 150, 0.82);
}

.board-wrap {
  min-height: 0;
  display: block;
  padding: 50px 21px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.grid {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 8px;
  align-content: center;
  position: relative;
}

.cell,
.hand-slot {
  position: relative;
  display: grid;
  place-items: center;
  min-width: 0;
  overflow: hidden;
  touch-action: manipulation;
  user-select: none;
}

.cell {
  aspect-ratio: 1;
  border-radius: 7px;
  background:
    linear-gradient(45deg, rgba(255, 255, 255, 0.018) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.018) 50%, rgba(255, 255, 255, 0.018) 75%, transparent 75%),
    #1e2020;
  background-size: 18px 18px;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.025);
}

.cell.locked::after {
  content: "";
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.18);
}

.cell.open {
  background:
    repeating-linear-gradient(0deg, rgba(255, 255, 255, 0.12) 0 1px, transparent 1px 4px),
    linear-gradient(180deg, #e7dfcf, #cfc6b6);
  box-shadow:
    inset 0 -3px 0 rgba(91, 80, 66, 0.18),
    0 4px 10px rgba(0, 0, 0, 0.22);
}

.cell.active {
  --chain-color: rgba(73, 229, 159, 0.76);
  --chain-join: 9px;
  --chain-bridge: 18px;
  z-index: 2;
  overflow: visible;
  box-shadow:
    inset 0 0 0 2px var(--chain-color),
    0 0 18px rgba(73, 229, 159, 0.24);
}

.cell.active::before {
  content: "";
  position: absolute;
  inset: auto 0 0;
  height: var(--charge, 0%);
  z-index: 4;
  border-radius: inherit;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.34), transparent 38%),
    linear-gradient(180deg, rgba(157, 255, 209, 0.36), rgba(20, 229, 135, 0.86));
  box-shadow:
    inset 0 0 22px rgba(157, 255, 209, 0.42);
  opacity: 0.96;
  pointer-events: none;
  transition: height 120ms linear;
}

.cell.active.chain-h.chain-start:not(.chain-solo)::before {
  left: 0;
  right: calc(-1 * var(--chain-join));
}

.cell.active.chain-h.chain-mid::before {
  left: calc(-1 * var(--chain-join));
  right: calc(-1 * var(--chain-join));
}

.cell.active.chain-h.chain-end::before {
  left: calc(-1 * var(--chain-join));
  right: 0;
}

.cell.active.chain-h:not(.chain-solo)::after {
  left: calc(-1 * var(--chain-join));
  right: calc(-1 * var(--chain-join));
}

.cell.active.chain-v.chain-start:not(.chain-solo)::before {
  top: auto;
  bottom: calc(-1 * var(--chain-join));
}

.cell.active.chain-v.chain-mid::before {
  top: auto;
  bottom: calc(-1 * var(--chain-join));
}

.cell.active.chain-v.chain-end::before {
  top: auto;
  bottom: 0;
}

.cell.active.chain-v:not(.chain-solo)::after {
  top: calc(-1 * var(--chain-join));
  bottom: calc(-1 * var(--chain-join));
}

.cell.active.chain-h.chain-start,
.cell.active.chain-h.chain-start::before,
.cell.active.chain-h.chain-start::after {
  border-top-right-radius: 0;
  border-bottom-right-radius: 0;
}

.cell.active.chain-h.chain-mid,
.cell.active.chain-h.chain-mid::before,
.cell.active.chain-h.chain-mid::after {
  border-radius: 0;
}

.cell.active.chain-h.chain-end,
.cell.active.chain-h.chain-end::before,
.cell.active.chain-h.chain-end::after {
  border-top-left-radius: 0;
  border-bottom-left-radius: 0;
}

.cell.active.chain-v.chain-start,
.cell.active.chain-v.chain-start::before,
.cell.active.chain-v.chain-start::after {
  border-bottom-left-radius: 0;
  border-bottom-right-radius: 0;
}

.cell.active.chain-v.chain-mid,
.cell.active.chain-v.chain-mid::before,
.cell.active.chain-v.chain-mid::after {
  border-radius: 0;
}

.cell.active.chain-v.chain-end,
.cell.active.chain-v.chain-end::before,
.cell.active.chain-v.chain-end::after {
  border-top-left-radius: 0;
  border-top-right-radius: 0;
}

.cell.active.chain-h.chain-start:not(.chain-solo) {
  box-shadow: 0 0 18px rgba(73, 229, 159, 0.24);
}

.cell.active.chain-h.chain-mid {
  box-shadow: 0 0 18px rgba(73, 229, 159, 0.24);
}

.cell.active.chain-h.chain-end {
  box-shadow: 0 0 18px rgba(73, 229, 159, 0.24);
}

.cell.active.chain-v.chain-start:not(.chain-solo) {
  box-shadow: 0 0 18px rgba(73, 229, 159, 0.24);
}

.cell.active.chain-v.chain-mid {
  box-shadow: 0 0 18px rgba(73, 229, 159, 0.24);
}

.cell.active.chain-v.chain-end {
  box-shadow: 0 0 18px rgba(73, 229, 159, 0.24);
}

.cell.active::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 6;
  border-radius: inherit;
  pointer-events: none;
  background: none;
  box-shadow:
    inset 0 0 0 2px var(--chain-color),
    0 0 14px rgba(73, 229, 159, 0.24);
}

.cell.active.chain-h:not(.chain-solo)::after,
.cell.active.chain-v:not(.chain-solo)::after {
  opacity: 1;
}

.cell.active.chain-h.chain-start:not(.chain-solo)::after {
  left: 0;
  right: calc(-1 * var(--chain-join));
  box-shadow:
    inset 2px 0 0 var(--chain-color),
    inset 0 2px 0 var(--chain-color),
    inset 0 -2px 0 var(--chain-color),
    0 0 14px rgba(73, 229, 159, 0.24);
}

.cell.active.chain-h.chain-mid::after {
  left: calc(-1 * var(--chain-join));
  right: calc(-1 * var(--chain-join));
  box-shadow:
    inset 0 2px 0 var(--chain-color),
    inset 0 -2px 0 var(--chain-color),
    0 0 14px rgba(73, 229, 159, 0.24);
}

.cell.active.chain-h.chain-end::after {
  left: calc(-1 * var(--chain-join));
  right: 0;
  box-shadow:
    inset -2px 0 0 var(--chain-color),
    inset 0 2px 0 var(--chain-color),
    inset 0 -2px 0 var(--chain-color),
    0 0 14px rgba(73, 229, 159, 0.24);
}

.cell.active.chain-v.chain-start:not(.chain-solo)::after {
  top: 0;
  bottom: calc(-1 * var(--chain-join));
  box-shadow:
    inset 2px 0 0 var(--chain-color),
    inset -2px 0 0 var(--chain-color),
    inset 0 2px 0 var(--chain-color),
    0 0 14px rgba(73, 229, 159, 0.24);
}

.cell.active.chain-v.chain-mid::after {
  top: calc(-1 * var(--chain-join));
  bottom: calc(-1 * var(--chain-join));
  box-shadow:
    inset 2px 0 0 var(--chain-color),
    inset -2px 0 0 var(--chain-color),
    0 0 14px rgba(73, 229, 159, 0.24);
}

.cell.active.chain-v.chain-end::after {
  top: calc(-1 * var(--chain-join));
  bottom: 0;
  box-shadow:
    inset 2px 0 0 var(--chain-color),
    inset -2px 0 0 var(--chain-color),
    inset 0 -2px 0 var(--chain-color),
    0 0 14px rgba(73, 229, 159, 0.24);
}

.cell.active.chain-h:not(.chain-solo),
.cell.active.chain-v:not(.chain-solo) {
  background: transparent;
  box-shadow: none;
  z-index: 3;
}

.cell.active.chain-h:not(.chain-solo)::before,
.cell.active.chain-h:not(.chain-solo)::after,
.cell.active.chain-v:not(.chain-solo)::before,
.cell.active.chain-v:not(.chain-solo)::after {
  content: none;
}

.chain-overlay {
  --chain-color: rgba(73, 229, 159, 0.76);
  position: relative;
  z-index: 2;
  min-width: 0;
  min-height: 0;
  overflow: hidden;
  border-radius: 7px;
  pointer-events: none;
  isolation: isolate;
  background:
    repeating-linear-gradient(0deg, rgba(255, 255, 255, 0.13) 0 1px, transparent 1px 4px),
    linear-gradient(180deg, #eee8da, #cfc7b8);
  box-shadow:
    inset 0 0 0 2px var(--chain-color),
    inset 0 -3px 0 rgba(80, 70, 58, 0.16),
    0 0 18px rgba(73, 229, 159, 0.24);
}

.chain-overlay::before {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: var(--charge, 0%);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.34), transparent 38%),
    linear-gradient(180deg, rgba(157, 255, 209, 0.36), rgba(20, 229, 135, 0.86));
  box-shadow: inset 0 0 22px rgba(157, 255, 209, 0.42);
  z-index: 0;
  opacity: 0.72;
  transition: height 120ms linear;
}

.chain-overlay.tier-combo {
  --chain-color: rgba(83, 170, 255, 0.8);
}

.chain-overlay.tier-combo::before {
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.34), transparent 38%),
    linear-gradient(180deg, rgba(145, 198, 255, 0.42), rgba(62, 126, 255, 0.82));
}

.chain-overlay.tier-heavy {
  --chain-color: rgba(255, 198, 91, 0.86);
}

.chain-overlay.tier-heavy::before {
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.38), transparent 38%),
    linear-gradient(180deg, rgba(255, 224, 150, 0.48), rgba(240, 178, 35, 0.9));
}

.chain-overlay.tier-legend {
  --chain-color: rgba(255, 91, 150, 0.9);
}

.chain-overlay.tier-legend::before {
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.38), transparent 38%),
    linear-gradient(180deg, rgba(255, 158, 195, 0.5), rgba(255, 91, 150, 0.92));
}

.cell.tier-combo {
  --chain-color: rgba(83, 170, 255, 0.8);
}

.cell.tier-combo::before {
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.34), transparent 38%),
    linear-gradient(180deg, rgba(145, 198, 255, 0.42), rgba(62, 126, 255, 0.82));
}

.cell.tier-heavy {
  --chain-color: rgba(255, 198, 91, 0.86);
}

.cell.tier-heavy::before {
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.38), transparent 38%),
    linear-gradient(180deg, rgba(255, 224, 150, 0.48), rgba(240, 178, 35, 0.9));
}

.cell.tier-legend {
  --chain-color: rgba(255, 91, 150, 0.9);
}

.cell.tier-legend::before {
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.38), transparent 38%),
    linear-gradient(180deg, rgba(255, 158, 195, 0.5), rgba(255, 91, 150, 0.92));
}

.cell.selected,
.hand-slot.selected {
  outline: 2px solid var(--green);
  outline-offset: 3px;
}

.cell.combo-candidate .tile,
.hand-slot.combo-candidate .tile {
  animation: combo-candidate-tremble 920ms ease-in-out infinite;
  box-shadow:
    inset 0 -3px 0 rgba(80, 70, 58, 0.18),
    0 0 14px rgba(73, 229, 159, 0.24),
    0 5px 10px rgba(0, 0, 0, 0.24);
}

.cell.dragging,
.hand-slot.dragging {
  opacity: 0.58;
  transform: scale(0.96);
}

.drag-ghost {
  position: fixed;
  left: 0;
  top: 0;
  z-index: 1000;
  display: grid;
  place-items: center;
  border-radius: 9px;
  pointer-events: none;
  background:
    repeating-linear-gradient(0deg, rgba(255, 255, 255, 0.13) 0 1px, transparent 1px 4px),
    linear-gradient(180deg, #fff3dc, #d7c7aa);
  color: #1b201e;
  font-family: "STKaiti", "KaiTi", "Noto Serif SC", serif;
  font-size: 32px;
  font-weight: 1000;
  box-shadow:
    0 18px 34px rgba(0, 0, 0, 0.34),
    0 0 0 2px rgba(255, 255, 255, 0.34);
  will-change: transform;
}

.drag-ghost.tile-tool {
  background: linear-gradient(180deg, #a2f5ce, #3ec992);
}

.drag-ghost.tile-heal {
  background: linear-gradient(180deg, #ff7994, #c51d4b);
  color: #fff;
}

.cell.drop-target,
.hand-slot.drop-target {
  outline: 3px solid var(--drop-target-color, var(--gold));
  outline-offset: 2px;
  box-shadow:
    inset 0 0 0 2px var(--drop-target-inner, rgba(240, 178, 35, 0.56)),
    0 0 18px var(--drop-target-glow, rgba(240, 178, 35, 0.28));
}

.cell.drop-target-valid,
.hand-slot.drop-target-valid {
  --drop-target-color: var(--green);
  --drop-target-inner: rgba(73, 229, 159, 0.58);
  --drop-target-glow: rgba(73, 229, 159, 0.3);
}

.cell.drop-target-invalid,
.hand-slot.drop-target-invalid {
  --drop-target-color: var(--red);
  --drop-target-inner: rgba(240, 63, 103, 0.6);
  --drop-target-glow: rgba(240, 63, 103, 0.32);
}

.tile {
  width: 100%;
  height: 100%;
  display: grid;
  place-items: center;
  position: relative;
  z-index: 3;
  border-radius: inherit;
  background:
    repeating-linear-gradient(0deg, rgba(255, 255, 255, 0.13) 0 1px, transparent 1px 4px),
    linear-gradient(180deg, #eee8da, #cfc7b8);
  color: #1b201e;
  font-family: "STKaiti", "KaiTi", "Noto Serif SC", serif;
  font-size: clamp(22px, 7vw, 34px);
  font-weight: 1000;
  text-shadow: 0 1px 0 rgba(255, 255, 255, 0.55);
  box-shadow:
    inset 0 -3px 0 rgba(80, 70, 58, 0.18),
    0 5px 10px rgba(0, 0, 0, 0.24);
}

.cell.active .tile {
  color: #1b201e;
  text-shadow: 0 1px 0 rgba(255, 255, 255, 0.55);
}

.cell.active.chain-h:not(.chain-solo) .tile,
.cell.active.chain-v:not(.chain-solo) .tile {
  box-shadow: inset 0 -3px 0 rgba(80, 70, 58, 0.18);
}

.cell.active.chain-h:not(.chain-solo) .tile {
  width: calc(100% + var(--chain-bridge));
}

.cell.active.chain-h.chain-start .tile {
  justify-self: start;
  border-top-right-radius: 0;
  border-bottom-right-radius: 0;
}

.cell.active.chain-h.chain-mid .tile {
  border-radius: 0;
}

.cell.active.chain-h.chain-end .tile {
  justify-self: end;
  border-top-left-radius: 0;
  border-bottom-left-radius: 0;
}

.cell.active.chain-v:not(.chain-solo) .tile {
  height: calc(100% + var(--chain-bridge));
}

.cell.active.chain-v.chain-start .tile {
  align-self: start;
  border-bottom-left-radius: 0;
  border-bottom-right-radius: 0;
}

.cell.active.chain-v.chain-mid .tile {
  border-radius: 0;
}

.cell.active.chain-v.chain-end .tile {
  align-self: end;
  border-top-left-radius: 0;
  border-top-right-radius: 0;
}

.cell.active.chain-h:not(.chain-solo) .tile,
.cell.active.chain-v:not(.chain-solo) .tile {
  background:
    repeating-linear-gradient(0deg, rgba(255, 255, 255, 0.13) 0 1px, transparent 1px 4px),
    linear-gradient(180deg, #eee8da, #cfc7b8);
  box-shadow:
    inset 0 -3px 0 rgba(80, 70, 58, 0.18),
    0 5px 10px rgba(0, 0, 0, 0.24);
}

.tile-tool,
.tile-heal {
  font-family: inherit;
  font-size: clamp(20px, 6vw, 30px);
}

.tile-tool {
  color: #102b22;
  background: linear-gradient(180deg, #a2f5ce, #3ec992);
}

.tile-heal {
  color: white;
  background: linear-gradient(180deg, #ff7994, #c51d4b);
}

.bottom-dock {
  display: grid;
  grid-template-rows: 58px 56px;
  gap: 30px;
  padding: 14px 21px calc(50px + var(--safe-bottom));
}

.hand {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 8px;
}

.hand-slot {
  aspect-ratio: 1;
  border-radius: 7px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.035), rgba(255, 255, 255, 0.01)),
    #191a1a;
  box-shadow:
    inset 0 0 0 1px rgba(255, 255, 255, 0.05),
    0 7px 16px rgba(0, 0, 0, 0.18);
}

.bag-slot {
  color: #8c8f94;
  font-size: 31px;
  font-weight: 800;
}

.hand-slot:first-child {
  box-shadow:
    inset 0 0 0 1px rgba(255, 255, 255, 0.06),
    0 0 0 1px rgba(255, 255, 255, 0.02),
    0 8px 16px rgba(0, 0, 0, 0.2);
}

.hand-slot.flipping .tile {
  transform: scaleX(var(--flip-scale, 1));
  filter: brightness(calc(1 + var(--flip-light, 0) * 0.55));
  opacity: var(--face-opacity, 1);
}

.hand-slot.flipping {
  background:
    linear-gradient(90deg, transparent, rgba(255, 255, 255, calc(var(--flip-light, 0) * 0.42)), transparent),
    repeating-linear-gradient(0deg, rgba(255, 255, 255, 0.08) 0 1px, transparent 1px 5px),
    linear-gradient(180deg, #252727, #141616);
}

.hand-slot.flipping::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 5;
  border-radius: inherit;
  pointer-events: none;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.48), transparent);
  opacity: var(--flip-light, 0);
}

.bottom-actions {
  display: grid;
  grid-template-columns: 88px 1fr;
  grid-template-rows: 56px;
  gap: 14px;
  align-items: center;
}

.ration {
  grid-column: 1;
  grid-row: 1;
  position: relative;
  overflow: hidden;
  width: 88px;
  height: 56px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  border-radius: 13px;
  background: #171818;
  box-shadow:
    inset 0 0 0 1px rgba(255, 255, 255, 0.07),
    inset 0 -4px 0 rgba(240, 178, 35, 0.55);
}

.ration::before {
  content: "";
  position: absolute;
  inset: calc(100% - var(--recover, 0%)) 0 0;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.16), transparent),
    linear-gradient(180deg, rgba(255, 211, 63, 0.24), rgba(240, 178, 35, 0.52));
  pointer-events: none;
  transition: inset 120ms linear;
}

.ration span {
  position: relative;
  z-index: 1;
  font-size: 28px;
}

.coin-icon {
  width: 28px;
  height: 28px;
  display: inline-grid;
  place-items: center;
  border-radius: 50%;
  background:
    radial-gradient(circle at 34% 28%, rgba(255, 255, 255, 0.5), transparent 24%),
    linear-gradient(180deg, #ffde66, #d89816);
  color: #5b3500;
  font-size: 15px;
  font-weight: 1000;
  line-height: 1;
  box-shadow:
    inset 0 0 0 2px rgba(92, 54, 0, 0.22),
    0 2px 5px rgba(0, 0, 0, 0.2);
}

.ration b {
  position: relative;
  z-index: 1;
  color: #ffce31;
  font-size: 26px;
  font-weight: 1000;
}

.draw-btn {
  grid-column: 2;
  grid-row: 1;
  height: 56px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  border-radius: 15px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.15), transparent 48%),
    linear-gradient(180deg, #54e9a7, #27b878);
  color: #09241a;
  font-size: 22px;
  font-weight: 1000;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.26),
    0 12px 24px rgba(33, 177, 117, 0.18);
}

.draw-btn span {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 9px;
  border-radius: 7px;
  background: rgba(0, 0, 0, 0.12);
  font-size: 18px;
}

.draw-btn .coin-icon {
  width: 20px;
  height: 20px;
  font-size: 11px;
}

.shout {
  position: absolute;
  left: 50%;
  top: 196px;
  z-index: 12;
  transform: translateX(-50%);
  padding: 8px 14px;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.72);
  color: var(--green);
  font-size: 18px;
  font-weight: 1000;
  box-shadow: 0 0 18px rgba(73, 229, 159, 0.18);
  opacity: var(--shout-opacity, 1);
  transform: translateX(-50%) translateY(var(--shout-y, 0)) scale(var(--shout-scale, 1));
  transition:
    opacity 80ms linear,
    transform 80ms linear;
}

.shout.tier-combo {
  color: #b9dcff;
  box-shadow: 0 0 22px rgba(83, 170, 255, 0.24);
}

.shout.tier-heavy {
  color: #ffe29a;
  font-size: 21px;
  box-shadow: 0 0 26px rgba(240, 178, 35, 0.28);
}

.shout.tier-legend {
  color: #ffd2e1;
  font-size: 23px;
  border-color: rgba(255, 79, 150, 0.35);
  box-shadow: 0 0 30px rgba(255, 79, 150, 0.34);
}

.attack-projectiles {
  position: absolute;
  inset: 0;
  z-index: 14;
  pointer-events: none;
  --start-x: 25%;
  --mid-x: min(26vw, 130px);
  --travel-x: min(46vw, 230px);
}

.attack-projectiles.to-player {
  --start-x: 74%;
  --mid-x: max(-26vw, -130px);
  --travel-x: max(-46vw, -230px);
}

.attack-projectile {
  position: absolute;
  left: var(--start-x);
  top: calc(116px + var(--safe-top));
  width: clamp(48px, 11vw, 62px);
  height: clamp(48px, 11vw, 62px);
  display: grid;
  place-items: center;
  border-radius: 50%;
  background:
    radial-gradient(circle at 34% 24%, rgba(255, 255, 255, 0.72), transparent 30%),
    linear-gradient(180deg, rgba(255, 235, 155, 0.96), rgba(238, 173, 70, 0.96));
  box-shadow:
    inset 0 -3px 0 rgba(132, 89, 28, 0.18),
    0 10px 22px rgba(137, 81, 22, 0.28);
  opacity: 0;
  animation: combo-icon-throw 820ms cubic-bezier(0.18, 0.84, 0.26, 1) both;
  animation-delay: var(--delay, 0ms);
}

.attack-projectile b {
  width: 76%;
  height: 76%;
  display: grid;
  place-items: center;
  font-size: clamp(24px, 6vw, 34px);
  line-height: 1;
}

.attack-projectile b img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.attack-projectile span {
  position: absolute;
  left: 50%;
  top: calc(100% - 5px);
  max-width: 82px;
  overflow: hidden;
  padding: 2px 6px;
  transform: translateX(-50%);
  border-radius: 999px;
  background: rgba(91, 53, 20, 0.72);
  color: #fff6d4;
  font-size: 11px;
  font-weight: 1000;
  line-height: 1.15;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.attack-projectiles.tier-heavy .attack-projectile,
.attack-projectiles.tier-legend .attack-projectile {
  background:
    radial-gradient(circle at 34% 24%, rgba(255, 255, 255, 0.76), transparent 30%),
    linear-gradient(180deg, rgba(255, 205, 114, 0.98), rgba(227, 112, 59, 0.98));
}

.attack-projectiles.tier-legend .attack-projectile {
  box-shadow:
    inset 0 -3px 0 rgba(132, 54, 48, 0.2),
    0 0 22px rgba(255, 120, 92, 0.34),
    0 12px 24px rgba(137, 57, 22, 0.26);
}

.toast {
  position: absolute;
  left: 50%;
  bottom: calc(165px + var(--safe-bottom));
  z-index: 20;
  transform: translateX(-50%);
  padding: 9px 14px;
  border: 1px solid rgba(73, 229, 159, 0.3);
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.78);
  color: #bff8d7;
  font-size: 13px;
  font-weight: 900;
  white-space: nowrap;
  pointer-events: none;
  animation: toast 1.5s ease forwards;
  animation-delay: calc(var(--toast-elapsed, 0ms) * -1);
}

.drag-hint {
  position: fixed;
  z-index: 1001;
  transform: translate(-50%, -100%);
  max-width: min(280px, calc(100vw - 32px));
  padding: 9px 13px;
  border: 1px solid rgba(240, 178, 35, 0.45);
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.82);
  color: #ffe29a;
  font-size: 14px;
  font-weight: 1000;
  white-space: nowrap;
  pointer-events: none;
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.32);
}

.modal {
  position: absolute;
  inset: 0;
  z-index: 30;
  display: grid;
  place-items: center;
  padding: 24px;
  background: rgba(3, 4, 4, 0.74);
  backdrop-filter: blur(8px);
}

.match-overlay {
  position: absolute;
  inset: 0;
  z-index: 40;
  overflow: hidden;
  background: url("./assets/tex_bg_match.jpg") center / cover no-repeat;
}

.match-scene {
  position: absolute;
  inset: 0;
  display: grid;
  grid-template-rows: minmax(150px, 25svh) auto minmax(92px, 14svh) minmax(104px, 17svh);
  justify-items: center;
  align-items: center;
  padding: calc(12px + var(--safe-top)) 18px calc(34px + var(--safe-bottom));
}

.match-title {
  align-self: end;
  width: 78%;
  max-width: 390px;
  aspect-ratio: 642 / 292;
  margin-bottom: 6px;
  background: url("./assets/tex_match_title1.png") center / contain no-repeat;
}

.match-ready .match-title {
  width: 82%;
  max-width: 420px;
  aspect-ratio: 834 / 346;
  background-image: url("./assets/tex_match_title2.png");
}

.match-versus-row {
  width: 88%;
  max-width: 440px;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 156px));
  align-items: center;
  justify-items: center;
  justify-content: space-between;
  gap: 26px;
  transform: translateY(96px);
}

.match-role-card,
.match-random-card {
  width: min(100%, 156px);
  aspect-ratio: 289 / 496;
  position: relative;
  display: grid;
  justify-items: center;
  align-content: start;
  padding: 16% 11% 9%;
  background: url("./assets/tex_match_role_bg.png") center / contain no-repeat;
  color: #6d4a28;
  text-align: center;
  backface-visibility: hidden;
  transform-origin: center center;
  will-change: transform, opacity;
}

.match-random-card {
  background-image: url("./assets/tex_match_random.png");
}

.match-entering .player-card {
  animation: match-card-enter-left 900ms cubic-bezier(0.18, 0.86, 0.22, 1) both;
}

.match-entering .match-random-card {
  animation: match-card-enter-right 900ms cubic-bezier(0.18, 0.86, 0.22, 1) both;
}

.match-entering .match-time,
.match-entering .match-cancel {
  opacity: 0;
  pointer-events: none;
}

.match-flipping .enemy-card {
  animation: match-card-flip-in 620ms cubic-bezier(0.18, 0.84, 0.24, 1) both;
  transform-style: preserve-3d;
}

.match-role-avatar {
  width: 82%;
  aspect-ratio: 1;
  display: grid;
  place-items: center;
  margin-top: 3%;
  margin-bottom: 6%;
  background: var(--unit-tray) center / contain no-repeat;
  color: #684522;
  font-size: 54px;
}

.match-role-avatar img {
  width: 84%;
  height: 84%;
  object-fit: contain;
}

.match-role-avatar span {
  line-height: 1;
}

.match-role-card > b {
  width: 100%;
  min-width: 0;
  overflow: hidden;
  color: #7a4e24;
  font-size: 18px;
  font-weight: 1000;
  line-height: 1.16;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.match-role-meta {
  position: absolute;
  left: 14%;
  right: 14%;
  bottom: 11%;
  min-height: 18%;
  display: grid;
  grid-template-columns: 35% 1fr;
  grid-template-rows: 1fr 1fr;
  align-items: center;
  text-align: left;
  column-gap: 6%;
}

.match-role-meta i {
  grid-row: 1 / span 2;
  width: 100%;
  aspect-ratio: 1;
  display: grid;
  place-items: center;
  border-radius: 50%;
  color: #7c562d;
  font-size: 16px;
  font-style: normal;
}

.match-role-meta i img {
  width: 92%;
  height: 92%;
  object-fit: contain;
}

.match-role-meta span,
.match-role-meta strong {
  overflow: hidden;
  color: #8b6235;
  font-size: 12px;
  font-weight: 1000;
  line-height: 1;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.match-role-meta strong {
  color: #7d552e;
  font-size: 17px;
}

.match-time {
  width: 42%;
  max-width: 214px;
  aspect-ratio: 369 / 102;
  display: flex;
  align-items: center;
  justify-content: center;
  transform: translateY(76px);
  padding-bottom: 2px;
  background: url("./assets/tex_battle_time.png") center / contain no-repeat;
}

.match-time b {
  color: #81ad4e;
  font-size: 18px;
  font-weight: 1000;
  line-height: 1;
  transform: translateX(42px);
}

.match-start-countdown {
  align-self: center;
  display: flex;
  align-items: baseline;
  justify-content: center;
  gap: 8px;
  transform: translateY(76px);
  color: #64451e;
  font-weight: 1000;
  text-align: center;
}

.match-start-countdown b {
  color: #7aa54d;
  font-size: 50px;
  line-height: 1;
}

.match-start-countdown span {
  color: #64451e;
  font-size: 24px;
  line-height: 1;
}

.match-cancel {
  width: 74%;
  aspect-ratio: 512 / 159;
  min-height: 0;
  align-self: start;
  transform: translateY(76px);
  border: 0;
  border-radius: 0;
  background: url("./assets/commonbtn_green.png") center / contain no-repeat;
  color: #ffffff;
  font-size: 30px;
  font-weight: 1000;
  letter-spacing: 0;
  text-shadow: 0 2px 0 rgba(82, 119, 44, 0.36);
  box-shadow: none;
}

@keyframes match-card-enter-left {
  0% {
    opacity: 0;
    transform: translateX(calc(50% + 58px)) scale(0.84);
  }

  70% {
    opacity: 1;
    transform: translateX(-8px) scale(1.06);
  }

  84% {
    opacity: 1;
    transform: translateX(3px) scale(0.98);
  }

  100% {
    opacity: 1;
    transform: translateX(0) scale(1);
  }
}

@keyframes match-card-enter-right {
  0% {
    opacity: 0;
    transform: translateX(calc(-50% - 58px)) scale(0.84);
  }

  70% {
    opacity: 1;
    transform: translateX(8px) scale(1.06);
  }

  84% {
    opacity: 1;
    transform: translateX(-3px) scale(0.98);
  }

  100% {
    opacity: 1;
    transform: translateX(0) scale(1);
  }
}

@keyframes match-card-flip-in {
  0% {
    opacity: 0;
    transform: perspective(720px) rotateY(-92deg) scale(0.96);
  }

  58% {
    opacity: 1;
    transform: perspective(720px) rotateY(7deg) scale(1.03);
  }

  100% {
    opacity: 1;
    transform: perspective(720px) rotateY(0) scale(1);
  }
}

.sheet {
  width: min(100%, 380px);
  max-height: 82svh;
  overflow: auto;
  border: 1px solid rgba(73, 229, 159, 0.34);
  border-radius: 18px;
  background: #181a1a;
  box-shadow: 0 24px 70px rgba(0, 0, 0, 0.48);
}

.book-sheet {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  overflow: hidden;
}

.compact-sheet {
  max-width: 340px;
}

.settings-sheet {
  width: min(100%, 430px);
}

.sheet-head {
  position: sticky;
  top: 0;
  z-index: 1;
  min-height: 56px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 16px;
  background: #1d1f1f;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.sheet-head b {
  color: var(--green);
  font-size: 18px;
  font-weight: 1000;
}

.close-btn {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.06);
  color: #c8cdd0;
  font-size: 28px;
  line-height: 1;
}

.sheet-body {
  display: grid;
  gap: 15px;
  padding: 16px;
}

.book-sheet-body {
  overflow: hidden;
  min-height: 0;
}

.theme-picker {
  gap: 14px;
}

.theme-fullscreen {
  padding: 0;
  place-items: stretch;
}

.theme-screen {
  width: 100%;
  height: 100%;
  min-height: 0;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.04), transparent 34%),
    rgba(18, 20, 20, 0.98);
}

.theme-screen-head {
  display: grid;
  gap: 5px;
  padding: calc(30px + var(--safe-top)) 24px 16px;
}

.theme-screen-head b {
  color: var(--green);
  font-size: 32px;
  font-weight: 1000;
  line-height: 1;
}

.theme-screen-head span {
  color: #8c8f94;
  font-size: 14px;
  font-weight: 900;
}

.theme-screen-body {
  display: grid;
  grid-template-rows: minmax(0, 1fr);
  min-height: 0;
  overflow: hidden;
  padding: 0 18px 18px;
}

.theme-bottom-nav {
  display: grid;
  grid-template-columns: 82px minmax(0, 1fr);
  gap: 8px;
  align-items: stretch;
  padding: 8px 12px calc(8px + var(--safe-bottom));
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(7, 9, 9, 0.86);
  backdrop-filter: blur(10px);
}

.theme-back {
  min-width: 0;
  min-height: 46px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.07);
  color: #e8eceb;
  font-size: 16px;
  font-weight: 1000;
}

.theme-tabs {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 6px;
  padding: 3px;
  border-radius: 13px;
  background: rgba(0, 0, 0, 0.18);
}

.book-fullscreen .theme-bottom-nav {
  grid-template-columns:
    var(--ui-bottom-nav-return-column)
    var(--ui-bottom-nav-main-column)
    var(--ui-bottom-nav-main-column);
}

.book-fullscreen-tab {
  grid-column: 2 / 4;
  min-width: 0;
  min-height: 46px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(239, 185, 83, 0.9);
  border-radius: 12px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.42), transparent 50%),
    rgba(255, 224, 146, 0.86);
  box-shadow:
    inset 0 0 0 2px rgba(255, 255, 255, 0.58),
    0 8px 18px rgba(163, 105, 32, 0.12);
  color: #6b4a22;
  font-size: 16px;
  font-weight: 1000;
}

.theme-option {
  min-width: 0;
  min-height: 46px;
  display: grid;
  align-content: center;
  padding: 6px 8px;
  border: 1px solid transparent;
  border-radius: 10px;
  background: transparent;
  text-align: center;
}

.theme-option b {
  color: #edf5f0;
  font-size: 15px;
  font-weight: 1000;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.theme-option.active {
  border-color: rgba(73, 229, 159, 0.7);
  background:
    linear-gradient(180deg, rgba(73, 229, 159, 0.18), rgba(73, 229, 159, 0.06)),
    rgba(22, 34, 29, 0.95);
}

.theme-option.active b {
  color: var(--green);
}

.theme-book {
  display: grid;
  grid-template-rows: minmax(0, 1fr);
  gap: 11px;
  padding: 12px;
  height: 100%;
  min-height: 0;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 14px;
  background: rgba(0, 0, 0, 0.16);
}

.theme-screen-body .theme-book {
  height: 100%;
  min-height: 100%;
  align-content: stretch;
}

.book-modal-panel {
  max-height: none;
}

.book-pages {
  min-height: 0;
  display: grid;
  align-content: start;
  gap: 14px;
  overflow: auto;
  padding-right: 8px;
}

.ui-scrollarea {
  overscroll-behavior: contain;
  scrollbar-color: rgba(214, 188, 132, 0.72) rgba(39, 27, 16, 0.42);
  scrollbar-width: thin;
  touch-action: pan-y;
  -webkit-overflow-scrolling: touch;
  cursor: grab;
}

.ui-scrollarea.drag-scrolling {
  cursor: grabbing;
}

.ui-scrollarea::-webkit-scrollbar {
  width: 10px;
  height: 10px;
}

.ui-scrollarea::-webkit-scrollbar-track {
  border-radius: 999px;
  background:
    linear-gradient(180deg, rgba(255, 245, 199, 0.12), rgba(65, 44, 24, 0.28)),
    rgba(26, 18, 11, 0.44);
}

.ui-scrollarea::-webkit-scrollbar-thumb {
  border: 2px solid rgba(31, 22, 14, 0.64);
  border-radius: 999px;
  background:
    linear-gradient(180deg, rgba(255, 241, 172, 0.86), rgba(177, 122, 55, 0.86));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.32);
}

.modal-style-grid {
  grid-template-columns: 1fr;
}

.book-group {
  display: grid;
  gap: 7px;
}

.book-group h3 {
  margin: 0 0 2px;
  color: #9aa09f;
  font-size: 13px;
}

.book-row {
  min-height: 42px;
  display: grid;
  grid-template-columns: 1fr auto auto;
  align-items: center;
  gap: 10px;
  padding: 0 12px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.045);
}

.book-row b {
  color: #e9efe9;
}

.char-list {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 6px;
}

.template-row {
  grid-template-columns: 1fr auto;
}

.template-row b {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.template-row b span,
.char-list span,
.combo-list span {
  min-width: 34px;
  min-height: 34px;
  display: inline-grid;
  place-items: center;
  border-radius: 7px;
  background:
    repeating-linear-gradient(0deg, rgba(255, 255, 255, 0.13) 0 1px, transparent 1px 4px),
    linear-gradient(180deg, #eee8da, #cfc7b8);
  color: #1b201e;
  font-family: "STKaiti", "KaiTi", "Noto Serif SC", serif;
  font-size: 22px;
  font-weight: 1000;
  text-shadow: 0 1px 0 rgba(255, 255, 255, 0.55);
  box-shadow:
    inset 0 -3px 0 rgba(80, 70, 58, 0.18),
    0 5px 10px rgba(0, 0, 0, 0.24);
}

.combo-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.combo-list span {
  min-width: max(34px, calc(var(--combo-len, 1) * 1.12em + 22px));
  padding: 0 11px;
  font-size: 20px;
}

.combo-list span.locked {
  color: rgba(27, 32, 30, 0.72);
}

.combo-list span.unlocked {
  color: #1b201e;
}

.recipe-section {
  gap: 8px;
}

.recipe-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
}

.recipe-card {
  min-width: 0;
  min-height: 78px;
  display: grid;
  grid-template-rows: 44px auto;
  justify-items: center;
  align-content: center;
  gap: 5px;
  padding: 7px 4px 8px;
  border: 1px solid rgba(141, 98, 45, 0.12);
  border-radius: 10px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.34), transparent 54%),
    rgba(255, 244, 205, 0.7);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.62),
    0 6px 12px rgba(122, 83, 30, 0.1);
}

.recipe-card b {
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  font-size: 28px;
  line-height: 1;
}

.recipe-card b img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.recipe-card i {
  min-width: 0;
  width: 100%;
  overflow: hidden;
  color: #6b4a22;
  font-style: normal;
  font-size: 13px;
  font-weight: 1000;
  line-height: 1.12;
  text-align: center;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.book-row > span,
.book-row i {
  color: #9aa09f;
  font-style: normal;
  font-size: 12px;
  font-weight: 900;
}

.reward-list {
  display: grid;
  gap: 10px;
  padding: 16px;
}

.reward {
  min-height: 72px;
  display: grid;
  grid-template-columns: 52px 1fr;
  align-items: center;
  column-gap: 12px;
  padding: 10px;
  text-align: left;
  border-radius: 13px;
  background: rgba(255, 255, 255, 0.055);
}

.reward b {
  grid-row: span 2;
  width: 52px;
  height: 52px;
  display: grid;
  place-items: center;
  border-radius: 12px;
  background: rgba(73, 229, 159, 0.15);
  color: var(--green);
  font-size: 22px;
}

.reward span {
  color: #edf4ef;
  font-size: 16px;
  font-weight: 1000;
}

.reward i {
  color: #8f9695;
  font-style: normal;
  font-size: 12px;
  font-weight: 800;
}

.danger-reward b {
  background: rgba(240, 63, 103, 0.15);
  color: var(--red);
}

.result-fullscreen {
  padding: 0;
  place-items: stretch;
}

.result-screen {
  position: relative;
  min-height: 100%;
  display: grid;
  grid-template-rows: auto auto minmax(0, 1fr) auto;
  align-items: start;
  gap: 14px;
  overflow: hidden;
  padding: calc(76px + var(--safe-top)) 24px calc(18px + var(--safe-bottom));
  text-align: center;
  background:
    radial-gradient(circle at 50% 16%, rgba(240, 178, 35, 0.24), transparent 30%),
    linear-gradient(180deg, rgba(73, 229, 159, 0.12), rgba(7, 9, 9, 0.98) 56%);
}

.result-screen.lose {
  background:
    radial-gradient(circle at 50% 16%, rgba(240, 63, 103, 0.3), transparent 32%),
    linear-gradient(180deg, rgba(240, 63, 103, 0.12), rgba(7, 9, 9, 0.98) 56%);
}

.result-screen::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    linear-gradient(90deg, transparent 0 9%, rgba(255, 255, 255, 0.04) 10% 11%, transparent 12% 100%),
    repeating-linear-gradient(0deg, rgba(255, 255, 255, 0.025) 0 1px, transparent 1px 5px);
}

.result-screen h2 {
  position: relative;
  z-index: 1;
  margin: 0;
  color: #fff2bd;
  font-size: 92px;
  font-weight: 1000;
  line-height: 0.88;
  text-shadow:
    0 5px 0 rgba(116, 82, 17, 0.42),
    0 0 34px rgba(240, 178, 35, 0.34);
}

.result-screen.lose h2 {
  color: #ffd7df;
  text-shadow:
    0 5px 0 rgba(111, 25, 45, 0.46),
    0 0 34px rgba(240, 63, 103, 0.36);
}

.result-screen p {
  position: relative;
  z-index: 1;
  margin: 0 0 18px;
  color: #9aa09f;
  font-size: 16px;
  font-weight: 1000;
}

.result-stats {
  position: relative;
  z-index: 1;
  width: 100%;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 9px;
  align-self: start;
}

.result-stat {
  min-height: 68px;
  display: grid;
  align-content: center;
  gap: 4px;
  padding: 10px;
  border: 1px solid rgba(255, 255, 255, 0.09);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.055);
}

.result-stat span {
  color: #8f9695;
  font-size: 12px;
  font-weight: 900;
}

.result-stat b {
  color: #eaf6ef;
  font-size: 24px;
  font-weight: 1000;
}

.result-actions {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  width: 100%;
}

.result-btn {
  min-height: 58px;
  border-radius: 15px;
  background: rgba(255, 255, 255, 0.08);
  color: #e8eceb;
  font-size: 17px;
  font-weight: 1000;
}

.result-btn.primary {
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.16), transparent 48%),
    linear-gradient(180deg, #54e9a7, #27b878);
  color: #09241a;
}

.game-shell.style-candy {
  --green: #ff4f96;
  --green-2: #007f86;
  --red: #ff6d72;
  --red-2: #c9305a;
  --gold: #ffd33f;
  --muted: #667085;
  color: #26323c;
  background:
    radial-gradient(circle at 16% 8%, rgba(255, 211, 63, 0.48), transparent 27%),
    radial-gradient(circle at 86% 18%, rgba(48, 210, 214, 0.34), transparent 30%),
    linear-gradient(180deg, #fff7fb 0%, #e8fbff 52%, #fff4d8 100%);
  box-shadow: 0 28px 72px rgba(43, 75, 98, 0.28);
}

.game-shell.style-candy::before {
  background:
    radial-gradient(circle at 24px 24px, rgba(255, 79, 150, 0.16) 0 5px, transparent 6px),
    radial-gradient(circle at 72px 54px, rgba(0, 170, 180, 0.14) 0 4px, transparent 5px);
  background-size: 92px 92px;
}

.game-shell.style-candy::after {
  box-shadow:
    inset 0 -100px 130px rgba(255, 181, 56, 0.13);
}

.game-shell.style-paper {
  --green: #188f70;
  --green-2: #3e6f96;
  --red: #ee5f5a;
  --red-2: #a33a48;
  --gold: #d69a20;
  --muted: #6e7b86;
  color: #213a3a;
  background:
    linear-gradient(135deg, rgba(41, 166, 127, 0.1), transparent 34%),
    linear-gradient(180deg, #f9fcf8 0%, #ecf8f3 50%, #e7f0ff 100%);
  box-shadow: 0 26px 76px rgba(30, 73, 91, 0.23);
}

.game-shell.style-paper::before {
  background:
    linear-gradient(90deg, rgba(24, 143, 112, 0.08) 1px, transparent 1px),
    linear-gradient(0deg, rgba(62, 111, 150, 0.07) 1px, transparent 1px);
  background-size: 28px 28px;
}

.game-shell.style-paper::after {
  box-shadow:
    inset 0 -120px 140px rgba(62, 111, 150, 0.08);
}

.game-shell.style-neon {
  --green: #3df5e0;
  --green-2: #91a7ff;
  --red: #ff4f9a;
  --red-2: #b32675;
  --gold: #ffd65a;
  --muted: #9ea7c6;
  color: #eef7ff;
  background:
    radial-gradient(circle at 14% 12%, rgba(255, 79, 154, 0.27), transparent 28%),
    radial-gradient(circle at 86% 2%, rgba(61, 245, 224, 0.22), transparent 30%),
    linear-gradient(180deg, #17122d 0%, #101528 54%, #0b0f1f 100%);
  box-shadow: 0 30px 88px rgba(16, 20, 42, 0.58);
}

.game-shell.style-neon::before {
  background:
    linear-gradient(90deg, rgba(61, 245, 224, 0.08) 1px, transparent 1px),
    linear-gradient(0deg, rgba(255, 79, 154, 0.07) 1px, transparent 1px),
    linear-gradient(120deg, transparent 0 44%, rgba(255, 214, 90, 0.08) 45% 46%, transparent 47% 100%);
  background-size: 28px 28px, 28px 28px, 120px 120px;
}

.game-shell.style-neon::after {
  box-shadow:
    inset 0 -140px 170px rgba(4, 6, 15, 0.36);
}

.style-candy .app-mark,
.style-paper .app-mark,
.style-neon .app-mark {
  color: var(--green);
  background: rgba(255, 255, 255, 0.52);
}

.style-candy .app-mark {
  border-color: rgba(255, 79, 150, 0.4);
}

.style-paper .app-mark {
  border-color: rgba(24, 143, 112, 0.36);
}

.style-neon .app-mark {
  border-color: rgba(61, 245, 224, 0.46);
  background: rgba(12, 16, 34, 0.7);
}

.style-candy .start-title {
  color: #ff4f96;
  text-shadow:
    0 4px 0 rgba(255, 211, 63, 0.72),
    0 12px 30px rgba(255, 79, 150, 0.2);
}

.style-paper .start-title {
  color: #188f70;
  text-shadow:
    0 3px 0 rgba(74, 119, 142, 0.22),
    0 14px 28px rgba(24, 143, 112, 0.12);
}

.style-neon .start-title {
  color: #e9feff;
  text-shadow:
    0 4px 0 rgba(255, 79, 154, 0.55),
    0 0 28px rgba(61, 245, 224, 0.42);
}

.style-candy .start-subtitle,
.style-paper .start-subtitle,
.style-candy .theme-box > span,
.style-paper .theme-box > span,
.style-candy .account-box > span,
.style-paper .account-box > span,
.style-candy .style-box > span,
.style-paper .style-box > span {
  color: #40505a;
}

.style-neon .start-subtitle,
.style-neon .theme-box > span,
.style-neon .account-box > span,
.style-neon .style-box > span {
  color: #c8d2ff;
}

.style-candy .theme-box button,
.style-candy .player-summary,
.style-candy .setting-btn,
.style-candy .leaderboard-button,
.style-candy .profile-preview,
.style-candy .profile-name,
.style-candy .avatar-option,
.style-candy .theme-book,
.style-candy .leaderboard,
.style-candy .style-option,
.style-paper .theme-box button,
.style-paper .player-summary,
.style-paper .setting-btn,
.style-paper .leaderboard-button,
.style-paper .profile-preview,
.style-paper .profile-name,
.style-paper .avatar-option,
.style-paper .theme-book,
.style-paper .leaderboard,
.style-paper .style-option {
  border-color: rgba(58, 91, 112, 0.13);
  background: rgba(255, 255, 255, 0.74);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.8),
    0 10px 22px rgba(48, 76, 92, 0.1);
}

.style-neon .theme-box button,
.style-neon .player-summary,
.style-neon .setting-btn,
.style-neon .leaderboard-button,
.style-neon .profile-preview,
.style-neon .profile-name,
.style-neon .avatar-option,
.style-neon .theme-book,
.style-neon .leaderboard,
.style-neon .style-option {
  border-color: rgba(61, 245, 224, 0.18);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.09), rgba(255, 255, 255, 0.02)),
    rgba(15, 19, 42, 0.82);
}

.style-candy .theme-tabs,
.style-paper .theme-tabs {
  background: rgba(53, 76, 88, 0.08);
}

.style-candy .theme-screen,
.style-paper .theme-screen {
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.58), transparent 35%),
    rgba(247, 251, 249, 0.98);
}

.style-candy .theme-bottom-nav,
.style-paper .theme-bottom-nav {
  border-color: rgba(58, 91, 112, 0.12);
  background: rgba(255, 255, 255, 0.82);
}

.style-candy .theme-back,
.style-paper .theme-back {
  background: rgba(55, 96, 112, 0.08);
  color: #26323c;
}

.style-neon .theme-tabs {
  background: rgba(0, 0, 0, 0.2);
}

.style-candy .profile-name,
.style-paper .profile-name {
  color: #26323c;
}

.style-candy .player-summary b,
.style-paper .player-summary b,
.style-candy .leaderboard-row b,
.style-paper .leaderboard-row b,
.style-candy .theme-option b,
.style-paper .theme-option b {
  color: #26323c;
}

.style-candy .theme-box i,
.style-candy .setting-btn i,
.style-candy .leaderboard-button i,
.style-candy .player-summary i,
.style-candy .style-option i,
.style-paper .theme-box i,
.style-paper .setting-btn i,
.style-paper .leaderboard-button i,
.style-paper .player-summary i,
.style-paper .style-option i {
  color: #667085;
}

.style-candy .style-option b,
.style-candy .setting-btn b,
.style-candy .leaderboard-button b,
.style-paper .setting-btn b,
.style-paper .leaderboard-button b,
.style-paper .style-option b {
  color: #26323c;
}

.style-candy .theme-option.active,
.style-candy .style-option.active {
  border-color: rgba(255, 79, 150, 0.5);
  background:
    linear-gradient(180deg, rgba(255, 79, 150, 0.16), rgba(255, 211, 63, 0.12)),
    rgba(255, 255, 255, 0.74);
}

.style-paper .theme-option.active,
.style-paper .style-option.active {
  border-color: rgba(24, 143, 112, 0.5);
  background:
    linear-gradient(180deg, rgba(24, 143, 112, 0.14), rgba(62, 111, 150, 0.1)),
    rgba(255, 255, 255, 0.72);
}

.style-neon .theme-option.active,
.style-neon .style-option.active {
  border-color: rgba(61, 245, 224, 0.55);
  background:
    linear-gradient(180deg, rgba(61, 245, 224, 0.17), rgba(255, 79, 154, 0.07)),
    rgba(12, 17, 39, 0.9);
}

.style-candy .start-btn {
  border-color: rgba(255, 79, 150, 0.45);
  background:
    linear-gradient(180deg, #ff86bd, #ff4f96);
  color: #fff;
  box-shadow: 0 15px 28px rgba(255, 79, 150, 0.22);
}

.style-paper .start-btn {
  border-color: rgba(24, 143, 112, 0.28);
  background:
    linear-gradient(180deg, #2fc696, #188f70);
  color: #f6fffb;
  box-shadow: 0 14px 28px rgba(24, 143, 112, 0.18);
}

.style-neon .start-btn {
  border-color: rgba(61, 245, 224, 0.5);
  background:
    linear-gradient(90deg, #32e7da, #ff4f9a);
  color: #071023;
  box-shadow: 0 0 28px rgba(61, 245, 224, 0.22);
}

.style-candy .combat-hud,
.style-paper .combat-hud,
.style-candy .board-wrap,
.style-paper .board-wrap {
  border-color: rgba(60, 92, 112, 0.12);
}

.style-candy .portrait,
.style-paper .portrait {
  background: rgba(255, 255, 255, 0.8);
}

.style-candy .cell,
.style-candy .hand-slot,
.style-paper .cell,
.style-paper .hand-slot {
  background: rgba(255, 255, 255, 0.58);
  box-shadow:
    inset 0 0 0 1px rgba(51, 76, 90, 0.08),
    0 8px 16px rgba(50, 73, 90, 0.08);
}

.style-candy .cell.open,
.style-paper .cell.open,
.style-candy .tile,
.style-paper .tile,
.style-candy .template-row b span,
.style-paper .template-row b span,
.style-candy .char-list span,
.style-paper .char-list span,
.style-candy .combo-list span,
.style-paper .combo-list span {
  background:
    linear-gradient(180deg, #ffffff, #eef7f4);
  color: #20313a;
}

.style-candy .draw-btn {
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.24), transparent 46%),
    linear-gradient(180deg, #ffdb54, #ff8b4a);
  color: #3a2504;
  box-shadow: 0 13px 24px rgba(255, 139, 74, 0.18);
}

.style-paper .draw-btn {
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.24), transparent 46%),
    linear-gradient(180deg, #43d0a1, #188f70);
  color: #07251c;
}

.style-neon .draw-btn {
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.2), transparent 46%),
    linear-gradient(90deg, #3df5e0, #91a7ff);
  color: #081025;
  box-shadow: 0 0 24px rgba(61, 245, 224, 0.18);
}

.style-candy .ration,
.style-paper .ration {
  background: rgba(255, 255, 255, 0.68);
}

.style-candy .sheet,
.style-paper .sheet {
  background: #fffdf8;
  color: #26323c;
}

.style-candy .sheet-head,
.style-paper .sheet-head {
  background: rgba(246, 251, 249, 0.96);
  border-color: rgba(57, 83, 96, 0.1);
}

.style-candy .book-row,
.style-candy .reward,
.style-paper .book-row,
.style-paper .reward {
  background: rgba(55, 96, 112, 0.07);
}

.style-candy .book-row b,
.style-candy .reward span,
.style-paper .book-row b,
.style-paper .reward span {
  color: #26323c;
}

.style-neon .sheet {
  background: #131831;
  border-color: rgba(61, 245, 224, 0.34);
}

.style-neon .sheet-head {
  background: #171d3a;
}

button:active {
  transform: translateY(1px) scale(0.99);
}

@keyframes lunge {
  50% {
    transform: translateX(12px) translateY(-2px);
  }
}

@keyframes shake {
  0%,
  100% {
    transform: translateX(0);
  }
  35% {
    transform: translateX(-5px);
  }
  70% {
    transform: translateX(4px);
  }
}

@keyframes combo-candidate-tremble {
  0%,
  100% {
    transform: translateX(0) rotate(0deg);
  }
  18% {
    transform: translateX(-1px) rotate(-0.7deg);
  }
  36% {
    transform: translateX(1px) rotate(0.7deg);
  }
  54% {
    transform: translateX(-0.5px) rotate(-0.35deg);
  }
  72% {
    transform: translateX(0.5px) rotate(0.35deg);
  }
}

@keyframes combo-icon-throw {
  0% {
    opacity: 0;
    transform: translate(0, 18px) scale(0.55) rotate(-14deg);
  }
  12% {
    opacity: 1;
  }
  52% {
    opacity: 1;
    transform: translate(var(--mid-x), calc(-54px + var(--lane-y, 0px))) scale(1.12) rotate(10deg);
  }
  82% {
    opacity: 1;
    transform: translate(var(--travel-x), calc(-6px + var(--impact-y, 0px))) scale(0.92) rotate(24deg);
  }
  100% {
    opacity: 0;
    transform: translate(var(--travel-x), calc(4px + var(--impact-y, 0px))) scale(0.74) rotate(32deg);
  }
}

@keyframes rise {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  20% {
    opacity: 1;
  }
  to {
    opacity: 0;
    transform: translateY(-36px);
  }
}

@keyframes pop {
  from {
    opacity: 0;
    transform: translateX(-50%) scale(0.92);
  }
  25% {
    opacity: 1;
  }
  to {
    opacity: 0;
    transform: translateX(-50%) translateY(-12px) scale(1);
  }
}

@keyframes toast {
  0% {
    opacity: 0;
    transform: translateX(-50%) translateY(10px);
  }
  18%,
  78% {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
  }
  100% {
    opacity: 0;
    transform: translateX(-50%) translateY(6px);
  }
}

@media (max-width: 430px) {
  .game-shell {
    width: 100%;
    max-width: 100%;
    border-radius: 0;
  }

  .start-shell {
    padding-left: 38px;
    padding-right: 38px;
  }

  .style-grid {
    gap: 8px;
  }

  .style-option {
    min-height: 62px;
    padding: 9px 10px;
  }

  .style-option b {
    font-size: 16px;
  }

  .battle-shell {
    grid-template-rows: 232px 1fr 220px;
  }
}

@media (max-height: 920px) {
  .start-shell {
    padding-top: calc(22px + var(--safe-top));
    padding-bottom: calc(22px + var(--safe-bottom));
  }

  .start-card {
    gap: 12px;
  }

  .app-mark {
    width: 76px;
    height: 76px;
    font-size: 42px;
  }

  .start-title {
    font-size: 46px;
  }

  .start-subtitle {
    margin: -6px 0 2px;
    font-size: 15px;
  }

  .theme-box button {
    min-height: 58px;
  }

  .theme-box b {
    font-size: 22px;
  }

  .style-option {
    min-height: 54px;
  }

  .account-row {
    min-height: 52px;
  }

  .profile-preview,
  .profile-name {
    height: 52px;
  }

  .profile-preview {
    width: 52px;
    font-size: 26px;
  }

  .profile-name {
    font-size: 18px;
  }

  .start-btn {
    min-height: 58px;
    font-size: 23px;
  }

  .online-btn {
    min-height: 56px;
  }

  .result-screen {
    padding-top: calc(54px + var(--safe-top));
    gap: 10px;
  }

  .result-screen h2 {
    font-size: 78px;
  }

  .result-screen p {
    margin-bottom: 10px;
  }

  .result-stat {
    min-height: 62px;
  }
}

@media (max-height: 820px) {
  .start-card {
    gap: 10px;
  }

  .app-mark {
    width: 68px;
    height: 68px;
    font-size: 38px;
  }

  .start-subtitle {
    margin-bottom: 0;
  }

  .theme-box button {
    min-height: 52px;
  }

  .style-option {
    min-height: 48px;
  }

  .start-btn {
    min-height: 54px;
  }

  .battle-shell {
    grid-template-rows: minmax(155px, 1fr) auto 210px;
  }

  .combat-hud {
    grid-template-columns: minmax(0, 1fr) 54px minmax(0, 1fr);
    padding: calc(22px + var(--safe-top)) 12px 12px;
  }

  .portrait {
    width: min(23vw, 96px);
    height: 60px;
    font-size: 34px;
  }

  .unit-name {
    width: min(24vw, 104px);
  }

  .unit-name b {
    font-size: 12px;
  }

  .versus {
    margin-top: 28px;
    font-size: 30px;
  }

  .hpbar,
  .enemy-hp {
    width: min(25vw, 110px);
    height: 15px;
  }

  .attackbar {
    width: min(21vw, 90px);
  }

  .bottom-dock {
    gap: 12px;
    padding-top: 16px;
  }

  .grid {
    gap: 7px;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 1ms !important;
    transition-duration: 1ms !important;
  }

  .cell.combo-candidate .tile,
  .hand-slot.combo-candidate .tile,
  .match-entering .player-card,
  .match-entering .match-random-card,
  .match-flipping .enemy-card,
  .attack-projectile {
    animation: none !important;
  }
}

.game-shell.start-shell {
  display: block;
  padding: 0;
  background: #f7e7ae var(--asset-bg-main, url("./assets/tex_bg_main.jpg")) center / cover no-repeat;
}

.game-shell.start-shell::before,
.game-shell.start-shell::after {
  content: none;
}

.game-shell.start-shell .player-summary {
  left: 7.8%;
  top: calc(4.7% + var(--safe-top));
  width: min(33%, 165px);
  aspect-ratio: 329 / 149;
  min-height: 0;
  grid-template-columns: 33% minmax(0, 1fr);
  gap: 4px;
  padding: 8px 13px 9px 8px;
  border: 0;
  border-radius: 0;
  background: var(--asset-profile-bg, url("./assets/start@namebg.png")) center / contain no-repeat;
  box-shadow: none;
}

.start-card {
  position: absolute;
  inset: 0;
  display: block;
  width: 100%;
}

.start-card .app-mark,
.start-card .start-title,
.start-card .start-subtitle {
  display: none;
}

.start-card .mode-actions {
  position: absolute;
  left: 50%;
  top: 58%;
  width: min(82.4%, 412px);
  display: grid;
  gap: min(2.4svh, 24px);
  transform: translateX(-50%);
}

.start-card .start-btn {
  display: block;
  width: 100%;
  min-height: 0;
  aspect-ratio: 822 / 215;
  margin: 0;
  border: 0;
  border-radius: 0;
  background: center / contain no-repeat;
  box-shadow: none;
  color: transparent;
  font-size: 0;
  text-indent: -9999px;
}

.start-card .start-btn > * {
  display: none;
}

.start-card .start-single-btn {
  display: none;
  background-image: var(--asset-start-single, url("./assets/common@start_single.png"));
}

.start-card .start-pvp-btn {
  aspect-ratio: 814 / 214;
  background-image: var(--asset-start-pvp, url("./assets/common@start_pvp.png"));
}

.start-card .start-btn:disabled {
  opacity: 0.66;
  filter: grayscale(0.18);
}

.start-card .settings-actions {
  display: none;
}

.start-card .setting-btn,
.start-card .leaderboard-button,
.start-card .task-button {
  position: absolute;
  bottom: calc(3.2% + var(--safe-bottom));
  width: min(18.2%, 91px);
  height: min(9.2%, 92px);
  min-height: 0;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: center / contain no-repeat;
  box-shadow: none;
  color: transparent;
  font-size: 0;
  text-indent: -9999px;
}

.start-card .setting-btn b,
.start-card .setting-btn i,
.start-card .leaderboard-button b,
.start-card .leaderboard-button i {
  display: none;
}

.start-card .setting-btn:first-child {
  left: 18%;
  transform: translateX(-50%);
  background-image: var(--asset-btn-book, url("./assets/common@btn_book.png"));
}

.start-card .setting-btn:nth-child(2) {
  left: 60%;
  transform: translateX(-50%);
  background-image: var(--asset-btn-achievement, url("./assets/common@btn_chengjiu.png"));
}

.start-card .leaderboard-button {
  left: 39%;
  transform: translateX(-50%);
  background-image: var(--asset-btn-rank, url("./assets/common@btn_rank.png"));
}

.start-card .task-button {
  left: 81%;
  transform: translateX(-50%);
  background-image: var(--asset-btn-task, url("./assets/common@btn_task.png"));
}

.start-card .task-button {
  display: none;
}

.rank-book-actions {
  display: grid;
  grid-template-columns: minmax(0, 1.85fr) minmax(86px, 1fr);
  grid-template-areas: "rank book";
  gap: 12px;
  align-items: stretch;
}

.rank-book-actions.has-goose-entry {
  grid-template-areas:
    "rank book"
    "goose goose";
}

.start-card .rank-entry-button {
  grid-area: rank;
  min-height: clamp(58px, 13.4vw, 74px);
}

.start-card .book-entry-button {
  grid-area: book;
  min-width: 0;
  min-height: clamp(58px, 13.4vw, 74px);
}

.start-card .goose-entry-button {
  grid-area: goose;
  min-height: clamp(58px, 13.4vw, 74px);
}

.rank-entry-button,
.goose-entry-button {
  width: 100%;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  border: 2px solid rgba(126, 83, 35, 0.22);
  border-radius: 13px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.62), rgba(255, 236, 178, 0.5)),
    rgba(129, 79, 28, 0.28);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.74),
    0 8px 18px rgba(101, 59, 19, 0.16);
  text-align: left;
}

.goose-entry-button {
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.7), rgba(255, 226, 159, 0.6)),
    linear-gradient(135deg, rgba(226, 107, 63, 0.34), rgba(111, 166, 77, 0.26));
}

.book-entry-button {
  width: 100%;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 8px 10px;
  border: 2px solid rgba(126, 83, 35, 0.22);
  border-radius: 13px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.62), rgba(255, 236, 178, 0.5)),
    rgba(129, 79, 28, 0.2);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.74),
    0 8px 18px rgba(101, 59, 19, 0.14);
}

.book-entry-button img {
  width: clamp(38px, 9vw, 50px);
  height: clamp(38px, 9vw, 50px);
  object-fit: contain;
}

.book-entry-button b {
  min-width: 0;
  overflow: hidden;
  color: #704320;
  font-size: clamp(15px, 3.8vw, 18px);
  font-weight: 1000;
  line-height: 1.1;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.goose-entry-button span,
.rank-entry-button img {
  width: clamp(42px, 10vw, 56px);
  height: clamp(42px, 10vw, 56px);
}

.goose-entry-button span {
  display: grid;
  place-items: center;
  border-radius: 999px;
  background: linear-gradient(180deg, #fff7cf, #f0b85a);
  color: #7a3f1f;
  font-size: clamp(23px, 5.8vw, 31px);
  font-weight: 1000;
  box-shadow:
    inset 0 2px 0 rgba(255, 255, 255, 0.76),
    0 4px 8px rgba(117, 64, 22, 0.16);
}

.rank-entry-button img {
  object-fit: contain;
}

.rank-entry-button span {
  min-width: 0;
  display: grid;
  gap: 3px;
}

.goose-entry-button span {
  grid-row: 1 / span 2;
}

.goose-entry-button b,
.goose-entry-button i {
  grid-column: 2;
}

.rank-entry-button b,
.rank-entry-button i,
.goose-entry-button b,
.goose-entry-button i {
  min-width: 0;
  overflow: hidden;
  color: #704320;
  font-style: normal;
  font-weight: 1000;
  line-height: 1.1;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.rank-entry-button b {
  font-size: clamp(15px, 3.6vw, 18px);
}

.goose-entry-button b {
  align-self: end;
  font-size: clamp(15px, 3.6vw, 18px);
}

.rank-entry-button i,
.goose-entry-button i {
  color: #9a6630;
  font-size: clamp(11px, 2.7vw, 13px);
}

.rank-fullscreen {
  padding: 0;
  place-items: stretch;
  background: transparent;
  -webkit-backdrop-filter: none;
  backdrop-filter: none;
}

.rank-fullscreen::before {
  content: none;
}

.rank-screen {
  width: 100%;
  height: 100%;
  min-height: 0;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  background:
    url("./assets/tex_battle_main_bg.jpg") center / cover no-repeat,
    #fff6d9;
  color: #70421f;
}

.rank-screen-head {
  display: grid;
  gap: 6px;
  padding: calc(30px + var(--safe-top)) 26px 14px;
}

.rank-screen-head b {
  color: #fff3c1;
  font-size: 36px;
  font-weight: 1000;
  line-height: 1;
  letter-spacing: 0;
  text-shadow:
    0 3px 0 #8b5428,
    3px 0 0 #8b5428,
    -3px 0 0 #8b5428,
    0 -3px 0 #8b5428,
    0 7px 0 rgba(188, 112, 36, 0.24),
    0 10px 18px rgba(143, 81, 25, 0.24);
}

.rank-screen-head span {
  color: #7a4b2e;
  font-size: 18px;
  font-weight: 1000;
  text-shadow: 0 1px 0 rgba(255, 244, 197, 0.9);
}

.rank-screen-body {
  min-height: 0;
  overflow: auto;
  scroll-padding: 118px 0 92px;
  padding: 0 26px 14px;
}

.rank-panel {
  position: relative;
  min-height: 0;
  display: grid;
  gap: 0;
}

.rank-current-card {
  position: sticky;
  top: 0;
  z-index: 3;
  display: grid;
  grid-template-columns: 78px minmax(0, 1fr);
  align-items: center;
  gap: 16px;
  min-height: 118px;
  padding: 16px 24px;
  border: 2px solid rgba(239, 185, 83, 0.78);
  border-radius: 24px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.64), transparent 52%),
    rgba(255, 246, 214, 0.88);
  box-shadow:
    inset 0 0 0 2px rgba(255, 255, 255, 0.48),
    0 12px 22px rgba(190, 123, 35, 0.13);
}

.rank-current-card img {
  width: 78px;
  height: 78px;
  object-fit: contain;
}

.rank-current-card div {
  min-width: 0;
  display: grid;
  gap: 3px;
}

.rank-current-card b {
  overflow: hidden;
  color: #70421f;
  font-size: 26px;
  font-weight: 1000;
  line-height: 1.1;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.rank-current-card span {
  color: #9d6a2f;
  font-size: 18px;
  font-weight: 1000;
}

.rank-current-card i {
  grid-column: 1 / -1;
  height: 12px;
  overflow: hidden;
  border-radius: 999px;
  border: 2px solid rgba(216, 154, 67, 0.28);
  background: rgba(233, 185, 117, 0.26);
}

.rank-current-card i::before {
  content: "";
  display: block;
  width: var(--rank-step);
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #56c960, #96df67 62%, #ffe05f);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.58);
}

.rank-list {
  position: relative;
  display: grid;
  gap: 8px;
  padding: 14px 0 10px;
}

.rank-list::before,
.rank-list::after {
  content: "";
  position: absolute;
  left: 44px;
  width: 10px;
}

.rank-list::before {
  top: -14px;
  bottom: 32px;
  border-radius: 0 0 999px 999px;
  background:
    linear-gradient(180deg, rgba(255, 245, 195, 0.9), rgba(230, 166, 69, 0.8)),
    rgba(239, 185, 83, 0.54);
  box-shadow:
    inset 0 0 0 2px rgba(255, 244, 197, 0.42),
    0 2px 8px rgba(181, 109, 24, 0.14);
}

.rank-list::after {
  bottom: 32px;
  height: var(--rank-total);
  max-height: calc(100% - 42px);
  border-radius: 0 0 999px 999px;
  background:
    linear-gradient(90deg, rgba(255, 255, 255, 0.5), transparent 48%),
    linear-gradient(180deg, #ffe061, #9bdd68 44%, #55c85c);
  box-shadow:
    inset 0 0 0 2px rgba(255, 255, 255, 0.42),
    0 3px 10px rgba(122, 83, 30, 0.16);
}

.rank-row {
  position: relative;
  z-index: 1;
  width: calc(100% - 102px);
  min-height: 72px;
  margin-left: auto;
  display: grid;
  grid-template-columns: 54px minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  padding: 10px 16px;
  border: 2px solid rgba(239, 185, 83, 0.42);
  border-radius: 18px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.62), transparent 56%),
    rgba(255, 248, 225, 0.78);
  box-shadow:
    inset 0 0 0 1px rgba(255, 255, 255, 0.54),
    0 8px 16px rgba(190, 123, 35, 0.09);
}

.rank-row::before {
  content: "";
  position: absolute;
  right: 100%;
  top: 50%;
  width: 44px;
  height: 7px;
  border-radius: 999px 0 0 999px;
  background: rgba(230, 166, 69, 0.46);
  transform: translateY(-50%);
}

.rank-row::after {
  content: "";
  position: absolute;
  right: calc(100% + 42px);
  top: 50%;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  border: 4px solid rgba(255, 235, 158, 0.9);
  background: #d99330;
  box-shadow:
    inset 0 0 0 5px rgba(181, 109, 24, 0.38),
    0 4px 8px rgba(151, 88, 18, 0.14);
  transform: translateY(-50%);
}

.rank-row.active {
  border-color: rgba(239, 185, 83, 0.72);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.66), transparent 48%),
    rgba(255, 236, 167, 0.9);
  box-shadow:
    inset 0 0 0 2px rgba(255, 255, 255, 0.48),
    0 0 0 4px rgba(255, 215, 111, 0.2),
    0 12px 22px rgba(190, 123, 35, 0.14);
}

.rank-row.active::before {
  background: linear-gradient(90deg, #67cf61, #ffe05f);
  box-shadow: none;
}

.rank-row.active::after {
  border-color: rgba(255, 241, 160, 0.92);
  background: #67cf61;
  box-shadow:
    inset 0 0 0 5px rgba(255, 249, 207, 0.54),
    0 4px 8px rgba(90, 153, 58, 0.18);
}

.rank-row.active b {
  color: #70421f;
}

.rank-row.active span {
  color: #9d6a2f;
}

.rank-row.active strong {
  color: #42a95d;
}

.rank-row.unlocked:not(.active)::before {
  background: rgba(103, 207, 97, 0.58);
}

.rank-row.unlocked:not(.active)::after {
  background: #70c95f;
}

.rank-row.locked {
  opacity: 0.74;
}

.rank-row img {
  width: 54px;
  height: 54px;
  object-fit: contain;
}

.rank-row div {
  min-width: 0;
  display: grid;
  gap: 3px;
}

.rank-row b,
.rank-row span,
.rank-row strong {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.rank-row b {
  color: #70421f;
  font-size: 19px;
  font-weight: 1000;
}

.rank-row span {
  color: #b57a37;
  font-size: 14px;
  font-weight: 900;
}

.rank-row strong {
  color: #45a95e;
  font-size: 14px;
  font-weight: 1000;
}

.rank-row.locked strong {
  color: rgba(125, 78, 36, 0.58);
}

.rank-bottom-nav {
  display: grid;
  grid-template-columns:
    var(--ui-bottom-nav-return-column)
    var(--ui-bottom-nav-main-column)
    var(--ui-bottom-nav-main-column);
  gap: 6px;
  align-items: stretch;
  margin: 6px 22px calc(10px + var(--safe-bottom));
  padding: 6px;
  border: 2px solid rgba(117, 67, 27, 0.56);
  border-radius: 22px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.2), transparent 42%),
    linear-gradient(180deg, #c99a5f, #8c5c31);
  box-shadow:
    inset 0 0 0 3px rgba(91, 52, 23, 0.28),
    0 6px 14px rgba(119, 69, 26, 0.18);
}

.rank-back,
.rank-tabs button {
  min-width: 0;
  min-height: var(--ui-bottom-nav-button-height);
  border-radius: var(--ui-bottom-nav-button-radius);
  font-size: var(--ui-bottom-nav-button-font);
  font-weight: 1000;
}

.rank-back {
  border: 2px solid rgba(118, 72, 33, 0.36);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.18), transparent 48%),
    linear-gradient(180deg, #b9874f, #875a32);
  color: #fff6d0;
  box-shadow:
    inset 0 2px 0 rgba(255, 232, 171, 0.32),
    inset 0 -3px 0 rgba(94, 53, 23, 0.18);
}

.rank-tabs {
  display: contents;
}

.rank-tabs button {
  border: 2px solid rgba(118, 72, 33, 0.36);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.18), transparent 48%),
    linear-gradient(180deg, #b9874f, #875a32);
  color: #fff6d0;
  box-shadow:
    inset 0 2px 0 rgba(255, 232, 171, 0.32),
    inset 0 -3px 0 rgba(94, 53, 23, 0.18);
}

.rank-tabs button.active {
  box-shadow:
    inset 0 0 0 2px rgba(255, 255, 255, 0.6),
    inset 0 -3px 0 rgba(224, 169, 66, 0.18),
    0 4px 10px rgba(116, 67, 25, 0.12);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.68), transparent 48%),
    linear-gradient(180deg, #fff2b8, #f8d36d);
  color: #70421f;
}

.rank-screen .leaderboard {
  min-height: 100%;
  align-content: start;
  gap: 12px;
  padding: 24px 18px 118px;
  border: 2px solid rgba(239, 185, 83, 0.58);
  border-radius: 28px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.66), transparent 50%),
    rgba(255, 247, 218, 0.82);
  box-shadow:
    inset 0 0 0 2px rgba(255, 255, 255, 0.48),
    0 12px 22px rgba(190, 123, 35, 0.1);
}

.rank-screen .leaderboard-row {
  grid-template-columns: 34px 52px minmax(0, 1fr) minmax(112px, 34%) 42px;
  gap: 10px;
  min-height: 68px;
  padding: 10px 14px;
  border: 2px solid rgba(239, 185, 83, 0.3);
  border-radius: 16px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.7), transparent 54%),
    rgba(255, 249, 226, 0.78);
  box-shadow:
    inset 0 0 0 1px rgba(255, 255, 255, 0.58),
    0 8px 16px rgba(190, 123, 35, 0.08);
}

.rank-screen .leaderboard-row.current-player {
  border-color: rgba(239, 185, 83, 0.72);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.66), transparent 48%),
    rgba(255, 236, 167, 0.9);
  box-shadow:
    inset 0 0 0 2px rgba(255, 255, 255, 0.48),
    0 0 0 4px rgba(255, 215, 111, 0.2),
    0 12px 22px rgba(190, 123, 35, 0.14);
}

.rank-screen .leaderboard-avatar {
  width: 46px;
  height: 46px;
  background: rgba(255, 232, 166, 0.54);
  font-size: 26px;
}

.rank-screen .leaderboard-row > i {
  color: #a8793d;
  font-size: 18px;
  font-weight: 1000;
}

.rank-screen .leaderboard-player b {
  color: #70421f;
  font-size: 18px;
}

.rank-screen .leaderboard-rank b {
  color: #8a5a2c;
  font-size: 15px;
}

.rank-screen .leaderboard-rank img {
  width: 32px;
  height: 32px;
}

.rank-screen .leaderboard-row strong {
  color: #b6772d;
  font-size: 20px;
}

.rank-screen .leaderboard-scope-tabs {
  position: absolute;
  left: 9%;
  right: 9%;
  bottom: calc(var(--ui-bottom-nav-button-height) + 34px + var(--safe-bottom));
  z-index: 7;
  gap: 10px;
  margin-top: 0;
}

.rank-screen .leaderboard-scope-tabs button {
  min-height: 52px;
  border: 2px solid rgba(118, 72, 33, 0.28);
  border-radius: 16px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.44), transparent 48%),
    linear-gradient(180deg, #f6d89a, #dfaa58);
  color: #805328;
  font-size: 17px;
  font-weight: 1000;
  box-shadow:
    inset 0 2px 0 rgba(255, 255, 255, 0.48),
    inset 0 -3px 0 rgba(155, 99, 37, 0.12);
}

.rank-screen .leaderboard-scope-tabs button.active {
  border-color: rgba(149, 111, 49, 0.42);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.66), transparent 48%),
    linear-gradient(180deg, #d5eb91, #9cc657);
  color: #fffaf0;
  text-shadow: 0 2px 0 rgba(86, 119, 38, 0.34);
  box-shadow:
    inset 0 2px 0 rgba(255, 255, 255, 0.5),
    inset 0 -4px 0 rgba(82, 114, 37, 0.14),
    0 8px 14px rgba(123, 82, 28, 0.12);
}

@media (max-width: 560px) {
  .rank-screen-head {
    padding: calc(22px + var(--safe-top)) 16px 10px;
  }

  .rank-screen-head b {
    font-size: 32px;
    text-shadow:
      0 2px 0 #8b5428,
      2px 0 0 #8b5428,
      -2px 0 0 #8b5428,
      0 -2px 0 #8b5428,
      0 6px 0 rgba(188, 112, 36, 0.22),
      0 8px 14px rgba(143, 81, 25, 0.2);
  }

  .rank-screen-head span {
    font-size: 15px;
  }

  .rank-screen-body {
    padding: 0 14px 10px;
  }

  .rank-current-card {
    grid-template-columns: 58px minmax(0, 1fr);
    gap: 12px;
    min-height: 100px;
    padding: 12px 16px;
    border-radius: 20px;
  }

  .rank-current-card img {
    width: 58px;
    height: 58px;
  }

  .rank-current-card b {
    font-size: 22px;
  }

  .rank-current-card span {
    font-size: 15px;
  }

  .rank-current-card i {
    height: 10px;
  }

  .rank-list::before,
  .rank-list::after {
    left: 34px;
    width: 8px;
  }

  .rank-row {
    width: calc(100% - 78px);
    min-height: 64px;
    grid-template-columns: 44px minmax(0, 1fr) auto;
    gap: 8px;
    padding: 8px 10px;
    border-radius: 15px;
  }

  .rank-row::before {
    width: 32px;
    height: 6px;
  }

  .rank-row::after {
    right: calc(100% + 31px);
    width: 18px;
    height: 18px;
    border-width: 3px;
  }

  .rank-row img {
    width: 44px;
    height: 44px;
  }

  .rank-row b {
    font-size: 16px;
  }

  .rank-row span,
  .rank-row strong {
    font-size: 12px;
  }

  .rank-screen .leaderboard {
    padding: 16px 10px 96px;
    border-radius: 22px;
  }

  .rank-screen .leaderboard-row {
    grid-template-columns: 24px 42px minmax(0, 1fr) minmax(88px, 34%) 32px;
    gap: 7px;
    min-height: 60px;
    padding: 8px 9px;
    border-radius: 14px;
  }

  .rank-screen .leaderboard-avatar {
    width: 38px;
    height: 38px;
    font-size: 22px;
  }

  .rank-screen .leaderboard-row > i {
    font-size: 15px;
  }

  .rank-screen .leaderboard-player b {
    font-size: 15px;
  }

  .rank-screen .leaderboard-rank {
    gap: 6px;
  }

  .rank-screen .leaderboard-rank img {
    width: 28px;
    height: 28px;
  }

  .rank-screen .leaderboard-rank b {
    font-size: 12px;
  }

  .rank-screen .leaderboard-row strong {
    font-size: 16px;
  }

  .rank-screen .leaderboard-scope-tabs {
    left: 9%;
    right: 9%;
    bottom: calc(var(--ui-bottom-nav-button-height-compact) + 28px + var(--safe-bottom));
    gap: 7px;
  }

  .rank-screen .leaderboard-scope-tabs button {
    min-height: 44px;
    border-radius: 14px;
    font-size: 15px;
  }

  .rank-bottom-nav {
    margin: 6px 12px calc(8px + var(--safe-bottom));
    border-radius: 18px;
  }

  .book-fullscreen .theme-bottom-nav {
    margin: 6px 12px calc(8px + var(--safe-bottom));
    border-radius: 18px;
  }

  .rank-back,
  .rank-tabs button {
    min-height: var(--ui-bottom-nav-button-height-compact);
    border-radius: var(--ui-bottom-nav-button-radius-compact);
    font-size: var(--ui-bottom-nav-button-font-compact);
  }

  .book-fullscreen .theme-back,
  .book-fullscreen .book-fullscreen-tab {
    min-height: var(--ui-bottom-nav-button-height-compact);
    border-radius: var(--ui-bottom-nav-button-radius-compact);
    font-size: var(--ui-bottom-nav-button-font-compact);
  }
}

.profile-modal {
  padding: 28px;
  background: rgba(255, 247, 216, 0.34);
  -webkit-backdrop-filter: blur(14px) saturate(1.08);
  backdrop-filter: blur(14px) saturate(1.08);
}

.profile-modal::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.22), rgba(255, 224, 146, 0.18)),
    repeating-linear-gradient(0deg, rgba(255, 255, 255, 0.12) 0 1px, transparent 1px 8px);
  pointer-events: none;
}

.profile-sheet {
  position: relative;
  z-index: 1;
  width: min(86%, 360px);
  max-height: min(78svh, 620px);
  border: 1px solid rgba(141, 98, 45, 0.18);
  border-radius: 28px;
  background: rgba(255, 252, 234, 0.84);
  color: #6b4a22;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.72),
    0 22px 64px rgba(122, 83, 30, 0.18);
}

.profile-sheet .sheet-head {
  min-height: 58px;
  padding: 10px 12px 8px 22px;
  border-bottom: 1px solid rgba(141, 98, 45, 0.12);
  background: rgba(255, 250, 226, 0.68);
}

.profile-sheet .sheet-head b {
  color: #6b4a22;
  font-size: 20px;
  text-shadow: 0 1px 0 rgba(255, 255, 255, 0.75);
}

.profile-sheet .close-btn {
  width: 38px;
  height: 38px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.35), transparent 50%),
    linear-gradient(180deg, #ffe29b, #efb953);
  color: #7a4b2e;
  box-shadow: 0 8px 18px rgba(163, 105, 32, 0.16);
}

.profile-sheet .sheet-body {
  padding: 20px;
}

.profile-modal .account-box {
  gap: 14px;
  justify-items: center;
}

.profile-hero-preview {
  width: 100%;
  display: grid;
  place-items: center;
  padding: 6px 0 0;
}

.profile-tray-preview {
  width: min(66%, 190px);
  aspect-ratio: 260 / 154;
  display: grid;
  place-items: center;
  background: var(--profile-tray) center / contain no-repeat;
}

.profile-tray-preview img {
  width: 67.5%;
  height: 67.5%;
  object-fit: contain;
  transform: translateY(-14%);
}

.profile-modal .profile-name {
  width: min(84%, 250px);
  height: 56px;
  border: 1px solid rgba(141, 98, 45, 0.18);
  border-radius: 18px;
  background: rgba(255, 255, 247, 0.78);
  color: #6b4a22;
  font-size: 18px;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.7);
}

.profile-modal .profile-name:focus {
  border-color: rgba(239, 185, 83, 0.86);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.75),
    0 0 0 4px rgba(255, 213, 124, 0.24);
}

.profile-edit-tabs {
  width: min(84%, 250px);
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.profile-edit-tabs button {
  min-height: 38px;
  border-radius: 999px;
  background: rgba(255, 244, 205, 0.72);
  color: #8b6334;
  font-size: 15px;
  font-weight: 1000;
  box-shadow: inset 0 0 0 1px rgba(141, 98, 45, 0.12);
}

.profile-edit-tabs button.active {
  background: linear-gradient(180deg, #ffe29b, #efb953);
  color: #6a471c;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.58),
    0 6px 12px rgba(163, 105, 32, 0.14);
}

.profile-modal .avatar-grid {
  width: 100%;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}

.profile-modal .tray-grid {
  width: 100%;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.profile-modal .avatar-option,
.profile-modal .tray-option {
  position: relative;
  overflow: visible;
  border: 1px solid rgba(141, 98, 45, 0.12);
  border-radius: 20px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.28), transparent 52%),
    rgba(255, 244, 205, 0.72);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.72),
    0 8px 16px rgba(122, 83, 30, 0.1);
}

.profile-modal .tray-option {
  aspect-ratio: 260 / 154;
  min-width: 0;
}

.profile-modal .tray-option span {
  width: 100%;
  height: 100%;
  display: grid;
  place-items: center;
  background: var(--tray-preview) center / contain no-repeat;
}

.profile-modal .tray-option img {
  width: 63%;
  height: 63%;
  object-fit: contain;
  transform: translateY(-12%);
}

.profile-modal .avatar-option.active,
.profile-modal .tray-option.active {
  border-color: rgba(239, 185, 83, 0.9);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.42), transparent 50%),
    rgba(255, 224, 146, 0.86);
  box-shadow:
    inset 0 0 0 2px rgba(255, 255, 255, 0.58),
    0 0 0 4px rgba(255, 204, 101, 0.28),
    0 12px 22px rgba(163, 105, 32, 0.18);
  animation: avatar-select-pop 420ms cubic-bezier(0.2, 1.35, 0.32, 1);
}

.profile-modal .avatar-option.active::after,
.profile-modal .tray-option.active::after {
  content: "✓";
  position: absolute;
  right: -3px;
  bottom: -3px;
  width: 24px;
  height: 24px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: linear-gradient(180deg, #9ed976, #6ab648);
  color: white;
  font-size: 15px;
  font-weight: 1000;
  box-shadow: 0 5px 10px rgba(74, 122, 38, 0.24);
}

.profile-modal .avatar-option.active img {
  animation: avatar-image-wiggle 520ms ease;
}

@keyframes avatar-select-pop {
  0% {
    transform: scale(0.88);
  }
  58% {
    transform: scale(1.08);
  }
  100% {
    transform: scale(1);
  }
}

@keyframes avatar-image-wiggle {
  0%,
  100% {
    transform: rotate(0deg) scale(1);
  }
  35% {
    transform: rotate(-5deg) scale(1.08);
  }
  68% {
    transform: rotate(4deg) scale(1.03);
  }
}

@media (prefers-reduced-motion: reduce) {
  .profile-modal .avatar-option.active,
  .profile-modal .avatar-option.active img {
    animation: none !important;
  }
}

.modal {
  background: rgba(255, 247, 216, 0.34);
  -webkit-backdrop-filter: blur(14px) saturate(1.08);
  backdrop-filter: blur(14px) saturate(1.08);
}

.modal::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at 50% 42%, rgba(255, 255, 255, 0.42), transparent 34%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.18), rgba(255, 224, 146, 0.18));
  pointer-events: none;
}

.sheet,
.style-candy .sheet,
.style-paper .sheet,
.style-neon .sheet {
  position: relative;
  z-index: 1;
  border: 1px solid rgba(141, 98, 45, 0.18);
  border-radius: 28px;
  background: rgba(255, 252, 234, 0.84);
  color: #6b4a22;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.72),
    0 22px 64px rgba(122, 83, 30, 0.18);
}

.sheet-head,
.style-candy .sheet-head,
.style-paper .sheet-head,
.style-neon .sheet-head {
  min-height: 58px;
  padding: 10px 12px 8px 22px;
  border-bottom: 1px solid rgba(141, 98, 45, 0.12);
  background: rgba(255, 250, 226, 0.68);
}

.sheet-head b,
.style-candy .sheet-head b,
.style-paper .sheet-head b,
.style-neon .sheet-head b {
  color: #6b4a22;
  font-size: 20px;
  text-shadow: 0 1px 0 rgba(255, 255, 255, 0.75);
}

.close-btn {
  width: 38px;
  height: 38px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.35), transparent 50%),
    linear-gradient(180deg, #ffe29b, #efb953);
  color: #7a4b2e;
  box-shadow: 0 8px 18px rgba(163, 105, 32, 0.16);
}

.sheet-body {
  padding: 20px;
}

.theme-screen,
.theme-bottom-nav {
  background: rgba(255, 252, 234, 0.84);
  color: #6b4a22;
}

.book-fullscreen .theme-screen {
  background:
    url("./assets/tex_battle_main_bg.jpg") center / cover no-repeat,
    #fff6d9;
}

.modal.book-fullscreen {
  background: transparent;
  -webkit-backdrop-filter: none;
  backdrop-filter: none;
}

.modal.book-fullscreen::before {
  content: none;
}

.theme-screen-head b,
.theme-box > span,
.style-box > span,
.account-box > span {
  color: #936733;
}

.theme-screen-head span,
.book-group h3,
.book-row > span,
.book-row i,
.reward i,
.leaderboard-head span,
.leaderboard-row i,
.leaderboard-row em,
.leaderboard-empty {
  color: rgba(107, 74, 34, 0.68);
}

.book-fullscreen .theme-bottom-nav {
  display: grid;
  grid-template-columns:
    var(--ui-bottom-nav-return-column)
    var(--ui-bottom-nav-main-column)
    var(--ui-bottom-nav-main-column);
  gap: 6px;
  align-items: stretch;
  margin: 6px 22px calc(10px + var(--safe-bottom));
  padding: 6px;
  border: 2px solid rgba(117, 67, 27, 0.56);
  border-radius: 22px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.2), transparent 42%),
    linear-gradient(180deg, #c99a5f, #8c5c31);
  box-shadow:
    inset 0 0 0 3px rgba(91, 52, 23, 0.28),
    0 6px 14px rgba(119, 69, 26, 0.18);
  -webkit-backdrop-filter: none;
  backdrop-filter: none;
}

.book-fullscreen .theme-back,
.book-fullscreen .book-fullscreen-tab {
  min-width: 0;
  min-height: var(--ui-bottom-nav-button-height);
  border-radius: var(--ui-bottom-nav-button-radius);
  font-size: var(--ui-bottom-nav-button-font);
  font-weight: 1000;
}

.book-fullscreen .theme-back {
  border: 2px solid rgba(118, 72, 33, 0.36);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.18), transparent 48%),
    linear-gradient(180deg, #b9874f, #875a32);
  color: #fff6d0;
  box-shadow:
    inset 0 2px 0 rgba(255, 232, 171, 0.32),
    inset 0 -3px 0 rgba(94, 53, 23, 0.18);
}

.book-fullscreen .book-fullscreen-tab {
  border: 2px solid rgba(118, 72, 33, 0.36);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.68), transparent 48%),
    linear-gradient(180deg, #fff2b8, #f8d36d);
  color: #70421f;
  box-shadow:
    inset 0 0 0 2px rgba(255, 255, 255, 0.6),
    inset 0 -3px 0 rgba(224, 169, 66, 0.18),
    0 4px 10px rgba(116, 67, 25, 0.12);
}

.theme-option,
.book-row,
.reward,
.leaderboard,
.leaderboard-row,
.style-option,
.setting-btn,
.leaderboard-button,
.profile-name,
.avatar-option {
  border-color: rgba(141, 98, 45, 0.14);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.28), transparent 52%),
    rgba(255, 244, 205, 0.72);
  color: #6b4a22;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.72),
    0 8px 16px rgba(122, 83, 30, 0.1);
}

.theme-option b,
.book-row b,
.reward span,
.leaderboard-head b,
.leaderboard-row b,
.style-option b,
.setting-btn b,
.leaderboard-button b {
  color: #6b4a22;
}

.theme-option.active,
.style-option.active,
.avatar-option.active {
  border-color: rgba(239, 185, 83, 0.9);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.42), transparent 50%),
    rgba(255, 224, 146, 0.86);
  box-shadow:
    inset 0 0 0 2px rgba(255, 255, 255, 0.58),
    0 0 0 4px rgba(255, 204, 101, 0.22),
    0 12px 22px rgba(163, 105, 32, 0.14);
}

.theme-option.active b,
.style-option.active b {
  color: #7a4b2e;
}

.leaderboard-row strong {
  color: #b46a22;
}

.theme-back,
.result-btn,
.reward b {
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.28), transparent 48%),
    linear-gradient(180deg, #ffe29b, #efb953);
  color: #6a471c;
}

.toast {
  border: 1px solid rgba(141, 98, 45, 0.2);
  background: rgba(255, 252, 234, 0.9);
  color: #6b4a22;
  text-shadow: 0 1px 0 rgba(255, 255, 255, 0.75);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.72),
    0 12px 26px rgba(122, 83, 30, 0.16);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
}

.game-shell.battle-shell {
  grid-template-rows: 29% 49% 22%;
  background:
    var(--asset-battle-bg, url("./assets/tex_battle_main_bg.jpg")) center / cover no-repeat,
    #fff3cf;
  color: #6a4b2f;
}

.game-shell.battle-shell::before,
.game-shell.battle-shell::after {
  content: none;
}

.battle-shell .game-settings-btn {
  left: clamp(12px, 3.6vw, 18px);
  top: calc(clamp(12px, 2.8vw, 18px) + var(--safe-top));
  width: clamp(46px, 10.8vw, 56px);
  height: clamp(48px, 11.4vw, 58px);
  border-radius: 0;
  background: var(--asset-battle-settings, url("./assets/battle@btn_setting.png")) center / contain no-repeat;
  color: transparent;
  font-size: 0;
  box-shadow: none;
}

.battle-shell .combat-hud {
  grid-template-columns: minmax(0, 1fr) clamp(58px, 15vw, 82px) minmax(0, 1fr);
  align-content: start;
  gap: clamp(8px, 2.4vw, 16px);
  padding: calc(clamp(64px, 13.2svh, 88px) + var(--safe-top)) clamp(28px, 8vw, 54px) 0;
  border-bottom: 0;
}

.battle-shell .unit {
  gap: 3px;
}

.battle-shell .unit.player {
  justify-self: start;
}

.battle-shell .unit.enemy {
  justify-self: end;
}

.battle-shell .portrait {
  position: relative;
  z-index: 1;
  width: clamp(108px, 26vw, 154px);
  max-width: none;
  height: auto;
  aspect-ratio: 260 / 154;
  padding: 0;
  place-items: center;
  border: 0;
  border-radius: 0;
  background: var(--unit-tray, url("./assets/tex_battle_tuopan_01.png")) center / contain no-repeat;
  color: #5d4030;
  font-size: clamp(34px, 8vw, 52px);
  box-shadow: none;
}

.battle-shell .attack-timer {
  --attack-progress: 0;
  position: absolute;
  left: 12%;
  top: 11%;
  z-index: 4;
  width: clamp(22px, 5.8vw, 32px);
  aspect-ratio: 1;
  border-radius: 50%;
  background:
    radial-gradient(circle, #fff8df 0 46%, transparent 47%),
    conic-gradient(#f08b5e calc(var(--attack-progress) * 1turn), rgba(255, 231, 183, 0.82) 0);
  box-shadow:
    inset 0 0 0 2px rgba(255, 255, 255, 0.86),
    0 2px 5px rgba(120, 74, 29, 0.2);
  pointer-events: none;
}

.battle-shell .attack-timer::after {
  content: "";
  position: absolute;
  inset: 34%;
  border-radius: 50%;
  background: #86bd57;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.62);
}

.battle-shell .portrait img {
  width: 69%;
  height: 69%;
  object-fit: contain;
  transform: translateY(-12%);
}

.battle-shell .enemy-face {
  background: var(--unit-tray, url("./assets/tex_battle_tuopan_02.png")) center / contain no-repeat;
}

.battle-shell .unit-name {
  position: relative;
  z-index: 3;
  gap: 0;
  width: clamp(112px, 28vw, 158px);
  min-height: clamp(34px, 8vw, 44px);
  margin-top: -15px;
  display: grid;
  place-items: center;
  padding: 4px 14px 7px;
  background: var(--asset-name-bg, url("./assets/battle@name_bg.png")) center / contain no-repeat;
  color: #7b5235;
  text-shadow:
    0 1px 0 rgba(255, 255, 255, 0.88),
    0 2px 6px rgba(111, 74, 36, 0.18);
}

.battle-shell .unit-name b {
  color: #6a3d25;
  font-size: clamp(15px, 3.7vw, 18px);
  line-height: 1;
}

.battle-shell .unit-name span {
  display: none;
}

.battle-shell .versus {
  align-self: center;
  margin-top: 14px;
  color: #fff7d6;
  font-size: clamp(38px, 9vw, 54px);
  line-height: 1;
  text-shadow:
    0 3px 0 #a96735,
    0 0 12px rgba(255, 201, 83, 0.72),
    0 8px 14px rgba(112, 68, 22, 0.24);
}

.battle-shell .hpbar,
.battle-shell .attackbar {
  width: clamp(110px, 31vw, 154px);
  height: clamp(19px, 4.6vw, 24px);
  border-radius: 999px;
  background: #d9c09e;
  box-shadow:
    inset 0 2px 3px rgba(93, 57, 24, 0.28),
    0 2px 4px rgba(93, 57, 24, 0.16);
}

.battle-shell .hpbar i,
.battle-shell .attackbar i {
  border-radius: inherit;
}

.battle-shell .fullness-wrap {
  position: relative;
  display: grid;
  justify-items: center;
  gap: 0;
  margin-top: -7px;
}

.battle-shell .fullness-bar {
  position: relative;
  z-index: 1;
  overflow: visible;
  width: 164px;
  max-width: none;
  height: 45px;
  padding: 18px 7px 6px;
  border-radius: 18px;
  background: var(--asset-hp-player, url("./assets/battle@jindutiao_bg.png")) center / 100% 100% no-repeat;
  box-shadow: none;
  filter: drop-shadow(0 3px 6px rgba(118, 75, 30, 0.13));
}

.battle-shell .enemy-fullness .fullness-bar {
  background-image: var(--asset-hp-enemy, url("./assets/battle@jindutiao_bg.png"));
}

.battle-shell .fullness-bar::before {
  content: none;
}

.battle-shell .fullness-bar::after {
  content: none;
}

.battle-shell .fullness-bar i {
  position: absolute;
  left: 7px;
  top: 18px;
  z-index: 1;
  display: block;
  width: calc(100% - 14px);
  height: calc(100% - 26px);
  border-radius: 10px;
  background: linear-gradient(90deg, var(--fullness-a), var(--fullness-b));
  box-shadow:
    inset 0 2px 0 rgba(255, 255, 255, 0.32),
    inset 0 -2px 0 rgba(132, 82, 24, 0.12),
    0 1px 3px rgba(125, 82, 28, 0.16);
  clip-path: inset(0 calc(100% - var(--fullness, 0%)) 0 0 round 14px);
  transition: clip-path 420ms cubic-bezier(0.22, 0.9, 0.24, 1);
}

.battle-shell .fullness-bar[data-fullness-tier="01"] {
  --fullness-a: #d9ef9b;
  --fullness-b: #8fca62;
}

.battle-shell .fullness-bar[data-fullness-tier="02"] {
  --fullness-a: #f3df7a;
  --fullness-b: #d6ba43;
}

.battle-shell .fullness-bar[data-fullness-tier="03"] {
  --fullness-a: #ffc766;
  --fullness-b: #f09c42;
}

.battle-shell .fullness-bar[data-fullness-tier="04"] {
  --fullness-a: #ff9d6f;
  --fullness-b: #e96c50;
}

.battle-shell .fullness-bar[data-fullness-tier="05"] {
  --fullness-a: #ff7b70;
  --fullness-b: #cf4745;
}

.battle-shell .fullness-attention-warning .fullness-bar {
  box-shadow:
    inset 0 0 0 2px rgba(255, 233, 143, 0.72),
    inset 0 -3px 0 rgba(171, 112, 45, 0.12),
    0 0 0 3px rgba(255, 204, 74, 0.18),
    0 6px 14px rgba(171, 103, 34, 0.18);
}

.battle-shell .fullness-attention-danger .fullness-bar {
  animation: fullness-attention-pulse 1080ms ease-in-out infinite;
  box-shadow:
    inset 0 0 0 2px rgba(255, 238, 166, 0.88),
    inset 0 -3px 0 rgba(171, 112, 45, 0.12),
    0 0 0 4px rgba(255, 123, 87, 0.22),
    0 8px 18px rgba(197, 72, 55, 0.24);
}

.battle-shell .hpbar span,
.battle-shell .attackbar span {
  display: none;
}

.battle-shell .fullness-tag {
  position: relative;
  z-index: 2;
  width: clamp(56px, 14.4vw, 79px);
  height: auto;
  margin-top: clamp(-4px, -0.8vw, -2px);
  object-fit: contain;
  filter: drop-shadow(0 2px 3px rgba(84, 68, 29, 0.15));
}

.battle-shell .attackbar {
  width: clamp(80px, 22vw, 112px);
  height: 7px;
  margin-top: -1px;
  background: rgba(104, 78, 53, 0.22);
}

.battle-shell .attackbar i {
  background: linear-gradient(90deg, #ec7270, #f2cc62);
}

.battle-shell .attackbar span {
  display: none;
}

.battle-shell .board-wrap {
  --board-player-alert-shadow: 0 0 0 0 transparent;
  --board-enemy-alert-shadow: 0 0 0 0 transparent;
  position: relative;
  isolation: isolate;
  align-self: center;
  justify-self: center;
  width: calc(100% - clamp(18px, 4vw, 28px));
  max-width: 480px;
  aspect-ratio: 958 / 980;
  min-height: 0;
  display: grid;
  padding: clamp(15px, 4.5vw, 22px) clamp(16px, 4.8vw, 24px) clamp(17px, 5vw, 25px);
  border-bottom: 0;
  background: var(--asset-board-bg, url("./assets/tex_chess_bg.png")) center / 100% 100% no-repeat;
  box-shadow:
    var(--board-player-alert-shadow),
    var(--board-enemy-alert-shadow);
}

.battle-shell .board-wrap::before,
.battle-shell .board-wrap::after {
  content: "";
  position: absolute;
  inset: clamp(7px, 2vw, 12px);
  z-index: 2;
  border-radius: clamp(16px, 4vw, 24px);
  opacity: 0;
  pointer-events: none;
  transition: opacity 220ms ease;
  will-change: opacity;
}

.battle-shell .board-wrap::before {
  background:
    radial-gradient(circle at 50% 50%, transparent 62%, rgba(210, 61, 48, 0.2) 82%, rgba(210, 61, 48, 0.34) 100%),
    linear-gradient(90deg, rgba(218, 66, 52, 0.32), transparent 16%, transparent 84%, rgba(218, 66, 52, 0.32)),
    linear-gradient(180deg, rgba(218, 66, 52, 0.22), transparent 18%, transparent 82%, rgba(218, 66, 52, 0.38));
  box-shadow:
    inset 0 0 0 3px rgba(232, 84, 62, 0.46),
    inset 0 0 22px rgba(218, 75, 52, 0.24),
    0 0 22px rgba(214, 78, 56, 0.26);
}

.battle-shell .board-wrap::after {
  background:
    radial-gradient(circle at 50% 50%, transparent 64%, rgba(255, 194, 73, 0.19) 84%, rgba(255, 194, 73, 0.32) 100%),
    linear-gradient(90deg, rgba(255, 197, 76, 0.26), transparent 17%, transparent 83%, rgba(255, 197, 76, 0.26)),
    linear-gradient(180deg, rgba(255, 197, 76, 0.18), transparent 18%, transparent 82%, rgba(255, 197, 76, 0.32));
  box-shadow:
    inset 0 0 0 3px rgba(255, 204, 91, 0.42),
    inset 0 0 24px rgba(255, 190, 65, 0.22),
    0 0 22px rgba(255, 187, 59, 0.22);
}

.battle-shell.player-fullness-warning .board-wrap::before,
.battle-shell.enemy-fullness-warning .board-wrap::after {
  opacity: 0.72;
}

.battle-shell.player-fullness-warning .board-wrap {
  --board-player-alert-shadow: 0 0 0 2px rgba(218, 70, 52, 0.2), 0 0 18px rgba(214, 78, 56, 0.16);
}

.battle-shell.enemy-fullness-warning .board-wrap {
  --board-enemy-alert-shadow: 0 0 0 2px rgba(255, 198, 78, 0.18), 0 0 18px rgba(255, 187, 59, 0.14);
}

.battle-shell.player-fullness-danger .board-wrap::before,
.battle-shell.enemy-fullness-danger .board-wrap::after {
  opacity: 1;
  animation: board-attention-breathe 1600ms ease-in-out infinite;
}

.battle-shell.player-fullness-danger .board-wrap {
  --board-player-alert-shadow: 0 0 0 3px rgba(218, 70, 52, 0.34), 0 0 26px rgba(214, 78, 56, 0.28);
}

.battle-shell.enemy-fullness-danger .board-wrap {
  --board-enemy-alert-shadow: 0 0 0 3px rgba(255, 198, 78, 0.28), 0 0 26px rgba(255, 187, 59, 0.24);
}

.battle-shell .goose-board-wrap {
  background: url("./assets/tex_chess_bg2.png") center / 100% 100% no-repeat;
}

.battle-shell .goose-board-wrap.goose-shuffling {
  transform-origin: 50% 72%;
  animation: goose-pan-toss 760ms cubic-bezier(0.18, 0.86, 0.28, 1) both;
}

@keyframes fullness-attention-pulse {
  0%,
  100% {
    filter: brightness(1);
    transform: scale(1);
  }

  50% {
    filter: brightness(1.12) saturate(1.08);
    transform: scale(1.035);
  }
}

@keyframes board-attention-breathe {
  0%,
  100% {
    opacity: 0.76;
  }

  50% {
    opacity: 1;
  }
}

.battle-shell .grid {
  position: relative;
  z-index: 1;
  gap: clamp(5px, 1.4vw, 8px);
  align-self: stretch;
  perspective: 760px;
}

.battle-shell .goose-grid {
  display: block;
  position: relative;
  min-height: 100%;
  overflow: visible;
  isolation: isolate;
}

.battle-shell .goose-tile {
  position: absolute;
  left: calc(var(--goose-x) * 1%);
  top: calc(var(--goose-y) * 1%);
  z-index: var(--goose-z);
  width: clamp(38px, 10.2vw, 54px);
  height: clamp(54px, 14vw, 76px);
  overflow: visible;
  border: 0;
  border-radius: clamp(7px, 1.7vw, 10px);
  background: transparent;
  transform:
    translate(-50%, -50%)
    translate(var(--goose-lift-x), var(--goose-lift-y))
    rotate(var(--goose-rotate));
  filter: drop-shadow(0 7px 8px rgba(63, 46, 30, 0.26));
  transition: transform 160ms ease, filter 160ms ease, opacity 160ms ease;
}

.battle-shell .goose-grid.goose-shuffling .goose-tile {
  animation: goose-tile-toss 620ms cubic-bezier(0.18, 0.86, 0.22, 1) both;
  animation-delay: var(--goose-toss-delay, 0ms);
}

.battle-shell .goose-tile .tile {
  width: 100%;
  height: 100%;
  border-radius: inherit;
  background:
    repeating-linear-gradient(0deg, rgba(92, 72, 48, 0.11) 0 1px, transparent 1px 4px),
    linear-gradient(180deg, #f8f1dd 0%, #ded6c3 48%, #bdb5a6 100%);
  color: #5b351d;
  font-size: clamp(22px, 5.8vw, 32px);
  box-shadow:
    inset 0 2px 0 rgba(255, 255, 255, 0.62),
    inset 0 -4px 0 rgba(83, 67, 47, 0.2),
    0 2px 0 rgba(100, 86, 66, 0.5),
    0 4px 0 rgba(93, 82, 65, 0.38),
    0 6px 12px rgba(55, 42, 30, 0.25);
}

.battle-shell .goose-tile.free {
  cursor: pointer;
}

.battle-shell .goose-tile.free:active {
  transform:
    translate(-50%, -50%)
    translate(var(--goose-lift-x), calc(var(--goose-lift-y) - 3px))
    rotate(var(--goose-rotate))
    scale(0.96);
}

.battle-shell .goose-tile.covered {
  opacity: 1;
  filter: grayscale(1) brightness(0.76) drop-shadow(0 4px 5px rgba(63, 46, 30, 0.18));
}

.battle-shell .goose-tile.covered .tile {
  color: #6d6a62;
}

.battle-shell .goose-tile.seed.free .tile {
  box-shadow:
    inset 0 0 0 2px rgba(255, 255, 255, 0.26),
    inset 0 -4px 0 rgba(168, 116, 65, 0.1),
    0 0 0 3px rgba(255, 203, 74, 0.68),
    0 7px 13px rgba(121, 78, 35, 0.2);
}

@keyframes goose-pan-toss {
  0%,
  100% {
    transform: translateY(0) rotate(0deg);
  }

  18% {
    transform: translateY(5px) rotate(-2.4deg);
  }

  38% {
    transform: translateY(-5px) rotate(3.2deg);
  }

  62% {
    transform: translateY(3px) rotate(-1.8deg);
  }

  82% {
    transform: translateY(-1px) rotate(0.8deg);
  }
}

@keyframes goose-tile-toss {
  0%,
  100% {
    transform:
      translate(-50%, -50%)
      translate(var(--goose-lift-x), var(--goose-lift-y))
      rotate(var(--goose-rotate));
  }

  24% {
    transform:
      translate(-50%, -50%)
      translate(calc(var(--goose-lift-x) - 5px), calc(var(--goose-lift-y) + 7px))
      rotate(calc(var(--goose-rotate) - 4deg))
      scale(0.98);
  }

  52% {
    transform:
      translate(-50%, -50%)
      translate(calc(var(--goose-lift-x) + 6px), calc(var(--goose-lift-y) - 18px))
      rotate(calc(var(--goose-rotate) + 7deg))
      scale(1.05);
  }

  78% {
    transform:
      translate(-50%, -50%)
      translate(calc(var(--goose-lift-x) - 2px), calc(var(--goose-lift-y) + 3px))
      rotate(calc(var(--goose-rotate) - 2deg))
      scale(0.99);
  }
}

.battle-shell .cell {
  border-radius: clamp(8px, 2vw, 13px);
  background:
    radial-gradient(circle at 32% 18%, rgba(255, 255, 255, 0.7), transparent 18%),
    linear-gradient(180deg, #fff8df, #f4e8c9);
  box-shadow:
    inset 0 0 0 2px rgba(213, 178, 121, 0.38),
    inset 0 -4px 0 rgba(160, 108, 58, 0.12),
    0 3px 5px rgba(121, 78, 35, 0.18);
}

.battle-shell .cell.locked {
  background: linear-gradient(180deg, #9a7658, #7b5a42);
}

.battle-shell .cell.locked::before,
.battle-shell .cell.locked::after {
  content: "";
  position: absolute;
  width: 64%;
  height: clamp(5px, 1.3vw, 8px);
  border-radius: 999px;
  background: rgba(92, 62, 43, 0.56);
  box-shadow: 0 1px 0 rgba(255, 222, 166, 0.18);
}

.battle-shell .cell.locked::before {
  transform: rotate(45deg);
}

.battle-shell .cell.locked::after {
  transform: rotate(-45deg);
}

.battle-shell .cell.open {
  background:
    radial-gradient(circle at 32% 18%, rgba(255, 255, 255, 0.78), transparent 18%),
    linear-gradient(180deg, #fff9e8, #f6ebd1);
  box-shadow:
    inset 0 0 0 2px rgba(216, 179, 119, 0.35),
    inset 0 -4px 0 rgba(168, 116, 65, 0.1),
    0 3px 5px rgba(121, 78, 35, 0.14);
}

.battle-shell .cell.open.unlocking {
  background: transparent;
  box-shadow: none;
}

.battle-shell .cell.unlocking::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 6;
  border-radius: inherit;
  background:
    linear-gradient(45deg, transparent 43%, rgba(92, 62, 43, 0.56) 44% 56%, transparent 57%),
    linear-gradient(-45deg, transparent 43%, rgba(92, 62, 43, 0.56) 44% 56%, transparent 57%),
    linear-gradient(180deg, #9a7658, #7b5a42);
  transform-origin: center;
  backface-visibility: hidden;
  pointer-events: none;
  animation: unlock-cell-flip 460ms cubic-bezier(0.2, 0.84, 0.28, 1) forwards;
  animation-delay: calc(var(--unlock-elapsed, 0ms) * -1);
}

.battle-shell .cell.unlocking::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 7;
  border-radius: inherit;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.52), transparent);
  opacity: 0;
  pointer-events: none;
  animation: unlock-cell-shine 460ms ease-out forwards;
  animation-delay: calc(var(--unlock-elapsed, 0ms) * -1);
}

.battle-shell .cell.active {
  --chain-color: rgba(112, 182, 83, 0.9);
  box-shadow:
    inset 0 0 0 3px rgba(124, 190, 84, 0.92),
    0 0 14px rgba(124, 190, 84, 0.34);
}

.battle-shell .cell.active.chain-h:not(.chain-solo),
.battle-shell .cell.active.chain-v:not(.chain-solo) {
  background: transparent;
  box-shadow: none;
}

.battle-shell .chain-overlay {
  border-radius: clamp(8px, 2vw, 13px);
  background:
    radial-gradient(circle at 32% 18%, rgba(255, 255, 255, 0.78), transparent 18%),
    linear-gradient(180deg, #fff9e8, #f6ebd1);
  box-shadow:
    inset 0 -4px 0 rgba(168, 116, 65, 0.1),
    0 3px 5px rgba(121, 78, 35, 0.14);
}

.battle-shell .chain-overlay::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 1;
  border-radius: inherit;
  pointer-events: none;
  box-shadow: inset 0 0 0 2px var(--chain-color);
}

.battle-shell .cell.combo-candidate {
  box-shadow:
    inset 0 0 0 3px rgba(255, 195, 75, 0.95),
    0 0 14px rgba(255, 195, 75, 0.28);
}

.battle-shell .bottom-dock {
  grid-template-rows: minmax(76px, 1fr) clamp(58px, 11vw, 70px);
  gap: clamp(8px, 2vw, 14px);
  padding: 0 clamp(14px, 3.6vw, 22px) calc(clamp(12px, 3svh, 26px) + var(--safe-bottom));
}

.battle-shell .goose-bottom-dock {
  grid-template-rows: minmax(70px, 1fr) clamp(70px, 13vw, 84px);
}

.battle-shell .hand {
  align-self: stretch;
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  align-items: center;
  gap: clamp(5px, 1.4vw, 8px);
  min-height: 0;
  padding: clamp(10px, 2.7vw, 16px) clamp(8px, 2.4vw, 12px);
  background: var(--asset-hand-bg, url("./assets/tex_bag_bg.png")) center / 100% 100% no-repeat;
}

.battle-shell .hand-slot {
  border-radius: clamp(9px, 2.2vw, 13px);
  background: rgba(255, 247, 224, 0.72);
  border: 2px dashed rgba(198, 151, 91, 0.28);
  box-shadow: none;
}

.battle-shell .hand-slot.filled {
  border-style: solid;
  background:
    radial-gradient(circle at 30% 18%, rgba(255, 255, 255, 0.82), transparent 18%),
    linear-gradient(180deg, #fff6d9, #f1dfb9);
  box-shadow:
    inset 0 0 0 2px rgba(255, 255, 255, 0.26),
    0 4px 7px rgba(127, 86, 43, 0.16);
}

.battle-shell .goose-bag-slot {
  cursor: pointer;
}

.battle-shell .goose-bag-slot:disabled {
  cursor: default;
  opacity: 1;
  filter: none;
}

.battle-shell .goose-bag-slot.recipe-ready {
  border-color: rgba(112, 182, 83, 0.84);
  box-shadow:
    inset 0 0 0 2px rgba(255, 255, 255, 0.32),
    0 0 13px rgba(112, 182, 83, 0.34);
}

.battle-shell .cell .tile:not(.tile-tool):not(.tile-heal),
.battle-shell .hand-slot .tile:not(.tile-tool):not(.tile-heal) {
  background:
    radial-gradient(circle at 32% 18%, rgba(255, 255, 255, 0.78), transparent 18%),
    linear-gradient(180deg, #fff9e8, #f6ebd1);
  box-shadow:
    inset 0 0 0 2px rgba(216, 179, 119, 0.35),
    inset 0 -4px 0 rgba(168, 116, 65, 0.1),
    0 3px 5px rgba(121, 78, 35, 0.14);
}

.battle-shell .cell.active.chain-h:not(.chain-solo) .tile,
.battle-shell .cell.active.chain-v:not(.chain-solo) .tile {
  width: 100%;
  height: 100%;
  justify-self: stretch;
  align-self: stretch;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}

.battle-shell .bag-slot,
.battle-shell .hand-slot:first-child {
  background: var(--asset-hand-bag, url("./assets/battle@btn_tujian.png")) center / contain no-repeat;
  border: 0;
  color: transparent;
  font-size: 0;
  box-shadow: none;
}

.battle-shell .bottom-actions {
  grid-template-columns: clamp(92px, 23vw, 112px) 1fr;
  grid-template-rows: 1fr;
  gap: clamp(12px, 3vw, 18px);
}

.battle-shell .ration {
  width: 100%;
  height: auto;
  aspect-ratio: 221 / 137;
  align-self: center;
  justify-content: flex-end;
  padding: 0 clamp(20px, 5vw, 28px) 0 0;
  border-radius: 0;
  background: var(--asset-coin-panel, url("./assets/battle@btn_coin.png")) center / contain no-repeat;
  box-shadow: none;
}

.battle-shell .ration .coin-icon {
  display: none;
}

.battle-shell .ration::before,
.battle-shell .ration::after {
  content: "";
  position: absolute;
  inset: auto;
  top: auto;
  left: 18%;
  right: 17%;
  bottom: 18%;
  height: clamp(5px, 1.1vw, 7px);
  border-radius: 999px;
  pointer-events: none;
}

.battle-shell .ration::before {
  display: block;
  background:
    linear-gradient(180deg, rgba(122, 83, 32, 0.16), transparent 55%),
    rgba(255, 239, 186, 0.58);
  box-shadow:
    inset 0 1px 2px rgba(94, 58, 19, 0.22),
    0 1px 0 rgba(255, 255, 255, 0.56);
}

.battle-shell .ration::after {
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.5), transparent 48%),
    linear-gradient(90deg, #f7d86d, #efb941 62%, #ffdf7a);
  box-shadow:
    inset 0 -1px 0 rgba(145, 86, 16, 0.16),
    0 0 8px rgba(238, 184, 59, 0.32);
  clip-path: inset(0 calc(100% - var(--recover, 0%)) 0 0 round 999px);
  transition: clip-path 140ms linear, opacity 180ms ease;
}

.battle-shell .ration.ration-full::after {
  opacity: 0.32;
  clip-path: inset(0 0 0 0 round 999px);
}

.battle-shell .ration b {
  position: relative;
  z-index: 1;
  top: -4px;
  color: #775436;
  font-size: clamp(31px, 7.2vw, 40px);
  text-shadow:
    0 1px 0 rgba(255, 255, 255, 0.8),
    0 2px 4px rgba(108, 68, 29, 0.22);
}

.battle-shell .draw-btn {
  position: relative;
  width: 100%;
  max-width: 316px;
  height: auto;
  aspect-ratio: 585 / 137;
  align-self: center;
  justify-self: start;
  border-radius: 0;
  background: var(--asset-draw-button, url("./assets/battle@btn_attack.png")) center / contain no-repeat;
  color: transparent;
  font-size: 0;
  box-shadow: none;
}

.battle-shell .draw-btn span {
  position: absolute;
  right: 20.5%;
  top: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 18px;
  padding: 0;
  transform: translateY(-50%);
  background: transparent;
  color: #5f8a42;
  font-size: clamp(17px, 4vw, 22px);
  font-weight: 1000;
  line-height: 1;
}

.battle-shell .draw-btn .coin-icon {
  display: none;
}

.battle-shell .draw-btn:disabled {
  opacity: 0.66;
  filter: grayscale(0.45);
}

.battle-shell .goose-actions {
  grid-template-columns: clamp(104px, 26vw, 128px) 1fr;
}

.battle-shell .stir-fry-btn {
  display: grid;
  place-items: center;
  align-content: center;
  justify-content: center;
  width: 100%;
  height: 100%;
  aspect-ratio: auto;
  padding: 0;
  border: 2px solid rgba(129, 83, 38, 0.32);
  border-radius: clamp(17px, 4.2vw, 24px);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.72), rgba(255, 239, 185, 0.22) 46%, transparent 47%),
    linear-gradient(180deg, #ffe7a6, #eab75c 55%, #c97837);
  box-shadow:
    inset 0 2px 0 rgba(255, 255, 255, 0.72),
    inset 0 -5px 0 rgba(124, 70, 31, 0.18),
    0 7px 13px rgba(126, 75, 27, 0.18);
  cursor: pointer;
  color: #775436;
  font-size: 0;
}

.battle-shell .stir-fry-btn::before,
.battle-shell .stir-fry-btn::after {
  content: none;
}

.battle-shell .stir-fry-btn:disabled {
  opacity: 1;
  filter: grayscale(0.52) brightness(0.94);
}

.battle-shell .stir-fry-btn b,
.battle-shell .stir-fry-btn span {
  position: relative;
  z-index: 2;
  top: auto;
  color: #754622;
  font-size: clamp(20px, 4.8vw, 27px);
  font-weight: 1000;
  line-height: 1;
  text-shadow:
    0 1px 0 rgba(255, 255, 255, 0.76),
    0 2px 4px rgba(108, 68, 29, 0.18);
}

.battle-shell .stir-fry-btn span {
  margin-top: -6px;
  color: #9a6630;
  font-size: clamp(12px, 3vw, 15px);
}

.battle-shell .goose-attack-btn {
  display: grid;
  align-content: center;
  place-items: center;
  grid-template-rows: auto auto;
  gap: 4px;
  width: 100%;
  max-width: none;
  height: 100%;
  aspect-ratio: auto;
  justify-self: stretch;
  overflow: visible;
  padding: 6px 14px 8px;
  border: 2px solid rgba(91, 143, 56, 0.34);
  border-radius: clamp(18px, 4.4vw, 26px);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.76), rgba(241, 255, 210, 0.24) 46%, transparent 47%),
    linear-gradient(180deg, #e8ffc0, #a8d966 55%, #65aa45);
  box-shadow:
    inset 0 2px 0 rgba(255, 255, 255, 0.72),
    inset 0 -5px 0 rgba(58, 112, 42, 0.2),
    0 7px 13px rgba(79, 126, 44, 0.18);
  color: #7a4927;
  font-size: clamp(21px, 4.8vw, 28px);
  font-weight: 1000;
  line-height: 1;
  text-shadow: 0 1px 0 rgba(255, 255, 255, 0.72);
}

.battle-shell .goose-attack-btn span {
  display: block;
  position: static;
  right: auto;
  top: auto;
  min-width: 0;
  width: 100%;
  max-width: 100%;
  transform: none;
  margin: 0;
  color: #6c8e35;
  font-size: clamp(11px, 2.7vw, 14px);
  line-height: 1.15;
  overflow: visible;
  text-align: center;
  white-space: normal;
  word-break: keep-all;
}

.battle-shell .goose-attack-btn.ready {
  filter: saturate(1.16) drop-shadow(0 0 12px rgba(106, 176, 65, 0.3));
}

.battle-intro {
  position: absolute;
  inset: 0;
  z-index: 26;
  overflow: hidden;
  pointer-events: auto;
}

.battle-intro::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 0;
  background: rgba(47, 35, 25, 0.48);
  animation: battle-intro-mask 2600ms ease-in-out forwards;
}

.battle-intro-avatar {
  position: absolute;
  left: 50%;
  top: 29%;
  z-index: 4;
  display: grid;
  place-items: center;
  width: clamp(86px, 23vw, 127px);
  aspect-ratio: 1;
  color: #6f472b;
  font-size: clamp(62px, 14.8vw, 92px);
  text-shadow:
    0 2px 0 rgba(255, 255, 255, 0.72),
    0 8px 15px rgba(97, 59, 23, 0.2);
  filter: drop-shadow(0 10px 12px rgba(84, 51, 19, 0.24));
  transform-origin: center;
}

.battle-intro-avatar img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.battle-intro-player {
  animation: battle-intro-player 2600ms cubic-bezier(0.2, 0.82, 0.28, 1) forwards;
}

.battle-intro-enemy {
  animation: battle-intro-enemy 2600ms cubic-bezier(0.2, 0.82, 0.28, 1) forwards;
}

.battle-intro-banner {
  position: absolute;
  left: 50%;
  top: 46%;
  z-index: 3;
  width: min(82%, 620px);
  height: auto;
  transform: translate(-50%, -50%) scale(0.88);
  opacity: 0;
  filter: drop-shadow(0 8px 10px rgba(111, 64, 24, 0.18));
  animation: battle-intro-banner 2600ms ease-out forwards;
}

.battle-intro-burst {
  position: absolute;
  left: 50%;
  top: 36%;
  z-index: 5;
  width: min(30%, 190px);
  height: auto;
  transform: translate(-50%, -50%) scale(0.24);
  opacity: 0;
  mix-blend-mode: screen;
  animation: battle-intro-burst 2600ms ease-out forwards;
}

.battle-intro-title {
  position: absolute;
  left: 50%;
  top: 43%;
  z-index: 6;
  width: min(68%, 500px);
  height: auto;
  transform: translate(-50%, -50%) scale(0.68);
  opacity: 0;
  filter: drop-shadow(0 12px 14px rgba(106, 57, 20, 0.24));
  animation: battle-intro-title 2600ms cubic-bezier(0.16, 0.92, 0.22, 1) forwards;
}

.battle-intro-spark,
.battle-intro-speed {
  position: absolute;
  z-index: 2;
  height: auto;
  opacity: 0;
  pointer-events: none;
  filter: drop-shadow(0 2px 3px rgba(173, 101, 24, 0.12));
}

.battle-intro-spark {
  width: clamp(18px, 4.8vw, 30px);
  animation: battle-intro-spark 2600ms ease-out forwards;
}

.battle-intro-speed {
  width: clamp(34px, 8.5vw, 58px);
  animation: battle-intro-speed 2600ms ease-out forwards;
}

.battle-intro .spark-1 {
  left: 10%;
  top: 39%;
}

.battle-intro .spark-2 {
  right: 10%;
  top: 39%;
  animation-delay: 80ms;
}

.battle-intro .spark-3 {
  left: 18%;
  top: 52%;
  animation-delay: 160ms;
}

.battle-intro .spark-4 {
  right: 18%;
  top: 52%;
  animation-delay: 220ms;
}

.battle-intro .speed-1 {
  left: 8%;
  top: 43%;
  transform: rotate(-18deg);
}

.battle-intro .speed-2 {
  left: 18%;
  top: 35%;
  transform: rotate(18deg);
  animation-delay: 90ms;
}

.battle-intro .speed-3 {
  right: 18%;
  top: 35%;
  transform: rotate(-16deg);
  animation-delay: 110ms;
}

.battle-intro .speed-4 {
  right: 8%;
  top: 43%;
  transform: rotate(18deg);
  animation-delay: 40ms;
}

.battle-settle-overlay {
  position: absolute;
  inset: 0;
  z-index: 17;
  display: grid;
  place-items: center;
  pointer-events: all;
  background: rgba(86, 57, 25, 0.16);
  -webkit-backdrop-filter: blur(1.5px);
  backdrop-filter: blur(1.5px);
  animation: battle-settle-mask 3000ms ease both;
  animation-delay: calc(var(--settle-elapsed, 0ms) * -1);
}

.battle-settle-card {
  min-width: min(74vw, 320px);
  display: grid;
  justify-items: center;
  gap: 8px;
  padding: 18px 24px 16px;
  border: 2px solid rgba(255, 229, 148, 0.72);
  border-radius: 22px;
  background:
    radial-gradient(circle at 50% 0%, rgba(255, 244, 177, 0.9), transparent 48%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.92), rgba(255, 231, 168, 0.92));
  box-shadow:
    inset 0 2px 0 rgba(255, 255, 255, 0.78),
    0 18px 34px rgba(95, 59, 24, 0.2);
  animation: battle-settle-card 3000ms cubic-bezier(0.18, 0.88, 0.22, 1) both;
  animation-delay: calc(var(--settle-elapsed, 0ms) * -1);
}

.battle-settle-card span {
  color: #d88924;
  font-size: clamp(28px, 7vw, 42px);
  font-weight: 1000;
  line-height: 1;
  text-shadow:
    0 2px 0 rgba(255, 255, 255, 0.85),
    0 6px 12px rgba(147, 91, 24, 0.18);
  white-space: nowrap;
}

.battle-settle-card b {
  color: #70431f;
  font-size: clamp(15px, 3.9vw, 19px);
  font-weight: 1000;
  line-height: 1.1;
  white-space: nowrap;
}

.battle-settle-overlay.lose .battle-settle-card {
  border-color: rgba(255, 184, 154, 0.72);
  background:
    radial-gradient(circle at 50% 0%, rgba(255, 219, 176, 0.88), transparent 48%),
    linear-gradient(180deg, rgba(255, 250, 238, 0.94), rgba(255, 216, 177, 0.94));
}

.battle-settle-overlay.lose .battle-settle-card span {
  color: #d56b34;
}

@keyframes battle-intro-mask {
  0%,
  76% {
    opacity: 1;
  }

  100% {
    opacity: 0;
  }
}

@keyframes battle-settle-mask {
  0% {
    opacity: 0;
  }

  16%,
  82% {
    opacity: 1;
  }

  100% {
    opacity: 0.92;
  }
}

@keyframes battle-settle-card {
  0% {
    opacity: 0;
    transform: translateY(16px) scale(0.84);
  }

  18% {
    opacity: 1;
    transform: translateY(0) scale(1.06);
  }

  36%,
  82% {
    opacity: 1;
    transform: translateY(0) scale(1);
  }

  100% {
    opacity: 0.96;
    transform: translateY(-4px) scale(0.98);
  }
}

@keyframes battle-intro-player {
  0% {
    opacity: 0;
    transform: translate(-72vw, 18px) scale(0.9) rotate(-8deg);
  }

  18% {
    opacity: 1;
  }

  34%,
  58% {
    opacity: 1;
    transform: translate(-110%, 0) scale(1) rotate(2deg);
  }

  76% {
    opacity: 1;
    transform: translate(-110%, 0) scale(1) rotate(0);
  }

  94%,
  100% {
    opacity: 1;
    transform: translate(-135%, -177%) scale(0.75) rotate(0);
  }
}

@keyframes battle-intro-enemy {
  0% {
    opacity: 0;
    transform: translate(72vw, 18px) scale(0.9) rotate(8deg);
  }

  18% {
    opacity: 1;
  }

  34%,
  58% {
    opacity: 1;
    transform: translate(10%, 0) scale(1) rotate(-2deg);
  }

  76% {
    opacity: 1;
    transform: translate(10%, 0) scale(1) rotate(0);
  }

  94%,
  100% {
    opacity: 1;
    transform: translate(35%, -177%) scale(0.75) rotate(0);
  }
}

@keyframes battle-intro-banner {
  0%,
  46% {
    opacity: 0;
    transform: translate(-50%, -50%) scale(0.88) translateY(10px);
  }

  58%,
  82% {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1);
  }

  100% {
    opacity: 0;
    transform: translate(-50%, -50%) scale(0.96) translateY(16px);
  }
}

@keyframes battle-intro-burst {
  0%,
  28% {
    opacity: 0;
    transform: translate(-50%, -50%) scale(0.32) rotate(-8deg);
  }

  38%,
  50% {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1) rotate(0);
  }

  62% {
    opacity: 0.72;
    transform: translate(-50%, -50%) scale(0.92) rotate(4deg);
  }

  100% {
    opacity: 0;
    transform: translate(-50%, -50%) scale(0.86) rotate(8deg);
  }
}

@keyframes battle-intro-title {
  0%,
  54% {
    opacity: 0;
    transform: translate(-50%, -50%) scale(0.88);
  }

  66% {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1);
  }

  82% {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1);
  }

  100% {
    opacity: 0;
    transform: translate(-50%, -50%) scale(0.94) translateY(20px);
  }
}

@keyframes battle-intro-spark {
  0%,
  35% {
    opacity: 0;
    transform: scale(0.3) rotate(-8deg);
  }

  52%,
  76% {
    opacity: 1;
    transform: scale(1) rotate(4deg);
  }

  100% {
    opacity: 0;
    transform: scale(0.7) rotate(14deg);
  }
}

@keyframes battle-intro-speed {
  0%,
  36% {
    opacity: 0;
    scale: 0.78;
  }

  50%,
  73% {
    opacity: 1;
    scale: 1;
  }

  100% {
    opacity: 0;
    scale: 0.92;
  }
}

@media (prefers-reduced-motion: reduce) {
  .battle-intro::before,
  .battle-intro-avatar,
  .battle-intro-banner,
  .battle-intro-burst,
  .battle-intro-title,
  .battle-intro-spark,
  .battle-intro-speed,
  .battle-settle-overlay,
  .battle-settle-card,
  .battle-shell .fullness-attention-danger .fullness-bar,
  .battle-shell.player-fullness-danger .board-wrap::before,
  .battle-shell.enemy-fullness-danger .board-wrap::after,
  .battle-shell .goose-board-wrap.goose-shuffling,
  .battle-shell .goose-grid.goose-shuffling .goose-tile {
    animation-duration: 720ms;
  }

  .battle-shell .fullness-attention-danger .fullness-bar,
  .battle-shell.player-fullness-danger .board-wrap::before,
  .battle-shell.enemy-fullness-danger .board-wrap::after,
  .battle-shell .goose-board-wrap.goose-shuffling,
  .battle-shell .goose-grid.goose-shuffling .goose-tile {
    animation: none;
  }
}

@media (max-height: 820px) {
  .game-shell.battle-shell {
    grid-template-rows: 27% 50% 23%;
  }

  .battle-shell .combat-hud {
    padding-top: calc(clamp(52px, 12svh, 72px) + var(--safe-top));
  }

  .battle-shell .unit-name {
    margin-top: -13px;
  }

  .battle-shell .bottom-dock {
    gap: 6px;
  }
}

@keyframes unlock-cell-flip {
  0% {
    opacity: 1;
    filter: brightness(1);
    transform: scaleX(1);
  }
  48% {
    opacity: 1;
    filter: brightness(1.26);
    transform: scaleX(0.08);
  }
  100% {
    opacity: 0;
    filter: brightness(1.1);
    transform: scaleX(0.08);
  }
}

@keyframes unlock-cell-shine {
  0%,
  100% {
    opacity: 0;
    transform: scaleX(1);
  }
  42% {
    opacity: 0.85;
    transform: scaleX(0.16);
  }
}

@media (prefers-reduced-motion: reduce) {
  .battle-shell .cell.unlocking::before,
  .battle-shell .cell.unlocking::after {
    animation: none !important;
    display: none;
  }
}

.modal.result-fullscreen {
  padding: 0;
  place-items: stretch;
  background: transparent;
  -webkit-backdrop-filter: none;
  backdrop-filter: none;
}

.modal.result-fullscreen::before {
  content: none;
}

.result-screen {
  position: relative;
  width: 100%;
  min-height: 100%;
  overflow: hidden;
  padding: 0;
  background:
    var(--asset-result-win-bg, url("./assets/tex_bg_win.jpg")) center / cover no-repeat,
    #fff3cf;
}

.result-screen.lose {
  background:
    var(--asset-result-lose-bg, url("./assets/tex_bg_lose.jpg")) center / cover no-repeat,
    #fff3cf;
}

.result-screen::before {
  content: none;
}

.result-screen h2,
.result-screen p {
  display: none;
}

.result-stats {
  position: absolute;
  left: 5.4%;
  right: 5.4%;
  bottom: calc(11.8% + var(--safe-bottom));
  z-index: 2;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: clamp(8px, 2.3vw, 12px);
  width: auto;
}

.result-stat {
  position: relative;
  --result-stat-lift: clamp(28px, 7.4vw, 42px);
  min-height: clamp(82px, 18.8vw, 104px);
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  grid-template-rows: auto auto;
  align-content: center;
  align-items: center;
  row-gap: 2px;
  padding: clamp(9px, 2.3vw, 13px) clamp(6px, 1.7vw, 10px);
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  text-align: center;
  transform: translateY(calc(var(--result-stat-lift) * -1));
}

.result-stat-icon {
  display: none;
}

.result-stat-icon::before {
  font-size: clamp(28px, 6.8vw, 38px);
  font-weight: 1000;
  line-height: 1;
}

.result-stat-icon.time::before {
  content: "时";
}

.result-stat-icon.move::before {
  content: "招";
}

.result-stat-icon.damage::before {
  content: "伤";
}

.result-stat-icon.hurt::before {
  content: "血";
}

.result-stat-icon.heal::before {
  content: "愈";
}

.result-stat-icon.draw::before {
  content: "抽";
}

.result-stat-icon.wave::before {
  content: "波";
}

.result-stat-icon.result::before {
  content: "果";
}

.result-stat span {
  min-width: 0;
  color: #7a5231;
  font-size: clamp(14px, 3.4vw, 18px);
  font-weight: 1000;
  line-height: 1.15;
  text-align: center;
  text-shadow: 0 1px 0 rgba(255, 255, 255, 0.8);
  white-space: nowrap;
}

.result-stat b {
  min-width: 0;
  color: #5a351f;
  font-size: clamp(28px, 7.4vw, 42px);
  font-weight: 1000;
  line-height: 1;
  text-align: center;
  letter-spacing: 0;
  text-shadow:
    0 2px 0 rgba(255, 255, 255, 0.58),
    0 3px 5px rgba(116, 70, 27, 0.13);
}

.result-actions {
  position: absolute;
  left: 6%;
  right: 6%;
  bottom: calc(3.4% + var(--safe-bottom));
  z-index: 2;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: clamp(10px, 3vw, 18px);
  width: auto;
}

.result-btn,
.result-btn.primary,
.result-btn.secondary {
  min-height: 0;
  aspect-ratio: 433 / 153;
  border-radius: 0;
  background: center / contain no-repeat;
  color: transparent;
  font-size: 0;
  box-shadow: none;
}

.result-btn.primary {
  background-image: var(--asset-result-primary, url("./assets/common@btn_again.png"));
}

.result-btn.secondary {
  background-image: var(--asset-result-secondary, url("./assets/common@btn_back.png"));
}

.result-rank-card {
  position: absolute;
  left: 6%;
  right: 6%;
  top: 39%;
  transform: translateY(150%);
  z-index: 2;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  min-height: 78px;
  padding: 10px 12px;
  border: 1px solid rgba(255, 233, 166, 0.44);
  border-radius: 14px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.62), rgba(255, 241, 188, 0.42)),
    rgba(120, 73, 27, 0.46);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.7),
    0 12px 28px rgba(83, 47, 17, 0.2);
}

.result-rank-card.loss {
  border-color: rgba(166, 92, 77, 0.44);
}

.result-rank-card > img {
  width: clamp(48px, 12vw, 64px);
  height: clamp(48px, 12vw, 64px);
  object-fit: contain;
}

.result-rank-main {
  min-width: 0;
  display: grid;
  gap: 5px;
}

.result-rank-main b,
.result-rank-main span,
.result-rank-card strong {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.result-rank-main b {
  color: #6b3d1e;
  font-size: clamp(17px, 4.2vw, 22px);
  font-weight: 1000;
  line-height: 1.1;
}

.result-rank-main span {
  color: #8e5e2f;
  font-size: clamp(12px, 3vw, 14px);
  font-weight: 1000;
}

.result-rank-main i {
  position: relative;
  height: 8px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(119, 76, 34, 0.18);
}

.result-rank-main i::before,
.result-rank-main i em {
  content: "";
  position: absolute;
  left: 0;
  top: 0;
  height: 100%;
  border-radius: inherit;
}

.result-rank-main i::before {
  width: var(--rank-before);
  background: rgba(110, 79, 49, 0.24);
}

.result-rank-main i em {
  width: var(--rank-after);
  background: linear-gradient(90deg, #55d893, #ffe07a);
}

.result-rank-card.loss .result-rank-main i em {
  background: linear-gradient(90deg, #e85f6d, #f2ba58);
}

.result-rank-card strong {
  color: #24945d;
  font-size: clamp(22px, 5.8vw, 32px);
  font-weight: 1000;
  text-align: right;
}

.result-rank-card.loss strong {
  color: #b43c40;
}

.result-promotion-overlay {
  position: absolute;
  inset: 0;
  z-index: 8;
  display: grid;
  place-items: center;
  padding: clamp(24px, 7vw, 44px);
  background: rgba(89, 55, 22, 0.28);
  -webkit-backdrop-filter: blur(4px);
  backdrop-filter: blur(4px);
}

.result-promotion-card {
  width: min(78vw, 360px);
  display: grid;
  justify-items: center;
  gap: clamp(7px, 2vw, 11px);
  padding: clamp(22px, 5.8vw, 32px) clamp(18px, 5vw, 28px) clamp(18px, 5vw, 26px);
  border: 2px solid rgba(255, 226, 139, 0.72);
  border-radius: 24px;
  background:
    radial-gradient(circle at 50% 0%, rgba(255, 236, 151, 0.92), transparent 42%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.94), rgba(255, 239, 187, 0.94));
  box-shadow:
    inset 0 2px 0 rgba(255, 255, 255, 0.8),
    0 18px 38px rgba(91, 55, 22, 0.28);
  animation: result-promotion-pop 420ms cubic-bezier(0.2, 0.9, 0.2, 1.12) both;
}

.result-promotion-card span {
  color: #d28a24;
  font-size: clamp(24px, 6.2vw, 34px);
  font-weight: 1000;
  line-height: 1;
  text-shadow:
    0 2px 0 rgba(255, 255, 255, 0.9),
    0 5px 10px rgba(152, 93, 22, 0.18);
  white-space: nowrap;
}

.result-promotion-card img {
  width: clamp(78px, 22vw, 112px);
  height: clamp(78px, 22vw, 112px);
  object-fit: contain;
  filter: drop-shadow(0 8px 12px rgba(111, 73, 20, 0.22));
}

.result-promotion-card b {
  color: #65381d;
  font-size: clamp(22px, 5.6vw, 30px);
  font-weight: 1000;
  line-height: 1.08;
  text-align: center;
}

.result-promotion-card i {
  color: #936333;
  font-size: clamp(13px, 3.4vw, 16px);
  font-style: normal;
  font-weight: 1000;
  line-height: 1.2;
  text-align: center;
}

.result-promotion-card button {
  width: min(210px, 62vw);
  min-height: clamp(46px, 12vw, 56px);
  margin-top: 4px;
  border: 2px solid rgba(128, 160, 64, 0.38);
  border-radius: 999px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.45), transparent 48%),
    linear-gradient(180deg, #cce984, #8fbd4d);
  color: #fffaf0;
  font-size: clamp(17px, 4.5vw, 22px);
  font-weight: 1000;
  text-shadow: 0 2px 0 rgba(76, 107, 35, 0.45);
  box-shadow:
    inset 0 -4px 0 rgba(95, 127, 44, 0.2),
    0 7px 0 rgba(96, 117, 45, 0.18);
}

@media (max-height: 820px) {
  .result-rank-card {
    top: 36%;
    min-height: 68px;
    padding-top: 8px;
    padding-bottom: 8px;
  }

  .result-stats {
    bottom: calc(10.4% + var(--safe-bottom));
    gap: 7px;
  }

  .result-stat {
    min-height: 74px;
    padding-top: 8px;
    padding-bottom: 8px;
  }

  .result-actions {
    bottom: calc(2.6% + var(--safe-bottom));
  }
}

@keyframes result-promotion-pop {
  from {
    opacity: 0;
    transform: translateY(18px) scale(0.88);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@media (prefers-reduced-motion: reduce) {
  .result-promotion-card {
    animation: none;
  }
}
