* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    background: #0b0e13;
    color: #fff;
    line-height: 1.6;
    padding: 0 15px;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 30px 15px;
}

/* Page Title */
.page-title {
    text-align: center;
    margin-bottom: 30px;
    padding: 20px 0;
}

.page-title h1 {
    font-size: 32px;
    font-weight: 700;
    background: linear-gradient(135deg, #3b82f6 0%, #8b5cf6 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* Charts Section */
.charts-section {
    display: flex;
    flex-direction: column;
    gap: 20px;
    margin-bottom: 30px;
}

.chart-card {
    background: #151921;
    border-radius: 12px;
    padding: 20px;
    border: 1px solid rgba(255, 255, 255, 0.03);
}

.chart-card-wide {
    width: 100%;
}

.chart-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 20px;
    flex-wrap: wrap;
    gap: 15px;
}

.chart-card h3 {
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 8px;
    color: #f3f4f6;
}

.chart-description {
    font-size: 12px;
    color: #6b7280;
    margin-bottom: 0;
    line-height: 1.5;
}

.chart-filters {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.filter-divider {
    width: 1px;
    background: rgba(255, 255, 255, 0.1);
    margin: 0 4px;
}

.filter-btn {
    background: rgba(255, 255, 255, 0.05);
    color: #9ca3af;
    border: 1px solid rgba(255, 255, 255, 0.1);
    padding: 8px 16px;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    white-space: nowrap;
}

.filter-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.2);
    color: #f3f4f6;
}

.filter-btn.active {
    background: #3b82f6;
    border-color: #3b82f6;
    color: #fff;
}

/* Header */

.recruitment-card,
.dashboard-header {
    background: linear-gradient(135deg, #151921 0%, #0f1218 100%);
    border-radius: 12px;
    padding: 25px;
    margin-bottom: 25px;
    border: 1px solid rgba(255, 255, 255, 0.03);
}

.recruitment-card span {
    font-size: 1.2em;
    color: #f3f4f6;
}

.recruitment-card span a {
    color: orange;
    text-decoration: none;
    font-weight: 600;
    display: inline-block; /* required so transform works reliably */
    transform-origin: center;
    will-change: transform;
    animation: pulse 1.6s ease-in-out infinite;
    margin-left: 15px;
}

@keyframes pulse {
    0%, 100% { transform: scale(1); }
    50%     { transform: scale(1.1); }
}

.header-stats {
    display: flex;
    gap: 40px;
}

.stat-item {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.stat-item-progress {
    min-width: 200px;
    flex: 1;
}

.dkp-progress-wrapper {
    display: flex;
    flex-direction: column;
    width: 100%;
}

.stat-label {
    color: #6b7280;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-weight: 500;
}

.stat-value {
    font-size: 24px;
    font-weight: 700;
    color: #f3f4f6;
}

.stat-value.power-down {
    color: #ef4444;
}

.stat-value.power-up {
    color: #22c55e;
}

.stat-change {
    font-size: 12px;
    color: #6b7280;
}

/* Dashboard Controls */
.dashboard-controls {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
}

.dashboard-controls h1 {
    font-size: 20px;
    font-weight: 600;
    color: #f3f4f6;
}

.controls {
    display: flex;
    gap: 10px;
    align-items: center;
}

.filter-select,
.search-input {
    background: #151921;
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 6px;
    padding: 7px 12px;
    font-size: 13px;
    color: #fff;
    font-size: 14px;
    outline: none;
    transition: all 0.3s ease;
}

.filter-select:hover,
.search-input:hover {
    border-color: rgba(255, 255, 255, 0.12);
}

.filter-select:focus,
.search-input:focus {
    border-color: #4dabf7;
}

.search-input {
    min-width: 250px;
}

.btn-export,
.btn-view {
    background: #1f2937;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 6px;
    padding: 7px 14px;
    color: #f3f4f6;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-view {
    background: #3b82f6;
    border-color: #3b82f6;
    color: #fff;
}

.btn-export:hover {
    background: #374151;
    border-color: rgba(255, 255, 255, 0.15);
}

.btn-view:hover {
    background: #2563eb;
    box-shadow: 0 2px 8px rgba(59, 130, 246, 0.3);
}

/* DKP Formula */
.dkp-formula {
    text-align: center;
    margin-bottom: 16px;
    padding: 12px 20px;
    background: rgba(17, 24, 39, 0.6);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 8px;
    font-size: 14px;
}

.formula-label {
    color: #9ca3af;
    font-weight: 600;
    margin-right: 8px;
}

.formula-text {
    color: #e5e7eb;
    font-family: 'Courier New', monospace;
    font-weight: 500;
}

.t4-color {
    color: #a78bfa;
    font-weight: 700;
}

.t5-color {
    color: #fbbf24;
    font-weight: 700;
}

.dead-color {
    color: #ef4444;
    font-weight: 700;
}

/* Ranking Info */
.ranking-info {
    margin-bottom: 12px;
    color: #6b7280;
    font-size: 12px;
    font-size: 14px;
}

/* Table Container */
.table-container {
    background: #151921;
    border-radius: 8px;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.03);
    width: 100%;
}

.ranking-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
    table-layout: auto;
}

.ranking-table thead {
    background: rgba(0, 0, 0, 0.5);
}

.ranking-table th {
    padding: 12px 16px;
    text-align: left;
    font-size: 10px;
    font-weight: 600;
    color: #6b7280;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    cursor: pointer;
    user-select: none;
    white-space: nowrap;
}

.ranking-table th:first-child {
    padding-left: 20px;
}

.ranking-table th.sortable:hover {
    color: #9ca3af;
}

.sort-icon {
    margin-left: 5px;
    opacity: 0.4;
}

.ranking-table tbody tr {
    border-bottom: 1px solid rgba(255, 255, 255, 0.03);
    transition: background 0.15s ease;
}

.ranking-table tbody tr:hover {
    background: rgba(255, 255, 255, 0.02);
}

.ranking-table td {
    padding: 10px 16px;
    font-size: 13px;
    vertical-align: middle;
}

.ranking-table td:first-child {
    padding-left: 20px;
}

/* Rank Column */
.rank-cell {
    font-weight: 600;
    color: #9ca3af;
    font-size: 13px;
}

/* Governor Column */
.governor-cell {
    display: flex;
    align-items: center;
    gap: 12px;
    cursor: pointer;
}

.governor-cell:hover .governor-name {
    color: #60a5fa;
}

.governor-info {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.governor-name {
    font-weight: 600;
    color: #f3f4f6;
    font-size: 13px;
    transition: color 0.15s ease;
}

.governor-id {
    font-size: 11px;
    color: #6b7280;
}

/* Stat Columns with Tags */
.stat-cell {
    display: flex;
    flex-direction: column;
    gap: 6px;
    align-items: flex-start;
}

.stat-value {
    font-weight: 600;
    color: #f3f4f6;
    font-size: 13px;
}

.stat-tag {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 2px 6px;
    border-radius: 3px;
    font-size: 12px;
    font-weight: 500;
    width: fit-content;
    border: 1px solid;
}

.stat-tag.positive {
    background: rgba(34, 197, 94, 0.1);
    color: #22c55e;
    border-color: rgba(34, 197, 94, 0.2);
}

.stat-tag.negative {
    background: rgba(239, 68, 68, 0.1);
    color: #ef4444;
    border-color: rgba(239, 68, 68, 0.2);
}

.stat-tag-empty {
    color: #6b7280;
    font-size: 12px;
    font-weight: 400;
}

.stat-tag .arrow {
    font-size: 10px;
}

/* DKP Percentage */
.dkp-header {
    display: flex;
    align-items: center;
    gap: 6px;
}

.dkp-percentage {
    font-size: 11px;
    color: #6b7280;
    font-weight: 500;
}

/* Pagination */
.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 8px;
    margin: 20px 0;
}

.page-btn {
    background: #151921;
    color: #f3f4f6;
    border: 1px solid rgba(255, 255, 255, 0.1);
    padding: 8px 12px;
    border-radius: 6px;
    font-size: 13px;
    cursor: pointer;
    transition: all 0.2s;
}

.page-btn:hover:not(:disabled) {
    background: #1f2937;
    border-color: rgba(255, 255, 255, 0.2);
}

.page-btn.active {
    background: #3b82f6;
    border-color: #3b82f6;
    color: #fff;
}

.page-btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

.page-ellipsis {
    color: #6b7280;
    padding: 0 4px;
}

/* Footer */
.footer {
    text-align: center;
    padding: 40px 20px;
    color: #6b7280;
    font-size: 14px;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
    margin-top: 60px;
}

.footer a {
    color: #3b82f6;
    text-decoration: none;
    transition: color 0.2s;
}

.footer a:hover {
    color: #60a5fa;
}

/* Progress Bar Column */
.dkp-cell {
    min-width: 180px;
}

/* Add spacing to DKP column (3rd column) */
.ranking-table th:nth-child(3),
.ranking-table td:nth-child(3) {
    padding-right: 20px;
}

.dkp-info {
    margin-bottom: 6px;
    font-size: 12px;
    color: #6b7280;
}

.dkp-value {
    font-weight: 600;
    color: #fff;
    margin-right: 5px;
}

.progress-bar-container {
    width: 100%;
    height: 8px;
    background: rgba(0, 0, 0, 0.3);
    border-radius: 4px;
    overflow: hidden;
    position: relative;
}

.progress {
    width: 100%;
    height: 8px;
    background: rgba(0, 0, 0, 0.3);
    border-radius: 4px;
    overflow: hidden;
    position: relative;
}

.progress-bar {
    height: 100%;
    border-radius: 4px;
    transition: width 0.5s ease;
    position: relative;
}

.progress-bar.low {
    background: linear-gradient(90deg, #ff6b6b 0%, #fa5252 100%);
}

.progress-bar.medium {
    background: linear-gradient(90deg, #ffd43b 0%, #fcc419 100%);
}

.progress-bar.high {
    background: linear-gradient(90deg, #51cf66 0%, #37b24d 100%);
}

.progress-bar.complete {
    background: linear-gradient(90deg, #4dabf7 0%, #339af0 100%);
}

/* Progress variants */
.progress-primary .progress-bar {
    background: linear-gradient(90deg, #4dabf7 0%, #339af0 100%);
}

.progress-success .progress-bar {
    background: linear-gradient(90deg, #51cf66 0%, #37b24d 100%);
}

.progress-warning .progress-bar {
    background: linear-gradient(90deg, #ffd43b 0%, #fcc419 100%);
}

.progress-danger .progress-bar {
    background: linear-gradient(90deg, #ff6b6b 0%, #fa5252 100%);
}

/* Loading Indicator */
.loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 60px;
    color: #6b7280;
}

.loading.hidden {
    display: none;
}

.spinner {
    width: 40px;
    height: 40px;
    border: 4px solid rgba(255, 255, 255, 0.1);
    border-top-color: #4dabf7;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-bottom: 16px;
}

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

/* Modal */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0, 0, 0, 0.8);
    animation: fadeIn 0.3s ease;
}

.modal.active {
    display: block;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.modal-content {
    background: #151921;
    margin: 2% auto;
    padding: 0;
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 12px;
    width: 90%;
    max-width: 1200px;
    max-height: 90vh;
    overflow-y: auto;
    animation: slideIn 0.3s ease;
}

@keyframes slideIn {
    from {
        transform: translateY(-50px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.close {
    color: #6b7280;
    float: right;
    font-size: 32px;
    font-weight: 700;
    padding: 20px 30px;
    cursor: pointer;
    transition: color 0.3s ease;
}

.close:hover,
.close:focus {
    color: #fff;
}

/* Player Profile */
#playerProfile {
    padding: 30px;
}

.profile-header {
    display: flex;
    align-items: center;
    gap: 20px;
    margin-bottom: 30px;
    padding-bottom: 20px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.03);
}

.profile-info h2 {
    font-size: 28px;
    margin-bottom: 5px;
}

.profile-info p {
    color: #6b7280;
    font-size: 14px;
}

.profile-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.profile-stat-card {
    background: rgba(0, 0, 0, 0.5);
    padding: 20px;
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.03);
}

.profile-stat-card h3 {
    font-size: 12px;
    color: #6b7280;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 8px;
}

.profile-stat-card .value {
    font-size: 24px;
    font-weight: 700;
    color: #fff;
}

.profile-stat-card .change {
    font-size: 14px;
    margin-top: 5px;
}

.chart-container {
    margin-bottom: 30px;
}

.chart-title {
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 15px;
    color: #fff;
}

/* Responsive Design */
@media (max-width: 1200px) {
    .table-container {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

    .ranking-table {
        min-width: 900px;
    }
}

@media (max-width: 768px) {
    .dashboard-controls {
        flex-direction: column;
        align-items: flex-start;
        gap: 15px;
    }

    .controls {
        width: 100%;
        flex-wrap: wrap;
    }

    .search-input {
        min-width: 100%;
    }

    .header-stats {
        flex-direction: column;
        gap: 20px;
    }

    .modal-content {
        width: 95%;
        margin: 5% auto;
    }
    
    /* Enable horizontal scroll for table on mobile */
    .table-container {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }
    
    .ranking-table {
        min-width: 900px;
        width: auto;
    }
}

/* Scrollbar Styling */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.2);
}

::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.2);
}

/* Table Row Styles - Inspired Design */
.ranking-table tbody tr {
    border-bottom: 1px solid rgba(255, 255, 255, 0.02);
    transition: background 0.2s ease;
}

.ranking-table tbody tr:hover {
    background: rgba(255, 255, 255, 0.02);
}

.ranking-table td {
    padding: 12px 16px;
    font-size: 14px;
    vertical-align: middle;
}

/* Text colors matching inspiration */
.ranking-table .text-gray-900 {
    color: #f3f4f6 !important;
}

.ranking-table .text-gray-600 {
    color: #6b7280 !important;
}

.ranking-table .text-gray-500 {
    color: #6b7280 !important;
}

/* Badge styles */
.badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 600;
}

.badge-outline {
    border: 1px solid;
}

.badge-success {
    background: rgba(34, 197, 94, 0.1);
    border-color: rgba(34, 197, 94, 0.3);
}

.text-success {
    color: #22c55e !important;
}

.badge-danger {
    background: rgba(239, 68, 68, 0.1);
    border-color: rgba(239, 68, 68, 0.3);
}

.text-danger {
    color: #ef4444 !important;
}

/* Avatar styles */
.avatar {
    position: relative;
    display: inline-block;
}

.avatar-sm {
    width: 40px;
    height: 40px;
}

.avatar-image {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    object-fit: cover;
}

.avatar-frame {
    position: absolute;
    top: -2px;
    left: -2px;
    width: calc(100% + 4px);
    height: calc(100% + 4px);
    pointer-events: none;
}

/* Text utility classes */
.text-2xs {
    font-size: 0.65rem;
}

.text-xs {
    font-size: 0.75rem;
}

.text-sm {
    font-size: 0.875rem;
}

.text-nowrap {
    white-space: nowrap;
}

.truncate {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* Flex utilities */
.flex {
    display: flex;
}

.flex-col {
    flex-direction: column;
}

.flex-1 {
    flex: 1 1 0%;
}

.items-center {
    align-items: center;
}

.gap-1 {
    gap: 0.25rem;
}

.gap-2 {
    gap: 0.5rem;
}

.min-w-0 {
    min-width: 0;
}

.min-w-8 {
    min-width: 2rem;
}

.min-w-20 {
    min-width: 5rem;
}

.max-w-12 {
    max-width: 3rem;
}

.max-w-24 {
    max-width: 6rem;
}

.max-w-32 {
    max-width: 8rem;
}

.max-w-40 {
    max-width: 10rem;
}

.shrink-0 {
    flex-shrink: 0;
}

/* Text alignment */
.text-center {
    text-align: center;
}

/* Font weights */
.font-medium {
    font-weight: 500;
}

.font-semibold {
    font-weight: 600;
}

/* Width utilities */
.w-full {
    width: 100%;
}

/* Cursor */
.cursor-pointer {
    cursor: pointer;
}

/* Hover effects */
.hover\:text-primary-active:hover {
    color: #4dabf7;
}

/* Hidden utilities */
.hidden {
    display: none !important;
}

.\!hidden {
    display: none !important;
}

.\!inline {
    display: inline !important;
}

.\!block {
    display: block !important;
}

.md\:invisible {
    visibility: visible;
}

@media (min-width: 768px) {
    .md\:invisible {
        visibility: hidden;
    }
    
    .group:hover .group-hover\/name\:visible,
    .group\/name:hover .group-hover\/name\:visible {
        visibility: visible;
    }
    
    .group:hover .group-hover\/item\:visible,
    .group\/item:hover .group-hover\/item\:visible {
        visibility: visible;
    }
    
    .md\:\!inline {
        display: inline !important;
    }
    
    .md\:\!hidden {
        display: none !important;
    }
    
    .md\:\!block {
        display: block !important;
    }
}

/* Block utility */
.block {
    display: block;
}

.inline {
    display: inline;
}

/* Progress bar container */
.progress {
    width: 100%;
    height: 4px;
    background: rgba(0, 0, 0, 0.3);
    border-radius: 2px;
    overflow: hidden;
    margin-top: 4px;
}

.progress-bar {
    height: 100%;
    border-radius: 2px;
    transition: width 0.3s ease;
}

.progress-primary .progress-bar {
    background: linear-gradient(90deg, #3b82f6 0%, #2563eb 100%);
}

.progress-success .progress-bar {
    background: linear-gradient(90deg, #22c55e 0%, #16a34a 100%);
}

.progress-danger .progress-bar {
    background: linear-gradient(90deg, #ef4444 0%, #dc2626 100%);
}

.progress-warning .progress-bar {
    background: linear-gradient(90deg, #f59e0b 0%, #d97706 100%);
}

/* Group utilities for conditional styling */
.group-\[\.hide-changes\]\:\!block {
    display: block;
}

.group-\[\.hide-changes\]\:\!hidden {
    display: none;
}

.group-\[\.hide-badges\]\:\!border-none {
    border: none !important;
}

.group-\[\.hide-badges\]\:\!bg-transparent {
    background: transparent !important;
}

.group-\[\.hide-progress-bars\]\:\!hidden {
    display: none;
}

/* Icon styles for arrows */
.ki-filled,
.ki-outline {
    display: inline-block;
    width: 1em;
    height: 1em;
}

.ki-filled.ki-arrow-up::before {
    content: "▲";
    font-size: 0.7em;
}

.ki-filled.ki-arrow-down::before {
    content: "▼";
    font-size: 0.7em;
}

/* Player Profile Page Styles */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 16px;
    margin-bottom: 24px;
}

.stat-card {
    background: #151921;
    border: 1px solid rgba(255, 255, 255, 0.03);
    border-radius: 8px;
    padding: 20px;
}

.stat-card-title {
    font-size: 11px;
    color: #6b7280;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-weight: 600;
    margin-bottom: 12px;
}

.stat-card-value {
    font-size: 28px;
    font-weight: 700;
    color: #f3f4f6;
    margin-bottom: 8px;
}

.stat-card-change {
    font-size: 13px;
    font-weight: 500;
}

.charts-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
    gap: 16px;
}

.chart-card {
    background: #151921;
    border: 1px solid rgba(255, 255, 255, 0.03);
    border-radius: 8px;
    padding: 20px;
}
.chart-title {
    font-size: 14px;
    color: #f3f4f6;
    font-weight: 600;
    margin-bottom: 16px;
}
.ki-outline.ki-copy::before {
    content: "📋";
    font-size: 0.8em;
    opacity: 0.7;
}

.ki-filled.ki-exit-right-corner::before {
    content: "↗";
    font-size: 0.9em;
}

/* ============================================
   RESPONSIVE DESIGN - MOBILE OPTIMIZED
   ============================================ */

/* Tablet */
@media (max-width: 768px) {
    body {
        font-size: 15px;
        padding: 0 20px; /* More margin from sides */
    }
    
    .container {
        padding: 20px 20px; /* More margin from sides */
    }
    
    .page-title h1 {
        font-size: 28px;
    }
    
    /* Show charts on mobile */
    .charts-section {
        display: flex;
    }
    
    .chart-card {
        padding: 12px; /* Decreased padding */
    }
    
    .chart-header {
        flex-direction: column;
        align-items: stretch;
    }
    
    .chart-filters {
        width: 100%;
        justify-content: stretch;
    }
    
    .filter-btn {
        flex: 1;
        padding: 10px 12px;
        font-size: 14px;
    }
    
    /* Header stats - row instead of column for kingdom */
    .header-stats {
        flex-direction: row;
        flex-wrap: wrap;
        gap: 12px;
        justify-content: space-between;
    }
    
    .header-stats .stat-item {
        flex: 1 1 calc(33.33% - 8px);
        min-width: 100px;
    }
    
    .stat-item-progress {
        flex: 1 1 100%; /* Full width on tablet */
        min-width: 100%;
    }
    
    /* Stat cards */
    .stat-card {
        padding: 12px; /* Decreased padding */
    }
    
    /* Table - less gap, more horizontal padding */
    .table-container {
        padding: 0; /* Remove padding from container */
    }
    
    .ranking-table {
        font-size: 13px;
    }
    
    .ranking-table th,
    .ranking-table td {
        padding: 10px 4px; /* Reduced horizontal padding between columns */
    }
    
    /* Add extra padding to first and last cells to create side margins */
    .ranking-table th:first-child,
    .ranking-table td:first-child {
        padding-left: 16px !important; /* Increased left margin */
    }
    
    .governor-name {
        font-size: 13px;
    }
    
    .governor-id {
        font-size: 11px;
    }
    
    .stat-value {
        font-size: 13px;
    }
    
    /* Pagination */
    .pagination {
        flex-wrap: wrap;
        gap: 6px;
    }
    
    .page-btn {
        padding: 8px 10px;
        font-size: 12px;
    }
    
    /* Stats grid - 2x2 grid for player page */
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 12px;
    }
    
    /* Charts grid */
    .charts-grid {
        grid-template-columns: 1fr;
    }
    
    /* Player page specific adjustments */
    .dashboard-header .header-stats {
        flex-direction: row; /* Row instead of column */
        flex-wrap: wrap;
    }
    
    .dashboard-header .stat-item {
        flex: 1 1 calc(50% - 8px);
        min-width: calc(50% - 8px);
    }
    
    .dashboard-header .stat-item-progress {
        flex: 1 1 100%;
        min-width: 100%;
    }
}

/* Mobile */
@media (max-width: 480px) {
    body {
        font-size: 14px;
        padding: 0 5px;
    }
    
    .container {
        padding: 15px 5px;
    }
    
    .page-title h1 {
        font-size: 24px;
    }
    
    .dashboard-header {
        padding: 15px;
    }
    
    .stat-item {
        text-align: left;
    }
    
    .dashboard-header .stat-item {
        flex: 1 1 100%;
        min-width: 100%;
        text-align: left;
    }
    
    .stat-item-progress {
        flex: 1 1 100%;
        min-width: 100%;
    }
    
    .stat-label {
        font-size: 10px;
    }
    
    .stat-value {
        font-size: 16px;
    }
    
    /* Smaller font sizes for mobile table */
    .ranking-table {
        font-size: 11px;
    }
    
    .ranking-table th {
        font-size: 9px;
        padding: 6px 3px;
    }
    
    .ranking-table td {
        padding: 6px 3px;
        font-size: 11px;
    }
    
    .ranking-table thead th[data-mobile-order="1"],
    .ranking-table tbody td[data-mobile-order="1"] {
        padding-left: 8px;
    }
    
    .governor-name {
        font-size: 11px;
    }
    
    .governor-id {
        font-size: 9px;
    }
    
    .stat-value {
        font-size: 11px;
    }
    
    .dkp-percentage {
        font-size: 10px;
    }
    
    /* Adjust progress bar for small screens */
    .progress-bar-container {
        height: 6px;
    }
    
    .dkp-header {
        flex-wrap: wrap;
    }
    
    .filter-btn {
        font-size: 13px;
        padding: 8px 10px;
    }
    
    .page-btn {
        padding: 6px 8px;
        font-size: 11px;
        min-width: 32px;
    }
    
    .page-ellipsis {
        display: none;
    }
    
    .dashboard-controls h1 {
        font-size: 20px;
    }
    
    .controls {
        gap: 8px;
    }
    
    .search-input {
        font-size: 13px;
        padding: 8px 12px;
    }
    
    .btn-export,
    .btn-view {
        padding: 8px 12px;
        font-size: 12px;
    }
}

/* Increase base font sizes slightly */
.ranking-table {
    font-size: 14px;
}

.ranking-table th {
    font-size: 11px;
}

.ranking-table td {
    font-size: 14px;
}

.stat-value {
    font-size: 14px;
}

.dkp-percentage {
    font-size: 12px;
}

/* Disable zoom/scroll on charts for mobile */
@media (max-width: 768px) {
    .apexcharts-canvas {
        touch-action: none !important;
        user-select: none !important;
        -webkit-user-select: none !important;
    }
    
    #evolutionChart,
    #powerChart,
    #kpChart {
        touch-action: none !important;
        overflow: hidden !important;
    }
}


