/* ============================================
   МОДАЛКА ДОБАВЛЕНИЯ КАРТЫ (library-osu.html)
   Отдельный файл — не раздувает общий style.css.
   ============================================ */

.modal-content--wide {
  max-width: 640px;
}

.tb-notice {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  margin-bottom: 16px;
  background: rgba(210, 153, 34, 0.1);
  border: 1px solid rgba(210, 153, 34, 0.35);
  border-radius: var(--radius);
  color: var(--accent-gold);
  font-size: 13px;
}

/* ---------- Вкладки ---------- */
.tb-tabs {
  display: flex;
  gap: 6px;
  margin-bottom: 14px;
  border-bottom: 1px solid var(--border-color);
}
.tb-tab {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 12px;
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  color: var(--text-muted);
  font-family: var(--font-sans);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: color 0.15s, border-color 0.15s;
}
.tb-tab:hover { color: var(--text-primary); }
.tb-tab.is-active { color: var(--accent-blue); border-bottom-color: var(--accent-blue); }

.tb-input {
  width: 100%;
  padding: 8px 12px;
  background: var(--bg-inset);
  border: 1px solid var(--border-color);
  border-radius: var(--radius);
  color: var(--text-primary);
  font-family: var(--font-sans);
  font-size: 14px;
  outline: none;
  transition: border-color 0.15s, box-shadow 0.15s;
  margin: 0;
}
.tb-input:focus {
  border-color: var(--accent-blue-emphasis);
  box-shadow: 0 0 0 3px rgba(31, 111, 235, 0.25);
}

.tb-link-row { display: flex; gap: 8px; }
.tb-link-row .tb-input { flex: 1; }

.tb-field-hint { margin-top: 6px; font-size: 12px; color: var(--text-muted); }
.tb-error {
  margin-top: 8px;
  padding: 8px 12px;
  background: rgba(248, 81, 73, 0.1);
  border: 1px solid rgba(248, 81, 73, 0.35);
  border-radius: var(--radius);
  color: var(--accent-red);
  font-size: 13px;
}

/* ---------- Результаты поиска: плоский список конкретных карт ---------- */
.tb-results {
  margin-top: 10px;
  max-height: 260px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.tb-results-loading,
.tb-results-empty {
  padding: 14px;
  text-align: center;
  color: var(--text-muted);
  font-size: 13px;
}
.tb-result {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 7px;
  background: var(--bg-inset);
  border: 1px solid var(--border-color);
  border-radius: var(--radius);
  cursor: pointer;
  text-align: left;
  transition: border-color 0.15s, background-color 0.15s;
}
.tb-result:hover { border-color: var(--accent-blue-emphasis); background: var(--bg-neutral); }
.tb-result img {
  width: 40px;
  height: 40px;
  border-radius: 4px;
  object-fit: cover;
  flex-shrink: 0;
  background: var(--bg-neutral);
}
.tb-result-info { min-width: 0; flex: 1; }
.tb-result-title {
  color: var(--text-bright);
  font-size: 13px;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.tb-result-artist {
  color: var(--text-muted);
  font-size: 12px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.tb-result-stars {
  flex-shrink: 0;
  color: var(--accent-gold);
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
}

/* ---------- Выбранная карта: компактная плашка над формой ---------- */
.tb-picked {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 14px 0;
  padding: 10px;
  background: var(--bg-inset);
  border: 1px solid var(--border-color);
  border-radius: var(--radius);
}
.tb-picked img {
  width: 52px;
  height: 52px;
  border-radius: 4px;
  object-fit: cover;
  flex-shrink: 0;
}
.tb-picked-title { color: var(--text-bright); font-size: 14px; font-weight: 600; }
.tb-picked-artist { color: var(--text-muted); font-size: 12px; margin: 2px 0; }
.tb-picked-stats { color: var(--accent-gold); font-size: 12px; font-weight: 600; }

/* ---------- Форма ---------- */
.tb-form { display: flex; flex-direction: column; gap: 12px; margin-top: 6px; }
.tb-label {
  display: block;
  color: var(--text-secondary);
  font-size: 13px;
  font-weight: 600;
}
.tb-label .tb-input { margin-top: 6px; font-weight: 400; }
.tb-form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}
.tb-required {
  display: inline-block;
  margin-left: 6px;
  padding: 1px 7px;
  background: rgba(248, 81, 73, 0.15);
  border: 1px solid rgba(248, 81, 73, 0.4);
  border-radius: 100px;
  color: var(--accent-red);
  font-size: 11px;
  font-weight: 600;
  vertical-align: middle;
}
.tb-optional {
  display: inline-block;
  margin-left: 6px;
  padding: 1px 7px;
  background: var(--bg-neutral);
  border: 1px solid var(--border-color);
  border-radius: 100px;
  color: var(--text-muted);
  font-size: 11px;
  font-weight: 600;
  vertical-align: middle;
}

.tb-modes {
  display: flex;
  gap: 16px;
  margin-top: 8px;
  font-weight: 400;
  color: var(--text-primary);
}
.tb-modes label { display: flex; align-items: center; gap: 6px; cursor: pointer; }
.tb-modes input { width: auto; margin: 0; }

.tb-sep {
  border: none;
  border-top: 1px solid var(--border-color);
  margin: 2px 0;
}

.tb-submit { width: 100%; margin-top: 4px; }

@media (max-width: 560px) {
  .tb-form-row { grid-template-columns: 1fr; }
}
