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

:root {
    --bg: #050510;
    --surface: #0a0a20;
    --card: rgba(15, 10, 30, 0.7);
    --brand: #480ca8;
    --brand-glow: rgba(72, 12, 168, 0.5);
    --brand-dim: rgba(72, 12, 168, 0.15);
    --accent: #b5179e;
    --text: #ffffff;
    --muted: #a0a0c8;
    --border: rgba(255, 255, 255, 0.05);
}

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

body {
    background: var(--bg);
    background-image:
        radial-gradient(circle at 100% 0%, rgba(72, 12, 168, 0.1) 0%, transparent 60%),
        radial-gradient(circle at 0% 100%, rgba(181, 23, 158, 0.05) 0%, transparent 40%);
    color: var(--text);
    font-family: 'Inter', system-ui, sans-serif;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    padding-bottom: 40px;
}

.header {
    width: 100%;
    padding: 32px 24px 16px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.btn-install {
    background: transparent;
    border: 1px solid var(--brand);
    color: var(--brand);
    padding: 6px 14px;
    border-radius: 30px;
    font-size: 10px;
    font-weight: 800;
    letter-spacing: 1px;
    cursor: pointer;
    box-shadow: 0 0 10px var(--brand-glow);
    transition: all 0.3s;
    text-transform: uppercase;
}

.logo {
    font-family: 'Outfit', sans-serif;
    font-size: 24px;
    font-weight: 800;
    background: linear-gradient(135deg, #fff 50%, var(--brand) 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.logo span {
    color: var(--brand);
}

.night-mode {
    font-size: 11px;
    font-weight: 700;
    color: var(--muted);
    cursor: pointer;
    background: rgba(255, 255, 255, 0.05);
    padding: 6px 14px;
    border-radius: 20px;
}

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

.sleep-tracker {
    background: var(--surface);
    border-radius: 40px;
    border: 1px solid var(--border);
    padding: 40px 24px;
    margin-top: 20px;
    text-align: center;
    position: relative;
    overflow: hidden;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.9);
}

.timer-view {
    font-family: 'Outfit', sans-serif;
    font-size: 48px;
    font-weight: 800;
    color: #fff;
    letter-spacing: -1px;
}

.moon-glow {
    width: 140px;
    height: 140px;
    background: var(--brand);
    border-radius: 50%;
    filter: blur(80px);
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    opacity: 0.3;
}

.sound-wave {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 6px;
    height: 40px;
    margin-top: 30px;
}

.bar {
    width: 4px;
    height: 5px;
    background: var(--brand);
    border-radius: 4px;
    box-shadow: 0 0 10px var(--brand);
    transition: height 0.1s ease;
}

.bar.animating {
    animation: pulseWave 1s infinite alternate ease-in-out;
}

@keyframes pulseWave {
    0% {
        height: 10px;
        opacity: 0.3;
    }

    100% {
        height: 35px;
        opacity: 1;
    }
}

.status-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    margin-top: 24px;
}

.s-card {
    background: var(--card);
    border: 1px solid var(--border);
    padding: 16px;
    border-radius: 20px;
    text-align: center;
}

.s-label {
    font-size: 10px;
    color: var(--muted);
    font-weight: 700;
    margin-bottom: 4px;
    display: block;
}

.s-val {
    font-size: 16px;
    font-weight: 800;
    color: var(--accent);
}

.controls {
    margin-top: 32px;
    text-align: center;
}

.btn-sleep {
    width: 100%;
    padding: 22px;
    border-radius: 24px;
    border: none;
    background: linear-gradient(135deg, var(--brand) 0%, var(--accent) 100%);
    color: #fff;
    font-family: 'Outfit', sans-serif;
    font-size: 18px;
    font-weight: 800;
    cursor: pointer;
    box-shadow: 0 10px 30px rgba(72, 12, 168, 0.4);
}

.btn-stop {
    width: 100%;
    padding: 18px;
    border-radius: 20px;
    border: 2px solid var(--accent);
    background: transparent;
    color: var(--accent);
    font-weight: 800;
    cursor: pointer;
}

.hint {
    font-size: 12px;
    color: var(--muted);
    margin-top: 16px;
    line-height: 1.5;
    padding: 0 20px;
}

.sound-controls {
    margin: 20px 0;
    display: flex;
    justify-content: center;
}

.sound-toggle {
    background: var(--brand-dim);
    border: 1px solid var(--brand);
    color: var(--brand);
    padding: 12px 24px;
    border-radius: 30px;
    font-weight: 700;
    font-size: 11px;
    cursor: pointer;
    transition: all 0.3s;
    display: flex;
    align-items: center;
    gap: 8px;
}

.sound-toggle.active {
    background: var(--brand);
    color: #fff;
    box-shadow: 0 0 15px var(--brand-glow);
}

.premium-close {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: #fff;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    cursor: pointer;
    transition: all 0.3s;
}

.premium-close:active {
    transform: scale(0.9);
    background: var(--brand);
}

/* NIGHT OVERLAY */
.night-overlay {
    position: fixed;
    inset: 0;
    background: #000;
    z-index: 2000;
    display: none;
    align-items: center;
    justify-content: center;
    text-align: center;
}

.night-overlay.active {
    display: flex;
}

.night-overlay p {
    font-size: 14px;
    color: #1a1a1a;
    letter-spacing: 0.5px;
    opacity: 0.5;
}

/* RESULT MODAL */
.result-panel {
    position: fixed;
    bottom: -100%;
    left: 0;
    width: 100%;
    height: 85vh;
    background: linear-gradient(180deg, #101030 0%, #050510 100%);
    border-top: 2px solid var(--brand);
    border-radius: 32px 32px 0 0;
    z-index: 1000;
    transition: bottom 0.5s cubic-bezier(0.19, 1, 0.22, 1);
    display: flex;
    flex-direction: column;
}

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

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

.nu-chip {
    padding: 6px 14px;
    background: var(--brand-dim);
    color: var(--brand);
    font-size: 11px;
    font-weight: 700;
    border-radius: 30px;
}

.panel-body {
    flex: 1;
    overflow-y: auto;
    padding: 24px;
}

.btn-main {
    width: 100%;
    padding: 18px;
    border-radius: 20px;
    border: 1px solid var(--brand);
    background: var(--brand-dim);
    color: var(--brand);
    font-weight: 800;
}