.v5-hide-beat-button {
  position: fixed;
  z-index: 12000;
  border: 1px solid #ff9d28;
  border-radius: 50%;
  background:
    linear-gradient(
      #281307,
      #090503
    );
  color: #ff9d28;
  cursor: pointer;
  display: grid;
  place-items: center;
  font-size: 20px;
  line-height: 1;
  box-shadow:
    0 0 0 2px #000,
    0 0 12px rgba(255,157,40,.5);
}

.v5-hide-beat-button:hover {
  filter: brightness(1.3);
}

.v5-crate-tools {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin: 8px 0 12px;
}

.v5-crate-tools button,
.v5-restore-button,
.v5-metro-actions button,
.v5-metro-tempo button {
  min-height: 38px;
  border: 1px solid #26d94c;
  border-radius: 6px;
  background: #031108;
  color: #50ff70;
  font: inherit;
  cursor: pointer;
}

.v5-crate-tools button:hover,
.v5-restore-button:hover,
.v5-metro-actions button:hover,
.v5-metro-tempo button:hover {
  background: #092315;
}

.v5-modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 100000 !important;
  display: grid;
  place-items: center;
  padding: 20px;
  background: rgba(0,0,0,.76);
  backdrop-filter: blur(7px);
}

.v5-modal-overlay[hidden] {
  display: none !important;
}

.v5-modal {
  width: min(620px,94vw);
  max-height: 80vh;
  overflow: auto;
  border: 1px solid #2ce957;
  border-radius: 14px;
  background: #020b05;
  color: #55ff75;
  box-shadow:
    0 0 40px rgba(25,255,70,.18);
}

.v5-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 18px;
  border-bottom:
    1px solid rgba(60,255,95,.25);
}

.v5-modal-close {
  width: 38px;
  height: 38px;
  border: 1px solid #39ef60;
  border-radius: 50%;
  background: #06130a;
  color: #51ff73;
  cursor: pointer;
  font-size: 24px;
}

.v5-modal-body {
  padding: 18px;
}

.v5-hidden-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 14px;
  align-items: center;
  padding: 10px 0;
  border-bottom:
    1px solid rgba(50,255,90,.12);
}

.v5-empty {
  opacity: .72;
}

.v5-metro-copy {
  margin-top: 0;
}

.v5-metro-tempo {
  display: grid;
  grid-template-columns: 60px 1fr 60px;
  gap: 12px;
  align-items: center;
  margin: 20px 0;
}

.v5-metro-value {
  text-align: center;
  font-size: 28px;
}

.v5-metro-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.v5-metro-badge {
  position: fixed;
  z-index: 11000;
  color: #44ff66;
  text-align: center;
  font-family: monospace;
  font-weight: 700;
  pointer-events: none;
  text-shadow:
    0 0 5px #18ff46;
}

.v5-brainstorm-button-logo {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
  box-sizing: border-box;
  padding: 3px;
  pointer-events: none;
}

.v5-help-addendum {
  margin-top: 18px;
  padding-top: 14px;
  border-top:
    1px solid rgba(70,255,100,.25);
}

/* V5 fallback position.
   JS can override this when it locates the machine geometry. */
.v5-hide-beat-button {
  right: 28px;
  top: 55%;
  left: auto;
}

/* Friendly two-step Hide Beat action; never hide on first tap. */
.v5-hide-options {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 20px;
  padding: 14px;
  margin: 16px 0;
  border: 1px solid rgba(80,255,110,.35);
  border-radius: 8px;
}
.v5-hide-options legend { padding: 0 6px; font-weight: 800; }
.v5-hide-options label { display: flex; align-items: center; gap: 7px; cursor: pointer; }
.v5-hide-options input { accent-color: #57ff73; }
.v5-hide-actions {
  display: grid;
  grid-template-columns: repeat(2,minmax(0,1fr));
  gap: 10px;
}
.v5-hide-actions button {
  padding: 12px 8px;
  min-height: 44px;
  border: 1px solid #4bef71;
  border-radius: 8px;
  background: #071c0d;
  color: #79ff8f;
  font: inherit;
  font-weight: 700;
  font-size: 14px;
  line-height: 1.3;
  cursor: pointer;
}
.v5-hide-actions button[data-hide-yes] { background: #3b170b; border-color: #fa8a5a; color: #fff; }
.v5-hide-actions button[data-hide-no] { background: #0d4d23; color: #fff; }
.v5-hide-actions button[data-hide-restore] { grid-column: 1 / -1; }
.v5-hide-actions button:hover, .v5-hide-actions button:focus-visible {
  filter: brightness(1.25);
  outline: 2px solid #afffbe;
  outline-offset: 1px;
}
.v5-hide-error { color: #ffc28f; min-height: 1.4em; }
@media (max-width: 450px) {
  .v5-hide-actions { grid-template-columns: 1fr; }
  .v5-hide-actions button[data-hide-restore] { grid-column: auto; }
}

/* Crates Hide / Restore lives immediately beside the Favorite heart. */
.crate-result {
  grid-template-columns: minmax(0,1fr) minmax(42px,9%) minmax(42px,9%);
}
.crate-hide-beat {
  display: grid;
  place-items: center;
  width: 100%;
  min-height: 44px;
  padding: 4px;
  border: 1px solid rgba(255,194,110,.6);
  border-radius: 7px;
  background: #26150a;
  color: #ffce93;
  font-size: clamp(16px,1.25vw,24px);
  cursor: pointer;
}
.crate-hide-beat.is-hidden {
  border-color: #58df79;
  background: #0a2c16;
  color: #9bffb1;
}
.crate-hide-beat:hover, .crate-hide-beat:focus-visible {
  filter: brightness(1.35);
  outline: 2px solid white;
  outline-offset: 1px;
}
.v5-hide-options[hidden] { display: none; }
