:root {
  --bg: #ecf7ef;
  --ink: #132016;
  --muted: #617267;
  --green-950: #04351d;
  --green-850: #07552d;
  --green-700: #0a8b43;
  --green-100: #e3f5e9;
  --gold: #f5b331;
  --gold-soft: #ffe69b;
  --red: #e64c3c;
  --line: #d5e5dc;
  --white: #fff;
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background:
    radial-gradient(circle at 50% 0, rgba(245, 179, 49, 0.22), transparent 28%),
    linear-gradient(180deg, #f7fcf8 0%, var(--bg) 100%);
  color: var(--ink);
}

html,
body {
  height: 100%;
  overflow: hidden;
}

button,
input,
select {
  font: inherit;
}

button {
  cursor: pointer;
}

a {
  color: inherit;
  text-decoration: none;
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.48;
  filter: grayscale(0.25);
}

.app {
  width: min(460px, 100%);
  height: 100dvh;
  margin: 0 auto;
  padding: 10px 14px 14px;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.topbar {
  flex: 0 0 auto;
  z-index: 8;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin: 0 -14px;
  padding: 9px 14px;
  background: rgba(247, 252, 248, 0.9);
  border-bottom: 1px solid rgba(213, 229, 220, 0.76);
  backdrop-filter: blur(12px);
}

.topbar div {
  display: grid;
  gap: 2px;
}

.topbar strong {
  color: var(--green-950);
  font-size: 18px;
}

.topbar span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.ghost-btn {
  min-width: 58px;
  min-height: 34px;
  border: 1px solid rgba(10, 139, 67, 0.24);
  border-radius: 999px;
  background: var(--white);
  color: var(--green-850);
  font-weight: 900;
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.screen {
  display: none;
  flex: 1 1 auto;
  min-height: 0;
  padding-top: 10px;
  overflow: hidden;
}

.screen.active {
  display: block;
  animation: enter 180ms ease both;
}

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

.game-hero,
.entry-card,
.question-card,
.level-pass,
.result-card,
.score-grid div,
.poster,
.modal-card {
  border: 1px solid var(--line);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.9);
  box-shadow: 0 18px 46px rgba(4, 53, 29, 0.1);
}

.game-hero {
  position: relative;
  overflow: hidden;
  padding: 24px 20px;
  background:
    radial-gradient(circle at 82% 12%, rgba(255, 230, 155, 0.92), transparent 30%),
    linear-gradient(145deg, #0d9a4c 0%, var(--green-950) 100%);
  color: var(--white);
}

.game-hero::after {
  content: "AMC";
  position: absolute;
  right: -16px;
  bottom: 8px;
  color: rgba(255, 255, 255, 0.08);
  font-size: 92px;
  font-weight: 1000;
}

.season {
  display: inline-grid;
  place-items: center;
  min-height: 30px;
  margin: 0 0 14px;
  padding: 0 12px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.15);
  color: var(--gold-soft);
  font-weight: 900;
}

h1 {
  position: relative;
  z-index: 1;
  margin: 0;
  font-size: 38px;
  line-height: 1.08;
  letter-spacing: 0;
}

.game-hero > p:not(.season) {
  position: relative;
  z-index: 1;
  margin: 12px 0 0;
  color: rgba(255, 255, 255, 0.9);
  font-weight: 800;
  line-height: 1.55;
}

.hero-stats {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin-top: 18px;
}

.hero-stats span {
  display: grid;
  gap: 3px;
  min-height: 66px;
  padding: 10px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.13);
  color: rgba(255, 255, 255, 0.88);
  font-size: 12px;
  font-weight: 800;
}

.hero-stats b {
  color: var(--gold-soft);
  font-size: 21px;
}

.entry-card {
  display: grid;
  gap: 14px;
  margin-top: 14px;
  padding: 16px;
}

label,
.grade-pick {
  display: grid;
  gap: 8px;
  color: var(--green-950);
  font-weight: 900;
}

input,
select {
  width: 100%;
  min-height: 50px;
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 0 14px;
  outline: none;
  background: #f8fcfa;
  color: var(--ink);
}

input:focus,
select:focus {
  border-color: var(--green-700);
  box-shadow: 0 0 0 4px rgba(10, 139, 67, 0.1);
}

.grade-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}

.grade-grid button,
.options button {
  min-height: 46px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #f8fcfa;
  color: var(--ink);
}

.grade-grid button.selected,
.options button.selected {
  border-color: var(--green-700);
  background: var(--green-100);
  color: var(--green-950);
  font-weight: 900;
}

.grade-grid button.locked {
  color: #91a49a;
  background: #f4faf6;
}

.grade-grid button.locked::after {
  content: "暂未开放";
  display: block;
  font-size: 10px;
  font-weight: 800;
  color: #91a49a;
}

.primary-btn,
.secondary-btn {
  width: 100%;
  min-height: 54px;
  border-radius: 15px;
  font-weight: 1000;
}

.primary-btn {
  border: 0;
  background: linear-gradient(180deg, #12a854 0%, var(--green-950) 100%);
  color: var(--white);
  box-shadow: 0 8px 18px rgba(4, 53, 29, 0.16);
}

.primary-btn:active {
  transform: translateY(1px);
  box-shadow: 0 5px 12px rgba(4, 53, 29, 0.14);
}

.secondary-btn {
  border: 1px solid var(--line);
  background: var(--white);
  color: var(--green-850);
  box-shadow: 0 8px 18px rgba(4, 53, 29, 0.06);
}

.ladder {
  display: grid;
  gap: 0;
  overflow: hidden;
  margin-top: 14px;
}

.ladder-item {
  display: grid;
  grid-template-columns: 42px 1fr;
  gap: 12px;
  padding: 14px;
  border-bottom: 1px solid var(--line);
}

.ladder-item:last-child {
  border-bottom: 0;
}

.ladder-item span {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--green-100);
  color: var(--green-850);
  font-weight: 1000;
}

.ladder-item.active span {
  background: var(--gold);
  color: #6f4507;
}

.ladder-item b {
  color: var(--green-950);
}

.ladder-item p {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
}

.screen-head {
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr) 78px;
  align-items: center;
  gap: 10px;
  margin-bottom: 12px;
}

.screen-head button {
  width: 38px;
  height: 38px;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: var(--white);
  color: var(--green-950);
  font-size: 25px;
}

.quiz-title {
  display: grid;
  min-width: 0;
  gap: 3px;
}

.quiz-title strong {
  color: var(--green-950);
  font-size: 24px;
  line-height: 1.1;
}

.quiz-title span {
  color: var(--green-700);
  font-size: 13px;
  font-weight: 1000;
}

.timer-card {
  display: grid;
  place-items: center;
  min-height: 62px;
  border: 3px solid rgba(255, 255, 255, 0.86);
  border-radius: 20px;
  background: var(--gold);
  color: #704506;
  box-shadow: 0 10px 22px rgba(245, 179, 49, 0.34);
}

.timer-card small {
  align-self: end;
  font-size: 12px;
  font-weight: 1000;
  line-height: 1;
  opacity: 0.86;
}

#timer {
  display: grid;
  place-items: center;
  min-height: 36px;
  color: inherit;
  font-size: 32px;
  line-height: 1;
  font-weight: 1000;
}

.timer-card:has(#timer.danger) {
  background: var(--red);
  color: var(--white);
  box-shadow: 0 0 0 5px rgba(230, 76, 60, 0.12), 0 8px 18px rgba(230, 76, 60, 0.24);
  animation: pulse 680ms ease infinite;
}

@keyframes pulse {
  50% {
    transform: scale(1.07);
  }
}

.level-progress {
  display: grid;
  gap: 7px;
  margin-top: 10px;
}

.level-progress > div:first-child {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: end;
  gap: 2px 10px;
  margin: 0 2px;
  color: var(--green-950);
  font-weight: 900;
}

.level-progress > div:first-child span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
}

.level-progress strong {
  grid-column: 1;
  color: var(--green-950);
  font-size: 15px;
}

.level-progress b {
  grid-column: 2;
  grid-row: 1 / span 2;
  color: var(--green-700);
  font-size: 14px;
  white-space: nowrap;
}

.progress {
  height: 11px;
  overflow: hidden;
  border-radius: 999px;
  background: #d7e9df;
}

.progress span {
  display: block;
  width: 0;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--gold), var(--green-700));
  transition: width 200ms ease;
}

.question-card {
  margin-top: 14px;
  padding: 16px;
}

.question-card.shake {
  animation: shake 260ms ease;
}

@keyframes shake {
  25% {
    transform: translateX(-6px);
  }
  50% {
    transform: translateX(6px);
  }
  75% {
    transform: translateX(-4px);
  }
}

.question-card > p {
  margin: 0 0 8px;
  color: var(--green-700);
  font-weight: 1000;
}

.question-card h2 {
  margin: 0;
  color: var(--ink);
  font-size: 22px;
  line-height: 1.35;
}

.question-hint {
  display: grid;
  grid-template-columns: auto 1fr;
  align-items: center;
  gap: 9px;
  margin: 12px 0 0;
  padding: 11px 12px;
  border: 1px solid rgba(245, 179, 49, 0.34);
  border-radius: 14px;
  background:
    linear-gradient(180deg, rgba(255, 246, 216, 0.94), rgba(255, 251, 237, 0.84)),
    var(--white);
  color: #5f4310;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.72);
}

.question-hint[hidden] {
  display: none;
}

.question-hint span {
  display: inline-grid;
  place-items: center;
  min-height: 26px;
  padding: 0 9px;
  border-radius: 999px;
  background: rgba(245, 179, 49, 0.18);
  color: #7c5409;
  font-size: 12px;
  font-weight: 1000;
}

.question-hint strong {
  color: #4c3510;
  font-size: 15px;
  line-height: 1.36;
}

.question-visual {
  display: grid;
  gap: 10px;
  min-height: 112px;
  margin: 14px 0;
  padding: 14px;
  border-radius: 15px;
  border: 1px solid var(--line);
  background: #f8fcfa;
  font-size: 21px;
  font-weight: 1000;
}

.visual-row {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 9px;
}

.shape {
  display: inline-grid;
  place-items: center;
  width: 32px;
  height: 32px;
  color: var(--white);
  font-size: 16px;
}

.triangle {
  color: var(--green-700);
  background: transparent;
  font-size: 32px;
}

.circle {
  border-radius: 50%;
  background: var(--green-700);
}

.square {
  border-radius: 7px;
  background: var(--gold);
}

.diamond {
  border-radius: 7px;
  background: #2e9ca0;
  transform: rotate(45deg);
}

.options {
  display: grid;
  gap: 10px;
}

.options button {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 14px;
  text-align: left;
  font-weight: 850;
}

.options button.hidden-option {
  opacity: 0.24;
  pointer-events: none;
}

.options button.wrong {
  border-color: #f1a59d;
  background: #fff1ef;
}

.quiz-actions {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
  margin-top: 14px;
}

.hint-action {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.hint-action b {
  display: inline-grid;
  place-items: center;
  min-width: 28px;
  height: 28px;
  border-radius: 999px;
  background: var(--green-100);
  color: var(--green-850);
  font-size: 18px;
}

.level-pass,
.result-card {
  display: grid;
  place-items: center;
  gap: 14px;
  padding: 24px 18px;
  text-align: center;
}

.level-pass {
  min-height: calc(100vh - 120px);
  align-content: center;
  background:
    radial-gradient(circle at 50% 8%, rgba(255, 230, 155, 0.72), transparent 34%),
    var(--white);
}

.level-pass p,
.result-topline span {
  margin: 0;
  color: var(--green-700);
  font-weight: 1000;
}

.level-pass h2 {
  margin: 0;
  color: var(--green-950);
  font-size: 32px;
}

.level-pass strong {
  color: #8c5a0d;
}

.result-card {
  position: relative;
  overflow: hidden;
  justify-items: stretch;
  gap: 14px;
  padding: 22px 18px 18px;
  background:
    radial-gradient(circle at 50% 38%, rgba(245, 179, 49, 0.14), transparent 36%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.96), rgba(249, 253, 250, 0.92));
}

.result-card::before {
  content: "";
  position: absolute;
  inset: 18px 38px auto;
  height: 120px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(245, 179, 49, 0.16), transparent 68%);
  filter: blur(10px);
}

.result-card > * {
  position: relative;
  z-index: 1;
}

.result-topline {
  display: flex;
  justify-content: space-between;
  align-items: center;
  width: 100%;
  gap: 10px;
}

.result-topline span,
.result-topline b {
  display: inline-grid;
  place-items: center;
  min-height: 30px;
  padding: 0 12px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 1000;
}

.result-topline span {
  background: var(--green-100);
  color: var(--green-850);
}

.result-topline b {
  border: 1px solid rgba(245, 179, 49, 0.34);
  background: rgba(255, 246, 218, 0.88);
  color: #8b5a08;
}

.result-hero {
  display: grid;
  grid-template-columns: 46px minmax(0, 1fr) 46px;
  align-items: center;
  width: 100%;
  min-height: 138px;
  padding: 4px 0;
}

.percent-mark {
  display: grid;
  justify-items: center;
  gap: 3px;
  text-align: center;
}

.percent-mark small,
.percent-mark em {
  color: rgba(4, 53, 29, 0.7);
  font-style: normal;
  font-size: 15px;
  font-weight: 1000;
}

.percent-mark strong {
  color: var(--gold);
  font-size: 76px;
  line-height: 0.94;
  letter-spacing: 0;
  text-shadow: 0 9px 24px rgba(245, 179, 49, 0.2);
}

.laurel {
  width: 42px;
  height: 84px;
  opacity: 0.86;
  background:
    radial-gradient(ellipse at 50% 16%, rgba(245, 179, 49, 0.88) 0 20%, transparent 22%),
    radial-gradient(ellipse at 50% 34%, rgba(245, 179, 49, 0.74) 0 18%, transparent 20%),
    radial-gradient(ellipse at 50% 52%, rgba(245, 179, 49, 0.66) 0 17%, transparent 19%),
    radial-gradient(ellipse at 50% 70%, rgba(245, 179, 49, 0.56) 0 16%, transparent 18%);
}

.laurel.left {
  transform: rotate(-24deg);
}

.laurel.right {
  transform: scaleX(-1) rotate(-24deg);
}

.medal {
  width: 58px;
  height: 58px;
  border-radius: 50%;
  justify-self: center;
  margin-top: -10px;
  background:
    radial-gradient(circle at 34% 28%, rgba(255, 245, 201, 0.9), transparent 22%),
    linear-gradient(135deg, #ffeaa0, #f5b331 58%, #a76809);
  box-shadow:
    inset 9px 0 rgba(255, 255, 255, 0.3),
    inset -6px -8px rgba(113, 70, 9, 0.18),
    0 8px 0 #7a480b,
    0 14px 26px rgba(141, 91, 12, 0.18);
}

#honor-title {
  display: grid;
  place-items: center;
  min-height: 42px;
  width: min(100%, 340px);
  justify-self: center;
  border-radius: 999px;
  background: linear-gradient(90deg, #04351d, #07904a);
  color: var(--gold-soft);
  font-size: 19px;
  box-shadow: 0 12px 26px rgba(4, 53, 29, 0.18);
}

#result-summary {
  margin: 0;
  color: rgba(19, 32, 22, 0.58);
  font-weight: 900;
  text-align: center;
  line-height: 1.5;
}

.insight-card {
  display: grid;
  gap: 12px;
  padding: 14px;
  border: 1px solid rgba(10, 139, 67, 0.18);
  border-radius: 20px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.94), rgba(248, 253, 250, 0.88));
  box-shadow: 0 14px 34px rgba(4, 53, 29, 0.08);
}

.insight-card > div:first-child {
  display: grid;
  gap: 4px;
}

.insight-card span {
  color: rgba(19, 32, 22, 0.56);
  font-size: 12px;
  font-weight: 1000;
}

.insight-card strong {
  color: var(--green-950);
  font-size: 18px;
  line-height: 1.35;
}

.insight-tags {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}

.insight-tags b {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 5px;
  align-items: center;
  place-items: center;
  min-height: 34px;
  padding: 0 9px;
  border-radius: 999px;
  background:
    linear-gradient(180deg, rgba(227, 245, 233, 0.96), rgba(238, 248, 241, 0.88));
  color: var(--green-850);
  font-size: 12px;
  font-weight: 1000;
  white-space: nowrap;
}

.insight-tags b::before {
  content: "";
  width: 15px;
  height: 15px;
  border: 2px solid currentColor;
  border-radius: 5px;
  transform: rotate(45deg) scale(0.82);
  opacity: 0.78;
}

.score-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin: 4px 0 6px;
}

.score-grid div {
  display: grid;
  place-items: center;
  gap: 3px;
  min-height: 78px;
  padding: 10px 6px;
  border-radius: 18px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.95), rgba(248, 253, 250, 0.9));
}

.score-grid b {
  color: var(--green-850);
  font-size: 21px;
  line-height: 1.1;
  text-align: center;
}

.score-grid span {
  color: rgba(19, 32, 22, 0.5);
  font-size: 12px;
  font-weight: 900;
}

.poster {
  position: relative;
  display: grid;
  justify-items: start;
  align-content: start;
  gap: 12px;
  overflow: hidden;
  padding: 18px;
  background:
    radial-gradient(circle at 86% 10%, rgba(255, 232, 144, 0.7), transparent 22%),
    radial-gradient(circle at 12% 94%, rgba(29, 197, 101, 0.34), transparent 24%),
    linear-gradient(160deg, #13a756 0%, #07572d 42%, #032716 100%);
  color: var(--white);
}

.poster::before {
  content: "AMC";
  position: absolute;
  right: -18px;
  top: 74px;
  color: rgba(255, 255, 255, 0.08);
  font-size: 108px;
  font-weight: 1000;
  line-height: 1;
}

.poster::after {
  content: "";
  position: absolute;
  inset: 10px;
  border: 1px solid rgba(255, 230, 155, 0.36);
  border-radius: 14px;
  pointer-events: none;
}

.poster > * {
  position: relative;
  z-index: 1;
}

.poster p {
  margin: 0;
  font-weight: 1000;
}

.poster-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  width: 100%;
  gap: 10px;
}

.poster-top span,
.poster-top b {
  display: inline-grid;
  place-items: center;
  min-height: 30px;
  padding: 0 10px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.14);
  color: #fff4c4;
  font-size: 13px;
  font-weight: 1000;
}

.poster-top b {
  background: var(--gold);
  color: #684103;
}

.poster-kicker {
  color: #fff6d6;
  font-size: 16px;
  text-shadow: 0 2px 12px rgba(0, 0, 0, 0.18);
}

.poster h2 {
  margin: 0;
  color: var(--white);
  font-size: 34px;
  line-height: 1.12;
  text-shadow: 0 8px 24px rgba(0, 0, 0, 0.22);
}

.poster h2 span {
  color: var(--gold);
  font-size: 58px;
  letter-spacing: 0;
  text-shadow: 0 5px 0 rgba(4, 53, 29, 0.35);
}

.honor-ribbon {
  display: grid;
  grid-template-columns: auto 1fr;
  align-items: center;
  gap: 10px;
  width: 100%;
  min-height: 52px;
  padding: 8px 12px;
  border: 1px solid rgba(255, 255, 255, 0.38);
  border-radius: 14px;
  background: linear-gradient(90deg, #ffe796, #fff2bf);
  color: #704500;
  box-shadow: 0 12px 24px rgba(0, 0, 0, 0.16);
}

.honor-ribbon small {
  display: inline-grid;
  place-items: center;
  min-height: 26px;
  padding: 0 8px;
  border-radius: 999px;
  background: rgba(112, 69, 0, 0.1);
  font-size: 12px;
  font-weight: 1000;
}

.honor-ribbon strong {
  font-size: 21px;
  text-align: center;
}

.poster-ability {
  width: 100%;
  padding: 10px 12px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.12);
  color: #fff6d5;
  font-size: 15px;
  line-height: 1.35;
  text-shadow: 0 2px 12px rgba(0, 0, 0, 0.18);
}

.poster-challenge {
  display: grid;
  width: 100%;
  gap: 8px;
  padding: 12px;
  border-radius: 16px;
  background: #fff8d5;
  color: #113a22;
  box-shadow: 0 16px 30px rgba(0, 0, 0, 0.18);
}

.challenge-label {
  display: inline-grid;
  justify-self: start;
  place-items: center;
  min-height: 26px;
  padding: 0 10px;
  border-radius: 999px;
  background: var(--green-850);
  color: #fff8d8;
  font-size: 13px;
  font-weight: 1000;
}

.poster-taunt {
  width: 100%;
  color: var(--green-950);
  font-size: 17px;
  line-height: 1.35;
}

.poster-target {
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  width: 100%;
  gap: 7px;
  padding: 9px 0 2px;
  border-top: 1px solid rgba(7, 85, 45, 0.16);
}

.poster-target span {
  color: #52705d;
  font-size: 13px;
  font-weight: 1000;
}

.poster-target b {
  color: var(--green-850);
  font-size: 22px;
  font-weight: 1000;
}

.poster-target em {
  color: #d88900;
  font-style: normal;
  font-size: 28px;
}

.poster-target i {
  width: 1px;
  height: 18px;
  background: rgba(7, 85, 45, 0.24);
}

.challenge-code {
  display: grid;
  align-content: center;
  justify-items: start;
  justify-self: stretch;
  min-height: 36px;
  padding-top: 2px;
  color: #704500;
  text-align: left;
  font-weight: 1000;
}

.challenge-code strong {
  font-size: 14px;
  line-height: 1.35;
}

.modal {
  position: fixed;
  inset: 0;
  z-index: 20;
  display: none;
  place-items: center;
  padding: 18px;
  background: rgba(20, 34, 25, 0.34);
  backdrop-filter: blur(22px) saturate(1.15);
}

.modal.open {
  display: grid;
}

.modal-card {
  display: grid;
  gap: 10px;
  width: min(336px, calc(100% - 28px));
  padding: 18px;
}

.comeback-card {
  position: relative;
  justify-items: center;
  gap: 11px;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.64);
  border-radius: 26px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.66), rgba(255, 255, 255, 0.38)),
    rgba(255, 255, 255, 0.42);
  text-align: center;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.86),
    inset 0 -1px 0 rgba(255, 255, 255, 0.28),
    0 24px 58px rgba(8, 28, 15, 0.2);
  backdrop-filter: blur(28px) saturate(1.35);
}

.modal-eyebrow {
  display: inline-grid;
  place-items: center;
  min-height: 25px;
  margin: 0;
  padding: 0 11px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.54);
  background: rgba(255, 255, 255, 0.26);
  color: rgba(19, 32, 22, 0.52);
  font-size: 12px;
  font-weight: 800;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.62);
}

.modal-card h2 {
  margin: 0;
  color: rgba(4, 53, 29, 0.84);
  font-size: 22px;
  font-weight: 850;
  line-height: 1.16;
  letter-spacing: 0;
}

.modal-card p {
  margin: 0;
  color: rgba(19, 32, 22, 0.48);
  font-size: 13px;
  font-weight: 700;
  line-height: 1.42;
}

.modal-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  width: 100%;
  margin-top: 4px;
  align-items: stretch;
}

.modal-actions .primary-btn,
.modal-actions .secondary-btn,
.quiz-actions .primary-btn,
.quiz-actions .secondary-btn {
  min-height: 40px;
  height: 40px;
  border-radius: 999px;
  font-size: 15px;
  box-shadow: none;
}

.modal-actions .primary-btn,
.quiz-actions .primary-btn {
  border: 1px solid var(--green-850);
}

.modal-actions .primary-btn {
  border: 1px solid rgba(4, 53, 29, 0.12);
  background: rgba(4, 53, 29, 0.78);
  color: rgba(255, 255, 255, 0.96);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.18),
    0 8px 18px rgba(4, 53, 29, 0.14);
}

.modal-actions .secondary-btn,
.quiz-actions .secondary-btn {
  border: 1px solid #c9ded2;
}

.modal-actions .secondary-btn {
  border-color: rgba(4, 53, 29, 0.12);
  background: rgba(255, 255, 255, 0.24);
  color: rgba(4, 53, 29, 0.62);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.58);
}

.wechat-card {
  border-color: rgba(10, 139, 67, 0.35);
}

.wechat-preview {
  display: grid;
  gap: 6px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #f8fcfa;
}

.wechat-preview strong {
  color: var(--green-950);
}

.wechat-preview span {
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.toast {
  position: fixed;
  left: 50%;
  top: 72px;
  bottom: auto;
  z-index: 30;
  display: grid;
  place-items: center;
  width: min(420px, calc(100% - 28px));
  min-height: 48px;
  padding: 12px 16px;
  border-radius: 16px;
  background: rgba(4, 53, 29, 0.95);
  color: var(--white);
  font-weight: 1000;
  opacity: 0;
  pointer-events: none;
  transform: translate(-50%, 12px);
  transition: 180ms ease;
}

.toast.show {
  opacity: 1;
  transform: translate(-50%, 0);
}

@media (min-width: 820px) {
  .app {
    padding-top: 14px;
  }

  .topbar {
    margin: 0;
    border: 1px solid var(--line);
    border-radius: 18px;
  }
}

#entry-screen.active,
#quiz-screen.active,
#level-screen.active,
#result-screen.active,
#share-screen.active {
  height: 100%;
}

#entry-screen.active {
  display: grid;
  grid-template-rows: auto auto;
  gap: 10px;
  align-content: center;
}

.game-hero {
  padding: 18px 16px;
}

.season {
  min-height: 26px;
  margin-bottom: 10px;
}

h1 {
  font-size: clamp(30px, 9vw, 36px);
}

.game-hero > p:not(.season) {
  margin-top: 8px;
  line-height: 1.42;
}

.hero-stats {
  gap: 6px;
  margin-top: 12px;
}

.hero-stats span {
  min-height: 50px;
  padding: 8px;
}

.entry-card {
  gap: 10px;
  margin-top: 0;
  padding: 12px;
}

input {
  min-height: 42px;
}

.grade-grid button {
  min-height: 38px;
}

.entry-card .primary-btn,
.level-pass .primary-btn,
.level-pass .secondary-btn,
#result-screen .primary-btn,
#result-screen .secondary-btn,
#share-screen .primary-btn,
#share-screen .secondary-btn {
  min-height: 48px;
}

.ladder {
  min-height: 0;
  margin-top: 0;
}

.ladder-item {
  min-height: 0;
  padding: 10px 12px;
}

#quiz-screen.active {
  display: grid;
  grid-template-rows: auto auto minmax(0, 1fr) auto;
  gap: 8px;
}

.screen-head {
  margin-bottom: 0;
}

.quiz-title strong {
  font-size: 22px;
}

.timer-card {
  min-height: 58px;
  border-radius: 18px;
}

#timer {
  font-size: 31px;
}

.level-progress {
  margin-top: 0;
}

.question-card {
  min-height: 0;
  margin-top: 0;
  padding: 10px 12px;
  display: grid;
  grid-template-rows: auto auto auto auto auto;
  align-content: start;
  overflow-y: auto;
  overscroll-behavior: contain;
}

.question-card > p {
  margin-bottom: 5px;
}

.question-card h2 {
  font-size: clamp(16px, 4.7vw, 20px);
  line-height: 1.22;
}

.question-hint {
  margin-top: 8px;
  padding: 8px 10px;
}

.question-hint span {
  min-height: 23px;
  font-size: 11px;
}

.question-hint strong {
  font-size: 13px;
}

.question-visual {
  min-height: 0;
  margin: 7px 0;
  padding: 8px 10px;
  align-content: center;
  gap: 4px;
  font-size: 17px;
  overflow: visible;
}

.visual-row {
  gap: 6px;
  line-height: 1.1;
}

.shape {
  width: 24px;
  height: 24px;
}

.triangle {
  font-size: 24px;
}

.options {
  gap: 6px;
}

.options button {
  min-height: 36px;
  padding: 0 12px;
}

.quiz-actions {
  margin-top: 0;
}

.quiz-actions .primary-btn,
.quiz-actions .secondary-btn {
  min-height: 48px;
}

#level-screen.active {
  display: grid;
}

.level-pass {
  min-height: 0;
  height: 100%;
  padding: 18px;
}

#result-screen.active {
  display: grid;
  grid-template-rows: auto auto auto auto auto;
  gap: 8px;
  align-content: center;
}

.result-card {
  min-height: auto;
  gap: 8px;
  padding: 14px 14px 12px;
}

.result-topline span,
.result-topline b {
  min-height: 26px;
  padding: 0 10px;
  font-size: 12px;
}

.result-hero {
  grid-template-columns: 34px minmax(0, 1fr) 34px;
  min-height: 98px;
}

.percent-mark small,
.percent-mark em {
  font-size: 12px;
}

.percent-mark strong {
  font-size: 54px;
}

.laurel {
  width: 30px;
  height: 62px;
}

.medal {
  width: 44px;
  height: 44px;
  margin-top: -7px;
  box-shadow:
    inset 7px 0 rgba(255, 255, 255, 0.3),
    inset -5px -7px rgba(113, 70, 9, 0.18),
    0 6px 0 #7a480b,
    0 11px 20px rgba(141, 91, 12, 0.16);
}

#honor-title {
  min-height: 34px;
  font-size: 15px;
}

#result-summary {
  font-size: 13px;
  line-height: 1.35;
}

.score-grid {
  margin: 0;
  gap: 8px;
}

.insight-card {
  gap: 8px;
  padding: 10px;
}

.insight-card strong {
  font-size: 14px;
}

.insight-tags {
  gap: 6px;
}

.insight-tags b {
  min-height: 28px;
  padding: 0 7px;
  font-size: 11px;
}

.insight-tags b::before {
  width: 12px;
  height: 12px;
  border-width: 2px;
}

.score-grid div {
  min-height: 62px;
  padding: 7px 5px;
}

.score-grid b {
  font-size: 18px;
}

#share-screen.active {
  display: grid;
  grid-template-rows: auto auto;
  gap: 8px;
  align-content: center;
}

.poster {
  min-height: auto;
  gap: 7px;
  padding: 12px;
  align-content: start;
}

.poster::before {
  font-size: 78px;
  top: 64px;
}

.poster h2 {
  font-size: 25px;
}

.poster h2 span {
  font-size: 40px;
}

.poster-top span,
.poster-top b {
  min-height: 26px;
  font-size: 12px;
}

.poster-kicker {
  font-size: 14px;
}

.honor-ribbon {
  min-height: 40px;
  padding: 6px 10px;
}

.honor-ribbon strong {
  font-size: 17px;
}

.honor-ribbon small {
  min-height: 22px;
  font-size: 11px;
}

.poster-taunt {
  padding: 0;
  font-size: 15px;
  line-height: 1.28;
}

.poster-ability {
  padding: 7px 9px;
  font-size: 13px;
  line-height: 1.28;
}

.poster-challenge {
  gap: 6px;
  padding: 10px;
}

.challenge-label {
  min-height: 23px;
  font-size: 12px;
}

.poster-target {
  gap: 6px;
  padding-top: 7px;
}

.poster-target b {
  font-size: 19px;
}

.poster-target em {
  font-size: 24px;
}

.challenge-code {
  min-height: 28px;
}

.challenge-code strong {
  font-size: 13px;
}

.modal {
  padding: 14px;
}

.modal-card {
  gap: 10px;
  padding: 16px;
}

.modal-card .primary-btn,
.modal-card .secondary-btn {
  min-height: 48px;
}

@media (max-height: 720px) {
  .topbar span,
  .ladder-item p,
  .game-hero > p:not(.season) {
    display: none;
  }

  .topbar {
    padding: 6px 12px;
  }

  .topbar strong {
    font-size: 16px;
  }

  .ghost-btn {
    min-height: 30px;
  }

  .app {
    padding-top: 8px;
    padding-bottom: 10px;
  }

  .game-hero {
    padding: 14px;
  }

  h1 {
    font-size: 30px;
  }

  .hero-stats span {
    min-height: 42px;
    font-size: 11px;
  }

  .hero-stats b {
    font-size: 18px;
  }

  .entry-card {
    gap: 8px;
    padding: 10px;
  }

  label,
  .grade-pick {
    gap: 5px;
  }

  input {
    min-height: 38px;
  }

  .grade-grid button,
  .options button {
    min-height: 34px;
  }

  .ladder-item {
    padding: 8px 10px;
  }

  .question-card {
    padding: 10px;
    grid-template-rows: auto auto auto auto auto;
  }

  .question-card h2 {
    font-size: 16px;
  }

  .question-visual {
    min-height: 54px;
    max-height: none;
    margin: 6px 0;
    padding: 8px;
    font-size: 16px;
  }

  .quiz-actions .primary-btn,
  .quiz-actions .secondary-btn {
    min-height: 42px;
    height: 42px;
  }

  .screen-head {
    grid-template-columns: 38px minmax(0, 1fr) 70px;
    gap: 8px;
  }

  .screen-head button {
    width: 34px;
    height: 34px;
  }

  .quiz-title strong {
    font-size: 20px;
  }

  .quiz-title span {
    font-size: 12px;
  }

  .timer-card {
    min-height: 52px;
    border-width: 2px;
    border-radius: 17px;
  }

  #timer {
    min-height: 31px;
    font-size: 28px;
  }

  .timer-card small {
    font-size: 11px;
  }

  #quiz-screen.active {
    gap: 6px;
  }

  .level-progress > div:first-child {
    margin-bottom: 5px;
  }

  .progress {
    height: 9px;
  }
}

/* Apple-inspired education premium refresh */
:root {
  --bg: #eef4f8;
  --ink: #14202b;
  --muted: #637183;
  --green-950: #102b2f;
  --green-850: #155a55;
  --green-700: #0b8f7f;
  --green-100: rgba(219, 246, 241, 0.72);
  --gold: #d9a441;
  --gold-soft: #fff1bd;
  --red: #e35d55;
  --line: rgba(255, 255, 255, 0.55);
  --white: rgba(255, 255, 255, 0.82);
  --glass: rgba(255, 255, 255, 0.58);
  --glass-strong: rgba(255, 255, 255, 0.76);
  --hairline: rgba(255, 255, 255, 0.72);
  --shadow-soft: 0 24px 70px rgba(24, 42, 56, 0.14);
  --shadow-float: 0 18px 44px rgba(28, 50, 62, 0.16);
  --blue: #3d7eff;
  --cyan: #26b8c8;
  --violet: #7868ff;
  --radius-xl: 28px;
  --radius-lg: 22px;
  --radius-md: 16px;
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Display", "SF Pro Text", "PingFang SC", "Microsoft YaHei", "Segoe UI", sans-serif;
}

body {
  background:
    radial-gradient(circle at 18% 5%, rgba(61, 126, 255, 0.22), transparent 26%),
    radial-gradient(circle at 84% 12%, rgba(38, 184, 200, 0.2), transparent 27%),
    radial-gradient(circle at 50% 98%, rgba(217, 164, 65, 0.16), transparent 32%),
    linear-gradient(180deg, #f8fbff 0%, #eef4f8 48%, #e7f0f4 100%);
}

body::before,
body::after {
  content: "";
  position: fixed;
  z-index: -1;
  pointer-events: none;
  border-radius: 999px;
  filter: blur(2px);
}

body::before {
  width: 280px;
  height: 280px;
  left: max(-96px, calc(50% - 360px));
  top: 78px;
  background: radial-gradient(circle, rgba(61, 126, 255, 0.17), transparent 68%);
}

body::after {
  width: 320px;
  height: 320px;
  right: max(-140px, calc(50% - 420px));
  bottom: -94px;
  background: radial-gradient(circle, rgba(38, 184, 200, 0.16), transparent 68%);
}

.app {
  width: min(480px, 100%);
  padding: 12px 14px 16px;
}

.topbar,
.game-hero,
.entry-card,
.question-card,
.level-pass,
.result-card,
.insight-card,
.score-grid div,
.poster,
.modal-card,
.timer-card,
.wechat-preview {
  border: 1px solid var(--hairline);
  background: linear-gradient(145deg, rgba(255, 255, 255, 0.74), rgba(255, 255, 255, 0.42));
  box-shadow: var(--shadow-soft), inset 0 1px 0 rgba(255, 255, 255, 0.82);
  backdrop-filter: blur(24px) saturate(1.22);
  -webkit-backdrop-filter: blur(24px) saturate(1.22);
}

.topbar {
  border-radius: 0 0 24px 24px;
  background: rgba(255, 255, 255, 0.58);
}

.topbar strong {
  color: #132a37;
  font-size: 17px;
  letter-spacing: 0;
}

.topbar span {
  color: rgba(61, 75, 91, 0.72);
}

.ghost-btn,
.screen-head button {
  border-color: rgba(255, 255, 255, 0.78);
  background: rgba(255, 255, 255, 0.62);
  color: #1f5160;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.78), 0 8px 22px rgba(31, 81, 96, 0.1);
  backdrop-filter: blur(18px) saturate(1.18);
  -webkit-backdrop-filter: blur(18px) saturate(1.18);
}

.game-hero {
  border-radius: var(--radius-xl);
  padding: 22px 18px;
  background:
    linear-gradient(135deg, rgba(13, 143, 127, 0.92), rgba(31, 72, 123, 0.86) 52%, rgba(20, 32, 43, 0.92)),
    rgba(255, 255, 255, 0.62);
  box-shadow: 0 26px 80px rgba(19, 55, 77, 0.22), inset 0 1px 0 rgba(255, 255, 255, 0.32);
}

.game-hero::after,
.poster::before {
  color: rgba(255, 255, 255, 0.07);
  letter-spacing: 0;
}

.season,
.result-topline span,
.result-topline b,
.poster-top span,
.poster-top b,
.challenge-label,
.modal-eyebrow {
  border: 1px solid rgba(255, 255, 255, 0.36);
  background: rgba(255, 255, 255, 0.17);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.32);
  backdrop-filter: blur(14px) saturate(1.18);
  -webkit-backdrop-filter: blur(14px) saturate(1.18);
}

h1 {
  font-weight: 900;
  letter-spacing: 0;
}

.hero-stats span {
  border: 1px solid rgba(255, 255, 255, 0.22);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.14);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.18);
  backdrop-filter: blur(18px) saturate(1.1);
  -webkit-backdrop-filter: blur(18px) saturate(1.1);
}

.entry-card,
.question-card,
.result-card,
.insight-card,
.score-grid div {
  border-radius: var(--radius-lg);
}

input,
select,
.grade-grid button,
.options button {
  border-color: rgba(255, 255, 255, 0.74);
  border-radius: var(--radius-md);
  background: rgba(255, 255, 255, 0.62);
  color: #172432;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.78), 0 7px 20px rgba(28, 50, 62, 0.06);
}

input:focus {
  border-color: rgba(61, 126, 255, 0.54);
  box-shadow: 0 0 0 5px rgba(61, 126, 255, 0.12), inset 0 1px 0 rgba(255, 255, 255, 0.88);
}

.grade-grid button.selected,
.options button.selected {
  border-color: rgba(11, 143, 127, 0.46);
  background: linear-gradient(180deg, rgba(219, 246, 241, 0.9), rgba(255, 255, 255, 0.72));
  color: #0d4f4a;
  box-shadow: 0 10px 24px rgba(11, 143, 127, 0.12), inset 0 1px 0 rgba(255, 255, 255, 0.9);
}

.primary-btn {
  border: 1px solid rgba(255, 255, 255, 0.28);
  border-radius: 17px;
  background: linear-gradient(180deg, #20b9aa 0%, #1974d2 100%);
  color: #fff;
  box-shadow: 0 15px 32px rgba(25, 116, 210, 0.2), inset 0 1px 0 rgba(255, 255, 255, 0.24);
}

.secondary-btn {
  border-color: rgba(255, 255, 255, 0.72);
  border-radius: 17px;
  background: rgba(255, 255, 255, 0.6);
  color: #245765;
  box-shadow: 0 11px 26px rgba(28, 50, 62, 0.08), inset 0 1px 0 rgba(255, 255, 255, 0.82);
  backdrop-filter: blur(18px) saturate(1.16);
  -webkit-backdrop-filter: blur(18px) saturate(1.16);
}

.timer-card {
  border-radius: 22px;
  background: linear-gradient(180deg, rgba(255, 241, 189, 0.96), rgba(217, 164, 65, 0.82));
  color: #6e4b08;
  box-shadow: 0 16px 32px rgba(217, 164, 65, 0.24), inset 0 1px 0 rgba(255, 255, 255, 0.72);
}

.timer-card:has(#timer.danger) {
  background: linear-gradient(180deg, rgba(255, 137, 126, 0.98), rgba(227, 93, 85, 0.9));
  box-shadow: 0 0 0 6px rgba(227, 93, 85, 0.12), 0 16px 34px rgba(227, 93, 85, 0.24);
}

.level-progress > div:first-child,
.question-card > p,
.quiz-title span,
.level-progress b {
  color: #18756e;
}

.progress {
  background: rgba(255, 255, 255, 0.56);
  box-shadow: inset 0 1px 3px rgba(26, 47, 61, 0.08);
}

.progress span {
  background: linear-gradient(90deg, #d9a441, #20b9aa, #1974d2);
}

.question-hint {
  border-color: rgba(255, 255, 255, 0.76);
  border-radius: 18px;
  background: linear-gradient(145deg, rgba(255, 247, 221, 0.82), rgba(255, 255, 255, 0.56));
  box-shadow: 0 10px 26px rgba(217, 164, 65, 0.1), inset 0 1px 0 rgba(255, 255, 255, 0.82);
}

.question-visual {
  border-color: rgba(255, 255, 255, 0.72);
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.48);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.82);
}

.circle {
  background: linear-gradient(145deg, #24b8aa, #1974d2);
}

.square {
  background: linear-gradient(145deg, #ffd978, #d9a441);
}

.diamond {
  background: linear-gradient(145deg, #6fd6df, #3d7eff);
}

.options button.wrong {
  border-color: rgba(227, 93, 85, 0.32);
  background: rgba(255, 238, 236, 0.72);
}

.level-pass {
  border-radius: var(--radius-xl);
  background:
    radial-gradient(circle at 50% 18%, rgba(255, 241, 189, 0.62), transparent 35%),
    linear-gradient(145deg, rgba(255, 255, 255, 0.76), rgba(255, 255, 255, 0.45));
}

.result-card::before {
  background: radial-gradient(circle, rgba(61, 126, 255, 0.16), transparent 68%);
}

.percent-mark strong,
.poster h2 span {
  color: #d9a441;
  text-shadow: 0 10px 28px rgba(217, 164, 65, 0.24);
}

.medal {
  background:
    radial-gradient(circle at 34% 28%, rgba(255, 249, 221, 0.95), transparent 22%),
    linear-gradient(135deg, #fff0a8, #d9a441 58%, #96680d);
}

#honor-title {
  border: 1px solid rgba(255, 255, 255, 0.32);
  background: linear-gradient(90deg, #14313b, #167d75, #1974d2);
  box-shadow: 0 14px 32px rgba(22, 125, 117, 0.22), inset 0 1px 0 rgba(255, 255, 255, 0.2);
}

.insight-tags b {
  border: 1px solid rgba(255, 255, 255, 0.62);
  background: rgba(255, 255, 255, 0.48);
  color: #155a55;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.74);
}

.poster {
  border-radius: var(--radius-xl);
  background:
    radial-gradient(circle at 80% 8%, rgba(255, 241, 189, 0.45), transparent 26%),
    linear-gradient(150deg, rgba(32, 185, 170, 0.92), rgba(25, 116, 210, 0.86) 48%, rgba(20, 32, 43, 0.94));
  box-shadow: 0 28px 80px rgba(20, 61, 86, 0.24), inset 0 1px 0 rgba(255, 255, 255, 0.24);
}

.honor-ribbon,
.poster-ability,
.poster-challenge {
  border: 1px solid rgba(255, 255, 255, 0.34);
  background: rgba(255, 255, 255, 0.18);
  color: #fff6d5;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.24);
  backdrop-filter: blur(18px) saturate(1.16);
  -webkit-backdrop-filter: blur(18px) saturate(1.16);
}

.poster-challenge {
  background: rgba(255, 255, 255, 0.76);
  color: #13202b;
}

.poster-taunt {
  color: #13202b;
}

.poster-target b {
  color: #176f69;
}

.modal {
  background:
    radial-gradient(circle at 50% 36%, rgba(255, 255, 255, 0.32), transparent 30%),
    rgba(19, 32, 43, 0.26);
  backdrop-filter: blur(28px) saturate(1.2);
  -webkit-backdrop-filter: blur(28px) saturate(1.2);
}

.modal-card {
  border-radius: 30px;
  background: linear-gradient(150deg, rgba(255, 255, 255, 0.78), rgba(255, 255, 255, 0.48));
  box-shadow: 0 30px 90px rgba(19, 32, 43, 0.24), inset 0 1px 0 rgba(255, 255, 255, 0.9);
}

.modal-card h2 {
  color: #132a37;
  font-weight: 900;
}

.modal-card p {
  color: rgba(45, 58, 72, 0.7);
}

.modal-actions .primary-btn,
.quiz-actions .primary-btn {
  background: linear-gradient(180deg, #20b9aa, #1974d2);
}

.modal-actions .secondary-btn {
  background: rgba(255, 255, 255, 0.42);
  color: rgba(20, 49, 59, 0.72);
}

.toast {
  border: 1px solid rgba(255, 255, 255, 0.2);
  background: rgba(20, 32, 43, 0.74);
  box-shadow: 0 18px 48px rgba(19, 32, 43, 0.18), inset 0 1px 0 rgba(255, 255, 255, 0.18);
  backdrop-filter: blur(22px) saturate(1.22);
  -webkit-backdrop-filter: blur(22px) saturate(1.22);
}

@media (min-width: 820px) {
  .app {
    width: min(500px, 100%);
  }

  .topbar {
    border-radius: 24px;
  }
}

@media (max-height: 720px) {
  .app {
    padding-top: 8px;
    padding-bottom: 10px;
  }

  .game-hero {
    padding: 14px;
  }

  .entry-card,
  .question-card,
  .insight-card {
    border-radius: 18px;
  }

  .hero-stats span {
    min-height: 42px;
  }

  .primary-btn,
  .secondary-btn {
    border-radius: 15px;
  }

  .timer-card {
    border-radius: 18px;
  }

  .modal-card {
    border-radius: 24px;
  }
}

/* Color rollback: keep the glass polish, restore the original green/gold identity. */
:root {
  --bg: #ecf7ef;
  --ink: #132016;
  --muted: #617267;
  --green-950: #04351d;
  --green-850: #07552d;
  --green-700: #0a8b43;
  --green-100: rgba(227, 245, 233, 0.78);
  --gold: #f5b331;
  --gold-soft: #ffe69b;
  --red: #e64c3c;
}

body {
  background:
    radial-gradient(circle at 50% 0, rgba(245, 179, 49, 0.2), transparent 28%),
    radial-gradient(circle at 18% 18%, rgba(10, 139, 67, 0.12), transparent 27%),
    radial-gradient(circle at 88% 84%, rgba(255, 230, 155, 0.18), transparent 31%),
    linear-gradient(180deg, #f7fcf8 0%, var(--bg) 100%);
}

body::before {
  background: radial-gradient(circle, rgba(10, 139, 67, 0.11), transparent 68%);
}

body::after {
  background: radial-gradient(circle, rgba(245, 179, 49, 0.14), transparent 68%);
}

.topbar strong,
.quiz-title strong,
.question-card h2,
.level-pass h2,
.insight-card strong,
.modal-card h2,
.poster-taunt {
  color: var(--green-950);
}

.topbar span,
.modal-card p {
  color: rgba(97, 114, 103, 0.78);
}

.ghost-btn,
.screen-head button,
.secondary-btn,
.modal-actions .secondary-btn {
  color: var(--green-850);
}

.game-hero {
  background:
    radial-gradient(circle at 82% 12%, rgba(255, 230, 155, 0.82), transparent 30%),
    linear-gradient(145deg, #0d9a4c 0%, var(--green-950) 100%);
  box-shadow: 0 26px 80px rgba(4, 53, 29, 0.2), inset 0 1px 0 rgba(255, 255, 255, 0.28);
}

.primary-btn,
.modal-actions .primary-btn,
.quiz-actions .primary-btn {
  background: linear-gradient(180deg, #12a854 0%, var(--green-950) 100%);
  box-shadow: 0 15px 32px rgba(4, 53, 29, 0.18), inset 0 1px 0 rgba(255, 255, 255, 0.22);
}

.grade-grid button.selected,
.options button.selected {
  border-color: rgba(10, 139, 67, 0.44);
  background: linear-gradient(180deg, rgba(227, 245, 233, 0.94), rgba(255, 255, 255, 0.72));
  color: var(--green-950);
  box-shadow: 0 10px 24px rgba(10, 139, 67, 0.12), inset 0 1px 0 rgba(255, 255, 255, 0.9);
}

input:focus,
select:focus {
  border-color: rgba(10, 139, 67, 0.52);
  box-shadow: 0 0 0 5px rgba(10, 139, 67, 0.1), inset 0 1px 0 rgba(255, 255, 255, 0.88);
}

.timer-card {
  background: linear-gradient(180deg, rgba(255, 230, 155, 0.98), rgba(245, 179, 49, 0.9));
  color: #704506;
  box-shadow: 0 16px 32px rgba(245, 179, 49, 0.28), inset 0 1px 0 rgba(255, 255, 255, 0.72);
}

.timer-card:has(#timer.danger) {
  background: linear-gradient(180deg, rgba(244, 111, 96, 0.98), rgba(230, 76, 60, 0.92));
  box-shadow: 0 0 0 6px rgba(230, 76, 60, 0.12), 0 16px 34px rgba(230, 76, 60, 0.24);
}

.level-progress > div:first-child,
.question-card > p,
.quiz-title span,
.level-progress b,
.result-topline span,
.level-pass p {
  color: var(--green-700);
}

.progress span {
  background: linear-gradient(90deg, var(--gold), var(--green-700));
}

.question-hint {
  background: linear-gradient(145deg, rgba(255, 246, 216, 0.88), rgba(255, 255, 255, 0.58));
  box-shadow: 0 10px 26px rgba(245, 179, 49, 0.1), inset 0 1px 0 rgba(255, 255, 255, 0.82);
}

.question-hint span {
  background: rgba(245, 179, 49, 0.18);
  color: #7c5409;
}

.question-hint strong {
  color: #4c3510;
}

.triangle {
  color: var(--green-700);
}

.circle {
  background: var(--green-700);
}

.square {
  background: var(--gold);
}

.diamond {
  background: #2e9ca0;
}

.level-pass {
  background:
    radial-gradient(circle at 50% 8%, rgba(255, 230, 155, 0.64), transparent 34%),
    linear-gradient(145deg, rgba(255, 255, 255, 0.76), rgba(255, 255, 255, 0.45));
}

.result-card {
  background:
    radial-gradient(circle at 50% 38%, rgba(245, 179, 49, 0.13), transparent 36%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.82), rgba(249, 253, 250, 0.62));
}

.result-card::before {
  background: radial-gradient(circle, rgba(245, 179, 49, 0.14), transparent 68%);
}

.percent-mark strong,
.poster h2 span {
  color: var(--gold);
  text-shadow: 0 10px 28px rgba(245, 179, 49, 0.24);
}

.medal {
  background:
    radial-gradient(circle at 34% 28%, rgba(255, 245, 201, 0.95), transparent 22%),
    linear-gradient(135deg, #ffeaa0, var(--gold) 58%, #a76809);
}

#honor-title {
  background: linear-gradient(90deg, var(--green-950), #07904a);
  box-shadow: 0 14px 32px rgba(4, 53, 29, 0.2), inset 0 1px 0 rgba(255, 255, 255, 0.2);
}

.insight-tags b {
  color: var(--green-850);
}

.poster {
  background:
    radial-gradient(circle at 86% 10%, rgba(255, 232, 144, 0.6), transparent 22%),
    radial-gradient(circle at 12% 94%, rgba(29, 197, 101, 0.26), transparent 24%),
    linear-gradient(160deg, #13a756 0%, #07572d 42%, #032716 100%);
  box-shadow: 0 28px 80px rgba(4, 53, 29, 0.24), inset 0 1px 0 rgba(255, 255, 255, 0.22);
}

.poster-top b {
  background: var(--gold);
  color: #684103;
}

.poster-challenge {
  background: rgba(255, 248, 213, 0.82);
  color: #113a22;
}

.poster-target b {
  color: var(--green-850);
}

.poster-target em {
  color: #d88900;
}

.challenge-label {
  background: var(--green-850);
  color: #fff8d8;
}

.toast {
  background: rgba(4, 53, 29, 0.88);
  box-shadow: 0 18px 48px rgba(4, 53, 29, 0.18), inset 0 1px 0 rgba(255, 255, 255, 0.18);
}

/* User-facing polish pass: premium Chinese online-education glass UI. */
:root {
  --edu-bg-top: #fbfff8;
  --edu-bg-mid: #edf8ef;
  --edu-bg-bottom: #e3f2e8;
  --edu-ink: #092315;
  --edu-muted: #647569;
  --edu-green: #078743;
  --edu-deep: #03351c;
  --edu-gold: #f1b43f;
  --edu-card: rgba(255, 255, 255, 0.72);
  --edu-card-strong: rgba(255, 255, 255, 0.86);
  --edu-border: rgba(255, 255, 255, 0.72);
  --edu-shadow: 0 22px 58px rgba(4, 53, 29, 0.13);
}

html,
body {
  overflow: hidden;
}

body {
  background:
    radial-gradient(circle at 50% -4%, rgba(241, 180, 63, 0.24), transparent 30%),
    radial-gradient(circle at 14% 22%, rgba(7, 135, 67, 0.13), transparent 26%),
    radial-gradient(circle at 94% 72%, rgba(241, 180, 63, 0.18), transparent 28%),
    linear-gradient(180deg, var(--edu-bg-top) 0%, var(--edu-bg-mid) 48%, var(--edu-bg-bottom) 100%);
  color: var(--edu-ink);
}

.app {
  width: min(430px, 100%);
  padding: 8px 12px 12px;
}

.topbar {
  min-height: 70px;
  padding: 10px 16px;
  border: 1px solid var(--edu-border);
  border-radius: 0 0 24px 24px;
  background: linear-gradient(145deg, rgba(255, 255, 255, 0.84), rgba(255, 255, 255, 0.56));
  box-shadow: 0 14px 34px rgba(4, 53, 29, 0.08), inset 0 1px 0 rgba(255, 255, 255, 0.9);
}

.topbar strong {
  color: var(--edu-deep);
  font-size: 17px;
}

.topbar span {
  color: var(--edu-muted);
}

.ghost-btn {
  min-width: 62px;
  min-height: 38px;
  background: rgba(255, 255, 255, 0.78);
}

#entry-screen.active {
  gap: 12px;
  align-content: center;
}

.game-hero {
  min-height: 242px;
  padding: 24px 20px;
  border-radius: 26px;
  border-color: rgba(255, 255, 255, 0.34);
  background:
    radial-gradient(circle at 85% 16%, rgba(255, 232, 151, 0.9), transparent 27%),
    radial-gradient(circle at 16% 102%, rgba(21, 199, 101, 0.28), transparent 32%),
    linear-gradient(150deg, #10a653 0%, #06713b 46%, #032d18 100%);
  box-shadow: 0 24px 62px rgba(4, 53, 29, 0.24), inset 0 1px 0 rgba(255, 255, 255, 0.28);
}

.game-hero::after {
  right: -22px;
  bottom: -4px;
  font-size: 104px;
  opacity: 0.95;
}

.season {
  min-height: 30px;
  margin-bottom: 12px;
  padding: 0 12px;
  color: #fff7d7;
}

h1 {
  max-width: 280px;
  font-size: 34px;
  line-height: 1.05;
}

.game-hero > p:not(.season) {
  max-width: 290px;
  font-size: 15px;
  line-height: 1.48;
}

.hero-stats {
  margin-top: 18px;
  gap: 8px;
}

.hero-stats span {
  min-height: 64px;
  padding: 10px 9px;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.17);
}

.hero-stats b {
  font-size: 24px;
}

.entry-card,
.question-card,
.result-card,
.insight-card,
.score-grid div,
.modal-card,
.level-pass {
  border-color: var(--edu-border);
  background:
    linear-gradient(145deg, var(--edu-card-strong), rgba(255, 255, 255, 0.52)),
    rgba(255, 255, 255, 0.66);
  box-shadow: var(--edu-shadow), inset 0 1px 0 rgba(255, 255, 255, 0.92);
}

.entry-card {
  padding: 16px;
  border-radius: 24px;
}

label,
.grade-pick {
  color: var(--edu-deep);
}

input,
select,
.grade-grid button,
.options button {
  border-color: rgba(255, 255, 255, 0.78);
  background: rgba(255, 255, 255, 0.76);
  color: #14251a;
}

.grade-grid {
  gap: 9px;
}

.grade-grid button {
  min-height: 42px;
  border-radius: 16px;
}

.grade-grid button.selected {
  border-color: rgba(7, 135, 67, 0.52);
  background: linear-gradient(180deg, #f2fff6, rgba(227, 245, 233, 0.9));
}

.primary-btn,
.modal-actions .primary-btn,
.quiz-actions .primary-btn {
  min-height: 50px;
  border-radius: 18px;
  background: linear-gradient(180deg, #12ad56 0%, #035527 100%);
  box-shadow: 0 16px 34px rgba(4, 83, 39, 0.2), inset 0 1px 0 rgba(255, 255, 255, 0.24);
}

.secondary-btn {
  min-height: 48px;
  border-radius: 18px;
}

#quiz-screen.active {
  gap: 9px;
}

.screen-head {
  grid-template-columns: 42px minmax(0, 1fr) 76px;
  gap: 9px;
}

.screen-head button {
  width: 38px;
  height: 38px;
  border-radius: 15px;
}

.quiz-title strong {
  font-size: 20px;
}

.timer-card {
  min-height: 58px;
  border-radius: 19px;
}

.level-progress {
  padding: 10px 2px 0;
}

.question-card {
  padding: 14px;
  border-radius: 24px;
}

.question-card h2 {
  font-size: clamp(18px, 4.9vw, 21px);
  line-height: 1.28;
}

.question-visual {
  min-height: 62px;
  margin: 10px 0;
  border-radius: 20px;
}

.options {
  gap: 9px;
}

.options button {
  min-height: 44px;
  border-radius: 17px;
  font-size: 16px;
}

.options button span {
  overflow-wrap: anywhere;
}

.quiz-actions {
  padding-bottom: 2px;
}

.result-card {
  border-radius: 28px;
}

#honor-title {
  border-radius: 999px;
}

.modal {
  align-items: center;
  justify-content: center;
  padding: 18px 14px;
}

.modal-card {
  width: min(420px, 100%);
  max-height: min(620px, calc(100dvh - 72px));
  overflow-y: auto;
  overscroll-behavior: contain;
  border-radius: 28px;
}

.modal-card h2 {
  font-size: 25px;
}

.modal-card p {
  color: var(--edu-muted);
}

.wechat-preview {
  border-radius: 20px;
  border-color: rgba(255, 255, 255, 0.78);
}

.lead-card label {
  text-align: left;
}

.toast {
  top: 78px;
  border-radius: 18px;
}

@media (max-width: 380px) {
  .app {
    padding-inline: 10px;
  }

  .game-hero {
    min-height: 224px;
    padding: 18px 16px;
  }

  h1 {
    font-size: 30px;
  }

  .hero-stats span {
    min-height: 56px;
    font-size: 11px;
  }

  .entry-card {
    padding: 14px;
  }

  .grade-grid button,
  .options button {
    font-size: 15px;
  }
}

@media (max-height: 720px) {
  #entry-screen.active,
  #result-screen.active,
  #share-screen.active {
    align-content: start;
    overflow-y: auto;
    padding-bottom: 10px;
  }

  .game-hero {
    min-height: 196px;
  }

  .season {
    margin-bottom: 8px;
  }

  h1 {
    font-size: 28px;
  }

  .hero-stats {
    margin-top: 10px;
  }

  .hero-stats span {
    min-height: 44px;
  }

  .entry-card {
    padding: 12px;
  }

  .modal {
    align-items: center;
  }
}

/* Card consistency pass: equal sizing, less color drift between panels. */
:root {
  --panel-bg: rgba(255, 255, 255, 0.82);
  --panel-bg-soft: rgba(255, 255, 255, 0.68);
  --panel-border: rgba(255, 255, 255, 0.82);
  --panel-radius: 24px;
  --control-radius: 17px;
}

.topbar,
.entry-card,
.question-card,
.result-card,
.insight-card,
.score-grid div,
.modal-card,
.level-pass,
.wechat-preview {
  border-radius: var(--panel-radius);
  border-color: var(--panel-border);
  background: linear-gradient(180deg, var(--panel-bg), var(--panel-bg-soft));
  box-shadow: 0 18px 42px rgba(4, 53, 29, 0.1), inset 0 1px 0 rgba(255, 255, 255, 0.96);
}

.topbar {
  border-radius: 0 0 var(--panel-radius) var(--panel-radius);
}

.game-hero {
  border-radius: var(--panel-radius);
}

.hero-stats {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.hero-stats span,
.grade-grid button,
.options button,
.score-grid div,
.insight-tags b {
  border-radius: var(--control-radius);
}

.hero-stats span {
  display: grid;
  grid-template-rows: auto 1fr;
  align-items: center;
  min-width: 0;
  min-height: 64px;
  background: rgba(255, 255, 255, 0.18);
}

.entry-card,
.question-card {
  width: 100%;
}

.grade-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.grade-grid button {
  width: 100%;
}

.question-visual,
.options button,
input,
select {
  background: rgba(255, 255, 255, 0.74);
}

.options button {
  width: 100%;
  min-height: 46px;
  text-align: left;
}

.options button.hidden-option {
  min-height: 46px;
}

.modal-card {
  border-radius: 28px;
}

.modal.open {
  display: grid;
  place-items: center;
}

.toast {
  top: auto;
  bottom: 18px;
  width: min(390px, calc(100% - 32px));
  min-height: 44px;
  transform: translate(-50%, 16px);
}

.toast.show {
  transform: translate(-50%, 0);
}

@media (min-width: 820px) {
  .topbar {
    border-radius: var(--panel-radius);
  }
}

@media (max-width: 380px) {
  .hero-stats span {
    min-height: 56px;
    padding-inline: 7px;
  }

  .options button {
    min-height: 44px;
  }
}

/* Modal final sizing: fixed product-grade dialog width, never content-sized. */
.modal {
  display: none;
  place-items: center;
  padding: 22px;
}

.modal.open {
  display: grid;
}

.modal-card,
#fail-modal .modal-card,
#hint-modal .modal-card,
#wechat-modal .modal-card,
#lead-modal .modal-card {
  width: min(340px, calc(100vw - 44px));
  min-width: min(300px, calc(100vw - 44px));
  max-width: 340px;
  padding: 24px 22px;
  gap: 14px;
  justify-items: stretch;
  text-align: left;
}

.comeback-card,
#hint-modal .modal-card,
.wechat-card {
  text-align: left;
}

.modal-eyebrow {
  justify-self: start;
}

.modal-card h2 {
  font-size: 26px;
  line-height: 1.12;
}

.modal-card p {
  font-size: 14px;
  line-height: 1.5;
}

.modal-actions,
#fail-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  width: 100%;
}

.modal-actions .primary-btn,
.modal-actions .secondary-btn,
#fail-actions .primary-btn,
#fail-actions .secondary-btn,
.modal-card > .primary-btn,
.modal-card > .secondary-btn {
  width: 100%;
  min-height: 48px;
  height: auto;
  border-radius: 16px;
  font-size: 16px;
}

@media (max-width: 340px) {
  .modal {
    padding: 16px;
  }

  .modal-card,
  #fail-modal .modal-card,
  #hint-modal .modal-card,
  #wechat-modal .modal-card,
  #lead-modal .modal-card {
    width: calc(100vw - 32px);
    min-width: 0;
    padding: 22px 18px;
  }

  .modal-actions,
  #fail-actions {
    grid-template-columns: 1fr;
  }
}
