:root {
    --bg: #f8fafc;
    --card-bg: rgba(255, 255, 255, 0.7);
    --primary: #2563eb;
    --primary-glow: rgba(37, 99, 235, 0.2);
    --secondary: #7c3aed;
    --text: #1e293b;
    --success: #10b981;
    --danger: #ef4444;
}

body {
    margin: 0;
    font-family: 'Inter', sans-serif;
    background: linear-gradient(135deg, #e2e8f0 0%, #f8fafc 100%);
    color: var(--text);
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 2rem;
}

.glass-container {
    max-width: 1000px;
    width: 100%;
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    background: rgba(255, 255, 255, 0.4);
    border: 1px solid rgba(255, 255, 255, 0.6);
    border-radius: 24px;
    padding: 2rem 3rem;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.05);
}

h1 {
    font-weight: 800;
    font-size: 2.5rem;
    margin-top: 0;
    margin-bottom: 2rem;
    text-align: center;
    letter-spacing: -1px;
}

h1 span {
    background: linear-gradient(to right, var(--primary), var(--secondary));
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.card {
    background: var(--card-bg);
    border: 1px solid rgba(255, 255, 255, 0.8);
    border-radius: 16px;
    padding: 1.5rem;
    margin-bottom: 1.5rem;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05);
}

.card:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
}

.card h2 {
    font-size: 1.25rem;
    margin-top: 0;
    margin-bottom: 0.5rem;
    font-weight: 600;
    color: #334155;
}

.subtitle {
    margin-top: 0;
    color: #64748b;
    font-size: 0.95rem;
}

.topic-box {
    background: rgba(255, 255, 255, 0.6);
    padding: 1rem;
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.8);
    font-size: 1.1rem;
    line-height: 1.6;
}

.topic-box > div { margin-bottom: 0.5rem; }
.topic-box > div:last-child { margin-bottom: 0; }

.topic-val {
    font-family: monospace;
    color: #6d28d9;
    background: rgba(255,255,255,0.8);
    padding: 0.2rem 0.5rem;
    border-radius: 4px;
    border: 1px solid #e2e8f0;
}

.split-layout {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
}

.bp-grid {
    display: flex;
    justify-content: space-around;
    align-items: center;
    margin-top: 1rem;
}

.bp-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
}

.bp-indicator {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: #e2e8f0;
    border: 2px solid #cbd5e1;
    box-shadow: inset 0 4px 6px rgba(0,0,0,0.1);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.bp-indicator.active {
    background: var(--success);
    border-color: #34d399;
    box-shadow: 0 0 20px rgba(16, 185, 129, 0.5), inset 0 0 10px rgba(255,255,255,0.5);
    transform: scale(0.95);
}

.bp-label {
    font-weight: 600;
    color: #475569;
}

.led-controls {
    display: flex;
    gap: 1rem;
    margin-top: 1rem;
}

.toggle-container {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    padding: 1rem 0;
}

.toggle-label {
    font-weight: 600;
    color: #64748b;
    font-size: 1.1rem;
    cursor: default;
}

.switch {
    position: relative;
    display: inline-block;
    width: 80px;
    height: 40px;
}
.switch input { opacity: 0; width: 0; height: 0; }

.slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #cbd5e1;
    border: 2px solid #94a3b8;
    transition: .4s;
    border-radius: 40px;
    box-shadow: inset 0 2px 4px rgba(0,0,0,0.1);
}

.slider:before {
    position: absolute;
    content: "";
    height: 30px;
    width: 30px;
    left: 3px;
    bottom: 3px;
    background-color: #ffffff;
    transition: .4s cubic-bezier(0.4, 0, 0.2, 1);
    border-radius: 50%;
    box-shadow: 0 2px 4px rgba(0,0,0,0.2);
}

input:checked + .slider {
    background-color: var(--primary);
    border-color: #60a5fa;
    box-shadow: 0 0 15px var(--primary-glow), inset 0 2px 4px rgba(0,0,0,0.1);
}

input:checked + .slider:before {
    transform: translateX(40px);
    background-color: #ffffff;
}

.led-status {
    margin-top: 1rem;
    text-align: center;
    color: #64748b;
    font-size: 0.9rem;
}

.code-block {
    background: #f1f5f9;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 1rem;
    overflow-x: auto;
    height: 280px;
}
code {
    font-family: monospace;
    white-space: pre-wrap;
    color: #6d28d9;
    font-size: 0.9rem;
}

.console-box {
    background: #ffffff;
    border-radius: 8px;
    padding: 1rem;
    height: 280px;
    overflow-y: auto;
    font-family: monospace;
    font-size: 0.85rem;
    border: 1px solid #e2e8f0;
    display: flex;
    flex-direction: column;
    gap: 0.3rem;
}

.log-entry {
    padding: 0.2rem 0.4rem;
    border-radius: 4px;
    background: #f8fafc;
    word-break: break-all;
    border: 1px solid #f1f5f9;
}

.log-entry.rx {
    color: #059669;
    border-left: 3px solid #10b981;
}

.log-entry.tx {
    color: #2563eb;
    border-left: 3px solid #3b82f6;
}

.log-entry.info {
    color: #64748b;
    font-style: italic;
}

.log-time {
    color: #94a3b8;
    margin-right: 0.5rem;
    font-size: 0.75rem;
}

@media (max-width: 768px) {
    .split-layout { grid-template-columns: 1fr; }
}
