/* =========================================================
   暗棋对决 · 军棋  (mobile-first, portrait)
   ========================================================= */
:root {
  --orange: #FF8A3D;
  --orange-deep: #E9631A;
  --orange-ink: #B44A0B;
  --cream: #FFF7EC;
  --paper: #FFFCF6;
  --ink: #2C211A;
  --ink-2: #6E5A49;
  --ink-3: #A08A76;
  --teal: #2E8C99;
  --teal-deep: #1D6672;
  --line: #EEDCC7;
  --line-soft: rgba(160, 120, 80, .14);
  --red-piece: #EF6326;
  --blue-piece: #2E8793;
  --shadow-sm: 0 5px 14px rgba(120, 70, 30, .08);
  --shadow-md: 0 12px 26px rgba(120, 70, 30, .13);
  --shadow-lg: 0 22px 50px rgba(90, 45, 15, .2);
  --radius: 18px;
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
}

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

html, body {
  margin: 0;
  padding: 0;
  height: 100%;
  overflow: hidden;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "HarmonyOS Sans SC",
    "Helvetica Neue", "Microsoft YaHei", sans-serif;
  color: var(--ink);
  background: #F4E3CF;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  user-select: none;
  -webkit-user-select: none;
}

button {
  font: inherit;
  color: inherit;
  background: none;
  border: 0;
  padding: 0;
  margin: 0;
  cursor: pointer;
  touch-action: manipulation;
}

button:focus { outline: none; }
button:focus-visible { outline: 2px solid rgba(255, 138, 61, .7); outline-offset: 2px; }

#app { height: 100%; }

.screen {
  display: none;
  height: 100vh;
  height: 100dvh;
  width: 100%;
  position: relative;
  overflow: hidden;
}

.screen.active { display: flex; flex-direction: column; }

/* ============ 首页 ============ */
.home-screen {
  overflow-y: auto;
  overflow-x: hidden;
  background:
    radial-gradient(120% 72% at 92% -8%, #FFD6B7 0%, rgba(255, 214, 183, 0) 62%),
    radial-gradient(95% 55% at -10% 38%, rgba(64, 154, 163, .18), rgba(64, 154, 163, 0) 66%),
    linear-gradient(180deg, #FFF8EE 0%, #FFF2E1 55%, #FBE8D2 100%);
}
.home-screen.active { display: block; }

.home-bg {
  position: fixed;
  inset: 0;
  pointer-events: none;
  overflow: hidden;
}
.blob {
  position: absolute;
  display: block;
  border-radius: 50%;
  filter: blur(34px);
  opacity: .55;
}
.blob-a {
  width: 240px; height: 240px;
  right: -90px; top: -60px;
  background: rgba(255, 138, 61, .5);
}
.blob-b {
  width: 220px; height: 220px;
  left: -100px; top: 42%;
  background: rgba(64, 154, 163, .32);
}
.dot-grid {
  position: absolute;
  inset: 0;
  background-image: radial-gradient(rgba(140, 92, 52, .16) 1px, transparent 1px);
  background-size: 18px 18px;
  opacity: .28;
  mask-image: linear-gradient(180deg, transparent 0%, #000 22%, #000 76%, transparent 100%);
  -webkit-mask-image: linear-gradient(180deg, transparent 0%, #000 22%, #000 76%, transparent 100%);
}

.home-scroll {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 460px;
  min-height: 100%;
  margin: 0 auto;
  padding: calc(20px + var(--safe-top)) 18px calc(18px + var(--safe-bottom));
  display: flex;
  flex-direction: column;
}

.home-head { text-align: left; }

.brand-row {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 12px 6px 7px;
  border-radius: 999px;
  background: rgba(255, 252, 245, .78);
  border: 1px solid rgba(226, 194, 160, .85);
  box-shadow: 0 4px 12px rgba(150, 90, 40, .07);
}
.brand-mark {
  width: 26px; height: 26px;
  border-radius: 50%;
  display: grid; place-items: center;
  background: linear-gradient(150deg, #FFA05C, #EB641E);
  color: #FFF8EF;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .4);
}
.brand-mark .mp-icon { width: 17px; height: 17px; }
.brand-tag {
  font-size: 11px;
  letter-spacing: 1.2px;
  font-weight: 700;
  color: #9B6F4C;
}

.home-title {
  margin: 14px 0 0;
  font-size: clamp(38px, 10.6vw, 48px);
  line-height: 1.04;
  font-weight: 900;
  letter-spacing: 2px;
  color: #2A1D13;
  text-shadow: 0 2px 0 rgba(255, 255, 255, .75);
}
.home-sub {
  margin: 9px 0 0;
  font-size: 13px;
  line-height: 1.75;
  color: #8B715D;
  letter-spacing: .4px;
}

/* 首页对弈主视觉 */
.hero-clash {
  position: relative;
  margin: 18px 0 16px;
  height: clamp(168px, 23vh, 206px);
  border-radius: 26px;
  overflow: hidden;
  background:
    radial-gradient(80% 120% at 50% 0%, rgba(255, 160, 92, .28), transparent 60%),
    linear-gradient(155deg, #3A261B 0%, #26170F 60%, #1D120C 100%);
  box-shadow: 0 18px 34px rgba(66, 32, 10, .26), inset 0 0 0 1px rgba(255, 190, 130, .16);
  flex: none;
}
.hero-lines {
  position: absolute;
  inset: -30%;
  background-image:
    linear-gradient(rgba(255, 255, 255, .055) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, .055) 1px, transparent 1px);
  background-size: 34px 34px;
  transform: rotate(-9deg);
}
.hero-glow {
  position: absolute;
  left: 50%; top: 50%;
  width: 220px; height: 220px;
  margin: -110px 0 0 -110px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255, 138, 61, .28), transparent 65%);
  filter: blur(4px);
}
.hero-piece {
  position: absolute;
  top: 26%;
  width: 82px;
  height: 100px;
  border-radius: 16px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 5px;
  color: #FFF8EF;
  border: 2px solid rgba(255, 240, 220, .55);
  box-shadow: 0 14px 22px rgba(0, 0, 0, .34), inset 0 2px 0 rgba(255, 255, 255, .34);
}
.hero-piece::after {
  content: "";
  position: absolute;
  inset: 6px;
  border-radius: 11px;
  border: 1px solid rgba(255, 255, 255, .16);
  pointer-events: none;
}
.hero-piece.red {
  left: calc(50% - 120px);
  transform: rotate(-9deg);
  background: linear-gradient(155deg, #FF9C5C 0%, #ED6324 55%, #CE4710 100%);
}
.hero-piece.blue {
  left: calc(50% + 38px);
  transform: rotate(9deg);
  background: linear-gradient(155deg, #5DB8C0 0%, #2C8592 55%, #1B5F6B 100%);
}
.hp-rank {
  font-size: 25px;
  font-weight: 900;
  letter-spacing: 2px;
  text-shadow: 0 2px 0 rgba(0, 0, 0, .2);
  line-height: 1;
}
.hp-foot {
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 1px;
  opacity: .68;
}
.hero-burst {
  position: absolute;
  left: 50%; top: 50%;
  width: 58px; height: 58px;
  margin: -29px 0 0 -29px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: linear-gradient(160deg, #FFE08A, #FFC24D);
  color: #5C3106;
  font-weight: 900;
  font-size: 18px;
  letter-spacing: .5px;
  box-shadow: 0 0 0 7px rgba(255, 205, 100, .12), 0 10px 20px rgba(0, 0, 0, .32);
  transform: rotate(-7deg);
  z-index: 3;
}
.hero-caption {
  position: absolute;
  left: 0; right: 0; bottom: 11px;
  text-align: center;
  font-size: 10.5px;
  letter-spacing: 1.4px;
  color: rgba(255, 233, 210, .62);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
}
.hero-caption .mp-icon { width: 13px; height: 13px; color: #FFB977; }
.hero-orbit {
  position: absolute;
  font-size: 9px;
  letter-spacing: 1px;
  color: rgba(255, 226, 200, .3);
  border: 1px solid rgba(255, 226, 200, .18);
  padding: 3px 7px;
  border-radius: 8px;
}
.orbit-a { left: 9%; top: 11%; transform: rotate(-8deg); }
.orbit-b { right: 9%; bottom: 19%; transform: rotate(7deg); }

/* 模式入口 */
.mode-stack { display: flex; flex-direction: column; gap: 11px; flex: none; }
.mode-card {
  position: relative;
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  text-align: left;
  padding: 14px;
  border-radius: 20px;
  border: 1px solid var(--line);
  background: rgba(255, 252, 246, .92);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
  transition: transform .12s ease, box-shadow .12s ease;
}
.mode-card:active { transform: scale(.982); box-shadow: 0 4px 10px rgba(120, 70, 30, .08); }
.mode-card.ai {
  color: #FFF9F2;
  border-color: #FFB077;
  background:
    radial-gradient(120% 160% at 100% 0%, rgba(255, 236, 200, .38), transparent 55%),
    linear-gradient(120deg, #FF9C55 0%, #F4791F 55%, #E86214 100%);
  box-shadow: 0 14px 26px rgba(226, 92, 25, .3);
}
.mode-card.ai::after {
  content: "";
  position: absolute;
  right: -26px; top: -38px;
  width: 112px; height: 112px;
  border-radius: 50%;
  border: 18px solid rgba(255, 255, 255, .1);
  pointer-events: none;
}
.mode-icon {
  flex: none;
  width: 48px; height: 48px;
  border-radius: 15px;
  display: grid; place-items: center;
  background: #FFF1E2;
  color: var(--orange-deep);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .65);
}
.mode-card.ai .mode-icon {
  background: rgba(255, 255, 255, .2);
  color: #FFF8EF;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .3);
}
.mode-icon .mp-icon { width: 26px; height: 26px; }
.mode-text { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.mode-text strong { font-size: 17px; font-weight: 900; letter-spacing: .5px; }
.mode-text em { font-style: normal; font-size: 11.5px; line-height: 1.35; opacity: .78; }
.mode-card.pvp {
  border-color: #CFE7E8;
  background:
    radial-gradient(120% 160% at 100% 0%, rgba(196, 240, 242, .55), transparent 58%),
    linear-gradient(120deg, #FBFFFF 0%, #F0FAFA 70%, #E7F5F6 100%);
  box-shadow: 0 10px 22px rgba(36, 110, 118, .1);
}
.mode-card.pvp .mode-icon {
  background: #DFF2F3;
  color: var(--teal-deep);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .8);
}
.mode-card.pvp .mode-text em { color: #55787B; opacity: 1; }
.mode-arrow {
  flex: none;
  width: 34px; height: 34px;
  border-radius: 50%;
  display: grid; place-items: center;
  background: rgba(255, 255, 255, .22);
  color: #FFF8EF;
}
.mode-card.pvp .mode-arrow { background: var(--teal); color: #FFF; }
.mode-arrow .mp-icon { width: 20px; height: 20px; }

/* 首页等级速览 */
.rank-ladder {
  margin-top: 12px;
  padding: 10px 10px 11px;
  border-radius: 16px;
  border: 1px solid rgba(232, 207, 180, .7);
  background: rgba(255, 252, 246, .55);
  flex: none;
}
.rank-ladder-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 7px;
  font-size: 9.5px;
  letter-spacing: .6px;
  color: #AE947C;
}
.rank-ladder-head span { font-weight: 800; color: #8B7059; font-size: 10px; }
.rank-ladder-head em { font-style: normal; }
.rank-ladder-line {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0;
  font-size: 10px;
  color: #7D6550;
}
.rank-ladder-line b {
  font-weight: 800;
  color: #5A4534;
  background: #FFF3E4;
  border: 1px solid #F1D9BF;
  border-radius: 5px;
  padding: 2px 4px;
  line-height: 1.3;
  white-space: nowrap;
}
.rank-ladder-line i {
  font-style: normal;
  color: #C9A88A;
  font-size: 8px;
  margin: 0;
}

/* 首页数据 */
.home-stats {
  margin-top: 14px;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 11px 12px;
  border-radius: 18px;
  border: 1px solid rgba(232, 207, 180, .8);
  background: rgba(255, 252, 246, .7);
  backdrop-filter: blur(6px);
  flex: none;
}
.stat { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 1px; }
.stat b { font-size: 17px; font-weight: 900; color: #47301F; line-height: 1.2; }
.stat span { font-size: 9.5px; color: #A18A74; letter-spacing: .6px; }
.stat-div { width: 1px; height: 25px; background: rgba(210, 180, 148, .55); }
.home-tool {
  margin-left: 2px;
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 7px 9px;
  border-radius: 11px;
  border: 1px solid #F0DAC4;
  background: #FFF4E8;
  color: #956E4F;
  font-size: 10.5px;
  font-weight: 600;
}
.home-tool .mp-icon { width: 15px; height: 15px; }
.home-tool.off { opacity: .55; }

.home-links {
  margin-top: auto;
  padding-top: 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex: none;
}
.link-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 11.5px;
  color: #8A7058;
  padding: 6px 0;
}
.link-btn .mp-icon { width: 15px; height: 15px; color: #B48860; }
.home-ver { font-size: 10px; color: #BEAA94; letter-spacing: .5px; }

/* ============ 布阵页 ============ */
.setup-screen {
  padding: calc(6px + var(--safe-top)) 10px calc(6px + var(--safe-bottom));
  background:
    radial-gradient(110% 50% at 50% -10%, rgba(255, 170, 100, .22), transparent 70%),
    linear-gradient(180deg, #FFF9F0 0%, #F7E7D3 100%);
}
.setup-head {
  flex: none;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 2px 2px 8px;
}
.round-btn {
  flex: none;
  width: 42px; height: 42px;
  border-radius: 14px;
  display: grid; place-items: center;
  background: #FFFDF8;
  border: 1px solid #EAD6BF;
  color: #6E523A;
  box-shadow: var(--shadow-sm);
  transition: transform .1s, background .1s;
}
.round-btn:active { transform: scale(.94); background: #FFF2E2; }
.round-btn .mp-icon { width: 21px; height: 21px; }
.round-btn.small { width: 40px; height: 40px; border-radius: 13px; }
.round-btn.small .mp-icon { width: 19px; height: 19px; }
.setup-title { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.setup-title strong { font-size: 17px; font-weight: 900; letter-spacing: .5px; }
.setup-title span {
  font-size: 10.5px;
  color: #977F69;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.pill-btn {
  flex: none;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  height: 36px;
  padding: 0 12px;
  border-radius: 12px;
  background: #FFF0E0;
  border: 1px solid #F2D3B2;
  color: #B45112;
  font-size: 12px;
  font-weight: 800;
  box-shadow: 0 4px 10px rgba(180, 90, 30, .08);
}
.pill-btn:active { transform: scale(.96); }
.pill-btn .mp-icon { width: 16px; height: 16px; }

.board-stage {
  position: relative;
  flex: 1;
  min-height: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
}
.setup-foot { flex: none; padding: 8px 2px 2px; }
.setup-tip {
  display: flex;
  align-items: flex-start;
  gap: 5px;
  font-size: 10px;
  line-height: 1.5;
  color: #9B8069;
  padding: 0 4px 8px;
}
.setup-tip .mp-icon { width: 13px; height: 13px; margin-top: 1px; flex: none; color: #C09067; }

/* ============ 对局页 ============ */
.game-screen {
  padding: calc(5px + var(--safe-top)) 9px calc(5px + var(--safe-bottom));
  background:
    radial-gradient(110% 55% at 50% 0%, rgba(255, 192, 140, .2), transparent 62%),
    linear-gradient(180deg, #FFF9F1 0%, #F5E4D0 100%);
}
.game-top { flex: none; display: flex; align-items: center; gap: 8px; }
.side-panel {
  flex: 1;
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 9px;
  border-radius: 16px;
  border: 1px solid rgba(232, 211, 188, .9);
  background: rgba(255, 253, 248, .78);
  box-shadow: var(--shadow-sm);
  transition: border-color .2s, box-shadow .2s;
}
.side-panel.active { border-color: #FFB47E; box-shadow: 0 0 0 2px rgba(255, 138, 61, .14), var(--shadow-sm); }
.side-panel.enemy.active { border-color: #8ECBD1; box-shadow: 0 0 0 2px rgba(46, 140, 153, .14), var(--shadow-sm); }
.side-panel.mine.active { border-color: #FFB47E; }
.avatar {
  flex: none;
  width: 36px; height: 36px;
  border-radius: 12px;
  display: grid; place-items: center;
  font-size: 15px;
  font-weight: 900;
  letter-spacing: .5px;
  color: #FFF8EF;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .3);
}
.avatar .mp-icon { width: 22px; height: 22px; }
.avatar-blue { background: linear-gradient(155deg, #5FB9C1, #216F7B); }
.avatar-red { background: linear-gradient(155deg, #FF9B5A, #D95014); }
.side-info { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 1px; }
.side-info strong {
  font-size: 13px;
  font-weight: 900;
  letter-spacing: .3px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.side-info span {
  font-size: 10px;
  color: #967D66;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.side-badge {
  flex: none;
  font-size: 9px;
  font-weight: 800;
  color: #9A7A5D;
  background: #F6EADB;
  border-radius: 7px;
  padding: 3px 6px;
  letter-spacing: .4px;
}
.side-panel.active .side-badge { color: #FFF; background: var(--orange); }
.side-panel.enemy.active .side-badge { background: var(--teal); }

.game-bottom { flex: none; display: flex; flex-direction: column; gap: 6px; padding-top: 6px; }
.event-ticker {
  display: flex;
  align-items: center;
  gap: 6px;
  min-height: 30px;
  padding: 6px 10px;
  border-radius: 11px;
  background: rgba(255, 252, 246, .72);
  border: 1px solid rgba(233, 213, 191, .9);
  color: #7D6652;
  font-size: 11px;
  line-height: 1.4;
}
.event-ticker .mp-icon { flex: none; width: 14px; height: 14px; color: #E07A33; }
.event-ticker span { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.game-actions { display: flex; gap: 7px; }
.action-btn {
  flex: 1;
  height: 38px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  background: #FFFDF8;
  border: 1px solid #EAD6BF;
  color: #6F5540;
  font-size: 12.5px;
  font-weight: 800;
  box-shadow: 0 4px 10px rgba(120, 70, 30, .06);
  transition: transform .1s, background .1s;
}
.action-btn:active { transform: scale(.982); background: #FFF3E5; }
.action-btn .mp-icon { width: 16px; height: 16px; }
.action-btn.danger { color: #C24C2F; background: #FFF4EE; border-color: #F3D3C4; }

/* ============ 棋盘 ============ */
.board {
  position: relative;
  flex: none;
  width: 320px;
  height: 499px;
  border-radius: 20px;
  overflow: hidden;
  background:
    linear-gradient(180deg, #FBF0DF 0%, #F7E8D3 48%, #F2DCC1 100%);
  box-shadow:
    0 16px 34px rgba(110, 62, 22, .2),
    inset 0 0 0 4px #FFFBF3,
    inset 0 0 0 5px #E7C8A3;
  touch-action: manipulation;
  isolation: isolate;
}
.board::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 20px;
  box-shadow: inset 0 2px 10px rgba(120, 70, 30, .12);
  pointer-events: none;
  z-index: 8;
}
.zone {
  position: absolute;
  left: 0; right: 0;
  height: 50%;
  pointer-events: none;
  z-index: 0;
}
.zone-top {
  top: 0;
  background: linear-gradient(180deg, rgba(46, 140, 153, .13), rgba(46, 140, 153, .015));
}
.zone-bottom {
  bottom: 0;
  background: linear-gradient(0deg, rgba(233, 99, 26, .12), rgba(233, 99, 26, .01));
}
.board-lines {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 1;
  pointer-events: none;
  overflow: visible;
}
.board-lines .road {
  fill: none;
  stroke: rgba(153, 113, 73, .26);
  stroke-width: 1.4;
  vector-effect: non-scaling-stroke;
}
.board-lines .rail {
  fill: none;
  stroke: rgba(122, 82, 47, .44);
  stroke-width: 5.2;
  stroke-linecap: round;
  vector-effect: non-scaling-stroke;
}
.board-lines .rail-dash {
  fill: none;
  stroke: rgba(255, 244, 226, .8);
  stroke-width: 1.4;
  stroke-dasharray: 5 5;
  stroke-linecap: round;
  vector-effect: non-scaling-stroke;
}
.board-lines .front {
  fill: none;
  stroke: rgba(192, 123, 65, .32);
  stroke-width: 1.2;
  stroke-dasharray: 7 7;
  vector-effect: non-scaling-stroke;
}

.cell {
  position: absolute;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  border-radius: 8px;
  background: rgba(255, 255, 255, .26);
  border: 1px solid rgba(158, 117, 77, .11);
  transition: background .12s ease, box-shadow .12s ease;
  touch-action: manipulation;
}
.cell.rail { background: rgba(255, 255, 255, .34); }
.cell.camp {
  border-radius: 50%;
  border: 1px dashed rgba(199, 147, 96, .7);
  background: radial-gradient(circle at 50% 45%, rgba(255, 255, 255, .8), rgba(255, 245, 230, .3));
}
.cell.hq {
  border: 1.5px solid rgba(216, 129, 65, .48);
  background: linear-gradient(180deg, rgba(255, 202, 154, .4), rgba(255, 172, 112, .22));
}
.cell .mark {
  font-size: calc(var(--pw, 340) * .026px);
  font-weight: 800;
  letter-spacing: 1px;
  color: rgba(150, 108, 69, .52);
  pointer-events: none;
  line-height: 1;
  white-space: nowrap;
}
.cell.camp .mark { color: rgba(179, 126, 76, .62); }
.cell.hq .mark { font-size: calc(var(--pw, 340) * .0205px); color: rgba(176, 103, 48, .62); }

/* 棋子 */
.piece {
  position: relative;
  width: calc(100% - 3px);
  height: calc(100% - 3px);
  border-radius: 7px;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, .42);
  box-shadow:
    0 2px 0 rgba(90, 45, 10, .24),
    0 4px 7px rgba(90, 45, 10, .2),
    inset 0 1px 0 rgba(255, 255, 255, .38);
  color: #FFF8EF;
  will-change: transform;
}
.piece.red { background: linear-gradient(155deg, #FF9557 0%, #EF6326 55%, #D24A12 100%); }
.piece.blue { background: linear-gradient(155deg, #60BAC2 0%, #2D8692 55%, #1C6470 100%); }
.piece.zhadan {
  background: linear-gradient(155deg, #544646 0%, #332A2A 55%, #201A1A 100%);
  color: #FFD8A4;
  border-color: rgba(255, 180, 110, .38);
}
.piece.dilei {
  background: linear-gradient(155deg, #8A6F4D 0%, #5C452B 55%, #43311C 100%);
  color: #FFE1B2;
  border-color: rgba(255, 222, 168, .38);
}
.piece.junqi {
  background: linear-gradient(155deg, #FFDC83 0%, #F5AE2E 55%, #DE8E13 100%);
  color: #5B3406;
  border-color: rgba(255, 248, 214, .9);
  box-shadow: 0 2px 0 #B97B0C, 0 5px 10px rgba(160, 95, 10, .34), inset 0 1px 0 rgba(255, 255, 255, .55);
}
.p-rank {
  position: relative;
  z-index: 1;
  font-size: calc(var(--pw, 340) * .041px);
  font-weight: 900;
  letter-spacing: .3px;
  line-height: 1;
  white-space: nowrap;
  text-shadow: 0 1px 0 rgba(0, 0, 0, .2);
}
.piece.junqi .p-rank { text-shadow: 0 1px 0 rgba(255, 255, 255, .4); }
.piece.tier-5::after {
  content: "";
  position: absolute;
  top: 3px; left: 50%;
  width: calc(var(--pw, 340) * .038px);
  height: 2px;
  border-radius: 2px;
  background: rgba(255, 230, 160, .85);
  transform: translateX(-50%);
}
.piece.revealed::before {
  content: "";
  position: absolute;
  top: 3px; right: 3px;
  width: 4px; height: 4px;
  border-radius: 50%;
  background: #FFF0B8;
  box-shadow: 0 0 4px rgba(255, 224, 138, .9);
  z-index: 2;
}
.piece.flag-live {
  animation: flagPulse 1.5s ease-in-out infinite;
}
.piece.back {
  background:
    repeating-linear-gradient(45deg, rgba(255, 255, 255, .13) 0 4px, rgba(255, 255, 255, 0) 4px 8px),
    linear-gradient(155deg, #DDB288 0%, #C08B5E 55%, #A66F43 100%);
  color: rgba(84, 44, 16, .55);
  border-color: rgba(255, 237, 214, .48);
}
.piece.back.blue {
  background:
    repeating-linear-gradient(45deg, rgba(255, 255, 255, .13) 0 4px, rgba(255, 255, 255, 0) 4px 8px),
    linear-gradient(155deg, #92BCBE 0%, #6C999F 55%, #527E86 100%);
  color: rgba(15, 62, 68, .55);
  border-color: rgba(230, 250, 250, .42);
}
.back-mark {
  font-size: calc(var(--pw, 340) * .042px);
  font-weight: 900;
  letter-spacing: 2px;
  opacity: .4;
  transform: translateZ(0);
}

/* 选中 / 可走 / 攻击 / 最后一步 */
.cell.selected { z-index: 7; }
.cell.selected .piece {
  transform: translateY(-2px) scale(1.045);
  box-shadow:
    0 0 0 2.5px #FFD166,
    0 7px 14px rgba(120, 50, 0, .32),
    inset 0 1px 0 rgba(255, 255, 255, .45);
}
.cell.hint::after {
  content: "";
  position: absolute;
  left: 50%; top: 50%;
  width: calc(var(--pw, 340) * .026px);
  height: calc(var(--pw, 340) * .026px);
  margin: calc(var(--pw, 340) * -.013px) 0 0 calc(var(--pw, 340) * -.013px);
  border-radius: 50%;
  background: rgba(233, 99, 26, .72);
  box-shadow: 0 0 0 4px rgba(255, 138, 61, .16);
  z-index: 4;
  animation: hintPulse 1.15s ease-in-out infinite;
  pointer-events: none;
}
.cell.hint-attack {
  box-shadow: inset 0 0 0 2px rgba(210, 58, 44, .62);
  border-radius: 8px;
}
.cell.hint-attack::after {
  content: "";
  position: absolute;
  top: 2px; right: 2px;
  width: calc(var(--pw, 340) * .018px);
  height: calc(var(--pw, 340) * .018px);
  border-radius: 50%;
  background: #D83A2C;
  border: 1px solid rgba(255, 255, 255, .8);
  z-index: 5;
  animation: hintPulse 1s ease-in-out infinite;
  pointer-events: none;
}
.cell.last-from { box-shadow: inset 0 0 0 1.5px rgba(233, 99, 26, .2); }
.cell.last-to { box-shadow: inset 0 0 0 2px rgba(255, 172, 72, .75), 0 0 14px rgba(255, 160, 60, .3); }

.cell:active { background: rgba(255, 255, 255, .46); }
.cell.camp:active { border-color: rgba(199, 147, 96, .9); }

.board-watermark {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  z-index: 5;
  padding: 5px 12px;
  border-radius: 20px;
  font-size: 10px;
  letter-spacing: 2px;
  color: rgba(118, 80, 50, .55);
  background: rgba(255, 250, 241, .86);
  border: 1px solid rgba(190, 150, 108, .35);
  box-shadow: 0 4px 10px rgba(120, 70, 30, .08);
  pointer-events: none;
  white-space: nowrap;
}
.board-watermark.top { top: 23%; }
.board-watermark.bottom { bottom: 23%; }

/* 战斗表现 */
.clash-layer {
  position: absolute;
  inset: 0;
  z-index: 30;
  display: none;
  align-items: center;
  justify-content: center;
  background: rgba(34, 20, 12, .38);
  backdrop-filter: blur(2px);
  border-radius: 6px;
}
.clash-layer.show { display: flex; animation: fadeIn .14s ease-out; }
.clash-box {
  position: relative;
  padding: 18px 20px 15px;
  border-radius: 22px;
  background: linear-gradient(170deg, #FFFCF6, #FFF0DD);
  border: 1px solid #FFD9B4;
  box-shadow: 0 20px 40px rgba(40, 20, 8, .35);
  text-align: center;
  animation: popIn .25s cubic-bezier(.2, .9, .3, 1.2);
}
.clash-row { display: flex; align-items: center; justify-content: center; gap: 10px; }
.clash-piece {
  width: 62px; height: 74px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 17px;
  font-weight: 900;
  color: #FFF8EF;
  border: 1px solid rgba(255, 255, 255, .45);
  box-shadow: 0 3px 0 rgba(90, 45, 10, .24), 0 7px 12px rgba(90, 45, 10, .2);
  letter-spacing: 1px;
}
.clash-piece.red { background: linear-gradient(155deg, #FF9A5A, #E8561F); }
.clash-piece.blue { background: linear-gradient(155deg, #5CB8C0, #1F6E7A); }
.clash-piece.zhadan { background: linear-gradient(155deg, #4A3D3D, #241D1D); color: #FFD8A4; }
.clash-piece.dilei { background: linear-gradient(155deg, #856A48, #49351F); color: #FFE1B2; }
.clash-piece.junqi { background: linear-gradient(155deg, #FFDC83, #E79A17); color: #5B3406; }
.clash-vs {
  font-size: 14px;
  font-weight: 900;
  color: #C79565;
  width: 22px;
  text-align: center;
}
.clash-result {
  margin-top: 12px;
  font-size: 17px;
  font-weight: 900;
  color: #C25312;
  letter-spacing: 1px;
}
.clash-result.blue { color: #1E7380; }
.clash-result.gold { color: #B57A08; }
.clash-result.even { color: #6E5A49; }
.clash-note {
  margin-top: 3px;
  font-size: 10px;
  color: #9B806A;
  letter-spacing: .5px;
}

/* ============ 通用底部面板 ============ */
.layer { position: fixed; inset: 0; z-index: 100; display: none; }
.layer.show { display: block; }
.layer-mask {
  position: absolute;
  inset: 0;
  background: rgba(36, 21, 12, .48);
  backdrop-filter: blur(3px);
  animation: fadeIn .18s ease-out;
}
.sheet-panel {
  position: absolute;
  left: 0; right: 0; bottom: 0;
  max-height: 84vh;
  max-height: 84dvh;
  display: flex;
  flex-direction: column;
  background: #FFF9F0;
  border-radius: 26px 26px 0 0;
  border-top: 1px solid rgba(255, 220, 185, .8);
  box-shadow: 0 -12px 40px rgba(40, 20, 8, .28);
  padding-bottom: calc(10px + var(--safe-bottom));
  animation: sheetUp .26s cubic-bezier(.2, .9, .3, 1);
}
.sheet-grab {
  width: 38px; height: 4px;
  border-radius: 4px;
  background: #E5CFB8;
  margin: 8px auto 0;
  flex: none;
}
.sheet-head {
  flex: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 9px 18px 5px;
}
.sheet-head strong { font-size: 18px; font-weight: 900; letter-spacing: .5px; }
.sheet-close {
  width: 34px; height: 34px;
  border-radius: 50%;
  display: grid; place-items: center;
  background: #F4E7D7;
  color: #7B5D44;
}
.sheet-close .mp-icon { width: 18px; height: 18px; }
.sheet-body {
  padding: 4px 20px 18px;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
}

/* 玩法内容 */
.rule-lead {
  margin: 4px 0 14px;
  font-size: 13px;
  line-height: 1.75;
  color: #5E4938;
}
.sheet-body h4 {
  margin: 16px 0 7px;
  font-size: 13px;
  font-weight: 900;
  color: #B55112;
  letter-spacing: .5px;
  display: flex;
  align-items: center;
  gap: 6px;
}
.sheet-body h4::before {
  content: "";
  width: 3px; height: 12px;
  border-radius: 2px;
  background: var(--orange);
}
.rank-line {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  align-items: center;
  font-size: 11px;
  line-height: 1.9;
  color: #5C4635;
}
.rank-chip {
  display: inline-block;
  padding: 2px 7px;
  border-radius: 7px;
  background: #FFF0E1;
  border: 1px solid #F3D3B4;
  font-weight: 800;
  color: #A74D12;
}
.rank-gt { color: #C8A382; font-weight: 700; }
.rule-block ul { margin: 0; padding: 0; list-style: none; }
.rule-block li {
  position: relative;
  padding: 6px 0 6px 14px;
  font-size: 12px;
  line-height: 1.7;
  color: #6B5645;
  border-bottom: 1px dashed rgba(226, 203, 178, .7);
}
.rule-block li:last-child { border-bottom: 0; }
.rule-block li::before {
  content: "";
  position: absolute;
  left: 2px; top: 14px;
  width: 4px; height: 4px;
  border-radius: 50%;
  background: #E39A5F;
}
.rule-block li b { color: #3F2E22; }
.sheet-body p {
  margin: 0 0 7px;
  font-size: 12px;
  line-height: 1.75;
  color: #6B5645;
}
.rule-note {
  margin-top: 12px !important;
  padding: 9px 11px;
  border-radius: 10px;
  background: #FFF2E2;
  border: 1px solid #F5DCC0;
  font-size: 11px !important;
  color: #916A46 !important;
}

/* 战报 */
.log-summary {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  padding: 3px 0 10px;
}
.log-pill {
  font-size: 10.5px;
  padding: 4px 9px;
  border-radius: 8px;
  background: #FFF1E2;
  color: #9A6232;
  border: 1px solid #F3D9BE;
  font-weight: 700;
}
.log-pill.blue { background: #EAF6F7; color: #2A7680; border-color: #CBE7E9; }
.log-list { list-style: none; margin: 0; padding: 0; }
.log-item {
  display: flex;
  align-items: flex-start;
  gap: 9px;
  padding: 8px 2px;
  border-bottom: 1px dashed rgba(226, 203, 178, .72);
  font-size: 11.5px;
  line-height: 1.6;
  color: #5F4A39;
}
.log-no {
  flex: none;
  min-width: 25px;
  font-size: 9.5px;
  font-weight: 800;
  color: #AF8A68;
  padding-top: 1px;
}
.log-dot {
  flex: none;
  width: 6px; height: 6px;
  border-radius: 50%;
  margin-top: 5px;
  background: var(--orange);
}
.log-item.blue .log-dot { background: var(--teal); }
.log-item.flag { color: #A8761D; }
.log-item.flag .log-dot { background: #E2A723; }
.log-empty {
  text-align: center;
  padding: 30px 0;
  font-size: 12px;
  color: #A88D75;
}

/* 菜单 */
.menu-row {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 13px 2px;
  border-bottom: 1px dashed rgba(226, 203, 178, .72);
  font-size: 14px;
  font-weight: 700;
  color: #4C392A;
  text-align: left;
}
.menu-row:last-child { border-bottom: 0; }
.menu-row > .mp-icon:first-child {
  width: 20px; height: 20px;
  color: #DB7A34;
  flex: none;
}
.menu-row .chev { margin-left: auto; width: 18px; height: 18px; color: #C4A88D; }
.menu-row.danger { color: #BF4C31; }
.menu-row.danger > .mp-icon:first-child { color: #BF4C31; }
.switch {
  margin-left: auto;
  width: 40px; height: 23px;
  border-radius: 20px;
  background: #E6D6C4;
  position: relative;
  transition: background .18s;
  flex: none;
}
.switch::after {
  content: "";
  position: absolute;
  top: 2px; left: 2px;
  width: 19px; height: 19px;
  border-radius: 50%;
  background: #FFF;
  box-shadow: 0 1px 3px rgba(0, 0, 0, .2);
  transition: transform .18s;
}
.switch.on { background: var(--orange); }
.switch.on::after { transform: translateX(17px); }

/* ============ 交接页 ============ */
.handoff {
  position: fixed;
  inset: 0;
  z-index: 120;
  display: none;
  align-items: center;
  justify-content: center;
  padding: calc(30px + var(--safe-top)) 26px calc(26px + var(--safe-bottom));
  text-align: center;
  color: #FFF5E8;
  background:
    radial-gradient(circle at 50% 12%, rgba(255, 138, 61, .26), transparent 52%),
    radial-gradient(circle at 50% 92%, rgba(46, 140, 153, .26), transparent 52%),
    linear-gradient(165deg, #2E1D13 0%, #1D120C 100%);
}
.handoff.show { display: flex; animation: fadeIn .2s ease-out; }
.handoff-inner { width: 100%; max-width: 360px; display: flex; flex-direction: column; align-items: center; }
.handoff-sides { display: flex; align-items: center; gap: 13px; margin-bottom: 20px; }
.hs-piece {
  width: 64px; height: 76px;
  border-radius: 14px;
  display: grid; place-items: center;
  font-size: 24px;
  font-weight: 900;
  border: 1.5px solid rgba(255, 240, 220, .45);
  box-shadow: 0 10px 22px rgba(0, 0, 0, .32), inset 0 1px 0 rgba(255, 255, 255, .26);
}
.hs-red { background: linear-gradient(155deg, #FF9C5C, #D95014); transform: rotate(-5deg); }
.hs-blue { background: linear-gradient(155deg, #5FB9C1, #1E6873); transform: rotate(5deg); }
.hs-line {
  width: 46px; height: 2px;
  background: linear-gradient(90deg, rgba(255, 150, 80, .7), rgba(80, 180, 190, .7));
  border-radius: 2px;
}
.handoff-kicker {
  margin: 0 0 8px;
  font-size: 10.5px;
  letter-spacing: 3px;
  color: rgba(255, 214, 175, .62);
  text-transform: uppercase;
}
.handoff h2 {
  margin: 0;
  font-size: 30px;
  line-height: 1.2;
  font-weight: 900;
  letter-spacing: 2px;
}
.handoff-sub {
  margin: 11px 0 26px;
  font-size: 12.5px;
  line-height: 1.7;
  color: rgba(255, 232, 210, .68);
  max-width: 280px;
}
.handoff .primary-btn {
  width: 100%;
  max-width: 280px;
  box-shadow: 0 14px 26px rgba(226, 92, 25, .38);
}
.handoff .primary-btn.blue {
  background: linear-gradient(150deg, #5FB9C1 0%, #2B8794 55%, #1D6672 100%);
  border-color: #8AD0D6;
  box-shadow: 0 14px 26px rgba(29, 102, 114, .4);
}
.handoff.side-blue .hs-red { opacity: .34; }
.handoff.side-red .hs-blue { opacity: .34; }
.handoff-note {
  margin: 16px 0 0;
  font-size: 10px;
  color: rgba(255, 226, 200, .35);
  letter-spacing: .8px;
}

/* ============ 结算 ============ */
.result {
  position: fixed;
  inset: 0;
  z-index: 130;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 22px;
  background: rgba(28, 16, 9, .72);
  backdrop-filter: blur(5px);
}
.result.show { display: flex; animation: fadeIn .2s ease-out; }
.confetti { position: absolute; inset: 0; overflow: hidden; pointer-events: none; }
.confetti span {
  position: absolute;
  top: -20px;
  width: 7px; height: 11px;
  border-radius: 2px;
  opacity: .9;
  animation: confettiFall var(--dur, 2.6s) linear var(--delay, 0s) forwards;
}
.result-card {
  position: relative;
  width: 100%;
  max-width: 372px;
  max-height: 88vh;
  overflow-y: auto;
  padding: 24px 22px 20px;
  border-radius: 28px;
  text-align: center;
  background:
    radial-gradient(100% 55% at 50% 0%, rgba(255, 186, 122, .22), transparent 65%),
    linear-gradient(180deg, #FFFCF6, #FFF3E2);
  border: 1px solid #FFE0BE;
  box-shadow: 0 28px 60px rgba(0, 0, 0, .4);
  animation: popIn .32s cubic-bezier(.2, .9, .3, 1.15);
}
.result-icon {
  width: 66px; height: 66px;
  margin: 0 auto 12px;
  border-radius: 22px;
  display: grid; place-items: center;
  color: #FFF7E8;
  background: linear-gradient(150deg, #FFB168, #EC6317);
  box-shadow: 0 10px 22px rgba(226, 92, 25, .36), inset 0 2px 0 rgba(255, 255, 255, .35);
  transform: rotate(-4deg);
}
.result-icon .mp-icon { width: 36px; height: 36px; }
.result-kicker {
  margin: 0 0 3px;
  font-size: 10px;
  letter-spacing: 2.5px;
  color: #B08A6B;
  text-transform: uppercase;
}
.result-card h2 {
  margin: 0;
  font-size: 30px;
  line-height: 1.2;
  font-weight: 900;
  letter-spacing: 2px;
  color: #2E1E12;
}
.result-reason {
  margin: 7px 0 18px;
  font-size: 12px;
  color: #8F735B;
}
.result-stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 6px;
  padding: 12px 6px;
  border-radius: 16px;
  background: rgba(255, 244, 230, .8);
  border: 1px solid #F2DCC3;
  margin-bottom: 18px;
}
.result-stats div { display: flex; flex-direction: column; gap: 2px; }
.result-stats b { font-size: 17px; font-weight: 900; color: #3E2A1B; }
.result-stats span { font-size: 9px; color: #A48A73; letter-spacing: .3px; }
.primary-btn {
  width: 100%;
  height: 50px;
  border-radius: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  background: linear-gradient(150deg, #FF9D5A 0%, #F4791F 55%, #E96316 100%);
  color: #FFF9F2;
  font-size: 15px;
  font-weight: 900;
  letter-spacing: .5px;
  border: 1px solid #FFB077;
  box-shadow: 0 10px 22px rgba(226, 92, 25, .3), inset 0 1px 0 rgba(255, 255, 255, .34);
  transition: transform .1s ease, filter .1s ease;
}
.primary-btn:active { transform: scale(.985); filter: brightness(.98); }
.primary-btn .mp-icon { width: 19px; height: 19px; }
.ghost-wide {
  width: 100%;
  height: 42px;
  margin-top: 4px;
  border-radius: 13px;
  font-size: 12.5px;
  font-weight: 700;
  color: #967B64;
}
.ghost-wide:active { background: rgba(160, 120, 80, .08); }

/* ============ 确认弹窗 ============ */
.modal {
  position: fixed;
  inset: 0;
  z-index: 140;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 30px;
}
.modal.show { display: flex; animation: fadeIn .18s ease-out; }
.modal-mask { position: absolute; inset: 0; background: rgba(28, 16, 9, .62); backdrop-filter: blur(4px); }
.modal-card {
  position: relative;
  width: 100%;
  max-width: 320px;
  padding: 22px 20px 16px;
  border-radius: 22px;
  background: #FFF9F0;
  border: 1px solid #FFE1C0;
  box-shadow: 0 24px 50px rgba(0, 0, 0, .35);
  animation: popIn .24s cubic-bezier(.2, .9, .3, 1.15);
}
.modal-card h3 { margin: 0 0 7px; font-size: 17px; font-weight: 900; letter-spacing: .5px; }
.modal-card p { margin: 0 0 18px; font-size: 12px; line-height: 1.7; color: #866C55; }
.modal-btns { display: flex; gap: 9px; }
.modal-btns button {
  flex: 1;
  height: 42px;
  border-radius: 12px;
  font-size: 13px;
  font-weight: 800;
}
.modal-cancel { background: #F4E7D7; color: #7B6149; }
.modal-ok { background: var(--orange); color: #FFF9F2; box-shadow: 0 6px 14px rgba(226, 92, 25, .26); }
.modal-btns button:active { transform: scale(.98); }

/* ============ Toast ============ */
.toast {
  position: fixed;
  left: 50%;
  bottom: calc(96px + var(--safe-bottom));
  z-index: 200;
  max-width: 82vw;
  padding: 9px 16px;
  border-radius: 13px;
  background: rgba(44, 27, 17, .94);
  color: #FFF4E8;
  font-size: 12px;
  line-height: 1.45;
  text-align: center;
  box-shadow: 0 10px 22px rgba(0, 0, 0, .22);
  opacity: 0;
  transform: translate(-50%, 8px);
  pointer-events: none;
  transition: opacity .18s ease, transform .18s ease;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }

/* ============ 动画 ============ */
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes popIn {
  from { opacity: 0; transform: scale(.9) translateY(8px); }
  to { opacity: 1; transform: scale(1) translateY(0); }
}
@keyframes sheetUp {
  from { transform: translateY(24px); opacity: .6; }
  to { transform: translateY(0); opacity: 1; }
}
@keyframes hintPulse {
  0%, 100% { transform: scale(1); opacity: .72; }
  50% { transform: scale(1.18); opacity: 1; }
}
@keyframes flagPulse {
  0%, 100% { box-shadow: 0 2px 0 #B97B0C, 0 5px 10px rgba(160, 95, 10, .34), 0 0 0 0 rgba(255, 201, 90, .45); }
  50% { box-shadow: 0 2px 0 #B97B0C, 0 5px 10px rgba(160, 95, 10, .34), 0 0 0 4px rgba(255, 201, 90, .12); }
}
@keyframes chipBlink { 0%, 100% { opacity: 1; } 50% { opacity: .55; } }
@keyframes confettiFall {
  0% { transform: translateY(-30px) rotate(0deg); opacity: 0; }
  12% { opacity: 1; }
  100% { transform: translateY(96vh) rotate(560deg); opacity: .9; }
}

/* ============ 小屏适配 ============ */
@media (max-height: 720px) {
  .home-title { font-size: 34px; margin-top: 10px; }
  .home-sub { font-size: 12px; margin-top: 6px; }
  .hero-clash { height: 154px; margin: 12px 0 12px; }
  .hero-piece { width: 70px; height: 86px; top: 24%; }
  .hp-rank { font-size: 22px; }
  .hero-burst { width: 50px; height: 50px; margin: -25px 0 0 -25px; font-size: 16px; }
  .mode-card { padding: 11px 13px; border-radius: 18px; }
  .mode-icon { width: 42px; height: 42px; border-radius: 13px; }
  .mode-text strong { font-size: 16px; }
  .home-stats { margin-top: 10px; padding: 9px 11px; }
  .home-links { padding-top: 10px; }
  .side-panel { padding: 5px 8px; }
  .avatar { width: 32px; height: 32px; border-radius: 10px; }
  .avatar .mp-icon { width: 19px; height: 19px; }
  .action-btn { height: 35px; }
  .event-ticker { min-height: 27px; padding: 4px 9px; }
  .game-bottom { gap: 5px; padding-top: 5px; }
  .setup-tip { font-size: 9.5px; padding-bottom: 5px; }
  .primary-btn { height: 46px; }
  .result-card { padding: 20px 18px 16px; }
  .result-icon { width: 58px; height: 58px; }
}

@media (min-width: 500px) {
  .home-scroll { padding-left: 24px; padding-right: 24px; }
}

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