/**
 * APP: MARSHAL DRAGONFLY (Horizontal Bullet-Hell Shmup)
 * PREFIX: md-
 * PALETTE: Pale frogpond greens (#eef7ee, #d8ecd5), deep marsh greens (#0f2d18, #1a4d2e),
 *          and hyper-visible neon spore accents (#22ff77, #39ff14, #ff4081).
 */

.md-root {
  position: relative;
  width: 100%;
  height: 100%;
  min-height: 480px;
  background-color: #0b1a10;
  color: #eef7ee;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  overflow: hidden;
  user-select: none;
  -webkit-user-select: none;
  touch-action: none;
  box-sizing: border-box;
}

.md-root *,
.md-root *::before,
.md-root *::after {
  box-sizing: inherit;
}

/* Flash effect on hull breach */
.md-root.md-hit-flash {
  animation: md-flash-anim 0.16s ease-out;
}

@keyframes md-flash-anim {
  0% { filter: brightness(2.2) drop-shadow(0 0 16px #ff1744); }
  100% { filter: none; }
}

.md-stage {
  display: block;
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 1;
}

.md-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 10;
  pointer-events: none;
}

/* Modals & Screens */
.md-modal {
  pointer-events: auto;
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 90%;
  max-width: 370px;
  background: #eef7ee;
  color: #0f2d18;
  border: 2px solid #22ff77;
  border-radius: 12px;
  padding: 20px;
  box-shadow: 0 12px 36px rgba(0, 0, 0, 0.65), 0 0 16px rgba(34, 255, 119, 0.2);
  display: flex;
  flex-direction: column;
  gap: 12px;
  text-align: center;
}

.md-brand-title {
  margin-bottom: 4px;
}

.md-badge {
  display: inline-block;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  color: #0f2d18;
  background: #22ff77;
  padding: 2px 8px;
  border-radius: 999px;
  margin-bottom: 6px;
}

.md-title {
  margin: 0;
  font-size: 20px;
  font-weight: 900;
  color: #0f2d18;
  letter-spacing: 0.5px;
}

.md-subtitle {
  margin: 2px 0 0 0;
  font-size: 11px;
  font-weight: 600;
  color: #2e603b;
  text-transform: uppercase;
}

/* Sector Row */
.md-sector-row {
  display: flex;
  gap: 8px;
  justify-content: space-between;
}

.md-sec-btn {
  flex: 1;
  background: #d8ecd5;
  border: 1px solid #1a4d2e;
  border-radius: 8px;
  padding: 10px 4px;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  transition: transform 0.1s ease, background 0.15s ease;
}

.md-sec-btn:active {
  transform: scale(0.97);
}

.md-sec-btn.is-unlocked {
  border-color: #22ff77;
  background: #e1f5dd;
}

.md-sec-btn.is-locked {
  opacity: 0.45;
  cursor: not-allowed;
  border-color: #9cb59c;
}

.md-sec-num {
  font-size: 12px;
  font-weight: 800;
  color: #0f2d18;
}

.md-sec-stat {
  font-size: 10px;
  font-weight: 600;
  color: #2e603b;
}

/* Info Bar */
.md-info-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: #d8ecd5;
  padding: 8px 12px;
  border-radius: 8px;
  font-size: 12px;
  color: #0f2d18;
}

.md-howto-text {
  margin: 0;
  font-size: 11px;
  color: #2e603b;
  line-height: 1.35;
}

/* Buttons */
.md-btn {
  appearance: none;
  border: none;
  font-family: inherit;
  font-size: 12px;
  font-weight: 800;
  border-radius: 6px;
  padding: 8px 12px;
  cursor: pointer;
  transition: opacity 0.15s ease, transform 0.1s ease;
}

.md-btn:active {
  transform: scale(0.96);
}

.md-btn-accent {
  background: #22ff77;
  color: #0f2d18;
}

.md-btn-secondary {
  background: #1a4d2e;
  color: #eef7ee;
}

.md-btn-sm {
  padding: 5px 8px;
  font-size: 11px;
}

.md-btn.is-disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.md-btn-row {
  display: flex;
  gap: 8px;
  margin-top: 6px;
}

.md-btn-row > .md-btn {
  flex: 1;
}

.md-mt-12 {
  margin-top: 12px;
}

/* Hangar Modal */
.md-hangar-card {
  max-width: 380px;
  max-height: 92%;
  overflow-y: auto;
  text-align: left;
}

.md-hangar-header h2 {
  margin: 0;
  font-size: 16px;
  color: #0f2d18;
}

.md-hangar-header p {
  margin: 2px 0 6px 0;
  font-size: 11px;
  color: #2e603b;
}

.md-nectar-stash {
  font-size: 12px;
  background: #d8ecd5;
  padding: 6px 8px;
  border-radius: 6px;
  color: #0f2d18;
}

.md-upg-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 8px;
}

.md-upg-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: #f7fbf6;
  border: 1px solid #c2dec0;
  border-radius: 8px;
  padding: 6px 8px;
}

.md-upg-meta {
  display: flex;
  flex-direction: column;
  font-size: 12px;
  color: #0f2d18;
}

.md-upg-meta span {
  font-size: 10px;
  color: #4b7a58;
}

/* HUD System */
.md-hud {
  pointer-events: none;
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 10px;
}

.md-hud-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: rgba(11, 26, 16, 0.85);
  border: 1px solid rgba(34, 255, 119, 0.35);
  padding: 6px 10px;
  border-radius: 8px;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.5px;
  color: #eef7ee;
}

.md-hud-hp-box {
  display: flex;
  align-items: center;
  gap: 6px;
}

.md-hud-label {
  color: #a3ff47;
}

.md-hp-pips {
  display: flex;
  gap: 4px;
}

.md-hp-pip {
  display: inline-block;
  width: 12px;
  height: 10px;
  background: #1f4228;
  border: 1px solid #336940;
  border-radius: 2px;
}

.md-hp-pip.is-active {
  background: #22ff77;
  border-color: #39ff14;
  box-shadow: 0 0 6px #22ff77;
}

.md-hud-score {
  color: #eef7ee;
}

.md-hud-time {
  color: #ffeedd;
}

.md-hud-bottom {
  display: flex;
  justify-content: center;
  pointer-events: auto;
  padding-bottom: 4px;
}

/* Pond Bomb UI Button & Meter */
.md-bomb-wrapper {
  display: flex;
  flex-direction: column;
  gap: 4px;
  width: 65%;
  max-width: 240px;
}

.md-bomb-fill-track {
  width: 100%;
  height: 5px;
  background: rgba(15, 45, 24, 0.7);
  border: 1px solid rgba(34, 255, 119, 0.4);
  border-radius: 999px;
  overflow: hidden;
}

.md-bomb-bar {
  width: 0%;
  height: 100%;
  background: #22ff77;
  box-shadow: 0 0 6px #22ff77;
  transition: width 0.2s ease;
}

.md-bomb-btn {
  appearance: none;
  background: #0f2d18;
  border: 1.5px solid #22ff77;
  color: #a3ff47;
  font-family: inherit;
  font-size: 11px;
  font-weight: 800;
  padding: 8px 10px;
  border-radius: 8px;
  cursor: pointer;
  letter-spacing: 0.6px;
  transition: background 0.15s ease, transform 0.1s ease;
}

.md-bomb-btn:active {
  transform: scale(0.97);
}

.md-bomb-btn.is-ready {
  background: #22ff77;
  color: #0f2d18;
  box-shadow: 0 0 14px rgba(34, 255, 119, 0.6);
  animation: md-bomb-pulse 1.2s infinite alternate;
}

@keyframes md-bomb-pulse {
  0% { transform: scale(1); }
  100% { transform: scale(1.03); }
}

/* Dialog Recap */
.md-dialog-card h2 {
  margin: 0;
  font-size: 17px;
  color: #0f2d18;
}

.md-danger-text {
  margin: 0;
  font-size: 12px;
  color: #d32f2f;
  font-weight: 600;
}

.md-lead-text {
  margin: 0;
  font-size: 12px;
  color: #2e603b;
}

.md-score-recap {
  background: #d8ecd5;
  border-radius: 8px;
  padding: 10px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 12px;
  color: #0f2d18;
  text-align: left;
}
