/* Fun Mode Toggle Button */
.fun-mode-toggle {
  position: fixed;
  bottom: 20px;
  right: 20px;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: 1px solid var(--border);
  background: var(--theme);
  cursor: pointer;
  font-size: 20px;
  z-index: 10010;
  opacity: 0.6;
  transition: opacity 0.2s ease, transform 0.2s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
}

.fun-mode-toggle:hover {
  opacity: 1;
  transform: scale(1.1);
}

.fun-mode .fun-mode-toggle {
  opacity: 1;
}

/* Settings Button (gear icon) */
.fun-mode-settings {
  position: fixed;
  bottom: 20px;
  right: 72px;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 1px solid var(--border);
  background: var(--theme);
  cursor: pointer;
  font-size: 16px;
  z-index: 10010;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.2s ease, transform 0.2s ease, visibility 0.2s;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
}

.fun-mode-settings:hover {
  transform: scale(1.1) rotate(30deg);
}

.fun-mode .fun-mode-settings {
  opacity: 0.7;
  visibility: visible;
}

.fun-mode .fun-mode-settings:hover {
  opacity: 1;
}

/* Control Panel */
.fun-mode-controls {
  position: fixed;
  bottom: 70px;
  right: 20px;
  width: 200px;
  background: var(--theme);
  border: 1px solid var(--border);
  border-radius: 12px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
  z-index: 10011;
  opacity: 0;
  visibility: hidden;
  transform: translateY(10px) scale(0.95);
  transition: opacity 0.2s ease, transform 0.2s ease, visibility 0.2s;
  overflow: hidden;
}

.fun-mode-controls.visible {
  opacity: 1;
  visibility: visible;
  transform: translateY(0) scale(1);
}

/* Control Panel Header */
.fun-mode-controls-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 12px;
  background: var(--code-bg);
  border-bottom: 1px solid var(--border);
  font-size: 12px;
  font-weight: 600;
  color: var(--primary);
}

.fun-mode-controls-close {
  background: none;
  border: none;
  font-size: 18px;
  cursor: pointer;
  color: var(--secondary);
  padding: 0;
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 4px;
  transition: background 0.2s ease, color 0.2s ease;
}

.fun-mode-controls-close:hover {
  background: var(--border);
  color: var(--primary);
}

/* Control Panel Body */
.fun-mode-controls-body {
  padding: 8px;
}

/* Individual Control */
.fun-mode-control {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border-radius: 8px;
  cursor: pointer;
  transition: background 0.2s ease;
}

.fun-mode-control:hover {
  background: var(--code-bg);
}

.fun-mode-control input[type="checkbox"] {
  width: 18px;
  height: 18px;
  margin: 0;
  cursor: pointer;
  accent-color: var(--primary);
}

.fun-mode-control-icon {
  font-size: 18px;
  width: 24px;
  text-align: center;
}

.fun-mode-control-label {
  font-size: 13px;
  color: var(--primary);
  flex: 1;
}

/* Disabled state styling */
.fun-mode-control input[type="checkbox"]:not(:checked) + .fun-mode-control-icon {
  opacity: 0.5;
}

.fun-mode-control input[type="checkbox"]:not(:checked) ~ .fun-mode-control-label {
  opacity: 0.6;
}

/* Mobile adjustments */
@media (max-width: 768px) {
  .fun-mode-controls {
    right: 10px;
    bottom: 65px;
    width: 180px;
  }

  .fun-mode-toggle {
    right: 10px;
    bottom: 10px;
    width: 40px;
    height: 40px;
  }

  .fun-mode-settings {
    right: 58px;
    bottom: 14px;
    width: 32px;
    height: 32px;
    font-size: 14px;
  }
}
