:root {
  --gold: #e8c15a;
  --text: #f0ead6;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: "Microsoft YaHei", "PingFang SC", "Segoe UI", sans-serif;
  background: #14151a;
  min-height: 100vh;
  color: var(--text);
}
/* 竞技场背景层：石墙 + 地面砖纹 + 火把 + 暗角 */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background:
    /* 中央顶光 */
    radial-gradient(ellipse at 50% 40%, rgba(255, 214, 150, .10), transparent 58%),
    /* 地面火光反射 */
    radial-gradient(ellipse at 50% 105%, rgba(120, 72, 26, .42), transparent 58%),
    /* 左右火把火焰 */
    radial-gradient(circle 30px at 4% 27%, rgba(255, 190, 90, .85), rgba(255, 130, 45, .30) 45%, transparent 72%),
    radial-gradient(circle 30px at 96% 27%, rgba(255, 190, 90, .85), rgba(255, 130, 45, .30) 45%, transparent 72%),
    /* 左右火把光柱 */
    radial-gradient(ellipse 220px 480px at 4% 45%, rgba(255, 150, 60, .26), transparent 70%),
    radial-gradient(ellipse 220px 480px at 96% 45%, rgba(255, 150, 60, .26), transparent 70%),
    /* 石墙砖缝（竖 + 横） */
    repeating-linear-gradient(90deg, rgba(255,255,255,.045) 0 2px, transparent 2px 76px),
    repeating-linear-gradient(0deg, rgba(255,255,255,.035) 0 1px, transparent 1px 44px),
    /* 墙 → 地面主体 */
    linear-gradient(to bottom,
      #3b3f4a 0%, #2e323c 28%, #262a33 40%, #1e2129 46%,
      #191b21 52%, #241b10 78%, #120c06 100%),
    /* 暗角 */
    radial-gradient(ellipse at 50% 45%, transparent 48%, rgba(0,0,0,.52) 100%);
}

#app { max-width: 1280px; margin: 0 auto; padding: 8px 12px 20px; }

header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  padding: 2px 0 6px;
}
h1 {
  font-size: .95rem;
  letter-spacing: 2px;
  color: var(--gold);
  text-shadow: 0 2px 4px rgba(0,0,0,.5);
}
#stageInfo {
  font-size: .8rem;
  color: #ffd9a0;
  white-space: nowrap;
  text-shadow: 0 1px 3px rgba(0,0,0,.6);
}
.header-btns { display: flex; gap: 6px; }

button {
  font: inherit;
  cursor: pointer;
  border: none;
  border-radius: 7px;
  padding: 5px 9px;
  color: #1c2b20;
  background: var(--gold);
  font-weight: bold;
  font-size: .78rem;
}
button:hover { filter: brightness(1.08); }
button:disabled { opacity: .45; cursor: not-allowed; }
button.secondary { background: #5b6e60; color: var(--text); }

.hidden { display: none !important; }

/* ---------- 对战面板 ---------- */
.player-panel {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  margin: 3px 0;
}
#battleRow {
  display: flex;
  gap: 16px;
  justify-content: center;
  align-items: stretch;
}
#centerCol {
  display: flex;
  flex-direction: column;
  width: 296px;
  min-height: 700px;
}
.table-head {
  display: flex;
  justify-content: center;
  align-items: center;
  width: min(296px, 100%);
  font-size: .78rem;
  color: #d9e6d2;
}
.table-head .char-name { font-weight: bold; color: var(--gold); white-space: nowrap; }

/* ---------- 角色状态栏 ---------- */
.side-panel {
  width: auto;
  min-width: 240px;
  max-width: 320px;
  flex: 1 1 280px;
  background: rgba(0,0,0,.4);
  border: 1px solid rgba(255,255,255,.09);
  border-radius: 10px;
  padding: 14px 16px;
  margin-top: 4px;
  display: flex;
  flex-direction: column;
}
.side-avatar {
  position: relative;
  text-align: center;
}
.side-avatar img {
  width: 112px;
  height: 112px;
  image-rendering: pixelated;
  border: 2px solid rgba(232,193,90,.35);
  border-radius: 12px;
  background: rgba(0,0,0,.28);
  box-shadow: 0 3px 10px rgba(0,0,0,.4);
}
.avatar-skillbar {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 2px;
  padding: 1px 2px 2px;
  background: rgba(0, 0, 0, .58);
  border-radius: 0 0 12px 12px;
}
.avatar-skillbar .skill-badge {
  font-size: .52rem;
  padding: 0 4px;
  border-radius: 999px;
  background: rgba(232, 193, 90, .22);
  border-width: 1px;
}
.side-skillbar {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  justify-content: center;
  margin-bottom: 5px;
}
.skill-badge {
  font-size: .68rem;
  color: #ffe9b0;
  background: rgba(232, 193, 90, .14);
  border: 1px solid rgba(232, 193, 90, .5);
  border-radius: 999px;
  padding: 2px 8px;
  cursor: help;
  user-select: none;
  -webkit-touch-callout: none;
  white-space: nowrap;
}
.skill-badge:active { background: rgba(232, 193, 90, .3); }
.side-name {
  text-align: center;
  font-weight: bold;
  color: var(--gold);
  font-size: 1rem;
  margin: 6px 0 10px;
}
.side-stat {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: .85rem;
  margin: 6px 0;
}
.side-label {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  white-space: nowrap;
}
.label-icon { width: 17px; height: 17px; image-rendering: pixelated; }
.side-icons { display: flex; flex-wrap: wrap; gap: 4px; justify-content: flex-end; }
.stat-icon {
  width: 27px;
  height: 27px;
  display: inline-block;
  background: rgba(255,255,255,.06);
  border: 1px solid rgba(255,255,255,.08);
  border-radius: 5px;
  padding: 2px;
  box-sizing: border-box;
}
.stat-icon img { width: 100%; height: 100%; image-rendering: pixelated; display: block; }
.stat-icon.spent { opacity: .16; filter: grayscale(1); border-style: dashed; }
.side-sub {
  margin-top: 10px;
  font-size: .8rem;
  color: #bcd3b0;
  text-align: center;
}
.side-skill {
  margin-top: 10px;
  padding: 7px 9px;
  border: 1px dashed rgba(232, 193, 90, .45);
  border-radius: 8px;
  background: rgba(232, 193, 90, .07);
  font-size: .74rem;
  line-height: 1.5;
  color: #e8d9a8;
  text-align: center;
}
.skill-title {
  color: var(--gold);
  font-weight: bold;
  margin-bottom: 2px;
}
.side-phase {
  margin-top: auto;
  padding-top: 12px;
  border-top: 1px solid rgba(255,255,255,.12);
  text-align: center;
  font-size: .82rem;
  color: var(--gold);
}

/* ---------- 牌桌 ---------- */
.grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 7px;
  width: min(296px, 100%);
}
.slot {
  position: relative;
  aspect-ratio: 1 / 1;
  border-radius: 8px;
  background: rgba(0,0,0,.32);
  border: 1px solid rgba(255,255,255,.07);
}
.slot.empty {
  border: 1.5px dashed rgba(255,255,255,.14);
  background: rgba(255,255,255,.02);
}

.card {
  position: absolute;
  inset: 0;
  perspective: 600px;
  cursor: pointer;
  transition: transform .15s;
}
.card:hover { transform: translateY(-2px); }
.card-inner {
  position: absolute;
  inset: 0;
  transform-style: preserve-3d;
  transition: transform .4s ease;
}
.card.revealed .card-inner { transform: rotateY(180deg); }
.card-face {
  position: absolute;
  inset: 0;
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
  border-radius: 8px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  border: 2px solid rgba(255,255,255,.16);
  box-shadow: 0 3px 8px rgba(0,0,0,.45);
}
.card-front { transform: rotateY(180deg); }
.card.hp .card-front { background: linear-gradient(160deg, #8f2f24, #5d1d16); }
.card.shield .card-front { background: linear-gradient(160deg, #245a82, #16344d); }
.card.dodge .card-front { background: linear-gradient(160deg, #1f7a4d, #12402a); }
.card-back {
  background: repeating-linear-gradient(45deg, #273a4d 0 10px, #1d2c3b 10px 20px);
  border-color: rgba(255,255,255,.24);
}
.card-emoji img {
  width: 44px;
  height: 44px;
  image-rendering: pixelated;
}
.card-type {
  font-size: .72rem;
  font-weight: bold;
  letter-spacing: 1px;
  color: #fff;
  text-shadow: 0 1px 2px rgba(0,0,0,.5);
  margin-top: 2px;
}

/* ---------- 动画 ---------- */
.slot.removing .card { animation: removeCard .4s ease forwards; }
@keyframes removeCard {
  60% { transform: scale(1.08) rotate(4deg); opacity: 1; }
  100% { transform: scale(0) rotate(12deg); opacity: 0; }
}
.slot.hit .card-front { animation: hitFlash .55s; }
@keyframes hitFlash {
  0% { box-shadow: 0 0 0 0 rgba(255,80,60,.9); }
  50% { box-shadow: 0 0 0 8px rgba(255,80,60,0); }
  100% { box-shadow: 0 0 0 0 rgba(255,80,60,0); }
}
.slot.dodged .card-front { animation: dodgeFlash .5s; }
@keyframes dodgeFlash {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-4px); }
  50% { transform: translateX(4px); }
  75% { transform: translateX(-2px); }
}
.slot.selected .card {
  outline: 3px solid var(--gold);
  outline-offset: 2px;
  transform: translateY(-3px);
}

/* ---------- 攻击特效 ---------- */
/* 生命牌：流血 → 消散 */
.slot.bleed::before {
  content: '🩸';
  position: absolute;
  top: 48%;
  left: 50%;
  font-size: 34px;
  z-index: 6;
  pointer-events: none;
  animation: bleedBurst .65s ease-out forwards;
}
@keyframes bleedBurst {
  0%   { transform: translate(-50%, -50%) scale(0); opacity: 0; }
  25%  { transform: translate(-50%, -50%) scale(1.6); opacity: 1; }
  100% { transform: translate(-35%, -72%) scale(1.1); opacity: 0; }
}
.slot.bleed .card-front::after {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at 50% 45%, rgba(210, 30, 30, .9), rgba(120, 10, 10, .35) 55%, transparent 75%);
  animation: bleedFlash .5s ease-out forwards;
}
@keyframes bleedFlash {
  0%   { opacity: 0; transform: scale(.4); }
  40%  { opacity: 1; transform: scale(1.15); }
  100% { opacity: 0; transform: scale(1.2); }
}
.slot.bleed .card {
  animation: bleedDissolve .68s ease-in forwards;
}
@keyframes bleedDissolve {
  0%   { filter: none; opacity: 1; transform: none; }
  45%  { filter: brightness(1.5) saturate(1.7); opacity: 1; }
  100% { filter: blur(3px) brightness(1.9); opacity: 0; transform: scale(.88) translateY(5px); }
}

/* 护盾牌：碎裂 → 飞散 */
.slot.shatter::before {
  content: '';
  position: absolute;
  inset: 0;
  z-index: 6;
  pointer-events: none;
  background:
    linear-gradient(118deg, transparent 43%, rgba(255,255,255,.95) 45%, rgba(255,255,255,.35) 47%, transparent 49%),
    linear-gradient(32deg, transparent 57%, rgba(255,255,255,.9) 59%, rgba(255,255,255,.3) 61%, transparent 63%),
    linear-gradient(205deg, transparent 27%, rgba(255,255,255,.85) 29%, rgba(255,255,255,.3) 31%, transparent 33%),
    linear-gradient(90deg, transparent 72%, rgba(255,255,255,.8) 74%, transparent 76%);
  animation: crackIn .28s ease-out forwards;
}
@keyframes crackIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}
.slot.shatter .card-front::after {
  content: '💥';
  position: absolute;
  top: 40%;
  left: 50%;
  font-size: 30px;
  transform: translate(-50%, -50%) scale(0);
  animation: shatterBurst .5s ease-out forwards;
}
@keyframes shatterBurst {
  0%   { transform: translate(-50%, -50%) scale(0); opacity: 0; }
  30%  { transform: translate(-50%, -50%) scale(1.5); opacity: 1; }
  100% { transform: translate(-50%, -50%) scale(.9); opacity: 0; }
}
.slot.shatter .card {
  animation: shatterFly .6s ease-in forwards;
}
@keyframes shatterFly {
  0%   { transform: scale(1) rotate(0deg); opacity: 1; }
  35%  { transform: scale(1.08) rotate(2deg); opacity: 1; }
  100% { transform: scale(.15) rotate(24deg); opacity: 0; }
}

/* 闪避：嗖风滑过 */
.slot.dodged::before {
  content: '💨';
  position: absolute;
  top: 38%;
  left: 8%;
  font-size: 26px;
  z-index: 5;
  pointer-events: none;
  animation: swooshSlide .5s ease-out forwards;
}
@keyframes swooshSlide {
  0%   { transform: translateX(-34px) scale(.55); opacity: 0; }
  30%  { transform: translateX(4px) scale(.9); opacity: 1; }
  100% { transform: translateX(38px) scale(1.15); opacity: 0; }
}

/* 攻击方突刺 */
.side-avatar.lunge-r img { animation: lungeR .52s ease-out; }
.side-avatar.lunge-l img { animation: lungeL .52s ease-out; }
@keyframes lungeR {
  0%   { transform: translateX(0) scale(1) rotate(0deg); }
  35%  { transform: translateX(46px) scale(1.14) rotate(5deg); }
  100% { transform: translateX(0) scale(1) rotate(0deg); }
}
@keyframes lungeL {
  0%   { transform: translateX(0) scale(1) rotate(0deg); }
  35%  { transform: translateX(-46px) scale(1.14) rotate(-5deg); }
  100% { transform: translateX(0) scale(1) rotate(0deg); }
}

/* 命中震屏 */
#app.screen-shake { animation: screenShake .48s; }
@keyframes screenShake {
  0%, 100% { transform: translate(0, 0); }
  20% { transform: translate(-5px, 2px); }
  40% { transform: translate(5px, -3px); }
  60% { transform: translate(-4px, -2px); }
  80% { transform: translate(3px, 2px); }
}

/* 粒子飞散 */
.fx-particle {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 6px;
  height: 6px;
  border-radius: 2px;
  pointer-events: none;
  z-index: 8;
  animation: fxFly .72s ease-out forwards;
}
.fx-particle.fx-emoji {
  width: auto;
  height: auto;
  background: transparent !important;
  font-size: 19px;
  line-height: 1;
}
@keyframes fxFly {
  0% {
    transform: translate(-50%, -50%) scale(1) rotate(0deg);
    opacity: 1;
  }
  100% {
    transform: translate(calc(-50% + var(--dx)), calc(-50% + var(--dy))) scale(.25) rotate(var(--rot));
    opacity: 0;
  }
}

/* 漂浮伤害数字 */
.fx-float {
  position: absolute;
  left: 50%;
  top: 32%;
  transform: translateX(-50%);
  font-weight: bold;
  font-size: 1.05rem;
  color: #ffd24a;
  text-shadow: 0 2px 4px rgba(0,0,0,.85);
  white-space: nowrap;
  pointer-events: none;
  z-index: 9;
  animation: fxFloatUp .7s ease-out forwards;
}
.fx-float.dmg { color: #ff5a4a; }
.fx-float.evade { color: #7fe0ff; }
@keyframes fxFloatUp {
  0%   { opacity: 0; transform: translate(-50%, 10px) scale(.7); }
  22%  { opacity: 1; transform: translate(-50%, 0) scale(1.18); }
  100% { opacity: 0; transform: translate(-50%, -28px) scale(1); }
}

/* 荆棘战士：荆棘牌标记 */
.slot.thorn-mark {
  outline: 2px solid #7fe08a;
  outline-offset: 1px;
  box-shadow: 0 0 10px rgba(90, 220, 120, .35);
}
.thorn-badge {
  position: absolute;
  top: -9px;
  right: -9px;
  font-size: 17px;
  z-index: 7;
  pointer-events: none;
  filter: drop-shadow(0 1px 2px rgba(0, 0, 0, .6));
}

/* ---------- 中部信息区 ---------- */
#statusArea {
  text-align: center;
  padding: 4px 0 2px;
  min-height: 104px;
  display: flex;
  flex-direction: column;
  justify-content: center;
}
#statusText {
  font-size: .96rem;
  font-weight: bold;
  color: var(--gold);
  min-height: 1.3em;
}
#statusText.enemy-turn {
  color: #ff6b6b;
  text-shadow: 0 0 10px rgba(255, 70, 70, .55);
}
.rps-reveal {
  display: flex;
  justify-content: center;
  gap: 18px;
  margin-top: 4px;
}
.rps-choice {
  min-width: 112px;
  padding: 8px 10px;
  border-radius: 8px;
  background: rgba(0,0,0,.25);
  border: 1.5px solid rgba(255,255,255,.16);
  font-size: 1.02rem;
  transition: border-color .2s, box-shadow .2s;
}
.rps-choice.shaking { animation: rpsShake .12s linear infinite; }
@keyframes rpsShake {
  0% { transform: translateX(-2px) rotate(-2deg); }
  50% { transform: translateX(2px) rotate(2deg); }
  100% { transform: translateX(-2px) rotate(-2deg); }
}
.rps-choice.result-win {
  border-color: #7fe0a0;
  box-shadow: 0 0 10px rgba(80,200,120,.4);
  color: #b7f5cd;
}
.rps-choice.result-lose {
  border-color: #ff8f8f;
  box-shadow: 0 0 10px rgba(255,80,80,.35);
  color: #ffc2c2;
}
.rps-choice.result-tie {
  border-color: var(--gold);
  box-shadow: 0 0 10px rgba(232,193,90,.3);
}
#tieArea {
  margin-top: 4px;
  display: flex;
  gap: 10px;
  justify-content: center;
}
#targetHint {
  margin-top: 2px;
  font-size: .8rem;
  color: #ffd9a0;
  min-height: 1.2em;
}

/* ---------- 控制区 ---------- */
#controlArea {
  text-align: center;
  padding: 4px 0;
  min-height: 72px;
}
#roundInfo { font-size: .8rem; color: #bcd3b0; margin-bottom: 4px; }
#rpsButtons { display: flex; gap: 10px; justify-content: center; }
.rps-btn { font-size: .9rem; padding: 7px 14px; }
#rearrangeArea {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  flex-wrap: wrap;
}
#timerBarWrap {
  width: 108px;
  height: 8px;
  background: rgba(0,0,0,.35);
  border-radius: 4px;
  overflow: hidden;
}
#timerBar {
  height: 100%;
  width: 100%;
  background: linear-gradient(90deg, #e8c15a, #e0743c);
  transition: width .1s linear;
}
#timerText { font-weight: bold; color: var(--gold); font-size: .82rem; min-width: 40px; }
#rearrangeHint { width: 100%; font-size: .76rem; color: #bcd3b0; }

/* ---------- 日志 ---------- */
#logPanel {
  position: fixed;
  left: 12px;
  bottom: 12px;
  z-index: 40;
  margin: 0;
  max-width: 330px;
  background: rgba(12, 9, 6, .66);
  border: 1px solid rgba(255,255,255,.14);
  border-radius: 10px;
  padding: 6px 12px;
  backdrop-filter: blur(2px);
}
#logToggle {
  cursor: pointer;
  user-select: none;
  font-size: .84rem;
  color: var(--gold);
  margin: 0;
  display: flex;
  align-items: center;
  gap: 6px;
}
#logBadge {
  background: #e0743c;
  color: #fff;
  border-radius: 8px;
  padding: 0 7px;
  font-size: .72rem;
  line-height: 1.4;
}
#logPanel.collapsed #logList { display: none; }

/* 技能说明悬浮框 */
.skill-tip {
  position: fixed;
  z-index: 100;
  max-width: 240px;
  white-space: pre-line;
  background: rgba(20, 16, 10, .96);
  border: 1px solid rgba(232, 193, 90, .55);
  border-radius: 8px;
  padding: 7px 10px;
  font-size: .76rem;
  line-height: 1.5;
  color: #f0ead6;
  box-shadow: 0 6px 18px rgba(0, 0, 0, .5);
  pointer-events: none;
}
#logList {
  list-style: none;
  padding: 0;
  margin: 4px 0 0;
  font-size: .78rem;
  line-height: 1.6;
  max-height: 190px;
  overflow-y: auto;
}
#logList li { border-bottom: 1px dashed rgba(255,255,255,.07); padding: 1px 0; }
#logList li.win { color: #8fe3a7; }
#logList li.lose { color: #ff9f9f; }
#logList li.info { color: #9fb8d8; }

/* ---------- 弹窗 ---------- */
.overlay {
  position: fixed;
  inset: 0;
  z-index: 50;
  background: rgba(18, 13, 8, .86);
  display: flex;
  align-items: center;
  justify-content: center;
  backdrop-filter: blur(3px);
  padding: 16px;
}
.overlay-content {
  background: linear-gradient(180deg, #3a2b1a, #221709);
  border: 1px solid rgba(255,255,255,.18);
  border-radius: 14px;
  padding: 20px 24px;
  max-width: 540px;
  width: 100%;
  box-shadow: 0 12px 40px rgba(0,0,0,.6);
  text-align: center;
  max-height: 90vh;
  overflow-y: auto;
}
.overlay-content h2 { color: var(--gold); margin-bottom: 12px; font-size: 1.25rem; }
#charOptions { display: flex; gap: 16px; justify-content: center; margin-bottom: 14px; flex-wrap: wrap; }
.char-option {
  width: 185px;
  cursor: pointer;
  padding: 14px 12px;
  background: rgba(255,255,255,.06);
  border: 2px solid rgba(255,255,255,.16);
  border-radius: 12px;
  transition: transform .15s, border-color .15s;
}
.char-option:hover { transform: translateY(-3px); border-color: var(--gold); }
.char-img { margin-bottom: 6px; }
.char-img img {
  width: 96px;
  height: 96px;
  image-rendering: pixelated;
  filter: drop-shadow(0 3px 4px rgba(0,0,0,.4));
}
.char-option-name { font-size: 1.1rem; font-weight: bold; color: var(--gold); margin: 6px 0; }
.char-option-stats { font-size: .8rem; line-height: 1.6; color: #d9e6d2; }
.rules-list { text-align: left; line-height: 1.75; font-size: .85rem; margin: 0 0 14px; padding-left: 18px; }
#resultTitle { font-size: 1.4rem; }
#resultText { margin: 6px 0 16px; line-height: 1.6; font-size: .92rem; }
#restartBtn { display: block; margin: 8px auto 0; }

button, .slot, .card, .char-option, .rps-btn { touch-action: manipulation; }

/* ---------- 平板/窄屏 ---------- */
@media (max-width: 820px) {
  #battleRow { flex-wrap: wrap; }
  #centerCol { width: 100%; }
  .side-panel {
    width: 100%;
    max-width: 100%;
    min-width: 0;
    flex: 0 0 auto;
    flex-direction: row;
    align-items: center;
    flex-wrap: wrap;
    gap: 6px 10px;
    padding: 8px 10px;
    margin-top: 2px;
  }
  .side-avatar img { width: 46px; height: 46px; }
  .side-avatar { display: flex; flex-direction: column; align-items: center; }
  .avatar-skillbar { position: static; background: transparent; padding: 0; margin-top: 1px; }
  .avatar-skillbar .skill-badge { font-size: .56rem; padding: 0 4px; }
  .side-name { margin: 0; font-size: .8rem; }
  .side-stat { margin: 0; font-size: .72rem; }
  .stat-icon { width: 20px; height: 20px; }
  .side-sub { margin: 0; font-size: .7rem; }
  .side-skill { margin: 0; padding: 2px 8px; font-size: .62rem; }
  .skill-desc { display: none; }
  .side-phase { display: none; }
}

/* ---------- 手机竖屏 ---------- */
@media (max-width: 700px) {
  html { -webkit-text-size-adjust: 100%; }
  #app { padding: 4px 6px calc(4px + env(safe-area-inset-bottom)); }
  header { flex-wrap: wrap; row-gap: 2px; padding: 0 0 1px; }
  h1 { font-size: .8rem; letter-spacing: 1px; }
  #stageInfo { font-size: .68rem; }
  .header-btns button { padding: 3px 7px; font-size: .7rem; }

  #battleRow {
    flex-direction: column;
    align-items: stretch;
    gap: 3px;
  }
  #playerStatus { order: 6; }
  #aiStatus { order: 1; }
  #centerCol { order: 2; min-height: 0; width: 100%; }

  .player-panel { margin: 0; gap: 2px; }
  .grid { width: min(200px, 60vw); gap: 5px; }
  .table-head { width: min(200px, 60vw); font-size: .68rem; padding: 1px 0; }
  .table-head { display: none; }
  .slot { aspect-ratio: 1 / 1; }
  .card-emoji img { width: 24px; height: 24px; }
  .card-type { font-size: .54rem; }

  #statusArea { min-height: 52px; padding: 2px 0; }
  #statusText { font-size: .86rem; }
  .rps-reveal { gap: 8px; margin-top: 2px; }
  .rps-choice { min-width: 84px; font-size: .86rem; padding: 5px 6px; }
  #tieArea { gap: 6px; }
  #targetHint { font-size: .76rem; }

  #controlArea { min-height: 48px; padding: 2px 0; }
  #roundInfo { font-size: .72rem; margin-bottom: 2px; }
  .rps-btn { font-size: .86rem; padding: 8px 11px; min-width: 76px; }
  #rearrangeArea { gap: 6px; }
  #timerBarWrap { width: 88px; height: 7px; }

  /* 状态条：保留完整信息但紧凑 */
  .side-panel {
    flex-direction: row;
    flex-wrap: wrap;
    align-items: center;
    gap: 2px 4px;
    padding: 2px 6px;
    margin-top: 0;
    font-size: .66rem;
  }
  .side-avatar img { width: 30px; height: 30px; border-radius: 6px; border-width: 1px; }
  .side-avatar { display: flex; flex-direction: column; align-items: center; }
  .avatar-skillbar { position: static; background: transparent; padding: 0; margin-top: 1px; }
  .avatar-skillbar .skill-badge { font-size: .5rem; padding: 0 3px; }
  .side-name { margin: 0; font-size: .68rem; }
  .side-label { display: none; }
  .side-stat { margin: 0; gap: 3px; font-size: .6rem; }
  .stat-icon { width: 13px; height: 13px; padding: 1px; border-radius: 3px; }
  .side-sub { margin: 0; font-size: .6rem; }
  .side-phase { display: none; }

  #logPanel { max-width: 58vw; font-size: .72rem; left: 6px; bottom: 6px; }

  .overlay { padding: 8px; }
  .overlay-content { padding: 12px 10px; max-width: 96vw; }
  .overlay-content h2 { font-size: 1rem; margin-bottom: 8px; }
  .char-option { width: calc(50% - 6px); padding: 8px 6px; }
  .char-img img { width: 66px; height: 66px; }
  .char-option-name { font-size: .9rem; margin: 3px 0; }
  .char-option-stats { font-size: .68rem; line-height: 1.4; }
  .rules-list { font-size: .78rem; }
}
