/* ==========================================================================
   《新兵集训营：魔鬼教官的考验》样式表
   迷彩 / 军营 / 训练场视觉，纯 CSS 图形与动画，无外部资源依赖
   ========================================================================== */

:root {
  --green-900: #141f13;
  --green-800: #1b2b1a;
  --green-700: #223a20;
  --green-600: #2f4f2f;
  --green-500: #3e613e;
  --green-400: #4f7a4f;
  --olive: #556b2f;
  --olive-light: #6b8e23;
  --khaki: #d4b483;
  --khaki-dark: #a8895a;
  --tan: #8b7355;
  --sand: #f0e6c8;
  --sand-dark: #e2d3a8;
  --gold: #f4c542;
  --red: #e0504b;
  --red-dark: #a9322c;
  --white: #f7f5ec;
  --ink: #232323;
  --shadow: rgba(0, 0, 0, 0.35);

  --font: "PingFang SC", "Microsoft YaHei", "Noto Sans SC", "Segoe UI", system-ui, -apple-system, sans-serif;

  --radius: 16px;
  --radius-lg: 22px;
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }

html, body {
  margin: 0;
  padding: 0;
  width: 100%;
  height: 100%;
  overflow: hidden;
  font-family: var(--font);
  color: var(--white);
  touch-action: manipulation;
  -webkit-user-select: none;
  user-select: none;
}

body {
  /* 迷彩风格底纹：深绿 + 橄榄 + 卡其斑点 */
  background:
    radial-gradient(circle at 12% 18%, rgba(107, 142, 35, 0.35) 0 90px, transparent 95px),
    radial-gradient(circle at 78% 12%, rgba(79, 122, 79, 0.45) 0 120px, transparent 125px),
    radial-gradient(circle at 30% 78%, rgba(212, 180, 131, 0.18) 0 110px, transparent 115px),
    radial-gradient(circle at 88% 70%, rgba(62, 97, 62, 0.4) 0 100px, transparent 105px),
    radial-gradient(circle at 55% 40%, rgba(34, 58, 32, 0.5) 0 140px, transparent 145px),
    linear-gradient(160deg, #26371f 0%, #1b2b1a 55%, #162416 100%);
}

#app {
  position: relative;
  width: 100%;
  height: 100dvh;
  min-height: 100vh;
  overflow: hidden;
}

/* ============ 背景装饰 ============ */
.bg-decor {
  position: absolute;
  inset: 0;
  pointer-events: none;
  overflow: hidden;
  z-index: 0;
}

.bg-sun {
  position: absolute;
  top: 6%;
  right: 8%;
  width: 90px;
  height: 90px;
  border-radius: 50%;
  background: radial-gradient(circle, #ffe08a 0%, #f4c542 45%, rgba(244, 197, 66, 0) 72%);
  filter: blur(1px);
  opacity: 0.9;
  animation: sunPulse 6s ease-in-out infinite;
}

.bg-hill {
  position: absolute;
  bottom: 0;
  border-radius: 50% 50% 0 0 / 60% 60% 0 0;
  opacity: 0.5;
}
.hill-1 {
  left: -10%;
  width: 60%;
  height: 34%;
  background: linear-gradient(180deg, #2f4f2f, #1f341f);
}
.hill-2 {
  right: -12%;
  width: 55%;
  height: 28%;
  background: linear-gradient(180deg, #27422a, #182a18);
}

.bg-ground {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 16%;
  background: linear-gradient(180deg, #3a4d2a, #2b3a20);
  opacity: 0.55;
  border-top: 3px dashed rgba(212, 180, 131, 0.35);
}

.bg-tent {
  position: absolute;
  bottom: 14%;
  width: 0;
  height: 0;
  border-left: 70px solid transparent;
  border-right: 70px solid transparent;
  border-bottom: 78px solid #4f6b3a;
  opacity: 0.85;
  filter: drop-shadow(0 8px 10px rgba(0, 0, 0, 0.3));
}
.bg-tent::after {
  content: "";
  position: absolute;
  left: -18px;
  top: 12px;
  border-left: 18px solid transparent;
  border-right: 18px solid transparent;
  border-bottom: 24px solid #2f4622;
  transform: rotate(0);
}
.tent-1 { left: 6%; transform: scale(0.9); }
.tent-2 { right: 8%; transform: scale(0.75); }

.bg-stars {
  position: absolute;
  color: var(--gold);
  font-size: 18px;
  animation: twinkle 2.4s ease-in-out infinite;
}
.star-1 { top: 14%; left: 22%; animation-delay: 0s; }
.star-2 { top: 26%; right: 28%; animation-delay: 0.8s; font-size: 14px; }
.star-3 { top: 10%; left: 55%; animation-delay: 1.4s; font-size: 12px; }

/* ============ 界面容器 ============ */
.screen {
  position: absolute;
  inset: 0;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 20px;
  opacity: 0;
  visibility: hidden;
  transform: translateY(14px);
  transition: opacity 0.45s ease, transform 0.45s ease, visibility 0.45s;
  overflow-y: auto;
}

.screen.active {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

/* ============ 通用按钮 ============ */
.btn {
  font-family: var(--font);
  font-weight: 700;
  letter-spacing: 0.5px;
  border: none;
  cursor: pointer;
  border-radius: 14px;
  padding: 13px 24px;
  font-size: 17px;
  color: var(--white);
  position: relative;
  transition: transform 0.12s ease, box-shadow 0.12s ease, filter 0.12s ease;
  min-height: 48px;
  box-shadow: 0 6px 0 rgba(0, 0, 0, 0.3), 0 10px 22px rgba(0, 0, 0, 0.35);
}

.btn:hover { filter: brightness(1.08); transform: translateY(-2px); }
.btn:active { transform: translateY(3px); box-shadow: 0 2px 0 rgba(0, 0, 0, 0.3), 0 4px 10px rgba(0, 0, 0, 0.3); }
.btn:focus-visible { outline: 3px solid var(--gold); outline-offset: 2px; }

.btn-lg { font-size: 20px; padding: 16px 40px; border-radius: 18px; }

.btn-primary {
  background: linear-gradient(180deg, #f6d365 0%, #e0a93f 55%, #c88b2a 100%);
  color: #4a2e0a;
  text-shadow: 0 1px 0 rgba(255, 255, 255, 0.35);
}
.btn-primary:hover { background: linear-gradient(180deg, #ffe08a 0%, #f0b845 55%, #d79a30 100%); }

.btn-secondary {
  background: linear-gradient(180deg, #557a4c 0%, #3d5c38 55%, #31492d 100%);
  color: var(--white);
  border: 1px solid rgba(212, 180, 131, 0.35);
}

.btn-ghost {
  background: transparent;
  color: var(--sand);
  box-shadow: none;
  border: 1px solid rgba(212, 180, 131, 0.4);
}
.btn-ghost:hover { background: rgba(212, 180, 131, 0.12); }

/* ============ 开始界面 ============ */
#start-screen { text-align: center; }

.title-block { animation: popIn 0.6s cubic-bezier(0.2, 1.4, 0.4, 1) both; }

.title-badge {
  font-size: 56px;
  filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.4));
  animation: badgeFloat 3s ease-in-out infinite;
}

.game-title {
  margin: 8px 0 4px;
  font-size: clamp(40px, 9vw, 76px);
  font-weight: 900;
  letter-spacing: 4px;
  color: var(--sand);
  text-shadow:
    0 2px 0 var(--khaki-dark),
    0 4px 0 #6b4f26,
    0 8px 18px rgba(0, 0, 0, 0.55);
  -webkit-text-stroke: 1px rgba(90, 60, 20, 0.4);
}

.game-subtitle {
  margin: 0;
  font-size: clamp(18px, 4vw, 26px);
  font-weight: 700;
  letter-spacing: 8px;
  color: var(--gold);
  text-shadow: 0 2px 6px rgba(0, 0, 0, 0.5);
}

.game-slogan {
  margin: 14px 0 0;
  font-size: 14px;
  letter-spacing: 2px;
  color: var(--sand);
  opacity: 0.85;
}

.start-menu {
  margin-top: 30px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  align-items: center;
  animation: popIn 0.6s 0.15s cubic-bezier(0.2, 1.4, 0.4, 1) both;
}

.start-menu-row {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  justify-content: center;
}

.best-score {
  margin-top: 26px;
  font-size: 16px;
  color: var(--khaki);
  background: rgba(0, 0, 0, 0.25);
  padding: 9px 22px;
  border-radius: 999px;
  border: 1px solid rgba(212, 180, 131, 0.3);
  animation: popIn 0.6s 0.28s cubic-bezier(0.2, 1.4, 0.4, 1) both;
}
#best-score { font-weight: 900; color: var(--gold); font-size: 18px; }

.page-footer {
  position: absolute;
  bottom: 16px;
  left: 0;
  right: 0;
  text-align: center;
  font-size: 12px;
  letter-spacing: 3px;
  color: var(--sand);
  opacity: 0.55;
}

/* ============ 战绩面板 ============ */
.history-panel {
  margin-top: 22px;
  width: min(480px, 92vw);
  max-height: 40vh;
  overflow-y: auto;
  background: rgba(16, 24, 15, 0.88);
  border: 1px solid rgba(212, 180, 131, 0.35);
  border-radius: var(--radius-lg);
  padding: 16px 18px;
  text-align: left;
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.4);
  animation: popIn 0.35s ease both;
}
.history-panel h3 { margin: 0 0 10px; color: var(--gold); letter-spacing: 2px; font-size: 17px; }
.history-list { list-style: none; margin: 0; padding: 0; }
.history-list li {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  padding: 8px 6px;
  border-bottom: 1px dashed rgba(212, 180, 131, 0.2);
  font-size: 14px;
}
.history-list li:last-child { border-bottom: none; }
.history-date { color: var(--sand); opacity: 0.7; font-size: 12px; }
.history-grade { font-weight: 900; color: var(--gold); }
.history-score { color: var(--white); font-weight: 700; }
.history-empty { color: var(--sand); opacity: 0.6; justify-content: center; }

.hidden { display: none !important; }

/* ============ 关卡介绍界面 ============ */
.intro-card {
  width: min(560px, 94vw);
  background: rgba(20, 30, 18, 0.86);
  border: 2px solid rgba(212, 180, 131, 0.4);
  border-radius: var(--radius-lg);
  padding: 34px 28px;
  text-align: center;
  box-shadow: 0 18px 45px rgba(0, 0, 0, 0.5);
  animation: cardIn 0.5s cubic-bezier(0.2, 1.3, 0.4, 1) both;
}

.intro-clear {
  display: inline-block;
  background: rgba(107, 142, 35, 0.25);
  color: #b7e07a;
  padding: 5px 16px;
  border-radius: 999px;
  font-size: 14px;
  margin-bottom: 10px;
  letter-spacing: 2px;
}

.intro-icon { font-size: 64px; margin: 6px 0; animation: badgeFloat 2.6s ease-in-out infinite; }
.intro-title { margin: 6px 0; font-size: 32px; color: var(--sand); letter-spacing: 3px; }
.intro-desc { margin: 0; font-size: 20px; color: var(--gold); font-weight: 700; letter-spacing: 2px; }
.intro-rule {
  margin: 16px auto;
  max-width: 420px;
  font-size: 15px;
  line-height: 1.7;
  color: var(--sand);
  opacity: 0.92;
  text-align: left;
}
.intro-meta { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; margin: 8px 0 22px; }
.meta-chip {
  background: rgba(0, 0, 0, 0.3);
  border: 1px solid rgba(212, 180, 131, 0.3);
  border-radius: 999px;
  padding: 7px 16px;
  font-size: 14px;
  color: var(--sand);
}
.meta-chip b { color: var(--gold); }
#intro-screen .btn { margin: 8px 6px; }

/* ============ 游戏界面 HUD ============ */
#game-screen {
  justify-content: flex-start;
  padding: 12px;
  gap: 8px;
}

.hud {
  width: 100%;
  max-width: 960px;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
  flex: 0 0 auto;
}

.hud-cell {
  background: rgba(15, 24, 14, 0.85);
  border: 1px solid rgba(212, 180, 131, 0.28);
  border-radius: 12px;
  padding: 7px 6px;
  text-align: center;
  display: flex;
  flex-direction: column;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}
.hud-label { font-size: 11px; letter-spacing: 2px; color: var(--khaki); opacity: 0.85; }
.hud-value { font-size: 22px; font-weight: 900; line-height: 1.2; }
.hud-value.score { color: var(--gold); }
.hud-value.time { color: var(--sand); }
.hud-value.time.danger { color: var(--red); animation: blink 0.8s step-start infinite; }
.hud-value.lives { font-size: 18px; letter-spacing: 1px; }

.combo-badge {
  position: absolute;
  top: 92px;
  right: 16px;
  z-index: 20;
  background: linear-gradient(180deg, #ff9a3d, #e2532c);
  color: #fff;
  font-weight: 900;
  padding: 6px 14px;
  border-radius: 999px;
  font-size: 15px;
  box-shadow: 0 4px 14px rgba(226, 83, 44, 0.5);
  animation: comboPop 0.3s ease;
}
.combo-badge.hot { background: linear-gradient(180deg, #ffc93d, #ff7a1a); box-shadow: 0 4px 18px rgba(255, 150, 40, 0.7); }
.combo-badge.fire { background: linear-gradient(180deg, #ff5e3a, #c81e1e); box-shadow: 0 4px 22px rgba(255, 80, 40, 0.85); animation: comboPop 0.3s ease, fireGlow 0.5s ease-in-out infinite alternate; }

/* ============ 任务栏 ============ */
.mission {
  width: 100%;
  max-width: 960px;
  flex: 0 0 auto;
  background: rgba(15, 24, 14, 0.75);
  border: 1px solid rgba(212, 180, 131, 0.25);
  border-radius: 12px;
  padding: 8px 14px;
}
.mission-text { font-size: 16px; font-weight: 700; color: var(--sand); letter-spacing: 1px; min-height: 22px; text-align: center; }
.progress-track {
  height: 9px;
  background: rgba(0, 0, 0, 0.4);
  border-radius: 999px;
  margin: 7px 0 5px;
  overflow: hidden;
  border: 1px solid rgba(212, 180, 131, 0.2);
}
.progress-fill {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, #6b8e23, #f4c542);
  border-radius: 999px;
  transition: width 0.3s ease;
}

.checklist {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  justify-content: center;
  padding: 4px 0;
}
.check-item {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  font-size: 22px;
  padding: 2px 8px;
  border-radius: 10px;
  background: rgba(0, 0, 0, 0.25);
  border: 1px solid rgba(212, 180, 131, 0.25);
  transition: all 0.25s ease;
}
.check-item.done {
  opacity: 0.4;
  text-decoration: line-through;
  filter: grayscale(1);
  border-color: rgba(107, 142, 35, 0.6);
  background: rgba(107, 142, 35, 0.2);
}

/* ============ 游戏场地 ============ */
.arena {
  position: relative;
  width: 100%;
  max-width: 960px;
  flex: 1 1 auto;
  min-height: 200px;
  background:
    radial-gradient(circle at 50% 0%, rgba(107, 142, 35, 0.12), transparent 60%),
    linear-gradient(180deg, rgba(43, 62, 34, 0.55), rgba(28, 42, 24, 0.65));
  border: 2px solid rgba(212, 180, 131, 0.3);
  border-radius: 18px;
  overflow: hidden;
  box-shadow: inset 0 0 60px rgba(0, 0, 0, 0.35);
  touch-action: manipulation;
}

.arena::after {
  content: "";
  position: absolute;
  inset: 0;
  background-image:
    repeating-linear-gradient(90deg, rgba(212, 180, 131, 0.05) 0 1px, transparent 1px 80px),
    repeating-linear-gradient(0deg, rgba(212, 180, 131, 0.05) 0 1px, transparent 1px 80px);
  pointer-events: none;
}

/* 第一关：可点击的军训用品 */
.spawn-item {
  position: absolute;
  transform: translate(-50%, -50%);
  font-size: 52px;
  line-height: 1;
  padding: 10px;
  border-radius: 16px;
  cursor: pointer;
  background: rgba(0, 0, 0, 0.18);
  border: 2px solid transparent;
  transition: transform 0.08s ease, border-color 0.08s ease;
  animation: itemPop 0.32s cubic-bezier(0.2, 1.6, 0.4, 1) both;
  pointer-events: auto;
}
.spawn-item:hover { transform: translate(-50%, -50%) scale(1.12); }
.spawn-item:active { transform: translate(-50%, -50%) scale(0.9); }
.spawn-item.good { border-color: rgba(107, 142, 35, 0.7); background: rgba(107, 142, 35, 0.16); }
.spawn-item.bad { border-color: rgba(224, 80, 75, 0.55); background: rgba(224, 80, 75, 0.12); }
.spawn-item.leaving { animation: itemOut 0.25s ease forwards; }

/* 第二关：目标 */
.target {
  position: absolute;
  transform: translate(-50%, -50%);
  width: 62px;
  height: 62px;
  cursor: pointer;
  box-shadow: 0 6px 14px rgba(0, 0, 0, 0.35), inset 0 -4px 6px rgba(0, 0, 0, 0.25);
  animation: itemPop 0.35s cubic-bezier(0.2, 1.6, 0.4, 1) both;
  transition: transform 0.08s ease;
}
.target:hover { transform: translate(-50%, -50%) scale(1.1); }
.target:active { transform: translate(-50%, -50%) scale(0.88); }
.target.leaving { animation: itemOut 0.22s ease forwards; }
.target.wrong-flash { animation: shake 0.4s ease; }

.target.s-circle { border-radius: 50%; }
.target.s-square { border-radius: 10px; }
.target.s-triangle { border-radius: 0; clip-path: polygon(50% 0, 0 100%, 100% 100%); }
.target.s-star { border-radius: 0; clip-path: polygon(50% 0%, 61% 35%, 98% 35%, 68% 57%, 79% 91%, 50% 70%, 21% 91%, 32% 57%, 2% 35%, 39% 35%); }

.target.c-red { background: linear-gradient(180deg, #ff6b5e, #d23a2f); }
.target.c-green { background: linear-gradient(180deg, #6fd26a, #2f8f2f); }
.target.c-blue { background: linear-gradient(180deg, #5eb2ff, #2f6fd2); }
.target.c-yellow { background: linear-gradient(180deg, #ffe066, #e0a22a); }

/* 第二关提示色块 */
.prompt-chip {
  display: inline-block;
  width: 20px;
  height: 20px;
  border-radius: 6px;
  vertical-align: middle;
  margin: 0 4px;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.4);
}

/* ============ 第三关 ============ */
.level3-controls {
  width: 100%;
  max-width: 960px;
  flex: 1 1 auto;
  min-height: 200px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  background: rgba(28, 42, 24, 0.6);
  border: 2px solid rgba(212, 180, 131, 0.3);
  border-radius: 18px;
  padding: 16px;
}

.formation {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 4px;
  font-size: 30px;
  line-height: 1;
  transition: transform 0.18s ease;
}
.formation.move-left { transform: translateX(-14px); }
.formation.move-right { transform: translateX(14px); }
.formation.move-up { transform: translateY(-10px); }
.formation.move-down { transform: translateY(10px); }
.formation.wrong { animation: shake 0.4s ease; }
.formation .soldier {
  background: rgba(0, 0, 0, 0.2);
  border-radius: 8px;
  padding: 4px;
  text-align: center;
}

.command {
  font-size: 34px;
  font-weight: 900;
  letter-spacing: 3px;
  color: var(--gold);
  text-shadow: 0 3px 8px rgba(0, 0, 0, 0.5);
  animation: commandPop 0.35s cubic-bezier(0.2, 1.6, 0.4, 1) both;
}

.dpad {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  margin-top: 6px;
}
.dpad-mid { display: flex; gap: 8px; align-items: center; }
.dpad-center {
  width: 56px;
  height: 56px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 26px;
  background: rgba(0, 0, 0, 0.28);
  border-radius: 50%;
}
.dir-btn {
  width: 66px;
  height: 66px;
  font-size: 30px;
  border: none;
  border-radius: 16px;
  cursor: pointer;
  background: linear-gradient(180deg, #557a4c, #31492d);
  color: #fff;
  box-shadow: 0 5px 0 rgba(0, 0, 0, 0.32), 0 8px 16px rgba(0, 0, 0, 0.35);
  transition: transform 0.08s ease, box-shadow 0.08s ease, filter 0.08s ease;
}
.dir-btn:hover { filter: brightness(1.1); }
.dir-btn:active { transform: translateY(3px); box-shadow: 0 2px 0 rgba(0, 0, 0, 0.32), 0 3px 8px rgba(0, 0, 0, 0.3); }
.dir-btn.correct { background: linear-gradient(180deg, #6fd26a, #2f8f2f); }
.dir-btn.wrong { background: linear-gradient(180deg, #ff6b5e, #c0392b); animation: shake 0.4s ease; }

/* ============ 结算界面 ============ */
.result-card {
  width: min(600px, 94vw);
  background: rgba(20, 30, 18, 0.9);
  border: 2px solid rgba(212, 180, 131, 0.45);
  border-radius: var(--radius-lg);
  padding: 30px 24px;
  text-align: center;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.55);
  animation: cardIn 0.55s cubic-bezier(0.2, 1.3, 0.4, 1) both;
  max-height: 92vh;
  overflow-y: auto;
}

.result-ribbon {
  display: inline-block;
  background: linear-gradient(180deg, #f6d365, #c88b2a);
  color: #4a2e0a;
  font-weight: 900;
  letter-spacing: 4px;
  padding: 5px 20px;
  border-radius: 999px;
  font-size: 14px;
  margin-bottom: 12px;
}

.result-badge {
  width: 92px;
  height: 92px;
  margin: 6px auto;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 52px;
  font-weight: 900;
  color: #4a2e0a;
  background: radial-gradient(circle at 35% 30%, #ffe9a8, #f4c542 55%, #c88b2a);
  box-shadow: 0 0 0 6px rgba(244, 197, 66, 0.25), 0 10px 26px rgba(0, 0, 0, 0.5);
  animation: badgePop 0.7s cubic-bezier(0.2, 1.6, 0.4, 1) both, badgeFloat 3s 0.7s ease-in-out infinite;
}

.result-title { margin: 12px 0 2px; font-size: 28px; color: var(--sand); letter-spacing: 3px; }
.result-grade-text { margin: 0; font-size: 20px; color: var(--gold); font-weight: 700; letter-spacing: 2px; }

.result-stats {
  display: flex;
  gap: 10px;
  justify-content: center;
  flex-wrap: wrap;
  margin: 20px 0;
}
.stat-box {
  flex: 1 1 90px;
  min-width: 90px;
  background: rgba(0, 0, 0, 0.28);
  border: 1px solid rgba(212, 180, 131, 0.25);
  border-radius: 12px;
  padding: 10px 8px;
}
.stat-label { display: block; font-size: 12px; color: var(--khaki); letter-spacing: 2px; }
.stat-value { display: block; font-size: 26px; font-weight: 900; color: var(--gold); margin-top: 3px; }

.level-breakdown {
  margin: 6px 0 14px;
  text-align: left;
  border-top: 1px dashed rgba(212, 180, 131, 0.25);
}
.lb-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 4px;
  border-bottom: 1px dashed rgba(212, 180, 131, 0.18);
  font-size: 15px;
}
.lb-name { flex: 1 1 auto; color: var(--sand); }
.lb-score { flex: 0 0 auto; color: var(--gold); font-weight: 700; }
.lb-status { flex: 0 0 60px; text-align: right; font-size: 14px; }

.result-comment {
  margin: 14px auto;
  max-width: 440px;
  font-size: 16px;
  line-height: 1.7;
  color: var(--sand);
  background: rgba(0, 0, 0, 0.25);
  border-left: 4px solid var(--gold);
  border-radius: 8px;
  padding: 12px 16px;
  text-align: left;
}
.result-saved { font-size: 13px; color: var(--khaki); opacity: 0.85; margin: 0 0 14px; }

.result-buttons { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; }

/* ============ 加分 / 提示浮层 ============ */
.popup {
  position: fixed;
  z-index: 100;
  transform: translate(-50%, -50%);
  font-weight: 900;
  font-size: 24px;
  pointer-events: none;
  text-shadow: 0 2px 6px rgba(0, 0, 0, 0.5);
  animation: floatUp 0.9s ease-out forwards;
}
.popup.good { color: #ffe08a; }
.popup.bad { color: #ff8a80; }
.popup.combo { color: #ffc93d; font-size: 30px; }
.popup.info { color: #b7e07a; font-size: 18px; }

/* ============ 动画 ============ */
@keyframes popIn {
  from { opacity: 0; transform: scale(0.85) translateY(16px); }
  to { opacity: 1; transform: scale(1) translateY(0); }
}
@keyframes cardIn {
  from { opacity: 0; transform: scale(0.9) translateY(20px); }
  to { opacity: 1; transform: scale(1) translateY(0); }
}
@keyframes badgeFloat {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-7px); }
}
@keyframes sunPulse {
  0%, 100% { transform: scale(1); opacity: 0.85; }
  50% { transform: scale(1.1); opacity: 1; }
}
@keyframes twinkle {
  0%, 100% { opacity: 0.25; transform: scale(0.8); }
  50% { opacity: 1; transform: scale(1.15); }
}
@keyframes itemPop {
  from { opacity: 0; transform: translate(-50%, -50%) scale(0.2); }
  to { opacity: 1; transform: translate(-50%, -50%) scale(1); }
}
@keyframes itemOut {
  to { opacity: 0; transform: translate(-50%, -50%) scale(0.3); }
}
@keyframes floatUp {
  0% { opacity: 0; transform: translate(-50%, -50%) scale(0.7); }
  20% { opacity: 1; transform: translate(-50%, -60%) scale(1.15); }
  100% { opacity: 0; transform: translate(-50%, -160%) scale(1); }
}
@keyframes shake {
  0%, 100% { transform: translate(-50%, -50%) translateX(0); }
  20% { transform: translate(-50%, -50%) translateX(-8px); }
  40% { transform: translate(-50%, -50%) translateX(8px); }
  60% { transform: translate(-50%, -50%) translateX(-6px); }
  80% { transform: translate(-50%, -50%) translateX(6px); }
}
@keyframes comboPop {
  0% { transform: scale(0.4); }
  60% { transform: scale(1.25); }
  100% { transform: scale(1); }
}
@keyframes fireGlow {
  from { filter: brightness(1); }
  to { filter: brightness(1.3); }
}
@keyframes commandPop {
  from { opacity: 0; transform: scale(0.6) rotate(-6deg); }
  to { opacity: 1; transform: scale(1) rotate(0); }
}
@keyframes badgePop {
  from { opacity: 0; transform: scale(0.3) rotate(-20deg); }
  to { opacity: 1; transform: scale(1) rotate(0); }
}
@keyframes blink {
  50% { opacity: 0.4; }
}

/* ============ 响应式适配 ============ */
@media (max-width: 640px) {
  .screen { padding: 12px; }
  .game-title { letter-spacing: 2px; }
  .game-subtitle { letter-spacing: 5px; }
  .hud-value { font-size: 19px; }
  .hud-value.lives { font-size: 15px; }
  .spawn-item { font-size: 44px; padding: 8px; }
  .target { width: 52px; height: 52px; }
  .intro-title { font-size: 26px; }
  .dir-btn { width: 58px; height: 58px; font-size: 26px; }
  .formation { font-size: 24px; }
  .command { font-size: 28px; }
  .combo-badge { top: 88px; right: 10px; font-size: 13px; }
  .btn-lg { font-size: 18px; padding: 14px 30px; }
}

@media (max-height: 640px) {
  .game-title { font-size: 38px; }
  .title-badge { font-size: 40px; }
  .start-menu { margin-top: 16px; gap: 10px; }
  .best-score { margin-top: 14px; }
  .intro-card { padding: 20px 18px; }
  .intro-icon { font-size: 46px; }
}

@media (pointer: coarse) {
  .btn, .dir-btn, .spawn-item, .target { cursor: default; }
}
