
body {
  margin: 0;
  background: #0a0a0f;
  color: white;
  font-family: "Microsoft YaHei", Arial, sans-serif;
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 100vh;
}
#menu {
  text-align: center;
}
.changelogButton{
  position:absolute;
  top:16px;
  right:16px;
  z-index:2;
  min-width:0;
  padding:8px 13px;
  border-radius:10px;
  color:#eafaff;
  border:1px solid rgba(126,249,255,.36);
  background:rgba(5,20,32,.76);
  box-shadow:0 8px 22px rgba(0,0,0,.28);
  font-size:14px;
  backdrop-filter:blur(7px);
}
.changelogButton:hover{background:rgba(11,49,70,.88);}

#game {
  text-align: center;
  width: min(1100px, 94vw);
  min-height: min(680px, 92vh);
  border-radius: 24px;
  overflow: hidden;
  position: relative;
  box-shadow: 0 20px 50px rgba(0,0,0,.45);
  background:
    linear-gradient(rgba(0,0,0,.58), rgba(0,0,0,.72)),
    url("assets/background-game-v1.png") center/cover no-repeat;
  padding: 24px 0 34px;
}
#game::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(180deg, rgba(0,0,0,.16), rgba(0,0,0,.42)),
    radial-gradient(circle at 30% 40%, rgba(255,215,0,.10), transparent 28%);
  pointer-events: none;
}
#game > * {
  position: relative;
  z-index: 1;
}

#menu {
  width: min(1100px, 94vw);
  min-height: min(680px, 92vh);
  border-radius: 24px;
  overflow: hidden;
  position: relative;
  box-shadow: 0 20px 50px rgba(0,0,0,.45);
  background:
    linear-gradient(rgba(0,0,0,.35), rgba(0,0,0,.65)), url("assets/background-menu-v1.png") center/cover no-repeat;
  display: flex;
  align-items: center;
  justify-content: center;
}
#menu::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at 72% 28%, rgba(255,180,70,.16), transparent 28%), linear-gradient(90deg, rgba(0,0,0,.30), rgba(0,0,0,.16) 45%, rgba(0,0,0,.45));
  pointer-events: none;
}
#menuCard {
  position: relative;
  z-index: 1;
  width: min(440px, 78vw);
  padding: 34px 28px 28px;
  border-radius: 22px;
  background: rgba(10, 13, 18, 0.62);
  backdrop-filter: blur(8px);
  box-shadow: 0 12px 30px rgba(0,0,0,.32);
  border: 1px solid rgba(255,255,255,.10);
}
#menu h1 {
  margin: 0 0 10px;
  font-size: clamp(38px, 5vw, 64px);
  line-height: 1.05;
  letter-spacing: 1px;
  text-shadow: 0 4px 12px rgba(0,0,0,.4);
}
#menu .subtitle {
  margin: 0 0 18px;
  font-size: 18px;
  color: #f1d85d;
  font-weight: 600;
}
#menu .desc {
  margin: 0 auto 10px;
  max-width: 28em;
  line-height: 1.65;
  color: rgba(255,255,255,.92);
  font-size: 18px;
}
#menu .challengeInvite{
  margin:14px auto -3px;
  max-width:31em;
  color:#d9f8ff;
  font-size:15px;
  line-height:1.55;
  text-shadow:0 2px 8px rgba(0,0,0,.32);
}
#menu .hint {
  margin-top: 14px;
  font-size: 13px;
  color: rgba(255,255,255,.78);
}
.modeActions{
  display:flex;
  justify-content:center;
  flex-wrap:wrap;
  gap:10px;
  margin-top:18px;
}
.modeActions button{
  min-width:170px;
  padding:12px 22px;
  font-size:20px;
}
.modeActions .challengeButton{
  border-color:rgba(126,249,255,.5);
  background:linear-gradient(180deg,#dffcff 0%,#63e4ff 42%,#1688bd 100%);
}
.challengeRules{
  margin:12px auto 0;
  max-width:34em;
  color:#ccecf7;
  font-size:13px;
  line-height:1.55;
}
button {
  font-size: 28px;
  padding: 14px 52px;
  cursor: pointer;
  border-radius: 14px;
  border: 1px solid rgba(255,255,255,.14);
  background: linear-gradient(180deg, #fff8cf 0%, #f2dc64 40%, #d9b728 100%);
  color: #141414;
  font-weight: 700;
  box-shadow: 0 10px 24px rgba(0,0,0,.25);
}
button:hover {
  transform: translateY(-1px);
}
canvas {
  background: linear-gradient(180deg, #282828 0%, #1f1f1f 100%);
  border: 3px solid #777;
  border-radius: 10px;
  box-shadow: 0 10px 30px rgba(0,0,0,.35);
  max-width: 100%;
  height: auto;
  touch-action: none;
}
.small {
  color: #ccc;
  font-size: 14px;
}
#devPanel{
  margin-top:10px;
  display:none;
  justify-content:center;
  flex-wrap:wrap;
  gap:8px;
}
#devPanel button{
  font-size:18px;
  min-width:48px;
  height:38px;
  padding:0 10px;
  margin:0;
  border-radius:10px;
}
#devPanel .clear-btn{
  min-width:72px;
  font-size:16px;
}
#devPanel .dev-toggle{
  min-width:150px;
  font-size:15px;
  background:#d7d7d7;
}
#devPanel .dev-toggle.active{
  color:#07140b;
  background:#78ee91;
  box-shadow:0 0 0 2px rgba(120,238,145,.24), 0 8px 20px rgba(0,0,0,.24);
}
#devHint{
  color:#f5d67a;
  font-size:13px;
}
#devCodeModal{
  display:none;
  position:fixed;
  inset:0;
  z-index:1200;
  align-items:center;
  justify-content:center;
  padding:16px;
  box-sizing:border-box;
  background:rgba(0,0,0,.78);
}
#challengeSetupModal{
  display:none;
  position:fixed;
  inset:0;
  z-index:1150;
  align-items:center;
  justify-content:center;
  padding:16px;
  box-sizing:border-box;
  background:rgba(0,0,0,.82);
}
#changelogModal{
  display:none;
  position:fixed;
  inset:0;
  z-index:1175;
  align-items:center;
  justify-content:center;
  padding:16px;
  box-sizing:border-box;
  background:rgba(0,0,0,.82);
}
#changelogCard{
  width:min(520px,100%);
  max-height:min(720px,calc(100svh - 32px));
  overflow-y:auto;
  padding:24px;
  box-sizing:border-box;
  border:1px solid rgba(126,249,255,.34);
  border-radius:18px;
  text-align:left;
  color:#fff;
  background:linear-gradient(155deg,#0b1f31 0%,#07111d 68%,#111827 100%);
  box-shadow:0 24px 70px rgba(0,0,0,.62),0 0 28px rgba(40,193,255,.12);
}
#changelogCard h2{margin:0;color:#dffcff;font-size:28px;}
#changelogCard .changelogLead{margin:7px 0 16px;color:#a9c9da;font-size:13px;line-height:1.5;}
.changelogEntry{padding:14px 15px;margin-top:11px;border:1px solid rgba(126,249,255,.17);border-radius:13px;background:rgba(0,0,0,.2);}
.changelogEntry h3{margin:0 0 8px;color:#ffe78d;font-size:17px;}
.changelogEntry ul{margin:0;padding-left:21px;color:#d9edf7;line-height:1.65;font-size:14px;}
.changelogActions{display:flex;justify-content:flex-end;margin-top:17px;}
.changelogActions button{min-height:42px;padding:8px 20px;border-radius:10px;font-size:15px;}
#challengeRescueScene{
  display:none;
  position:fixed;
  inset:0;
  z-index:1185;
  align-items:center;
  justify-content:center;
  padding:18px;
  box-sizing:border-box;
  background:radial-gradient(circle at 64% 45%,rgba(15,71,102,.34),transparent 42%),rgba(0,0,0,.88);
  overflow:hidden;
}
#challengeRescueScene.active{display:flex;animation:rescueSceneIn .28s ease-out both;}
.rescueComic{
  width:min(760px,96vw);
  display:grid;
  grid-template-columns:minmax(210px,42%) minmax(280px,1fr);
  align-items:center;
  gap:22px;
}
.rescuePortrait{
  position:relative;
  overflow:visible;
  transform:translateX(46px) rotate(-1.5deg);
  opacity:0;
  animation:rescuePortraitIn .48s .08s cubic-bezier(.2,.9,.2,1.12) forwards;
}
.rescuePortrait img{display:block;width:100%;height:auto;filter:drop-shadow(12px 18px 16px rgba(0,0,0,.72)) drop-shadow(0 0 2px rgba(92,222,255,.72));}
.rescueDialogue{
  position:relative;
  padding:24px 25px;
  color:#07131b;
  border:4px solid #07131b;
  border-radius:7px;
  background:#f8fcff;
  box-shadow:9px 10px 0 #38bde9;
  transform:translateY(18px);
  opacity:0;
  animation:rescueDialogueIn .34s .48s ease-out forwards;
}
.rescueDialogue::before{
  content:"";
  position:absolute;
  left:-29px;
  top:42%;
  width:34px;
  height:34px;
  border-left:4px solid #07131b;
  border-bottom:4px solid #07131b;
  background:#f8fcff;
  transform:rotate(45deg);
}
.rescueSpeaker{display:block;margin-bottom:8px;color:#087eaa;font-size:13px;font-weight:900;letter-spacing:.12em;}
.rescueLine{margin:0;font-size:clamp(21px,3vw,31px);font-weight:900;line-height:1.42;}
.rescueAuthorization{
  margin:17px 0 0;
  padding-top:13px;
  border-top:2px solid #a9c8d5;
  color:#a32113;
  font-size:clamp(17px,2.3vw,23px);
  font-weight:900;
  line-height:1.4;
  opacity:0;
  transform:translateY(8px);
}
#challengeRescueScene.authorized .rescueAuthorization{animation:rescueAuthIn .22s ease-out forwards;}
@keyframes rescueSceneIn{from{opacity:0}to{opacity:1}}
@keyframes rescuePortraitIn{to{opacity:1;transform:translateX(0) rotate(-1.5deg)}}
@keyframes rescueDialogueIn{to{opacity:1;transform:translateY(0)}}
@keyframes rescueAuthIn{to{opacity:1;transform:translateY(0)}}
#challengeSetupCard{
  width:min(500px,100%);
  max-height:min(760px,calc(100svh - 32px));
  overflow-y:auto;
  padding:25px 24px 22px;
  box-sizing:border-box;
  border:1px solid rgba(98,233,255,.42);
  border-radius:18px;
  color:#fff;
  background:linear-gradient(155deg,#0b1f31 0%,#07111d 68%,#111827 100%);
  box-shadow:0 24px 70px rgba(0,0,0,.62),0 0 28px rgba(40,193,255,.14);
}
#challengeSetupCard h2{margin:0 0 7px;font-size:30px;color:#dffcff;}
#challengeSetupCard .setupLead{margin:0 0 14px;color:#bcd8e8;line-height:1.55;}
.challengeRuleList{
  margin:0 0 17px;
  padding:13px 16px 13px 34px;
  text-align:left;
  border:1px solid rgba(126,249,255,.18);
  border-radius:13px;
  color:#d9edf7;
  background:rgba(0,0,0,.22);
  line-height:1.65;
}
.skillSetupGrid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:10px;text-align:left;}
.skillSetupSlot{
  padding:12px;
  border:1px solid rgba(255,212,94,.28);
  border-radius:12px;
  background:rgba(255,212,94,.06);
}
.skillSetupSlot label{display:block;margin-bottom:7px;color:#ffe78d;font-size:13px;font-weight:800;}
.skillSetupSlot select{
  width:100%;
  min-height:42px;
  padding:8px 9px;
  border:1px solid rgba(126,249,255,.32);
  border-radius:9px;
  color:#fff;
  background:#102436;
  font-size:14px;
}
.skillSetupSlot p{min-height:34px;margin:8px 0 0;color:#9eb7c9;font-size:12px;line-height:1.4;}
.challengeSetupActions{display:flex;justify-content:flex-end;gap:9px;margin-top:18px;}
.challengeSetupActions button{min-height:42px;padding:8px 18px;border-radius:10px;font-size:15px;}
.challengeSetupActions .cancelButton{background:#263442;color:#fff;box-shadow:none;}
#devCodeCard{
  width:min(360px,100%);
  padding:22px;
  box-sizing:border-box;
  border:1px solid rgba(126,249,255,.35);
  border-radius:16px;
  background:#09131f;
  box-shadow:0 20px 60px rgba(0,0,0,.55);
}
#devCodeCard h2{margin:0 0 8px;font-size:24px;}
#devCodeCard p{margin:0 0 12px;color:#b8c7d9;font-size:13px;}
#devCodeInput{
  width:100%;
  min-height:44px;
  padding:9px 11px;
  box-sizing:border-box;
  border:1px solid rgba(126,249,255,.35);
  border-radius:10px;
  background:rgba(0,0,0,.28);
  color:#fff;
  font-size:16px;
  outline:none;
}
#devCodeInput:focus{border-color:#7ef9ff;box-shadow:0 0 0 2px rgba(126,249,255,.12);}
#devCodeError{min-height:18px;margin:7px 0 0!important;color:#ff9e9e!important;}
.devCodeActions{display:flex;justify-content:flex-end;gap:8px;margin-top:10px;}
.devCodeActions button{min-height:40px;padding:8px 16px;border-radius:10px;font-size:15px;}
.devCodeActions .cancelButton{background:#263442;color:#fff;box-shadow:none;}
#gameOverMsg{
  display:none;
  position:fixed;
  left:50%;
  top:50%;
  transform:translate(-50%,-50%);
  z-index:99;
  background:rgba(0,0,0,.75);
  padding:30px 50px;
  border-radius:18px;
  font-size:32px;
  color:white;
  border:2px solid rgba(255,255,255,.3);
}
#victoryMsg{
  display:none;
  position:fixed;
  inset:0;
  z-index:1000;
  background:rgba(0,0,0,.78);
  align-items:center;
  justify-content:center;
  padding:20px;
  box-sizing:border-box;
}
#victoryCard{
  width:min(460px, 86vw);
  background:linear-gradient(180deg, rgba(28,31,35,.98), rgba(10,11,13,.98));
  border:2px solid rgba(255,227,110,.75);
  border-radius:22px;
  padding:34px 30px 28px;
  color:white;
  text-align:center;
  box-shadow:0 20px 60px rgba(0,0,0,.65);
}
#victoryTitle{
  margin:0 0 12px;
  color:#ffe36e;
  font-size:42px;
  line-height:1.15;
}
#victoryText{
  margin:8px 0;
  font-size:22px;
}
#victoryScore{
  margin:22px 0 24px;
  font-size:26px;
  color:#fff4b0;
}
#victoryRestartBtn{
  font-size:21px;
  padding:12px 28px;
  border-radius:12px;
  cursor:pointer;
  transition:opacity .2s ease, transform .2s ease;
}
#victoryRestartBtn:disabled{
  opacity:.48;
  cursor:not-allowed;
  transform:none;
}
.restartConfirmPanel{
  margin-top:12px;
  padding:12px;
  border:1px solid rgba(255,190,94,.45);
  border-radius:12px;
  background:rgba(56,28,4,.72);
}
.restartConfirmPanel[hidden]{display:none;}
.restartConfirmPanel p{margin:0 0 10px;color:#ffe8b0;font-size:14px;line-height:1.5;}
.restartConfirmActions{display:flex;gap:8px;justify-content:center;}
.restartConfirmActions button{min-height:40px;padding:8px 13px;border-radius:9px;font-size:14px;}
.restartConfirmActions .discardButton{background:#6b241f;border-color:#e36b5f;color:#fff3ef;}
#gameHud{
  width: min(420px, 92vw);
  margin: 10px auto 6px;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
}
#game.challenge-mode #gameHud{
  grid-template-columns:1.2fr .72fr 1fr .68fr 1.15fr 1.15fr;
  gap:6px;
}
#game.challenge-mode .skillHud{display:block;}
.hudCompact{padding-left:3px;padding-right:3px;}
.hudCompact strong{font-size:15px;}
.skillHud{
  display:none;
  border-color:rgba(255,212,94,.34);
  background:linear-gradient(145deg,rgba(73,56,10,.82),rgba(19,24,34,.9));
}
.skillHud[role="button"]{cursor:pointer;user-select:none;touch-action:manipulation;}
.skillHud.ready{border-color:#ffe36e;box-shadow:0 0 16px rgba(255,212,94,.25);}
.skillHud.targeting{border-color:#ff7b38;background:linear-gradient(145deg,rgba(117,39,8,.9),rgba(38,17,13,.94));animation:eagleSkillPulse .55s ease-in-out infinite alternate;}
.skillHud.cooldown{opacity:.72;border-color:rgba(160,174,190,.35);background:rgba(20,28,38,.88);}
.skillHud.barrage{border-color:#ff9448;background:linear-gradient(145deg,rgba(112,49,13,.92),rgba(35,22,17,.94));animation:eagleSkillPulse .55s ease-in-out infinite alternate;}
.skillHud > span{display:block;min-height:14px;font-size:10px;font-weight:800;line-height:1.15;overflow-wrap:anywhere;}
.skillHud strong{font-size:12px;line-height:1.2;overflow-wrap:anywhere;}
@keyframes eagleSkillPulse{from{box-shadow:0 0 7px rgba(255,110,40,.32)}to{box-shadow:0 0 22px rgba(255,110,40,.72)}}
#game.eagle-impact canvas{animation:eagleImpactShake .08s linear 7;}
@keyframes eagleImpactShake{0%,100%{transform:translate(0,0)}25%{transform:translate(-5px,2px)}50%{transform:translate(4px,-3px)}75%{transform:translate(-2px,-2px)}}
#challengeAuxiliaryHud{
  display:none;
  width:min(420px,92vw);
  margin:0 auto 7px;
  box-sizing:border-box;
}
#challengeDropHud{
  margin:0 0 4px;
  padding:2px 8px;
  box-sizing:border-box;
  border:1px solid rgba(98,233,255,.48);
  border-radius:7px;
  color:#dffcff;
  background:linear-gradient(90deg,rgba(13,70,102,.92),rgba(4,23,45,.92));
  font-size:10px;
  font-weight:700;
}
#challengeDropHud strong{color:#fff;font-size:11px;}
.auxiliarySlotGrid{display:grid;grid-template-columns:1fr 1fr;gap:6px;}
.auxiliarySlot{
  min-height:42px;
  padding:5px 8px;
  border:1px solid rgba(126,249,255,.32);
  border-radius:9px;
  color:#c9e5eb;
  background:linear-gradient(145deg,rgba(5,39,54,.94),rgba(7,16,29,.95));
  box-shadow:none;
  cursor:pointer;
  touch-action:manipulation;
}
.auxiliarySlot span,.auxiliarySlot strong,.auxiliarySlot small{display:block;line-height:1.15;overflow-wrap:anywhere;}
.auxiliarySlot span{font-size:9px;color:#8ecbd8;}
.auxiliarySlot strong{margin-top:2px;font-size:12px;color:#fff;}
.auxiliarySlot small{margin-top:2px;font-size:9px;color:#afc6ce;}
.auxiliarySlot.ready{border-color:#ffe36e;box-shadow:0 0 12px rgba(255,212,94,.2);}
.auxiliarySlot.targeting{border-color:#ff8a45;background:linear-gradient(145deg,rgba(105,43,12,.95),rgba(38,17,13,.96));animation:eagleSkillPulse .55s ease-in-out infinite alternate;}
.auxiliarySlot.empty{opacity:.68;}
#bugSwarmAlert{
  display:none;
  position:absolute;
  z-index:8;
  top:148px;
  left:50%;
  width:min(360px,82%);
  padding:10px 14px;
  box-sizing:border-box;
  transform:translateX(-50%);
  border:1px solid rgba(255,111,72,.78);
  border-radius:12px;
  background:linear-gradient(90deg,rgba(95,18,15,.94),rgba(34,7,12,.94));
  box-shadow:0 0 26px rgba(255,65,35,.42);
  pointer-events:none;
  flex-direction:column;
  gap:2px;
  animation:bugSwarmAlertPulse .55s ease-in-out infinite alternate;
}
#bugSwarmAlert.active{display:flex;}
#bugSwarmAlert span{color:#ffbc8f;font-size:12px;font-weight:800;letter-spacing:.14em;}
#bugSwarmAlert strong{color:#fff;font-size:18px;line-height:1.25;}
#game.bug-swarm-active canvas{animation:bugSwarmCanvasPulse .45s ease-in-out infinite alternate;}
@keyframes bugSwarmAlertPulse{from{opacity:.82;box-shadow:0 0 14px rgba(255,65,35,.28)}to{opacity:1;box-shadow:0 0 32px rgba(255,65,35,.62)}}
@keyframes bugSwarmCanvasPulse{from{border-color:#777}to{border-color:#ff6548;box-shadow:0 0 24px rgba(255,65,35,.42)}}
#eagleTargetControls{
  display:none;
  width:min(420px,92vw);
  margin:-2px auto 7px;
  padding:8px 10px;
  box-sizing:border-box;
  align-items:center;
  justify-content:space-between;
  gap:8px;
  border:1px solid rgba(255,113,45,.55);
  border-radius:10px;
  color:#ffe2cf;
  background:rgba(68,24,10,.92);
  font-size:12px;
}
#eagleTargetControls button{min-height:34px;padding:5px 12px;border-radius:8px;font-size:12px;box-shadow:none;}
.hudItem{
  padding: 8px 5px;
  border: 1px solid rgba(126,249,255,.28);
  border-radius: 10px;
  background: rgba(4,12,23,.76);
  font-size: 12px;
  color: #b8c7d9;
}
#scoreHud{
  user-select:none;
  -webkit-user-select:none;
  -webkit-touch-callout:none;
  touch-action:manipulation;
}
.mobileDevTapHint{display:inline;color:#f5d67a;font-size:9px;white-space:nowrap;}
.hudItem strong{
  display: block;
  margin-top: 3px;
  color: #fff;
  font-size: 17px;
}
#comboHud.active{
  border-color: #ffd45e;
  box-shadow: 0 0 16px rgba(255,212,94,.28);
}
#comboHud{
  user-select:none;
  -webkit-user-select:none;
  touch-action:manipulation;
  transition:border-color .18s ease,box-shadow .18s ease,background .18s ease,transform .18s ease;
}
#comboHud.orbital-ready{
  color:#dffcff;
  cursor:pointer;
  border-color:#62e9ff;
  background:linear-gradient(145deg,rgba(13,70,102,.94),rgba(4,23,45,.94));
  box-shadow:0 0 8px #84eeff,0 0 26px rgba(40,193,255,.78),inset 0 0 18px rgba(98,233,255,.18);
  animation:orbitalReadyPulse .7s ease-in-out infinite alternate;
}
#comboHud.orbital-ready strong{color:#fff;text-shadow:0 0 8px #7ef9ff;}
#comboHud.orbital-used{opacity:.58;border-color:rgba(160,174,190,.32);}
#comboHud.hellbomb-ready{
  color:#fff0d6;
  cursor:pointer;
  border-color:#ff9c45;
  background:linear-gradient(145deg,rgba(112,42,12,.96),rgba(38,13,8,.96));
  box-shadow:0 0 9px #ffb35e,0 0 28px rgba(255,88,35,.72),inset 0 0 18px rgba(255,174,75,.18);
  animation:hellbombReadyPulse .65s ease-in-out infinite alternate;
}
#comboHud.hellbomb-ready strong{color:#fff;text-shadow:0 0 9px #ffb56c;}
#comboHud.hellbomb-charging{border-color:rgba(255,152,69,.4);}
#game.hellbomb-active canvas{animation:hellbombCanvasShake .1s linear infinite;}
@keyframes hellbombReadyPulse{from{transform:scale(1)}to{transform:scale(1.035)}}
@keyframes hellbombCanvasShake{0%,100%{transform:translate(0,0)}25%{transform:translate(-2px,1px)}75%{transform:translate(2px,-1px)}}
#game.danger-warning canvas{box-shadow:0 0 18px rgba(47,170,255,.46),inset 0 0 18px rgba(47,170,255,.2);}
#game.danger-critical canvas{box-shadow:0 0 12px #8cf4ff,0 0 38px rgba(32,173,255,.76);animation:dangerShake .18s linear infinite;}
@keyframes orbitalReadyPulse{from{transform:scale(1)}to{transform:scale(1.035)}}
@keyframes dangerShake{0%,100%{transform:translate(0,0)}25%{transform:translate(-1px,0)}75%{transform:translate(1px,0)}}
#victoryCard{
  width: min(440px, 88vw);
}
#actionReport{
  margin: 16px 0;
  padding: 14px 18px;
  text-align: left;
  border-radius: 14px;
  background: rgba(0,0,0,.24);
  border: 1px solid rgba(126,249,255,.2);
}
.reportRow{
  display: flex;
  justify-content: space-between;
  gap: 18px;
  padding: 6px 0;
  border-bottom: 1px solid rgba(255,255,255,.08);
}
.reportRow:last-child{ border-bottom: 0; }
#reportGrade{
  color: #ffd45e;
  font-size: 28px;
  font-weight: 800;
  text-shadow: 0 0 18px rgba(255,212,94,.35);
}
.leaderboardPanel{
  margin-top:14px;
  padding:14px;
  border-radius:14px;
  background:rgba(3,10,20,.56);
  border:1px solid rgba(255,212,94,.26);
  text-align:left;
}
.leaderboardPanel h3{
  margin:0 0 10px;
  color:#ffe36e;
  font-size:18px;
}
.leaderboardForm{display:flex;gap:8px;}
.leaderboardForm input{
  min-width:0;
  flex:1;
  padding:10px 12px;
  border-radius:10px;
  border:1px solid rgba(126,249,255,.35);
  background:rgba(0,0,0,.35);
  color:#fff;
  font-size:15px;
  outline:none;
}
.leaderboardForm input:focus{border-color:#7ef9ff;box-shadow:0 0 0 2px rgba(126,249,255,.12);}
.leaderboardForm button{padding:9px 14px;font-size:14px;border-radius:10px;white-space:nowrap;}
#leaderboardStatus{min-height:18px;margin:8px 0 5px;color:#a9bfd2;font-size:12px;}
.leaderboardLink{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  margin-top:10px;
  padding:10px 16px;
  border:1px solid rgba(255,212,94,.48);
  border-radius:10px;
  color:#ffe36e;
  background:rgba(255,212,94,.08);
  font-size:14px;
  font-weight:700;
  text-decoration:none;
  transition:background .2s ease,border-color .2s ease,transform .2s ease;
}
.leaderboardLink:hover{background:rgba(255,212,94,.16);border-color:#ffe36e;transform:translateY(-1px);}
.authorCredit{
  display:inline-flex;
  align-items:center;
  gap:6px;
  margin-top:10px;
  padding:6px 10px;
  border-radius:999px;
  color:rgba(255,255,255,.68);
  background:rgba(0,0,0,.22);
  border:1px solid rgba(255,255,255,.12);
  font-size:12px;
  line-height:1;
  text-decoration:none;
  transition:color .2s ease,border-color .2s ease,background .2s ease;
}
.authorCredit:hover,.authorCredit:focus-visible{
  color:#fff;
  border-color:rgba(0,174,236,.72);
  background:rgba(0,174,236,.13);
  outline:none;
}
.authorCredit .biliMark{color:#00aeec;font-weight:800;letter-spacing:.02em;}
.gameCredit{position:relative;z-index:2;margin:2px auto 8px;}
@media (min-width: 821px){
  #gameHud{
    position:absolute;
    z-index:3;
    inset:24px 18px auto;
    width:auto;
    height:210px;
    margin:0;
    display:block;
    pointer-events:none;
  }
  #game.challenge-mode #gameHud{display:block;}
  #gameHud .hudItem{
    position:absolute;
    width:150px;
    min-height:60px;
    padding:9px 8px;
    box-sizing:border-box;
    pointer-events:auto;
    backdrop-filter:blur(5px);
  }
  #gameHud .hudItem strong{
    min-width:0;
    white-space:nowrap;
    overflow:hidden;
    text-overflow:ellipsis;
    font-variant-numeric:tabular-nums;
  }
  #scoreHud{left:0;top:0;}
  #timeHud{left:0;top:72px;}
  #comboHud{right:0;top:0;}
  #multiplierHud{right:0;top:72px;}
  #skillHudOne{left:0;top:144px;}
  #skillHudTwo{right:0;top:144px;}
}
@media (max-width: 520px){
  body{
    min-height:100svh;
    align-items:flex-start;
    padding:0;
    overflow-x:hidden;
  }
  #menu,#game{
    width:100vw;
    min-height:100svh;
    border-radius:0;
    box-sizing:border-box;
  }
  #menu{display:flex;align-items:center;justify-content:center;padding:16px max(12px,env(safe-area-inset-right)) 16px max(12px,env(safe-area-inset-left));}
  #menuCard{width:100%;max-width:420px;padding:26px 20px 22px;box-sizing:border-box;}
  #menuCard h1{font-size:clamp(34px,11vw,52px);}
  #menuCard .desc{font-size:14px;line-height:1.65;}
  #menuCard button{min-height:48px;font-size:22px;padding:11px 42px;}
  .modeActions{flex-direction:column;align-items:stretch;}
  .modeActions button{width:100%;min-width:0;font-size:20px;padding:10px 18px;}
  .challengeRules{font-size:12px;}
  #game{padding:6px 8px calc(8px + env(safe-area-inset-bottom));overflow-y:auto;}
  canvas{
    width:min(calc(100vw - 16px),calc((100svh - 220px) * .6),420px);
    display:block;
    margin:0 auto;
    border-width:2px;
  }
  #gameHud{ grid-template-columns: repeat(2, 1fr); }
  #game.challenge-mode #gameHud{grid-template-columns:repeat(3,1fr);gap:5px;}
  #gameHud{width:min(420px,calc(100vw - 16px));margin:6px auto 3px;gap:5px;}
  .hudItem{padding:5px 4px;font-size:11px;}
  .hudItem strong{margin-top:1px;font-size:15px;}
  .skillHud strong{font-size:12px;}
  #challengeAuxiliaryHud{width:min(420px,calc(100vw - 16px));margin-bottom:3px;}
  #challengeDropHud{margin-bottom:3px;padding:1px 7px;font-size:9px;}
  #challengeDropHud strong{font-size:10px;}
  .auxiliarySlotGrid{gap:5px;}
  .auxiliarySlot{min-height:38px;padding:4px 6px;}
  .auxiliarySlot strong{font-size:11px;}
  #challengeSetupCard{padding:20px 14px 17px;}
  #challengeSetupCard h2{font-size:27px;}
  #bugSwarmAlert{top:132px;width:min(350px,88%);padding:8px 11px;}
  #bugSwarmAlert strong{font-size:16px;}
  .skillSetupGrid{grid-template-columns:1fr;}
  .skillSetupSlot p{min-height:0;}
  .challengeSetupActions{flex-direction:column-reverse;}
  .challengeSetupActions button{width:100%;}
  .small{margin:5px auto 0;max-width:420px;font-size:11px;line-height:1.4;}
  #devHint{display:none;}
  .gameCredit{margin:4px auto 6px;padding:5px 9px;font-size:11px;}
  #victoryMsg{align-items:flex-start;padding:calc(10px + env(safe-area-inset-top)) 8px calc(10px + env(safe-area-inset-bottom));box-sizing:border-box;overflow-y:auto;}
  #victoryCard{width:min(440px,100%);padding:20px 14px 18px;max-height:none;box-sizing:border-box;}
  #victoryTitle{font-size:32px;}
  #victoryText{font-size:17px;}
  #actionReport{margin:10px 0;padding:9px 12px;}
  .reportRow{padding:4px 0;font-size:13px;}
  #reportGrade{font-size:22px;}
  .leaderboardPanel{margin-top:10px;padding:11px;}
  .leaderboardForm input{font-size:16px;min-height:42px;box-sizing:border-box;}
  .leaderboardForm button{min-height:42px;padding:8px 11px;}
  .leaderboardLink{min-height:42px;box-sizing:border-box;}
  #victoryRestartBtn{font-size:17px;padding:10px 22px;margin-top:8px;}
  .restartConfirmActions{flex-direction:column;}
  .restartConfirmActions button{width:100%;}
}
@media (max-width: 360px){
  .leaderboardForm{flex-direction:column;}
  .leaderboardForm button{width:100%;}
  .changelogButton{top:10px;right:10px;padding:7px 10px;font-size:12px;}
}
@media (max-width: 620px){
  .rescueComic{width:min(390px,94vw);grid-template-columns:42% 1fr;gap:11px;}
  .rescuePortrait img{filter:drop-shadow(7px 10px 10px rgba(0,0,0,.72)) drop-shadow(0 0 1px rgba(92,222,255,.72));}
  .rescueDialogue{padding:15px 13px;border-width:3px;box-shadow:5px 6px 0 #38bde9;}
  .rescueDialogue::before{left:-18px;width:22px;height:22px;border-width:0 0 3px 3px;}
  .rescueSpeaker{font-size:10px;letter-spacing:.06em;}
  .rescueLine{font-size:clamp(16px,5vw,22px);}
  .rescueAuthorization{margin-top:10px;padding-top:9px;font-size:clamp(14px,4.2vw,18px);}
}
@media (max-height: 700px) and (max-width: 520px){
  .small{display:none;}
  .gameCredit{margin-top:3px;}
}
