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

/* Design System (Theme) */
:root {
    --ds-bg: #000000;
    --ds-fg: #ffffff;
    --ds-border: rgba(255, 255, 255, 0.22);
    --ds-card-bg: rgba(0, 0, 0, 0.20);
    --ds-card-bg-hover: rgba(0, 0, 0, 0.30);
    --ds-hover-border: rgba(249, 115, 22, 0.72);
    --ds-hover-overlay: rgb(24, 12, 6);
    --ds-viz-accent-fill: rgba(249, 115, 22, 0.38);
    --ds-viz-accent-stroke: rgba(249, 115, 22, 0.65);
    --ds-viz-accent-fill-03: rgba(249, 115, 22, 0.26);
    --ds-viz-accent-fill-045: rgba(249, 115, 22, 0.34);
    --ds-viz-accent-fill-06: rgba(249, 115, 22, 0.42);
    --ds-viz-accent-fill-075: rgba(249, 115, 22, 0.50);
    --ds-viz-stroke: rgba(249, 115, 22, 0.55);
    --ds-viz-fill: rgba(249, 115, 22, 0.14);
    --ds-fg-70: rgba(255, 255, 255, 0.70);
    --ds-fg-80: rgba(255, 255, 255, 0.80);
    --ds-control-bg: rgba(0, 0, 0, 0.72);
    --ds-control-border: rgba(255, 255, 255, 0.18);
    --ds-control-shadow: 0 10px 30px rgba(0, 0, 0, 0.45);
    color-scheme: dark;
}

html[data-theme="auto"] {
    color-scheme: light dark;
}

html[data-theme="clear"] {
    /* Force light theme regardless of OS preference */
    --ds-bg: #f7f7f8;
    --ds-fg: #0b0b0c;
    --ds-border: rgba(0, 0, 0, 0.14);
    --ds-card-bg: rgba(255, 255, 255, 0.70);
    --ds-card-bg-hover: rgba(255, 255, 255, 0.78);
    --ds-hover-border: rgba(249, 115, 22, 0.72);
    --ds-hover-overlay: rgba(249, 115, 22, 0.10);
    --ds-viz-accent-fill: rgba(249, 115, 22, 0.38);
    --ds-viz-accent-stroke: rgba(249, 115, 22, 0.65);
    --ds-viz-accent-fill-03: rgba(249, 115, 22, 0.26);
    --ds-viz-accent-fill-045: rgba(249, 115, 22, 0.34);
    --ds-viz-accent-fill-06: rgba(249, 115, 22, 0.42);
    --ds-viz-accent-fill-075: rgba(249, 115, 22, 0.50);
    --ds-viz-stroke: rgba(249, 115, 22, 0.45);
    --ds-viz-fill: rgba(249, 115, 22, 0.10);
    --ds-fg-70: rgba(11, 11, 12, 0.70);
    --ds-fg-80: rgba(11, 11, 12, 0.80);
    --ds-control-bg: rgba(255, 255, 255, 0.72);
    --ds-control-border: rgba(0, 0, 0, 0.14);
    --ds-control-shadow: 0 10px 30px rgba(0, 0, 0, 0.18);
    color-scheme: light;
}

html[data-theme="dark"] {
    --ds-bg: #000000;
    --ds-fg: #ffffff;
    --ds-border: rgba(255, 255, 255, 0.22);
    --ds-card-bg: rgba(0, 0, 0, 0.20);
    --ds-card-bg-hover: rgba(0, 0, 0, 0.30);
    --ds-hover-border: rgba(249, 115, 22, 0.72);
    --ds-hover-overlay: rgb(24, 12, 6);
    --ds-viz-accent-fill: rgba(249, 115, 22, 0.38);
    --ds-viz-accent-stroke: rgba(249, 115, 22, 0.65);
    --ds-viz-accent-fill-03: rgba(249, 115, 22, 0.26);
    --ds-viz-accent-fill-045: rgba(249, 115, 22, 0.34);
    --ds-viz-accent-fill-06: rgba(249, 115, 22, 0.42);
    --ds-viz-accent-fill-075: rgba(249, 115, 22, 0.50);
    --ds-viz-stroke: rgba(249, 115, 22, 0.55);
    --ds-viz-fill: rgba(249, 115, 22, 0.14);
    --ds-fg-70: rgba(255, 255, 255, 0.70);
    --ds-fg-80: rgba(255, 255, 255, 0.80);
    --ds-control-bg: rgba(0, 0, 0, 0.72);
    --ds-control-border: rgba(255, 255, 255, 0.18);
    --ds-control-shadow: 0 10px 30px rgba(0, 0, 0, 0.45);
    color-scheme: dark;
}

/* Tailwind CDN compatibility: map common text-white utilities to theme tokens */
.text-white {
    color: var(--ds-fg) !important;
}
.text-white\/70 {
    color: var(--ds-fg-70) !important;
}
.text-white\/80 {
    color: var(--ds-fg-80) !important;
}

html {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    overflow: hidden;
}

body {
    font-family: 'Geist', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    background: var(--ds-bg);
    color: var(--ds-fg);
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    overflow: hidden;
}

.blockrunner-root {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: transparent;
    display: flex;
    flex-direction: column;
    overflow-x: hidden;
    overflow-y: auto;
}


#dashboard-modules-root {
    position: relative;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    display: flex;
    flex-direction: column;
    overflow: visible;
}

#dashboard-modules-root > section {
    position: relative;
    width: 100svw;
    min-height: 100svh;
    overflow: hidden;
}

/* In split view, make sure section takes full height of left panel */
html.ai-chat-open #dashboard-modules-root > section {
    min-height: 100vh;
    height: auto;
}

.module-card {
    position: relative;
    background: var(--ds-card-bg);
    transition: background 0.03s ease, border-color 0.03s ease;
    border: 1px solid var(--ds-border);
    cursor: pointer;
}

.blockrunner-module {
    background: transparent !important;
    border: none !important;
}

.blockrunner-module:hover {
    background: transparent !important;
    border: none !important;
}

.blockrunner-module::before {
    display: none !important;
}

@media (min-width: 769px) {
    .module-card {
        border-color: var(--ds-border) !important;
        border-width: 1px !important;
    }
}

.module-card:hover {
    border-color: var(--ds-hover-border) !important;
    background: var(--ds-card-bg-hover);
}

.module-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: transparent;
    transition: background 0.03s ease;
    pointer-events: none;
    z-index: 5;
}

.module-card:hover::before {
    background: var(--ds-hover-overlay);
}

/* Disable hover overlay and effects for Bitcoin Intelligence module */
.bitcoin-intelligence-module::before {
    display: none !important;
}

.bitcoin-intelligence-module:hover::before {
    display: none !important;
}

.bitcoin-intelligence-module:hover {
    border-color: var(--ds-border) !important;
    background: var(--ds-card-bg) !important;
}

.module-card svg * {
    transition: fill 0.03s ease, stroke 0.03s ease;
}

.module-card svg rect:not([fill="none"]) {
    stroke: none !important;
}

.module-card:hover svg:not(.inscriptions-masonry-grid):not(.hexagon-grid) .viz-accent {
    fill: var(--ds-viz-accent-fill);
    stroke: var(--ds-viz-accent-stroke);
    animation-play-state: running !important;
}

/* Varying orange tones for matrix noise elements */
.module-card:hover svg:not(.inscriptions-masonry-grid):not(.hexagon-grid) .viz-accent[data-blue-tone="0.3"] {
    fill: var(--ds-viz-accent-fill-03);
}

.module-card:hover svg:not(.inscriptions-masonry-grid):not(.hexagon-grid) .viz-accent[data-blue-tone="0.45"] {
    fill: var(--ds-viz-accent-fill-045);
}

.module-card:hover svg:not(.inscriptions-masonry-grid):not(.hexagon-grid) .viz-accent[data-blue-tone="0.6"] {
    fill: var(--ds-viz-accent-fill-06);
}

.module-card:hover svg:not(.inscriptions-masonry-grid):not(.hexagon-grid) .viz-accent[data-blue-tone="0.75"] {
    fill: var(--ds-viz-accent-fill-075);
}

/* Inscriptions masonry grid - animations handled by JavaScript */
/* CSS only provides smooth transitions */
svg.inscriptions-masonry-grid .inscriptions-block {
    transition: fill 0.5s ease;
}

/* Stagger the rotation so different groups become white at different times */
.module-card:hover svg.inscriptions-masonry-grid .inscriptions-block:nth-child(7n+1) {
    animation-delay: 0s !important;
}

.module-card:hover svg.inscriptions-masonry-grid .inscriptions-block:nth-child(7n+2) {
    animation-delay: 2.14s !important;
}

.module-card:hover svg.inscriptions-masonry-grid .inscriptions-block:nth-child(7n+3) {
    animation-delay: 4.28s !important;
}

.module-card:hover svg.inscriptions-masonry-grid .inscriptions-block:nth-child(7n+4) {
    animation-delay: 6.42s !important;
}

.module-card:hover svg.inscriptions-masonry-grid .inscriptions-block:nth-child(7n+5) {
    animation-delay: 8.56s !important;
}

.module-card:hover svg.inscriptions-masonry-grid .inscriptions-block:nth-child(7n+6) {
    animation-delay: 10.7s !important;
}

.module-card:hover svg.inscriptions-masonry-grid .inscriptions-block:nth-child(7n+7) {
    animation-delay: 12.84s !important;
}

.module-card:hover svg *:not(.viz-accent) {
    stroke: var(--ds-viz-stroke);
    fill: var(--ds-viz-fill);
    opacity: 1;
}

.module-card:hover svg.mining-cost-coin * {
    fill: none !important;
}

.module-card:hover svg.mining-cost-coin .mining-cost-fill {
    stroke: rgba(255, 255, 255, 0.95) !important;
}

.module-card:hover svg.mining-cost-coin text {
    fill: rgba(255, 255, 255, 0.9) !important;
    stroke: none !important;
}

.module-card:hover svg.mining-cost-coin .coin-outline {
    stroke: rgba(143, 143, 143, 0.45) !important;
}

/* Mempool activity line: white on hover (instead of orange) */
.module-card:hover svg.mempool-load-display path[stroke] {
    stroke: rgba(255, 255, 255, 0.95) !important;
}

.module-card:hover svg:not(.mining-cost-coin) *[fill="none"] {
    stroke: var(--ds-viz-stroke) !important;
    fill: none !important;
    opacity: 1;
}

/* AI Chatbot Container */
.ai-chatbot-container {
    position: fixed;
    right: 16px;
    bottom: 80px;
    width: 400px;
    max-width: calc(100vw - 32px);
    max-height: calc(100vh - 120px);
    z-index: 9999;
    background: var(--ds-control-bg);
    border: 1px solid var(--ds-control-border);
    border-radius: 16px;
    box-shadow: var(--ds-control-shadow);
    backdrop-filter: blur(10px);
    display: flex;
    flex-direction: column;
    opacity: 0;
    transform: translateY(20px) scale(0.95);
    pointer-events: none;
    transition: opacity 0.3s ease, transform 0.3s ease;
    overflow: hidden;
}

.ai-chatbot-container[aria-hidden="false"] {
    opacity: 1;
    transform: translateY(0) scale(1);
    pointer-events: all;
}

@media (min-width: 769px) {
    /* Right-side sliding panel */
    .ai-chatbot-container {
        top: 0;
        bottom: 0;
        right: 0;
        left: auto;
        width: 50vw;
        max-width: 50vw;
        height: 100svh;
        max-height: 100svh;
        border-radius: 0;
        border-left: 1px solid var(--ds-control-border);
        border-right: none;
        border-top: none;
        border-bottom: none;
        transform: translateX(100%);
        opacity: 1;
        transition: transform 0.35s ease;
        pointer-events: none;
        position: fixed;
        z-index: 2;
    }

    .ai-chatbot-container[aria-hidden="false"] {
        transform: translateX(0);
        pointer-events: all;
    }

    /* Ensure input container is flush at bottom in split view */
    html.ai-chat-open .ai-chatbot-container {
        display: flex;
        flex-direction: column;
        padding-bottom: 0;
    }

    html.ai-chat-open .ai-chatbot-input-container {
        margin-top: auto;
        padding-bottom: 0;
        margin-bottom: 0;
    }

    html.ai-chat-open #dashboard-modules-root {
        width: 50vw;
        max-width: 50vw;
        position: fixed;
        left: 0;
        right: auto;
        top: 0;
        bottom: 0;
        z-index: 1;
        overflow-y: auto;
        overflow-x: hidden;
    }

    html.ai-chat-open #dashboard-modules-root > section {
        width: 100%;
        min-height: 100vh;
        height: auto;
        overflow-y: auto;
        overflow-x: hidden;
        position: relative;
        z-index: 1;
        background: #000000;
    }

    /* Drive the React inline styles via CSS vars */
    html.ai-chat-open {
        --dashboard-width: 50vw;
        --dashboard-height: auto;
        --dashboard-max-height: none;
        --dashboard-grid-cols: 1fr;
        --dashboard-grid-rows: auto;
    }

    html.ai-chat-open .dashboard-grid > .blockrunner-module {
        display: none !important;
    }

    html.ai-chat-open .dashboard-grid {
        display: flex !important;
        flex-direction: column !important;
        height: auto !important;
        max-height: none !important;
        width: 100% !important;
        overflow: visible !important;
        gap: 0 !important;
        padding: 24px !important;
        margin: 0 !important;
    }

    html.ai-chat-open .dashboard-grid .module-card + .module-card {
        margin-top: 0 !important;
    }

    html.ai-chat-open .dashboard-grid .module-card {
        width: 100% !important;
        height: auto !important;
        min-height: 180px !important;
        aspect-ratio: 4 / 3 !important;
        flex: 0 0 auto !important;
        overflow: hidden;
        position: relative;
        z-index: 2;
        margin-bottom: 0 !important;
        /* Match homepage module styling exactly */
        /* Split view: darker, less translucent by default (closer to hover) */
        background: rgba(0, 0, 0, 0.97) !important;
        -webkit-backdrop-filter: blur(28px) saturate(1.15) !important;
        backdrop-filter: blur(28px) saturate(1.15) !important;
        display: block !important;
        visibility: visible !important;
        opacity: 1 !important;
        border-color: var(--ds-border) !important;
        border-width: 1px !important;
    }

    html.ai-chat-open .dashboard-grid .module-card:not(:last-child) {
        margin-bottom: 0 !important;
    }

    /* Normal hover behavior - same as homepage */
    html.ai-chat-open .dashboard-grid .module-card:hover {
        border-color: var(--ds-hover-border) !important;
        /* Hover: fully opaque (no alpha) for subtle transition */
        background: rgba(0, 0, 0, 1) !important;
    }

    html.ai-chat-open .dashboard-grid .module-card::before {
        /* Slight default overlay to reduce translucency (closer to hover) */
        background: rgba(0, 0, 0, 0.18) !important;
    }

    html.ai-chat-open .dashboard-grid .module-card:hover::before {
        background: var(--ds-hover-overlay) !important;
    }

    html.ai-chat-open .full-viewport-background-video {
        position: fixed !important;
        top: 0 !important;
        left: 0 !important;
        right: 0 !important;
        bottom: 0 !important;
        width: 100vw !important;
        height: 100vh !important;
        z-index: 0 !important;
    }

    html.ai-chat-open .full-viewport-background-video video {
        position: absolute !important;
        top: 50% !important;
        left: 50% !important;
        transform: translate(-50%, -50%) !important;
        width: 100vw !important;
        height: 100vh !important;
        object-fit: cover !important;
        object-position: center !important;
    }

    html.ai-chat-open .mined-america-section {
        min-height: auto;
        position: relative;
        z-index: 1;
    }

    html.ai-chat-open .ai-chatbot-container {
        position: fixed;
        z-index: 2;
        /* Split view: darker panel to match modules */
        background: rgba(0, 0, 0, 0.9);
        -webkit-backdrop-filter: blur(18px) saturate(1.1);
        backdrop-filter: blur(18px) saturate(1.1);
    }
}

.ai-chatbot-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    border-bottom: 1px solid var(--ds-border);
}

.ai-chatbot-header h3 {
    font-family: 'Geist', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    font-size: 14px;
    font-weight: 500;
    color: var(--ds-fg);
    margin: 0;
}

.ai-chatbot-close {
    appearance: none;
    border: none;
    background: transparent;
    color: var(--ds-fg);
    cursor: pointer;
    padding: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
    transition: background 0.2s ease;
    opacity: 0.7;
}

.ai-chatbot-close:hover {
    background: var(--ds-hover-overlay);
    opacity: 1;
}

.ai-chatbot-messages {
    flex: 1;
    overflow-y: auto;
    padding: 16px 20px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    min-height: 200px;
    max-height: 400px;
    overflow-anchor: none;
}

.ai-chatbot-message {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.ai-chatbot-message p {
    font-family: 'Geist', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    font-size: 13px;
    line-height: 1.5;
    color: var(--ds-fg);
    margin: 0;
    padding: 10px 14px;
    border-radius: 12px;
    background: var(--ds-card-bg);
    border: 1px solid var(--ds-border);
}

.ai-chatbot-message-user {
    align-items: flex-end;
}

.ai-chatbot-message-user p {
    background: var(--ds-hover-overlay);
    border-color: var(--ds-hover-border);
}

.ai-chatbot-message-assistant {
    align-items: flex-start;
}

.ai-chatbot-input-container {
    display: flex;
    gap: 8px;
    padding: 16px 20px;
    padding-bottom: 0;
    border-top: 1px solid var(--ds-border);
    margin-top: auto;
}

.ai-chatbot-input {
    flex: 1;
    appearance: none;
    border: 1px solid var(--ds-border);
    background: var(--ds-card-bg);
    color: var(--ds-fg);
    font-family: 'Geist', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    font-size: 13px;
    padding: 10px 14px;
    border-radius: 12px;
    outline: none;
    transition: border-color 0.2s ease, background 0.2s ease;
}

.ai-chatbot-input:focus {
    border-color: var(--ds-hover-border);
    background: var(--ds-card-bg-hover);
}

.ai-chatbot-input::placeholder {
    color: var(--ds-fg-70);
}

.ai-chatbot-send {
    appearance: none;
    border: 1px solid var(--ds-hover-border);
    background: var(--ds-hover-overlay);
    color: var(--ds-fg);
    cursor: pointer;
    padding: 10px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s ease, transform 0.2s ease;
    min-width: 40px;
}

.ai-chatbot-send:hover {
    background: var(--ds-hover-overlay);
    transform: scale(1.05);
}

.ai-chatbot-send:active {
    transform: scale(0.95);
}

.ai-chatbot-send svg {
    width: 20px;
    height: 20px;
}

/* Mobile responsive */
@media (max-width: 768px) {
    .ai-chatbot-container {
        width: calc(100vw - 32px);
        bottom: 80px;
        max-height: calc(100vh - 140px);
    }
}

.module-card:hover svg.daily-output-grid .viz-accent[data-on="1"] {
    fill: rgba(255, 255, 255, 0.85) !important;
}

/* Transaction Trends hover - only animate colors, keep dots in place */
.module-card:hover svg.transactions-flow-field .viz-accent {
    transition: fill 0.3s ease !important;
}

/* Active dots (white) become brighter on hover */
.module-card:hover svg.transactions-flow-field .viz-accent[data-is-active="1"] {
    fill: rgba(255, 255, 255, 0.6) !important;
}

/* Inactive dots (grey) become translucent orange on hover */
.module-card:hover svg.transactions-flow-field .viz-accent[data-is-active="0"] {
    fill: rgba(249, 115, 22, 0.3) !important;
}

/* Block Space - default state: grey outlines only */
svg.hexagon-grid .hexagon-circle {
    stroke: rgba(143, 143, 143, 1) !important;
}

/* Block Space hover - white circle outline that changes every few seconds */
.module-card:hover svg.hexagon-grid .hexagon-circle {
    transition: stroke 0.4s ease, opacity 0.4s ease, fill 0.4s ease !important;
}

.module-card:hover svg.hexagon-grid .hexagon-circle[data-white-hover="1"] {
    stroke: rgba(255, 255, 255, 0.95) !important;
}

.module-card:hover svg.hexagon-grid .hexagon-circle[data-white-hover="0"] {
    stroke: rgba(143, 143, 143, 0.8) !important;
}

/* Orange translucent background for some circles on hover */
.module-card:hover svg.hexagon-grid .hexagon-circle[data-orange-fill="1"] {
    fill: rgba(249, 115, 22, 0.25) !important;
}

.module-card:hover svg.route-grid .route-line {
    stroke: rgba(255, 255, 255, 0.95) !important;
}

.module-card:hover svg .leaderboard-highlighted-bar {
    fill: rgba(255, 255, 255, 0.95) !important;
}

.module-card:hover svg.hexagon-grid .hexagon-white-on-hover {
    stroke: rgba(255, 255, 255, 0.95) !important;
    fill: none !important;
}

.module-card:hover svg.hexagon-grid .hexagon-orange-on-hover {
    stroke: rgba(249, 115, 22, 0.4) !important;
    fill: rgba(249, 115, 22, 0.25) !important;
}

.module-visual {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    position: relative;
}

.module-card .module-visual {
    position: relative !important;
    z-index: 10 !important;
}

/* Live price display - typography & color */
.live-price-display {
    color: rgba(143, 143, 143, 0.6) !important;
    font-size: clamp(2.5rem, 8vw, 6rem);
    font-weight: 400;
    letter-spacing: -0.02em;
    line-height: 1;
    transition: color 0.4s ease;
    background: transparent !important;
}

.live-price-display::before,
.live-price-display::after {
    background: transparent !important;
}

.module-card:hover .live-price-display {
    color: rgba(255, 255, 255, 0.95) !important;
    background: transparent !important;
}

/* Hashrate display - typography & color (smaller than live price) */
.hashrate-display {
    color: rgba(143, 143, 143, 0.6) !important;
    font-size: clamp(1.5rem, 5vw, 3.5rem);
    font-weight: 400;
    letter-spacing: -0.02em;
    line-height: 1.2;
    transition: color 0.4s ease;
    background: transparent !important;
    text-align: center;
    display: inline-block;
    max-width: 100%;
    word-break: break-word;
}

.hashrate-display.miner-revenue-display {
    /* Same sizing as Bitcoin Price number (live-price-display) */
    font-size: clamp(2.5rem, 8vw, 6rem);
    line-height: 1;
}

.hashrate-display.hashrate-display-zh {
    /* ZH/s should visually fill the module more */
    font-size: clamp(2.2rem, 6.2vw, 4.8rem);
    line-height: 1.05;
}

.hashrate-display::before,
.hashrate-display::after {
    background: transparent !important;
}

.module-card:hover .hashrate-display {
    color: rgba(255, 255, 255, 0.95) !important;
    background: transparent !important;
}

.module-card h3,
.module-card p,
.module-card span,
.module-card div {
    background-color: transparent !important;
    background: transparent !important; /* Ensure both properties are unset */
    box-shadow: none !important;
}

.module-card:hover h3,
.module-card:hover p,
.module-card:hover span,
.module-card:hover div,
.module-card:hover .live-price-display,
.module-card:hover .hashrate-display,
.module-card:hover .bitcoin-treasury-display {
    background-color: transparent !important;
    background: transparent !important;
    box-shadow: none !important;
}

/* Ensure module-card background doesn't show through for price displays */
.module-card .live-price-wrapper,
.module-card .live-price-display,
.module-card .hashrate-display-wrapper,
.module-card .hashrate-display,
.module-card .bitcoin-treasury-display {
    background: transparent !important;
    background-color: transparent !important;
    position: relative;
    z-index: 1;
}

.live-price-wrapper {
    transform: none;
    background: transparent !important;
}

.live-price-wrapper::before,
.live-price-wrapper::after {
    background: transparent !important;
}

.hashrate-display-wrapper {
    transform: none;
    background: transparent !important;
    text-align: center;
}

.hashrate-display-wrapper::before,
.hashrate-display-wrapper::after {
    background: transparent !important;
}

.bitcoin-treasury-display {
    background: transparent !important;
}

.bitcoin-treasury-display::before,
.bitcoin-treasury-display::after {
    background: transparent !important;
}

@media (min-width: 1920px) {
    .live-price-display {
        /* Slightly larger than default on big monitors */
        font-size: clamp(3rem, 6vw, 8rem) !important;
    }
    .hashrate-display {
        font-size: clamp(2.5rem, 5vw, 6rem) !important;
    }
    .hashrate-display.hashrate-display-zh {
        font-size: clamp(2.8rem, 5.5vw, 6.5rem) !important;
    }
    .hashrate-display.miner-revenue-display {
        /* Match Bitcoin Price number size at larger breakpoints */
        font-size: clamp(3rem, 6vw, 8rem) !important;
    }
}

@media (min-width: 2560px) {
    .live-price-display {
        font-size: clamp(4rem, 8vw, 10rem) !important;
    }
    .hashrate-display {
        font-size: clamp(3rem, 6vw, 7.5rem) !important;
    }
    .hashrate-display.hashrate-display-zh {
        font-size: clamp(3.5rem, 7vw, 8.5rem) !important;
    }
    .hashrate-display.miner-revenue-display {
        /* Match Bitcoin Price number size at larger breakpoints */
        font-size: clamp(4rem, 8vw, 10rem) !important;
    }
}

@media (min-width: 3000px) {
    .live-price-display {
        font-size: clamp(5rem, 10vw, 12rem) !important;
    }
    .hashrate-display {
        font-size: clamp(3.5rem, 7vw, 9rem) !important;
    }
    .hashrate-display.hashrate-display-zh {
        font-size: clamp(4rem, 8vw, 10rem) !important;
    }
    .hashrate-display.miner-revenue-display {
        /* Match Bitcoin Price number size at larger breakpoints */
        font-size: clamp(5rem, 10vw, 12rem) !important;
    }
}

/* Scale up Bitcoin Treasury number at larger resolutions (proportional to Live Bitcoin Price) */
@media (min-width: 1920px) {
    .bitcoin-treasury-display {
        /* Scale Bitcoin Treasury larger on big monitors */
        font-size: clamp(3rem, 6vw, 6.8rem) !important;
    }
}

@media (min-width: 2560px) {
    .bitcoin-treasury-display {
        /* Scale Bitcoin Treasury larger at ultra-wide */
        font-size: clamp(4.2rem, 7.5vw, 8.5rem) !important;
    }
}

/* Control width of the hero WideDotMatrixField SVG */
/* Increase specificity to override generic .module-visual svg rules */
.module-visual .wide-dot-matrix {
    /* Base size - responsive using viewport units (12% larger total) */
    width: 100%;
    max-width: clamp(449px, 28.1vw, 540px);
}

/* Medium desktop breakpoints - gradual scaling */
@media (min-width: 1440px) {
    .module-visual .wide-dot-matrix {
        max-width: clamp(584px, 33.7vw, 674px);
    }
}

@media (min-width: 1600px) {
    .module-visual .wide-dot-matrix {
        max-width: clamp(674px, 39.3vw, 786px);
    }
}

@media (min-width: 1920px) {
    .module-visual .wide-dot-matrix {
        /* Larger on ultra-wide */
        max-width: clamp(786px, 44.9vw, 956px);
    }
}

@media (min-width: 2560px) {
    .module-visual .wide-dot-matrix {
        /* Larger on massive displays */
        max-width: clamp(956px, 50.6vw, 1236px);
    }
}

.module-visual svg {
    width: 100%;
    height: 100%;
    max-width: 100%;
    max-height: 100%;
    border: none !important;
    outline: none !important;
    background: none !important;
    margin: auto;
    object-fit: contain;
}


.module-visual svg rect[width="100"][height="100"] {
    display: none !important;
}


.module-visual {
    background: none !important;
}

header {
    text-align: center;
    margin-bottom: 40px;
}

header h1 {
    font-size: 2.5rem;
    color: #ffffff;
    margin-bottom: 10px;
    font-weight: 700;
    letter-spacing: -0.5px;
}

header p {
    color: rgba(255, 255, 255, 0.8);
    font-size: 1.1rem;
}

.source-link {
    margin-top: 10px;
    font-size: 0.9rem;
}

.source-link a {
    color: #f7931a;
    text-decoration: none;
    font-weight: 600;
}

.source-link a:hover {
    text-decoration: underline;
}


.controls {
    display: flex;
    gap: 15px;
    justify-content: center;
    margin-bottom: 40px;
    flex-wrap: wrap;
}

.btn {
    padding: 12px 24px;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.15);
}

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

.btn-primary {
    background: #f7931a;
    color: white;
}

.btn-primary:hover {
    background: #e8840a;
}

.btn-secondary {
    background: #f56565;
    color: white;
}

.btn-secondary:hover {
    background: #e53e3e;
}

.btn-info {
    background: #48bb78;
    color: white;
}

.btn-info:hover {
    background: #38a169;
}


.info h2 {
    color: rgba(255, 255, 255, 0.9);
    margin-bottom: 12px;
    font-weight: 500;
    font-size: 14px;
}

.info a {
    color: rgba(100, 150, 255, 0.9);
    text-decoration: none;
    font-weight: 500;
}

.info a:hover {
    text-decoration: underline;
    color: rgba(100, 150, 255, 1);
}

.disclaimer {
    margin-top: 20px;
    font-size: 0.85rem;
    color: rgba(255, 255, 255, 0.6);
    font-style: italic;
}

.info p {
    color: rgba(255, 255, 255, 0.6);
    line-height: 1.5;
    margin-bottom: 8px;
    font-size: 12px;
}

/* Titan-style ambient animation keyframes for dashboard modules */

@keyframes dot-shimmer {
    0% {
        transform: translateY(0px);
    }
    50% {
        transform: translateY(-1px);
    }
    100% {
        transform: translateY(0px);
    }
}

@keyframes radar-sweep {
    0% {
        transform: rotate(0deg);
    }
    100% {
        transform: rotate(360deg);
    }
}

@keyframes matrix-noise {
    0% {
        transform: translateY(5%);
    }
    100% {
        transform: translateY(-20%);
    }
}

@keyframes matrix-rect-drift-a {
  0% {
        transform: translate3d(0, 0, 0);
  }
  40% {
        transform: translate3d(0, -1.5px, 0);
  }
  75% {
        transform: translate3d(0, -2.5px, 0);
  }
  100% {
        transform: translate3d(0, 0, 0);
  }
}

@keyframes matrix-rect-drift-b {
  0% {
        transform: translate3d(0, 0, 0);
  }
  30% {
        transform: translate3d(0, -1px, 0);
  }
  65% {
        transform: translate3d(0, -2.2px, 0);
  }
  100% {
        transform: translate3d(0, 0, 0);
  }
}

@keyframes matrix-rect-drift-c {
  0% {
        transform: translate3d(0, 0, 0);
  }
  45% {
        transform: translate3d(0, -0.8px, 0);
  }
  80% {
        transform: translate3d(0, -1.8px, 0);
  }
  100% {
        transform: translate3d(0, 0, 0);
  }
}

@keyframes sparkline-flicker {
    0%,
    100% {
        opacity: 0.18;
    }
    40% {
        opacity: 0.28;
    }
    60% {
        opacity: 0.22;
    }
}

@keyframes pulse-soft {
    0%,
    100% {
        transform: scale(1);
        opacity: 0.18;
    }
    50% {
        transform: scale(1.25);
        opacity: 0.32;
    }
}

@keyframes wave-drift {
    0% {
        transform: translateX(0);
        opacity: 0.4;
    }
    50% {
        transform: translateX(12px);
        opacity: 0.7;
    }
    100% {
        transform: translateX(0);
        opacity: 0.4;
    }
}

@keyframes hexagon-pulse {
    0%,
    100% {
        opacity: 0.35;
        transform: scale(1);
    }
    50% {
        opacity: 0.65;
        transform: scale(1.15);
    }
}

@keyframes route-highlight {
    0% {
        stroke-dasharray: 2 160;
        stroke-dashoffset: 0;
        stroke-width: 1.1;
    }
    40% {
        stroke-dasharray: 40 120;
        stroke-dashoffset: -20;
        stroke-width: 1.4;
    }
    100% {
        stroke-dasharray: 2 160;
        stroke-dashoffset: -160;
        stroke-width: 1.1;
    }
}

@keyframes leaderboard-swap-up {
    0% {
        transform: translateY(0);
    }
    100% {
        transform: translateY(-8px);
    }
}

@keyframes leaderboard-swap-down {
    0% {
        transform: translateY(0);
    }
    100% {
        transform: translateY(8px);
    }
}

@keyframes leaderboard-bar-glow-subtle {
    0%,
    100% {
        opacity: 0.5;
    }
    50% {
        opacity: 0.55;
    }
}

@keyframes leaderboard-bar-drift-subtle {
    0% {
        opacity: 0.3;
    }
    50% {
        opacity: 0.35;
    }
    100% {
        opacity: 0.3;
    }
}

@keyframes mining-cost-fill {
    0% {
        stroke-dashoffset: 170;
    }
    66% {
        stroke-dashoffset: 0;
    }
    100% {
        stroke-dashoffset: 0;
    }
}

.mining-cost-fill {
    stroke-dasharray: 170 170;
    stroke-dashoffset: 170;
    animation: mining-cost-fill 9s linear infinite;
    transform-origin: 50px 37.5px;
    transform: rotate(-90deg);
}

@keyframes daily-output-fill {
    0% {
        fill: rgba(143, 143, 143, 0.3); /* dark grey, off */
    }
    49% {
        fill: rgba(143, 143, 143, 0.3);
    }
    50% {
        fill: rgba(143, 143, 143, 0.7); /* light grey, on */
    }
    100% {
        fill: rgba(143, 143, 143, 0.7);
    }
}

/* Desktop: Make half-width modules square aspect ratio */
@media (min-width: 769px) {
    .dashboard-grid > .module-card:nth-child(2),
    .dashboard-grid > .module-card:nth-child(3),
    .dashboard-grid > .module-card:nth-child(4),
    .dashboard-grid > .module-card:nth-child(5),
    .dashboard-grid > .module-card:nth-child(6),
    .dashboard-grid > .module-card:nth-child(7) {
        aspect-ratio: 1 / 1 !important;
    }
}

.mobile-message {
    display: none;
}

@media (max-width: 768px) {
    .blockrunner-root {
        display: none !important;
    }
    
    .mobile-message {
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        background: #000000;
        z-index: 9999;
        text-align: center;
    }

    .mobile-message-content {
        display: flex;
        flex-direction: column;
        gap: 0.5rem;
    }

    .mobile-line-1 {
        font-size: 1.5rem;
        font-weight: 400;
        color: #ffffff;
        letter-spacing: 0.05em;
    }

    .mobile-line-2 {
        font-size: 1.5rem;
        font-weight: 400;
        color: #ffffff;
        letter-spacing: 0.05em;
    }
}

@media (max-height: 600px) and (max-width: 900px) {
    .blockrunner-root {
        display: none !important;
    }
    
    .mobile-message {
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        background: #000000;
        z-index: 9999;
        text-align: center;
    }
}

.mined-america-section {
    display: flex;
    align-items: flex-start;
    justify-content: center;
    padding: 24px;
    background: var(--ds-bg);
    height: 100svh;
    position: relative;
    cursor: pointer;
    border: 1px solid var(--ds-border);
    --orange-phase: 0;
    --gold-phase: 0;
}

.mined-america-section::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: transparent;
    pointer-events: none;
    z-index: 1;
    transition: background 0.4s ease;
}

.mined-america-section::after {
    /* Hover background overlay removed */
    display: none;
}

.mined-america-inner {
    display: flex;
    flex-direction: column;
    width: 100%;
    height: 100%;
    margin: auto;
    align-items: flex-start;
    justify-content: flex-start;
    gap: 16px;
    padding: 0;
    /* Ensure content is above the hover overlay */
    position: relative;
    z-index: 2;
}

.mined-america-copy {
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    gap: 8px;
    margin-top: 0;
    width: 100%;
    cursor: pointer;
    padding: 0;
}

.mined-america-title {
    font-family: 'Geist', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    font-size: 15px;
    font-weight: 500;
    letter-spacing: -0.02em;
    color: #ffffff;
}

.mined-america-subtitle {
    font-family: 'Geist', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    font-size: 15px;
    color: rgba(255, 255, 255, 0.7);
    max-width: 36rem;
    line-height: 1.5;
}

.mined-america-footnote {
    font-size: 0.75rem;
    color: rgba(148, 163, 184, 0.9);
    text-transform: uppercase;
    letter-spacing: 0.16em;
    margin-top: 10px;
}

.mined-america-visual {
    display: flex;
    align-items: stretch;
    justify-content: stretch;
    flex-grow: 1;
    width: 100%;
    margin: 0;
    padding: 0;
    align-self: stretch;
    flex: 1 1 auto;
    min-height: 0; /* allow SVG to fill without forcing overflow */
    overflow: hidden; /* prevent SVG/glow from spilling outside */
}

.world-map-with-nodes {
    width: 100%;
    height: 100%;
    max-width: 100%;
    max-height: 100%;
    overflow: hidden; /* clip inside the SVG viewport */
    pointer-events: none;
    display: block;
}

/* The base `.usa-map-outline` rules include max-width/max-height/auto sizing.
   Override them for the world map so the SVG fills the visual container. */
.usa-map-outline.world-map-with-nodes {
    width: 100% !important;
    height: 100% !important;
    max-width: none !important;
    max-height: none !important;
}

.usa-map-outline {
    /* 0 = red/white base only, 1 = full gold theme */
    --mapGoldPhase: 0;
    width: 100%;
    height: auto;
    max-height: 60vh;
    max-width: 80vw;
    /* Ensure strokes scale nicely */
    overflow: visible;
    pointer-events: none; /* Disable all hover interaction on map SVG */
    shape-rendering: geometricPrecision; /* Better anti-aliasing for smoother rendering */
    will-change: opacity; /* Optimize for opacity animations */
}

.usa-map-fill-base {
    fill: url(#white-gradient);
    stroke: none;
    vector-effect: non-scaling-stroke;
    transition: opacity 0.03s ease;
    pointer-events: all;
    opacity: 1;
}

.usa-map-stroke-base {
    fill: none !important;
    stroke: rgba(140, 140, 140, 1) !important;
    stroke-width: 2px !important;
    stroke-linecap: round;
    stroke-linejoin: round;
    shape-rendering: geometricPrecision;
    vector-effect: non-scaling-stroke;
    pointer-events: none;
    filter: drop-shadow(
        0 0 calc(0.5px + 1px * var(--shimmerPhase, 0))
        rgba(255, 255, 255, calc(0.05 + 0.15 * var(--shimmerPhase, 0)))
    );
    transition: filter 0.1s linear;
}

.usa-map-stroke-orange {
    /* Orange theme overlay paths – used in orangePhase crossfade */
    fill: url(#orange-fill-gradient);
    stroke: url(#orange-gradient-stroke);
    stroke-width: 2px !important;
    stroke-linecap: round;
    stroke-linejoin: round;
    vector-effect: non-scaling-stroke;
    pointer-events: none;
    filter: none !important;
    transition: opacity 0.15s linear;
}

.usa-map-border-orange {
    /* Orange-only border overlay used in orangePhase crossfade */
    fill: none !important;
    stroke: url(#orange-gradient-stroke);
    stroke-width: 2px !important;
    stroke-linecap: round;
    stroke-linejoin: round;
    shape-rendering: geometricPrecision;
    vector-effect: non-scaling-stroke;
    pointer-events: none;
    filter: none;
    transition: opacity 0.15s linear;
}

.usa-map-stroke-gold {
    /* Gold theme overlay paths – used in goldPhase crossfade */
    fill: url(#gold-fill-gradient);
    stroke: url(#gold-gradient-stroke);
    stroke-width: 2px !important;
    stroke-linecap: round;
    stroke-linejoin: round;
    vector-effect: non-scaling-stroke;
    pointer-events: none;
    filter: none !important;
    transition: opacity 0.15s linear;
}

.usa-map-border-gold {
    /* Gold-only border overlay used in goldPhase crossfade */
    fill: none !important;
    stroke: url(#gold-gradient-stroke);
    stroke-width: 2px !important;
    stroke-linecap: round;
    stroke-linejoin: round;
    shape-rendering: geometricPrecision;
    vector-effect: non-scaling-stroke;
    pointer-events: none;
    /* No blur - sharp metallic borders */
    filter: none;
    transition: opacity 0.15s linear;
}

.usa-map-stroke-highlight {
    fill: none !important;
    stroke: url(#white-border-gradient) !important;
    stroke-width: 2px !important;
    stroke-linecap: round;
    stroke-linejoin: round;
    stroke-dasharray: 60 360;
    stroke-dashoffset: 0;
    animation: map-border-travel 24s linear infinite;
    opacity: 1 !important;
    filter: none !important;
    transition: opacity 0.03s ease-out, filter 0.03s ease-out;
    pointer-events: none;
}

@keyframes slideInFromRight {
    from {
        transform: translateX(100%);
    }
    to {
        transform: translateX(0);
    }
}

.bitcoin-intelligence-container {
    animation: slideInFromRight 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

@keyframes map-border-travel {
    to {
        stroke-dashoffset: -365;
    }
}

@media (max-width: 768px) {
    .mined-america-section {
        padding: 0 !important;
        background: transparent !important;
        border-top: 1px solid rgba(255, 255, 255, 0.22);
        min-height: auto;
        width: 100% !important;
    }

    .mined-america-inner {
        display: flex !important;
        flex-direction: column !important;
        padding: 24px !important;
        gap: 16px;
        max-width: none;
        width: 100% !important;
        box-sizing: border-box !important;
    }

    .mined-america-visual {
        justify-content: center;
        padding: 20px 0;
        width: 100% !important;
    }

    .usa-map-outline {
        width: 100%;
        max-width: 100%;
    }

    .world-map-with-nodes {
        width: 100%;
        max-width: 100%;
    }

    .mined-america-subtitle {
        font-size: 15px;
    }
}
