/* ========== ЭКРАН КЛАНОВ ========== */

/* === ОПТИМИЗАЦИЯ ДЛЯ ANDROID === */
html[data-platform="android"] #clan-screen {
    background-attachment: scroll !important;
}

/* Фон экрана кланов - величественный замок/гильдия */
#clan-screen {
    min-height: 100vh;
    background:
        url('../assets/bg-clan.svg?v=3') center top / cover no-repeat fixed,
        linear-gradient(180deg, #0a0520 0%, #1a1040 30%, #2d1b5e 60%, #0f0828 100%) !important;
}

/* Android: фиксированный фон может лагать, используем scroll */
html[data-platform="android"] #clan-screen {
    background:
        url('../assets/bg-clan.svg?v=3') center top / cover no-repeat scroll,
        linear-gradient(180deg, #0a0520 0%, #1a1040 30%, #2d1b5e 60%, #0f0828 100%) !important;
}



/* ========== HEADER ========== */
.clan-header {
    padding: 1rem 0 0.5rem;
    text-align: center;
}

.clan-title {
    font-size: 1.625rem;
    font-weight: 700;
    color: #FFFFFF;
    margin: 0;
    padding: 0;
    border: none;
    outline: none;
    text-shadow: 0 2px 8px rgba(139, 92, 246, 0.5);
}

/* ========== SEARCH ========== */
.clan-search-container {
    padding: 1rem 1rem 0.5rem;
}

.clan-search-wrapper {
    display: flex;
    gap: 0.5rem;
    padding: 0.5rem;
    background: #13182b;
    border: 2px solid #252d4a;
    border-radius: 25px;
}

.clan-search-input {
    flex: 1;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    background: #0a0e1a;
    border-radius: 15px;
}

.clan-search-icon {
    font-size: 1rem;
    opacity: 0.6;
}

.clan-input {
    flex: 1;
    background: transparent;
    border: none;
    outline: none;
    color: #FFFFFF;
    font-size: 0.875rem;
}

.clan-input::placeholder {
    color: #5a6a8f;
}

.clan-sort-btn {
    width: 55px;
    height: 30px;
    background: linear-gradient(135deg, #5a6fbd 0%, #3d4a8f 100%);
    border: none;
    border-radius: 15px;
    color: #FFFFFF;
    font-size: 1rem;
    cursor: pointer;
    transition: transform 0.2s;
}

.clan-sort-btn:active {
    transform: scale(0.95);
}

/* Sort Dropdown */
.clan-sort-dropdown {
    position: relative;
}

.clan-sort-menu {
    position: absolute;
    top: calc(100% + 8px);
    left: 0;
    background: #13182b;
    border: 1.5px solid #3d4a6e;
    border-radius: 12px;
    padding: 0.5rem 0;
    min-width: 150px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
    z-index: 9999;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.2s ease;
}

.clan-sort-dropdown.open .clan-sort-menu {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.clan-sort-option {
    display: block;
    width: 100%;
    padding: 0.6rem 1rem;
    background: transparent;
    border: none;
    color: #8fa3d1;
    font-size: 0.8rem;
    font-weight: 600;
    text-align: left;
    cursor: pointer;
    transition: all 0.15s;
}

.clan-sort-option:hover {
    background: rgba(99, 102, 241, 0.15);
    color: #b4c5ff;
}

.clan-sort-option.active {
    color: #6366f1;
    background: rgba(99, 102, 241, 0.1);
}

.clan-sort-option.active::before {
    content: '✓ ';
}

/* ========== FILTERS ========== */
.clan-filters {
    display: flex;
    gap: 0.5rem;
    padding: 0 1rem 1rem;
    flex-wrap: nowrap;
    align-items: center;
    position: relative;
    overflow: visible;
    justify-content: center;
    /* Center buttons */
}

/* Base button style */
.clan-filter-btn {
    padding: 0.4rem 0.7rem;
    border-radius: 14px;
    font-size: 0.7rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s;
    border: 1.5px solid;
    white-space: nowrap;
    flex-shrink: 0;
}

.clan-filter-btn:active {
    transform: scale(0.95);
}

/* Filter variants */
.clan-filter-btn.filter-rating {
    background: #252d4a;
    border-color: #3d4a6e;
    color: #8fa3d1;
}

.clan-filter-btn.filter-rating.active {
    background: #3d4a6e;
    border-color: #5a6fbd;
    color: #b4c5ff;
}

.clan-filter-btn.filter-active {
    background: #1a4d3e;
    border-color: #2d7a5f;
    color: #5aecc0;
}

.clan-filter-btn.filter-top {
    background: #4a2533;
    border-color: #7a3d57;
    color: #ec5a9d;
}

.clan-filter-btn.filter-top.active {
    background: #7a3d57;
    border-color: #f472b6;
}

/* Create button variant */
.clan-filter-btn.filter-create {
    background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
    border-color: #60a5fa;
    color: #FFFFFF;
}

.clan-filter-btn.filter-create:active {
    background: linear-gradient(135deg, #2563eb 0%, #1d4ed8 100%);
}

/* ========== LIST HEADER ========== */
.clan-list-header {
    padding: 0.75rem 1rem;
    font-size: 0.8125rem;
    font-weight: 700;
    color: #5a6a8f;
    letter-spacing: 0.5px;
    text-align: center;
    /* Center text */
}

/* ========== CLAN CARDS GRID ========== */
.clan-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(160px, 1fr));
    gap: 0.75rem;
    padding: 0 calc(0.75rem + 2.5px) 2rem;
    width: 100%;
    box-sizing: border-box;
    justify-content: center;
}

.clan-card {
    --clan-color: #8b5cf6;
    background: #13182b;
    border: 2.5px solid var(--clan-color);
    border-radius: 15px;
    overflow: hidden;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
}

.clan-card:active {
    transform: scale(0.98);
}

.clan-card-header {
    height: 45px;
    background: var(--clan-color);
    opacity: 0.15;
    border-radius: 12px 12px 0 0;
    margin: -2px -2px 0 -2px;
}

.clan-card-emblem {
    width: 54px;
    height: 54px;
    margin: -28px auto 0;
    background: #1a1d29;
    border: 3px solid var(--clan-color);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.75rem;
    position: relative;
    z-index: 1;
}

.clan-card-name {
    text-align: center;
    font-size: 0.875rem;
    font-weight: 700;
    color: #FFFFFF;
    margin-top: 0.5rem;
    padding: 0 0.5rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.clan-card-divider {
    width: 60%;
    height: 2px;
    background: linear-gradient(90deg, transparent, var(--clan-color), transparent);
    margin: 0.4rem auto;
    border-radius: 1px;
}

.clan-card-stats {
    padding: 0.5rem 0.75rem 0.75rem;
}

.clan-stat {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.25rem;
}

.clan-stat:last-child {
    margin-bottom: 0;
}

.clan-stat-label {
    font-size: 0.7rem;
    color: #cbd5e1;
}

.clan-stat-value {
    font-size: 0.7rem;
    font-weight: 700;
    color: var(--clan-color);
}

.clan-stat-value.rating {
    color: #fbbf24;
}

/* ========== CLAN MODALS ========== */
.clan-modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    padding: 1rem;
    padding-top: calc(1rem + 75px);
}

.clan-modal {
    --clan-color: #8b5cf6;
    background: #13182b;
    border: 2px solid var(--clan-color);
    border-radius: 20px;
    width: 100%;
    max-width: 340px;
    max-height: 80vh;
    overflow-y: auto;
    padding: 1.5rem;
    position: relative;
    animation: modalSlideIn 0.3s ease;
}

@keyframes modalSlideIn {
    from {
        opacity: 0;
        transform: scale(0.9);
    }

    to {
        opacity: 1;
        transform: scale(1);
    }
}

.clan-modal-close {
    position: absolute;
    top: 0.75rem;
    right: 0.75rem;
    background: rgba(255, 255, 255, 0.1);
    border: none;
    color: #888;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    font-size: 1.25rem;
    cursor: pointer;
    transition: all 0.2s;
}

.clan-modal-close:hover {
    background: rgba(255, 255, 255, 0.2);
    color: #fff;
}

.clan-modal-header {
    text-align: center;
    margin-bottom: 1rem;
}

.clan-modal-emblem {
    width: 70px;
    height: 70px;
    margin: 0 auto 0.75rem;
    background: #1a1d29;
    border: 3px solid var(--clan-color);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2.25rem;
}

.clan-modal-name {
    font-size: 1.25rem;
    font-weight: 700;
    color: #fff;
    margin: 0;
}

.clan-modal-level {
    font-size: 0.75rem;
    color: var(--clan-color);
    margin-top: 0.25rem;
}

.clan-modal-title {
    font-size: 1.25rem;
    font-weight: 700;
    color: #fff;
    margin: 0;
    text-align: center;
}

.clan-modal-divider {
    width: 60%;
    height: 2px;
    background: linear-gradient(90deg, transparent, var(--clan-color), transparent);
    margin: 0.75rem auto;
}

.clan-modal-stats {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    margin-bottom: 1rem;
}

.clan-modal-stat {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.5rem 0.75rem;
    background: rgba(255, 255, 255, 0.03);
    border-radius: 8px;
}

.clan-modal-stat .label {
    font-size: 0.8rem;
    color: #cbd5e1;
}

.clan-modal-stat .value {
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--clan-color);
}

.clan-modal-stat .value.rating {
    color: #fbbf24;
}

.clan-modal-actions {
    margin-top: 1rem;
}

.clan-apply-btn {
    width: 100%;
    padding: 0.875rem;
    background: linear-gradient(135deg, var(--clan-color), color-mix(in srgb, var(--clan-color) 70%, #000));
    border: none;
    border-radius: 12px;
    color: #fff;
    font-size: 1rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s;
}

.clan-apply-btn:hover {
    transform: scale(1.02);
}

.clan-apply-btn:disabled,
.clan-apply-btn.sent {
    background: #1f2937;
    color: #10b981;
    cursor: default;
    transform: none;
}

/* ========== CREATE CLAN MODAL ========== */
.clan-create-form {
    margin-top: 1rem;
}

.clan-create-form .form-group {
    margin-bottom: 1rem;
}

.clan-create-form label {
    display: block;
    font-size: 0.75rem;
    color: #8fa3d1;
    margin-bottom: 0.5rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.clan-create-form input[type="text"] {
    width: 100%;
    padding: 0.75rem 1rem;
    background: #0a0e1a;
    border: 1.5px solid #252d4a;
    border-radius: 10px;
    color: #fff;
    font-size: 0.9rem;
    outline: none;
    transition: border-color 0.2s;
}

.clan-create-form input[type="text"]:focus {
    border-color: #5a6fbd;
}

.emblem-picker,
.logo-picker,
.color-picker {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.logo-picker {
    padding: 0.25rem;
}

.logo-option {
    width: 44px;
    height: 44px;
    background: #1a1d29;
    border: 2px solid #252d4a;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s;
    padding: 6px;
}

.logo-option img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.logo-option:hover {
    border-color: #5a6fbd;
    transform: scale(1.05);
}

.logo-option.selected {
    border-color: #ffd700;
    background: rgba(255, 215, 0, 0.15);
    box-shadow: 0 0 10px rgba(255, 215, 0, 0.3);
}

.emblem-option {
    width: 40px;
    height: 40px;
    background: #1a1d29;
    border: 2px solid #252d4a;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
    cursor: pointer;
    transition: all 0.2s;
}

.emblem-option:hover {
    border-color: #5a6fbd;
}

.emblem-option.selected {
    border-color: #ffd700;
    background: rgba(255, 215, 0, 0.1);
}

.color-option {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: 3px solid transparent;
    cursor: pointer;
    transition: all 0.2s;
}

.color-option:hover {
    transform: scale(1.1);
}

.color-option.selected {
    border-color: #fff;
    box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.3);
}

.clan-create-cost {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem;
    background: rgba(255, 215, 0, 0.05);
    border: 1px solid rgba(255, 215, 0, 0.2);
    border-radius: 10px;
    margin-bottom: 1rem;
    font-size: 0.85rem;
}

.clan-create-cost span:first-child {
    color: #8fa3d1;
}

.clan-create-cost .cost {
    font-weight: 700;
    color: #fbbf24;
}

.clan-create-btn {
    width: 100%;
    padding: 0.875rem;
    background: linear-gradient(135deg, #10b981, #059669);
    border: none;
    border-radius: 12px;
    color: #fff;
    font-size: 1rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s;
}

.clan-create-btn:hover {
    transform: scale(1.02);
    box-shadow: 0 4px 20px rgba(16, 185, 129, 0.3);
}

/* ========== MY CLAN SCREEN ========== */
.my-clan-view {
    display: none;
    padding: 1rem;
    padding-bottom: 5rem;
    animation: fadeIn 0.3s ease;
    width: 100%;
    box-sizing: border-box;
}

.my-clan-header {
    margin-bottom: 1.5rem;
    text-align: center;
    position: relative;
    padding: 1rem;
    background: radial-gradient(circle at center, rgba(var(--clan-color-rgb), 0.15) 0%, transparent 70%);
}

.my-clan-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}

.icon-btn {
    background: rgba(255, 255, 255, 0.1);
    border: none;
    border-radius: 50%;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 1.2rem;
    color: #fff;
    transition: all 0.2s;
}

.icon-btn:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: scale(1.1);
}

.my-clan-title {
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--clan-color, #fff);
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.5);
    margin-top: -50px;
}

.my-clan-logo-big {
    width: 120px;
    height: 120px;
    margin: 0 auto;
    filter: drop-shadow(0 0 20px var(--clan-color, #ffd700));
}

.my-clan-tabs-container {
    background: rgba(14, 18, 28, 0.8);
    border-radius: 12px;
    padding: 4px;
    margin-bottom: 1.5rem;
    border: 1px solid #252d4a;
}

.clan-tabs-slider {
    display: flex;
    gap: 0;
}

.clan-tab {
    flex: 1;
    text-align: center;
    padding: 0.6rem 0;
    font-size: 0.85rem;
    font-weight: 600;
    color: #8fa3d1;
    cursor: pointer;
    border-radius: 8px;
    transition: all 0.2s;
}

.clan-tab.active {
    background: #252d4a;
    color: #fff;
}

.my-clan-content {
    min-height: 200px;
}

.placeholder-msg {
    text-align: center;
    color: #6b7280;
    padding: 2rem;
    font-style: italic;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 12px;
    border: 1px dashed rgba(255, 255, 255, 0.1);
}

.guardian-info {
    text-align: center;
    margin-top: 1rem;
    color: #fff;
    font-size: 1.1rem;
}

.clan-create-submit {
    width: 100%;
    padding: 1rem;
    background: linear-gradient(135deg, #10b981, #059669);
    border: none;
    border-radius: 12px;
    color: #fff;
    font-size: 1rem;
    font-weight: 800;
    cursor: pointer;
    transition: all 0.2s;
    box-shadow: 0 4px 15px rgba(16, 185, 129, 0.3);
}

.clan-create-submit:hover {
    transform: scale(1.02);
    box-shadow: 0 6px 20px rgba(16, 185, 129, 0.4);
}

/* Updated Buttons */
.text-btn {
    background: rgba(255, 255, 255, 0.1);
    border: none;
    border-radius: 20px;
    padding: 0.5rem 1rem;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 0.9rem;
    font-weight: 600;
    color: #fff;
    transition: all 0.2s;
    backdrop-filter: blur(4px);
}

.text-btn:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: translateY(-2px);
}

/* Lower buttons and align */
.my-clan-top {
    align-items: flex-start;
}

.my-clan-top .text-btn,
.my-clan-top .icon-btn {
    margin-top: 20px;
}

/* Members List */
.clan-members-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-top: 1rem;
}

.clan-member-row {
    display: flex;
    align-items: center;
    background: rgba(0, 0, 0, 0.2);
    padding: 10px;
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.member-rank {
    width: 30px;
    font-weight: bold;
    color: #8fa3d1;
    text-align: center;
    font-size: 0.9rem;
}

.member-info {
    flex: 1;
    margin-left: 10px;
    display: flex;
    flex-direction: column;
}

.member-name {
    font-weight: bold;
    color: #fff;
    font-size: 1rem;
}

.member-role {
    font-size: 0.75rem;
    color: #aaa;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-top: 2px;
}

.member-role.leader {
    color: #ffd700;
}

.member-role.officer {
    color: #a855f7;
}

.member-level {
    font-size: 0.9rem;
    color: #ffd700;
    font-weight: bold;
    background: rgba(0, 0, 0, 0.3);
    padding: 4px 8px;
    border-radius: 6px;
}

/* Member Action Buttons */
.member-actions {
    display: flex;
    gap: 6px;
    margin-right: 12px;
}

.member-action-btn {
    width: 28px;
    height: 28px;
    border-radius: 6px;
    border: none;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.2s;
    background: rgba(255, 255, 255, 0.1);
    color: #ccc;
}

.member-action-btn:hover {
    background: rgba(255, 255, 255, 0.2);
    color: #fff;
}

.btn-kick:hover {
    background: #ef4444 !important;
}

.btn-promote:hover {
    background: #10b981 !important;
}

.btn-demote:hover {
    background: #f59e0b !important;
}

/* Empty slots */
.clan-member-row.empty {
    opacity: 0.4;
    border: 1px dashed rgba(255, 255, 255, 0.2);
    justify-content: center;
    align-items: center;
    color: #6b7280;
    font-style: italic;
    background: transparent;
    padding: 12px;
    min-height: 50px;
}

/* Generic Modal Styles */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(8px);
    z-index: 2000;
    display: none;
    align-items: center;
    justify-content: center;
}

.modal-content {
    background: #13182b;
    border: 1px solid #252d4a;
    border-radius: 20px;
    padding: 24px;
    width: 90%;
    max-width: 380px;
    position: relative;
    box-shadow: 0 0 50px rgba(0, 0, 0, 0.5);
    animation: fadeIn 0.3s ease;
}

.modal-title {
    font-size: 1.5rem;
    font-weight: 800;
    color: #fff;
    margin-bottom: 1.5rem;
    text-align: center;
}

.close-modal {
    position: absolute;
    top: 16px;
    right: 20px;
    color: #5a6a8f;
    font-size: 2rem;
    cursor: pointer;
    line-height: 1;
    transition: color 0.2s;
}

.close-modal:hover {
    color: #fff;
}


.settings-section {
    margin-bottom: 24px;
}

.settings-label {
    display: block;
    margin-bottom: 12px;
    color: #8fa3d1;
    font-weight: bold;
    font-size: 0.9rem;
}

.slots-info {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: rgba(0, 0, 0, 0.3);
    padding: 12px 16px;
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.slots-count {
    color: #fff;
    font-weight: bold;
}

.btn-buy-slots {
    background: linear-gradient(135deg, #10b981, #059669);
    border: none;
    padding: 8px 16px;
    border-radius: 8px;
    color: #fff;
    font-size: 13px;
    cursor: pointer;
    font-weight: 800;
    box-shadow: 0 4px 10px rgba(16, 185, 129, 0.2);
}

.btn-buy-slots:hover {
    transform: scale(1.05);
}

/* Request Action Buttons */
.btn-accept:hover {
    background: #10b981 !important;
    color: #fff !important;
}

.btn-reject:hover {
    background: #ef4444 !important;
    color: #fff !important;
}

/* =========================================
   ANDROID SPECIFIC OVERRIDES
   "Separate style for Android" (Custom Tuning)
   ========================================= */
html[data-platform="android"] .clan-grid {
    /* Custom Android padding/gap */
    padding: 0 25px 40px !important;
    gap: 8px !important;
    grid-template-columns: repeat(2, 1fr) !important;
    width: 100% !important;
    box-sizing: border-box !important;
    /* Force 2 columns strict */
}

html[data-platform="android"] .clan-card {
    /* Simplify shadows/transitions for performance on Android */
    box-shadow: none !important;
    transition: none !important;
    border-width: 1.5px !important;
}

html[data-platform="android"] .clan-card-emblem {
    /* Slightly smaller emblem on Android? */
    width: 48px !important;
    height: 48px !important;
    margin-top: -24px !important;
}

html[data-platform="android"] .clan-title {
    font-size: 1.4rem !important;
    /* Slightly smaller title */
}

/* =========================================
   GUARDIAN SYSTEM STYLES
   ========================================= */
.guardian-container {
    padding: 0;
}

.guardian-loading,
.guardian-error {
    text-align: center;
    padding: 40px 20px;
    color: #8fa3d1;
    font-style: italic;
}

.guardian-card {
    background: linear-gradient(145deg, rgba(20, 25, 45, 0.95) 0%, rgba(10, 14, 28, 0.98) 100%);
    border: 1px solid rgba(139, 92, 246, 0.3);
    border-radius: 20px;
    padding: 20px;
    text-align: center;
    position: relative;
    overflow: hidden;
}

.guardian-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 100px;
    background: radial-gradient(ellipse at center top, rgba(139, 92, 246, 0.2), transparent 70%);
    pointer-events: none;
}

.guardian-image-wrap {
    width: 160px;
    height: 160px;
    margin: 0 auto 12px;
    position: relative;
    z-index: 1;
}

.guardian-image {
    width: 100%;
    height: 100%;
    object-fit: contain;
    filter: drop-shadow(0 0 20px rgba(139, 92, 246, 0.5));
    animation: guardianPulse 3s ease-in-out infinite;
}

@keyframes guardianPulse {

    0%,
    100% {
        transform: scale(1);
        filter: drop-shadow(0 0 20px rgba(139, 92, 246, 0.5));
    }

    50% {
        transform: scale(1.02);
        filter: drop-shadow(0 0 30px rgba(139, 92, 246, 0.7));
    }
}

.guardian-level-badge {
    display: inline-block;
    background: linear-gradient(135deg, #8b5cf6, #6d28d9);
    color: #fff;
    font-weight: 800;
    font-size: 1rem;
    padding: 6px 20px;
    border-radius: 20px;
    margin-bottom: 16px;
    box-shadow: 0 4px 15px rgba(139, 92, 246, 0.4);
}

.guardian-stats {
    display: flex;
    justify-content: space-around;
    gap: 12px;
    margin-bottom: 16px;
}

.guardian-stat {
    display: flex;
    flex-direction: column;
    align-items: center;
    background: rgba(0, 0, 0, 0.3);
    padding: 10px 16px;
    border-radius: 12px;
    min-width: 70px;
}

.guardian-stat span:first-child {
    font-size: 0.75rem;
    color: #8fa3d1;
    margin-bottom: 4px;
}

.guardian-stat span:last-child {
    font-size: 1rem;
    color: #fff;
    font-weight: 700;
}

.guardian-xp-bar {
    position: relative;
    height: 24px;
    background: rgba(0, 0, 0, 0.4);
    border-radius: 12px;
    overflow: hidden;
}

.guardian-xp-fill {
    position: absolute;
    left: 0;
    top: 0;
    height: 100%;
    background: linear-gradient(90deg, #8b5cf6, #a78bfa);
    border-radius: 12px;
    transition: width 0.5s ease;
}

.guardian-xp-text {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.8rem;
    font-weight: 600;
    color: #fff;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.5);
}

/* Contribution Section */
.guardian-contributions {
    margin-top: 20px;
    padding: 16px;
    background: rgba(0, 0, 0, 0.2);
    border-radius: 16px;
}

/* 2x2 Contribution Grid */
.contribution-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
}

.contribution-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;
    background: linear-gradient(145deg, rgba(30, 35, 55, 0.9), rgba(20, 25, 40, 0.95));
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 14px;
    padding: 14px 10px;
    cursor: pointer;
    transition: all 0.2s;
    text-align: center;
    min-height: 100px;
}

.contribution-card:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.contrib-card-icon {
    font-size: 1.8rem;
}

.contrib-card-title {
    color: #fff;
    font-weight: 600;
    font-size: 0.85rem;
}

.contrib-card-cost {
    color: #8fa3d1;
    font-size: 0.75rem;
}

.contrib-card-xp {
    color: #a78bfa;
    font-weight: 700;
    font-size: 0.8rem;
    margin-top: 2px;
}

.contrib-timer {
    color: #fbbf24;
    font-size: 0.75rem;
    font-weight: 600;
    margin-top: 4px;
}

/* Item Donation Modal */
.donation-modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.85);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2000;
    padding: 20px;
}

.donation-modal {
    background: linear-gradient(145deg, #1a1f35, #0f1320);
    border: 1px solid rgba(139, 92, 246, 0.3);
    border-radius: 20px;
    padding: 20px;
    width: 100%;
    max-width: 400px;
    max-height: 70vh;
    overflow-y: auto;
}

.donation-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
}

.donation-modal-title {
    color: #fff;
    font-size: 1.1rem;
    font-weight: 700;
}

.donation-modal-close {
    background: none;
    border: none;
    color: #8fa3d1;
    font-size: 1.5rem;
    cursor: pointer;
}

.donation-item-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.donation-item {
    display: flex;
    align-items: center;
    gap: 12px;
    background: rgba(0, 0, 0, 0.3);
    border-radius: 12px;
    padding: 12px;
}

.donation-item-icon {
    font-size: 1.5rem;
}

.donation-item-info {
    flex: 1;
}

.donation-item-name {
    color: #fff;
    font-weight: 600;
    font-size: 0.9rem;
}

.donation-item-rarity {
    font-size: 0.75rem;
    opacity: 0.8;
}

.donation-item-btn {
    background: linear-gradient(135deg, #8b5cf6, #6d28d9);
    color: #fff;
    border: none;
    border-radius: 8px;
    padding: 8px 14px;
    font-size: 0.8rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.donation-empty {
    text-align: center;
    color: #8fa3d1;
    padding: 30px;
    font-style: italic;
}

/* SVG icon styling */
.donation-item-icon-svg {
    width: 40px;
    height: 40px;
    object-fit: contain;
    flex-shrink: 0;
}

/* Durability (gray, smaller) */
.donation-item-durability {
    font-size: 0.7rem;
    color: #6b7280;
    margin-top: 2px;
}

/* Gem warning */
.donation-item-warning {
    font-size: 0.7rem;
    color: #f59e0b;
    margin-top: 2px;
}

/* Disabled item (has gem) */
.donation-item-disabled {
    opacity: 0.5;
    pointer-events: none;
}

.donation-item-btn:disabled {
    background: #4b5563;
    cursor: not-allowed;
}

/* === CLAN WAR ANIMATIONS === */
.search-pulse {
    width: 60px;
    height: 60px;
    background: #fbbf24;
    border-radius: 50%;
    margin: 0 auto;
    position: relative;
    animation: searchPulse 1.5s infinite ease-in-out;
}

@keyframes searchPulse {
    0% {
        transform: scale(0.8);
        opacity: 0.5;
        box-shadow: 0 0 0 0 rgba(251, 191, 36, 0.7);
    }

    70% {
        transform: scale(1);
        opacity: 0.3;
        box-shadow: 0 0 0 20px rgba(251, 191, 36, 0);
    }

    100% {
        transform: scale(0.8);
        opacity: 0.5;
        box-shadow: 0 0 0 0 rgba(251, 191, 36, 0);
    }
}

.shake-anim {
    animation: shake 0.4s cubic-bezier(.36, .07, .19, .97) both;
    transform: translate3d(0, 0, 0);
}

@keyframes shake {

    10%,
    90% {
        transform: translate3d(-1px, 0, 0);
    }

    20%,
    80% {
        transform: translate3d(2px, 0, 0);
    }

    30%,
    50%,
    70% {
        transform: translate3d(-4px, 0, 0);
    }

    40%,
    60% {
        transform: translate3d(4px, 0, 0);
    }
}

@keyframes pulse {

    0%,
    100% {
        opacity: 1;
        transform: scale(1);
    }

    50% {
        opacity: 0.8;
        transform: scale(1.05);
    }
}

/* ========== LEAGUE TIERS ========== */
.clan-level-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    white-space: nowrap;
    background: rgba(255, 255, 255, 0.1);
    color: #cbd5e1;
}

.clan-level-badge.tier-bronze {
    background: linear-gradient(135deg, #cd7f32 0%, #8b5a2b 100%);
    color: #fff;
    box-shadow: 0 2px 8px rgba(205, 127, 50, 0.4);
}

.clan-level-badge.tier-silver {
    background: linear-gradient(135deg, #e8e8e8 0%, #a8a8a8 100%);
    color: #333;
    box-shadow: 0 2px 8px rgba(192, 192, 192, 0.5);
}

.clan-level-badge.tier-gold {
    background: linear-gradient(135deg, #ffd700 0%, #ffaa00 100%);
    color: #1a1a00;
    box-shadow: 0 2px 10px rgba(255, 215, 0, 0.5);
}

.clan-level-badge.tier-diamond {
    background: linear-gradient(135deg, #b9f2ff 0%, #7ee8fa 50%, #80c7d4 100%);
    color: #0a3d44;
    box-shadow: 0 2px 12px rgba(185, 242, 255, 0.6);
}

.clan-level-badge.tier-legend {
    background: linear-gradient(135deg, #ff6b35 0%, #f7931e 30%, #ffd700 50%, #f7931e 70%, #ff6b35 100%);
    color: #1a0500;
    box-shadow: 0 2px 15px rgba(255, 107, 53, 0.7), 0 0 20px rgba(247, 147, 30, 0.5);
    animation: legend-glow 2s ease-in-out infinite;
}