* { margin: 0; padding: 0; box-sizing: border-box; }
html, body { width: 100%; height: 100%; overflow: hidden; }
body {
  background: #10151d;
  font-family: "Microsoft YaHei", "PingFang SC", system-ui, sans-serif;
  user-select: none; -webkit-user-select: none;
}
#game { display: block; width: 100vw; height: 100vh; touch-action: none; cursor: crosshair; }

#hud {
  position: fixed; top: 12px; left: 50%; transform: translateX(-50%);
  display: none; align-items: center; gap: 12px;
  background: rgba(18, 26, 38, .85); color: #fff;
  padding: 8px 16px; border-radius: 999px; z-index: 5;
  box-shadow: 0 4px 14px rgba(0,0,0,.4); white-space: nowrap;
}
body.playing #hud { display: flex; }
#levelName { opacity: .85; font-size: 14px; }
#scoreVal { font-weight: bold; font-size: 20px; color: #ffd54f; min-width: 64px; text-align: right; font-variant-numeric: tabular-nums; }
#birdIcons { display: inline-flex; gap: 5px; align-items: center; }
.hbtn {
  border: 0; cursor: pointer; color: #fff; font-family: inherit;
  background: #ff8f2b; padding: 6px 14px; border-radius: 999px; font-size: 13px;
  transition: transform .1s, filter .15s;
}
.hbtn:hover { filter: brightness(1.12); transform: translateY(-1px); }

.screen {
  position: fixed; inset: 0; z-index: 10;
  display: flex; align-items: center; justify-content: center;
  background: rgba(8, 12, 18, .55); backdrop-filter: blur(3px);
}
.panel {
  background: linear-gradient(#fdf7ec, #f6e9d0);
  color: #4a2f1a; padding: 30px 44px; border-radius: 22px;
  text-align: center; max-width: min(92vw, 560px);
  box-shadow: 0 20px 60px rgba(0,0,0,.5), inset 0 0 0 4px #fff;
}
h1 { font-size: 46px; color: #d63b2f; letter-spacing: 4px; text-shadow: 2px 3px 0 #ffd54f; }
h2 { font-size: 32px; color: #d63b2f; }
.sub { opacity: .65; margin-top: 4px; font-size: 14px; letter-spacing: 2px; }
.dim { opacity: .6; font-size: 14px; margin-top: 6px; }

#levelGrid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; margin: 20px 0 6px; }
.lvbtn {
  border: 0; cursor: pointer; font-family: inherit; font-size: 18px; color: #fff;
  background: linear-gradient(#83c95a, #5da53b);
  padding: 10px 6px; border-radius: 14px; line-height: 1.5;
  box-shadow: 0 4px 0 #467c2c; transition: transform .08s;
}
.lvbtn small { font-size: 13px; letter-spacing: 2px; color: #eaffdc; }
.lvbtn:not(:disabled):hover { transform: translateY(-2px); }
.lvbtn:not(:disabled):active { transform: translateY(2px); box-shadow: 0 1px 0 #467c2c; }
.lvbtn:disabled { background: #b9b2a4; box-shadow: 0 4px 0 #948d80; cursor: not-allowed; }

.help { text-align: left; font-size: 14px; line-height: 1.9; margin-top: 10px; background: rgba(255,255,255,.55); border-radius: 12px; padding: 10px 16px; }
.help .tip { opacity: .7; margin-top: 6px; font-size: 13px; }
.dot { display: inline-block; width: 14px; height: 14px; border-radius: 50%; margin-right: 8px; vertical-align: -2px; box-shadow: inset -2px -2px 3px rgba(0,0,0,.25); }
.d-red { background: #e23b3e; } .d-yellow { background: #ffc93c; }
.d-blue { background: #58b7e8; } .d-black { background: #3a3a44; }

.stars { font-size: 52px; letter-spacing: 10px; color: #f6b73c; margin: 10px 0 2px; text-shadow: 0 3px 0 rgba(0,0,0,.15); }
.big { font-size: 28px; font-weight: bold; }
.row { display: flex; gap: 10px; justify-content: center; margin-top: 18px; flex-wrap: wrap; }
.mbtn {
  border: 0; cursor: pointer; font-family: inherit; font-size: 16px; color: #5b3a17;
  background: #ffe1a6; padding: 10px 22px; border-radius: 999px;
  box-shadow: 0 3px 0 #d8b56e; transition: transform .08s;
}
.mbtn:hover { transform: translateY(-2px); }
.mbtn.primary { background: linear-gradient(#ff9d3b, #f07f1a); color: #fff; box-shadow: 0 3px 0 #b85e0d; }

.hidden { display: none !important; }
@media (max-width: 520px) {
  .panel { padding: 20px; } h1 { font-size: 34px; }
  #levelGrid { grid-template-columns: 1fr; }
}
