:root {
    /* Light Mode - Softer, warmer, less glare */
    --bg-gradient: radial-gradient(circle at center, #f3f0e9 0%, #e8e4da 100%);
    --text-color: #4a4a4a;
    /* Softer grey instead of stark dark grey */
    --accent-color: #d97e0f;
    /* Slightly muted orange */
    --secondary-text: #7f8c8d;
    --status-color: #95a5a6;
    --danger-color: #e74c3c;
    /* Red for overtime */
    --transition-speed: 0.5s;
    --glow-opacity: 0;
    --border-color: rgba(0, 0, 0, 0.2);

    /* Golden Ratio Scale */
    --phi: 1.618;
    --base-unit: 1rem;

    /* Spacing Scale (Golden Ratio) */
    --space-xs: calc(var(--base-unit) / var(--phi));
    /* ~0.618rem */
    --space-sm: var(--base-unit);
    /* 1rem */
    --space-md: calc(var(--base-unit) * var(--phi));
    /* ~1.618rem */
    --space-lg: calc(var(--base-unit) * var(--phi) * var(--phi));
    /* ~2.618rem */
    --space-xl: calc(var(--base-unit) * var(--phi) * var(--phi) * var(--phi));
    /* ~4.236rem */
    --space-xxl: calc(var(--base-unit) * var(--phi) * var(--phi) * var(--phi) * var(--phi));
    /* ~6.854rem */

    /* Typography Scale (Golden Ratio) */
    --text-xs: calc(1rem / var(--phi));
    /* ~0.618rem */
    --text-sm: 1rem;
    --text-md: calc(1rem * var(--phi));
    /* ~1.618rem */
    --text-lg: calc(1rem * var(--phi) * var(--phi));
    /* ~2.618rem */
    --text-xl: calc(1rem * var(--phi) * var(--phi) * var(--phi));
    /* ~4.236rem */
    --text-xxl: calc(1rem * var(--phi) * var(--phi) * var(--phi) * var(--phi));
    /* ~6.854rem */

    /* Line Height */
    --line-height-base: var(--phi);

    /* Header Icon Size (Standardized) */
    --header-icon-size: clamp(24px, 5vw, 32px);
}

[data-theme="dark"] {
    /* Dark Mode - Deep slate/charcoal, easy on eyes */
    --bg-gradient: radial-gradient(circle at center, #2d3436 0%, #1e272e 100%);
    --text-color: #dfe6e9;
    --secondary-text: #b2bec3;
    --status-color: #636e72;
    --glow-opacity: 0.1;
    --border-color: rgba(255, 255, 255, 0.2);
}

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

html {
    overflow-x: hidden;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    background: var(--bg-gradient);
    color: var(--text-color);
    transition: background 0.5s ease, color 0.5s ease;
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    overflow-x: hidden;
    font-size: var(--text-sm);
    line-height: var(--line-height-base);
}

.container {
    text-align: center;
    width: 100%;
    max-width: 1400px;
    /* Could be 1000 * phi? Keeping explicit for now */
    padding: var(--space-md);
    display: flex;
    flex-direction: column;
    align-items: center;
    min-height: 100vh;
}

header {
    /* Match the width of chart and progress sections for alignment */
    width: clamp(300px, 75vw, 1400px);
    padding: var(--space-md) 0;
    display: flex;
    justify-content: center;
    align-items: center;
    pointer-events: none;
    z-index: 10;
    margin-bottom: var(--space-md);
}

main {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    width: 100%;
    gap: var(--space-lg);
    /* Golden gap between main sections */
}

.header-tagline {
    color: var(--secondary-text);
    /* Responsive font size to prevent wrapping on mobile */
    font-size: clamp(0.85rem, 3.5vw, var(--text-md));
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.02em;
    /* Reduced spacing */
    opacity: 0.8;
    display: flex;
    align-items: center;
    gap: 0.8em;
    /* Increased gap */
    white-space: nowrap;
    /* Prevent wrapping */
}

.header-tagline svg {
    width: var(--header-icon-size);
    height: var(--header-icon-size);
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.1));
    flex-shrink: 0;
    /* Prevent logo from squishing */
}

/* Custom arrow for dropdown if needed, or keep it super minimal without */
/* For now, minimal text-only look is cleanest */
.nav-arrow {
    font-weight: 900;
    color: var(--accent-color);
    text-shadow: 0 0 1px currentColor;
    -webkit-text-stroke: 1px var(--accent-color);
}

/* Footer */
footer {
    margin-top: var(--space-md);
    margin-bottom: var(--space-md);
    text-align: center;
}

#disclaimer-btn {
    background: none;
    border: none;
    color: var(--secondary-text);
    font-size: var(--text-xs);
    cursor: pointer;
    text-decoration: underline;
    opacity: 0.7;
    transition: opacity 0.3s ease;
}

#disclaimer-btn:hover {
    opacity: 1;
}

/* Modal */
.modal {
    display: none;
    position: fixed;
    z-index: 100;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(5px);
    overflow: auto;
    /* Enable scroll if needed */
}

.modal-content {
    background-color: #ffffff;
    color: #1a1a1a;
    /* Ensure this is solid in themes */
    margin: 15% auto;
    padding: var(--space-lg);
    border: 1px solid var(--border-color);
    border-radius: var(--space-sm);
    width: 80%;
    max-width: 500px;
    position: relative;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.5);
    /* Darker shadow */
}

.close-modal {
    color: var(--secondary-text);
    float: right;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
    line-height: 0.8;
}

.close-modal:hover,
.close-modal:focus {
    color: var(--accent-color);
    /* Make close button pop */
    text-decoration: none;
}

.modal-content h2 {
    margin-top: 0;
    margin-bottom: var(--space-md);
    font-size: var(--text-md);
    color: var(--accent-color);
}

.modal-content p {
    font-size: 0.95rem;
    /* Slightly larger */
    line-height: 1.6;
    margin-bottom: var(--space-sm);
    color: inherit;
    /* Inherit from modal-content */
}

.logo-container {
    pointer-events: auto;
}


#price-label {
    font-size: var(--text-sm);
    color: var(--secondary-text);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: calc(var(--space-md) * -0.8);
    opacity: 0.8;
    font-weight: 500;
    z-index: 2;
    position: relative;
}

#price-container {
    font-weight: 600;
    /* Golden Ratio Typography Scaling */
    font-size: clamp(var(--text-xl), 13vw, var(--text-xxl));
    letter-spacing: -0.03em;
    display: flex;
    align-items: baseline;
    justify-content: center;
    line-height: 1;
    position: relative;
    z-index: 1;
    /* Subtle text shadow for depth */
    text-shadow: 0 10px 30px rgba(0, 0, 0, var(--glow-opacity));
    transition: text-shadow 0.5s ease;
    margin-bottom: var(--space-lg);
    /* Reduced from xl */
}



/* --- Chart Section --- */
#chart-section {
    width: 100%;
    /* Golden Ratio width relative to max container or viewport */
    width: clamp(300px, 75vw, 1400px);
    margin-top: 0;
    /* Reduced from lg */
    margin-bottom: var(--space-md);
}


#chart-header {
    text-align: left;
    font-size: var(--text-sm);
    color: var(--secondary-text);
    margin-bottom: 0;
    /* Removed margin to align with button */
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.chart-header-wrapper {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: var(--space-sm);
}

.chart-controls {
    display: flex;
    justify-content: space-between;
    margin-bottom: var(--space-sm);
    flex-wrap: wrap;
    gap: var(--space-sm);
}

.unit-toggles,
.timeframe-toggles {
    display: flex;
    gap: var(--space-xs);
}

.timeframe-btn,
.unit-btn {
    background: none;
    border: 1px solid var(--border-color);
    color: var(--secondary-text);
    padding: 4px 8px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.8rem;
    transition: all 0.2s ease;
}

.timeframe-btn:hover,
.unit-btn:hover {
    color: var(--text-color);
    border-color: var(--accent-color);
}

.timeframe-btn.active,
.unit-btn.active {
    background-color: var(--accent-color);
    color: #fff;
    border-color: var(--accent-color);
}

.inverse-toggle {
    background: none;
    border: 1px solid var(--border-color);
    color: var(--secondary-text);
    padding: 4px 8px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.8rem;
    transition: all 0.2s ease;
}

.inverse-toggle:hover {
    color: var(--text-color);
    border-color: var(--accent-color);
}

.inverse-toggle.active {
    background-color: var(--secondary-text);
    color: #fff;
    border-color: var(--accent-color);
}

[data-theme="dark"] .inverse-toggle.active {
    color: #2d3436;
}

.share-btn {
    background: none;
    border: 1px solid var(--border-color);
    color: var(--secondary-text);
    padding: 4px 6px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.8rem;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.share-btn:hover {
    color: var(--text-color);
    border-color: var(--accent-color);
}



@media (max-width: 480px) {
    .chart-controls {
        flex-wrap: nowrap;
        gap: 4px;
        align-items: center;
    }

    .unit-toggles,
    .timeframe-toggles {
        gap: 2px;
    }

    .timeframe-btn,
    .unit-btn,
    .inverse-toggle {
        padding: 3px 5px;
        font-size: 0.7rem;
        border-radius: 3px;
    }
}

.chart-container {
    position: relative;
    height: 300px;
    width: 100%;
}

.watermark {
    position: absolute;
    bottom: 10px;
    right: 10px;
    font-size: 1.5rem;
    font-weight: bold;
    color: rgba(128, 128, 128, 0.1);
    pointer-events: none;
    display: none;
    /* Hidden by default */
    z-index: 10;
}

#currency-symbol {
    font-size: 0.382em;
    /* 1 - 0.618 */
    margin-right: 0.2em;
    color: var(--secondary-text);
    font-weight: 400;
    vertical-align: super;
    opacity: 0.8;
}

.progress-section {
    width: 100%;
    width: clamp(300px, 75vw, 1400px);
    display: flex;
    flex-direction: column;
    gap: var(--space-md);
}

.progress-wrapper {
    display: flex;
    flex-direction: column;
    gap: var(--space-xs);
}

.progress-label {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    font-size: 1rem;
    color: var(--secondary-text);
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    flex-wrap: wrap;
    /* Allow wrapping if needed, but controlled */
    gap: var(--space-xs);
    /* Golden ratio gap */
}

.progress-details {
    display: flex;
    justify-content: center;
    width: 100%;
    margin-top: var(--space-xs);
    gap: var(--space-sm);
}

.detail-item {
    display: flex;
    flex-direction: column;
    align-items: center;
}

#halving-eta {
    color: var(--secondary-text);
}

.detail-label {
    font-size: 0.8rem;
    color: var(--secondary-text);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 0.2rem;
}

.detail-value {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-color);
}

@media (max-width: 480px) {
    .progress-details {
        flex-direction: column;
        gap: var(--space-xs);
        align-items: center;
    }
}

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

@media (max-width: 480px) {
    .progress-label {
        flex-direction: row;
        align-items: baseline;
        justify-content: space-between;
        /* 0.618rem was too small. 1rem might wrap. 
           Using 1rem / 1.1 (~0.9rem) for balance */
        font-size: 0.9rem;
        gap: 0.2rem;
    }

    /* Adjust container width for mobile to be wider than the desktop Golden Ratio */
    header,
    .progress-section,
    #chart-section {
        width: 90vw;
    }

    .progress-info {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.2rem;
    }

    .progress-label,
    .secondary-label {
        font-size: 0.9rem;
    }
}

.progress-bar-container {
    width: 100%;
    height: calc(var(--space-xs) / 1.618);
    /* Golden height */
    background-color: rgba(0, 0, 0, 0.08);
    border-radius: var(--space-xs);
    overflow: hidden;
}

[data-theme="dark"] .progress-bar-container {
    background-color: rgba(255, 255, 255, 0.08);
}

.progress-bar-fill {
    height: 100%;
    background-color: var(--accent-color);
    border-radius: var(--space-xs);
    transition: width 1s linear, background-color 0.5s ease;
}

.progress-bar-fill.overtime {
    background-color: var(--danger-color);
    transition: width 1s linear, background-color 0.5s ease;
}



@media (prefers-color-scheme: dark) {
    :root {
        --bg-gradient: radial-gradient(circle at center, #2d3436 0%, #1e272e 100%);
        --text-color: #dfe6e9;
        --secondary-text: #b2bec3;
        --status-color: #636e72;
        --glow-opacity: 0.1;
        --border-color: rgba(255, 255, 255, 0.2);
    }

    .modal-content {
        background-color: #1a1a1a;
        color: #f0f0f0;
        border: 1px solid #333;
    }


}



/* Footer & Copyright */
footer {
    margin-top: var(--space-xl);
    text-align: center;
    padding-bottom: var(--space-md);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--space-md);
}

.donation-section {
    width: 100%;
    display: flex;
    justify-content: center;
}

.footer-bottom {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-sm);
    flex-wrap: wrap;
    color: #888;
    font-size: 0.8rem;
}

.footer-bottom .divider {
    color: #555;
}

#disclaimer-btn {
    background: none;
    border: none;
    color: #888;
    cursor: pointer;
    font-size: 0.8rem;
    padding: 0;
    text-decoration: underline;
    text-transform: uppercase;
}

#disclaimer-btn:hover {
    color: var(--accent-color);
}

.copyright {
    margin: 0;
    /* Remove default margin */
    color: inherit;
}

.copyright a {
    color: inherit;
    text-decoration: none;
    border-bottom: 1px dotted #888;
    text-transform: uppercase;
}

.copyright a:hover {
    color: var(--accent-color);
    border-bottom-color: var(--accent-color);
}

/* Donation Modal Styles */
#donate-btn {
    background-color: #F7931A;
    border: none;
    color: #FFFFFF;
    padding: 0.5rem 1rem;
    border-radius: 20px;
    cursor: pointer;
    font-size: 1rem;
    transition: all 0.2s ease;
    font-weight: 600;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

#donate-btn:hover {
    filter: brightness(0.95);
    transform: translateY(-1px);
}

[data-theme="dark"] #donate-btn:hover {
    filter: brightness(1.1);
}

.donation-tabs {
    display: flex;
    justify-content: center;
    gap: 1rem;
    margin-bottom: 1.5rem;
    border-bottom: 1px solid rgba(128, 128, 128, 0.2);
    padding-bottom: 0.5rem;
}

.tab-btn {
    background: none;
    border: none;
    color: var(--secondary-text);
    cursor: pointer;
    font-size: 1rem;
    padding: 0.5rem;
    position: relative;
    transition: color 0.3s ease;
}

.tab-btn.active {
    color: var(--accent-color);
    font-weight: 600;
}

.tab-btn.active::after {
    content: '';
    position: absolute;
    bottom: -0.6rem;
    left: 0;
    width: 100%;
    height: 2px;
    background-color: var(--accent-color);
}

.tab-content {
    display: none;
    animation: fadeIn 0.3s ease;
}

.tab-content.active {
    display: block;
}

.qr-container {
    background: #fff;
    padding: 1rem;
    border-radius: 10px;
    display: inline-block;
    margin-bottom: 1rem;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.qr-code {
    width: 150px;
    height: 150px;
    display: block;
}

.qr-placeholder {
    width: 150px;
    height: 150px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #eee;
    color: #333;
    font-size: 0.8rem;
    text-align: center;
}

.address-box {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    background: rgba(128, 128, 128, 0.1);
    padding: 0.5rem 1rem;
    border-radius: 5px;
    margin-top: 0.5rem;
}

.address-text {
    font-family: monospace;
    font-size: 0.9rem;
    word-break: break-all;
    max-width: 250px;
    color: var(--text-color);
}

.copy-btn {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 1.2rem;
    opacity: 0.7;
    transition: opacity 0.2s;
}

.copy-btn:hover {
    opacity: 1;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}