:root {
  --bg: #fff7ec;
  --ink: #27212f;
  --muted: #6d6474;
  --card: rgba(255, 255, 255, 0.88);
  --line: rgba(39, 33, 47, 0.12);
  --primary: #7567ff;
  --primary-dark: #5747e8;
  --pink: #ff7aaf;
  --yellow: #ffd166;
  --green: #52d3a2;
  --shadow: 0 24px 60px rgba(65, 52, 117, 0.18);
}

* {
  box-sizing: border-box;
}

html {
  min-height: 100%;
}

body {
  min-height: 100vh;
  margin: 0;
  color: var(--ink);
  font-family: "Microsoft YaHei", "PingFang SC", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background:
    radial-gradient(circle at 15% 12%, rgba(255, 209, 102, 0.75), transparent 28%),
    radial-gradient(circle at 82% 18%, rgba(117, 103, 255, 0.28), transparent 24%),
    radial-gradient(circle at 85% 82%, rgba(82, 211, 162, 0.35), transparent 25%),
    linear-gradient(135deg, #fff8eb 0%, #f8f1ff 100%);
}

body::before,
body::after {
  position: fixed;
  z-index: -1;
  width: 180px;
  height: 180px;
  border-radius: 38% 62% 48% 52%;
  content: "";
  opacity: 0.35;
  filter: blur(1px);
}

body::before {
  top: 8%;
  left: 5%;
  background: var(--pink);
  transform: rotate(18deg);
}

body::after {
  right: 4%;
  bottom: 7%;
  background: var(--green);
  transform: rotate(-16deg);
}

button,
textarea {
  font: inherit;
}

button {
  -webkit-tap-highlight-color: transparent;
}

.app-shell {
  width: min(960px, 100%);
  min-height: 100vh;
  margin: 0 auto;
  padding: clamp(18px, 4vw, 44px);
  display: grid;
  place-items: center;
}

.card {
  width: min(760px, 100%);
  padding: clamp(22px, 5vw, 44px);
  border: 1px solid var(--line);
  border-radius: 32px;
  background: var(--card);
  box-shadow: var(--shadow);
  backdrop-filter: blur(14px);
}

.hero,
.result {
  text-align: center;
}

.hidden {
  display: none !important;
}

.badge {
  width: fit-content;
  margin: 0 auto 18px;
  padding: 8px 14px;
  border: 1px solid rgba(117, 103, 255, 0.18);
  border-radius: 999px;
  color: var(--primary-dark);
  background: rgba(117, 103, 255, 0.1);
  font-size: 14px;
  font-weight: 700;
}

h1,
h2,
p {
  margin-top: 0;
}

h1 {
  margin-bottom: 14px;
  font-size: clamp(42px, 9vw, 72px);
  line-height: 0.98;
  letter-spacing: -0.06em;
}

h2 {
  margin-bottom: 26px;
  font-size: clamp(26px, 5vw, 42px);
  line-height: 1.18;
  letter-spacing: -0.04em;
}

.lead {
  max-width: 620px;
  margin-right: auto;
  margin-bottom: 28px;
  margin-left: auto;
  color: var(--muted);
  font-size: clamp(16px, 2.4vw, 19px);
  line-height: 1.75;
}

.setup-panel {
  margin: 26px auto;
  text-align: left;
}

.setup-panel label {
  display: block;
  margin-bottom: 10px;
  font-weight: 800;
}

textarea {
  width: 100%;
  min-height: 128px;
  padding: 16px 18px;
  border: 2px solid transparent;
  border-radius: 22px;
  color: var(--ink);
  outline: none;
  resize: vertical;
  background: #fff;
  box-shadow: inset 0 0 0 1px var(--line);
  transition: border-color 0.2s, box-shadow 0.2s;
}

textarea:focus {
  border-color: rgba(117, 103, 255, 0.38);
  box-shadow: 0 0 0 5px rgba(117, 103, 255, 0.12);
}

.hint {
  margin: 10px 0 0;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.6;
}

.center {
  text-align: center;
}

.primary-btn,
.ghost-btn,
.option-btn {
  border: 0;
  border-radius: 999px;
  cursor: pointer;
  font-weight: 800;
  transition: transform 0.16s ease, box-shadow 0.16s ease, background 0.16s ease;
}

.primary-btn {
  width: min(340px, 100%);
  padding: 16px 24px;
  color: #fff;
  background: linear-gradient(135deg, var(--primary), var(--pink));
  box-shadow: 0 14px 26px rgba(117, 103, 255, 0.28);
  font-size: 18px;
}

.ghost-btn {
  padding: 10px 16px;
  color: var(--primary-dark);
  background: rgba(117, 103, 255, 0.1);
}

.primary-btn:hover,
.ghost-btn:hover,
.option-btn:hover {
  transform: translateY(-2px);
}

.primary-btn:active,
.ghost-btn:active,
.option-btn:active {
  transform: translateY(0);
}

.topbar {
  display: flex;
  gap: 18px;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 26px;
}

.progress-wrap {
  flex: 1;
  min-width: 0;
  color: var(--muted);
  font-size: 14px;
  font-weight: 700;
  text-align: right;
}

.progress-track {
  height: 10px;
  margin-top: 8px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(39, 33, 47, 0.09);
}

.progress-fill {
  width: 0;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--green), var(--primary));
  transition: width 0.28s ease;
}

.player-chip {
  display: inline-flex;
  max-width: 100%;
  margin-bottom: 18px;
  padding: 9px 14px;
  border-radius: 999px;
  color: #4f4100;
  background: rgba(255, 209, 102, 0.55);
  font-weight: 800;
  overflow-wrap: anywhere;
}

.option-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.option-btn {
  min-height: 72px;
  padding: 18px;
  border: 2px solid rgba(117, 103, 255, 0.12);
  color: var(--ink);
  background: #fff;
  box-shadow: 0 10px 22px rgba(39, 33, 47, 0.08);
  font-size: clamp(15px, 2.5vw, 18px);
  line-height: 1.4;
  white-space: normal;
  overflow-wrap: anywhere;
}

.option-btn:nth-child(2n) {
  border-color: rgba(255, 122, 175, 0.2);
}

.option-btn:nth-child(3n) {
  border-color: rgba(82, 211, 162, 0.24);
}

.option-btn:focus-visible,
.primary-btn:focus-visible,
.ghost-btn:focus-visible {
  outline: 4px solid rgba(117, 103, 255, 0.24);
  outline-offset: 3px;
}

.score-orbit {
  display: grid;
  place-items: center;
  margin-bottom: 20px;
}

.score-ring {
  width: clamp(150px, 40vw, 210px);
  aspect-ratio: 1;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background:
    radial-gradient(circle at center, #fff 0 58%, transparent 59%),
    conic-gradient(var(--primary), var(--pink), var(--yellow), var(--green), var(--primary));
  box-shadow: 0 18px 36px rgba(117, 103, 255, 0.2);
}

.score-ring span {
  font-size: clamp(44px, 12vw, 72px);
  font-weight: 900;
  letter-spacing: -0.06em;
}

.score-ring small {
  margin-top: -52px;
  color: var(--muted);
  font-weight: 800;
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  margin: 28px 0;
}

.stats-grid div {
  padding: 18px;
  border-radius: 22px;
  background: rgba(255, 255, 255, 0.74);
  box-shadow: inset 0 0 0 1px var(--line);
}

.stats-grid strong,
.stats-grid span {
  display: block;
}

.stats-grid strong {
  min-height: 46px;
  margin-bottom: 8px;
  font-size: 17px;
  line-height: 1.35;
}

.stats-grid span {
  color: var(--muted);
  font-size: 14px;
  font-weight: 700;
}

.breakdown {
  display: grid;
  gap: 12px;
  margin: 28px 0 0;
  text-align: left;
}

.break-card {
  padding: 16px;
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.78);
  box-shadow: inset 0 0 0 1px var(--line);
}

.break-card strong {
  display: block;
  margin-bottom: 8px;
  line-height: 1.45;
}

.answer-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.answer-pill {
  padding: 6px 10px;
  border-radius: 999px;
  color: var(--muted);
  background: rgba(39, 33, 47, 0.07);
  font-size: 13px;
}

@media (max-width: 620px) {
  .app-shell {
    align-items: start;
    padding: 14px;
  }

  .card {
    border-radius: 24px;
  }

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

  .progress-wrap {
    text-align: left;
  }

  .option-grid,
  .stats-grid {
    grid-template-columns: 1fr;
  }

  .ghost-btn {
    width: 100%;
  }
}
