/* Frame-specific active trait control. Passive frames intentionally hide it. */
#game-screen.rem-battle--phase4 .breach-drive-btn {
  position: absolute;
  z-index: 24;
  left: 11px;
  bottom: calc(112px + env(safe-area-inset-bottom));
  width: 72px;
  height: 72px;
  padding: 0;
  border: 2px solid rgba(128, 175, 214, .72);
  border-radius: 50%;
  color: #a9c8d7;
  background: linear-gradient(145deg, rgba(36, 50, 87, .98), rgba(7, 12, 29, .99));
  box-shadow: 0 0 0 4px rgba(2, 8, 18, .7), inset 0 0 0 2px rgba(160, 224, 255, .07);
  font: 900 10px/1 var(--fac-display, monospace);
  letter-spacing: .06em;
  white-space: pre-line;
  pointer-events: auto;
  transition: transform .12s ease, border-color .16s ease, box-shadow .16s ease, color .16s ease;
}

#game-screen.rem-battle--phase4 .breach-drive-btn.hidden { display: none !important; }
#game-screen.rem-battle--phase4 .breach-drive-btn::before {
  content: "TRAIT";
  position: absolute;
  top: 10px;
  left: 0;
  right: 0;
  color: rgba(179, 226, 246, .68);
  font-size: 6px;
  letter-spacing: .18em;
}
#game-screen.rem-battle--phase4 .breach-drive-btn:disabled { opacity: 1; }
#game-screen.rem-battle--phase4 .breach-drive-btn.ready {
  border-color: #ffb2db;
  color: #fff7fd;
  background: linear-gradient(145deg, #71345e, #26366f 62%, #152343);
  box-shadow: 0 0 0 4px rgba(2, 8, 18, .68), 0 0 18px rgba(255, 137, 202, .5), inset 0 0 18px rgba(185, 236, 255, .18);
  animation: frame-trait-ready-pulse 1.15s ease-in-out infinite;
}
#game-screen.rem-battle--phase4 .breach-drive-btn.active {
  border-color: #f9e4ff;
  color: #ffffff;
  background: linear-gradient(145deg, #85406c, #24637a 65%, #19204e);
  box-shadow: 0 0 0 4px rgba(2, 8, 18, .68), 0 0 25px rgba(255, 161, 215, .7), inset 0 0 20px rgba(218, 255, 249, .28);
}
#game-screen.rem-battle--phase4 .breach-drive-btn:active:not(:disabled) { transform: scale(.93); }
#game-screen.rem-battle--phase4.frame-trait-active .dust-fill { background: linear-gradient(90deg, #ff9dcc, #ffd36e, #88f4c4) !important; }
#game-screen.rem-battle--phase4 .hud-bottom.hud-dust-charged .dust-gauge { border-color: #ffb8dc !important; box-shadow: 0 0 12px rgba(255, 137, 201, .35); }

@keyframes frame-trait-ready-pulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.045); }
}

@media (max-width: 430px) {
  #game-screen.rem-battle--phase4 .breach-drive-btn { width: 64px; height: 64px; bottom: calc(118px + env(safe-area-inset-bottom)); font-size: 9px; }
}
@media (orientation: landscape) and (max-height: 560px) {
  #game-screen.rem-battle--phase4 .breach-drive-btn { left: 10px; bottom: calc(16px + env(safe-area-inset-bottom)); width: 58px; height: 58px; }
}
@media (prefers-reduced-motion: reduce) {
  #game-screen.rem-battle--phase4 .breach-drive-btn.ready { animation: none; }
}
