/* ═══════════════════════════════════════════════════════
   NullDrop — style.css
   Glassmorphic Dark Theme with Syne + DM Mono typography
   ═══════════════════════════════════════════════════════ */

/* ─────────────────────────────────────────
   CSS CUSTOM PROPERTIES (Design Tokens)
───────────────────────────────────────── */
:root {
  /* Core Palette */
  --bg: #0B0F19;
  --surface: rgba(255, 255, 255, 0.04);
  --surface-hover: rgba(255, 255, 255, 0.07);
  --border: rgba(255, 255, 255, 0.08);
  --border-active: rgba(167, 139, 250, 0.45);

  /* Brand Accents */
  --purple: #A78BFA;
  --purple-dim: rgba(167, 139, 250, 0.18);
  --teal: #2DD4BF;
  --teal-dim: rgba(45, 212, 191, 0.15);
  --pink: #F472B6;

  /* Text */
  --text-primary: #F1F5F9;
  --text-secondary: #94A3B8;
  --text-muted: #475569;

  /* Semantic */
  --success: #34D399;
  --error: #F87171;
  --warning: #FBBF24;

  /* Typography */
  --font-display: 'Syne', 'SF Pro Display', system-ui, sans-serif;
  --font-mono: 'DM Mono', 'SF Mono', 'Fira Code', monospace;

  /* Spacing */
  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 22px;
  --radius-xl: 32px;

  /* Shadows */
  --shadow-card: 0 24px 80px rgba(0, 0, 0, 0.55), 0 0 0 1px rgba(255, 255, 255, 0.06);
  --shadow-btn: 0 4px 24px rgba(167, 139, 250, 0.25);
  --shadow-glow-p: 0 0 80px 20px rgba(139, 92, 246, 0.18);
  --shadow-glow-t: 0 0 80px 20px rgba(45, 212, 191, 0.12);

  /* Transitions */
  --ease-out-expo: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-spring: cubic-bezier(0.34, 1.56, 0.64, 1);
}

/* ─────────────────────────────────────────
   RESET & BASE
───────────────────────────────────────── */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
}

body {
  min-height: 100dvh;
  background-color: var(--bg);
  color: var(--text-primary);
  font-family: var(--font-display);
  font-size: 15px;
  line-height: 1.6;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

button {
  font-family: inherit;
  cursor: pointer;
  border: none;
  background: none;
  color: inherit;
}

input {
  font-family: inherit;
  color: inherit;
}

/* ─────────────────────────────────────────
   AMBIENT BACKGROUND GLOWS
───────────────────────────────────────── */
.ambient {
  position: fixed;
  border-radius: 50%;
  filter: blur(80px);
  pointer-events: none;
  z-index: 0;
  will-change: transform;
  animation: ambientPulse 8s ease-in-out infinite alternate;
}

#ambient-purple {
  width: 600px;
  height: 600px;
  background: radial-gradient(circle, rgba(109, 40, 217, 0.28) 0%, transparent 70%);
  top: -160px;
  left: -160px;
  animation-delay: 0s;
}

#ambient-teal {
  width: 520px;
  height: 520px;
  background: radial-gradient(circle, rgba(20, 184, 166, 0.22) 0%, transparent 70%);
  bottom: -140px;
  right: -140px;
  animation-delay: -4s;
}

@keyframes ambientPulse {
  0% {
    transform: scale(1) translate(0, 0);
  }

  50% {
    transform: scale(1.08) translate(10px, -10px);
  }

  100% {
    transform: scale(0.96) translate(-6px, 8px);
  }
}

/* ─────────────────────────────────────────
   NOISE TEXTURE OVERLAY
───────────────────────────────────────── */
.noise-overlay {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 1;
  opacity: 0.032;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  background-size: 200px 200px;
}

/* ─────────────────────────────────────────
   APP WRAPPER
───────────────────────────────────────── */
.app-wrapper {
  position: relative;
  z-index: 2;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 24px 16px 48px;
  gap: 20px;
}

/* ─────────────────────────────────────────
   HEADER
───────────────────────────────────────── */
.app-header {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  max-width: 480px;
  padding: 6px 0;
}

.logo-mark {
  display: flex;
  align-items: center;
  flex-shrink: 0;
}

.logo-text {
  font-size: 17px;
  font-weight: 700;
  letter-spacing: -0.3px;
  background: linear-gradient(135deg, var(--purple), var(--teal));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  flex: 1;
}

/* ── Connection Status Pill ── */
.status-pill {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 5px 12px 5px 9px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 99px;
  font-size: 11.5px;
  font-weight: 500;
  color: var(--text-secondary);
  transition: border-color 0.3s ease, background 0.3s ease;
}

.status-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--text-muted);
  transition: background 0.4s ease, box-shadow 0.4s ease;
  flex-shrink: 0;
}

/* Pill states driven by JS class on body/pill */
.status-pill.ready {
  border-color: rgba(52, 211, 153, 0.35);
}

.status-pill.ready .status-dot {
  background: var(--success);
  box-shadow: 0 0 8px var(--success);
}

.status-pill.ready .status-label {
  color: var(--success);
}

.status-pill.connected {
  border-color: rgba(167, 139, 250, 0.4);
}

.status-pill.connected .status-dot {
  background: var(--purple);
  box-shadow: 0 0 10px var(--purple);
  animation: dotPulse 1.8s ease-in-out infinite;
}

.status-pill.connected .status-label {
  color: var(--purple);
}

.status-pill.error {
  border-color: rgba(248, 113, 113, 0.35);
}

.status-pill.error .status-dot {
  background: var(--error);
  box-shadow: 0 0 8px var(--error);
}

.status-pill.error .status-label {
  color: var(--error);
}

@keyframes dotPulse {

  0%,
  100% {
    opacity: 1;
    transform: scale(1);
  }

  50% {
    opacity: 0.5;
    transform: scale(0.7);
  }
}

/* ─────────────────────────────────────────
   HUB CARD — Frosted Glass Container
───────────────────────────────────────── */
.hub-card {
  width: 100%;
  max-width: 480px;
  background: var(--surface);
  backdrop-filter: blur(20px) saturate(180%);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-card);
  overflow: hidden;
  animation: cardReveal 0.7s var(--ease-out-expo) both;
}

@keyframes cardReveal {
  from {
    opacity: 0;
    transform: translateY(24px) scale(0.97);
  }

  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

/* ─────────────────────────────────────────
   CARD SECTIONS
───────────────────────────────────────── */
.card-section {
  padding: 24px 28px;
}

.section-label {
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 10px;
}

.section-hint {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 8px;
}

/* ─────────────────────────────────────────
   PEER ID DISPLAY
───────────────────────────────────────── */
.id-display-row {
  display: flex;
  align-items: center;
  gap: 10px;
}

.id-badge {
  font-family: var(--font-mono);
  font-size: 34px;
  font-weight: 500;
  letter-spacing: 0.18em;
  background: linear-gradient(135deg, var(--purple), var(--teal));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  min-width: 140px;
  transition: opacity 0.3s ease;
}

/* Skeleton loader for ID while PeerJS initialises */
.id-skeleton {
  display: flex;
  gap: 6px;
}

.id-skeleton span {
  display: inline-block;
  width: 22px;
  height: 34px;
  border-radius: 6px;
  background: linear-gradient(90deg, rgba(255, 255, 255, 0.06) 25%, rgba(255, 255, 255, 0.12) 50%, rgba(255, 255, 255, 0.06) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.4s ease-in-out infinite;
}

.id-skeleton span:nth-child(2) {
  animation-delay: 0.1s;
}

.id-skeleton span:nth-child(3) {
  animation-delay: 0.2s;
}

.id-skeleton span:nth-child(4) {
  animation-delay: 0.3s;
}

@keyframes shimmer {
  0% {
    background-position: 200% 0;
  }

  100% {
    background-position: -200% 0;
  }
}

/* Icon button (copy) */
.icon-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: var(--radius-sm);
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--text-secondary);
  transition: background 0.2s, border-color 0.2s, color 0.2s, transform 0.15s var(--ease-spring);
  flex-shrink: 0;
}

.icon-btn:hover {
  background: var(--surface-hover);
  border-color: var(--border-active);
  color: var(--purple);
  transform: scale(1.08);
}

.icon-btn:active {
  transform: scale(0.94);
}

/* ─────────────────────────────────────────
   DIVIDER
───────────────────────────────────────── */
.divider {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 0 28px;
}

.divider::before,
.divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--border);
}

.divider span {
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-muted);
  white-space: nowrap;
}

/* ─────────────────────────────────────────
   CONNECT ROW
───────────────────────────────────────── */
.connect-row {
  display: flex;
  gap: 10px;
}

/* Peer ID input field */
.peer-input {
  flex: 1;
  height: 46px;
  padding: 0 16px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  color: var(--text-primary);
  font-family: var(--font-mono);
  font-size: 22px;
  font-weight: 500;
  letter-spacing: 0.2em;
  text-align: center;
  outline: none;
  transition: border-color 0.25s ease, box-shadow 0.25s ease, background 0.25s ease;
  -webkit-appearance: none;
  appearance: none;
}

.peer-input::placeholder {
  color: var(--text-muted);
  letter-spacing: 0.12em;
}

.peer-input:focus {
  border-color: var(--border-active);
  background: rgba(167, 139, 250, 0.06);
  box-shadow: 0 0 0 3px rgba(167, 139, 250, 0.12), 0 0 20px rgba(167, 139, 250, 0.08);
}

/* Connect button */
.connect-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0 20px;
  height: 46px;
  background: linear-gradient(135deg, rgba(139, 92, 246, 0.7), rgba(45, 212, 191, 0.5));
  border: 1px solid rgba(167, 139, 250, 0.4);
  border-radius: var(--radius-md);
  font-size: 13.5px;
  font-weight: 600;
  color: var(--text-primary);
  white-space: nowrap;
  transition: background 0.25s ease, box-shadow 0.25s ease, transform 0.15s var(--ease-spring), opacity 0.25s ease;
  box-shadow: var(--shadow-btn);
}

.connect-btn:hover {
  background: linear-gradient(135deg, rgba(139, 92, 246, 0.9), rgba(45, 212, 191, 0.7));
  box-shadow: 0 6px 32px rgba(167, 139, 250, 0.35);
  transform: translateY(-1px);
}

.connect-btn:active {
  transform: translateY(0) scale(0.97);
}

.connect-btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

.btn-arrow {
  transition: transform 0.2s var(--ease-spring);
}

.connect-btn:hover .btn-arrow {
  transform: translateX(3px);
}

/* ─────────────────────────────────────────
   DROP ZONE
───────────────────────────────────────── */
.drop-zone {
  position: relative;
  border: 1.5px dashed var(--border);
  border-radius: var(--radius-lg);
  padding: 36px 20px;
  text-align: center;
  cursor: pointer;
  transition:
    border-color 0.25s ease,
    background 0.25s ease,
    box-shadow 0.25s ease,
    transform 0.2s var(--ease-spring);
  outline: none;
}

.drop-zone:hover,
.drop-zone:focus-visible {
  border-color: rgba(167, 139, 250, 0.5);
  background: rgba(167, 139, 250, 0.04);
}

/* Drag-over state applied by JS */
.drop-zone.drag-over {
  border-color: var(--purple);
  background: rgba(167, 139, 250, 0.08);
  box-shadow: 0 0 0 4px rgba(167, 139, 250, 0.12), inset 0 0 30px rgba(167, 139, 250, 0.05);
  transform: scale(1.012);
}

.drop-zone.drag-over .drop-icon {
  stroke: var(--purple);
  transform: translateY(-5px) scale(1.08);
}

/* Drop icon animation */
.drop-icon-wrap {
  display: flex;
  justify-content: center;
  margin-bottom: 14px;
}

.drop-icon {
  color: var(--text-muted);
  transition: color 0.25s ease, transform 0.3s var(--ease-spring), stroke 0.25s ease;
}

.drop-title {
  font-size: 14.5px;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 4px;
}

.drop-sub {
  font-size: 13px;
  color: var(--text-muted);
  margin-bottom: 8px;
}

.link-btn {
  color: var(--purple);
  text-decoration: underline;
  text-decoration-color: rgba(167, 139, 250, 0.4);
  text-underline-offset: 2px;
  font-size: inherit;
  font-family: inherit;
  transition: color 0.2s, text-decoration-color 0.2s;
}

.link-btn:hover {
  color: var(--teal);
  text-decoration-color: rgba(45, 212, 191, 0.5);
}

.drop-hint {
  font-size: 11px;
  color: var(--text-muted);
  opacity: 0.7;
}

/* ─────────────────────────────────────────
   FILE QUEUE — Chips
───────────────────────────────────────── */
.file-queue {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 14px;
}

.file-chip {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  animation: chipIn 0.3s var(--ease-spring) both;
}

@keyframes chipIn {
  from {
    opacity: 0;
    transform: translateY(8px) scale(0.97);
  }

  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.chip-icon {
  width: 32px;
  height: 32px;
  border-radius: var(--radius-sm);
  background: var(--purple-dim);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  color: var(--purple);
}

.chip-info {
  flex: 1;
  min-width: 0;
}

.chip-name {
  font-size: 13px;
  font-weight: 500;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.chip-size {
  font-size: 11px;
  color: var(--text-muted);
  font-family: var(--font-mono);
}

.chip-remove {
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  color: var(--text-muted);
  transition: background 0.15s, color 0.15s;
  flex-shrink: 0;
}

.chip-remove:hover {
  background: rgba(248, 113, 113, 0.15);
  color: var(--error);
}

/* ─────────────────────────────────────────
   SEND BUTTON
───────────────────────────────────────── */
.send-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
  margin-top: 14px;
  height: 50px;
  border-radius: var(--radius-md);
  background: linear-gradient(135deg, #7C3AED, #0F766E);
  border: 1px solid rgba(167, 139, 250, 0.3);
  font-size: 14.5px;
  font-weight: 700;
  color: #fff;
  letter-spacing: 0.02em;
  box-shadow: 0 8px 32px rgba(109, 40, 217, 0.3);
  transition: box-shadow 0.25s ease, transform 0.15s var(--ease-spring), opacity 0.25s ease;
}

.send-btn:hover {
  box-shadow: 0 12px 40px rgba(109, 40, 217, 0.45);
  transform: translateY(-2px);
}

.send-btn:active {
  transform: translateY(0) scale(0.98);
}

.send-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
}

/* ─────────────────────────────────────────
   TRANSFER PANEL
───────────────────────────────────────── */
.transfer-panel {
  width: 100%;
  max-width: 480px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  animation: cardReveal 0.5s var(--ease-out-expo) both;
}

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

/* Individual transfer row */
.transfer-row {
  background: var(--surface);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 18px 20px;
  animation: chipIn 0.35s var(--ease-spring) both;
  overflow: hidden;
  position: relative;
}

/* Subtle glow stripe on left edge for active rows */
.transfer-row::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 3px;
  background: linear-gradient(180deg, var(--purple), var(--teal));
  border-radius: 99px 0 0 99px;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.transfer-row.active::before {
  opacity: 1;
}

.transfer-row-header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 12px;
}

.transfer-direction-badge {
  font-size: 9.5px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  padding: 3px 8px;
  border-radius: 99px;
  flex-shrink: 0;
}

.badge-send {
  background: var(--purple-dim);
  color: var(--purple);
  border: 1px solid rgba(167, 139, 250, 0.2);
}

.badge-recv {
  background: var(--teal-dim);
  color: var(--teal);
  border: 1px solid rgba(45, 212, 191, 0.2);
}

.transfer-filename {
  font-size: 13.5px;
  font-weight: 600;
  color: var(--text-primary);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  flex: 1;
}

.transfer-stats {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 10px;
}

.stat-item {
  display: flex;
  flex-direction: column;
  gap: 1px;
}

.stat-label {
  font-size: 9.5px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-muted);
}

.stat-value {
  font-family: var(--font-mono);
  font-size: 13px;
  font-weight: 500;
  color: var(--text-secondary);
}

/* ── Progress Bar ── */
.progress-track {
  height: 5px;
  background: rgba(255, 255, 255, 0.06);
  border-radius: 99px;
  overflow: hidden;
  position: relative;
}

.progress-fill {
  height: 100%;
  width: 0%;
  border-radius: 99px;
  background: linear-gradient(90deg, var(--purple), var(--teal));
  transition: width 0.2s ease;
  position: relative;
  box-shadow: 0 0 10px rgba(167, 139, 250, 0.5);
}

/* Shimmer on progress fill while active */
.progress-fill::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
  background-size: 200% 100%;
  animation: progressShimmer 1.5s ease-in-out infinite;
}

@keyframes progressShimmer {
  0% {
    background-position: -200% 0;
  }

  100% {
    background-position: 200% 0;
  }
}

/* Stop shimmer when done */
.transfer-row.done .progress-fill::after {
  display: none;
}

.transfer-row.done .progress-fill {
  background: linear-gradient(90deg, var(--success), #059669);
  box-shadow: 0 0 10px rgba(52, 211, 153, 0.5);
  transition: background 0.4s ease;
}

.progress-percent {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text-muted);
  text-align: right;
  margin-top: 5px;
}

/* ── Download Button (shown on receive complete) ── */
.download-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-top: 12px;
  padding: 9px 18px;
  border-radius: var(--radius-md);
  background: linear-gradient(135deg, rgba(52, 211, 153, 0.2), rgba(45, 212, 191, 0.15));
  border: 1px solid rgba(52, 211, 153, 0.35);
  font-size: 13px;
  font-weight: 600;
  color: var(--success);
  transition: background 0.2s, transform 0.15s var(--ease-spring);
  animation: chipIn 0.4s var(--ease-spring) both;
}

.download-btn:hover {
  background: linear-gradient(135deg, rgba(52, 211, 153, 0.3), rgba(45, 212, 191, 0.22));
  transform: translateY(-1px);
}

/* ─────────────────────────────────────────
   TOAST NOTIFICATIONS
───────────────────────────────────────── */
.toast-rack {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  z-index: 100;
  pointer-events: none;
  width: 100%;
  max-width: 380px;
  padding: 0 16px;
}

.toast {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 18px;
  background: rgba(15, 20, 35, 0.92);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  font-size: 13.5px;
  font-weight: 500;
  color: var(--text-primary);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5);
  pointer-events: auto;
  animation: toastIn 0.4s var(--ease-spring) both;
  width: 100%;
}

.toast.removing {
  animation: toastOut 0.3s var(--ease-out-expo) both;
}

@keyframes toastIn {
  from {
    opacity: 0;
    transform: translateY(16px) scale(0.95);
  }

  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes toastOut {
  from {
    opacity: 1;
    transform: translateY(0) scale(1);
  }

  to {
    opacity: 0;
    transform: translateY(8px) scale(0.95);
  }
}

.toast-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  flex-shrink: 0;
}

.toast.success .toast-dot {
  background: var(--success);
  box-shadow: 0 0 6px var(--success);
}

.toast.error .toast-dot {
  background: var(--error);
  box-shadow: 0 0 6px var(--error);
}

.toast.info .toast-dot {
  background: var(--purple);
  box-shadow: 0 0 6px var(--purple);
}

.toast.warning .toast-dot {
  background: var(--warning);
  box-shadow: 0 0 6px var(--warning);
}

/* ─────────────────────────────────────────
   FOOTER
───────────────────────────────────────── */
.app-footer {
  font-size: 11px;
  color: var(--text-muted);
  opacity: 0.6;
  text-align: center;
  padding-bottom: 8px;
  margin-top: auto;
}

/* ─────────────────────────────────────────
   SETTINGS / SPEED SELECT
───────────────────────────────────────── */
.speed-select-container {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

/* ─────────────────────────────────────────
   CUSTOM SELECT (Glassmorphic Dropdown)
───────────────────────────────────────── */
.custom-select {
  position: relative;
  width: 100%;
}

.select-trigger {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  height: 46px;
  padding: 0 18px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  color: var(--text-primary);
  font-size: 13.5px;
  font-weight: 500;
  cursor: pointer;
  transition: border-color 0.25s, background-color 0.25s, box-shadow 0.25s;
}

.select-trigger:hover {
  background: var(--surface-hover);
  border-color: var(--border-active);
}

.custom-select.active .select-trigger {
  border-color: var(--border-active);
  box-shadow: 0 0 0 3px rgba(167, 139, 250, 0.12);
  background: rgba(167, 139, 250, 0.03);
}

.select-arrow {
  color: var(--text-secondary);
  transition: transform 0.3s var(--ease-spring);
}

.custom-select.active .select-arrow {
  transform: rotate(180deg);
  color: var(--purple);
}

.select-options {
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  right: 0;
  background: rgba(15, 20, 35, 0.95);
  backdrop-filter: blur(25px);
  -webkit-backdrop-filter: blur(25px);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  box-shadow: 0 16px 48px rgba(0, 0, 0, 0.6);
  z-index: 50;
  opacity: 0;
  pointer-events: none;
  transform: translateY(8px) scale(0.98);
  transition: opacity 0.25s var(--ease-out-expo), transform 0.25s var(--ease-out-expo);
  overflow: hidden;
  padding: 6px;
}

.custom-select.active .select-options {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0) scale(1);
}

.select-option {
  padding: 10px 14px;
  border-radius: 8px;
  font-size: 13.5px;
  color: var(--text-secondary);
  cursor: pointer;
  transition: background 0.15s, color 0.15s, padding-left 0.2s;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.select-option:hover {
  background: rgba(255, 255, 255, 0.05);
  color: var(--text-primary);
  padding-left: 18px;
}

.select-option.selected {
  background: rgba(167, 139, 250, 0.12);
  color: var(--purple);
  font-weight: 600;
}

.select-option.selected::after {
  content: '✓';
  font-size: 12px;
  color: var(--purple);
}

/* ─────────────────────────────────────────
   PWA INSTALL BUTTON
───────────────────────────────────────── */
.install-pwa-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  height: 44px;
  border-radius: var(--radius-md);
  background: var(--purple-dim);
  border: 1px solid rgba(167, 139, 250, 0.3);
  font-size: 13.5px;
  font-weight: 600;
  color: var(--purple);
  transition: background 0.25s, transform 0.15s var(--ease-spring);
}

.install-pwa-btn:hover {
  background: rgba(167, 139, 250, 0.25);
  transform: translateY(-1px);
}

.install-pwa-btn:active {
  transform: translateY(0) scale(0.98);
}

/* ─────────────────────────────────────────
   UTILITY — Hidden
───────────────────────────────────────── */
[hidden] {
  display: none !important;
}

/* ─────────────────────────────────────────
   RESPONSIVE — Mobile Adjustments
───────────────────────────────────────── */
@media (max-width: 520px) {
  .card-section {
    padding: 20px 18px;
  }

  .divider {
    padding: 0 18px;
  }

  .id-badge {
    font-size: 28px;
  }

  .connect-row {
    flex-direction: column;
  }

  .connect-btn {
    width: 100%;
    justify-content: center;
  }

  #ambient-purple {
    width: 360px;
    height: 360px;
    top: -100px;
    left: -100px;
  }

  #ambient-teal {
    width: 300px;
    height: 300px;
    bottom: -80px;
    right: -80px;
  }
}

@media (prefers-reduced-motion: reduce) {

  *,
  *::before,
  *::after {
    animation-duration: 0.001ms !important;
    transition-duration: 0.001ms !important;
  }
}