/* ===== OTA PAGE STYLES ===== */
*,
*::before,
*::after {
  box-sizing: border-box;
}

.ota-container {
  max-width: 980px;
  margin: 40px auto;
  padding: 24px;
  background: #111827;
  border-radius: 16px;
  color: #e6eef8;
  box-shadow: 0 0 15px rgba(0,0,0,0.25);
}

/* Header mit kleinem Donate rechts */
.ota-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
  gap: 10px;
}
.ota-header-left {
  display: flex;
  align-items: center;
  gap: 12px;
}
.ota-sub { color:#9fb0c2; margin:0; }
.ota-header h2 { margin:0; }

/* kleiner, dezenter Donate-Button */
.mini-dono {
  background: #00e29b;
  color: #042;
  font-weight: 800;
  font-size: 0.85rem;
  padding: 4px 12px;
  border-radius: 999px;
  text-decoration: none;
  transition: background 0.2s ease, transform 0.15s ease;
  line-height: 1.2;
  display: inline-flex;
  align-items: center;
  height: 32px;
}
.mini-dono:hover {
  background: #08f3aa;
  transform: translateY(-1px);
}

/* Einheitliche Höhe und zentrierte Elemente */
select, button {
  height: 42px;
  line-height: 42px;
  padding: 0 16px;
  border-radius: 999px;
  border: none;
  outline: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.row, .ota-row {
  display: flex;
  align-items: flex-end; /* statt center -> untere Kante bündig */
  gap: 12px;
  flex-wrap: wrap;
}

/* Inline-Override, falls das HTML noch align-self:flex-end hat */
.ota-row > div[style*="align-self:flex-end"] {
  align-self: auto !important;
}

/* === Grundkomponenten === */
.ota-select,
.ota-button {
  padding: 10px 14px;
  border-radius: 999px;
  border: 0;
  font-weight: 700;
  cursor: pointer;
  transition: 0.15s ease;
}

.ota-select {
  background: #0f172a;
  color: #e6eef8;
  border: 1px solid #24314a;
  min-width: 200px;
}

.ota-button {
  background: #ff6f61;
  color: #071129;
}
.ota-button:hover {
  background: #ff867a;
}

/* === Chips & Result === */
.ota-chip {
  display: inline-block;
  padding: 4px 8px;
  border-radius: 999px;
  background: #24314a;
  color: #9fb0c2;
  font-size: 0.8rem;
  margin-right: 5px;
}

.ota-result {
  margin-top: 18px;
  padding: 14px;
  background: #0b1220;
  border-radius: 12px;
}

.ota-error {
  color: #ff7777;
}

/* === Buttons === */
.ota-btn,
.ota-button,
button,
button#resetButton {
  height: 42px;
  line-height: 42px;
  padding: 0 16px;
  border-radius: 999px;
  border: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  cursor: pointer;
  transition: 0.15s ease;
}

/* Haupt-Download-Button */
.ota-btn {
  background: #00e29b;
  color: #042;
  text-decoration: none;
  font-weight: 800;
  border: 1px solid transparent; /* gleicht Ghost-Borderhöhe aus */
}
.ota-btn:hover {
  background: #08f3aa;
}

/* Reset-Button */
.ota-btn.ghost,
button#resetButton {
  background: #24314a;
  color: #e6eef8;
  border: 1px solid #2a3a56;
}
.ota-btn.ghost:hover,
button#resetButton:hover {
  background: #2b354a;
}

/* Disabled-Button */
.ota-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* === Zusatzkomponenten === */
.ota-badge {
  display: inline-block;
  margin-left: 8px;
  padding: 3px 8px;
  border-radius: 999px;
  background: #24314a;
  color: #9fb0c2;
  font-size: 0.8rem;
}

/* === Timer Info (Ablaufzeit) === */
.ota-timer {
  font-size: 1rem;
  font-weight: 700;
  color: #9fb0c2;
  margin-top: 12px;
  background: rgba(36, 49, 74, 0.35);
  padding: 8px 14px;
  border-radius: 10px;
  display: inline-block;
}

.ota-actions {
  display: flex;
  gap: 12px;
  margin-top: 14px;
  flex-wrap: wrap;
}

/* === OTA manual-only help === */
.ota-help {
  margin-top: 14px;
  color: #c8d3e1;
  display: grid;
  gap: 14px;
}
.ota-help h4 {
  margin: 0 0 4px 0;
  color: #e6eef8;
}
.ota-help ol {
  margin: 6px 0 0 18px;
}
.ota-code {
  margin-top: 6px;
  padding: 10px 12px;
  padding-right: 60px; /* Platz für Copy-Button */
  background: #0a1322;
  border: 1px solid #1e2b44;
  border-radius: 10px;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: .9rem;
  white-space: pre-wrap;
  word-break: break-all;
  color: #d7e2f0;
  position: relative;
}
.ota-mini-btn {
  position: absolute;
  top: 45%; /* leicht über Mitte für optisches Gleichgewicht */
  right: 8px;
  transform: translateY(-50%);
  padding: 4px 10px;
  border: 0;
  border-radius: 8px;
  background: #24314a;
  color: #e6eef8;
  font-weight: 700;
  cursor: pointer;
  line-height: 1;
}
.ota-note {
  font-size: .86rem;
  color: #9fb0c2;
  margin-top: 8px;
}

/* === Alert Banner === */
.ota-alert {
  margin-top: 14px;
  padding: 12px 14px;
  border-radius: 12px;
  font-weight: 800;
  font-size: 0.98rem;
  line-height: 1.3;
  border: 1px solid transparent;
}

.ota-alert-danger {
  background: #2a0d0d;
  color: #ffb3b3;
  border-color: #7a1f1f;
}

/* Abstand zwischen Alert und Help */
.ota-alert + .ota-help {
  margin-top: 16px;
}

/* ===== Mobile Optimierungen (clean) ===== */

/* Fix: verhindert Breiten-Sprung beim Ergebnis */
.ota-container {
  width: min(92vw, 980px); /* max gleich wie vorher */
  min-width: 300px;        /* bleibt leicht stabil beim Laden */
  transition: width 0.25s ease; /* smooth Übergang */
}

/* Tablet und kleiner */
@media (max-width: 900px) {
  .ota-container {
    margin: 16px auto;
    padding: 16px;
    border-radius: 14px;
  }

  .ota-header {
    flex-direction: column;
    align-items: stretch;
    gap: 8px;
  }
  .ota-header-left {
    flex-direction: column;
    align-items: flex-start;
    gap: 4px;
  }
  .mini-dono {
    align-self: flex-start;
    height: 36px;
    padding: 6px 14px;
    font-size: 0.9rem;
  }

  /* Form stapeln & Full-Width */
  .ota-row {
    flex-direction: column;
    align-items: stretch;
    gap: 10px;
  }
  .ota-row > div {
    width: 100%;
    min-width: 0; /* verhindert Überlauf */
  }

  .ota-select,
  .ota-btn,
  .ota-button,
  button,
  button#resetButton {
    width: 100%;
    min-width: 0;
    height: 48px;
    line-height: 48px;
    padding: 0 14px;
    border-radius: 12px;
  }

  /* Resultbox sauber stapeln */
  #resultBox {
    display: grid;
    gap: 12px;
    min-width: 0;
  }
  #resultBox * {
    min-width: 0;
    max-width: 100%;
  }

  /* Chips umbrechen */
  #resultBox > div:first-child {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
  }
  .ota-chip {
    margin-right: 0;
    overflow-wrap: anywhere;
  }

  /* Actions vertikal + vollbreit */
  .ota-actions {
    flex-direction: column;
    align-items: stretch;
    gap: 10px;
  }

  /* Timer/Alert schön umbrochen */
  .ota-timer,
  .ota-alert {
    width: 100%;
    overflow-wrap: anywhere;
    white-space: normal;
  }

  /* Copy/Code: kompakt, EINZEILIG scrollend, Button oben rechts */
  .ota-code {
    position: relative;
    padding: 10px 48px 10px 12px;  /* Platz rechts für Button */
    white-space: normal;           /* Container selbst bricht nicht komisch */
    overflow: hidden;              /* Scroll nur im Span */
  }
  .ota-code > span {
    display: block;
    white-space: nowrap;           /* EINZEILIG */
    overflow-x: auto;
    overflow-y: hidden;
    -webkit-overflow-scrolling: touch;
  }
  .ota-mini-btn {
    position: absolute;
    top: 8px;
    right: 8px;
    transform: none;
    padding: 6px 10px;
    border-radius: 8px;
    height: auto;                  /* nicht auf 42/48px aufblasen */
    line-height: 1;
  }
}

/* Phone-optimiert */
@media (max-width: 640px) {
  .ota-container { padding: 14px; }
  label { display:block; margin-bottom:6px; font-size:0.95rem; }

  .ota-btn,
  .ota-button,
  button,
  button#resetButton {
    font-size: 1rem;
    font-weight: 800;
  }
}
