:root {
  color-scheme: dark;
  --panel-bg: rgba(6, 18, 34, 0.72);
  --panel-bg-strong: rgba(5, 15, 29, 0.9);
  --panel-border: rgba(184, 232, 255, 0.3);
  --text: #f3fbff;
  --muted: #a9c8d7;
  --gold: #ffd26a;
  --gold-strong: #ffae45;
  --cyan: #67d7ff;
  --red: #ff6f7d;
  --green: #81e6a8;
  --violet: #c8a8ff;
  --shadow: rgba(0, 0, 0, 0.38);
}

* {
  box-sizing: border-box;
}

html,
body {
  width: 100%;
  height: 100%;
  margin: 0;
  overflow: hidden;
  background: #041425;
  color: var(--text);
  font-family: "Microsoft YaHei", "PingFang SC", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  letter-spacing: 0;
  user-select: none;
  touch-action: none;
}

button {
  border: 0;
  color: inherit;
  font: inherit;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

button:focus-visible {
  outline: 3px solid rgba(103, 215, 255, 0.78);
  outline-offset: 3px;
}

.game-shell {
  position: relative;
  width: 100vw;
  height: 100dvh;
  min-height: 520px;
  overflow: hidden;
  background: #041425;
}

.game-shell::before,
.game-shell::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 1;
  pointer-events: none;
}

.game-shell::before {
  background:
    linear-gradient(108deg, rgba(255, 255, 255, 0.16) 0 7%, transparent 7% 20%, rgba(121, 231, 255, 0.09) 20% 27%, transparent 27% 100%),
    radial-gradient(circle at 18% 12%, rgba(255, 210, 106, 0.18), transparent 26%),
    radial-gradient(circle at 82% 20%, rgba(129, 230, 168, 0.11), transparent 25%);
  mix-blend-mode: screen;
  opacity: 0.58;
}

.game-shell::after {
  background:
    linear-gradient(180deg, rgba(2, 7, 14, 0.1), transparent 38%, rgba(0, 0, 0, 0.2)),
    radial-gradient(ellipse at center, transparent 42%, rgba(0, 0, 0, 0.28));
}

#gameCanvas {
  position: relative;
  z-index: 0;
  display: block;
  width: 100%;
  height: 100%;
}

.hud {
  position: absolute;
  z-index: 5;
  display: flex;
  gap: 10px;
  pointer-events: none;
  transition: opacity 180ms ease, filter 180ms ease;
}

body.is-menu .hud,
body.is-over .hud {
  opacity: 0.28;
  filter: saturate(0.65);
}

body.is-menu .pause-button,
body.is-over .pause-button {
  opacity: 0;
  pointer-events: none;
}

.hud-top {
  top: max(12px, env(safe-area-inset-top));
  left: max(12px, env(safe-area-inset-left));
  right: max(12px, env(safe-area-inset-right));
  flex-wrap: wrap;
  align-items: stretch;
}

.brand-chip,
.stat,
.mission-panel,
.bounty-panel,
.skill-button,
.round-button,
.fire-button,
.auto-button,
.pause-button {
  border: 1px solid var(--panel-border);
  background:
    linear-gradient(180deg, rgba(24, 72, 104, 0.74), rgba(6, 18, 34, 0.82)),
    var(--panel-bg);
  box-shadow: 0 14px 30px var(--shadow), inset 0 1px 0 rgba(255, 255, 255, 0.12);
  backdrop-filter: blur(16px);
}

.brand-chip {
  position: relative;
  min-width: 168px;
  padding: 8px 14px 9px;
  border-radius: 8px;
  overflow: hidden;
}

.brand-chip::after {
  content: "";
  position: absolute;
  left: 14px;
  right: 14px;
  bottom: 0;
  height: 2px;
  background: linear-gradient(90deg, var(--cyan), var(--gold), var(--green));
}

.brand-chip span {
  display: block;
  color: var(--cyan);
  font-size: 11px;
  line-height: 1.15;
  font-weight: 700;
}

.brand-chip strong {
  display: block;
  margin-top: 2px;
  color: var(--text);
  font-size: 22px;
  line-height: 1;
  font-weight: 800;
}

.stat {
  min-width: 102px;
  padding: 8px 12px;
  border-radius: 8px;
}

.stat span {
  display: block;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.2;
}

.stat strong {
  display: block;
  margin-top: 2px;
  color: var(--gold);
  font-size: 24px;
  line-height: 1;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
}

.combo-stat strong {
  color: var(--green);
}

.mission-panel {
  top: max(146px, calc(env(safe-area-inset-top) + 144px));
  left: 50%;
  width: min(360px, calc(100vw - 32px));
  padding: 10px 12px;
  border-radius: 8px;
  transform: translateX(-50%);
}

.bounty-panel {
  top: max(78px, calc(env(safe-area-inset-top) + 76px));
  left: 50%;
  width: min(400px, calc(100vw - 32px));
  min-height: 58px;
  padding: 9px 14px;
  border-radius: 8px;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  transform: translateX(-50%);
  border-color: rgba(255, 210, 106, 0.52);
  background:
    linear-gradient(180deg, rgba(91, 41, 12, 0.72), rgba(7, 19, 36, 0.88)),
    var(--panel-bg);
  box-shadow: 0 18px 42px rgba(0, 0, 0, 0.4), 0 0 28px rgba(255, 210, 106, 0.18), inset 0 1px 0 rgba(255, 255, 255, 0.14);
}

.bounty-panel::before,
.bounty-panel::after {
  content: "";
  width: 22px;
  height: 22px;
  border: 2px solid rgba(255, 210, 106, 0.72);
  opacity: 0.9;
}

.bounty-panel::before {
  border-right: 0;
  border-bottom: 0;
}

.bounty-panel::after {
  border-left: 0;
  border-bottom: 0;
}

.bounty-panel div {
  min-width: 0;
}

.bounty-panel span {
  display: block;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.1;
  font-weight: 700;
}

.bounty-panel strong {
  display: block;
  margin-top: 3px;
  color: var(--text);
  font-size: 18px;
  line-height: 1;
  font-weight: 900;
  white-space: nowrap;
}

.bounty-reward {
  text-align: right;
}

.bounty-reward strong {
  color: var(--gold);
  font-size: 22px;
  text-shadow: 0 0 18px rgba(255, 210, 106, 0.42);
}

.mission-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.mission-title span {
  color: var(--text);
  font-size: 14px;
  font-weight: 700;
}

.mission-title strong {
  color: var(--gold);
  font-size: 14px;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
}

.meter {
  height: 8px;
  margin: 8px 0 6px;
  border-radius: 999px;
  background: rgba(160, 211, 236, 0.16);
  overflow: hidden;
}

.meter span {
  display: block;
  width: 0%;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--cyan), var(--green), var(--gold));
  box-shadow: 0 0 18px rgba(103, 215, 255, 0.55);
  transition: width 160ms ease;
}

.mission-panel small {
  display: block;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.2;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.hud-side {
  right: max(14px, env(safe-area-inset-right));
  top: 138px;
  flex-direction: column;
  pointer-events: auto;
}

.skill-button,
.round-button,
.fire-button,
.auto-button,
.pause-button,
.primary-button {
  transition: transform 120ms ease, opacity 160ms ease, border-color 160ms ease, box-shadow 160ms ease;
}

.skill-button:active,
.round-button:active,
.fire-button:active,
.auto-button:active,
.pause-button:active,
.primary-button:active {
  transform: translateY(1px);
}

.skill-button[disabled],
.round-button[disabled],
.fire-button[disabled],
.auto-button[disabled] {
  cursor: not-allowed;
  opacity: 0.46;
  transform: none;
}

.skill-button {
  --cooldown: 0%;
  position: relative;
  width: 78px;
  min-height: 78px;
  padding: 8px 6px;
  border-radius: 8px;
  display: grid;
  place-items: center;
  gap: 2px;
  color: var(--text);
  overflow: hidden;
}

.skill-button::before {
  content: "";
  position: absolute;
  inset: 4px;
  border-radius: 6px;
  background: conic-gradient(rgba(255, 210, 106, 0.58) var(--cooldown), transparent 0);
  opacity: 0.9;
  pointer-events: none;
}

.skill-button > * {
  position: relative;
  z-index: 1;
}

.skill-button span:not(.skill-icon) {
  font-size: 14px;
  line-height: 1;
}

.skill-button small {
  color: var(--muted);
  font-size: 11px;
  line-height: 1;
}

.skill-icon {
  position: relative;
  display: block;
  width: 26px;
  height: 26px;
}

.ice-icon::before,
.ice-icon::after {
  content: "";
  position: absolute;
  left: 50%;
  top: 50%;
  width: 26px;
  height: 4px;
  border-radius: 999px;
  background: var(--cyan);
  transform-origin: center;
}

.ice-icon::before {
  transform: translate(-50%, -50%) rotate(0deg);
}

.ice-icon::after {
  transform: translate(-50%, -50%) rotate(60deg);
  box-shadow: 0 0 12px rgba(103, 215, 255, 0.9);
}

.bomb-icon {
  border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, #fff0a0, #ff8b47 32%, #c8283b 70%);
}

.bomb-icon::before {
  content: "";
  position: absolute;
  right: -2px;
  top: -7px;
  width: 12px;
  height: 10px;
  border-top: 3px solid var(--gold);
  border-radius: 50%;
  transform: rotate(25deg);
}

.rain-icon::before,
.rain-icon::after {
  content: "";
  position: absolute;
}

.rain-icon::before {
  inset: 1px 4px 10px;
  border-radius: 999px 999px 8px 8px;
  background: linear-gradient(180deg, #fff2a0, #ffb345);
  box-shadow: 0 0 14px rgba(255, 210, 106, 0.7);
}

.rain-icon::after {
  left: 5px;
  right: 5px;
  bottom: 0;
  height: 13px;
  background:
    radial-gradient(circle, #ffdf78 0 42%, transparent 45%) 0 0 / 9px 9px,
    radial-gradient(circle, #fff4c0 0 38%, transparent 42%) 5px 4px / 9px 9px;
}

.lock-icon::before,
.lock-icon::after {
  content: "";
  position: absolute;
  border: 2px solid var(--green);
}

.lock-icon::before {
  inset: 3px;
  border-radius: 50%;
}

.lock-icon::after {
  left: 11px;
  top: 0;
  width: 0;
  height: 26px;
  border-left: 2px solid var(--green);
  border-right: 0;
  border-top: 0;
  border-bottom: 0;
  box-shadow: -11px 13px 0 -1px var(--green), 11px 13px 0 -1px var(--green);
}

.hud-bottom {
  left: 50%;
  bottom: max(16px, env(safe-area-inset-bottom));
  transform: translateX(-50%);
  align-items: center;
  pointer-events: auto;
}

.round-button {
  width: 54px;
  height: 54px;
  border-radius: 50%;
  color: var(--cyan);
  font-size: 34px;
  line-height: 1;
}

.fire-button {
  position: relative;
  min-width: 126px;
  height: 60px;
  border-radius: 8px;
  color: #081827;
  background: linear-gradient(180deg, #fff1a3, #ffb14f 58%, #ff8845);
  font-size: 20px;
  font-weight: 800;
  text-shadow: 0 1px 0 rgba(255, 255, 255, 0.36);
  overflow: hidden;
}

.auto-button {
  min-width: 74px;
  height: 48px;
  padding: 0 14px;
  border-radius: 8px;
  color: var(--green);
  font-size: 16px;
  font-weight: 800;
  white-space: nowrap;
}

.auto-button.is-on {
  color: #061624;
  border-color: rgba(185, 255, 210, 0.68);
  background: linear-gradient(180deg, #b9ffd2, #52d989);
  box-shadow: 0 14px 32px rgba(0, 0, 0, 0.34), 0 0 24px rgba(129, 230, 168, 0.28);
}

.fire-button::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(110deg, transparent 0 35%, rgba(255, 255, 255, 0.38) 45%, transparent 58% 100%);
  transform: translateX(-120%);
  animation: button-shine 2.8s ease-in-out infinite;
}

.pause-button {
  position: absolute;
  z-index: 6;
  right: max(14px, env(safe-area-inset-right));
  bottom: max(18px, env(safe-area-inset-bottom));
  height: 42px;
  padding: 0 14px;
  border-radius: 8px;
  color: var(--text);
  background: rgba(8, 22, 39, 0.62);
}

.combo-badge {
  position: absolute;
  z-index: 6;
  left: 50%;
  top: 42%;
  min-width: 180px;
  padding: 12px 18px;
  border-radius: 8px;
  border: 1px solid rgba(255, 210, 106, 0.44);
  background: linear-gradient(180deg, rgba(58, 27, 7, 0.72), rgba(7, 18, 31, 0.74));
  box-shadow: 0 18px 48px rgba(0, 0, 0, 0.34), 0 0 34px rgba(255, 210, 106, 0.2);
  text-align: center;
  opacity: 0;
  pointer-events: none;
  transform: translate(-50%, -50%) scale(0.88);
  transition: opacity 160ms ease, transform 160ms ease;
}

.combo-badge.is-visible {
  opacity: 1;
  transform: translate(-50%, -50%) scale(1);
}

.combo-badge span {
  display: block;
  color: var(--gold);
  font-size: 12px;
  font-weight: 800;
}

.combo-badge strong {
  display: block;
  color: var(--text);
  font-size: 42px;
  line-height: 1;
  font-weight: 900;
  font-variant-numeric: tabular-nums;
}

.big-win {
  position: absolute;
  z-index: 7;
  left: 50%;
  top: 30%;
  min-width: 240px;
  padding: 12px 22px 16px;
  border-radius: 8px;
  border: 1px solid rgba(255, 210, 106, 0.56);
  background: linear-gradient(180deg, rgba(91, 41, 12, 0.78), rgba(8, 19, 31, 0.76));
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.4), 0 0 46px rgba(255, 210, 106, 0.26);
  text-align: center;
  opacity: 0;
  pointer-events: none;
  transform: translate(-50%, -50%) scale(0.82);
}

.big-win.is-visible {
  animation: big-win-pop 860ms ease-out;
}

.big-win span {
  display: block;
  color: var(--cyan);
  font-size: 13px;
  font-weight: 900;
}

.big-win strong {
  display: block;
  color: var(--gold);
  font-size: 54px;
  line-height: 1;
  font-weight: 900;
  text-shadow: 0 4px 24px rgba(255, 170, 70, 0.58);
}

.boss-banner {
  position: absolute;
  z-index: 8;
  top: 172px;
  left: 50%;
  width: min(520px, calc(100vw - 32px));
  padding: 12px 18px;
  border: 1px solid rgba(255, 111, 125, 0.48);
  border-radius: 8px;
  background: linear-gradient(90deg, rgba(88, 13, 28, 0.84), rgba(8, 21, 39, 0.86), rgba(88, 13, 28, 0.84));
  color: #fff5f4;
  box-shadow: 0 18px 46px rgba(0, 0, 0, 0.36), 0 0 34px rgba(255, 111, 125, 0.24);
  text-align: center;
  font-weight: 800;
  opacity: 0;
  pointer-events: none;
  transform: translate(-50%, -16px);
  transition: opacity 180ms ease, transform 180ms ease;
}

.boss-banner.is-visible {
  opacity: 1;
  transform: translate(-50%, 0);
}

.screen-flash {
  position: absolute;
  z-index: 9;
  inset: 0;
  pointer-events: none;
  background: rgba(255, 226, 150, 0.16);
  opacity: 0;
}

.screen-flash.is-active {
  animation: flash 320ms ease-out;
}

.overlay {
  position: absolute;
  z-index: 10;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 24px;
  background:
    radial-gradient(circle at 50% 45%, rgba(31, 147, 190, 0.24), rgba(2, 8, 18, 0.84)),
    linear-gradient(180deg, rgba(4, 14, 28, 0.2), rgba(0, 0, 0, 0.5));
}

.overlay.is-hidden {
  display: none;
}

.overlay-panel {
  width: min(600px, 100%);
  padding: 30px 30px 28px;
  border: 1px solid var(--panel-border);
  border-radius: 8px;
  background:
    linear-gradient(180deg, rgba(12, 44, 70, 0.7), rgba(7, 19, 36, 0.9)),
    var(--panel-bg-strong);
  box-shadow: 0 28px 80px rgba(0, 0, 0, 0.52), inset 0 1px 0 rgba(255, 255, 255, 0.14);
  text-align: center;
  backdrop-filter: blur(18px);
}

.title-mark {
  display: grid;
  justify-items: center;
  gap: 8px;
  margin-bottom: 10px;
  color: var(--cyan);
  font-size: 11px;
  font-weight: 900;
}

.crest {
  position: relative;
  display: block;
  width: 58px;
  height: 58px;
  border: 1px solid rgba(255, 210, 106, 0.6);
  border-radius: 50%;
  background:
    radial-gradient(circle at 35% 32%, #ffffff, transparent 12%),
    radial-gradient(circle at 45% 48%, var(--gold), var(--gold-strong) 56%, rgba(255, 136, 69, 0.6));
  box-shadow: 0 0 28px rgba(255, 210, 106, 0.32);
}

.crest::before,
.crest::after {
  content: "";
  position: absolute;
  top: 50%;
  border-top: 11px solid transparent;
  border-bottom: 11px solid transparent;
  transform: translateY(-50%);
}

.crest::before {
  left: -16px;
  border-right: 18px solid rgba(103, 215, 255, 0.9);
}

.crest::after {
  right: -18px;
  border-left: 22px solid rgba(129, 230, 168, 0.9);
}

.overlay-panel h1 {
  margin: 0;
  color: var(--gold);
  font-size: 58px;
  line-height: 1;
  font-weight: 900;
  letter-spacing: 0;
  text-shadow: 0 5px 24px rgba(255, 167, 69, 0.46);
}

.overlay-panel p {
  margin: 18px auto 0;
  max-width: 470px;
  color: var(--muted);
  font-size: 16px;
  line-height: 1.65;
}

.quick-rules {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 8px;
  margin: 22px 0 12px;
}

.quick-rules span {
  padding: 7px 10px;
  border-radius: 8px;
  background: rgba(103, 215, 255, 0.12);
  color: var(--cyan);
  font-size: 13px;
  font-weight: 700;
}

.overlay-meta {
  min-height: 20px;
  margin-bottom: 22px;
  color: var(--gold);
  font-size: 13px;
  font-weight: 700;
}

.primary-button {
  min-width: 178px;
  min-height: 52px;
  border: 1px solid rgba(203, 255, 255, 0.56);
  border-radius: 8px;
  color: #061624;
  background: linear-gradient(180deg, #affcff, #54d8f1 58%, #28a7cc);
  box-shadow: 0 16px 36px rgba(0, 0, 0, 0.34), inset 0 1px 0 rgba(255, 255, 255, 0.48);
  font-size: 18px;
  font-weight: 900;
}

.toast {
  position: absolute;
  z-index: 7;
  left: 50%;
  top: 172px;
  min-width: 180px;
  max-width: min(440px, calc(100vw - 32px));
  padding: 10px 14px;
  border: 1px solid rgba(184, 232, 255, 0.24);
  border-radius: 8px;
  background: rgba(5, 17, 31, 0.82);
  color: var(--text);
  text-align: center;
  box-shadow: 0 14px 28px var(--shadow);
  opacity: 0;
  pointer-events: none;
  transform: translate(-50%, -12px);
  transition: opacity 180ms ease, transform 180ms ease;
}

.toast.is-visible {
  opacity: 1;
  transform: translate(-50%, 0);
}

@keyframes button-shine {
  0%,
  62% {
    transform: translateX(-120%);
  }
  100% {
    transform: translateX(120%);
  }
}

@keyframes flash {
  0% {
    opacity: 0.34;
  }
  100% {
    opacity: 0;
  }
}

@keyframes big-win-pop {
  0% {
    opacity: 0;
    transform: translate(-50%, -50%) scale(0.68);
  }
  18%,
  70% {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1);
  }
  100% {
    opacity: 0;
    transform: translate(-50%, -72%) scale(1.08);
  }
}

@media (max-width: 860px) {
  .mission-panel {
    top: 188px;
  }

  .bounty-panel {
    top: 124px;
  }

  .hud-side {
    top: auto;
    right: 12px;
    bottom: 94px;
    flex-direction: row;
  }

  .boss-banner {
    top: 250px;
  }
}

@media (max-width: 720px) {
  .game-shell {
    min-height: 480px;
  }

  .hud-top {
    gap: 6px;
  }

  .brand-chip {
    min-width: calc(33.333% - 4px);
    flex: 1 1 calc(33.333% - 4px);
    min-width: 0;
    padding: 7px 10px;
  }

  .brand-chip strong {
    font-size: 18px;
  }

  .stat {
    min-width: calc(33.333% - 4px);
    flex: 1 1 calc(33.333% - 4px);
    padding: 7px 9px;
  }

  .stat strong {
    font-size: 20px;
  }

  .combo-stat {
    min-width: calc(33.333% - 4px);
  }

  .bounty-panel {
    top: 136px;
    min-height: 52px;
    padding: 8px 10px;
  }

  .bounty-panel::before,
  .bounty-panel::after {
    width: 15px;
    height: 15px;
  }

  .bounty-panel strong {
    font-size: 16px;
  }

  .bounty-reward strong {
    font-size: 20px;
  }

  .mission-panel {
    top: 198px;
    padding: 8px 10px;
  }

  .boss-banner,
  .toast {
    top: 260px;
  }

  .hud-side {
    right: 10px;
    bottom: 92px;
    gap: 6px;
  }

  .skill-button {
    width: 62px;
    min-height: 62px;
    padding: 6px 4px;
  }

  .skill-icon {
    width: 22px;
    height: 22px;
  }

  .hud-bottom {
    bottom: max(12px, env(safe-area-inset-bottom));
  }

  .round-button {
    width: 48px;
    height: 48px;
  }

  .fire-button {
    min-width: 100px;
    height: 52px;
  }

  .auto-button {
    min-width: 72px;
    height: 44px;
    padding: 0 9px;
    font-size: 15px;
  }

  .pause-button {
    left: 10px;
    right: auto;
    bottom: max(17px, env(safe-area-inset-bottom));
  }

  .overlay-panel {
    padding: 24px 18px 22px;
  }

  .overlay-panel h1 {
    font-size: 40px;
  }

  .overlay-panel p {
    margin-top: 14px;
  }

  .combo-badge {
    top: 46%;
    min-width: 150px;
  }

  .combo-badge strong {
    font-size: 34px;
  }

  .big-win {
    min-width: 190px;
  }

  .big-win strong {
    font-size: 40px;
  }
}

@media (max-height: 620px) {
  .mission-panel {
    opacity: 0;
    pointer-events: none;
  }

  .bounty-panel {
    top: 78px;
  }

  .boss-banner,
  .toast {
    top: 142px;
  }

  .hud-side {
    top: auto;
    bottom: 86px;
    flex-direction: row;
  }

  .skill-button {
    width: 62px;
    min-height: 58px;
  }

  .overlay-panel {
    padding: 18px;
  }

  .overlay-panel h1 {
    font-size: 40px;
  }

  .overlay-panel p {
    margin-top: 12px;
  }
}

/* Premium key-art pass: keep the playfield vivid while the controls read as one finished game. */
.game-shell {
  background: #02091d;
}

.game-shell::before {
  background:
    linear-gradient(115deg, rgba(255, 255, 255, 0.08) 0 5%, transparent 5% 28%, rgba(103, 215, 255, 0.06) 28% 34%, transparent 34% 100%),
    linear-gradient(180deg, rgba(2, 9, 31, 0.12), transparent 30%, rgba(2, 5, 22, 0.16));
  opacity: 0.46;
}

.game-shell::after {
  background:
    linear-gradient(180deg, rgba(1, 5, 20, 0.12), transparent 30%, rgba(0, 0, 0, 0.36)),
    radial-gradient(ellipse at center, transparent 38%, rgba(0, 0, 14, 0.38));
}

#gameCanvas {
  filter: saturate(1.08) contrast(1.04);
}

.brand-chip,
.stat,
.mission-panel,
.bounty-panel,
.skill-button,
.round-button,
.fire-button,
.auto-button,
.pause-button {
  border-color: rgba(192, 226, 255, 0.36);
  background:
    linear-gradient(180deg, rgba(10, 56, 94, 0.72), rgba(4, 13, 34, 0.82)),
    rgba(4, 13, 32, 0.76);
  box-shadow: 0 16px 34px rgba(0, 0, 0, 0.42), 0 0 22px rgba(43, 156, 215, 0.1), inset 0 1px 0 rgba(255, 255, 255, 0.16);
}

.brand-chip {
  border-color: rgba(255, 210, 106, 0.58);
  background:
    linear-gradient(180deg, rgba(26, 82, 119, 0.82), rgba(7, 23, 51, 0.9)),
    rgba(5, 16, 37, 0.82);
}

.brand-chip span {
  color: #8ceaff;
  text-shadow: 0 0 16px rgba(103, 215, 255, 0.52);
}

.brand-chip strong {
  color: #fff2a6;
  text-shadow: 0 2px 16px rgba(255, 191, 67, 0.42);
}

.stat {
  min-width: 96px;
  border-color: rgba(140, 207, 242, 0.28);
}

.stat strong {
  text-shadow: 0 0 16px rgba(255, 210, 106, 0.34);
}

.mission-panel {
  border-color: rgba(99, 219, 255, 0.36);
  background:
    linear-gradient(180deg, rgba(9, 68, 103, 0.72), rgba(3, 19, 45, 0.88)),
    rgba(4, 15, 36, 0.82);
}

.bounty-panel {
  border-color: rgba(255, 218, 124, 0.72);
  background:
    linear-gradient(180deg, rgba(119, 62, 17, 0.72), rgba(10, 24, 51, 0.9)),
    rgba(7, 18, 40, 0.85);
}

.hud-side {
  gap: 8px;
}

.skill-button {
  width: 82px;
  min-height: 82px;
  border-color: rgba(148, 220, 248, 0.42);
  background:
    linear-gradient(180deg, rgba(13, 73, 112, 0.82), rgba(4, 16, 39, 0.88)),
    rgba(3, 13, 33, 0.84);
}

.skill-button:hover,
.round-button:hover,
.auto-button:hover,
.pause-button:hover {
  border-color: rgba(255, 222, 136, 0.82);
  box-shadow: 0 16px 34px rgba(0, 0, 0, 0.42), 0 0 28px rgba(255, 210, 106, 0.18), inset 0 1px 0 rgba(255, 255, 255, 0.2);
}

.skill-button span:not(.skill-icon) {
  color: #effcff;
  font-weight: 800;
  text-shadow: 0 2px 8px rgba(0, 0, 0, 0.45);
}

.skill-button small {
  color: #8ed5f1;
}

.hud-bottom {
  gap: 12px;
  padding: 8px 10px;
  border: 1px solid rgba(255, 210, 106, 0.3);
  border-radius: 10px;
  background: linear-gradient(180deg, rgba(6, 29, 54, 0.7), rgba(2, 9, 25, 0.82));
  box-shadow: 0 18px 42px rgba(0, 0, 0, 0.42), inset 0 1px 0 rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(14px);
}

.round-button {
  border-color: rgba(119, 224, 255, 0.66);
  background: radial-gradient(circle at 35% 26%, rgba(201, 251, 255, 0.54), rgba(12, 92, 147, 0.9) 42%, rgba(3, 25, 59, 0.96));
  box-shadow: 0 10px 20px rgba(0, 0, 0, 0.32), 0 0 18px rgba(103, 215, 255, 0.18), inset 0 1px 0 rgba(255, 255, 255, 0.32);
}

.fire-button {
  min-width: 142px;
  height: 64px;
  border-color: rgba(255, 245, 183, 0.86);
  background:
    radial-gradient(circle at 50% 16%, #fffbd0 0, transparent 23%),
    linear-gradient(180deg, #fff19a, #ffb13c 56%, #e95a32);
  box-shadow: 0 16px 30px rgba(0, 0, 0, 0.36), 0 0 26px rgba(255, 162, 59, 0.34), inset 0 1px 0 rgba(255, 255, 255, 0.6);
  font-size: 22px;
}

.auto-button {
  min-width: 86px;
  border-color: rgba(125, 225, 220, 0.5);
  background: linear-gradient(180deg, rgba(15, 98, 117, 0.82), rgba(4, 33, 58, 0.92));
}

.auto-button.is-on {
  color: #062033;
  border-color: rgba(255, 234, 156, 0.9);
  background: linear-gradient(180deg, #fff4ad, #ffd269 56%, #ff9e49);
  box-shadow: 0 14px 32px rgba(0, 0, 0, 0.34), 0 0 30px rgba(255, 210, 106, 0.42);
}

.boss-banner {
  border-color: rgba(255, 211, 104, 0.72);
  background: linear-gradient(90deg, rgba(80, 12, 30, 0.9), rgba(10, 30, 59, 0.94), rgba(80, 12, 30, 0.9));
  box-shadow: 0 18px 46px rgba(0, 0, 0, 0.4), 0 0 42px rgba(255, 111, 125, 0.3), inset 0 1px 0 rgba(255, 235, 173, 0.22);
  font-size: 16px;
  text-shadow: 0 2px 10px rgba(0, 0, 0, 0.5);
}

.overlay {
  background:
    radial-gradient(circle at 50% 42%, rgba(0, 198, 255, 0.16), rgba(2, 7, 22, 0.46)),
    linear-gradient(180deg, rgba(1, 7, 24, 0.1), rgba(0, 0, 0, 0.44));
}

.overlay-panel {
  border-color: rgba(255, 213, 111, 0.58);
  background:
    linear-gradient(180deg, rgba(10, 48, 75, 0.64), rgba(4, 12, 31, 0.86)),
    rgba(4, 12, 30, 0.68);
  box-shadow: 0 28px 90px rgba(0, 0, 0, 0.58), 0 0 42px rgba(22, 177, 226, 0.12), inset 0 1px 0 rgba(255, 242, 181, 0.18);
}

.overlay-panel h1 {
  color: #fff0a0;
  text-shadow: 0 4px 28px rgba(255, 163, 58, 0.56), 0 0 2px #fff;
}

.quick-rules span {
  border: 1px solid rgba(110, 224, 250, 0.22);
  background: rgba(30, 166, 211, 0.14);
}

.primary-button {
  min-width: 210px;
  border-color: rgba(255, 246, 190, 0.86);
  color: #24190a;
  background: linear-gradient(180deg, #fff4b2, #ffc75c 56%, #f47e3d);
  box-shadow: 0 16px 36px rgba(0, 0, 0, 0.38), 0 0 30px rgba(255, 185, 76, 0.3), inset 0 1px 0 rgba(255, 255, 255, 0.6);
}

@media (max-width: 720px) {
  .skill-button {
    width: 66px;
    min-height: 66px;
  }

  .hud-bottom {
    gap: 7px;
    padding: 6px;
  }

  .fire-button {
    min-width: 106px;
    height: 54px;
  }

  .auto-button {
    min-width: 74px;
  }
}

.toast {
  top: auto;
  bottom: max(112px, calc(env(safe-area-inset-bottom) + 106px));
}

.cannon-style-chip {
  min-width: 128px;
  padding: 7px 10px;
  border: 1px solid rgba(255, 210, 106, 0.4);
  border-radius: 8px;
  background: linear-gradient(180deg, rgba(31, 83, 112, 0.82), rgba(5, 22, 47, 0.92));
  display: grid;
  align-content: center;
  gap: 3px;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.12);
}

.cannon-style-chip span {
  color: #fff1a0;
  font-size: 13px;
  font-weight: 800;
  white-space: nowrap;
}

.cannon-style-chip small {
  color: #91d6ef;
  font-size: 11px;
  white-space: nowrap;
}

.cannon-style-chip b {
  color: #ffd26a;
  font-variant-numeric: tabular-nums;
}

.network-panel {
  position: absolute;
  z-index: 6;
  top: 112px;
  left: max(14px, env(safe-area-inset-left));
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 34px;
  padding: 5px 7px 5px 10px;
  border: 1px solid rgba(120, 215, 242, 0.34);
  border-radius: 8px;
  background: rgba(4, 21, 43, 0.74);
  box-shadow: 0 10px 26px rgba(0, 0, 0, 0.3), inset 0 1px 0 rgba(255, 255, 255, 0.12);
  backdrop-filter: blur(12px);
  color: #b8d9e7;
  font-size: 12px;
  pointer-events: auto;
}

.network-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #8ba9b6;
  box-shadow: 0 0 10px rgba(139, 169, 182, 0.5);
}

.network-panel button {
  min-height: 26px;
  padding: 3px 9px;
  border: 1px solid rgba(103, 215, 255, 0.48);
  border-radius: 6px;
  background: linear-gradient(180deg, rgba(25, 118, 151, 0.84), rgba(5, 47, 78, 0.92));
  color: #effcff;
  font-size: 12px;
  font-weight: 800;
}

.network-panel button.is-connected {
  border-color: rgba(129, 230, 168, 0.62);
  background: linear-gradient(180deg, rgba(29, 131, 111, 0.88), rgba(5, 60, 61, 0.94));
}

.network-panel:has(button.is-connected) .network-dot {
  background: #81e6a8;
  box-shadow: 0 0 12px rgba(129, 230, 168, 0.8);
}

@media (max-width: 720px) {
  .network-panel {
    top: auto;
    bottom: max(168px, calc(env(safe-area-inset-bottom) + 158px));
    left: 10px;
    max-width: calc(100vw - 20px);
    font-size: 11px;
  }
}

@media (max-width: 720px) {
  .cannon-style-chip {
    min-width: 72px;
    padding: 6px 7px;
  }

  .cannon-style-chip span {
    font-size: 11px;
  }

  .cannon-style-chip small {
    font-size: 10px;
  }
}
