/* ============================================
   CWL Live Table - War-Themed Styling
   ============================================ */

:root {
    --war-dark-bg: #0f1419;
    --war-darker-bg: #0a0e13;
    --war-gold: #d4af37;
    --war-gold-bright: #ffd700;
    --war-bronze: #cd7f32;
    --war-silver: #c0c0c0;
    --war-red: #dc2626;
    --war-green: #16a34a;
    --war-blue: #1e3a8a;
    --war-primary: #3b82f6;
    --war-border: #2d3748;
    --war-glow: rgba(212, 175, 55, 0.5);
    --war-text-primary: #e2e8f0;
    --war-text-secondary: #94a3b8;
}

/* Container */
.cwl-container {
    min-height: 100vh;
    background: linear-gradient(135deg, var(--war-darker-bg) 0%, var(--war-dark-bg) 100%);
    background-attachment: fixed;
    padding: 2rem;
    color: var(--war-text-primary);
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

/* Error State */
.cwl-error-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 60vh;
    text-align: center;
}

.error-icon {
    font-size: 6rem;
    margin-bottom: 1rem;
    filter: grayscale(1) opacity(0.5);
}

.cwl-error-state h2 {
    color: var(--war-gold);
    font-size: 2rem;
    margin-bottom: 1rem;
}

.cwl-error-state p {
    color: var(--war-text-secondary);
    font-size: 1.2rem;
    margin-bottom: 2rem;
}

.btn-back {
    background: linear-gradient(135deg, var(--war-bronze), var(--war-gold));
    color: var(--war-dark-bg);
    padding: 0.75rem 2rem;
    border-radius: 8px;
    text-decoration: none;
    font-weight: 600;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px var(--war-glow);
}

.btn-back:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px var(--war-glow);
}

/* Header */
.cwl-header {
    position: relative;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    margin-bottom: 2rem;
    padding: 2rem;
    background: linear-gradient(135deg, rgba(30, 41, 59, 0.6), rgba(15, 20, 25, 0.8));
    border: 2px solid var(--war-border);
    border-radius: 12px;
    box-shadow: 0 0 30px rgba(212, 175, 55, 0.2), inset 0 0 30px rgba(0, 0, 0, 0.5);
}

.cwl-header-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
}

.cwl-title {
    font-size: 2.5rem;
    font-weight: 700;
    margin: 0 0 0.5rem 0;
    background: linear-gradient(135deg, var(--war-gold-bright), var(--war-bronze));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    text-shadow: 0 0 20px var(--war-glow);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1rem;
}

.title-icon {
    font-size: 2rem;
    text-shadow: 0 0 10px var(--war-gold), 0 0 20px var(--war-gold);
}

.cwl-season-info {
    display: flex;
    justify-content: center;
}

.last-sync {
    color: var(--war-text-secondary);
    font-size: 0.9rem;
}

/* Actions */
.cwl-actions {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
    justify-content: center;
    margin-top: 1.5rem;
}

.btn-refresh {
    padding: 0.75rem 1.5rem;
    border: 2px solid var(--war-gold);
    border-radius: 0.325em;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    background: transparent;
    color: red;
}

.btn-purge {
    display: none;
    min-width: 150px;
}

.btn-purge.show {
    display: block;
}

.btn-text {
    font-size: 0.9rem;
}

.btn-refresh {
    background: linear-gradient(135deg, var(--war-gold), var(--war-gold-bright));
    color: var(--war-dark-bg);
    box-shadow: 0 4px 15px var(--war-glow);
}

.btn-refresh:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px var(--war-glow);
}

.btn-refresh:active {
    transform: translateY(0);
}

.btn-purge.btn-outline-primary {
    color: var(--war-red);
    border-color: var(--war-red);
    background: transparent;
}

.btn-purge.btn-outline-primary:hover {
    background-color: var(--war-red);
    border-color: var(--war-red);
    color: white;
}

.btn-purge.btn-outline-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(139, 0, 0, 0.5);
}

/* Section Titles */
.section-title {
    font-size: 1.8rem;
    font-weight: 700;
    color: var(--war-gold);
    text-align: center;
    margin: 2rem 0;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1rem;
}

.title-divider {
    flex: 1;
    height: 2px;
    background: linear-gradient(90deg, transparent, var(--war-gold), transparent);
    max-width: 200px;
}

/* Standings Table */
/* CWL Info Section - now inside header */
.cwl-info-content {
    width: 100%;
    margin-top: 1.5rem;
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid var(--war-border);
    border-radius: 8px;
    box-shadow: 0 0 20px rgba(0, 0, 0, 0.3);
    transition: max-height 0.3s ease, opacity 0.3s ease, padding 0.3s ease, margin-top 0.3s ease;
    overflow: hidden;
    max-height: 2000px;
    opacity: 1;
}

.cwl-info-content.collapsed {
    max-height: 0 !important;
    padding: 0 !important;
    margin: 0 !important;
    opacity: 0;
    border: none;
    box-shadow: none;
    background: transparent !important;
}

.distribution-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
}

.distribution-card {
    background: var(--war-bg);
    border-radius: 8px;
    padding: 1.5rem;
    border: 1px solid var(--war-border);
}

.distribution-title {
    font-size: 1.2rem;
    font-weight: 600;
    margin-bottom: 1rem;
    color: var(--war-text);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.distribution-title i {
    color: var(--war-gold);
}

.distribution-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.distribution-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 0.5rem 0;
}

.distribution-label {
    min-width: 150px;
    font-weight: 500;
    color: var(--war-text);
    text-align: left;
}

.distribution-bar-container {
    flex: 1;
    height: 20px;
    background: rgba(0, 0, 0, 0.1);
    border-radius: 10px;
    overflow: hidden;
    position: relative;
}

.distribution-bar {
    height: 100%;
    background: linear-gradient(90deg, var(--war-primary), var(--war-gold));
    border-radius: 10px;
    transition: width 0.3s ease;
    min-width: 2px;
}

.distribution-value {
    min-width: 80px;
    text-align: right;
    font-weight: 600;
    color: var(--war-text-secondary);
    font-size: 0.9rem;
}

.distribution-empty {
    text-align: center;
    color: var(--war-text-secondary);
    padding: 1rem;
    font-style: italic;
}

/* Expandable Distribution Rows */
.clan-row-expand {
    background: none;
    border: none;
    color: var(--war-text-secondary);
    cursor: pointer;
    padding: 0.5rem;
    margin: 0 auto;
    border-radius: 4px;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0.7;
}

.clan-row-expand:hover {
    background: var(--war-border);
    color: var(--war-primary);
    opacity: 1;
}

.clan-row-expand i {
    font-size: 1rem;
}

.distribution-row {
    background: var(--war-card-bg);
}

.distribution-row td {
    padding: 1rem 1.5rem !important;
    border-top: 2px solid var(--war-border);
}

.clan-distribution-content {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    padding: 0.5rem 0;
}

.clan-distribution-section {
    color: var(--war-text);
    font-size: 0.95rem;
}

.clan-distribution-section strong {
    color: var(--war-text-secondary);
    margin-right: 0.5rem;
}

.clan-distribution-list {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    margin-top: 0.25rem;
}

.clan-distribution-item {
    display: block;
    margin-left: 0.5rem;
}

.clan-distribution-mobile {
    padding: 1rem;
    background: var(--war-bg);
    border-top: 2px solid var(--war-border);
    margin-top: 0.5rem;
}

.distribution-empty-small {
    text-align: center;
    color: var(--war-text-secondary);
    padding: 0.5rem;
    font-style: italic;
    font-size: 0.9rem;
}

.standings-section {
    margin-bottom: 3rem;
}

/* Show/hide desktop vs mobile views */
.standings-mobile {
    display: none;
}

@media (max-width: 1000px) {
    .clan-badge {
        display: none;
    }
}

@media (max-width: 768px) {
    .standings-desktop {
        display: none;
    }

    .standings-mobile {
        display: block;
    }
}

.standings-table-container {
    overflow-x: auto;
    background: rgba(15, 20, 25, 0.6);
    border: 2px solid var(--war-border);
    border-radius: 12px;
    padding: 1rem;
    box-shadow: 0 0 30px rgba(0, 0, 0, 0.5), inset 0 0 20px rgba(0, 0, 0, 0.3);
}

.standings-table {
    width: 100%;
    border-collapse: collapse;
    table-layout: fixed;
}

.standings-table thead {
    background: linear-gradient(135deg, var(--war-bronze), var(--war-gold));
    color: var(--war-dark-bg);
}

.standings-table th {
    padding: 1rem;
    text-align: left;
    font-weight: 700;
    border-bottom: 3px solid var(--war-gold-bright);
}

.standings-table tbody tr {
    border-bottom: 1px solid var(--war-border);
    transition: all 0.3s ease;
}

.standings-table tbody tr:hover {
    background: rgba(212, 175, 55, 0.1);
}

.standings-table tbody tr.our-clan {
    background: linear-gradient(90deg, rgba(30, 58, 138, 0.15), rgba(30, 58, 138, 0.05));
}

.standings-table td {
    padding: 1rem;
    color: var(--war-text-primary);
}

/* First column (Rank) - centered */
.standings-table th:nth-child(1),
.standings-table td:nth-child(1) {
    width: 60px;
    text-align: center;
}

/* Second column (Clan) - left aligned, flexible */
.standings-table th:nth-child(2),
.standings-table td:nth-child(2) {
    width: 180px;
    text-align: left;
}

/* Third column (Points) - centered */
.standings-table th:nth-child(3),
.standings-table td:nth-child(3) {
    width: 80px;
    text-align: center;
}

/* Fourth column (Stars) - centered */
.standings-table th:nth-child(4),
.standings-table td:nth-child(4) {
    width: 80px;
    text-align: center;
}

/* Fifth column (Destruction) - centered */
.standings-table th:nth-child(5),
.standings-table td:nth-child(5) {
    width: 100px;
    text-align: center;
}

/* Sixth column (Hit Rate) - centered */
.standings-table th:nth-child(6),
.standings-table td:nth-child(6) {
    width: 90px;
    text-align: center;
}

/* Seventh column (Record) - centered */
.standings-table th:nth-child(7),
.standings-table td:nth-child(7) {
    width: 90px;
    text-align: center;
}

/* Eighth column (Info) - centered */
.standings-table th:nth-child(8),
.standings-table td:nth-child(8) {
    width: 60px;
    text-align: center;
}

/* Fix header alignment to match content - center numeric columns */
.standings-table th:nth-child(1),
.standings-table th:nth-child(3),
.standings-table th:nth-child(4),
.standings-table th:nth-child(5),
.standings-table th:nth-child(6),
.standings-table th:nth-child(7),
.standings-table th:nth-child(8) {
    text-align: center;
}

.rank-badge {
    display: inline-block;
    width: 35px;
    height: 35px;
    line-height: 35px;
    text-align: center;
    border-radius: 50%;
    font-weight: 700;
    font-size: 1.1rem;
}

.rank-1 {
    background: linear-gradient(135deg, #ffd700, #ffed4e);
    color: var(--war-dark-bg);
    box-shadow: 0 0 15px rgba(255, 215, 0, 0.6);
}

.rank-2 {
    background: linear-gradient(135deg, #c0c0c0, #e8e8e8);
    color: var(--war-dark-bg);
    box-shadow: 0 0 15px rgba(192, 192, 192, 0.6);
}

.rank-3 {
    background: linear-gradient(135deg, #cd7f32, #e89656);
    color: var(--war-dark-bg);
    box-shadow: 0 0 15px rgba(205, 127, 50, 0.6);
}

.rank-other {
    background: rgba(30, 41, 59, 0.6);
    color: var(--war-text-primary);
    border: 1px solid var(--war-border);
}

.clan-info {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.clan-badge {
    width: 40px;
    height: 40px;
    border-radius: 8px;
}

.clan-name {
    font-weight: 600;
    color: var(--war-gold-bright);
}

.attacks-remaining {
    font-size: 0.85rem;
    color: var(--war-text-secondary);
    font-weight: 500;
    margin-left: 0.5rem;
}

.bonus-indicator {
    display: inline-block;
    background: var(--war-green);
    color: white;
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    font-size: 0.85rem;
    font-weight: 600;
    margin-left: 0.5rem;
}

/* Mobile Standing Cards */
.standing-card {
    background: linear-gradient(135deg, rgba(30, 41, 59, 0.4), rgba(15, 20, 25, 0.6));
    border: 2px solid var(--war-border);
    border-radius: 12px;
    padding: 1.25rem;
    margin-bottom: 1rem;
    transition: all 0.3s ease;
}

.standing-card.our-clan {
    background: linear-gradient(135deg, rgba(30, 58, 138, 0.3), rgba(15, 20, 25, 0.6));
}

.standing-card-header {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--war-border);
}

.clan-info-mobile {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex: 1;
}

.clan-badge-mobile {
    width: 40px;
    height: 40px;
    border-radius: 8px;
}

.clan-name-mobile {
    font-weight: 600;
    color: var(--war-gold-bright);
    font-size: 1.1rem;
}

.standing-card-body {
    display: grid;
    gap: 0.75rem;
}

.stat-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.stat-label {
    color: var(--war-text-secondary);
    font-size: 0.9rem;
}

.stat-value {
    color: var(--war-text-primary);
    font-size: 1rem;
}

.bonus-indicator-small {
    display: inline-block;
    background: var(--war-green);
    color: white;
    padding: 0.2rem 0.4rem;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 600;
    margin-left: 0.25rem;
}

/* Round Wheel */
.rounds-section {
    margin-bottom: 3rem;
}

.round-wheel-container {
    background: rgba(15, 20, 25, 0.6);
    border: 2px solid var(--war-border);
    border-radius: 12px;
    padding: 2rem;
    box-shadow: 0 0 30px rgba(0, 0, 0, 0.5), inset 0 0 20px rgba(0, 0, 0, 0.3);
}

.round-selector {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 2rem;
    margin-bottom: 2rem;
}

.round-nav-btn {
    background: linear-gradient(135deg, var(--war-bronze), var(--war-gold));
    color: var(--war-dark-bg);
    border: none;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    font-size: 1.2rem;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px var(--war-glow);
}

.round-nav-btn:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 20px var(--war-glow);
}

.round-nav-btn:disabled {
    opacity: 0.3;
    cursor: not-allowed;
    transform: scale(1);
}

.round-indicator {
    text-align: center;
}

.round-label {
    display: block;
    color: var(--war-text-secondary);
    font-size: 0.9rem;
    margin-bottom: 0.25rem;
}

.round-number {
    display: block;
    font-size: 3rem;
    font-weight: 700;
    color: var(--war-gold-bright);
    text-shadow: 0 0 20px var(--war-glow);
}

.round-total {
    display: block;
    color: var(--war-text-secondary);
    font-size: 0.9rem;
    margin-top: 0.25rem;
}

.round-status-badge {
    display: inline-block;
    margin-top: 0.75rem;
    padding: 0.5rem 1rem;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    min-width: 140px;
    text-align: center;
}

.round-status-badge.status-ended {
    background: var(--war-green);
    color: white;
}

.round-status-badge.status-inwar {
    background: var(--war-red);
    color: white;
    animation: statusPulse 2s infinite;
}

.round-status-badge.status-preparation {
    background: #555;
    color: white;
}

@keyframes statusPulse {
    0%, 100% { box-shadow: 0 0 10px rgba(139, 0, 0, 0.5); }
    50% { box-shadow: 0 0 20px rgba(139, 0, 0, 0.8); }
}

.round-wheel {
    position: relative;
    min-height: 400px;
}

.round-content {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1.5rem;
    transition: all 0.5s ease;
}

@media (min-width: 1000px) {
    .round-content {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* War Card */
.war-card {
    background: linear-gradient(135deg, rgba(30, 41, 59, 0.4), rgba(15, 20, 25, 0.6));
    border: 2px solid var(--war-border);
    border-radius: 12px;
    padding: 1.5rem;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.war-card:hover {
    box-shadow: 0 10px 30px rgba(212, 175, 55, 0.3);
    border-color: var(--war-gold);
}

.war-card.war-ended {
    border-color: var(--war-green);
}

.war-card.war-inwar {
    border-color: var(--war-red);
    animation: warPulse 2s infinite;
}

@keyframes warPulse {
    0%, 100% { box-shadow: 0 0 20px rgba(139, 0, 0, 0.3); }
    50% { box-shadow: 0 0 30px rgba(139, 0, 0, 0.6); }
}

.war-matchup {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    grid-template-rows: auto auto;
    gap: 1rem;
    align-items: center;
    margin-bottom: 1rem;
    padding-top: 2rem;
    position: relative;
}

.war-clan-names {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    text-align: center;
    min-height: 60px;
    position: relative;
}

.war-clan-name {
    font-size: 1.05rem;
    font-weight: 600;
    color: var(--war-gold);
    max-width: 100px;
    word-break: break-word;
    line-height: 1.4;
}

.war-clan-badge {
    width: 40px;
    height: 40px;
    border-radius: 4px;
    flex-shrink: 0;
}

.war-clan-stars {
    font-size: 2rem;
    font-weight: 700;
    color: var(--war-gold-bright);
    text-shadow: 0 0 10px var(--war-glow);
    text-align: center;
    grid-row: 2;
}

.war-clan-stars:nth-of-type(4) {
    grid-column: 1;
}

.war-clan-stars:nth-of-type(6) {
    grid-column: 3;
}

.war-empty {
    grid-row: 2;
    grid-column: 2;
}

.war-vs-div {
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    grid-row: 1;
    grid-column: 2;
}

.war-vs {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--war-text-secondary);
}

.war-clan-badge-left,
.war-clan-badge-right {
    flex-shrink: 0;
}

/* Hide mobile badges on desktop */
.war-clan-badge-mobile {
    display: none;
}

.war-clan-section {
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
}

.war-clan-section.winner::before {
    content: "👑";
    display: block;
    font-size: 1.5rem;
    margin-bottom: 0.5rem;
    filter: drop-shadow(0 2px 4px rgba(255, 215, 0, 0.6));
}

.war-clan-names.winner::before {
    content: "👑";
    position: absolute;
    top: -1.5rem;
    left: 50%;
    transform: translateX(-50%);
    font-size: 1.5rem;
    z-index: 5;
    filter: drop-shadow(0 2px 4px rgba(255, 215, 0, 0.6));
}

.war-vs-section {
    display: flex;
    align-items: center;
    justify-content: center;
}

.war-vs {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--war-text-secondary);
}

.war-details {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1.5rem;
    padding-top: 1rem;
    border-top: 1px solid var(--war-border);
    font-size: 0.9rem;
    color: var(--war-text-secondary);
}

.war-clan-details {
    text-align: center;
}

.war-detail-clan-name {
    font-weight: 600;
    color: var(--war-gold);
    margin-bottom: 0.5rem;
}

.war-detail-stats {
    color: var(--war-text-secondary);
}

.stat-label {
    display: block;
    font-size: 0.85rem;
    color: var(--war-text-secondary);
    margin-top: 0.3rem;
    font-weight: 500;
}

.attack-icon {
    color: var(--war-red);
}

/* Hide mobile destruction icon on desktop */
.destruction-icon-mobile {
    display: none;
}

/* Hide mobile labels on desktop */
.stat-label-mobile {
    display: none;
}

/* Show desktop labels on desktop */
.stat-label-desktop {
    display: inline;
}

/* Modal */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(5px);
}

.modal-content {
    background: linear-gradient(135deg, var(--war-dark-bg), var(--war-darker-bg));
    margin: 10% auto;
    padding: 2rem;
    border: 2px solid var(--war-gold);
    border-radius: 12px;
    width: 90%;
    max-width: 500px;
    box-shadow: 0 0 50px var(--war-glow);
}

.modal-content h3 {
    color: var(--war-gold);
    margin-bottom: 1rem;
}

.modal-content p {
    color: var(--war-text-primary);
    margin-bottom: 1rem;
}

.warning-text {
    color: var(--war-red);
    font-weight: 600;
}

.modal-actions {
    display: flex;
    gap: 1rem;
    margin-top: 2rem;
}

.btn-confirm-purge {
    flex: 1;
    background: var(--war-red);
    color: white;
    padding: 0.75rem;
    border: none;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.btn-confirm-purge:hover {
    background: #a00000;
    transform: translateY(-2px);
}

.btn-cancel {
    flex: 1;
    background: #555;
    color: white;
    padding: 0.75rem;
    border: none;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.btn-cancel:hover {
    background: #666;
    transform: translateY(-2px);
}

.btn-confirm {
    flex: 1;
    background: var(--war-gold);
    color: var(--war-dark-bg);
    padding: 0.75rem;
    border: none;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.btn-confirm:hover {
    background: #d4af37;
    transform: translateY(-2px);
}

.info-text {
    color: var(--war-text-secondary);
    font-size: 0.95em;
}

/* Clan Checkbox List */
.clan-checkbox-list {
    max-height: 400px;
    overflow-y: auto;
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid var(--war-gold-dim);
    border-radius: 8px;
    padding: 1rem;
    margin: 1.5rem 0;
}

.clan-checkbox-item {
    display: flex;
    align-items: center;
    padding: 0.75rem;
    margin-bottom: 0.5rem;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.clan-checkbox-item:hover {
    background: rgba(255, 255, 255, 0.1);
}

.clan-checkbox-item input[type="checkbox"] {
    margin-right: 0.75rem;
    cursor: pointer;
    width: 18px;
    height: 18px;
}

.clan-checkbox-item span {
    color: var(--war-text-primary);
    font-weight: 500;
}

/* Loading Overlay */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.9);
    z-index: 999;
    display: flex;
    justify-content: center;
    align-items: center;
}

.loading-spinner {
    text-align: center;
}

.spinner {
    width: 60px;
    height: 60px;
    border: 4px solid rgba(212, 175, 55, 0.3);
    border-top-color: var(--war-gold);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 1rem;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.loading-spinner p {
    color: var(--war-gold);
    font-size: 1.2rem;
}

/* Responsive Design */
@media (max-width: 900px) {
    .cwl-header {
        flex-direction: column;
        align-items: center;
        text-align: center;
    }

    .cwl-header-content {
        width: 100%;
        margin-bottom: 1rem;
    }
}

@media (max-width: 768px) {
    .cwl-header {
        padding: 1.5rem 1rem;
    }

    .cwl-title {
        font-size: 1.8rem;
    }
    
    .cwl-info-content {
        border: none;
    }

    .btn-refresh,
    .btn-purge {
        max-width: 200px;
    }
    
    /* Keep button text visible on mobile */
    .btn-text {
        display: inline;
    }

    .standings-table {
        font-size: 0.9rem;
    }

    .standings-table th,
    .standings-table td {
        padding: 0.75rem 0.5rem;
    }
}

/* Mobile responsiveness for war cards */
@media (max-width: 768px) {
    .war-clan-name {
        font-size: 0.85rem;
        max-width: 100px;
        word-break: break-word;
        line-height: 1.3;
    }

    .war-matchup {
        gap: 0.75rem;
        padding-top: 1.5rem;
    }

    .war-clan-names {
        min-height: auto;
        gap: 0.5rem;
        flex-direction: column;
        align-items: center;
    }

    /* On mobile, stack VS vertically in center (no badges) */
    .war-vs-div {
        flex-direction: column;
        gap: 0.5rem;
    }

    /* Hide center badges on mobile */
    .war-vs-div .war-clan-badge {
        display: none;
    }

    /* Show mobile badges above names on mobile */
    .war-clan-badge-mobile {
        display: block;
    }

    /* Hide star icon on mobile (keep the number visible) */
    .war-clan-stars .star-icon {
        display: none;
    }

    /* Hide bullet separator on mobile */
    .bullet-separator {
        display: none;
    }

    /* Stack attack stats vertically on mobile */
    .attack-stats-line {
        display: flex;
        flex-direction: column;
        gap: 0.25rem;
    }

    .attack-stats-attacks,
    .attack-stats-destruction {
        display: block;
    }

    /* Hide line break on mobile */
    .stats-line-break {
        display: none;
    }

    /* Show destruction icon on mobile (icon on left) */
    .destruction-icon-mobile {
        display: inline-block;
        margin-right: 0.25rem;
        color: var(--war-red);
    }

    /* Hide desktop labels, show mobile labels on mobile */
    .stat-label-desktop {
        display: none;
    }

    .stat-label-mobile {
        display: inline;
    }

    /* Mobile distribution styles */
    .distribution-grid {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }

    .distribution-card {
        padding: 1rem;
    }

    .distribution-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
    }

    .distribution-label {
        min-width: auto;
        width: 100%;
        text-align: left;
    }

    .distribution-bar-container {
        width: 100%;
    }

    .distribution-value {
        min-width: auto;
        width: 100%;
        text-align: left;
    }

    .clan-info-mobile .clan-row-expand {
        margin-left: auto;
    }
}

/* Players Section */
.players-section {
    margin-bottom: 3rem;
}

.players-content {
    background: rgba(15, 20, 25, 0.6);
    border: 2px solid var(--war-border);
    border-radius: 12px;
    padding: 2rem;
    box-shadow: 0 0 30px rgba(0, 0, 0, 0.5), inset 0 0 20px rgba(0, 0, 0, 0.3);
}

.players-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 2rem;
}

.players-clan-group {
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid var(--war-border);
    border-radius: 8px;
    padding: 1.5rem;
}

.players-clan-name {
    color: var(--war-gold);
    font-size: 1.2rem;
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid var(--war-border);
    font-weight: 600;
}

.players-clan-players {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.player-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 6px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    transition: all 0.2s ease;
}

.player-item:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: var(--war-gold);
    transform: translateX(4px);
}

.player-name {
    color: var(--war-text-primary);
    font-weight: 500;
    flex: 1;
}

.player-tag {
    color: var(--war-text-secondary);
    font-size: 0.9rem;
    font-family: 'Courier New', monospace;
}

@media (max-width: 768px) {
    .players-content {
        border: none;
        padding: 0;
    }
    
    .players-list {
        grid-template-columns: 1fr;
    }
    
    .player-item {
        gap: 0.5rem;
    }
    
    .player-tag {
        font-size: 0.85rem;
    }
}

