:root {
    --bg: #050505;
    --border: rgba(255, 255, 255, 0.06);
    --text-primary: #e4e4e7;
    --text-muted: #71717a;
    --accent: #10b981;
    --accent-glow: rgba(16, 185, 129, 0.4);
    --fallback-orange: #f59e0b;
    --font-mono: 'Geist', system-ui, mono-serif;
    --font-mono: 'Geist Mono', monospace;
    
    --surface: rgba(9, 9, 11, 0.08); 
    --surface-card: rgba(24, 24, 27, 0.1);
    --panel-blur: blur(4px);
}

* { 
    box-sizing: border-box; 
    margin: 0; 
    padding: 0; 
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
}

body { 
    background-color: var(--bg); 
    color: var(--text-primary); 
    font-family: var(--font-mono); 
    overflow-y: auto; 
    overflow-x: hidden; 
    line-height: 1.5; 
    -webkit-font-smoothing: antialiased; 
}

canvas { 
    position: fixed; 
    top: 0; 
    left: 0; 
    z-index: 0; 
    pointer-events: auto; 
    width: 100vw;
    height: 100vh;
}

.layout-grid { 
    position: relative; 
    z-index: 10; 
    display: flex; 
    flex-direction: column; 
    align-items: center; 
    justify-content: flex-start; 
    min-height: 100dvh; 
    padding: 1rem; 
    pointer-events: none; 
}

.glass-panel { 
    background: var(--surface); 
    backdrop-filter: var(--panel-blur); 
    -webkit-backdrop-filter: var(--panel-blur); 
    border: 1px solid var(--border); 
    border-radius: 1rem; 
    width: 100%; 
    max-width: 52rem; 
    pointer-events: auto; 
    overflow: hidden; 
    box-shadow: 0 10px 30px -10px rgba(0,0,0,0.5); 
    margin-top: auto;
}

.header { padding: 1.25rem; border-bottom: 1px solid var(--border); display: flex; flex-direction: column; align-items: flex-start; gap: 0.5rem; }
.status-badge { display: inline-flex; align-items: center; gap: 0.5rem; font-size: 0.625rem; color: var(--accent); font-weight: 500; letter-spacing: 0.1em; text-transform: uppercase; transition: color 0.4s ease; white-space: nowrap; }
.pulse-dot { position: relative; display: flex; width: 0.5rem; height: 0.5rem; flex-shrink: 0; }
.pulse-dot::before { content: ''; position: absolute; width: 100%; height: 100%; border-radius: 50%; background: var(--accent); opacity: 0.75; animation: pulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite; transition: background-color 0.4s ease; }
.pulse-dot::after { content: ''; position: relative; width: 100%; height: 100%; border-radius: 50%; background: var(--accent); transition: background-color 0.4s ease; }

.status-badge.is-fallback { color: var(--fallback-orange); }
.status-badge.is-fallback .pulse-dot::before, .status-badge.is-fallback .pulse-dot::after { background: var(--fallback-orange); }

@keyframes pulse { 0% { transform: scale(1); opacity: 1; } 100% { transform: scale(2.5); opacity: 0; } }

.title { font-size: 1.125rem; font-weight: 500; color: #fff; letter-spacing: -0.025em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; width: 100%; }
.subtitle { font-size: 0.65rem; color: var(--text-muted); font-family: var(--font-mono); margin-top: 0.125rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; width: 100%; }
.uptime-block { display: flex; flex-direction: column; align-items: flex-start; gap: 0.125rem; margin-top: 0.5rem; }
.uptime-label { font-size: 0.625rem; color: var(--text-muted); font-family: var(--font-mono); letter-spacing: 0.1em; text-transform: uppercase; white-space: nowrap; }
.uptime-val { font-size: 0.875rem; color: #d4d4d8; font-family: var(--font-mono); white-space: nowrap; }

.metrics-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0.5rem; padding: 0.75rem 1rem 1rem 1rem; }

.metric-card { background: var(--surface-card); border: 1px solid var(--border); border-radius: 0.5rem; padding: 0.75rem; transition: background 0.3s ease; min-width: 0; }
.metric-label { font-size: 0.55rem; color: var(--text-muted); font-family: var(--font-mono); letter-spacing: 0.05em; margin-bottom: 0.25rem; text-transform: uppercase; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.metric-value { font-size: 1.125rem; font-weight: 500; color: #f4f4f5; display: flex; align-items: baseline; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.metric-accent { color: var(--accent); }
.metric-unit { font-size: 0.65rem; color: var(--text-muted); font-family: var(--font-mono); margin-left: 0.2rem; font-weight: 400; }

.metric-split { font-size: 0.875rem; display: flex; flex-direction: column; gap: 0.125rem; align-items: flex-start; white-space: nowrap; }
.metric-divider { width: 100%; height: 1px; background: var(--border); margin: 0.125rem 0; }
.text-white { color: #fff; }
.text-muted { color: #a1a1aa; }

.services { background: transparent; border-top: 1px solid var(--border); padding: 1rem; }
.services-title { font-size: 0.625rem; font-weight: 500; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.1em; margin-bottom: 0.75rem; white-space: nowrap; }
.service-list { list-style: none; display: flex; flex-direction: column; gap: 0.5rem; font-size: 0.75rem; }
.service-item { display: flex; flex-direction: row; justify-content: space-between; align-items: center; color: #d4d4d8; cursor: default; gap: 0.5rem; }

.service-item-left { display: flex; align-items: center; gap: 0.5rem; min-width: 0; flex: 1; }
.service-item-left-inner { display: flex; align-items: center; gap: 0.5rem; min-width: 0; flex: 1; }
.service-dot { width: 0.375rem; height: 0.375rem; border-radius: 50%; background: var(--accent); flex-shrink: 0; }
.service-item-left-inner span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.service-id { font-size: 0.55rem; font-family: var(--font-mono); color: var(--text-muted); border: 1px solid var(--border); padding: 0.125rem 0.25rem; border-radius: 0.25rem; background: rgba(24, 24, 27, 0.3); flex-shrink: 0; }
.service-ping { font-size: 0.65rem; font-family: var(--font-mono); color: rgba(52, 211, 153, 0.7); flex-shrink: 0; margin-left: 0.5rem; }

.footer-wrapper { 
    position: relative; 
    width: 100%; 
    padding: 1.5rem 0; 
    pointer-events: auto; 
    margin-top: auto; 
}
.footer { display: flex; flex-direction: row; justify-content: space-between; align-items: center; max-width: 52rem; margin: 0 auto; padding: 0 1rem; font-size: 0.625rem; font-family: var(--font-mono); color: #52525b; letter-spacing: 0.1em; text-transform: uppercase; width: 100%; }
.hash-meta { opacity: 0.4; text-transform: none; white-space: nowrap; }

@media (min-width: 641px) {
    :root {
        --surface: rgba(9, 9, 11, 0.65);
        --surface-card: rgba(24, 24, 27, 0.4);
        --panel-blur: blur(16px);
    }
    
    .layout-grid { padding: 2rem; }
    .glass-panel { box-shadow: 0 25px 50px -12px rgba(0,0,0,0.7); margin-bottom: 0; }
    
    .header { flex-direction: row; align-items: flex-end; justify-content: space-between; padding: 2rem; }
    .status-badge { margin-bottom: 0.5rem; font-size: 0.6875rem; }
    .uptime-block { align-items: flex-end; margin-top: 0; }
    .uptime-label { text-align: right; font-size: 0.75rem; }
    .uptime-val { font-size: 1.125rem; }
    .title { font-size: 1.5rem; }
    .subtitle { font-size: 0.75rem; }
    
    .metrics-grid { grid-template-columns: repeat(2, 1fr); padding: 0 2rem 2rem 2rem; gap: 1rem; }
    .metric-card { padding: 1rem; }
    .metric-label { font-size: 0.625rem; margin-bottom: 0.35rem; }
    .metric-value { font-size: 1.5rem; }
    .metric-split { font-size: 1.125rem; }
    .metric-unit { font-size: 0.75rem; }
    
    .services { padding: 1.25rem 2rem; }
    .services-title { font-size: 0.6875rem; margin-bottom: 1rem; }
    .service-list { font-size: 0.875rem; gap: 0.75rem; }
    .service-id { font-size: 0.625rem; padding: 0.125rem 0.375rem; }
    .service-ping { font-size: 0.75rem; }
    
    .footer-wrapper { padding: 2rem 0; }
    .footer { font-size: 0.6875rem; padding: 0 2rem; }
}

@media (min-width: 1025px) {
    .metrics-grid { grid-template-columns: repeat(4, 1fr); }
}
