/* lp_rank GameBoost-style: cards with header + tier + division + LP */
.lp-rank-calc--gameboost {
  margin-bottom: 20px;
}

.lp-rank-cards {
  display: flex;
  flex-wrap: wrap;
  align-items: stretch;
  gap: 16px 20px;
  position: relative;
}

@media (min-width: 769px) {
  .lp-rank-cards {
    flex-wrap: nowrap;
    gap: 12px;
  }
}

/* Card container */
.lp-rank-card {
  flex: 1 1 100%;
  min-width: 0;
  border-radius: 14px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: var(--background-dark-grey, #1a1a1a);
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

@media (min-width: 769px) {
  .lp-rank-card {
    flex: 1 1 0;
  }
}

/* Card header — gradient, icon + title */
.lp-rank-card__header {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 16px 18px;
  background: linear-gradient(135deg, rgba(255, 199, 0, 0.12) 0%, rgba(0, 0, 0, 0.4) 100%);
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.lp-rank-card--to .lp-rank-card__header {
  background: linear-gradient(135deg, rgba(255, 199, 0, 0.18) 0%, rgba(0, 0, 0, 0.4) 100%);
}

.lp-rank-card__icon-wrap {
  flex-shrink: 0;
  width: 52px;
  height: 52px;
  border-radius: 50%;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.35);
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.lp-rank-card__icon-wrap img {
  width: 32px;
  height: 32px;
  object-fit: contain;
}

.lp-rank-card__header-text {
  min-width: 0;
}

.lp-rank-card__title {
  font-size: 17px;
  font-weight: 600;
  margin: 0 0 4px 0;
  color: var(--text-white-color, #fff);
}

.lp-rank-card__hint {
  font-size: 13px;
  color: var(--light-grey, #999);
  margin: 0;
}

/* Arrow between cards */
.lp-rank-card__arrow {
  flex-shrink: 0;
  display: none;
  align-items: center;
  justify-content: center;
  color: var(--orange, #ffc700);
  opacity: 0.7;
}

@media (min-width: 769px) {
  .lp-rank-card__arrow {
    display: flex;
    order: 0;
    align-self: center;
  }
}

/* Card body */
.lp-rank-card__body {
  padding: 18px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  flex: 1;
}

.lp-rank-card__label {
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  color: var(--light-grey, #888);
  margin: 0 0 4px 0;
}

/* Tier buttons — GameBoost style */
.lp-rank-tier-icons {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

.lp-rank-tier-btn {
  flex: 1 1 auto;
  max-width: 80px;
  padding: 10px 12px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 10px;
  cursor: pointer;
  transition: border-color 0.2s, background 0.2s;
  display: flex;
  align-items: center;
  justify-content: center;
}

.lp-rank-tier-btn img {
  width: 36px;
  height: 36px;
  object-fit: contain;
  display: block;
}

.lp-rank-tier-btn:hover {
  background: rgba(255, 199, 0, 0.1);
  border-color: rgba(255, 199, 0, 0.4);
}

.lp-rank-tier-btn.active {
  background: rgba(255, 199, 0, 0.15);
  border-color: var(--orange, #ffc700);
}

/* LP block */
.lp-rank-lp-block {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 4px;
}

.lp-rank-lp-row {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.lp-rank-lp-row--input {
  flex-direction: column;
}

.lp-rank-lp-row--input .lp-rank-card__label {
  margin-bottom: 0;
}

.lp-rank-lp-controls {
  display: flex;
  align-items: center;
  gap: 10px;
  align-self: flex-start;
}

.lp-rank-lp-btn {
  width: 40px;
  height: 40px;
  min-width: 40px;
  border-radius: 10px;
  border: 1px solid var(--background-light-grey, #444);
  background: rgba(255, 255, 255, 0.06);
  color: var(--text-white-color, #fff);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  font-weight: 600;
  line-height: 1;
  transition: border-color 0.2s, background 0.2s;
  position: relative;
}

.lp-rank-lp-btn::before,
.lp-rank-lp-btn::after {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  margin: -1px 0 0 -6px;
  background: currentColor;
  width: 12px;
  height: 2px;
  border-radius: 2px;
}

.lp-rank-lp-btn--plus::before {
  transform: rotate(-90deg);
}

.lp-rank-lp-btn:hover {
  border-color: rgba(255, 199, 0, 0.4);
  background: rgba(255, 199, 0, 0.08);
}

.lp-rank-lp-input {
  width: 80px;
  padding: 10px 12px;
  text-align: center;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 10px;
  color: var(--text-white-color, #fff);
  font-size: 16px;
  font-weight: 600;
}

.lp-rank-lp-input:focus {
  outline: none;
  border-color: rgba(255, 199, 0, 0.5);
}

/* Division row — GameBoost style buttons */
.lp-rank-division-row {
  display: flex;
  align-items: center;
  gap: 8px;
}

.lp-rank-division-row--no-border {
  border: none;
  padding: 0;
}

.lp-rank-division-marks {
  display: flex;
  align-items: stretch;
  gap: 6px;
  flex: 1;
}

.lp-rank-division-marks .lp-rank-division-mark {
  flex: 1;
  min-width: 50px;
  padding: 10px 8px;
  border-radius: 10px;
  cursor: pointer;
  font-size: 13px;
  font-weight: 600;
  text-align: center;
  color: var(--light-grey, #888);
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.1);
  transition: color 0.2s, background 0.2s, border-color 0.2s;
}

.lp-rank-division-marks .lp-rank-division-mark:hover {
  color: var(--light-grey, #ccc);
  background: rgba(255, 199, 0, 0.08);
  border-color: rgba(255, 199, 0, 0.25);
}

.lp-rank-division-marks .lp-rank-division-mark.active {
  color: var(--orange, #ffc700);
  background: rgba(255, 199, 0, 0.15);
  border-color: rgba(255, 199, 0, 0.5);
}

/* Legacy: ensure calc-services__rank is not breaking layout */
.lp-rank-calc--gameboost .lp-rank-section {
  margin-bottom: 0;
}

/* Server + additions — spacing */
.lp-rank-cards + .calc-services__controls {
  margin-top: 20px;
}

.lp-rank-cards ~ .calc-services__checkboxes {
  margin-top: 16px;
}

/* Mobile */
@media (max-width: 768px) {
  .lp-rank-cards {
    flex-direction: column;
  }

  .lp-rank-card__arrow {
    transform: rotate(90deg);
    align-self: center;
    display: flex;
  }

  .lp-rank-tier-btn img {
    width: 32px;
    height: 32px;
  }

  .lp-rank-division-marks .lp-rank-division-mark {
    min-width: 44px;
    padding: 8px 4px;
    font-size: 12px;
  }
}
