/* ============================================================
   Switch2BLE Web — Apple-style design system
   ============================================================ */

:root {
  --bg: #000000;
  --bg-elevated: #1c1c1e;
  --bg-card: rgba(30, 30, 32, 0.8);
  --bg-card-hover: rgba(42, 42, 44, 0.85);
  --bg-card-solid: #1e1e20;
  --bg-header: #252528;
  --text-primary: #f5f5f7;
  --text-secondary: rgba(245, 245, 247, 0.6);
  --text-tertiary: rgba(245, 245, 247, 0.35);
  --accent: #0a84ff;
  --accent-hover: #409cff;
  --green: #30d158;
  --orange: #ff9f0a;
  --red: #ff453a;
  --yellow: #ffd60a;
  --border: rgba(255, 255, 255, 0.1);
  --border-strong: rgba(255, 255, 255, 0.15);
  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 20px;
  --radius-xl: 28px;
  --shadow-card: 0 2px 20px rgba(0, 0, 0, 0.3), 0 0 0 0.5px rgba(255, 255, 255, 0.06);
  --shadow-elevated: 0 8px 40px rgba(0, 0, 0, 0.5), 0 0 0 0.5px rgba(255, 255, 255, 0.08);
  --transition-fast: 0.15s cubic-bezier(0.25, 0.1, 0.25, 1);
  --transition-medium: 0.3s cubic-bezier(0.25, 0.1, 0.25, 1);
  --transition-spring: 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
  --font-stack: -apple-system, BlinkMacSystemFont, 'SF Pro Display', 'SF Pro Text', 'Helvetica Neue', system-ui, sans-serif;
  --font-mono: 'SF Mono', 'Menlo', 'Monaco', 'Consolas', monospace;
}

/* ---- Reset ---- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html {
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  font-family: var(--font-stack);
  background: var(--bg);
  color: var(--text-primary);
  min-height: 100vh;
  overflow-x: hidden;
}

/* ---- Navbar ---- */
.navbar {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(0, 0, 0, 0.95);
  border-bottom: 0.5px solid var(--border);
}

.navbar-content {
  max-width: 960px;
  margin: 0 auto;
  padding: 14px 24px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.navbar-title {
  font-size: 20px;
  font-weight: 700;
  letter-spacing: -0.3px;
  color: var(--text-primary);
}

.navbar-status {
  display: flex;
  align-items: center;
  gap: 8px;
}

.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--red);
  transition: background var(--transition-medium), box-shadow var(--transition-medium);
}

.status-dot.scanning,
.status-dot.connecting,
.status-dot.pairing {
  background: var(--orange);
  box-shadow: 0 0 8px rgba(255, 159, 10, 0.5);
  animation: pulse 1.5s ease-in-out infinite;
}

.status-dot.connected {
  background: var(--green);
  box-shadow: 0 0 8px rgba(48, 209, 88, 0.4);
}

.status-text {
  font-size: 13px;
  font-weight: 500;
  color: var(--text-secondary);
  transition: color var(--transition-medium);
}

/* ---- Main Content ---- */
.main-content {
  max-width: 960px;
  margin: 0 auto;
  padding: 24px;
  padding-bottom: 120px;
}

/* ---- Glass Card ---- */
.glass-card {
  background: var(--bg-card-solid);
  border-radius: var(--radius-lg);
  border: 0.5px solid var(--border);
  box-shadow: var(--shadow-card);
  transition: transform var(--transition-medium), box-shadow var(--transition-medium);
}

/* ---- Hero Section ---- */
.hero-section {
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: calc(100vh - 200px);
  animation: fadeInUp 0.6s cubic-bezier(0.25, 0.1, 0.25, 1) both;
}

.hero-card {
  text-align: center;
  max-width: 440px;
  width: 100%;
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.hero-glow {
  position: absolute;
  top: 0px;
  left: 50%;
  transform: translateX(-50%);
  width: 280px;
  height: 280px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(10, 132, 255, 0.18) 0%, transparent 70%);
  pointer-events: none;
  animation: breathe 4s ease-in-out infinite;
}

.hero-icon-ring {
  position: relative;
  width: 96px;
  height: 96px;
  border-radius: 50%;
  border: 2px solid rgba(10, 132, 255, 0.35);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 32px;
  box-shadow: 0 0 20px rgba(10, 132, 255, 0.1), inset 0 0 20px rgba(10, 132, 255, 0.05);
}

.hero-icon-pulse {
  position: absolute;
  inset: -8px;
  border-radius: 50%;
  border: 2px solid rgba(10, 132, 255, 0.35);
  opacity: 0;
  animation: ringPulse 3s ease-out infinite;
}

.hero-icon-pulse.pulse-2 {
  animation-delay: 1s;
}

.hero-icon-pulse.pulse-3 {
  animation-delay: 2s;
}

.hero-bt-icon {
  color: var(--accent);
  opacity: 0.8;
}

.hero-title {
  font-size: 36px;
  font-weight: 800;
  letter-spacing: -1px;
  margin-bottom: 12px;
}

.hero-subtitle {
  font-size: 15px;
  color: var(--text-tertiary);
  line-height: 1.6;
  margin-bottom: 28px;
  max-width: 340px;
}

.supported-list {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
  margin-bottom: 36px;
}

.supported-tag {
  font-size: 12px;
  font-weight: 500;
  color: var(--text-tertiary);
  background: rgba(255, 255, 255, 0.04);
  border: 0.5px solid rgba(255, 255, 255, 0.08);
  border-radius: 100px;
  padding: 5px 14px;
  transition: all var(--transition-fast);
}

.supported-tag:hover {
  background: rgba(255, 255, 255, 0.08);
  color: var(--text-secondary);
}

.hero-note {
  font-size: 12px;
  color: var(--text-tertiary);
  margin-top: 16px;
}

@keyframes breathe {
  0%, 100% { opacity: 0.6; transform: translateX(-50%) scale(1); }
  50% { opacity: 1; transform: translateX(-50%) scale(1.1); }
}

@keyframes ringPulse {
  0% { transform: scale(1); opacity: 0; }
  10% { opacity: 0.6; }
  80% { transform: scale(2.2); opacity: 0; }
  100% { transform: scale(2.2); opacity: 0; }
}

.hero-credit-line {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 40px;
}

.hero-credit {
  font-size: 11px;
  font-weight: 500;
  color: var(--text-tertiary);
  opacity: 0.5;
  letter-spacing: 0.3px;
  text-decoration: none;
  transition: opacity var(--transition-fast);
}

.hero-credit:hover {
  opacity: 0.8;
}

.hero-credit-sep {
  font-size: 11px;
  color: var(--text-tertiary);
  opacity: 0.3;
}

/* ---- Unsupported Browser ---- */
.unsupported-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  font-weight: 600;
  color: var(--orange);
  background: rgba(255, 159, 10, 0.1);
  border: 1px solid rgba(255, 159, 10, 0.2);
  border-radius: var(--radius-md);
  padding: 10px 18px;
  margin-bottom: 12px;
}

.unsupported-detail {
  font-size: 13px;
  color: var(--text-tertiary);
  line-height: 1.5;
  margin-bottom: 20px;
  max-width: 320px;
}

.hero-actions {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.btn-demo {
  font-family: var(--font-stack);
  font-size: 14px;
  font-weight: 500;
  color: var(--text-tertiary);
  background: none;
  border: none;
  cursor: pointer;
  padding: 8px 0;
  margin-top: 14px;
  transition: color var(--transition-fast);
  text-decoration: underline;
  text-decoration-color: rgba(255, 255, 255, 0.15);
  text-underline-offset: 3px;
}

.btn-demo:hover {
  color: var(--text-secondary);
  text-decoration-color: rgba(255, 255, 255, 0.3);
}

/* ---- Buttons ---- */
.btn-primary {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-family: var(--font-stack);
  font-size: 16px;
  font-weight: 600;
  color: #fff;
  background: var(--accent);
  border: none;
  border-radius: var(--radius-xl);
  padding: 14px 32px;
  cursor: pointer;
  transition: all var(--transition-fast);
  overflow: hidden;
  min-width: 220px;
}

.btn-primary:hover {
  background: var(--accent-hover);
  transform: scale(1.02);
  box-shadow: 0 4px 20px rgba(10, 132, 255, 0.35);
}

.btn-primary:active {
  transform: scale(0.98);
}

.btn-primary.scanning {
  background: var(--orange);
}

.btn-primary.scanning:hover {
  background: #ffb340;
  box-shadow: 0 4px 20px rgba(255, 159, 10, 0.35);
}

.btn-content {
  display: flex;
  align-items: center;
  gap: 8px;
  transition: opacity var(--transition-fast);
}

.btn-icon {
  flex-shrink: 0;
}

.btn-spinner {
  display: none;
  width: 20px;
  height: 20px;
  border: 2.5px solid rgba(255, 255, 255, 0.3);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}

.btn-primary.scanning .btn-spinner {
  display: block;
}

.btn-secondary {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-family: var(--font-stack);
  font-size: 14px;
  font-weight: 500;
  color: var(--accent);
  background: rgba(10, 132, 255, 0.12);
  border: none;
  border-radius: var(--radius-md);
  padding: 8px 16px;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.btn-secondary:hover {
  background: rgba(10, 132, 255, 0.2);
}

.btn-secondary:active {
  transform: scale(0.96);
}

.btn-small {
  font-size: 13px;
  padding: 6px 14px;
}

.btn-back {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-family: var(--font-stack);
  font-size: 15px;
  font-weight: 500;
  color: var(--accent);
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px 0;
  margin-bottom: 20px;
  transition: opacity var(--transition-fast);
}

.btn-back:hover {
  opacity: 0.8;
}

/* ---- Controllers Section ---- */
.section-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
}

.section-title {
  font-size: 22px;
  font-weight: 700;
  letter-spacing: -0.3px;
}

.controllers-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.controller-card {
  display: flex;
  align-items: center;
  padding: 16px 20px;
  cursor: pointer;
  transition: all var(--transition-fast);
  animation: fadeInUp 0.35s cubic-bezier(0.25, 0.1, 0.25, 1) both;
}

.controller-card:hover {
  transform: translateY(-1px);
  box-shadow: var(--shadow-elevated);
  background: var(--bg-card-hover);
}

.controller-card:active {
  transform: scale(0.99);
}

.controller-info {
  flex: 1;
}

.controller-name {
  font-size: 16px;
  font-weight: 600;
  margin-bottom: 3px;
}

.controller-player {
  font-size: 13px;
  color: var(--text-secondary);
}

.controller-right {
  display: flex;
  align-items: center;
  gap: 12px;
}

.controller-battery-indicator {
  display: flex;
  align-items: center;
  gap: 6px;
}

.controller-battery {
  font-size: 13px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

.controller-status-icon {
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.controller-status-icon .ready {
  color: var(--green);
  animation: scaleIn 0.4s var(--transition-spring) both;
}

.controller-status-icon .spinner {
  width: 20px;
  height: 20px;
  border: 2px solid var(--border-strong);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

/* ---- Detail Section ---- */
.detail-section {
  animation: fadeInUp 0.35s cubic-bezier(0.25, 0.1, 0.25, 1) both;
}

.detail-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 24px 28px;
  margin-bottom: 20px;
  background: var(--bg-header);
}

.detail-title {
  font-size: 24px;
  font-weight: 700;
  letter-spacing: -0.3px;
}

.detail-player {
  font-size: 14px;
  color: var(--text-secondary);
  margin-top: 4px;
}

.battery-indicator {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--green);
  transition: color var(--transition-medium);
}

.battery-indicator.low {
  color: var(--orange);
}

.battery-indicator.critical {
  color: var(--red);
  animation: pulse 1.5s ease-in-out infinite;
}

.battery-indicator.charging {
  color: var(--yellow);
}

.battery-icon { flex-shrink: 0; }

.battery-text {
  font-size: 14px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

/* ---- Detail Grid ---- */
.detail-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 14px;
}

.detail-card {
  padding: 20px 24px;
  animation: fadeInUp 0.4s cubic-bezier(0.25, 0.1, 0.25, 1) both;
  display: flex;
  flex-direction: column;
  min-height: 220px;
}

.detail-card > div:not(.card-header) {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.card-header {
  flex: none;
}

.detail-card:nth-child(2) { animation-delay: 0.05s; }
.detail-card:nth-child(3) { animation-delay: 0.1s; }
.detail-card:nth-child(4) { animation-delay: 0.15s; }
.detail-card:nth-child(5) { animation-delay: 0.2s; }
.detail-card:nth-child(6) { animation-delay: 0.25s; }
.detail-card:nth-child(7) { animation-delay: 0.3s; }

.detail-card-wide {
  /* stays in normal grid flow */
}

.card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 14px;
  flex-wrap: nowrap;
  gap: 8px;
}

.card-header .card-title {
  margin-bottom: 0;
}

.view-toggle {
  font-family: var(--font-stack);
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--accent);
  background: rgba(10, 132, 255, 0.1);
  border: none;
  border-radius: 6px;
  padding: 4px 10px;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.view-toggle:hover {
  background: rgba(10, 132, 255, 0.2);
}

.view-toggle:active {
  transform: scale(0.95);
}

/* ---- Motion Visualizer ---- */
.motion-visual {
  display: flex;
  justify-content: center;
  flex: 1;
  align-items: center;
}

.motion-viz-row {
  display: flex;
  justify-content: space-evenly;
  align-items: center;
  gap: 20px;
  width: 100%;
  flex-wrap: nowrap;
}

.viz-wrapper {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}

.motion-canvas {
  width: 110px;
  height: 110px;
  border-radius: var(--radius-md);
  background: rgba(0, 0, 0, 0.25);
  border: 1px solid var(--border);
}

.viz-label {
  font-size: 11px;
  font-weight: 500;
  color: var(--text-tertiary);
  text-transform: uppercase;
  letter-spacing: 0.4px;
}

/* ---- Battery Visualizer ---- */
.battery-visual {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 24px;
  flex: 1;
  flex-wrap: nowrap;
}

.battery-ring-wrapper {
  flex-shrink: 0;
}

.battery-ring-canvas {
  width: 110px;
  height: 110px;
}

.battery-stats {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.battery-stat-value {
  font-size: 32px;
  font-weight: 700;
  letter-spacing: -1px;
  font-variant-numeric: tabular-nums;
  line-height: 1.1;
}

.battery-stat-unit {
  font-size: 13px;
  font-weight: 500;
  color: var(--text-secondary);
}

.battery-stat-row {
  display: flex;
  gap: 8px;
  align-items: center;
}

.battery-stat-detail {
  font-size: 13px;
  font-weight: 500;
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
  color: var(--text-tertiary);
}

.battery-stat-sep {
  font-size: 12px;
  color: var(--text-tertiary);
  opacity: 0.4;
}

/* ---- Mouse Visualizer ---- */
.mouse-canvas {
  width: 100%;
  height: 160px;
  border-radius: var(--radius-md);
  background: rgba(0, 0, 0, 0.25);
  border: 1px solid var(--border);
}

.card-title {
  font-size: 13px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-secondary);
  margin-bottom: 14px;
}

/* ---- Buttons Display ---- */
.buttons-display {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  min-height: 34px;
  align-items: center;
  align-content: center;
  flex: 1;
}

.no-input {
  font-size: 14px;
  color: var(--text-tertiary);
}

.button-tag {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  font-weight: 600;
  color: #fff;
  background: var(--accent);
  border-radius: 8px;
  padding: 4px 12px;
  min-width: 36px;
  animation: popIn 0.15s cubic-bezier(0.34, 1.56, 0.64, 1) both;
  box-shadow: 0 2px 8px rgba(10, 132, 255, 0.3);
}

/* ---- Sticks ---- */
.sticks-container {
  display: flex;
  justify-content: space-evenly;
  align-items: center;
  gap: 16px;
  flex: 1;
  flex-wrap: nowrap;
}

.stick-wrapper {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}

.stick-canvas {
  width: min(110px, 40vw);
  height: min(110px, 40vw);
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.3);
  border: 1px solid var(--border);
  flex-shrink: 0;
}

.stick-label {
  font-size: 11px;
  font-weight: 500;
  color: var(--text-secondary);
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
  height: 14px;
  white-space: nowrap;
  overflow: hidden;
}

/* ---- Triggers ---- */
.triggers-container {
  display: flex;
  gap: 14px;
  flex: 1;
  align-items: stretch;
  min-height: 120px;
}

#triggersVisual {
  display: flex;
  flex: 1;
}

.trigger-wrapper {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0;
}

.trigger-bar {
  width: 100%;
  flex: 1;
  background: rgba(255, 255, 255, 0.04);
  border-radius: var(--radius-sm);
  border: 0.5px solid var(--border);
  overflow: hidden;
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
}

.trigger-fill {
  width: 100%;
  height: 0%;
  background: linear-gradient(to top, var(--accent), rgba(10, 132, 255, 0.6));
  border-radius: 0 0 var(--radius-sm) var(--radius-sm);
  transition: height 0.05s linear;
  box-shadow: 0 -4px 16px rgba(10, 132, 255, 0.2);
}

.trigger-label {
  font-size: 13px;
  font-weight: 700;
  color: var(--text-secondary);
  margin-top: 8px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

/* ---- Motion / Data Rows ---- */
.motion-grid {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.motion-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.motion-label {
  font-size: 14px;
  font-weight: 500;
  color: var(--text-secondary);
}

.motion-value {
  font-size: 14px;
  font-weight: 500;
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
  color: var(--text-primary);
  transition: color 0.1s;
}

/* ---- Rumble Controls ---- */
.rumble-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-bottom: 14px;
}

.rumble-slider-group {
  background: rgba(255, 255, 255, 0.03);
  border: 0.5px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
}

.rumble-slider-label {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
}

.rumble-slider-name {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.3px;
  color: var(--text-tertiary);
}

.rumble-slider-value {
  font-size: 13px;
  font-weight: 700;
  font-family: var(--font-mono);
  color: var(--text-primary);
  font-variant-numeric: tabular-nums;
}

/* Custom range slider */
input[type="range"] {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 4px;
  background: rgba(255, 255, 255, 0.08);
  border-radius: 100px;
  outline: none;
  transition: background var(--transition-fast);
}

input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: #fff;
  cursor: pointer;
  box-shadow: 0 1px 6px rgba(0, 0, 0, 0.4), 0 0 0 0.5px rgba(0, 0, 0, 0.1);
  transition: transform var(--transition-fast), box-shadow var(--transition-fast);
}

input[type="range"].lf-freq::-webkit-slider-thumb { background: #ff9f0a; }
input[type="range"].lf-amp::-webkit-slider-thumb { background: #ff453a; }
input[type="range"].hf-freq::-webkit-slider-thumb { background: #30d158; }
input[type="range"].hf-amp::-webkit-slider-thumb { background: #0a84ff; }

input[type="range"]::-webkit-slider-thumb:hover {
  transform: scale(1.15);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.4), 0 0 0 0.5px rgba(0, 0, 0, 0.1);
}

input[type="range"]::-webkit-slider-thumb:active {
  transform: scale(1.05);
}

input[type="range"]::-moz-range-thumb {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: #fff;
  cursor: pointer;
  border: none;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.3);
}

.rumble-toggle {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 0;
  margin-bottom: 14px;
}

.rumble-toggle-label {
  font-size: 14px;
  font-weight: 500;
  color: var(--text-primary);
}

/* iOS-style toggle switch */
.toggle-switch {
  position: relative;
  width: 50px;
  height: 30px;
  background: rgba(255, 255, 255, 0.15);
  border-radius: 100px;
  cursor: pointer;
  transition: background var(--transition-medium);
  border: none;
  padding: 0;
}

.toggle-switch.active {
  background: var(--green);
}

.toggle-switch::after {
  content: '';
  position: absolute;
  top: 2px;
  left: 2px;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
  transition: transform var(--transition-medium);
}

.toggle-switch.active::after {
  transform: translateX(20px);
}

.rumble-wave-canvas {
  width: 100%;
  height: 60px;
  border-radius: var(--radius-sm);
  background: rgba(0, 0, 0, 0.2);
  border: 0.5px solid var(--border);
  margin-bottom: 12px;
}

.btn-rumble {
  width: 100%;
  font-family: var(--font-stack);
  font-size: 15px;
  font-weight: 600;
  padding: 12px;
  border-radius: var(--radius-md);
  border: none;
  cursor: pointer;
  transition: all var(--transition-fast);
  margin-top: 8px;
}

.btn-rumble.play {
  background: var(--accent);
  color: #fff;
}

.btn-rumble.play:hover {
  background: var(--accent-hover);
}

.btn-rumble.stop {
  background: rgba(255, 69, 58, 0.15);
  color: var(--red);
}

.btn-rumble.stop:hover {
  background: rgba(255, 69, 58, 0.25);
}

.btn-rumble:active {
  transform: scale(0.98);
}

/* ---- Log Section ---- */
.log-section {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 90;
}

.log-toggle {
  width: 100%;
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 6px;
  font-family: var(--font-stack);
  font-size: 13px;
  font-weight: 500;
  color: var(--text-tertiary);
  background: rgba(28, 28, 30, 0.95);
  border: none;
  border-top: 0.5px solid var(--border);
  padding: 10px;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.log-toggle:hover {
  color: var(--text-secondary);
  background: rgba(28, 28, 30, 0.95);
}

.log-chevron {
  transition: transform var(--transition-medium);
}

.log-chevron.open {
  transform: rotate(180deg);
}

.log-panel {
  max-height: 0;
  overflow: hidden;
  background: rgba(0, 0, 0, 0.95);
  transition: max-height var(--transition-medium);
}

.log-panel.open {
  max-height: 200px;
  border-top: 0.5px solid var(--border);
}

.log-entries {
  padding: 12px 20px;
  max-height: 180px;
  overflow-y: auto;
  font-family: var(--font-mono);
  font-size: 11px;
  line-height: 1.6;
  color: var(--text-tertiary);
}

.log-entries::-webkit-scrollbar {
  width: 4px;
}

.log-entries::-webkit-scrollbar-track {
  background: transparent;
}

.log-entries::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.15);
  border-radius: 100px;
}

.log-entry {
  animation: fadeIn 0.2s ease both;
}

/* ---- Animations ---- */
@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(16px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes fadeOut {
  from { opacity: 1; transform: translateY(0); }
  to { opacity: 0; transform: translateY(8px); }
}

@keyframes scaleIn {
  from {
    opacity: 0;
    transform: scale(0);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

@keyframes popIn {
  from {
    opacity: 0;
    transform: scale(0.6);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.5; }
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

@keyframes float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-8px); }
}

/* ---- Controllers Section Animation ---- */
.controllers-section {
  animation: fadeInUp 0.35s cubic-bezier(0.25, 0.1, 0.25, 1) both;
}

/* ---- Responsive ---- */
@media (max-width: 640px) {
  .main-content {
    padding: 16px;
    padding-bottom: 120px;
  }

  .hero-card {
    padding: 40px 28px;
  }

  .hero-title {
    font-size: 24px;
  }

  .detail-grid {
    grid-template-columns: 1fr;
  }
}

/* ---- Selection & Focus ---- */
::selection {
  background: rgba(10, 132, 255, 0.3);
}

button:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

/* ---- Disconnect button ---- */
.btn-disconnect {
  font-family: var(--font-stack);
  font-size: 14px;
  font-weight: 500;
  color: var(--red);
  background: rgba(255, 69, 58, 0.1);
  border: none;
  border-radius: var(--radius-md);
  padding: 10px 20px;
  cursor: pointer;
  transition: all var(--transition-fast);
  margin-top: 20px;
  width: 100%;
}

.btn-disconnect:hover {
  background: rgba(255, 69, 58, 0.2);
}

.btn-disconnect:active {
  transform: scale(0.98);
}
