/* Brickers Modern Styles */
@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@400;500;600;700;800&family=JetBrains+Mono:wght@500;700&display=swap');

:root {
  --color-a: #EF4444; /* Red / Coral */
  --color-b: #3B82F6; /* Electric Blue */
  --color-c: #F59E0B; /* Golden Amber */
  --color-d: #10B981; /* Emerald Green */
}

body {
  font-family: 'Plus Jakarta Sans', system-ui, -apple-system, sans-serif;
  -webkit-tap-highlight-color: transparent;
}

.font-mono-digits {
  font-family: 'JetBrains Mono', monospace;
  font-feature-settings: "tnum";
  font-variant-numeric: tabular-nums;
}

/* Animations */
@keyframes pulseDanger {
  0%, 100% {
    transform: scale(1);
    box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.4);
  }
  50% {
    transform: scale(1.04);
    box-shadow: 0 0 0 10px rgba(239, 68, 68, 0);
  }
}

.animate-pulse-danger {
  animation: pulseDanger 0.8s infinite ease-in-out;
}

@keyframes popIn {
  0% {
    opacity: 0;
    transform: scale(0.92) translateY(10px);
  }
  100% {
    opacity: 1;
    transform: scale(1) translateY(0);
  }
}

.animate-pop-in {
  animation: popIn 0.3s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

/* Option letter pill styling */
.badge-option-a {
  background-color: #FEE2E2;
  color: #DC2626;
  border-color: #FCA5A5;
}
.badge-option-b {
  background-color: #DBEAFE;
  color: #2563EB;
  border-color: #93C5FD;
}
.badge-option-c {
  background-color: #FEF3C7;
  color: #D97706;
  border-color: #FCD34D;
}
.badge-option-d {
  background-color: #D1FAE5;
  color: #059669;
  border-color: #6EE7B7;
}

/* Big option button styles */
.btn-choice {
  transition: all 0.15s cubic-bezier(0.4, 0, 0.2, 1);
  user-select: none;
  -webkit-user-select: none;
}

.btn-choice:active {
  transform: scale(0.97);
}

.btn-choice-a {
  border-color: #FCA5A5;
}
.btn-choice-a:hover {
  background-color: #FFF5F5;
  border-color: #EF4444;
}
.btn-choice-a.selected {
  background-color: #EF4444 !important;
  color: #FFFFFF !important;
  border-color: #DC2626 !important;
  box-shadow: 0 8px 20px -4px rgba(239, 68, 68, 0.4);
}
.btn-choice-a.selected .letter-badge {
  background-color: #FFFFFF !important;
  color: #EF4444 !important;
}

.btn-choice-b {
  border-color: #93C5FD;
}
.btn-choice-b:hover {
  background-color: #F0F7FF;
  border-color: #3B82F6;
}
.btn-choice-b.selected {
  background-color: #3B82F6 !important;
  color: #FFFFFF !important;
  border-color: #2563EB !important;
  box-shadow: 0 8px 20px -4px rgba(59, 130, 246, 0.4);
}
.btn-choice-b.selected .letter-badge {
  background-color: #FFFFFF !important;
  color: #3B82F6 !important;
}

.btn-choice-c {
  border-color: #FCD34D;
}
.btn-choice-c:hover {
  background-color: #FFFDF0;
  border-color: #F59E0B;
}
.btn-choice-c.selected {
  background-color: #F59E0B !important;
  color: #FFFFFF !important;
  border-color: #D97706 !important;
  box-shadow: 0 8px 20px -4px rgba(245, 158, 11, 0.4);
}
.btn-choice-c.selected .letter-badge {
  background-color: #FFFFFF !important;
  color: #F59E0B !important;
}

.btn-choice-d {
  border-color: #6EE7B7;
}
.btn-choice-d:hover {
  background-color: #F0FDF4;
  border-color: #10B981;
}
.btn-choice-d.selected {
  background-color: #10B981 !important;
  color: #FFFFFF !important;
  border-color: #059669 !important;
  box-shadow: 0 8px 20px -4px rgba(16, 185, 129, 0.4);
}
.btn-choice-d.selected .letter-badge {
  background-color: #FFFFFF !important;
  color: #10B981 !important;
}

/* Safe area support for mobile */
.pb-safe {
  padding-bottom: env(safe-area-inset-bottom, 1rem);
}

/* Custom Scrollbar */
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}
::-webkit-scrollbar-track {
  background: #f1f5f9;
}
::-webkit-scrollbar-thumb {
  background: #cbd5e1;
  border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
  background: #94a3b8;
}

/* Cross-platform font smoothing & mobile adaptation */
html, body {
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  min-height: 100vh;
  min-height: 100dvh;
  overflow-x: hidden;
  transition: background-color 0.35s ease, color 0.35s ease;
}

/* Dark Mode Overrides (Smooth Transition) */
html.dark, html.dark body {
  background-color: #0b1120 !important;
  color: #f1f5f9 !important;
}

html.dark body {
  background-color: #0b1120 !important;
  color: #f1f5f9 !important;
}

html.dark header {
  background-color: rgba(15, 23, 42, 0.92) !important;
  border-bottom-color: rgba(51, 65, 85, 0.7) !important;
}

html.dark #theme-toggle-btn,
html.dark #theme-toggle-btn-mobile,
html.dark #sound-toggle-btn,
html.dark #btn-burger-menu {
  color: #cbd5e1 !important;
}

html.dark #theme-toggle-btn:hover,
html.dark #theme-toggle-btn-mobile:hover,
html.dark #sound-toggle-btn:hover,
html.dark #btn-burger-menu:hover {
  background-color: #334155 !important;
  color: #818cf8 !important;
}

html.dark header span.text-slate-900 {
  color: #f8fafc !important;
}

html.dark .bg-white {
  background-color: #162033 !important;
  border-color: #2a3950 !important;
  color: #f1f5f9 !important;
}

html.dark .bg-slate-50,
html.dark .bg-slate-50\/70 {
  background-color: #0f172a !important;
  border-color: #2a3950 !important;
}

html.dark .bg-slate-100 {
  background-color: #1e293b !important;
}

html.dark .bg-slate-200,
html.dark .bg-slate-200\/70 {
  background-color: #1e293b !important;
}

html.dark .bg-indigo-50 {
  background-color: rgba(99, 102, 241, 0.16) !important;
  color: #a5b4fc !important;
  border-color: rgba(99, 102, 241, 0.35) !important;
}

html.dark .bg-emerald-50,
html.dark .bg-emerald-50\/50,
html.dark .bg-emerald-50\/60 {
  background-color: rgba(16, 185, 129, 0.14) !important;
  border-color: rgba(16, 185, 129, 0.35) !important;
  color: #6ee7b7 !important;
}

html.dark .bg-red-50,
html.dark .bg-red-50\/50,
html.dark .bg-red-50\/60 {
  background-color: rgba(239, 68, 68, 0.14) !important;
  border-color: rgba(239, 68, 68, 0.35) !important;
  color: #fca5a5 !important;
}

html.dark .bg-amber-50 {
  background-color: rgba(245, 158, 11, 0.14) !important;
  border-color: rgba(245, 158, 11, 0.35) !important;
  color: #fcd34d !important;
}

html.dark .bg-emerald-100 {
  background-color: rgba(16, 185, 129, 0.22) !important;
  color: #6ee7b7 !important;
}

html.dark .bg-red-100 {
  background-color: rgba(239, 68, 68, 0.22) !important;
  color: #fca5a5 !important;
}

html.dark .bg-amber-100 {
  background-color: rgba(245, 158, 11, 0.22) !important;
  color: #fcd34d !important;
}

html.dark .bg-indigo-100 {
  background-color: rgba(99, 102, 241, 0.22) !important;
  color: #a5b4fc !important;
}

html.dark .text-slate-900, html.dark .text-slate-800 {
  color: #f8fafc !important;
}

html.dark .text-slate-700, html.dark .text-slate-600 {
  color: #cbd5e1 !important;
}

html.dark .text-slate-500, html.dark .text-slate-400 {
  color: #94a3b8 !important;
}

html.dark .border-slate-100, html.dark .border-slate-200, html.dark .border-slate-300 {
  border-color: #2a3950 !important;
}

html.dark tr:hover {
  background-color: rgba(30, 41, 59, 0.7) !important;
}

html.dark input, html.dark select, html.dark textarea {
  background-color: #0b1120 !important;
  border-color: #334155 !important;
  color: #f8fafc !important;
}

html.dark input::placeholder, html.dark textarea::placeholder {
  color: #64748b !important;
}

html.dark .shadow-sm, html.dark .shadow-md, html.dark .shadow-xl, html.dark .shadow-2xl {
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.5) !important;
}

html.dark ::-webkit-scrollbar-track {
  background: #0f172a;
}
html.dark ::-webkit-scrollbar-thumb {
  background: #334155;
}
html.dark ::-webkit-scrollbar-thumb:hover {
  background: #475569;
}

/* Mobile responsive refinements */
@media (max-width: 640px) {
  header .max-w-2xl, header .max-w-6xl {
    padding-left: 12px;
    padding-right: 12px;
  }
  .rounded-3xl {
    border-radius: 1.25rem !important;
  }
  input#test-pin-input {
    font-size: 1.35rem;
    padding: 12px;
    height: 52px;
  }
  #btn-join-pin {
    height: 52px;
    font-size: 1.05rem;
  }
}

button, a, input, select, textarea {
  touch-action: manipulation;
}

@media (max-width: 768px) {
  .container, main, section {
    padding-left: 12px !important;
    padding-right: 12px !important;
  }

  .btn-choice-a,
  .btn-choice-b,
  .btn-choice-c,
  .btn-choice-d {
    min-height: 56px;
    font-size: 1rem;
    padding: 12px 14px;
  }

  table {
    display: block;
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
}

@media (max-width: 480px) {
  h1 {
    font-size: 1.5rem !important;
  }
  h2 {
    font-size: 1.25rem !important;
  }
}
