.search-section {
    max-width: 1100px !important;
}

.search-layout {
    display: grid;
    grid-template-columns: 1fr 350px;
    gap: 2rem;
    align-items: start;
}

.search-container {
    margin-bottom: 2rem;
}

@media (max-width: 992px) {
    .search-layout {
        grid-template-columns: 1fr;
    }
}

.clan-members-module {
    background: var(--surface-color);
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-color);
    overflow: hidden;
    box-shadow: var(--shadow-md);
    display: none;
}

.module-header {
    padding: 1.5rem;
    background: var(--surface-hover);
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.module-title {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--text-primary);
    margin: 0;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.member-count {
    font-size: 0.875rem;
    color: var(--text-secondary);
    background: var(--background-color);
    padding: 0.25rem 0.75rem;
    border-radius: 999px;
    font-weight: 600;
}

.members-list {
    max-height: 600px;
    overflow-y: auto;
    padding: 0;
    margin: 0;
    list-style: none;
}

.members-list::-webkit-scrollbar {
    width: 6px;
}

.members-list::-webkit-scrollbar-track {
    background: transparent;
}

.members-list::-webkit-scrollbar-thumb {
    background-color: var(--border-color);
    border-radius: 3px;
}

.member-item {
    display: grid;
    grid-template-columns: auto 1fr auto;
    gap: 1rem;
    padding: 0.75rem 1.25rem;
    border-bottom: 1px solid var(--border-color);
    transition: background-color 0.2s ease;
    align-items: center;
}

.member-item:last-child {
    border-bottom: none;
}

.member-item:hover {
    background-color: var(--surface-hover);
}

.member-rank {
    font-size: 1rem;
    font-weight: 700;
    color: var(--text-secondary);
    width: 1.5rem;
    text-align: center;
}

.member-rank.top-3 {
    color: var(--primary-color);
    font-size: 1.2rem;
}

.member-info {
    display: flex;
    flex-direction: column;
    gap: 0.125rem;
    overflow: hidden;
}

.member-name {
    font-weight: 600;
    color: var(--text-primary);
    font-size: 0.95rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.member-meta {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.75rem;
    color: var(--text-secondary);
}

.member-tag {
    font-family: monospace;
    opacity: 0.8;
    text-decoration: none;
    color: var(--text-secondary);
    transition: all 0.2s ease;
    cursor: pointer;
}

.member-tag:hover {
    color: var(--primary-color);
    opacity: 1;
    text-decoration: underline;
}

.member-role {
    padding: 0.125rem 0.375rem;
    border-radius: 4px;
    background: rgba(99, 102, 241, 0.1);
    color: var(--primary-color);
    font-weight: 500;
    font-size: 0.7rem;
    text-transform: capitalize;
}

.member-trophies {
    display: flex;
    align-items: center;
    gap: 0.375rem;
    font-weight: 600;
    color: #fbbf24;
    font-size: 0.9rem;
}

.trophy-icon {
    font-size: 0.9rem;
}

.comparison-section {
    background: var(--surface-color);
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-color);
    padding: 1.5rem;
    margin-bottom: 2rem;
    box-shadow: var(--shadow-sm);
}

.comparison-header {
    text-align: center;
    margin-bottom: 1.5rem;
}

.comparison-header h3 {
    margin: 0 0 0.5rem 0;
    font-size: 1.25rem;
    color: var(--text-primary);
}

.comparison-header p {
    margin: 0;
    color: var(--text-secondary);
    font-size: 0.9rem;
}

.comparison-container {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    gap: 1rem;
    align-items: center;
    margin-bottom: 1.5rem;
}

.vs-divider {
    font-weight: 800;
    color: var(--text-secondary);
    font-size: 1.2rem;
    opacity: 0.5;
}

.drop-zone {
    border: 2px dashed var(--border-color);
    border-radius: var(--radius-md);
    min-height: 120px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--background-color);
    transition: all 0.2s ease;
    position: relative;
}

.drop-zone.drag-over {
    border-color: var(--primary-color);
    background: rgba(99, 102, 241, 0.05);
    transform: scale(1.02);
}

.drop-placeholder {
    text-align: center;
    color: var(--text-secondary);
    pointer-events: none;
}

.drop-icon {
    font-size: 2rem;
    display: block;
    margin-bottom: 0.5rem;
    opacity: 0.5;
}

.drop-placeholder p {
    margin: 0;
    font-size: 0.9rem;
    font-weight: 500;
}

.comparison-results {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1px;
    background: var(--border-color);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    overflow: hidden;
    margin-top: 1.5rem;
}

.comparison-column {
    background: var(--surface-color);
    padding: 1rem;
}

.comp-header {
    text-align: center;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--border-color);
    margin-bottom: 1rem;
}

.comp-name {
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 0.25rem;
}

.comp-tag {
    font-size: 0.8rem;
    color: var(--text-secondary);
    font-family: monospace;
}

.comp-stat-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem 0;
    border-bottom: 1px solid var(--border-color);
    font-size: 0.9rem;
}

.comp-stat-row:last-child {
    border-bottom: none;
}

.comp-label {
    color: var(--text-secondary);
}

.comp-value {
    font-weight: 600;
    color: var(--text-primary);
    display: flex;
    flex-direction: column;
    align-items: flex-end;
}

.diff-badge {
    font-size: 0.75rem;
    font-weight: 700;
    padding: 0.1rem 0.3rem;
    border-radius: 4px;
    margin-top: 0.2rem;
}

.diff-positive {
    color: #10b981;
    background: rgba(16, 185, 129, 0.1);
}

.diff-negative {
    color: #ef4444;
    background: rgba(239, 68, 68, 0.1);
}

.reset-comparison-btn {
    display: block;
    width: 100%;
    margin-top: 1rem;
    padding: 0.75rem;
    background: var(--surface-hover);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    color: var(--text-secondary);
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.reset-comparison-btn:hover {
    background: var(--border-color);
    color: var(--text-primary);
}

.member-item[draggable="true"] {
    cursor: grab;
}

.member-item[draggable="true"]:active {
    cursor: grabbing;
}

.member-item.dragging {
    opacity: 0.5;
    background: var(--surface-hover);
    border: 1px dashed var(--primary-color);
}

.member-item.selected {
    background: rgba(99, 102, 241, 0.15);
    border-left: 3px solid var(--primary-color);
}

.slot-selection-prompt {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    animation: fadeIn 0.2s ease;
}

.prompt-content {
    background: var(--surface-color);
    border-radius: var(--radius-lg);
    padding: 2rem;
    max-width: 400px;
    width: 90%;
    box-shadow: var(--shadow-xl);
    border: 1px solid var(--border-color);
}

.prompt-content p {
    margin: 0 0 1.5rem 0;
    color: var(--text-primary);
    font-size: 1rem;
    text-align: center;
}

.prompt-content strong {
    color: var(--primary-color);
}

.prompt-buttons {
    display: flex;
    gap: 0.75rem;
    flex-direction: column;
}

.prompt-btn {
    padding: 1rem 1.5rem;
    background: var(--gradient-primary);
    border: none;
    border-radius: var(--radius-md);
    color: white;
    font-weight: 600;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.3s ease;
    font-family: inherit;
    min-height: 48px;
}

.prompt-btn:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.prompt-btn:active {
    transform: translateY(0);
}

.prompt-btn-cancel {
    background: var(--surface-hover);
    color: var(--text-secondary);
    border: 1px solid var(--border-color);
}

.prompt-btn-cancel:hover {
    background: var(--border-color);
    color: var(--text-primary);
}

@media (max-width: 768px) {
    .comparison-container {
        grid-template-columns: 1fr;
    }

    .vs-divider {
        text-align: center;
        margin: 0.5rem 0;
    }

    .clan-members-module {
        margin-top: 1.5rem;
    }

    .member-item {
        padding: 1rem 1.25rem;
        min-height: 60px;
    }

    .search-layout {
        grid-template-columns: 1fr;
    }

    .comparison-section {
        order: 2;
    }

    .search-side {
        order: 3;
    }

    .desktop-instruction {
        display: none;
    }

    .mobile-instruction {
        display: block;
    }

    .drop-zone {
        min-height: 140px;
        padding: 1rem;
    }
}

@media (min-width: 769px) {
    .mobile-instruction {
        display: none;
    }

}

.comp-label {
    color: var(--text-secondary);
}

.comp-value {
    font-weight: 600;
    color: var(--text-primary);
    display: flex;
    flex-direction: column;
    align-items: flex-end;
}

.diff-badge {
    font-size: 0.75rem;
    font-weight: 700;
    padding: 0.1rem 0.3rem;
    border-radius: 4px;
    margin-top: 0.2rem;
}

.diff-positive {
    color: #10b981;
    background: rgba(16, 185, 129, 0.1);
}

.diff-negative {
    color: #ef4444;
    background: rgba(239, 68, 68, 0.1);
}

.reset-comparison-btn {
    display: block;
    width: 100%;
    margin-top: 1rem;
    padding: 0.75rem;
    background: var(--surface-hover);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    color: var(--text-secondary);
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.reset-comparison-btn:hover {
    background: var(--border-color);
    color: var(--text-primary);
}

.member-item[draggable="true"] {
    cursor: grab;
}

.member-item[draggable="true"]:active {
    cursor: grabbing;
}

.member-item.dragging {
    opacity: 0.5;
    background: var(--surface-hover);
    border: 1px dashed var(--primary-color);
}

.member-item.selected {
    background: rgba(99, 102, 241, 0.15);
    border-left: 3px solid var(--primary-color);
}

.slot-selection-prompt {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    animation: fadeIn 0.2s ease;
}

.prompt-content {
    background: var(--surface-color);
    border-radius: var(--radius-lg);
    padding: 2rem;
    max-width: 400px;
    width: 90%;
    box-shadow: var(--shadow-xl);
    border: 1px solid var(--border-color);
}

.prompt-content p {
    margin: 0 0 1.5rem 0;
    color: var(--text-primary);
    font-size: 1rem;
    text-align: center;
}

.prompt-content strong {
    color: var(--primary-color);
}

.prompt-buttons {
    display: flex;
    gap: 0.75rem;
    flex-direction: column;
}

.prompt-btn {
    padding: 1rem 1.5rem;
    background: var(--gradient-primary);
    border: none;
    border-radius: var(--radius-md);
    color: white;
    font-weight: 600;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.3s ease;
    font-family: inherit;
    min-height: 48px;
}

.prompt-btn:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.prompt-btn:active {
    transform: translateY(0);
}

.prompt-btn-cancel {
    background: var(--surface-hover);
    color: var(--text-secondary);
    border: 1px solid var(--border-color);
}

.prompt-btn-cancel:hover {
    background: var(--border-color);
    color: var(--text-primary);
}

@media (max-width: 768px) {
    .comparison-container {
        grid-template-columns: 1fr;
    }

    .vs-divider {
        text-align: center;
        margin: 0.5rem 0;
    }

    .clan-members-module {
        margin-top: 1.5rem;
    }

    .member-item {
        padding: 1rem 1.25rem;
        min-height: 60px;
    }

    .search-layout {
        grid-template-columns: 1fr;
    }

    .comparison-section {
        order: 2;
    }

    .search-side {
        order: 3;
    }

    .desktop-instruction {
        display: none;
    }

    .mobile-instruction {
        display: block;
    }

    .drop-zone {
        min-height: 140px;
        padding: 1rem;
    }
}

@media (min-width: 769px) {
    .mobile-instruction {
        display: none;
    }

    .desktop-instruction {
        display: block;
    }
}

@media (min-width: 600px) {
    .prompt-buttons {
        flex-direction: row;
    }

    .prompt-btn {
        flex: 1;
    }
}

.mobile-player-list {
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
}

.mobile-list-header {
    padding: 0.75rem 1rem;
    background: var(--surface-hover);
    border-bottom: 1px solid var(--border-color);
    font-weight: 600;
    color: var(--text-primary);
    text-align: center;
    font-size: 0.9rem;
}

.mobile-list-scroll {
    flex: 1;
    overflow-y: auto;
    max-height: 300px;
}

.mobile-list-scroll::-webkit-scrollbar {
    width: 4px;
}

.mobile-list-scroll::-webkit-scrollbar-track {
    background: transparent;
}

.mobile-list-scroll::-webkit-scrollbar-thumb {
    background-color: var(--border-color);
    border-radius: 2px;
}

.mobile-player-item {
    padding: 0.75rem 1rem;
    border-bottom: 1px solid var(--border-color);
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    justify-content: space-between;
    align-items: center;
    min-height: 48px;
}

.mobile-player-item:last-child {
    border-bottom: none;
}

.mobile-player-item:hover {
    background: var(--surface-hover);
}

.mobile-player-item.selected {
    background: rgba(99, 102, 241, 0.15);
    border-left: 3px solid var(--primary-color);
    padding-left: calc(1rem - 3px);
}

.mobile-player-name {
    font-weight: 500;
    color: var(--text-primary);
    font-size: 0.9rem;
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.mobile-player-trophies {
    font-size: 0.85rem;
    color: #fbbf24;
    font-weight: 600;
    margin-left: 0.5rem;
}

@media (max-width: 768px) {
    .drop-zone {
        border-style: solid;
        min-height: 200px;
    }

    .drop-placeholder {
        display: none;
    }
}

@media (min-width: 769px) {
    .mobile-player-list {
        display: none;
    }
}