/* 弹球对打 · 专属样式（选择器统一 .g-pong 前缀；球场由 Canvas 绘制） */

.g-pong { gap: 10px; }

/* ---------------- 设置 ---------------- */
.g-pong .pong-setup { display: flex; flex-direction: column; gap: 12px; flex: 1; min-height: 0; }
.g-pong .pong-rules { padding: 12px 13px; }
.g-pong .pong-rules .panel-h { margin-bottom: 8px; }
.g-pong .pong-rule-line { font-size: 12px; line-height: 1.82; color: var(--dim); }
.g-pong .pong-rule-line b { color: var(--text); font-weight: 600; }
.g-pong .pong-setup .stats { margin-top: 2px; }
.g-pong .pong-setup .stat-v { font-size: 24px; }

/* ---------------- 比分板 ---------------- */
.g-pong .pong-play { display: flex; flex-direction: column; gap: 8px; flex: 1; min-height: 0; }
.g-pong .pong-scoreboard {
  flex: none;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 8px;
  padding: 7px 13px 8px;
  border-radius: 15px;
  border: 1px solid var(--line);
  background: linear-gradient(180deg, rgba(255, 92, 108, 0.07), rgba(95, 200, 255, 0.05));
}
.g-pong .pong-side { display: flex; flex-direction: column; min-width: 0; }
.g-pong .pong-side.p1 { align-items: flex-start; }
.g-pong .pong-side.p2 { align-items: flex-end; }
.g-pong .pong-side-k { font-size: 9.5px; color: var(--faint); letter-spacing: 0.04em; line-height: 1.2; }
.g-pong .pong-score-num {
  font-size: 25px;
  font-weight: 800;
  line-height: 1.1;
  font-variant-numeric: tabular-nums;
  text-shadow: 0 0 14px currentColor;
}
.g-pong .pong-score-num.p1 { color: #5fc8ff; }
.g-pong .pong-score-num.p2 { color: #ff5c6c; }
.g-pong .pong-mid {
  font-size: 9px;
  color: var(--faint);
  text-align: center;
  line-height: 1.2;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1px;
}
.g-pong .pong-mid b { font-size: 15px; color: var(--accent); line-height: 1; font-weight: 800; }
.g-pong .pong-scoreboard.lead-p1 .pong-score-num.p1 { animation: pongLead 1.1s ease-in-out infinite alternate; }
.g-pong .pong-scoreboard.lead-p2 .pong-score-num.p2 { animation: pongLead 1.1s ease-in-out infinite alternate; }

/* ---------------- 球场 ---------------- */
.g-pong .pong-court {
  position: relative;
  flex: 1;
  min-height: 0;
}
.g-pong .pong-host {
  position: absolute;
  inset: 0;
  border-radius: 20px;
  overflow: hidden;
  border: 1px solid var(--line-2);
  background: #0a1020;
  box-shadow: 0 22px 54px -26px rgba(0, 0, 0, 0.95), inset 0 0 0 1px rgba(255, 255, 255, 0.03);
  touch-action: none;
  cursor: crosshair;
}
.g-pong .pong-host canvas { display: block; border-radius: inherit; }
.g-pong .pong-hint { flex: none; text-align: center; font-size: 10.5px; color: var(--faint); }

/* ---------------- 结算 ---------------- */
.g-pong .pong-result {
  flex: 1;
  min-height: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}
.g-pong .pong-res-card {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 18px 16px;
  border-radius: 22px;
  border: 1px solid var(--line-2);
  background:
    radial-gradient(120% 80% at 50% -10%, rgba(255, 92, 108, 0.16), transparent 55%),
    linear-gradient(180deg, #171b2c, #0d1120);
  box-shadow: 0 30px 70px -24px rgba(0, 0, 0, 0.9), inset 0 1px 0 rgba(255, 255, 255, 0.05);
}
.g-pong .pong-res-title {
  text-align: center;
  font-size: 27px;
  font-weight: 800;
  line-height: 1.15;
  letter-spacing: 0.01em;
}
.g-pong .pong-res-title.p1 {
  color: #5fc8ff;
  text-shadow: 0 0 22px rgba(95, 200, 255, 0.45);
}
.g-pong .pong-res-title.p2 {
  color: #ff5c6c;
  text-shadow: 0 0 22px rgba(255, 92, 108, 0.45);
}
.g-pong .pong-res-score {
  text-align: center;
  font-size: 34px;
  font-weight: 800;
  letter-spacing: 0.06em;
  font-variant-numeric: tabular-nums;
  color: var(--text);
  line-height: 1;
}
.g-pong .pong-res-stats {
  display: flex;
  flex-direction: column;
  gap: 6px;
  text-align: center;
  font-size: 11.5px;
  color: var(--dim);
}
.g-pong .pong-res-stats b { color: var(--text); font-weight: 700; }
.g-pong .pong-res-card .btn { margin-top: 2px; }

@keyframes pongLead {
  from { opacity: 0.72; }
  to { opacity: 1; }
}

/* ---------------- 小屏 ---------------- */
@media (max-height: 720px) {
  .g-pong { gap: 8px; }
  .g-pong .pong-hint { display: none; }
  .g-pong .pong-score-num { font-size: 22px; }
  .g-pong .pong-res-score { font-size: 30px; }
}
