/* =========================================================
   Tournament Site — Team Pages Stylesheet
   Shared by View Team (team.html) and Edit Team Information
   (edit-team.html). Loaded AFTER styles.css, home.css, profile.css
   (and edit-profile.css on the edit page) so it inherits shared
   tokens and the .team-panel__head / .team-logo / .team-members
   components already defined in profile.css.
   ========================================================= */

/* ---------- View Team page ---------- */

.team-view-main {
  max-width: 560px;
  margin: 0 auto;
  padding: 32px 24px 64px;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.team-view-card {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius-clip);
  padding: 28px;
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.team-logo--lg {
  width: 64px;
  height: 64px;
  font-size: 20px;
}

.team-view-name {
  font-family: var(--font-display);
  font-size: 22px;
  font-weight: 700;
  margin: 0 0 4px;
}

.team-view-edit {
  width: 100%;
}

/* ---------- Edit Team Information page ---------- */

.team-edit-note {
  margin: 0;
  padding: 12px 14px;
  font-size: 12.5px;
  line-height: 1.5;
  color: var(--text-muted);
  background: var(--panel-raised);
  border: 1px solid var(--border);
  border-radius: var(--radius-clip);
}

.team-edit-section-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin: 0 0 18px;
}

.team-edit-section-head h2 {
  margin: 0;
}

.team-edit-count {
  font-size: 12px;
  color: var(--text-muted);
  white-space: nowrap;
}

.team-edit-list {
  list-style: none;
  margin: 0 0 16px;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.team-edit-row {
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--panel-raised);
  border: 1px solid var(--border);
  border-radius: var(--radius-clip);
  padding: 10px 12px;
  font-size: 13px;
}

.team-edit-row--empty {
  color: var(--text-muted);
  justify-content: center;
  font-size: 12px;
}

.team-edit-row__name {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* Editable name for other squad players (same look as UID field) */
.team-edit-row__name-input {
  flex: 1;
  min-width: 0;
  background: transparent;
  border: none;
  border-bottom: 1px solid var(--border);
  color: var(--text-primary);
  font-family: var(--font-body);
  font-size: 13px;
  font-weight: 500;
  padding: 4px 2px;
  outline: none;
  transition: border-color 0.15s ease;
}

.team-edit-row__name-input:focus {
  border-bottom-color: var(--cyan);
}

.team-edit-row__name-input::placeholder {
  color: #4B5162;
}

/* Own row: keep the "You" tag right beside the name instead of pushed
   to the far end of the row. */
.team-edit-row__name--owner {
  flex: 0 1 auto;
}

.team-edit-row__tag {
  flex: none;
  margin-right: auto;
  font-size: 10.5px;
  font-family: var(--font-display);
  font-weight: 600;
  color: var(--cyan);
  border: 1px solid var(--cyan);
  border-radius: var(--radius-clip);
  padding: 1px 7px;
}

.team-edit-row__spacer {
  flex: none;
  width: 24px;
  height: 24px;
}

.team-edit-row__uid {
  flex: 0 0 38%;
  min-width: 0;
  background: transparent;
  border: none;
  border-bottom: 1px solid var(--border);
  color: var(--text-muted);
  font-family: var(--font-body);
  font-size: 12px;
  padding: 4px 2px;
  outline: none;
  transition: border-color 0.15s ease, color 0.15s ease;
}

.team-edit-row__uid::placeholder {
  color: #4B5162;
}

.team-edit-row__uid:focus {
  color: var(--text-primary);
  border-bottom-color: var(--cyan);
}

.team-edit-row__remove {
  flex: none;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  border: 1px solid var(--border);
  background: transparent;
  color: var(--text-muted);
  font-size: 14px;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: border-color 0.15s ease, color 0.15s ease;
}

.team-edit-row__remove:hover {
  color: var(--crimson);
  border-color: var(--crimson-dim);
}

.team-add-row {
  display: flex;
  gap: 10px;
}

.team-add-row input {
  flex: 1;
  min-width: 0;
  background: transparent;
  border: none;
  border-bottom: 1px solid var(--border);
  color: var(--text-primary);
  font-family: var(--font-body);
  font-size: 14px;
  padding: 10px 2px;
  outline: none;
  transition: border-color 0.15s ease;
}

.team-add-row input::placeholder {
  color: #4B5162;
}

.team-add-row input:focus {
  border-bottom-color: var(--cyan);
}

.team-add-row .team-add-row__uid {
  flex: 0 1 38%;
}

.team-add-row__btn {
  width: auto;
  min-height: auto;
  flex: none;
  padding: 10px 18px;
  font-size: 13px;
}

.team-add-row input:disabled,
.team-add-row__btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* ---------- Responsive ---------- */

@media (max-width: 860px) {
  .team-view-main {
    padding: 24px 16px calc(var(--nav-height-mobile) + 32px);
  }

  .team-view-card {
    padding: 22px 20px;
  }
}

@media (max-width: 480px) {
  .team-view-name {
    font-size: 19px;
  }

  .team-add-row {
    flex-direction: column;
  }

  .team-add-row__btn {
    width: 100%;
  }

  .team-add-row .team-add-row__uid {
    flex: none;
    width: 100%;
  }
}
