/* CoC Head Styles - CSS that was being injected into body */
/* This file is included via headInclude templateListener */

/* ============================================
   Sidebar Widget CSS (from cocSidebarStyles listener)
   ============================================ */
.cocSidebarInfo { padding: 8px 0; }
.cocSidebarCentered .cocSidebarRow { justify-content: center; }
.cocSidebarRow { display: flex; align-items: center; justify-content: space-around; gap: 8px; margin-bottom: 6px; }
.cocSidebarCol { display: flex; align-items: center; gap: 4px; }
.cocSidebarColCenter { justify-content: center; flex: 1; }
.cocSidebarDivider { width: 1px; height: 28px; background: var(--wcfContentBorderInner, #ccc); margin: 0 4px; }
.cocSidebarTH, .cocSidebarBH { width: 28px; height: 28px; object-fit: contain; }
.cocSidebarLeague { width: 24px; height: 24px; object-fit: contain; }
.cocSidebarBHBadge { font-size: 0.7rem; font-weight: bold; background: #5d4e37; color: #fff; padding: 2px 6px; border-radius: 4px; }
.cocSidebarTrophiesRow { margin-top: 4px; }
.cocSidebarTrophies { display: flex; align-items: center; gap: 3px; font-size: 0.85rem; }
.cocTrophyIcon { font-size: 0.9rem; }
.cocTrophyImg { width: 16px; height: 16px; }
.cocTrophyCount { font-weight: 600; }
.cocBHCount { color: #8b7355; }
.cocSidebarClan { display: flex; align-items: center; gap: 5px; margin-top: 6px; justify-content: center; }
.cocSidebarClanBadge { width: 20px; height: 20px; }
.cocSidebarClanName { font-size: 0.8rem; color: var(--wcfContentDimmedText); }

/* Mobile styles for CoC tabs */
@media (max-width: 544px) {
    .cocBtnText { display: none; }
    .cocArmyArchiveViewBtn, .cocBaseArchiveViewBtn { padding: 8px 10px; }
    .cocArmyCreateBtn, .cocBaseCreateBtn { padding: 8px 10px; }
}


/* ============================================
   Army Modal CSS (from cocArmyModal.tpl)
   ============================================ */
.cocArmyModal {
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    right: 0 !important;
    bottom: 0 !important;
    z-index: 10000 !important;
    display: none !important;
    align-items: center !important;
    justify-content: center !important;
}
.cocArmyModal.active {
    display: flex !important;
}
.cocArmyModalOverlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.6);
    touch-action: none;
}
.cocArmyModalContent {
    position: relative;
    background: var(--wcfContentContainerBackground);
    border-radius: 12px;
    width: 90%;
    max-width: 800px;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    box-shadow: 0 10px 40px rgba(0,0,0,0.3);
}
.cocArmyModalBody {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
    border-radius: 12px 12px 0 0;
    overscroll-behavior: contain;
}
.cocArmyModalFooter {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    padding: 15px 20px;
    border-top: 1px solid var(--wcfContentBorderInner);
}

/* Status Icons */
.cocArmyStatusIcon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 18px;
    height: 18px;
    border-radius: 3px;
    font-size: 10px;
    margin-left: 4px;
}
.cocArmyStatusIcon.full {
    background: var(--wcfStatusSuccessBackground, #d4edda);
    color: var(--wcfStatusSuccessText, #155724);
    border: 1px solid var(--wcfStatusSuccessBorder, #c3e6cb);
}
.cocArmyStatusIcon.notFull {
    background: var(--wcfStatusErrorBackground, #f8d7da);
    color: var(--wcfStatusErrorText, #721c24);
    border: 1px solid var(--wcfStatusErrorBorder, #f5c6cb);
}

/* Tabs */
.cocArmyTabs {
    display: flex;
    gap: 5px;
    margin-bottom: 20px;
    border-bottom: 2px solid var(--wcfContentBorderInner);
    padding-bottom: 10px;
}
.cocArmyTab {
    padding: 8px 16px;
    border: none;
    background: var(--wcfContentBackground);
    border-radius: 6px;
    cursor: pointer;
    font-weight: 500;
    transition: all 0.2s;
}
.cocArmyTab:hover {
    background: var(--wcfButtonPrimaryBackground);
    color: var(--wcfButtonPrimaryText);
}
.cocArmyTab.active {
    background: var(--wcfButtonPrimaryBackground);
    color: var(--wcfButtonPrimaryText, #fff);
}
.cocArmyTabContent {
    display: none;
}
.cocArmyTabContent.active {
    display: block;
}

/* Army List */
.cocArmyList {
    min-height: 200px;
}
.cocArmyListItem {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 12px;
    background: var(--wcfContentBackground);
    border-radius: 8px;
    margin-bottom: 10px;
    cursor: pointer;
    transition: all 0.2s;
    border: 2px solid transparent;
}
.cocArmyListItem:hover {
    border-color: var(--wcfButtonPrimaryBackground);
}
.cocArmyListItem.selected {
    border-color: var(--wcfButtonPrimaryBackground);
    background: color-mix(in srgb, var(--wcfButtonPrimaryBackground) 10%, transparent);
}
.cocArmyListItemTH {
    width: 40px;
    height: 40px;
    object-fit: contain;
}
.cocArmyListItemInfo {
    flex: 1;
}
.cocArmyListItemName {
    font-weight: 600;
    margin-bottom: 3px;
}
.cocArmyListItemStats {
    font-size: 0.85rem;
    color: var(--wcfContentDimmedText);
}
.cocArmyListItemActions {
    display: flex;
    gap: 5px;
}
.cocArmyListEmpty {
    text-align: center;
    padding: 40px;
    color: var(--wcfContentDimmedText);
}

/* Builder */
.cocArmyBuilderField {
    margin-bottom: 15px;
}
.cocArmyBuilderField label {
    display: block;
    margin-bottom: 5px;
    font-weight: 500;
}
.cocArmyCapacity {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    padding: 10px 15px;
    background: var(--wcfContentBackground);
    border-radius: 8px;
    margin-bottom: 15px;
}
.cocArmyCapacityItem {
    display: flex;
    align-items: center;
    gap: 5px;
    font-size: 0.9rem;
}
.cocArmyCapacityIcon {
    width: 24px;
    height: 24px;
    object-fit: contain;
}

/* Unit Tabs */
.cocArmyUnitTabs {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
    margin-bottom: 15px;
}
.cocArmyUnitTab.button {
    padding: 8px 14px;
    border-radius: 6px;
    font-size: 0.9rem;
    font-weight: 500;
}
.cocArmyUnitTab.button.active {
    background: var(--wcfButtonPrimaryBackground) !important;
    color: var(--wcfButtonPrimaryText, #fff) !important;
    border-color: var(--wcfButtonPrimaryBackground) !important;
}
.cocArmyUnitContent {
    display: none;
}
.cocArmyUnitContent.active {
    display: block;
}

/* Unit Grid */
.cocArmyUnitGrid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(60px, 1fr));
    gap: 10px;
    padding: 8px;
}
.cocArmyUnit {
    position: relative;
    background: var(--wcfContentBackground);
    border-radius: 8px;
    padding: 0;
    cursor: pointer;
    border: 2px solid transparent;
    transition: all 0.2s;
    text-align: center;
    aspect-ratio: 1/1;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: visible;
}
.cocArmyUnit:hover {
    border-color: var(--wcfButtonPrimaryBackground);
    transform: translateY(-2px);
}
.cocArmyUnit:active {
    transform: scale(0.95);
}
.cocArmyUnit.selected {
    border-color: var(--wcfButtonPrimaryBackground);
    background: color-mix(in srgb, var(--wcfButtonPrimaryBackground) 15%, transparent);
}
.cocArmySuperUnit {
    background: linear-gradient(135deg, rgba(147, 51, 234, 0.1), rgba(124, 58, 237, 0.15));
    border-color: rgba(147, 51, 234, 0.3);
}
.cocArmySuperUnit:hover {
    border-color: #9333ea;
    box-shadow: 0 0 8px rgba(147, 51, 234, 0.4);
}
.cocArmySuperUnit.selected {
    border-color: #9333ea;
    background: linear-gradient(135deg, rgba(147, 51, 234, 0.2), rgba(124, 58, 237, 0.25));
    box-shadow: 0 0 12px rgba(147, 51, 234, 0.5);
}
.cocArmyUnit img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}
/* Siege machines keep smaller size */
.cocArmyUnit[data-type="siege"] img,
.cocArmyUnit[data-type="ccSiege"] img {
    width: 36px;
    height: 36px;
}
.cocArmyUnitCount {
    position: absolute;
    bottom: 2px;
    left: 2px;
    background: rgba(0,0,0,0.85);
    color: #fff;
    font-size: 0.7rem;
    font-weight: 700;
    padding: 2px 6px;
    border-radius: 4px;
    min-width: 16px;
    text-align: center;
}
.cocArmyUnitRemove {
    display: none;
    position: absolute;
    top: -6px;
    right: -6px;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    border: none;
    background: #dc2626;
    color: #fff;
    font-size: 14px;
    font-weight: bold;
    cursor: pointer;
    line-height: 1;
    align-items: center;
    justify-content: center;
    z-index: 5;
    box-shadow: 0 2px 4px rgba(0,0,0,0.3);
}
.cocArmyUnitRemove:hover {
    background: #b91c1c;
    transform: scale(1.1);
}
.cocArmyUnit.selected .cocArmyUnitRemove {
    display: flex;
}
/* CC Section */
.cocArmyCCSection {
    margin-bottom: 20px;
}
.cocArmyCCSection h4 {
    font-size: 0.9rem;
    margin-bottom: 10px;
    color: var(--wcfContentDimmedText);
}

/* Hero Grid with Pet Selection */
.cocArmyHeroGrid {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
}
.cocArmyHeroUnit {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 12px;
    background: var(--wcfContentBackground);
    border-radius: 10px;
    border: 2px solid transparent;
    cursor: pointer;
    transition: all 0.2s;
    min-width: 140px;
    max-width: 180px;
}
.cocArmyHeroUnit:hover {
    border-color: var(--wcfContentBorderInner);
}
.cocArmyHeroUnit.selected {
    border-color: var(--wcfButtonPrimaryBackground);
    background: color-mix(in srgb, var(--wcfButtonPrimaryBackground) 10%, transparent);
}
.cocArmyHeroImg {
    width: 64px;
    height: 64px;
    margin-bottom: 6px;
}
.cocArmyHeroImg img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}
.cocArmyHeroName {
    font-size: 0.75rem;
    font-weight: 600;
    text-align: center;
    margin-bottom: 8px;
    white-space: nowrap;
}
/* Pet Image Grid */
.cocArmyPetGrid {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    justify-content: center;
    margin-bottom: 8px;
    padding: 6px;
    background: var(--wcfContainerBackground);
    border-radius: 6px;
    width: 100%;
}
.cocArmyPetGrid .cocArmyPetLabel {
    width: 100%;
    font-size: 0.6rem;
    color: var(--wcfContentDimmedText);
    text-transform: uppercase;
    text-align: center;
    margin-bottom: 4px;
}
.cocArmyPetItem {
    width: 28px;
    height: 28px;
    border-radius: 4px;
    border: 2px solid transparent;
    cursor: pointer;
    opacity: 0.5;
    transition: all 0.15s;
    background: var(--wcfContentBackground);
    padding: 2px;
}
.cocArmyPetItem:hover {
    opacity: 0.8;
    border-color: var(--wcfContentBorderInner);
}
.cocArmyPetItem.selected {
    opacity: 1;
    border-color: #f59e0b;
    box-shadow: 0 0 6px rgba(245, 158, 11, 0.5);
}
.cocArmyPetItem.disabled {
    opacity: 0.3;
    cursor: not-allowed;
}
.cocArmyPetItem img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}
/* Equipment Image Grid */
.cocArmyEquipGrid {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    justify-content: center;
    padding: 6px;
    background: var(--wcfContainerBackground);
    border-radius: 6px;
    width: 100%;
}
.cocArmyEquipGrid .cocArmyEquipLabel {
    width: 100%;
    font-size: 0.6rem;
    color: var(--wcfContentDimmedText);
    text-transform: uppercase;
    text-align: center;
    margin-bottom: 4px;
}
.cocArmyEquipItem {
    width: 28px;
    height: 28px;
    border-radius: 4px;
    border: 2px solid transparent;
    cursor: pointer;
    opacity: 0.5;
    transition: all 0.15s;
    background: var(--wcfContentBackground);
    padding: 2px;
}
.cocArmyEquipItem:hover {
    opacity: 0.8;
    border-color: var(--wcfContentBorderInner);
}
.cocArmyEquipItem.selected {
    opacity: 1;
    border-color: #8b5cf6;
    box-shadow: 0 0 6px rgba(139, 92, 246, 0.5);
}
.cocArmyEquipItem.epic {
    background: linear-gradient(135deg, rgba(155, 89, 182, 0.2), rgba(142, 68, 173, 0.3));
}
.cocArmyEquipItem.epic.selected {
    border-color: #9b59b6;
    box-shadow: 0 0 8px rgba(155, 89, 182, 0.6);
}
.cocArmyEquipItem img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}
.cocArmyNoUnits {
    padding: 20px;
    text-align: center;
    color: var(--wcfContentDimmedText);
    font-style: italic;
}

/* Preview */
.cocArmyPreview {
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid var(--wcfContentBorderInner);
}
.cocArmyPreview h4 {
    font-size: 0.9rem;
    margin-bottom: 10px;
    color: var(--wcfContentDimmedText);
}
#cocArmyPreviewContent {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    min-height: 44px;
    padding: 10px;
    background: var(--wcfContentBackground);
    border-radius: 8px;
}
.cocArmyPreviewUnit {
    position: relative;
}
.cocArmyPreviewUnit img {
    width: 32px;
    height: 32px;
    object-fit: contain;
}
.cocArmyPreviewUnit .count {
    position: absolute;
    bottom: -2px;
    right: -2px;
    background: rgba(0,0,0,0.8);
    color: #fff;
    font-size: 0.6rem;
    font-weight: 700;
    padding: 1px 3px;
    border-radius: 3px;
}
.cocArmyPreviewHeroWithPet {
    display: flex;
    align-items: flex-end;
}
.cocArmyPreviewPet {
    width: 20px !important;
    height: 20px !important;
    margin-left: -8px;
    margin-bottom: -4px;
    border: 2px solid var(--wcfContentBackground);
    border-radius: 50%;
    background: var(--wcfContentBackground);
}
.cocArmyPreviewCC {
    border: 2px solid #8b5cf6;
    border-radius: 6px;
    padding: 2px;
    background: rgba(139, 92, 246, 0.15);
}

/* Preview hero group with equipment */
.cocArmyPreviewHeroGroup {
    display: flex;
    flex-direction: column;
    align-items: center;
    margin-right: 4px;
}
.cocArmyPreviewEquipRow {
    display: flex;
    gap: 2px;
    margin-top: 2px;
}
.cocArmyPreviewEquip {
    width: 16px;
    height: 16px;
    border-radius: 3px;
    overflow: hidden;
    background: var(--wcfContentBackground);
    padding: 1px;
}
.cocArmyPreviewEquip.epic {
    background: linear-gradient(135deg, #B640A8, #642785);
}
.cocArmyPreviewEquip.common {
    background: linear-gradient(135deg, #10C0DC, #46AFEF);
}
.cocArmyPreviewEquip img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}
/* Equipment in hero selector */
.cocArmyEquipBox {
    width: 18px;
    height: 18px;
    border-radius: 3px;
    overflow: hidden;
    padding: 1px;
    display: flex;
    align-items: center;
    justify-content: center;
}
.cocArmyEquipBox.epic {
    background: linear-gradient(135deg, #B640A8, #642785);
}
.cocArmyEquipBox.common {
    background: linear-gradient(135deg, #10C0DC, #46AFEF);
}

.cocArmyLoading {
    text-align: center;
    padding: 40px;
    color: var(--wcfContentDimmedText);
}

/* Mobile styles */
@media (max-width: 768px) {
    .cocArmyModalContent { width:95%; max-width:none; max-height:95vh; border-radius:8px; }
    .cocArmyModalBody { padding:10px; border-radius:8px 8px 0 0; }
    .cocArmyModalFooter { padding:12px 15px; flex-wrap:wrap; }
    .cocArmyModalFooter button { flex:1; min-width:100px; }
    .cocArmyBuilderField label { font-size:0.9rem; }
    .cocArmyBuilderField input, .cocArmyBuilderField select { padding:12px; font-size:16px; }
    .cocArmyUnitGrid { grid-template-columns:repeat(auto-fill, minmax(50px, 1fr)); gap:8px; padding:6px; }
    .cocArmyUnit[data-type="siege"] img, .cocArmyUnit[data-type="ccSiege"] img { width:32px; height:32px; }
    .cocArmyUnitRemove { width:18px; height:18px; font-size:12px; top:-4px; right:-4px; }
    .cocArmyUnitCount { font-size:0.6rem; padding:1px 4px; }
    .cocArmyHeroGrid { gap:8px; }
    .cocArmyHeroUnit { min-width:70px; padding:8px; }
    .cocArmyHeroImg { width:40px; height:40px; }
    .cocArmyCapacityBar { flex-wrap:wrap; gap:8px; padding:8px; }
    .cocArmyCapacityItem { font-size:0.75rem; }
    .cocArmyCapacityIcon { width:18px; height:18px; }
    .cocArmyUnitTabs { flex-wrap:nowrap; overflow-x:auto; -webkit-overflow-scrolling:touch; }
    .cocArmyUnitTab.button { white-space:nowrap; padding:8px 12px; font-size:0.8rem; }
}

/* ============================================
   Base Modal CSS (from cocBaseModal.tpl)
   ============================================ */
.cocBaseModal { position:fixed; top:0; left:0; right:0; bottom:0; z-index:10001; display:flex; align-items:center; justify-content:center; }
.cocBaseModalOverlay { position:absolute; top:0; left:0; right:0; bottom:0; background:rgba(0,0,0,0.6); -webkit-tap-highlight-color:transparent; }
.cocBaseModalContent { position:relative; background:var(--wcfContentContainerBackground); border-radius:12px; width:90%; max-width:700px; max-height:90vh; display:flex; flex-direction:column; box-shadow:0 10px 40px rgba(0,0,0,0.3); }
.cocBaseModalBody { flex:1; overflow-y:auto; padding:20px; border-radius:12px 12px 0 0; }
.cocBaseModalFooter { display:flex; justify-content:flex-end; gap:10px; padding:15px 20px; border-top:1px solid var(--wcfContentBorderInner); }
.cocBaseBuilderField { margin-bottom:15px; }
.cocBaseBuilderField label { display:block; font-weight:600; margin-bottom:5px; color:var(--wcfContentText); }
.cocBaseBuilderField input, .cocBaseBuilderField select { width:100%; padding:10px; border:1px solid var(--wcfContentBorderInner); border-radius:6px; background:var(--wcfContentBackground); color:var(--wcfContentText); font-size:0.95rem; }
.cocBaseImageUpload { display:flex; gap:15px; align-items:flex-start; }
.cocBaseImagePreview { width:200px; height:120px; background:var(--wcfContentBackground); border:2px dashed var(--wcfContentBorderInner); border-radius:8px; display:flex; align-items:center; justify-content:center; overflow:hidden; }
.cocBaseImagePreview img { width:100%; height:100%; object-fit:cover; }
.cocBaseImagePlaceholder { color:var(--wcfContentDimmedText); font-size:0.85rem; text-align:center; padding:10px; }
.cocBaseImageActions { display:flex; flex-direction:column; gap:8px; }
.cocBaseLinkStatus { margin-top:6px; padding:6px 10px; border-radius:6px; font-size:0.85rem; display:none; }
.cocBaseLinkStatus.valid { display:block; background:var(--wcfStatusSuccessBackground, #e8f5e9); color:var(--wcfStatusSuccessText, #2e7d32); border:1px solid var(--wcfStatusSuccessBorder, #a5d6a7); }
.cocBaseLinkStatus.invalid { display:block; background:var(--wcfStatusErrorBackground, #ffebee); color:var(--wcfStatusErrorText, #c62828); border:1px solid var(--wcfStatusErrorBorder, #ef9a9a); }
.cocBaseLinkStatus.duplicate { display:block; background:var(--wcfStatusErrorBackground, #ffebee); color:var(--wcfStatusErrorText, #c62828); border:1px solid var(--wcfStatusErrorBorder, #ef9a9a); margin-top:6px; }
.cocBaseLinkStatus .icon { margin-right:5px; }
.cocBaseLinkStatus.validating { display:block; background:var(--wcfStatusInfoBackground, #e3f2fd); color:var(--wcfStatusInfoText, #1565c0); border:1px solid var(--wcfStatusInfoBorder, #90caf9); }

/* Video Status - inline style like innerInfo but colored */
.cocVideoStatus { margin-top:5px; font-size:0.8rem; }
.cocVideoStatus:empty { display:none; }
.cocVideoStatus.validating { color:var(--wcfStatusInfoText, #1565c0); }
.cocVideoStatus.valid { color:var(--wcfStatusSuccessText, #2e7d32); }
.cocVideoStatus.invalid { color:var(--wcfStatusErrorText, #c62828); }
.cocBasePublicLabel.disabled { opacity:0.5; pointer-events:none; }
.cocBasePublicLabel.disabled input { cursor:not-allowed; }
.cocBaseCCGrid { display:grid; grid-template-columns:repeat(auto-fill, minmax(60px, 1fr)); gap:10px; padding:8px; background:var(--wcfContainerBackground); border:1px solid var(--wcfContentBorderInner); border-radius:8px; }
.cocBaseCCUnit { position:relative; background:var(--wcfContentBackground); border-radius:8px; padding:0; cursor:pointer; border:2px solid transparent; transition:all 0.2s; text-align:center; aspect-ratio:1/1; display:flex; align-items:center; justify-content:center; overflow:visible; }
.cocBaseCCSuperUnit { background:linear-gradient(135deg, rgba(147, 51, 234, 0.1), rgba(124, 58, 237, 0.15)); border-color:rgba(147, 51, 234, 0.3); }
.cocBaseCCSuperUnit:hover { border-color:#9333ea; box-shadow:0 0 8px rgba(147, 51, 234, 0.4); }
.cocBaseCCSuperUnit.selected { border-color:#9333ea; background:linear-gradient(135deg, rgba(147, 51, 234, 0.2), rgba(124, 58, 237, 0.25)); box-shadow:0 0 12px rgba(147, 51, 234, 0.5); }
.cocBaseCCUnit:hover { border-color:var(--wcfButtonPrimaryBackground); transform:translateY(-2px); }
.cocBaseCCUnit:active { transform:scale(0.95); }
.cocBaseCCUnit.selected { border-color:var(--wcfButtonPrimaryBackground); background:color-mix(in srgb, var(--wcfButtonPrimaryBackground) 15%, transparent); }
.cocBaseCCUnit img { width:100%; height:100%; object-fit:contain; }
.cocBaseCCUnit .cocBaseCCCount { position:absolute; bottom:2px; left:2px; background:rgba(0,0,0,0.85); color:#fff; font-size:0.7rem; font-weight:700; padding:2px 6px; border-radius:4px; min-width:16px; text-align:center; }
.cocBaseCCRemove { display:none; position:absolute; top:-6px; right:-6px; width:20px; height:20px; border-radius:50%; border:none; background:#dc2626; color:#fff; font-size:14px; font-weight:bold; cursor:pointer; line-height:1; align-items:center; justify-content:center; z-index:5; box-shadow:0 2px 4px rgba(0,0,0,0.3); }
.cocBaseCCRemove:hover { background:#b91c1c; transform:scale(1.1); }
.cocBaseCCUnit.selected .cocBaseCCRemove { display:flex; }
@keyframes fa-spin { 0% { transform: rotate(0deg); } 100% { transform: rotate(360deg); } }

/* Mobile styles */
@media (max-width: 768px) {
    .cocBaseModalContent { width:95%; max-width:none; max-height:95vh; border-radius:8px; }
    .cocBaseModalBody { padding:15px; border-radius:8px 8px 0 0; }
    .cocBaseModalFooter { padding:12px 15px; flex-wrap:wrap; }
    .cocBaseModalFooter button { flex:1; min-width:120px; }
    .cocBaseBuilderField label { font-size:0.9rem; }
    .cocBaseBuilderField input, .cocBaseBuilderField select { padding:12px; font-size:16px; }
    .cocBaseImageUpload { flex-direction:column; }
    .cocBaseImagePreview { width:100%; height:150px; }
    .cocBaseImageActions { flex-direction:row; width:100%; }
    .cocBaseImageActions button { flex:1; }
    .cocBaseCCGrid { grid-template-columns:repeat(auto-fill, minmax(50px, 1fr)); gap:8px; padding:6px; }
    .cocBaseCCRemove { width:18px; height:18px; font-size:12px; top:-4px; right:-4px; }
    .cocBaseCCUnit .cocBaseCCCount { font-size:0.6rem; padding:1px 4px; }
}

/* ============================================
   Clan Modal CSS (from cocClanModal.tpl)
   ============================================ */
.cocClanModal { position:fixed; top:0; left:0; right:0; bottom:0; z-index:400; display:flex; align-items:center; justify-content:center; }
.cocClanModalOverlay { position:absolute; top:0; left:0; right:0; bottom:0; background:rgba(0,0,0,0.6); }
.cocClanModalContent { position:relative; background:var(--wcfContentContainerBackground); border-radius:12px; width:90%; max-width:500px; max-height:90vh; display:flex; flex-direction:column; box-shadow:0 10px 40px rgba(0,0,0,0.3); }
.cocClanModalBody { flex:1; overflow-y:auto; padding:20px; border-radius:12px 12px 0 0; }
.cocClanModalFooter { display:flex; justify-content:flex-end; gap:10px; padding:15px 20px; border-top:1px solid var(--wcfContentBorderInner); }
.cocClanBuilderField { margin-bottom:15px; }
.cocClanBuilderField label { display:block; font-weight:600; margin-bottom:5px; color:var(--wcfContentText); }
.cocClanBuilderField input { width:100%; padding:10px; border:1px solid var(--wcfContentBorderInner); border-radius:6px; background:var(--wcfContentBackground); color:var(--wcfContentText); font-size:0.95rem; }
.cocClanTagStatus { margin-top:6px; padding:6px 10px; border-radius:6px; font-size:0.85rem; display:none; }
.cocClanTagStatus.validating { display:block; background:var(--wcfContentBackground); color:var(--wcfContentDimmedText); border:1px solid var(--wcfContentBorderInner); }
.cocClanTagStatus.valid { display:block; background:var(--wcfStatusSuccessBackground, #e8f5e9); color:var(--wcfStatusSuccessText, #2e7d32); border:1px solid var(--wcfStatusSuccessBorder, #a5d6a7); }
.cocClanTagStatus.invalid { display:block; background:var(--wcfStatusErrorBackground, #ffebee); color:var(--wcfStatusErrorText, #c62828); border:1px solid var(--wcfStatusErrorBorder, #ef9a9a); }

/* Preview Card */
.cocClanPreview { background:var(--wcfContentBackground); border:1px solid var(--wcfContentBorderInner); border-radius:10px; padding:15px; margin-bottom:15px; }
.cocClanPreviewHeader { display:flex; align-items:center; gap:12px; margin-bottom:12px; }
.cocClanPreviewHeader img { width:60px; height:60px; object-fit:contain; }
.cocClanPreviewName { font-size:1.1rem; font-weight:700; color:var(--wcfContentText); }
.cocClanPreviewTag { font-size:0.85rem; color:var(--wcfContentDimmedText); font-family:monospace; }
.cocClanPreviewLevel { display:inline-block; margin-top:4px; padding:2px 8px; background:linear-gradient(135deg, #f59e0b, #d97706); color:#fff; border-radius:10px; font-size:0.75rem; font-weight:600; }
.cocClanPreviewStats { display:flex; gap:8px; margin-bottom:10px; }
.cocClanPreviewStat { flex:1; background:var(--wcfContainerBackground); padding:8px; border-radius:6px; text-align:center; font-size:0.85rem; }
.cocClanPreviewStat .icon { margin-right:4px; }
.cocClanPreviewDetails { font-size:0.85rem; color:var(--wcfContentText); }
.cocClanPreviewDetails > div { margin-bottom:4px; }
.cocClanPreviewDescription { font-style:italic; color:var(--wcfContentDimmedText); font-size:0.85rem; margin-top:10px; padding-top:10px; border-top:1px solid var(--wcfContentBorderInner); }

/* Mobile styles */
@media (max-width: 768px) {
    .cocClanModalContent { width:95%; max-width:none; max-height:95vh; border-radius:8px; }
    .cocClanModalBody { padding:15px; }
    .cocClanModalFooter { padding:12px 15px; flex-wrap:wrap; }
    .cocClanModalFooter button { flex:1; min-width:100px; }
    .cocClanBuilderField input { padding:12px; font-size:16px; }
    .cocClanPreviewStats { flex-direction:column; gap:6px; }
}

/* ============================================
   Clan Listing Box CSS (from boxCoCClanListing.tpl)
   ============================================ */
@font-face {
    font-family: 'Clash Bold';
    src: url('/font/Clash_Bold.otf') format('opentype');
    font-weight: bold;
    font-style: normal;
}

@font-face {
    font-family: 'Clash Regular';
    src: url('/font/Clash_Regular.otf') format('opentype');
    font-weight: normal;
    font-style: normal;
}

.cocClanSliderBox {
    --card-gap: 20px;
    --card-width: calc((100% - var(--card-gap)) / 2);
    --card-min-width: 320px;
    background: transparent !important;
}

.cocClanSliderWrapper {
    display: flex;
    align-items: center;
    gap: 10px;
    background: transparent;
}

.cocClanSliderNav {
    flex-shrink: 0;
    width: 40px;
    height: 40px;
    border: none;
    border-radius: 50%;
    background: rgba(0,0,0,0.5);
    color: #fff;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    backdrop-filter: blur(10px);
    z-index: 10;
    position: relative;
}

.cocClanSliderNav:hover {
    background: rgba(0,0,0,0.7);
    transform: scale(1.1);
}

.cocClanSliderNav:disabled {
    opacity: 0.3;
    cursor: not-allowed;
    transform: none;
}

.cocClanSliderTrack {
    flex: 1;
    overflow: hidden;
}

.cocClanSliderContent {
    display: flex;
    gap: var(--card-gap);
    transition: transform 0.4s ease;
    padding: 10px;
}

.cocClanSliderCard {
    flex: 0 0 var(--card-width);
    min-width: var(--card-min-width);
    position: relative;
    border-radius: 16px;
    overflow: visible;
    display: block;
    text-decoration: none;
}

.cocClanSliderCard:hover {
    text-decoration: none;
}

.cocClanCardContent {
    position: relative;
    z-index: 3;
    display: flex;
    flex-direction: column;
    height: 100%;
    padding-bottom: 16px;
}

.cocClanCardBg {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-size: cover;
    background-position: center center;
    z-index: 1;
    border-radius: 16px;
}

.cocClanCardOverlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(180deg, rgba(0,0,0,0.4) 0%, rgba(0,0,0,0.75) 100%);
    z-index: 2;
    border-radius: 16px;
}

/* Featured card styling */
.cocClanCardIsFeatured {
    box-shadow: inset 0 0 0 3px #FFD700;
}

.cocClanCardFeaturedBadge {
    position: absolute;
    top: -5px;
    right: -4px;
    background: linear-gradient(135deg, #FFD700, #FFA500);
    color: #000;
    padding: 4px 10px 4px 8px;
    border-radius: 4px 0 0 4px;
    display: flex;
    align-items: center;
    gap: 5px;
    font-family: 'Clash Bold', sans-serif;
    font-size: 0.65rem;
    font-weight: 700;
    text-transform: uppercase;
    z-index: 10;
    box-shadow: 0 2px 6px rgba(255, 165, 0, 0.5);
}

.cocClanCardFeaturedBadge::after {
    content: '';
    position: absolute;
    right: 0;
    bottom: -4px;
    border-style: solid;
    border-width: 4px 4px 0 0;
    border-color: #b8860b transparent transparent transparent;
}

.cocClanCardFeaturedBadge fa-icon {
    font-size: 10px;
}

.cocClanCardHeader {
    position: relative;
    z-index: 3;
    padding: 16px;
    display: grid;
    grid-template-columns: auto 1fr auto;
    gap: 12px;
    align-items: start;
}

.cocClanCardBadge {
    width: 52px;
    height: 52px;
}

.cocClanCardBadge img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    filter: drop-shadow(0 0 6px rgba(255,255,255,0.4)) drop-shadow(0 2px 4px rgba(0,0,0,0.5));
}

.cocClanCardInfo {
    min-width: 0;
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 4px;
}

.cocClanCardName {
    font-family: 'Clash Bold', sans-serif;
    font-size: 1.1rem;
    font-weight: 700;
    color: #fff;
    text-shadow: 0 2px 4px rgba(0,0,0,0.5);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    line-height: 1.2;
    display: block;
}

.cocClanCardTag {
    font-family: 'Clash Regular', monospace;
    font-size: 0.8rem;
    color: rgba(255,255,255,0.85);
    text-shadow: 0 1px 3px rgba(0,0,0,0.8);
    display: block;
    letter-spacing: 0.5px;
    white-space: nowrap;
}

.cocClanCardMembers {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 0.8rem;
    color: rgba(255,255,255,0.9);
    margin-top: 2px;
}

.cocClanCardMembers fa-icon {
    color: #4ade80;
    font-size: 0.75rem;
}

.cocClanCardStats {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 3px;
    font-family: 'Clash Regular', sans-serif;
    color: #fff;
    font-size: 0.8rem;
}

.cocClanCardIsFeatured .cocClanCardStats {
    margin-top: auto;
    padding-top: 12px;
}

.cocClanCardStats > div {
    display: flex;
    align-items: center;
    gap: 4px;
}

.cocCWLIcon {
    width: 18px;
    height: 18px;
    object-fit: contain;
    filter: drop-shadow(0 0 4px rgba(255,255,255,0.5));
}

.cocWarIcon {
    width: 18px;
    height: 18px;
    object-fit: contain;
}

/* Communication badges as pill style (same as TH/league requirements) */
.cocClanCardReqDiscord {
    background: rgba(88, 101, 242, 0.3) !important;
    border-color: rgba(88, 101, 242, 0.5) !important;
}
.cocClanCardReqDiscord fa-icon,
.cocClanCardReqDiscord fa-brand { color: #5865F2; }

.cocClanCardReqTelegram {
    background: rgba(0, 136, 204, 0.3) !important;
    border-color: rgba(0, 136, 204, 0.5) !important;
}
.cocClanCardReqTelegram fa-icon,
.cocClanCardReqTelegram fa-brand { color: #0088cc; }

.cocClanCardReqWhatsapp {
    background: rgba(37, 211, 102, 0.3) !important;
    border-color: rgba(37, 211, 102, 0.5) !important;
}
.cocClanCardReqWhatsapp fa-icon,
.cocClanCardReqWhatsapp fa-brand { color: #25D366; }

.cocClanCardDesc {
    position: relative;
    z-index: 3;
    padding: 0 16px 12px;
    color: rgba(255,255,255,0.9);
    font-family: 'Clash Regular', sans-serif;
    font-size: 0.85rem;
    line-height: 1.4;
    height: 2.8em;
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

.cocClanCardReqs {
    position: relative;
    z-index: 3;
    display: flex;
    gap: 6px;
    padding: 0 16px 0;
    flex-wrap: wrap;
}

.cocClanCardReqs.cocClanCardReqsCentered {
    justify-content: center;
}

.cocClanCardReq {
    display: flex;
    align-items: center;
    gap: 5px;
    background: rgba(0,0,0,0.5);
    backdrop-filter: blur(10px);
    padding: 6px 10px;
    border-radius: 16px;
    color: #fff;
    font-family: 'Clash Regular', sans-serif;
    font-size: 0.8rem;
    font-weight: 600;
}

.cocClanCardReq img {
    width: 18px;
    height: 18px;
}

.cocClanCardReq fa-icon {
    font-size: 12px;
}

.cocClanCardReq fa-icon[name="trophy"] {
    color: #FFD700;
}

.cocClanCardDiscord fa-icon {
    color: #5865F2;
}

.cocClanCardLeagueTier .cocLeagueTierIcon {
    width: 18px;
    height: 18px;
    object-fit: contain;
}

.cocClanCardActions {
    position: relative;
    z-index: 3;
    display: flex;
    gap: 8px;
    padding: 0 16px 16px;
}

.cocClanCardBtn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 8px 12px;
    border-radius: 20px;
    font-family: 'Clash Regular', sans-serif;
    font-size: 0.8rem;
    font-weight: 600;
    text-decoration: none;
    transition: all 0.2s ease;
}

.cocClanCardBtnGame {
    flex: 1;
    background: linear-gradient(135deg, #10b981, #059669);
    color: #fff;
}

.cocClanCardBtnGame:hover {
    background: linear-gradient(135deg, #059669, #047857);
    color: #fff;
    transform: scale(1.02);
}

/* Responsive: 2 cards on tablet */
@media (max-width: 900px) {
    .cocClanSliderBox {
        --card-width: calc((100% - var(--card-gap)) / 2);
        --card-min-width: 280px;
    }
    
    .cocClanCardHeader {
        padding: 14px;
        gap: 10px;
    }
    
    .cocClanCardBadge {
        width: 46px;
        height: 46px;
    }
    
    .cocClanCardName {
        font-size: 1rem;
    }
    
    .cocClanCardStats {
        font-size: 0.7rem;
    }
}

/* Responsive: 1 card on mobile */
@media (max-width: 600px) {
    .cocClanSliderBox {
        --card-width: 85%;
        --card-min-width: 260px;
        --card-gap: 12px;
    }
    
    .cocClanSliderWrapper {
        gap: 0;
    }
    
    .cocClanSliderNav {
        display: none;
    }
    
    .cocClanSliderTrack {
        overflow-x: auto;
        overflow-y: hidden;
        -webkit-overflow-scrolling: touch;
        scroll-snap-type: x mandatory;
        scrollbar-width: none;
        -ms-overflow-style: none;
    }
    
    .cocClanSliderTrack::-webkit-scrollbar {
        display: none;
    }
    
    .cocClanSliderContent {
        padding: 6px;
        transform: none !important;
    }
    
    .cocClanSliderCard {
        min-height: auto;
        border-radius: 12px;
        scroll-snap-align: center;
    }
    
    .cocClanCardBg, .cocClanCardOverlay {
        border-radius: 12px;
    }
    
    .cocClanCardContent {
        padding-bottom: 8px;
    }
    
    .cocClanCardHeader {
        padding: 12px;
        gap: 8px;
    }
    
    .cocClanCardBadge {
        width: 40px;
        height: 40px;
    }
    
    .cocClanCardName {
        font-size: 0.95rem;
    }
    
    .cocClanCardTag {
        font-size: 0.7rem;
    }
    
    .cocClanCardStats {
        font-size: 0.65rem;
        gap: 2px;
    }
    
    .cocCWLIcon, .cocWarIcon {
        width: 14px;
        height: 14px;
    }
    
    .cocClanCardDesc {
        padding: 0 12px 10px;
        font-size: 0.75rem;
        height: 3.6em;
        line-height: 1.2;
        min-height: 3.6em;
        -webkit-line-clamp: 3;
    }
    
    .cocClanCardReqs {
        padding: 0 12px;
        gap: 4px;
    }
    
    .cocClanCardReq {
        padding: 4px 8px;
        font-size: 0.7rem;
        border-radius: 12px;
    }
    
    .cocClanCardReq img {
        width: 14px;
        height: 14px;
    }
    
    .cocClanCardFeaturedBadge {
        padding: 3px 6px 3px 5px;
        font-size: 0.55rem;
        top: -3px;
        right: -3px;
        gap: 3px;
    }
    
    .cocClanCardFeaturedBadge::after {
        border-width: 3px 3px 0 0;
        bottom: -3px;
    }
    
    .cocClanCardFeaturedBadge fa-icon {
        font-size: 8px;
    }
}

/* ============================================
   Message Sidebar CSS (from cocMessageSidebar.tpl)
   ============================================ */
        /* CoC Sidebar Widget Styles - Desktop */
        .cocSidebarInfo {
            padding: 6px;
            background: var(--wcfContentContainerBackground);
            border-radius: 6px;
            margin-top: 6px;
        }
        .cocSidebarInfo.cocSidebarCentered .cocSidebarRow {
            justify-content: center;
        }
        .cocSidebarRow {
            display: flex;
            align-items: center;
            justify-content: space-between;
            gap: 6px;
        }
        .cocSidebarCol {
            display: flex;
            align-items: center;
            gap: 4px;
            flex: 1;
            justify-content: center;
        }
        .cocSidebarCol.cocSidebarColCenter {
            justify-content: center;
        }
        .cocSidebarDivider {
            width: 1px;
            height: 22px;
            background: var(--wcfContentBorderInner);
            flex-shrink: 0;
        }
        .cocSidebarTH, .cocSidebarBH {
            width: 28px;
            height: 28px;
            object-fit: contain;
        }
        .cocSidebarLeague {
            width: 22px;
            height: 22px;
            object-fit: contain;
        }
        .cocSidebarBHBadge {
            font-size: 0.7rem;
            font-weight: 600;
            background: var(--wcfContentBackground);
            padding: 2px 6px;
            border-radius: 4px;
        }
        .cocSidebarTrophiesRow {
            margin-top: 4px;
            gap: 4px;
            flex-wrap: nowrap;
        }
        .cocSidebarTrophiesRow .cocSidebarCol {
            flex: 0 1 auto;
        }
        /* Hide inline trophies on desktop - they show in row 2 */
        .cocSidebarTrophies.cocSidebarTrophiesMobile {
            display: none !important;
        }
        .cocSidebarTrophies {
            display: inline-flex;
            align-items: center;
            gap: 3px;
            background: #f59e0b;
            color: #fff !important;
            padding: 2px 6px;
            border-radius: 4px;
            font-size: 0.75rem;
        }
        .cocSidebarTrophies * {
            color: #fff !important;
        }
        .cocSidebarTrophies .cocTrophyIcon {
            font-size: 0.75rem;
            color: #fff !important;
        }
        .cocSidebarTrophies .cocTrophyImg {
            width: 12px;
            height: 12px;
        }
        .cocSidebarTrophies .cocTrophyCount,
        .cocSidebarTrophies span.cocTrophyCount {
            font-weight: 600;
            color: #fff !important;
            display: inline;
        }
        .cocSidebarBHTrophies {
            background: #8b5cf6;
        }
        .cocSidebarBHTrophies .cocTrophyCount,
        .cocSidebarBHTrophies span.cocTrophyCount {
            color: #fff !important;
        }
        .cocSidebarClan {
            display: flex;
            align-items: center;
            justify-content: center;
            gap: 5px;
            margin-top: 5px;
            padding: 4px 6px;
            background: var(--wcfContentBackground);
            border-radius: 4px;
            transition: background 0.2s;
        }
        .cocSidebarClan:hover {
            background: var(--wcfContentContainerBackground);
        }
        .cocSidebarClanBadge {
            width: 18px;
            height: 18px;
            object-fit: contain;
        }
        .cocSidebarClanName {
            font-size: 0.75rem;
            color: var(--wcfContentLink);
            white-space: nowrap;
            overflow: hidden;
            text-overflow: ellipsis;
            max-width: 120px;
        }
        
        /* Mobile Optimization - Compact Single-Row Layout */
        @media (max-width: 768px) {
            .cocSidebarInfo {
                padding: 6px;
                margin: 4px 0;
            }
            .cocSidebarRow {
                gap: 4px;
            }
            .cocSidebarCol {
                gap: 3px;
            }
            .cocSidebarDivider {
                height: 18px;
                margin: 0 2px;
            }
            .cocSidebarTH, .cocSidebarBH {
                width: 22px;
                height: 22px;
            }
            .cocSidebarLeague {
                width: 18px;
                height: 18px;
            }
            /* Hide BH league on mobile */
            .cocSidebarLeagueDesktop {
                display: none !important;
            }
            /* Hide the separate trophy row on mobile */
            .cocSidebarTrophiesRow {
                display: none !important;
            }
            /* Show inline trophies on mobile */
            .cocSidebarTrophies.cocSidebarTrophiesMobile {
                display: inline-flex !important;
            }
            .cocSidebarTrophies {
                padding: 2px 4px;
                font-size: 0.65rem;
                gap: 2px;
                border-radius: 4px;
            }
            .cocSidebarTrophies .cocTrophyIcon {
                font-size: 0.6rem;
            }
            .cocSidebarTrophies .cocTrophyImg {
                width: 10px;
                height: 10px;
            }
            .cocSidebarClan {
                margin-top: 4px;
                padding: 3px 6px;
            }
            .cocSidebarClanBadge {
                width: 14px;
                height: 14px;
            }
            .cocSidebarClanName {
                font-size: 0.7rem;
                max-width: 100px;
            }
            
            .cocSidebarClan {
                display: none !important;
            }
            
            /* Clan Modal Mobile */
            .cocSidebarClanModal.active {
                padding: 10px;
                align-items: flex-start;
            }
            .cocSidebarClanModalContent {
                margin: 10px auto;
                max-height: calc(100vh - 20px);
                display: flex;
                flex-direction: column;
            }
            .cocSidebarClanModalHeader {
                flex-direction: column;
                text-align: center;
                padding: 15px;
                flex-shrink: 0;
            }
            .cocSidebarClanBadgeLg {
                width: 60px;
                height: 60px;
            }
            .cocSidebarClanHeaderInfo {
                width: 100%;
            }
            .cocSidebarClanHeaderInfo h2 {
                font-size: 1.1rem;
                padding-right: 0;
            }
            .cocSidebarClanHeaderInfo .clanDescription {
                font-size: 0.8rem;
                -webkit-line-clamp: 2;
                display: -webkit-box;
                -webkit-box-orient: vertical;
                overflow: hidden;
            }
            .cocSidebarClanHeaderStats {
                justify-content: center;
                gap: 8px;
            }
            .cocSidebarClanHeaderStats .stat {
                padding: 8px 10px;
                min-width: 60px;
            }
            .cocSidebarClanHeaderStats .stat .value {
                font-size: 1rem;
            }
            .cocSidebarClanHeaderStats .stat .label {
                font-size: 0.6rem;
            }
            .cocSidebarClanMembersSection {
                padding: 15px;
                flex: 1;
                min-height: 0;
                display: flex;
                flex-direction: column;
            }
            .cocSidebarClanMembersSection > div {
                flex: 1;
                min-height: 0;
            }
            
            /* Members table to card layout on mobile */
            .cocSidebarClanMembersTable {
                display: block;
            }
            .cocSidebarClanMembersTable thead {
                display: none;
            }
            .cocSidebarClanMembersTable tbody {
                display: flex;
                flex-direction: column;
                gap: 8px;
            }
            .cocSidebarClanMembersTable tr {
                display: flex;
                flex-wrap: wrap;
                align-items: center;
                background: var(--wcfContentContainerBackground);
                border-radius: 8px;
                padding: 10px 12px;
                gap: 8px;
                border: none !important;
            }
            .cocSidebarClanMembersTable td {
                padding: 0 !important;
                border: none !important;
            }
            .cocSidebarClanMembersTable td:first-child {
                width: 24px;
                height: 24px;
                display: flex;
                align-items: center;
                justify-content: center;
                background: var(--wcfContentBackground);
                border-radius: 4px;
                font-size: 0.75rem;
                font-weight: 600;
                flex-shrink: 0;
            }
            .cocSidebarClanMembersTable td:nth-child(2) {
                flex: 1;
                min-width: 0;
            }
            .cocSidebarClanMembersTable td:nth-child(2) .memberName {
                display: block;
                white-space: nowrap;
                overflow: hidden;
                text-overflow: ellipsis;
                font-size: 0.9rem;
            }
            .cocSidebarClanMembersTable td:nth-child(2) .memberTag {
                display: none;
            }
            .cocSidebarClanMembersTable td:nth-child(3) {
                order: 10;
                width: 100%;
                margin-top: 4px;
            }
            .cocSidebarClanMembersTable td:nth-child(3) .memberRole {
                font-size: 0.7rem;
                padding: 2px 6px;
            }
            /* Hide TH and donations on mobile */
            .cocSidebarClanMembersTable td:nth-child(4),
            .cocSidebarClanMembersTable td:nth-child(6) {
                display: none;
            }
            /* Trophies on right */
            .cocSidebarClanMembersTable td:nth-child(5) {
                margin-left: auto;
                font-size: 0.85rem;
                font-weight: 600;
                color: #f59e0b;
            }
            .cocSidebarClanMembersTable td:nth-child(5)::before {
                content: '🏆 ';
            }
        }
        
        /* Very small screens - even more compact */
        @media (max-width: 400px) {
            .cocSidebarInfo {
                padding: 4px;
            }
            .cocSidebarTH, .cocSidebarBH {
                width: 18px;
                height: 18px;
            }
            .cocSidebarLeague {
                width: 14px;
                height: 14px;
            }
            .cocSidebarTrophies {
                padding: 1px 3px;
                font-size: 0.6rem;
            }
            .cocSidebarTrophies .cocTrophyImg {
                width: 8px;
                height: 8px;
            }
            .cocSidebarDivider {
                height: 14px;
            }
            .cocSidebarClanName {
                max-width: 70px;
                font-size: 0.6rem;
            }
            .cocSidebarClanBadge {
                width: 12px;
                height: 12px;
            }
            .cocSidebarClanHeaderStats .stat {
                padding: 6px 8px;
                min-width: 50px;
            }
        }

/* ============================================
   Shared Modals CSS (from cocSharedModals.tpl)
   ============================================ */
/* ============================================
   CoC Shared Modal Styles
   ============================================ */

/* Font */
@font-face { font-family: 'Clash'; src: url('/font/Clash_Regular.otf') format('opentype'); font-weight: normal; font-style: normal; font-display: swap; }

/* Base Modal */
.cocModal { display: none; position: fixed; z-index: 10000; left: 0; top: 0; width: 100%; height: 100%; background: rgba(0,0,0,0.7); overflow: hidden; font-family: 'Clash', sans-serif !important; }
.cocModal.active { display: flex; align-items: center; justify-content: center; padding: 20px; box-sizing: border-box; }
.cocModalContent { background: var(--wcfContentBackground); border-radius: 12px; max-width: 900px; width: 100%; position: relative; box-shadow: 0 10px 40px rgba(0,0,0,0.3); max-height: calc(100vh - 40px); overflow: hidden; display: flex; flex-direction: column; font-family: 'Clash', sans-serif !important; }
.cocModal * { font-family: inherit !important; }
.cocModalClose { position: absolute; top: 15px; right: 15px; font-size: 1.5rem; cursor: pointer; color: #8892b0; z-index: 10; background: rgba(0,0,0,0.3); width: 32px; height: 32px; border-radius: 50%; display: flex; align-items: center; justify-content: center; text-decoration: none; line-height: 1; }
.cocModalClose:hover { color: #fff; background: rgba(0,0,0,0.5); }
.cocModalHeader { background: var(--wcfContentContainerBackground); color: var(--wcfContentText); padding: 25px; border-radius: 12px 12px 0 0; flex-shrink: 0; border-bottom: 1px solid var(--wcfContentBorderInner); }
.cocModalHeader h2 { margin: 0 0 5px 0; padding-right: 30px; color: var(--wcfContentHeadlineText); }
.cocModalHeader .playerTag, .cocModalHeader .clanTag { font-size: 0.9rem; color: var(--wcfContentDimmedText); font-weight: normal; }
.cocModalHeader .clanInfo { color: var(--wcfContentText); margin-top: 5px; }
.cocModalHeader .registeredBadge { background: #4caf50; color: #fff; padding: 4px 10px; border-radius: 12px; font-size: 0.75rem; margin-left: 10px; }

/* Player Modal Header - New Layout */
.cocPlayerHeaderLayout { display: flex; justify-content: space-between; gap: 20px; }
.cocPlayerHeaderLeft { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 15px; }
.cocPlayerHeaderRight { flex-shrink: 0; min-width: 200px; display: flex; flex-direction: column; justify-content: flex-start; padding-right: 30px; }

/* Player Identity Row (TH + Name/Tag) */
.cocPlayerIdentity { display: flex; align-items: center; gap: 12px; }
.cocPlayerTHImage { flex-shrink: 0; }
.cocPlayerTHImage img { width: 40px; height: 40px; object-fit: contain; }
.cocPlayerTHFallback { width: 40px; height: 40px; display: flex; align-items: center; justify-content: center; font-size: 1rem; font-weight: 700; color: #a29bfe; background: rgba(255,255,255,0.1); border-radius: 6px; }
.cocPlayerInfo { display: flex; flex-direction: column; justify-content: center; }
.cocPlayerNameRow { display: flex; align-items: center; gap: 8px; }
.cocPlayerName { font-size: 1.3rem; font-weight: 700; line-height: 1.2; }
.cocRegisteredCheck { display: inline-flex; align-items: center; justify-content: center; width: 18px; height: 18px; background: #4caf50; color: #fff; border-radius: 50%; font-size: 0.7rem; font-weight: 700; cursor: default; }
.cocPlayerTag { font-size: 0.85rem; color: #8892b0; }

/* Clan Row (Badge + Clan Name/Role) */
.cocPlayerClanRow { display: flex; align-items: center; gap: 12px; }
.cocPlayerClanBadge { flex-shrink: 0; width: 40px; height: 40px; }
.cocPlayerClanBadge img { width: 40px; height: 40px; object-fit: contain; }
.cocPlayerClanBadgeEmpty { width: 40px; height: 40px; background: rgba(255,255,255,0.1); border-radius: 6px; }
.cocPlayerClanInfo { display: flex; flex-direction: column; justify-content: center; }
.cocPlayerClanName { font-size: 1rem; color: var(--wcfContentHeadlineText); font-weight: 600; }
.cocPlayerClanRole { font-size: 0.85rem; color: var(--wcfContentDimmedText); }

/* Stats Right Side */
.cocPlayerStatRow { display: flex; justify-content: space-between; align-items: center; padding: 8px 0; gap: 15px; }
.cocPlayerStatLabel { font-size: 0.85rem; color: var(--wcfContentDimmedText); }
.cocPlayerStatValue { font-size: 1rem; font-weight: 600; color: var(--wcfContentHeadlineText); display: flex; align-items: center; gap: 6px; }
.cocLeagueBadgeSmall { width: 24px; height: 24px; object-fit: contain; }
.cocPlayerStatDivider { height: 1px; background: var(--wcfContentBorderInner); }
.cocModalBody { padding: 20px; overflow-y: auto; flex: 1; min-height: 0; overscroll-behavior: contain; scrollbar-width: thin; scrollbar-color: transparent transparent; transition: scrollbar-color 0.3s; }
.cocModalBody:hover { scrollbar-color: rgba(155, 155, 155, 0.5) transparent; }
.cocModalBody::-webkit-scrollbar { width: 6px; }
.cocModalBody::-webkit-scrollbar-track { background: transparent; }
.cocModalBody::-webkit-scrollbar-thumb { background: transparent; border-radius: 3px; transition: background 0.3s; }
.cocModalBody:hover::-webkit-scrollbar-thumb { background: rgba(155, 155, 155, 0.5); }
.cocModalBody::-webkit-scrollbar-thumb:hover { background: rgba(155, 155, 155, 0.7); }
.cocModalStats { display: grid; grid-template-columns: repeat(auto-fit, minmax(80px, 1fr)); gap: 10px; margin-bottom: 20px; }
.cocModalStat { background: var(--wcfContentContainerBackground); border-radius: 8px; padding: 12px 8px; text-align: center; }
.cocModalStat .value { font-size: 1.2rem; font-weight: 700; color: var(--wcfContentHeadlineText); }
.cocModalStat .label { font-size: 0.7rem; color: var(--wcfContentDimmedText); text-transform: uppercase; }
.cocModalSection { margin-bottom: 20px; }
.cocModalSection h4 { margin: 0 0 10px 0; font-size: 0.95rem; color: var(--wcfContentHeadlineText); border-bottom: 1px solid var(--wcfContentBorderInner); padding-bottom: 8px; }
.cocModalGrid { display: grid; grid-template-columns: repeat(auto-fill, 55px); gap: 8px; justify-content: start; }
.cocModalItem { background: var(--wcfContentContainerBackground); border-radius: 6px; width: 55px; height: 55px; position: relative; overflow: hidden; }
.cocModalItem img { width: 55px; height: 55px; object-fit: contain; display: block; }
.cocModalItem .level { position: absolute; bottom: 0; left: 0; font-size: 0.6rem; font-weight: 600; color: #fff; background: rgba(0,0,0,0.7); padding: 1px 4px; border-radius: 0 4px 0 6px; z-index: 2; }
.cocModalItem.maxed .level { background: linear-gradient(to top, rgba(180,50,0,0.9) 0%, rgba(255,100,0,0.85) 50%, rgba(255,150,0,0.8) 100%); box-shadow: 0 0 4px rgba(255,100,0,0.6), 0 0 8px rgba(255,50,0,0.4); overflow: visible; animation: cocBoxGlow 0.5s ease-in-out infinite alternate; }
@keyframes cocBoxGlow { 0% { box-shadow: 0 0 3px rgba(255,100,0,0.5), 0 0 6px rgba(255,50,0,0.3); } 100% { box-shadow: 0 0 5px rgba(255,150,0,0.7), 0 0 10px rgba(255,80,0,0.5); } }
.cocModalItem.maxed .level .p { position: absolute; border-radius: 50%; mix-blend-mode: screen; opacity: 0; pointer-events: none; }
.cocModalItem.maxed .level .p1 { left: 5%; bottom: 2px; width: 3px; height: 3px; background: radial-gradient(circle, rgba(255,220,0,1) 20%, rgba(255,220,0,0) 70%); animation: cocFire1 0.6s ease-in infinite; }
.cocModalItem.maxed .level .p2 { left: 20%; bottom: 0; width: 4px; height: 4px; background: radial-gradient(circle, rgba(255,120,0,1) 20%, rgba(255,120,0,0) 70%); animation: cocFire2 0.8s ease-in infinite 0.15s; }
.cocModalItem.maxed .level .p3 { left: 35%; bottom: 1px; width: 3px; height: 3px; background: radial-gradient(circle, rgba(255,180,0,1) 20%, rgba(255,180,0,0) 70%); animation: cocFire1 0.7s ease-in infinite 0.3s; }
.cocModalItem.maxed .level .p4 { left: 50%; bottom: 0; width: 4px; height: 4px; background: radial-gradient(circle, rgba(255,80,0,1) 20%, rgba(255,80,0,0) 70%); animation: cocFire3 0.9s ease-in infinite 0.1s; }
.cocModalItem.maxed .level .p5 { left: 65%; bottom: 2px; width: 2px; height: 2px; background: radial-gradient(circle, rgba(255,200,50,1) 20%, rgba(255,200,50,0) 70%); animation: cocFire2 0.65s ease-in infinite 0.4s; }
.cocModalItem.maxed .level .p6 { left: 75%; bottom: 0; width: 3px; height: 3px; background: radial-gradient(circle, rgba(255,100,0,1) 20%, rgba(255,100,0,0) 70%); animation: cocFire1 0.75s ease-in infinite 0.25s; }
.cocModalItem.maxed .level .p7 { left: 88%; bottom: 1px; width: 2px; height: 2px; background: radial-gradient(circle, rgba(255,160,0,1) 20%, rgba(255,160,0,0) 70%); animation: cocFire3 0.7s ease-in infinite 0.5s; }
.cocModalItem.maxed .level .p8 { left: 95%; bottom: 0; width: 3px; height: 3px; background: radial-gradient(circle, rgba(255,140,20,1) 20%, rgba(255,140,20,0) 70%); animation: cocFire2 0.85s ease-in infinite 0.35s; }
@keyframes cocFire1 { 0% { opacity: 0; transform: translateY(0) translateX(0) scale(1); } 15% { opacity: 1; } 100% { opacity: 0; transform: translateY(-14px) translateX(-2px) scale(0.2); } }
@keyframes cocFire2 { 0% { opacity: 0; transform: translateY(0) translateX(0) scale(1); } 20% { opacity: 1; } 100% { opacity: 0; transform: translateY(-16px) translateX(2px) scale(0.15); } }
@keyframes cocFire3 { 0% { opacity: 0; transform: translateY(0) translateX(0) scale(1); } 18% { opacity: 1; } 100% { opacity: 0; transform: translateY(-12px) translateX(-1px) scale(0.25); } }
.cocModalError { text-align: center; padding: 40px; color: #991b1b; }

/* Hero with equipment - clickable indicator */
.cocModalHero { position: relative; cursor: pointer; }
.cocModalHero::after { content: ''; position: absolute; top: 2px; right: 2px; width: 8px; height: 8px; background: #64ffda; border-radius: 50%; opacity: 0.8; }

/* Floating equipment tooltip */
.cocEquipTooltip { position: fixed; background: var(--wcfContentContainerBackground, #1a1a2e); border: 1px solid var(--wcfContentBorderInner, #444); border-radius: 8px; padding: 8px; z-index: 100000; box-shadow: 0 4px 20px rgba(0,0,0,0.5); pointer-events: none; max-width: calc(100vw - 20px); width: auto; height: auto; }
.cocEquipGrid { display: inline-grid; grid-template-columns: repeat(4, 36px); gap: 5px; }
.cocEquipItem { width: 36px; height: 36px; position: relative; background: var(--wcfContentBackground, #252540); border-radius: 4px; overflow: hidden; }
.cocEquipItem img { width: 100%; height: 100%; object-fit: contain; }
.cocEquipItem .eqLevel { position: absolute; bottom: 0; left: 0; font-size: 0.55rem; font-weight: 600; color: #fff; background: rgba(0,0,0,0.75); padding: 1px 3px; border-radius: 0 3px 0 4px; }
.cocEquipItem.epic { background: linear-gradient(135deg, #B640A8, #642785); padding: 2px; }
.cocEquipItem.epic .eqLevel { background: linear-gradient(135deg, #8e44ad, #9b59b6); }
.cocEquipItem.common { background: linear-gradient(135deg, #10C0DC, #46AFEF); padding: 2px; }
.cocEquipItem.common .eqLevel { background: linear-gradient(135deg, #2980b9, #3498db); }
.cocEquipItem.maxed .eqLevel { background: linear-gradient(to top, rgba(180,50,0,0.9) 0%, rgba(255,100,0,0.85) 50%, rgba(255,150,0,0.8) 100%); box-shadow: 0 0 4px rgba(255,100,0,0.6), 0 0 8px rgba(255,50,0,0.4); overflow: visible; animation: cocBoxGlow 0.5s ease-in-out infinite alternate; }
.cocEquipItem.maxed .eqLevel .p { position: absolute; border-radius: 50%; mix-blend-mode: screen; opacity: 0; pointer-events: none; }
.cocEquipItem.maxed .eqLevel .p1 { left: 5%; bottom: 2px; width: 2px; height: 2px; background: radial-gradient(circle, rgba(255,220,0,1) 20%, rgba(255,220,0,0) 70%); animation: cocFire1 0.6s ease-in infinite; }
.cocEquipItem.maxed .eqLevel .p2 { left: 25%; bottom: 0; width: 3px; height: 3px; background: radial-gradient(circle, rgba(255,120,0,1) 20%, rgba(255,120,0,0) 70%); animation: cocFire2 0.8s ease-in infinite 0.15s; }
.cocEquipItem.maxed .eqLevel .p3 { left: 50%; bottom: 1px; width: 2px; height: 2px; background: radial-gradient(circle, rgba(255,180,0,1) 20%, rgba(255,180,0,0) 70%); animation: cocFire1 0.7s ease-in infinite 0.3s; }
.cocEquipItem.maxed .eqLevel .p4 { left: 75%; bottom: 0; width: 3px; height: 3px; background: radial-gradient(circle, rgba(255,80,0,1) 20%, rgba(255,80,0,0) 70%); animation: cocFire3 0.9s ease-in infinite 0.1s; }
.cocEquipItem.maxed .eqLevel .p5 { left: 95%; bottom: 2px; width: 2px; height: 2px; background: radial-gradient(circle, rgba(255,200,50,1) 20%, rgba(255,200,50,0) 70%); animation: cocFire2 0.65s ease-in infinite 0.4s; }
.cocEquipEmpty { color: var(--wcfContentDimmedText); font-size: 0.75rem; text-align: center; padding: 10px; }

/* Mobile: smaller equipment tooltip */
@media (max-width: 480px) {
    .cocEquipTooltip { padding: 6px; }
    .cocEquipGrid { grid-template-columns: repeat(4, 30px); gap: 4px; }
    .cocEquipItem { width: 30px; height: 30px; }
    .cocEquipItem .eqLevel { font-size: 0.5rem; padding: 1px 2px; }
}

/* Clan Detail Modal Header */
/* Clan Modal Header - same style as player modal */
.cocModalHeader .cocClanHeaderLayout { display: flex; flex-direction: row; justify-content: space-between; gap: 20px; flex-wrap: nowrap; }
.cocModalHeader .cocClanHeaderLeft { flex: 1; min-width: 0; display: flex; gap: 15px; align-items: flex-start; max-width: 60%; }
.cocModalHeader .cocClanHeaderRight { flex-shrink: 0; min-width: 200px; display: flex; flex-direction: column; justify-content: flex-start; padding-right: 30px; }
.cocClanDetailBadge { width: 70px; height: 70px; object-fit: contain; flex-shrink: 0; }
.cocClanDetailInfo { flex: 1; min-width: 0; }
.cocClanDetailDesc { font-size: 0.85rem; color: var(--wcfContentDimmedText); margin-top: 8px; font-style: italic; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }

/* Clan Members Table */
.cocClanMembersTable { width: 100%; border-collapse: collapse; font-size: 0.85rem; }
.cocClanMembersTable thead tr { background: var(--wcfContentContainerBackground); }
.cocClanMembersTable th { padding: 8px 10px; text-align: left; font-weight: 600; font-size: 0.75rem; text-transform: uppercase; color: var(--wcfContentDimmedText); }
.cocClanMembersTable th:nth-child(n+4) { text-align: center; }
.cocClanMembersTable tbody tr { border-bottom: 1px solid var(--wcfContentBorderInner); }
.cocClanMembersTable td { padding: 8px 10px; }
.cocMemberRank { width: 40px; }
.cocMemberPlayer .cocRegisteredMark { color: #4caf50; font-size: 0.8rem; margin-left: 5px; }
.cocMemberMobileExtra { display: none; font-size: 0.75rem; margin-top: 4px; }
.cocMemberTH img { width: 28px; height: 28px; }
.cocMemberLeague img { width: 28px; height: 28px; }
.cocMemberTH, .cocMemberLeague { text-align: center; }
.cocMemberTrophies { text-align: center; }

/* Player/Clan Buttons */
.cocPlayerBtn { display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px; background: var(--wcfButtonBackground); color: var(--wcfButtonText); border: 1px solid var(--wcfButtonBorder, var(--wcfContentBorderInner)); border-radius: 6px; cursor: pointer; font-size: 0.9rem; font-weight: 600; transition: all 0.2s; text-decoration: none; }
.cocPlayerBtn:hover { background: var(--wcfButtonBackgroundActive, var(--wcfButtonBackground)); border-color: var(--wcfButtonBorderActive, var(--wcfButtonBorder, var(--wcfContentBorderInner))); }
.cocClanBtn { display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px; background: var(--wcfButtonBackground); color: var(--wcfButtonText); border: 1px solid var(--wcfButtonBorder, var(--wcfContentBorderInner)); border-radius: 6px; cursor: pointer; font-size: 0.85rem; transition: all 0.2s; text-decoration: none; }
.cocClanBtn:hover { background: var(--wcfButtonBackgroundActive, var(--wcfButtonBackground)); border-color: var(--wcfButtonBorderActive, var(--wcfButtonBorder, var(--wcfContentBorderInner))); }
.cocClanBtn img { width: 18px; height: 18px; object-fit: contain; }

/* Trophy Display */
.cocTrophyDisplay { display: inline-flex; align-items: center; gap: 4px; background: #f59e0b; color: #fff; padding: 4px 10px; border-radius: 6px; font-size: 0.85rem; }
.cocTrophyDisplay .cocTrophyIcon { font-size: 0.9rem; }
.cocTrophyDisplay .cocTrophyCount { font-weight: 600; color: #fff !important; }

/* Action Buttons */
.cocBtn { padding: 10px 20px; border: none; border-radius: 6px; cursor: pointer; font-size: 0.95rem; font-weight: 500; text-decoration: none; display: inline-block; }
.cocBtnPrimary { background: var(--wcfButtonPrimaryBackground); color: var(--wcfButtonPrimaryText); }
.cocBtnSecondary { background: var(--wcfButtonBackground); color: var(--wcfButtonText); }

/* ============================================
   Mobile Responsive Styles
   ============================================ */

/* Tablet - 768px */
@media (max-width: 768px) {
    .cocModal.active { padding: 10px; }
    .cocModalContent { max-height: calc(100vh - 20px); }
    .cocModalHeader { padding: 15px; }
    .cocModalBody { padding: 15px; }
    .cocModalStats { grid-template-columns: repeat(3, 1fr); gap: 8px; }
    .cocModalStat { padding: 10px 6px; }
    .cocModalStat .value { font-size: 1rem; }
    .cocModalStat .label { font-size: 0.6rem; }
    .cocModalGrid { grid-template-columns: repeat(auto-fill, 48px); gap: 6px; }
    .cocModalItem { width: 48px; height: 48px; }
    .cocModalItem img { width: 48px; height: 48px; }
    .cocModalSection h4 { font-size: 0.85rem; margin-bottom: 8px; padding-bottom: 6px; }
    
    /* Player Header - Mobile */
    .cocPlayerHeaderLayout { flex-direction: column; gap: 15px; }
    .cocPlayerHeaderLeft { flex-direction: row; justify-content: center; align-items: center; gap: 20px; }
    .cocPlayerHeaderRight { min-width: 0; width: 100%; padding-right: 0; }
    .cocPlayerIdentity { gap: 10px; }
    .cocPlayerTHImage img, .cocPlayerTHFallback { width: 36px; height: 36px; }
    .cocPlayerName { font-size: 1.1rem; }
    .cocRegisteredCheck { width: 16px; height: 16px; font-size: 0.6rem; }
    .cocPlayerTag { font-size: 0.8rem; }
    .cocPlayerClanRow { gap: 10px; }
    .cocPlayerClanBadge, .cocPlayerClanBadge img, .cocPlayerClanBadgeEmpty { width: 36px; height: 36px; }
    .cocPlayerClanName { font-size: 0.9rem; }
    .cocPlayerClanRole { font-size: 0.8rem; }
    .cocPlayerStatRow { padding: 6px 0; }
    .cocPlayerStatLabel { font-size: 0.8rem; }
    .cocPlayerStatValue { font-size: 0.9rem; }
    .cocLeagueBadgeSmall { width: 20px; height: 20px; }
    
    /* Clan Detail Modal - Mobile */
    .cocModalHeader .cocClanHeaderLayout { flex-direction: column; gap: 15px; }
    .cocModalHeader .cocClanHeaderLeft { flex-direction: column; align-items: center; text-align: center; gap: 12px; max-width: 100%; }
    .cocModalHeader .cocClanHeaderRight { min-width: 0; width: 100%; padding-right: 0; }
    .cocClanDetailBadge { width: 60px; height: 60px; }
    .cocClanDetailDesc { font-size: 0.75rem; -webkit-line-clamp: 2; }
    
    /* Clan Members Table - Mobile Card Layout */
    .cocClanMembersTable { display: block; }
    .cocClanMembersTable thead { display: none; }
    .cocClanMembersTable tbody { display: flex; flex-direction: column; gap: 8px; }
    .cocClanMembersTable tbody tr {
        display: flex;
        flex-wrap: wrap;
        align-items: center;
        background: var(--wcfContentContainerBackground);
        border-radius: 10px;
        padding: 10px 12px;
        gap: 10px;
        border: none !important;
        cursor: pointer;
        transition: transform 0.1s, background 0.1s;
    }
    .cocClanMembersTable tbody tr:active {
        transform: scale(0.98);
        background: var(--wcfContentBackground);
    }
    .cocMemberRank {
        width: 28px;
        height: 28px;
        display: flex;
        align-items: center;
        justify-content: center;
        background: var(--wcfContentBackground);
        border-radius: 6px;
        font-size: 0.8rem;
        font-weight: 600;
        flex-shrink: 0;
        padding: 0;
    }
    .cocMemberPlayer {
        flex: 1;
        min-width: 0;
        padding: 0 !important;
    }
    .cocMemberPlayer .cocPlayerBtn {
        display: inline-flex;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
        font-size: 0.8rem;
        padding: 3px 8px;
        max-width: 120px;
    }
    .cocMemberMobileExtra { display: block; color: var(--wcfContentDimmedText); }
    .cocMemberTrophies {
        padding: 0 !important;
        margin-left: auto;
    }
    .cocMemberTrophies .cocTrophyDisplay {
        padding: 4px 8px;
        min-width: 60px;
        font-size: 0.8rem;
        color: #fff !important;
    }
    .cocHideMobile { display: none !important; }
    
    /* Button styles */
    .cocBtn { padding: 12px 20px; font-size: 0.9rem; }
    .cocPlayerBtn, .cocClanBtn { padding: 3px 8px; font-size: 0.8rem; }
    .cocClanBtn img { width: 16px; height: 16px; }
}

/* Small phones - 480px */
@media (max-width: 480px) {
    .cocModal.active { padding: 0; align-items: flex-end; }
    .cocModalContent { 
        max-width: 100%; 
        max-height: 95vh; 
        border-radius: 16px 16px 0 0;
        margin-bottom: 0;
    }
    .cocModalClose { 
        top: 10px; 
        right: 10px; 
        width: 28px; 
        height: 28px; 
        font-size: 1.2rem; 
    }
    .cocModalHeader { padding: 12px; padding-top: 40px; }
    .cocModalBody { padding: 12px; }
    
    .cocPlayerHeaderLayout { gap: 12px; }
    .cocPlayerHeaderLeft { gap: 15px; flex-wrap: wrap; justify-content: center; }
    .cocPlayerName { font-size: 1rem; }
    .cocPlayerTag { font-size: 0.75rem; }
    .cocPlayerStatRow { padding: 5px 0; }
    .cocPlayerStatLabel, .cocPlayerStatValue { font-size: 0.8rem; }
    
    .cocModalStats { grid-template-columns: repeat(3, 1fr); gap: 6px; }
    .cocModalStat { padding: 8px 4px; }
    .cocModalStat .value { font-size: 0.95rem; }
    .cocModalStat .label { font-size: 0.55rem; }
    
    .cocModalGrid { grid-template-columns: repeat(auto-fill, 42px); gap: 5px; }
    .cocModalItem { width: 42px; height: 42px; }
    .cocModalItem img { width: 42px; height: 42px; }
    .cocModalItem .level { font-size: 0.55rem; padding: 1px 3px; }
    
    .cocClanDetailBadge { width: 50px; height: 50px; }
    
    .cocClanMembersTable tbody tr { padding: 8px 10px; gap: 8px; }
    .cocMemberRank { width: 24px; height: 24px; font-size: 0.75rem; }
    .cocMemberPlayer .cocPlayerBtn { max-width: 100px; font-size: 0.75rem; padding: 2px 6px; }
    .cocMemberMobileExtra { font-size: 0.7rem; }
    .cocMemberTrophies .cocTrophyDisplay { padding: 3px 6px; min-width: 50px; font-size: 0.75rem; }
    
    /* Equipment tooltip on mobile */
    .cocEquipTooltip { 
        position: fixed; 
        bottom: 20px; 
        left: 50%; 
        transform: translateX(-50%); 
        top: auto;
        max-width: calc(100% - 40px);
    }
    .cocEquipGrid { grid-template-columns: repeat(4, 36px); gap: 5px; }
    .cocEquipItem { width: 36px; height: 36px; }
}

/* ============================================
   User Profile CSS (from cocUserProfileContent.tpl)
   ============================================ */
.cocProfileContainer { padding: 20px; }

/* Table Styles */
.cocProfileTable { width: 100%; background: var(--wcfContentBackground); border-radius: 8px; overflow: hidden; box-shadow: 0 2px 4px rgba(0,0,0,0.1); border-collapse: collapse; }
.cocProfileTable th, .cocProfileTable td { padding: 12px 15px; text-align: left; }
.cocProfileTable th { background: var(--wcfContentContainerBackground); font-weight: 600; font-size: 0.85rem; text-transform: uppercase; color: var(--wcfContentDimmedText); }
.cocProfileTable tbody tr { border-bottom: 1px solid var(--wcfContentBorderInner); }
.cocProfileTable tbody tr:hover { background: var(--wcfContentContainerBackground); }
.cocProfileTable tbody tr.primary { background: rgba(139, 92, 246, 0.08); }
.cocProfileTable tbody tr.primary:hover { background: rgba(139, 92, 246, 0.12); }

.cocProfilePlayerName { font-weight: 600; }
.cocProfilePlayerName .tag { font-size: 0.8rem; color: var(--wcfContentDimmedText); font-weight: normal; display: block; margin-top: 2px; }
.cocProfileTHIcon { width: 32px; height: 32px; object-fit: contain; vertical-align: middle; }
.cocProfileLeagueIcon { width: 28px; height: 28px; object-fit: contain; vertical-align: middle; }
.cocProfileTrophyDisplay { display: inline-flex; align-items: center; justify-content: center; gap: 4px; background: #f59e0b; color: #fff; padding: 4px 8px; border-radius: 6px; min-width: 80px; }
.cocProfileTrophyDisplay .cocTrophyIcon { font-size: 1rem; }
.cocProfileTrophyDisplay .cocTrophyCount { font-weight: 600; color: #fff; }

.cocProfilePrimaryBadge { display: inline-block; background: var(--wcfButtonPrimaryBackground); color: var(--wcfButtonPrimaryText); padding: 2px 8px; border-radius: 10px; font-size: 0.7rem; font-weight: 600; margin-left: 8px; vertical-align: middle; }

.cocProfileNoAccount { text-align: center; padding: 60px 20px; color: var(--wcfContentDimmedText); }
.cocProfileNoAccount .icon { font-size: 4rem; margin-bottom: 20px; opacity: 0.5; }
.cocProfileNoAccount h3 { margin: 0 0 10px 0; color: var(--wcfContentText); }

.cocProfileAccountCount { margin-bottom: 15px; color: var(--wcfContentDimmedText); font-size: 0.9rem; }
.cocProfileAccountCount strong { color: var(--wcfContentText); }

/* Mobile Responsive */
@media (max-width: 768px) {
    .cocProfileContainer { padding: 10px; }
    
    /* Convert table to card layout on mobile */
    .cocProfileTable { display: block; background: none; box-shadow: none; }
    .cocProfileTable thead { display: none; }
    .cocProfileTable tbody { display: flex; flex-direction: column; gap: 10px; }
    .cocProfileTable tbody tr {
        display: flex;
        flex-wrap: wrap;
        align-items: center;
        background: var(--wcfContentBackground);
        border-radius: 12px;
        padding: 12px 15px;
        gap: 10px;
        border: 1px solid var(--wcfContentBorderInner) !important;
        cursor: pointer;
        transition: transform 0.1s, box-shadow 0.1s;
    }
    .cocProfileTable tbody tr:active {
        transform: scale(0.98);
    }
    .cocProfileTable tbody tr.primary {
        border-color: var(--wcfButtonPrimaryBackground) !important;
        border-width: 2px !important;
    }
    
    /* TH icon on left */
    .cocProfileTable td:has(.cocProfileTHIcon) {
        order: -1;
        padding: 0 !important;
    }
    .cocProfileTHIcon { width: 40px; height: 40px; }
    
    /* Player name takes center */
    .cocProfileTable td.cocProfilePlayerName {
        flex: 1;
        min-width: 0;
        padding: 0 !important;
        order: 0;
    }
    .cocProfileTable .cocPlayerBtn,
    .cocProfileTable .cocClanBtn {
        display: block;
        padding: 0;
        background: none;
        border: none;
        font-size: 0.95rem;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }
    .cocProfilePlayerName .tag {
        font-size: 0.7rem;
        display: none;
    }
    .cocProfilePrimaryBadge { font-size: 0.65rem; padding: 1px 6px; }
    
    /* Trophies on right */
    .cocProfileTable td:last-child {
        padding: 0 !important;
        order: 1;
        margin-left: auto;
    }
    .cocProfileTrophyDisplay { min-width: 70px; padding: 4px 8px; font-size: 0.85rem; }
    
    /* Tap indicator */
    .cocProfileTable tbody tr::after {
        content: '›';
        font-size: 1.3rem;
        color: var(--wcfContentDimmedText);
        order: 2;
        margin-left: 5px;
    }
    
    /* Hide clan and league on mobile */
    .cocProfileTable td.cocProfileClanName,
    .cocProfileTable td:has(.cocProfileLeagueIcon) {
        display: none !important;
    }
}

/* Army card sidebar button hover effects */
.cocCardVideoBtn:hover {
    background: linear-gradient(135deg, #b91c1c, #dc2626) !important;
}

.cocCardCopyBtn:hover {
    background: linear-gradient(135deg, #1d4ed8, #2563eb) !important;
}

.cocCardCautionBtn:hover {
    background: linear-gradient(135deg, #b45309, #d97706) !important;
}

.cocCardNotesBtn:hover {
    background: linear-gradient(135deg, #1d4ed8, #2563eb) !important;
}

/* Army Tab Row Styles */
.cocArmyRow {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    padding: 10px;
    border-bottom: 1px solid var(--wcfContentBorderInner);
    gap: 10px;
}

.cocArmyRowContent {
    flex: 1;
    min-width: 0;
}

.cocArmyRowHeader {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-bottom: 4px;
}

.cocArmyRowTH {
    width: 24px;
    height: 24px;
}

.cocArmyRowPreview {
    display: flex;
    flex-wrap: wrap;
    gap: 3px;
    align-items: center;
}

.cocArmyRowActions {
    display: flex;
    gap: 5px;
    flex-shrink: 0;
}

/* Mobile responsive for army tab rows */
@media (max-width: 500px) {
    .cocArmyRow {
        flex-direction: column;
        gap: 8px;
    }
    
    .cocArmyRowContent {
        width: 100%;
    }
    
    .cocArmyRowActions {
        width: 100%;
        justify-content: flex-end;
        padding-top: 8px;
        border-top: 1px solid var(--wcfContentBorderInner);
    }
}
