:root {
  color-scheme: light;
  --bg-top: #fff7ef;
  --bg-bottom: #ffd8bc;
  --ink: #6c4f42;
  --muted: #9d7f72;
  --card: rgba(255, 248, 241, 0.8);
  --line: rgba(139, 97, 79, 0.12);
  --accent: #ff8e63;
  --accent-deep: #eb7042;
  --cream: #fff8f3;
  --shadow: 0 24px 60px rgba(132, 86, 67, 0.14);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  font-family: "Microsoft YaHei", "PingFang SC", sans-serif;
  background:
    radial-gradient(circle at 10% 10%, rgba(255, 255, 255, 0.78), transparent 22%),
    radial-gradient(circle at 90% 0%, rgba(255, 229, 205, 0.76), transparent 24%),
    linear-gradient(180deg, var(--bg-top), var(--bg-bottom));
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.08) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.08) 1px, transparent 1px);
  background-size: 26px 26px;
  mask-image: linear-gradient(180deg, rgba(0, 0, 0, 0.3), transparent 70%);
}

button {
  font: inherit;
  border: 0;
  cursor: pointer;
}

.page {
  width: min(100%, 1080px);
  margin: 0 auto;
  padding: 18px 16px 40px;
}

.hero-shell {
  position: relative;
  margin-bottom: 18px;
}

.hero-shell::before {
  content: "";
  position: absolute;
  inset: 12px 0 auto;
  height: 320px;
  border-radius: 36px;
  background: linear-gradient(135deg, rgba(255, 244, 238, 0.9), rgba(255, 226, 204, 0.62));
  box-shadow: var(--shadow);
  z-index: 0;
}

.topbar,
.card,
.canvas-frame {
  position: relative;
  z-index: 1;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 18px 20px 10px;
}

.brand,
.btn-row,
.hero-pair,
.result-pair,
.intro-actions {
  display: flex;
  align-items: center;
}

.brand {
  gap: 16px;
}

.avatar-stack {
  display: flex;
  align-items: center;
}

.avatar,
.result-avatar {
  width: 68px;
  height: 68px;
  object-fit: cover;
  border-radius: 50%;
  border: 3px solid rgba(255, 255, 255, 0.8);
  box-shadow: 0 10px 24px rgba(116, 73, 57, 0.16);
  background: #fff;
}

.avatar.second {
  margin-left: -14px;
  transform: translateY(10px);
}

.eyebrow,
.section-tag,
.info-kicker,
.canvas-label {
  margin: 0;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #c17f64;
  font-size: 0.78rem;
  font-weight: 700;
}

.title,
.splash-title,
.intro-title,
.result-title,
.canvas-title {
  margin: 0;
}

.title {
  font-size: clamp(1.7rem, 3vw, 2.2rem);
  line-height: 1.05;
}

.sub,
.splash-sub,
.intro-sub,
.micro-copy,
.tip,
.result-text,
.info-card p {
  color: var(--muted);
}

.sub {
  margin: 6px 0 0;
}

.btn-row {
  gap: 10px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.ghost,
.start-btn {
  min-height: 44px;
  border-radius: 999px;
  padding: 10px 18px;
  transition: transform 140ms ease, box-shadow 140ms ease, background 140ms ease;
}

.ghost {
  background: rgba(255, 255, 255, 0.82);
  color: var(--ink);
  box-shadow: inset 0 0 0 1px rgba(124, 90, 79, 0.12);
}

.start-btn {
  color: #fff;
  background: linear-gradient(180deg, #ffaf85, var(--accent));
  box-shadow: 0 14px 28px rgba(255, 142, 99, 0.28);
}

.ghost:hover,
.start-btn:hover {
  transform: translateY(-1px);
}

.card {
  background: var(--card);
  border: 1px solid rgba(255, 255, 255, 0.55);
  border-radius: 30px;
  box-shadow: var(--shadow);
  backdrop-filter: blur(12px);
}

.splash {
  display: grid;
  grid-template-columns: 1.2fr 0.8fr;
  gap: 18px;
  padding: 28px;
  margin-bottom: 18px;
}

.splash-title,
.intro-title,
.result-title {
  font-size: clamp(1.8rem, 4vw, 2.8rem);
  font-weight: 800;
}

.splash-sub,
.intro-sub {
  margin: 12px 0 0;
  line-height: 1.7;
  font-size: 1rem;
}

.feature-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 18px;
}

.feature-pill,
.canvas-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 38px;
  padding: 8px 14px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.7);
  color: #b16d52;
  box-shadow: inset 0 0 0 1px rgba(177, 109, 82, 0.12);
  font-weight: 700;
  font-size: 0.92rem;
}

.hero-pair,
.result-pair {
  justify-content: center;
  gap: 18px;
}

.hero {
  width: min(30vw, 180px);
  aspect-ratio: 1;
  object-fit: cover;
  border-radius: 50%;
  border: 4px solid rgba(255, 255, 255, 0.78);
  box-shadow: 0 18px 34px rgba(116, 73, 57, 0.16);
  background: #fff;
}

.hero:last-child {
  transform: translateY(18px);
}

.intro {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  padding: 24px;
  margin-bottom: 18px;
}

.intro-copy {
  display: grid;
  align-content: center;
}

.intro-actions {
  gap: 14px;
  flex-wrap: wrap;
  margin-top: 18px;
}

.micro-copy {
  margin: 0;
  font-size: 0.92rem;
}

.info-grid {
  display: grid;
  gap: 12px;
}

.info-card {
  padding: 18px;
  border-radius: 22px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.9), rgba(255, 247, 240, 0.74));
  box-shadow: inset 0 0 0 1px rgba(135, 95, 78, 0.08);
}

.info-card strong {
  display: block;
  margin-top: 8px;
  font-size: 1.08rem;
}

.info-card p {
  margin: 8px 0 0;
  line-height: 1.6;
}

.hud {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  padding: 14px;
  margin-bottom: 12px;
}

.hud-item {
  padding: 16px 12px;
  text-align: center;
  border-radius: 22px;
  background: rgba(255, 255, 255, 0.76);
  box-shadow: inset 0 0 0 1px rgba(124, 90, 79, 0.08);
}

.num,
.grade {
  font-weight: 800;
}

.num {
  display: block;
  margin-top: 8px;
  font-size: 1.5rem;
}

.tip {
  margin: 0 0 14px;
  text-align: center;
}

.canvas-frame {
  padding: 18px;
  border-radius: 32px;
  background: linear-gradient(180deg, rgba(255, 251, 247, 0.84), rgba(255, 239, 228, 0.78));
  border: 1px solid rgba(255, 255, 255, 0.56);
  box-shadow: var(--shadow);
}

.canvas-topline {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 14px;
}

.canvas-title {
  margin-top: 6px;
  font-size: 1.35rem;
}

.canvas-shell {
  position: relative;
}

.game-canvas {
  width: 100%;
  height: min(78vh, 760px);
  display: block;
  border-radius: 30px;
  background: linear-gradient(180deg, #fff9f4, #ffe3c8);
  touch-action: none;
  box-shadow: 0 20px 44px rgba(129, 81, 61, 0.16);
}

.countdown,
.pause-mask,
.result-mask {
  position: absolute;
  inset: 0;
}

.countdown,
.pause-mask {
  display: grid;
  place-items: center;
  pointer-events: none;
}

.countdown {
  font-size: clamp(4rem, 14vw, 6rem);
  font-weight: 900;
  color: #fff;
  text-shadow: 0 12px 24px rgba(124, 90, 79, 0.35);
}

.pause-mask {
  color: #fff;
  font-size: clamp(2.4rem, 8vw, 3.2rem);
  font-weight: 800;
  background: rgba(90, 66, 55, 0.22);
}

.result-mask {
  position: fixed;
  z-index: 9999;
  display: grid;
  place-items: center;
  padding: 16px;
  background: rgba(88, 55, 43, 0.28);
}

.result-box {
  width: min(100%, 430px);
  padding: 26px;
  text-align: center;
  border-radius: 28px;
  background: #fff;
  box-shadow: var(--shadow);
  position: relative;
  z-index: 10000;
}

.result-text {
  line-height: 1.7;
}

.grade {
  margin: 14px 0 0;
  color: var(--accent-deep);
  font-size: 1.2rem;
}

.hidden {
  display: none;
}

@media (max-width: 860px) {
  .splash,
  .intro {
    grid-template-columns: 1fr;
  }

  .hero-pair {
    margin-top: 4px;
  }
}

@media (max-width: 760px) {
  .page {
    width: 100%;
    padding: 10px 10px 24px;
  }

  .hero-shell::before {
    height: 264px;
    border-radius: 28px;
  }

  .topbar {
    flex-direction: column;
    align-items: stretch;
    padding: 16px 14px 8px;
  }

  .brand {
    align-items: flex-start;
  }

  .btn-row {
    justify-content: center;
  }

  .splash,
  .intro,
  .canvas-frame {
    padding: 18px;
    border-radius: 24px;
  }

  .hud {
    grid-template-columns: repeat(2, 1fr);
  }

  .canvas-topline {
    flex-direction: column;
    align-items: flex-start;
  }

  .game-canvas {
    height: min(76vh, 720px);
    border-radius: 22px;
  }

  .hero {
    width: min(38vw, 150px);
  }
}
