@import url('https://fonts.googleapis.com/css2?family=Montserrat:wght@400;700;900&family=Outfit:wght@500;700;800&display=swap');

:root {
    --bg: #030712;
    --surface: #0a1120;
    --card: rgba(16, 24, 40, 0.6);
    --brand: #00d2ff;
    --brand-glow: rgba(0, 210, 255, 0.4);
    --brand-dim: rgba(0, 210, 255, 0.08);
    --accent: #ff4d4d;
    --text: #f8fafc;
    --muted: #94a3b8;
    --border: rgba(0, 210, 255, 0.15);
    --glass: blur(12px);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
}

body {
    background: var(--bg);
    background-image:
        radial-gradient(circle at 0% 0%, rgba(0, 210, 255, 0.08) 0%, transparent 40%),
        radial-gradient(circle at 100% 100%, rgba(0, 119, 255, 0.05) 0%, transparent 40%);
    color: var(--text);
    font-family: 'Montserrat', system-ui, sans-serif;
    min-height: 100vh;
    padding-bottom: 40px;
    overflow-x: hidden;
}

.header {
    padding: 40px 24px 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.logo {
    font-family: 'Outfit', sans-serif;
    font-size: 22px;
    font-weight: 800;
    letter-spacing: -0.5px;
    color: #fff;
}

.logo span {
    color: var(--brand);
    text-shadow: 0 0 10px var(--brand-glow);
}

.btn-install {
    background: var(--brand-dim);
    border: 1px solid var(--brand);
    color: var(--brand);
    padding: 8px 16px;
    border-radius: 30px;
    font-size: 10px;
    font-weight: 800;
    cursor: pointer;
    box-shadow: 0 0 15px var(--brand-dim);
}

.app-container {
    width: 100%;
    max-width: 440px;
    margin: 0 auto;
    padding: 0 24px;
}

.stats-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
    margin-bottom: 24px;
}

.s-card {
    background: var(--card);
    backdrop-filter: var(--glass);
    padding: 20px;
    border-radius: 24px;
    border: 1px solid var(--border);
    text-align: center;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
}

.s-label {
    font-size: 10px;
    color: var(--muted);
    font-weight: 800;
    display: block;
    margin-bottom: 6px;
    letter-spacing: 1px;
}

.s-val {
    font-size: 20px;
    font-weight: 800;
    color: #fff;
    font-family: 'Outfit', sans-serif;
}

.pulmo-visualizer {
    background: linear-gradient(180deg, #050a14 0%, #0a1120 100%);
    border-radius: 40px;
    border: 1px solid var(--border);
    height: 360px;
    position: relative;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    box-shadow: 0 30px 60px rgba(0, 0, 0, 0.6);
}

.ball-container {
    flex: 1;
    position: relative;
    display: flex;
    align-items: flex-end;
    justify-content: center;
    padding-bottom: 50px;
}

.rehab-ball {
    width: 54px;
    height: 54px;
    background: radial-gradient(circle at 30% 30%, #4ddbff, #0077ff);
    border-radius: 50%;
    box-shadow:
        0 15px 30px rgba(0, 0, 0, 0.5),
        inset -5px -5px 15px rgba(0, 0, 0, 0.4),
        inset 10px 10px 20px rgba(255, 255, 255, 0.3);
    position: absolute;
    bottom: 40px;
    left: 50%;
    transform: translateX(-50%);
    transition: bottom 0.1s linear;
    z-index: 2;
}

.rehab-ball::before {
    content: '';
    position: absolute;
    inset: -10px;
    background: var(--brand-glow);
    border-radius: 50%;
    filter: blur(15px);
    opacity: 0.3;
    z-index: -1;
}

.target-zone {
    position: absolute;
    top: 60px;
    left: 50%;
    transform: translateX(-50%);
    width: 74px;
    height: 74px;
    border: 2px dashed var(--brand);
    border-radius: 50%;
    opacity: 0.2;
    animation: pulseTarget 2s infinite ease-in-out;
}

@keyframes pulseTarget {

    0%,
    100% {
        opacity: 0.1;
        transform: translateX(-50%) scale(1);
    }

    50% {
        opacity: 0.4;
        transform: translateX(-50%) scale(1.1);
    }
}

#wavesVisualizer {
    background: rgba(0, 0, 0, 0.3);
}

.controls {
    margin-top: 32px;
}

.btn-scan {
    width: 100%;
    padding: 24px;
    border-radius: 28px;
    border: none;
    background: linear-gradient(135deg, #00d2ff 0%, #0077ff 100%);
    color: #fff;
    font-family: 'Outfit', sans-serif;
    font-size: 17px;
    font-weight: 800;
    cursor: pointer;
    box-shadow: 0 15px 35px rgba(0, 210, 255, 0.3);
    transition: all 0.3s;
}

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

.hint {
    font-size: 12px;
    color: var(--muted);
    margin-top: 20px;
    text-align: center;
    line-height: 1.6;
    padding: 0 20px;
}

/* MODAL PREMIUM */
.result-panel {
    position: fixed;
    bottom: -100%;
    left: 0;
    width: 100%;
    height: 85vh;
    background: #0a0f1d;
    border-top: 4px solid var(--brand);
    border-radius: 40px 40px 0 0;
    z-index: 1000;
    transition: bottom 0.6s cubic-bezier(0.16, 1, 0.3, 1);
    display: flex;
    flex-direction: column;
    box-shadow: 0 -20px 50px rgba(0, 0, 0, 0.8);
}

.result-panel.visible {
    bottom: 0;
}

.panel-header {
    padding: 30px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.nu-chip {
    padding: 8px 16px;
    background: var(--brand-dim);
    color: var(--brand);
    font-size: 12px;
    font-weight: 800;
    border-radius: 30px;
    border: 1px solid var(--border);
}

.panel-body {
    flex: 1;
    overflow-y: auto;
    padding: 0 30px 40px;
}

.res-text h3 {
    color: var(--brand);
    margin-bottom: 16px;
    font-size: 20px;
}

.res-text p {
    margin-bottom: 14px;
    color: #cbd5e1;
    line-height: 1.6;
    font-size: 15px;
}

.res-text ul {
    padding-left: 20px;
    margin-bottom: 20px;
    color: #94a3b8;
}

.panel-footer {
    padding: 30px;
    background: rgba(0, 0, 0, 0.2);
}

.btn-main {
    width: 100%;
    padding: 20px;
    border-radius: 24px;
    border: 1px solid var(--brand);
    background: var(--brand-dim);
    color: var(--brand);
    font-weight: 800;
    font-family: 'Outfit', sans-serif;
    cursor: pointer;
}

.close-btn {
    background: rgba(255, 255, 255, 0.05);
    border: none;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    color: #fff;
    font-size: 24px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}