/* 2026新版GCP段位生死战 — 移动端优先 */
* { margin: 0; padding: 0; box-sizing: border-box; -webkit-tap-highlight-color: transparent; }

:root {
  --bg1: #0f1b3d;
  --bg2: #1e3a8a;
  --accent: #38bdf8;
  --gold: #fbbf24;
  --green: #34d399;
  --red: #f87171;
  --card: rgba(255, 255, 255, 0.08);
  --card-border: rgba(255, 255, 255, 0.14);
  --text: #f1f5f9;
  --text-dim: #94a3b8;
}

html, body { height: 100%; }
body {
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Helvetica Neue", sans-serif;
  background: linear-gradient(160deg, var(--bg1) 0%, var(--bg2) 60%, #0c4a6e 100%);
  background-attachment: fixed;
  color: var(--text);
  min-height: 100vh;
  max-width: 520px;
  margin: 0 auto;
  overflow-x: hidden;
}

.hidden { display: none !important; }

.screen { display: none; flex-direction: column; min-height: 100vh; padding: 24px 20px calc(24px + env(safe-area-inset-bottom)); }
.screen.active { display: flex; }

/* ---------- 首页 ---------- */
#screen-splash { justify-content: center; gap: 22px; text-align: center; }

.challenge-banner {
  background: linear-gradient(90deg, #f59e0b, #ef4444);
  border-radius: 12px;
  padding: 12px 16px;
  font-size: 15px;
  font-weight: 600;
  animation: pulse 1.6s infinite;
}
@keyframes pulse { 0%,100% { transform: scale(1); } 50% { transform: scale(1.03); } }

.badge-pill {
  display: inline-block;
  background: var(--card);
  border: 1px solid var(--card-border);
  border-radius: 999px;
  padding: 6px 16px;
  font-size: 13px;
  color: var(--text-dim);
}
.badge-pill b { color: var(--gold); font-size: 16px; }

.splash-title { font-size: 42px; line-height: 1.2; margin-top: 14px; letter-spacing: 2px; }
.splash-title .accent {
  background: linear-gradient(90deg, var(--accent), var(--gold));
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}
.splash-sub { margin-top: 12px; font-size: 13px; color: var(--text-dim); line-height: 1.7; }

.splash-card {
  background: var(--card);
  border: 1px solid var(--card-border);
  border-radius: 16px;
  padding: 18px;
  text-align: left;
}
.rule-line { font-size: 15px; line-height: 2.1; }

.splash-foot { font-size: 12px; color: var(--text-dim); }

/* ---------- 按钮 ---------- */
.btn-primary {
  background: linear-gradient(90deg, #38bdf8, #6366f1);
  color: #fff;
  border: none;
  border-radius: 999px;
  padding: 16px;
  font-size: 18px;
  font-weight: 700;
  width: 100%;
  cursor: pointer;
  box-shadow: 0 6px 20px rgba(56, 189, 248, 0.35);
  transition: transform 0.1s;
}
.btn-primary:active { transform: scale(0.97); }
.btn-sm { padding: 12px; font-size: 16px; margin-top: 14px; }

.btn-outline {
  background: transparent;
  color: var(--accent);
  border: 1.5px solid var(--accent);
  border-radius: 999px;
  padding: 14px;
  font-size: 16px;
  font-weight: 600;
  width: 100%;
  cursor: pointer;
}
.btn-ghost {
  background: transparent;
  color: var(--text-dim);
  border: none;
  padding: 12px;
  font-size: 15px;
  width: 100%;
  cursor: pointer;
}
.btn-ghost.light { color: #e2e8f0; text-decoration: underline; }

/* ---------- 答题页 ---------- */
#screen-quiz { gap: 12px; }
.quiz-head { display: flex; justify-content: space-between; align-items: center; font-size: 15px; color: var(--text-dim); }
.quiz-progress span { color: var(--text); font-size: 20px; font-weight: 700; }
.quiz-score b { color: var(--gold); font-size: 20px; }
.quiz-timer { font-size: 15px; }
.quiz-timer span { color: var(--accent); font-size: 20px; font-weight: 700; }
.quiz-timer.urgent span { color: var(--red); }

.timer-bar { height: 6px; background: var(--card); border-radius: 3px; overflow: hidden; }
.timer-fill { height: 100%; width: 100%; background: linear-gradient(90deg, var(--accent), var(--green)); border-radius: 3px; transition: width 0.2s linear; }
.timer-fill.urgent { background: var(--red); }

.combo-tip {
  text-align: center;
  color: var(--gold);
  font-weight: 800;
  font-size: 17px;
  animation: pop 0.5s;
}
@keyframes pop { 0% { transform: scale(0.4); opacity: 0; } 70% { transform: scale(1.15); } 100% { transform: scale(1); opacity: 1; } }

.quiz-card {
  background: var(--card);
  border: 1px solid var(--card-border);
  border-radius: 16px;
  padding: 20px 18px;
}
.q-text { font-size: 18px; font-weight: 700; line-height: 1.6; margin-bottom: 18px; }

.q-opts { display: flex; flex-direction: column; gap: 12px; }
.opt {
  background: rgba(255, 255, 255, 0.06);
  border: 1.5px solid var(--card-border);
  border-radius: 12px;
  padding: 14px 16px;
  font-size: 16px;
  line-height: 1.5;
  color: var(--text);
  text-align: left;
  cursor: pointer;
  transition: background 0.15s;
}
.opt:active { background: rgba(255, 255, 255, 0.14); }
.opt.correct { background: rgba(52, 211, 153, 0.22); border-color: var(--green); }
.opt.wrong { background: rgba(248, 113, 113, 0.22); border-color: var(--red); }
.opt:disabled { cursor: default; opacity: 0.9; }

.q-exp {
  background: rgba(251, 191, 36, 0.1);
  border: 1px solid rgba(251, 191, 36, 0.35);
  border-radius: 14px;
  padding: 16px;
  font-size: 14px;
  line-height: 1.7;
}
.exp-tag { color: var(--gold); font-weight: 700; font-size: 13px; margin-bottom: 6px; }

/* ---------- 结果页 ---------- */
#screen-result { justify-content: center; gap: 20px; text-align: center; }
.result-emoji { font-size: 64px; }
.result-title {
  font-size: 34px;
  font-weight: 900;
  margin-top: 8px;
  background: linear-gradient(90deg, var(--gold), #f97316);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}
.result-roast { margin-top: 10px; font-size: 15px; color: var(--text-dim); line-height: 1.6; }

.result-stats {
  display: flex;
  background: var(--card);
  border: 1px solid var(--card-border);
  border-radius: 16px;
  padding: 18px 0;
}
.stat { flex: 1; display: flex; flex-direction: column; gap: 4px; }
.stat b { font-size: 26px; color: var(--gold); }
.stat span { font-size: 12px; color: var(--text-dim); }
.stat + .stat { border-left: 1px solid var(--card-border); }

.result-cta { display: flex; flex-direction: column; gap: 12px; }

.follow-card {
  background: linear-gradient(120deg, rgba(52, 211, 153, 0.14), rgba(56, 189, 248, 0.14));
  border: 1px solid rgba(52, 211, 153, 0.35);
  border-radius: 16px;
  padding: 16px;
}
.follow-title { font-size: 15px; font-weight: 700; margin-bottom: 8px; }
.follow-text { font-size: 13px; color: var(--text-dim); line-height: 1.8; }
.follow-text b { color: var(--green); }

/* ---------- 浮层 ---------- */
.overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.88);
  z-index: 50;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 20px;
}
.poster-wrap { display: flex; flex-direction: column; align-items: center; gap: 12px; width: 100%; }
#poster-img { width: min(78vw, 340px); max-height: 72vh; border-radius: 12px; box-shadow: 0 10px 40px rgba(0, 0, 0, 0.6); }
.poster-tip { color: var(--gold); font-size: 15px; font-weight: 600; }

.share-arrow { position: absolute; top: 8px; right: 28px; font-size: 56px; color: var(--gold); animation: bounce 1s infinite; }
@keyframes bounce { 0%,100% { transform: translateY(0); } 50% { transform: translateY(-12px); } }
.share-guide-text { color: #fff; font-size: 18px; text-align: center; line-height: 1.8; }

/* ---------- 身份选择 ---------- */
#screen-role { justify-content: center; gap: 10px; text-align: center; }
.role-title { font-size: 30px; }
.role-sub { font-size: 13px; color: var(--text-dim); margin-bottom: 14px; }
.role-list { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.role-card {
  background: var(--card);
  border: 1.5px solid var(--card-border);
  border-radius: 16px;
  padding: 22px 12px;
  color: var(--text);
  cursor: pointer;
  display: flex;
  flex-direction: column;
  gap: 6px;
  align-items: center;
  transition: transform 0.1s;
}
.role-card:active { transform: scale(0.96); border-color: var(--accent); }
.role-emoji { font-size: 42px; }
.role-card b { font-size: 18px; }
.role-card small { font-size: 11px; color: var(--text-dim); line-height: 1.5; }

/* ---------- 幕间过场 ---------- */
#screen-act { justify-content: center; text-align: center; }
.act-wrap { display: flex; flex-direction: column; gap: 22px; animation: fadeUp 0.6s; }
@keyframes fadeUp { from { opacity: 0; transform: translateY(24px); } to { opacity: 1; transform: none; } }
.act-no {
  font-size: 40px;
  font-weight: 900;
  letter-spacing: 3px;
  background: linear-gradient(90deg, var(--accent), var(--gold));
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}
.act-intro { font-size: 16px; line-height: 2; color: #cbd5e1; text-align: left; padding: 0 6px; }
.act-tip {
  display: inline-block;
  margin: 0 auto;
  background: rgba(251, 191, 36, 0.12);
  border: 1px solid rgba(251, 191, 36, 0.4);
  color: var(--gold);
  border-radius: 999px;
  padding: 8px 18px;
  font-size: 14px;
}

/* ---------- 剧情气泡 / 生命 / BOSS ---------- */
.hearts { font-size: 17px; letter-spacing: 2px; }
.scene-bubble {
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid var(--card-border);
  border-radius: 16px 16px 16px 4px;
  padding: 14px 16px;
  animation: fadeUp 0.4s;
}
.scene-npc { font-size: 13px; color: var(--accent); margin-bottom: 6px; }
.scene-npc span { font-size: 18px; }
.scene-text { font-size: 15px; line-height: 1.7; color: #e2e8f0; }

.boss-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  background: rgba(248, 113, 113, 0.1);
  border: 1px solid rgba(248, 113, 113, 0.4);
  border-radius: 12px;
  padding: 10px 14px;
}
.boss-name { font-size: 14px; font-weight: 700; color: var(--red); white-space: nowrap; }
.boss-hp { flex: 1; height: 12px; background: rgba(0, 0, 0, 0.4); border-radius: 6px; overflow: hidden; }
.boss-hp-fill { height: 100%; width: 100%; background: linear-gradient(90deg, #ef4444, #f97316); border-radius: 6px; transition: width 0.5s; }
.boss-bar.boss-hit { animation: bossHit 0.5s; }
@keyframes bossHit { 0%, 100% { transform: none; } 25% { transform: translateX(-8px); } 50% { transform: translateX(8px); } 75% { transform: translateX(-4px); } }

body.shake { animation: shake 0.4s; }
@keyframes shake { 0%, 100% { transform: none; } 20% { transform: translateX(-10px); } 40% { transform: translateX(10px); } 60% { transform: translateX(-6px); } 80% { transform: translateX(6px); } }

/* ---------- 道具 ---------- */
.item-bar { display: flex; gap: 12px; }
.item-btn {
  flex: 1;
  background: rgba(251, 191, 36, 0.1);
  border: 1.5px solid rgba(251, 191, 36, 0.45);
  border-radius: 12px;
  padding: 10px;
  color: var(--gold);
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  gap: 3px;
  align-items: center;
}
.item-btn small { font-size: 11px; font-weight: 400; color: var(--text-dim); }
.item-btn:disabled { opacity: 0.35; filter: grayscale(1); }

.opt.ruled-out { opacity: 0.3; text-decoration: line-through; }
.opt.laobai-mark { border-color: var(--gold); box-shadow: 0 0 12px rgba(251, 191, 36, 0.45); }
.opt.laobai-mark::after { content: " 👈 老白说选这个"; color: var(--gold); font-size: 13px; }

/* ---------- 复活 / 结局 ---------- */
.revive-card {
  background: linear-gradient(160deg, #1e293b, #0f172a);
  border: 1px solid var(--card-border);
  border-radius: 20px;
  padding: 28px 22px;
  text-align: center;
  display: flex;
  flex-direction: column;
  gap: 14px;
  width: min(86vw, 360px);
}
.revive-emoji { font-size: 56px; }
.revive-title { font-size: 26px; font-weight: 900; }
.revive-text { font-size: 14px; color: var(--text-dim); line-height: 1.9; }
.revive-text b { color: var(--gold); }

.result-badge {
  display: inline-block;
  background: var(--card);
  border: 1px solid var(--card-border);
  border-radius: 999px;
  padding: 5px 16px;
  font-size: 13px;
  color: var(--text-dim);
  margin-bottom: 6px;
}

/* 提示气泡 */
.toast {
  position: fixed;
  left: 50%;
  bottom: 90px;
  transform: translateX(-50%);
  background: rgba(15, 23, 42, 0.95);
  border: 1px solid var(--card-border);
  color: #fff;
  padding: 12px 20px;
  border-radius: 999px;
  font-size: 14px;
  z-index: 99;
  white-space: nowrap;
}
