/* 蓄能对决 · UI —— Apple 风黑白单色（浅色、极简、留白、发丝线、克制动效） */
:root {
  --bg: #f5f5f7;            /* 页面底 · Apple 浅灰 */
  --surface: #ffffff;      /* 卡片/面板 */
  --surface-2: #f1f1f4;    /* 内嵌输入/浅填充 */
  --panel: #ffffff;
  --panel-line: #e7e7ec;   /* 轻发丝边框（更弱，靠阴影分层） */
  --line-strong: #d9d9de;
  --ink: #1d1d1f;          /* 近黑主色（文字/攻击） */
  --txt: #1d1d1f;
  --muted: #6e6e73;        /* 次要文字 */
  --faint: #8e8e93;        /* 三级文字 */
  --accent: #0071e3;       /* 唯一点睛色 · Apple 蓝（主按钮/选中/关键数字） */
  --accent-press: #0060c0;
  --accent-soft: rgba(0,113,227,.10);
  --ring: rgba(0,113,227,.55);   /* 键盘聚焦环 */
  /* 语义色收敛（保留变量名以兼容旧引用） */
  --charge: #1d1d1f;
  --attack: #1d1d1f;
  --defend: #6e6e73;
  --gold: #1d1d1f;
  --shadow: 0 6px 22px rgba(17,17,26,.05), 0 2px 6px rgba(17,17,26,.04);
  --shadow-lg: 0 18px 50px rgba(17,17,26,.14);
}

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

html, body {
  height: 100%;
  background: var(--bg);
  color: var(--txt);
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Display", "SF Pro Text",
    "PingFang SC", "Microsoft YaHei", "Segoe UI", system-ui, sans-serif;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow: hidden;
}

#app { height: 100%; position: relative; }

/* ===== 屏幕切换 ===== */
.screen {
  position: absolute; inset: 0;
  display: none;
  flex-direction: column;
  align-items: center; justify-content: center;
  padding: 24px;
  overflow-y: auto;
  animation: fade .4s cubic-bezier(.4,0,.2,1);
}
.screen.active { display: flex; }
@keyframes fade { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

/* ===== 通用 ===== */
.hero { text-align: center; max-width: 440px; width: 100%; }
.title {
  font-size: clamp(40px, 9vw, 68px);
  font-weight: 700; letter-spacing: -0.5px; line-height: 1.04;
  color: var(--ink);
}
.subtitle { color: var(--muted); margin-top: 10px; font-size: 16px; letter-spacing: 0; font-weight: 400; }
.tagline { color: var(--muted); margin-top: 16px; font-size: 13.5px; line-height: 1.5; font-weight: 400; opacity: .78; max-width: 30em; margin-left: auto; margin-right: auto; }

/* 基础按钮：默认次要（白底细边），交互用胶囊形 */
.btn {
  border: 1px solid var(--panel-line); cursor: pointer; border-radius: 980px;
  font-size: 16px; font-weight: 500; color: var(--ink);
  background: var(--surface);
  padding: 12px 22px; transition: background .2s ease, transform .06s ease, border-color .2s ease, opacity .2s ease;
  font-family: inherit;
}
.btn:hover { background: var(--surface-2); }
.btn:active { transform: scale(.97); }
.btn:disabled { opacity: .38; cursor: not-allowed; }

/* 统一键盘聚焦环（focus-visible）：只在键盘导航时出现，鼠标点击不打扰 */
.btn:focus-visible,
button:focus-visible,
input:focus-visible,
[tabindex]:focus-visible,
.action-btn:focus-visible,
.series-btn:focus-visible,
.charge-mode-btn:focus-visible,
.ai-btn:focus-visible,
.chat-emoji:focus-visible,
.rules-tab:focus-visible,
.sb-name:focus-visible,
.sb-exit:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}
.btn-primary {
  background: var(--accent); border-color: var(--accent); color: #fff;
}
.btn-primary:hover { background: var(--accent-press); border-color: var(--accent-press); }
.btn-lg { font-size: 17px; padding: 15px 32px; margin-top: 26px; border-radius: 980px; }

/* ===== 规则卡（旧，保留） ===== */
.rules-card {
  margin-top: 26px; text-align: left;
  background: var(--surface); border: 1px solid var(--panel-line);
  border-radius: 18px; padding: 18px 20px; box-shadow: var(--shadow);
}
.rules-card p { font-size: 15px; margin-bottom: 10px; color: var(--txt); }
.rules-card em { color: var(--ink); font-style: normal; font-weight: 600; }
.rules-card ul { list-style: none; display: grid; gap: 7px; }
.rules-card li { font-size: 13.5px; color: var(--muted); }
.rules-card .k { display: inline-block; min-width: 82px; color: var(--txt); font-weight: 600; margin-right: 6px; }
.rules-card b { color: var(--ink); font-weight: 600; }

/* ===== 开始页工具区：规则按钮 + 改名 ===== */
.start-tools { margin-top: 30px; display: flex; flex-direction: column; gap: 12px; }
.rules-toggle {
  width: 100%; font-weight: 500; letter-spacing: 0;
  background: var(--surface); border: 1px solid var(--panel-line); color: var(--ink);
}
.rules-toggle:hover { background: var(--surface-2); }
.name-panel {
  display: flex; align-items: center; gap: 10px;
  background: var(--surface); border: 1px solid var(--panel-line);
  border-radius: 14px; padding: 8px 14px; box-shadow: var(--shadow);
}
.name-panel label { color: var(--ink); font-size: 14px; font-weight: 600; white-space: nowrap; letter-spacing: 0; }
.name-input {
  flex: 1; min-width: 0; text-transform: none; letter-spacing: normal;
  font-weight: 500; text-align: left; padding: 10px 12px; color: var(--ink);
}
.name-input::placeholder { color: var(--faint); font-weight: 400; }

/* ===== 完整规则弹窗 ===== */
.rules-modal { position: fixed; inset: 0; z-index: 200; display: flex; align-items: center; justify-content: center; padding: 18px; }
.rules-modal-mask { position: absolute; inset: 0; background: rgba(0,0,0,.4); backdrop-filter: blur(6px); animation: fade .25s ease; }
.rules-modal-box {
  position: relative; z-index: 1; width: 100%; max-width: 460px; max-height: 88vh;
  display: flex; flex-direction: column;
  background: var(--surface); border: 1px solid var(--panel-line);
  border-radius: 20px; box-shadow: var(--shadow-lg);
  animation: pop .3s cubic-bezier(.2,.9,.3,1.1);
}
.rules-modal-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 18px 22px; border-bottom: 1px solid var(--panel-line); flex-shrink: 0;
}
.rules-modal-head h2 { font-size: 20px; font-weight: 600; letter-spacing: -0.2px; color: var(--ink); }
.rules-modal-close {
  border: 1px solid var(--panel-line); background: var(--surface); color: var(--muted);
  border-radius: 999px; width: 32px; height: 32px; font-size: 15px; cursor: pointer; font-family: inherit;
  transition: background .2s, color .2s;
}
.rules-modal-close:hover { color: var(--ink); background: var(--surface-2); }
.rules-modal-body { padding: 10px 22px 4px; overflow-y: auto; text-align: left; }
.rules-modal-body .rm-lead { font-size: 15px; color: var(--txt); margin: 12px 0 6px; line-height: 1.6; }
.rules-modal-body .rm-lead em { color: var(--ink); font-style: normal; font-weight: 600; }
.rules-modal-body .rm-h { font-size: 15px; font-weight: 700; color: var(--ink); margin: 18px 0 8px; letter-spacing: 0; }
.rules-modal-body .rm-list { list-style: none; display: grid; gap: 8px; }
.rules-modal-body .rm-list li { font-size: 13.5px; color: var(--muted); line-height: 1.55; padding-left: 14px; position: relative; }
.rules-modal-body .rm-list li::before { content: '·'; position: absolute; left: 2px; color: var(--faint); font-weight: 900; }
.rules-modal-body .rm-list b { color: var(--ink); font-weight: 600; }
.rules-modal-body .rm-list b.rm-danger { color: var(--ink); font-weight: 700; }
.rules-modal-body .rm-tip {
  font-size: 13px; color: var(--muted); line-height: 1.6;
  background: var(--surface-2); border: 1px solid var(--panel-line);
  border-radius: 12px; padding: 10px 12px;
}
/* 规则：Apple 分段控件 + 克制三角 */
.rules-tabs {
  display: flex; gap: 3px; margin: 14px 22px 2px; padding: 3px;
  background: var(--surface-2); border-radius: 12px; flex-shrink: 0;
}
.rules-tab {
  flex: 1; border: none; background: transparent; cursor: pointer; font-family: inherit;
  padding: 9px 0; font-size: 14px; font-weight: 600; color: var(--muted); border-radius: 9px;
  transition: background .2s ease, color .2s ease;
}
.rules-tab.active { background: var(--surface); color: var(--ink); box-shadow: 0 1px 3px rgba(0,0,0,.09); }
.rm-triangle { display: flex; flex-direction: column; gap: 8px; margin: 16px 0; }
.rm-tri-row {
  display: flex; align-items: center; justify-content: center; gap: 10px;
  background: var(--surface-2); border-radius: 12px; padding: 11px 12px; font-size: 14.5px;
}
.rm-tri-row b { font-weight: 600; color: var(--ink); }
.rm-tri-row span { color: var(--accent); font-size: 12px; font-weight: 700; padding: 2px 9px; background: var(--accent-soft); border-radius: 999px; }
.rules-modal-body strong { color: var(--ink); font-weight: 700; }
.rules-modal-ok { width: calc(100% - 44px); margin: 14px 22px 22px; flex-shrink: 0; }

/* ===== 起源与文化：首次进入弹窗 ===== */
.culture-modal .rules-modal-mask {
  background:
    radial-gradient(900px 460px at 50% 8%, rgba(0,113,227,.18), transparent 60%),
    rgba(0,0,0,.44);
}
.culture-modal-box {
  max-width: 520px;
  border-color: rgba(0,113,227,.22);
  box-shadow: 0 22px 70px rgba(17,17,26,.18), 0 0 0 1px rgba(0,113,227,.05);
  overflow: hidden;
}
.culture-modal-box::before {
  content: '';
  position: absolute; inset: 0 0 auto 0; height: 4px;
  background: linear-gradient(90deg, transparent, rgba(0,113,227,.85), transparent);
}
.culture-head { align-items: flex-start; padding-top: 24px; }
.culture-kicker {
  margin-bottom: 4px;
  font-size: 12px;
  color: var(--accent);
  font-weight: 700;
  letter-spacing: .16em;
}
.culture-head h2 { font-size: 22px; }
.culture-body {
  display: grid;
  gap: 13px;
  padding-top: 6px;
  color: var(--muted);
}
.culture-body p {
  font-size: 14px;
  line-height: 1.78;
}
.culture-body b { color: var(--ink); font-weight: 700; }
.culture-lead {
  color: var(--ink) !important;
  font-size: 16px !important;
  font-weight: 650;
}
.culture-quote {
  position: relative;
  margin: 2px 0;
  padding: 14px 16px 14px 18px;
  border: 1px solid rgba(0,113,227,.18);
  border-radius: 14px;
  background: linear-gradient(135deg, rgba(0,113,227,.08), rgba(255,255,255,.9));
}
.culture-quote::before {
  content: '';
  position: absolute; left: 0; top: 12px; bottom: 12px; width: 3px;
  border-radius: 99px;
  background: var(--accent);
}
.culture-quote span {
  display: block;
  color: var(--ink);
  font-size: 14px;
  line-height: 1.68;
  font-weight: 600;
}
.culture-body h3 {
  margin-top: 4px;
  font-size: 15px;
  color: var(--ink);
  letter-spacing: 0;
}
.culture-triad {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}
.culture-triad div {
  min-height: 92px;
  padding: 12px 10px;
  border: 1px solid var(--panel-line);
  border-radius: 14px;
  background: var(--surface-2);
  text-align: center;
}
.culture-triad b {
  display: block;
  margin-bottom: 7px;
  color: var(--accent);
  font-size: 18px;
}
.culture-triad span {
  display: block;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}
.culture-end {
  color: var(--ink) !important;
  font-weight: 650;
  text-align: center;
  padding-top: 4px;
}
.culture-ok { margin-top: 12px; }
@media (max-width: 560px) {
  .name-panel { flex-direction: column; align-items: stretch; gap: 6px; }
  .name-panel label { text-align: left; }
}

/* ===== 模式选择 ===== */
.mode-select { margin-top: 30px; display: flex; flex-direction: column; gap: 14px; }
#btn-pvp { width: 100%; }
.online-block {
  background: var(--surface); border: 1px solid var(--panel-line);
  border-radius: 18px; padding: 18px; box-shadow: var(--shadow);
}
.online-block .btn-lg { width: 100%; margin-top: 10px; }
.online-block .btn-lg:first-of-type { margin-top: 4px; }
.join-row { display: grid; grid-template-columns: 1fr auto; gap: 10px; margin-top: 12px; }
.room-input {
  min-width: 0; border: 1px solid var(--panel-line); border-radius: 12px;
  background: var(--surface-2); color: var(--ink); padding: 12px 14px;
  font: inherit; font-weight: 600; letter-spacing: 3px; text-transform: uppercase; text-align: center;
}
.room-input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.ai-block {
  background: var(--surface); border: 1px solid var(--panel-line);
  border-radius: 18px; padding: 18px; box-shadow: var(--shadow);
}
.ai-label { color: var(--muted); font-size: 14px; margin-bottom: 12px; }
.ai-btns { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 10px; }
.ai-btn {
  display: flex; flex-direction: column; align-items: center; gap: 3px;
  padding: 14px 4px; font-size: 16px; font-weight: 600; border-radius: 14px;
  background: var(--surface-2); border: 1px solid var(--panel-line); color: var(--ink);
}
.ai-btn span { font-size: 11px; font-weight: 400; color: var(--muted); }
.ai-btn[data-level="master"] { background: var(--surface); border-color: var(--accent); color: var(--accent); }
.ai-btn[data-level="master"] span { color: var(--accent); opacity: .8; }
/* 觉悟 Boss：全宽、近黑，气场拉满 */
.ai-btn-awaken { width: 100%; margin-top: 10px; background: var(--ink); border-color: var(--ink); color: #fff; }
.ai-btn-awaken span { color: rgba(255,255,255,.7); font-weight: 400; }
.ai-btn-awaken:hover { background: #000; }

/* ===== AI 读心台词 ===== */
.ai-reason {
  display: none; max-width: 520px; margin: 0 auto 14px;
  background: var(--surface); border: 1px solid var(--panel-line);
  color: var(--txt); border-radius: 14px; padding: 12px 18px;
  font-size: 15px; text-align: center; box-shadow: var(--shadow); animation: pop .4s ease;
}

/* ===== 选招界面 ===== */
.pick-header { text-align: center; width: 100%; max-width: 720px; margin-bottom: 8px; }
.turn-badge {
  display: inline-block; font-size: 21px; font-weight: 600; letter-spacing: 0;
  padding: 7px 22px; border-radius: 999px; margin-bottom: 6px;
  background: var(--surface-2); color: var(--ink); border: 1px solid var(--panel-line);
}
#screen-pick.p1-turn .turn-badge { background: var(--accent-soft); color: var(--accent); border-color: transparent; }
#screen-pick.p2-turn .turn-badge { background: var(--ink); color: #fff; border-color: var(--ink); }
.privacy-hint { color: var(--muted); font-size: 13px; margin-bottom: 12px; }

/* 出招倒计时 */
.pick-countdown {
  display: inline-flex; align-items: center; justify-content: center;
  width: 44px; height: 44px; margin: 4px auto 8px;
  border-radius: 50%; font-size: 22px; font-weight: 700;
  color: var(--accent); background: var(--surface);
  border: 2px solid var(--accent);
  font-variant-numeric: tabular-nums;
}
.pick-countdown.urgent {
  color: #fff; background: var(--ink); border-color: var(--ink);
  animation: pulse .6s ease-in-out infinite;
}
@keyframes pulse { 0%,100% { transform: scale(1); } 50% { transform: scale(1.12); } }
/* ===== 能量粒子背景 ===== */
.bg-particles { position: fixed; inset: 0; width: 100%; height: 100%; z-index: 0; pointer-events: none; }
#app { z-index: 1; }

/* ===== 首页品牌 + 冷色调 ===== */
#screen-start { background: radial-gradient(130% 85% at 50% -12%, rgba(0,113,227,.10), transparent 58%); }
.brand { display: flex; flex-direction: row; align-items: center; justify-content: center; gap: 14px; }

/* 能量波 logo：脉冲涟漪的能量球 */
.energy-orb { position: relative; width: 44px; height: 44px; flex: 0 0 auto; }
.energy-orb .core {
  position: absolute; inset: 34%; border-radius: 50%;
  background: radial-gradient(circle at 40% 35%, #4aa3ff, var(--accent));
  box-shadow: 0 0 12px rgba(0,113,227,.7), 0 0 4px rgba(0,113,227,.9);
  animation: orbCore 2.4s ease-in-out infinite;
}
.energy-orb .ring {
  position: absolute; inset: 0; border-radius: 50%;
  border: 2px solid var(--accent); opacity: 0;
  animation: orbWave 2.4s cubic-bezier(.2,.6,.3,1) infinite;
}
.energy-orb .ring:nth-child(2) { animation-delay: .8s; }
.energy-orb .ring:nth-child(3) { animation-delay: 1.6s; }
@keyframes orbWave { 0% { transform: scale(.28); opacity: .75; } 100% { transform: scale(1); opacity: 0; } }
@keyframes orbCore { 0%, 100% { transform: scale(.9); } 50% { transform: scale(1.12); } }

/* ===== 在线对战：单一入口 + 子菜单 ===== */
.btn-online-entry { width: 100%; display: flex; flex-direction: column; align-items: center; gap: 3px; line-height: 1.25; }
.btn-online-entry span { font-size: 12.5px; font-weight: 400; color: rgba(255,255,255,.72); }
.online-menu { margin-top: 24px; display: flex; flex-direction: column; gap: 12px; }
.online-menu .btn-lg { width: 100%; margin-top: 0; }
.online-menu .btn-quickmatch, .online-menu #btn-online-create { display: flex; flex-direction: column; align-items: center; gap: 3px; line-height: 1.25; }
.online-menu #btn-online-create span { font-size: 12px; font-weight: 400; color: var(--muted); }
.join-block { margin-top: 4px; }
.join-block .cfg-label { text-align: center; margin-bottom: 8px; }

/* ===== 信息层级：在线主 / 本地次 ===== */
.online-primary { border: 1px solid rgba(0,113,227,.4); box-shadow: 0 12px 36px rgba(0,113,227,.12); }
.block-head { display: flex; flex-direction: column; gap: 2px; font-size: 16px; font-weight: 700; color: var(--ink); margin-bottom: 14px; }
.block-head span { font-size: 12.5px; font-weight: 400; color: var(--muted); }
.local-group { margin-top: 4px; }
.group-label { position: relative; text-align: center; font-size: 12px; color: var(--faint); letter-spacing: 3px; margin: 6px 0 12px; }
.group-label::before, .group-label::after { content: ''; position: absolute; top: 50%; width: 24%; height: 1px; background: var(--panel-line); }
.group-label::before { left: 8%; } .group-label::after { right: 8%; }
.local-group #btn-pvp { width: 100%; margin-bottom: 14px; }

/* ===== 能量 10 格（填充格发光脉动，能量越高越亮越快）===== */
.energy-cells { display: flex; gap: 4px; justify-content: center; margin: 12px auto 0; width: min(340px, 84%); }
.ecell { flex: 1; height: 12px; border-radius: 4px; background: var(--surface-2); border: 1px solid var(--panel-line); transition: background .25s ease, border-color .25s ease, box-shadow .3s ease; }
.ecell.on { background: var(--accent); border-color: var(--accent); box-shadow: 0 0 5px rgba(0,113,227,.4); animation: ecellPulse 1.8s ease-in-out infinite; }
@keyframes ecellPulse { 0%, 100% { box-shadow: 0 0 4px rgba(0,113,227,.35); } 50% { box-shadow: 0 0 9px rgba(0,113,227,.6); } }
/* 能量越高，脉动越快越亮 */
.energy-cells.lvl-mid .ecell.on { animation-duration: 1.3s; }
.energy-cells.lvl-high .ecell.on { animation-duration: .9s; box-shadow: 0 0 7px rgba(0,113,227,.6); }
@media (prefers-reduced-motion: reduce) { .ecell.on { animation: none; } }

/* ===== 本地/人机：顶部赛制+比分（竖排层级：赛制大、局数小）===== */
.match-info { text-align: center; margin-bottom: 16px; }
.mi-series { font-size: 24px; font-weight: 800; color: var(--accent); letter-spacing: 1px; line-height: 1.15; }
.mi-sub { font-size: 13px; color: var(--muted); margin-top: 4px; }

/* ===== 克制小提示（新手降门槛）===== */
.round-line { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; justify-content: center; margin: 12px 0 16px; }
.counter-legend { font-size: 12px; color: var(--muted); background: var(--surface); border: 1px solid var(--panel-line); border-radius: 999px; padding: 4px 12px; }
.counter-legend b { color: var(--ink); font-weight: 700; }

.energy-line { font-size: 15px; color: var(--muted); }
.energy-num { color: var(--accent); font-weight: 700; font-size: 20px; }
.energy-bar {
  width: min(320px, 80%); height: 8px; margin: 10px auto 0;
  background: var(--surface-2); border: 1px solid var(--panel-line);
  border-radius: 999px; overflow: hidden;
}
.energy-fill {
  height: 100%; width: 0%;
  background: var(--accent);
  transition: width .35s ease;
}
.round-info { color: var(--ink); font-size: 14px; font-weight: 600; letter-spacing: 0; }

.actions {
  display: grid; grid-template-columns: 1fr 1.3fr 1.3fr;
  gap: 14px; width: 100%; max-width: 760px;
}
.action-col {
  background: var(--surface); border: 1px solid var(--panel-line);
  border-radius: 18px; padding: 16px 14px; box-shadow: var(--shadow);
}
.col-title {
  text-align: center; font-size: 13px; letter-spacing: 1px; font-weight: 600;
  margin-bottom: 14px; padding-bottom: 10px; border-bottom: 1px solid var(--panel-line);
  color: var(--muted); text-transform: none;
}
.col-charge, .col-attack, .col-defend { color: var(--muted); }
.btn-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-bottom: 8px; }
.action-btn { width: 100%; padding: 12px 6px; font-size: 14px; margin-bottom: 8px; border-radius: 12px; border: 1px solid var(--panel-line); background: var(--surface); color: var(--ink); }
.action-btn:hover { background: var(--surface-2); }
.action-btn:last-child { margin-bottom: 0; }
/* 储能 = 描边（安静积累）*/
.action-btn.charge { background: var(--surface); border: 1.5px solid var(--ink); color: var(--ink); font-size: 16px; padding: 18px; font-weight: 600; }
.action-btn.charge:hover { background: var(--surface-2); }
.btn-grid .action-btn { margin-bottom: 0; }
/* 攻击 = 实心黑（强攻）*/
.action-btn.atk { background: var(--ink); border-color: var(--ink); color: #fff; }
/* 费越高、视觉越"重"（颜色越深、10费带质感）*/
.action-btn.atk.atk-t1 { background: #7a7a80; border-color: #7a7a80; }
.action-btn.atk.atk-t2 { background: #55555b; border-color: #55555b; }
.action-btn.atk.atk-t3 { background: #2c2c30; border-color: #2c2c30; }
.action-btn.atk.atk-t4 { background: #000; border-color: #000; font-weight: 700; box-shadow: inset 0 1px 0 rgba(255,255,255,.14), 0 5px 16px rgba(0,0,0,.3); }
.action-btn.atk:hover:not(:disabled) { filter: brightness(1.14); }
.action-btn.atk:active:not(:disabled) { transform: translateY(1px) scale(.97); }
.action-btn.atk:disabled { background: var(--surface); color: var(--faint); border-color: var(--panel-line); box-shadow: none; filter: none; }
/* 防御 = 浅灰填充（柔挡）*/
.action-btn.def { background: var(--surface-2); border-color: var(--panel-line); color: var(--ink); }
.action-btn.def-low, .action-btn.def-all { background: var(--surface-2); border-color: var(--line-strong); color: var(--ink); font-weight: 600; }
.action-btn .cost { display: block; font-size: 11px; opacity: .6; margin-top: 2px; }
.picked-tip { margin-top: 16px; height: 20px; color: var(--muted); font-size: 14px; }

/* ===== 交接 ===== */
.handoff-icon, .win-crown { font-size: 60px; margin-bottom: 14px; }
/* 胜利仪式感 */
#screen-over .win-crown { font-size: 78px; animation: crownDrop .7s cubic-bezier(.2,.9,.3,1.35); }
@keyframes crownDrop { 0% { transform: translateY(-36px) scale(.3) rotate(-12deg); opacity: 0; } 60% { transform: translateY(5px) scale(1.12) rotate(4deg); } 100% { transform: none; opacity: 1; } }
#over-detail { display: inline-block; margin-top: 16px; padding: 10px 22px; background: var(--surface); border: 1px solid var(--panel-line); border-radius: 14px; box-shadow: var(--shadow); font-size: 15px; color: var(--ink); font-weight: 600; letter-spacing: 0; animation: pop .4s ease .15s both; }

/* ===== 结算 ===== */
.reveal-wrap {
  display: flex; align-items: center; justify-content: center;
  gap: 18px; width: 100%; max-width: 620px; margin-bottom: 24px;
}
.reveal-side { flex: 1; text-align: center; }
.reveal-name { color: var(--muted); font-size: 14px; margin-bottom: 10px; letter-spacing: 0; }
.reveal-card {
  background: var(--surface); border: 1px solid var(--panel-line);
  border-radius: 18px; padding: 26px 12px; font-size: 20px; font-weight: 600;
  box-shadow: var(--shadow); animation: pop .4s cubic-bezier(.2,.9,.3,1.1);
}
.reveal-side.p1 .reveal-card { border-color: var(--accent); }
.reveal-side.p2 .reveal-card { border-color: var(--ink); }
.reveal-card.dead { background: var(--ink); border-color: var(--ink); color: #fff; animation: deadPunch .45s cubic-bezier(.2,.9,.3,1.25); }
@keyframes deadPunch { 0% { transform: scale(1.16); } 45% { transform: scale(.93); } 100% { transform: scale(1); } }

/* ===== 打击感特效 ===== */
@keyframes fxShake {
  0%, 100% { transform: translateX(0); }
  15% { transform: translateX(-9px) rotate(-.6deg); }
  30% { transform: translateX(8px) rotate(.6deg); }
  45% { transform: translateX(-6px); }
  60% { transform: translateX(4px); }
  75% { transform: translateX(-2px); }
}
.fx-shake { animation: fxShake .48s cubic-bezier(.36,.07,.19,.97); }
.fx-flash {
  position: fixed; inset: 0; z-index: 300; pointer-events: none; opacity: 0;
  background: radial-gradient(circle at 50% 44%, rgba(255,255,255,.55), rgba(0,113,227,.18) 52%, transparent 72%);
}
.fx-flash.on { animation: fxFlash .34s ease-out; }
@keyframes fxFlash { 0% { opacity: 0; } 12% { opacity: 1; } 100% { opacity: 0; } }
.reveal-card.dead small { color: rgba(255,255,255,.7); }
.reveal-card small { display: block; font-size: 12px; color: var(--muted); font-weight: 400; margin-top: 6px; }
@keyframes pop { from { transform: scale(.9); opacity: 0; } to { transform: scale(1); opacity: 1; } }
.reveal-vs { color: var(--faint); font-weight: 600; font-size: 16px; }
.reveal-result { font-size: 18px; font-weight: 600; text-align: center; max-width: 520px; margin-bottom: 8px; color: var(--ink); }
.reveal-energy { color: var(--muted); font-size: 14px; text-align: center; }

#winner-text.p1, #winner-text.p2 { color: var(--ink); }

/* ===== 线上房间 ===== */
.online-hero { max-width: 520px; }
.room-card {
  margin-top: 26px; background: var(--surface); border: 1px solid var(--panel-line);
  border-radius: 20px; padding: 22px; box-shadow: var(--shadow);
}
.room-code-label { color: var(--muted); font-size: 13px; letter-spacing: 0; }
.room-code {
  margin: 8px 0 16px; font-size: clamp(40px, 13vw, 64px); font-weight: 700;
  letter-spacing: 8px; color: var(--accent);
  cursor: pointer; user-select: all;
}
.room-code:active { transform: scale(.98); }
.online-status {
  margin-top: 14px; color: var(--accent); background: var(--accent-soft);
  border: 1px solid transparent; border-radius: 12px; padding: 11px 14px;
  word-break: break-all; font-size: 14px; font-weight: 500;
}
.room-actions { display: flex; gap: 10px; flex-wrap: wrap; justify-content: center; margin-bottom: 12px; }
.room-actions .btn { flex: 1; min-width: 130px; }
.share-label { display: block; color: var(--muted); font-size: 12px; margin-bottom: 6px; text-align: left; }
.share-link {
  width: 100%; border: 1px solid var(--panel-line); border-radius: 12px;
  background: var(--surface-2); color: var(--muted); padding: 11px 12px;
  font: inherit; font-size: 13px; letter-spacing: .3px;
}
.share-link:focus { outline: none; border-color: var(--accent); color: var(--ink); box-shadow: 0 0 0 3px var(--accent-soft); }
.room-players { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 14px; }
.room-players div {
  background: var(--surface-2); border: 1px solid var(--panel-line); border-radius: 12px;
  padding: 12px; display: flex; flex-direction: column; gap: 5px;
}
.room-players span { color: var(--muted); font-size: 13px; }
.room-players b { color: var(--ink); font-size: 14px; font-weight: 600; }
.room-tip { margin-top: 14px; color: var(--muted); font-size: 12px; line-height: 1.6; text-align: left; background: var(--surface-2); border: 1px solid var(--panel-line); border-radius: 12px; padding: 10px 12px; }

/* 房间内模式选择 */
.room-mode { margin-top: 16px; padding-top: 16px; border-top: 1px solid var(--panel-line); }
.room-mode-badge {
  display: inline-block; margin-bottom: 14px; padding: 8px 20px; border-radius: 999px;
  background: var(--accent-soft); color: var(--accent); font-weight: 700; font-size: 16px;
}
.room-mode-editor .cfg-label { text-align: left; }
.room-mode-readonly { color: var(--muted); font-size: 13px; }

/* ===== 线上：等待对手出招 ===== */
.wait-ring {
  width: 104px; height: 104px; margin: 0 auto 18px;
  border-radius: 50%; display: flex; align-items: center; justify-content: center;
  font-size: 44px; font-weight: 700; color: var(--accent);
  background: var(--surface); border: 3px solid var(--accent);
  font-variant-numeric: tabular-nums;
}
.wait-title { font-size: 23px; font-weight: 600; color: var(--ink); letter-spacing: 0; }
.wait-mymove {
  margin: 16px auto 0; display: inline-block;
  background: var(--surface); border: 1px solid var(--panel-line);
  border-radius: 12px; padding: 10px 18px; color: var(--txt); font-weight: 600;
}
.wait-hint { margin-top: 18px; color: var(--muted); font-size: 13px; }

/* ===== 房间内计分板（Apple 磨砂顶栏）===== */
.scoreboard {
  display: none;
  position: fixed; top: 0; left: 0; right: 0; z-index: 50;
  align-items: center; gap: 10px;
  padding: 9px 16px;
  background: rgba(255,255,255,.8);
  border-bottom: 1px solid var(--panel-line);
  backdrop-filter: saturate(180%) blur(20px);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
}
body.online-mode .screen { padding-top: 80px; }
.sb-side { display: flex; align-items: center; gap: 8px; flex: 1; min-width: 0; }
.sb-right { justify-content: flex-end; }
.sb-name {
  border: 1px dashed transparent; cursor: pointer; border-radius: 8px;
  background: transparent; color: var(--ink); font: inherit; font-weight: 600; font-size: 15px;
  padding: 4px 8px; max-width: 9em; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.sb-name:hover { border-color: var(--panel-line); background: var(--surface-2); }
.sb-name-input {
  border: 1px solid var(--ink); border-radius: 8px; background: var(--surface); color: var(--ink);
  font: inherit; font-weight: 600; font-size: 15px; padding: 4px 8px; width: 9em; outline: none;
}
.sb-meta { display: flex; align-items: center; gap: 4px; color: var(--muted); font-size: 12px; }
.sb-wins { color: var(--accent); font-size: 18px; font-weight: 700; min-width: 1ch; text-align: center; }
.sb-label { letter-spacing: 0; }
.sb-center { display: flex; flex-direction: column; align-items: center; gap: 3px; }
.sb-vs { color: var(--faint); font-weight: 600; font-size: 13px; letter-spacing: 1px; }
.sb-series { color: var(--accent); font-weight: 800; font-size: 16px; letter-spacing: 0; white-space: nowrap; background: var(--accent-soft); padding: 3px 11px; border-radius: 999px; }
.sb-exit {
  border: 1px solid var(--panel-line); background: var(--surface); color: var(--muted);
  border-radius: 999px; padding: 4px 14px; font-size: 12px; cursor: pointer; font-family: inherit;
  transition: background .2s, color .2s;
}
.sb-exit:hover { color: var(--ink); background: var(--surface-2); }
.sb-side.leading .sb-name { color: var(--accent); font-weight: 700; }
.sb-side.leading .sb-wins { color: var(--accent); }
.sb-side.not-joined .sb-name { color: var(--faint); font-style: italic; opacity: .8; }

/* ===== 房间内聊天 ===== */
.chat-widget { position: fixed; left: 14px; top: 60px; z-index: 120; }
.chat-fab {
  position: relative; width: 48px; height: 48px; border-radius: 50%;
  border: none; background: var(--accent);
  color: #fff; font-size: 21px; cursor: pointer; box-shadow: 0 8px 24px rgba(0,113,227,.35);
  display: flex; align-items: center; justify-content: center;
  transition: transform .1s ease;
}
.chat-fab:active { transform: scale(.94); }
.chat-fab.shake { animation: fabShake .55s cubic-bezier(.36,.07,.19,.97); }
@keyframes fabShake {
  0%, 100% { transform: translateX(0); box-shadow: var(--shadow-lg); }
  10% { box-shadow: 0 0 0 4px rgba(0,0,0,.18), var(--shadow-lg); }
  15% { transform: translateX(-4px) rotate(-6deg); }
  30% { transform: translateX(4px) rotate(6deg); }
  45% { transform: translateX(-3px) rotate(-4deg); }
  60% { transform: translateX(3px) rotate(4deg); }
  75% { transform: translateX(-2px) rotate(-2deg); }
}
.chat-badge {
  position: absolute; top: -3px; right: -3px; min-width: 18px; height: 18px; padding: 0 4px;
  border-radius: 999px; background: #ff3b30; color: #fff;
  font-size: 11px; font-weight: 700; line-height: 18px; text-align: center;
  box-shadow: 0 0 0 2px var(--bg);
}
/* 收起态浮动气泡 */
.chat-bubbles {
  position: absolute; left: 0; top: 56px; width: min(300px, calc(100vw - 28px));
  display: flex; flex-direction: column; gap: 6px; pointer-events: none;
}
.chat-bubble {
  align-self: flex-start; max-width: 100%;
  padding: 8px 13px; border-radius: 14px; font-size: 15.5px; line-height: 1.45;
  word-break: break-word; white-space: pre-wrap;
  box-shadow: var(--shadow);
  animation: bubbleIn .28s cubic-bezier(.2,.9,.3,1.15);
  transition: opacity .38s ease, transform .38s ease;
}
.chat-bubble .cb-name { font-weight: 600; opacity: .7; margin-right: 2px; }
.chat-bubble.mine { align-self: flex-start; background: var(--accent); color: #fff; }
.chat-bubble.theirs { background: var(--surface); border: 1px solid var(--panel-line); color: var(--ink); }
.chat-bubble.out { opacity: 0; transform: translateX(-8px); }
@keyframes bubbleIn { from { opacity: 0; transform: translateX(-10px) scale(.96); } to { opacity: 1; transform: none; } }

.chat-panel {
  position: absolute; left: 0; top: 56px; width: min(360px, calc(100vw - 24px));
  background: var(--surface); border: 1px solid var(--panel-line);
  border-radius: 18px; box-shadow: var(--shadow-lg);
  display: flex; flex-direction: column; overflow: hidden; animation: pop .22s ease;
}
.chat-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 12px 16px; border-bottom: 1px solid var(--panel-line);
  color: var(--ink); font-weight: 600; font-size: 15px; letter-spacing: 0;
}
.chat-close {
  border: none; background: transparent; color: var(--muted);
  font-size: 18px; cursor: pointer; font-family: inherit; padding: 0 4px;
}
.chat-close:hover { color: var(--ink); }
.chat-list {
  height: 280px; max-height: 48vh; overflow-y: auto;
  padding: 14px; display: flex; flex-direction: column; gap: 8px;
}
.chat-empty { color: var(--muted); font-size: 14px; text-align: center; margin: auto 0; }
.chat-msg { max-width: 82%; display: flex; flex-direction: column; gap: 2px; }
.chat-msg .cm-name { font-size: 12px; color: var(--muted); }
.chat-msg .cm-bubble {
  padding: 9px 13px; border-radius: 15px; font-size: 15.5px; line-height: 1.45;
  word-break: break-word; white-space: pre-wrap;
}
.chat-msg.mine { align-self: flex-end; align-items: flex-end; }
.chat-msg.mine .cm-bubble { background: var(--accent); color: #fff; border-bottom-right-radius: 5px; }
.chat-msg.theirs { align-self: flex-start; align-items: flex-start; }
.chat-msg.theirs .cm-bubble { background: var(--surface-2); border: 1px solid var(--panel-line); color: var(--ink); border-bottom-left-radius: 5px; }
.chat-emojis { display: flex; gap: 6px; padding: 10px 14px 0; }
.chat-emoji {
  flex: 1; border: 1px solid var(--panel-line); background: var(--surface);
  border-radius: 12px; padding: 8px 0; font-size: 23px; cursor: pointer; font-family: inherit;
  transition: background .2s, border-color .2s;
}
.chat-emoji:active { transform: scale(.9); }
.chat-emoji:hover { border-color: var(--ink); background: var(--surface-2); }
.chat-input-row { display: flex; gap: 8px; padding: 12px 14px 14px; }
.chat-input {
  flex: 1; min-width: 0; border: 1px solid var(--panel-line); border-radius: 999px;
  background: var(--surface-2); color: var(--ink); padding: 11px 15px; font: inherit; font-size: 15.5px;
}
.chat-input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.chat-send { padding: 11px 20px; font-size: 15.5px; white-space: nowrap; }

@media (max-width: 560px) {
  .chat-widget { left: 8px; top: 56px; }
  .chat-list { height: 240px; }
  .actions { grid-template-columns: 1fr; }
  .btn-grid { grid-template-columns: 1fr 1fr 1fr 1fr; }
  .scoreboard { padding: 7px 12px; gap: 6px; }
  .sb-name { font-size: 13px; max-width: 7em; }
  .sb-name-input { width: 7em; font-size: 13px; }
}

/* ===== 结束界面：胜利特效 ===== */
.firework-canvas { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; z-index: 1; }
.over-content {
  position: relative; z-index: 2;
  display: flex; flex-direction: column; align-items: center; max-width: 520px; width: 100%;
}
.win-title {
  font-size: clamp(30px, 8vw, 52px) !important;
  font-weight: 700; letter-spacing: 0; line-height: 1.2;
  color: var(--ink); max-width: 90%; margin: 0 auto;
  animation: winPop .6s cubic-bezier(.18,.89,.32,1.15);
}
/* 觉悟读心洞察卡片（DeepSeek 赛后画像露出）*/
.awaken-insight {
  display: flex; align-items: flex-start; gap: 12px; text-align: left;
  width: 100%; max-width: 460px; margin: 18px 0 4px;
  padding: 14px 16px; border-radius: 14px;
  background: linear-gradient(180deg, rgba(0,113,227,.07), rgba(0,113,227,.03));
  border: 1px solid rgba(0,113,227,.25);
}
.awaken-insight.reveal { animation: insightIn .5s cubic-bezier(.2,.9,.3,1.2); }
@keyframes insightIn { from { opacity: 0; transform: translateY(8px) scale(.98); } to { opacity: 1; transform: none; } }
.awaken-insight .ai-eye { font-size: 26px; line-height: 1.1; flex: none; filter: drop-shadow(0 0 6px rgba(0,113,227,.5)); }
.awaken-insight .ai-read-label { font-size: 11.5px; font-weight: 700; letter-spacing: 1px; color: var(--accent); margin-bottom: 4px; }
.awaken-insight .ai-read-text { font-size: 14.5px; line-height: 1.5; color: var(--ink); font-weight: 500; }
.awaken-insight.analyzing .ai-read-text { color: var(--muted); font-weight: 400; }
.awaken-insight.analyzing .ai-eye { animation: eyePulse 1.1s ease-in-out infinite; }
@keyframes eyePulse { 0%, 100% { opacity: .5; } 50% { opacity: 1; } }
@keyframes winPop { from { transform: scale(.4); opacity: 0; } to { transform: scale(1); opacity: 1; } }
.win-title.p1, .win-title.p2 { color: var(--ink); }

/* 倒计时条 */
.countdown-bar { width: min(280px, 70%); height: 5px; margin: 18px auto 8px; background: var(--surface-2); border: 1px solid var(--panel-line); border-radius: 999px; overflow: hidden; }
.countdown-fill { height: 100%; width: 100%; border-radius: 999px; background: var(--ink); transition: width 1s linear; }
.countdown-text { color: var(--muted); font-size: 13px; letter-spacing: 0; margin-bottom: 8px; }
#reveal-countdown { margin-top: 8px; color: var(--muted); font-size: 12px; }

/* ===== 对局开始倒计时 ===== */
.countdown-wrap { text-align: center; }
.countdown-label { font-size: clamp(24px, 6vw, 38px); font-weight: 600; letter-spacing: 0; color: var(--ink); margin-bottom: 20px; }
.countdown-num {
  font-size: clamp(80px, 20vw, 140px); font-weight: 700;
  font-variant-numeric: tabular-nums;
  min-width: 1.5ch; display: inline-block;
  color: var(--ink); line-height: 1;
}
#screen-countdown { overflow: hidden; animation: none; }

/* ===== 开始对局按钮 ===== */
#btn-ready-start { width: 100%; margin-top: 14px; border-radius: 980px; font-size: 19px; letter-spacing: 0; }

/* ===== 回看记录 ===== */
#btn-history { width: 100%; margin-top: 10px; font-size: 16px; background: var(--surface); border: 1px solid var(--panel-line); color: var(--ink); }
.history-wrap { width: 100%; max-width: 560px; padding: 20px; display: flex; flex-direction: column; align-items: center; }
.history-title { font-size: 22px; font-weight: 600; letter-spacing: -0.2px; color: var(--ink); margin-bottom: 18px; }
.history-list { width: 100%; display: flex; flex-direction: column; gap: 10px; max-height: 65vh; overflow-y: auto; padding-right: 4px; }
.history-item { background: var(--surface); border: 1px solid var(--panel-line); border-radius: 14px; padding: 12px 16px; }
.history-round { font-size: 13px; color: var(--muted); margin-bottom: 6px; letter-spacing: 0; }
.history-moves { display: grid; grid-template-columns: 1fr auto 1fr; gap: 10px; align-items: center; font-size: 14px; color: var(--ink); }
.history-moves .hm-p1 { text-align: right; }
.history-moves .hm-p2 { text-align: left; }
.history-moves .hm-vs { color: var(--faint); font-weight: 600; }
.history-result { margin-top: 6px; font-size: 13px; font-weight: 600; color: var(--muted); }
.history-result.dead { color: var(--ink); }
#btn-history-back { border-radius: 980px; padding: 10px 30px; }

/* 输家文字 */
.win-title.loser {
  color: var(--muted) !important; -webkit-text-fill-color: var(--muted) !important;
  filter: none !important; font-size: clamp(28px, 7vw, 48px) !important;
}

/* 对手退出通知 */
.leave-notice {
  position: fixed; top: 52px; left: 50%; transform: translateX(-50%); z-index: 60;
  background: var(--ink); color: #fff; padding: 10px 24px;
  border-radius: 999px; font-weight: 500; font-size: 15px;
  box-shadow: var(--shadow-lg); animation: fade .35s ease;
}

/* ===== 对局设置界面 ===== */
.cfg-title { font-size: clamp(30px, 8vw, 52px); }
.cfg-card {
  margin-top: 24px; text-align: left;
  background: var(--surface); border: 1px solid var(--panel-line);
  border-radius: 18px; padding: 20px; box-shadow: var(--shadow);
}
.cfg-label { color: var(--muted); font-size: 13px; letter-spacing: 0; margin-bottom: 10px; }
.series-btns { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.series-btn {
  padding: 13px 6px; font-size: 15px; font-weight: 500; border-radius: 12px;
  background: var(--surface-2); border: 1px solid var(--panel-line); color: var(--ink);
}
.series-btn.active { background: var(--accent); border-color: var(--accent); color: #fff; }
.series-btn.locked { opacity: .4; cursor: not-allowed; }
.series-btn.locked::after { content: ' 🔒'; font-size: 12px; }
.charge-btns { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.charge-mode-btn {
  display: flex; flex-direction: column; align-items: center; gap: 3px;
  padding: 13px 6px; font-size: 15px; font-weight: 600; border-radius: 12px;
  background: var(--surface-2); border: 1px solid var(--panel-line); color: var(--ink);
}
.charge-mode-btn span { font-size: 11px; font-weight: 400; color: var(--muted); }
.charge-mode-btn.active { background: var(--accent); border-color: var(--accent); color: #fff; }
.charge-mode-btn.active span { color: rgba(255,255,255,.72); }

/* ===== 局间过渡 ===== */
#screen-gameover .over-content { text-align: center; max-width: 520px; }
.go-score {
  display: inline-flex; gap: 14px; align-items: center; margin: 16px auto 4px;
  background: var(--accent-soft); border: 1px solid transparent;
  color: var(--accent); border-radius: 12px; padding: 8px 18px; font-weight: 700; font-size: 18px;
}
.go-next { margin-top: 18px; color: var(--muted); font-size: 17px; font-weight: 500; }
.go-count {
  margin: 14px auto 0; width: 62px; height: 62px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 30px; font-weight: 700; color: var(--accent);
  background: var(--surface); border: 3px solid var(--accent);
  font-variant-numeric: tabular-nums;
}
.series-badge {
  display: inline-block; margin-top: 6px; padding: 4px 14px; border-radius: 999px;
  background: var(--surface-2); color: var(--muted); font-size: 13px; font-weight: 500; border: 1px solid var(--panel-line);
}

/* ===== 回看：每局分界标题 ===== */
.history-game-header {
  display: flex; align-items: center; justify-content: center; gap: 12px;
  position: relative;
  margin: 26px 0 12px; padding: 12px 16px;
  background: var(--surface); border: 1px solid var(--panel-line);
  border-radius: 14px; box-shadow: var(--shadow);
}
.history-game-header::before, .history-game-header::after {
  content: ''; flex: 1; height: 1px; background: var(--panel-line);
}
.history-game-header:first-child { margin-top: 4px; }
.history-game-header .hgh-title { font-size: 20px; font-weight: 700; letter-spacing: 0; color: var(--ink); white-space: nowrap; }
.history-game-header .hgh-sub { font-size: 12.5px; color: var(--muted); font-weight: 500; white-space: nowrap; background: var(--surface-2); padding: 3px 10px; border-radius: 999px; }

/* ===== 在线玩家弹窗 ===== */
.lobby-list { display: flex; flex-direction: column; gap: 10px; margin-top: 8px; }
.lobby-empty { color: var(--muted); font-size: 14px; text-align: center; padding: 24px 8px; }
.lobby-row {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  padding: 12px 14px; background: var(--surface-2); border: 1px solid var(--panel-line); border-radius: 14px;
}
.lobby-info { display: flex; align-items: center; gap: 10px; min-width: 0; }
.lobby-name { font-size: 15px; font-weight: 600; color: var(--ink); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 46vw; }
.lobby-status { font-size: 11px; font-weight: 600; padding: 3px 9px; border-radius: 999px; white-space: nowrap; }
.lobby-status.s-idle { color: #fff; background: var(--accent); }
.lobby-status.s-busy { color: var(--muted); background: var(--surface); border: 1px solid var(--panel-line); }
.lobby-invite { flex: 0 0 auto; padding: 8px 20px; font-size: 14px; }
.lobby-invite:disabled { opacity: .5; cursor: default; }

/* ===== 收到邀请弹窗 ===== */
.invite-popup {
  position: fixed; inset: 0; z-index: 200; display: none;
  align-items: center; justify-content: center; padding: 20px;
  background: rgba(0,0,0,.4); backdrop-filter: blur(6px);
}
.invite-card {
  width: min(360px, 92vw); background: var(--surface); border: 1px solid var(--panel-line);
  border-radius: 20px; padding: 26px 22px; text-align: center;
  box-shadow: var(--shadow-lg); animation: pop .24s ease;
}
.invite-icon { font-size: 42px; margin-bottom: 10px; }
.invite-text { font-size: 16px; line-height: 1.6; color: var(--ink); margin-bottom: 4px; }
.invite-text .invite-mode { color: var(--accent); font-weight: 700; }
.invite-actions { display: flex; gap: 10px; margin-top: 20px; }
.invite-actions .btn { flex: 1; }

/* ===== 轻提示 toast（深色，Apple 风）===== */
.toast {
  position: fixed; left: 50%; bottom: 34px; transform: translateX(-50%);
  z-index: 210; max-width: 88vw; padding: 12px 20px;
  background: rgba(30,30,32,.96); border-radius: 999px;
  color: #fff; font-size: 14px; font-weight: 500; box-shadow: var(--shadow-lg);
  animation: toastIn .3s ease; transition: opacity .34s ease, transform .34s ease;
}
.toast.out { opacity: 0; transform: translateX(-50%) translateY(8px); }
@keyframes toastIn { from { opacity: 0; transform: translateX(-50%) translateY(10px); } to { opacity: 1; transform: translateX(-50%) translateY(0); } }

/* ===== 快速匹配 ===== */
.btn-quickmatch { display: flex; flex-direction: column; align-items: center; gap: 3px; line-height: 1.2; }
.btn-quickmatch span { font-size: 12px; font-weight: 400; opacity: .7; }
.btn-quickmatch.btn-primary span { color: rgba(255,255,255,.7); opacity: 1; }
.match-overlay {
  position: fixed; inset: 0; z-index: 205; display: none;
  align-items: center; justify-content: center; padding: 20px;
  background: rgba(0,0,0,.4); backdrop-filter: blur(6px);
}
.match-card {
  width: min(360px, 92vw); text-align: center;
  background: var(--surface); border: 1px solid var(--panel-line);
  border-radius: 22px; padding: 32px 24px; box-shadow: var(--shadow-lg);
  animation: pop .24s ease;
}
.match-spinner {
  width: 52px; height: 52px; margin: 0 auto 18px;
  border: 3px solid var(--surface-2); border-top-color: var(--accent);
  border-radius: 50%; animation: matchspin .9s linear infinite;
}
@keyframes matchspin { to { transform: rotate(360deg); } }
.match-title { font-size: 19px; font-weight: 600; color: var(--ink); margin-bottom: 6px; }
.match-sub { font-size: 15px; color: var(--accent); font-weight: 600; margin-bottom: 6px; }
.match-hint { font-size: 13px; color: var(--muted); line-height: 1.6; margin-bottom: 22px; }
.match-fallback { margin: 4px 0 20px; padding-top: 16px; border-top: 1px solid var(--panel-line); animation: fadeIn .3s ease; }
.match-fb-text { font-size: 14px; color: var(--ink); font-weight: 600; margin-bottom: 12px; }
.match-fallback .btn-lg { width: 100%; }
.match-fb-note { font-size: 12px; color: var(--muted); line-height: 1.6; margin-top: 10px; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }

/* ===== 降低动效偏好 ===== */
@media (prefers-reduced-motion: reduce) {
  *, .screen, .reveal-card, .win-title, .chat-bubble, .toast, .match-card, .rules-modal-box {
    animation: none !important;
    transition: none !important;
  }
  .match-spinner { animation: matchspin 1.2s linear infinite !important; }
  .pick-countdown.urgent { animation: none !important; }
}
