:root {
    --bg-primary: #0a0c16;
    --bg-card: rgba(18, 22, 38, 0.65);
    --border-card: rgba(255, 255, 255, 0.08);
    --border-glow: rgba(99, 102, 241, 0.3);
    
    --text-primary: #f8fafc;
    --text-secondary: #94a3b8;
    --text-muted: #64748b;
    
    --accent-indigo: #6366f1;
    --accent-violet: #8b5cf6;
    --accent-cyan: #06b6d4;
    --accent-emerald: #10b981;
    --accent-rose: #f43f5e;
    
    --btn-primary-bg: linear-gradient(135deg, #6366f1 0%, #4f46e5 100%);
    --btn-primary-hover: linear-gradient(135deg, #4f46e5 0%, #4338ca 100%);
    
    --font-main: 'Outfit', -apple-system, BlinkMacSystemFont, sans-serif;
    --font-mono: 'JetBrains Mono', monospace;
}

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

body {
    font-family: var(--font-main);
    background-color: var(--bg-primary);
    color: var(--text-primary);
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    overflow-x: hidden;
    position: relative;
}

/* Background Animated Blobs */
.background-globes {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: 0;
    pointer-events: none;
    overflow: hidden;
}

.globe {
    position: absolute;
    border-radius: 50%;
    filter: blur(90px);
    opacity: 0.35;
    animation: float 18s ease-in-out infinite alternate;
}

.globe-1 {
    top: -10%;
    left: -10%;
    width: 45vw;
    height: 45vw;
    background: radial-gradient(circle, var(--accent-indigo), var(--accent-violet));
}

.globe-2 {
    bottom: -15%;
    right: -10%;
    width: 50vw;
    height: 50vw;
    background: radial-gradient(circle, var(--accent-cyan), var(--accent-indigo));
    animation-delay: -6s;
}

.globe-3 {
    top: 40%;
    left: 60%;
    width: 30vw;
    height: 30vw;
    background: radial-gradient(circle, var(--accent-violet), var(--accent-rose));
    animation-delay: -12s;
}

@keyframes float {
    0% { transform: translate(0, 0) scale(1); }
    50% { transform: translate(40px, -60px) scale(1.1); }
    100% { transform: translate(-30px, 40px) scale(0.95); }
}

/* Container */
.app-container {
    position: relative;
    z-index: 1;
    width: 100%;
    max-width: 480px;
    padding: 24px 16px;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

/* Header */
.app-header {
    text-align: center;
}

.badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 6px 14px;
    background: rgba(99, 102, 241, 0.12);
    border: 1px solid rgba(99, 102, 241, 0.25);
    border-radius: 999px;
    font-size: 0.8rem;
    font-weight: 600;
    color: #a5b4fc;
    margin-bottom: 12px;
    letter-spacing: 0.5px;
    text-transform: uppercase;
}

.badge-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background-color: var(--accent-emerald);
    box-shadow: 0 0 10px var(--accent-emerald);
}

.app-header h1 {
    font-size: 2.2rem;
    font-weight: 800;
    letter-spacing: -0.5px;
    background: linear-gradient(135deg, #ffffff 0%, #cbd5e1 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.subtitle {
    font-size: 0.95rem;
    color: var(--text-secondary);
    margin-top: 4px;
}

/* Glass Card */
.glass-card {
    background: var(--bg-card);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid var(--border-card);
    border-radius: 24px;
    padding: 28px;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.4),
                inset 0 1px 0 rgba(255, 255, 255, 0.1);
}

/* Status Bar */
.status-bar {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 8px 16px;
    border-radius: 12px;
    background: rgba(15, 23, 42, 0.6);
    border: 1px solid rgba(255, 255, 255, 0.05);
    font-size: 0.85rem;
    margin-bottom: 24px;
}

.status-indicator {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    transition: all 0.3s ease;
}

.status-indicator.online {
    background-color: var(--accent-emerald);
    box-shadow: 0 0 12px var(--accent-emerald);
}

.status-indicator.offline {
    background-color: var(--accent-rose);
    box-shadow: 0 0 12px var(--accent-rose);
}

.status-indicator.loading {
    background-color: #f59e0b;
    box-shadow: 0 0 12px #f59e0b;
    animation: pulse 1.5s infinite;
}

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

.status-text {
    color: var(--text-secondary);
}

/* Counter Display */
.counter-wrapper {
    text-align: center;
    margin: 20px 0 32px 0;
}

.counter-display {
    font-family: var(--font-mono);
    font-size: 5rem;
    font-weight: 700;
    line-height: 1;
    background: linear-gradient(135deg, #ffffff 30%, #94a3b8 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    transition: transform 0.15s ease, filter 0.15s ease;
    user-select: none;
}

.counter-display.bump-up {
    transform: scale(1.1);
    filter: drop-shadow(0 0 15px rgba(99, 102, 241, 0.6));
}

.counter-display.bump-down {
    transform: scale(0.92);
    filter: drop-shadow(0 0 15px rgba(244, 63, 94, 0.6));
}

.counter-label {
    font-size: 0.85rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 1.5px;
    margin-top: 12px;
    font-weight: 600;
}

/* Buttons Controls Grid */
.controls-grid {
    display: grid;
    grid-template-columns: 1fr 2fr 2fr 1fr;
    gap: 10px;
    margin-bottom: 20px;
}

.btn {
    font-family: var(--font-main);
    font-weight: 600;
    border: none;
    border-radius: 16px;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    user-select: none;
    padding: 14px 16px;
    font-size: 1rem;
}

.btn:active {
    transform: scale(0.96);
}

.btn-primary {
    background: var(--btn-primary-bg);
    color: #ffffff;
    box-shadow: 0 8px 20px rgba(99, 102, 241, 0.35);
}

.btn-primary:hover {
    background: var(--btn-primary-hover);
    box-shadow: 0 12px 25px rgba(99, 102, 241, 0.5);
    transform: translateY(-2px);
}

.btn-dec {
    background: linear-gradient(135deg, #334155 0%, #1e293b 100%);
    border: 1px solid rgba(255, 255, 255, 0.08);
}

.btn-dec:hover {
    background: linear-gradient(135deg, #475569 0%, #334155 100%);
    border-color: rgba(255, 255, 255, 0.15);
    transform: translateY(-2px);
}

.btn-secondary {
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-secondary);
    border: 1px solid var(--border-card);
    font-family: var(--font-mono);
    font-size: 0.9rem;
}

.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.1);
    color: var(--text-primary);
    border-color: rgba(255, 255, 255, 0.2);
}

.btn-icon {
    font-size: 1.2rem;
    font-weight: 700;
    line-height: 1;
}

/* Secondary Actions */
.secondary-actions {
    display: flex;
    justify-content: center;
}

.btn-outline {
    background: transparent;
    color: var(--text-muted);
    border: 1px dashed rgba(255, 255, 255, 0.15);
    width: 100%;
    padding: 12px;
    font-size: 0.9rem;
    border-radius: 14px;
}

.btn-outline:hover {
    color: var(--accent-rose);
    border-color: rgba(244, 63, 94, 0.4);
    background: rgba(244, 63, 94, 0.08);
}

.svg-icon {
    width: 18px;
    height: 18px;
}

/* Footer Card */
.app-footer {
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding: 16px 20px;
    font-size: 0.85rem;
}

.info-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.info-label {
    color: var(--text-muted);
}

.info-value {
    color: var(--text-secondary);
    font-family: var(--font-mono);
}

.info-value.highlight {
    color: #a5b4fc;
}

/* Responsive adjustment */
@media (max-width: 420px) {
    .controls-grid {
        grid-template-columns: 1fr 1fr;
    }
}
