/* style.css - 龙虾一站到底 全局样式 */
:root {
  --primary: #e74c3c;
  --primary-dark: #c0392b;
  --accent: #f39c12;
  --accent-light: #f1c40f;
  --bg: #1a1a2e;
  --bg-card: #16213e;
  --bg-light: #0f3460;
  --text: #eee;
  --text-dim: #999;
  --success: #2ecc71;
  --danger: #e74c3c;
  --border: rgba(255,255,255,0.1);
}
* { margin: 0; padding: 0; box-sizing: border-box; }
body {
  font-family: -apple-system, 'PingFang SC', 'Microsoft YaHei', sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  overflow-x: hidden;
}
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

/* 通用容器 */
.container { max-width: 600px; margin: 0 auto; padding: 16px; }
.container-wide { max-width: 900px; margin: 0 auto; padding: 16px; }

/* 头部 */
.header {
  text-align: center;
  padding: 20px 16px 12px;
  background: linear-gradient(135deg, var(--primary-dark), var(--bg-light));
  border-bottom: 2px solid var(--accent);
}
.header h1 { font-size: 24px; margin-bottom: 4px; }
.header .subtitle { color: var(--text-dim); font-size: 14px; }
.header .lobster-emoji { font-size: 36px; display: block; margin-bottom: 8px; }

/* 卡片 */
.card {
  background: var(--bg-card);
  border-radius: 12px;
  padding: 16px;
  margin-bottom: 12px;
  border: 1px solid var(--border);
}
.card-title { font-size: 16px; font-weight: 600; margin-bottom: 8px; color: var(--accent); }

/* 按钮 */
.btn {
  display: inline-block;
  padding: 12px 24px;
  border: none;
  border-radius: 8px;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
  text-align: center;
}
.btn:active { transform: scale(0.96); }
.btn-primary { background: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-dark); }
.btn-accent { background: var(--accent); color: #000; }
.btn-accent:hover { background: var(--accent-light); }
.btn-outline { background: transparent; border: 2px solid var(--primary); color: var(--primary); }
.btn-block { display: block; width: 100%; }
.btn-sm { padding: 8px 16px; font-size: 14px; }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }

/* 输入框 */
.input {
  width: 100%;
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--bg);
  color: var(--text);
  font-size: 16px;
  outline: none;
}
.input:focus { border-color: var(--accent); }

/* 龙虾头像 */
.lobster-avatar {
  width: 48px; height: 48px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 28px;
  background: linear-gradient(135deg, var(--primary), var(--accent));
  flex-shrink: 0;
}
.lobster-avatar.eliminated {
  filter: grayscale(1);
  opacity: 0.4;
}

/* 玩家列表 */
.player-list { display: flex; flex-wrap: wrap; gap: 8px; }
.player-item {
  display: flex; align-items: center; gap: 8px;
  background: var(--bg); padding: 8px 12px; border-radius: 8px;
  font-size: 14px;
}
.player-item.eliminated { opacity: 0.4; text-decoration: line-through; }

/* 答题区 */
.question-box {
  text-align: center;
  padding: 20px;
  margin: 16px 0;
}
.question-text {
  font-size: 20px;
  font-weight: 600;
  margin-bottom: 20px;
  line-height: 1.5;
}
.question-meta {
  font-size: 13px;
  color: var(--text-dim);
  margin-bottom: 12px;
}
.options-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  max-width: 500px;
  margin: 0 auto;
}
.option-btn {
  padding: 16px;
  border: 2px solid var(--border);
  border-radius: 12px;
  background: var(--bg);
  color: var(--text);
  font-size: 16px;
  cursor: pointer;
  transition: all 0.3s;
  text-align: center;
  min-height: 60px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.option-btn:hover { border-color: var(--accent); background: rgba(243,156,18,0.1); }
.option-btn:active { transform: scale(0.96); }
.option-btn.selected { border-color: var(--accent); background: rgba(243,156,18,0.2); }
.option-btn.correct { border-color: var(--success); background: rgba(46,204,113,0.2); }
.option-btn.wrong { border-color: var(--danger); background: rgba(231,76,60,0.2); }
.option-btn:disabled { cursor: default; }
.option-label { font-weight: 700; margin-right: 8px; color: var(--accent); }

/* 计时器 */
.timer {
  font-size: 48px;
  font-weight: 700;
  text-align: center;
  color: var(--accent);
  margin: 12px 0;
}
.timer.urgent { color: var(--danger); animation: pulse 0.5s infinite; }

/* 状态栏 */
.status-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 16px;
  background: var(--bg-card);
  border-bottom: 1px solid var(--border);
  font-size: 14px;
}

/* 排行榜 */
.rank-table { width: 100%; border-collapse: collapse; }
.rank-table th, .rank-table td {
  padding: 10px 8px;
  text-align: left;
  border-bottom: 1px solid var(--border);
}
.rank-table th { color: var(--accent); font-size: 13px; }
.rank-table tr:hover { background: rgba(255,255,255,0.03); }
.rank-num { font-weight: 700; color: var(--accent); width: 40px; }
.rank-num.gold { color: #ffd700; }
.rank-num.silver { color: #c0c0c0; }
.rank-num.bronze { color: #cd7f32; }

/* Tab切换 */
.tabs { display: flex; gap: 0; margin-bottom: 16px; }
.tab {
  flex: 1;
  padding: 10px;
  text-align: center;
  cursor: pointer;
  border-bottom: 2px solid transparent;
  color: var(--text-dim);
  font-size: 14px;
  transition: all 0.2s;
}
.tab.active { color: var(--accent); border-bottom-color: var(--accent); }

/* 动画 */
@keyframes pulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.05); }
}
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}
@keyframes slideOut {
  from { opacity: 1; transform: translateY(0); }
  to { opacity: 0; transform: translateY(50px); }
}
@keyframes shake {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-5px); }
  75% { transform: translateX(5px); }
}
.fade-in { animation: fadeIn 0.3s ease; }
.slide-out { animation: slideOut 0.5s ease forwards; }
.shake { animation: shake 0.3s ease; }

/* 比赛结果 */
.result-overlay {
  position: fixed; inset: 0;
  background: rgba(0,0,0,0.85);
  display: flex; align-items: center; justify-content: center;
  z-index: 100;
}
.result-card {
  background: var(--bg-card);
  border-radius: 16px;
  padding: 24px;
  text-align: center;
  max-width: 400px;
  width: 90%;
  border: 2px solid var(--accent);
}
.result-card h2 { font-size: 24px; margin-bottom: 16px; }
.crown { font-size: 48px; display: block; margin-bottom: 8px; }

/* 管理后台 */
.admin-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.stat-card { text-align: center; padding: 16px; }
.stat-num { font-size: 28px; font-weight: 700; color: var(--accent); }
.stat-label { font-size: 13px; color: var(--text-dim); margin-top: 4px; }

/* 隐藏 */
.hidden { display: none !important; }

/* 响应式 */
@media (max-width: 480px) {
  .options-grid { grid-template-columns: 1fr; }
  .admin-grid { grid-template-columns: 1fr; }
  .timer { font-size: 36px; }
  .question-text { font-size: 18px; }
}

/* 安全区域 */
@supports (padding-bottom: env(safe-area-inset-bottom)) {
  body { padding-bottom: env(safe-area-inset-bottom); }
}

/* 观战看板 */
.board-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(80px, 1fr)); gap: 12px; padding: 16px; }
.board-lobster { text-align: center; transition: all 0.5s; }
.board-lobster .avatar { font-size: 40px; display: block; margin-bottom: 4px; transition: all 0.5s; }
.board-lobster .name { font-size: 12px; color: var(--text-dim); }
.board-lobster.eliminated .avatar { filter: grayscale(1); opacity: 0.3; transform: translateY(20px); }
.board-lobster.eliminated .name { text-decoration: line-through; }
.board-question { text-align: center; padding: 24px; font-size: 22px; font-weight: 600; }
.board-stats { display: flex; justify-content: center; gap: 24px; padding: 12px; font-size: 14px; }
.board-stats .stat { text-align: center; }
.board-stats .stat-val { font-size: 24px; font-weight: 700; color: var(--accent); }
.board-timer { text-align: center; font-size: 64px; font-weight: 700; color: var(--accent); }
.board-timer.urgent { color: var(--danger); animation: pulse 0.5s infinite; }
.board-options { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; max-width: 600px; margin: 12px auto; }
.board-opt { padding: 12px; border-radius: 8px; background: var(--bg-card); border: 1px solid var(--border); text-align: center; transition: all 0.3s; }
.board-opt.correct { border-color: var(--success); background: rgba(46,204,113,0.2); }
.board-banner { text-align: center; padding: 40px; font-size: 28px; font-weight: 700; }
