/* 植物大战僵尸 · 肉鸽版 */
html {
  height: 100%;
  overflow: hidden;
  background: #111;
}
body {
  position: relative;
  width: 1000px;
  height: 700px;
  overflow: hidden;
  transform-origin: 0 0;
  background: #000;
  font-family: "PingFang SC", "Microsoft YaHei", sans-serif;
  color: #fff;
  user-select: none;
}
#canvas {
  display: block;
}
.hidden {
  display: none !important;
}
button {
  font: inherit;
  cursor: pointer;
  border: 2px solid #3d1f06;
  border-radius: 8px;
  background: linear-gradient(#a8662d, #7a4216);
  color: #ffe9b8;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .25), 0 2px 0 #2b1504;
}
button:hover:not(:disabled) {
  filter: brightness(1.15);
}
button:disabled {
  opacity: .45;
  cursor: default;
}

/* —— HUD —— */
#hud {
  position: absolute;
  left: 112px;
  top: 4px;
  right: 8px;
  display: flex;
  align-items: center;
  gap: 8px;
  pointer-events: none;
}
#hud > * {
  pointer-events: auto;
}
.sun-box {
  display: flex;
  align-items: center;
  height: 42px;
  padding: 0 14px 0 2px;
  border: 2px solid #3d1f06;
  border-radius: 21px;
  background: #f2e6b3;
}
.sun-box.bump span {
  animation: sun-bump .25s ease-out;
}
.sun-box.deny {
  animation: sun-deny .35s;
}
@keyframes sun-bump {
  50% { transform: scale(1.3); color: #c77700; }
}
@keyframes sun-deny {
  0%, 100% { transform: translateX(0); }
  20%, 60% { transform: translateX(-5px); background: #ff9b8a; }
  40%, 80% { transform: translateX(5px); background: #ff9b8a; }
}
.sun-box span {
  display: inline-block;
}
.sun-box img {
  width: 44px;
  height: 44px;
  margin: -4px 0;
}
.sun-box span {
  min-width: 52px;
  color: #3a2400;
  font-size: 24px;
  font-weight: bold;
}
#shovelBtn, #speedBtn, #pauseBtn, #muteBtn {
  width: 44px;
  height: 42px;
  padding: 0;
  font-size: 20px;
}
#speedBtn {
  font-size: 16px;
  font-weight: bold;
}
#shovelBtn.active {
  background: linear-gradient(#ffe066, #e0a800);
  color: #3a2400;
}
.stage-box {
  margin-left: auto;
  width: 290px;
  padding: 5px 10px 7px;
  border: 2px solid #3d1f06;
  border-radius: 8px;
  background: rgba(40, 22, 6, .78);
}
.stage-top {
  display: flex;
  justify-content: space-between;
  margin-bottom: 5px;
  font-size: 13px;
  line-height: 16px;
}
.chip {
  color: #ffd66b;
  cursor: help;
}
.progress {
  position: relative;
  height: 9px;
  border-radius: 5px;
  background: #3a3a3a;
}
#progressFill {
  width: 0;
  height: 100%;
  border-radius: 5px;
  background: linear-gradient(90deg, #7bd34f, #c3f36d);
  transition: width .3s;
}
.progress .flag {
  position: absolute;
  right: -6px;
  top: -9px;
  font-size: 15px;
}

/* —— 强化图标 —— */
#relics {
  position: absolute;
  left: 112px;
  top: 50px;
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  max-width: 330px;
}
.relic {
  position: relative;
  width: 30px;
  height: 30px;
  border: 2px solid;
  border-radius: 7px;
  background: rgba(20, 12, 4, .8);
  font-size: 17px;
  line-height: 26px;
  text-align: center;
  cursor: help;
}
.relic i {
  position: absolute;
  right: -5px;
  bottom: -5px;
  padding: 0 3px;
  border-radius: 6px;
  background: #000;
  font-size: 10px;
  font-style: normal;
  line-height: 14px;
}
.r-common { border-color: #9fd18b; }
.r-rare { border-color: #6fb6ff; }
.r-legendary { border-color: #ffb640; }

/* —— 提示框 —— */
.tip {
  position: absolute;
  z-index: 20;
  padding: 8px 10px;
  border: 2px solid #3d1f06;
  border-radius: 8px;
  background: #fff8dc;
  color: #3a2400;
  font-size: 13px;
  line-height: 18px;
  pointer-events: none;
}
#cardTip {
  left: 108px;
  width: 200px;
}
#cardTip b {
  display: block;
  font-size: 15px;
}
#cardTip span {
  color: #7a5a2a;
}
#cardTip p {
  margin-top: 3px;
}
#relicTip {
  left: 112px;
  bottom: 42px;
  max-width: 330px;
}

/* —— 横幅 —— */
#banner {
  position: absolute;
  left: 50%;
  top: 42%;
  z-index: 15;
  transform: translate(-50%, -50%);
  text-align: center;
  opacity: 0;
  pointer-events: none;
}
#banner div {
  color: #ff4d2e;
  font-size: 40px;
  font-weight: 900;
  white-space: nowrap;
  -webkit-text-stroke: 1.5px #3a0f00;
  text-shadow: 0 3px 0 #3a0f00;
}
#banner small {
  display: block;
  margin-top: 8px;
  color: #fff;
  font-size: 18px;
  text-shadow: 0 2px 4px #000;
}
#banner.show {
  animation: banner-in .35s ease-out forwards;
}
@keyframes banner-in {
  from { opacity: 0; transform: translate(-50%, -50%) scale(1.6); }
  to { opacity: 1; transform: translate(-50%, -50%) scale(1); }
}

/* —— 全屏面板 —— */
.overlay {
  position: absolute;
  inset: 0;
  z-index: 10;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, .72);
  text-align: center;
}
.overlay h1 {
  color: #b4f05a;
  font-size: 56px;
  font-weight: 900;
  line-height: 1.1;
  -webkit-text-stroke: 2px #1f3d00;
  text-shadow: 0 4px 0 #1f3d00;
}
.overlay h1 small {
  display: block;
  margin-top: 6px;
  color: #ffb640;
  font-size: 30px;
  -webkit-text-stroke: 1.5px #4a2000;
  text-shadow: 0 3px 0 #4a2000;
}
.overlay h2 {
  margin-bottom: 22px;
  color: #ffe066;
  font-size: 30px;
  text-shadow: 0 3px 0 #4a2000;
}
.overlay > button, .btns button {
  padding: 10px 34px;
  font-size: 22px;
  font-weight: bold;
}
.btns {
  display: flex;
  gap: 16px;
  margin-top: 20px;
}
.btns .ghost {
  background: #444;
  border-color: #222;
  color: #ddd;
}
.load-bar {
  width: 320px;
  height: 14px;
  margin-top: 24px;
  border: 2px solid #3d1f06;
  border-radius: 8px;
  background: #222;
  overflow: hidden;
}
#loadFill {
  width: 0;
  height: 100%;
  background: #7bd34f;
}
#title .rules {
  margin: 26px 0 28px;
  padding: 16px 26px;
  border-radius: 12px;
  background: rgba(0, 0, 0, .45);
  font-size: 17px;
  line-height: 32px;
  text-align: left;
}
#title .rules b {
  color: #ffe066;
}
#title .credit {
  position: absolute;
  bottom: 10px;
  color: #999;
  font-size: 12px;
}

/* —— 三选一 —— */
.choices {
  display: flex;
  gap: 22px;
}
.choice {
  opacity: 0;
  animation: card-in .45s cubic-bezier(.2, 1.4, .4, 1) forwards;
  width: 210px;
  height: 270px;
  padding: 16px 14px;
  border: 3px solid;
  border-radius: 14px;
  background: linear-gradient(#3b2a14, #1e140a);
  cursor: pointer;
  transition: translate .15s, box-shadow .15s;
}
/* 入场动画占用了 transform，悬浮用独立的 translate 属性 */
.choice:hover {
  translate: 0 -8px;
  box-shadow: 0 10px 24px rgba(0, 0, 0, .6);
}
.choice.r-legendary {
  background: linear-gradient(#5a3a08, #2a1a04);
  animation: card-in .45s cubic-bezier(.2, 1.4, .4, 1) forwards, legend-glow 1.6s ease-in-out .45s infinite;
}
.choice.r-rare {
  box-shadow: 0 0 10px rgba(111, 182, 255, .35);
}
@keyframes card-in {
  from { opacity: 0; transform: rotateY(90deg) scale(.8); }
  to { opacity: 1; transform: rotateY(0) scale(1); }
}
@keyframes legend-glow {
  50% { box-shadow: 0 0 34px rgba(255, 182, 64, .85); }
}
.choices {
  perspective: 900px;
}
.choice .rarity {
  font-size: 13px;
  font-weight: bold;
  letter-spacing: 2px;
}
.choice .icon {
  margin: 14px 0 10px;
  font-size: 54px;
  line-height: 64px;
}
.choice .name {
  margin-bottom: 10px;
  color: #ffe9b8;
  font-size: 21px;
  font-weight: bold;
}
.choice .name em {
  color: #9fd18b;
  font-size: 14px;
  font-style: normal;
}
.choice .desc {
  color: #ddd;
  font-size: 15px;
  line-height: 22px;
}
.draft-foot {
  display: flex;
  align-items: center;
  gap: 20px;
  margin-top: 24px;
  color: #aaa;
  font-size: 14px;
}
.draft-foot button {
  padding: 6px 16px;
  font-size: 15px;
}

/* —— 暂停 —— */
#pause h3 {
  margin-bottom: 10px;
  color: #ccc;
  font-size: 16px;
}
#pause ul {
  width: 560px;
  max-height: 300px;
  overflow: auto;
  text-align: left;
}
#pause li {
  display: flex;
  align-items: baseline;
  gap: 8px;
  padding: 5px 10px;
  border-bottom: 1px solid rgba(255, 255, 255, .1);
  color: #ccc;
  font-size: 14px;
  line-height: 20px;
}
#pause li b {
  flex: none;
}
#pause .keys {
  margin-top: 16px;
  color: #999;
  font-size: 13px;
}

/* —— 结算 —— */
#end img {
  width: 300px;
}
#end p {
  margin: 10px 0 4px;
  font-size: 20px;
}
#end .win {
  font-size: 50px;
}
.stats {
  display: flex;
  gap: 28px;
  margin-top: 16px;
  color: #bbb;
  font-size: 14px;
}
.stats b {
  display: block;
  color: #ffe066;
  font-size: 30px;
}

#end .seed {
  margin-top: 12px;
  color: #777;
  font-size: 12px;
}
