@import url('https://fonts.googleapis.com/css2?family=Space+Mono:wght@400;700&family=DM+Sans:wght@300;400&display=swap');

*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    min-height: 100vh;
    background: #0d0d0d;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    font-family: 'DM Sans', sans-serif;
    position: relative;
    overflow: hidden;
}

body::before {
    content: '';
    position: fixed;
    inset: 0;
    background-image:
        linear-gradient(rgba(255,255,255,0.03) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255,255,255,0.03) 1px, transparent 1px);
    background-size: 48px 48px;
    pointer-events: none;
}

/* Connection indicator */
#connIndicator {
    position: fixed;
    top: 1.5rem;
    left: 1.5rem;
    display: flex;
    align-items: center;
    gap: 7px;
    font-family: 'Space Mono', monospace;
    font-size: 0.7rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

#connDot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    display: inline-block;
}

#connIndicator.connected { color: #3ddc84; }
#connIndicator.connected #connDot {
    background: #3ddc84;
    box-shadow: 0 0 6px #3ddc84;
    animation: pulse 2s ease-in-out infinite;
}

#connIndicator.disconnected { color: #ff4f4f; }
#connIndicator.disconnected #connDot { background: #ff4f4f; }

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.4; }
}

/* Center layout */
.center {
    display: flex;
    flex-direction: column;
    align-items: center;
    position: relative;
    z-index: 1;
}

.count-label {
    font-family: 'Space Mono', monospace;
    font-size: 0.65rem;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    color: #555;
    margin-bottom: 0.5rem;
}

#count {
    font-family: 'Space Mono', monospace;
    font-size: clamp(5rem, 15vw, 8rem);
    font-weight: 700;
    color: #f5f5f0;
    line-height: 1;
    letter-spacing: -0.04em;
    transition: color 0.08s;
    user-select: none;
}

#count.flash { color: #3ddc84; }

.divider {
    width: 1px;
    height: 40px;
    background: #2a2a2a;
    margin: 2rem 0 1.8rem;
}

#incrementBtn {
    font-family: 'Space Mono', monospace;
    font-size: 0.72rem;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: #f5f5f0;
    background: transparent;
    border: 1px solid #333;
    padding: 0.85rem 2.8rem;
    cursor: pointer;
    position: relative;
    overflow: hidden;
    transition: border-color 0.15s, color 0.15s;
}

#incrementBtn::before {
    content: '';
    position: absolute;
    inset: 0;
    background: #f5f5f0;
    transform: scaleX(0);
    transform-origin: left;
    transition: transform 0.15s ease;
}

#incrementBtn:hover::before { transform: scaleX(1); }
#incrementBtn:hover { color: #0d0d0d; border-color: #f5f5f0; }
#incrementBtn:active { opacity: 0.7; }
#incrementBtn span { position: relative; }

/* Stats bar */
.stats-bar {
    display: flex;
    align-items: stretch;
    gap: 0;
    margin-top: 2.2rem;
    border: 1px solid #1e1e1e;
}

.stat-cell {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 0.85rem 2rem;
    min-width: 120px;
    position: relative;
}

.stat-cell + .stat-cell::before {
    content: '';
    position: absolute;
    left: 0;
    top: 20%;
    height: 60%;
    width: 1px;
    background: #1e1e1e;
}

.stat-label {
    font-family: 'Space Mono', monospace;
    font-size: 0.58rem;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: #444;
    margin-bottom: 0.35rem;
    white-space: nowrap;
}

.stat-value {
    font-family: 'Space Mono', monospace;
    font-size: 1.15rem;
    font-weight: 700;
    color: #f5f5f0;
    line-height: 1;
    transition: color 0.08s;
}

.stat-value.live { color: #3ddc84; }