/* Clans list & profile shared styles */
.clans-toolbar {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-bottom: 16px;
}

.clans-top {
  display: flex;
  align-items: center;
  gap: 10px;
  direction: ltr;
}

.clans-back-btn {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: rgba(23, 23, 23, 0.8);
  color: #fff;
  font-size: 20px;
  text-decoration: none;
  transition: background 0.12s, border-color 0.12s;
}

.clans-back-btn:hover {
  background: rgba(255, 255, 255, 0.12);
  border-color: rgba(184, 14, 19, 0.35);
}

.clans-search-wrap {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-left: auto;
  width: min(72%, 260px);
  padding: 0 10px;
  background: rgba(23, 23, 23, 0.8);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 12px;
  min-height: 38px;
}

.clans-search {
  flex: 1;
  min-width: 0;
  border: none;
  outline: none;
  background: transparent;
  color: #fff;
  font-family: inherit;
  font-size: 13px;
  padding: 8px 0;
  direction: rtl;
}

.clans-action-btn {
  width: 100%;
  padding: 12px 16px;
  border-radius: 12px;
  border: 1px solid #B80E13;
  background: linear-gradient(180deg, #2B2B2D 0%, #1C1C1E 100%);
  color: #e0474b;
  font-family: inherit;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
}

.clans-action-btn:disabled,
.clans-action-btn.is-disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.clans-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
}

@media (min-width: 520px) {
  .clans-grid {
    grid-template-columns: 1fr 1fr;
  }
}

.clan-card {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 14px;
  border-radius: 14px;
  background: linear-gradient(180deg, #1C1C1E 0%, #161617 100%);
  border: 1px solid #4a3840;
  text-decoration: none;
  color: inherit;
  cursor: pointer;
  transition: border-color 0.12s, transform 0.12s;
}

.clan-card:hover {
  border-color: #B80E13;
  transform: translateY(-1px);
}

.clan-card-logo {
  width: 52px;
  height: 52px;
  border-radius: 12px;
  object-fit: contain;
  background: #161617;
  border: 1px solid #5a4048;
  flex-shrink: 0;
}

.clan-logo-wrap {
  position: relative;
  display: inline-block;
  flex-shrink: 0;
}

.clan-logo-img {
  display: block;
  object-fit: contain;
}

.clan-logo-frame {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  object-fit: contain;
}

.clan-logo-wrap--profile {
  width: 96px;
  height: 96px;
}

.clan-logo-wrap--profile .clan-logo-img {
  position: absolute;
  top: 48%;
  left: 50%;
  width: 80%;
  height: 80%;
  transform: translate(-50%, -50%);
  filter: drop-shadow(0 0 10px rgba(184, 14, 19, 0.75));
}

.clan-logo-wrap--card {
  width: 56px;
  height: 56px;
}

.clan-logo-wrap--card .clan-logo-img {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 68%;
  height: 68%;
  transform: translate(-50%, -50%);
  border-radius: 10px;
  background: #161617;
}

.clan-logo-wrap--chip {
  width: 36px;
  height: 36px;
}

.clan-logo-wrap--chip .clan-logo-img {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 68%;
  height: 68%;
  transform: translate(-50%, -50%);
}

.clan-logo-wrap--header {
  width: 78px;
  height: 78px;
}

.clan-logo-wrap--header .clan-logo-img {
  position: absolute;
  top: 48%;
  left: 50%;
  width: 80%;
  height: 80%;
  transform: translate(-50%, -50%);
  filter: drop-shadow(0 0 6px rgba(184, 14, 19, 0.55));
}

.clan-logo-wrap--grid {
  width: 64px;
  height: 64px;
}

.clan-logo-wrap--grid .clan-logo-img {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 68%;
  height: 68%;
  transform: translate(-50%, -50%);
}

.clan-logo-wrap--preview {
  width: 112px;
  height: 112px;
}

.clan-logo-wrap--preview .clan-logo-img {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 72%;
  height: 72%;
  transform: translate(-50%, -50%);
}

.clan-cosmetics-tabs {
  display: flex;
  gap: 8px;
  margin-bottom: 12px;
  direction: rtl;
}

.clan-cosmetics-tab {
  flex: 1;
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid #5a4048;
  background: rgba(255, 255, 255, 0.04);
  color: #d0c8cc;
  font-family: inherit;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
}

.clan-cosmetics-tab.is-active {
  border-color: #B80E13;
  color: #e0474b;
  background: rgba(184, 14, 19, 0.12);
}

.clan-frame-grid-item {
  padding: 8px;
}

.clan-card-body {
  flex: 1;
  min-width: 0;
}

.clan-card-name {
  font-size: 15px;
  font-weight: 700;
  color: #e0474b;
  margin-bottom: 4px;
}

.clan-card-desc {
  font-size: 12px;
  line-height: 1.5;
  color: #b8b0b4;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.clan-card-rank {
  font-size: 11px;
  color: #9a8a90;
  margin-top: 6px;
}

.clans-empty {
  text-align: center;
  color: #9a8a90;
  padding: 24px 12px;
}

/* Profile */
#clanProfileRoot {
  padding-bottom: calc(64px + env(safe-area-inset-bottom, 0px));
}

.clan-profile-hero {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: 20px 16px;
  margin-bottom: 16px;
  border-radius: 16px;
  background: linear-gradient(180deg, #1C1C1E 0%, #161617 100%);
  border: 1px solid #4a3840;
}

.clan-profile-logo {
  width: 88px;
  height: 88px;
  filter: drop-shadow(0px 0px 10px rgba(184, 14, 19, 0.75));
  -webkit-filter: drop-shadow(0px 0px 10px rgba(184, 14, 19, 0.75));
}

.clan-profile-name {
  font-size: 1.35rem;
  font-weight: 800;
  color: #e0474b;
  margin: 0 0 4px;
}

.clan-profile-tag {
  font-size: 13px;
  color: #B80E13;
  margin-bottom: 8px;
}

.clan-profile-stats {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px 16px;
  margin: 12px 0;
  font-size: 12px;
  color: #d0c8cc;
}

.clan-profile-stat strong {
  color: #e0474b;
}

.clan-xp-bar {
  width: 100%;
  max-width: 280px;
  margin-top: 12px;
}

.clan-xp-label {
  display: flex;
  justify-content: space-between;
  font-size: 11px;
  color: #9a8a90;
  margin-bottom: 4px;
}

.clan-xp-track {
  height: 8px;
  border-radius: 4px;
  background: #232325;
  overflow: hidden;
  border: 1px solid #5a4048;
}

.clan-xp-fill {
  height: 100%;
  background: linear-gradient(90deg, #B80E13, #e0474b);
  border-radius: 3px;
  transition: width 0.3s;
}

.clan-profile-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: center;
  margin-bottom: 16px;
}

.clan-btn {
  padding: 10px 16px;
  border-radius: 10px;
  border: 1px solid #5a4048;
  background: linear-gradient(180deg, #232325 0%, #18181a 100%);
  color: #fff;
  font-family: inherit;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
}

.clan-btn--primary {
  border-color: #B80E13;
  color: #e0474b;
}

.clan-btn--danger {
  border-color: #8b3030;
  color: #ff8888;
}

.clan-btn--with-badge {
  position: relative;
  padding-inline-end: 14px;
}

.clan-btn-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 20px;
  height: 20px;
  margin-inline-start: 8px;
  padding: 0 6px;
  border-radius: 999px;
  background: linear-gradient(180deg, #c93030 0%, #8b1c1c 100%);
  border: 1px solid #ff6666;
  color: #fff;
  font-size: 11px;
  font-weight: 800;
  line-height: 1;
  vertical-align: middle;
}

.clan-section {
  margin-bottom: 16px;
  padding: 14px;
  border-radius: 14px;
  background: linear-gradient(180deg, #1C1C1E 0%, #161617 100%);
  border: 1px solid #4a3840;
}

.clan-section-title {
  margin: 0 0 10px;
  font-size: 14px;
  font-weight: 700;
  color: #e0474b;
}

.clan-rules-text,
.clan-desc-text {
  font-size: 13px;
  line-height: 1.7;
  color: #d0c8cc;
  white-space: pre-wrap;
}

.clan-members-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.clan-member-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border-radius: 10px;
  background: rgba(0, 0, 0, 0.2);
  border: 1px solid #3a2830;
}

.clan-member-row--clickable {
  cursor: pointer;
  transition: background 0.12s ease, border-color 0.12s ease;
}

.clan-member-row--clickable:hover {
  background: rgba(255, 255, 255, 0.06);
  border-color: rgba(184, 14, 19, 0.35);
}

.clan-member-avatar-wrap {
  position: relative;
  width: 40px;
  height: 40px;
  flex-shrink: 0;
}

.clan-member-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  object-fit: cover;
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
}

.clan-member-frame {
  width: 40px;
  height: 40px;
  position: absolute;
  inset: 0;
}

.clan-member-info {
  flex: 1;
  min-width: 0;
}

.clan-member-name {
  font-size: 13px;
  font-weight: 600;
  color: #fff;
}

.clan-member-role {
  font-size: 11px;
  color: #B80E13;
}

.clan-member-actions {
  display: flex;
  gap: 4px;
}

.clan-member-actions button {
  padding: 4px 8px;
  font-size: 11px;
  border-radius: 6px;
  border: 1px solid #5a4048;
  background: #232325;
  color: #fff;
  cursor: pointer;
}

.clan-friends-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.clan-friend-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 10px;
  border-radius: 20px;
  background: #232325;
  border: 1px solid #5a4048;
  font-size: 12px;
  color: #fff;
  text-decoration: none;
}

.clan-friend-chip .clan-logo-wrap--chip {
  flex-shrink: 0;
}

.clan-friend-chip img {
  width: 22px;
  height: 22px;
  border-radius: 6px;
}

.clan-form-group {
  margin-bottom: 12px;
}

.clan-form-group label {
  display: block;
  font-size: 12px;
  color: #B80E13;
  margin-bottom: 4px;
}

.clan-form-group input,
.clan-form-group textarea,
.clan-form-group select {
  width: 100%;
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid #5a4048;
  background: #161617;
  color: #fff;
  font-family: inherit;
  font-size: 13px;
}

.clan-logo-picker {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.clan-logo-option {
  width: 48px;
  height: 48px;
  padding: 4px;
  border-radius: 10px;
  border: 2px solid transparent;
  background: #161617;
  cursor: pointer;
}

.clan-logo-option.is-selected {
  border-color: #e0474b;
}

.clan-logo-option img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.clan-profile-logo-wrap {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  margin: 0 auto 12px;
  border: none;
  background: transparent;
  border-radius: 50%;
}

.clan-profile-logo-wrap.is-clickable {
  cursor: pointer;
}

.clan-profile-logo-wrap.is-clickable:hover .clan-logo-wrap--profile .clan-logo-img {
  filter: drop-shadow(0 0 14px rgba(184, 14, 19, 0.95)) brightness(1.05);
}

.clan-profile-logo-hint {
  position: absolute;
  bottom: -6px;
  left: 50%;
  transform: translateX(-50%);
  padding: 2px 8px;
  border-radius: 999px;
  background: rgba(14, 14, 15, 0.92);
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: #bbb;
  font-size: 11px;
  white-space: nowrap;
}

.clan-logo-settings-hint {
  margin: 0;
  color: #888;
  font-size: 13px;
  line-height: 1.6;
}

.clan-logo-picker-modal,
.clan-logo-preview-modal {
  max-width: 420px;
  width: min(100%, 420px);
}

.clan-logo-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  padding: 4px 0 12px;
  min-height: 120px;
}

.clan-logo-grid-item {
  position: relative;
  aspect-ratio: 1;
  padding: 8px;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: #161617;
  cursor: pointer;
}

.clan-logo-grid-item:hover {
  border-color: rgba(224, 71, 75, 0.55);
}

.clan-logo-grid-item img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.clan-logo-badge {
  position: absolute;
  left: 4px;
  right: 4px;
  bottom: 4px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 3px;
  padding: 2px 4px;
  border-radius: 8px;
  font-size: 10px;
  font-weight: 700;
  background: rgba(14, 14, 15, 0.9);
}

.clan-logo-badge img {
  width: 12px;
  height: 12px;
  object-fit: contain;
}

.clan-logo-badge.is-paid {
  color: #f5d76e;
}

.clan-logo-badge.is-owned {
  color: #7dcea0;
}

.clan-logo-badge.is-current {
  color: #e0474b;
}

.clan-logo-grid-loading,
.clan-logo-grid-empty {
  grid-column: 1 / -1;
  text-align: center;
  color: #888;
  margin: 0;
  padding: 24px 8px;
}

.clan-logo-pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding-top: 4px;
}

.clan-logo-pagination button {
  padding: 8px 14px;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: #1c1c1e;
  color: #ededed;
  font-family: inherit;
  cursor: pointer;
}

.clan-logo-pagination button:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.clan-logo-preview-wrap {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  min-height: 180px;
}

.clan-logo-preview-wrap img {
  width: min(100%, 200px);
  height: auto;
  object-fit: contain;
}

.clan-logo-preview-price {
  margin: 0 0 12px;
  text-align: center;
  color: #bbb;
  font-size: 14px;
  font-weight: 600;
}

.clan-logo-preview-actions {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.clan-logo-purchase-btn {
  background: linear-gradient(180deg, #3a2f10 0%, #2a2208 100%);
  border: 1px solid rgba(245, 215, 110, 0.35);
}

.clan-form-msg {
  font-size: 12px;
  margin: 8px 0;
  color: #ff8888;
}

.clan-form-msg.is-success {
  color: #88ff88;
}

.clan-request-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 10px;
  border-radius: 10px;
  background: rgba(0, 0, 0, 0.2);
  margin-bottom: 8px;
}

.clan-request-actions {
  display: flex;
  gap: 6px;
}

.clan-chip--list {
  text-decoration: none;
}

.clan-chip--list .chip-label {
  font-size: 10px;
  color: #9a8a90;
}

.clan-chip-logo {
  width: 40px;
  height: 40px;
  filter: drop-shadow(0px 0px 6px rgba(184, 14, 19, 0.55));
  -webkit-filter: drop-shadow(0px 0px 6px rgba(184, 14, 19, 0.55));
}

.clan-presets-modal {
  max-width: 440px;
}

.clan-modal-body {
  padding: 0 4px 4px;
}

.clan-preset-intro {
  font-size: 13px;
  line-height: 1.75;
  color: #b8b0b4;
  margin: 0 0 14px;
  padding: 12px;
  background: rgba(0, 0, 0, 0.25);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 10px;
}

.clan-preset-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 14px;
  max-height: 42vh;
  overflow-y: auto;
}

.clan-preset-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 12px;
  background: rgba(0, 0, 0, 0.25);
  border: 1px solid #5a4048;
  border-radius: 10px;
}

.clan-preset-name {
  font-size: 14px;
  font-weight: 600;
  color: #eee;
  flex: 1;
  text-align: right;
}

.clan-preset-form-actions {
  display: flex;
  gap: 10px;
  margin-top: 8px;
}

.clan-preset-form-actions .clans-action-btn,
.clan-preset-form-actions .clan-btn {
  flex: 1;
}

.clan-btn--sm {
  padding: 6px 12px;
  font-size: 12px;
}
