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

.clans-top {
  display: flex;
  align-items: center;
  gap: 10px;
  direction: ltr;
  max-width: 100%;
  min-width: 0;
}

.clans-back-btn {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: rgba(23, 23, 23, 0.8);
  color: #fff;
  font-size: 16px;
  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-create-btn {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 90px;
  margin-left: auto;
  padding: 0;
  border: 0;
  background: transparent;
  text-decoration: none;
  cursor: pointer;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
  transition: transform 0.12s, filter 0.12s;
}

.clans-create-btn img {
  display: block;
  width: min(150px, 36vw);
  height: min(150px, 36vw);
  max-width: 100%;
  object-fit: contain;
  pointer-events: none;
}

.clans-create-btn:hover {
  transform: translateY(-1px);
  filter: brightness(1.08);
}

.clans-create-btn[hidden] {
  display: none !important;
}

.clans-search-wrap {
  display: flex;
  align-items: center;
  gap: 4px;
  flex: 1 1 auto;
  width: min(140px, 100%);
  max-width: 140px;
  min-width: 0;
  padding: 0 6px;
  background: rgba(23, 23, 23, 0.8);
  border: 1px solid rgba(255, 255, 255, 0.12);
  min-height: 30px;
  box-sizing: border-box;
}

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

.clans-action-btn {
  width: 100%;
  padding: 12px 16px;
  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;
}

.app-main--clan-profile .modal {
  background: url("/icons/bg-items.webp") center / 100% 100% no-repeat !important;
}

.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;
}

.clans-list-section {
  padding-bottom: var(--bottom-nav-clearance, calc(110px + env(safe-area-inset-bottom, 0px)));
}

.clans-pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  margin-top: 14px;
  padding: 4px 2px;
  font-family: "Iranian Sans", Tahoma, sans-serif;
  font-size: 13px;
  color: #ededed;
}

.clans-pagination[hidden] {
  display: none !important;
}

.clans-page-btn {
  width: 44px;
  height: 44px;
  min-width: 44px;
  min-height: 44px;
  padding: 0;
  border: 0;
  font-size: 0;
  line-height: 0;
  color: transparent;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}

.clans-page-btn--prev {
  background: url("/achievements/ui/achievement-previous.png") center / contain no-repeat;
}

.clans-page-btn--next {
  background: url("/achievements/ui/achievement-next.png") center / contain no-repeat;
}

.clans-page-btn:hover:not(:disabled) {
  filter: brightness(1.08);
}

.clans-page-btn:disabled {
  filter: grayscale(100%) opacity(0.45);
  cursor: default;
}

.clans-page-label {
  font-size: 0.75rem;
  font-weight: 700;
  color: rgba(255, 244, 216, 0.85);
  min-width: 3.2rem;
  text-align: center;
}

.clan-card {
  position: relative;
  display: flex;
  direction: ltr;
  align-items: center;
  gap: 2px;
  padding: 8px 8px;
  border: 0;
  background: url("/quests/quests-items-bg.webp") center / 100% 100% no-repeat !important;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.28);
  text-decoration: none;
  color: inherit;
  cursor: pointer;
  transition: transform 0.12s, filter 0.12s;
}

.clan-card-age-tag {
  position: absolute;
  top: 4px;
  left: 4px;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 8px;
  font-weight: 800;
  letter-spacing: -0.4px;
  line-height: 1;
  z-index: 2;
  pointer-events: none;
}

.clan-card-age-tag--plus18 {
  background: rgb(113 73 73 / 90%);
  color: #ffffff;
}

.clan-card-age-tag--minus18 {
  background: rgba(214, 188, 96, 0.92);
  color: #090909;
}

.clan-card:hover {
  transform: translateY(-1px);
  filter: brightness(1.04);
}

.clan-card-logo {
  width: 52px;
  height: 52px;
  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: 160px;
  height: 160px;
}

.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: 44px;
  height: 44px;
  flex-shrink: 0;
}

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

.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: 68px;
  height: 68px;
}

.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: 51px;
  height: 51px;
}

.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: 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: 6px;
}

.clan-card-body {
  flex: 1;
  min-width: 0;
  direction: rtl;
  text-align: right;
}

.clan-card-name-row {
  display: flex;
  direction: rtl;
  align-items: center;
  gap: 8px;
  margin-bottom: 4px;
}

.clan-level-icon {
  display: block;
  object-fit: contain;
  flex-shrink: 0;
}

.clan-level-icon--card {
  width: 48px;
  height: 48px;
}

.clan-level-icon--profile {
  width: 28px;
  height: 28px;
}

.clan-profile-rank-stat {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  margin: 0 0 4px;
  font-size: 13px;
  color: #d0c8cc;
}

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

.clan-card-name {
  flex: 1;
  min-width: 0;
  font-size: 15px;
  font-weight: 700;
  color: #e0474b;
  margin-bottom: 0;
}

.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 — clear fixed bottom nav */
#clanProfileRoot {
  padding: var(--pages-frame-pad-top-clan, clamp(14px, 4.5vw, 62px))
    var(--pages-frame-pad-x-clan, clamp(10px, 3vw, 50px))
    var(--pages-frame-pad-bottom, clamp(14px, 2vw, 28px));
  padding-bottom: var(--bottom-nav-clearance, calc(110px + env(safe-area-inset-bottom, 0px)));
  max-width: 100%;
  min-width: 0;
  overflow-x: clip;
  box-sizing: border-box;
  padding-top: 38px;
}

.clan-profile-hero {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: 20px 16px;
  margin-bottom: 16px;
  background: url("/icons/bg-items.webp") center / 100% 100% no-repeat;
}

.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;
  background: #232325;
  overflow: hidden;
  border: 1px solid #5a4048;
}

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

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

.clan-profile-actions .clan-btn {
  background: url("/icons/btn-bg.webp") center / 100% 100% no-repeat;
  border: 1px solid #2c2713;
  border-radius: 8px;
}

.clan-btn {
  padding: 10px 16px;
  background: url("/icons/bg-items.webp") center / 100% 100% no-repeat;
  color: #d19d2f;
  font-family: inherit;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
  border:1px solid #d19d2f;
}

.clan-btn--primary {
  border-color: #0eb82d;
  color: #47e071;
}

.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;
  background: url("/icons/bg-items.webp") center / 100% 100% no-repeat;
}

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

.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;
  background: url("/icons/member-bg.webp") center / 100% 100% no-repeat;
  position: relative;
  overflow: visible;
}

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

.clan-member-avatar,
video.clan-member-avatar.avatar-media--video {
  width: calc(100% / var(--avatar-frame-scale, 1.52));
  height: calc(100% / var(--avatar-frame-scale, 1.52));
  border-radius: 50%;
  object-fit: cover;
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  display: block;
  pointer-events: none;
  background: #000;
  z-index: 1;
}

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

.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 {
  position: relative;
  flex-shrink: 0;
}

.clan-member-menu-btn {
  width: 34px;
  height: 34px;
  padding: 0;
  border: 1px solid #2c2713;
  border-radius: 8px;
  background: url("/icons/btn-bg.png") center / 100% 100% no-repeat;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.clan-member-menu-icon {
  display: block;
  width: 14px;
  height: 2px;
  background: #e0b83a;
  box-shadow: 0 -5px 0 #e0b83a, 0 5px 0 #e0b83a;
}

.clan-member-menu {
  position: absolute;
  top: calc(100% + 4px);
  inset-inline-end: 0;
  z-index: 20;
  min-width: min(148px, 70vw);
  max-width: min(220px, calc(100vw - 24px));
  padding: 6px;
  border: 1px solid #2c2713;
  border-radius: 10px;
  background: url("/icons/bg-items.webp") center / 100% 100% no-repeat;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.45);
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.clan-member-menu[hidden] {
  display: none !important;
}

.clan-member-menu-item {
  width: 100%;
  padding: 8px 10px;
  font-size: 12px;
  font-family: inherit;
  font-weight: 600;
  text-align: right;
  border: 1px solid #47390e;
  border-radius: 8px;
  background: url("/icons/btn-bg.png") center / 100% 100% no-repeat;
  color: #fff;
  cursor: pointer;
}

.clan-member-menu-item:hover,
.clan-member-menu-item:focus-visible {
  filter: brightness(1.08);
  outline: none;
}

.clan-member-personal-tag {
  flex-shrink: 0;
  max-width: 7.5em;
  padding: 3px 8px;
  font-size: 11px;
  font-weight: 600;
  color: #e0b83a;
  border: 1px solid #47390e;
  border-radius: 8px;
  background: rgba(0, 0, 0, 0.4);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  pointer-events: none;
}

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

.clan-friend-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 10px;
  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;
}

.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: 1px solid #5a4048;
  background: #161617;
  color: #fff;
  font-family: inherit;
  font-size: 13px;
}

.clan-friends-toolbar {
  margin: 0 0 14px;
}

.clan-friends-toolbar .clans-action-btn {
  width: 100%;
}

.clan-combobox {
  position: relative;
}

.clan-combobox-hint {
  margin: 6px 0 0;
  font-size: 11px;
  color: rgba(255, 255, 255, 0.55);
  line-height: 1.4;
}

.clan-combobox-list {
  position: absolute;
  z-index: 20;
  top: calc(100% + 4px);
  left: 0;
  right: 0;
  margin: 0;
  padding: 6px;
  list-style: none;
  max-height: 240px;
  overflow-y: auto;
  border: 1px solid #5a4048;
  background: #1a1a1c;
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.45);
}

.clan-combobox-option {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  cursor: pointer;
}

.clan-combobox-option:hover,
.clan-combobox-option:focus {
  background: rgba(184, 14, 19, 0.18);
  outline: none;
}

.clan-combobox-option-text {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.clan-combobox-option-name {
  font-size: 13px;
  font-weight: 600;
  color: #ededed;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.clan-combobox-option-tag {
  font-size: 11px;
  color: rgba(255, 255, 255, 0.6);
}

.clan-combobox-empty {
  padding: 10px;
  font-size: 12px;
  color: rgba(255, 255, 255, 0.55);
  text-align: center;
}

.clan-logo-wrap--combo {
  width: 28px;
  height: 28px;
  flex-shrink: 0;
}

.clan-logo-wrap--combo .clan-logo-img,
.clan-logo-wrap--combo .clan-logo-frame {
  width: 28px;
  height: 28px;
}

.clan-rich-field {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.clan-rich-preview {
  min-height: 42px;
  padding: 10px 12px;
  border: 1px solid #5a4048;
  background: #161617;
  color: #fff;
  font-size: 15px;
  line-height: 1.4;
  word-break: break-word;
}

.clan-rich-preview--tag {
  font-size: 13px;
  color: #d4a574;
}

.clan-rich-preview-empty {
  color: #666;
}

.clan-rich-editor-modal {
  max-width: 420px;
}

.clan-rich-editor-body {
  padding: 0 16px 16px;
}

.clan-rich-editor-hint {
  margin: 0 0 10px;
  font-size: 11px;
  color: #aaa;
  line-height: 1.5;
}

.clan-rich-editor-canvas {
  text-align: left;
  direction: ltr;
  min-height: 56px;
  max-height: 120px;
  overflow-y: auto;
  padding: 10px 12px;
  border: 1px solid #5a4048;
  background: #161617;
  color: #fff;
  font-family: inherit;
  font-size: 15px;
  line-height: 1.4;
  outline: none;
}

.clan-rich-editor-canvas:focus {
  border-color: #B80E13;
}

.clan-rich-editor-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin: 10px 0 12px;
}

.clan-rich-editor-color-label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: #ccc;
}

.clan-rich-editor-color-label input[type="color"] {
  width: 36px;
  height: 28px;
  padding: 0;
  border: none;
  background: transparent;
  cursor: pointer;
}

.clan-rich-editor-len {
  margin-right: auto;
  font-size: 11px;
  color: #888;
}

.clan-rich-editor-len.is-over {
  color: #ff6b6b;
}

.clan-rich-inline span {
  display: inline;
}

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

.clan-logo-option {
  width: 48px;
  height: 48px;
  padding: 4px;
  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);
  overflow-x: hidden;
}

.clan-logo-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  padding: 4px 0 12px;
  min-height: 96px;
  max-height: min(52vh, 420px);
  overflow-x: hidden;
  overflow-y: auto;
  min-width: 0;
  width: 100%;
  box-sizing: border-box;
}

.clan-logo-grid-item {
  position: relative;
  aspect-ratio: 1;
  width: 80%;
  max-width: 100%;
  margin-inline: auto;
  padding: 6px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: #161617;
  cursor: pointer;
  min-width: 0;
  box-sizing: border-box;
}

.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: 3px;
  right: 3px;
  bottom: 3px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 2px;
  padding: 2px 3px;
  font-size: 9px;
  font-weight: 700;
  background: rgba(14, 14, 15, 0.9);
}

.clan-logo-badge img {
  width: 10px;
  height: 10px;
  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: 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;
  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);
}

.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;
}

.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;
}

.clan-age-desc {
  margin: 0 0 14px;
  font-size: 13px;
  line-height: 1.7;
  color: rgba(255, 255, 255, 0.82);
}

.clan-age-check {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  margin: 0 0 10px;
  font-size: 14px;
  cursor: pointer;
}

.clan-age-check input {
  margin-top: 3px;
  flex-shrink: 0;
}

#clanAgeBracketSave:disabled,
#clanAgeBracketSave.is-disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.clan-saved-rules-modal {
  max-width: 520px;
}

.clan-saved-rules-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 12px;
  max-height: 240px;
  overflow-y: auto;
}

.clan-saved-rule-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
  padding: 10px;
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.clan-saved-rule-meta {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 0;
  flex: 1;
}

.clan-saved-rule-name {
  font-weight: 700;
}

.clan-saved-rule-sub {
  font-size: 12px;
  opacity: 0.75;
}

.clan-saved-rule-meta audio {
  width: 100%;
  max-width: 280px;
}

.clan-saved-rules-divider {
  border: 0;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  margin: 14px 0;
}

.clan-saved-rules-form-title {
  margin: 0 0 10px;
  font-size: 15px;
}

.clan-saved-rules-record-row {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.clan-saved-rules-status {
  margin: 8px 0;
  font-size: 13px;
  opacity: 0.85;
}

.clan-member-row, .clan-btn{
  border-color: 1px solid #2c2713;
}

.clan-create-page {
  max-width: 520px;
  margin: 0 auto;
  padding-bottom: var(--bottom-nav-clearance, calc(110px + env(safe-area-inset-bottom, 0px)));
}

.clan-create-title {
  margin: 0;
  flex: 1;
  text-align: center;
}

.clan-create-form {
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding: 14px;
  border-radius: 14px;
  background: url("/icons/bg-items.webp") center / 100% 100% no-repeat;
}

.clan-create-logo-row {
  display: flex;
  align-items: center;
  gap: 12px;
}

.clan-create-logo-preview {
  width: 72px;
  height: 72px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 12px;
  border: 1px solid #5a4048;
  background: rgba(0, 0, 0, 0.25);
}

.clan-create-logo-preview img {
  width: 56px;
  height: 56px;
  object-fit: contain;
}

.clan-create-price-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid rgba(224, 184, 58, 0.28);
  background: rgba(0, 0, 0, 0.22);
  font-size: 13px;
  color: #d0c8cc;
}

.clan-create-price-gem {
  width: 18px;
  height: 18px;
}

.clan-create-price-row strong {
  color: #ffd56a;
}

.clan-create-price-balance {
  margin-inline-start: auto;
  font-size: 12px;
  color: #9a8a90;
}

/* ClanNotification */
.clan-notification-modal {
  max-width: min(560px, 96vw);
  width: 100%;
}

.clan-notif-intro {
  margin: 0 0 14px;
  font-size: 13px;
  line-height: 1.6;
  color: #d0c8cc;
  text-align: right;
}

.clan-notif-remaining {
  margin: 0 0 12px;
  font-size: 13px;
  color: #d0c8cc;
}

.clan-notif-members-hint {
  margin: 8px 0 0;
  font-size: 12px;
  color: #9a8a90;
}

.clan-notif-members-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
  gap: 8px;
  max-height: min(40vh, 280px);
  overflow: auto;
  padding: 4px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(0, 0, 0, 0.2);
}

.clan-notif-member-cell {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 8px 10px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: rgba(23, 23, 23, 0.85);
  color: #f2e9ec;
  font-size: 13px;
  text-align: center;
  cursor: pointer;
  user-select: none;
  transition: background 0.12s, border-color 0.12s, color 0.12s;
}

.clan-notif-member-cell:hover {
  border-color: rgba(184, 14, 19, 0.45);
  background: rgba(255, 255, 255, 0.08);
}

.clan-notif-member-cell.is-selected {
  border-color: rgba(184, 14, 19, 0.85);
  background: rgba(184, 14, 19, 0.28);
  color: #fff;
}

.clan-notif-confirm-text {
  margin: 0 0 16px;
  font-size: 14px;
  line-height: 1.6;
  color: #e8dee2;
  white-space: pre-wrap;
}

@media (max-width: 480px) {
  .clan-notif-members-grid {
    grid-template-columns: repeat(auto-fill, minmax(96px, 1fr));
  }
}

@media (max-width: 360px) {
  .clans-create-btn {
    height: auto;
  }

  .clans-create-btn img {
    width: min(120px, 34vw);
    height: min(120px, 34vw);
  }

  .clan-logo-wrap--preview {
    width: min(112px, 40vw);
    height: min(112px, 40vw);
  }
}

.clan-btn--with-dot {
  position: relative;
}

.clan-btn-dot {
  position: absolute;
  top: 4px;
  inset-inline-end: 6px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #e53935;
  box-shadow: 0 0 0 2px rgba(0, 0, 0, 0.35);
}

.clan-messages-modal {
  max-width: 480px;
  width: calc(100% - 24px);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  max-height: min(85vh, 640px);
}

.clan-messages-modal .modal-header {
  flex-shrink: 0;
}

.clan-messages-body {
  display: flex;
  flex-direction: column;
  gap: 12px;
  flex: 1 1 auto;
  min-height: 0;
  overflow: hidden;
}

.clan-messages-list {
  height: min(42vh, 320px);
  flex: 0 0 auto;
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior: contain;
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 4px 2px;
  -webkit-overflow-scrolling: touch;
}

.clan-messages-empty {
  margin: 0;
  padding: 24px 12px;
  text-align: center;
  color: #a89ea3;
  font-size: 13px;
}

.clan-message-item {
  display: flex;
  gap: 10px;
  align-items: flex-start;
}

.clan-message-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
  background: rgba(0, 0, 0, 0.2);
}

.clan-message-content {
  flex: 1;
  min-width: 0;
}

.clan-message-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 6px;
  margin-bottom: 4px;
}

.clan-message-name {
  font-size: 10px;
  font-weight: 700;
  color: #797979;
}

.clan-message-time {
  font-size: 11px;
  color: #9a8f94;
  margin-inline-start: auto;
}

.clan-message-body {
  margin: 0;
  font-size: 13px;
  line-height: 1.6;
  color: #ddd4d8;
  white-space: pre-wrap;
  word-break: break-word;
}

.clan-messages-compose {
  flex: 0 0 auto;
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding-top: 8px;
  margin-top: auto;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.clan-messages-compose[hidden] {
  display: none !important;
}

.clan-messages-remaining {
  margin: 0;
  font-size: 12px;
  color: #c4b8bd;
}

.clan-messages-input {
  width: 100%;
  box-sizing: border-box;
  padding: 10px 12px;
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(0, 0, 0, 0.25);
  color: #f0e8ec;
  font: inherit;
  resize: none;
  min-height: 72px;
  max-height: 96px;
}

.clan-reports-page {
  max-width: 640px;
  margin: 25px 0;
  padding: 10px 18px;
  min-width: 0;
}

.clan-reports-toolbar {
  margin-bottom: 12px;
}

.clan-reports-title {
  margin: 0;
  flex: 1;
  font-size: 18px;
  font-weight: 700;
  color: #f3e9ed;
  text-align: center;
}

.clan-reports-ranges {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.clan-reports-range {
  flex: 1 1 0;
  min-width: 0;
  padding: 8px 6px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: rgba(23, 23, 23, 0.75);
  color: #e8dce1;
  font: inherit;
  font-size: 13px;
  cursor: pointer;
}

.clan-reports-range.is-active {
  border-color: rgba(196, 163, 90, 0.7);
  background: rgba(196, 163, 90, 0.18);
  color: #f5e6c8;
}

.clan-reports-hero {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 12px;
}

.clan-reports-clan-name {
  margin: 0;
  font-size: 16px;
}

.clan-reports-kpis {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin-bottom: 12px;
}

.clan-kpi {
  padding: 10px 12px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(0, 0, 0, 0.28);
  min-width: 0;
}

.clan-kpi span {
  display: block;
  font-size: 11px;
  color: #b7a8ae;
  margin-bottom: 4px;
}

.clan-kpi strong {
  font-size: 16px;
  color: #f4ecef;
}

.clan-report-card {
  margin: 0 0 14px;
  padding: 12px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(0, 0, 0, 0.22);
}

.clan-report-card h3 {
  margin: 0 0 10px;
  font-size: 14px;
  color: #f0e4c8;
}

.clan-reports-hint,
.clan-reports-empty,
.clan-reports-footnote {
  margin: 0 0 10px;
  font-size: 12px;
  line-height: 1.6;
  color: #b7a8ae;
}

.clan-reports-footnote {
  margin-top: 8px;
}

.clan-reports-back-wrap {
  text-align: center;
  margin-top: 12px;
}

.clan-line {
  direction: ltr;
  min-width: 0;
}

.clan-line-svg {
  display: block;
  width: 100%;
  height: 132px;
}

.clan-line-labs {
  display: flex;
  gap: 2px;
  margin-top: 4px;
}

.clan-line-lab {
  flex: 1 1 0;
  min-width: 0;
  font-size: 9px;
  line-height: 1.2;
  color: #9a8f94;
  text-align: center;
  word-break: break-word;
}

.clan-chart--v {
  display: flex;
  align-items: stretch;
  gap: 4px;
  min-height: 140px;
}

.clan-chart-col {
  flex: 1 1 0;
  min-width: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
}

.clan-chart-val {
  font-size: 10px;
  color: #d8cfd3;
}

.clan-chart-track {
  flex: 1;
  width: 100%;
  max-width: 22px;
  min-height: 88px;
  background: rgba(255, 255, 255, 0.06);
  display: flex;
  align-items: flex-end;
}

.clan-chart-fill {
  width: 100%;
  min-height: 0;
}

.clan-chart-lab {
  font-size: 9px;
  line-height: 1.2;
  color: #9a8f94;
  text-align: center;
  word-break: break-word;
}

.clan-chart--h {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.clan-hbar {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(0, 1.4fr) auto;
  align-items: center;
  gap: 8px;
}

.clan-hbar-who {
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
  font-size: 13px;
}

.clan-hbar-who span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.clan-report-avatar {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
}

.clan-hbar-track {
  height: 8px;
  background: rgba(255, 255, 255, 0.08);
  min-width: 0;
}

.clan-hbar-fill {
  height: 100%;
  background: #c4a35a;
}

.clan-hbar-val {
  font-size: 12px;
  color: #f0e4c8;
  min-width: 1.6em;
  text-align: start;
}

.clan-report-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.clan-report-chip {
  padding: 6px 10px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(255, 255, 255, 0.04);
  font-size: 12px;
}

@media (max-width: 420px) {
  .clan-reports-kpis {
    grid-template-columns: 1fr 1fr;
  }

  .clan-hbar {
    grid-template-columns: minmax(0, 1fr) auto;
    grid-template-rows: auto auto;
  }

  .clan-hbar-track {
    grid-column: 1 / -1;
    grid-row: 2;
  }
}
