* { box-sizing: border-box; }
html, body {
  margin: 0; padding: 0; height: 100%;
  background: #07060f; color: #ece8f5;
  font-family: -apple-system, "Hiragino Kaku Gothic ProN", "Yu Gothic", system-ui, sans-serif;
  -webkit-text-size-adjust: 100%; overscroll-behavior: none; user-select: none;
}
#app { max-width: 480px; margin: 0 auto; min-height: 100%; display: flex; flex-direction: column; }

.mutebtn {
  position: fixed; top: 8px; right: 8px; z-index: 10; width: 40px; height: 40px; font-size: 18px;
  background: rgba(20,18,40,0.8); border: 1px solid #322a55; border-radius: 10px; color: #ece8f5; cursor: pointer;
}

.screen {
  flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 16px; text-align: center; padding: 24px; min-height: 100%;
}
.hidden { display: none !important; }
.title {
  font-size: clamp(44px, 15vw, 76px); margin: 0; letter-spacing: 0.12em;
  color: #ffe066; text-shadow: 0 0 24px rgba(255,224,102,0.4), 2px 3px 0 #b81e4a;
}
.subtitle { color: #b39fd6; letter-spacing: 0.3em; margin: -6px 0 8px; }
.story { line-height: 1.9; font-size: 15px; color: #d8d2ea; max-width: 340px; }
.hint { color: #7a7196; font-size: 12px; margin-top: 4px; }
h2 { font-weight: 700; margin: 6px 0; font-size: 26px; }
.score { font-size: 22px; color: #ffe066; }
.hiscore { font-size: 15px; color: #c9a227; letter-spacing: 0.05em; }

.loadout { display: flex; flex-direction: column; gap: 6px; align-items: center; margin: 4px 0; }
.lo-label { color: #b39fd6; font-size: 12px; letter-spacing: 0.12em; margin-top: 4px; }
.charsel, .shotsel { display: flex; gap: 8px; justify-content: center; flex-wrap: wrap; }
.charopt {
  width: 58px; height: 58px; padding: 2px; border-radius: 12px; cursor: pointer;
  background: rgba(20,18,40,0.6); border: 2px solid #322a55; display: flex; align-items: center; justify-content: center;
}
.charopt img { max-width: 100%; max-height: 100%; image-rendering: auto; }
.charopt.sel { border-color: #ffe066; box-shadow: 0 0 12px rgba(255,224,102,0.5); background: rgba(60,40,90,0.6); }
.shotopt {
  min-width: 86px; padding: 8px 10px; border-radius: 12px; cursor: pointer; color: #ece8f5;
  background: rgba(20,18,40,0.6); border: 2px solid #322a55; display: flex; flex-direction: column; gap: 2px; line-height: 1.2;
}
.shotopt b { font-size: 15px; color: #ffe066; }
.shotopt span { font-size: 10px; color: #b39fd6; }
.shotopt.sel { border-color: #ffe066; box-shadow: 0 0 12px rgba(255,224,102,0.45); background: rgba(60,40,90,0.6); }

.repick {
  position: fixed; left: 0; right: 0; bottom: 30%; z-index: 14;
  display: flex; flex-direction: column; align-items: center; gap: 6px; pointer-events: none;
}
.repick .shotsel { pointer-events: auto; }
.repick .lo-label { background: rgba(8,6,20,0.6); padding: 2px 10px; border-radius: 8px; }

.levelup {
  position: fixed; inset: 0; z-index: 26; display: flex; flex-direction: column;
  align-items: center; justify-content: center; gap: 14px; background: rgba(6,5,14,0.7); padding: 20px;
}
.lvl-title { color: #ffe066; font-size: 20px; font-weight: 800; letter-spacing: 0.08em; text-shadow: 0 0 16px rgba(255,224,102,0.5); }
.lvlsel { display: flex; flex-direction: column; gap: 12px; width: 100%; max-width: 320px; }
.lvlopt {
  padding: 14px 16px; border-radius: 14px; cursor: pointer; color: #ece8f5; text-align: left;
  background: linear-gradient(#241c44, #181230); border: 2px solid #4a3f7a;
  display: flex; flex-direction: column; gap: 3px;
}
.lvlopt:active { transform: scale(0.98); }
.lvlopt b { font-size: 18px; color: #ffe066; }
.lvlopt span { font-size: 12px; color: #b39fd6; }
.lvlopt em { font-size: 12px; color: #5effc8; font-style: normal; align-self: flex-end; margin-top: -16px; }
.lvlopt.maxed { opacity: 0.55; border-color: #322a55; }
.lvlopt.maxed em { color: #9c8; }

.howto-btn {
  margin-top: 2px; padding: 9px 26px; font-size: 15px; font-weight: 700; color: #ece8f5; cursor: pointer;
  background: rgba(20,18,40,0.7); border: 1px solid #4a3f7a; border-radius: 12px; letter-spacing: 0.08em;
}
.tut {
  position: fixed; inset: 0; z-index: 30; display: flex; align-items: center; justify-content: center;
  background: rgba(6,5,14,0.82); padding: 20px;
}
.tut-card {
  width: 100%; max-width: 360px; background: linear-gradient(#1a1535, #120e28);
  border: 1px solid #3a3168; border-radius: 18px; padding: 22px 22px 16px; box-shadow: 0 10px 40px rgba(0,0,0,0.5);
}
.tut-step { color: #b39fd6; font-size: 12px; letter-spacing: 0.3em; text-align: center; }
#tut-page { min-height: 150px; display: flex; flex-direction: column; justify-content: center; }
#tut-page h3 { color: #ffe066; font-size: 21px; margin: 10px 0 10px; text-align: center; }
#tut-page p { color: #e2ddf2; font-size: 15px; line-height: 1.85; margin: 0; }
.tut-nav { display: flex; align-items: center; justify-content: space-between; margin-top: 14px; }
.tut-dots { color: #6a5f96; font-size: 11px; letter-spacing: 0.12em; }
.tut-skip {
  padding: 8px 16px; font-size: 13px; color: #b39fd6; cursor: pointer;
  background: transparent; border: 1px solid #3a3168; border-radius: 10px;
}
.tut-next {
  padding: 9px 24px; font-size: 16px; font-weight: 800; color: #1a0a14; cursor: pointer;
  background: linear-gradient(#ffe066, #f0a800); border: none; border-radius: 11px; box-shadow: 0 3px 0 #9c6b00;
}
.tut-next:active { transform: translateY(2px); box-shadow: 0 1px 0 #9c6b00; }

.big-btn {
  margin-top: 6px; padding: 15px 40px; font-size: 20px; font-weight: 800; color: #1a0a14;
  background: linear-gradient(#ffe066, #f0a800); border: none; border-radius: 14px; cursor: pointer;
  box-shadow: 0 4px 0 #9c6b00; letter-spacing: 0.1em;
}
.big-btn:active { transform: translateY(2px); box-shadow: 0 2px 0 #9c6b00; }

#game { flex: 1; display: flex; align-items: center; justify-content: center; position: relative; }
.focusbtn {
  position: fixed; right: 14px; bottom: 22px; z-index: 12;
  width: 66px; height: 66px; border-radius: 50%;
  background: rgba(120,74,168,0.32); border: 2px solid rgba(255,158,200,0.7);
  color: #ffe0f0; font-size: 15px; font-weight: 700; line-height: 1.15;
  touch-action: none; user-select: none; -webkit-user-select: none;
}
.focusbtn:active { background: rgba(255,158,200,0.45); }
.bombbtn {
  position: fixed; left: 14px; bottom: 22px; z-index: 12;
  width: 60px; height: 60px; border-radius: 50%;
  background: rgba(160,120,210,0.34); border: 2px solid rgba(255,224,120,0.75);
  color: #fff4d8; font-size: 14px; font-weight: 700; line-height: 1.15;
  touch-action: none; user-select: none; -webkit-user-select: none;
}
.bombbtn:active { background: rgba(255,224,120,0.5); }
.weaponbtn {
  position: fixed; right: 22px; bottom: 96px; z-index: 12;
  width: 50px; height: 50px; border-radius: 50%;
  background: rgba(90,150,210,0.3); border: 2px solid rgba(160,200,255,0.7);
  color: #d4e8ff; font-size: 18px; font-weight: 700;
  touch-action: none; user-select: none; -webkit-user-select: none;
}
.weaponbtn:active { background: rgba(160,200,255,0.45); }
.specialbtn {
  position: fixed; left: 18px; bottom: 96px; z-index: 12;
  width: 54px; height: 54px; border-radius: 50%;
  background: rgba(200,139,255,0.32); border: 2px solid rgba(255,224,102,0.85);
  color: #fff4d8; font-size: 15px; font-weight: 800; line-height: 1.15;
  touch-action: none; user-select: none; -webkit-user-select: none;
}
.specialbtn:active { background: rgba(255,224,102,0.5); }
.specialbtn { transition: box-shadow .15s, background .15s, transform .1s; opacity: 0.72; }
.specialbtn.ready {
  opacity: 1; color: #2a1500;
  background: radial-gradient(circle, #ffe066 0%, #ff9a3c 100%);
  border-color: #fff2c0; animation: superpulse 0.7s ease-in-out infinite;
}
@keyframes superpulse {
  0%, 100% { box-shadow: 0 0 10px 3px rgba(255,224,102,0.7); transform: scale(1); }
  50% { box-shadow: 0 0 22px 8px rgba(255,224,102,1); transform: scale(1.07); }
}
#field {
  display: block; height: 100vh; max-height: 100%; width: auto; max-width: 100%;
  aspect-ratio: 200 / 340; background: #0c0a1c; touch-action: none;
  image-rendering: auto; border-left: 1px solid #221c3e; border-right: 1px solid #221c3e;
}
