/* ═══════════════════════════════════════════════════════════════════════════
   main.css — 局域网游戏大厅 · 八合一 (音游风格主题)
   与「节奏打击」统一: 深空渐变背景 + 霓虹青/金/粉 + 玻璃卡片。
   ⚠ 所有 id/class 选择器与 JS 绑定保持一致, 请勿删除任何选择器。
═══════════════════════════════════════════════════════════════════════════ */

/* ── reset & variables ────────────────────────────────────────────────────── */

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  /* 音游风格主色调 */
  --bg:           #0a0a1a;
  --surface:      rgba(255,255,255,.07);
  --surface2:     rgba(255,255,255,.11);
  --surface3:     rgba(255,255,255,.04);
  --border:       rgba(255,255,255,.13);
  --border-strong: rgba(255,255,255,.22);
  --text:         #eef4ff;
  --text-muted:   rgba(255,255,255,.55);
  --accent:       #7ef2ff;
  --accent-hover: #b8f7ff;
  --neon-cyan:    #7ef2ff;
  --neon-gold:    #ffd700;
  --neon-pink:    #ff9ad5;
  --neon-blue:    #2196f3;
  --danger:       #ff5252;
  --warning:      #ffb300;
  --info:         #29b6f6;
  --primary-grad: linear-gradient(90deg, #2196f3, #ffb300);

  /* Property group colours (语义色, 保留) */
  --brown:        #a5682a;
  --lightblue:    #6fd3ff;
  --pink:         #ff7eb6;
  --orange:       #ff8c42;
  --red:          #ef5350;
  --yellow:       #ffd700;
  --green:        #4cd964;
  --darkblue:     #3f51b5;

  /* Board fills available space: min(width-after-sidebar, height-after-header, hard-max) */
  --board-size:   min(calc(100vw - 312px), calc(100vh - 86px), 960px);
  --corner-size:  calc(var(--board-size) * 0.121);
  --side-size:    calc((var(--board-size) - 2 * var(--corner-size)) / 9);
}

html, body {
  height: 100%;
  font-family: -apple-system, 'PingFang SC', 'HarmonyOS Sans SC', 'Microsoft YaHei', 'Segoe UI', system-ui, sans-serif;
  font-size: 14px;
  background: linear-gradient(180deg, #1a0a3a 0%, #0a0a1a 60%, #001a2a 100%);
  background-attachment: fixed;
  color: var(--text);
  overflow-x: hidden;
}

/* 霓虹渐变标题文字 */
h1, h2, h3, .auth-title, .logo, .board-logo {
  background: linear-gradient(90deg, #7ef2ff, #ffd700);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  letter-spacing: 2px;
}

/* ── screen management ────────────────────────────────────────────────────── */

.screen        { display: none; }
.screen.active { display: block; }

/* ── buttons ──────────────────────────────────────────────────────────────── */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 10px 18px;
  min-height: 44px;
  border-radius: 12px;
  border: 1px solid rgba(255,255,255,.16);
  background: rgba(255,255,255,.08);
  color: var(--text);
  cursor: pointer;
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 1px;
  transition: transform .15s, box-shadow .25s, background .2s, filter .2s, opacity .15s;
  text-shadow: 0 1px 4px rgba(0,0,0,.4);
}
.btn:disabled { opacity: 0.45; cursor: not-allowed; }
.btn:not(:disabled):hover {
  background: rgba(255,255,255,.14);
  box-shadow: 0 0 18px rgba(33,150,243,.35), inset 0 0 12px rgba(255,255,255,.05);
}
.btn:not(:disabled):active { transform: scale(.96); }
.btn-primary {
  background: var(--primary-grad);
  border-color: rgba(255,255,255,.25);
  color: #fff;
  font-weight: 700;
  box-shadow: 0 4px 18px rgba(33,150,243,.4);
}
.btn-primary:not(:disabled):hover { filter: brightness(1.1); box-shadow: 0 0 22px rgba(33,150,243,.55); }
.btn-danger    { background: rgba(255,82,82,.2);  color: #fff; border-color: rgba(255,82,82,.45); }
.btn-danger:not(:disabled):hover { background: rgba(255,82,82,.32); box-shadow: 0 0 18px rgba(255,82,82,.35); }
.btn-outline   { background: transparent; color: var(--text); border: 1px solid var(--border-strong); }
.btn-outline:not(:disabled):hover { background: rgba(255,255,255,.12); box-shadow: 0 0 18px rgba(33,150,243,.35); }
.btn-ghost     { background: transparent; color: var(--text-muted); border: 1px solid rgba(255,255,255,.1); }
.btn-ghost:not(:disabled):hover { background: rgba(255,255,255,.1); color: var(--text); }
.btn-full      { width: 100%; }
.btn-sm        { padding: 7px 12px; min-height: 36px; font-size: 12.5px; }
.mt-2          { margin-top: 8px; }

/* 风险游戏通用操作按钮 */
.action-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 10px 16px;
  min-height: 44px;
  border-radius: 12px;
  border: 1px solid rgba(255,255,255,.16);
  background: rgba(255,255,255,.08);
  color: var(--text);
  cursor: pointer;
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 1px;
  width: 100%;
  transition: transform .15s, box-shadow .25s, background .2s;
}
.action-btn:not(:disabled):hover { background: rgba(255,255,255,.14); box-shadow: 0 0 18px rgba(33,150,243,.35); }
.action-btn:disabled { opacity: .45; cursor: not-allowed; }

/* ── form elements ────────────────────────────────────────────────────────── */

.form-group     { margin-bottom: 14px; }
.form-group label { display: block; margin-bottom: 4px; color: var(--text-muted); font-size: 12px; }
input[type="text"],
input[type="password"],
input[type="number"],
select {
  width: 100%;
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid var(--border-strong);
  background: rgba(255,255,255,.07);
  color: var(--text);
  font-size: 14px;
  outline: none;
  transition: border-color .2s, box-shadow .2s;
}
input:focus, select:focus { border-color: var(--neon-cyan); box-shadow: 0 0 14px rgba(126,242,255,.25); }
input::placeholder { color: rgba(255,255,255,.35); }
.checkbox-group label { display: flex; align-items: center; gap: 8px; color: var(--text); }
.checkbox-group input { width: auto; accent-color: var(--neon-blue); }
.form-error { color: var(--danger); font-size: 12px; min-height: 18px; margin-bottom: 8px; }

/* ── ── ── ── ── ── ── ── ── ── ── ── ── ── ── ── ── ── ── ── ── ── ── ── ──
   AUTH SCREEN (登录界面)
── ── ── ── ── ── ── ── ── ── ── ── ── ── ── ── ── ── ── ── ── ── ── ── ── */

#auth-screen {
  min-height: 100vh;
  /* display 由 .screen / .screen.active 控制 —— 此处不可设置,
     否则 ID 选择器优先级高于 class, 退出登录后界面会残留 */
  align-items: center;
  justify-content: center;
  background: radial-gradient(ellipse at 50% 30%, rgba(126,242,255,.08) 0%, transparent 55%),
              radial-gradient(ellipse at 80% 80%, rgba(255,157,213,.06) 0%, transparent 50%),
              linear-gradient(180deg, #1a0a3a 0%, #0a0a1a 60%, #001a2a 100%);
}
#auth-screen.active {
  display: flex;
}

.auth-container {
  width: 380px;
  background: rgba(255,255,255,.07);
  border: 1px solid rgba(255,255,255,.13);
  border-radius: 16px;
  padding: 40px 34px;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  box-shadow: 0 20px 60px rgba(0,0,0,.5), inset 0 1px 0 rgba(255,255,255,.06);
}
.auth-title    { font-size: 34px; text-align: center; margin-bottom: 4px; }
.auth-subtitle { text-align: center; color: var(--text-muted); margin-bottom: 26px; letter-spacing: 2px; }

.tab-bar { display: flex; border-bottom: 1px solid var(--border); margin-bottom: 22px; }
.tab-btn {
  flex: 1;
  padding: 12px;
  min-height: 44px;
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  color: var(--text-muted);
  cursor: pointer;
  font-size: 15px;
  font-weight: 600;
  letter-spacing: 4px;
  transition: color .15s, border-color .15s, text-shadow .15s;
}
.tab-btn.active { color: var(--neon-cyan); border-bottom-color: var(--neon-cyan); text-shadow: 0 0 12px rgba(126,242,255,.6); }

.auth-form         { display: none; }
.auth-form.active  { display: block; }

/* ── ── ── ── ── ── ── ── ── ── ── ── ── ── ── ── ── ── ── ── ── ── ── ── ──
   LOBBY SCREEN (游戏大厅)
── ── ── ── ── ── ── ── ── ── ── ── ── ── ── ── ── ── ── ── ── ── ── ── ── */

#lobby-screen.active { display: flex; flex-direction: column; min-height: 100vh; }

.lobby-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 24px;
  background: rgba(255,255,255,.07);
  border: 1px solid var(--border);
  border-radius: 12px;
  margin: 12px 16px 0;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  box-shadow: 0 4px 20px rgba(0,0,0,.3);
  flex-shrink: 0;
}
.lobby-header .logo { font-size: 22px; }
.header-user { display: flex; align-items: center; gap: 12px; color: var(--text-muted); font-size: 13px; }

.lobby-body {
  display: flex;
  gap: 24px;
  padding: 24px;
  flex: 1;
  overflow: auto;
}

.lobby-games {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.lobby-create {
  width: 330px;
  background: rgba(255,255,255,.07);
  border: 1px solid rgba(255,255,255,.13);
  border-radius: 16px;
  padding: 22px;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  align-self: flex-start;
  box-shadow: 0 12px 40px rgba(0,0,0,.4), inset 0 1px 0 rgba(255,255,255,.06);
}
.lobby-create h2 { margin-bottom: 16px; font-size: 18px; }

.section-header { display: flex; align-items: center; justify-content: space-between; }
.section-header h2 { font-size: 18px; }

.games-list { display: flex; flex-direction: column; gap: 10px; margin-top: 10px; }

.game-card {
  background: rgba(255,255,255,.07);
  border: 1px solid rgba(255,255,255,.13);
  border-radius: 12px;
  padding: 14px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  transition: box-shadow .2s, border-color .2s, transform .15s;
}
.game-card:hover { border-color: rgba(126,242,255,.45); box-shadow: 0 0 18px rgba(33,150,243,.25); transform: translateY(-1px); }
.game-card-info h4 { font-size: 15px; margin-bottom: 2px; }
.game-card-info p  { font-size: 12px; color: var(--text-muted); }
.game-type-badge {
  display: inline-block;
  font-size: 10px;
  padding: 2px 8px;
  border-radius: 99px;
  background: rgba(126,242,255,.12);
  border: 1px solid rgba(126,242,255,.3);
  color: var(--neon-cyan);
  margin-top: 3px;
}
.game-card-status {
  font-size: 11px;
  padding: 3px 10px;
  border-radius: 99px;
  font-weight: 600;
  letter-spacing: 1px;
  border: 1px solid;
}
.status-waiting { background: rgba(76,217,100,.12); color: #69f0ae; border-color: rgba(76,217,100,.35); }
.status-playing { background: rgba(33,150,243,.12); color: #82b1ff; border-color: rgba(33,150,243,.4); }
.status-paused  { background: rgba(255,179,0,.1); color: #ffd54f; border-color: rgba(255,179,0,.35); }

.empty-state { color: var(--text-muted); font-style: italic; padding: 12px 0; }

.saved-games-section h3 { font-size: 15px; color: var(--text-muted); margin-top: 16px; }

.collapsible-btn {
  background: rgba(255,255,255,.05);
  border: 1px dashed var(--border-strong);
  color: var(--text-muted);
  padding: 10px 12px;
  min-height: 40px;
  border-radius: 10px;
  cursor: pointer;
  font-size: 13px;
  width: 100%;
  text-align: left;
  margin-bottom: 10px;
  transition: border-color .2s, color .2s;
}
.collapsible-btn:hover { border-color: var(--neon-cyan); color: var(--text); }
.config-panel { padding: 10px 0; }

/* ── ── ── ── ── ── ── ── ── ── ── ── ── ── ── ── ── ── ── ── ── ── ── ── ──
   WAITING ROOM SCREEN (等待室)
── ── ── ── ── ── ── ── ── ── ── ── ── ── ── ── ── ── ── ── ── ── ── ── ── */

#waiting-screen.active { display: flex; flex-direction: column; min-height: 100vh; }

.waiting-body {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
}
.waiting-card {
  background: rgba(255,255,255,.07);
  border: 1px solid rgba(255,255,255,.13);
  border-radius: 16px;
  padding: 36px 44px;
  min-width: 380px;
  text-align: center;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  box-shadow: 0 20px 60px rgba(0,0,0,.45), inset 0 1px 0 rgba(255,255,255,.06);
}
.waiting-card h3 { font-size: 20px; margin-bottom: 20px; }
.players-waiting-list { list-style: none; margin-bottom: 24px; }
.players-waiting-list li {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 0;
  border-bottom: 1px solid var(--border);
  font-size: 15px;
}
.players-waiting-list li:last-child { border-bottom: none; }
.player-token-badge {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  flex-shrink: 0;
  box-shadow: 0 0 10px rgba(255,255,255,.2), inset 0 0 6px rgba(0,0,0,.35);
}
.waiting-hint { color: var(--text-muted); margin-bottom: 16px; font-size: 13px; }

/* ── ── ── ── ── ── ── ── ── ── ── ── ── ── ── ── ── ── ── ── ── ── ── ── ──
   GAME SCREEN (游戏界面)
── ── ── ── ── ── ── ── ── ── ── ── ── ── ── ── ── ── ── ── ── ── ── ── ── */

#game-screen.active { display: flex; flex-direction: column; height: 100vh; overflow: hidden; }

.game-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 16px;
  background: rgba(255,255,255,.07);
  border-bottom: 1px solid var(--border);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  flex-shrink: 0;
}
.game-header-left  { display: flex; align-items: center; gap: 12px; min-width: 0; }
.game-header-left h2 { font-size: 17px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.game-header-right { display: flex; gap: 8px; flex-shrink: 0; }

.turn-indicator {
  font-size: 12px;
  padding: 3px 10px;
  border-radius: 99px;
  background: rgba(255,255,255,.08);
  border: 1px solid var(--border);
  color: var(--text-muted);
  white-space: nowrap;
}
.turn-indicator.my-turn {
  background: rgba(76,217,100,.15);
  color: #69f0ae;
  border-color: rgba(76,217,100,.4);
  box-shadow: 0 0 12px rgba(76,217,100,.3);
}

.game-layout {
  display: flex;
  flex: 1;
  overflow: hidden;
}

/* ── board (大富翁棋盘) ──────────────────────────────────────────────────── */

.board-wrapper {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  overflow: auto;
  background: transparent;
}

.board {
  display: grid;
  grid-template-columns: var(--corner-size) repeat(9, var(--side-size)) var(--corner-size);
  grid-template-rows:    var(--corner-size) repeat(9, var(--side-size)) var(--corner-size);
  width:  var(--board-size);
  height: var(--board-size);
  border: 2px solid rgba(126,242,255,.35);
  border-radius: 12px;
  background: rgba(10,16,40,.85);
  box-shadow: 0 0 40px rgba(33,150,243,.15), inset 0 0 60px rgba(0,0,0,.4);
  flex-shrink: 0;
  position: relative;
  overflow: hidden;
}

/* 棋盘中心区域 */
.board-center {
  grid-column: 2 / 11;
  grid-row: 2 / 11;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  background:
    radial-gradient(circle at 50% 40%, rgba(126,242,255,.10) 0%, transparent 60%),
    rgba(10,16,40,.85);
  position: relative;
}
.board-logo {
  font-size: calc(var(--board-size) * 0.042);
  font-weight: 900;
  letter-spacing: 4px;
  text-shadow: 0 0 24px rgba(126,242,255,.5);
}
.free-parking-pot { text-align: center; }
.pot-label { display: block; font-size: 11px; color: var(--text-muted); }
.pot-amount { font-size: 22px; font-weight: 700; color: var(--neon-gold); text-shadow: 0 0 12px rgba(255,215,0,.5); }

.dice-display { display: flex; gap: 10px; }
.die {
  width: 44px;
  height: 44px;
  border-radius: 10px;
  background: rgba(255,255,255,.12);
  border: 1px solid rgba(255,255,255,.3);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  font-weight: 700;
  color: var(--neon-cyan);
  box-shadow: 0 0 12px rgba(126,242,255,.25), inset 0 2px 4px rgba(0,0,0,.4);
}

.auction-center { text-align: center; font-size: 13px; color: var(--text); }
.auction-center h4 { color: var(--neon-gold); font-size: 15px; margin-bottom: 4px; letter-spacing: 2px; }

/* ── individual board squares ────────────────────────────────────────────── */

.square {
  position: relative;
  border: 1px solid rgba(255,255,255,.14);
  background: rgba(16,24,52,.9);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-end;
  padding: 2px;
  overflow: hidden;
  cursor: default;
  transition: filter 0.15s, box-shadow 0.15s;
  font-size: calc(var(--board-size) * 0.0136);
  text-align: center;
  color: var(--text);
}
.square:hover { filter: brightness(1.25); box-shadow: inset 0 0 18px rgba(126,242,255,.15); }
.square.clickable { cursor: pointer; }

/* Corner squares */
.square.corner {
  font-size: calc(var(--board-size) * 0.0152);
  font-weight: 700;
  justify-content: center;
}

/* Color band for property squares */
.color-band {
  position: absolute;
  left: 0;
  right: 0;
  height: calc(var(--board-size) * 0.0212);
  box-shadow: 0 0 8px rgba(255,255,255,.15);
}
/* Color band position varies by edge */
.square.edge-bottom .color-band { top: 0; }
.square.edge-top    .color-band { bottom: 0; }
.square.edge-left   .color-band { right: 0; top: 0; bottom: 0; width: calc(var(--board-size) * 0.0212); height: auto; }
.square.edge-right  .color-band { left: 0; top: 0; bottom: 0; width: calc(var(--board-size) * 0.0212); height: auto; }

.sq-name  { font-size: calc(var(--board-size) * 0.0121); line-height: 1.1; font-weight: 600; word-break: break-word; color: var(--text); }
.sq-price { font-size: calc(var(--board-size) * 0.0121); color: var(--neon-gold); }

/* Property colour groups */
.color-brown    { background: var(--brown); }
.color-lightblue { background: var(--lightblue); }
.color-pink     { background: var(--pink); }
.color-orange   { background: var(--orange); }
.color-red      { background: var(--red); }
.color-yellow   { background: var(--yellow); }
.color-green    { background: var(--green); }
.color-darkblue { background: var(--darkblue); }

/* Square type tinting (霓虹微调色) */
.square.type-chance          { background: rgba(255,213,79,.14); }
.square.type-community_chest { background: rgba(41,182,246,.16); }
.square.type-railroad        { background: rgba(255,255,255,.08); }
.square.type-utility         { background: rgba(76,217,100,.12); }
.square.type-tax             { background: rgba(255,152,0,.14); }
.square.type-go_to_jail,
.square.type-jail            { background: rgba(255,82,82,.16); }
.square.type-free_parking    { background: rgba(76,217,100,.14); }

/* Owned property highlight */
.square.owned { filter: brightness(.85) saturate(1.2); }
.square.mortgaged { opacity: 0.55; }

/* Houses and hotels on squares */
.buildings {
  display: flex;
  gap: 2px;
  position: absolute;
  top: calc(var(--board-size) * 0.0242);
  flex-wrap: wrap;
  justify-content: center;
  width: 100%;
}
.house-dot {
  width:  calc(var(--board-size) * 0.0121);
  height: calc(var(--board-size) * 0.0121);
  border-radius: 2px;
  background: #4cd964;
  border: 1px solid #2e9e46;
  box-shadow: 0 0 4px rgba(76,217,100,.5);
}
.hotel-dot {
  width:  calc(var(--board-size) * 0.0152);
  height: calc(var(--board-size) * 0.0152);
  border-radius: 2px;
  background: var(--danger);
  border: 1px solid #c62828;
  box-shadow: 0 0 6px rgba(255,82,82,.6);
}

/* Player tokens on squares */
.tokens-container {
  display: flex;
  flex-wrap: wrap;
  gap: 2px;
  justify-content: center;
  align-items: center;
  position: absolute;
  bottom: 2px;
  width: 100%;
}
.player-token {
  width:  calc(var(--board-size) * 0.033);
  height: calc(var(--board-size) * 0.033);
  border-radius: 50%;
  border: 2px solid rgba(255,255,255,0.9);
  font-size: calc(var(--board-size) * 0.020);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 1px 6px rgba(0,0,0,0.6), 0 0 8px rgba(255,255,255,.15);
}

/* Ownership indicator (tiny dot under color band) */
.ownership-dot {
  width:  calc(var(--board-size) * 0.0121);
  height: calc(var(--board-size) * 0.0121);
  border-radius: 50%;
  position: absolute;
  top: calc(var(--board-size) * 0.0242);
  left: 50%;
  transform: translateX(-50%);
  box-shadow: 0 0 6px rgba(255,255,255,.4);
}

/* Rotated text for left/right edge squares */
.square.edge-left  .sq-inner { transform: rotate(90deg);  writing-mode: vertical-lr; }
.square.edge-right .sq-inner { transform: rotate(-90deg); writing-mode: vertical-rl; }

/* ── sidebar (右侧栏) ────────────────────────────────────────────────────── */

.game-sidebar {
  width: 288px;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  border-left: 1px solid var(--border);
  overflow-y: auto;
  background: rgba(8,10,26,.6);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

.players-section,
.action-section,
.log-section,
.chat-section {
  border-bottom: 1px solid var(--border);
  padding: 12px 14px;
}

.players-section h3,
.action-section h3,
.log-section h3,
.chat-section h3 {
  font-size: 13px;
  letter-spacing: 2px;
  color: var(--text-muted);
  margin-bottom: 10px;
  background: none;
  -webkit-background-clip: initial;
  background-clip: initial;
  color: var(--text-muted);
}

/* Player panel cards */
.players-panel { display: flex; flex-direction: column; gap: 8px; }

.player-card {
  border-radius: 12px;
  border: 1px solid transparent;
  padding: 9px 11px;
  background: rgba(255,255,255,.06);
  transition: border-color 0.2s, box-shadow 0.2s;
}
.player-card.active-turn {
  border-color: rgba(126,242,255,.55);
  box-shadow: 0 0 14px rgba(126,242,255,.2);
}
.player-card.dimmed      { opacity: 0.45; }

.player-card-header {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 4px;
}
.player-color-dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  flex-shrink: 0;
  box-shadow: 0 0 6px rgba(255,255,255,.35);
}
.player-card-name  { font-weight: 700; font-size: 13px; flex: 1; color: var(--text); }
.player-card-money { font-weight: 700; color: var(--neon-gold); font-size: 13px; text-shadow: 0 0 8px rgba(255,215,0,.4); }
.player-card-props { font-size: 11px; color: var(--text-muted); }
.player-jail-badge {
  font-size: 10px;
  padding: 2px 8px;
  border-radius: 99px;
  background: rgba(255,82,82,.25);
  border: 1px solid rgba(255,82,82,.45);
  color: #ffab91;
  letter-spacing: 1px;
}

/* Action buttons area */
.action-buttons { display: flex; flex-direction: column; gap: 8px; }
.action-buttons .btn { text-align: left; justify-content: flex-start; }

.dice-display {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 12px;
}

/* Die face: 3×3 grid of pip slots (侧栏骰子) */
.die {
  width: 58px;
  height: 58px;
  background: rgba(255,255,255,.12);
  border: 1px solid rgba(255,255,255,.3);
  border-radius: 12px;
  box-shadow: 0 0 14px rgba(126,242,255,.2), inset 0 1px 0 rgba(255,255,255,.25);
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  grid-template-rows: repeat(3, 1fr);
  padding: 7px;
  gap: 3px;
  user-select: none;
  flex-shrink: 0;
}

/* Each pip slot — pip shown when .pip class is present */
.pip-slot {
  display: flex;
  align-items: center;
  justify-content: center;
}
.pip-slot::after {
  content: '';
  display: none;
  width: 10px;
  height: 10px;
  background: var(--neon-cyan);
  border-radius: 50%;
  box-shadow: 0 0 6px rgba(126,242,255,.8);
}
.pip-slot.pip::after {
  display: block;
}

.doubles-badge {
  font-size: 0.7rem;
  font-weight: 700;
  color: var(--neon-cyan);
  background: rgba(126,242,255,.12);
  border: 1px solid rgba(126,242,255,.4);
  padding: 3px 9px;
  border-radius: 99px;
  letter-spacing: 0.06em;
  text-shadow: 0 0 8px rgba(126,242,255,.5);
}

.auction-panel { padding-top: 8px; }
.auction-bid-row { display: flex; gap: 6px; margin-top: 6px; }
.bid-input { width: 110px; flex-shrink: 0; }

/* Game log */
.game-log {
  height: 210px;
  overflow-y: auto;
  font-size: 12px;
  line-height: 1.4;
  color: var(--text-muted);
  display: flex;
  flex-direction: column;
  gap: 1px;
}

.log-entry {
  display: flex;
  align-items: baseline;
  gap: 5px;
  padding: 3px 6px 3px 0;
  border-left: 2px solid transparent;
  border-radius: 0 6px 6px 0;
}
.log-icon {
  flex-shrink: 0;
  width: 18px;
  padding-left: 5px;
  text-align: center;
  font-size: 11px;
  line-height: 1.4;
}
.log-msg { flex: 1; min-width: 0; word-break: break-word; }

.log-entry.type-dice     { border-color: #5c8dd6; color: #aac4f0; }
.log-entry.type-move     { color: var(--text-muted); font-size: 11px; }
.log-entry.type-money    { border-color: #4cd964; color: #a5d6a7; }
.log-entry.type-property { border-color: #f9c74f; color: #fff59d; }
.log-entry.type-jail     { border-color: #e57373; color: #ef9a9a; }
.log-entry.type-card     { border-color: #ce93d8; color: #e1bee7; }
.log-entry.type-trade    { border-color: #4dd0e1; color: #80deea; }
.log-entry.type-auction  { border-color: #ffb300; color: #ffcc80; }
.log-entry.type-game     { border-color: var(--neon-gold); color: #fff; font-weight: 700; background: rgba(255,215,0,.08); border-radius: 6px; text-shadow: 0 0 8px rgba(255,215,0,.3); }
.log-entry.type-info     { color: var(--text-muted); font-size: 11px; }

/* Turn separator — horizontal rule with player name centred */
.log-entry.type-turn {
  border-left: none;
  padding: 8px 6px 4px;
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 10px;
  font-style: italic;
  color: var(--text-muted);
}
.log-entry.type-turn::before,
.log-entry.type-turn::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--border);
}
.log-divider-text { white-space: nowrap; flex-shrink: 0; }

/* Chat */
.chat-messages {
  height: 120px;
  overflow-y: auto;
  font-size: 12px;
  margin-bottom: 8px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.chat-msg { }
.chat-msg-name { font-weight: 700; color: var(--neon-cyan); }
.chat-msg-text { color: var(--text); }

.chat-form { display: flex; gap: 6px; }
.chat-form input { flex: 1; min-width: 0; }
.chat-form .btn  { flex-shrink: 0; }

/* ── modals (弹窗) ───────────────────────────────────────────────────────── */

.modal {
  position: fixed;
  inset: 0;
  background: rgba(5,6,18,.75);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
}
.modal-content {
  background: rgba(15,16,40,.95);
  border: 1px solid rgba(255,255,255,.13);
  border-radius: 16px;
  width: 440px;
  max-width: 95vw;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: 0 20px 60px rgba(0,0,0,.55), inset 0 1px 0 rgba(255,255,255,.06);
}
.modal-wide { width: 680px; }

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
}
.modal-header h3 { font-size: 16px; }
.modal-close {
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 18px;
  cursor: pointer;
  padding: 6px 10px;
  border-radius: 8px;
  transition: background .15s, color .15s;
}
.modal-close:hover { background: rgba(255,255,255,.1); color: var(--text); }
.modal-body   { padding: 20px; }
.modal-footer {
  display: flex;
  gap: 10px;
  padding: 16px 20px;
  border-top: 1px solid var(--border);
  justify-content: flex-end;
}

/* My Properties modal */
.my-props-list { display: flex; flex-direction: column; gap: 8px; max-height: 60vh; overflow-y: auto; }
.my-prop-row { display: flex; align-items: center; gap: 10px; padding: 8px; background: rgba(255,255,255,.06); border: 1px solid var(--border); border-radius: 10px; }
.my-prop-color { width: 12px; height: 36px; border-radius: 4px; flex-shrink: 0; box-shadow: 0 0 6px rgba(255,255,255,.25); }
.my-prop-info { flex: 1; min-width: 0; }
.my-prop-name { font-weight: 700; font-size: 13px; display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; color: var(--text); }
.my-prop-status { font-size: 11px; color: var(--text-muted); }
.my-prop-btns { display: flex; gap: 6px; flex-shrink: 0; }

/* Property detail modal */
.prop-detail-card { background: rgba(255,255,255,.06); border: 1px solid var(--border); border-radius: 12px; padding: 16px; }
.prop-color-stripe { height: 24px; border-radius: 6px; margin-bottom: 12px; box-shadow: 0 0 12px rgba(255,255,255,.15); }
.prop-detail-row { display: flex; justify-content: space-between; font-size: 13px; padding: 4px 0; border-bottom: 1px solid var(--border); }
.prop-detail-row:last-child { border-bottom: none; }
.prop-actions { display: flex; flex-direction: column; gap: 8px; margin-top: 16px; }

/* Trade modal */
.trade-columns { display: flex; gap: 0; align-items: flex-start; }
.trade-col { flex: 1; padding: 0 12px; min-width: 0; }
.trade-col:first-child { padding-left: 0; }
.trade-col:last-child  { padding-right: 0; }
.trade-col-center { display: flex; align-items: center; font-size: 28px; color: var(--neon-cyan); padding: 0 4px; align-self: center; }
.trade-col h4 { font-size: 14px; margin-bottom: 10px; }
.trade-select { margin-bottom: 10px; }
.trade-props-list { display: flex; flex-direction: column; gap: 4px; max-height: 160px; overflow-y: auto; }
.trade-prop-item { display: flex; align-items: center; gap: 6px; font-size: 12px; padding: 4px; border-radius: 8px; cursor: pointer; }
.trade-prop-item:hover { background: rgba(255,255,255,.08); }
.trade-prop-item input[type=checkbox] { width: auto; accent-color: var(--neon-cyan); }
.trade-prop-color { width: 10px; height: 10px; border-radius: 50%; flex-shrink: 0; }
.trade-input { margin-bottom: 10px; }

/* Game over */
.game-over-message { font-size: 22px; text-align: center; padding: 20px 0; color: var(--neon-gold); font-weight: 700; text-shadow: 0 0 16px rgba(255,215,0,.45); }

/* ── Connect Four board (四子棋) ─────────────────────────────────────────── */

.connect-four-wrapper {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
  padding: 16px;
  gap: 6px;
}

.cf-col-buttons {
  display: grid;
  gap: 4px;
  width: fit-content;
}

.cf-col-btn {
  width: 58px;
  height: 44px;
  background: rgba(255,255,255,.08);
  border: 1px solid var(--border-strong);
  border-radius: 10px;
  color: var(--neon-cyan);
  cursor: pointer;
  font-size: 16px;
  transition: background 0.15s, box-shadow 0.15s, color 0.15s, transform .1s;
}
.cf-col-btn:not(:disabled):hover {
  background: rgba(33,150,243,.3);
  border-color: var(--neon-cyan);
  box-shadow: 0 0 14px rgba(33,150,243,.45);
  transform: translateY(-2px);
}
.cf-col-btn:disabled { opacity: 0.25; cursor: not-allowed; }

.cf-grid {
  display: grid;
  gap: 5px;
  background: linear-gradient(180deg, rgba(33,150,243,.35), rgba(10,26,64,.9));
  padding: 10px;
  border-radius: 14px;
  border: 1px solid rgba(126,242,255,.3);
  box-shadow: 0 0 30px rgba(33,150,243,.2), inset 0 0 20px rgba(0,0,0,.5);
  width: fit-content;
}

.cf-cell {
  width: 54px;
  height: 54px;
  background: rgba(5,10,25,.95);
  border-radius: 50%;
  transition: background 0.2s, box-shadow 0.2s;
  box-shadow: inset 0 3px 8px rgba(0,0,0,.7), inset 0 0 0 2px rgba(255,255,255,.05);
}
.cf-cell.filled {
  box-shadow: inset 0 2px 6px rgba(0,0,0,.4), 0 0 12px rgba(255,255,255,.25);
}

/* ── Tic-Tac-Toe board (井字棋) ──────────────────────────────────────────── */

.tic-tac-toe-wrapper {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
  padding: 16px;
}

.ttt-grid {
  display: grid;
  gap: 8px;
  background: rgba(10,16,40,.6);
  border: 1px solid rgba(126,242,255,.25);
  padding: 14px;
  border-radius: 16px;
  box-shadow: 0 0 30px rgba(33,150,243,.15);
  width: fit-content;
}

.ttt-cell {
  width: 96px;
  height: 96px;
  background: rgba(255,255,255,.06);
  border: 1px solid rgba(255,255,255,.16);
  border-radius: 14px;
  color: var(--text);
  font-size: 56px;
  line-height: 1;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.15s, transform 0.08s, box-shadow 0.15s;
  box-shadow: inset 0 3px 8px rgba(0,0,0,.4);
}
.ttt-cell:not(:disabled):not(.filled):hover {
  background: rgba(33,150,243,.2);
  border-color: var(--neon-cyan);
  transform: scale(1.03);
  box-shadow: 0 0 16px rgba(33,150,243,.35);
}
.ttt-cell:disabled:not(.filled) { cursor: not-allowed; opacity: 0.55; }
.ttt-cell.filled { cursor: default; text-shadow: 0 0 14px rgba(255,255,255,.35); }

/* ── Yahtzee (快艇骰子) ──────────────────────────────────────────────────── */

.yahtzee-wrapper {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  width: 100%;
  height: 100%;
  padding: 14px 12px;
  gap: 14px;
  overflow-y: auto;
}

.yz-sheet-wrap {
  width: 100%;
  display: flex;
  justify-content: center;
}

.yz-sheet {
  border-collapse: separate;
  border-spacing: 0;
  background: rgba(255,255,255,.05);
  border: 1px solid var(--border);
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 3px 14px rgba(0,0,0,.35);
  font-size: 13px;
  min-width: 420px;
  max-width: 100%;
}

.yz-sheet th, .yz-sheet td {
  padding: 7px 10px;
  text-align: center;
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}

.yz-sheet thead th {
  background: rgba(33,150,243,.15);
  font-weight: 600;
  font-size: 12px;
  letter-spacing: 0.04em;
  color: var(--neon-cyan);
}

.yz-sheet .yz-cat-col, .yz-sheet .yz-cat-label {
  text-align: left;
  color: var(--text);
  font-weight: 600;
  background: rgba(255,255,255,.05);
}

.yz-sheet .yz-hint, .yz-sheet .yz-hint-col {
  text-align: left;
  font-size: 11px;
  color: var(--text-muted);
  font-style: italic;
  font-weight: normal;
}

.yz-sheet .yz-col-current { background: rgba(126,242,255,.1); }
.yz-sheet .yz-col-me { font-weight: 600; }
.yz-sheet .yz-col-winner { background: rgba(255,215,0,.16); }
.yz-sheet thead th.yz-col-winner { color: var(--neon-gold); }

.yz-score-cell { cursor: default; color: var(--text); }
.yz-cell-empty { color: var(--text-muted); }
.yz-cell-scored { color: var(--text); font-weight: 600; }
.yz-cell-locked { cursor: default; }
.yz-cell-preview {
  cursor: pointer;
  color: var(--neon-cyan);
  background: rgba(126,242,255,.07);
  text-shadow: 0 0 8px rgba(126,242,255,.4);
}
.yz-cell-preview:hover {
  background: rgba(126,242,255,.18);
  outline: 1px solid var(--neon-cyan);
  box-shadow: 0 0 12px rgba(126,242,255,.3);
}
.yz-cell-selected {
  background: var(--primary-grad);
  color: #fff;
  outline: 2px solid var(--neon-cyan);
  box-shadow: 0 0 14px rgba(33,150,243,.5);
}
.yz-cell-flash { animation: yzCellFlash 0.8s ease-out; }

@keyframes yzCellFlash {
  0%   { background: #fff8a0; color: #000; }
  100% { background: transparent; color: inherit; }
}

.yz-row-sep td { padding: 0; height: 4px; background: transparent; border-bottom: 1px solid var(--border); }
.yz-summary-row { background: rgba(255,255,255,.06); }
.yz-summary-row .yz-summary-cell { font-weight: 600; color: var(--text); }
.yz-grand-row .yz-cat-label,
.yz-grand-row .yz-summary-cell {
  font-size: 14px;
  background: rgba(33,150,243,.2);
  color: var(--neon-gold);
}

/* ── dice tray (骰子托盘) ───────────────────────────────────────────────── */

.yz-tray {
  display: flex;
  gap: 14px;
  justify-content: center;
  align-items: center;
  padding: 14px 18px;
  background: rgba(255,255,255,.06);
  border-radius: 14px;
  border: 1px solid var(--border);
  box-shadow: inset 0 2px 8px rgba(0,0,0,.45), 0 0 20px rgba(33,150,243,.1);
  transition: outline 0.15s;
}

.yz-die {
  width: 64px;
  height: 64px;
  background: rgba(255,255,255,.14);
  border-radius: 14px;
  border: 1px solid rgba(255,255,255,.35);
  padding: 8px;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  grid-template-rows: repeat(3, 1fr);
  gap: 2px;
  cursor: pointer;
  transition: transform 0.12s, border-color 0.15s, box-shadow 0.15s;
  box-shadow: 0 2px 6px rgba(0,0,0,.3), 0 0 8px rgba(126,242,255,.15);
}

.yz-die:not(:disabled):hover {
  transform: translateY(-2px);
  border-color: var(--neon-cyan);
  box-shadow: 0 0 14px rgba(126,242,255,.35);
}

.yz-die:disabled { cursor: default; }

.yz-die.yz-die-empty {
  background: rgba(255,255,255,.04);
  border-color: var(--border);
  box-shadow: inset 0 2px 6px rgba(0,0,0,.5);
}

.yz-die.yz-die-empty .yz-pip-slot.pip::after { background: transparent; }

.yz-die.yz-die-held {
  border-color: var(--neon-cyan);
  background: rgba(126,242,255,.14);
  box-shadow: 0 0 14px rgba(126,242,255,.5), 0 2px 4px rgba(0,0,0,.3);
}

.yz-die.yz-die-rolling { animation: yzRoll 0.25s linear infinite; }

@keyframes yzRoll {
  0%   { transform: rotate(0deg)   translateY(0); }
  25%  { transform: rotate(-8deg)  translateY(-3px); }
  50%  { transform: rotate(0deg)   translateY(0); }
  75%  { transform: rotate(8deg)   translateY(-3px); }
  100% { transform: rotate(0deg)   translateY(0); }
}

.yz-pip-slot {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.yz-pip-slot.pip::after {
  content: '';
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--neon-cyan);
  box-shadow: 0 0 6px rgba(126,242,255,.8);
}

.yz-die.yz-die-held .yz-pip-slot.pip::after { background: #fff; box-shadow: 0 0 8px rgba(255,255,255,.8); }

/* ── roll button ─────────────────────────────────────────────────────────── */

.yz-roll-wrap { display: flex; justify-content: center; }
.yz-roll-btn { min-width: 260px; padding: 12px 24px; font-size: 15px; font-weight: 600; }

/* ── Battleship (海战棋) ─────────────────────────────────────────────────── */

.battleship-wrapper {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  width: 100%;
  height: 100%;
  padding: 12px;
  gap: 12px;
  overflow-y: auto;
  user-select: none;
}

/* ── grid primitive ─────────────────────────────────────────────────────── */

.bs-grid {
  display: grid;
  gap: 3px;
  padding: 8px;
  background: rgba(10,16,40,.8);
  border: 1px solid rgba(126,242,255,.3);
  border-radius: 12px;
  box-shadow: inset 0 2px 10px rgba(0,0,0,.5), 0 0 20px rgba(33,150,243,.12);
  width: fit-content;
}

.bs-cell {
  width: 40px;
  height: 40px;
  background: rgba(26,34,66,.95);
  border-radius: 6px;
  border: 1px solid rgba(255,255,255,.07);
  position: relative;
  transition: background 0.12s, box-shadow 0.12s;
}

.bs-grid-dimmed .bs-cell {
  background: rgba(16,20,40,.8);
  opacity: 0.55;
}

.bs-grid-active.bs-grid-opp .bs-cell:not(.bs-cell-shot-disabled):hover {
  background: rgba(33,150,243,.35);
  cursor: crosshair;
  box-shadow: inset 0 0 0 2px var(--neon-cyan), 0 0 12px rgba(33,150,243,.4);
}

.bs-grid-inactive { opacity: 0.6; filter: grayscale(0.35); }

/* Own ships visible */
.bs-cell.bs-cell-ship {
  background: linear-gradient(135deg, rgba(126,242,255,.75), rgba(33,150,243,.85));
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.35), 0 0 10px rgba(126,242,255,.35);
}
.bs-cell.bs-cell-ship-pickup { cursor: grab; }
.bs-cell.bs-cell-ship-pickup:active { cursor: grabbing; }

/* Drag ghost — green when placement valid, red when invalid */
.bs-cell.bs-cell-ghost-valid {
  background: rgba(76,217,100,.55);
  box-shadow: inset 0 0 0 2px #4cd964, 0 0 12px rgba(76,217,100,.4);
}
.bs-cell.bs-cell-ghost-invalid {
  background: rgba(255,82,82,.5);
  box-shadow: inset 0 0 0 2px #ff5252, 0 0 12px rgba(255,82,82,.4);
}

/* Shot markers */
.bs-cell.bs-cell-miss::after {
  content: '';
  position: absolute;
  inset: 0;
  margin: auto;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: rgba(255,255,255,.45);
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  box-shadow: 0 0 6px rgba(255,255,255,.4);
}
.bs-cell.bs-cell-hit::after {
  content: '✕';
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #ff6b6b;
  font-weight: 700;
  font-size: 22px;
  text-shadow: 0 0 10px rgba(255,82,82,.8);
}
/* One-shot impact flash added by onEvent('SHOT_FIRED') only, never by
   the state-driven paint loop — keeps the animation from replaying on
   every update tick. */
.bs-cell.bs-cell-hit-flash::after { animation: bsImpact 0.2s ease-out; }
@keyframes bsImpact {
  0%   { transform: scale(1.8); opacity: 0; }
  60%  { transform: scale(0.85); opacity: 1; }
  100% { transform: scale(1); opacity: 1; }
}

/* Sunk: persistent ship outline + faint red wash */
.bs-cell.bs-cell-sunk {
  background: rgba(127,29,29,.85);
  box-shadow: inset 0 0 0 1px #fca5a5, 0 0 10px rgba(255,82,82,.3);
}
.bs-cell.bs-cell-sunk-flash { animation: bsSunkFlash 1s ease-out; }
@keyframes bsSunkFlash {
  0%   { background: #fef08a; }
  100% { background: rgba(127, 29, 29, 0.85); }
}

.bs-cell.bs-cell-shot-disabled { cursor: default; }

/* ── section labels ─────────────────────────────────────────────────────── */

.bs-section-label {
  margin: 0 0 6px;
  font-size: 13px;
  letter-spacing: 0.08em;
  color: var(--text-muted);
}

/* ── setup phase (布阵阶段) ──────────────────────────────────────────────── */

.bs-setup {
  display: grid;
  grid-template-columns: auto 300px;
  gap: 24px;
  align-items: start;
  justify-content: center;
}

.bs-setup-col { display: flex; flex-direction: column; }

.bs-setup-status {
  margin-top: 10px;
  font-size: 14px;
  color: var(--text);
  min-height: 20px;
}

.bs-ready-btn {
  margin-top: 10px;
  width: fit-content;
  padding: 12px 28px;
  font-weight: 600;
}

.bs-unplaced-panel {
  display: flex;
  flex-direction: column;
  gap: 6px;
  background: rgba(255,255,255,.06);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 10px;
  margin-bottom: 16px;
}

.bs-hint {
  margin: 0 0 8px;
  font-size: 11px;
  color: var(--text-muted);
  font-style: italic;
}

.bs-unplaced-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 6px 8px;
  border-radius: 8px;
  cursor: grab;
  transition: background 0.12s;
}
.bs-unplaced-row:hover { background: rgba(255,255,255,.08); }
.bs-unplaced-row.bs-unplaced-placing { opacity: 0.55; cursor: default; }
.bs-unplaced-row:active { cursor: grabbing; }

.bs-ship-preview { display: flex; gap: 2px; }
.bs-ship-seg {
  width: 16px;
  height: 16px;
  background: var(--ship-color, var(--accent));
  border-radius: 4px;
  box-shadow: 0 0 6px rgba(126,242,255,.35);
}

.bs-ship-label { font-size: 13px; color: var(--text); font-weight: 500; }
.bs-ship-placing { margin-left: auto; font-size: 11px; color: var(--text-muted); font-style: italic; }

.bs-opp-placeholder { position: relative; }
.bs-opp-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 8px;
  background: rgba(8,12,32,.78);
  color: var(--text);
  font-size: 13px;
  border-radius: 12px;
  backdrop-filter: blur(3px);
  -webkit-backdrop-filter: blur(3px);
}

/* ── firing phase (射击阶段) ─────────────────────────────────────────────── */

.bs-firing {
  display: grid;
  grid-template-columns: auto auto;
  gap: 24px;
  align-items: start;
  justify-content: center;
}

.bs-firing-col { display: flex; flex-direction: column; }

.bs-firing-status {
  margin-bottom: 6px;
  font-size: 13px;
  color: var(--text-muted);
  min-height: 18px;
}

/* ── game-over banner ───────────────────────────────────────────────────── */

.bs-game-over {
  grid-column: 1 / -1;
  margin-top: 12px;
  padding: 18px;
  background: rgba(255,255,255,.07);
  border: 1px solid var(--border);
  border-radius: 14px;
  text-align: center;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}
.bs-game-over-headline { font-size: 24px; font-weight: 700; color: var(--neon-gold); text-shadow: 0 0 16px rgba(255,215,0,.45); }
.bs-game-over-sub { margin-top: 6px; font-size: 13px; color: var(--text-muted); }

/* ── Risk board (风险/征服) ──────────────────────────────────────────────── */

.risk-wrapper {
  position: relative;
  width:    100%;
  height:   100%;
  display:  flex;
  align-items:     center;
  justify-content: center;
  background: radial-gradient(ellipse at 50% 40%, rgba(33,150,243,.08) 0%, transparent 60%), transparent;
  overflow:        hidden;
}

.risk-map-host {
  width:  100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.risk-map-host svg { max-width: 100%; max-height: 100%; }

.risk-map-host path {
  stroke:       rgba(126,242,255,.35);
  stroke-width: 1.2;
  transition:   fill 0.2s, stroke-width 0.15s, filter 0.15s;
}

.risk-map-host path.risk-mine {
  stroke:       #ffffff;
  stroke-width: 3.5;
  filter:       drop-shadow(0 0 5px rgba(126,242,255,.7));
}

.risk-map-host path:hover {
  stroke:       var(--neon-cyan);
  stroke-width: 3.2;
  filter:       brightness(1.22);
}

.risk-map-host path.risk-selected {
  stroke:       var(--neon-gold);
  stroke-width: 4;
  filter:       drop-shadow(0 0 10px rgba(255, 215, 0, 0.9)) brightness(1.2);
}

.risk-loading { color: var(--text-muted); font-style: italic; font-size: 14px; }

.risk-btn { margin-bottom: 6px; }

.risk-help { margin: 8px 0 0; font-size: 12px; color: var(--text-muted); }

/* ── turn-timer warning banner (回合倒计时警告) ───────────────────────────── */

.turn-warning {
  position: fixed;
  top: 16px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 1000;
  padding: 10px 18px;
  background: rgba(120,53,15,.92);
  color: #fff;
  border: 1px solid var(--warning);
  border-radius: 12px;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.45);
  font-size: 14px;
  font-weight: 500;
  pointer-events: none;
  max-width: calc(100vw - 32px);
  text-align: center;
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}

.turn-warning.turn-warning-me {
  background: rgba(153,27,27,.92);
  border-color: #f87171;
  animation: turnWarningPulse 1s ease-in-out infinite;
}

@keyframes turnWarningPulse {
  0%, 100% { box-shadow: 0 4px 14px rgba(0, 0, 0, 0.45); }
  50%      { box-shadow: 0 4px 18px rgba(248, 113, 113, 0.55), 0 4px 14px rgba(0, 0, 0, 0.45); }
}

/* ── The Game of Life (人生游戏) ─────────────────────────────────────────── */
/*
 * Life renderer 拆分在四个文件 (renderer / board-view / action-panel /
 * card-display), 这里按子视图归属分组。
 */

.life-wrapper {
  display: flex;
  flex-direction: row;
  gap: 12px;
  width: 100%;
  height: 100%;
  padding: 12px;
  box-sizing: border-box;
  overflow: auto;
}

.life-board-container {
  flex: 1 1 auto;
  min-width: 0;
  overflow: auto;
  background: rgba(255,255,255,.05);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 12px;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

.life-inventory-container {
  flex: 0 0 300px;
  overflow-y: auto;
  background: rgba(255,255,255,.05);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 12px;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

/* ── board grid ─────────────────────────────────────────────────────────── */

.life-board {
  display: grid;
  grid-template-columns: repeat(23, 64px);
  grid-template-rows: repeat(11, 56px);
  gap: 4px;
  position: relative;
  min-width: max-content;
}

.life-square {
  background: rgba(18,24,52,.85);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 4px;
  font-size: 10px;
  line-height: 1.1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  cursor: default;
  overflow: hidden;
  transition: outline-color 200ms ease, box-shadow 200ms ease;
  outline: 2px solid transparent;
  color: var(--text);
}

.life-square-icon { font-size: 14px; margin-bottom: 2px; }

.life-square-label {
  font-size: 9px;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  width: 100%;
}

/* Square-type accents — 霓虹微调色 */
.life-square-payday               { background: rgba(76,217,100,.16); }
.life-square-collect-bank         { background: rgba(76,217,100,.12); }
.life-square-pay-bank             { background: rgba(255,82,82,.14); }
.life-square-pay-tax-by-salary    { background: rgba(255,82,82,.14); }
.life-square-pay-loans            { background: rgba(255,82,82,.14); }
.life-square-pay-each-player      { background: rgba(255,82,82,.14); }
.life-square-collect-each-player  { background: rgba(76,217,100,.12); }
.life-square-spin-again           { background: rgba(126,242,255,.12); }
.life-square-marry                { background: rgba(255,157,213,.14); }
.life-square-have-baby            { background: rgba(255,157,213,.14); }
.life-square-have-twins           { background: rgba(255,157,213,.14); }
.life-square-buy-house            { background: rgba(255,179,0,.12); }
.life-square-auto-accident        { background: rgba(255,82,82,.16); }
.life-square-life-accident        { background: rgba(255,82,82,.16); }
.life-square-career-fork          { background: rgba(160,160,190,.2); font-weight: bold; }
.life-square-draw-career-no-degree { background: rgba(41,182,246,.14); }
.life-square-draw-career-degree   { background: rgba(41,182,246,.14); }
.life-square-retirement-fork      { background: rgba(255,179,0,.18); font-weight: bold; }
.life-square-countryside-retirement { background: rgba(76,217,100,.18); font-weight: bold; }
.life-square-millionaire-retirement { background: rgba(255,215,0,.2); font-weight: bold; }

/* Active player's "you are here, decide now" emphasis. */
.life-square-highlight {
  outline: 2px solid var(--neon-gold);
  box-shadow: 0 0 0 2px rgba(255,215,0,.35), 0 0 16px rgba(255,215,0,.25);
}

/* ── player cars ────────────────────────────────────────────────────────── */

.life-car {
  width: 28px;
  height: 22px;
  border-radius: 6px;
  border: 2px solid #222;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  color: #fff;
  text-shadow: 0 1px 1px rgba(0, 0, 0, 0.6);
  pointer-events: none;
  align-self: center;
  justify-self: center;
  position: relative;
  box-shadow: 0 1px 5px rgba(0,0,0,.5), 0 0 8px rgba(255,255,255,.15);
}

.life-car-stepping { transition: all 140ms cubic-bezier(0.4, 0.0, 0.2, 1); }
.life-car-token { display: inline-block; }

.life-car-pegs {
  position: absolute;
  bottom: -4px;
  left: 50%;
  transform: translateX(-50%);
  font-size: 7px;
  color: #fff;
  white-space: nowrap;
}

.life-car-me { box-shadow: 0 0 0 2px #f8c43c, 0 1px 4px rgba(0, 0, 0, 0.4), 0 0 12px rgba(248,196,60,.4); }
.life-car-retired { opacity: 0.45; filter: grayscale(0.6); }

.life-car-retired-badge {
  position: absolute;
  top: -8px;
  right: -8px;
  background: #48bb78;
  color: #fff;
  border-radius: 50%;
  width: 14px;
  height: 14px;
  font-size: 10px;
  line-height: 14px;
  text-align: center;
  font-weight: bold;
}

/* ── inventory panel (我的卡牌) ─────────────────────────────────────────── */

.life-inventory { font-size: 12px; }

.life-my-card {
  background: rgba(255,255,255,.05);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 10px;
  margin-bottom: 12px;
}

.life-card-name { margin: 0 0 8px 0; font-size: 14px; color: var(--text); }

.life-card-row {
  display: flex;
  justify-content: space-between;
  padding: 3px 0;
  border-bottom: 1px dashed rgba(255,255,255,.08);
  font-size: 11px;
  color: var(--text);
}
.life-card-row:last-child { border-bottom: none; }

.life-card-row label {
  color: var(--text-muted);
  font-weight: 600;
  letter-spacing: 0.04em;
  font-size: 10px;
}
.life-card-row span, .life-card-row strong { color: var(--text); }

.life-card-tiles { flex-direction: column; align-items: flex-start; gap: 4px; }

.life-tiles-stack { display: flex; flex-wrap: wrap; gap: 3px; }

.life-tile-face-down {
  display: inline-block;
  background: rgba(33,150,243,.25);
  border: 1px solid rgba(126,242,255,.4);
  border-radius: 6px;
  padding: 2px 6px;
  font-size: 11px;
  color: var(--neon-cyan);
  text-shadow: 0 0 6px rgba(126,242,255,.5);
}

.life-retired-tag {
  margin-top: 8px;
  background: rgba(72,187,120,.2);
  color: #7ef0a8;
  border: 1px solid rgba(72,187,120,.4);
  border-radius: 99px;
  padding: 3px 8px;
  font-size: 11px;
  text-align: center;
  font-weight: bold;
}

.life-opponents h4 {
  font-size: 12px;
  margin: 0 0 6px 0;
  letter-spacing: 0.04em;
  color: var(--text-muted);
}

.life-opp-row {
  display: grid;
  grid-template-columns: 12px 1fr auto;
  gap: 6px;
  align-items: center;
  padding: 5px 6px;
  background: rgba(255,255,255,.05);
  border: 1px solid var(--border);
  border-radius: 10px;
  margin-bottom: 4px;
}

.life-opp-dot { width: 10px; height: 10px; border-radius: 50%; border: 1px solid rgba(0, 0, 0, 0.3); box-shadow: 0 0 5px rgba(255,255,255,.3); }
.life-opp-name { font-size: 12px; }

.life-opp-retired {
  display: inline-block;
  margin-left: 6px;
  background: rgba(72,187,120,.2);
  color: #7ef0a8;
  font-size: 9px;
  padding: 1px 5px;
  border-radius: 99px;
}

.life-opp-cash { font-weight: bold; font-size: 11px; color: var(--neon-gold); }
.life-opp-meta { grid-column: 1 / -1; font-size: 10px; color: var(--text-muted); }

/* ── action panel: spinner (转盘) ───────────────────────────────────────── */

.life-spinner-box { position: relative; width: 150px; height: 150px; margin: 0 auto 12px auto; }

.life-spinner-wheel {
  width: 150px;
  height: 150px;
  border-radius: 50%;
  background: radial-gradient(circle at center, #2a2a4a, #141430);
  border: 3px solid var(--neon-gold);
  box-shadow: 0 0 24px rgba(255,215,0,.25);
  position: relative;
  transition: transform 1.5s cubic-bezier(0.05, 0.6, 0.3, 1);
}

.life-spinner-seg {
  position: absolute;
  top: 0;
  left: 50%;
  width: 0;
  height: 75px;
  border-left: 0;
  transform-origin: 50% 100%;
}

.life-spinner-num {
  position: absolute;
  top: 8px;
  left: -8px;
  width: 16px;
  text-align: center;
  font-size: 13px;
  font-weight: bold;
  color: #fff;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.6);
}

.life-spinner-pointer {
  position: absolute;
  top: -10px;
  left: 50%;
  transform: translateX(-50%);
  width: 0;
  height: 0;
  border-left: 12px solid transparent;
  border-right: 12px solid transparent;
  border-top: 20px solid #e94235;
  filter: drop-shadow(0 2px 3px rgba(0, 0, 0, 0.6));
  z-index: 2;
}

/* ── action panel: buttons + messages ──────────────────────────────────── */

.life-actions { display: flex; flex-direction: column; gap: 8px; }

.life-actions-message {
  font-size: 12px;
  color: var(--text-muted);
  text-align: center;
  padding: 12px 0;
  margin: 0;
}

.life-spin-btn { font-size: 16px; padding: 12px; min-height: 52px; }
.life-purchase-btn { font-size: 12px; padding: 8px; }

.life-card-choice {
  text-align: left;
  font-size: 12px;
  padding: 10px;
  line-height: 1.3;
}
.life-card-choice small { display: block; color: var(--text-muted); margin-top: 2px; font-size: 10px; }

.life-fork-choice { font-size: 14px; padding: 12px; }

.life-retirement-banner {
  background: linear-gradient(135deg, rgba(255,179,0,.22), rgba(76,217,100,.16));
  border: 1px solid rgba(255,215,0,.4);
  border-radius: 12px;
  padding: 10px;
  font-size: 11px;
  margin-bottom: 8px;
  line-height: 1.4;
  color: #fff;
}
.life-retirement-banner strong { display: block; font-size: 13px; margin-bottom: 4px; color: var(--neon-gold); }

.life-retirement-choice { font-size: 16px; padding: 16px; font-weight: bold; }

.life-stock-grid { display: grid; grid-template-columns: repeat(5, 1fr); gap: 4px; margin: 8px 0; }
.life-stock-cell { padding: 10px; font-size: 14px; font-weight: bold; min-height: 44px; }

/* ── game over panel ───────────────────────────────────────────────────── */

.life-game-over { margin-top: 16px; background: rgba(255,255,255,.05); border: 1px solid rgba(255,215,0,.4); border-radius: 12px; padding: 12px; }

.life-game-over h3 { margin: 0 0 12px 0; text-align: center; color: var(--neon-gold); }

.life-score-row {
  background: rgba(255,255,255,.05);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 10px;
  margin-bottom: 8px;
}

.life-score-row h4 { margin: 0 0 6px 0; font-size: 14px; }
.life-score-line { font-size: 11px; color: var(--text-muted); padding: 2px 0; }
.life-score-total { margin-top: 6px; padding-top: 6px; border-top: 1px solid var(--border); font-size: 13px; }
.life-score-total strong { color: var(--neon-gold); }
.life-score-melost { opacity: 0.7; }
.life-melost-note { color: #e94235; font-size: 10px; }
.life-winner-badge { margin-right: 6px; }

.life-tile-reveal-row { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 6px; }

.life-tile-revealed {
  display: inline-block;
  background: rgba(76,217,100,.14);
  border: 1px solid rgba(76,217,100,.4);
  border-radius: 8px;
  padding: 4px 6px;
  font-size: 10px;
  line-height: 1.2;
  color: var(--text);
}

@keyframes lifeTileFlipIn {
  from { transform: rotateY(180deg) scale(0.5); opacity: 0; }
  to   { transform: rotateY(0deg)   scale(1);   opacity: 1; }
}

.life-tile-flip-in { animation: lifeTileFlipIn 350ms cubic-bezier(0.2, 0.7, 0.2, 1) both; }

.life-tile-list { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 6px; }

/* Responsive: stack inventory below the board on narrow viewports. */
@media (max-width: 1100px) {
  .life-wrapper { flex-direction: column; }
  .life-inventory-container { flex: 1 1 auto; width: 100%; }
}

/* ── scrollbar styling ────────────────────────────────────────────────────── */

::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-track { background: rgba(255,255,255,.04); }
::-webkit-scrollbar-thumb { background: rgba(126,242,255,.35); border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: rgba(126,242,255,.55); }

/* ── ── ── ── ── ── ── ── ── ── ── ── ── ── ── ── ── ── ── ── ── ── ── ── ──
   SPECTATOR MODE (观战模式)
── ── ── ── ── ── ── ── ── ── ── ── ── ── ── ── ── ── ── ── ── ── ── ── ── */

#spectator-banner {
  align-items: center;
  justify-content: center;
  padding: 8px 16px;
  background: linear-gradient(90deg, rgba(126,242,255,.12), rgba(255,157,213,.1));
  border-bottom: 1px solid var(--neon-cyan);
  color: var(--text);
  font-size: 13px;
}
.spectator-banner-text { letter-spacing: 0.3px; }

/* ── ── ── ── ── ── ── ── ── ── ── ── ── ── ── ── ── ── ── ── ── ── ── ── ──
   HELP OVERLAY (帮助弹层, 由 help-system.js 使用)
── ── ── ── ── ── ── ── ── ── ── ── ── ── ── ── ── ── ── ── ── ── ── ── ── */

.help-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: rgba(255,255,255,.08);
  border: 1px solid var(--border-strong);
  color: var(--text-muted);
  font-weight: 700;
  font-size: 13px;
  cursor: pointer;
  padding: 0;
  margin-left: 6px;
  transition: background 0.15s, color 0.15s, border-color 0.15s, box-shadow 0.15s;
}
.help-btn:hover {
  background: rgba(33,150,243,.25);
  color: var(--text);
  border-color: var(--neon-cyan);
  box-shadow: 0 0 12px rgba(33,150,243,.4);
}

.game-type-row { display: flex; align-items: center; gap: 6px; }
.game-type-row select { flex: 1; }

.game-type-description {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 6px;
  min-height: 16px;
}

.game-card .help-btn {
  width: 22px;
  height: 22px;
  font-size: 11px;
  margin-left: 4px;
}

.help-overlay {
  position: fixed;
  inset: 0;
  background: rgba(5,6,18,.75);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  align-items: center;
  justify-content: center;
  z-index: 2000;
}
.help-overlay-content {
  width: min(80vw, 760px);
  height: 80vh;
  background: rgba(15,16,40,.95);
  border: 1px solid var(--border);
  border-radius: 16px;
  box-shadow: 0 20px 60px rgba(0,0,0,.6), inset 0 1px 0 rgba(255,255,255,.06);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.help-overlay-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 20px;
  border-bottom: 1px solid var(--border);
  background: rgba(255,255,255,.06);
  flex-shrink: 0;
}
.help-overlay-title { font-size: 16px; color: var(--text); }
.help-overlay-close {
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 18px;
  cursor: pointer;
  padding: 4px 8px;
  border-radius: 8px;
  transition: background .15s, color .15s;
}
.help-overlay-close:hover { background: rgba(255,255,255,.1); color: var(--text); }

.help-overlay-body {
  flex: 1;
  overflow-y: auto;
  padding: 20px 28px;
  color: var(--text);
  line-height: 1.55;
}
.help-overlay-body h1 { font-size: 22px; margin: 4px 0 14px; color: var(--neon-cyan); }
.help-overlay-body h2 { font-size: 18px; margin: 22px 0 8px; color: var(--neon-gold); border-bottom: 1px solid var(--border); padding-bottom: 4px; }
.help-overlay-body h3 { font-size: 16px; margin: 18px 0 6px; color: var(--text); }
.help-overlay-body h4 { font-size: 14px; margin: 14px 0 4px; color: var(--text-muted); letter-spacing: 0.5px; }
.help-overlay-body p  { margin: 0 0 10px; }
.help-overlay-body ul,
.help-overlay-body ol { margin: 0 0 12px 22px; }
.help-overlay-body li { margin-bottom: 4px; }
.help-overlay-body strong { color: var(--text); }
.help-overlay-body em     { color: var(--text-muted); font-style: italic; }
.help-overlay-body hr { border: none; border-top: 1px solid var(--border); margin: 18px 0; }

.help-overlay-body .help-table {
  border-collapse: collapse;
  width: 100%;
  margin: 10px 0 16px;
  font-size: 13px;
}
.help-overlay-body .help-table th,
.help-overlay-body .help-table td {
  border: 1px solid var(--border);
  padding: 6px 10px;
  text-align: left;
}
.help-overlay-body .help-table th { background: rgba(33,150,243,.15); color: var(--text); }
.help-overlay-body .help-loading,
.help-overlay-body .help-error { color: var(--text-muted); text-align: center; padding: 40px 0; }
.help-overlay-body .help-error { color: var(--danger); }

@media (max-width: 700px) {
  .help-overlay-content { width: 95vw; height: 90vh; }
  .help-overlay-body { padding: 16px 18px; }
}

/* ── Checkers board (国际跳棋) ───────────────────────────────────────────── */

.checkers-wrapper {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
  padding: 16px;
  gap: 8px;
}

.ck-capture-banner {
  background: rgba(255,179,0,.14);
  border: 1px solid var(--warning);
  color: var(--warning);
  font-size: 13px;
  font-weight: 600;
  padding: 8px 14px;
  border-radius: 12px;
  text-align: center;
  box-shadow: 0 0 14px rgba(255,179,0,.2);
}

.ck-grid {
  display: grid;
  gap: 0;
  border-radius: 12px;
  overflow: hidden;
  border: 1px solid rgba(126,242,255,.3);
  box-shadow: 0 0 30px rgba(33,150,243,.15), 0 4px 16px rgba(0, 0, 0, 0.5);
  width: fit-content;
}

.ck-cell {
  width: 62px;
  height: 62px;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
}

.ck-light { background: rgba(126,242,255,.25); }
.ck-dark  { background: rgba(10,16,40,.9); }

/* ── pieces (棋子) ───────────────────────────────────────────────────────── */

.ck-piece {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1;
  transition: box-shadow 0.2s, transform 0.2s;
}

.ck-piece-red {
  background: radial-gradient(circle at 35% 35%, #ff7eb6, #c2185b);
  border: 2px solid #880e4f;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.4), 0 0 10px rgba(255,126,182,.35), inset 0 1px 2px rgba(255, 255, 255, 0.25);
}

.ck-piece-black {
  background: radial-gradient(circle at 35% 35%, #7ef2ff, #0d47a1);
  border: 2px solid #01579b;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.4), 0 0 10px rgba(126,242,255,.3), inset 0 1px 2px rgba(255, 255, 255, 0.2);
}

.ck-crown {
  font-size: 20px;
  line-height: 1;
  filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.5));
  pointer-events: none;
}

/* ── selection & eligibility highlights ──────────────────────────────────── */

.ck-eligible {
  box-shadow: 0 0 0 3px rgba(126,242,255,.55), 0 0 14px rgba(126,242,255,.4), 0 2px 6px rgba(0, 0, 0, 0.4);
  cursor: pointer;
}

.ck-capture-eligible {
  box-shadow: 0 0 0 3px rgba(255,179,0,.75), 0 0 14px rgba(255,179,0,.45), 0 2px 6px rgba(0, 0, 0, 0.4);
  animation: ck-pulse 1.2s ease-in-out infinite;
  cursor: pointer;
}

.ck-selected {
  box-shadow: 0 0 0 4px var(--neon-cyan), 0 0 18px rgba(126,242,255,.6);
  transform: scale(1.08);
}

@keyframes ck-pulse {
  0%, 100% { box-shadow: 0 0 0 3px rgba(255,179,0,.75), 0 0 14px rgba(255,179,0,.45), 0 2px 6px rgba(0,0,0,.4); }
  50%      { box-shadow: 0 0 0 5px rgba(255,179,0,.95), 0 0 18px rgba(255,179,0,.6), 0 2px 6px rgba(0,0,0,.4); }
}

/* ── destination markers ─────────────────────────────────────────────────── */

.ck-dest::after,
.ck-dest-capture::after {
  content: '';
  position: absolute;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  pointer-events: none;
  z-index: 2;
}

.ck-dest { background: rgba(76,217,100,.18); }
.ck-dest::after { background: rgba(76,217,100,.55); box-shadow: 0 0 10px rgba(76,217,100,.5); }
.ck-dest-capture { background: rgba(255,179,0,.18); }
.ck-dest-capture::after { background: rgba(255,179,0,.65); box-shadow: 0 0 10px rgba(255,179,0,.5); }

/* ── move animation ──────────────────────────────────────────────────────── */

.ck-anim-moving {
  transition: transform 350ms cubic-bezier(0.25, 0.46, 0.45, 0.94);
  z-index: 10;
}

/* ── capture fade ────────────────────────────────────────────────────────── */

.ck-anim-fading { animation: ck-fade-out 400ms ease-out forwards; }

@keyframes ck-fade-out {
  0%   { transform: scale(1); opacity: 1; }
  30%  { transform: scale(1.15); opacity: 1; border-color: var(--danger); box-shadow: 0 0 12px var(--danger); }
  100% { transform: scale(0.5); opacity: 0; }
}

/* ── coronation animation ────────────────────────────────────────────────── */

.ck-anim-crowning { animation: ck-crown-pop 600ms ease-out; }
.ck-crown-anim { animation: ck-crown-fade-in 300ms ease-out; }

@keyframes ck-crown-pop {
  0%   { transform: scale(1); }
  40%  { transform: scale(1.2); }
  100% { transform: scale(1); }
}

@keyframes ck-crown-fade-in {
  0%   { opacity: 0; transform: scale(0.5); }
  100% { opacity: 1; transform: scale(1); }
}

/* ── responsive: narrow viewports ────────────────────────────────────────── */

@media (max-width: 900px) {
  .game-sidebar { width: 250px; }
  :root {
    --board-size: min(calc(100vw - 282px), calc(100vh - 86px), 960px);
  }
}

@media (max-width: 700px) {
  .game-layout { flex-direction: column; overflow-y: auto; }
  .game-sidebar { width: 100%; border-left: none; border-top: 1px solid var(--border); }
  :root {
    --board-size: min(calc(100vw - 32px), 480px);
  }
  .lobby-body { flex-direction: column; }
  .lobby-create { width: 100%; }
  .bs-setup { grid-template-columns: 1fr; justify-items: center; }
  .bs-firing { grid-template-columns: 1fr; justify-items: center; }
  .trade-columns { flex-direction: column; gap: 12px; }
  .trade-col-center { transform: rotate(90deg); align-self: center; }
}

/* 手机端 (<=480px) 紧凑 + 触摸目标 >= 44px */
@media (max-width: 480px) {
  html, body { font-size: 13px; }

  .auth-container { width: 92vw; padding: 28px 20px; }
  .auth-title { font-size: 26px; }

  .lobby-header { margin: 8px 10px 0; padding: 10px 14px; }
  .lobby-header .logo { font-size: 17px; }
  .lobby-body { padding: 14px; gap: 16px; }

  .waiting-card { min-width: 0; width: 92vw; padding: 24px 18px; }

  .game-header { padding: 8px 10px; flex-wrap: wrap; gap: 6px; }
  .game-header-right { width: 100%; justify-content: flex-end; }
  .btn, .btn-sm, .tab-btn, .action-btn, .collapsible-btn,
  .cf-col-btn, .help-btn, .yz-roll-btn, .life-spin-btn, .life-stock-cell {
    min-height: 44px;
  }

  .board-wrapper { padding: 10px; }

  .bs-cell { width: 34px; height: 34px; }
  .ttt-cell { width: 84px; height: 84px; font-size: 44px; }
  .cf-cell { width: 46px; height: 46px; }
  .ck-cell { width: 52px; height: 52px; }
  .ck-piece { width: 40px; height: 40px; }
  .yz-die { width: 56px; height: 56px; }
  .life-square { font-size: 9px; }

  .modal-content { width: 94vw; }
  .modal-wide { width: 96vw; }
  .game-log { height: 160px; }
  .chat-messages { height: 100px; }

  .bs-setup { gap: 16px; }
  .bs-firing { gap: 16px; }
}
