/* ========================================
   REFERRALS PAGE — cs2red-inspired design
   ======================================== */

.referrals-container {
  padding-bottom: 40px;
  display: flex;
  flex-direction: column;
  gap: 24px;
}

/* ── Hero ── */
.ref-hero {
  position: relative;
  padding: 0 0 32px;
  overflow: hidden;
  min-height: 417px;
}

.ref-hero__content {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  gap: 18px;
  max-width: 894px;
  padding: 32px 32px 0px 32px;
}

.ref-hero__bg {
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  overflow: hidden;
}

.ref-hero__bg-image {
  position: absolute;
  top: -20%;
  right: 0;
  width: auto;
  height: 116%;
  object-fit: cover;
  object-position: center;
  opacity: 3.4;
}

.ref-hero__gradient {
  position: absolute;
  top: -40%;
  right: -10%;
  width: 600px;
  height: 600px;
  background: radial-gradient(circle, rgba(255, 0, 84, 0.18) 0%, transparent 70%);
  filter: blur(80px);
}

.ref-hero__agents {
  position: absolute;
  top: 0%;
  right: -10%;
  width: 100%;
  height: 100%;
  z-index: 0;
  pointer-events: none;
  overflow: hidden;
  display: none;
}

.ref-hero__agents-image {
  position: absolute;
  top: 39px;
  right: 154px;
  height: 100%;
  /* width: auto; */
  /* object-fit: cover; */
  /* object-position: right center; */
  opacity: 1;
}

@media (min-width: 1280px) {
  .ref-hero__agents {
    display: block;
  }
}

.ref-hero__title {
  font-size: 45px;
  font-weight: 900;
  /* font-style: italic; */
  text-transform: uppercase;
  color: #fff;
  line-height: 1.1;
  margin: 0;
  letter-spacing: -0.02em;
}

.ref-hero__subtitle {
  font-size: 15px;
  color: rgba(255, 255, 255, 0.55);
  line-height: 1.5;
  margin: 0;
}

/* ── Auth card (guest) ── */
.ref-auth-card {
  display: flex;
  align-items: center;
  gap: 24px;
  padding: 32px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 20px;
  backdrop-filter: blur(12px);
}

.ref-auth-card__icon img {
  filter: drop-shadow(0 8px 24px rgba(255, 0, 84, 0.3));
}

.ref-auth-card__text h2 {
  font-size: 22px;
  font-weight: 800;
  font-style: italic;
  text-transform: uppercase;
  margin: 0 0 8px;
}

.ref-auth-card__text p {
  color: rgba(255, 255, 255, 0.55);
  font-size: 14px;
  line-height: 1.5;
  margin: 0;
}

/* ── Stats row ── */
.ref-stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 12px;
}

.ref-stat-card {
  position: relative;
  padding: 16px;
  background: linear-gradient(180deg, #270d18, #ff005442);
  border-radius: 15px;
  overflow: hidden;
  min-height: 100px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  transition: transform 0.2s, box-shadow 0.2s;
}

.ref-stat-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3);
}

.ref-stat-card__label {
  font-size: 14px;
  color: #B8B8B8;
  margin-bottom: 8px;
  position: relative;
  z-index: 2;
}

.ref-stat-card__value {
  display: flex;
  align-items: center;
  gap: 8px;
  position: relative;
  z-index: 2;
}

.ref-stat-card__value p {
  margin: 0;
  font-size: 32px;
  font-weight: 700;
  color: #FFFFFF;
}

.ref-stat-card__value img {
  width: 20px;
  height: 20px;
}

.ref-stat-card__image {
  position: absolute;
  right: -10px;
  bottom: -10px;
  width: 120px;
  height: 120px;
  object-fit: contain;
  opacity: 0.15;
  pointer-events: none;
}

.ref-stat-card__skeleton {
  display: inline-block;
  width: 60px;
  height: 32px;
  border-radius: 6px;
  background: linear-gradient(90deg, rgba(255,255,255,0.08) 25%, rgba(255,255,255,0.15) 50%, rgba(255,255,255,0.08) 75%);
  background-size: 200% 100%;
  animation: ref-skeleton-pulse 1.2s ease-in-out infinite;
}

@keyframes ref-skeleton-pulse {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

/* ── Code section ── */
.ref-code-section {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 8px;
}

.ref-code-section__label {
  font-size: 14px;
  color: rgba(255, 255, 255, 0.7);
}

.ref-code-row {
  display: flex;
  align-items: center;
  gap: 8px;
}

.ref-code-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 4px;
}

.ref-code-display {
  display: flex;
  align-items: center;
  justify-content: left;
  height: 53px;
  width: 100%;
  padding: 0 24px;
  background: rgba(255, 255, 255, 0.05);
  border-radius: 8px;
  letter-spacing: 4px;
  text-transform: uppercase;
  font-weight: 700;
  font-size: 14px;
  color: #fff;
  user-select: all;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 100%;
  flex-shrink: 1;
}

/* ── Benefits ── */
.ref-benefits {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.ref-benefit-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 20px;
  background: rgba(255, 255, 255, 0.04);
  border-radius: 16px;
  backdrop-filter: blur(12px);
  line-height: 1.4;
}

.ref-benefit-item__icon {
  flex-shrink: 0;
  color: #ff0054;
}

.ref-benefit-item__text {
  font-size: 14px;
  font-weight: 500;
  color: rgba(255, 255, 255, 0.85);
}

.ref-benefit-item__text strong {
  color: #fff;
}

/* ── Buttons ── */
.ref-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: none;
  border-radius: 8px;
  padding: 12px 20px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
  text-decoration: none;
  color: #fff;
  white-space: nowrap;
}

/* Profile card buttons (from profile.css) */
.profile-card-btn {
  position: relative;
  z-index: 2;
  padding: 8px 16px;
  background: rgba(167, 194, 162, 0.1);
  border: 1px solid rgba(167, 194, 162, 0.2);
  border-radius: 10px;
  color: rgba(167, 194, 162, 0.9);
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
  align-self: flex-start;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.profile-card-btn:hover {
  background: rgba(167, 194, 162, 0.15);
  border-color: rgba(167, 194, 162, 0.3);
}

/* Hero button (розовая) */
.profile-card-btn--hero {
  align-items: center;
  background: linear-gradient(307deg, #ff0054 3.2%, #ba134d 99.71%);
  border: none;
  border-radius: 8px;
  color: #f3efe7;
  display: inline-flex;
  font-size: 14px;
  font-weight: 700;
  width: 50%;
  gap: 6px;
  height: 46px;
  justify-content: center;
  margin-top: 0;
  overflow: hidden;
  padding: 0 18px;
  text-decoration: none;
  text-shadow: 0 2px 1px rgba(137, 65, 14, 0.34);
  text-transform: uppercase;
  transition: opacity 0.3s, background 0.3s, color 0.3s, transform 0.3s;
}

.profile-card-btn--hero::before {
  background: linear-gradient(307deg, #ff0054 3.2%, #ff0054 99.71%);
  content: "";
  height: 100%;
  left: 0;
  opacity: 0;
  position: absolute;
  top: 0;
  transition: opacity 0.3s;
  width: 100%;
  z-index: 0;
}

.profile-card-btn--hero:hover {
  background: linear-gradient(307deg, #ff0054 3.2%, #ba134d 99.71%);
  border-color: transparent;
  color: #f3efe7;
  transform: translateY(-1px);
}

.profile-card-btn--hero:hover::before {
  opacity: 1;
}

.profile-card-btn--hero span {
  position: relative;
  z-index: 2;
  white-space: nowrap;
}

.profile-card-btn--hero svg {
  width: 16px;
  height: 16px;
  position: relative;
  z-index: 2;
  transition: transform 0.3s ease;
}

.profile-card-btn--hero:hover svg {
  transform: translateX(4px);
}

/* Telegram button (голубая версия) */
.profile-card-btn--telegram {
  align-items: center;
  background: linear-gradient(307deg, #0088cc 3.2%, #006ba3 99.71%);
  border: none;
  border-radius: 8px;
  color: #f3efe7;
  display: inline-flex;
  font-size: 14px;
  font-weight: 700;
  gap: 6px;
  height: 46px;
  width: 100%;
  justify-content: center;
  margin-top: 0;
  overflow: hidden;
  padding: 0 18px;
  text-decoration: none;
  text-shadow: 0 2px 1px rgba(0, 50, 80, 0.34);
  text-transform: uppercase;
  transition: opacity 0.3s, background 0.3s, color 0.3s, transform 0.3s;
}

.profile-card-btn--telegram::before {
  background: linear-gradient(307deg, #0088cc 3.2%, #0088cc 99.71%);
  content: "";
  height: 100%;
  left: 0;
  opacity: 0;
  position: absolute;
  top: 0;
  transition: opacity 0.3s;
  width: 100%;
  z-index: 0;
}

.profile-card-btn--telegram:hover {
  background: linear-gradient(307deg, #0088cc 3.2%, #006ba3 99.71%);
  border-color: transparent;
  color: #f3efe7;
  transform: translateY(-1px);
}

.profile-card-btn--telegram:hover::before {
  opacity: 1;
}

.profile-card-btn--telegram span {
  position: relative;
  z-index: 2;
  white-space: nowrap;
}

.profile-card-btn--telegram svg {
  width: 16px;
  height: 16px;
  position: relative;
  z-index: 2;
  transition: transform 0.3s ease;
}

.profile-card-btn--telegram:hover svg {
  transform: translateX(4px);
}

.ref-btn:hover {
  transform: translateY(-1px);
}

.ref-btn:active {
  transform: translateY(0);
}

.ref-btn--primary {
  background: linear-gradient(135deg, #ff0054, #ff7a18);
  box-shadow: 0 8px 20px rgba(255, 0, 84, 0.3);
  font-size: 15px;
  padding: 14px 28px;
  border-radius: 12px;
}

.ref-btn--primary:hover {
  box-shadow: 0 12px 28px rgba(255, 0, 84, 0.4);
}

.ref-btn--secondary {
  background: rgba(255, 255, 255, 0.08);
  height: 53px;
}

.ref-btn--secondary:hover {
  background: rgba(255, 255, 255, 0.12);
}

.ref-btn--ghost {
  background: rgba(255, 255, 255, 0.08);
  padding: 10px 16px;
  border-radius: 10px;
  font-size: 13px;
}

.ref-btn--ghost:hover {
  background: rgba(255, 255, 255, 0.14);
}

.ref-btn--icon {
  width: 53px;
  padding: 0;
  flex-shrink: 0;
}

/* ── Grid 2 col ── */
.ref-grid-2col {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 16px;
}

/* ── Panel (card-like blocks) ── */
.ref-panel {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 20px;
  padding: 24px;
  display: flex;
  flex-direction: column;
}

.ref-panel__head {
  margin-bottom: 20px;
}

.ref-panel__head--row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}

.ref-panel__label {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: rgba(255, 255, 255, 0.45);
  margin-bottom: 4px;
}

.ref-panel__title {
  font-size: 20px;
  font-weight: 800;
  /* font-style: italic; */
  margin: 0;
  color: #fff;
}

.ref-panel__title--uppercase {
  text-transform: uppercase;
  font-size: 22px;
}

.ref-panel__body {
  flex: 1;
}

.ref-panel__body--center {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
}

.ref-panel__body--scroll {
  max-height: 600px;
  overflow-y: auto;
  overflow-x: hidden;
}

.ref-panel__body--scroll::-webkit-scrollbar {
  width: 6px;
}

.ref-panel__body--scroll::-webkit-scrollbar-track {
  background: rgba(255, 255, 255, 0.05);
  border-radius: 3px;
}

.ref-panel__body--scroll::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.2);
  border-radius: 3px;
}

.ref-panel__body--scroll::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 255, 255, 0.3);
}

.ref-panel__events {
  margin-top: 24px;
  padding-top: 24px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

/* ── Search ── */
.ref-search {
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(255, 255, 255, 0.04);
  color: #fff;
  padding: 10px 14px;
  font-size: 13px;
  outline: none;
  transition: border-color 0.2s;
  min-width: 200px;
}

.ref-search:focus {
  border-color: rgba(255, 0, 84, 0.5);
}

.ref-search::placeholder {
  color: rgba(255, 255, 255, 0.35);
}

/* ── Events list (instead of table) ── */
.ref-events-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.ref-event-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: rgba(255, 255, 255, 0.04);
  border-radius: 8px;
  padding: 14px 20px;
  gap: 16px;
  flex-wrap: wrap;
  transition: background 0.15s ease;
}

.ref-event-row:hover {
  background: rgba(255, 255, 255, 0.07);
}

.ref-event-user {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.ref-event-user__avatar {
  width: 36px;
  height: 36px;
  border-radius: 8px;
  object-fit: cover;
  flex-shrink: 0;
}

.ref-event-user__name {
  font-size: 14px;
  font-weight: 600;
  color: #fff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.ref-event-user__id {
  font-size: 12px;
  color: rgba(255, 255, 255, 0.4);
}

.ref-event-info {
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
  font-size: 13px;
}

.ref-event-info__action {
  color: rgba(255, 255, 255, 0.65);
}

.ref-event-info__bonus {
  font-weight: 700;
  color: #fff;
  display: flex;
  align-items: center;
  gap: 4px;
}

.ref-event-info__date {
  color: rgba(255, 255, 255, 0.35);
  font-size: 12px;
}

.ref-events-empty {
  text-align: center;
  padding: 40px 20px;
  color: rgba(255, 255, 255, 0.35);
  font-size: 14px;
}

/* ── ТОП по фарму ── */
.ref-top-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.ref-top-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: rgba(255, 255, 255, 0.04);
  border-radius: 8px;
  padding: 12px 16px;
  gap: 12px;
  transition: background 0.15s ease;
}

.ref-top-item:hover {
  background: rgba(255, 255, 255, 0.07);
}

.ref-top-item__rank {
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 32px;
  height: 32px;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 700;
  color: #fff;
  background: rgba(255, 255, 255, 0.08);
}

.ref-top-item__rank--gold {
  background: linear-gradient(135deg, #ffd700, #ffed4e);
  color: #000;
}

.ref-top-item__rank--silver {
  background: linear-gradient(135deg, #c0c0c0, #e8e8e8);
  color: #000;
}

.ref-top-item__rank--bronze {
  background: linear-gradient(135deg, #cd7f32, #e6a857);
  color: #fff;
}

.ref-top-item__user {
  display: flex;
  align-items: center;
  gap: 12px;
  flex: 1;
  min-width: 0;
}

.ref-top-item__avatar {
  width: 40px;
  height: 40px;
  border-radius: 8px;
  object-fit: cover;
  flex-shrink: 0;
}

.ref-top-item__info {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.ref-top-item__name {
  font-size: 14px;
  font-weight: 600;
  color: #fff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.ref-top-item__id {
  font-size: 12px;
  color: rgba(255, 255, 255, 0.4);
}

.ref-top-item__earned {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 14px;
  font-weight: 700;
  color: #fff;
}

.ref-top-item__earned img {
  width: 18px;
  height: 18px;
}

/* ── Toast ── */
.ref-toast {
  position: fixed;
  bottom: 24px;
  right: 24px;
  background: rgba(0, 0, 0, 0.9);
  color: #fff;
  padding: 12px 20px;
  border-radius: 10px;
  font-size: 14px;
  font-weight: 600;
  opacity: 0;
  transform: translateY(10px);
  transition: opacity 0.25s ease, transform 0.25s ease;
  z-index: 2000;
  pointer-events: none;
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.ref-toast--visible {
  opacity: 1;
  transform: translateY(0);
}

/* ── Responsive ── */
@media (max-width: 1024px) {
  .ref-grid-2col {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 768px) {
  .referrals-container {
    gap: 16px;
    padding-bottom: 20px;
  }

  .ref-hero {
    padding: 32px 0 20px;
    min-height: auto;
  }

  .ref-hero__content {
    max-width: 100%;
  }

  .ref-hero__bg-image {
    opacity: 0.25;
  }

  .ref-hero__agents {
    display: none !important;
  }

  .ref-hero__title {
    font-size: 28px;
  }

  .ref-hero__subtitle {
    font-size: 14px;
  }

  .ref-auth-card {
    flex-direction: column;
    text-align: center;
    padding: 24px;
  }

  .ref-stats {
    grid-template-columns: 1fr;
  }

  .ref-stat-card {
    min-height: 90px;
  }

  .ref-stat-card__value {
    font-size: 28px;
  }

  .ref-code-row {
    flex-wrap: wrap;
  }

  .ref-code-display {
    flex: 1 1 100%;
    min-width: 0;
  }

  .ref-btn--icon {
    flex: 1;
  }

  .ref-code-actions {
    flex-wrap: wrap;
    gap: 8px;
  }

  .profile-card-btn--hero,
  .profile-card-btn--telegram {
    flex: 1;
    min-width: 140px;
  }

  .ref-benefit-item {
    padding: 12px 16px;
  }

  .ref-panel {
    padding: 18px;
    border-radius: 16px;
  }

  .ref-panel__head--row {
    flex-direction: column;
  }

  .ref-search {
    min-width: unset;
    width: 100%;
  }

  .ref-event-row {
    padding: 12px 14px;
  }

  .ref-event-info {
    width: 100%;
    justify-content: space-between;
  }

  .ref-panel__events {
    margin-top: 20px;
    padding-top: 20px;
  }

  .ref-panel__body--scroll {
    max-height: 400px;
  }

  .ref-top-item {
    padding: 10px 12px;
  }

  .ref-top-item__avatar {
    width: 36px;
    height: 36px;
  }

  .ref-top-item__rank {
    min-width: 28px;
    height: 28px;
    font-size: 12px;
  }
}

@media (max-width: 480px) {
  .ref-hero {
    padding: 24px 0 16px;
  }

  .ref-hero__title {
    font-size: 22px;
  }

  .ref-hero__subtitle {
    font-size: 13px;
  }

  .ref-stat-card__value {
    font-size: 20px;
  }

  .ref-grid-2col {
    grid-template-columns: 1fr;
  }
}
