:root {
    --primary-color: #6c5ce7;
    --secondary-color: #a29bfe;
    --background-color: #0a0e27;
    --card-background: #1a1f3a;
    --text-color: #ffffff;
    --text-secondary: #8892b0;
    --border-color: #2a2f4a;
    --deflationary-color: #00d68f;
    --deflationary-dark: #00b074;
    --inflationary-color: #4a90e2;
    --inflationary-bright: #2e7cd6;
    --neutral-color: #ffd700;
    --highlight-color: #ffd700;
    --gradient-primary: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

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

body {
    font-family: 'Inter', sans-serif;
    background: linear-gradient(180deg, #0a0e27 0%, #151a35 100%);
    color: var(--text-color);
    line-height: 1.6;
    min-height: 100vh;
}

.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 20px;
}

/* Header */
header {
    margin-bottom: 40px;
    text-align: center;
    position: relative;
}

.brand-header {
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 10px;
}

.main-title {
    font-size: 3rem;
    margin: 0;
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    font-weight: 900;
    letter-spacing: -1px;
}

.domain-badge {
    background: rgba(108, 92, 231, 0.2);
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 0.9rem;
    color: var(--secondary-color);
    border: 1px solid rgba(108, 92, 231, 0.3);
    font-weight: 600;
    margin: 0 auto;
    display: inline-block;
}

.subtitle {
    color: var(--text-secondary);
    font-size: 1.1rem;
    margin-bottom: 30px;
}

/* Status Container */
.status-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
    margin-bottom: 30px;
}

.status-item {
    background: var(--card-background);
    padding: 15px 20px;
    border-radius: 12px;
    border: 1px solid var(--border-color);
    transition: transform 0.3s, box-shadow 0.3s;
}

.status-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 30px rgba(108, 92, 231, 0.2);
}

.label {
    font-weight: 500;
    font-size: 0.85rem;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 8px;
    display: block;
}

.value {
    font-weight: 700;
    font-size: 1.3rem;
    color: var(--text-color);
}

.value.highlight {
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* Battle Section */
.battle-section {
    background: var(--card-background);
    border-radius: 20px;
    padding: 40px;
    margin-bottom: 40px;
    border: 1px solid var(--border-color);
}

.battle-header {
    text-align: center;
    margin-bottom: 30px;
}

.battle-title {
    font-size: 1.8rem;
    color: var(--text-color);
    margin-bottom: 10px;
}

.battle-subtitle {
    color: var(--text-secondary);
    font-size: 1rem;
}

.forces-container {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    gap: 40px;
    align-items: center;
    margin: 30px 0;
}

.force-card {
    text-align: center;
    padding: 25px;
    border-radius: 15px;
    background: rgba(255,255,255,0.03);
    border: 2px solid;
    transition: all 0.3s;
}

.force-card.burns {
    border-color: rgba(0, 214, 143, 0.3);
}

.force-card.burns:hover {
    background: rgba(0, 214, 143, 0.05);
    transform: translateY(-5px);
}

.force-card.issuance {
    border-color: rgba(74, 144, 226, 0.3);
}

.force-card.issuance:hover {
    background: rgba(74, 144, 226, 0.05);
    transform: translateY(-5px);
}

.force-label {
    font-size: 1rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 15px;
    font-weight: 600;
}

.burns .force-label {
    color: var(--deflationary-color);
}

.issuance .force-label {
    color: var(--inflationary-color);
}

.force-value {
    font-size: 2.5rem;
    font-weight: 900;
    margin-bottom: 10px;
}

.burns .force-value {
    color: var(--deflationary-color);
}

.issuance .force-value {
    color: var(--inflationary-color);
}

.force-change {
    font-size: 0.9rem;
    color: var(--text-secondary);
}

.vs-divider {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 15px;
}

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

.battle-result {
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 600;
    text-transform: uppercase;
}

.battle-result.issuance-winning {
    background: rgba(74, 144, 226, 0.2);
    color: var(--inflationary-color);
    border: 1px solid var(--inflationary-color);
}

.battle-result.burns-winning {
    background: rgba(0, 214, 143, 0.2);
    color: var(--deflationary-color);
    border: 1px solid var(--deflationary-color);
}

/* Progress Bar with Balance Indicator */
.progress-bar-container {
    margin: 30px 0;
    padding: 20px;
    background: rgba(255,255,255,0.02);
    border-radius: 15px;
}

.progress-header {
    display: flex;
    justify-content: space-between;
    margin-bottom: 15px;
}

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

.progress-percentage {
    font-weight: 700;
}

.progress-bar {
    height: 40px;
    background: var(--background-color);
    border-radius: 20px;
    overflow: visible;
    position: relative;
    margin: 15px 0;
}

.balance-notch-top {
    position: absolute;
    left: 50%;
    top: -8px;
    transform: translateX(-50%);
    width: 0;
    height: 0;
    border-left: 8px solid transparent;
    border-right: 8px solid transparent;
    border-top: 10px solid var(--neutral-color);
    z-index: 10;
}

.balance-notch-bottom {
    position: absolute;
    left: 50%;
    bottom: -8px;
    transform: translateX(-50%);
    width: 0;
    height: 0;
    border-left: 8px solid transparent;
    border-right: 8px solid transparent;
    border-bottom: 10px solid var(--neutral-color);
    z-index: 10;
}

.progress-fill {
    height: 100%;
    display: flex;
    transition: all 0.5s ease;
    border-radius: 20px;
    overflow: hidden;
}

.burns-fill {
    background: linear-gradient(90deg, var(--deflationary-dark), var(--deflationary-color));
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: 700;
}

.issuance-fill {
    background: linear-gradient(90deg, var(--inflationary-color), var(--inflationary-bright));
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: 700;
}

.balance-indicator-below {
    display: flex;
    justify-content: center;
    margin-top: 15px;
}

.indicator-chip {
    background: rgba(255, 215, 0, 0.1);
    border: 1px solid var(--neutral-color);
    border-radius: 12px;
    padding: 6px 16px;
    font-size: 0.8rem;
    color: var(--neutral-color);
    font-weight: 600;
}

/* Net Supply Change */
.net-change-box {
    text-align: center;
    padding: 25px;
    background: linear-gradient(135deg, rgba(108, 92, 231, 0.1), rgba(108, 92, 231, 0.05));
    border-radius: 15px;
    border: 1px solid rgba(108, 92, 231, 0.3);
    margin-top: 30px;
}

.net-label {
    font-size: 0.9rem;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 10px;
}

.net-percentage {
    font-size: 2.5rem;
    font-weight: 900;
    margin-bottom: 10px;
}

.net-amount {
    font-size: 1.1rem;
    color: var(--text-secondary);
    margin-bottom: 15px;
}

.projection-chips {
    display: flex;
    justify-content: center;
    gap: 15px;
    flex-wrap: wrap;
    margin-bottom: 20px;
}

.chip {
    padding: 8px 16px;
    background: rgba(255,255,255,0.05);
    border-radius: 20px;
    font-size: 0.85rem;
}

.chip-label {
    color: var(--text-secondary);
    margin-right: 5px;
}

.chip-value {
    font-weight: 700;
    color: var(--text-color);
}

/* Key Metrics Grid */
.key-metrics {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 20px;
    margin-bottom: 40px;
}

.key-metric {
    background: var(--card-background);
    padding: 25px;
    border-radius: 15px;
    text-align: center;
    border: 1px solid var(--border-color);
    transition: all 0.3s;
    position: relative;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    min-height: 140px;
}

.key-metric::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: var(--gradient-primary);
    transform: scaleX(0);
    transition: transform 0.3s;
}

.key-metric:hover::before {
    transform: scaleX(1);
}

.key-metric:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 40px rgba(108, 92, 231, 0.3);
}

.key-metric-label {
    font-size: 0.8rem;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: auto;
}

.key-metric-value {
    font-size: 1.8rem;
    font-weight: 700;
    color: var(--text-color);
    margin-top: auto;
}

.key-metric-value.highlight {
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.key-metric-value.burn {
    color: var(--deflationary-color);
}

.metric-usd {
    display: block;
    font-size: 0.9rem;
    color: var(--text-secondary);
    margin-top: 5px;
    font-weight: 500;
}

/* Milestones Section */
.milestones-section {
    background: var(--card-background);
    border-radius: 20px;
    padding: 40px;
    margin-bottom: 40px;
    border: 1px solid rgba(0, 214, 143, 0.2);
}

.milestones-header {
    text-align: center;
    margin-bottom: 30px;
}

.milestones-title {
    font-size: 1.8rem;
    color: var(--deflationary-color);
    margin-bottom: 10px;
}

.milestones-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
}

.milestone {
    text-align: center;
    padding: 20px;
    background: rgba(255,255,255,0.03);
    border-radius: 12px;
    border: 1px solid rgba(255,255,255,0.1);
    transition: all 0.3s;
}

.milestone.achieved {
    background: rgba(0, 214, 143, 0.1);
    border-color: rgba(0, 214, 143, 0.3);
}

.milestone:hover {
    transform: translateY(-3px);
}

.milestone-icon {
    font-size: 2rem;
    margin-bottom: 10px;
}

.milestone-label {
    font-size: 0.85rem;
    color: var(--text-secondary);
    margin-bottom: 5px;
}

.milestone-value {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--text-color);
}

.achieved .milestone-value {
    color: var(--deflationary-color);
}

/* Timeframe Indicator */
.timeframe-indicator {
    display: inline-flex;
    align-items: center;
    gap: 5px;
}

.timeframe-badge {
    background: rgba(255,255,255,0.05);
    border: 1px solid rgba(255,255,255,0.1);
    color: var(--text-secondary);
    padding: 5px 10px;
    border-radius: 15px;
    font-size: 0.8rem;
    font-weight: 500;
    letter-spacing: 0.3px;
}

/* Chart Cards */
.chart-card {
    background: var(--card-background);
    border-radius: 20px;
    padding: 30px;
    margin-bottom: 40px;
    border: 1px solid var(--border-color);
}

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

.chart-header h2 {
    font-size: 1.8rem;
    color: var(--text-color);
    margin: 0;
}

.chart-header .header-left {
    display: flex;
    align-items: center;
    gap: 15px;
}

.timeframe-display {
    font-size: 0.9rem;
    color: var(--text-secondary);
}

.time-selector {
    display: flex;
    gap: 5px;
    background: rgba(108, 92, 231, 0.1);
    padding: 4px;
    border-radius: 10px;
}

.time-btn {
    padding: 8px 16px;
    background: transparent;
    border: none;
    border-radius: 8px;
    color: var(--text-secondary);
    cursor: pointer;
    font-weight: 600;
    transition: all 0.3s;
}

.time-btn:hover {
    color: var(--text-color);
}

.time-btn.active {
    background: var(--gradient-primary);
    color: white;
}

.chart-container {
    height: 400px;
    position: relative;
    margin-bottom: 20px;
}

/* Ensure canvas has proper dimensions on mobile */
.chart-container canvas {
    max-width: 100%;
    height: 100% !important;
}

@media (max-width: 768px) {
    .chart-container {
        height: 300px;
        min-height: 300px;
    }
}

/* Burn Battle Specific Styles */
.burn-battle-stats {
    display: flex;
    justify-content: center;
    gap: 40px;
    padding: 20px;
    background: rgba(255, 255, 255, 0.02);
    border-radius: 12px;
    margin-bottom: 25px;
}

.burn-battle-stats .stat-item {
    text-align: center;
}

.burn-battle-stats .stat-value {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 5px;
}

.burn-battle-stats .stat-label {
    font-size: 0.8rem;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.wins-stat .stat-value {
    color: var(--deflationary-color);
}

.losses-stat .stat-value {
    color: var(--inflationary-color);
}

.winrate-stat .stat-value {
    color: var(--text-color);
}

/* Burn Battle Container */
.burn-battle-container {
    background: rgba(0, 0, 0, 0.2);
    border-radius: 15px;
    padding: 20px;
    height: 420px;
    min-height: 420px;
    position: relative;
    overflow: visible;
}

@media (max-width: 768px) {
    .burn-battle-container {
        height: 350px;
        min-height: 350px;
        padding: 15px;
    }
}

.chart-legend {
    position: absolute;
    top: 20px;
    right: 20px;
    display: flex;
    gap: 20px;
    background: rgba(0, 0, 0, 0.7);
    padding: 10px 15px;
    border-radius: 8px;
    z-index: 10;
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.85rem;
}

.legend-dot {
    width: 12px;
    height: 12px;
    border-radius: 2px;
}

.legend-dot.burn {
    background: linear-gradient(to top, var(--deflationary-dark), var(--deflationary-color));
}

.legend-dot.issuance {
    background: linear-gradient(to top, var(--inflationary-color), var(--inflationary-bright));
}

/* Burn Battle Bars */
.burn-battle-bars {
    height: calc(100% - 60px);
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    padding: 0 10px;
    margin-top: 50px;
}

.battle-day-bar {
    width: calc((100% / 7) - 10px);
    max-width: 60px;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    position: relative;
    height: 100%;
}

.battle-bar-group {
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    position: relative;
}

.burn-win-bar {
    background: linear-gradient(to top, var(--deflationary-dark), var(--deflationary-color));
    width: 100%;
    border-radius: 2px 2px 0 0;
    box-shadow: 0 0 4px rgba(0, 214, 143, 0.4);
}

.issuance-win-bar {
    background: linear-gradient(to top, var(--inflationary-color), var(--inflationary-bright));
    width: 100%;
    border-radius: 2px 2px 0 0;
    opacity: 0.9;
    box-shadow: 0 0 4px rgba(74, 144, 226, 0.4);
}

.battle-day-bar:hover .burn-win-bar,
.battle-day-bar:hover .issuance-win-bar {
    filter: brightness(1.3);
}

/* Burn Battle Tooltip */
.battle-tooltip {
    position: absolute;
    bottom: calc(100% + 10px);
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0, 0, 0, 0.95);
    border: 1px solid rgba(255, 255, 255, 0.1);
    padding: 10px;
    border-radius: 6px;
    font-size: 0.75rem;
    white-space: nowrap;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.3s;
    z-index: 100;
    min-width: 140px;
}

.battle-day-bar:hover .battle-tooltip {
    opacity: 1;
}

.battle-tooltip::after {
    content: '';
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    width: 0;
    height: 0;
    border-left: 6px solid transparent;
    border-right: 6px solid transparent;
    border-top: 6px solid rgba(0, 0, 0, 0.95);
}

.battle-tooltip-header {
    font-weight: 600;
    margin-bottom: 5px;
    padding-bottom: 5px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.battle-tooltip-row {
    display: flex;
    justify-content: space-between;
    margin: 3px 0;
}

.battle-tooltip-label {
    color: var(--text-secondary);
    margin-right: 10px;
}

.battle-tooltip-value {
    font-weight: 600;
}

/* Loading States */
.loading {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid rgba(108, 92, 231, 0.3);
    border-radius: 50%;
    border-top-color: var(--primary-color);
    animation: spin 1s ease-in-out infinite;
}

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

/* Live Indicator */
.live-indicator {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 5px 10px;
    background: rgba(0, 214, 143, 0.1);
    border-radius: 20px;
    font-size: 0.85rem;
    color: var(--deflationary-color);
    transition: all 0.3s;
}

.live-dot {
    width: 8px;
    height: 8px;
    background: var(--deflationary-color);
    border-radius: 50%;
    animation: pulse 2s infinite;
}

.indexing-dot {
    width: 8px;
    height: 8px;
    background: var(--neutral-color);
    border-radius: 50%;
    animation: spin-dot 2s linear infinite;
}

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

@keyframes spin-dot {
    0% { opacity: 1; }
    50% { opacity: 0.3; }
    100% { opacity: 1; }
}

/* Footer */
footer {
    text-align: center;
    margin-top: 60px;
    padding: 30px 0;
    border-top: 1px solid var(--border-color);
    color: var(--text-secondary);
}

.footer-content p {
    margin-bottom: 10px;
}

footer a {
    color: var(--primary-color);
    text-decoration: none;
    transition: color 0.3s;
}

footer a:hover {
    color: var(--secondary-color);
}

/* Responsive */
@media (max-width: 768px) {
    .main-title {
        font-size: 2rem;
    }

    .forces-container {
        grid-template-columns: 1fr;
        gap: 20px;
    }

    .vs-divider {
        margin: 20px 0;
    }

    .projection-chips {
        flex-direction: column;
    }

    .key-metrics {
        grid-template-columns: repeat(2, 1fr);
    }

    .chart-header {
        flex-direction: column;
        align-items: stretch;
    }

    .time-selector {
        justify-content: center;
    }

    .status-container {
        grid-template-columns: 1fr;
    }

    .force-value {
        font-size: 2rem;
    }

    .net-percentage {
        font-size: 2rem;
    }

    .burn-battle-stats {
        gap: 20px;
    }

    .burn-battle-stats .stat-value {
        font-size: 1.2rem;
    }
}