/* ALL CSS STYLES RETAINED EXACTLY AS THEY WERE IN YOUR UPLOADED FILE */
:root {
  --highlight-color: #00f9ff;
}
body {
  font-family: "Inter", sans-serif;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  background: linear-gradient(
    to right,
    #f3f4f6 0%,
    #ede9fe 20%,
    #ede9fe 80%,
    #f3f4f6 100%
  );
}

/* --- UNIVERSAL SPLASH SCREEN --- */
#splash-screen {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: linear-gradient(
    to right,
    #f3f4f6 0%,
    #ede9fe 20%,
    #ede9fe 80%,
    #f3f4f6 100%
  );
  z-index: 100000; /* Extremely high to cover everything */
  display: flex;
  justify-content: center;
  align-items: center;
  transition:
    opacity 0.5s ease-out,
    visibility 0.5s ease-out;
}
#splash-screen.hidden {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}
.splash-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1rem;
  animation: pulse-splash 1.5s infinite;
}
.splash-content img {
  width: 6rem;
  height: 6rem;
  border-radius: 50%;
  border: 2px solid #a855f7;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
}
@keyframes pulse-splash {
  0%,
  100% {
    opacity: 1;
    transform: scale(1);
  }
  50% {
    opacity: 0.6;
    transform: scale(0.98);
  }
}

/* --- Micro-Tactile Press Interactions --- */
.item:active,
.chosen-item:active {
  /* Mimics the physical feeling of pressing down slightly off-center on a card */
  transform: scale(0.98) rotate(-0.5deg) !important;
  /* Ultra-fast snap down */
  transition: transform 0.05s cubic-bezier(0.4, 0, 0.2, 1) !important;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1) !important;
}

.item {
  margin-bottom: 1rem;
  padding: 2rem 1.5rem;
  font-size: clamp(1rem, 1.17rem, 1.5rem);
  background: linear-gradient(135deg, #ffffff 0%, #f8fafc 100%);
  border: 1px solid #e2e8f0;
  border-radius: 0.75rem;
  box-shadow:
    0 2px 4px rgba(0, 0, 0, 0.05),
    0 8px 16px rgba(0, 0, 0, 0.05);
  transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
  cursor: pointer;
  position: relative;
  min-height: 120px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  text-align: center;
}
.item::before {
  content: "\f005";
  font-family: "Font Awesome 6 Free", "Font Awesome 5 Free", "FontAwesome";
  font-weight: 400;
  position: absolute;
  top: 10px;
  left: 12px;
  font-size: 0.95rem;
  color: #a0aec0;
  line-height: 1;
  opacity: 0.75;
  cursor: pointer;
  transition: all 0.2s ease-in-out;
  z-index: 5;
  padding: 5px;
  margin-left: -5px;
  margin-top: -5px;
}
/* --- Playful Star Pop Animation --- */
@keyframes starPop {
  0% {
    transform: scale(0.8);
  }
  40% {
    transform: scale(1.4) rotate(15deg);
  }
  70% {
    transform: scale(0.95) rotate(-5deg);
  }
  100% {
    transform: scale(1.1) rotate(0deg);
  }
}

.item.is-saved::before {
  font-weight: 900;
  color: #ffd700;
  opacity: 1;
  transform: scale(1.1);
  animation: starPop 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}
.item::before:hover {
  opacity: 1;
  transform: scale(1.15);
}
.item::after {
  content: attr(data-qn);
  position: absolute;
  top: 8px;
  right: 10px;
  font-size: 0.75rem;
  color: #6b7280;
  background: #eef2ff;
  border: 1px solid #e5e7eb;
  padding: 2px 6px;
  border-radius: 9999px;
  line-height: 1;
  opacity: 0.85;
  pointer-events: none;
  display: none;
}
.item[data-qn]:not([data-qn=""])::after {
  display: inline-block;
}
.item.selected-item {
  background: linear-gradient(135deg, #ffffff 0%, var(--highlight-color) 100%);
  /* Inherits padding and font-size from .item so the layout doesn't jump */
  transform: translateY(-4px) scale(1.01); /* Lifts up slightly instead of blowing up */
  box-shadow:
    0 12px 20px rgba(0, 0, 0, 0.15),
    0 0 0 2px rgba(168, 85, 247, 0.3); /* Adds a subtle purple ring */
  z-index: 10;
}
.chosen-item {
  display: flex;
  flex-direction: column;
  justify-content: center;
  margin-bottom: 1rem;
  padding: 1.5rem 1.5rem;
  font-size: clamp(1rem, 1.17rem, 1.5rem);
  background: linear-gradient(135deg, #ffffff 0%, #fdfbf7 100%);
  border: 1px solid #e2e8f0;
  border-radius: 0.75rem;
  box-shadow:
    0 2px 4px rgba(0, 0, 0, 0.05),
    0 6px 12px rgba(0, 0, 0, 0.05);
  transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
  cursor: pointer;
  text-align: center;
  position: relative;
  min-height: 100px;
}
.chosen-item::before {
  content: "\f005";
  font-family: "Font Awesome 6 Free", "Font Awesome 5 Free", "FontAwesome";
  font-weight: 900;
  position: absolute;
  top: 10px;
  left: 12px;
  font-size: 0.95rem;
  color: #ffd700;
  line-height: 1;
  opacity: 1;
  cursor: pointer;
  transition: all 0.2s ease-in-out;
  z-index: 5;
  padding: 5px;
  margin-left: -5px;
  margin-top: -5px;
}
.chosen-item::before:hover {
  opacity: 0.8;
  transform: scale(1.15);
}
.chosen-item-text {
  font-size: clamp(1rem, 1.17rem, 1.5rem);
  color: #1f2937;
  font-weight: 500;
  line-height: 1.4;
  letter-spacing: -0.01em;
  text-wrap: balance;
  flex-grow: 1;
  min-width: 0;
  overflow-wrap: anywhere;
  margin-bottom: 0.5rem;
}
.item-main-text {
  display: block;
  color: #1f2937;
  font-weight: 500;
  line-height: 1.4;
  letter-spacing: -0.01em;
  text-wrap: balance;
}
.prompt-subtitle {
  font-size: 0.85em;
  color: #4b5563;
  font-weight: 400;
  line-height: 1.5;
  letter-spacing: 0.01em;
  text-align: center;
  text-wrap: balance;

  /* Smooth expansion properties */
  max-height: 0;
  opacity: 0;
  margin-top: 0;
  padding-top: 0;
  border-top: 1px dashed transparent;
  overflow: hidden;
  transition:
    max-height 0.3s ease-in-out,
    opacity 0.3s ease-in-out,
    margin-top 0.3s ease-in-out,
    padding-top 0.3s ease-in-out,
    border-color 0.3s ease-in-out;
}

body.show-subtitles .prompt-subtitle {
  /* Safely increased to accommodate expanded text blocks post-flip */
  max-height: 800px;
  opacity: 1;
  margin-top: 0.75rem;
  padding-top: 0.75rem;
  border-top-color: #cbd5e1;
}
.note-container {
  margin-top: 0.75rem;
  display: none;
  margin-left: -2.25rem;
  margin-right: -2.25rem;
  padding: 0 1rem;
}
#chosen-questions-display.notes-visible .note-container {
  display: block;
}
.note-textarea {
  width: 100%;
  font-size: 0.9rem;
  color: #374151;
  border: 1px solid #d1d5db;
  border-radius: 0.5rem;
  padding: 0.5rem;
  resize: none;
  min-height: 38px;
  height: 38px;
  overflow-y: hidden;
  background: #f9fafb;
  transition:
    border-color 0.15s,
    box-shadow 0.15s,
    background-color 0.15s;
  line-height: 1.4;
}
.note-textarea::placeholder {
  color: #9ca3af;
}
.note-textarea:focus {
  background: #ffffff;
  border-color: #8b5cf6;
  box-shadow: 0 0 0 2px rgba(139, 92, 246, 0.2);
  outline: none;
}
.switch {
  position: relative;
  display: inline-block;
  width: 38px;
  height: 22px;
  margin-right: 0.5rem;
  vertical-align: middle;
  transform: scale(0.9); /* Increased from 0.85 */
}

/* Added to keep the "Filter by cities/category" toggle untouched */
#subcat-filter-wrapper .switch {
  transform: scale(0.85);
}

.switch input {
  opacity: 0;
  width: 0;
  height: 0;
}
.slider {
  position: absolute;
  cursor: pointer;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: #ccc;
  -webkit-transition: 0.4s;
  transition: 0.4s;
  border-radius: 22px;
}
.slider:before {
  position: absolute;
  content: "";
  height: 16px;
  width: 16px;
  left: 3px;
  bottom: 3px;
  background-color: white;
  -webkit-transition: 0.4s;
  transition: 0.4s;
  border-radius: 50%;
}
input:checked + .slider {
  background-color: #8b5cf6;
}
input:focus + .slider {
  box-shadow: 0 0 1px #8b5cf6;
}
input:checked + .slider:before {
  -webkit-transform: translateX(16px);
  -ms-transform: translateX(16px);
  transform: translateX(16px);
}
.chosen-item::after {
  content: attr(data-qn);
  position: absolute;
  top: 8px;
  right: 10px;
  font-size: 0.72rem;
  color: #6b7280;
  background: #eef2ff;
  border: 1px solid #e5e7eb;
  padding: 2px 6px;
  border-radius: 9999px;
  line-height: 1;
  opacity: 0.85;
  pointer-events: none;
  display: none;
}
.chosen-item[data-qn]:not([data-qn=""])::after {
  display: inline-block;
}
.chosen-item.selected-chosen-item {
  background: linear-gradient(135deg, #ffffff 0%, var(--highlight-color) 100%);
  /* Inherits padding and font-size from .chosen-item */
  transform: translateY(-4px) scale(1.01);
  box-shadow:
    0 12px 20px rgba(0, 0, 0, 0.15),
    0 0 0 2px rgba(168, 85, 247, 0.3);
  z-index: 10;
}
/* Removed overriding chosen-item-text font-size to prevent layout thrashing */
/* --- BACK TO TOP BUTTON --- */
#back-to-top {
  position: fixed;
  bottom: 20px;
  right: 20px;
  width: 56px;
  height: 56px;
  background-color: rgba(255, 255, 255, 0.95);
  color: #6b7280;
  font-size: 1.25rem;
  border: 1px solid #e5e7eb;
  border-radius: 50%;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  cursor: pointer;
  display: none;
  align-items: center;
  justify-content: center;
  opacity: 0.85;
  transition: all 0.3s ease-in-out;
  z-index: 1000;
}

#back-to-top:hover {
  background-color: #ffffff;
  color: #7c3aed;
  border-color: #d8b4fe;
  transform: translateY(-3px);
  box-shadow: 0 6px 14px rgba(0, 0, 0, 0.15);
  opacity: 1;
}

/* --- FLOATING DICE --- */
#floating-dice {
  position: fixed;
  bottom: 20px;
  right: 20px;
  width: 56px;
  height: 56px;
  background-color: rgba(255, 255, 255, 0.95);
  color: #6b7280;
  border: 1px solid #e5e7eb;
  border-radius: 50%;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  z-index: 1100;
  opacity: 0.85;
  transition: all 0.3s ease-in-out;
}
#floating-dice i {
  font-size: 1.25rem;
}
#floating-dice:hover,
#floating-dice:focus {
  background-color: #ffffff;
  color: #7c3aed;
  border-color: #d8b4fe;
  transform: translateY(-3px);
  box-shadow: 0 6px 14px rgba(0, 0, 0, 0.15);
  outline: none;
  opacity: 1;
}
#floating-dice:active {
  transform: translateY(0) scale(0.98);
}
#floating-join {
  position: fixed;
  bottom: 88px;
  right: 20px;
  width: 56px;
  height: 56px;
  border-radius: 9999px;
  background: linear-gradient(135deg, #3b82f6, #10b981);
  color: #ffffff;
  display: none !important;
  align-items: center;
  justify-content: center;
  box-shadow: 0 8px 16px rgba(0, 0, 0, 0.15);
  text-decoration: none;
  z-index: 1120;
  transition:
    transform 0.15s ease-in-out,
    box-shadow 0.2s ease-in-out,
    filter 0.2s,
    bottom 0.2s ease-in-out;
}
#floating-join i {
  font-size: 1.17rem;
}
#floating-join:hover,
#floating-join:focus {
  transform: translateY(-2px) scale(1.03);
  box-shadow: 0 10px 18px rgba(0, 0, 0, 0.2);
  outline: none;
  filter: brightness(1.05);
}
#floating-join:active {
  transform: translateY(0) scale(0.98);
}
#floating-lookup {
  position: fixed;
  bottom: 20px;
  right: 20px;
  width: 56px;
  height: 56px;
  border-radius: 9999px;
  background: linear-gradient(135deg, #3b82f6, #10b981);
  color: #ffffff;
  display: none;
  align-items: center;
  justify-content: center;
  box-shadow: 0 8px 16px rgba(0, 0, 0, 0.15);
  text-decoration: none;
  z-index: 1150;
  transition:
    transform 0.15s ease-in-out,
    box-shadow 0.2s ease-in-out,
    filter 0.2s,
    bottom 0.2s ease-in-out;
  cursor: pointer;
}
#floating-lookup i {
  font-size: 1.17rem;
}
#floating-lookup:hover,
#floating-lookup:focus {
  transform: translateY(-2px) scale(1.03);
  box-shadow: 0 10px 18px rgba(0, 0, 0, 0.2);
  outline: none;
  filter: brightness(1.05);
}
#floating-lookup:active {
  transform: translateY(0) scale(0.98);
}
#floating-copy {
  position: fixed;
  bottom: 88px;
  right: 20px;
  width: 56px;
  height: 56px;
  border-radius: 9999px;
  background: linear-gradient(135deg, #a855f7, #ec4899);
  color: #ffffff;
  display: none;
  align-items: center;
  justify-content: center;
  box-shadow: 0 8px 16px rgba(0, 0, 0, 0.15);
  text-decoration: none;
  z-index: 1140;
  transition:
    transform 0.15s ease-in-out,
    box-shadow 0.2s ease-in-out,
    filter 0.2s,
    bottom 0.2s ease-in-out;
  cursor: pointer;
}
#floating-copy i {
  font-size: 1.15rem;
}
#floating-copy:hover,
#floating-copy:focus {
  transform: translateY(-2px) scale(1.03);
  box-shadow: 0 10px 18px rgba(0, 0, 0, 0.2);
  outline: none;
  filter: brightness(1.05);
}
#floating-copy:active {
  transform: translateY(0) scale(0.98);
}

@media (max-width: 480px) {
  .item,
  .chosen-item {
    padding-left: 1.75rem;
    padding-right: 1rem;
  }
  .item.selected-item,
  .chosen-item.selected-chosen-item {
    padding-left: 1.75rem;
    padding-right: 1rem;
  }
  .item::before,
  .chosen-item::before {
    left: 8px;
  }

  #floating-dice {
    width: 52px;
    height: 52px;
    bottom: 16px;
    right: 16px;
  }
  #floating-dice i {
    font-size: 1.17rem;
  }
  #floating-join {
    width: 52px;
    height: 52px;
    right: 16px;
    bottom: 80px;
  }
  #floating-join i {
    font-size: 1.15rem;
  }
  #back-to-top {
    bottom: 16px;
    right: 16px; /* Match the mobile right alignment */
    width: 52px; /* Match the mobile dice size */
    height: 52px; /* Match the mobile dice size */
    font-size: 1.15rem; /* Slightly larger icon for the bigger button */
  }
  #floating-lookup {
    width: 52px;
    height: 52px;
    right: 16px;
    bottom: 16px;
  }
  #floating-lookup i {
    font-size: 1.15rem;
  }
  #floating-copy {
    width: 52px;
    height: 52px;
    right: 16px;
    bottom: 80px;
  }
  #floating-copy i {
    font-size: 1.05rem;
  }
}

#back-to-topics {
  background-color: #c53030;
  color: white;
  border: none;
  padding: 0.5rem 1rem;
  font-size: 1rem;
  font-weight: bold;
  border-radius: 9999px;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
  cursor: pointer;
  transition: all 0.3s ease-in-out;
  width: 100%;
  margin-top: 1rem;
  margin-bottom: 0;
  display: block;
  text-align: center;
}
#back-to-topics:hover {
  background-color: #9b2c2c;
  box-shadow: 0 6px 8px rgba(0, 0, 0, 0.15);
}

#clear-chosen-button {
  background-color: #fc8181;
  color: white;
  font-weight: bold;
  padding: 0.5rem 1rem;
  font-size: 1rem;
  border-radius: 9999px;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
  cursor: pointer;
  width: 100%;
  margin-top: 1rem;
  transition: all 0.3s ease-in-out;
}
#clear-chosen-button:hover {
  background-color: #f56565;
  box-shadow: 0 6px 8px rgba(0, 0, 0, 0.15);
}
#clear-chosen-button.clear-selected {
  background-color: #fecaca;
  color: #7f1d1d;
}
#clear-chosen-button.clear-selected:hover {
  background-color: #fca5a5;
}

#random-result {
  min-height: 60px;
}

.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.6);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 10050; /* Fix: Elevate above the 9999 bottom nav */
  opacity: 0;
  visibility: hidden;
  transition:
    opacity 0.3s ease-in-out,
    visibility 0.3s ease-in-out;
}
.modal-overlay.show {
  opacity: 1;
  visibility: visible;
}

.modal-content {
  background-color: white;
  padding: 2rem;
  border-radius: 0.75rem;
  box-shadow: 0 10px 15px rgba(0, 0, 0, 0.2);
  text-align: center;
  max-width: 400px;
  width: 90%;
  transform: translateY(-20px);
  transition: transform 0.3s;
  /* Accessibility constraints for large text scaling */
  max-height: 90vh;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
}

.modal-overlay.show .modal-content {
  transform: translateY(0);
}

.modal-buttons {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  margin-top: 1.5rem;
}

.modal-button {
  padding: 0.75rem 1.5rem;
  border-radius: 9999px;
  font-weight: bold;
  cursor: pointer;
  transition: all 0.2s ease-in-out;
}

.modal-button.confirm {
  background-color: #c53030;
  color: white;
}
.modal-button.confirm:hover {
  background-color: #9b2c2c;
}

.modal-button.cancel {
  background-color: #e2e8f0;
  color: #4a5568;
}
.modal-button.cancel:hover {
  background-color: #cbd5e0;
}

.filter-btn {
  padding: 0.5rem 1rem;
  border-radius: 9999px;
  border: 1px solid #d1d5db;
  background-color: #ffffff;
  color: #4b5563;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease-in-out;
  font-size: 0.9rem;
}
.filter-btn:hover {
  background-color: #f3f4f6;
}
.filter-btn.active {
  background-color: #8b5cf6;
  color: #ffffff;
  border-color: #8b5cf6;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

/* --- Dual-Thumb Slider Styles --- */
input[type="range"]::-webkit-slider-thumb {
  appearance: none;
  pointer-events: auto;
  width: 24px;
  height: 24px;
  background-color: #ffffff;
  border: 2px solid #8b5cf6;
  border-radius: 50%;
  cursor: grab;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.15);
  transition:
    transform 0.1s ease,
    box-shadow 0.1s ease;
}
input[type="range"]::-webkit-slider-thumb:active {
  cursor: grabbing;
  transform: scale(1.15);
  box-shadow: 0 3px 8px rgba(139, 92, 246, 0.3);
}
input[type="range"]::-moz-range-thumb {
  pointer-events: auto;
  width: 24px;
  height: 24px;
  background-color: #ffffff;
  border: 2px solid #8b5cf6;
  border-radius: 50%;
  cursor: grab;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.15);
  transition:
    transform 0.1s ease,
    box-shadow 0.1s ease;
}
input[type="range"]::-moz-range-thumb:active {
  cursor: grabbing;
  transform: scale(1.15);
  box-shadow: 0 3px 8px rgba(139, 92, 246, 0.3);
}

.loading-spinner-modal {
  border: 4px solid #f3f3f3;
  border-top: 4px solid #a855f7;
  border-radius: 50%;
  width: 40px;
  height: 40px;
  animation: spin 1s linear infinite;
  margin: 20px auto;
}
@keyframes spin {
  0% {
    transform: rotate(0deg);
  }
  100% {
    transform: rotate(360deg);
  }
}

.description-link-container {
  display: flex;
  justify-content: center;
  align-items: center;
  margin-top: -0.5rem;
  margin-bottom: 1rem;
  font-size: 0.9rem;
  color: #6b46c1;
}
.description-link {
  display: inline-flex;
  align-items: center;
  text-align: center;
  color: #6b46c1;
  font-weight: 500;
  text-decoration: none;
  transition: color 0.2s ease-in-out;
  border: none;
  background: none;
  cursor: pointer;
  padding: 0;
}
.description-link:hover {
  color: #805ad5;
  text-decoration: underline;
}
.description-link i {
  margin-right: 0.35rem;
}
.separator {
  display: inline-flex;
  align-items: center;
  margin: 0 0.45rem;
  color: #6b46c1;
  font-size: 1em;
  height: 1em;
  opacity: 0.5;
}

#qr-modal-content {
  max-width: 350px;
  padding: 1.5rem;
  position: relative;
}
#qr-modal-content img {
  width: 100%;
  height: auto;
  max-width: 250px;
  margin: 0 auto 1rem auto;
  display: block;
  border-radius: 0.5rem;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}
.qr-modal-close-button {
  position: absolute;
  top: 0.75rem;
  right: 0.75rem;
  background: none;
  border: none;
  font-size: 1.5rem;
  cursor: pointer;
  color: #4a5568;
  line-height: 1;
  padding: 0.25rem;
  border-radius: 50%;
  transition:
    background-color 0.2s,
    color 0.2s;
}
.qr-modal-close-button:hover {
  background-color: #e2e8f0;
  color: #2d3748;
}
.qr-code-link {
  font-size: 0.875rem;
  color: #6b46c1;
  text-decoration: none;
  transition:
    color 0.2s ease-in-out,
    text-decoration 0.2s ease-in-out;
  display: flex;
  align-items: center;
  gap: 0.25rem;
  margin-top: 0.5rem;
  justify-content: center;
}
.qr-code-link:hover {
  color: #805ad5;
  text-decoration: underline;
}

#search-google-choice-btn {
  background-color: #4285f4;
  color: white;
  font-weight: bold;
  padding: 0.5rem 1rem;
  font-size: 0.9rem;
  border-radius: 9999px;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
  cursor: pointer;
  transition: all 0.3s ease-in-out;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 0.5rem;
}
#search-google-choice-btn:hover {
  background-color: #357ae8;
  box-shadow: 0 6px 8px rgba(0, 0, 0, 0.15);
}
#search-google-choice-btn i {
  margin-right: 0.5rem;
}

#search-bing-choice-btn {
  background-color: #008ad6;
  color: white;
  font-weight: bold;
  padding: 0.5rem 1rem;
  font-size: 0.9rem;
  border-radius: 9999px;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
  cursor: pointer;
  transition: all 0.3s ease-in-out;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 0.5rem;
}
#search-bing-choice-btn:hover {
  background-color: #006fb7;
  box-shadow: 0 6px 8px rgba(0, 0, 0, 0.15);
}
#search-bing-choice-btn i {
  margin-right: 0.5rem;
}

#search-duckduckgo-choice-btn {
  background-color: #e3722a;
  color: white;
  font-weight: bold;
  padding: 0.5rem 1rem;
  font-size: 0.9rem;
  border-radius: 9999px;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
  cursor: pointer;
  transition: all 0.3s ease-in-out;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 0.5rem;
}
#search-duckduckgo-choice-btn:hover {
  background-color: #c96024;
  box-shadow: 0 6px 8px rgba(0, 0, 0, 0.15);
}
#search-duckduckgo-choice-btn i {
  margin-right: 0.5rem;
}

#search-brave-choice-btn {
  background-color: #fb542b;
  color: white;
  font-weight: bold;
  padding: 0.5rem 1rem;
  font-size: 0.9rem;
  border-radius: 9999px;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
  cursor: pointer;
  transition: all 0.3s ease-in-out;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 0.5rem;
}
#search-brave-choice-btn:hover {
  background-color: #d14424;
  box-shadow: 0 6px 8px rgba(0, 0, 0, 0.15);
}
#search-brave-choice-btn i {
  margin-right: 0.5rem;
}

#search-qwant-choice-btn {
  background-color: #000000;
  color: white;
  font-weight: bold;
  padding: 0.5rem 1rem;
  font-size: 0.9rem;
  border-radius: 9999px;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
  cursor: pointer;
  transition: all 0.3s ease-in-out;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 0.5rem;
}
#search-qwant-choice-btn:hover {
  background-color: #333333;
  box-shadow: 0 6px 8px rgba(0, 0, 0, 0.15);
}
#search-qwant-choice-btn i {
  margin-right: 0.5rem;
}

#translate-google-choice-btn {
  background-color: #60a5fa;
  color: white;
  font-weight: bold;
  padding: 0.5rem 1rem;
  font-size: 0.9rem;
  border-radius: 9999px;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
  cursor: pointer;
  transition: all 0.3s ease-in-out;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 0.5rem;
}
#translate-google-choice-btn:hover {
  background-color: #3b82f6;
  box-shadow: 0 6px 8px rgba(0, 0, 0, 0.15);
}
#translate-google-choice-btn i {
  margin-right: 0.5rem;
}

#translate-bing-choice-btn {
  background-color: #008ad6;
  color: white;
  font-weight: bold;
  padding: 0.5rem 1rem;
  font-size: 0.9rem;
  border-radius: 9999px;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
  cursor: pointer;
  transition: all 0.3s ease-in-out;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 0.5rem;
}
#translate-bing-choice-btn:hover {
  background-color: #006fb7;
  box-shadow: 0 6px 8px rgba(0, 0, 0, 0.15);
}
#translate-bing-choice-btn i {
  margin-right: 0.5rem;
}

#translate-deepl-choice-btn {
  background-color: #0f2b46;
  color: white;
  font-weight: bold;
  padding: 0.5rem 1rem;
  font-size: 0.9rem;
  border-radius: 9999px;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
  cursor: pointer;
  transition: all 0.3s ease-in-out;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 0.5rem;
}
#translate-deepl-choice-btn:hover {
  background-color: #0a1e31;
  box-shadow: 0 6px 8px rgba(0, 0, 0, 0.15);
}
#translate-deepl-choice-btn i {
  margin-right: 0.5rem;
}

.modal-subheading {
  font-size: 0.9rem;
  font-weight: 600;
  color: #4b5563;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-top: 0.75rem;
  margin-bottom: 0.5rem;
  text-align: center;
  border-bottom: none;
  padding-bottom: 0;
}

.getting-started-list {
  list-style-type: none;
  padding-left: 0;
  text-align: left;
  counter-reset: step-counter;
}
.getting-started-list li {
  margin-bottom: 0.75rem;
  padding-left: 1.5rem;
  position: relative;
}
.getting-started-list li::before {
  content: counter(step-counter);
  counter-increment: step-counter;
  position: absolute;
  left: 0;
  top: 0;
  background-color: #9f7aea;
  color: white;
  border-radius: 50%;
  width: 20px;
  height: 20px;
  display: flex;
  justify-content: center;
  align-items: center;
  font-size: 0.8rem;
  font-weight: bold;
}

#getting-started-modal .getting-started-list a {
  color: #0000ee !important;
  font-weight: normal !important;
  background: none !important;
  border: none !important;
  text-decoration: none !important;
  cursor: pointer;
}
#getting-started-modal .getting-started-list a:hover,
#getting-started-modal .getting-started-list a:focus {
  color: #551a8b !important;
  text-decoration: underline !important;
  outline: none;
}
#getting-started-modal .getting-started-list a:active {
  color: #551a8b !important;
}

#inline-share-trigger {
  background: none;
  border: none;
  padding: 0;
  margin: 0;
  color: #0000ee;
  font-style: italic;
  cursor: pointer;
}
#inline-share-trigger:hover,
#inline-share-trigger:focus {
  text-decoration: underline;
  color: #551a8b;
  outline: none;
}

#modal-goto-saved-trigger {
  background: none;
  border: none;
  padding: 0;
  margin: 0;
  color: #0000ee !important;
  font-style: italic;
  cursor: pointer;
}
#modal-goto-saved-trigger:hover,
#modal-goto-saved-trigger:focus {
  color: #551a8b !important;
  text-decoration: underline;
  outline: none;
}

.bottom-tip {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  color: #4b5563;
  background: #f3f4f6;
  border: 1px dashed #d1d5db;
  border-radius: 9999px;
  padding: 0.5rem 0.875rem;
  font-size: 0.9rem;
  margin-top: 0.75rem;
  user-select: none;
}
.bottom-tip i {
  color: #f59e0b;
}

.category-filter-btn {
  padding: 0.4rem 0.7rem;
  border: 1px solid #c4b5fd;
  border-radius: 9999px;
  background-color: #ffffff;
  color: #6b46c1;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease-in-out;
  font-size: 0.875rem;
}
.category-filter-btn:hover {
  background-color: #f5f3ff;
  border-color: #a78bfa;
}
.category-filter-btn.active {
  background-color: #6b46c1;
  color: #ffffff;
  border-color: #6b46c1;
}

#copy-notification-modal .modal-buttons {
  flex-direction: column;
  gap: 0.75rem;
}
#share-from-copy-modal-btn {
  background-color: #ffffff;
  color: #a855f7;
  border: 2px solid #e9d5ff;
}
#share-from-copy-modal-btn:hover {
  background-color: #f3e8ff;
  border-color: #d8b4fe;
}

#feedback-from-copy-modal-btn {
  background-color: #64748b;
  color: white;
  text-decoration: none;
  display: flex;
  align-items: center;
  justify-content: center;
}
#feedback-from-copy-modal-btn:hover {
  background-color: #475569;
}

#join-session-from-copy-modal-btn {
  background: linear-gradient(to right, #10b981, #06b6d4);
  color: white;
  text-decoration: none;
  display: flex;
  align-items: center;
  justify-content: center;
}
#join-session-from-copy-modal-btn:hover {
  background-color: #2563eb;
}

#first-time-save-modal .modal-buttons {
  justify-content: center;
}
#first-time-save-modal .modal-content {
  max-width: 320px;
}
#close-first-time-save-modal {
  background-color: #8b5cf6;
  color: white;
}
#close-first-time-save-modal:hover {
  background-color: #7c3aed;
}

/* --- TOP LEFT BACK BUTTON --- */
.top-left-back-btn {
  position: absolute;
  top: 1.5rem;
  left: 1.5rem;
  background: rgba(255, 255, 255, 0.7);
  border: 1px solid #e5e7eb;
  color: #6b7280;
  font-weight: 600;
  font-size: 0.9rem;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.5rem 0.8rem;
  border-radius: 9999px;
  transition: all 0.2s ease;
  font-family: "Inter", sans-serif;
  z-index: 50;
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.02);
}

.top-left-back-btn:hover {
  background: #ffffff;
  color: #7c3aed;
  border-color: #d8b4fe;
  transform: translateX(-2px);
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
}

/* --- TOP RIGHT STAR BUTTON --- */
.top-right-star-btn {
  position: absolute;
  top: 1.5rem;
  right: 1.5rem;
  background: rgba(255, 255, 255, 0.7);
  border: 1px solid #e5e7eb;
  color: #6b7280;
  font-size: 1.1rem;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  transition: all 0.2s ease;
  z-index: 50;
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.02);
}

.top-right-star-btn:hover {
  background: #ffffff;
  transform: scale(1.05);
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
}

.top-right-star-btn.is-starred {
  color: #eab308;
  border-color: #fef08a;
  background: #fef9c3;
  animation: starPop 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

@media (max-width: 768px) {
  .top-left-back-btn {
    top: 1rem;
    left: 1rem;
    padding: 0.4rem 0.7rem;
    font-size: 0.85rem;
  }
  .top-right-star-btn {
    top: 1rem;
    right: 1rem;
    width: 32px;
    height: 32px;
    font-size: 1rem;
  }
}

@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}
.fade-in-up {
  animation: fadeInUp 0.4s ease-out forwards;
}

/* --- 3D Flashcard Flip (X-Axis) --- */
.card-flip-out-x {
  animation: flipOutX 0.2s ease-in forwards;
  pointer-events: none;
}

.card-flip-in-x {
  animation: flipInX 0.3s ease-out forwards;
}

@keyframes flipOutX {
  0% {
    transform: perspective(1000px) rotateX(0deg);
    opacity: 1;
  }
  100% {
    transform: perspective(1000px) rotateX(90deg);
    opacity: 0;
  }
}

@keyframes flipInX {
  0% {
    transform: perspective(1000px) rotateX(-90deg);
    opacity: 0;
  }
  100% {
    transform: perspective(1000px) rotateX(0deg);
    opacity: 1;
  }
}

.searching-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 2rem 0;
  color: #6b46c1;
}
.searching-spinner {
  font-size: 1.5rem;
  margin-bottom: 0.5rem;
  animation: spin 1s linear infinite;
}

.focus-btn {
  position: absolute;
  top: 6px;
  right: 6px;
  width: 30px;
  height: 30px;
  display: none;
  align-items: center;
  justify-content: center;
  background-color: rgba(255, 255, 255, 0.4);
  backdrop-filter: blur(2px);
  color: #4b5563;
  border: 1px solid rgba(255, 255, 255, 0.6);
  border-radius: 50%;
  cursor: pointer;
  z-index: 20;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
  transition: all 0.2s ease;
  animation: fadeIn 0.2s ease-in-out;
}

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

.focus-btn:hover {
  background-color: #ffffff;
  color: #7c3aed;
  border-color: #ffffff;
  transform: translateY(-1px) scale(1.1);
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.item.selected-item .focus-btn,
.chosen-item.selected-chosen-item .focus-btn {
  display: flex;
}

.item.selected-item::before,
.chosen-item.selected-chosen-item::before {
  display: block !important;
  opacity: 1 !important;
  z-index: 50;
}

#focus-mode-modal {
  transition: opacity 0.3s ease;
}

.item::after,
.chosen-item::after {
  transition: right 0.2s ease-in-out;
}

/* Slide the number to the left to make room for the focus button */
.item.selected-item::after,
.chosen-item.selected-chosen-item::after {
  right: 44px !important;
}

@keyframes saved-section-flash {
  0% {
    background-color: rgba(168, 85, 247, 0.15);
    box-shadow: 0 0 0 2px rgba(168, 85, 247, 0.3);
  }
  100% {
    background-color: transparent;
    box-shadow: 0 0 0 0 rgba(168, 85, 247, 0);
  }
}

.highlight-saved-section {
  animation: saved-section-flash 2s ease-out;
  border-radius: 0.5rem;
}
.mindful-highlight {
  border-color: #a855f7 !important;
  background-color: #f3e8ff !important;
  transform: scale(1.02);
  box-shadow: 0 0 15px rgba(168, 85, 247, 0.3);
  transition: all 0.2s ease-in-out;
  position: relative;
  z-index: 10;
}

#privacy-general-modal .modal-content {
  max-width: 600px;
  max-height: 85vh;
  width: 90%;
  display: flex;
  flex-direction: column;
}

#privacy-general-modal .modal-content div.text-left {
  overflow-y: auto;
  flex-grow: 1;
  padding-right: 0.5rem;
  margin-bottom: 1rem;
  border-bottom: 1px solid #e2e8f0;
  padding-bottom: 1rem;
}

.locked-feature {
  opacity: 0.5;
  pointer-events: none;
  filter: grayscale(1);
  position: relative;
  cursor: not-allowed;
}

.lock-wrapper {
  display: inline-flex;
  position: relative;
  cursor: pointer;
}

.lock-wrapper::after {
  content: "\f023";
  font-family: "Font Awesome 6 Free", "Font Awesome 5 Free", "FontAwesome";
  font-weight: 900;
  position: absolute;
  top: -8px;
  left: -8px;
  right: auto;
  background: #fbbf24;
  color: white;
  width: 20px;
  height: 20px;
  font-size: 10px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
  z-index: 50;
  transition: transform 0.2s;
}
.lock-wrapper:hover::after {
  transform: scale(1.1);
}
/* --- HOST ONLY LOCK STYLING --- */
.lock-wrapper.host-only::after {
  background: #db2777; /* Deep Pink */
}

/* Ensure the wrapper expands correctly inside the modal buttons */
.modal-buttons .lock-wrapper {
  display: flex;
  width: 100%;
}
.modal-buttons .lock-wrapper .modal-button {
  width: 100%;
}

/* --- Onboarding Spotlight Overlay --- */
#spotlight-tour-overlay {
  position: fixed;
  inset: 0;
  background-color: rgba(0, 0, 0, 0.65);
  backdrop-filter: blur(2px);
  -webkit-backdrop-filter: blur(2px);
  z-index: 4000;
  opacity: 0;
  visibility: hidden;
  transition:
    opacity 0.3s ease,
    visibility 0.3s ease;
  cursor: pointer;
}

#spotlight-tour-overlay.show {
  opacity: 1;
  visibility: visible;
}

#tour-close-hint {
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.5);
}

/* Radar pulse animation to draw the eye to small spotlight targets */
@keyframes tour-radar-pulse {
  0% {
    box-shadow:
      0 0 0 0 rgba(168, 85, 247, 0.7),
      0 10px 15px -3px rgba(0, 0, 0, 0.1);
  }
  70% {
    box-shadow:
      0 0 0 15px rgba(168, 85, 247, 0),
      0 10px 15px -3px rgba(0, 0, 0, 0.1);
  }
  100% {
    box-shadow:
      0 0 0 0 rgba(168, 85, 247, 0),
      0 10px 15px -3px rgba(0, 0, 0, 0.1);
  }
}

.tour-highlight {
  position: relative !important;
  z-index: 10051 !important;
  background-color: white;
  border-radius: 0.5rem;
  animation: tour-radar-pulse 1.5s infinite ease-out !important;
}

/* Add base opacity and include it in the transition */
#floating-join,
#floating-lookup,
#floating-copy {
  opacity: 0.85;
  transition:
    transform 0.15s ease-in-out,
    box-shadow 0.2s ease-in-out,
    filter 0.2s,
    bottom 0.2s ease-in-out,
    opacity 0.2s ease-in-out;
}

/* Make them fully opaque when the user interacts with them */
#floating-join:hover,
#floating-join:focus,
#floating-lookup:hover,
#floating-lookup:focus,
#floating-copy:hover,
#floating-copy:focus {
  opacity: 1;
}

/* Perfectly balances wrapped pills to prevent single-item widows */
.balanced-pill-wrap {
  display: block !important;
  text-align: center;
  text-wrap: balance;
  line-height: 2.5rem; /* Keeps the vertical gap between lines */
}
.balanced-pill-wrap > button {
  display: inline-block !important;
  margin: 0.25rem !important;
  vertical-align: middle;
  line-height: normal !important; /* Resets the text height inside the pill */
}

/* --- Premium Environmental Physics --- */
.noise-layer {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  pointer-events: none;
  z-index: 9999;
  opacity: 0.025;
  background-image: url('data:image/svg+xml,%3Csvg viewBox="0 0 200 200" xmlns="http://www.w3.org/2000/svg"%3E%3Cfilter id="noiseFilter"%3E%3CfeTurbulence type="fractalNoise" baseFrequency="0.85" numOctaves="3" stitchTiles="stitch"/%3E%3C/filter%3E%3Crect width="100%25" height="100%25" filter="url(%23noiseFilter)"/%3E%3C/svg%3E');
}

@keyframes breathe {
  0%,
  100% {
    transform: scale(1) translate(0, 0);
    opacity: 0.6;
  }
  33% {
    transform: scale(1.05) translate(10px, -5px);
    opacity: 0.8;
  }
  66% {
    transform: scale(0.95) translate(-10px, 10px);
    opacity: 0.7;
  }
}

.ambient-glow {
  position: fixed;
  top: -10%;
  left: -10%;
  width: 120vw;
  height: 120vh;
  background: radial-gradient(
    circle at 50% 50%,
    rgba(139, 92, 246, 0.08) 0%,
    rgba(236, 72, 153, 0.03) 40%,
    transparent 70%
  );
  pointer-events: none;
  z-index: -1;
  animation: breathe 18s ease-in-out infinite alternate;
}

/* Mouse-Tracking Spotlight Effects */
.item:hover,
.chosen-item:hover {
  background:
    radial-gradient(
      600px circle at var(--mouse-x, 50%) var(--mouse-y, 50%),
      rgba(168, 85, 247, 0.1),
      transparent 40%
    ),
    #f8fafc;
  border-color: rgba(168, 85, 247, 0.4);
}

.item.selected-item,
.chosen-item.selected-chosen-item {
  background:
    radial-gradient(
      600px circle at var(--mouse-x, 50%) var(--mouse-y, 50%),
      rgba(255, 255, 255, 0.3),
      transparent 40%
    ),
    linear-gradient(135deg, #ffffff 0%, var(--highlight-color) 100%);
}

/* =========================================================
   PWA BOTTOM NAVIGATION BAR
   ========================================================= */

/* 1. The Tab Bar Container */
.mobile-bottom-nav {
  display: flex;
  justify-content: space-around;
  align-items: center;
  position: fixed;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 100%;
  max-width: 448px; /* Matches Tailwind max-w-md to align with your app card */
  height: 65px;
  background-color: rgba(255, 255, 255, 0.75);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-top: 1px solid rgba(255, 255, 255, 0.4);
  z-index: 9990;
  /* iOS Safe Area Padding */
  padding-bottom: env(safe-area-inset-bottom);
  box-sizing: content-box;
  box-shadow: 0 -4px 6px -1px rgba(0, 0, 0, 0.05);
}

/* 2. Prevent the main app card from hiding behind the tab bar */
body {
  padding-bottom: calc(75px + env(safe-area-inset-bottom)) !important;
}

/* 3. Tab Button Styling */
.nav-tab {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  color: #9ca3af; /* Tailwind Gray-400 */
  text-decoration: none;
  height: 100%;
  transition:
    color 0.2s ease-in-out,
    transform 0.1s;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
}

.nav-tab i {
  font-size: 1.25rem;
  margin-bottom: 3px;
  transition: transform 0.2s ease;
}

.nav-tab span {
  font-size: 0.65rem;
  font-weight: 600;
}

/* Active State (Brand Purple) */
.nav-tab.active {
  color: #6b46c1;
}

.nav-tab.active i {
  transform: translateY(-2px);
}

.nav-tab:hover {
  color: #8b5cf6;
}

/* =========================================================
   FAB COLLISION PREVENTION OVERRIDES (FIXED)
   ========================================================= */
/* We use margin-bottom instead of bottom so we don't break your Javascript's dynamic stacking math! */

#floating-dice,
#floating-join,
#floating-copy,
#floating-lookup,
#back-to-top,
.toast-notification,
#global-host-timer,
#filter-toast {
  margin-bottom: calc(65px + env(safe-area-inset-bottom)) !important;
}

/* Force Toast to sit above everything (nav is 9990, modals are 9995+) */
#filter-toast {
  z-index: 10000 !important;
  bottom: 2rem !important; /* Overrides the tailwind bottom-24 to use our dynamic margin-bottom math safely */
}

/* Adjust Host Timer if present */
#global-host-timer {
  bottom: calc(24px + 65px + env(safe-area-inset-bottom)) !important;
}

/* =========================================================
   RESPONSIVE ADAPTATIONS
   ========================================================= */

/* Tablet/Desktop View: Floating Pill Dock */
@media (min-width: 600px) {
  .mobile-bottom-nav {
    bottom: 2rem !important;
    border-radius: 9999px !important;
    border: 1px solid rgba(255, 255, 255, 0.5) !important;
    box-shadow:
      0 10px 25px -5px rgba(0, 0, 0, 0.1),
      0 8px 10px -6px rgba(0, 0, 0, 0.1) !important;
    padding: 0 0.5rem !important;
  }

  body {
    padding-bottom: 120px !important;
  }

  /* Bumps existing floating buttons up to sit safely above the pill dock */
  #floating-dice,
  #floating-join,
  #floating-copy,
  #floating-lookup,
  #floating-collapse,
  #back-to-top,
  .toast-notification,
  #global-host-timer {
    margin-bottom: 90px !important;
  }

  /* Keep floating buttons tethered to the main app container instead of the far screen edge */
  #floating-dice,
  #floating-join,
  #floating-copy,
  #floating-lookup,
  #floating-collapse,
  #back-to-top {
    right: calc(50% - 224px + 20px) !important;
  }
}

/* =========================================================
   ACCESSIBILITY OVERRIDES
   ========================================================= */
.modal-content-card {
  max-height: 90vh;
  overflow-y: auto;
}

/* Subtle Light Purple Active State for the Flip Control Icon */
#inline-flip-btn.active i {
  background-color: #f3e8ff !important; /* Soft, muted pastel purple background */
  color: #8b5cf6 !important;            /* Bright, readable theme purple text icon */
  box-shadow: inset 0 0 0 1px rgba(139, 92, 246, 0.15) !important; /* Ultra-subtle border ring */
}
#inline-flip-btn.active i:hover {
  background-color: #e9d5ff !important; /* Gentle shift on active hover */
  color: #7c3aed !important;            
}

/* Fix mobile 'sticky hover' preventing the button from looking turned off after tapping */
@media (hover: none) {
  #inline-flip-btn:not(.active):hover {
    color: #9ca3af !important; /* Forces Tailwind text-gray-400 */
  }
  #inline-flip-btn:not(.active):hover i {
    background-color: #f3f4f6 !important; /* Forces Tailwind bg-gray-100 */
  }
}

/* Also clear standard browser focus outlines just in case */
#inline-flip-btn:focus {
  outline: none;
}

/* =========================================================
   LIVE BOARD BANNER (TLI) - PREVENTS TAILWIND TRUNCATION BUGS
   ========================================================= */
.tli-left {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  overflow: hidden;
}
.tli-dot-wrap {
  position: relative;
  display: flex;
  width: 8px;
  height: 8px;
  flex-shrink: 0;
}
.tli-dot-ping {
  position: absolute;
  display: inline-flex;
  width: 100%;
  height: 100%;
  border-radius: 50%;
  background: white;
  opacity: 0.75;
  animation: tli-ping 1s cubic-bezier(0, 0, 0.2, 1) infinite;
}
.tli-dot {
  position: relative;
  display: inline-flex;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: white;
}
.tli-text {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.tli-right {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-shrink: 0;
  margin-left: 0.5rem;
}
.tli-broadcast-wrap {
  display: flex;
  flex-direction: column;
  min-width: 0;
  cursor: pointer;
}
.tli-broadcast-label {
  font-size: 8px;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: #e9d5ff;
  line-height: 1;
  margin-bottom: 2px;
}
.tli-broadcast-text {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  font-weight: 500;
  color: white;
}
.tli-interactive {
  cursor: pointer;
  transition: background-color 0.2s;
  border-radius: 0.25rem;
  padding: 0 0.25rem;
  margin-left: -0.25rem;
}
.tli-interactive:hover {
  background-color: #7e22ce;
}
.tli-board-btn {
  background: #6b21a8;
  color: white;
  padding: 0.25rem 0.75rem;
  border-radius: 0.25rem;
  text-decoration: none;
  display: flex;
  align-items: center;
  gap: 0.25rem;
  border: 1px solid #a855f7;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
  transition: background 0.2s;
  font-size: 11px;
}
.tli-board-btn:hover {
  background: #581c87;
  color: white;
  text-decoration: none;
}
.tli-disconnect-btn {
  background: rgba(255, 255, 255, 0.2);
  color: white;
  padding: 0.25rem 0.5rem;
  border-radius: 0.25rem;
  border: none;
  cursor: pointer;
  transition: background 0.2s;
  display: flex;
  align-items: center;
  justify-content: center;
}
.tli-disconnect-btn:hover {
  background: rgba(255, 255, 255, 0.3);
}
@keyframes tli-ping {
  75%,
  100% {
    transform: scale(2);
    opacity: 0;
  }
}
