/* =============================================
   WA-AKG Monitor — Centered Design
   ============================================= */
:root {
    --bg: #07080c;
    --surface: #0d0f16;
    --elevated: #13161f;
    --hover: #1a1e2b;

    --border: rgba(255, 255, 255, 0.07);
    --border2: rgba(255, 255, 255, 0.1);

    --text: #edf2f7;
    --text2: #7e8a9e;
    --text3: #505a6e;

    --cyan: #06b6d4;
    --emerald: #10b981;
    --rose: #f43f5e;
    --amber: #f59e0b;

    --ok: var(--emerald);
    --ok-bg: rgba(16, 185, 129, 0.12);
    --bad: var(--rose);
    --bad-bg: rgba(244, 63, 94, 0.12);
    --warn: var(--amber);
    --warn-bg: rgba(245, 158, 11, 0.12);
    --info: var(--cyan);
    --info-bg: rgba(6, 182, 212, 0.12);

    --radius: 12px;
    --radius-sm: 8px;

    --font: 'Inter', system-ui, sans-serif;
    --mono: 'JetBrains Mono', 'SF Mono', monospace;

    --ease: cubic-bezier(0.16, 1, 0.3, 1);
}

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

html {
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body {
    min-height: 100vh;
    background: var(--bg);
    color: var(--text);
    font-family: var(--font);
    font-size: 14px;
    line-height: 1.5;
    display: flex;
    justify-content: center;
    padding: 32px 16px;
}

/* Noise  */
.noise {
    position: fixed;
    inset: 0;
    z-index: 0;
    pointer-events: none;
    opacity: 0.015;
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
    background-repeat: repeat;
    background-size: 256px 256px;
}

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

/* Header */
.header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-bottom: 16px;
    border-bottom: 1px solid var(--border);
}

.brand {
    display: flex;
    align-items: center;
    gap: 10px;
}

.brand-icon {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--cyan), var(--emerald));
    border-radius: var(--radius-sm);
    color: #fff;
}

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

.brand-name {
    font-weight: 700;
    font-size: 1rem;
    letter-spacing: -0.01em;
}

.clock {
    font-family: var(--mono);
    font-size: 0.85rem;
    color: var(--text3);
    font-variant-numeric: tabular-nums;
    letter-spacing: 0.03em;
    padding: 4px 12px;
    border: 1px solid var(--border);
    border-radius: 999px;
}

/* Section */
.section {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.section-head {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.78rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--text2);
    padding-left: 2px;
}

.section-head svg {
    width: 16px;
    height: 16px;
    opacity: 0.6;
}

/* Cards */
.card {
    background: var(--elevated);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 24px;
    position: relative;
    overflow: hidden;
}

.card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    opacity: 0;
    transition: opacity 0.3s var(--ease);
}

.card:hover::before {
    opacity: 1;
}

/* Hero Card */
.card-hero {
    text-align: center;
    padding: 32px 24px;
    background: linear-gradient(135deg, rgba(6, 182, 212, 0.06), rgba(16, 185, 129, 0.06));
    border-color: rgba(6, 182, 212, 0.2);
}

.card-hero::before {
    background: linear-gradient(90deg, var(--cyan), var(--emerald));
    opacity: 1;
}

.hero-value {
    display: block;
    font-size: 3.4rem;
    font-weight: 800;
    line-height: 1;
    letter-spacing: -0.03em;
    font-variant-numeric: tabular-nums;
    background: linear-gradient(135deg, var(--cyan), var(--emerald));
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    margin-bottom: 8px;
}

.hero-label {
    display: block;
    font-size: 0.9rem;
    font-weight: 700;
    color: var(--text);
    margin-bottom: 4px;
}

.hero-desc {
    font-size: 0.78rem;
    color: var(--text3);
}

/* Session cards */
.card-row {
    display: flex;
    gap: 12px;
}

.card-row .card {
    flex: 1;
    padding: 18px 20px;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.card-ok::before {
    background: var(--emerald);
}

.card-bad::before {
    background: var(--rose);
}

.card-icon {
    width: 20px;
    height: 20px;
    margin-bottom: 6px;
}

.card-ok .card-icon {
    color: var(--emerald);
}

.card-bad .card-icon {
    color: var(--rose);
}

.card-value {
    font-size: 1.8rem;
    font-weight: 800;
    line-height: 1;
    font-variant-numeric: tabular-nums;
}

.card-ok .card-value {
    color: var(--emerald);
}

.card-bad .card-value {
    color: var(--rose);
}

.card-label {
    font-size: 0.7rem;
    font-weight: 600;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--text2);
}

/* Breakdown */
.breakdown {
    background: var(--elevated);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.bd-row {
    display: grid;
    grid-template-columns: 100px 1fr 40px;
    align-items: center;
    gap: 12px;
}

.bd-label {
    font-size: 0.72rem;
    font-weight: 600;
    color: var(--text2);
    font-family: var(--mono);
    letter-spacing: 0.02em;
}

.bd-track {
    height: 6px;
    border-radius: 999px;
    background: var(--hover);
    overflow: hidden;
}

.bd-fill {
    height: 100%;
    border-radius: 999px;
    transition: width 0.6s var(--ease);
}

.bd-ok { background: var(--emerald); }
.bd-warn { background: var(--amber); }
.bd-bad { background: var(--rose); }
.bd-muted { background: var(--text3); }

.bd-count {
    font-family: var(--mono);
    font-size: 0.82rem;
    color: var(--text2);
    text-align: right;
    font-variant-numeric: tabular-nums;
}

.total-badge {
    text-align: center;
    font-size: 0.75rem;
    color: var(--text3);
    font-weight: 600;
}

/* Footer */
.footer {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 20px;
    padding-top: 8px;
    border-top: 1px solid var(--border);
    font-size: 0.75rem;
    color: var(--text3);
}

.status-items {
    display: flex;
    align-items: center;
    gap: 6px;
}

.status-dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: var(--text3);
    transition: all 0.3s ease;
    flex-shrink: 0;
}

.status-dot.ok {
    background: var(--emerald);
    box-shadow: 0 0 6px var(--emerald);
}

.status-dot.bad {
    background: var(--rose);
    box-shadow: 0 0 6px var(--rose);
}

.footer-sync {
    font-family: var(--mono);
    font-size: 0.72rem;
    padding: 2px 10px;
    border: 1px solid var(--border);
    border-radius: 999px;
}

/* Pop animation */
@keyframes pop {
    0% { transform: scale(1); }
    40% { transform: scale(1.12); }
    100% { transform: scale(1); }
}

.pop {
    animation: pop 0.35s var(--ease);
}

/* Focus */
:focus-visible {
    outline: 2px solid var(--cyan);
    outline-offset: 2px;
}

/* Responsive */
@media (max-width: 480px) {
    body {
        padding: 20px 12px;
    }

    .card-hero {
        padding: 24px 20px;
    }

    .hero-value {
        font-size: 2.6rem;
    }

    .card-row {
        flex-direction: column;
    }

    .bd-row {
        grid-template-columns: 80px 1fr 35px;
        gap: 8px;
    }

    .footer {
        flex-wrap: wrap;
        gap: 12px;
    }
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        transition-duration: 0.01ms !important;
    }
}
