:root {
    --bg: #1a1a2e;
    --bg2: #16213e;
    --fg: #e0e0e0;
    --accent: #0f3460;
    --highlight: #00d2ff;
    --green: #00e676;
    --red: #ff5252;
    --orange: #ffab40;
    --yellow: #ffd740;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

body {
    background: var(--bg);
    color: var(--fg);
    font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

header {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 20px;
    background: var(--bg2);
    border-bottom: 1px solid #2a2a4a;
}

header h1 {
    font-size: 1.2rem;
    font-weight: 600;
    color: var(--highlight);
}

.dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    display: inline-block;
}

.dot.connected { background: var(--green); box-shadow: 0 0 6px var(--green); }
.dot.disconnected { background: var(--red); }

#status-text {
    font-size: 0.85rem;
    opacity: 0.7;
}

main {
    flex: 1;
    display: flex;
    flex-direction: column;
    padding: 16px 20px;
    gap: 16px;
}

#waterfall-section {
    position: relative;
    border: 1px solid #2a2a4a;
    border-radius: 6px;
    overflow: hidden;
    background: #000;
}

#waterfall {
    display: block;
    width: 100%;
    height: 300px;
}

#reconnect-banner {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(255, 82, 82, 0.85);
    color: #fff;
    padding: 10px 24px;
    border-radius: 4px;
    font-weight: 600;
    font-size: 0.95rem;
}

.hidden { display: none !important; }

#info-bar {
    display: flex;
    gap: 16px;
    flex-wrap: wrap;
}

.info-item {
    background: var(--bg2);
    border: 1px solid #2a2a4a;
    border-radius: 6px;
    padding: 12px 16px;
    flex: 1;
    min-width: 140px;
}

.info-item .label {
    display: block;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    opacity: 0.5;
    margin-bottom: 4px;
}

.info-item .value {
    display: block;
    font-size: 1.4rem;
    font-family: 'Consolas', 'Fira Mono', monospace;
    font-weight: 700;
    color: var(--highlight);
}

#freq-display .value {
    font-size: 1.8rem;
}

#tx-display .value {
    color: var(--green);
}

#tx-display .value.tx-active {
    color: var(--red);
    animation: pulse 0.5s ease-in-out infinite alternate;
}

@keyframes pulse {
    from { opacity: 1; }
    to { opacity: 0.4; }
}

.smeter-bar {
    position: relative;
    height: 24px;
    background: #0a0a1a;
    border-radius: 3px;
    overflow: hidden;
    margin-top: 4px;
}

.smeter-fill {
    height: 100%;
    width: 0%;
    background: linear-gradient(90deg, var(--green) 0%, var(--yellow) 50%, var(--orange) 75%, var(--red) 100%);
    transition: width 0.15s ease-out;
}

.smeter-text {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-family: 'Consolas', monospace;
    font-size: 0.8rem;
    font-weight: 700;
    text-shadow: 0 0 4px #000;
}

#controls {
    display: flex;
    align-items: center;
    gap: 16px;
}

.btn-primary {
    background: var(--accent);
    color: var(--fg);
    border: 1px solid var(--highlight);
    border-radius: 6px;
    padding: 10px 24px;
    font-size: 1rem;
    cursor: pointer;
    transition: background 0.2s;
}

.btn-primary:hover { background: #1a4a80; }
.btn-primary.active { background: #0a6040; border-color: var(--green); }

#volume-control {
    display: flex;
    align-items: center;
    gap: 8px;
}

#volume-control label {
    font-size: 0.85rem;
    opacity: 0.7;
}

#volume {
    width: 150px;
    accent-color: var(--highlight);
}

footer {
    padding: 8px 20px;
    text-align: center;
    font-size: 0.75rem;
    opacity: 0.4;
    border-top: 1px solid #2a2a4a;
}
