/* 原神杀 · 重构版 —— 界面与特效 */
:root {
  --gold: #e6b561;
  --gold-bright: #ffd98a;
  --ink: #0d0f14;
  --panel: rgba(16, 18, 26, 0.88);
  --panel-light: rgba(34, 38, 52, 0.92);
  --red: #ff5b5b;
  --green: #7dffa9;
  --blue: #6db9ff;
  --wei: #5b8dd9;
  --shu: #d96a5b;
  --wu: #5bbf7f;
  --qun: #b0a18c;
  /* 舞台单位：--svmin 由 JS 按"限宽后的舞台"实际尺寸维护（回退 1vmin） */
  --svmin: 1vmin;
  --stage-h: 100vh;
  --card-w: clamp(74px, calc(var(--svmin) * 9), 170px);
  --card-h: calc(var(--card-w) * 1.5);
  --seat-w: clamp(104px, calc(var(--svmin) * 14), 240px);
  --seat-h: calc(var(--seat-w) * 1.6);
  --self-w: calc(var(--seat-w) * 1.2);
  --self-h: calc(var(--self-w) * 1.57);
  --fs: clamp(12px, calc(var(--svmin) * 1.5), 19px);   /* 基准字号 */
}
* { margin: 0; padding: 0; box-sizing: border-box; user-select: none; }
html, body { width: 100%; height: 100%; overflow: hidden; background: var(--ink); }
body {
  font-family: "PingFang SC", "Microsoft YaHei", "Noto Sans SC", sans-serif;
  color: #e8e4da;
}
.hidden { display: none !important; }

/* ============ 按钮 ============ */
.btn {
  border: 1px solid rgba(230, 181, 97, 0.55);
  background: linear-gradient(180deg, rgba(60, 52, 38, 0.9), rgba(36, 30, 22, 0.9));
  color: var(--gold-bright);
  border-radius: 8px;
  padding: 8px 22px;
  font-size: calc(var(--fs) * 1.05);
  cursor: pointer;
  transition: all 0.15s ease;
  letter-spacing: 2px;
}
.btn:hover { filter: brightness(1.25); box-shadow: 0 0 12px rgba(230, 181, 97, 0.35); }
.btn:active { transform: scale(0.96); }
.btn:disabled { opacity: 0.35; cursor: not-allowed; filter: none; box-shadow: none; }
.btn-gold {
  background: linear-gradient(180deg, #caa256, #8a6a2e);
  color: #1d1812;
  font-weight: 700;
  border-color: #ffd98a;
}
.btn-lg { padding: 12px 42px; font-size: 18px; border-radius: 10px; }
.btn-sm { padding: 3px 10px; font-size: 12px; letter-spacing: 0; }
.btn-ghost { background: rgba(20, 22, 30, 0.7); border-color: rgba(255, 255, 255, 0.25); color: #cfc9bd; }
.btn-end { border-color: rgba(255, 120, 120, 0.5); color: #ffb3a3; }

/* ============ 大厅 ============ */
.lobby { position: fixed; inset: 0; display: flex; align-items: center; justify-content: center; }
.lobby-bg {
  position: absolute; inset: 0;
  background: url("/assets/bg/login-landscape.png") center/cover no-repeat;
  filter: brightness(0.75);
}
.lobby-bg::after {
  content: ""; position: absolute; inset: 0;
  background: radial-gradient(ellipse at center, transparent 30%, rgba(5, 6, 10, 0.85) 100%);
}
.lobby-panel {
  position: relative; z-index: 1; text-align: center;
  background: var(--panel); border: 1px solid rgba(230, 181, 97, 0.35);
  border-radius: 18px; padding: 44px 60px;
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.7), inset 0 0 40px rgba(230, 181, 97, 0.04);
  animation: lobbyIn 0.7s cubic-bezier(0.2, 0.9, 0.3, 1.2);
  backdrop-filter: blur(6px);
}
@keyframes lobbyIn { from { opacity: 0; transform: translateY(36px) scale(0.94); } }
.lobby-title { font-size: 64px; letter-spacing: 10px; color: #f3ead7; text-shadow: 0 0 30px rgba(230, 181, 97, 0.5); }
.lobby-title span { color: var(--gold); }
.lobby-sub { margin: 10px 0 28px; color: #b8b0a0; letter-spacing: 3px; }
.lobby-input {
  display: block; width: 280px; margin: 0 auto 18px; padding: 10px 16px;
  background: rgba(0, 0, 0, 0.45); border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 8px; color: #fff; font-size: 16px; text-align: center; outline: none;
}
.lobby-input:focus { border-color: var(--gold); box-shadow: 0 0 10px rgba(230, 181, 97, 0.3); }
.lobby-tip { margin-top: 22px; font-size: 12px; color: #837c6e; letter-spacing: 1px; }

/* AI 风格开关 */
.ai-toggle {
  display: flex; align-items: stretch; gap: 10px; justify-content: center;
  margin: 0 auto 14px; max-width: 480px;
}
.ai-toggle-label { align-self: center; font-size: 13px; color: #a59c8a; letter-spacing: 2px; }
.ai-opt {
  flex: 1; display: flex; flex-direction: column; gap: 2px; cursor: pointer;
  padding: 8px 12px; border-radius: 10px;
  background: rgba(20, 22, 30, 0.7); border: 1px solid rgba(255, 255, 255, 0.18);
  transition: all 0.15s;
}
.ai-opt:has(input:checked) {
  border-color: var(--gold); background: rgba(60, 50, 30, 0.6);
  box-shadow: 0 0 10px rgba(230, 181, 97, 0.25);
}
.ai-opt input { display: none; }
.ai-opt b { font-size: 14px; color: #f0e9d8; letter-spacing: 1px; }
.ai-opt i { font-size: 11px; color: #968d7c; font-style: normal; }

/* 模式选择 */
.mode-grid {
  display: grid; grid-template-columns: 1fr 1fr; gap: 12px;
  max-width: 480px; margin: 0 auto;
}
.mode-card {
  display: flex; flex-direction: column; gap: 6px; align-items: center;
  padding: 16px 12px; border-radius: 12px; cursor: pointer;
  background: linear-gradient(180deg, rgba(46, 42, 32, 0.9), rgba(28, 26, 20, 0.9));
  border: 1px solid rgba(230, 181, 97, 0.4); color: inherit;
  transition: all 0.18s ease;
}
.mode-card:hover { transform: translateY(-4px); border-color: var(--gold-bright); box-shadow: 0 10px 28px rgba(0,0,0,0.5), 0 0 16px rgba(230, 181, 97, 0.3); }
.mode-card:disabled { opacity: 0.45; cursor: wait; transform: none; }
.mode-card.loading { border-color: var(--gold-bright); animation: skillReady 1s infinite; }
.mode-card.recommended { border-color: rgba(255, 217, 138, 0.75); background: linear-gradient(180deg, rgba(74, 60, 34, 0.95), rgba(40, 33, 20, 0.95)); }
.mc-title { font-size: 17px; font-weight: 700; color: var(--gold-bright); letter-spacing: 3px; }
.mc-sub { font-size: 11px; color: #a59c8a; line-height: 1.6; text-align: center; }

/* 新手教学 */
.tut-tip {
  position: absolute; top: 48px; left: 50%; transform: translateX(-50%); z-index: 85;
  max-width: min(520px, 88vw);
  background: rgba(20, 24, 16, 0.96); border: 1px solid rgba(170, 230, 130, 0.55);
  border-radius: 12px; padding: 12px 16px;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.7), 0 0 18px rgba(150, 220, 110, 0.2);
  font-size: calc(var(--fs) * 0.98); line-height: 1.7; color: #e2efd2;
  animation: promptIn 0.3s ease;
  text-align: left;
}
.tut-tip b { color: #c2f098; }
.tut-tip .tt-head { color: #a8e87c; font-weight: 700; letter-spacing: 2px; margin-bottom: 4px; font-size: calc(var(--fs) * 0.9); }
.tut-tip .btn { margin-top: 8px; }
.tut-body { max-width: 460px; font-size: 14px; line-height: 1.9; color: #d8d2c2; text-align: left; }
.tut-body b { color: var(--gold-bright); }

/* ============ 游戏底图 ============ */
/* 超大屏时舞台限宽居中，四周用暗化背景填充 */
body::before {
  content: ""; position: fixed; inset: 0; z-index: 0;
  background: url("/gen/liyue-landscape.jpg") center/cover no-repeat;
  filter: brightness(0.22) saturate(0.8) blur(6px);
}
.game {
  position: fixed; inset: 0; margin: auto;
  max-width: 1760px; max-height: 1000px;
  overflow: hidden; border-radius: 6px;
  box-shadow: 0 0 80px rgba(0, 0, 0, 0.8);
}
.game-bg {
  position: absolute; inset: 0;
  background: url("/gen/liyue-landscape.jpg") center/cover no-repeat;
  filter: brightness(0.8) saturate(1.02);
}
.game-bg::after {
  content: ""; position: absolute; inset: 0;
  background:
    linear-gradient(180deg, rgba(5, 6, 10, 0.65) 0%, transparent 22%, transparent 55%, rgba(5, 6, 10, 0.78) 100%);
}
/* 小屏横屏：用小尺寸背景省流量 */
@media (orientation: landscape) and (max-width: 980px) {
  .game-bg, body::before { background-image: url("/gen/liyue-landscape-sm.jpg"); }
}

/* ============ 顶栏 ============ */
.topbar {
  position: absolute; top: 0; left: 0; right: 0; height: 40px; z-index: 30;
  display: flex; align-items: center; gap: 14px; padding: 0 14px;
  background: linear-gradient(180deg, rgba(8, 9, 14, 0.85), transparent);
}
.turn-info { color: var(--gold-bright); font-size: 14px; letter-spacing: 1px; }
.phase-info { color: #9d9688; font-size: 12px; }
.deck-info { margin-left: auto; display: flex; align-items: center; gap: 6px; color: #cfc6b2; font-size: 14px; }
.deck-icon {
  width: 18px; height: 26px; border-radius: 3px;
  background: url("/gen/card-back-sm.png") center/cover no-repeat;
  border: 1px solid rgba(212, 175, 96, 0.5);
  box-shadow: 2px 2px 0 rgba(20, 30, 44, 0.9), 4px 4px 0 rgba(20, 30, 44, 0.6);
}

/* ============ 座位（全身卡牌） ============ */
.seats { position: absolute; inset: 44px 10px auto 10px; z-index: 20; pointer-events: none; }
.seat {
  position: absolute; width: var(--seat-w); height: var(--seat-h); pointer-events: auto;
  background: #14161f; border: 2px solid rgba(255, 255, 255, 0.16);
  border-radius: 13px;
  transition: box-shadow 0.25s, border-color 0.25s, transform 0.2s;
}
/* 侧位上限公式：保证 座位+下方装备行 始终在自己区域上方，不被遮挡 */
.seat.pos-r1, .seat.pos-r4 {
  top: min(
    calc(var(--seat-h) * 0.74),
    calc(var(--stage-h) - var(--self-h) - var(--seat-h) - var(--seat-w) * 0.78 - 120px)
  );
}
.seat.pos-r1 { right: 10px; }
.seat.pos-r2 { right: 21%; top: 6px; }
.seat.pos-r3 { left: 21%; top: 6px; }
.seat.pos-r4 { left: 10px; }

.seat-art {
  position: absolute; inset: 0; border-radius: 11px;
  background-size: cover; background-position: center 18%;
}
.seat-art::after {
  content: ""; position: absolute; inset: 0; border-radius: 11px;
  background: linear-gradient(180deg, rgba(0,0,0,0.22) 0%, transparent 22%, transparent 56%, rgba(4,5,9,0.92) 100%);
}
.seat-plate {
  position: absolute; left: 0; right: 0; bottom: 0; z-index: 2;
  padding: 2px 6px 5px; text-align: center;
}
.seat-name {
  font-size: calc(var(--fs) * 0.95); color: #f5efdf; text-shadow: 0 1px 3px #000;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.seat-char { font-size: calc(var(--fs) * 0.78); color: #cdc4ae; text-shadow: 0 1px 2px #000; white-space: nowrap; overflow: hidden; }
.sub-proto { font-size: 0.72em; color: #a79d88; margin-left: 3px; font-weight: 400; }

/* 装备数值角标（武器范围 / 马匹±1） */
.eq-badge {
  position: absolute; top: -5px; right: -5px; z-index: 2;
  min-width: 14px; height: 14px; padding: 0 2px; border-radius: 7px;
  font-size: 9px; line-height: 14px; text-align: center; font-weight: 800;
  background: linear-gradient(180deg, #e8b95e, #9c7320); color: #241a06;
  border: 1px solid rgba(255, 235, 170, 0.8); box-shadow: 0 1px 4px rgba(0,0,0,0.7);
}
.eq-badge.plus { background: linear-gradient(180deg, #6fd98a, #2e7a44); color: #06230f; border-color: rgba(180, 255, 200, 0.8); }
.eq-badge.minus { background: linear-gradient(180deg, #ff8a70, #a83a24); color: #2a0a04; border-color: rgba(255, 200, 180, 0.8); }
.hcard-badge {
  position: absolute; right: 4px; top: 4px;
  padding: 1px 7px; border-radius: 9px;
  font-size: calc(var(--fs) * 0.78); font-weight: 800;
  background: rgba(10, 12, 20, 0.82); color: #ffd98a;
  border: 1px solid rgba(230, 181, 97, 0.6); text-shadow: 0 1px 2px #000;
}
.hcard-badge.plus { color: #8af0a8; border-color: rgba(120, 230, 150, 0.6); }
.hcard-badge.minus { color: #ff9a82; border-color: rgba(255, 140, 110, 0.6); }

.seat.active-turn {
  border-color: var(--gold);
  box-shadow: 0 0 22px rgba(230, 181, 97, 0.65), inset 0 0 16px rgba(230, 181, 97, 0.12);
  animation: turnGlow 1.6s ease-in-out infinite;
}
@keyframes turnGlow {
  0%, 100% { box-shadow: 0 0 14px rgba(230, 181, 97, 0.45); }
  50% { box-shadow: 0 0 30px rgba(255, 217, 138, 0.85); }
}
.turn-ribbon {
  position: absolute; top: -11px; left: 50%; transform: translateX(-50%); z-index: 4;
  font-size: 11px; letter-spacing: 2px; padding: 1px 12px; border-radius: 9px;
  background: linear-gradient(180deg, #ffd98a, #b98c3e); color: #241a06; font-weight: 800;
  box-shadow: 0 2px 8px rgba(0,0,0,0.6), 0 0 12px rgba(255, 217, 138, 0.6);
}
.seat.pending-act { animation: pendingPulse 1.1s ease-in-out infinite; }
@keyframes pendingPulse {
  0%, 100% { box-shadow: 0 0 10px rgba(109, 185, 255, 0.35); border-color: rgba(109, 185, 255, 0.6); }
  50% { box-shadow: 0 0 26px rgba(109, 185, 255, 0.9); border-color: var(--blue); }
}
/* 等待者卡牌内底部倒计时条 */
.seat-timer {
  position: absolute; left: 6px; right: 6px; bottom: 2px; z-index: 5;
  height: 4px; border-radius: 2px; background: rgba(0, 0, 0, 0.55);
  overflow: hidden; box-shadow: 0 0 4px rgba(0,0,0,0.6);
}
.seat-timer i {
  display: block; height: 100%; width: 100%;
  background: linear-gradient(90deg, var(--gold), #ff9a5b);
  border-radius: 2px; transition: width 0.2s linear;
  box-shadow: 0 0 6px rgba(255, 180, 90, 0.8);
}
/* 回合外响应者：红色倒计时条 */
.seat-timer.resp i {
  background: linear-gradient(90deg, #ff5b5b, #ff9a8a);
  box-shadow: 0 0 6px rgba(255, 100, 90, 0.9);
}
/* 出牌方在他人响应期间：满格金条常亮 */
.seat-timer.full i { transition: none; animation: fullGlow 1.2s ease-in-out infinite; }
@keyframes fullGlow {
  0%, 100% { box-shadow: 0 0 4px rgba(255, 180, 90, 0.5); }
  50% { box-shadow: 0 0 10px rgba(255, 200, 110, 1); }
}

/* 落雷特效 */
.bolt-svg {
  position: absolute; inset: 0; width: 100%; height: 100%; z-index: 79; pointer-events: none;
  filter: drop-shadow(0 0 10px rgba(150, 200, 255, 0.95));
  animation: boltFlicker 0.7s ease-out forwards;
}
@keyframes boltFlicker {
  0% { opacity: 0; } 10% { opacity: 1; } 28% { opacity: 0.3; }
  40% { opacity: 1; } 70% { opacity: 0.7; } 100% { opacity: 0; }
}
.bolt-impact {
  position: absolute; width: 26px; height: 26px; border-radius: 50%; z-index: 79;
  transform: translate(-50%, -50%);
  background: radial-gradient(circle, #fff, rgba(150, 200, 255, 0.8) 45%, transparent 70%);
  animation: boltImpact 0.7s ease-out forwards; pointer-events: none;
}
@keyframes boltImpact {
  0% { opacity: 1; transform: translate(-50%, -50%) scale(0.5); }
  100% { opacity: 0; transform: translate(-50%, -50%) scale(4.5); }
}

/* 判定结果印章（含判定牌展示） */
.verdict-pop {
  position: absolute; left: 50%; top: 30%; transform: translate(-50%, -50%);
  z-index: 82; pointer-events: none; text-align: center;
  display: flex; align-items: center; gap: 18px;
  padding: 14px 30px; border-radius: 14px;
  background: rgba(12, 14, 20, 0.9); backdrop-filter: blur(2px);
  animation: verdictIn 2.1s cubic-bezier(0.2, 0.9, 0.3, 1.2) forwards;
}
.vp-card {
  width: calc(var(--card-w) * 0.78); height: calc(var(--card-h) * 0.78);
  border-radius: 8px; background-size: cover; background-position: center;
  border: 2px solid rgba(255, 255, 255, 0.5); position: relative; flex-shrink: 0;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.7);
  animation: vpCardFlip 0.5s ease;
}
@keyframes vpCardFlip { from { transform: rotateY(90deg); } to { transform: rotateY(0); } }
.vp-text { display: flex; flex-direction: column; align-items: center; }
.verdict-pop.good { border: 2px solid rgba(125, 255, 169, 0.8); box-shadow: 0 0 30px rgba(90, 230, 140, 0.5); }
.verdict-pop.bad { border: 2px solid rgba(255, 91, 91, 0.8); box-shadow: 0 0 30px rgba(255, 80, 70, 0.5); }
.vp-icon {
  font-size: clamp(30px, 4.6vmin, 52px); font-weight: 900; line-height: 1;
}
.verdict-pop.good .vp-icon { color: #7dffa9; text-shadow: 0 0 18px rgba(110, 240, 160, 0.95); }
.verdict-pop.bad .vp-icon { color: #ff6b5b; text-shadow: 0 0 18px rgba(255, 90, 70, 0.95); }
.vp-title {
  font-size: clamp(18px, 2.8vmin, 30px); font-weight: 800; letter-spacing: 4px; margin-top: 4px;
  color: #f3ead7; text-shadow: 0 2px 6px #000;
}
.vp-sub { font-size: clamp(12px, 1.6vmin, 16px); color: #b9b19e; margin-top: 3px; letter-spacing: 1px; }
.vp-rule {
  font-size: clamp(11px, 1.4vmin, 14px); color: #8fb8d8; margin-top: 5px;
  padding: 2px 10px; border-radius: 8px; background: rgba(100, 150, 200, 0.12);
  border: 1px solid rgba(120, 170, 220, 0.3);
}
@keyframes verdictIn {
  0% { opacity: 0; transform: translate(-50%, -50%) scale(1.7); }
  14% { opacity: 1; transform: translate(-50%, -50%) scale(1); }
  80% { opacity: 1; }
  100% { opacity: 0; transform: translate(-50%, -56%) scale(0.94); }
}

.status-chip {
  position: absolute; left: 50%; top: calc(var(--seat-h) * 0.48); transform: translateX(-50%); z-index: 4;
  font-size: 11px; padding: 2px 12px; border-radius: 10px; white-space: nowrap;
  background: rgba(18, 30, 48, 0.95); border: 1px solid rgba(109, 185, 255, 0.7); color: #aed4ff;
  box-shadow: 0 0 10px rgba(109, 185, 255, 0.4);
  animation: chipBlink 1.2s ease-in-out infinite;
}
@keyframes chipBlink { 50% { opacity: 0.65; } }
.seat.targetable { cursor: pointer; border-color: rgba(125, 255, 169, 0.7); box-shadow: 0 0 16px rgba(125, 255, 169, 0.45); }
.seat.targetable:hover { transform: scale(1.04); }
.seat.target-chosen { border-color: var(--red); box-shadow: 0 0 22px rgba(255, 91, 91, 0.75); }
.seat.dying { animation: dyingPulse 0.8s ease-in-out infinite; }
@keyframes dyingPulse {
  0%, 100% { box-shadow: 0 0 12px rgba(255, 60, 60, 0.5); }
  50% { box-shadow: 0 0 30px rgba(255, 30, 30, 0.95); }
}
.seat.dead { filter: grayscale(0.95) brightness(0.55); }
.seat.shake { animation: seatShake 0.45s; }
@keyframes seatShake {
  0%, 100% { transform: translateX(0); }
  20% { transform: translateX(-7px) rotate(-1deg); }
  40% { transform: translateX(6px) rotate(1deg); }
  60% { transform: translateX(-4px); }
  80% { transform: translateX(3px); }
}
.seat.flash-red::before {
  content: ""; position: absolute; inset: 0; border-radius: 12px;
  background: rgba(255, 40, 40, 0.4); animation: fadeOut 0.6s forwards; pointer-events: none;
}
.seat.flash-green::before {
  content: ""; position: absolute; inset: 0; border-radius: 12px;
  background: rgba(80, 255, 140, 0.32); animation: fadeOut 0.8s forwards; pointer-events: none;
}
@keyframes fadeOut { to { opacity: 0; } }

.role-badge {
  position: absolute; top: -9px; left: -9px; z-index: 4;
  min-width: 26px; height: 26px; padding: 0 5px; border-radius: 8px;
  font-size: 14px; line-height: 26px; text-align: center; font-weight: 800;
  background: #333; border: 1px solid rgba(255, 255, 255, 0.45); color: #fff;
  box-shadow: 0 2px 6px rgba(0,0,0,0.7);
  text-shadow: 0 1px 2px rgba(0,0,0,0.4);
}
.role-badge.lord {
  background: linear-gradient(180deg, #ffd45e, #b8860b); color: #2a1d04;
  border-color: #ffe9a8; min-width: 30px; height: 30px; line-height: 30px; font-size: 16px;
  box-shadow: 0 0 12px rgba(255, 212, 94, 0.9), 0 2px 6px rgba(0,0,0,0.7);
  animation: lordGlow 1.8s ease-in-out infinite;
}
@keyframes lordGlow {
  0%, 100% { box-shadow: 0 0 8px rgba(255, 212, 94, 0.7), 0 2px 6px rgba(0,0,0,0.7); }
  50% { box-shadow: 0 0 20px rgba(255, 226, 140, 1), 0 2px 6px rgba(0,0,0,0.7); }
}
.role-badge.loyalist { background: linear-gradient(180deg, #d9d04f, #8f8a25); color: #1f1d06;}
.role-badge.rebel { background: linear-gradient(180deg, #4fae5c, #2c6e36); }
.role-badge.spy { background: linear-gradient(180deg, #7a64d9, #4a3a91); }
.dead-stamp {
  position: absolute; inset: 0; display: flex; align-items: center; justify-content: center;
  font-size: 26px; font-weight: 800; color: rgba(255, 70, 70, 0.95);
  text-shadow: 0 0 8px #000; transform: rotate(-18deg); letter-spacing: 4px; z-index: 5;
}
.faction-dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; margin-right: 4px; }
.faction-wei { background: var(--wei); } .faction-shu { background: var(--shu); }
.faction-wu { background: var(--wu); } .faction-qun { background: var(--qun); }

.hp-row { display: flex; gap: 3px; align-items: center; justify-content: center; margin-top: 2px; }
.hp-orb {
  width: clamp(9px, calc(var(--svmin) * 1.3), 17px); height: clamp(9px, calc(var(--svmin) * 1.3), 17px); border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, #9cffb4, #28a049 65%, #135c27);
  box-shadow: 0 0 4px rgba(60, 220, 110, 0.7);
}
.hp-orb.lost { background: radial-gradient(circle at 35% 30%, #555, #2a2a2a 70%); box-shadow: none; }
.hp-orb.low { background: radial-gradient(circle at 35% 30%, #ffd2a8, #d9742f 65%, #7c3a10); box-shadow: 0 0 4px rgba(255, 150, 60, 0.8); }
.hp-orb.crit { background: radial-gradient(circle at 35% 30%, #ffb3b3, #d92f2f 65%, #6e0e0e); box-shadow: 0 0 5px rgba(255, 60, 60, 0.9); animation: critBlink 1s infinite; }
@keyframes critBlink { 50% { opacity: 0.55; } }

.hand-badge {
  position: absolute; top: -8px; right: -8px; z-index: 4;
  display: flex; align-items: center; gap: 2px;
  font-size: 12px; font-weight: 700; color: #e8f0ff;
  background: rgba(25, 32, 52, 0.95); border: 1px solid rgba(140, 170, 230, 0.6);
  border-radius: 9px; padding: 1px 7px; box-shadow: 0 2px 6px rgba(0,0,0,0.6);
}
.hand-badge::before {
  content: ""; width: 9px; height: 13px; border-radius: 2px;
  background: url("/gen/card-back-sm.png") center/cover no-repeat;
  border: 1px solid rgba(212, 175, 96, 0.6);
}
/* 装备：参考英雄杀，座位卡正下方横排小卡面 */
.equip-minis {
  position: absolute; top: calc(100% + 3px); left: 0; right: 0; z-index: 3;
  display: flex; flex-direction: row; gap: 3px; justify-content: center;
}
.equip-thumb {
  position: relative;
  width: calc(var(--seat-w) * 0.23); height: calc(var(--seat-w) * 0.3);
  border-radius: 4px; background-size: cover; background-position: center 28%;
  border: 1px solid rgba(190, 205, 240, 0.6);
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.75);
  background-color: #141722;
}
.equip-thumb .et-tag {
  position: absolute; left: 0; right: 0; bottom: -1px;
  font-size: clamp(7px, calc(var(--svmin) * 0.95), 11px); line-height: 1.3;
  text-align: center; color: #dfe8ff; background: rgba(8, 12, 22, 0.85);
  border-radius: 0 0 3px 3px; white-space: nowrap; overflow: hidden;
}
.equip-thumb .et-corner {
  position: absolute; top: 0; left: 2px; z-index: 2;
  font-size: clamp(8px, calc(var(--svmin) * 1.1), 13px); font-weight: 800; line-height: 1.15;
  text-shadow: 0 1px 2px #000, 0 0 3px #000;
}
.et-corner.red { color: #ff8a78; } .et-corner.black { color: #eef0f8; }
/* 空槽占位 */
.equip-thumb.empty {
  background: rgba(10, 14, 24, 0.5);
  border: 1px dashed rgba(160, 180, 220, 0.3);
  box-shadow: none;
}
.equip-thumb.empty .et-tag { color: #6f7587; background: transparent; }
/* 自己：卡牌整体上移，装备行与其他人一致放在卡牌正下方 */
.self-seat { padding-bottom: calc(var(--seat-w) * 0.34 + 8px); }

/* 判定区小卡（闪电/乐不思蜀）：固定在人物卡"朝屏幕中心"的外侧
   右侧座位 → 左外侧；左侧座位/自己 → 右外侧 */
.seat.pos-r1 .judge-icons, .seat.pos-r2 .judge-icons {
  right: auto; left: calc(var(--seat-w) * -0.26);
}
.seat.pos-r3 .judge-icons, .seat.pos-r4 .judge-icons,
.self-seat .judge-icons {
  left: auto; right: calc(var(--seat-w) * -0.26);
}
/* 判定区（乐不思蜀/闪电）：人物卡右侧贴边醒目小卡图 */
.judge-icons {
  position: absolute; top: calc(var(--seat-h) * 0.16); right: 2px;
  display: flex; flex-direction: column; gap: 3px; z-index: 3;
}
.judge-thumb {
  position: relative;
  width: calc(var(--seat-w) * 0.2); height: calc(var(--seat-w) * 0.28);
  border-radius: 3px; background-size: cover; background-position: center;
  border: 1px solid #b07fe8;
  box-shadow: 0 0 10px rgba(150, 80, 230, 0.9), 0 2px 8px rgba(0, 0, 0, 0.7);
  animation: judgeGlow 1.4s ease-in-out infinite;
}
@keyframes judgeGlow {
  0%, 100% { box-shadow: 0 0 6px rgba(150, 80, 230, 0.6), 0 2px 8px rgba(0,0,0,0.7); transform: translateY(0); }
  50% { box-shadow: 0 0 16px rgba(180, 110, 255, 1), 0 2px 8px rgba(0,0,0,0.7); transform: translateY(-2px); }
}
.judge-thumb .et-tag {
  position: absolute; left: 0; right: 0; bottom: 0; font-size: 8px; line-height: 10px;
  text-align: center; color: #f0e3ff; background: rgba(30, 12, 50, 0.8);
  border-radius: 0 0 3px 3px; white-space: nowrap; overflow: hidden;
}
.judge-icon {
  width: 18px; height: 18px; border-radius: 50%; font-size: 10px; line-height: 18px; text-align: center;
  background: radial-gradient(circle, #6b3fa0, #3a2158); border: 1px solid #b07fe8; color: #f0e3ff;
  box-shadow: 0 0 6px rgba(150, 80, 230, 0.8); animation: judgeFloat 2s ease-in-out infinite;
}
@keyframes judgeFloat { 50% { transform: translateY(-2px); } }

.seat-bubble {
  position: absolute; left: 50%; bottom: -26px; transform: translateX(-50%);
  background: rgba(20, 24, 34, 0.92); border: 1px solid rgba(109, 185, 255, 0.5);
  color: #bcd9ff; font-size: 11px; padding: 2px 10px; border-radius: 10px; white-space: nowrap;
  animation: bubbleIn 0.25s ease; z-index: 5;
}
@keyframes bubbleIn { from { opacity: 0; transform: translateX(-50%) translateY(5px); } }

/* ============ 中央区 ============ */
.center-area {
  position: absolute; left: 50%; top: 45%; transform: translate(-50%, -50%);
  z-index: 10; pointer-events: none;
}
.table-cards { display: flex; gap: 10px; min-height: var(--card-h); align-items: center; justify-content: center; }
.table-card {
  width: var(--card-w); height: var(--card-h);
  border-radius: 8px; position: relative;
  background-size: cover; background-position: center;
  border: 1px solid rgba(255, 255, 255, 0.3);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.65);
  animation: tableCardIn 0.35s cubic-bezier(0.2, 0.9, 0.3, 1.25);
}
.table-card.fading { animation: tableCardOut 0.5s forwards; }
@keyframes tableCardIn { from { opacity: 0; transform: scale(0.5) translateY(40px); } }
@keyframes tableCardOut { to { opacity: 0; transform: translateY(26px) scale(0.85); } }
.table-card .who {
  position: absolute; top: -20px; left: 50%; transform: translateX(-50%);
  font-size: 11px; color: #ffe9bb; text-shadow: 0 1px 3px #000; white-space: nowrap;
}

/* 卡牌通用 */
.card-face {
  background-size: cover; background-position: center; border-radius: 8px; position: relative;
}
.corner {
  position: absolute; top: 4px; left: 5px; line-height: 1.05;
  font-size: 13px; font-weight: 800; text-shadow: 0 1px 2px #000, 0 0 4px #000;
  display: flex; flex-direction: column; align-items: center;
}
.corner.red { color: #ff7a6b; } .corner.black { color: #e8e8f0; }

/* ============ 手牌 ============ */
.self-area {
  position: absolute; left: 0; right: 0; bottom: 0; z-index: 40;
  display: flex; align-items: flex-end; gap: 10px; padding: 6px 10px 8px;
}
.self-seat { flex-shrink: 0; width: var(--self-w); position: relative; }
.self-seat .seat { position: relative; width: var(--self-w); height: var(--self-h); }
.hand-wrap { flex: 1; display: flex; flex-direction: column; align-items: center; min-width: 0; }
.virtual-bar { display: flex; gap: 6px; margin-bottom: 4px; flex-wrap: wrap; justify-content: center; }
.virtual-chip {
  font-size: 12px; padding: 3px 12px; border-radius: 12px; cursor: pointer;
  background: rgba(90, 60, 130, 0.55); border: 1px solid rgba(190, 140, 255, 0.6); color: #e3ccff;
  transition: all 0.15s;
}
.virtual-chip:hover, .virtual-chip.on { background: rgba(140, 90, 200, 0.8); box-shadow: 0 0 10px rgba(190, 140, 255, 0.6); }
.hand {
  display: flex; justify-content: center; align-items: flex-end;
  height: calc(var(--card-h) + 26px); max-width: 100%;
}
/* 手牌 ≥10 张自动收缩（--card-h 由 --card-w 派生，会一并缩小） */
.hand.compact { --card-w: clamp(56px, calc(var(--svmin) * 6.8), 124px); }
.hcard {
  width: var(--card-w); height: var(--card-h); flex-shrink: 0;
  margin: 0 calc(min(0px, (78vw - var(--n, 6) * var(--card-w)) / var(--n, 6) / 2));
  border-radius: 9px; position: relative; cursor: pointer;
  background-size: cover; background-position: center;
  border: 1px solid rgba(255, 255, 255, 0.28);
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.6);
  transition: transform 0.16s ease, box-shadow 0.16s ease, filter 0.16s;
  transform: translateY(14px);
}
.hcard:hover { transform: translateY(-12px) scale(1.06); z-index: 5; box-shadow: 0 14px 30px rgba(0, 0, 0, 0.8); }
.hcard.disabled { filter: grayscale(0.75) brightness(0.55); cursor: default; }
.hcard.disabled:hover { transform: translateY(14px); }
.hcard.selected {
  transform: translateY(-22px) scale(1.07); z-index: 6;
  border-color: var(--gold-bright);
  box-shadow: 0 0 0 2px var(--gold), 0 0 22px rgba(255, 217, 138, 0.65), 0 14px 30px rgba(0, 0, 0, 0.8);
}
.hcard.newly { animation: cardDealIn 0.4s cubic-bezier(0.2, 0.9, 0.3, 1.2); }
@keyframes cardDealIn { from { opacity: 0; transform: translateY(60px) rotate(8deg) scale(0.7); } to { transform: translateY(14px); } }

/* 技能按钮：贴在自己武将牌右侧（参考三国杀，缩短点击距离） */
.skill-buttons {
  position: absolute; left: calc(100% + 6px); bottom: 4px; z-index: 6;
  display: flex; flex-direction: column; gap: 5px; width: max-content; max-width: 120px;
}
.skill-btn {
  font-size: calc(var(--fs) * 0.92); padding: 4px 12px; border-radius: 14px; cursor: pointer; text-align: center;
  background: linear-gradient(180deg, rgba(50, 70, 120, 0.92), rgba(30, 42, 76, 0.92));
  border: 1px solid rgba(120, 160, 240, 0.55); color: #cfdfff; letter-spacing: 2px;
  transition: all 0.15s; box-shadow: 0 2px 8px rgba(0, 0, 0, 0.5);
}
.skill-btn:hover { box-shadow: 0 0 12px rgba(120, 160, 240, 0.6); filter: brightness(1.25); }
.skill-btn { display: flex; align-items: center; justify-content: center; gap: 5px; }
.sk-ic {
  width: 20px; height: 20px; border-radius: 50%; object-fit: cover; flex-shrink: 0;
  border: 1px solid rgba(255, 255, 255, 0.35); background: rgba(0,0,0,0.4);
  vertical-align: -5px;
}
.tooltip .sk-ic { width: 17px; height: 17px; margin-right: 3px; }
.skill-btn.active-skill {
  border-color: rgba(255, 217, 138, 0.7); color: #ffe9bb;
  background: linear-gradient(180deg, rgba(120, 86, 30, 0.95), rgba(80, 56, 18, 0.95));
  animation: skillReady 1.6s ease-in-out infinite;
}
@keyframes skillReady { 50% { box-shadow: 0 0 14px rgba(255, 217, 138, 0.65); } }
.skill-btn.passive { background: rgba(28, 30, 40, 0.85); border-color: rgba(255,255,255,0.18); color: #9a968a; cursor: help; }
.skill-btn.lord-skill { border-color: rgba(230, 181, 97, 0.6); color: var(--gold-bright); }

/* 确定/取消/结束：手牌正上方一行（紧挨手牌，缩短点击距离） */
.action-row {
  display: flex; gap: 10px; align-items: center; justify-content: center;
  flex-wrap: wrap; margin-bottom: 4px; min-height: 34px;
}

/* 悬浮提示 */
.tooltip {
  position: absolute; z-index: 95; pointer-events: none;
  max-width: min(300px, 72vw);
  background: rgba(14, 16, 24, 0.96); border: 1px solid rgba(230, 181, 97, 0.5);
  border-radius: 10px; padding: 9px 12px;
  box-shadow: 0 10px 36px rgba(0, 0, 0, 0.75);
  font-size: calc(var(--fs) * 0.9); line-height: 1.6; color: #d8d2c2;
  animation: tipIn 0.12s ease;
}
@keyframes tipIn { from { opacity: 0; transform: translateY(4px); } }
.tooltip .tt-title { color: var(--gold-bright); font-size: calc(var(--fs) * 1.0); margin-bottom: 2px; }
.tooltip .tt-sub { color: #99917f; font-size: calc(var(--fs) * 0.8); margin-bottom: 4px; }
.tooltip .tt-skill b { color: #87b3f5; font-weight: 600; }
.tooltip .tt-row { border-top: 1px dashed rgba(255,255,255,0.12); margin-top: 5px; padding-top: 5px; }

/* ============ 提示条 ============ */
.prompt-bar {
  position: absolute; left: 50%; bottom: calc(var(--self-h) + 24px); transform: translateX(-50%); z-index: 45;
  min-width: 420px; max-width: 760px;
  background: var(--panel); border: 1px solid rgba(230, 181, 97, 0.5);
  border-radius: 12px; padding: 10px 18px 12px;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.6);
  animation: promptIn 0.25s ease;
  text-align: center;
}
@keyframes promptIn { from { opacity: 0; transform: translateX(-50%) translateY(14px); } }
.prompt-text { font-size: calc(var(--fs) * 1.12); color: #ffe9bb; letter-spacing: 1px; margin-bottom: 8px; }
.prompt-timer { height: 4px; border-radius: 2px; background: rgba(255, 255, 255, 0.12); overflow: hidden; margin-bottom: 8px; }
.prompt-timer i { display: block; height: 100%; background: linear-gradient(90deg, var(--gold), #ff9a5b); border-radius: 2px; transition: width 0.2s linear; width: 100%; }
.prompt-actions { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; }

/* ============ 技能横幅 ============ */
.banner-area {
  position: absolute; left: 50%; top: 24%; transform: translateX(-50%);
  z-index: 60; pointer-events: none; display: flex; flex-direction: column; gap: 8px; align-items: center;
}
.skill-banner {
  padding: 8px 46px; border-radius: 6px; white-space: nowrap;
  font-size: clamp(18px, calc(var(--svmin) * 3.2), 40px); font-weight: 800; letter-spacing: 8px; color: #ffeec9;
  background: linear-gradient(90deg, transparent, rgba(120, 70, 20, 0.92) 18%, rgba(160, 100, 30, 0.95) 50%, rgba(120, 70, 20, 0.92) 82%, transparent);
  text-shadow: 0 0 14px rgba(255, 200, 100, 0.9), 0 2px 4px #000;
  animation: bannerIn 1.6s ease forwards;
}
.skill-banner small { font-size: 14px; letter-spacing: 2px; color: #ffd98a; margin-right: 14px; font-weight: 500; }
@keyframes bannerIn {
  0% { opacity: 0; transform: scaleX(0.3); }
  14% { opacity: 1; transform: scaleX(1.04); }
  20% { transform: scaleX(1); }
  78% { opacity: 1; }
  100% { opacity: 0; transform: translateY(-12px); }
}

/* ============ 飞行牌 / 浮动数字 / 特效 ============ */
.fx-layer { position: absolute; inset: 0; z-index: 70; pointer-events: none; overflow: hidden; }
.fly-card {
  position: absolute; width: calc(var(--card-w) * 0.85); height: calc(var(--card-h) * 0.85);
  border-radius: 7px; background-size: cover; background-position: center;
  border: 1px solid rgba(255, 255, 255, 0.4); box-shadow: 0 10px 26px rgba(0, 0, 0, 0.7);
  transition: left 0.55s cubic-bezier(0.3, 0.7, 0.3, 1), top 0.55s cubic-bezier(0.3, 0.7, 0.3, 1), opacity 0.4s;
}
.fly-back {
  background: url("/gen/card-back-sm.png") center/cover no-repeat;
  border-color: rgba(212, 175, 96, 0.55);
}
.float-num {
  position: absolute; font-size: 34px; font-weight: 900; z-index: 80;
  text-shadow: 0 0 12px currentColor, 0 2px 4px #000;
  animation: floatUp 1.15s ease-out forwards;
}
.float-num.dmg { color: #ff5b4b; }
.float-num.heal { color: #7dffa9; }
@keyframes floatUp {
  0% { opacity: 0; transform: translateY(8px) scale(0.5); }
  18% { opacity: 1; transform: translateY(-6px) scale(1.25); }
  100% { opacity: 0; transform: translateY(-54px) scale(1); }
}
.screen-flash { position: absolute; inset: 0; animation: fadeOut 0.5s forwards; }
.screen-flash.lightning {
  background:
    radial-gradient(ellipse at 50% 0%, rgba(190, 220, 255, 0.85), transparent 65%),
    rgba(140, 180, 255, 0.25);
  animation: lightningFlash 0.7s forwards;
}
@keyframes lightningFlash {
  0% { opacity: 0; } 8% { opacity: 1; } 22% { opacity: 0.25; }
  32% { opacity: 0.9; } 100% { opacity: 0; }
}
.slash-fx {
  position: absolute; width: 120px; height: 120px; z-index: 75;
  transform: translate(-50%, -50%) rotate(-18deg);
  pointer-events: none;
}
.slash-fx::before {
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(115deg, transparent 42%, rgba(255, 240, 210, 0.95) 49%, #fff 50%, rgba(255, 240, 210, 0.95) 51%, transparent 58%);
  filter: drop-shadow(0 0 10px rgba(255, 200, 120, 0.9));
  animation: slashSweep 0.4s ease-out forwards;
}
@keyframes slashSweep {
  from { transform: translate(-70px, -70px) scale(0.4); opacity: 0; }
  30% { opacity: 1; }
  to { transform: translate(60px, 60px) scale(1.15); opacity: 0; }
}

/* 指示箭头 */
.arrow-layer { position: absolute; inset: 0; z-index: 55; pointer-events: none; }
.arrow-line {
  stroke: url(#arrowGrad); stroke-width: 4; fill: none; stroke-linecap: round;
  stroke-dasharray: 10 8; animation: dashMove 0.8s linear infinite;
  filter: drop-shadow(0 0 6px rgba(255, 150, 80, 0.8));
}
@keyframes dashMove { to { stroke-dashoffset: -18; } }
.arrow-head { fill: #ffb35b; filter: drop-shadow(0 0 6px rgba(255, 150, 80, 0.9)); }

/* ============ 战报 ============ */
.log-panel {
  position: absolute; right: 8px; top: 44px; bottom: 200px; width: 290px; z-index: 65;
  background: var(--panel); border: 1px solid rgba(255, 255, 255, 0.15); border-radius: 12px;
  display: flex; flex-direction: column; animation: promptIn 0.2s ease;
}
.log-head { padding: 8px 12px; font-size: 14px; color: var(--gold-bright); display: flex; justify-content: space-between; align-items: center; border-bottom: 1px solid rgba(255,255,255,0.1); }
.log-list { flex: 1; overflow-y: auto; padding: 8px 12px; font-size: 12px; line-height: 1.85; color: #c9c2b2; }
.log-list div { border-bottom: 1px dashed rgba(255,255,255,0.06); }
.log-list .turn-sep { color: var(--gold); }

/* ============ 弹窗 ============ */
.modal { position: fixed; inset: 0; z-index: 90; display: flex; align-items: center; justify-content: center; }
.modal-mask { position: absolute; inset: 0; background: rgba(4, 5, 9, 0.72); backdrop-filter: blur(3px); }
.modal-body {
  position: relative; max-width: 92vw; max-height: 88vh; overflow: auto;
  background: var(--panel-light); border: 1px solid rgba(230, 181, 97, 0.4);
  border-radius: 16px; padding: 22px 26px;
  box-shadow: 0 30px 90px rgba(0, 0, 0, 0.8);
  animation: modalIn 0.3s cubic-bezier(0.2, 0.9, 0.3, 1.18);
}
@keyframes modalIn { from { opacity: 0; transform: scale(0.88) translateY(20px); } }
.modal-title { font-size: 19px; color: var(--gold-bright); letter-spacing: 3px; margin-bottom: 6px; text-align: center; }
.modal-sub { font-size: 13px; color: #a59c8a; text-align: center; margin-bottom: 16px; }
.modal-actions { display: flex; gap: 12px; justify-content: center; margin-top: 18px; }

/* 选将 */
.char-grid { display: flex; gap: 16px; justify-content: center; flex-wrap: wrap; }
.char-card {
  width: 168px; border-radius: 12px; overflow: hidden; cursor: pointer; position: relative;
  border: 2px solid rgba(255, 255, 255, 0.18); background: #14161f;
  transition: all 0.18s ease;
}
.char-card:hover { transform: translateY(-8px) scale(1.03); border-color: var(--gold); box-shadow: 0 16px 40px rgba(0, 0, 0, 0.7), 0 0 20px rgba(230, 181, 97, 0.35); }
.char-card.selected { border-color: var(--gold-bright); box-shadow: 0 0 0 2px var(--gold), 0 0 26px rgba(255, 217, 138, 0.5); }
.char-card img { width: 100%; height: 210px; object-fit: cover; object-position: top; display: block; }
.char-card .cc-info { padding: 8px 10px 10px; }
.cc-name { font-size: 15px; color: #f3ead7; display: flex; align-items: center; }
.cc-rule { font-size: 11px; color: #968d7c; margin: 2px 0 6px; }
.cc-skill { font-size: 11px; color: #b9c8e8; line-height: 1.55; margin-top: 4px; }
.cc-skill b { color: #87b3f5; font-weight: 600; }
.cc-skill .sk-ic { width: 13px; height: 13px; vertical-align: -2px; margin-right: 2px; }
#btn-bgm { opacity: 0.55; }
#btn-bgm.bgm-on { opacity: 1; color: var(--gold-bright); box-shadow: 0 0 8px rgba(230, 181, 97, 0.4); }

/* 设置面板 */
.vol-row {
  display: flex; align-items: center; gap: 14px; margin: 14px 0; min-width: 300px;
}
.vol-row span { width: 72px; font-size: 14px; color: #cfc6b2; }
.vol-row b { width: 34px; text-align: right; color: var(--gold-bright); font-size: 13px; }
.vol-row input[type="range"] { flex: 1; accent-color: var(--gold); }
.cc-hp { font-size: 11px; color: #7ec98f; }

/* 选牌弹窗（拆顺/五谷等） */
.zone-section { margin-bottom: 14px; }
.zone-label { font-size: 13px; color: #a59c8a; margin-bottom: 6px; letter-spacing: 2px; }
.pick-row { display: flex; gap: 10px; flex-wrap: wrap; }
.pick-card {
  width: calc(var(--card-w) * 0.86); height: calc(var(--card-h) * 0.86);
  border-radius: 8px; cursor: pointer; position: relative;
  background-size: cover; background-position: center;
  border: 2px solid rgba(255, 255, 255, 0.2); transition: all 0.15s;
}
.pick-card:hover { transform: translateY(-6px); border-color: var(--gold); }
.pick-card.selected { border-color: var(--gold-bright); box-shadow: 0 0 16px rgba(255, 217, 138, 0.55); transform: translateY(-6px); }
.pick-card.back {
  background: url("/gen/card-back-sm.png") center/cover no-repeat;
  display: flex; align-items: center; justify-content: center;
  color: rgba(255, 226, 150, 0.0); font-size: 26px;
  border-color: rgba(212, 175, 96, 0.45);
}
.pick-card .pc-label {
  position: absolute; bottom: 0; left: 0; right: 0; font-size: 10px; text-align: center;
  background: rgba(0,0,0,0.65); border-radius: 0 0 6px 6px; padding: 2px 0; color: #d8d2c2;
}

/* 观星 */
.gx-zone {
  min-height: calc(var(--card-h) * 0.86 + 38px); border: 1px dashed rgba(255, 255, 255, 0.25);
  border-radius: 10px; padding: 8px; display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 6px;
}
.gx-zone.top { border-color: rgba(230, 181, 97, 0.5); }
.gx-item { display: flex; flex-direction: column; align-items: center; gap: 4px; }
.gx-num {
  position: absolute; top: -10px; left: 50%; transform: translateX(-50%);
  font-size: 11px; font-weight: 800; padding: 1px 8px; border-radius: 9px; white-space: nowrap;
  background: linear-gradient(180deg, #ffd98a, #b98c3e); color: #241a06;
  box-shadow: 0 2px 6px rgba(0,0,0,0.6);
}
.gx-arrows { display: flex; gap: 6px; }
.gx-arrow {
  width: 30px; height: 22px; border-radius: 6px; cursor: pointer; font-size: 12px;
  background: rgba(50, 60, 90, 0.8); border: 1px solid rgba(140, 170, 230, 0.5); color: #cfdfff;
}
.gx-arrow:disabled { opacity: 0.3; cursor: default; }
.gx-arrow:hover:not(:disabled) { filter: brightness(1.3); }

/* 花色选择 */
.suit-row { display: flex; gap: 14px; justify-content: center; }
.suit-btn { font-size: 34px; width: 64px; height: 64px; border-radius: 12px; cursor: pointer;
  background: rgba(255, 255, 255, 0.06); border: 1px solid rgba(255, 255, 255, 0.25);
  transition: all 0.15s; display: flex; align-items: center; justify-content: center; }
.suit-btn:hover { transform: scale(1.12); border-color: var(--gold); }
.suit-btn.red { color: #ff7a6b; } .suit-btn.black { color: #e8e8f0; }

/* 结算结果 */
.gameover-panel { text-align: center; padding: 10px 30px; }
.go-title { font-size: 44px; font-weight: 900; letter-spacing: 10px; margin-bottom: 6px; }
.go-title.win { color: var(--gold-bright); text-shadow: 0 0 30px rgba(255, 217, 138, 0.8); }
.go-title.lose { color: #8d97ad; }
.go-roles { display: flex; gap: 14px; justify-content: center; margin: 22px 0; flex-wrap: wrap; }
.go-player { width: 110px; padding: 10px 6px; border-radius: 10px; background: rgba(255, 255, 255, 0.05); }
.go-player img { width: 56px; height: 56px; border-radius: 8px; object-fit: cover; }
.go-player .gp-name { font-size: 12px; margin-top: 5px; color: #ddd5c4; }
.go-player .gp-role { font-size: 11px; margin-top: 2px; }
.go-player.winner { background: rgba(230, 181, 97, 0.14); box-shadow: 0 0 14px rgba(230, 181, 97, 0.25); }

/* 判定翻牌 */
.judge-flip {
  position: absolute; left: 50%; top: 34%; transform: translate(-50%, -50%); z-index: 78;
  width: calc(var(--card-w) * 1.05); height: calc(var(--card-h) * 1.05);
  border-radius: 10px; background-size: cover; background-position: center;
  border: 2px solid rgba(255, 255, 255, 0.5); box-shadow: 0 0 40px rgba(150, 80, 230, 0.55);
  animation: judgeFlipIn 1.8s ease forwards;
}
.jf-caption {
  position: absolute; top: 100%; left: 50%; transform: translateX(-50%);
  margin-top: 6px; text-align: center; white-space: nowrap;
}
.jf-reason {
  font-size: calc(var(--fs) * 1.0); color: #ffe9bb; font-weight: 700;
  text-shadow: 0 2px 6px #000; letter-spacing: 2px;
}
.jf-rule {
  font-size: calc(var(--fs) * 0.82); color: #9fc4e0; margin-top: 2px;
  padding: 1px 10px; border-radius: 8px;
  background: rgba(14, 20, 30, 0.85); border: 1px solid rgba(120, 170, 220, 0.35);
}
@keyframes judgeFlipIn {
  0% { opacity: 0; transform: translate(-50%, -50%) rotateY(90deg) scale(0.7); }
  22% { opacity: 1; transform: translate(-50%, -50%) rotateY(0) scale(1.08); }
  32% { transform: translate(-50%, -50%) scale(1); }
  80% { opacity: 1; }
  100% { opacity: 0; transform: translate(-50%, -52%) scale(0.92); }
}

/* ============ 出牌强化特效 ============ */
.burst-ring {
  position: absolute; width: 30px; height: 30px; border-radius: 50%;
  border: 3px solid rgba(255, 217, 138, 0.9);
  box-shadow: 0 0 24px rgba(255, 190, 90, 0.9), inset 0 0 18px rgba(255, 190, 90, 0.5);
  transform: translate(-50%, -50%);
  animation: burstRing 0.65s ease-out forwards;
  pointer-events: none;
}
@keyframes burstRing {
  0% { opacity: 1; transform: translate(-50%, -50%) scale(0.4); }
  100% { opacity: 0; transform: translate(-50%, -50%) scale(5.2); }
}
.burst-ring.trick { border-color: rgba(150, 200, 255, 0.9); box-shadow: 0 0 24px rgba(110, 170, 255, 0.9), inset 0 0 18px rgba(110, 170, 255, 0.5); }
.burst-ring.heal-c { border-color: rgba(140, 255, 180, 0.9); box-shadow: 0 0 24px rgba(90, 230, 140, 0.9), inset 0 0 18px rgba(90, 230, 140, 0.5); }

.name-pop {
  position: absolute; left: 50%; top: 38%; transform: translate(-50%, -50%);
  z-index: 76; pointer-events: none;
  font-size: clamp(34px, calc(var(--svmin) * 6.5), 86px); font-weight: 900; letter-spacing: 12px; white-space: nowrap;
  color: #ffe9bb; -webkit-text-stroke: 1px rgba(120, 60, 10, 0.8);
  text-shadow: 0 0 26px rgba(255, 180, 80, 0.95), 0 4px 10px #000;
  animation: namePop 0.95s cubic-bezier(0.2, 0.9, 0.3, 1.2) forwards;
}
@keyframes namePop {
  0% { opacity: 0; transform: translate(-50%, -50%) scale(2.4); }
  22% { opacity: 1; transform: translate(-50%, -50%) scale(1); }
  72% { opacity: 1; }
  100% { opacity: 0; transform: translate(-50%, -56%) scale(0.92); }
}
.name-pop.trick { color: #cde4ff; -webkit-text-stroke-color: rgba(20, 60, 120, 0.8); text-shadow: 0 0 26px rgba(120, 180, 255, 0.95), 0 4px 10px #000; }
.name-pop.heal-c { color: #d2ffe0; -webkit-text-stroke-color: rgba(15, 90, 45, 0.8); text-shadow: 0 0 26px rgba(110, 240, 160, 0.95), 0 4px 10px #000; }

.game.screen-shake { animation: screenShake 0.4s; }
@keyframes screenShake {
  0%, 100% { transform: translate(0, 0); }
  20% { transform: translate(-6px, 3px); }
  40% { transform: translate(5px, -3px); }
  60% { transform: translate(-4px, 2px); }
  80% { transform: translate(3px, -1px); }
}

/* 指向箭头（移植自原项目 flight-effect：细长光束缓慢延伸 + 箭头 + 命中脉冲 + 粒子） */
.flight {
  position: absolute; height: 0; z-index: 74; pointer-events: none;
  transform-origin: left center;
  filter: drop-shadow(0 0 5px rgba(255, 216, 112, 0.8)) drop-shadow(0 0 12px rgba(188, 35, 22, 0.46));
  animation: flight-life 1.5s ease-out both;
  will-change: transform, opacity;
}
.flight::before { /* 光束 */
  content: ""; position: absolute; left: 0; top: -3px; width: 100%; height: 6px; border-radius: 999px;
  background: linear-gradient(90deg, transparent 0 4%, rgba(255, 246, 188, 0.76) 14%, #fff064 34%, #ff321f 66%, #ffe6a1 100%);
  box-shadow: 0 0 0 1px rgba(255, 225, 126, 0.36), 0 0 9px rgba(191, 44, 30, 0.58), 0 0 16px rgba(255, 210, 92, 0.32);
  transform: scaleX(0); transform-origin: left center;
  animation: flight-beam 1.5s cubic-bezier(0.16, 0.82, 0.22, 1) both;
}
.flight::after { /* 箭头 */
  content: ""; position: absolute; right: -5px; top: -9px; width: 0; height: 0;
  border-top: 9px solid transparent; border-bottom: 9px solid transparent;
  border-left: 18px solid #fff064;
  filter: drop-shadow(0 0 1px rgba(255, 255, 255, 0.72)) drop-shadow(0 0 8px rgba(218, 51, 30, 0.62));
  opacity: 0;
  animation: flight-head 1.5s cubic-bezier(0.16, 0.82, 0.22, 1) both;
}
.flight .fl-label { /* 中点卡名标签 */
  position: absolute; left: 52%; top: -27px; max-width: 120px;
  padding: 2px 8px; border: 1px solid rgba(224, 179, 87, 0.56); border-radius: 999px;
  background: rgba(54, 18, 14, 0.78); color: #ffe3a5;
  font-size: 12px; font-weight: 800; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  transform: translateX(-50%); text-shadow: 0 2px 6px rgba(0, 0, 0, 0.9);
  box-shadow: 0 0 8px rgba(171, 40, 27, 0.28);
}
.flight .fl-pulse { /* 命中脉冲 */
  position: absolute; right: -14px; top: -14px; width: 28px; height: 28px;
  border: 1px solid rgba(255, 211, 111, 0.72); border-radius: 50%;
  opacity: 0; transform: scale(0.35);
  box-shadow: 0 0 9px rgba(195, 46, 28, 0.46), inset 0 0 8px rgba(255, 233, 152, 0.28);
  animation: flight-impact-pulse 1.5s ease-out both;
}
.flight .fl-particles { /* 拖尾粒子 */
  position: absolute; right: 5%; top: 0; width: 5px; height: 5px; border-radius: 50%;
  background: #ffe6a1; opacity: 0;
  box-shadow: -22px -10px 0 rgba(196, 45, 29, 0.86), -46px 9px 0 rgba(255, 216, 115, 0.9),
    -76px -7px 0 rgba(255, 236, 171, 0.82), -110px 10px 0 rgba(185, 49, 31, 0.72);
  animation: flight-particles 1.5s ease-out both;
}
/* 锦囊（紫金）/ 回复（绿） */
.flight.fl-tactic { filter: drop-shadow(0 0 10px rgba(205, 135, 255, 0.68)); }
.flight.fl-tactic::before { background: linear-gradient(90deg, transparent, rgba(255, 246, 215, 0.92) 18%, rgba(188, 101, 255, 0.98) 68%, rgba(255, 219, 111, 0.96)); box-shadow: 0 0 18px rgba(190, 105, 255, 0.7), 0 0 34px rgba(255, 222, 123, 0.32); }
.flight.fl-tactic::after { border-left-color: #d9a7ff; filter: drop-shadow(0 0 10px rgba(210, 150, 255, 0.94)); }
.flight.fl-tactic .fl-label { border-color: rgba(205, 150, 255, 0.55); background: rgba(40, 18, 56, 0.78); color: #ecd7ff; }
.flight.fl-heal { filter: drop-shadow(0 0 10px rgba(112, 255, 172, 0.68)); }
.flight.fl-heal::before { background: linear-gradient(90deg, transparent, rgba(238, 255, 232, 0.92) 18%, rgba(93, 244, 151, 0.98) 68%, rgba(207, 255, 188, 0.96)); box-shadow: 0 0 18px rgba(97, 246, 151, 0.72), 0 0 34px rgba(212, 255, 182, 0.32); }
.flight.fl-heal::after { border-left-color: #b8ff9a; filter: drop-shadow(0 0 10px rgba(150, 255, 176, 0.96)); }
.flight.fl-heal .fl-label { border-color: rgba(150, 255, 176, 0.5); background: rgba(14, 46, 26, 0.78); color: #d6ffe2; }

@keyframes flight-life { 0%, 12%, 82% { opacity: 1; } 100% { opacity: 0; } }
@keyframes flight-beam {
  0% { opacity: 1; transform: scaleX(0.12); }
  53%, 82% { opacity: 1; transform: scaleX(1); }
  100% { opacity: 0; transform: scaleX(1); }
}
@keyframes flight-head {
  0% { opacity: 0; transform: translateX(-26px) scale(0.9); }
  30% { opacity: 1; }
  53%, 82% { opacity: 1; transform: translateX(0) scale(1); }
  100% { opacity: 0; transform: translateX(8px) scale(0.96); }
}
@keyframes flight-impact-pulse {
  0%, 48% { opacity: 0; transform: scale(0.35); }
  60% { opacity: 1; transform: scale(1); }
  82% { opacity: 0.6; transform: scale(1.5); }
  100% { opacity: 0; transform: scale(1.8); }
}
@keyframes flight-particles {
  0% { opacity: 0; transform: translateX(-60%); }
  30%, 70% { opacity: 1; }
  100% { opacity: 0; transform: translateX(4%); }
}

.spark {
  position: absolute; width: 7px; height: 7px; border-radius: 50%;
  background: radial-gradient(circle, #fff, #ffb35b 70%);
  box-shadow: 0 0 8px rgba(255, 180, 90, 0.95);
  pointer-events: none;
  animation: sparkFly 0.7s ease-out forwards;
}
@keyframes sparkFly {
  0% { opacity: 1; transform: translate(0, 0) scale(1); }
  100% { opacity: 0; transform: translate(var(--dx), var(--dy)) scale(0.3); }
}

/* 顶栏当前行动者 */
.actor-chip {
  display: flex; align-items: center; gap: 8px;
  background: rgba(20, 22, 32, 0.85); border: 1px solid rgba(230, 181, 97, 0.55);
  border-radius: 18px; padding: 2px 14px 2px 3px;
  box-shadow: 0 0 12px rgba(230, 181, 97, 0.25);
}
.actor-chip img { width: 28px; height: 28px; border-radius: 50%; object-fit: cover; border: 1px solid rgba(255, 217, 138, 0.7); }
.actor-chip .ac-text { font-size: 13px; color: var(--gold-bright); letter-spacing: 1px; white-space: nowrap; }
.actor-chip .ac-sub { font-size: 11px; color: #a89f8d; }

/* 滚动条 */
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-thumb { background: rgba(230, 181, 97, 0.3); border-radius: 4px; }
::-webkit-scrollbar-track { background: rgba(255, 255, 255, 0.04); }

/* ============ 手机竖屏 ============ */
@media (orientation: portrait) {
  :root {
    --seat-w: clamp(70px, 22.5vw, 132px);
    --card-w: clamp(56px, 16vw, 98px);
    --self-w: clamp(62px, 19vw, 112px);
    --fs: clamp(10px, 3vw, 15px);
  }
  .game-bg { background-image: url("/gen/liyue-portrait.jpg"); }
  .lobby-bg { background-image: url("/assets/bg/login-portrait.png"); }
  @media (max-width: 860px) {
    .game-bg, body::before { background-image: url("/gen/liyue-portrait-sm.jpg"); }
  }
  .seats { inset: 48px 4px auto 4px; }
  .seat.pos-r1 { right: 1vw; top: 0; }
  .seat.pos-r2 { right: 26vw; top: 0; }
  .seat.pos-r3 { left: 26vw; top: 0; }
  .seat.pos-r4 { left: 1vw; top: 0; }
  .center-area { top: 48%; }
  .banner-area { top: 31%; }
  .self-area { padding: 4px 4px 6px; gap: 6px; }
  .self-buttons { width: 104px; padding-bottom: 6px; }
  .skill-btn { font-size: 11px; letter-spacing: 1px; padding: 4px 6px; }
  .prompt-bar { min-width: 90vw; max-width: 96vw; bottom: calc(var(--self-h) + 18px); padding: 8px 10px 10px; }
  .log-panel { width: 80vw; bottom: calc(var(--self-h) + 70px); }
  .lobby-panel { padding: 28px 22px; }
  .lobby-title { font-size: 42px; }
  .lobby-input { width: 70vw; }
  .char-grid { gap: 10px; }
  .char-card { width: 42vw; }
  .char-card img { height: 46vw; }
  .topbar { flex-wrap: wrap; height: auto; min-height: 40px; padding: 2px 8px; }
  .modal-body { padding: 14px 12px; border-radius: 12px; }
  /* 竖屏：回合绶带贴卡牌顶部内沿（不挡脸、不与下方装备行冲突） */
  .turn-ribbon { font-size: 10px; padding: 1px 8px; top: 1px; }
  .status-chip { font-size: 10px; padding: 1px 8px; top: calc(var(--seat-h) * 0.45); }
  /* 竖屏：技能按钮移到武将牌上方一行 */
  .skill-buttons { left: 0; bottom: calc(100% + 8px); flex-direction: row; flex-wrap: wrap; max-width: 70vw; }
  .tooltip { max-width: 86vw; }
  /* 竖屏：提示条整体抬高到手牌+按钮行之上，避免重叠 */
  .prompt-bar { bottom: calc(var(--card-h) + 108px); }
  .action-row { min-height: 30px; }
  .action-row .btn { padding: 5px 14px; }
  /* 竖屏：顶排座位间距小，判定小卡改放在装备行下方居中，避免压到邻座 */
  .seats .seat .judge-icons {
    left: 50%; right: auto; transform: translateX(-50%);
    top: calc(100% + var(--seat-w) * 0.34 + 6px);
    flex-direction: row;
  }
  .self-seat .judge-icons {
    left: auto; right: calc(var(--seat-w) * -0.24); transform: none;
    top: calc(var(--seat-h) * 0.1); flex-direction: column;
  }
}
