/* ============================================
   真心话大冒险 - 主样式文件
   配色方案：靛蓝 #6366f1 / 紫色 #8b5cf6 / 背景 #f8fafc / 文字 #1e293b / 惩罚红 #f43f5e
   ============================================ */

/* ---------- 1. 全局重置和基础样式 ---------- */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  font-size: 16px;
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC',
    'Hiragino Sans GB', 'Microsoft YaHei', 'Helvetica Neue', Helvetica, Arial,
    sans-serif;
  color: #1e293b;
  background: linear-gradient(135deg, #f8fafc 0%, #eef2ff 50%, #f5f3ff 100%);
  min-height: 100vh;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

a {
  color: #6366f1;
  text-decoration: none;
  transition: color 0.2s ease;
}

a:hover {
  color: #8b5cf6;
}

button {
  cursor: pointer;
  border: none;
  outline: none;
  font-family: inherit;
  font-size: inherit;
  transition: all 0.3s ease;
}

input {
  font-family: inherit;
  font-size: inherit;
  outline: none;
  border: none;
}

ul, ol {
  list-style: none;
}

img {
  max-width: 100%;
  display: block;
}

/* ---------- 2. 首页样式 ---------- */
.home-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  padding: 2rem;
  text-align: center;
}

.home-title {
  font-size: 3.5rem;
  font-weight: 800;
  background: linear-gradient(135deg, #6366f1, #8b5cf6, #f43f5e);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  margin-bottom: 0.75rem;
  letter-spacing: -0.02em;
  line-height: 1.2;
}

.home-subtitle {
  font-size: 1.2rem;
  color: #64748b;
  margin-bottom: 2.5rem;
  font-weight: 400;
}

.home-buttons {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  width: 100%;
  max-width: 320px;
  margin-bottom: 2.5rem;
}

.btn-primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.875rem 2rem;
  background: linear-gradient(135deg, #6366f1, #8b5cf6);
  color: #fff;
  font-size: 1.1rem;
  font-weight: 600;
  border-radius: 1rem;
  box-shadow: 0 4px 15px rgba(99, 102, 241, 0.35);
  transition: all 0.3s ease;
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 25px rgba(99, 102, 241, 0.5);
}

.btn-primary:active {
  transform: translateY(0);
  box-shadow: 0 2px 10px rgba(99, 102, 241, 0.3);
}

.btn-secondary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.875rem 2rem;
  background: #fff;
  color: #6366f1;
  font-size: 1.1rem;
  font-weight: 600;
  border-radius: 1rem;
  border: 2px solid #e2e8f0;
  transition: all 0.3s ease;
}

.btn-secondary:hover {
  border-color: #6366f1;
  background: #eef2ff;
  transform: translateY(-2px);
}

.btn-secondary:active {
  transform: translateY(0);
}

.rules-card {
  background: #fff;
  border-radius: 1rem;
  padding: 1.5rem 2rem;
  max-width: 480px;
  width: 100%;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.06);
  text-align: left;
}

.rules-card h3 {
  font-size: 1.1rem;
  font-weight: 700;
  color: #1e293b;
  margin-bottom: 0.75rem;
}

.rules-card ul {
  padding-left: 1.25rem;
}

.rules-card li {
  position: relative;
  padding-left: 1rem;
  margin-bottom: 0.5rem;
  color: #475569;
  font-size: 0.95rem;
  line-height: 1.6;
}

.rules-card li::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0.55em;
  width: 6px;
  height: 6px;
  background: #6366f1;
  border-radius: 50%;
}

/* ---------- 3. 游戏页面布局 ---------- */
.game-container {
  max-width: 800px;
  margin: 0 auto;
  padding: 0 1rem;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.game-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 0;
  border-bottom: 1px solid #e2e8f0;
  margin-bottom: 1.5rem;
}

.game-header .back-btn {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  background: none;
  color: #64748b;
  font-size: 0.95rem;
  padding: 0.5rem 0.75rem;
  border-radius: 0.5rem;
  transition: all 0.2s ease;
}

.game-header .back-btn:hover {
  color: #6366f1;
  background: #eef2ff;
}

.game-header .header-title {
  font-size: 1.15rem;
  font-weight: 700;
  color: #1e293b;
}

.game-header .header-actions {
  display: flex;
  gap: 0.5rem;
}

.game-header .header-actions button {
  background: none;
  color: #64748b;
  padding: 0.5rem;
  border-radius: 0.5rem;
  font-size: 1.2rem;
  transition: all 0.2s ease;
}

.game-header .header-actions button:hover {
  color: #6366f1;
  background: #eef2ff;
}

.game-body {
  flex: 1;
  padding-bottom: 2rem;
}

/* ---------- 4. 玩家设置区域 ---------- */
.player-setup {
  background: #fff;
  border-radius: 1rem;
  padding: 1.5rem;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.06);
  margin-bottom: 1.5rem;
}

.player-input-row {
  display: flex;
  gap: 0.75rem;
  margin-bottom: 1rem;
}

.player-input-row input {
  flex: 1;
  padding: 0.75rem 1rem;
  background: #f1f5f9;
  border: 2px solid transparent;
  border-radius: 0.75rem;
  font-size: 1rem;
  color: #1e293b;
  transition: all 0.2s ease;
}

.player-input-row input::placeholder {
  color: #94a3b8;
}

.player-input-row input:focus {
  border-color: #6366f1;
  background: #fff;
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.15);
}

.player-input-row button {
  padding: 0.75rem 1.25rem;
  background: linear-gradient(135deg, #6366f1, #8b5cf6);
  color: #fff;
  font-weight: 600;
  border-radius: 0.75rem;
  white-space: nowrap;
  box-shadow: 0 2px 10px rgba(99, 102, 241, 0.3);
}

.player-input-row button:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 15px rgba(99, 102, 241, 0.4);
}

.player-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  min-height: 2rem;
}

.player-tag {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.4rem 0.75rem 0.4rem 1rem;
  background: linear-gradient(135deg, #eef2ff, #f5f3ff);
  color: #6366f1;
  font-size: 0.9rem;
  font-weight: 500;
  border-radius: 2rem;
  animation: fadeIn 0.3s ease;
}

.player-remove {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
  background: rgba(99, 102, 241, 0.2);
  color: #6366f1;
  border-radius: 50%;
  font-size: 0.75rem;
  line-height: 1;
  padding: 0;
  transition: all 0.2s ease;
}

.player-remove:hover {
  background: #f43f5e;
  color: #fff;
}

/* ---------- 5. 模式/题型选择 ---------- */
.selection-group {
  margin-bottom: 1.5rem;
}

.selection-group .section-title {
  margin-bottom: 0.75rem;
}

.selection-group .btn-group {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.mode-btn,
.type-btn {
  padding: 0.6rem 1.25rem;
  background: #fff;
  color: #64748b;
  font-size: 0.95rem;
  font-weight: 500;
  border: 2px solid #e2e8f0;
  border-radius: 0.75rem;
  transition: all 0.3s ease;
}

.mode-btn:hover,
.type-btn:hover {
  border-color: #6366f1;
  color: #6366f1;
}

.mode-btn.active,
.type-btn.active {
  background: linear-gradient(135deg, #6366f1, #8b5cf6);
  color: #fff;
  border-color: transparent;
  box-shadow: 0 2px 10px rgba(99, 102, 241, 0.3);
}

/* ---------- 6. 转盘区域 ---------- */
.wheel-section {
  display: flex;
  flex-direction: column;
  align-items: center;
  margin-bottom: 2rem;
}

.wheel-container {
  position: relative;
  width: 320px;
  height: 320px;
  margin-bottom: 1.5rem;
}

#wheelCanvas {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  box-shadow: 0 8px 30px rgba(99, 102, 241, 0.2);
}

.spin-hint {
  font-size: 0.95rem;
  color: #94a3b8;
  margin-bottom: 1rem;
  text-align: center;
}

#spinBtn {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  background: linear-gradient(135deg, #6366f1, #8b5cf6);
  color: #fff;
  font-size: 1rem;
  font-weight: 700;
  box-shadow: 0 4px 20px rgba(99, 102, 241, 0.4);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s ease;
}

#spinBtn:hover {
  transform: scale(1.08);
  box-shadow: 0 6px 30px rgba(99, 102, 241, 0.55);
}

#spinBtn:active {
  transform: scale(0.98);
}

#spinBtn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none;
}

#spinBtn.spinning {
  animation: pulse 1s ease-in-out infinite;
}

/* ---------- 7. 选择面板 ---------- */
.panel {
  display: none;
}

.panel.active {
  display: block;
  animation: fadeIn 0.4s ease;
}

.choose-panel {
  text-align: center;
  padding: 1rem 0;
}

.choose-panel .choose-title {
  font-size: 1.5rem;
  font-weight: 700;
  color: #1e293b;
  margin-bottom: 0.5rem;
}

.choose-panel .choose-subtitle {
  font-size: 1rem;
  color: #64748b;
  margin-bottom: 2rem;
}

.choose-buttons {
  display: flex;
  gap: 1.5rem;
  justify-content: center;
  flex-wrap: wrap;
}

#truthBtn {
  flex: 1;
  min-width: 200px;
  max-width: 280px;
  padding: 2rem 1.5rem;
  background: linear-gradient(135deg, #6366f1, #818cf8);
  color: #fff;
  font-size: 1.3rem;
  font-weight: 700;
  border-radius: 1.25rem;
  box-shadow: 0 6px 20px rgba(99, 102, 241, 0.35);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
}

#truthBtn:hover {
  transform: translateY(-3px);
  box-shadow: 0 8px 30px rgba(99, 102, 241, 0.5);
}

#truthBtn:active {
  transform: translateY(0);
}

#truthBtn .btn-icon {
  font-size: 2.5rem;
}

#dareBtn {
  flex: 1;
  min-width: 200px;
  max-width: 280px;
  padding: 2rem 1.5rem;
  background: linear-gradient(135deg, #f43f5e, #fb7185);
  color: #fff;
  font-size: 1.3rem;
  font-weight: 700;
  border-radius: 1.25rem;
  box-shadow: 0 6px 20px rgba(244, 63, 94, 0.35);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
}

#dareBtn:hover {
  transform: translateY(-3px);
  box-shadow: 0 8px 30px rgba(244, 63, 94, 0.5);
}

#dareBtn:active {
  transform: translateY(0);
}

#dareBtn .btn-icon {
  font-size: 2.5rem;
}

/* ---------- 8. 题目展示面板 ---------- */
.question-panel {
  text-align: center;
  padding: 1rem 0;
}

.question-type-badge {
  display: inline-block;
  padding: 0.35rem 1rem;
  border-radius: 2rem;
  font-size: 0.85rem;
  font-weight: 600;
  margin-bottom: 1.25rem;
}

.question-type-badge.truth {
  background: #eef2ff;
  color: #6366f1;
}

.question-type-badge.dare {
  background: #fff1f2;
  color: #f43f5e;
}

.question-type-badge.punishment {
  background: #f5f3ff;
  color: #8b5cf6;
}

.question-card {
  background: #fff;
  border-radius: 1.25rem;
  padding: 2.5rem 2rem;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.06);
  margin-bottom: 1.5rem;
  animation: slideUp 0.4s ease;
}

.question-text {
  font-size: 1.5rem;
  font-weight: 600;
  color: #1e293b;
  line-height: 1.6;
  margin-bottom: 1.5rem;
}

.timer-section {
  margin-bottom: 1.5rem;
}

.timer-bar {
  width: 100%;
  height: 6px;
  background: #e2e8f0;
  border-radius: 3px;
  overflow: hidden;
  margin-bottom: 0.5rem;
}

.timer-bar .timer-fill {
  height: 100%;
  background: linear-gradient(90deg, #6366f1, #8b5cf6);
  border-radius: 3px;
  transition: width 1s linear;
}

.timer-bar.timer-warning .timer-fill {
  background: linear-gradient(90deg, #f43f5e, #fb7185);
  animation: shake 0.5s ease-in-out infinite;
}

.timer-text {
  font-size: 0.9rem;
  color: #64748b;
  font-weight: 500;
}

.timer-warning .timer-text {
  color: #f43f5e;
  font-weight: 700;
}

.action-buttons {
  display: flex;
  gap: 1rem;
  justify-content: center;
  flex-wrap: wrap;
}

.action-buttons .btn-complete {
  padding: 0.75rem 2rem;
  background: linear-gradient(135deg, #22c55e, #16a34a);
  color: #fff;
  font-size: 1rem;
  font-weight: 600;
  border-radius: 0.75rem;
  box-shadow: 0 4px 15px rgba(34, 197, 94, 0.3);
}

.action-buttons .btn-complete:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(34, 197, 94, 0.4);
}

.action-buttons .btn-skip {
  padding: 0.75rem 2rem;
  background: #fff;
  color: #64748b;
  font-size: 1rem;
  font-weight: 600;
  border-radius: 0.75rem;
  border: 2px solid #e2e8f0;
}

.action-buttons .btn-skip:hover {
  border-color: #f43f5e;
  color: #f43f5e;
  background: #fff1f2;
}

/* ---------- 9. 惩罚面板 ---------- */
.punishment-panel {
  text-align: center;
  padding: 1rem 0;
}

.punishment-card {
  background: linear-gradient(135deg, #fff1f2, #fff5f5);
  border: 2px solid #fecdd3;
  border-radius: 1.25rem;
  padding: 2.5rem 2rem;
  box-shadow: 0 4px 20px rgba(244, 63, 94, 0.1);
  animation: slideUp 0.4s ease;
}

.punishment-card .punishment-icon {
  font-size: 3rem;
  margin-bottom: 1rem;
}

.punishment-card .punishment-title {
  font-size: 1.3rem;
  font-weight: 700;
  color: #f43f5e;
  margin-bottom: 0.75rem;
}

.punishment-card .punishment-text {
  font-size: 1.25rem;
  font-weight: 500;
  color: #1e293b;
  line-height: 1.6;
  margin-bottom: 1.5rem;
}

.punishment-card .punishment-actions {
  display: flex;
  gap: 1rem;
  justify-content: center;
  flex-wrap: wrap;
}

/* ---------- 10. 下一轮面板 ---------- */
.next-round-panel {
  text-align: center;
  padding: 2rem 0;
  animation: fadeIn 0.4s ease;
}

.next-round-panel .round-summary {
  font-size: 1.1rem;
  color: #64748b;
  margin-bottom: 1.5rem;
}

#nextRoundBtn {
  padding: 0.875rem 2.5rem;
  background: linear-gradient(135deg, #6366f1, #8b5cf6);
  color: #fff;
  font-size: 1.1rem;
  font-weight: 600;
  border-radius: 1rem;
  box-shadow: 0 4px 15px rgba(99, 102, 241, 0.35);
}

#nextRoundBtn:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 25px rgba(99, 102, 241, 0.5);
}

#nextRoundBtn:active {
  transform: translateY(0);
}

/* ---------- 11. 自定义题目 ---------- */
.custom-section {
  background: #fff;
  border-radius: 1rem;
  padding: 1.5rem;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.06);
  margin-bottom: 1.5rem;
}

.custom-tabs {
  display: flex;
  gap: 0.25rem;
  background: #f1f5f9;
  border-radius: 0.75rem;
  padding: 0.25rem;
  margin-bottom: 1rem;
}

.custom-tab {
  flex: 1;
  padding: 0.6rem 1rem;
  background: transparent;
  color: #64748b;
  font-size: 0.9rem;
  font-weight: 600;
  border-radius: 0.5rem;
  transition: all 0.2s ease;
}

.custom-tab:hover {
  color: #6366f1;
}

.custom-tab.active {
  background: #fff;
  color: #6366f1;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.08);
}

.custom-list {
  max-height: 300px;
  overflow-y: auto;
  padding-right: 0.25rem;
}

.custom-list::-webkit-scrollbar {
  width: 4px;
}

.custom-list::-webkit-scrollbar-track {
  background: transparent;
}

.custom-list::-webkit-scrollbar-thumb {
  background: #cbd5e1;
  border-radius: 2px;
}

.custom-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.75rem 1rem;
  border-radius: 0.5rem;
  transition: background 0.2s ease;
  border-bottom: 1px solid #f1f5f9;
}

.custom-item:last-child {
  border-bottom: none;
}

.custom-item:hover {
  background: #f8fafc;
}

.custom-item .item-text {
  flex: 1;
  font-size: 0.95rem;
  color: #1e293b;
}

.custom-item .item-delete {
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: none;
  color: #94a3b8;
  border-radius: 0.375rem;
  font-size: 0.85rem;
  padding: 0;
  transition: all 0.2s ease;
}

.custom-item .item-delete:hover {
  background: #fff1f2;
  color: #f43f5e;
}

.custom-add-row {
  display: flex;
  gap: 0.5rem;
  margin-top: 1rem;
}

.custom-add-row input {
  flex: 1;
  padding: 0.6rem 0.875rem;
  background: #f1f5f9;
  border: 2px solid transparent;
  border-radius: 0.5rem;
  font-size: 0.9rem;
  color: #1e293b;
  transition: all 0.2s ease;
}

.custom-add-row input::placeholder {
  color: #94a3b8;
}

.custom-add-row input:focus {
  border-color: #6366f1;
  background: #fff;
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.15);
}

.custom-add-row button {
  padding: 0.6rem 1rem;
  background: linear-gradient(135deg, #6366f1, #8b5cf6);
  color: #fff;
  font-weight: 600;
  font-size: 0.9rem;
  border-radius: 0.5rem;
  white-space: nowrap;
}

/* ---------- 12. 历史记录 ---------- */
.history-section {
  background: #fff;
  border-radius: 1rem;
  padding: 1.5rem;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.06);
  margin-bottom: 1.5rem;
}

.history-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.875rem 0;
  border-bottom: 1px solid #f1f5f9;
  animation: fadeIn 0.3s ease;
}

.history-item:last-child {
  border-bottom: none;
}

.history-header {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex: 1;
  min-width: 0;
}

.history-player {
  font-weight: 600;
  font-size: 0.95rem;
  color: #1e293b;
  white-space: nowrap;
}

.history-type {
  display: inline-block;
  padding: 0.2rem 0.6rem;
  border-radius: 0.375rem;
  font-size: 0.75rem;
  font-weight: 600;
  white-space: nowrap;
}

.history-type.truth {
  background: #eef2ff;
  color: #6366f1;
}

.history-type.dare {
  background: #fff1f2;
  color: #f43f5e;
}

.history-type.punishment {
  background: #f5f3ff;
  color: #8b5cf6;
}

.history-question {
  flex: 1;
  font-size: 0.9rem;
  color: #64748b;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* ---------- 13. 设置页面 ---------- */
.settings-container {
  max-width: 600px;
  margin: 0 auto;
  padding: 2rem 1rem;
}

.setting-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 0;
  border-bottom: 1px solid #f1f5f9;
}

.setting-item:last-child {
  border-bottom: none;
}

.setting-label {
  font-size: 0.95rem;
  font-weight: 500;
  color: #1e293b;
}

.setting-desc {
  font-size: 0.8rem;
  color: #94a3b8;
  margin-top: 0.2rem;
}

.toggle-switch {
  position: relative;
  width: 48px;
  height: 26px;
  background: #cbd5e1;
  border-radius: 13px;
  cursor: pointer;
  transition: background 0.3s ease;
  flex-shrink: 0;
}

.toggle-switch.active {
  background: linear-gradient(135deg, #6366f1, #8b5cf6);
}

.toggle-switch::after {
  content: '';
  position: absolute;
  top: 3px;
  left: 3px;
  width: 20px;
  height: 20px;
  background: #fff;
  border-radius: 50%;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.15);
  transition: transform 0.3s ease;
}

.toggle-switch.active::after {
  transform: translateX(22px);
}

.range-slider {
  -webkit-appearance: none;
  appearance: none;
  width: 140px;
  height: 6px;
  background: #e2e8f0;
  border-radius: 3px;
  outline: none;
  cursor: pointer;
}

.range-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 20px;
  height: 20px;
  background: linear-gradient(135deg, #6366f1, #8b5cf6);
  border-radius: 50%;
  cursor: pointer;
  box-shadow: 0 2px 6px rgba(99, 102, 241, 0.3);
  transition: transform 0.2s ease;
}

.range-slider::-webkit-slider-thumb:hover {
  transform: scale(1.15);
}

.range-slider::-moz-range-thumb {
  width: 20px;
  height: 20px;
  background: linear-gradient(135deg, #6366f1, #8b5cf6);
  border-radius: 50%;
  cursor: pointer;
  border: none;
  box-shadow: 0 2px 6px rgba(99, 102, 241, 0.3);
}

.range-value {
  font-size: 0.85rem;
  font-weight: 600;
  color: #6366f1;
  min-width: 2.5rem;
  text-align: right;
}

.setting-control {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

/* ---------- 14. Toast提示 ---------- */
.toast {
  position: fixed;
  bottom: 2rem;
  left: 50%;
  transform: translateX(-50%) translateY(100px);
  padding: 0.75rem 1.5rem;
  background: #1e293b;
  color: #fff;
  font-size: 0.9rem;
  font-weight: 500;
  border-radius: 0.75rem;
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.2);
  opacity: 0;
  transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
  z-index: 1000;
  pointer-events: none;
  white-space: nowrap;
}

.toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

.toast.toast-success {
  background: #22c55e;
}

.toast.toast-error {
  background: #f43f5e;
}

.toast.toast-warning {
  background: #f59e0b;
}

/* ---------- 15. 通用组件 ---------- */
.empty-state {
  text-align: center;
  padding: 3rem 1rem;
  color: #94a3b8;
}

.empty-state .empty-icon {
  font-size: 3rem;
  margin-bottom: 1rem;
  opacity: 0.5;
}

.empty-state .empty-text {
  font-size: 1rem;
  font-weight: 500;
}

.empty-players {
  text-align: center;
  padding: 1.5rem;
  color: #94a3b8;
  font-size: 0.9rem;
}

.section-title {
  font-size: 1rem;
  font-weight: 700;
  color: #1e293b;
  margin-bottom: 0.75rem;
}

.card {
  background: #fff;
  border-radius: 1rem;
  padding: 1.5rem;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.06);
  margin-bottom: 1.5rem;
}

/* ---------- 16. 动画 ---------- */
@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

@keyframes slideUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

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

@keyframes shake {
  0%, 100% {
    transform: translateX(0);
  }
  10%, 30%, 50%, 70%, 90% {
    transform: translateX(-3px);
  }
  20%, 40%, 60%, 80% {
    transform: translateX(3px);
  }
}

/* ---------- 17. 响应式 ---------- */

/* 平板及以下 */
@media (max-width: 768px) {
  .home-title {
    font-size: 2.5rem;
  }

  .home-subtitle {
    font-size: 1.05rem;
  }

  .game-container {
    padding: 0 0.75rem;
  }

  .game-header {
    padding: 0.75rem 0;
  }

  .wheel-container {
    width: 280px;
    height: 280px;
  }

  #spinBtn {
    width: 70px;
    height: 70px;
    font-size: 0.9rem;
  }

  .question-text {
    font-size: 1.3rem;
  }

  .question-card {
    padding: 2rem 1.5rem;
  }

  .choose-buttons {
    flex-direction: column;
    align-items: center;
  }

  #truthBtn,
  #dareBtn {
    max-width: 100%;
    min-width: auto;
    width: 100%;
    padding: 1.5rem 1rem;
  }

  .player-setup,
  .custom-section,
  .history-section {
    padding: 1.25rem;
  }

  .settings-container {
    padding: 1.5rem 0.75rem;
  }
}

/* 手机竖屏 */
@media (max-width: 480px) {
  .home-title {
    font-size: 2rem;
  }

  .home-subtitle {
    font-size: 0.95rem;
    margin-bottom: 2rem;
  }

  .home-buttons {
    max-width: 100%;
  }

  .btn-primary,
  .btn-secondary {
    padding: 0.75rem 1.5rem;
    font-size: 1rem;
  }

  .rules-card {
    padding: 1.25rem;
  }

  .wheel-container {
    width: 240px;
    height: 240px;
  }

  #spinBtn {
    width: 60px;
    height: 60px;
    font-size: 0.85rem;
  }

  .question-text {
    font-size: 1.15rem;
  }

  .question-card {
    padding: 1.5rem 1rem;
    border-radius: 1rem;
  }

  .punishment-card {
    padding: 1.5rem 1rem;
  }

  .action-buttons {
    flex-direction: column;
    align-items: stretch;
  }

  .action-buttons .btn-complete,
  .action-buttons .btn-skip {
    width: 100%;
    text-align: center;
    justify-content: center;
  }

  .player-input-row {
    flex-direction: column;
  }

  .player-input-row button {
    width: 100%;
  }

  .custom-add-row {
    flex-direction: column;
  }

  .custom-add-row button {
    width: 100%;
  }

  .setting-item {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.75rem;
  }

  .setting-control {
    width: 100%;
    justify-content: space-between;
  }

  .range-slider {
    flex: 1;
  }

  .history-item {
    flex-wrap: wrap;
    gap: 0.5rem;
  }

  .history-question {
    flex-basis: 100%;
    white-space: normal;
  }

  .toast {
    left: 1rem;
    right: 1rem;
    transform: translateX(0) translateY(100px);
    text-align: center;
    white-space: normal;
  }

  .toast.show {
    transform: translateX(0) translateY(0);
  }
}

/* ============================================================
   新增样式 - 积分系统、卡片系统、成就系统
   ============================================================ */

/* ---- 积分榜 ---- */
.score-board {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  padding: 0.75rem 1rem;
  margin-bottom: 1rem;
  background: linear-gradient(135deg, #f8fafc 0%, #eef2ff 100%);
}

.score-item {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 0.75rem;
  background: #fff;
  border-radius: 20px;
  font-size: 0.875rem;
  box-shadow: 0 1px 3px rgba(0,0,0,0.1);
  position: relative;
  overflow: hidden;
}

.score-item.leading {
  background: linear-gradient(135deg, #fef3c7 0%, #fde68a 100%);
  border: 2px solid #f59e0b;
}

.score-rank {
  font-size: 1rem;
}

.score-name {
  font-weight: 600;
  color: #1e293b;
}

.score-streak {
  font-size: 0.75rem;
}

.score-value {
  font-weight: 700;
  color: #6366f1;
  min-width: 30px;
  text-align: right;
}

.score-change {
  position: absolute;
  right: -5px;
  top: -5px;
  font-size: 0.75rem;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: 10px;
  animation: scoreFloat 1.5s ease-out forwards;
}

.score-change.positive {
  background: #10b981;
  color: #fff;
}

.score-change.negative {
  background: #ef4444;
  color: #fff;
}

@keyframes scoreFloat {
  0% { opacity: 1; transform: translateY(0); }
  100% { opacity: 0; transform: translateY(-20px); }
}

/* ---- 积分倍率提示 ---- */
.multiplier-hint {
  display: inline-block;
  padding: 0.25rem 0.5rem;
  border-radius: 12px;
  font-size: 0.75rem;
  font-weight: 700;
  margin-left: 0.5rem;
}

.multiplier-hint.positive {
  background: linear-gradient(135deg, #10b981 0%, #059669 100%);
  color: #fff;
}

.multiplier-hint.negative {
  background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
  color: #fff;
}

/* ---- 卡片动画遮罩 ---- */
.card-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.7);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}

.card-overlay.active {
  opacity: 1;
  pointer-events: auto;
}

.card-reveal {
  background: #fff;
  border-radius: 20px;
  padding: 2rem;
  text-align: center;
  transform: scale(0.5);
  transition: transform 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
  max-width: 300px;
}

.card-overlay.active .card-reveal {
  transform: scale(1);
}

.card-reveal.positive {
  border: 3px solid #10b981;
  box-shadow: 0 0 30px rgba(16, 185, 129, 0.5);
}

.card-reveal.negative {
  border: 3px solid #ef4444;
  box-shadow: 0 0 30px rgba(239, 68, 68, 0.5);
}

.card-reveal.neutral {
  border: 3px solid #6366f1;
  box-shadow: 0 0 30px rgba(99, 102, 241, 0.5);
}

.card-icon {
  font-size: 4rem;
  margin-bottom: 1rem;
}

.card-name {
  font-size: 1.5rem;
  font-weight: 700;
  color: #1e293b;
  margin-bottom: 0.5rem;
}

.card-effect {
  font-size: 1rem;
  color: #64748b;
}

/* ---- 玩家选择遮罩 ---- */
.player-select-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.7);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}

.player-select-overlay.active {
  opacity: 1;
  pointer-events: auto;
}

.player-select-content {
  background: #fff;
  border-radius: 20px;
  padding: 2rem;
  text-align: center;
  max-width: 400px;
  width: 90%;
}

.player-select-content h3 {
  margin-bottom: 1.5rem;
  color: #1e293b;
}

.player-select-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  justify-content: center;
}

.player-select-btn {
  padding: 0.75rem 1.5rem;
  background: linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%);
  color: #fff;
  border: none;
  border-radius: 25px;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
}

.player-select-btn:hover {
  transform: scale(1.05);
  box-shadow: 0 4px 15px rgba(99, 102, 241, 0.4);
}

/* ---- 游戏结束遮罩 ---- */
.game-end-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.85);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.5s ease;
}

.game-end-overlay.active {
  opacity: 1;
  pointer-events: auto;
}

.game-end-content {
  text-align: center;
  padding: 2rem;
}

.winner-announcement {
  margin-bottom: 2rem;
}

.winner-crown {
  font-size: 5rem;
  animation: bounce 1s ease infinite;
}

@keyframes bounce {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-20px); }
}

.winner-name {
  font-size: 3rem;
  font-weight: 800;
  color: #fff;
  text-shadow: 0 0 20px rgba(251, 191, 36, 0.8);
  margin: 1rem 0;
}

.winner-score {
  font-size: 2rem;
  color: #fbbf24;
  font-weight: 700;
}

.winner-title {
  font-size: 1.5rem;
  color: #a5b4fc;
  margin-top: 0.5rem;
}

.final-leaderboard {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  max-width: 300px;
  margin: 0 auto;
}

.final-rank {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 0.75rem 1rem;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 12px;
}

.final-rank.rank-1 {
  background: linear-gradient(135deg, rgba(251, 191, 36, 0.3) 0%, rgba(245, 158, 11, 0.3) 100%);
  border: 1px solid #fbbf24;
}

.final-rank.rank-2 {
  background: linear-gradient(135deg, rgba(156, 163, 175, 0.3) 0%, rgba(107, 114, 128, 0.3) 100%);
  border: 1px solid #9ca3af;
}

.final-rank.rank-3 {
  background: linear-gradient(135deg, rgba(180, 83, 9, 0.3) 0%, rgba(146, 64, 14, 0.3) 100%);
  border: 1px solid #b45309;
}

.rank-medal {
  font-size: 1.5rem;
}

.rank-name {
  flex: 1;
  color: #fff;
  font-weight: 600;
}

.rank-score {
  color: #a5b4fc;
  font-weight: 700;
}

.btn-restart {
  margin-top: 2rem;
  padding: 1rem 2rem;
  background: linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%);
  color: #fff;
  border: none;
  border-radius: 30px;
  font-size: 1.125rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
}

.btn-restart:hover {
  transform: scale(1.05);
  box-shadow: 0 4px 20px rgba(99, 102, 241, 0.5);
}

/* ---- 投票面板 ---- */
.vote-panel {
  text-align: center;
  padding: 2rem;
}

.vote-header {
  margin-bottom: 1.5rem;
}

.vote-header p {
  font-size: 1.25rem;
  color: #1e293b;
}

.vote-subtitle {
  color: #64748b;
  margin-top: 0.5rem;
}

.vote-buttons {
  display: flex;
  gap: 1rem;
  justify-content: center;
}

.vote-btn {
  padding: 1rem 2rem;
  border: none;
  border-radius: 15px;
  font-size: 1.125rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
}

.vote-btn.awesome {
  background: linear-gradient(135deg, #fbbf24 0%, #f59e0b 100%);
  color: #fff;
}

.vote-btn.awesome:hover {
  transform: scale(1.05);
  box-shadow: 0 4px 15px rgba(251, 191, 36, 0.5);
}

.vote-btn.normal {
  background: #e2e8f0;
  color: #64748b;
}

.vote-btn.normal:hover {
  background: #cbd5e1;
}

/* ---- 下一轮面板增强 ---- */
.next-round-score {
  font-size: 1.25rem;
  color: #6366f1;
  font-weight: 600;
  margin: 0.5rem 0;
}

.current-leader {
  font-size: 1rem;
  color: #f59e0b;
  margin-bottom: 1rem;
}

.next-round-buttons {
  display: flex;
  gap: 1rem;
  justify-content: center;
  flex-wrap: wrap;
}

.btn-end-game {
  padding: 0.875rem 1.5rem;
  background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
  color: #fff;
  border: none;
  border-radius: 25px;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
}

.btn-end-game:hover {
  transform: scale(1.05);
  box-shadow: 0 4px 15px rgba(239, 68, 68, 0.4);
}

/* ---- 成就弹窗 ---- */
.achievement-popup {
  position: fixed;
  top: 20%;
  left: 50%;
  transform: translateX(-50%) translateY(-30px);
  background: linear-gradient(135deg, #fef3c7 0%, #fde68a 100%);
  border: 3px solid #f59e0b;
  border-radius: 20px;
  padding: 1.5rem 2rem;
  z-index: 1001;
  opacity: 0;
  pointer-events: none;
  transition: all 0.4s ease;
  max-width: 350px;
  text-align: center;
}

.achievement-popup.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

.achievement-unlock {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.achievement-popup .achievement-icon {
  font-size: 3rem;
}

.achievement-popup .achievement-title {
  font-size: 0.875rem;
  color: #92400e;
  font-weight: 600;
}

.achievement-popup .achievement-name {
  font-size: 1.25rem;
  font-weight: 700;
  color: #1e293b;
}

.achievement-popup .achievement-desc {
  font-size: 0.875rem;
  color: #64748b;
  margin-top: 0.25rem;
}

.achievement-popup .achievement-reward {
  font-size: 1rem;
  color: #059669;
  font-weight: 700;
  margin-top: 0.5rem;
}

.achievement-popup .achievement-title-reward {
  font-size: 0.875rem;
  color: #7c3aed;
  font-weight: 600;
  margin-top: 0.25rem;
}

/* ---- 成就面板 ---- */
.achievement-panel {
  position: fixed;
  top: 0;
  right: -400px;
  width: 380px;
  max-width: 90vw;
  height: 100vh;
  background: #fff;
  box-shadow: -5px 0 30px rgba(0, 0, 0, 0.2);
  z-index: 1000;
  transition: right 0.3s ease;
  overflow-y: auto;
}

.achievement-panel.active {
  right: 0;
}

.achievement-panel-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1.5rem;
  border-bottom: 1px solid #e2e8f0;
  position: sticky;
  top: 0;
  background: #fff;
}

.achievement-panel-header h3 {
  font-size: 1.25rem;
  color: #1e293b;
}

.achievement-panel-header .close-btn {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: #f1f5f9;
  border: none;
  font-size: 1.25rem;
  color: #64748b;
  cursor: pointer;
  transition: all 0.2s ease;
}

.achievement-panel-header .close-btn:hover {
  background: #e2e8f0;
}

.achievement-list {
  padding: 1rem;
}

.achievement-item {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1rem;
  border-radius: 12px;
  margin-bottom: 0.75rem;
  transition: all 0.2s ease;
}

.achievement-item.unlocked {
  background: linear-gradient(135deg, #fef3c7 0%, #fde68a 100%);
  border: 1px solid #fbbf24;
}

.achievement-item.locked {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  opacity: 0.7;
}

.achievement-item .achievement-icon {
  font-size: 2rem;
  width: 50px;
  text-align: center;
}

.achievement-item .achievement-info {
  flex: 1;
}

.achievement-item .achievement-name {
  font-weight: 600;
  color: #1e293b;
  margin-bottom: 0.25rem;
}

.achievement-item .achievement-desc {
  font-size: 0.75rem;
  color: #64748b;
}

.achievement-item .achievement-progress {
  font-size: 0.75rem;
  color: #94a3b8;
  margin-top: 0.25rem;
}

.achievement-reward-badge {
  padding: 0.25rem 0.5rem;
  background: #10b981;
  color: #fff;
  border-radius: 10px;
  font-size: 0.75rem;
  font-weight: 600;
}

/* ---- 头部操作按钮 ---- */
.header-actions {
  display: flex;
  gap: 0.5rem;
}

.achievement-toggle {
  padding: 0.5rem 1rem;
  background: linear-gradient(135deg, #fbbf24 0%, #f59e0b 100%);
  color: #fff;
  border: none;
  border-radius: 20px;
  font-size: 0.875rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
}

.achievement-toggle:hover {
  transform: scale(1.05);
  box-shadow: 0 2px 10px rgba(251, 191, 36, 0.4);
}

/* ---- 连胜提示 ---- */
.streak-toast {
  background: linear-gradient(135deg, #f97316 0%, #ea580c 100%) !important;
  font-weight: 700;
}

/* ---- 响应式调整 ---- */
@media (max-width: 768px) {
  .score-board {
    justify-content: center;
  }

  .score-item {
    flex: 1;
    min-width: 120px;
    max-width: 180px;
  }

  .winner-name {
    font-size: 2rem;
  }

  .winner-score {
    font-size: 1.5rem;
  }

  .achievement-panel {
    width: 100%;
    right: -100%;
  }

  .vote-buttons {
    flex-direction: column;
  }

  .next-round-buttons {
    flex-direction: column;
    align-items: stretch;
  }

  .btn-next-round,
  .btn-end-game {
    width: 100%;
    text-align: center;
  }
}
