/* =========================================================
   弹弓小鸟 · Sling Birds
   全程序化矢量美术，无第三方图片素材
   ========================================================= */

* { box-sizing: border-box; }
:root {
  --cream: #fff6dc;
  --cream-2: #ffe9b5;
  --ink: #3a2a12;
  --ink-soft: #6b542e;
  --orange: #ff9f1c;
  --orange-deep: #d96a00;
  --green: #53b84a;
  --green-deep: #2c7a2a;
  --panel-dark: rgba(7, 29, 31, .58);
  --panel-line: rgba(255, 255, 255, .2);
  --shadow: 0 12px 32px rgba(0, 0, 0, .35);
}

html, body {
  margin: 0;
  padding: 0;
  height: 100%;
  overflow: hidden;
  background: #06181c;
  color: #fff;
  font-family: "Microsoft YaHei UI", "Microsoft YaHei", "PingFang SC", "Hiragino Sans GB", "Noto Sans SC", sans-serif;
  -webkit-font-smoothing: antialiased;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
}

body {
  background:
    radial-gradient(120% 90% at 50% 0%, #123b42 0%, #071a1f 55%, #040f12 100%);
}

#app {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

#stage {
  position: relative;
  width: min(100vw, calc(100vh * 16 / 9));
  height: min(100vh, calc(100vw * 9 / 16));
  overflow: hidden;
  background: #7ec8f0;
  box-shadow: 0 30px 120px rgba(0, 0, 0, .65), 0 0 0 1px rgba(255, 255, 255, .04);
  container-type: size;
}

#game {
  display: block;
  width: 100%;
  height: 100%;
  touch-action: none;
  cursor: crosshair;
}

.hidden { display: none !important; }

/* ============================ 通用按钮 ============================ */
.btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .5em;
  border: 0;
  border-radius: 999px;
  padding: .78em 1.7em;
  font-family: inherit;
  font-weight: 900;
  font-size: clamp(13px, 2.5cqh, 22px);
  line-height: 1.15;
  letter-spacing: .04em;
  cursor: pointer;
  color: #4a2600;
  background: linear-gradient(180deg, #ffe27a 0%, #ffc23c 55%, #ffa41b 100%);
  box-shadow: 0 .55em 0 #b85e00, 0 .9em 1.6em rgba(0, 0, 0, .3), inset 0 1px 0 rgba(255, 255, 255, .8);
  transition: transform .12s ease, filter .12s ease, box-shadow .12s ease;
  white-space: nowrap;
}
.btn:hover { transform: translateY(-2px) scale(1.015); filter: brightness(1.04); }
.btn:active { transform: translateY(.4em); box-shadow: 0 .18em 0 #b85e00, 0 .5em 1em rgba(0, 0, 0, .25), inset 0 1px 0 rgba(255, 255, 255, .8); }
.btn:focus-visible { outline: 3px solid #fff; outline-offset: 4px; }

.btn-primary { color: #4a2600; }

.btn-soft {
  color: #3f3218;
  background: linear-gradient(180deg, #fffdf3, #ffeec4);
  box-shadow: 0 .45em 0 #c9a86a, 0 .8em 1.4em rgba(0, 0, 0, .18), inset 0 1px 0 #fff;
}
.btn-soft:active { box-shadow: 0 .15em 0 #c9a86a, 0 .4em .8em rgba(0, 0, 0, .15), inset 0 1px 0 #fff; }

.btn-ghost {
  color: #f3fff8;
  background: rgba(6, 32, 34, .55);
  border: 1.5px solid rgba(255, 255, 255, .32);
  box-shadow: 0 .45em 0 rgba(0, 0, 0, .25), 0 .9em 1.6em rgba(0, 0, 0, .22);
  backdrop-filter: blur(8px);
}
.btn-ghost:hover { background: rgba(10, 46, 48, .72); }
.btn-ghost:active { box-shadow: 0 .12em 0 rgba(0, 0, 0, .25); }

.btn-xl {
  font-size: clamp(18px, 4.1cqh, 34px);
  padding: .95em 2.2em;
  letter-spacing: .08em;
}
.btn-arrow { font-size: .85em; transition: transform .15s ease; }
.btn:hover .btn-arrow { transform: translateX(4px); }

.btn-row { display: flex; gap: 1.4cqh; align-items: center; justify-content: center; flex-wrap: wrap; }

/* ============================ 标题画面 ============================ */
.screen {
  position: absolute;
  inset: 0;
  z-index: 10;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 4cqh 4cqw;
  text-align: center;
}

#screenTitle::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(70% 60% at 50% 42%, rgba(4, 22, 24, .52) 0%, rgba(4, 22, 24, .12) 55%, rgba(4, 22, 24, .55) 100%),
    linear-gradient(180deg, rgba(4, 22, 24, .35), rgba(4, 22, 24, .02) 35%, rgba(4, 22, 24, .58));
  pointer-events: none;
}

.title-glow {
  position: absolute;
  width: 70cqh;
  height: 70cqh;
  left: 50%;
  top: 34%;
  transform: translate(-50%, -50%);
  background: radial-gradient(circle, rgba(255, 214, 90, .22), transparent 62%);
  filter: blur(6px);
  pointer-events: none;
}

.title-wrap {
  position: relative;
  z-index: 2;
  display: flex;
  flex-direction: column;
  align-items: center;
  animation: floatIn .8s cubic-bezier(.2, .9, .25, 1.2) both;
}

.bird-badge {
  position: relative;
  width: clamp(74px, 16cqh, 152px);
  aspect-ratio: 1.16;
  margin-bottom: 1.3cqh;
  border-radius: 50% 50% 46% 46%;
  background:
    radial-gradient(circle at 36% 28%, #ff8b7d 0%, #f0544c 38%, #d23036 72%, #ab1e2a 100%);
  border: .55cqh solid #7d111f;
  box-shadow: inset -.4cqh -.7cqh 0 rgba(0, 0, 0, .16), inset .5cqh .5cqh 0 rgba(255, 255, 255, .18), 0 1.2cqh 2.4cqh rgba(0, 0, 0, .35);
  transform: rotate(-4deg);
}
.bird-badge::before {
  content: "";
  position: absolute;
  left: 50%;
  top: -18%;
  width: 26%;
  height: 30%;
  transform: translateX(-50%) rotate(-8deg);
  background: #b02330;
  clip-path: polygon(50% 0%, 65% 65%, 50% 100%, 35% 65%);
}
.badge-eye {
  position: absolute;
  top: 30%;
  width: 27%;
  aspect-ratio: 1;
  border-radius: 50%;
  background: #fff;
  border: .35cqh solid #7d111f;
  display: flex;
  align-items: center;
  justify-content: center;
}
.badge-eye.left { left: 21%; }
.badge-eye.right { right: 21%; }
.badge-eye i {
  width: 42%;
  aspect-ratio: 1;
  border-radius: 50%;
  background: #20232b;
  transform: translateX(18%);
  position: relative;
}
.badge-eye i::after {
  content: "";
  position: absolute;
  width: 28%;
  aspect-ratio: 1;
  border-radius: 50%;
  background: #fff;
  left: 22%;
  top: 16%;
}
.badge-brow {
  position: absolute;
  top: 19%;
  width: 32%;
  height: 12%;
  background: #6d0d18;
  border-radius: 999px;
  z-index: 2;
}
.badge-brow.left { left: 14%; transform: rotate(17deg); }
.badge-brow.right { right: 14%; transform: rotate(-17deg); }
.badge-beak {
  position: absolute;
  left: 50%;
  top: 57%;
  width: 30%;
  height: 24%;
  transform: translateX(-50%);
  background: linear-gradient(180deg, #ffc24e 0 52%, #e78908 52% 100%);
  border: .3cqh solid #8f4b00;
  clip-path: polygon(0% 0%, 100% 0%, 46% 100%);
  border-radius: 2px;
}

.logo {
  position: relative;
  margin: 0;
  font-size: clamp(48px, 14.5cqh, 150px);
  font-weight: 900;
  line-height: .98;
  letter-spacing: .05em;
  color: #ffe57a;
  background: linear-gradient(180deg, #fffbe2 0%, #ffe87c 38%, #ffb01f 72%, #ff8a00 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  filter:
    drop-shadow(0 .045em 0 #9a4a0c)
    drop-shadow(0 .09em 0 #7a3505)
    drop-shadow(0 .2em .16em rgba(0, 0, 0, .4));
  transform: rotate(-1.5deg);
}

.logo-en {
  margin: 1.3cqh 0 0;
  font-size: clamp(9px, 1.75cqh, 17px);
  font-weight: 900;
  letter-spacing: .42em;
  color: #fff4c4;
  text-shadow: 0 2px 6px rgba(0, 0, 0, .45);
  opacity: .95;
}

.tagline {
  margin: 2.2cqh 0 0;
  font-size: clamp(12px, 2.4cqh, 22px);
  font-weight: 700;
  letter-spacing: .08em;
  color: #ecffe9;
  text-shadow: 0 2px 10px rgba(0, 0, 0, .55);
}

.menu-actions {
  position: relative;
  z-index: 2;
  margin-top: 4.2cqh;
  display: flex;
  flex-direction: column;
  gap: 1.8cqh;
  align-items: center;
  animation: floatIn .8s .12s cubic-bezier(.2, .9, .25, 1.2) both;
}

.title-foot {
  position: absolute;
  bottom: 2.4cqh;
  left: 0;
  right: 0;
  z-index: 2;
  font-size: clamp(8px, 1.5cqh, 13px);
  letter-spacing: .16em;
  color: rgba(236, 255, 240, .62);
  text-shadow: 0 1px 4px rgba(0, 0, 0, .5);
}
.foot-dot { margin: 0 .8em; opacity: .6; }

@keyframes floatIn {
  from { opacity: 0; transform: translateY(18px) scale(.96); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

/* ============================ 面板 ============================ */
.panel {
  position: relative;
  width: min(88cqw, 800px);
  max-height: 92cqh;
  overflow: auto;
  padding: 3.6cqh 4cqw;
  border-radius: 3cqh;
  background: linear-gradient(180deg, #fffdf4 0%, #fff5d8 70%, #ffe9b8 100%);
  color: var(--ink);
  box-shadow: 0 2cqh 5cqh rgba(0, 0, 0, .45), inset 0 0 0 1px #fff, inset 0 -1.2cqh 0 rgba(198, 154, 80, .18);
  border: .45cqh solid rgba(255, 255, 255, .75);
  animation: panelIn .3s cubic-bezier(.2, .9, .3, 1.25) both;
}
.panel::before {
  content: "";
  position: absolute;
  inset: 1.1cqh;
  border-radius: 2.2cqh;
  border: 2px dashed rgba(172, 129, 58, .18);
  pointer-events: none;
}
@keyframes panelIn {
  from { opacity: 0; transform: translateY(14px) scale(.94); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

.panel h2 {
  margin: 0;
  font-size: clamp(21px, 4.6cqh, 42px);
  font-weight: 900;
  letter-spacing: .05em;
  color: #3f2b0d;
}
.panel-sub {
  margin: .8cqh 0 0;
  font-size: clamp(11px, 2.1cqh, 18px);
  font-weight: 600;
  color: #8a7043;
}

.panel-head {
  display: flex;
  align-items: center;
  gap: 2cqw;
  margin-bottom: 2.6cqh;
}
.panel-title-wrap { flex: 0 0 auto; }
.panel-title-wrap p {
  margin: .5cqh 0 0;
  font-size: clamp(10px, 1.8cqh, 15px);
  color: #917849;
  font-weight: 600;
}
.head-spacer { flex: 1; }

.round-back {
  flex: 0 0 auto;
  width: clamp(34px, 7cqh, 60px);
  aspect-ratio: 1;
  border-radius: 50%;
  border: 0;
  cursor: pointer;
  font-size: clamp(16px, 3.2cqh, 28px);
  font-weight: 900;
  color: #5a3d12;
  background: linear-gradient(180deg, #fff8e2, #ffdf9d);
  box-shadow: 0 .5cqh 0 #c9a35c, 0 .8cqh 1.6cqh rgba(0, 0, 0, .14);
  transition: transform .12s ease;
  line-height: 1;
}
.round-back:hover { transform: translateY(-2px); }
.round-back:active { transform: translateY(3px); box-shadow: 0 .15cqh 0 #c9a35c; }

/* ============================ 关卡选择 ============================ */
.levels-panel { width: min(90cqw, 980px); }
.levels-panel .panel-sub { margin-top: .4cqh; }

.level-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.8cqh 1.6cqw;
}
.level-card {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1cqh;
  min-height: 15cqh;
  padding: 2cqh 2.2cqw 1.6cqh;
  border-radius: 2.2cqh;
  border: .35cqh solid #e2bd79;
  background:
    radial-gradient(140% 120% at 12% 0%, rgba(255, 255, 255, .95), transparent 55%),
    linear-gradient(155deg, #fffdf5, #ffedc4 75%, #ffe1a0);
  box-shadow: 0 .8cqh 0 #d3a75e, 0 1.2cqh 2.2cqh rgba(0, 0, 0, .12);
  cursor: pointer;
  text-align: left;
  font-family: inherit;
  color: var(--ink);
  transition: transform .14s ease, box-shadow .14s ease, filter .14s ease;
  overflow: hidden;
}
.level-card:hover:not(.locked) { transform: translateY(-.7cqh) rotate(-.4deg); box-shadow: 0 1.4cqh 0 #d3a75e, 0 1.8cqh 3cqh rgba(0, 0, 0, .18); }
.level-card:active:not(.locked) { transform: translateY(.25cqh); box-shadow: 0 .4cqh 0 #d3a75e; }
.level-card.locked { cursor: not-allowed; filter: grayscale(.5) brightness(.94); opacity: .78; }
.level-card.current { border-color: #ff9c1a; box-shadow: 0 .8cqh 0 #d17a00, 0 0 0 .5cqh rgba(255, 161, 31, .28), 0 1.2cqh 2.4cqh rgba(0, 0, 0, .16); }

.level-num {
  display: flex;
  align-items: center;
  gap: .55em;
  font-size: clamp(9px, 1.7cqh, 14px);
  font-weight: 900;
  letter-spacing: .15em;
  color: #a8782a;
  text-transform: uppercase;
}
.level-num b {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.2em;
  height: 2.2em;
  border-radius: 50%;
  background: linear-gradient(180deg, #ffd45e, #ff9d17);
  color: #5b3200;
  font-size: 1.35em;
  letter-spacing: 0;
  box-shadow: inset 0 1px 0 #fff3bd, 0 .18em 0 #c06c00;
}
.level-name {
  font-size: clamp(13px, 2.6cqh, 23px);
  font-weight: 900;
  letter-spacing: .03em;
  color: #42300f;
  line-height: 1.2;
}
.level-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  gap: 1em;
}
.level-stars {
  display: flex;
  gap: .12em;
  font-size: clamp(13px, 2.4cqh, 22px);
  letter-spacing: .02em;
  color: #dcc796;
}
.level-stars .on { color: #ffb300; text-shadow: 0 .08em 0 #c67a00, 0 0 .5em rgba(255, 196, 45, .55); }
.level-best {
  font-size: clamp(8px, 1.5cqh, 12px);
  font-weight: 700;
  color: #a58a58;
  white-space: nowrap;
}
.level-lock {
  position: absolute;
  right: 1.8cqw;
  top: 1.8cqh;
  font-size: clamp(15px, 2.8cqh, 26px);
  filter: drop-shadow(0 2px 2px rgba(0, 0, 0, .15));
  opacity: .9;
}
.level-thumb {
  position: absolute;
  right: -2%;
  bottom: -8%;
  width: 44%;
  aspect-ratio: 1.4;
  border-radius: 50%;
  background: radial-gradient(circle at 40% 40%, rgba(105, 190, 84, .28), rgba(105, 190, 84, 0));
  pointer-events: none;
}

.levels-foot {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 2.6cqh;
  padding-top: 1.8cqh;
  border-top: 2px dashed rgba(160, 124, 62, .25);
  font-size: clamp(10px, 1.9cqh, 16px);
  font-weight: 800;
  color: #8a6d39;
}
.text-btn {
  border: 0;
  background: none;
  font-family: inherit;
  font-size: inherit;
  font-weight: 800;
  color: #907334;
  cursor: pointer;
  padding: .4em .8em;
  border-radius: 999px;
  transition: background .15s ease;
}
.text-btn:hover { background: rgba(166, 124, 56, .12); }

/* ============================ HUD ============================ */
#hud {
  position: absolute;
  inset: 0;
  z-index: 6;
  pointer-events: none;
  padding: 2.2cqh 2.2cqw;
  font-size: clamp(10px, 1.9cqh, 17px);
}
#hud button { pointer-events: auto; }

.hud-left {
  position: absolute;
  top: 2.4cqh;
  left: 2.2cqw;
  display: flex;
  flex-direction: column;
  gap: 1cqh;
  align-items: flex-start;
}
.level-pill,
.score-wrap,
.hud-chip {
  background: var(--panel-dark);
  border: 1px solid var(--panel-line);
  box-shadow: 0 .5cqh 1.6cqh rgba(0, 0, 0, .25), inset 0 1px 0 rgba(255, 255, 255, .12);
  backdrop-filter: blur(7px);
  color: #f2fff0;
}
.level-pill {
  display: flex;
  align-items: center;
  gap: .8em;
  padding: .65em 1.2em;
  border-radius: 999px;
  font-weight: 800;
  letter-spacing: .05em;
  font-size: clamp(9px, 1.8cqh, 15px);
}
#hudLevel { color: #ffd76a; }
.pill-dot { width: .35em; height: .35em; border-radius: 50%; background: rgba(255, 255, 255, .45); }

.score-wrap {
  display: flex;
  align-items: baseline;
  gap: .6em;
  padding: .38em 1.1em .34em;
  border-radius: 1.2em;
}
.score-label {
  font-size: .72em;
  font-weight: 800;
  letter-spacing: .18em;
  color: rgba(235, 255, 238, .66);
}
#hudScore {
  font-size: 1.85em;
  font-weight: 900;
  font-variant-numeric: tabular-nums;
  color: #fff7d6;
  text-shadow: 0 .06em 0 rgba(0, 0, 0, .35);
  min-width: 2.2em;
  text-align: right;
}

.hud-center {
  position: absolute;
  top: 2.4cqh;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  align-items: stretch;
  gap: 1.1cqw;
}
.hud-chip {
  display: flex;
  align-items: center;
  gap: .7em;
  padding: .55em 1em;
  border-radius: 1.4em;
}
.hud-caption {
  font-size: .7em;
  font-weight: 800;
  letter-spacing: .12em;
  color: rgba(235, 255, 238, .6);
}
#birdQueue {
  height: clamp(20px, 3.8cqh, 36px);
  width: auto;
  display: block;
}
.pig-chip {
  font-weight: 900;
  font-size: 1.4em;
  color: #eaffd8;
}
.pig-chip .hud-caption { font-size: .55em; }
.mini-pig {
  position: relative;
  width: 1.15em;
  height: 1.05em;
  border-radius: 50%;
  background: linear-gradient(180deg, #9ee36b, #54ad35);
  box-shadow: inset 0 -.12em 0 rgba(0, 0, 0, .18);
}
.mini-pig::before {
  content: "";
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -20%);
  width: 46%;
  height: 34%;
  border-radius: 50%;
  background: #8ad45a;
  box-shadow: inset 0 0 0 1px rgba(45, 100, 24, .35);
}
.mini-pig::after {
  content: "";
  position: absolute;
  width: 10%;
  height: 10%;
  border-radius: 50%;
  background: #3c6f23;
  left: 38%;
  top: 46%;
  box-shadow: .38em 0 0 #3c6f23;
}

.hud-right {
  position: absolute;
  top: 2.4cqh;
  right: 2.2cqw;
  display: flex;
  gap: .8cqw;
}
.icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: clamp(32px, 5.2cqh, 52px);
  aspect-ratio: 1;
  border-radius: 50%;
  border: 1px solid var(--panel-line);
  background: var(--panel-dark);
  color: #f4fff2;
  font-size: clamp(14px, 2.6cqh, 24px);
  cursor: pointer;
  backdrop-filter: blur(7px);
  box-shadow: 0 .45cqh 1.2cqh rgba(0, 0, 0, .28), inset 0 1px 0 rgba(255, 255, 255, .14);
  transition: transform .13s ease, background .13s ease;
}
.icon-btn:hover { transform: translateY(-2px) scale(1.04); background: rgba(15, 55, 56, .75); }
.icon-btn:active { transform: translateY(1px) scale(.97); }
.icon-btn svg { display: block; }
.snd-off, .muted .snd-wave { display: none; }
.muted .snd-off { display: block; }
.muted .snd-on { opacity: .45; }
.muted .snd-wave { display: none; }

/* ============================ 提示 & Toast ============================ */
.hint-bar {
  position: absolute;
  z-index: 7;
  left: 50%;
  bottom: 2.8cqh;
  transform: translateX(-50%);
  max-width: 86cqw;
  padding: .85cqh 2cqw;
  border-radius: 999px;
  background: rgba(6, 28, 30, .8);
  border: 1px solid rgba(255, 255, 255, .18);
  box-shadow: 0 .6cqh 2cqh rgba(0, 0, 0, .25);
  color: #f5ffe9;
  font-size: clamp(10px, 1.95cqh, 17px);
  font-weight: 700;
  letter-spacing: .04em;
  text-align: center;
  pointer-events: none;
  transition: opacity .3s ease, transform .3s ease;
  animation: hintIn .4s ease both;
}
.hint-bar b { color: #ffd76a; }
.hint-bar .key {
  display: inline-block;
  padding: 0 .4em;
  margin: 0 .15em;
  border-radius: .35em;
  background: rgba(255, 255, 255, .16);
  border: 1px solid rgba(255, 255, 255, .28);
  font-size: .9em;
  font-weight: 800;
}
@keyframes hintIn {
  from { opacity: 0; transform: translate(-50%, 8px); }
  to { opacity: 1; transform: translate(-50%, 0); }
}

.toast {
  position: absolute;
  z-index: 15;
  top: 16%;
  left: 50%;
  transform: translateX(-50%);
  text-align: center;
  pointer-events: none;
  animation: toastIn .45s cubic-bezier(.2, .9, .3, 1.2) both;
}
.toast .toast-main {
  display: block;
  font-size: clamp(22px, 5.4cqh, 52px);
  font-weight: 900;
  letter-spacing: .08em;
  color: #fff8d8;
  text-shadow: 0 .04em 0 #7f4a00, 0 .12em .2em rgba(0, 0, 0, .5);
}
.toast .toast-sub {
  display: block;
  margin-top: .35em;
  font-size: clamp(10px, 2cqh, 18px);
  font-weight: 700;
  letter-spacing: .2em;
  color: rgba(255, 244, 198, .85);
  text-shadow: 0 2px 8px rgba(0, 0, 0, .5);
}
@keyframes toastIn {
  from { opacity: 0; transform: translate(-50%, -12px) scale(.94); }
  to { opacity: 1; transform: translate(-50%, 0) scale(1); }
}
.toast.out { animation: toastOut .35s ease both; }
@keyframes toastOut {
  to { opacity: 0; transform: translate(-50%, -10px) scale(.97); }
}

/* ============================ 遮罩 & 结果 ============================ */
.overlay {
  position: absolute;
  inset: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 4cqh;
  background: rgba(3, 17, 19, .6);
  backdrop-filter: blur(5px);
  animation: overlayIn .22s ease both;
}
@keyframes overlayIn { from { opacity: 0; } to { opacity: 1; } }

.result-panel { width: min(84cqw, 620px); text-align: center; }
.win-panel h2 { color: #36731f; }
.lose-panel h2 { color: #8a4a12; }

.stars {
  display: flex;
  justify-content: center;
  align-items: flex-end;
  gap: 1.4cqw;
  margin: -1cqh 0 1.4cqh;
  height: clamp(52px, 13cqh, 140px);
}
.star {
  font-size: clamp(42px, 11cqh, 110px);
  line-height: 1;
  color: #e3d2ae;
  text-shadow: 0 .03em 0 #bfa87c, 0 .1em .2em rgba(0, 0, 0, .1);
  transform: scale(.72);
  transition: color .2s ease;
}
.star:nth-child(2) { font-size: clamp(54px, 14cqh, 140px); }
.star.on {
  color: #ffc529;
  text-shadow: 0 .035em 0 #d48a00, 0 .08em 0 #b06b00, 0 0 .5em rgba(255, 193, 40, .55);
  animation: starPop .45s cubic-bezier(.2, 1.4, .4, 1) both;
}
.star:nth-child(2).on { animation-delay: .12s; }
.star:nth-child(3).on { animation-delay: .24s; }
@keyframes starPop {
  0% { transform: scale(.2) rotate(-25deg); opacity: 0; }
  70% { transform: scale(1.18) rotate(6deg); opacity: 1; }
  100% { transform: scale(1) rotate(0); }
}

.score-block {
  margin: 2cqh auto 1cqh;
  padding: 1.4cqh 3cqw;
  border-radius: 1.8cqh;
  background: rgba(255, 255, 255, .62);
  border: 2px dashed rgba(172, 129, 58, .28);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: .3cqh;
  max-width: 28em;
}
.score-block-label {
  font-size: clamp(9px, 1.7cqh, 13px);
  font-weight: 800;
  letter-spacing: .25em;
  color: #a0824a;
}
#winScore {
  font-size: clamp(28px, 6.2cqh, 58px);
  font-weight: 900;
  line-height: 1;
  color: #3f2b0d;
  font-variant-numeric: tabular-nums;
}
.best-line {
  font-size: clamp(9px, 1.7cqh, 13px);
  font-weight: 700;
  color: #9c8354;
}
.result-actions {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 1.2cqh 1.2cqw;
  margin-top: 2.4cqh;
}

.lose-pig {
  width: clamp(64px, 15cqh, 130px);
  height: auto;
  margin-bottom: 1cqh;
  filter: drop-shadow(0 6px 10px rgba(0, 0, 0, .18));
  animation: pigWiggle 2.2s ease-in-out infinite;
}
@keyframes pigWiggle {
  0%, 100% { transform: rotate(-4deg); }
  50% { transform: rotate(4deg); }
}

/* ============================ 暂停 ============================ */
.pause-panel { width: min(80cqw, 460px); text-align: center; }
.pause-icon {
  display: flex;
  justify-content: center;
  gap: .7em;
  margin-bottom: 1cqh;
}
.pause-icon span {
  width: clamp(10px, 2.6cqh, 24px);
  height: clamp(34px, 8cqh, 76px);
  border-radius: .35em;
  background: linear-gradient(180deg, #ffd15c, #f39a12);
  box-shadow: inset 0 2px 0 #fff0b8, 0 .2em 0 #c06c00;
}
.stack-btns {
  display: flex;
  flex-direction: column;
  gap: 1.3cqh;
  margin-top: 2.2cqh;
}
.stack-btns .btn { width: 100%; }

/* ============================ 玩法说明 ============================ */
.howto-panel { width: min(90cqw, 840px); text-align: left; }
.howto-close {
  position: absolute;
  top: 2cqh;
  right: 2cqw;
  z-index: 3;
}
.howto-panel h2 { text-align: left; }
.howto-list {
  display: flex;
  flex-direction: column;
  gap: 1.8cqh;
  margin: 2.2cqh 0;
}
.howto-row {
  display: flex;
  align-items: flex-start;
  gap: 2cqw;
  padding: 1.4cqh 1.6cqw;
  border-radius: 1.6cqh;
  background: rgba(255, 255, 255, .55);
  border: 1px solid rgba(183, 144, 76, .18);
}
.howto-row b {
  display: block;
  font-size: clamp(13px, 2.5cqh, 22px);
  color: #4b3410;
  margin-bottom: .35cqh;
}
.howto-row span {
  display: block;
  font-size: clamp(10px, 1.85cqh, 16px);
  line-height: 1.55;
  color: #77603a;
  font-weight: 600;
}
.howto-ico {
  flex: 0 0 auto;
  width: clamp(34px, 6.4cqh, 58px);
  aspect-ratio: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 1.2cqh;
  background: linear-gradient(180deg, #ffe89b, #ffc94e);
  color: #7a4a00;
  font-size: clamp(18px, 3.6cqh, 32px);
  font-weight: 900;
  box-shadow: inset 0 1px 0 #fff9d8, 0 .3cqh 0 #d59b2a;
}
.howto-ico.pig {
  background: radial-gradient(circle at 38% 32%, #b8ee88, #64b93f 70%);
  position: relative;
}
.howto-ico.pig::before {
  content: "";
  width: 42%;
  height: 30%;
  border-radius: 50%;
  background: #8ad45a;
  box-shadow: inset 0 0 0 1px rgba(45, 100, 24, .3);
}

.bird-legend {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1.2cqw;
  margin-top: 1.4cqh;
}
.legend-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: .5cqh;
  padding: 1.2cqh .5cqw;
  border-radius: 1.4cqh;
  background: rgba(255, 255, 255, .45);
  border: 1px solid rgba(183, 144, 76, .16);
  font-size: clamp(8px, 1.5cqh, 12px);
  color: #8a7040;
}
.legend-item b { font-size: clamp(10px, 1.8cqh, 15px); color: #4b3410; }
.legend-item em { font-style: normal; }
.bird-dot {
  width: clamp(22px, 4.4cqh, 40px);
  aspect-ratio: 1;
  border-radius: 50%;
  position: relative;
  box-shadow: inset -.15em -.2em 0 rgba(0, 0, 0, .18), inset .12em .12em 0 rgba(255, 255, 255, .3), 0 .16em 0 rgba(0, 0, 0, .18);
}
.bird-dot::before, .bird-dot::after {
  content: "";
  position: absolute;
  top: 31%;
  width: 24%;
  aspect-ratio: 1;
  background: #fff;
  border-radius: 50%;
}
.bird-dot::before { left: 23%; }
.bird-dot::after { right: 23%; }
.bird-dot.red { background: linear-gradient(180deg, #ff6b5e, #d32f36); }
.bird-dot.yellow { background: linear-gradient(180deg, #ffe66a, #f5b800); }
.bird-dot.blue { background: linear-gradient(180deg, #7bc8ff, #2188d6); }
.bird-dot.black { background: linear-gradient(180deg, #59606e, #232833); }

.howto-panel > .btn { margin-top: 1.6cqh; width: 100%; }

/* ============================ 响应式细节 ============================ */
@media (max-aspect-ratio: 1/1) {
  .hud-center { display: none; }
  .logo { font-size: clamp(40px, 14cqh, 120px); }
  .bird-legend { grid-template-columns: repeat(2, 1fr); }
  .level-grid { grid-template-columns: repeat(2, 1fr); }
  .panel { width: 94cqw; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
  }
}
