* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

:root {
  --primary: #2d5a3d;
  --primary-dark: #1e3d2a;
  --primary-light: #3d7a52;
  --secondary: #7c5e3f;
  --accent: #9fbd5f;
  --success: #4a9960;
  --warning: #d4a574;
  --danger: #c85a54;
  --info: #5a9bd4;
  --dark: #1a1a1a;
  --dark-lighter: #2d2d2d;
  --light: #f8f9f7;
  --light-green: #e8f3ea;
  --border: #d4d9d0;
  --text: #2d2d2d;
  --text-muted: #6b7280;
  --shadow: rgba(45, 90, 61, 0.12);
  --shadow-hover: rgba(45, 90, 61, 0.18);

  /* Spacing */
  --spacing-xs: 0.25rem;
  --spacing-sm: 0.5rem;
  --spacing-md: 1rem;
  --spacing-lg: 1.5rem;
  --spacing-xl: 2rem;

  /* Border radius */
  --radius-sm: 6px;
  --radius-md: 8px;
  --radius-lg: 12px;

  /* Transitions */
  --transition-fast: 0.15s cubic-bezier(0.4, 0, 0.2, 1);
  --transition-base: 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  --transition-slow: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Focus visible styles for accessibility */
*:focus-visible {
  outline: 3px solid var(--primary);
  outline-offset: 2px;
}

/* Reduced motion support */
@media (prefers-reduced-motion: reduce) {

  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
  background: linear-gradient(135deg, #e8f3ea 0%, #f5f2ed 50%, #e8e5df 100%);
  min-height: 100vh;
  color: var(--text);
  line-height: 1.6;
  animation: fadeIn 0.3s ease-out;
  position: relative;
}

/* Improved background pattern with better performance */
body::before {
  content: '';
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-image: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%232d5a3d' fill-opacity='0.02'%3E%3Cpath d='M36 34v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zm0-30V0h-2v4h-4v2h4v4h2V6h4V4h-4zM6 34v-4H4v4H0v2h4v4h2v-4h4v-2H6zM6 4V0H4v4H0v2h4v4h2V6h4V4H6z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
  pointer-events: none;
  opacity: 0.5;
  z-index: 0;
  will-change: transform;
}

/* Skip link for accessibility */
.skip-link {
  position: absolute;
  top: -40px;
  left: 0;
  background: var(--primary);
  color: white;
  padding: var(--spacing-sm) var(--spacing-md);
  text-decoration: none;
  border-radius: 0 0 var(--radius-md) 0;
  z-index: 10000;
  font-weight: 600;
}

.skip-link:focus {
  top: 0;
}

/* Screen reader only content */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border-width: 0;
}

/* Toast Notifications */
.toast-container {
  position: fixed;
  top: var(--spacing-lg);
  right: var(--spacing-lg);
  z-index: 10000;
  display: flex;
  flex-direction: column;
  gap: var(--spacing-sm);
  max-width: 400px;
}

.toast {
  background: white;
  border-radius: var(--radius-md);
  padding: var(--spacing-md) var(--spacing-lg);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.15);
  display: flex;
  align-items: center;
  gap: var(--spacing-md);
  animation: slideInRight 0.3s ease-out, fadeOut 0.3s ease-out 2.7s;
  border-left: 4px solid var(--primary);
}

.toast.success {
  border-left-color: var(--success);
}

.toast.error {
  border-left-color: var(--danger);
}

.toast.warning {
  border-left-color: var(--warning);
}

.toast.info {
  border-left-color: var(--info);
}

.toast-icon {
  flex-shrink: 0;
  width: 20px;
  height: 20px;
}

.toast-message {
  flex: 1;
  font-size: 0.9375rem;
  color: var(--text);
}

@keyframes slideInRight {
  from {
    transform: translateX(100%);
    opacity: 0;
  }

  to {
    transform: translateX(0);
    opacity: 1;
  }
}

@keyframes fadeOut {
  to {
    opacity: 0;
    transform: translateX(100%);
  }
}

/* Connection Status Indicator */
.connection-status {
  position: fixed;
  top: var(--spacing-md);
  left: 50%;
  transform: translateX(-50%);
  background: var(--danger);
  color: white;
  padding: var(--spacing-sm) var(--spacing-lg);
  border-radius: var(--radius-lg);
  font-size: 0.875rem;
  font-weight: 600;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  z-index: 9999;
  display: none;
  align-items: center;
  gap: var(--spacing-sm);
  animation: slideDown 0.3s ease-out;
}

.connection-status.visible {
  display: flex;
}

.connection-status.reconnecting {
  background: var(--warning);
}

.connection-status.connected {
  background: var(--success);
}

.connection-status::before {
  content: '';
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: currentColor;
  animation: pulse 2s ease-in-out infinite;
}

@keyframes slideDown {
  from {
    transform: translateX(-50%) translateY(-100%);
    opacity: 0;
  }

  to {
    transform: translateX(-50%) translateY(0);
    opacity: 1;
  }
}

@keyframes fadeIn {
  from {
    opacity: 0;
  }

  to {
    opacity: 1;
  }
}

.container {
  max-width: 1400px;
  margin: 0 auto;
  padding: var(--spacing-xl);
  animation: fadeIn 0.5s ease-out;
  position: relative;
  z-index: 1;
  padding-bottom: 100px;
  /* Space for footer */
}

/* Loading State */
.loading {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  gap: var(--spacing-lg);
}

.spinner {
  width: 50px;
  height: 50px;
  border: 4px solid var(--border);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

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

.loading p {
  color: var(--text-muted);
  font-size: 1rem;
}

/* Skeleton Loading */
.skeleton {
  background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
  background-size: 200% 100%;
  animation: loading 1.5s ease-in-out infinite;
  border-radius: var(--radius-md);
}

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

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

.skeleton-text {
  height: 1rem;
  margin-bottom: var(--spacing-sm);
}

.skeleton-title {
  height: 1.5rem;
  width: 60%;
  margin-bottom: var(--spacing-md);
}

/* Header */
.header {
  background: white;
  border-radius: var(--radius-lg);
  padding: var(--spacing-lg) var(--spacing-xl);
  margin-bottom: var(--spacing-lg);
  box-shadow: 0 2px 8px var(--shadow);
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: var(--spacing-md);
  border-left: 4px solid var(--primary);
}

.header-left {
  display: flex;
  align-items: center;
  gap: var(--spacing-md);
}

.logo {
  width: 65px;
  height: 65px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2.5rem;
}

.header h1 {
  font-size: clamp(1.25rem, 3vw, 1.5rem);
  color: var(--primary);
  font-weight: 700;
}

.header-subtitle {
  color: var(--text-muted);
  font-size: 0.875rem;
  margin-top: var(--spacing-xs);
}

.header-actions {
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
  justify-content: flex-end;
  /* Anchors the buttons to the right */
  flex: 1;
  /* Tells the container to fill the remaining horizontal space */
}

/* Buttons */
.btn {
  padding: 0.625rem 1.125rem;
  border: none;
  border-radius: var(--radius-md);
  font-size: 0.875rem;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition-base);
  display: inline-flex;
  align-items: center;
  gap: var(--spacing-sm);
  white-space: nowrap;
  min-height: 44px;
  /* Accessibility: minimum touch target */
  position: relative;
  overflow: hidden;
}

.btn::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 0;
  height: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.3);
  transform: translate(-50%, -50%);
  transition: width 0.6s, height 0.6s;
}

.btn:active::before {
  width: 300px;
  height: 300px;
}

.btn svg {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
}

.btn-primary {
  background: var(--primary);
  color: white;
}

.btn-primary:hover:not(:disabled) {
  background: var(--primary-dark);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px var(--shadow-hover);
}

.btn-secondary {
  background: white;
  color: var(--text);
  border: 1.5px solid var(--border);
}

.btn-secondary:hover:not(:disabled) {
  background: var(--light);
  border-color: var(--primary);
  color: var(--primary);
}

.btn-danger {
  background: var(--danger);
  color: white;
}

.btn-danger:hover:not(:disabled) {
  background: #a84842;
}

.btn-success {
  background: var(--success);
  color: white;
}

.btn-success:hover:not(:disabled) {
  background: #3d7d4e;
}

.btn-accent {
  background: var(--accent);
  color: white;
}

.btn-accent:hover:not(:disabled) {
  background: #8aa952;
}

.btn-text {
  margin-left: var(--spacing-xs);
}

.btn-sm {
  padding: 0.4rem 0.75rem;
  font-size: 0.8125rem;
  min-height: 36px;
}

.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  pointer-events: none;
}

/* Social Share Buttons */
.social-share-section {
  margin-top: 2.5rem;
  padding-top: var(--spacing-xl);
  border-top: 1px solid var(--border);
  text-align: center;
}

.social-share-label {
  font-size: 0.875rem;
  color: var(--text-muted);
  margin-bottom: var(--spacing-md);
  font-weight: 500;
}

.social-share-buttons {
  display: flex;
  justify-content: center;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.social-btn {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: none;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all var(--transition-base);
  color: white;
  position: relative;
}

.social-btn svg {
  width: 20px;
  height: 20px;
}

.social-btn.twitter {
  background: #1DA1F2;
}

.social-btn.twitter:hover {
  background: #1a8cd8;
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(29, 161, 242, 0.3);
}

.social-btn.linkedin {
  background: #0A66C2;
}

.social-btn.linkedin:hover {
  background: #084f94;
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(10, 102, 194, 0.3);
}

.social-btn.facebook {
  background: #1877F2;
}

.social-btn.facebook:hover {
  background: #1565c9;
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(24, 119, 242, 0.3);
}

.social-btn.email {
  background: var(--secondary);
}

.social-btn.email:hover {
  background: #6a4e33;
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(124, 94, 63, 0.3);
}

.social-btn.reddit {
  background: #FF4500;
}

.social-btn.reddit:hover {
  background: #e03d00;
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(255, 69, 0, 0.3);
}

.social-btn.copy-btn {
  background: var(--primary);
}

.social-btn.copy-btn:hover {
  background: var(--primary-dark);
  transform: translateY(-2px);
  box-shadow: 0 4px 12px var(--shadow-hover);
}

.social-btn-success {
  background: var(--success) !important;
}

/* Setup Screen */
.setup-screen {
  background: white;
  border-radius: var(--radius-lg);
  padding: 3rem;
  max-width: 700px;
  margin: 4rem auto;
  box-shadow: 0 4px 24px var(--shadow);
  border-top: 4px solid var(--primary);
}

.setup-screen h2 {
  margin-bottom: var(--spacing-sm);
  color: var(--primary);
  font-size: clamp(1.5rem, 4vw, 1.75rem);
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.setup-screen h2 svg {
  width: 28px;
  height: 28px;
}

.setup-screen p {
  color: var(--text-muted);
  margin-bottom: var(--spacing-xl);
}

.form-group {
  margin-bottom: var(--spacing-lg);
}

.form-group label {
  display: block;
  margin-bottom: var(--spacing-sm);
  font-weight: 600;
  color: var(--text);
  display: flex;
  align-items: center;
  gap: var(--spacing-sm);
}

.form-group label svg {
  width: 18px;
  height: 18px;
}

.form-group input,
.form-group select,
.form-group textarea {
  width: 100%;
  padding: 0.75rem;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-md);
  font-size: 1rem;
  transition: border-color var(--transition-base), box-shadow var(--transition-base);
  background: white;
  font-family: inherit;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(45, 90, 61, 0.1);
}

.form-group textarea {
  resize: vertical;
  min-height: 80px;
}

.session-code-display {
  background: var(--light-green);
  border: 2px solid var(--primary);
  border-radius: var(--radius-md);
  padding: var(--spacing-lg);
  text-align: center;
  margin-bottom: var(--spacing-lg);
}

.session-code-label {
  font-size: 0.875rem;
  color: var(--text-muted);
  margin-bottom: var(--spacing-sm);
}

.session-code {
  font-size: clamp(2rem, 5vw, 2.5rem);
  font-weight: 700;
  color: var(--primary);
  letter-spacing: 0.25rem;
  font-family: 'SF Mono', 'Monaco', 'Courier New', monospace;
}

/* Session Info Bar */
.session-info {
  background: white;
  border-radius: var(--radius-lg);
  padding: var(--spacing-md) var(--spacing-lg);
  margin-bottom: var(--spacing-lg);
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: var(--spacing-md);
  box-shadow: 0 2px 8px var(--shadow);
}

.session-title {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--primary);
}

.session-meta {
  display: flex;
  gap: var(--spacing-lg);
  color: var(--text-muted);
  font-size: 0.875rem;
  align-items: center;
}

.session-meta>div {
  display: flex;
  align-items: center;
  gap: 0.375rem;
}

.session-meta svg {
  width: 16px;
  height: 16px;
}

.participant-count {
  background: var(--primary);
  color: white;
  padding: var(--spacing-xs) 0.75rem;
  border-radius: 20px;
  font-weight: 600;
}

/* Admin Controls */
.admin-section {
  background: white;
  border-radius: var(--radius-lg);
  padding: var(--spacing-lg);
  margin-bottom: var(--spacing-lg);
  box-shadow: 0 2px 8px var(--shadow);
  border-left: 4px solid var(--accent);
}

.admin-section h3 {
  font-size: 1.125rem;
  color: var(--primary);
  margin-bottom: var(--spacing-md);
  display: flex;
  align-items: center;
  gap: var(--spacing-sm);
}

.admin-section h3 svg {
  width: 20px;
  height: 20px;
}

.admin-actions {
  display: flex;
  gap: var(--spacing-sm);
  flex-wrap: wrap;
}

.questions-list {
  margin-top: var(--spacing-md);
}

.question-item {
  background: var(--light);
  border-radius: var(--radius-md);
  padding: var(--spacing-md);
  margin-bottom: var(--spacing-sm);
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: var(--spacing-md);
  transition: background var(--transition-base);
}

.question-item:hover {
  background: var(--light-green);
}

.question-item.active {
  background: var(--light-green);
  border: 2px solid var(--primary);
}

.question-info {
  flex: 1;
}

.question-text {
  font-weight: 600;
  color: var(--text);
  margin-bottom: var(--spacing-xs);
}

.question-type-badge {
  display: inline-block;
  padding: 0.2rem 0.5rem;
  background: var(--primary);
  color: white;
  border-radius: 4px;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
}

.question-actions {
  display: flex;
  gap: var(--spacing-sm);
}

/* Question Display */
.question-display {
  background: white;
  border-radius: var(--radius-lg);
  padding: var(--spacing-xl);
  margin-bottom: var(--spacing-lg);
  box-shadow: 0 2px 8px var(--shadow);
  border-top: 4px solid var(--primary);
}

.question-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: var(--spacing-lg);
  flex-wrap: wrap;
  gap: var(--spacing-md);
}

.question-counter {
  background: var(--light-green);
  color: var(--primary);
  padding: var(--spacing-sm) var(--spacing-md);
  border-radius: var(--radius-lg);
  font-weight: 700;
  font-size: 0.875rem;
}

.question-navigation {
  display: flex;
  gap: var(--spacing-sm);
}

.question-title {
  font-size: clamp(1.25rem, 4vw, 1.5rem);
  color: var(--primary);
  margin-bottom: var(--spacing-lg);
  line-height: 1.4;
}

/* Multiple Choice */
.vote-options {
  display: grid;
  gap: var(--spacing-md);
  margin-bottom: var(--spacing-lg);
}

.vote-option {
  background: var(--light);
  border: 2px solid var(--border);
  border-radius: var(--radius-md);
  padding: var(--spacing-md) var(--spacing-lg);
  cursor: pointer;
  transition: all var(--transition-base);
  font-size: 1rem;
  font-weight: 500;
  text-align: left;
  min-height: 44px;
  display: flex;
  align-items: center;
  gap: var(--spacing-md);
}

.vote-radio {
  width: 20px;
  height: 20px;
  border: 2px solid var(--border);
  border-radius: 50%;
  flex-shrink: 0;
  transition: all var(--transition-base);
  position: relative;
}

.vote-option:hover .vote-radio {
  border-color: var(--primary);
  background: var(--light-green);
}

.vote-option:hover {
  background: var(--light-green);
  border-color: var(--primary);
  transform: translateX(4px);
}

.vote-option.selected {
  background: var(--primary);
  color: white;
  border-color: var(--primary);
  box-shadow: 0 4px 12px var(--shadow-hover);
}

.vote-option.selected .vote-radio {
  border-color: white;
  background: white;
}

.vote-option.selected .vote-radio::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--primary);
}

.choice-options {
  display: grid;
  gap: var(--spacing-md);
}

.choice-option {
  background: var(--light);
  border: 2px solid var(--border);
  border-radius: var(--radius-md);
  padding: var(--spacing-md) var(--spacing-lg);
  cursor: pointer;
  transition: all var(--transition-base);
  font-size: 1rem;
  font-weight: 500;
  text-align: left;
  min-height: 44px;
  display: flex;
  align-items: center;
}

.choice-option:hover:not(.selected) {
  background: var(--light-green);
  border-color: var(--primary);
  transform: translateX(4px);
}

.choice-option.selected {
  background: var(--primary);
  color: white;
  border-color: var(--primary);
  box-shadow: 0 4px 12px var(--shadow-hover);
}

.choice-option:focus-visible {
  transform: translateX(4px);
}

/* Rating Scale */
.rating-scale {
  display: flex;
  justify-content: center;
  gap: var(--spacing-md);
  flex-wrap: wrap;
  padding: var(--spacing-lg) 0;
}

.rating-option {
  width: 50px;
  height: 50px;
  min-width: 44px;
  min-height: 44px;
  border: 2px solid var(--border);
  border-radius: 50%;
  background: white;
  cursor: pointer;
  font-size: 1.125rem;
  font-weight: 700;
  color: var(--text);
  transition: all var(--transition-base);
  display: flex;
  align-items: center;
  justify-content: center;
}

.rating-option:hover:not(.selected) {
  background: var(--light-green);
  border-color: var(--primary);
  transform: scale(1.1);
}

.rating-option.selected {
  background: var(--primary);
  color: white;
  border-color: var(--primary);
  transform: scale(1.15);
  box-shadow: 0 4px 12px var(--shadow-hover);
}

.rating-labels {
  display: flex;
  justify-content: space-between;
  margin-top: var(--spacing-md);
  color: var(--text-muted);
  font-size: 0.875rem;
}

/* Text Response */
.text-response textarea {
  width: 100%;
  min-height: 120px;
  padding: var(--spacing-md);
  border: 2px solid var(--border);
  border-radius: var(--radius-md);
  font-size: 1rem;
  font-family: inherit;
  resize: vertical;
  transition: border-color var(--transition-base);
}

.text-response textarea:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(45, 90, 61, 0.1);
}

.char-counter {
  text-align: right;
  font-size: 0.875rem;
  color: var(--text-muted);
  margin-top: var(--spacing-sm);
}

/* Results Display */
.results-container {
  background: white;
  border-radius: var(--radius-lg);
  padding: var(--spacing-xl);
  margin-bottom: var(--spacing-lg);
  box-shadow: 0 2px 8px var(--shadow);
}

.results-container h3 {
  font-size: 1.25rem;
  color: var(--primary);
  margin-bottom: var(--spacing-lg);
  display: flex;
  align-items: center;
  gap: var(--spacing-sm);
}

.results-container h3 svg {
  width: 22px;
  height: 22px;
}

.chart-container {
  position: relative;
  height: 300px;
  margin-bottom: var(--spacing-xl);
}

.result-bars {
  display: flex;
  flex-direction: column;
  gap: var(--spacing-md);
}

.result-row {
  display: flex;
  align-items: center;
  gap: var(--spacing-md);
}

.result-label {
  min-width: 120px;
  font-size: 0.875rem;
  color: var(--text);
  font-weight: 500;
}

.result-bar-container {
  flex: 1;
  height: 32px;
  background: var(--light);
  border-radius: var(--radius-sm);
  overflow: hidden;
  position: relative;
}

.result-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--primary) 0%, var(--primary-light) 100%);
  transition: width 0.5s cubic-bezier(0.4, 0, 0.2, 1);
  display: flex;
  align-items: center;
  justify-content: flex-end;
  padding-right: 0.75rem;
  color: white;
  font-size: 0.875rem;
  font-weight: 700;
  min-width: 40px;
}

/* Word Cloud */
.word-cloud-input-container {
  display: flex;
  gap: 0.75rem;
  margin-bottom: 0.5rem;
}

.word-cloud-input {
  flex: 1;
  padding: 0.75rem;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-md);
  font-size: 1rem;
  transition: border-color var(--transition-base);
}

.word-cloud-input:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(45, 90, 61, 0.1);
}

.word-cloud {
  background: var(--light);
  border-radius: var(--radius-md);
  padding: var(--spacing-xl);
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  justify-content: center;
  align-items: center;
  min-height: 200px;
}

.word-cloud-word {
  font-weight: 700;
  color: var(--primary);
  transition: all var(--transition-base);
  cursor: default;
  padding: var(--spacing-xs) var(--spacing-sm);
  border-radius: var(--radius-sm);
}

.word-cloud-word:hover {
  background: var(--light-green);
  transform: scale(1.05);
}

/* Response List */
.response-list {
  background: var(--light);
  border-radius: var(--radius-md);
  padding: var(--spacing-md);
  max-height: 400px;
  overflow-y: auto;
}

.response-item {
  background: white;
  border-radius: var(--radius-sm);
  padding: 0.875rem;
  margin-bottom: var(--spacing-sm);
  border-left: 3px solid var(--primary);
  animation: slideInLeft 0.3s ease-out;
}

.response-item:last-child {
  margin-bottom: 0;
}

.response-author {
  font-size: 0.75rem;
  color: var(--text-muted);
  font-weight: 600;
  margin-bottom: var(--spacing-xs);
}

.response-text {
  color: var(--text);
  font-size: 0.9375rem;
  word-wrap: break-word;
}

@keyframes slideInLeft {
  from {
    opacity: 0;
    transform: translateX(-20px);
  }

  to {
    opacity: 1;
    transform: translateX(0);
  }
}

/* Modal */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  animation: fadeIn 0.2s ease-out;
  padding: var(--spacing-md);
}

.modal {
  background: white;
  border-radius: var(--radius-lg);
  padding: var(--spacing-xl);
  max-width: 600px;
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
  border-top: 4px solid var(--primary);
  position: relative;
}

.modal h3 {
  font-size: 1.375rem;
  color: var(--primary);
  margin-bottom: var(--spacing-md);
  display: flex;
  align-items: center;
  gap: var(--spacing-sm);
}

.modal h3 svg {
  width: 22px;
  height: 22px;
}

.modal-actions {
  display: flex;
  gap: 0.75rem;
  margin-top: var(--spacing-lg);
  justify-content: flex-end;
}

/* Close button for modal accessibility */
.modal-close {
  position: absolute;
  top: var(--spacing-md);
  right: var(--spacing-md);
  background: transparent;
  border: none;
  cursor: pointer;
  padding: var(--spacing-sm);
  color: var(--text-muted);
  transition: color var(--transition-base);
}

.modal-close:hover {
  color: var(--danger);
}

/* Question Type Selector */
.question-types {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 0.75rem;
  margin-bottom: var(--spacing-lg);
}

.question-type-option {
  padding: var(--spacing-md);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: all var(--transition-base);
  background: white;
  text-align: center;
  min-height: 44px;
}

.question-type-option:hover:not(.selected) {
  border-color: var(--primary);
  background: var(--light-green);
  transform: translateY(-2px);
}

.question-type-option.selected {
  border-color: var(--primary);
  background: var(--primary);
  color: white;
}

.question-type-option svg {
  width: 24px;
  height: 24px;
  margin-bottom: var(--spacing-sm);
}

.question-type-option h4 {
  font-size: 0.875rem;
  margin: 0;
}

.question-type-option.selected svg {
  color: white;
  stroke: white;
}

/* Options Editor */
.options-editor {
  margin-top: var(--spacing-md);
}

.option-input-group {
  display: flex;
  gap: var(--spacing-sm);
  margin-bottom: var(--spacing-sm);
}

.option-input-group input {
  flex: 1;
}

.option-input-group .btn {
  padding: 0.625rem;
}

/* Toggle Switch */
.toggle-group {
  display: flex;
  align-items: flex-start;
  /* Keeps the toggle aligned with the title instead of the middle of the paragraph */
  gap: 0.75rem;
  margin-bottom: var(--spacing-md);
}

.toggle-switch {
  position: relative;
  width: 50px;
  height: 26px;
  flex-shrink: 0;
  /* Forces the browser to NEVER squish the toggle button */
}

.toggle-switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

.toggle-slider {
  position: absolute;
  cursor: pointer;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: var(--border);
  transition: var(--transition-slow);
  border-radius: 26px;
}

.toggle-slider:before {
  position: absolute;
  content: "";
  height: 18px;
  width: 18px;
  left: 4px;
  bottom: 4px;
  background-color: white;
  transition: var(--transition-slow);
  border-radius: 50%;
}

.toggle-switch input:checked+.toggle-slider {
  background-color: var(--primary);
}

.toggle-switch input:checked+.toggle-slider:before {
  transform: translateX(24px);
}

.toggle-switch input:focus-visible+.toggle-slider {
  box-shadow: 0 0 0 3px rgba(45, 90, 61, 0.3);
}

.toggle-label {
  font-size: 0.875rem;
  color: var(--text);
  font-weight: 500;
}

/* Empty State */
.empty-state {
  text-align: center;
  padding: 3rem var(--spacing-xl);
  color: var(--text-muted);
}

.empty-state svg {
  width: 64px;
  height: 64px;
  margin-bottom: var(--spacing-md);
  opacity: 0.5;
}

.empty-state h3 {
  font-size: 1.25rem;
  color: var(--text);
  margin-bottom: var(--spacing-sm);
}

.empty-state p {
  margin-bottom: var(--spacing-lg);
}

/* Waiting State */
.waiting-state {
  text-align: center;
  padding: var(--spacing-xl);
  background: var(--light-green);
  border-radius: var(--radius-md);
  margin-top: var(--spacing-md);
}

.waiting-state svg {
  width: 48px;
  height: 48px;
  color: var(--primary);
  margin-bottom: var(--spacing-md);
  animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {

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

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

.waiting-state h4 {
  color: var(--primary);
  margin-bottom: var(--spacing-sm);
}

.waiting-state p {
  color: var(--text-muted);
  font-size: 0.875rem;
}

/* Confirmation Dialog */
.confirmation-dialog {
  text-align: center;
  padding: var(--spacing-md);
}

.confirmation-icon {
  width: 64px;
  height: 64px;
  margin: 0 auto var(--spacing-lg);
  color: var(--warning);
}

.confirmation-message {
  font-size: 1.125rem;
  color: var(--text);
  margin-bottom: var(--spacing-xl);
  line-height: 1.6;
}

/* Footer */
.footer {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: white;
  border-top: 1px solid var(--border);
  padding: 0.75rem var(--spacing-md);
  box-shadow: 0 -2px 8px var(--shadow);
  z-index: 100;
}

.footer-content {
  max-width: 1400px;
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: var(--spacing-md);
}

.footer-info {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.footer-label {
  font-size: 0.875rem;
  color: var(--text-muted);
  font-weight: 500;
}

.footer-code {
  font-family: 'SF Mono', 'Monaco', 'Courier New', monospace;
  font-size: 1.125rem;
  font-weight: 700;
  color: var(--primary);
  letter-spacing: 0.15rem;
  background: var(--light-green);
  padding: var(--spacing-xs) 0.75rem;
  border-radius: var(--radius-sm);
}

.btn-footer {
  font-size: 0.875rem;
  padding: var(--spacing-sm) var(--spacing-md);
}

/* Focus Mode - reduces distractions */
body.focus-mode {
  background: #f5f5f5;
}

body.focus-mode::before {
  opacity: 0;
}

/* ============================================================================
   PRESENTATION MODE BANNER
   ============================================================================ */
.presentation-banner {
  background: linear-gradient(to right, var(--light-green), #ffffff, var(--light-green));
  border: 1px solid var(--primary-light);
  border-radius: var(--radius-md);
  padding: 1rem;
  margin-bottom: 1.5rem;
  text-align: center;
  box-shadow: 0 4px 12px var(--shadow);
}

.presentation-banner-title {
  color: var(--primary);
  font-weight: 700;
  margin-bottom: 0.35rem;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  font-size: 1.1rem;
}

.presentation-banner-text {
  color: var(--text-muted);
  font-size: 0.875rem;
}

/* Little pulsing dot to show it's "Live" */
.pulse-dot {
  width: 8px;
  height: 8px;
  background-color: var(--danger);
  border-radius: 50%;
  animation: pulse-dot 1.5s infinite;
}

@keyframes pulse-dot {
  0% {
    box-shadow: 0 0 0 0 rgba(200, 90, 84, 0.7);
  }

  70% {
    box-shadow: 0 0 0 6px rgba(200, 90, 84, 0);
  }

  100% {
    box-shadow: 0 0 0 0 rgba(200, 90, 84, 0);
  }
}

/* ============================================================================
   MOBILE OPTIMIZATIONS
   ============================================================================ */
@media (max-width: 768px) {
  .container {
    padding: var(--spacing-md);
    padding-bottom: 140px;
  }

  /* 1. Center the header content cleanly */
  .header {
    flex-direction: column;
    gap: 1.5rem;
    text-align: center;
  }

  .header-left {
    display: flex !important;
    flex-direction: row !important;
    /* The sledgehammer forcing them onto one line */
    align-items: center !important;
    justify-content: center !important;
    flex-wrap: wrap !important;
    width: 100%;
    gap: 0.5rem 1rem !important;
    /* 0.5rem vertical gap if it wraps, 1rem horizontal gap */
  }

  .header-left>div:nth-child(2) {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    text-align: left;
  }

  .logo {
    width: 44px !important;
    height: 44px !important;
    font-size: 1.75rem !important;
  }

  .header h1 {
    font-size: 1.5rem !important;
    line-height: 1.2 !important;
  }

  .header-subtitle {
    font-size: 0.875rem !important;
  }

  .facilitator-badge {
    margin: 0 !important;
    padding: 0.25rem 0.75rem !important;
  }

  /* 2. Create a clean grid for the tool buttons */
  .header-actions {
    width: 100%;
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    justify-content: space-between;
  }

  /* Make standard header buttons neat squares (4 per row) */
  .header-actions .btn {
    flex: 0 0 calc(25% - 0.375rem);
    min-width: 0;
    padding: 0.75rem 0;
    justify-content: center;
  }

  /* Hide the text for the small tool buttons */
  .btn-text {
    display: none;
  }

  /* EXCEPTIONS: Make Add Question and Leave full-width */
  .header-actions .btn-primary,
  .header-actions .btn-leave {
    flex: 0 0 100%;
  }

  /* Restore text for the full-width buttons */
  .header-actions .btn-primary .btn-text {
    display: inline-block;
  }

  /* Force Undo/Redo wrapper to take up exactly two square slots */
  .header-actions>div[style*="display: flex"] {
    flex: 0 0 calc(50% - 0.25rem);
  }

  .header-actions>div[style*="display: flex"] .btn {
    flex: 1;
  }

  /* 3. Fix the overflowing Presentation Controls */
  .session-info {
    flex-direction: column;
    align-items: flex-start;
  }

  .session-meta {
    flex-wrap: wrap;
    gap: 1rem;
    width: 100%;
  }

  /* Override the inline styles from app.js on mobile */
  .session-meta>div[style*="border-left"] {
    margin-left: 0 !important;
    padding-left: 0 !important;
    border-left: none !important;
    border-top: 1px solid var(--border);
    padding-top: 1rem !important;
    width: 100%;
    justify-content: space-between;
  }

  /* Question cards more compact */
  .question-card {
    padding: 1rem;
  }

  .question-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.75rem;
  }

  .question-actions {
    width: 100%;
    justify-content: flex-start;
  }

  /* Modals full screen */
  .modal {
    max-width: 100%;
    max-height: 100%;
    margin: 0;
    border-radius: 0;
  }
}

/* Tablet breakpoint */
@media (min-width: 769px) and (max-width: 1024px) {
  .container {
    padding: var(--spacing-lg);
  }

  .rating-option {
    width: 48px;
    height: 48px;
  }
}

/* Scrollbar Styling */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

::-webkit-scrollbar-track {
  background: var(--light);
}

::-webkit-scrollbar-thumb {
  background: var(--border);
  border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
  background: var(--primary);
}

/* Print styles */
@media print {

  .header-actions,
  .admin-section,
  .footer,
  .social-share-section {
    display: none !important;
  }

  body {
    background: white;
  }

  body::before {
    display: none;
  }
}

/* High contrast mode support */
@media (prefers-contrast: high) {
  :root {
    --border: #000;
    --text-muted: #333;
  }

  .btn {
    border: 2px solid currentColor;
  }
}

/* Dark mode support (future enhancement) */
@media (prefers-color-scheme: dark) {
  /* Uncomment when implementing dark mode */
  /*
  :root {
    --primary: #4a8a5d;
    --text: #e0e0e0;
    --dark: #f0f0f0;
    --light: #2d2d2d;
    --border: #4a4a4a;
  }
  */
}

/* ============================================================================
   PHASE 2: FACILITATOR CONTROLS & ROLE SYSTEM
   ============================================================================ */

.facilitator-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  background: linear-gradient(135deg, #FFD700, #FFA500);
  color: #000;
  padding: 0.5rem 1rem;
  border-radius: 20px;
  font-size: 0.875rem;
  font-weight: 600;
  margin-left: 1rem;
  box-shadow: 0 2px 8px rgba(255, 215, 0, 0.3);
}

.facilitator-badge svg {
  width: 16px;
  height: 16px;
}

.facilitator-tag {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  background: var(--light-green);
  color: var(--primary);
  padding: 0.25rem 0.5rem;
  border-radius: 12px;
  font-size: 0.75rem;
  font-weight: 600;
}

.facilitator-tag svg {
  width: 12px;
  height: 12px;
}

.participant-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.75rem;
  border-bottom: 1px solid var(--border);
  gap: 1rem;
}

.participant-item:last-child {
  border-bottom: none;
}

.participant-item:hover {
  background: var(--light-green);
}

.online-indicator {
  color: #22c55e;
  animation: pulse 2s infinite;
  display: flex;
  align-items: center;
}

.offline-indicator {
  color: var(--text-muted);
  display: flex;
  align-items: center;
}

@keyframes pulse {

  0%,
  100% {
    opacity: 1;
  }

  50% {
    opacity: 0.5;
  }
}

.question-actions {
  display: flex;
  gap: 0.5rem;
  align-items: center;
}

.question-actions .btn-sm {
  min-width: auto;
  padding: 0.5rem 0.75rem;
  font-size: 0.875rem;
}

.btn.btn-sm.btn-secondary {
  background: var(--light-green);
  color: var(--primary);
  border: 1px solid var(--primary);
}

.btn.btn-sm.btn-secondary:hover {
  background: var(--primary);
  color: white;
}

.results-pending {
  background: var(--background);
  border-radius: 8px;
  padding: 1rem;
  text-align: center;
  color: var(--text-muted);
  font-size: 0.875rem;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  margin-top: 1rem;
}

@media (max-width: 768px) {
  .facilitator-badge {
    margin-left: 0;
    margin-top: 0.5rem;
    font-size: 0.75rem;
    padding: 0.375rem 0.75rem;
  }

  .participant-item {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.75rem;
  }

  .participant-item>div:first-child {
    width: 100%;
  }

  .participant-item>button {
    width: 100%;
  }
}

/* ============================================================================
   TIMER FOOTER
   ============================================================================ */

.timer-footer {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: var(--background);
  border-top: 2px solid var(--primary);
  padding: 1rem;
  box-shadow: 0 -4px 12px rgba(0, 0, 0, 0.1);
  z-index: 100;
  animation: slideUp 0.3s ease;
}

@keyframes slideUp {
  from {
    transform: translateY(100%);
  }

  to {
    transform: translateY(0);
  }
}

.timer-content {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.timer-label {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-weight: 600;
  color: var(--text-muted);
}

.timer-display {
  font-size: 2rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  color: var(--primary);
  min-width: 120px;
  text-align: center;
}

.timer-display.timer-warning {
  color: #f59e0b;
  animation: pulse 1s infinite;
}

.timer-display.timer-expired {
  color: #ef4444;
}

.timer-controls {
  display: flex;
  gap: 0.5rem;
}

/* ============================================================================
   ANALYTICS MODAL
   ============================================================================ */

.analytics-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 1rem;
  margin: 1.5rem 0;
}

.analytics-card {
  background: var(--light-green);
  border-radius: 12px;
  padding: 1.5rem;
  text-align: center;
  border: 2px solid var(--primary);
}

.analytics-value {
  font-size: 2.5rem;
  font-weight: 700;
  color: var(--primary);
  margin-bottom: 0.5rem;
}

.analytics-label {
  font-size: 0.875rem;
  color: var(--text-muted);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

/* ============================================================================
   TEMPLATES MODAL
   ============================================================================ */

.template-list {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  margin: 1.5rem 0;
}

.template-item {
  background: var(--background);
  border: 2px solid var(--border);
  border-radius: 12px;
  padding: 1.5rem;
  cursor: pointer;
  transition: all 0.2s ease;
}

.template-item:hover {
  border-color: var(--primary);
  background: var(--light-green);
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.template-item h4 {
  margin: 0 0 0.5rem 0;
  color: var(--text);
  font-size: 1.125rem;
}

.template-item p {
  margin: 0;
  color: var(--text-muted);
  font-size: 0.875rem;
}

/* ============================================================================
   UNDO/REDO BUTTONS
   ============================================================================ */

#undoBtn,
#redoBtn {
  font-size: 1.25rem;
  min-width: 40px;
  padding: 0.5rem;
}

#undoBtn:disabled,
#redoBtn:disabled {
  opacity: 0.3;
  cursor: not-allowed;
}

.question-card {
  background-color: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  padding: 1.5rem;
  margin-bottom: 2.5rem;
  /* This creates the gap between questions */
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
}

/* ============================================================================
   MOBILE OPTIMIZATIONS (FEATURE 5)
   ============================================================================ */

@media (max-width: 768px) {

  /* Header becomes vertical on mobile */
  .header {
    flex-direction: column;
    gap: 1rem;
  }

  .header-left {
    flex-direction: column;
    align-items: flex-start;
  }

  .header-actions {
    width: 100%;
    flex-wrap: wrap;
    gap: 0.5rem;
  }

  .header-actions .btn {
    flex: 1 1 auto;
    min-width: calc(50% - 0.25rem);
  }

  /* Hide button text on mobile, keep icons */
  .btn-text {
    display: none;
  }

  .btn {
    justify-content: center;
  }

  /* Undo/redo buttons smaller */
  #undoBtn,
  #redoBtn {
    min-width: 44px;
    flex: 0 0 44px;
  }

  /* Timer footer more compact */
  .timer-footer {
    padding: 0.75rem;
  }

  .timer-content {
    flex-direction: row;
    gap: 0.75rem;
  }

  .timer-display {
    font-size: 1.5rem;
  }

  /* Analytics grid single column on small screens */
  .analytics-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .analytics-value {
    font-size: 2rem;
  }

  /* Question cards more compact */
  .question-card {
    padding: 1rem;
  }

  .question-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.75rem;
  }

  .question-actions {
    width: 100%;
    justify-content: flex-start;
  }

  /* Modals full screen on mobile */
  .modal {
    max-width: 100%;
    max-height: 100%;
    margin: 0;
    border-radius: 0;
  }

  /* Template items more compact */
  .template-item {
    padding: 1rem;
  }

  .template-item h4 {
    font-size: 1rem;
  }

  .template-item p {
    font-size: 0.8125rem;
  }
}

/* Touch-friendly tap targets */
@media (hover: none) and (pointer: coarse) {
  .btn {
    min-height: 44px;
    padding: 0.75rem 1rem;
  }

  .btn-sm {
    min-height: 36px;
  }

  .question-type-option {
    min-height: 60px;
  }

  .participant-item {
    min-height: 56px;
  }
}

/* Swipe gestures indicator */
.swipe-indicator {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  font-size: 2rem;
  opacity: 0.3;
  pointer-events: none;
  z-index: 10;
}

.swipe-indicator.left {
  left: 1rem;
}

.swipe-indicator.right {
  right: 1rem;
}

/* ============================================================================
   IMPROVED EMPTY STATES
   ============================================================================ */

.empty-state {
  text-align: center;
  padding: 4rem 2rem;
  color: var(--text-muted);
  background-color: var(--bg-surface, #ffffff);
  border: 1px solid var(--border, #e2e8f0);
  border-radius: 12px;
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
}

.empty-state svg {
  width: 64px;
  height: 64px;
  margin-bottom: 1.5rem;
  opacity: 0.3;
}

.empty-state h3 {
  margin: 0 0 0.5rem 0;
  color: var(--text);
}

.empty-state p {
  margin: 0 0 1.5rem 0;
  max-width: 400px;
  margin-left: auto;
  margin-right: auto;
}

/* ============================================================================
   ACCESSIBILITY IMPROVEMENTS
   ============================================================================ */

/* Focus visible for keyboard navigation */
.btn:focus-visible,
button:focus-visible,
input:focus-visible,
textarea:focus-visible {
  outline: 3px solid var(--primary);
  outline-offset: 2px;
}

/* Skip to main content link */
.skip-to-main {
  position: absolute;
  left: -9999px;
  z-index: 999;
  padding: 1rem;
  background: var(--primary);
  color: white;
  text-decoration: none;
}

.skip-to-main:focus {
  left: 1rem;
  top: 1rem;
}

/* High contrast mode support */
@media (prefers-contrast: high) {
  .btn {
    border: 2px solid currentColor;
  }

  .question-card {
    border: 2px solid var(--border);
  }
}

/* Reduced motion support */
@media (prefers-reduced-motion: reduce) {
  * {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }

  .timer-footer {
    animation: none;
  }
}

/* ============================================================================
   LOADING STATES
   ============================================================================ */

.btn.loading {
  position: relative;
  color: transparent;
  pointer-events: none;
}

.btn.loading::after {
  content: '';
  position: absolute;
  width: 16px;
  height: 16px;
  top: 50%;
  left: 50%;
  margin-left: -8px;
  margin-top: -8px;
  border: 2px solid currentColor;
  border-radius: 50%;
  border-right-color: transparent;
  animation: spin 0.6s linear infinite;
}

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

/* ============================================================================
   PRINT STYLES
   ============================================================================ */

@media print {

  .header-actions,
  .timer-footer,
  .footer,
  .question-actions,
  .modal-overlay {
    display: none !important;
  }

  .question-card {
    page-break-inside: avoid;
    border: 1px solid #000;
  }

  .results-section {
    page-break-inside: avoid;
  }
}

/* Ranked Choice */
.rank-item {
  display: flex;
  align-items: center;
  background: var(--light);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 0.5rem 1rem;
  margin-bottom: 0.5rem;
  gap: 1rem;
}

.rank-controls {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.rank-controls button {
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  padding: 0.2rem;
}

.rank-controls button:hover {
  color: var(--primary);
}

/* Lean Coffee Upvote Board */
.upvote-card {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: white;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 1rem;
  margin-bottom: 0.5rem;
  box-shadow: 0 2px 4px var(--shadow);
}

.upvote-btn {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  background: var(--light-green);
  color: var(--primary);
  border: 1px solid var(--primary);
  padding: 0.5rem 1rem;
  border-radius: 20px;
  cursor: pointer;
  font-weight: bold;
  transition: all 0.2s;
}

.upvote-btn:hover {
  background: var(--primary);
  color: white;
}

/* Start/Stop/Continue Matrix */
.ssc-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 1rem;
}

.ssc-column {
  background: var(--light);
  border-radius: var(--radius-md);
  padding: 1rem;
}

.ssc-column h4 {
  margin-bottom: 1rem;
  padding-bottom: 0.5rem;
  border-bottom: 2px solid var(--primary);
}

#feedback-btn:hover {
  transform: scale(1.05);
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.25);
}

@media (max-width: 768px) {
  #feedback-btn {
    bottom: 16px;
    right: 16px;
    width: 48px;
    height: 48px;
    padding: 12px;
  }

  #feedback-btn svg {
    width: 20px;
    height: 20px;
  }
}

.grecaptcha-badge {
  visibility: hidden !important;
}