/* tsbutt — mobile-first, no framework. */ :root { --bg: #121216; --card: #1c1c22; --text: #e8e8ec; --muted: #9a9aa4; --accent: #7c5cff; --danger: #ff4757; --ok: #2ed573; --warn: #ffa502; --radius: 12px; /* Height of the fixed emergency-stop dock; content must clear it. */ --estop-dock: 4.4rem; } * { box-sizing: border-box; } body { margin: 0; background: var(--bg); color: var(--text); font-family: system-ui, -apple-system, "Segoe UI", sans-serif; font-size: 16px; line-height: 1.4; -webkit-user-select: none; user-select: none; touch-action: manipulation; } #app { margin: 0 auto; /* Wide enough to use desktop real estate (waveforms, freehand canvas), narrow enough to keep visible margins on very large screens. */ max-width: 60rem; padding: 1rem; /* Always leave room for the fixed emergency-stop dock. */ padding-bottom: calc(var(--estop-dock) + env(safe-area-inset-bottom)); display: flex; flex-direction: column; gap: 0.9rem; min-height: 100dvh; } header { display: flex; align-items: center; justify-content: space-between; gap: 0.5rem; } h1 { font-size: 1.4rem; margin: 0; } h2 { font-size: 1rem; margin: 0 0 0.5rem; color: var(--muted); text-transform: uppercase; letter-spacing: 0.05em; } .card { background: var(--card); border-radius: var(--radius); padding: 1rem; } .muted { color: var(--muted); } .pill { padding: 0.3rem 0.8rem; border-radius: 999px; font-size: 0.85rem; font-weight: 600; white-space: nowrap; } .pill-on { background: color-mix(in srgb, var(--ok) 25%, transparent); color: var(--ok); } .pill-off { background: color-mix(in srgb, var(--warn) 25%, transparent); color: var(--warn); } .pill-bad { background: color-mix(in srgb, var(--danger) 25%, transparent); color: var(--danger); } .banner { background: color-mix(in srgb, var(--danger) 20%, transparent); border: 1px solid var(--danger); border-radius: var(--radius); padding: 0.7rem 1rem; font-size: 0.9rem; display: flex; justify-content: space-between; align-items: center; gap: 0.5rem; } .hidden { display: none; } button { background: var(--accent); color: white; border: none; border-radius: var(--radius); padding: 0.8rem 1.2rem; font-size: 1rem; font-weight: 600; cursor: pointer; } button:disabled { opacity: 0.4; cursor: not-allowed; } button.danger { background: var(--danger); width: 100%; padding: 1.2rem; font-size: 1.2rem; } button.ghost { background: transparent; color: var(--muted); padding: 0.4rem 0.6rem; } button.ghost:disabled { color: #55555e; } input[type="range"] { width: 100%; height: 3rem; /* large touch target */ accent-color: var(--accent); } /* --- direct control: per-vibrator rows ---------------------------------- */ .device-head { display: flex; align-items: baseline; justify-content: space-between; gap: 0.5rem; } .device-name { font-size: 1rem; margin: 0 0 0.5rem; color: var(--muted); text-transform: uppercase; letter-spacing: 0.05em; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; } .battery { font-size: 0.85rem; white-space: nowrap; } .vrow { background: var(--bg); border-radius: var(--radius); padding: 0.5rem 0.7rem; display: flex; flex-direction: column; gap: 0.3rem; } .vrow + .vrow { margin-top: 0.5rem; } .vlabel { font-size: 0.9rem; font-weight: 600; color: var(--text); } .vbtns { display: flex; gap: 0.5rem; } .vbtns .hold { flex: 1; padding: 0.6rem 0.4rem; font-size: 0.9rem; } /* Hold button colors are shared with every mode's compact hold buttons. */ .hold-max { background: var(--accent); } .hold-stop { background: var(--danger); } .hold.holding { filter: brightness(1.35); } .empty-note { padding: 0.5rem 0.2rem; } /* --- mode tabs ----------------------------------------------------------- */ #mode-tabs { display: flex; gap: 0.4rem; } .tab { flex: 1; background: var(--card); color: var(--muted); padding: 0.6rem 0.4rem; font-size: 0.95rem; border-radius: var(--radius); } .tab.active { background: var(--accent); color: white; } /* --- pattern mode --------------------------------------------------------- */ .transport { display: flex; gap: 0.4rem; flex-wrap: wrap; } .transport button { flex: 1; padding: 0.6rem 0.4rem; font-size: 0.9rem; } .transport button.active { filter: brightness(1.3); } .loop-row { display: flex; align-items: center; gap: 0.5rem; margin-top: 0.6rem; font-size: 0.9rem; } .loop-row input { width: 5rem; background: var(--bg); color: var(--text); border: 1px solid #33333c; border-radius: 8px; padding: 0.4rem; font-size: 0.95rem; } .prow { display: flex; align-items: stretch; gap: 0.4rem; background: var(--card); border-radius: var(--radius); padding: 0.25rem 0.4rem; } .prow + .prow { margin-top: 0.25rem; } .pbtns { display: flex; flex-direction: column; gap: 0.3rem; justify-content: center; } .pbtns .glyph { width: 2.4rem; padding: 0.35rem 0; font-size: 1rem; line-height: 1; } .pwave-wrap { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 0.15rem; position: relative; } .wave-tag { position: absolute; top: 4px; left: 8px; font-size: 0.7rem; color: var(--muted); pointer-events: none; max-width: calc(100% - 16px); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; } .wave { width: 100%; /* Tall enough for fine vertical adjustments. */ height: 9rem; background: var(--bg); border: 1px solid #33333c; border-radius: 8px; touch-action: none; /* drags edit the waveform instead of scrolling */ cursor: crosshair; } .wave-zero { stroke: #33333c; stroke-width: 1; vector-effect: non-scaling-stroke; } .wave-line { fill: none; stroke: var(--accent); stroke-width: 2; vector-effect: non-scaling-stroke; } .wave-head { stroke: var(--warn); stroke-width: 2; vector-effect: non-scaling-stroke; } /* --- freehand mode -------------------------------------------------------- */ .freehand-bar .submode { display: flex; gap: 0.4rem; } .freehand-bar .submode .tab { flex: 1; } .freehand-bar .hint { font-size: 0.8rem; margin: 0.5rem 0 0; } #freehand-wrap { position: relative; height: min(70vh, 42rem); border-radius: var(--radius); overflow: hidden; } #freehand-canvas { width: 100%; height: 100%; display: block; background: var(--card); touch-action: none; /* drags drive vibrators instead of scrolling */ cursor: crosshair; } .fh-ring { stroke-width: 2; } /* stroke color is per-vibrator (set in app.js) */ .fh-dot { stroke: color-mix(in srgb, white 60%, transparent); stroke-width: 1.5; } /* fill color is per-vibrator */ .fh-label { font-size: 10px; pointer-events: none; } /* fill color is per-vibrator */ .fh-handle { stroke: #33333c; stroke-width: 1.5; } .fh-handle-radius { fill: var(--warn); } .fh-handle-curve { fill: var(--ok); } #fh-selection { fill: none; stroke: var(--text); stroke-width: 2; } #fh-key { position: absolute; right: 8px; bottom: 8px; max-width: 60%; display: flex; flex-direction: column; gap: 0.15rem; background: color-mix(in srgb, var(--bg) 82%, transparent); border: 1px solid #33333c; border-radius: 8px; padding: 0.4rem 0.6rem; font-size: 0.75rem; pointer-events: none; } .fh-key-row { display: flex; align-items: center; gap: 0.4rem; white-space: nowrap; } .fh-key-swatch { flex: none; width: 0.7rem; height: 0.7rem; border-radius: 50%; } /* --- settings panel ------------------------------------------------------- */ .icon-btn { background: transparent; color: var(--muted); padding: 0.3rem 0.5rem; font-size: 1.25rem; line-height: 1; } .icon-btn:hover:not(:disabled) { color: var(--text); } #settings-overlay { position: fixed; inset: 0; z-index: 150; background: rgb(0 0 0 / 0.55); display: flex; align-items: flex-start; justify-content: center; padding: 3rem 1rem calc(1rem + env(safe-area-inset-bottom)); overflow-y: auto; } /* .hidden alone loses to the ID's display:flex, so re-state it here. */ #settings-overlay.hidden { display: none; } .settings-panel { width: 100%; max-width: 30rem; display: flex; flex-direction: column; gap: 0.5rem; } .settings-head { display: flex; align-items: center; justify-content: space-between; gap: 0.5rem; } .settings-head h2 { margin: 0; color: var(--text); } .settings-label { font-weight: 600; font-size: 0.9rem; } .settings-panel .muted { margin: 0; font-size: 0.85rem; } .settings-panel code { background: var(--bg); border-radius: 4px; padding: 0 0.25rem; } #endpoint { width: 100%; background: var(--bg); color: var(--text); border: 1px solid #33333c; border-radius: 8px; padding: 0.5rem; font-size: 0.95rem; -webkit-user-select: text; user-select: text; } .row button.ghost { background: color-mix(in srgb, var(--card) 70%, transparent); } /* --- emergency stop dock ------------------------------------------------- */ /* Fixed to the bottom of the viewport in every view; nothing may cover it. */ #estop-dock { position: fixed; left: 0; right: 0; bottom: 0; z-index: 100; padding: 0.5rem 1.25rem calc(0.5rem + env(safe-area-inset-bottom)); background: linear-gradient(to top, var(--bg) 70%, transparent); } #estop-dock .danger { border-radius: var(--radius); /* Prominent but not overwhelming; centered with breathing room. */ max-width: 40rem; margin: 0 auto; display: block; padding: 0.9rem 1.2rem; font-size: 1.05rem; } #log { max-height: 12rem; overflow: auto; font-size: 0.75rem; color: var(--muted); white-space: pre-wrap; } details { font-size: 0.85rem; } summary { color: var(--muted); cursor: pointer; }