:root {
  --page-top: #e8f8ff;
  --page-mid: #f8fdff;
  --page-bottom: #f2fff3;
  --window: #ffffff;
  --camera-blue: #7fc5f1;
  --primary-top: #ffe27a;
  --primary-bottom: #ffbd45;
  --text-primary: #12314c;
  --text-secondary: #244158;
  --text-muted: #688297;
  --border: #c9e4ef;
  --panel-radius: 10px;
}

* {
  box-sizing: border-box;
}

html {
  min-height: 100%;
  background: var(--page-top);
}

body {
  min-height: 100%;
  margin: 0;
  background:
    radial-gradient(circle at 12% 14%, rgba(117, 220, 255, 0.36), transparent 28%),
    radial-gradient(circle at 88% 12%, rgba(255, 226, 122, 0.34), transparent 24%),
    linear-gradient(145deg, var(--page-top), var(--page-mid) 54%, var(--page-bottom));
  color: var(--text-primary);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", Arial, sans-serif;
}

body.game-active {
  overflow: hidden;
}

button,
a {
  font: inherit;
}

button {
  border: 0;
  cursor: pointer;
}

a {
  color: inherit;
}

.page-shell {
  width: min(100%, 1120px);
  min-height: 100vh;
  margin: 0 auto;
  padding: 26px 24px 40px;
}

.site-header {
  position: relative;
  z-index: 4;
  display: flex;
  align-items: center;
  gap: 24px;
  margin-bottom: 26px;
}

.brand {
  color: #15324d;
  font-size: 24px;
  font-weight: 850;
  letter-spacing: 0;
  text-decoration: none;
}

.site-nav {
  display: flex;
  align-items: center;
  gap: 18px;
  margin-left: auto;
  color: #17405c;
  font-size: 13px;
  font-weight: 800;
}

.site-nav a {
  text-decoration: none;
}

.chip-button,
.text-button {
  min-height: 34px;
  padding: 0 14px;
  border: 1px solid #bfdae9;
  border-radius: 8px;
  background: #e9f8ff;
  color: #17405c;
  font-size: 13px;
  font-weight: 800;
}

.setup-card,
.result-card,
.static-card {
  border: 1px solid var(--border);
  border-radius: 18px;
  background: linear-gradient(145deg, #ffffff, #f4fbff);
  box-shadow: 0 16px 36px rgba(91, 138, 167, 0.22);
}

.setup-card {
  display: grid;
  grid-template-columns: minmax(0, 1.08fr) 340px;
  gap: 42px;
  padding: 42px;
}

.eyebrow {
  margin: 0 0 14px;
  color: #2368a5;
  font-size: 12px;
  font-weight: 850;
  text-transform: uppercase;
}

.setup-copy h1,
.result-details h2 {
  margin: 0;
  color: var(--text-primary);
  font-size: 34px;
  font-weight: 850;
  line-height: 1.12;
  letter-spacing: 0;
}

.lead {
  max-width: 560px;
  margin: 16px 0 0;
  color: var(--text-secondary);
  font-size: 15px;
  font-weight: 650;
  line-height: 1.6;
}

.privacy-note {
  display: grid;
  gap: 7px;
  max-width: 430px;
  margin-top: 26px;
  padding: 18px;
  border: 1px solid #b8e3f4;
  border-radius: var(--panel-radius);
  background: #e9f8ff;
}

.privacy-note strong {
  font-size: 15px;
  font-weight: 850;
}

.privacy-note span {
  color: var(--text-muted);
  font-size: 13px;
  font-weight: 700;
}

.mode-selector {
  margin-top: 30px;
}

.field-label {
  margin: 0 0 12px;
  color: var(--text-muted);
  font-size: 12px;
  font-weight: 850;
}

.mode-options {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  max-width: 430px;
}

.mode-card {
  min-height: 74px;
  padding: 14px;
  border: 2px solid var(--border);
  border-radius: var(--panel-radius);
  background: #ffffff;
  color: var(--text-primary);
  text-align: left;
}

.mode-card.is-active {
  border-color: #71c4ee;
  box-shadow: 0 0 0 4px rgba(117, 220, 255, 0.18);
}

.mode-card span {
  display: block;
  font-size: 16px;
  font-weight: 850;
}

.mode-card small {
  display: block;
  margin-top: 8px;
  color: var(--text-muted);
  font-size: 12px;
  font-weight: 700;
  line-height: 1.35;
}

.setup-actions,
.result-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 28px;
}

.primary-button,
.primary-link,
.secondary-button {
  min-width: 150px;
  height: 52px;
  padding: 0 22px;
  border-radius: var(--panel-radius);
  font-size: 17px;
  font-weight: 900;
}

.primary-button,
.primary-link {
  background: linear-gradient(145deg, var(--primary-top), var(--primary-bottom));
  color: #173048;
  box-shadow: 0 12px 24px rgba(255, 189, 69, 0.26);
}

.primary-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-top: 20px;
  text-decoration: none;
}

.secondary-button {
  border: 1px solid var(--border);
  background: #ffffff;
  color: #17405c;
}

.status-message {
  min-height: 22px;
  margin: 16px 0 0;
  color: #b34838;
  font-size: 13px;
  font-weight: 800;
  line-height: 1.45;
}

.preview-panel {
  display: grid;
  align-content: center;
  gap: 16px;
  text-align: center;
}

.preview-camera {
  position: relative;
  min-height: 320px;
  overflow: hidden;
  border: 1px solid #b6e3f5;
  border-radius: 16px;
  background:
    radial-gradient(circle at 50% 38%, rgba(247, 201, 162, 0.58), transparent 24%),
    linear-gradient(145deg, #7fc5f1, #c6edf4 48%, #f9e1a8);
}

.preview-camera::after {
  position: absolute;
  inset: 0;
  content: "";
  background: rgba(223, 248, 255, 0.2);
}

.preview-bubble,
.result-bubble {
  position: absolute;
  display: block;
  border: 3px solid rgba(255, 255, 255, 0.82);
  border-radius: 50%;
  background:
    radial-gradient(circle at 32% 28%, rgba(255, 255, 255, 0.94) 0 9%, transparent 10%),
    radial-gradient(circle at 50% 52%, rgba(117, 220, 255, 0.66), rgba(37, 152, 255, 0.38));
  box-shadow: 0 0 22px rgba(111, 216, 255, 0.62);
}

.bubble-a {
  left: 38px;
  top: 48px;
  width: 92px;
  height: 92px;
}

.bubble-b {
  right: 34px;
  top: 74px;
  width: 104px;
  height: 104px;
  background:
    radial-gradient(circle at 34% 28%, rgba(255, 255, 255, 0.92) 0 9%, transparent 10%),
    linear-gradient(145deg, rgba(255, 248, 168, 0.86), rgba(123, 231, 255, 0.66), rgba(255, 155, 232, 0.58));
}

.bubble-c {
  left: 70px;
  bottom: 36px;
  width: 126px;
  height: 126px;
}

.preview-hand {
  position: absolute;
  left: 50%;
  top: 54%;
  z-index: 2;
  width: 116px;
  height: 116px;
  border-radius: 50%;
  background:
    radial-gradient(circle, #ffca3a 0 10%, rgba(255, 255, 255, 0.74) 11% 28%, rgba(255, 243, 166, 0.42) 29% 58%, transparent 59%);
  transform: translate(-50%, -50%);
}

.preview-panel p {
  margin: 0;
  color: var(--text-muted);
  font-size: 12px;
  font-weight: 700;
}

.result-card {
  display: grid;
  grid-template-columns: 360px minmax(0, 1fr);
  gap: 42px;
  padding: 40px;
}

.mission-card {
  display: grid;
  gap: 24px;
  padding: 38px;
  border: 1px solid #c3eaf5;
  border-radius: 18px;
  background: linear-gradient(145deg, #ffffff, #ecf9ff);
  box-shadow: 0 16px 36px rgba(91, 138, 167, 0.22);
}

.mission-hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 360px;
  gap: 34px;
  align-items: center;
}

.mission-hero h1,
.mission-panel-card h1 {
  margin: 0;
  color: var(--text-primary);
  font-size: 34px;
  font-weight: 850;
  line-height: 1.12;
}

.mission-hero p,
.mission-panel-card p {
  margin: 14px 0 0;
  color: var(--text-secondary);
  font-size: 15px;
  font-weight: 650;
  line-height: 1.6;
}

.mission-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 26px;
}

.challenge-map {
  display: grid;
  gap: 18px;
  padding: 22px;
  border: 1px solid #c3eaf5;
  border-radius: 14px;
  background: #ecf9ff;
}

.challenge-map h2 {
  margin: 0;
  font-size: 22px;
  font-weight: 850;
}

.stage-grid,
.level-dots,
.mission-metrics {
  display: grid;
  gap: 10px;
}

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

.stage-pill {
  min-height: 62px;
  padding: 10px;
  border: 1px solid #c9e4ef;
  border-radius: 10px;
  background: #ffffff;
  text-align: center;
}

.stage-pill strong,
.stage-pill span {
  display: block;
}

.stage-pill strong {
  font-size: 13px;
  font-weight: 900;
}

.stage-pill span {
  margin-top: 6px;
  color: var(--text-muted);
  font-size: 11px;
  font-weight: 750;
}

.level-dots {
  grid-template-columns: repeat(10, 1fr);
}

.level-dot {
  display: grid;
  place-items: center;
  aspect-ratio: 1;
  border: 1px solid #c9e4ef;
  border-radius: 50%;
  background: #ffffff;
  color: var(--text-secondary);
  font-size: 11px;
  font-weight: 900;
}

.level-dot.is-done {
  border-color: #ffcc35;
  background: #fff3c1;
}

.level-dot.is-current {
  border-color: #71c4ee;
  background: #dff7ff;
}

.mission-panel-card {
  max-width: 666px;
  margin: 0 auto;
  text-align: center;
}

.mission-icon {
  display: grid;
  place-items: center;
  width: 126px;
  height: 126px;
  margin: 0 auto 22px;
  border: 5px solid rgba(255, 255, 255, 0.86);
  border-radius: 50%;
  background: radial-gradient(circle at 32% 28%, #ffffff 0 10%, #77ddff 11% 58%, #2698ff 100%);
  box-shadow: 0 0 26px rgba(111, 216, 255, 0.62);
  font-size: 54px;
}

.mission-icon.is-reward {
  background: linear-gradient(145deg, #fff8a8, #ff9be8, #77ddff);
}

.mission-stars {
  margin: 20px 0 0;
  color: #ffbd33;
  font-size: 34px;
  font-weight: 950;
  letter-spacing: 0;
}

.mission-metrics {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  margin-top: 22px;
}

.mission-metrics div {
  padding: 14px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: #ffffff;
}

.mission-metrics strong,
.mission-metrics span {
  display: block;
}

.mission-metrics strong {
  font-size: 28px;
  font-weight: 900;
}

.mission-metrics span {
  margin-top: 6px;
  color: var(--text-muted);
  font-size: 12px;
  font-weight: 750;
}

.result-card.is-hidden,
.is-hidden {
  display: none !important;
}

.result-preview {
  position: relative;
  min-height: 290px;
  overflow: hidden;
  border: 1px solid #b6e3f5;
  border-radius: 16px;
  background: linear-gradient(145deg, #d9f4ff, #f4fff9);
  text-align: center;
}

.result-preview strong {
  position: relative;
  z-index: 2;
  display: block;
  margin-top: 118px;
  color: #1261a6;
  font-size: 54px;
  font-weight: 950;
}

.result-preview p {
  position: relative;
  z-index: 2;
  margin: 4px 0 0;
  color: var(--text-secondary);
  font-size: 16px;
  font-weight: 850;
}

.result-bubble.one {
  left: 28px;
  top: 28px;
  width: 86px;
  height: 86px;
}

.result-bubble.two {
  right: 30px;
  top: 42px;
  width: 96px;
  height: 96px;
}

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

.metrics div {
  min-height: 86px;
  padding: 14px;
  border: 1px solid var(--border);
  border-radius: var(--panel-radius);
  background: #ffffff;
  text-align: center;
}

.metrics strong,
.metrics span {
  display: block;
}

.metrics strong {
  color: var(--text-primary);
  font-size: 28px;
  font-weight: 900;
}

.metrics span {
  margin-top: 7px;
  color: var(--text-muted);
  font-size: 12px;
  font-weight: 750;
}

.small-note {
  margin: 16px 0 0;
  color: var(--text-muted);
  font-size: 12px;
  font-weight: 700;
}

.static-page {
  max-width: 960px;
}

.static-card {
  padding: 34px;
}

.static-card h1 {
  margin: 0 0 22px;
  color: var(--text-primary);
  font-size: 34px;
  font-weight: 850;
}

.static-card p {
  margin: 0 0 18px;
  color: var(--text-secondary);
  font-size: 15px;
  font-weight: 650;
  line-height: 1.72;
}

.static-card p:last-child {
  margin-bottom: 0;
}

.static-card a {
  color: #1261a6;
  font-weight: 850;
  text-decoration: none;
}

@media (max-width: 840px) {
  .page-shell {
    padding: 18px 14px 30px;
  }

  .site-header,
  .site-nav,
  .setup-actions,
  .result-actions {
    align-items: flex-start;
  }

  .site-header {
    flex-wrap: wrap;
    gap: 14px;
  }

  .site-nav {
    order: 3;
    width: 100%;
    margin-left: 0;
  }

  .setup-card,
  .result-card,
  .mission-hero {
    grid-template-columns: 1fr;
    padding: 24px;
  }

  .mode-options,
  .metrics,
  .stage-grid,
  .mission-metrics {
    grid-template-columns: 1fr;
  }

  .mission-card {
    padding: 24px;
  }

  .level-dots {
    grid-template-columns: repeat(5, 1fr);
  }
}
