/* The live Arduino board on /code Arduino lessons (code-arduino.mjs). */
.ca-board { margin: .75rem 0; border-radius: 1rem; border: 1px solid rgba(45, 212, 191, .35); background: #0b2530; padding: .75rem; color: #e2e8f0; }
.ca-head { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem; }
.ca-chip { font-weight: 700; font-size: .8rem; letter-spacing: .03em; color: #0b2530; background: #2dd4bf; border-radius: 999px; padding: .15rem .6rem; }
.ca-status { flex: 1 1 10rem; font-size: .85rem; color: #cbd5e1; font-variant-numeric: tabular-nums; }
.ca-btn { border: 1px solid rgba(203, 213, 225, .35); background: rgba(15, 23, 42, .6); color: #f1f5f9; border-radius: .6rem; padding: .3rem .75rem; font-size: .85rem; cursor: pointer; }
.ca-btn:hover { border-color: #2dd4bf; }
.ca-btn[hidden], .ca-send[hidden], .ca-empty[hidden] { display: none; }
.ca-parts { display: flex; flex-wrap: wrap; gap: .75rem; margin-top: .75rem; }
.ca-parts:empty { display: none; }
.ca-part { display: flex; flex-direction: column; align-items: center; gap: .35rem; min-width: 4.5rem; padding: .5rem .6rem; border-radius: .8rem; background: rgba(15, 23, 42, .55); border: 1px solid rgba(148, 163, 184, .2); }
.ca-label { font-size: .78rem; color: #cbd5e1; text-align: center; font-variant-numeric: tabular-nums; }
.ca-empty { margin: .6rem 0 0; font-size: .85rem; color: #cbd5e1; }

/* LED: --on is the share of time the pin was HIGH this frame (PWM gives a dimmer glow). */
.ca-led-bulb { --on: 0; width: 1.9rem; height: 1.9rem; border-radius: 50% 50% 45% 45%; border: 2px solid rgba(226, 232, 240, .35);
  background: color-mix(in srgb, var(--led) calc(18% + var(--on) * 82%), #1e293b);
  box-shadow: 0 0 calc(var(--on) * 22px) calc(var(--on) * 6px) color-mix(in srgb, var(--led) 70%, transparent); }
.ca-push { width: 2.6rem; height: 2.6rem; border-radius: 50%; border: 3px solid #64748b; background: radial-gradient(circle at 40% 35%, #f87171, #b91c1c); cursor: pointer; touch-action: none; box-shadow: 0 3px 0 #475569; }
.ca-push.is-down { transform: translateY(2px); box-shadow: 0 1px 0 #475569; background: radial-gradient(circle at 40% 35%, #fca5a5, #991b1b); }
.ca-push:focus-visible { outline: 3px solid #2dd4bf; outline-offset: 2px; }
.ca-analog input[type="range"] { width: 9rem; accent-color: #2dd4bf; }
.ca-note { font-size: 1.2rem; color: #94a3b8; font-variant-numeric: tabular-nums; }
.ca-buzzer.is-on .ca-note { color: #facc15; }
.ca-servo-c { width: 120px; height: 70px; }
.ca-send { display: flex; gap: .5rem; margin-top: .75rem; }
.ca-send input { flex: 1; min-width: 0; border-radius: .6rem; border: 1px solid rgba(148, 163, 184, .35); background: #0f172a; color: #f1f5f9; padding: .35rem .6rem; font-family: ui-monospace, monospace; }

/* The breadboard (arduino-bb-ui.mjs) reuses the circuit lab's .cl styles and stays dark in both themes. */
.ca-bb { margin-top: .75rem; padding: .6rem; border-radius: .8rem; background: #0b1220; }
.ca-bb .cl-board { background: linear-gradient(180deg, #0b1626, #070b14); }

html[data-theme="light"] .ca-board { background: #ecfeff; border-color: #5eead4; color: #0f172a; }
html[data-theme="light"] .ca-status, html[data-theme="light"] .ca-label, html[data-theme="light"] .ca-empty { color: #334155; }
html[data-theme="light"] .ca-btn { background: #fff; color: #0f172a; border-color: #94a3b8; }
html[data-theme="light"] .ca-part { background: #fff; border-color: #cbd5e1; }
html[data-theme="light"] .ca-led-bulb { background: color-mix(in srgb, var(--led) calc(18% + var(--on) * 82%), #e2e8f0); border-color: #94a3b8; }
html[data-theme="light"] .ca-send input { background: #fff; color: #0f172a; }
@media (prefers-reduced-motion: reduce) { .ca-push { transition: none; } }
