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

:root {
    --bg: #0a0a05;
    --surface: #121212;
    --card: rgba(30, 30, 35, 0.9);
    --brand: #ff5f00;
    --brand-glow: rgba(255, 95, 0, 0.3);
    --brand-dim: rgba(255, 95, 0, 0.1);
    --accent: #ff0054;
    --text: #ffffff;
    --muted: #a0a090;
    --border: rgba(255, 255, 255, 0.08);
}

* {
    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(255, 95, 0, 0.05) 0%, transparent 50%),
        radial-gradient(circle at 0% 100%, rgba(255, 0, 84, 0.04) 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);
}

.status-dot {
    width: 8px;
    height: 8px;
    background: var(--brand);
    border-radius: 50%;
    box-shadow: 0 0 10px var(--brand);
    margin-right: 8px;
}

.live-label {
    font-size: 10px;
    font-weight: 700;
    color: var(--brand);
    letter-spacing: 1px;
}

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

.mode-tabs {
    display: flex;
    gap: 10px;
    margin-bottom: 24px;
    background: rgba(255, 255, 255, 0.03);
    padding: 6px;
    border-radius: 16px;
}

.tab-btn {
    flex: 1;
    padding: 12px;
    border-radius: 12px;
    border: none;
    background: transparent;
    color: var(--muted);
    font-weight: 700;
    font-size: 13px;
    cursor: pointer;
    transition: all 0.3s;
}

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

.motion-view {
    background: var(--surface);
    border-radius: 32px;
    border: 1px solid var(--border);
    padding: 32px 24px;
    text-align: center;
    position: relative;
    overflow: hidden;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.7);
}

.timer-overlay {
    position: absolute;
    top: 20px;
    right: 24px;
    font-family: 'Space Mono', monospace;
    color: var(--brand);
    font-weight: 700;
    font-size: 14px;
}

.gauge-container {
    position: relative;
    width: 220px;
    height: 220px;
    margin: 0 auto;
}

#gaugeCanvas {
    width: 100%;
    height: 100%;
}

.main-metric {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
}

.m-big {
    font-family: 'Outfit', sans-serif;
    font-size: 56px;
    font-weight: 900;
    color: #fff;
    line-height: 1;
}

.m-unit {
    font-size: 12px;
    font-weight: 700;
    color: var(--brand);
    display: block;
    margin-top: 4px;
}

.sub-label {
    font-size: 11px;
    color: var(--muted);
    margin-top: 10px;
    text-transform: uppercase;
    letter-spacing: 2px;
}

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

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

.b-label {
    font-size: 9px;
    color: var(--muted);
    font-weight: 700;
    display: block;
    margin-bottom: 4px;
    text-transform: uppercase;
}

.b-val {
    font-family: 'Space Mono', monospace;
    font-size: 16px;
    font-weight: 800;
    color: var(--brand);
}

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

.btn-start {
    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(255, 95, 0, 0.4);
}

.btn-start.active {
    background: #1a1a1a;
    border: 1px solid var(--brand);
}

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

/* RESULT PANEL */
.result-panel {
    position: fixed;
    bottom: -100%;
    left: 0;
    width: 100%;
    height: 85vh;
    background: linear-gradient(180deg, #181820 0%, #0a0a05 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;
}

.panel-footer {
    padding: 24px;
    border-top: 1px solid var(--border);
}

.close-btn {
    background: var(--brand-dim);
    border: 1px solid var(--brand-glow);
    color: var(--brand);
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 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;
}