.breakout-shell-page::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  background:
    radial-gradient(circle at 8% 10%, rgba(255, 201, 90, 0.22), transparent 25%),
    radial-gradient(circle at 92% 16%, rgba(121, 183, 255, 0.24), transparent 28%),
    radial-gradient(circle at 50% 82%, rgba(167, 133, 255, 0.16), transparent 30%),
    linear-gradient(180deg, rgba(239, 229, 215, 0.86) 0%, rgba(211, 232, 255, 0.88) 100%);
}

.breakout-page-content {
  display: grid;
  gap: 14px;
}

.breakout-head {
  padding-bottom: 8px;
}

.breakout-stage-card {
  padding: 12px;
  border-radius: 32px;
  background:
    linear-gradient(180deg, rgba(255, 250, 244, 0.82), rgba(247, 242, 235, 0.72)),
    rgba(255, 250, 244, 0.76);
}

.stage-topbar,
.mobile-hud-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.mobile-hud-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr));
  margin-top: 12px;
}

.stage-chip,
.battle-card {
  position: relative;
  min-height: 70px;
  padding: 12px 14px;
  border-radius: 20px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.94), rgba(255, 247, 238, 0.86));
  border: 1px solid rgba(58, 42, 27, 0.08);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.8),
    0 14px 26px rgba(30, 26, 20, 0.06);
  overflow: hidden;
}

.stage-chip::before,
.battle-card::before {
  content: "";
  position: absolute;
  inset: 0 auto auto 0;
  width: 100%;
  height: 58%;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.42), rgba(255, 255, 255, 0));
  pointer-events: none;
}

.stage-chip {
  display: flex;
  align-items: center;
  gap: 12px;
}

.stage-chip-label,
.battle-label {
  display: block;
  margin-bottom: 6px;
  font-size: 0.78rem;
  color: var(--moyu-muted);
}

.battle-card {
  text-align: center;
}

.stage-chip-copy {
  position: relative;
  z-index: 1;
  min-width: 0;
}

.stage-chip-mark,
.battle-mark {
  position: relative;
  z-index: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  width: 34px;
  height: 34px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.86);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.9),
    0 8px 16px rgba(35, 27, 20, 0.08);
  font-size: 0.95rem;
  line-height: 1;
}

.talent-mark { color: #c95f21; }
.mode-mark { color: #5b67d8; }
.boss-mark { color: #9b4761; }

.stage-chip strong,
.battle-card strong {
  position: relative;
  z-index: 1;
  font-size: 1.06rem;
  letter-spacing: 0.01em;
}

#hudCombo[data-tier="2"] {
  color: #0f7a61;
}

#hudCombo[data-tier="3"] {
  color: #d76f16;
}

#hudCombo[data-tier="4"] {
  color: #b23d62;
}

.stage-chip-value {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  max-width: 100%;
  padding: 6px 10px;
  border-radius: 999px;
  font-size: 0.9rem;
  line-height: 1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.7);
}

.stage-chip-value::before {
  content: "";
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 18px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.72);
  font-size: 0.7rem;
  line-height: 1;
  flex: 0 0 auto;
}

#statusTalent[data-state="none"] {
  background: rgba(116, 102, 87, 0.12);
  color: var(--moyu-muted);
}

#statusTalent[data-state="none"]::before { content: "·"; }
#statusTalent[data-state="magnet"] {
  background: rgba(255, 201, 90, 0.26);
  color: #7a4d10;
}

#statusTalent[data-state="magnet"]::before { content: "◌"; }
#statusTalent[data-state="arsenal"] {
  background: rgba(167, 133, 255, 0.26);
  color: #5f3ab8;
}

#statusTalent[data-state="arsenal"]::before { content: "║"; }
#statusTalent[data-state="chaos"] {
  background: rgba(120, 212, 189, 0.3);
  color: #176c59;
}

#statusTalent[data-state="chaos"]::before { content: "✦"; }

#statusMode[data-mode="normal"] {
  background: rgba(116, 102, 87, 0.12);
  color: var(--moyu-muted);
}

#statusMode[data-mode="normal"]::before { content: "◦"; }
#statusMode[data-mode="laser"] {
  background: rgba(167, 133, 255, 0.26);
  color: #5f3ab8;
}

#statusMode[data-mode="laser"]::before { content: "║"; }
#statusMode[data-mode="fire"] {
  background: rgba(255, 159, 93, 0.26);
  color: #b35411;
}

#statusMode[data-mode="fire"]::before { content: "✹"; }
#statusMode[data-mode="pierce"] {
  background: rgba(79, 100, 131, 0.2);
  color: #304561;
}

#statusMode[data-mode="pierce"]::before { content: "◆"; }
#statusMode[data-mode="hybrid"] {
  background: linear-gradient(135deg, rgba(167, 133, 255, 0.26), rgba(255, 159, 93, 0.26));
  color: #6d4288;
}

#statusMode[data-mode="hybrid"]::before { content: "✦"; }

#statusBoss[data-state="idle"] {
  background: rgba(116, 102, 87, 0.12);
  color: var(--moyu-muted);
}

#statusBoss[data-state="idle"]::before { content: "○"; }
#statusBoss[data-state="active"] {
  background: rgba(238, 102, 117, 0.18);
  color: #ab2f4d;
}

#statusBoss[data-state="active"]::before { content: "!"; }
#statusBoss[data-state="clear"] {
  background: rgba(120, 212, 189, 0.24);
  color: #1f7d67;
}

#statusBoss[data-state="clear"]::before { content: "✓"; }

.battle-mark {
  position: absolute;
  top: 10px;
  right: 10px;
  width: 28px;
  height: 28px;
  font-size: 0.82rem;
  opacity: 0.94;
}

.score-card .battle-mark { color: #bf7b10; }
.lives-card .battle-mark { color: #cf5161; }
.level-card .battle-mark { color: #4d79d8; }
.combo-card .battle-mark { color: #2a9376; }

.canvas-wrap {
  position: relative;
  width: 100%;
  overflow: hidden;
  margin-top: 12px;
  border-radius: 28px;
  background:
    radial-gradient(circle at 50% 14%, rgba(119, 163, 255, 0.28), transparent 30%),
    linear-gradient(180deg, rgba(41, 73, 124, 0.98), rgba(14, 24, 44, 0.98));
  box-shadow:
    0 22px 48px rgba(14, 22, 40, 0.34),
    inset 0 0 0 1px rgba(255, 255, 255, 0.08);
}

.phaser-stage {
  width: 100%;
  min-height: min(74vh, 760px);
  aspect-ratio: 9 / 16;
  touch-action: none;
}

.phaser-stage canvas {
  display: block;
  width: 100%;
  height: auto;
}

.game-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background: rgba(8, 14, 28, 0.34);
  backdrop-filter: blur(4px);
  z-index: 5;
  opacity: 1;
  visibility: visible;
}

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

.stage-toast {
  position: absolute;
  left: 50%;
  top: 18px;
  transform: translateX(-50%) translateY(-10px);
  min-width: 180px;
  max-width: calc(100% - 28px);
  padding: 10px 16px;
  border-radius: 999px;
  background: rgba(255, 249, 241, 0.92);
  border: 1px solid rgba(255, 255, 255, 0.3);
  color: #5d3a1b;
  text-align: center;
  font-size: 0.9rem;
  font-weight: 800;
  letter-spacing: 0.02em;
  box-shadow:
    0 14px 30px rgba(8, 14, 28, 0.22),
    inset 0 1px 0 rgba(255, 255, 255, 0.8);
  backdrop-filter: blur(12px);
  opacity: 0;
  pointer-events: none;
  z-index: 6;
  transition:
    opacity 180ms ease,
    transform 180ms ease;
}

.stage-toast.visible {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

.stage-toast.hidden {
  display: none;
}

.stage-toast[data-tone="boss"],
.stage-toast[data-tone="boss-phase"] {
  background: rgba(255, 234, 221, 0.94);
  color: #7a241f;
}

.stage-toast[data-tone="debug"] {
  background: rgba(222, 238, 255, 0.94);
  color: #264a7b;
}

.game-overlay-card {
  width: 100%;
  max-width: 348px;
  padding: 24px 20px;
  border-radius: 28px;
  text-align: center;
  background: linear-gradient(180deg, rgba(255, 250, 244, 0.98), rgba(250, 242, 235, 0.96));
  box-shadow:
    0 24px 42px rgba(14, 22, 40, 0.18),
    inset 0 1px 0 rgba(255, 255, 255, 0.72);
}

.game-overlay-tag {
  margin: 0 0 8px;
  color: var(--moyu-accent-deep);
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.game-overlay-card h2 {
  margin: 0 0 10px;
  font-size: 1.8rem;
}

.game-overlay-card p {
  margin: 0 0 16px;
  color: var(--moyu-muted);
  line-height: 1.6;
}

.game-overlay-talent {
  display: grid;
  gap: 8px;
  margin: 0 0 16px;
}

.talent-choice {
  position: relative;
  padding: 14px 14px 14px 16px;
  border: 1px solid rgba(58, 42, 27, 0.12);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.88);
  text-align: left;
  font: inherit;
  font-weight: 700;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.72);
}

.talent-choice strong,
.talent-choice span {
  display: block;
}

.talent-choice strong {
  margin-bottom: 4px;
}

.talent-choice span {
  color: var(--moyu-muted);
  font-size: 0.78rem;
  font-weight: 600;
  line-height: 1.45;
}

.talent-choice.active {
  background: linear-gradient(135deg, rgba(255, 201, 90, 0.96), rgba(244, 124, 56, 0.92));
  color: #fff;
  border-color: transparent;
  box-shadow: 0 16px 24px rgba(207, 92, 34, 0.22);
}

.talent-choice.active span {
  color: rgba(255, 255, 255, 0.92);
}

.game-overlay-actions {
  display: grid;
  gap: 8px;
}

#actionButton {
  width: 100%;
  position: relative;
  overflow: hidden;
}

#dailyButton {
  width: 100%;
  border-radius: 18px;
  border-width: 1px;
}

#dailyButton[disabled] {
  opacity: 0.55;
}

.overlay-meta {
  margin-top: 12px;
  font-size: 0.8rem;
  font-weight: 700;
  color: #70563d;
}

#actionButton::before {
  content: "";
  position: absolute;
  inset: 1px;
  border-radius: inherit;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.18), rgba(255, 255, 255, 0));
  pointer-events: none;
}

.controls {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin-top: 12px;
}

.controls-dock {
  padding: 8px;
  border-radius: 24px;
  background: rgba(255, 255, 255, 0.9);
  border: 1px solid rgba(58, 42, 27, 0.1);
  backdrop-filter: blur(14px);
}

.debug-dock {
  margin-top: 10px;
}

.debug-toggle-button {
  width: 100%;
  min-height: 42px;
  border: 0;
  border-radius: 18px;
  background: linear-gradient(135deg, rgba(19, 34, 66, 0.94), rgba(45, 78, 137, 0.94));
  color: #fef7ef;
  font: inherit;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  box-shadow:
    0 14px 26px rgba(14, 22, 40, 0.2),
    inset 0 1px 0 rgba(255, 255, 255, 0.14);
}

.debug-panel {
  margin-top: 10px;
  padding: 14px;
  border-radius: 22px;
  background: linear-gradient(180deg, rgba(17, 28, 51, 0.96), rgba(11, 20, 37, 0.96));
  border: 1px solid rgba(158, 188, 255, 0.18);
  box-shadow:
    0 18px 34px rgba(8, 14, 28, 0.24),
    inset 0 1px 0 rgba(255, 255, 255, 0.08);
  color: #f5f0e7;
}

.debug-panel.hidden {
  display: none;
}

.debug-panel-head,
.debug-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.debug-panel-head strong {
  display: block;
  font-size: 1rem;
}

.debug-kicker,
.debug-hint {
  margin: 0;
  color: rgba(231, 238, 255, 0.72);
  font-size: 0.76rem;
}

.debug-level-jump {
  display: grid;
  gap: 6px;
  flex: 1 1 auto;
  font-size: 0.82rem;
  font-weight: 700;
}

.debug-level-jump input {
  min-height: 40px;
  padding: 0 12px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.08);
  color: #fffaf3;
  font: inherit;
}

.debug-grid,
.debug-token-grid {
  display: grid;
  gap: 8px;
  margin-top: 12px;
}

.debug-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.debug-token-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.debug-action,
.debug-token {
  min-height: 42px;
  border: 0;
  border-radius: 16px;
  font: inherit;
  font-weight: 700;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.18),
    0 10px 18px rgba(8, 14, 28, 0.18);
}

.debug-action {
  background: linear-gradient(135deg, rgba(255, 245, 228, 0.96), rgba(243, 228, 206, 0.94));
  color: #342416;
}

.debug-token {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 0 10px;
  color: #1d1410;
}

.debug-token span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.8);
  font-size: 0.88rem;
}

.debug-token strong {
  font-size: 0.8rem;
}

.debug-token.gold { background: linear-gradient(135deg, #ffd979, #ffbf3c); }
.debug-token.sky { background: linear-gradient(135deg, #9cd0ff, #6aaefb); }
.debug-token.mint { background: linear-gradient(135deg, #9be6d2, #63c9ad); }
.debug-token.red { background: linear-gradient(135deg, #f58c98, #e85667); color: #fff; }
.debug-token.violet { background: linear-gradient(135deg, #bda6ff, #9372f3); color: #fff; }
.debug-token.orange { background: linear-gradient(135deg, #ffbb79, #f78a2e); }
.debug-token.dark { background: linear-gradient(135deg, #5f738f, #34465d); color: #fff; }

.breakout-insight-grid {
  display: grid;
  gap: 14px;
}

.breakout-info-card .card-content {
  position: relative;
}

.breakout-info-card .card-content::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at top right, rgba(255, 201, 90, 0.18), transparent 30%),
    linear-gradient(135deg, rgba(255, 255, 255, 0.08), transparent 65%);
  pointer-events: none;
}

.breakout-info-card h2 {
  position: relative;
  z-index: 1;
  margin: 0 0 10px;
  font-size: 1.38rem;
}

.breakout-info-card p,
.compact-list {
  position: relative;
  z-index: 1;
}

.accent-card .card-content::before {
  background:
    radial-gradient(circle at top right, rgba(167, 133, 255, 0.16), transparent 30%),
    radial-gradient(circle at bottom left, rgba(121, 183, 255, 0.16), transparent 30%);
}

.token-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin-bottom: 14px;
}

.token-pill {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-height: 46px;
  padding: 0 14px 0 10px;
  border-radius: 18px;
  font-size: 0.84rem;
  font-weight: 700;
  border: 1px solid rgba(47, 36, 26, 0.08);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.52),
    0 10px 20px rgba(37, 30, 23, 0.08);
}

.token-glyph {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.82);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.88),
    0 6px 12px rgba(47, 36, 26, 0.12);
  font-size: 0.9rem;
  line-height: 1;
}

.token-text {
  line-height: 1;
}

.token-pill.gold { background: linear-gradient(135deg, #ffd979, #ffbf3c); }
.token-pill.sky { background: linear-gradient(135deg, #9cd0ff, #6aaefb); }
.token-pill.mint { background: linear-gradient(135deg, #9be6d2, #63c9ad); }
.token-pill.red { background: linear-gradient(135deg, #f58c98, #e85667); color: #fff; }
.token-pill.violet { background: linear-gradient(135deg, #bda6ff, #9372f3); color: #fff; }
.token-pill.orange { background: linear-gradient(135deg, #ffbb79, #f78a2e); }
.token-pill.dark { background: linear-gradient(135deg, #5f738f, #34465d); color: #fff; }

.token-pill.red .token-glyph,
.token-pill.violet .token-glyph,
.token-pill.dark .token-glyph {
  color: #20150f;
}

.pill-icon {
  gap: 8px;
  min-width: 72px;
  padding: 4px 10px 4px 6px;
}

.pill-icon .token-glyph {
  width: 22px;
  height: 22px;
  font-size: 0.78rem;
}

.leaderboard-card .card-content {
  background:
    radial-gradient(circle at top right, rgba(255, 201, 90, 0.14), transparent 34%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.08), rgba(255, 255, 255, 0));
}

.meta-card .card-content {
  background:
    radial-gradient(circle at top right, rgba(120, 212, 189, 0.14), transparent 34%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.08), rgba(255, 255, 255, 0));
}

#unlockList {
  margin-bottom: 12px;
}

#unlockList li {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
}

#unlockList li.pending {
  opacity: 0.66;
}

#unlockList strong {
  flex: 0 0 auto;
  font-size: 0.8rem;
  color: #6b4b2b;
}

.controls .touch-button {
  position: relative;
  overflow: hidden;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.78),
    0 10px 18px rgba(32, 24, 18, 0.08);
}

.controls .touch-button::before {
  content: "";
  position: absolute;
  inset: 1px;
  border-radius: inherit;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.28), rgba(255, 255, 255, 0));
  pointer-events: none;
}

.controls .touch-button:active {
  transform: translateY(1px) scale(0.99);
}

.compact-list {
  margin-top: 12px;
}

@media (min-width: 768px) {
  .breakout-insight-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 560px) {
  .stage-topbar,
  .mobile-hud-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .stage-chip {
    gap: 10px;
  }

  .stage-chip-mark {
    width: 30px;
    height: 30px;
  }

  .stage-chip-value {
    font-size: 0.84rem;
  }

  .token-grid {
    grid-template-columns: 1fr;
  }

  .debug-grid,
  .debug-token-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .debug-row {
    flex-direction: column;
    align-items: stretch;
  }

  .stage-toast {
    top: 14px;
    min-width: 156px;
    font-size: 0.84rem;
  }

  .phaser-stage {
    min-height: 540px;
  }
}

@media (max-width: 430px) {
  .breakout-page-content {
    gap: 12px;
  }

  .breakout-stage-card {
    padding: 10px;
    border-radius: 26px;
  }

  .stage-topbar,
  .mobile-hud-grid {
    gap: 8px;
  }

  .stage-chip,
  .battle-card {
    min-height: 60px;
    padding: 10px 11px;
    border-radius: 16px;
  }

  .stage-chip-mark,
  .battle-mark {
    width: 28px;
    height: 28px;
  }

  .canvas-wrap {
    margin-top: 10px;
    border-radius: 22px;
  }

  .phaser-stage {
    min-height: min(62vh, 620px);
  }
}
