:root { 
    --billy-orange: #F5A623; 
    --billy-dark: #333; 
    --billy-blue: #008080; 
    --bg-light: #f9f9f9; 
    --slate-200: #e2e8f0;
    --slate-500: #64748b;
    --slate-800: #1e293b;
}

#billy-notes-wrapper {
    font-family: 'Segoe UI', 'Microsoft JhengHei', sans-serif;
    -webkit-font-smoothing: antialiased;
    color: #333; 
}

.note-card { 
    background: var(--bg-light); 
    border-radius: 12px; 
    padding: 0; 
    margin: 20px 0; 
    box-shadow: 0 4px 15px rgba(0,0,0,0.05); 
    border-top: 4px solid var(--billy-blue); 
    overflow: hidden;
}

.card-header {
    padding: 20px 25px;
    border-bottom: 1px solid var(--slate-200);
    background: #fff;
}

.hud-display {
    text-align: center;
    width: 100%;
    padding: 15px;
    background: var(--bg-light);
    border-radius: 8px;
    border: 1px solid var(--slate-200);
    position: relative;
    overflow: hidden;
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 10px;
}
.hud-display::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0; height: 4px;
    background: linear-gradient(90deg, var(--billy-blue), var(--billy-orange));
}
.hud-label {
    font-size: 0.75rem; 
    font-weight: bold; 
    color: var(--slate-500); 
    text-transform: uppercase; 
    margin-bottom: 5px;
}
.hud-label span { font-weight: normal; }
.hud-val {
    font-size: 1.5rem;
    font-family: monospace;
    font-weight: bold;
    color: var(--slate-800);
    line-height: 1.1;
}

.diagram-container {
    position: relative;
    width: 100%;
    background: #000;
    border-bottom: 1px solid var(--slate-200);
    padding: 20px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

canvas {
    image-rendering: pixelated;
    max-width: 100%;
    height: auto;
    border-radius: 8px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.5);
    aspect-ratio: 1 / 1;
}

.legend-bar {
    height: 12px;
    width: 100%;
    border-radius: 6px;
    margin-top: 8px;
    border: 1px solid rgba(255,255,255,0.2);
    background: linear-gradient(to right, #000000, #960064, #ff7800, #ffffc8);
}

.controls {
    padding: 25px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 15px;
    background: #fff;
}

.btn-primary {
    background: var(--billy-blue);
    color: white;
    padding: 10px 20px;
    border-radius: 8px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.2s;
    border: none;
    display: flex;
    align-items: center;
    gap: 8px;
}
.btn-primary:hover:not(:disabled) { background: #006666; transform: translateY(-2px); }
.btn-primary:disabled { opacity: 0.5; cursor: not-allowed; }

.btn-toggle {
    flex: 1;
    padding: 10px;
    text-align: center;
    font-weight: bold;
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.2s;
}
.btn-toggle.active { background: var(--billy-blue); color: white; }
.btn-toggle.inactive { background: var(--slate-200); color: var(--slate-500); }

.sliders-wrapper {
    padding: 25px;
    background: #fff;
    display: grid;
    grid-template-columns: 1fr;
    gap: 20px;
}
@media (min-width: 640px) {
    .sliders-wrapper { grid-template-columns: 1fr 1fr; }
}
.slider-group { display: flex; flex-direction: column; gap: 8px; }
.slider-header {
    display: flex; justify-content: space-between; align-items: center;
    font-weight: bold; font-size: 0.9rem; color: var(--slate-800);
}
.val-badge {
    background: var(--bg-light); border: 1px solid var(--slate-200);
    padding: 2px 6px; border-radius: 4px; font-family: monospace;
    font-size: 0.85rem; color: var(--billy-blue);
}

input[type=range] { -webkit-appearance: none; width: 100%; background: transparent; }
input[type=range]::-webkit-slider-thumb {
    -webkit-appearance: none; height: 18px; width: 18px; border-radius: 50%;
    background: var(--billy-blue); cursor: pointer; margin-top: -6px; 
    box-shadow: 0 2px 4px rgba(0,0,0,0.2); border: 2px solid white;
}
input[type=range]::-webkit-slider-runnable-track {
    width: 100%; height: 6px; cursor: pointer; background: var(--slate-200); border-radius: 3px;
}