/* ============================================================
   SPEED DIAL FAB  —  Material Design–style theme switcher
   ============================================================ */

.fab-container {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 9990;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 10px;
}

/* ── Backdrop scrim ─────────────────────────────────── */
.fab-backdrop {
  position: fixed;
  inset: 0;
  z-index: 9985;
  background: transparent;
  pointer-events: none;
  transition: background 0.3s ease;
}
.fab-backdrop.visible {
  background: rgba(0, 0, 0, 0.18);
  pointer-events: all;
}

/* ── Sub-items list ─────────────────────────────────── */
.fab-items {
  display: flex;
  flex-direction: column;
  gap: 8px;
  align-items: flex-end;
  margin-bottom: 4px;
}

.fab-item {
  display: flex;
  align-items: center;
  gap: 10px;
  opacity: 0;
  transform: translateY(10px) scale(0.88);
  pointer-events: none;
  /* close animation — fastest items first */
  transition: opacity 0.2s ease, transform 0.2s ease;
}
.fab-item:nth-child(5) { transition-delay: 0ms; }
.fab-item:nth-child(4) { transition-delay: 15ms; }
.fab-item:nth-child(3) { transition-delay: 30ms; }
.fab-item:nth-child(2) { transition-delay: 45ms; }
.fab-item:nth-child(1) { transition-delay: 60ms; }

/* open state */
.fab-container.open .fab-item {
  opacity: 1;
  transform: none;
  pointer-events: all;
}
.fab-container.open .fab-item:nth-child(1) { transition-delay: 0ms;   }
.fab-container.open .fab-item:nth-child(2) { transition-delay: 45ms;  }
.fab-container.open .fab-item:nth-child(3) { transition-delay: 90ms;  }
.fab-container.open .fab-item:nth-child(4) { transition-delay: 135ms; }
.fab-container.open .fab-item:nth-child(5) { transition-delay: 180ms; }

/* ── Label chip ─────────────────────────────────────── */
.fab-label {
  font-family: var(--font-ui, 'Inter', sans-serif);
  font-size: 0.6875rem;
  font-weight: 500;
  color: #FFFFFF;
  background: rgba(18, 18, 18, 0.9);
  padding: 5px 10px;
  border-radius: 4px;
  white-space: nowrap;
  letter-spacing: 0.01em;
  box-shadow: 0 2px 8px rgba(0,0,0,0.28);
  pointer-events: none;
  line-height: 1;
}

/* ── Mini FAB buttons ───────────────────────────────── */
.fab-btn {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 3px 10px rgba(0,0,0,0.22);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  flex-shrink: 0;
  background: #FFFFFF;
  color: #1C1C1C;
}
.fab-btn:hover {
  transform: scale(1.12);
  box-shadow: 0 5px 18px rgba(0,0,0,0.3);
}
.fab-btn.active {
  outline: 3px solid rgba(255,255,255,0.65);
  outline-offset: 2px;
}
.fab-btn svg {
  width: 18px;
  height: 18px;
  display: block;
  flex-shrink: 0;
}

/* ── Main FAB ───────────────────────────────────────── */
.fab-main {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  border: none;
  background: var(--accent, #E84B2D);
  color: #FFFFFF;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 14px rgba(0,0,0,0.3);
  transition: transform 0.3s ease, box-shadow 0.2s ease, background 0.4s;
  position: relative;
  z-index: 2;
}
.fab-main:hover {
  transform: scale(1.07);
  box-shadow: 0 6px 22px rgba(0,0,0,0.35);
}
.fab-main svg {
  width: 22px;
  height: 22px;
  transition: transform 0.35s ease;
}
.fab-container.open .fab-main svg { transform: rotate(45deg); }


/* ═══════════════════════════════════════════════════════
   THEME-SPECIFIC FAB OVERRIDES
   ═══════════════════════════════════════════════════════ */

/* Tron */
[data-theme="tron"] .fab-main {
  background: transparent;
  border: 2px solid #00E5FF;
  color: #00E5FF;
  box-shadow: 0 0 16px rgba(0,229,255,0.4), inset 0 0 10px rgba(0,229,255,0.06);
}
[data-theme="tron"] .fab-btn {
  background: #020810;
  border: 1px solid rgba(0,229,255,0.4);
  color: #00E5FF;
  box-shadow: 0 0 8px rgba(0,229,255,0.2);
}
[data-theme="tron"] .fab-label {
  background: rgba(2,8,16,0.96);
  border: 1px solid rgba(0,229,255,0.25);
  color: #00E5FF;
  border-radius: 2px;
}

/* 16-bit */
[data-theme="16bit"] .fab-main {
  border-radius: 0;
  border: 3px solid #FFD700;
  box-shadow: 4px 4px 0 0 #FFD700;
}
[data-theme="16bit"] .fab-btn {
  border-radius: 0;
  border: 2px solid #FFD700;
  box-shadow: 3px 3px 0 0 #FFD700;
  background: #16213E;
  color: #FFD700;
}
[data-theme="16bit"] .fab-label {
  border-radius: 0;
  font-family: 'Press Start 2P', monospace;
  font-size: 0.4rem;
  background: #0D1B2A;
  border: 2px solid #FFD700;
  color: #FFD700;
  line-height: 1.6;
}

/* Brick (LEGO-style) */
[data-theme="lego"] .fab-main {
  background: #D9131A;
  border: 3px solid #1B1B1B;
  border-radius: 8px;
  box-shadow: 0 4px 0 #1B1B1B;
  color: #FFD500;
}
[data-theme="lego"] .fab-main:hover { transform: translateY(-2px); box-shadow: 0 6px 0 #1B1B1B; }
[data-theme="lego"] .fab-btn {
  background: #FFD500;
  border: 3px solid #1B1B1B;
  border-radius: 6px;
  color: #1B1B1B;
  box-shadow: 0 3px 0 #1B1B1B;
}
[data-theme="lego"] .fab-btn:hover { transform: translateY(-1px); box-shadow: 0 4px 0 #1B1B1B; }
[data-theme="lego"] .fab-label {
  font-family: 'Fredoka', 'Inter', sans-serif;
  font-weight: 700;
  letter-spacing: 0.06em;
  font-size: 0.65rem;
  text-transform: uppercase;
  background: #1B1B1B;
  color: #FFD500;
  border-radius: 4px;
}

/* Win95 */
[data-theme="win95"] .fab-main {
  border-radius: 0;
  border-top:    2px solid #FFFFFF;
  border-left:   2px solid #FFFFFF;
  border-right:  2px solid #808080;
  border-bottom: 2px solid #808080;
  background: #C0C0C0;
  color: #000000;
  box-shadow: none;
}
[data-theme="win95"] .fab-main:hover { transform: none; }
[data-theme="win95"] .fab-btn {
  border-radius: 0;
  border-top:    2px solid #FFFFFF;
  border-left:   2px solid #FFFFFF;
  border-right:  2px solid #808080;
  border-bottom: 2px solid #808080;
  background: #C0C0C0;
  color: #000000;
  box-shadow: none;
}
[data-theme="win95"] .fab-btn:hover {
  transform: none;
  border-top:    2px solid #808080;
  border-left:   2px solid #808080;
  border-right:  2px solid #FFFFFF;
  border-bottom: 2px solid #FFFFFF;
}
[data-theme="win95"] .fab-label {
  background: #FFFF80;
  color: #000000;
  border: 1px solid #808080;
  border-radius: 0;
  font-family: 'Courier New', monospace;
  font-size: 0.65rem;
  letter-spacing: 0;
}
