/* ===== 基础重置 ===== */
* { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  /* 背景色提亮，不再用纯黑 */
  --bg:       #13151f;
  --surface:  #1e2130;
  --surface2: #272b3f;
  --surface3: #2f3450;

  --accent:   #7c6ff7;   /* 紫色主色，稍亮 */
  --accent2:  #ff7096;
  --green:    #2ecc8a;
  --red:      #ff5370;
  --yellow:   #ffb830;
  --text:     #e8eaf0;   /* 主文字，不刺眼的白 */
  --muted:    #8890aa;
  --border:   rgba(255,255,255,0.07);

  --radius:    16px;
  --radius-sm: 10px;
  --radius-xs: 7px;

  --pad:        16px;
  --font-hero:  26px;
  --font-title: 17px;
  --font-base:  14px;
  --font-sm:    12px;
  --logo-size:  56px;
  --option-font:14px;
}

@media (min-width: 768px) {
  :root {
    --pad: 32px;
    --font-hero: 32px;
    --font-title: 19px;
    --font-base: 15px;
    --font-sm: 13px;
    --logo-size: 72px;
    --option-font: 15px;
  }
}

@media (min-width: 1024px) {
  :root {
    --pad: 48px;
    --font-hero: 36px;
    --font-title: 20px;
    --font-base: 15px;
    --font-sm: 13px;
    --logo-size: 72px;
    --option-font: 15px;
  }
}

html, body { height: 100%; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', 'Microsoft YaHei', sans-serif;
  min-height: 100vh;
  font-size: var(--font-base);
}

#app {
  width: 100%;
  max-width: 540px;
  margin: 0 auto;
  min-height: 100vh;
}

@media (min-width: 768px) { #app { max-width: 700px; } }
@media (min-width: 1024px) { #app { max-width: 960px; } }

/* ===== 屏幕切换 ===== */
.screen {
  display: none;
  flex-direction: column;
  min-height: 100vh;
  padding: var(--pad);
}
.screen.active { display: flex; }

/* ==========================================
   主菜单
   ========================================== */
.home-header {
  text-align: center;
  padding: 48px 0 28px;
}
.logo { font-size: var(--logo-size); margin-bottom: 12px; }
.home-header h1 {
  font-size: var(--font-hero);
  font-weight: 800;
  letter-spacing: -0.5px;
  background: linear-gradient(135deg, #a89cf7 0%, #7c6ff7 50%, #ff7096 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}
.subtitle { color: var(--muted); margin-top: 6px; font-size: var(--font-base); }

/* 统计栏 */
.stats-bar {
  display: flex;
  justify-content: space-around;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
  margin: 0 0 24px;
}
.stat { text-align: center; }
.stat-value { display: block; font-size: 22px; font-weight: 700; color: var(--accent); }
.stat-label { font-size: var(--font-sm); color: var(--muted); margin-top: 3px; }

/* 场景标签 */
.scenario-tag {
  display: inline-block;
  font-size: 11px;
  font-weight: 600;
  color: var(--accent);
  background: rgba(124,111,247,0.12);
  border: 1px solid rgba(124,111,247,0.22);
  border-radius: var(--radius-xs);
  padding: 3px 10px;
  margin-bottom: 14px;
  letter-spacing: 0.3px;
}
.scenario-tag:empty { display: none; }

/* 菜单卡片 */
.menu-cards {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

@media (min-width: 1024px) {
  .menu-cards { flex-direction: row; gap: 16px; }
  .menu-card { flex: 1; flex-direction: column; align-items: flex-start; gap: 12px; }
  .card-arrow { display: none; }
}

.menu-card {
  display: flex;
  align-items: center;
  gap: 16px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  cursor: pointer;
  transition: all 0.18s;
  position: relative;
}
.menu-card:not(.locked):hover {
  border-color: rgba(124,111,247,0.5);
  background: var(--surface2);
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(124,111,247,0.12);
}
.menu-card.locked { opacity: 0.4; cursor: not-allowed; }

.card-icon { font-size: 32px; flex-shrink: 0; }
.card-info { flex: 1; }
.card-info h2 { font-size: var(--font-title); font-weight: 700; color: var(--text); }
.card-info p { font-size: var(--font-sm); color: var(--muted); margin-top: 4px; line-height: 1.5; }
.card-arrow { font-size: 20px; color: var(--muted); flex-shrink: 0; }
.card-badge {
  position: absolute; top: 10px; right: 12px;
  background: var(--surface3); color: var(--muted);
  font-size: 10px; padding: 3px 8px; border-radius: 20px;
  border: 1px solid var(--border);
}

/* ==========================================
   游戏头部
   ========================================== */
.game-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 4px 0 16px;
  flex-shrink: 0;
}
.back-btn {
  background: none; border: none; color: var(--accent);
  font-size: 18px; cursor: pointer; padding: 6px 10px;
  border-radius: var(--radius-xs); font-family: inherit;
  transition: background 0.15s;
}
.back-btn:hover { background: var(--surface); }
.game-title { font-weight: 700; font-size: var(--font-title); color: var(--text); }
.game-score { font-size: var(--font-sm); color: var(--muted); }
.game-score span { color: var(--accent); font-weight: 700; font-size: 18px; }

/* ==========================================
   计时条
   ========================================== */
.timer-bar {
  height: 3px;
  background: var(--surface2);
  border-radius: 3px;
  margin-bottom: 20px;
  overflow: hidden;
  flex-shrink: 0;
}
.timer-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--accent), var(--accent2));
  border-radius: 3px;
  width: 100%;
  transition: width linear;
}

/* ==========================================
   游戏内容区
   ========================================== */
.game-body {
  display: flex;
  flex-direction: column;
  gap: 16px;
  flex: 1;
}

@media (min-width: 1024px) {
  .game-body { flex-direction: row; align-items: flex-start; gap: 24px; }
  .game-body .question-card { flex: 1; }
  .game-body .feedback-panel { flex: 1; min-height: 280px; }
}

/* ==========================================
   题目卡片
   ========================================== */
.question-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px 18px;
}

.situation { margin-bottom: 20px; }
.situation-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 0;
  border-bottom: 1px solid var(--border);
}
.situation-row:last-child { border-bottom: none; }
.sit-label { font-size: var(--font-sm); color: var(--muted); }
.sit-value { font-size: 22px; font-weight: 700; color: var(--text); }
.sit-value.bet { color: var(--yellow); }
.sit-value.highlight { color: var(--accent2); }

.question-text {
  font-size: var(--font-base);
  font-weight: 600;
  text-align: center;
  margin-bottom: 16px;
  color: var(--text);
}

/* ==========================================
   选项按钮
   ========================================== */
.options {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.option-btn {
  background: var(--surface2);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 14px 8px;
  font-size: var(--option-font);
  font-weight: 600;
  color: var(--text);
  cursor: pointer;
  text-align: center;
  transition: all 0.15s;
  font-family: inherit;
  line-height: 1.4;
}
.option-btn:hover:not(:disabled) {
  border-color: var(--accent);
  background: var(--surface3);
  color: #fff;
}
.option-btn.correct {
  border-color: var(--green);
  background: rgba(46,204,138,0.1);
  color: var(--green);
}
.option-btn.wrong {
  border-color: var(--red);
  background: rgba(255,83,112,0.1);
  color: var(--red);
}
.option-btn:disabled { cursor: not-allowed; }

#l2-options .option-btn { font-size: calc(var(--option-font) - 1px); padding: 12px 8px; }

/* ==========================================
   反馈面板
   ========================================== */
.feedback-panel {
  display: none;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px 20px;
  text-align: center;
  gap: 12px;
}
.feedback-panel.show {
  display: flex;
  animation: slideUp 0.25s ease;
}

@media (min-width: 1024px) {
  .feedback-panel {
    display: flex;
    visibility: hidden;
    opacity: 0;
    transition: opacity 0.2s, visibility 0.2s;
  }
  .feedback-panel.show {
    visibility: visible;
    opacity: 1;
    animation: none;
  }
}

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

.feedback-icon { font-size: 40px; }
.feedback-text { font-size: 18px; font-weight: 800; }
.feedback-text.ok   { color: var(--green); }
.feedback-text.fail { color: var(--red); }
.feedback-explain {
  font-size: var(--font-sm);
  color: var(--muted);
  line-height: 1.75;
  white-space: pre-wrap;
  max-width: 300px;
  text-align: left;
}

.next-btn {
  margin-top: 6px;
  background: var(--accent);
  color: #fff;
  border: none;
  border-radius: var(--radius-sm);
  padding: 12px 40px;
  font-size: var(--font-base);
  font-weight: 700;
  cursor: pointer;
  font-family: inherit;
  transition: opacity 0.18s, transform 0.15s;
  letter-spacing: 0.3px;
}
.next-btn:hover  { opacity: 0.85; transform: translateY(-1px); }
.next-btn:active { transform: translateY(0); }

/* ==========================================
   连胜
   ========================================== */
.streak-display {
  text-align: center;
  font-size: var(--font-base);
  color: var(--muted);
  padding: 14px 0 20px;
  flex-shrink: 0;
}
.streak-display span { color: var(--yellow); font-weight: 700; font-size: var(--font-title); }

/* ==========================================
   牌面展示
   ========================================== */
.board-display {
  display: flex;
  justify-content: center;
  gap: 8px;
  margin-bottom: 16px;
  flex-wrap: wrap;
}

/* ===== 扑克牌 ===== */
.playing-card {
  background: #f8f8fc;
  border-radius: 8px;
  width: 54px; height: 72px;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: flex-start;
  box-shadow: 0 2px 8px rgba(0,0,0,0.35), 0 0 0 1px rgba(0,0,0,0.08);
  flex-shrink: 0;
  position: relative;
  padding: 5px 0 0 5px;
  overflow: hidden;
}

/* 四色 — 红桃/方片明显区分 */
.playing-card.suit-spade   { color: #1c1c2e; }   /* 黑桃：深紫黑 */
.playing-card.suit-club    { color: #15652a; }   /* 草花：深绿 */
.playing-card.suit-heart   { color: #c0392b; }   /* 红桃：正红 */
.playing-card.suit-diamond { color: #d4620a; }   /* 方片：橙棕，明显区别于红桃 */

.playing-card .rank {
  font-size: 16px;
  font-weight: 900;
  line-height: 1;
  letter-spacing: -0.5px;
}
.playing-card .suit-small {
  font-size: 12px;
  line-height: 1;
  margin-top: 1px;
}
.playing-card .suit-big {
  position: absolute;
  bottom: 5px;
  left: 0; right: 0;
  text-align: center;
  font-size: 34px;
  line-height: 1;
}

@media (min-width: 768px) {
  .playing-card { width: 62px; height: 82px; padding: 6px 0 0 6px; }
  .playing-card .rank { font-size: 18px; }
  .playing-card .suit-small { font-size: 13px; }
  .playing-card .suit-big { font-size: 40px; }
}

/* ==========================================
   手牌展示行
   ========================================== */
.hand-row {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 14px;
  padding: 10px 14px;
  background: rgba(124,111,247,0.07);
  border: 1px solid rgba(124,111,247,0.2);
  border-radius: var(--radius-sm);
}
.hand-label {
  font-size: var(--font-sm);
  color: var(--accent);
  font-weight: 700;
  white-space: nowrap;
  flex-shrink: 0;
}
.hand-row .board-display {
  margin-bottom: 0;
  justify-content: flex-start;
  gap: 6px;
}
.hand-row.hidden { display: none; }

/* ==========================================
   情境文字
   ========================================== */
.scenario-text {
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 12px 14px;
  font-size: var(--font-sm);
  line-height: 1.8;
  color: var(--muted);
  margin-bottom: 16px;
}
