:root {
  --bg: #fff9f0;
  --ink: #1f2430;
  --muted: #6c7384;
  --blue: #2575ff;
  --blue-soft: #e6f0ff;
  --pink: #ff3f78;
  --pink-soft: #ffe6ee;
  --gold: #ffb800;
  --card: #ffffff;
  --border: #232836;
  --shadow: 0 3px 0 #232836;
}

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

html,
body {
  margin: 0;
  padding: 0;
  width: 100%;
  height: 100%;
  position: fixed;
  inset: 0;
  overflow: hidden;
  overscroll-behavior: none;
  background: var(--bg);
  color: var(--ink);
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", "Segoe UI", sans-serif;
  touch-action: manipulation;
  user-select: none;
  -webkit-user-select: none;
  -webkit-touch-callout: none;
}

button {
  touch-action: manipulation;
}

input {
  user-select: text;
  -webkit-user-select: text;
  touch-action: manipulation;
}

.hidden {
  display: none !important;
}

.app-shell {
  width: 100%;
  max-width: 520px;
  height: var(--app-h, 100dvh);
  max-height: var(--app-h, 100dvh);
  margin: 0 auto;
  padding: calc(env(safe-area-inset-top, 0px) + 6px) 10px calc(env(safe-area-inset-bottom, 0px) + 8px);
  display: flex;
  flex-direction: column;
  gap: 6px;
  overflow: hidden;
}

/* 顶部状态栏 */
.top-bar {
  flex: 0 0 auto;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 5px;
  min-width: 0;
}

.brand-badge {
  width: 26px;
  height: 26px;
  border-radius: 8px;
  background: var(--gold);
  border: 2px solid var(--border);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  box-shadow: 0 2px 0 var(--border);
  flex-shrink: 0;
}

.brand-title {
  font-size: 15px;
  font-weight: 900;
  letter-spacing: 0.3px;
  white-space: nowrap;
}

.conn-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  display: inline-block;
  border: 1.5px solid var(--border);
  flex-shrink: 0;
}

.conn-open {
  background: #22c55e;
}

.conn-connecting {
  background: #f59e0b;
}

.conn-closed {
  background: #ef4444;
}

.top-actions {
  display: flex;
  align-items: center;
  gap: 5px;
}

.pill {
  height: 30px;
  padding: 0 9px;
  border-radius: 999px;
  border: 2px solid var(--border);
  background: var(--card);
  font-size: 12px;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  box-shadow: 0 2px 0 var(--border);
}

.icon-pill {
  width: 32px;
  padding: 0;
  justify-content: center;
  cursor: pointer;
  font-size: 14px;
}

.icon-pill.sound-on {
  background: #fef08a;
}

.btn-pill {
  cursor: pointer;
  color: var(--ink);
  padding: 0 8px 0 4px;
}

.btn-pill:active,
.icon-pill:active {
  transform: translateY(1px);
  box-shadow: 0 1px 0 var(--border);
}

.mini-avatar {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  overflow: hidden;
  border: 1.5px solid var(--border);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 800;
  color: #fff;
  flex-shrink: 0;
}

.my-name {
  max-width: 66px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* 双方实时比分条 */
.scoreboard {
  flex: 0 0 auto;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 6px;
}

.player-card {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 6px 8px;
  border-radius: 14px;
  border: 2px solid var(--border);
  background: var(--card);
  box-shadow: var(--shadow);
  min-width: 0;
  transition: transform 0.12s ease, background-color 0.15s ease;
}

.card-a {
  background: var(--blue-soft);
}

.card-b {
  background: var(--pink-soft);
  justify-content: flex-end;
}

.card-leading {
  box-shadow: 0 3px 0 var(--border), 0 0 0 2px var(--gold);
}

.seat-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 2px solid var(--border);
  overflow: hidden;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 900;
  font-size: 14px;
  color: #fff;
  background: #9ca3af;
}

.avatar-a {
  background: var(--blue);
}

.avatar-b {
  background: var(--pink);
}

.seat-avatar img,
.mini-avatar img,
.res-avatar img,
.preset-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.player-meta {
  min-width: 0;
  flex: 1;
}

.player-meta-right {
  text-align: right;
}

.player-name {
  font-size: 12px;
  font-weight: 800;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.player-stats {
  display: flex;
  align-items: baseline;
  gap: 4px;
  margin-top: 1px;
}

.player-stats-right {
  justify-content: flex-end;
}

.player-score {
  font-size: 18px;
  font-weight: 900;
  line-height: 1;
  font-variant-numeric: tabular-nums;
  display: inline-block;
  transition: transform 0.08s ease-out;
}

.player-score.score-bump {
  transform: scale(1.32);
}

.card-a .player-score {
  color: var(--blue);
}

.card-b .player-score {
  color: var(--pink);
}

.player-cps {
  font-size: 11px;
  font-weight: 700;
  color: var(--muted);
  white-space: nowrap;
}

.vs-center {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-width: 62px;
}

.phase-badge {
  font-size: 10px;
  font-weight: 900;
  padding: 2px 7px;
  border-radius: 999px;
  background: var(--border);
  color: #fff;
  white-space: nowrap;
  transition: background-color 0.15s ease;
}

.phase-badge.phase-urgent {
  background: #ef4444;
  box-shadow: 0 0 8px rgba(239, 68, 68, 0.55);
}

.timer-text {
  font-size: 18px;
  font-weight: 900;
  margin-top: 2px;
  font-variant-numeric: tabular-nums;
  line-height: 1.1;
  display: inline-block;
  transform-origin: center;
  transition: color 0.12s ease;
}

.timer-text.timer-urgent {
  color: #ef4444;
  text-shadow: 0 0 10px rgba(239, 68, 68, 0.45);
  animation: timerUrgentPulse 0.48s ease-in-out infinite;
}

@keyframes timerUrgentPulse {
  0%,
  100% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.42);
  }
}

/* 中间动效舞台 */
.stage-wrap {
  flex: 1 1 auto;
  min-height: 0;
  position: relative;
  border-radius: 18px;
  border: 2.5px solid var(--border);
  background: radial-gradient(circle at 50% 45%, #ffffff 0%, #fff4dc 72%, #ffe7c2 100%);
  box-shadow: var(--shadow);
  overflow: hidden;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.stage-wrap.stage-urgent {
  border-color: #ef4444;
  animation: stageUrgentGlow 0.5s ease-in-out infinite;
}

@keyframes stageUrgentGlow {
  0%,
  100% {
    box-shadow: 0 3px 0 #b91c1c, inset 0 0 0 0 rgba(239, 68, 68, 0);
  }
  50% {
    box-shadow: 0 3px 0 #b91c1c, 0 0 16px rgba(239, 68, 68, 0.45), inset 0 0 22px rgba(239, 68, 68, 0.22);
  }
}

.arena-canvas {
  width: 100%;
  height: 100%;
  display: block;
}

.danmaku-layer {
  position: absolute;
  inset: 6px 0 auto 0;
  height: 104px;
  pointer-events: none;
  overflow: hidden;
  z-index: 4;
}

.danmaku-item {
  position: absolute;
  left: 100%;
  white-space: nowrap;
  padding: 3px 11px;
  border-radius: 999px;
  background: rgba(31, 36, 48, 0.86);
  border: 1.5px solid rgba(255, 255, 255, 0.35);
  color: #fff;
  font-size: 12px;
  font-weight: 800;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.14);
  animation: danmakuFly 10.5s linear forwards;
  will-change: transform;
}

.danmaku-from {
  color: #fde047;
  margin-right: 4px;
}

@keyframes danmakuFly {
  from {
    transform: translateX(0);
  }
  to {
    transform: translateX(calc(-100% - 560px));
  }
}

.cheat-banner {
  position: absolute;
  top: 8px;
  left: 8px;
  right: 8px;
  padding: 7px 10px;
  border-radius: 12px;
  background: linear-gradient(90deg, #ef4444, #f97316);
  color: #fff;
  border: 2px solid var(--border);
  font-size: 12px;
  font-weight: 900;
  text-align: center;
  box-shadow: 0 3px 0 var(--border);
  z-index: 6;
  animation: popIn 0.2s ease-out;
}

.center-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
  z-index: 5;
}

.center-overlay-text {
  font-size: 56px;
  font-weight: 900;
  color: #fff;
  text-shadow:
    -3px -3px 0 var(--border),
    3px -3px 0 var(--border),
    -3px 3px 0 var(--border),
    3px 3px 0 var(--border),
    0 6px 0 var(--border);
  animation: popBounce 0.32s ease-out;
}

.center-overlay-text.swap-text {
  font-size: 28px;
  color: var(--gold);
}

.speed-tier-badge {
  position: absolute;
  left: 10px;
  bottom: 8px;
  padding: 3px 9px;
  border-radius: 999px;
  background: var(--gold);
  color: var(--ink);
  border: 2px solid var(--border);
  font-size: 11px;
  font-weight: 900;
  box-shadow: 0 2px 0 var(--border);
  z-index: 4;
}

.toast {
  position: absolute;
  left: 50%;
  bottom: 10px;
  transform: translateX(-50%);
  max-width: 88%;
  padding: 6px 12px;
  border-radius: 999px;
  background: rgba(31, 36, 48, 0.92);
  color: #fff;
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  z-index: 8;
}

@keyframes popIn {
  from {
    transform: translateY(-10px) scale(0.95);
    opacity: 0;
  }
  to {
    transform: translateY(0) scale(1);
    opacity: 1;
  }
}

@keyframes popBounce {
  0% {
    transform: scale(0.45);
    opacity: 0;
  }
  70% {
    transform: scale(1.12);
    opacity: 1;
  }
  100% {
    transform: scale(1);
    opacity: 1;
  }
}

/* 拉锯进度条 */
.tug-section {
  flex: 0 0 auto;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.tug-labels {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 11px;
  font-weight: 800;
}

.tag-a {
  color: var(--blue);
}

.tag-b {
  color: var(--pink);
}

.tug-hint {
  color: var(--muted);
}

.tug-track {
  position: relative;
  height: 18px;
  border-radius: 999px;
  border: 2px solid var(--border);
  background: #e5e7eb;
  overflow: visible;
  display: flex;
  box-shadow: 0 2px 0 var(--border);
}

.tug-fill-a {
  height: 100%;
  border-radius: 999px 0 0 999px;
  background: linear-gradient(90deg, #3b82f6, #1d4ed8);
  transition: width 0.09s linear;
}

.tug-fill-b {
  height: 100%;
  border-radius: 0 999px 999px 0;
  background: linear-gradient(90deg, #f43f5e, #ff3f78);
  transition: width 0.09s linear;
}

.tug-marker {
  position: absolute;
  top: 50%;
  transform: translate(-50%, -50%);
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: var(--gold);
  border: 2px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  box-shadow: 0 2px 0 var(--border);
  transition: left 0.09s linear;
}

/* 底部操作区 */
.controls {
  flex: 0 0 auto;
  height: 136px;
  display: flex;
  flex-direction: column;
}

.seat-panel {
  height: 100%;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 7px;
}

.seat-buttons {
  flex: 1;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.seat-btn {
  border-radius: 16px;
  border: 2.5px solid var(--border);
  color: #fff;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  padding: 8px;
  box-shadow: 0 4px 0 var(--border);
  transition: transform 0.08s ease, box-shadow 0.08s ease, opacity 0.15s ease;
}

.seat-btn-a {
  background: linear-gradient(180deg, #4b91ff 0%, #2575ff 100%);
}

.seat-btn-b {
  background: linear-gradient(180deg, #ff6b98 0%, #ff3f78 100%);
}

.seat-btn:active:not(:disabled) {
  transform: translateY(3px);
  box-shadow: 0 1px 0 var(--border);
}

.seat-btn:disabled {
  opacity: 0.58;
  cursor: not-allowed;
}

.seat-btn-mine {
  box-shadow: 0 4px 0 var(--border), 0 0 0 3px var(--gold);
}

.seat-btn-title {
  font-size: 18px;
  font-weight: 900;
}

.seat-btn-sub {
  font-size: 11px;
  font-weight: 700;
  opacity: 0.92;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.controls-foot {
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
}

.foot-actions {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}

.role-tip {
  font-size: 12px;
  font-weight: 700;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.mini-action-btn {
  height: 26px;
  padding: 0 10px;
  border-radius: 999px;
  border: 2px solid var(--border);
  background: #fff;
  color: var(--ink);
  font-size: 11px;
  font-weight: 800;
  cursor: pointer;
  flex-shrink: 0;
  box-shadow: 0 2px 0 var(--border);
}

.mini-action-btn:active {
  transform: translateY(1px);
  box-shadow: 0 1px 0 var(--border);
}

/* 观战起哄弹幕面板 */
.danmaku-panel {
  height: 100%;
  border-radius: 16px;
  border: 2.5px solid var(--border);
  background: #ffffff;
  padding: 7px 8px;
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.danmaku-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  flex-shrink: 0;
}

.danmaku-title {
  font-size: 11px;
  font-weight: 900;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.danmaku-head-actions {
  display: flex;
  align-items: center;
  gap: 5px;
  flex-shrink: 0;
}

.cheer-btn {
  height: 26px;
  padding: 0 10px;
  border-radius: 999px;
  border: 2px solid var(--border);
  background: var(--gold);
  color: var(--ink);
  font-size: 11px;
  font-weight: 900;
  cursor: pointer;
  box-shadow: 0 2px 0 var(--border);
}

.cheer-btn:active {
  transform: translateY(1px);
  box-shadow: 0 1px 0 var(--border);
}

.danmaku-grid {
  flex: 1;
  min-height: 0;
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 5px;
  overflow-y: auto;
  touch-action: pan-y;
  padding-bottom: 2px;
}

.dm-chip {
  height: 28px;
  padding: 0 8px;
  border-radius: 10px;
  border: 1.5px solid var(--border);
  background: #fff8e7;
  color: var(--ink);
  font-size: 11px;
  font-weight: 800;
  cursor: pointer;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  text-align: center;
}

.dm-chip:active {
  background: var(--gold);
  transform: scale(0.97);
}

/* 狂点能量键 */
.tap-panel {
  height: 100%;
  display: flex;
}

.tap-pad {
  position: relative;
  width: 100%;
  height: 100%;
  border-radius: 20px;
  border: 3px solid var(--border);
  background: linear-gradient(180deg, #ffcf33 0%, #ff9900 100%);
  color: var(--ink);
  box-shadow: 0 6px 0 var(--border);
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  overflow: hidden;
  touch-action: none;
  transition: transform 0.04s ease, box-shadow 0.04s ease;
}

.tap-pad.tap-seat-a {
  background: linear-gradient(180deg, #5da0ff 0%, #2575ff 100%);
  color: #fff;
}

.tap-pad.tap-seat-b {
  background: linear-gradient(180deg, #ff709d 0%, #ff3f78 100%);
  color: #fff;
}

.tap-pad.is-pressed {
  transform: translateY(5px) scale(0.965);
  box-shadow: 0 1px 0 var(--border), 0 0 18px rgba(255, 208, 0, 0.55);
  filter: brightness(1.12);
}

.tap-pad.tap-flash::after {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(circle, rgba(255, 255, 255, 0.45) 0%, rgba(255, 255, 255, 0) 72%);
  pointer-events: none;
  animation: tapFlashFade 0.14s ease-out forwards;
}

@keyframes tapFlashFade {
  from {
    opacity: 1;
  }
  to {
    opacity: 0;
  }
}

.tap-ripple {
  position: absolute;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  border: 3.5px solid rgba(255, 255, 255, 0.92);
  background: rgba(255, 255, 255, 0.25);
  transform: translate(-50%, -50%) scale(0.4);
  pointer-events: none;
  animation: tapRippleOut 0.34s ease-out forwards;
}

@keyframes tapRippleOut {
  0% {
    transform: translate(-50%, -50%) scale(0.4);
    opacity: 0.95;
  }
  100% {
    transform: translate(-50%, -50%) scale(4.6);
    opacity: 0;
  }
}

.tap-pad-main {
  font-size: 28px;
  font-weight: 900;
  letter-spacing: 1px;
  pointer-events: none;
  text-shadow: 0 2px 0 rgba(0, 0, 0, 0.2);
}

.tap-pad-sub {
  font-size: 12px;
  font-weight: 800;
  opacity: 0.95;
  pointer-events: none;
}

.tap-float-layer {
  position: absolute;
  inset: 0;
  pointer-events: none;
  overflow: hidden;
}

.tap-pop {
  position: absolute;
  font-size: 24px;
  font-weight: 900;
  color: #fff;
  text-shadow:
    -1.5px -1.5px 0 var(--border),
    1.5px -1.5px 0 var(--border),
    -1.5px 1.5px 0 var(--border),
    1.5px 1.5px 0 var(--border),
    0 3px 0 var(--border);
  animation: tapPopFloat 0.44s cubic-bezier(0.22, 1, 0.36, 1) forwards;
  pointer-events: none;
}

.tap-pop.tap-pop-hot {
  font-size: 28px;
  color: #fde047;
}

@keyframes tapPopFloat {
  0% {
    transform: translate(-50%, 0) scale(0.65) rotate(var(--tilt, 0deg));
    opacity: 1;
  }
  35% {
    transform: translate(-50%, -26px) scale(1.35) rotate(var(--tilt, 0deg));
    opacity: 1;
  }
  100% {
    transform: translate(-50%, -68px) scale(1.05) rotate(var(--tilt, 0deg));
    opacity: 0;
  }
}

/* 弹窗与群友预设选择器 */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(18, 22, 32, 0.68);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 14px;
  z-index: 30;
}

.modal-card,
.result-card {
  width: 100%;
  max-width: 360px;
  border-radius: 20px;
  border: 2.5px solid var(--border);
  background: #fff;
  padding: 16px;
  box-shadow: 0 6px 0 var(--border);
  animation: popIn 0.2s ease-out;
}

.profile-modal-card {
  max-height: 90dvh;
  overflow-y: auto;
  touch-action: pan-y;
}

.modal-title {
  margin: 0 0 10px;
  font-size: 17px;
  font-weight: 900;
}

.section-sub-label {
  font-size: 12px;
  font-weight: 800;
  color: var(--muted);
  margin-bottom: 8px;
}

.member-preset-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 7px;
}

.preset-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 7px 4px;
  border-radius: 12px;
  border: 2px solid var(--border);
  background: #fffdf7;
  cursor: pointer;
  box-shadow: 0 2px 0 var(--border);
}

.preset-card:active {
  transform: translateY(1px);
  box-shadow: 0 1px 0 var(--border);
}

.preset-card.is-selected {
  background: #fef08a;
}

.preset-avatar {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  border: 2px solid var(--border);
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  font-weight: 900;
  color: #fff;
}

.preset-name {
  font-size: 11px;
  font-weight: 800;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.profile-divider {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 12px 0 10px;
  font-size: 11px;
  font-weight: 800;
  color: var(--muted);
}

.profile-divider::before,
.profile-divider::after {
  content: '';
  flex: 1;
  height: 1.5px;
  background: #e5e7eb;
}

.profile-preview-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  margin-bottom: 10px;
  border-radius: 12px;
  border: 1.5px dashed #d1d5db;
  background: #fffdf7;
}

.profile-preview-avatar {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  border: 2px solid var(--border);
  overflow: hidden;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  font-weight: 900;
  color: #fff;
}

.profile-preview-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.profile-preview-hint {
  min-width: 0;
  flex: 1;
}

.preview-title {
  font-size: 12px;
  font-weight: 900;
  color: var(--ink);
}

.preview-sub {
  font-size: 11px;
  font-weight: 700;
  color: var(--muted);
  margin-top: 2px;
}

.field-label {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin-bottom: 10px;
  font-size: 12px;
  font-weight: 800;
}

/* 必须 >= 16px，防止苹果 iOS Safari 点击输入框时自动放大整页导致半屏 */
.field-input {
  height: 40px;
  padding: 0 12px;
  border-radius: 12px;
  border: 2px solid var(--border);
  font-size: 16px;
  outline: none;
}

.field-input:focus {
  border-color: var(--blue);
}

.modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 6px;
}

.modal-btn {
  height: 36px;
  padding: 0 16px;
  border-radius: 12px;
  border: 2px solid var(--border);
  font-size: 13px;
  font-weight: 800;
  cursor: pointer;
}

.modal-btn-ghost {
  background: #f3f4f6;
  color: var(--ink);
}

.modal-btn-primary {
  background: var(--gold);
  color: var(--ink);
  box-shadow: 0 2px 0 var(--border);
}

/* 适合手机截屏发群的结算海报卡片 */
.result-card {
  background: linear-gradient(180deg, #fff9e6 0%, #ffffff 34%, #ffffff 100%);
  padding: 14px 16px 16px;
}

.result-poster-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-bottom: 8px;
  margin-bottom: 10px;
  border-bottom: 2px dashed #e5e7eb;
  font-size: 11px;
  font-weight: 900;
}

.poster-top-right {
  display: flex;
  align-items: center;
  gap: 8px;
}

.result-close-x {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  border: 2px solid var(--border);
  background: #f3f4f6;
  color: var(--ink);
  font-size: 12px;
  font-weight: 900;
  line-height: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

.result-close-x:active {
  transform: scale(0.92);
}

.result-foot-btns {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}

.close-result-btn {
  background: #fee2e2;
  color: #b91c1c;
}

.poster-brand {
  color: var(--ink);
}

.poster-duration {
  color: var(--muted);
}

.result-header {
  text-align: center;
  margin-bottom: 12px;
}

.result-badge {
  display: inline-block;
  padding: 3px 11px;
  border-radius: 999px;
  background: var(--gold);
  border: 2px solid var(--border);
  font-size: 12px;
  font-weight: 900;
}

.result-winner-title {
  margin: 8px 0 4px;
  font-size: 22px;
  font-weight: 900;
}

.result-comment {
  margin: 0;
  font-size: 12.5px;
  color: var(--muted);
  font-weight: 700;
  line-height: 1.4;
}

.result-versus {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 8px;
}

.res-player {
  position: relative;
  border-radius: 14px;
  border: 2px solid var(--border);
  padding: 12px 6px 10px;
  text-align: center;
}

.res-a {
  background: var(--blue-soft);
}

.res-b {
  background: var(--pink-soft);
}

.res-winner {
  box-shadow: 0 0 0 3px var(--gold);
}

.res-crown {
  position: absolute;
  top: -12px;
  left: 50%;
  transform: translateX(-50%);
  font-size: 18px;
  line-height: 1;
}

.res-avatar {
  width: 54px;
  height: 54px;
  border-radius: 50%;
  border: 2.5px solid var(--border);
  margin: 0 auto 6px;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  font-weight: 900;
  color: #fff;
}

.res-name {
  font-size: 13px;
  font-weight: 900;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.res-score {
  font-size: 20px;
  font-weight: 900;
  margin-top: 3px;
}

.res-cps {
  font-size: 11px;
  font-weight: 700;
  color: var(--muted);
}

.res-title {
  margin-top: 5px;
  display: inline-block;
  padding: 2px 8px;
  border-radius: 999px;
  background: #fff;
  border: 1.5px solid var(--border);
  font-size: 10px;
  font-weight: 800;
}

.res-divider {
  font-size: 16px;
  font-weight: 900;
  color: var(--muted);
}

.result-tug-mini {
  margin-top: 10px;
  height: 10px;
  border-radius: 999px;
  border: 2px solid var(--border);
  overflow: hidden;
  display: flex;
}

.res-tug-a {
  background: var(--blue);
  height: 100%;
}

.res-tug-b {
  background: var(--pink);
  height: 100%;
}

.result-footer {
  margin-top: 10px;
  text-align: center;
}

.share-tip {
  font-size: 11.5px;
  font-weight: 800;
  color: var(--ink);
  background: #fef9c3;
  border: 1.5px solid var(--border);
  border-radius: 10px;
  padding: 5px 8px;
  margin-bottom: 8px;
}

.result-foot-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.result-countdown {
  font-size: 11.5px;
  font-weight: 800;
  color: var(--muted);
}
