/* Change avatar — match templates/aviatorwin_change_avatar.html */

body.change-avatar-panel-open > a.close {
  display: none;
}

.card.change-avatar-mode {
  flex: 1 1 0 !important;
  min-width: 0 !important;
  max-width: none !important;
  width: auto !important;
  display: flex !important;
  justify-content: flex-start !important;
  align-items: flex-start !important;
  background: transparent !important;
  padding: 0 !important;
  border: none !important;
  border-radius: 0 !important;
  box-shadow: none !important;
  transition: none !important;
}

.card.change-avatar-mode #card-content {
  width: 100% !important;
  max-width: 960px !important;
}

body.change-avatar-panel-open .container {
  flex-wrap: nowrap;
  align-items: flex-start;
  gap: 24px;
}

@media (max-width: 900px) {
  body.change-avatar-panel-open .container {
    flex-wrap: wrap;
    gap: 14px;
  }

  body.change-avatar-panel-open .container .sidebar {
    width: 100%;
    flex-basis: 100%;
  }

  .card.change-avatar-mode {
    width: 100% !important;
  }
}

#change-avatar-section {
  --ca-stroke: #223449;
  --ca-muted: #96a5b8;
  --ca-blue: #f5b52e;
  --ca-blue2: #ffe08a;
  position: relative !important;
  width: 100% !important;
  max-width: none !important;
  margin: 0 !important;
  padding: 28px 26px 28px !important;
  border: 1px solid rgba(255, 255, 255, 0.06) !important;
  border-radius: 18px !important;
  overflow: hidden !important;
  color: #f6f8fb !important;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif !important;
  background:
    radial-gradient(circle at 72% 7%, rgba(59, 130, 246, 0.14), transparent 30%),
    radial-gradient(circle at 6% 0%, rgba(96, 165, 250, 0.08), transparent 34%),
    linear-gradient(180deg, rgba(12, 25, 41, 0.94), rgba(7, 17, 30, 0.97)) !important;
  box-shadow: none !important;
}

#change-avatar-section .ca-close {
  position: absolute;
  top: 18px;
  right: 18px;
  z-index: 3;
  width: 46px;
  height: 46px;
  border-radius: 9px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--ca-stroke);
  color: #b8c3d0;
  display: grid;
  place-items: center;
  text-decoration: none;
  transition: 0.18s ease;
}

#change-avatar-section .ca-close:hover {
  border-color: var(--ca-blue);
  color: #fff;
  background: rgba(59, 130, 246, 0.1);
}

#change-avatar-section .ca-close svg {
  width: 22px;
  height: 22px;
  stroke: currentColor;
  stroke-width: 1.8;
  fill: none;
  stroke-linecap: round;
}

#change-avatar-section .ca-head {
  position: relative;
  z-index: 1;
  display: grid;
  justify-items: center;
  text-align: center;
  gap: 14px;
  margin: 0 48px 28px 0;
}

#change-avatar-section .ca-head h1 {
  margin: 0;
  padding: 0;
  text-align: center;
  font-size: 34px;
  line-height: 1.05;
  letter-spacing: -0.035em;
  font-weight: 800;
  color: #fff;
}

#change-avatar-section .ca-preview {
  width: 120px;
  height: 120px;
  border-radius: 50%;
  border: 2px solid rgba(96, 165, 250, 0.35);
  background: rgba(8, 18, 31, 0.9);
  overflow: hidden;
  display: grid;
  place-items: center;
  box-shadow: 0 0 0 6px rgba(59, 130, 246, 0.08);
}

#change-avatar-section .ca-preview img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

#change-avatar-section .ca-head p {
  margin: 0;
  color: var(--ca-muted);
  font-size: 15px;
}

#change-avatar-section .ca-grid {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: repeat(8, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 22px;
}

#change-avatar-section .ca-option {
  aspect-ratio: 1;
  border: 1px solid var(--ca-stroke);
  border-radius: 14px;
  background: linear-gradient(180deg, rgba(13, 28, 46, 0.9), rgba(8, 18, 31, 0.86));
  padding: 6px;
  cursor: pointer;
  position: relative;
  overflow: hidden;
  transition: 0.18s ease;
}

#change-avatar-section .ca-option[hidden] {
  display: none !important;
}

#change-avatar-section .ca-option:hover {
  border-color: rgba(96, 165, 250, 0.45);
  background: rgba(59, 130, 246, 0.08);
}

#change-avatar-section .ca-option.active {
  border-color: var(--ca-blue);
  box-shadow: inset 0 0 0 1px rgba(96, 165, 250, 0.25);
}

#change-avatar-section .ca-option img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 10px;
  display: block;
}

#change-avatar-section .ca-option .ca-tick {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 24px;
  height: 24px;
  border-radius: 999px;
  background: var(--ca-blue);
  color: #fff;
  display: grid;
  place-items: center;
  font-size: 12px;
  font-weight: 900;
  box-shadow: 0 0 14px rgba(59, 130, 246, 0.4);
}

/* display:grid above would otherwise override the [hidden] UA rule */
#change-avatar-section .ca-option .ca-tick[hidden] {
  display: none !important;
}

#change-avatar-section .ca-option.is-custom .ca-custom-label {
  position: absolute;
  left: 6px;
  right: 6px;
  bottom: 6px;
  border-radius: 8px;
  background: rgba(2, 8, 18, 0.72);
  color: #fff3d6;
  font-size: 10px;
  font-weight: 700;
  text-align: center;
  padding: 3px 4px;
  letter-spacing: 0.02em;
  z-index: 1;
  pointer-events: none;
}

#change-avatar-section .ca-option.is-custom:not(.has-image) {
  display: grid;
  place-items: center;
  color: var(--ca-muted);
  font-size: 12px;
  font-weight: 650;
}

#change-avatar-section .ca-option.is-custom:not(.has-image)::before {
  content: "📷";
  font-size: 22px;
  line-height: 1;
  margin-bottom: 18px;
}

#change-avatar-section .ca-option.is-custom:not(.has-image) .ca-custom-label {
  bottom: 10px;
}

#change-avatar-section .ca-actions {
  position: relative;
  z-index: 1;
  display: grid;
  gap: 12px;
  justify-items: center;
}

#change-avatar-section .ca-upload-btn,
#change-avatar-section .ca-save-btn {
  width: min(100%, 420px);
  height: 54px;
  border: 0;
  border-radius: 10px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  font-size: 16px;
  font-weight: 800;
  color: #fff;
  transition: filter 0.15s ease;
}

#change-avatar-section .ca-upload-btn {
  background: linear-gradient(135deg, #d98e12, #e8a020);
  box-shadow: 0 14px 36px rgba(59, 130, 246, 0.24);
}

#change-avatar-section .ca-save-btn {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(96, 165, 250, 0.28);
  color: #9dccff;
  box-shadow: none;
}

#change-avatar-section .ca-upload-btn:hover,
#change-avatar-section .ca-save-btn:hover {
  filter: brightness(1.06);
}

#change-avatar-section .ca-upload-btn:disabled,
#change-avatar-section .ca-save-btn:disabled {
  opacity: 0.55;
  cursor: not-allowed;
  filter: none;
}

#change-avatar-section .ca-upload-btn svg {
  width: 20px;
  height: 20px;
  stroke: currentColor;
  stroke-width: 1.9;
  fill: none;
  stroke-linecap: round;
  stroke-linejoin: round;
}

#change-avatar-section .ca-hint {
  color: var(--ca-muted);
  font-size: 13px;
  text-align: center;
}

#change-avatar-section .ca-file-input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}

@media (max-width: 1100px) {
  #change-avatar-section .ca-grid {
    grid-template-columns: repeat(6, minmax(0, 1fr));
  }
}

@media (max-width: 760px) {
  #change-avatar-section {
    padding: 18px 14px 22px !important;
    border-radius: 14px !important;
  }

  #change-avatar-section .ca-close {
    top: 12px;
    right: 12px;
    width: 42px;
    height: 42px;
  }

  #change-avatar-section .ca-head {
    margin-right: 44px;
  }

  #change-avatar-section .ca-head h1 {
    font-size: 26px;
  }

  #change-avatar-section .ca-preview {
    width: 96px;
    height: 96px;
  }

  #change-avatar-section .ca-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 10px;
  }

  #change-avatar-section .ca-upload-btn,
  #change-avatar-section .ca-save-btn {
    width: 100%;
    height: 50px;
    font-size: 15px;
  }
}
