:root {
  --bg: #0a0f1d;
  --bg2: #121a30;
  --panel: rgba(14, 23, 45, 0.86);
  --line: rgba(118, 162, 255, 0.22);
  --text: #edf4ff;
  --muted: #a8b8dc;
  --green: #7dffb3;
  --cyan: #53dfff;
  --pink: #ff6fb6;
  --gold: #ffd86b;
  --danger: #ff7a8a;
  --shadow: 0 18px 40px rgba(0, 0, 0, 0.35);
}
* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; }
body {
  font-family: "PingFang SC", "Microsoft YaHei", sans-serif;
  color: var(--text);
  background:
    radial-gradient(circle at 20% 0%, rgba(83, 223, 255, 0.16), transparent 34%),
    radial-gradient(circle at 90% 10%, rgba(255, 111, 182, 0.14), transparent 38%),
    linear-gradient(160deg, var(--bg), var(--bg2));
}
button, textarea { font: inherit; }
.app-shell { width: min(820px, 94vw); margin: 0 auto; padding: 18px 0 32px; }
.topbar { display: flex; justify-content: space-between; gap: 16px; align-items: flex-start; margin-bottom: 18px; }
.eyebrow { color: var(--cyan); font-size: .82rem; letter-spacing: .08em; text-transform: uppercase; }
h1 { margin: 6px 0 0; font-size: clamp(2rem, 6vw, 3rem); }
.highscore-box, .panel, .stat-card, .message-card, .choice-btn, .result-card {
  background: var(--panel);
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
  backdrop-filter: blur(8px);
}
.highscore-box {
  border-radius: 18px; padding: 14px 16px; min-width: 112px; text-align: center;
}
.highscore-box span { display: block; color: var(--muted); font-size: .82rem; }
.highscore-box strong { display: block; margin-top: 4px; font-size: 1.5rem; color: var(--gold); }
.screen.hidden { display: none; }
.screen.active { display: block; }
.panel, .result-card, .hero-card { border-radius: 24px; padding: 22px; }
.hero-card {
  background: linear-gradient(180deg, rgba(18, 30, 58, 0.96), rgba(11, 18, 34, 0.94));
  border: 1px solid rgba(118, 162, 255, 0.24);
  box-shadow: var(--shadow);
}
.hero-kicker { margin: 0 0 10px; color: var(--gold); font-weight: 700; }
.hero-card h2 { margin: 0; line-height: 1.45; font-size: clamp(1.3rem, 4.6vw, 2rem); }
.bullet-list { margin: 16px 0 0; padding-left: 1.2rem; color: var(--muted); line-height: 1.75; }
.action-row { display: flex; gap: 12px; flex-wrap: wrap; margin-top: 20px; }
.primary-btn, .ghost-btn, .choice-btn {
  border: 0; border-radius: 16px; padding: 14px 18px; cursor: pointer; transition: transform .15s ease, box-shadow .2s ease, opacity .2s ease;
}
.primary-btn { background: linear-gradient(120deg, var(--cyan), #74a8ff); color: #061320; font-weight: 800; }
.ghost-btn { background: rgba(255,255,255,.04); color: var(--text); border: 1px solid rgba(255,255,255,.14); }
.primary-btn:hover, .ghost-btn:hover, .choice-btn:hover { transform: translateY(-2px); }
.mini-rules { margin-top: 18px; color: var(--muted); line-height: 1.75; }
.mini-rules.hidden { display: none; }
.hud-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.stat-card { border-radius: 18px; padding: 14px; text-align: center; }
.stat-card span { display: block; color: var(--muted); font-size: .85rem; }
.stat-card strong { display: block; font-size: 1.6rem; margin-top: 4px; }
.bar-stack { display: grid; gap: 10px; margin: 14px 0; }
.bar-block { background: rgba(255,255,255,.03); border-radius: 16px; padding: 10px 12px; border: 1px solid rgba(255,255,255,.08); }
.bar-label-row { display: flex; justify-content: space-between; color: var(--muted); font-size: .9rem; margin-bottom: 8px; }
.bar { height: 12px; border-radius: 999px; overflow: hidden; background: rgba(255,255,255,.08); }
.bar-fill { height: 100%; width: 0%; transition: width .25s ease; }
.bar.heat .bar-fill { background: linear-gradient(90deg, var(--green), var(--cyan)); }
.bar.cold .bar-fill { background: linear-gradient(90deg, #ff9ca7, var(--danger)); }
.chat-panel { border-radius: 24px; padding: 18px; }
.chat-head { display: flex; justify-content: space-between; gap: 16px; align-items: flex-start; margin-bottom: 16px; }
.chat-title { font-size: 1.1rem; font-weight: 800; }
.special-rule { color: var(--gold); margin-top: 6px; line-height: 1.55; }
.streak-tag {
  padding: 8px 12px; border-radius: 999px; background: rgba(125,255,179,.1); border: 1px solid rgba(125,255,179,.25); color: var(--green); font-size: .88rem; white-space: nowrap;
}
.bubble-wrap { display: flex; gap: 12px; align-items: flex-start; }
.avatar {
  width: 44px; height: 44px; border-radius: 14px; display: grid; place-items: center; font-weight: 800;
  background: linear-gradient(140deg, #1bd6ff, #6d7bff);
  color: #041420;
}
.message-card { flex: 1; border-radius: 20px; padding: 16px; }
.sender-row { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; color: var(--muted); font-size: .9rem; }
.topic-tag { padding: 4px 8px; border-radius: 999px; background: rgba(255,255,255,.06); border: 1px solid rgba(255,255,255,.08); }
.message-text { margin: 12px 0 0; line-height: 1.72; font-size: 1.08rem; }
.feedback-banner {
  margin-top: 14px; min-height: 54px; display: grid; place-items: center; text-align: center; border-radius: 16px;
  background: rgba(255,255,255,.05); color: var(--muted); padding: 10px 12px; transition: all .18s ease;
}
.feedback-banner.good { background: rgba(125,255,179,.12); color: var(--green); }
.feedback-banner.bad { background: rgba(255,122,138,.12); color: var(--danger); }
.feedback-banner.hype { background: rgba(255,216,107,.14); color: var(--gold); }
.choices { display: grid; gap: 12px; margin-top: 16px; }
.choice-btn {
  text-align: left; color: var(--text); padding: 16px 18px; border-radius: 18px; position: relative; overflow: hidden;
}
.choice-btn::after {
  content: ""; position: absolute; inset: auto -20% -35% auto; width: 120px; height: 120px; border-radius: 50%;
  background: radial-gradient(circle, rgba(255,255,255,.12), transparent 62%);
}
.choice-main { display: block; font-size: 1.08rem; font-weight: 800; }
.choice-sub { display: block; margin-top: 6px; color: var(--muted); font-size: .9rem; }
.choice-btn.disabled { opacity: .38; cursor: not-allowed; }
.result-card textarea {
  width: 100%; min-height: 120px; margin-top: 16px; border-radius: 16px; padding: 14px; resize: none;
  color: var(--text); background: rgba(4, 10, 24, .75); border: 1px solid rgba(255,255,255,.12);
}
.result-summary { color: var(--muted); line-height: 1.75; }
.result-metrics { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; margin-top: 16px; }
.result-metrics div { background: rgba(255,255,255,.04); border: 1px solid rgba(255,255,255,.08); border-radius: 18px; padding: 14px; }
.result-metrics span { display: block; color: var(--muted); font-size: .84rem; }
.result-metrics strong { display: block; margin-top: 4px; font-size: 1.35rem; }
@media (max-width: 640px) {
  .topbar { flex-direction: column; }
  .hud-grid, .result-metrics { grid-template-columns: 1fr 1fr; }
  .action-row > * { flex: 1; }
}
