* {
  box-sizing: border-box;
}
html, body {
  margin: 0;
  min-height: 100%;
  background: #21160d;
  font-family: "Microsoft YaHei", "Noto Sans SC", sans-serif;
}
body {
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 100vh;
}
#app {
  position: relative;
  width: min(960px, 100vw);
  aspect-ratio: 960 / 720;
  overflow: hidden;
  box-shadow: 0 12px 40px rgba(0,0,0,.45);
}
canvas {
  display: block;
  width: 100%;
  height: 100%;
  image-rendering: auto;
  position: absolute;
  top: 0;
  left: 0;
  z-index: 1;
}

#restartLevelBtn {
  position: absolute;
  top: 66px;
  right: 12px;
  min-width: 110px;
  padding: 8px 14px;
  border: 0;
  border-radius: 8px;
  background: #e5b84f;
  color: #3d230e;
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 3px 0 #8b5a20;
  z-index: 8;
}
#restartLevelBtn:hover {
  filter: brightness(1.06);
}
#restartLevelBtn:active {
  transform: translateY(2px);
  box-shadow: 0 1px 0 #8b5a20;
}

.bomb-indicator{
  position:absolute;
  left:22px;
  top:72px;
  z-index:5;
  display:flex;
  align-items:center;
  gap:6px;
  color:#ead6aa;
  font-size:16px;
  font-family:"Microsoft YaHei",sans-serif;
}
.bomb-icon{
  font-size:20px;
  color:#ff3838;
}
.bomb-icon.used{
  color:#666666;
}

/* 移动端虚拟按键 */
.mobile-controls{
  position:absolute;
  z-index:6;
  bottom:12px;
  left:0;
  right:0;
  display:flex;
  justify-content:space-evenly;
  gap:12px;
  padding:0 16px;
}
.mobile-controls button{
  min-width:130px;
  padding:16px 10px;
  font-size:17px;
  margin:0;
  touch-action:manipulation;
  user-select:none;
}
/* PC大屏幕隐藏虚拟按键 */
@media (min-width:721px){
  .mobile-controls{
    display:none !important;
  }
}
@media (max-width:720px){
  .mobile-controls.hidden{
    display:none;
  }
  .mobile-controls:not(.hidden){
    display:flex;
  }
}

/* 竖屏旋转提示 */
.rotate-tip{
  position:fixed;
  inset:0;
  background:rgba(0,0,0,0.85);
  z-index:99;
  display:flex;
  align-items:center;
  justify-content:center;
}
.rotate-tip.hidden{
  display:none !important;
}
.rotate-inner{
  text-align:center;
  color:#fff;
}
.rotate-icon{
  font-size:60px;
  margin-bottom:16px;
  animation:rotateAnim 2s ease-in-out infinite;
}
@keyframes rotateAnim{
  0%{transform:rotate(0deg);}
  50%{transform:rotate(-90deg);}
  100%{transform:rotate(0deg);}
}

.screen {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(22, 13, 6, .66);
  z-index: 10;
}
.hidden {
  display: none !important;
}
.panel {
  min-width: 330px;
  padding: 34px 42px;
  text-align: center;
  color: #fff7df;
  background: rgba(61, 35, 14, .96);
  border: 3px solid #d3a54f;
  border-radius: 14px;
  box-shadow: 0 8px 30px rgba(0,0,0,.35);
}
h1 {
  margin: 0;
  font-size: 44px;
  letter-spacing: 3px;
  color: #f3ca61;
  text-shadow: 2px 3px 0 #6b3b13;
}
.subtitle {
  margin: 6px 0 28px;
  font-size: 22px;
}
h2 {
  margin: 0 0 18px;
  color: #f3ca61;
  font-size: 32px;
}
.mission-line {
  margin: 10px 0;
  font-size: 20px;
}
.controls {
  display: flex;
  justify-content: center;
  gap: 24px;
  margin: 24px 0;
  font-size: 16px;
}
.controls b {
  display: inline-block;
  padding: 4px 9px;
  margin-right: 4px;
  border-radius: 5px;
  background: #e2b65b;
  color: #3d230e;
}
button {
  min-width: 150px;
  margin: 7px;
  padding: 11px 24px;
  border: 0;
  border-radius: 8px;
  background: #e5b84f;
  color: #3d230e;
  font-size: 18px;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 3px 0 #8b5a20;
}
button:hover {
  filter: brightness(1.06);
}
button:active {
  transform: translateY(2px);
  box-shadow: 0 1px 0 #8b5a20;
}
button.secondary {
  background: #c9c0ae;
}
.hint {
  margin: 22px 0 0;
  opacity: .78;
  font-size: 13px;
}
.result-score {
  font-size: 22px;
}