/* ==========================================================================
   PARTY HUB - 精品现代设计系统 (Crafted Modern UI System)
   ========================================================================== */

/* --------------------------------------------------------------------------
   1. 设计变量体系 (Design Tokens)
   -------------------------------------------------------------------------- */

:root,
[data-theme="dark"] {
  --theme-mode: 'dark';

  /* 核心主色 (Electric Indigo) */
  --primary: #6366F1;
  --primary-hover: #4F46E5;
  --primary-active: #4338CA;
  --primary-subtle: rgba(99, 102, 241, 0.12);
  --primary-glow: rgba(99, 102, 241, 0.25);

  /* 语义辅助色 */
  --success: #10B981;
  --success-subtle: rgba(16, 185, 129, 0.12);
  --danger: #EF4444;
  --danger-subtle: rgba(239, 68, 68, 0.12);
  --warning: #F59E0B;
  --warning-subtle: rgba(245, 158, 11, 0.12);
  --info: #3B82F6;

  /* 深色背景阶梯 (深邃石墨基底) */
  --bg-base: #090A0F;
  --bg-sub: #11131A;
  --bg-surface: #181B24;
  --bg-surface-hover: #222634;
  --bg-card: rgba(24, 27, 36, 0.85);
  --bg-input: #11131A;
  --bg-pill: rgba(255, 255, 255, 0.05);
  --bg-backdrop: rgba(0, 0, 0, 0.7);

  /* 文字与边框 */
  --text-main: #F1F5F9;
  --text-sub: #94A3B8;
  --text-muted: #64748B;

  --border: rgba(255, 255, 255, 0.08);
  --border-subtle: rgba(255, 255, 255, 0.04);
  --border-strong: rgba(255, 255, 255, 0.14);
  --border-focus: #6366F1;

  /* 阴影层级 */
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.4);
  --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.35);
  --shadow-lg: 0 12px 32px -4px rgba(0, 0, 0, 0.5);

  --canvas-bg: #FFFFFF;
  --canvas-border: #222634;
}

[data-theme="light"] {
  --theme-mode: 'light';

  /* 核心主色 (Deep Royal Indigo) */
  --primary: #4F46E5;
  --primary-hover: #4338CA;
  --primary-active: #3730A3;
  --primary-subtle: rgba(79, 70, 229, 0.08);
  --primary-glow: rgba(79, 70, 229, 0.16);

  /* 语义辅助色 */
  --success: #059669;
  --success-subtle: rgba(5, 150, 105, 0.08);
  --danger: #E11D48;
  --danger-subtle: rgba(225, 29, 72, 0.08);
  --warning: #D97706;
  --warning-subtle: rgba(217, 119, 6, 0.08);
  --info: #2563EB;

  /* 浅色背景阶梯 (冷珍珠白基底) */
  --bg-base: #F8FAFC;
  --bg-sub: #F1F5F9;
  --bg-surface: #FFFFFF;
  --bg-surface-hover: #F8FAFC;
  --bg-card: rgba(255, 255, 255, 0.95);
  --bg-input: #F8FAFC;
  --bg-pill: rgba(0, 0, 0, 0.04);
  --bg-backdrop: rgba(15, 23, 42, 0.4);

  /* 文字与边框 */
  --text-main: #0F172A;
  --text-sub: #475569;
  --text-muted: #94A3B8;

  --border: rgba(0, 0, 0, 0.08);
  --border-subtle: rgba(0, 0, 0, 0.04);
  --border-strong: rgba(0, 0, 0, 0.12);
  --border-focus: #4F46E5;

  /* 阴影层级 */
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.04);
  --shadow-md: 0 4px 12px -2px rgba(0, 0, 0, 0.06);
  --shadow-lg: 0 12px 28px -4px rgba(0, 0, 0, 0.08);

  --canvas-bg: #FFFFFF;
  --canvas-border: #E2E8F0;
}

/* --------------------------------------------------------------------------
   2. 全局重置与排版体系
   -------------------------------------------------------------------------- */

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
  user-select: none;
  font-family: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  transition: background-color 0.18s ease, border-color 0.18s ease, box-shadow 0.18s ease;
}

input, textarea {
  user-select: text;
}

html, body {
  width: 100%;
  height: 100%;
  height: 100dvh;
  overflow: hidden;
  background-color: var(--bg-base);
  color: var(--text-main);
  position: fixed;
  -webkit-font-smoothing: antialiased;
}

/* 动效画布 */
.confetti-canvas, .reaction-container {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 1000;
}

.floating-emoji {
  position: absolute;
  font-size: 2.2rem;
  animation: floatUp 2.4s ease-out forwards;
  pointer-events: none;
}

@keyframes floatUp {
  0% { transform: translateY(0) scale(0.6); opacity: 0; }
  15% { transform: translateY(-20px) scale(1.1); opacity: 1; }
  80% { opacity: 0.9; }
  100% { transform: translateY(-200px) scale(1); opacity: 0; }
}

.screen {
  display: none;
  width: 100%;
  height: 100%;
  height: 100dvh;
}

.screen.active {
  display: flex;
}

.icon-svg {
  width: 16px;
  height: 16px;
  display: inline-block;
  vertical-align: middle;
}

.icon-svg-sm {
  width: 14px;
  height: 14px;
  display: inline-block;
  vertical-align: middle;
}

/* --------------------------------------------------------------------------
   3. 通用控件与按钮 (Buttons & Controls)
   -------------------------------------------------------------------------- */

input[type="text"], select {
  width: 100%;
  padding: 8px 12px;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: 6px;
  color: var(--text-main);
  font-size: 0.88rem;
  font-weight: 500;
  outline: none;
  transition: all 0.15s ease;
}

input[type="text"]:focus, select:focus {
  border-color: var(--border-focus);
  box-shadow: 0 0 0 2.5px var(--primary-subtle);
  background: var(--bg-surface);
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  font-weight: 600;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  padding: 8px 16px;
  font-size: 0.88rem;
  color: #fff;
  transition: all 0.15s ease;
  letter-spacing: -0.01em;
}

.btn-primary {
  background: var(--primary);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1), inset 0 1px 0 rgba(255, 255, 255, 0.18);
}
.btn-primary:hover {
  background: var(--primary-hover);
  box-shadow: 0 4px 14px var(--primary-glow), inset 0 1px 0 rgba(255, 255, 255, 0.18);
  transform: translateY(-1px);
}
.btn-primary:active {
  background: var(--primary-active);
  transform: translateY(0);
}

.btn-secondary {
  background: var(--bg-sub);
  color: var(--text-main);
  border: 1px solid var(--border);
}
.btn-secondary:hover {
  background: var(--bg-surface-hover);
  border-color: var(--border-strong);
}

.btn-subtle {
  background: var(--bg-pill);
  color: var(--text-sub);
  border: 1px solid var(--border);
}
.btn-subtle:hover {
  color: var(--text-main);
  border-color: var(--border-strong);
}

.btn-success { background: var(--success); }
.btn-danger { background: var(--danger); }

.btn-block { width: 100%; }
.btn-lg { padding: 11px 18px; font-size: 0.94rem; border-radius: 8px; }
.btn-sm { padding: 5px 10px; font-size: 0.8rem; border-radius: 5px; }

.icon-btn {
  background: var(--bg-pill);
  border: 1px solid var(--border);
  color: var(--text-sub);
  width: 32px;
  height: 32px;
  border-radius: 6px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}
.icon-btn:hover {
  color: var(--text-main);
  border-color: var(--border-strong);
}

/* --------------------------------------------------------------------------
   4. 登录界面 (Login Screen)
   -------------------------------------------------------------------------- */

.theme-toggle-fixed {
  position: fixed;
  top: 16px;
  right: 16px;
  z-index: 100;
}

.theme-switch-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 999px;
  color: var(--text-sub);
  font-size: 0.78rem;
  font-weight: 600;
  cursor: pointer;
}
.theme-switch-btn:hover {
  color: var(--text-main);
  border-color: var(--border-strong);
}

.login-wrapper {
  display: flex;
  justify-content: center;
  align-items: center;
  width: 100%;
  height: 100%;
  padding: 20px;
  background: radial-gradient(circle at 50% 15%, var(--primary-subtle) 0%, transparent 60%);
}

.login-card {
  background: var(--bg-card);
  backdrop-filter: blur(20px);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 32px 28px;
  width: 100%;
  max-width: 380px;
  box-shadow: var(--shadow-lg);
  text-align: center;
}

.brand-header {
  margin-bottom: 22px;
}

.brand-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 3px 10px;
  background: var(--primary-subtle);
  border-radius: 999px;
  color: var(--primary);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  margin-bottom: 10px;
}

.pulse-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--primary);
}

.brand-title {
  font-size: 1.45rem;
  font-weight: 700;
  color: var(--text-main);
  letter-spacing: -0.02em;
  margin-bottom: 4px;
}

.brand-subtitle {
  font-size: 0.82rem;
  color: var(--text-muted);
}

.avatar-section {
  margin-bottom: 20px;
}

.avatar-preview-box {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  cursor: pointer;
}

.avatar-display {
  font-size: 2.2rem;
  width: 64px;
  height: 64px;
  background: var(--bg-sub);
  border: 1.5px solid var(--border);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
}
.avatar-preview-box:hover .avatar-display {
  border-color: var(--primary);
}

.avatar-edit-label {
  font-size: 0.74rem;
  color: var(--text-muted);
  margin-top: 5px;
}

.avatar-picker-grid {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 6px;
  background: var(--bg-sub);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 8px;
  margin-top: 10px;
}

.avatar-item {
  font-size: 1.4rem;
  cursor: pointer;
  padding: 4px;
  border-radius: 6px;
}
.avatar-item:hover {
  background: var(--primary-subtle);
}

.login-form {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.input-field {
  text-align: left;
}

.input-field label {
  display: block;
  font-size: 0.76rem;
  font-weight: 600;
  color: var(--text-sub);
  margin-bottom: 4px;
}

/* --------------------------------------------------------------------------
   5. 房间 Header 顶栏
   -------------------------------------------------------------------------- */

#game-screen {
  flex-direction: column;
  width: 100%;
  height: 100%;
}

.game-header {
  background: var(--bg-card);
  backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border);
  padding: 8px 14px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-shrink: 0;
  z-index: 40;
}

.header-left, .header-right {
  display: flex;
  align-items: center;
  gap: 6px;
}

.room-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--bg-pill);
  border: 1px solid var(--border);
  padding: 3px 8px;
  border-radius: 6px;
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--text-main);
}

.room-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--success);
}

.game-tag {
  background: var(--primary-subtle);
  border: 1px solid var(--primary-subtle);
  color: var(--primary);
  font-size: 0.78rem;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: 6px;
  white-space: nowrap;
  flex-shrink: 0;
}

.round-counter {
  font-size: 0.76rem;
  color: var(--text-sub);
  padding: 0 4px;
}

.pill-btn {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: var(--bg-pill);
  border: 1px solid var(--border);
  color: var(--text-sub);
  font-size: 0.76rem;
  font-weight: 600;
  padding: 3px 8px;
  border-radius: 6px;
  cursor: pointer;
}
.pill-btn:hover {
  color: var(--text-main);
  border-color: var(--border-strong);
}

.timer-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: var(--warning-subtle);
  border: 1px solid var(--warning-subtle);
  color: var(--warning);
  font-size: 0.78rem;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: 6px;
}

.sub-status-bar {
  background: var(--bg-sub);
  border-bottom: 1px solid var(--border-subtle);
  padding: 4px 14px;
  font-size: 0.8rem;
}

.hint-container {
  display: flex;
  align-items: center;
  gap: 8px;
}

.category-indicator {
  background: var(--primary);
  color: #fff;
  font-size: 0.7rem;
  font-weight: 700;
  padding: 1px 6px;
  border-radius: 4px;
}

.hint-text {
  color: var(--text-sub);
  font-weight: 500;
  font-size: 0.8rem;
}

/* --------------------------------------------------------------------------
   6. 现代大厅控制台 (Lobby Console)
   -------------------------------------------------------------------------- */

.game-body {
  display: flex;
  flex-direction: column;
  flex: 1;
  overflow: hidden;
  position: relative;
}

.stage-section {
  flex: 1;
  display: flex;
  flex-direction: column;
  position: relative;
  overflow: hidden;
  padding: 8px;
  min-height: 0;
}

.lobby-card {
  width: 100%;
  height: 100%;
  overflow-y: auto;
  overflow-x: hidden;
  -webkit-overflow-scrolling: touch;
  display: flex;
  justify-content: center;
  align-items: flex-start;
  scrollbar-width: thin;
  padding-bottom: 56px;
}

.lobby-console {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 14px;
  width: 100%;
  max-width: 720px;
  box-shadow: var(--shadow-md);
  margin: 0 auto 16px;
}

.console-section-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
}

.section-title {
  display: flex;
  align-items: baseline;
  gap: 8px;
  font-size: 0.92rem;
  font-weight: 700;
  color: var(--text-main);
}

.count-hint {
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--text-muted);
}

.category-nav {
  display: flex;
  gap: 4px;
  background: var(--bg-sub);
  padding: 2px;
  border-radius: 6px;
  border: 1px solid var(--border-subtle);
}

.cat-pill {
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-size: 0.74rem;
  font-weight: 600;
  padding: 3px 8px;
  border-radius: 4px;
  cursor: pointer;
}
.cat-pill.active {
  background: var(--bg-surface);
  color: var(--text-main);
  box-shadow: var(--shadow-sm);
}

/* 12款游戏应用磁贴 (App Tiles) */
.game-tiles-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
  margin-bottom: 14px;
}

@media (max-width: 600px) {
  .game-tiles-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 6px;
  }
}

.game-tile {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 8px 10px;
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  position: relative;
  text-align: left;
  transition: all 0.15s ease;
}

.game-tile.tab-hidden {
  display: none !important;
}

.game-tile:hover {
  border-color: var(--border-strong);
  background: var(--bg-surface-hover);
}

.game-tile.active {
  border-color: var(--primary);
  background: var(--primary-subtle);
  box-shadow: 0 0 0 1px var(--primary);
}

.game-tile.active::after {
  content: '';
  position: absolute;
  top: 4px;
  right: 4px;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--primary);
}

.tile-icon-box {
  width: 32px;
  height: 32px;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.25rem;
  flex-shrink: 0;
  background: var(--bg-sub);
}

/* 专属低饱和色彩底 */
.bg-indigo { background: rgba(99, 102, 241, 0.15); }
.bg-cyan { background: rgba(6, 182, 212, 0.15); }
.bg-amber { background: rgba(245, 158, 11, 0.15); }
.bg-rose { background: rgba(244, 63, 94, 0.15); }
.bg-emerald { background: rgba(16, 185, 129, 0.15); }
.bg-orange { background: rgba(249, 115, 22, 0.15); }
.bg-blue { background: rgba(59, 130, 246, 0.15); }
.bg-violet { background: rgba(139, 92, 246, 0.15); }
.bg-teal { background: rgba(20, 184, 166, 0.15); }
.bg-red { background: rgba(239, 68, 68, 0.15); }
.bg-yellow { background: rgba(234, 179, 8, 0.15); }
.bg-purple { background: rgba(168, 85, 247, 0.15); }

.tile-content {
  min-width: 0;
  flex: 1;
}

.tile-title {
  font-size: 0.84rem;
  font-weight: 700;
  color: var(--text-main);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  letter-spacing: -0.01em;
}

.tile-meta {
  font-size: 0.68rem;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-top: 1px;
}

.game-tile.active .tile-title {
  color: var(--primary);
}

/* 访客展示卡片 */
.guest-game-display {
  margin-bottom: 12px;
}

.guest-showcase-card {
  display: flex;
  align-items: center;
  gap: 12px;
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 12px 14px;
}

.showcase-icon-box {
  width: 40px;
  height: 40px;
  border-radius: 8px;
  background: var(--primary-subtle);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
}

.showcase-info h4 {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--text-main);
}

.showcase-info p {
  font-size: 0.78rem;
  color: var(--text-muted);
  margin-top: 2px;
}

/* 参数与规则控制台面板 */
.settings-panel {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 12px;
  margin-bottom: 12px;
}

.settings-form-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(110px, 1fr));
  gap: 8px;
  margin-bottom: 8px;
}

.form-item label {
  display: block;
  font-size: 0.74rem;
  font-weight: 600;
  color: var(--text-sub);
  margin-bottom: 3px;
}

.rule-tip-bar {
  display: flex;
  align-items: baseline;
  gap: 6px;
  background: var(--bg-sub);
  padding: 6px 10px;
  border-radius: 6px;
  font-size: 0.76rem;
  line-height: 1.4;
}

.tip-label {
  color: var(--primary);
  font-weight: 700;
  flex-shrink: 0;
}

.tip-desc {
  color: var(--text-sub);
}

.checkbox-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 8px;
}

.check-box-item {
  display: flex;
  align-items: center;
  gap: 6px;
  background: var(--bg-sub);
  padding: 5px 8px;
  border-radius: 5px;
  font-size: 0.76rem;
  color: var(--text-sub);
  cursor: pointer;
}

.check-box-item input[type="checkbox"] {
  accent-color: var(--primary);
}

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

/* --------------------------------------------------------------------------
   7. 玩家侧边栏与列表 (Player Sidebar)
   -------------------------------------------------------------------------- */

.player-drawer {
  position: absolute;
  top: 0;
  left: 0;
  width: 250px;
  height: 100%;
  background: var(--bg-surface);
  border-right: 1px solid var(--border);
  z-index: 60;
  transform: translateX(-100%);
  transition: transform 0.22s ease;
  padding: 12px;
  display: flex;
  flex-direction: column;
}

.player-drawer.open {
  transform: translateX(0);
}

.drawer-backdrop {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: var(--bg-backdrop);
  z-index: 55;
  display: none;
}
.drawer-backdrop.open { display: block; }

.drawer-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 8px;
}

.drawer-title-group {
  display: flex;
  align-items: center;
  gap: 6px;
}

.drawer-title-group h3 {
  font-size: 0.88rem;
  font-weight: 700;
}

.count-pill {
  background: var(--bg-pill);
  font-size: 0.72rem;
  font-weight: 700;
  padding: 1px 6px;
  border-radius: 999px;
}

.btn-close {
  background: transparent;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
}

.player-list {
  list-style: none;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.player-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 6px 8px;
  background: var(--bg-sub);
  border: 1px solid var(--border-subtle);
  border-radius: 6px;
}

.player-item.is-me {
  border-color: var(--primary-subtle);
  background: var(--primary-subtle);
}

.player-item-left {
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
  flex: 1;
}

.p-avatar { font-size: 1.2rem; }
.p-name {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-main);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.p-score { font-size: 0.75rem; font-weight: 700; color: var(--warning); }

.badge-host {
  font-size: 0.65rem;
  background: #FBBF24;
  color: #78350F;
  font-weight: 700;
  padding: 1px 4px;
  border-radius: 3px;
}

/* --------------------------------------------------------------------------
   8. 游戏舞台通用规范
   -------------------------------------------------------------------------- */

.game-stage-container {
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

/* 画板 */
.draw-turn-banner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 6px 12px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 6px;
  margin-bottom: 6px;
  font-size: 0.86rem;
  font-weight: 700;
}

.draw-word-badge {
  background: var(--primary);
  color: #fff;
  padding: 2px 10px;
  border-radius: 4px;
  font-size: 0.86rem;
}

.canvas-wrapper {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 0;
}

.canvas-box {
  width: 100%;
  height: 100%;
  max-width: 680px;
  max-height: 460px;
  background: var(--canvas-bg);
  border: 1px solid var(--canvas-border);
  border-radius: 8px;
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  touch-action: none;
}

#game-canvas { width: 100%; height: 100%; display: block; }

.drawing-toolbar {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 6px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 6px;
  margin-top: 6px;
}

.color-palette {
  display: flex;
  gap: 6px;
  overflow-x: auto;
  padding: 2px;
}

.color-dot {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  cursor: pointer;
  flex-shrink: 0;
  border: 1px solid rgba(0,0,0,0.1);
}
.color-dot.active {
  transform: scale(1.15);
  outline: 2px solid var(--primary);
}

.toolbar-controls {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.brush-sizes, .action-tools { display: flex; gap: 4px; }
.btn-tool {
  background: var(--bg-sub);
  border: 1px solid var(--border);
  color: var(--text-main);
  border-radius: 4px;
  padding: 3px 8px;
  font-size: 0.8rem;
  cursor: pointer;
}
.btn-size.active {
  border-color: var(--primary);
  background: var(--primary-subtle);
}

.dot-preview { background: currentColor; border-radius: 50%; display: inline-block; }
.dot-3 { width: 3px; height: 3px; }
.dot-6 { width: 6px; height: 6px; }
.dot-12 { width: 10px; height: 10px; }
.dot-20 { width: 14px; height: 14px; }

/* 谁是卧底 */
.uc-secret-card-box { display: flex; justify-content: center; margin: 8px 0; }
.uc-secret-card {
  width: 100%;
  max-width: 320px;
  min-height: 110px;
  background: var(--primary);
  border-radius: 12px;
  padding: 14px;
  color: #fff;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  box-shadow: 0 8px 20px var(--primary-glow);
  transition: transform 0.15s ease;
}
.uc-secret-card:hover { transform: translateY(-2px); }
.uc-secret-card.masked .card-back { display: none; }
.uc-secret-card.masked .card-front { display: flex; flex-direction: column; align-items: center; }
.uc-secret-card:not(.masked) .card-front { display: none; }
.uc-secret-card:not(.masked) .card-back { display: flex; flex-direction: column; align-items: center; }
.card-word { font-size: 1.6rem; font-weight: 800; margin-top: 4px; letter-spacing: 0.05em; }

.uc-speaker-spotlight {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 10px 14px;
  margin-bottom: 10px;
  box-shadow: var(--shadow-sm);
}
.speaker-name { font-size: 0.95rem; font-weight: 800; color: var(--primary); }

.uc-player-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(105px, 1fr));
  gap: 8px;
}
.uc-player-card {
  background: var(--bg-card);
  border: 1.5px solid var(--border);
  border-radius: 10px;
  padding: 10px 8px;
  text-align: center;
  cursor: pointer;
  transition: all 0.15s ease;
  box-shadow: var(--shadow-xs);
}
.uc-player-card:hover {
  border-color: var(--primary);
  transform: translateY(-2px);
}
.uc-player-card.is-speaking {
  border-color: var(--primary);
  background: var(--primary-subtle);
  box-shadow: 0 0 0 2px var(--primary);
}
.uc-player-card.is-dead {
  opacity: 0.4;
  filter: grayscale(1);
  cursor: not-allowed;
}

/* 阿瓦隆 */
.avalon-hero-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 8px 10px;
  margin-bottom: 6px;
  font-size: 0.8rem;
}
.av-role-badge {
  background: var(--primary);
  color: #fff;
  font-weight: 700;
  font-size: 0.76rem;
  padding: 1px 6px;
  border-radius: 4px;
}
.avalon-quest-track {
  display: flex;
  gap: 6px;
  margin: 6px 0;
}
.quest-node {
  flex: 1;
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 4px 2px;
  text-align: center;
  font-size: 0.75rem;
}
.quest-node.current { border-color: var(--warning); }
.quest-node.success { background: var(--info); color: #fff; border-color: var(--info); }
.quest-node.fail { background: var(--danger); color: #fff; border-color: var(--danger); }

.av-player-cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(90px, 1fr));
  gap: 6px;
}
.av-p-card {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: 5px;
  padding: 6px;
  text-align: center;
  cursor: pointer;
  font-size: 0.8rem;
}
.av-p-card.is-selected {
  border-color: var(--primary);
  background: var(--primary-subtle);
}

/* UNO */
.uno-opponents-strip { display: flex; gap: 6px; overflow-x: auto; padding: 4px 0; }
.uno-table-center {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 20px;
}
.uno-card {
  width: 60px;
  height: 90px;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  font-weight: 800;
  color: #fff;
  border: 2px solid rgba(255, 255, 255, 0.8);
}
.uno-card.red, .bg-red { background: #EF4444; }
.uno-card.yellow, .bg-yellow { background: #FBBF24; color: #1E293B; }
.uno-card.green, .bg-green { background: #10B981; }
.uno-card.blue, .bg-blue { background: #3B82F6; }
.uno-card.wild { background: linear-gradient(135deg, #EF4444 25%, #3B82F6 25%, #3B82F6 50%, #FBBF24 50%, #FBBF24 75%, #10B981 75%); }

.uno-card-back {
  width: 60px;
  height: 90px;
  background: #181B24;
  border: 2px solid #fff;
  border-radius: 6px;
  color: #EF4444;
  font-weight: 800;
  font-size: 1rem;
  display: flex;
  align-items: center;
  justify-content: center;
}
.uno-hand-container { display: flex; gap: 4px; overflow-x: auto; padding: 6px 2px 2px; }

/* 其他各小游戏 */
/* 切披萨 (Perfect Slice) 专属舞台 */
.slice-arena {
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  gap: 10px;
  overflow: hidden;
  position: relative;
  user-select: none;
  -webkit-user-select: none;
}

.slice-header-info {
  display: flex;
  justify-content: center;
  align-items: center;
  flex-shrink: 0;
}

.slice-cut-prompt {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: rgba(15, 23, 42, 0.78);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid rgba(255, 255, 255, 0.12);
  padding: 6px 16px;
  border-radius: 999px;
  font-size: 0.84rem;
  font-weight: 600;
  color: #f1f5f9;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.25), inset 0 1px 0 rgba(255, 255, 255, 0.15);
  letter-spacing: 0.02em;
}

.slice-cut-prompt .cut-icon-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #38bdf8;
  box-shadow: 0 0 10px #38bdf8, 0 0 18px rgba(56, 189, 248, 0.6);
  animation: pulse 1.6s ease-in-out infinite;
}

.slice-canvas-wrapper {
  flex: 1;
  width: 100%;
  min-height: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  background: radial-gradient(circle at 50% 50%, #171b26 0%, #0d1017 100%);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 16px;
  overflow: hidden;
  touch-action: none;
  box-shadow: inset 0 1px 2px rgba(255, 255, 255, 0.06), 0 10px 30px rgba(0, 0, 0, 0.4);
}

#slice-canvas {
  width: 100%;
  height: 100%;
  display: block;
  cursor: crosshair;
  touch-action: none;
}

.slice-result-panel {
  background: rgba(15, 23, 42, 0.82);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 14px;
  padding: 10px 18px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.35), inset 0 1px 0 rgba(255, 255, 255, 0.1);
  flex-shrink: 0;
  text-align: center;
  animation: fadeIn 0.25s ease-out;
}

.slice-ratio-title {
  font-size: 0.74rem;
  font-weight: 600;
  color: #94a3b8;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.slice-ratio-val {
  font-size: 1.65rem;
  font-weight: 800;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  background: linear-gradient(135deg, #38bdf8 0%, #f59e0b 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  letter-spacing: 0.03em;
  line-height: 1.1;
}

.slice-ratio-bar-wrap {
  width: 100%;
  max-width: 320px;
  height: 8px;
  border-radius: 999px;
  overflow: hidden;
  display: flex;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.1);
  margin: 2px 0;
  box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.4);
}

.slice-bar-left {
  background: linear-gradient(90deg, #0284c7, #38bdf8);
  transition: width 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

.slice-bar-right {
  background: linear-gradient(90deg, #f59e0b, #fbbf24);
  transition: width 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

.slice-diff-badge {
  display: inline-block;
  background: rgba(16, 185, 129, 0.14);
  border: 1px solid rgba(16, 185, 129, 0.35);
  color: #34d399;
  font-size: 0.8rem;
  font-weight: 700;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  padding: 3px 12px;
  border-radius: 999px;
  box-shadow: 0 0 12px rgba(16, 185, 129, 0.15);
}

/* 盲压挑战 (Hold Target) 专属舞台 */
.hold-arena {
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 20px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 20px;
  text-align: center;
}

.hold-target-title {
  font-size: 1.5rem;
  font-weight: 800;
  color: var(--primary);
  letter-spacing: -0.01em;
  background: var(--primary-subtle);
  padding: 6px 18px;
  border-radius: 999px;
  border: 1px solid var(--primary-subtle);
}

.hold-btn-wrapper {
  display: flex;
  justify-content: center;
  align-items: center;
}

.btn-hold-trigger {
  width: 160px;
  height: 160px;
  border-radius: 50%;
  background: var(--primary);
  border: 4px solid rgba(255, 255, 255, 0.2);
  color: #fff;
  font-size: 1.1rem;
  font-weight: 800;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  box-shadow: 0 10px 25px var(--primary-glow), inset 0 2px 4px rgba(255, 255, 255, 0.3);
  transition: transform 0.15s ease, box-shadow 0.15s ease, background-color 0.15s ease;
  user-select: none;
  -webkit-user-select: none;
  touch-action: none;
}

.btn-hold-trigger:hover {
  transform: scale(1.04);
}

.btn-hold-trigger.pressing {
  transform: scale(0.94);
  background: var(--warning);
  box-shadow: 0 0 35px var(--warning-subtle), inset 0 3px 8px rgba(0, 0, 0, 0.3);
  border-color: rgba(255, 255, 255, 0.5);
}

.hold-icon {
  font-size: 2.2rem;
}

.hold-text {
  font-size: 0.92rem;
  letter-spacing: 0.02em;
}

.hold-result-box {
  background: var(--bg-surface);
  border: 1.5px solid var(--border-strong);
  border-radius: 10px;
  padding: 12px 24px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  box-shadow: var(--shadow-sm);
  animation: fadeIn 0.2s ease-out;
}

.hold-score-time {
  font-size: 1.8rem;
  font-weight: 900;
  color: var(--primary);
}

.hold-score-diff {
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--warning);
}

/* --------------------------------------------------------------------------
   决战 24 点 (Math 24) 工业级精工舞台
   -------------------------------------------------------------------------- */

.m24-arena {
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  gap: 10px;
  overflow-y: auto;
  scrollbar-width: thin;
  padding: 4px 2px 14px;
}

.m24-poker-deck {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 12px;
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.m24-deck-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.m24-tag {
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--primary);
  background: var(--primary-subtle);
  padding: 2px 8px;
  border-radius: 999px;
}

.m24-hint {
  font-size: 0.72rem;
  color: var(--text-muted);
}

.m24-cards-row {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
  max-width: 480px;
  margin: 0 auto;
  width: 100%;
}

.m24-card {
  aspect-ratio: 3 / 4;
  min-height: 80px;
  max-height: 120px;
  background: #ffffff;
  border: 2px solid #E2E8F0;
  border-radius: 10px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  position: relative;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.06), 0 1px 3px rgba(0, 0, 0, 0.04);
  user-select: none;
  cursor: default;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

[data-theme="dark"] .m24-card {
  background: #1E293B;
  border-color: #334155;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.4);
}

.m24-card.used {
  opacity: 0.35;
  transform: scale(0.96);
  border-color: var(--border);
  filter: grayscale(0.8);
  cursor: default;
}

.m24-card-val {
  font-family: 'Plus Jakarta Sans', var(--font-main);
  font-size: 1.8rem;
  font-weight: 900;
  color: #0F172A;
  letter-spacing: -0.03em;
}

[data-theme="dark"] .m24-card-val {
  color: #F8FAFC;
}

.m24-card-suit {
  position: absolute;
  top: 4px;
  left: 6px;
  font-size: 0.72rem;
  opacity: 0.75;
}

/* 算式编辑与实时求值 */
.m24-display-board {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 10px 14px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  box-shadow: var(--shadow-sm);
}

.m24-formula-bar {
  background: var(--bg-surface);
  border: 1.5px solid var(--border-strong);
  border-radius: 8px;
  padding: 8px 12px;
  min-height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: 'JetBrains Mono', 'Plus Jakarta Sans', monospace;
  font-size: 1.3rem;
  font-weight: 800;
  color: var(--primary);
  letter-spacing: 0.05em;
  text-align: center;
  word-break: break-all;
}

.m24-eval-preview {
  font-size: 0.76rem;
  font-weight: 600;
  color: var(--text-muted);
  text-align: right;
  padding: 0 4px;
  font-family: 'JetBrains Mono', monospace;
}

.m24-eval-preview.match-24 {
  color: var(--success);
  font-weight: 800;
}

/* 现代计算键盘 */
.m24-keypad-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  box-shadow: var(--shadow-sm);
}

.m24-keypad-section {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.m24-section-label {
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.m24-num-buttons {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
}

.btn-m24-num {
  background: var(--bg-sub);
  border: 1.5px solid var(--border);
  border-radius: 8px;
  color: var(--text-main);
  font-family: 'Plus Jakarta Sans', var(--font-main);
  font-size: 1.25rem;
  font-weight: 800;
  padding: 10px 0;
  cursor: pointer;
  transition: all 0.15s ease;
  box-shadow: var(--shadow-xs);
}

.btn-m24-num:hover:not(.used) {
  border-color: var(--primary);
  background: var(--primary-subtle);
  color: var(--primary);
  transform: translateY(-2px);
}

.btn-m24-num.used {
  opacity: 0.3;
  border-style: dashed;
  cursor: not-allowed;
  transform: none;
}

.m24-op-buttons {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 6px;
}

.btn-m24-op {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text-main);
  font-family: 'JetBrains Mono', 'Plus Jakarta Sans', monospace;
  font-size: 1.15rem;
  font-weight: 700;
  padding: 10px 0;
  cursor: pointer;
  transition: all 0.15s ease;
}

.btn-m24-op:hover {
  border-color: var(--primary);
  background: var(--primary-subtle);
  color: var(--primary);
}

.btn-m24-op.btn-op-paren {
  color: var(--primary);
  background: var(--primary-subtle);
  border-color: var(--primary-subtle);
}

.btn-m24-op.btn-op-del {
  color: var(--warning);
  font-size: 0.88rem;
  font-weight: 700;
}

.btn-m24-op.btn-op-clear {
  color: var(--danger);
  font-size: 0.88rem;
  font-weight: 700;
}

.m24-submit-btn {
  margin-top: 4px;
  font-weight: 800;
  letter-spacing: 0.02em;
}

/* --------------------------------------------------------------------------
   8. 几A几B (Bulls and Cows) 专属现代舞台
   -------------------------------------------------------------------------- */

.bc-arena {
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  gap: 10px;
  overflow-y: auto;
  scrollbar-width: thin;
}

.bc-history-panel {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 12px;
  box-shadow: var(--shadow-sm);
  flex: 1;
  min-height: 140px;
  max-height: 220px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.bc-panel-title {
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  display: flex;
  justify-content: space-between;
}

.bc-log-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.bc-empty-tip {
  font-size: 0.8rem;
  color: var(--text-muted);
  text-align: center;
  padding: 20px 0;
}

.bc-log-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 6px 12px;
  background: var(--bg-sub);
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 0.9rem;
}

.bc-log-digits {
  font-family: 'JetBrains Mono', 'Plus Jakarta Sans', monospace;
  font-weight: 800;
  letter-spacing: 0.15em;
  color: var(--text-main);
}

.bc-log-result {
  font-weight: 800;
}

.bc-log-result .tag-a { color: var(--success); }
.bc-log-result .tag-b { color: var(--warning); }

.bc-input-panel {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 12px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  box-shadow: var(--shadow-sm);
}

.bc-digits-display {
  width: 100%;
  max-width: 320px;
  background: var(--bg-surface);
  border: 1.5px solid var(--border-strong);
  border-radius: 8px;
  padding: 8px 12px;
  font-family: 'JetBrains Mono', monospace;
  font-size: 1.6rem;
  font-weight: 900;
  color: var(--primary);
  letter-spacing: 0.35em;
  text-align: center;
  box-shadow: inset 0 2px 4px rgba(0,0,0,0.03);
}

.bc-keypad {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  width: 100%;
  max-width: 320px;
  margin: 0 auto;
}

.btn-key {
  background: var(--bg-sub);
  border: 1px solid var(--border);
  color: var(--text-main);
  font-family: 'Plus Jakarta Sans', var(--font-main);
  font-size: 1.25rem;
  font-weight: 800;
  padding: 12px 0;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.15s ease;
  box-shadow: var(--shadow-xs);
}

.btn-key:hover {
  border-color: var(--primary);
  background: var(--primary-subtle);
  color: var(--primary);
  transform: translateY(-1px);
}

.btn-key.btn-key-action {
  font-size: 1.1rem;
}

#btn-bc-clear {
  color: var(--danger);
}

#btn-bc-submit {
  background: var(--primary);
  color: #fff;
  border-color: var(--primary);
}

#btn-bc-submit:hover {
  opacity: 0.9;
  background: var(--primary);
  color: #fff;
}

/* --------------------------------------------------------------------------
   7. 拆弹轮盘 (Bomb Roulette) 专属舞台
   -------------------------------------------------------------------------- */

.bomb-arena {
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 16px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 16px;
}

.bomb-center-graphic {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  text-align: center;
}

.bomb-body-icon {
  font-size: 3.5rem;
  filter: drop-shadow(0 6px 12px rgba(0,0,0,0.15));
  animation: floatSlow 3s ease-in-out infinite alternate;
}

.bomb-turn-tip {
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--text-main);
  background: var(--bg-surface);
  border: 1px solid var(--border);
  padding: 4px 14px;
  border-radius: 999px;
}

.wires-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  width: 100%;
  max-width: 360px;
}

.btn-wire {
  background: var(--bg-surface);
  border: 1.5px solid var(--border);
  border-radius: 10px;
  padding: 14px 8px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  font-size: 0.88rem;
  font-weight: 800;
  color: var(--text-main);
  cursor: pointer;
  transition: all 0.2s ease;
  box-shadow: var(--shadow-xs);
}

.btn-wire:hover:not(:disabled) {
  transform: translateY(-2px);
  border-color: var(--primary);
  box-shadow: 0 4px 12px var(--primary-glow);
}

.btn-wire.cut {
  opacity: 0.3;
  border-style: dashed;
  filter: grayscale(1);
  cursor: not-allowed;
}

/* --------------------------------------------------------------------------
   11. 词汇炸弹 (Word Bomb) 专属舞台
   -------------------------------------------------------------------------- */

.wb-arena {
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 16px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 16px;
}

.wb-bomb-box {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  text-align: center;
}

.wb-bomb-icon {
  font-size: 3.5rem;
  filter: drop-shadow(0 6px 14px rgba(239, 68, 68, 0.3));
  animation: pulseScale 1s infinite alternate;
}

.wb-keyword-banner {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--bg-surface);
  border: 1px solid var(--border);
  padding: 6px 16px;
  border-radius: 999px;
  font-size: 0.88rem;
  font-weight: 700;
  color: var(--text-main);
}

.wb-keyword-badge {
  font-size: 1.4rem;
  font-weight: 900;
  color: var(--danger);
  background: rgba(239, 68, 68, 0.1);
  padding: 2px 10px;
  border-radius: 6px;
}

.wb-turn-status {
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--warning);
}

.wb-lives-bar {
  font-size: 1.2rem;
  letter-spacing: 4px;
}

.wb-input-form {
  display: flex;
  gap: 8px;
  width: 100%;
  max-width: 360px;
}

.wb-input-form input {
  flex: 1;
  padding: 10px 14px;
  font-size: 0.95rem;
  font-weight: 600;
}

/* 3D数方块与瞬间数动物专属舞台 */
.flash-arena, .cube-arena {
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  gap: 10px;
  position: relative;
  overflow: hidden;
  user-select: none;
  -webkit-user-select: none;
}

.flash-canvas-wrapper, .cube-canvas-wrapper {
  flex: 1;
  width: 100%;
  min-height: 200px;
  position: relative;
  background: radial-gradient(circle at 50% 50%, #151923 0%, #0d1017 100%);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 16px;
  overflow: hidden;
  box-shadow: inset 0 1px 2px rgba(255, 255, 255, 0.06), 0 8px 24px rgba(0, 0, 0, 0.35);
}

#flash-canvas, #cube-canvas {
  width: 100%;
  height: 100%;
  display: block;
}

/* 瞬间数动物 DOM 奔跑层 (CSS GPU 硬件加速，跨平台 100% 可见) */
.flash-runners-layer {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  overflow: hidden;
  z-index: 5;
}

.flash-runner-item {
  position: absolute;
  left: -80px;
  transform: translateY(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  will-change: left;
  user-select: none;
  -webkit-user-select: none;
  pointer-events: none;
}

.flash-runner-hop {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  animation: runnerHop 0.26s infinite alternate ease-in-out;
}

.flash-runner-emoji {
  display: block;
  line-height: 1;
  font-size: inherit;
  filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.45));
}

.flash-runner-shadow {
  display: block;
  width: 28px;
  height: 6px;
  margin-top: -2px;
  background: radial-gradient(ellipse at center, rgba(0, 0, 0, 0.55) 0%, rgba(0, 0, 0, 0) 75%);
  border-radius: 50%;
  animation: shadowPulse 0.26s infinite alternate ease-in-out;
}

@keyframes runnerAcrossContainer {
  0% {
    left: -80px;
  }
  100% {
    left: calc(100% + 40px);
  }
}

@keyframes runnerHop {
  0% {
    transform: translateY(0);
  }
  100% {
    transform: translateY(-14px);
  }
}

@keyframes shadowPulse {
  0% {
    transform: scale(1);
    opacity: 0.6;
  }
  100% {
    transform: scale(0.65);
    opacity: 0.25;
  }
}

/* 准备期聚焦居中大横幅 */
.flash-ready-banner {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background: rgba(15, 23, 42, 0.92);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid rgba(56, 189, 248, 0.35);
  border-radius: 20px;
  padding: 16px 22px;
  display: flex;
  align-items: center;
  gap: 14px;
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.6), 0 0 24px rgba(56, 189, 248, 0.2);
  z-index: 8;
  animation: popIn 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  text-align: left;
}

.ready-target-emoji {
  font-size: 2.8rem;
  line-height: 1;
  animation: pulse 1.2s infinite ease-in-out;
}

.ready-target-text {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.ready-sub {
  font-size: 0.78rem;
  color: #94a3b8;
  font-weight: 500;
}

.ready-main {
  font-size: 1.1rem;
  font-weight: 800;
  color: #f8fafc;
}

.ready-main b {
  color: #38bdf8;
  font-size: 1.2rem;
}

.ready-countdown {
  font-size: 2.2rem;
  font-weight: 900;
  color: #fbbf24;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  padding-left: 10px;
  border-left: 1px solid rgba(255, 255, 255, 0.12);
  min-width: 36px;
  text-align: center;
}

/* 瞬间数动物答题悬浮面板 (Glassmorphism & Mobile UX) */
.flash-overlay-card {
  position: absolute;
  bottom: 10px;
  left: 10px;
  right: 10px;
  background: rgba(15, 23, 42, 0.88);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 16px;
  padding: 14px 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.5), inset 0 1px 0 rgba(255, 255, 255, 0.15);
  animation: slideUp 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  z-index: 10;
}

.flash-question-header {
  display: flex;
  align-items: center;
  gap: 12px;
}

.flash-target-emoji {
  font-size: 2.2rem;
  line-height: 1;
  filter: drop-shadow(0 2px 8px rgba(0, 0, 0, 0.4));
  animation: pulse 1.5s ease-in-out infinite;
}

.flash-question-title {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.flash-q-sub {
  font-size: 0.76rem;
  color: #94a3b8;
  font-weight: 500;
  letter-spacing: 0.02em;
}

.flash-q-main {
  font-size: 1.05rem;
  font-weight: 800;
  color: #f8fafc;
}

.flash-q-main b {
  color: #38bdf8;
}

/* 3D数方块控制台 */
.cube-control-panel {
  background: rgba(15, 23, 42, 0.82);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 14px;
  padding: 12px 14px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.35);
  flex-shrink: 0;
}

.cube-prompt-bar {
  display: flex;
  align-items: baseline;
  gap: 6px;
  font-size: 0.86rem;
  font-weight: 700;
  color: #f1f5f9;
}

.prompt-sub {
  font-size: 0.74rem;
  color: #94a3b8;
  font-weight: normal;
}

/* 移动端 2x2 大触控选项胶囊 */
.cube-options-grid, .flash-options-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
  width: 100%;
}

.btn-cube-option, .btn-flash-option {
  background: rgba(255, 255, 255, 0.06);
  border: 1.5px solid rgba(255, 255, 255, 0.12);
  color: #f8fafc;
  font-size: 1.35rem;
  font-weight: 800;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  padding: 10px 0;
  min-height: 48px;
  border-radius: 10px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.15s cubic-bezier(0.16, 1, 0.3, 1);
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
}

.btn-cube-option:hover, .btn-flash-option:hover {
  border-color: #38bdf8;
  background: rgba(56, 189, 248, 0.15);
  color: #38bdf8;
  transform: translateY(-1px);
}

.btn-cube-option:active, .btn-flash-option:active {
  transform: scale(0.97);
}

.cube-direct-form {
  display: flex;
  gap: 8px;
  align-items: center;
  width: 100%;
}

.cube-direct-form input {
  flex: 1;
  height: 40px;
  padding: 0 12px;
  font-size: 0.95rem;
  background: rgba(0, 0, 0, 0.25);
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 8px;
  color: #ffffff;
  outline: none;
}

.cube-direct-form input:focus {
  border-color: #38bdf8;
  box-shadow: 0 0 0 2px rgba(56, 189, 248, 0.25);
}

.cube-direct-form button {
  height: 40px;
  padding: 0 16px;
  font-size: 0.9rem;
  font-weight: 700;
  border-radius: 8px;
  white-space: nowrap;
}

.bc-keypad, .m24-keypad {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 4px;
  max-width: 240px;
  width: 100%;
}

.btn-key, .btn-m24-op, .btn-m24-num {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  color: var(--text-main);
  padding: 8px;
  font-size: 0.95rem;
  font-weight: 600;
  border-radius: 4px;
  cursor: pointer;
}

/* --------------------------------------------------------------------------
   9. 底部聊天栏
   -------------------------------------------------------------------------- */

.chat-section {
  background: var(--bg-card);
  border-top: 1px solid var(--border);
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  z-index: 30;
}

.chat-header-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 6px 12px;
  cursor: pointer;
  background: var(--bg-sub);
  border-bottom: 1px solid var(--border-subtle);
}

.chat-header-title {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--text-sub);
}

.chat-live-dot {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--success);
}

.btn-toggle-chat {
  background: var(--bg-pill);
  border: 1px solid var(--border);
  color: var(--text-muted);
  font-size: 0.72rem;
  font-weight: 600;
  cursor: pointer;
  padding: 1px 6px;
  border-radius: 4px;
}

.chat-messages {
  flex: 1;
  overflow-y: auto;
  padding: 6px 10px;
  display: flex;
  flex-direction: column;
  gap: 3px;
  max-height: 80px;
}

.msg-item {
  font-size: 0.78rem;
  line-height: 1.35;
  padding: 2px 4px;
  border-radius: 3px;
}

.msg-system {
  color: var(--text-muted);
  font-size: 0.72rem;
  text-align: center;
  align-self: center;
}

.reaction-bar {
  display: flex;
  gap: 3px;
  padding: 2px 8px;
  overflow-x: auto;
}

.btn-reaction {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 2px 5px;
  font-size: 0.9rem;
  cursor: pointer;
}

.chat-form {
  display: flex;
  gap: 4px;
  padding: 4px 8px 6px;
}

.chat-form input {
  flex: 1;
  padding: 5px 8px;
  font-size: 0.8rem;
}

.chat-section.collapsed .chat-body-collapsible {
  display: none !important;
}

/* --------------------------------------------------------------------------
   10. 弹窗系统
   -------------------------------------------------------------------------- */

.modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: var(--bg-backdrop);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  padding: 12px;
}

.modal.active { display: flex; }

.modal-content {
  background: var(--bg-surface);
  border: 1px solid var(--border-strong);
  border-radius: 10px;
  padding: 18px;
  width: 100%;
  max-width: 360px;
  box-shadow: var(--shadow-lg);
  text-align: center;
}

.hidden { display: none !important; }

/* 桌面端响应式 */
@media (min-width: 768px) {
  .game-body { flex-direction: row; }
  .player-drawer {
    position: relative;
    transform: translateX(0);
    z-index: 10;
  }
  .drawer-backdrop, #btn-toggle-players, #btn-close-drawer {
    display: none !important;
  }
  .chat-section {
    border-top: none;
    border-left: 1px solid var(--border);
    width: 250px;
    height: 100%;
  }
  .chat-messages { max-height: none; }
}
