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

:root {
    --blue: #2563eb;
    --blue-dark: #1d4ed8;
    --blue-light: #3b82f6;
}

body {
    font-family: 'Courier New', monospace;
    background-color: #fff;
    color: #1e293b;
    min-height: 100vh;
    line-height: 1.6;
}

.container {
    max-width: 1000px;
    margin: 0 auto;
    padding: 2rem 1rem;
}

/* Header */
header {
    text-align: center;
    margin-bottom: 2rem;
}

header h1 {
    font-size: 3rem;
    font-weight: 700;
    letter-spacing: 1rem;
    color: var(--blue);
}

.tagline {
    font-size: 0.875rem;
    color: #64748b;
    margin-top: 0.5rem;
    text-transform: uppercase;
    letter-spacing: 0.2rem;
}

/* Settings */
.settings {
    display: flex;
    justify-content: center;
    gap: 2rem;
    margin-bottom: 2rem;
    flex-wrap: wrap;
}

.setting-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.setting-group label {
    font-size: 0.75rem;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.1rem;
    color: var(--blue);
}

.setting-group input {
    padding: 0.5rem;
    border: 2px solid var(--blue);
    font-size: 1rem;
    font-family: 'Courier New', monospace;
    background: #fff;
    width: 180px;
    color: #1e293b;
}

.setting-group input:focus {
    outline: none;
    background: #eff6ff;
    border-color: var(--blue-dark);
}

/* Tabs */
.tabs {
    display: flex;
    justify-content: center;
    gap: 0;
    margin-bottom: 2rem;
    flex-wrap: wrap;
    border: 2px solid var(--blue);
    width: fit-content;
    margin-left: auto;
    margin-right: auto;
}

.tab {
    padding: 0.75rem 1.5rem;
    border: none;
    border-right: 2px solid var(--blue);
    background: #fff;
    font-size: 0.8rem;
    font-weight: 500;
    font-family: 'Courier New', monospace;
    color: var(--blue);
    cursor: pointer;
    text-transform: uppercase;
    letter-spacing: 0.05rem;
}

.tab .key {
    display: inline-block;
    width: 18px;
    height: 18px;
    line-height: 18px;
    text-align: center;
    border: 1px solid currentColor;
    margin-right: 0.5rem;
    font-size: 0.7rem;
}

.tab:last-child {
    border-right: none;
}

.tab:hover {
    background: #eff6ff;
}

.tab.active {
    background: var(--blue);
    color: #fff;
}

/* Stats */
.stats {
    text-align: center;
    margin-bottom: 2rem;
}

.stat-row {
    display: flex;
    justify-content: center;
    gap: 3rem;
}

.stat-block {
    display: flex;
    flex-direction: column;
}

.stat-value {
    font-size: 2.5rem;
    font-weight: 700;
    line-height: 1;
    color: var(--blue);
}

.stat-label {
    font-size: 0.7rem;
    letter-spacing: 0.2rem;
    color: #64748b;
    margin-top: 0.25rem;
}

/* Dot Grid */
.dot-grid {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 6px;
    padding: 2rem;
    background: #f8fafc;
    border: 2px solid var(--blue);
    margin-bottom: 2rem;
    min-height: 100px;
}

.dot {
    width: 14px;
    height: 14px;
    cursor: pointer;
    position: relative;
}

.dot:hover {
    transform: scale(1.5);
    z-index: 10;
}

.dot.passed {
    background-color: #e74c3c;
}

.dot.remaining {
    background-color: #2ecc71;
}

.dot.current {
    outline: 2px solid var(--blue);
    outline-offset: 2px;
    position: relative;
    overflow: hidden;
}

.dot.current::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: var(--fill-percent, 0%);
    background-color: #e74c3c;
    transition: height 1s linear;
}

.dot.final {
    background-color: var(--blue-dark) !important;
}

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

/* Tooltip */
.tooltip {
    position: fixed;
    background: var(--blue);
    color: #fff;
    padding: 0.5rem 1rem;
    font-size: 0.8rem;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.15s;
    z-index: 1000;
    max-width: 200px;
}

.tooltip.visible {
    opacity: 1;
}

/* Live Clock */
.live-clock {
    text-align: center;
    margin-bottom: 2rem;
}

#liveClock {
    font-size: 1.5rem;
    font-weight: 700;
    letter-spacing: 0.1rem;
    color: var(--blue);
}

.clock-label {
    display: block;
    font-size: 0.65rem;
    letter-spacing: 0.3rem;
    color: #64748b;
    margin-top: 0.25rem;
}

/* Export Section */
.export-section {
    text-align: center;
    margin-bottom: 2rem;
}

.export-btn {
    padding: 1rem 2rem;
    background: var(--blue);
    color: #fff;
    border: none;
    font-family: 'Courier New', monospace;
    font-size: 0.8rem;
    font-weight: 700;
    letter-spacing: 0.1rem;
    cursor: pointer;
    transition: background 0.2s;
}

.export-btn:hover {
    background: var(--blue-dark);
}

.export-btn:active {
    transform: scale(0.98);
}

/* Footer */
footer {
    text-align: center;
    padding-top: 1.5rem;
    border-top: 2px solid var(--blue);
}

.quote {
    font-size: 0.9rem;
    max-width: 600px;
    margin: 0 auto 1rem;
    line-height: 1.8;
}

.hint {
    font-size: 0.7rem;
    color: #94a3b8;
    letter-spacing: 0.05rem;
}

/* Paused state */
body.paused .dot.current::after {
    animation: none;
}

.pause-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.95);
    z-index: 1000;
    justify-content: center;
    align-items: center;
    flex-direction: column;
    text-align: center;
    padding: 2rem;
}

body.paused .pause-overlay {
    display: flex;
}

.pause-message {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--blue);
    margin-bottom: 1rem;
    letter-spacing: 0.1rem;
}

.pause-submessage {
    font-size: 1rem;
    color: #64748b;
    max-width: 400px;
    line-height: 1.8;
    margin-bottom: 2rem;
}

.pause-hint {
    font-size: 0.75rem;
    color: #94a3b8;
    letter-spacing: 0.1rem;
}

/* Responsive */
@media (max-width: 600px) {
    header h1 {
        font-size: 2rem;
        letter-spacing: 0.5rem;
    }

    .settings {
        flex-direction: column;
        align-items: center;
    }

    .tabs {
        border: none;
        gap: 4px;
        flex-wrap: wrap;
    }

    .tab {
        border: 2px solid var(--blue);
        padding: 0.5rem 0.75rem;
        font-size: 0.65rem;
    }

    .tab .key {
        display: none;
    }

    .tab:last-child {
        border-right: 2px solid var(--blue);
    }

    .stat-row {
        gap: 1.5rem;
    }

    .stat-value {
        font-size: 1.75rem;
    }

    .dot-grid {
        gap: 5px;
        padding: 1rem;
    }

    .dot {
        width: 10px;
        height: 10px;
    }
}

/* Years view - larger dots */
.dot-grid.years-view .dot {
    width: 20px;
    height: 20px;
}

@media (max-width: 600px) {
    .dot-grid.years-view .dot {
        width: 14px;
        height: 14px;
    }
}
