:root {
  --bg: #f4eadb;
  --panel: #fffaf2;
  --ink: #2d2119;
  --muted: #6f5d50;
  --accent: #a93627;
  --accent-dark: #7f261c;
  --gold: #d9bc67;
  --green: #2f6848;
  --line: #dec9af;
  --soft: #f7efe4;
  --shadow: 0 18px 42px rgba(61, 38, 20, 0.14);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  font-family: "Microsoft YaHei", "PingFang SC", sans-serif;
  background:
    radial-gradient(circle at 14% 0%, rgba(217, 188, 103, 0.26), transparent 28%),
    radial-gradient(circle at 88% 10%, rgba(169, 54, 39, 0.13), transparent 30%),
    linear-gradient(180deg, #fbf6ed 0%, var(--bg) 100%);
}

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

button,
input {
  font: inherit;
}

.app-shell {
  width: min(1220px, calc(100% - 28px));
  margin: 0 auto;
  padding: 28px 0 54px;
}

.hero {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  align-items: flex-start;
  margin-bottom: 22px;
  padding: 28px;
  border-radius: 18px;
  color: #fff8ef;
  background:
    linear-gradient(135deg, rgba(126, 34, 24, 0.94), rgba(50, 63, 48, 0.92)),
    url("assets/hanyu/hanyu-q3-memorial-lite.webp") center / cover;
  box-shadow: var(--shadow);
}

.eyebrow {
  margin: 0 0 8px;
  font-size: 13px;
  letter-spacing: 0.08em;
  opacity: 0.82;
}

h1 {
  margin-bottom: 10px;
  font-size: clamp(2.1rem, 4vw, 4.1rem);
  line-height: 1.08;
}

.hero-copy {
  max-width: 760px;
  margin-bottom: 0;
  line-height: 1.85;
  color: rgba(255, 248, 239, 0.92);
}

.ghost-button,
.primary-button,
.choice-button,
.tool-button {
  display: inline-flex;
  min-height: 42px;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  border: 0;
  padding: 10px 16px;
  font-weight: 700;
  text-decoration: none;
  cursor: pointer;
  transition: transform 0.18s ease, background 0.18s ease;
}

.ghost-button {
  flex: 0 0 auto;
  border: 1px solid rgba(255, 248, 239, 0.36);
  color: #fff8ef;
  background: rgba(255, 248, 239, 0.12);
}

.primary-button,
.choice-button {
  color: #fff8ef;
  background: var(--accent);
}

.primary-button:disabled {
  color: #fff8ef;
  background: #c9b7a3;
  cursor: not-allowed;
}

.tool-button {
  border: 1px solid var(--line);
  color: var(--ink);
  background: #fffaf2;
}

.ghost-button:hover,
.primary-button:hover,
.choice-button:hover,
.tool-button:hover {
  transform: translateY(-1px);
}

.panel,
.card,
.choice-card,
.history-box,
.question-box,
.score-card,
.route-item {
  border: 1px solid rgba(169, 54, 39, 0.14);
  background: rgba(255, 250, 242, 0.96);
  box-shadow: var(--shadow);
}

.panel {
  border-radius: 20px;
  padding: 22px;
}

.intro-grid {
  display: grid;
  grid-template-columns: minmax(280px, 1fr) minmax(280px, 1fr);
  gap: 18px;
}

.card,
.choice-card,
.score-card {
  border-radius: 8px;
  padding: 20px;
}

.form-grid {
  display: grid;
  gap: 14px;
}

label {
  display: grid;
  gap: 8px;
  font-weight: 700;
}

input {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 12px 14px;
  color: var(--ink);
  background: #fffdf7;
}

.bullet-list {
  margin: 0;
  padding-left: 20px;
  line-height: 1.8;
}

.game-layout {
  display: grid;
  gap: 18px;
}

.top-bar {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 14px;
  align-items: start;
}

.score-strip {
  display: grid;
  grid-template-columns: repeat(2, minmax(190px, 1fr));
  gap: 12px;
}

.score-card {
  padding: 16px;
  box-shadow: none;
}

.score-label {
  margin-bottom: 6px;
  color: var(--muted);
  font-size: 14px;
}

.score-number {
  font-size: 28px;
  font-weight: 900;
  color: var(--accent-dark);
  white-space: nowrap;
}

.score-number small {
  font-size: 0.62em;
}

.meter {
  height: 9px;
  margin-top: 12px;
  overflow: hidden;
  border-radius: 99px;
  background: #eadbc7;
}

.meter span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--gold), var(--accent));
}

.kit {
  position: relative;
  justify-self: end;
}

.kit-panel {
  position: absolute;
  z-index: 3;
  top: 52px;
  right: 0;
  width: min(380px, calc(100vw - 42px));
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 16px;
  background: #fffdf8;
  box-shadow: var(--shadow);
}

.kit-panel[hidden] {
  display: none;
}

.stage-title {
  margin-bottom: 14px;
  font-size: 28px;
}

.stage-image {
  display: block;
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  border-radius: 14px;
  border: 1px solid rgba(169, 54, 39, 0.18);
  background: #eadbc7;
}

.scene-text {
  display: grid;
  gap: 10px;
  margin: 18px 0;
  border: 1px solid rgba(169, 54, 39, 0.12);
  border-radius: 10px;
  padding: 16px;
  line-height: 1.9;
  background: #fffaf4;
}

.text-block,
.quote-block {
  margin: 0;
  border: 0;
  border-radius: 0;
  padding: 0;
  background: transparent;
}

.quote-block {
  border-left: 5px solid rgba(47, 104, 72, 0.45);
  padding-left: 14px;
  color: #244c38;
}

.question-box {
  margin: 18px 0;
  border-left: 7px solid #d8927f;
  border-radius: 8px;
  padding: 18px 20px;
  color: var(--accent-dark);
  font-size: 21px;
  font-weight: 900;
  background: #fffdf8;
}

.choices-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: 14px;
}

.choice-card {
  display: grid;
  min-height: 168px;
  align-content: space-between;
  gap: 16px;
  box-shadow: none;
}

.choice-card.selected {
  outline: 3px solid rgba(169, 54, 39, 0.22);
  background: #fff6ec;
}

.choice-card.disabled {
  opacity: 0.62;
}

.choice-title {
  margin-bottom: 0;
  font-size: 20px;
}

.feedback {
  display: grid;
  gap: 12px;
  margin-top: 18px;
}

.feedback-card {
  border: 1px solid rgba(47, 104, 72, 0.2);
  border-radius: 12px;
  padding: 18px;
  line-height: 1.9;
  background: #f1f4ea;
}

.feedback-card p {
  margin-bottom: 0;
}

.feedback-card p + p {
  margin-top: 10px;
}

.card p {
  white-space: pre-line;
}

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

.tag {
  border-radius: 999px;
  padding: 6px 10px;
  color: #fffaf2;
  font-size: 13px;
  font-weight: 700;
  background: var(--green);
}

.score-delta {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 6px;
  font-weight: 800;
  color: var(--accent-dark);
}

.history-box {
  border-radius: 12px;
  padding: 18px;
  background: #fffdf8;
}

.history-box h3 {
  color: var(--accent-dark);
}

.branch-card {
  border: 1px solid rgba(47, 104, 72, 0.22);
  border-radius: 12px;
  padding: 18px;
  background: #eef2e8;
}

.branch-card .choices-grid {
  margin-top: 16px;
}

.summary-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 16px;
}

.route-list {
  display: grid;
  gap: 8px;
  margin-top: 16px;
}

.route-item {
  position: relative;
  border-radius: 8px;
  padding: 12px 14px;
  box-shadow: none;
}

.route-item:not(:last-child)::after {
  content: "↓";
  display: block;
  margin: 8px 0 -3px 8px;
  color: var(--accent-dark);
  font-weight: 900;
}

.summary-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 18px;
}

@media (max-width: 760px) {
  .app-shell {
    width: min(100% - 18px, 1220px);
    padding-top: 12px;
  }

  .hero,
  .top-bar,
  .intro-grid {
    grid-template-columns: 1fr;
  }

  .hero {
    display: grid;
    padding: 22px;
  }

  .score-strip {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
  }

  .score-card {
    padding: 10px 12px;
  }

  .score-label {
    margin-bottom: 4px;
    font-size: 13px;
  }

  .score-number {
    font-size: 22px;
  }

  .meter {
    height: 6px;
    margin-top: 8px;
  }

  .kit {
    justify-self: stretch;
  }

  .kit-panel {
    left: 0;
    right: auto;
  }
}
