:root {
    --dashboard-scale: 1;
    --dashboard-width: 100vw;
    --dashboard-height: 100vh;
    --base-font-size: 16px;
    --scaled-font-size: calc(var(--base-font-size) * var(--dashboard-scale));
    --compact-header-height: 5.2rem;
    --graph-scale: 1;
    --graph-height: 500px;
}

.responsive-dashboard {
    container-type: size;
    container-name: dashboard;
}

html {
    font-size: var(--scaled-font-size);
}

.container {
    transform-origin: top left;
    transition: transform 0.2s ease-out;
    max-width: 100vw;
    overflow: hidden;
    box-sizing: border-box;
}

.dashboard {
    overflow: visible;
    margin-top: 2rem;
}

@media (min-width: 1025px) {
    html, body {
        position: fixed;
        height: 100%;
        overflow-y: auto;
    }
    
    .container {
        max-height: 100vh;
        overflow: hidden;
    }
    
    .dashboard {
        max-height: calc(100vh - calc(var(--compact-header-height) * 1.69) - 60px);
        overflow: hidden;
    }
    
    .right-panel {
        min-width: 0;
        flex: 1;
        max-height: 100%;
        overflow: hidden;
        display: flex;
        flex-direction: column;
    }
}

.tactical-progress {
    max-height: none !important;
    overflow: visible !important;
    height: auto !important;
    position: relative !important;
    transform: none !important;
}

@container dashboard (max-width: 575px) {
    .dashboard-split {
        flex-direction: column;
    }
    
    .left-panel {
        width: 100%;
        order: 2;
    }
    
    .right-panel {
        order: 1;
    }
    
    .platform-cards-row {
        flex-direction: column;
    }
    
    .stats-cards-grid {
        flex-direction: column;
    }
    
    .tactical-progress {
        padding: 0.5rem 1rem;
    }
}

@container dashboard (min-width: 576px) and (max-width: 767px) {
    .dashboard-split {
        flex-direction: column;
    }
    
    .platform-cards-row {
    }
    
    .stats-cards-grid {
    }
}

@container dashboard (min-width: 768px) and (max-width: 991px) {
    .dashboard-split {
        flex-direction: column;
    }
    
    .left-panel {
        width: 100%;
        max-height: 40vh;
        overflow-y: auto;
    }
    
    .platform-cards-row {
    }
}

@container dashboard (min-width: 992px) and (max-width: 1199px) {
    .left-panel {
        width: 20rem;
        min-width: 18rem;
    }
    
    .platform-cards-row {
    }
}

@container dashboard (min-width: 1200px) {
    .left-panel {
        width: 24rem;
        min-width: 20rem;
    }
    
    .platform-cards-row {
    }
}

.size-xs .dashboard-split {
    flex-direction: column;
}

.size-xs .platform-cards-row {
    flex-direction: column;
}

.size-sm .dashboard-split {
    flex-direction: column;
}

.size-sm .platform-cards-row {
}

.size-md .dashboard-split {
    flex-direction: column;
}

.size-md .left-panel {
    max-height: 40vh;
    overflow-y: auto;
}

.size-lg .left-panel,
.size-xl .left-panel {
    width: 24rem;
}

.tactical-progress {
    container-type: inline-size;
    container-name: progress;
}

@container progress (max-width: 600px) {
    .progress-bar {
        height: 6px;
    }
    
    .soldier-container {
        width: 2.5rem;
        height: 3.5rem;
    }
    
    .loading-text {
        font-size: 0.875rem;
    }
}

.chart-container {
    container-type: size;
    container-name: chart;
    overflow: hidden;
    max-height: 100%;
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
}

.grafana-chart {
    max-width: 100% !important;
    max-height: 100% !important;
    overflow: hidden !important;
    box-sizing: border-box !important;
}

.chart-container iframe,
.chart-container canvas,
.chart-container svg {
    max-width: 100% !important;
    max-height: 100% !important;
    object-fit: contain;
}

@container chart (max-width: 500px) {
    .graph-tabs-container {
        grid-template-columns: repeat(2, 1fr);
        gap: 0.25rem;
    }
    
    .graph-tab {
        padding: 0.5rem;
        font-size: 0.75rem;
    }
    
    .graph-tab span {
        display: none;
    }
}

@container chart (min-width: 501px) and (max-width: 800px) {
    .graph-tabs-container {
        grid-template-columns: repeat(auto-fit, minmax(100px, 1fr));
    }
}

@media (min-width: 2560px) and (max-width: 3839px) {
    :root {
        --base-font-size: 17px;
    }
}

@media (min-width: 3840px) and (max-width: 5119px) {
    :root {
        --base-font-size: 19px;
    }
    
    .container {
        padding: 0.5rem;
    }
}

@media (min-width: 5120px) and (max-width: 7679px) {
    :root {
        --base-font-size: 21px;
    }
    
    .container {
        max-width: 95vw;
        margin: 0 auto;
    }
}

@media (min-width: 7680px) {
    :root {
        --base-font-size: 25px;
    }
    
    .container {
        max-width: 90vw;
        margin: 0 auto;
        padding: 1rem;
    }
}

@media (min-resolution: 2dppx) {
    :root {
        --base-font-size: calc(var(--base-font-size) * 1.1);
    }
}

@media (prefers-reduced-motion: reduce) {
    .container {
        transition: none;
    }
    
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

.container,
.dashboard,
.left-panel,
.right-panel {
    will-change: transform;
    backface-visibility: hidden;
    transform-style: preserve-3d;
}

.responsive-dashboard.resizing * {
    pointer-events: none;
    user-select: none;
}

.dashboard-split {
    min-height: 0;
}

.left-panel {
    min-width: 0;
}

.right-panel {
    min-width: 0;
    flex: 0 0 auto;
    overflow: visible;
    display: flex;
    flex-direction: column;
}

.weekly-chart-container {
    flex: 1;
    min-height: 0;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.platform-cards-row {
}

.stats-cards-grid {
}

.header {
    transform: scale(1.69) !important;
    transform-origin: top center !important;
    padding: 0.75rem 2rem !important;
    min-height: 4rem !important;
    margin-bottom: 2rem !important;
}

.logo {
}

.logo-image {
    max-height: 3rem !important;
    width: auto !important;
}

.logo h1 {
    font-size: 1.0rem !important;
    margin: 0 !important;
    line-height: 1.1 !important;
}

.logo p {
    font-size: 0.4rem !important;
    margin: 0.25rem 0 0 0 !important;
}

#total-players-value {
    font-size: clamp(4rem, 8vw, 12rem) !important;
    font-weight: 900 !important;
    line-height: 0.9 !important;
    text-shadow: 0 0 20px rgba(255, 255, 255, 0.3) !important;
    letter-spacing: -0.02em !important;
    margin: 1rem 0 !important;
}

.stats-card .stats-label {
    font-size: clamp(1.2rem, 2.5vw, 3rem) !important;
    font-weight: 700 !important;
    text-transform: uppercase !important;
    letter-spacing: 0.1em !important;
    margin-top: 1rem !important;
}

.stats-card .stats-icon i {
    font-size: clamp(2.5rem, 5vw, 6rem) !important;
    text-shadow: 0 0 15px rgba(148, 138, 103, 0.5) !important;
}

.stat-card__header {
}

.stat-card__subheader {
}

@media (max-width: 480px) {
    .container {
        overflow-y: auto;
        overflow-x: hidden;
        height: 100vh;
        min-height: 100vh;
    }

    .header {
        transform: scale(1) !important;
        padding: 0.5rem 0.5rem !important;
        margin-bottom: 0.25rem !important;
    }

    .logo-image {
        max-height: 2rem !important;
    }

    .logo h1 {
        font-size: 0.75rem !important;
    }

    .logo p {
        font-size: 0.5rem !important;
    }

    .dashboard {
        padding: 0.25rem !important;
        margin-top: 0 !important;
        max-height: none !important;
        height: auto !important;
    }

    .dashboard-split {
        display: flex !important;
        flex-direction: column !important;
        gap: 0.25rem !important;
    }

    .left-panel,
    .right-panel {
        width: 100% !important;
        padding: 0.25rem !important;
    }

    .right-panel {
        display: flex !important;
        min-height: 450px !important;
        margin-bottom: 0 !important;
    }

    .stats-card {
        padding: 0.5rem !important;
    }

    .stats-number {
        font-size: 2rem !important;
    }

    .stats-label {
        font-size: 0.85rem !important;
    }

    .stats-cards-container {
        padding: 0.5rem !important;
        gap: 0.25rem !important;
    }

    .platform-cards-row {
        flex-wrap: wrap !important;
        gap: 0.25rem !important;
    }
    
    .game-stats-row {
        flex-wrap: wrap !important;
        gap: 0.25rem !important;
        grid-template-columns: 1fr !important;
    }

    .stat-card {
        min-width: calc(50% - 0.125rem) !important;
        padding: 0.4rem !important;
        flex: 1 1 calc(50% - 0.125rem) !important;
    }

    .stat-card__header {
        font-size: 1.25rem !important;
    }

    .stat-card__subheader {
        font-size: 0.65rem !important;
    }

    .stat-card__icon {
        font-size: 1.25rem !important;
    }

    .chart-card {
        padding: 0.25rem !important;
        max-height: none !important;
        min-height: auto !important;
        height: auto !important;
        display: flex !important;
        flex-direction: column !important;
        overflow: visible !important;
        border-radius: 8px !important;
        margin-bottom: 0.5rem !important;
    }

    .chart-header {
        flex-shrink: 0 !important;
        margin-bottom: -0.516px !important;
    }

    .chart-header h3 {
        font-size: 1rem !important;
    }

    .graph-tabs {
        gap: 0.15rem !important;
        flex-wrap: nowrap !important;
        overflow-x: auto !important;
        margin-right: 0.2rem;
    }

    .graph-tab {
        padding: 0.35rem 0.6rem !important;
        font-size: 0.6rem !important;
        min-width: auto !important;
        min-height: 32px !important;
    }

    .auto-rotate-toggle {
        font-size: 0.6rem !important;
    }

    .toggle-slider {
        width: 26px !important;
        height: 15px !important;
    }

    .toggle-slider:before {
        width: 11px !important;
        height: 11px !important;
    }

    .chart-container {
        min-height: 400px !important;
        height: 400px !important;
        flex: 1 !important;
        display: flex !important;
        overflow: hidden !important;
        position: relative !important;
        border-radius: 0 0 8px 8px !important;
        padding: 0.25rem !important;
        margin-bottom: 0.2rem !important;
        margin-left: 0.2rem !important;
        margin-right: 0.2rem !important;
    }

    .grafana-chart,
    .chart-container iframe {
        width: 100% !important;
        height: 100% !important;
        display: block !important;
        min-height: 400px !important;
        border: none !important;
    }

    .tactical-progress {
        padding: 0.25rem !important;
        height: 30px !important;
    }

    .loading-text {
        font-size: 0.65rem !important;
    }

    .soldier-container {
        display: none !important;
    }
}

@media (min-width: 481px) and (max-width: 767px) {
    .container {
        overflow-y: auto;
        overflow-x: hidden;
        height: auto;
        min-height: 0 !important;
    }
    
    .right-panel {
        min-height: auto !important;
    }

    .header {
        transform: scale(0.7);
        transform-origin: top center;
        width: 142.86%;
        margin-left: -21.43%;
    }

    .dashboard {
        transform: scale(0.7);
        transform-origin: top center;
        width: 142.86%;
        margin-left: -21.43%;
        margin-bottom: -30% !important;
        padding: 0.75rem !important;
        max-height: none !important;
        overflow: visible !important;
    }

    .dashboard-split {
        display: flex !important;
        flex-direction: column !important;
        max-width: 100%;
        gap: 1.5rem !important;
    }

    .left-panel,
    .right-panel {
        width: 100% !important;
    }

    .platform-cards-row {
        display: grid !important;
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 1rem !important;
    }
    
    .game-stats-row {
        display: grid !important;
        grid-template-columns: 1fr !important;
        gap: 1rem !important;
    }

    .tactical-progress {
        transform: scale(0.7);
        transform-origin: bottom center;
    }
}

@media (min-width: 768px) and (max-width: 1024px) {
    .container {
        overflow-y: auto;
        height: auto;
        min-height: 0 !important;
    }
    
    .right-panel {
        min-height: auto !important;
    }

    .dashboard {
        transform: scale(0.8);
        transform-origin: top center;
        width: 125%;
        margin-left: -12.5%;
        margin-bottom: -20% !important;
        padding: 1rem !important;
        max-height: none !important;
        overflow: visible !important;
    }

    .dashboard-split {
        display: flex !important;
        flex-direction: column !important;
        gap: 2rem !important;
    }

    .left-panel,
    .right-panel {
        width: 100% !important;
        max-width: 100% !important;
    }

    .platform-cards-row {
        display: grid !important;
        grid-template-columns: repeat(3, 1fr) !important;
        gap: 1rem !important;
    }
    
    .game-stats-row {
        display: grid !important;
        grid-template-columns: 1fr !important;
        gap: 1rem !important;
    }
}

@media (hover: none) and (pointer: coarse) {
    .graph-tab {
        min-height: 44px !important;
        padding: 0.75rem 1rem !important;
    }

    .auto-rotate-toggle {
        min-height: 44px !important;
        padding: 0.5rem !important;
    }

    .toggle-slider {
        width: 48px !important;
        height: 26px !important;
    }

    .toggle-slider:before {
        width: 22px !important;
        height: 22px !important;
    }

    .stat-card {
        transition: none !important;
    }

    .chart-card:hover {
        transform: none !important;
    }

    .stat-card:hover {
        transform: none !important;
    }

    .chart-container {
        -webkit-overflow-scrolling: touch !important;
    }
}

@media (max-height: 600px) and (orientation: landscape) {
    .header {
        transform: scale(0.9) !important;
        padding: 0.5rem 1rem !important;
        margin-bottom: 0.5rem !important;
    }

    .dashboard {
        margin-top: 0 !important;
    }

    .tactical-progress {
        display: none !important;
    }

    .stats-card {
        padding: 0.5rem !important;
    }

    .chart-card {
        min-height: 200px !important;
    }
}
.container {
    height: 100vh;
    min-height: 100vh;
    overflow-y: auto;
    overflow-x: hidden;
}

.header {
    transform: scale(clamp(0.8, 0.5 + 0.0005 * 100vh, 1.2));
    padding: clamp(0.3rem, 1vh, 1rem) clamp(0.6rem, 2vw, 2rem);
    margin-bottom: clamp(0, 0.5vh, 1rem);
}

.dashboard {
    max-height: none;
    overflow: visible;
    padding: clamp(0.25rem, 1vw, 1rem);
}

.dashboard-split {
    height: auto;
    min-height: auto;
    gap: clamp(0.5rem, 1.5vw, 2rem);
}

.left-panel, .right-panel {
    height: auto;
    overflow: visible;
}

.left-panel {
    padding: clamp(0.25rem, 1vw, 1rem);
}

.right-panel {
    display: flex;
    flex-direction: column;
    padding: clamp(0.25rem, 1vw, 1rem);
}

.right-panel .chart-card {
    max-height: none;
    height: auto;
    min-height: auto;
    flex-direction: column;
    padding: clamp(0.5rem, 2vw, 1.5rem);
}

.chart-container {
    min-height: clamp(250px, 35vh, 450px);
    height: clamp(300px, 60vh, 700px);
    max-height: min(80vh, 700px);
    overflow: hidden;
    position: relative;
    flex: 1 1 auto;
    display: flex;
    flex-direction: column;
    padding: 0;
    margin: 0;
}

.chart-container iframe,
.chart-container .grafana-chart {
    width: 100%;
    height: 100%;
    border: none;
    display: block;
    transform: scale(clamp(0.85, 0.8 + 0.00015 * 100vh, 1));
    transform-origin: center center;
}

.stats-card {
    min-height: clamp(70px, 10vh, 100px);
    padding: clamp(0.4rem, 1.5vw, 1rem);
}

.stats-cards-container {
    padding: clamp(0.5rem, 1.5vw, 1.2rem);
}

.stats-section-title h2 {
    font-size: clamp(0.9rem, 2.5vw, 1.4rem);
    margin: clamp(0.25rem, 1vh, 0.5rem) 0;
}

.stats-section-subtitle {
    font-size: clamp(0.65rem, 2vw, 0.85rem);
    margin: clamp(0.3rem, 1vh, 0.5rem) 0 0 0;
}

.stat-card__header {
    font-size: clamp(0.9rem, 2.5vw, 1.8rem);
}

.stat-card__subheader {
    font-size: clamp(0.5rem, 1.5vw, 0.9rem);
}

@media (max-width: 767px) {
    html, body {
        position: relative !important;
        height: auto !important;
        min-height: 0 !important;
        overflow-x: hidden !important;
    }
    
    .container {
        min-height: 0 !important;
        height: auto !important;
    }
    
    .right-panel {
        min-height: auto !important;
    }
    
    .header {
        transform: scale(0.6);
        transform-origin: top center;
        width: 166.67%;
        margin-left: -33.33%;
    }

    .dashboard {
        transform: scale(0.6);
        transform-origin: top center;
        width: 166.67%;
        margin-left: -33.33%;
        margin-bottom: -630px !important;
    }
    
    .dashboard-split {
        display: flex !important;
        max-width: 100%;
        flex-direction: column !important;
        gap: 1rem !important;
    }
    
    .left-panel,
    .right-panel {
        width: 100% !important;
        max-width: 100% !important;
    }
    
    .platform-cards-row {
        display: grid !important;
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 1rem !important;
    }
    
    .game-stats-row {
        display: grid !important;
        grid-template-columns: 1fr !important;
        gap: 1rem !important;
    }
}

@media (min-width: 768px) and (max-width: 1024px) {
    .dashboard-split {
        display: flex;
        flex-direction: column;
        gap: 1rem;
    }
    
    .left-panel,
    .right-panel {
        width: 100%;
    }
    
    .platform-cards-row {
        grid-template-columns: repeat(3, 1fr);
    }
    
    .game-stats-row {
        grid-template-columns: 1fr;
    }
}

@media (max-height: 500px) {
    .header {
        transform: scale(0.7);
        margin-bottom: 0;
    }
    
    .stats-card {
        min-height: 60px;
        padding: 0.3rem;
    }
    
    .chart-container {
        height: clamp(200px, 50vh, 300px);
        min-height: 200px;
    }
    
    .game-stats-section {
        display: none;
    }
    
    .tactical-progress {
        display: none;
    }
}

@media (min-width: 768px) and (max-width: 1024px) and (orientation: landscape) {
    .chart-container {
        height: clamp(250px, 55vh, 400px);
    }
}
