/* Modern UI styling with clean aesthetics */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

:root {
  --primary: #4f46e5;
  --primary-rgb: 79, 70, 229;
  --primary-hover: #4338ca;
  --danger: #ef4444;
  --danger-hover: #dc2626;
  --card-bg: #1e1e1e;
  --bg: #000000;
  --text: #ffffff;
  --text-secondary: #a1a1aa;
  --border: #333333;
  --button-secondary-bg: #27272a;
  --button-secondary-hover: #3f3f46;
  --shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
  --radius: 8px;
  --font: system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, 'Open Sans', 'Helvetica Neue', sans-serif;
}

/* Remove all animations and transitions EXCEPT for score updates and popups */
* {
  transition: none !important;
  animation: none !important;
}

.score-change, .winner-popup, .score-row {
  transition: all 0.3s ease !important;
  animation: none !important;
}

body {
  background: var(--bg);
  color: var(--text);
  font-family: 'Inter', 'Segoe UI', system-ui, -apple-system, sans-serif;
  margin: 0;
  padding: 40px 20px;
  max-width: 1400px;
  margin: auto;
  line-height: 1.5;
}

.logo-wrapper {
  text-align: center;
  margin-bottom: 40px;
  position: relative;
  z-index: 1;
  min-height: 120px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.logo-wrapper img {
  max-width: 220px;
  max-height: 120px;
  width: auto;
  height: auto;
  display: block;
  filter: drop-shadow(0 4px 6px rgba(0, 0, 0, 0.5));
  object-fit: contain;
  object-position: center;
  margin-bottom: 20px;
  transition: transform 0.5s cubic-bezier(0.19, 1, 0.22, 1);
  cursor: pointer;
}

.logo-wrapper img:hover {
  animation: logoWiggle 0.6s cubic-bezier(0.36, 0.07, 0.19, 0.97) both;
  transform: scale(1.05);
}

/* Logo wiggle animation */
@keyframes logoWiggle {
  0%, 100% {
    transform: rotate(0) scale(1.05);
  }
  15% {
    transform: rotate(-5deg) scale(1.05);
  }
  30% {
    transform: rotate(3deg) scale(1.05);
  }
  45% {
    transform: rotate(-3deg) scale(1.05);
  }
  60% {
    transform: rotate(2deg) scale(1.05);
  }
  75% {
    transform: rotate(-1deg) scale(1.05);
  }
}

/* Stable layout elements - no animations */
.layout {
  display: flex;
  flex-wrap: wrap;
  gap: 20px;
  max-width: 1400px;
  margin: 0 auto;
  padding: 0 20px;
  position: relative;
  z-index: 1;
}

/* When in setup mode, allow full width */
.layout.setup-mode {
  max-width: 100%;
  padding: 0 30px;
}

.sidebar,
.main-content {
  flex: 1;
  min-width: 300px;
}

.sidebar {
  flex: 0 0 300px;
}

.controls,
.main-content,
.sidebar {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.card {
  background: var(--card-bg);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 25px;
  overflow: hidden;
  border: 1px solid var(--border);
  transition: transform 0.5s cubic-bezier(0.19, 1, 0.22, 1), 
              box-shadow 0.5s cubic-bezier(0.19, 1, 0.22, 1), 
              border-color 0.5s cubic-bezier(0.19, 1, 0.22, 1);
  position: relative;
  z-index: 1;
  will-change: transform, box-shadow;
  animation: cardEntrance 0.5s cubic-bezier(0.23, 1, 0.32, 1) forwards;
  isolation: isolate;
}

.card::before, 
.card::after, 
.category-item::after,
.category-item::before {
  pointer-events: none !important;
  z-index: -1 !important;
}

.card:hover {
  transform: translateY(-5px);
  box-shadow: 0 10px 20px rgba(0, 0, 0, 0.1);
  border-color: rgba(var(--primary-rgb), 0.3);
  pointer-events: auto;
  transition: transform 0.4s cubic-bezier(0.165, 0.84, 0.44, 1), 
              box-shadow 0.4s cubic-bezier(0.165, 0.84, 0.44, 1), 
              border-color 0.4s cubic-bezier(0.165, 0.84, 0.44, 1);
}

.card:hover::before {
  opacity: 1;
}

/* Card content animations */
.card h2, .card h3 {
  transition: transform 0.5s cubic-bezier(0.19, 1, 0.22, 1), 
              color 0.5s cubic-bezier(0.19, 1, 0.22, 1);
}

.card:hover h2, .card:hover h3 {
  transform: translateY(-2px);
  color: var(--primary);
  transition: transform 0.4s cubic-bezier(0.165, 0.84, 0.44, 1), 
              color 0.4s cubic-bezier(0.165, 0.84, 0.44, 1);
}

.card table, .card .performance-info, .card .bid-controls {
  transition: transform 0.3s ease, opacity 0.3s ease;
}

.card:hover table, .card:hover .performance-info, .card:hover .bid-controls {
  transform: translateY(2px);
}

/* Special animations for different card types */
.card.scores:hover {
  transform: translateY(-3px) scale(1.01);
  animation: subtlePulse 3s infinite;
  border-color: rgba(var(--primary-rgb), 0.3);
}

.card.performance-card:hover {
  transform: translateY(-5px) scale(1.02);
  box-shadow: 0 15px 30px rgba(var(--primary-rgb), 0.1);
}

.card.result-card:hover {
  transform: translateY(-7px) scale(1.03);
  box-shadow: 0 20px 40px rgba(var(--primary-rgb), 0.2);
  border-color: rgba(var(--primary-rgb), 0.5);
}

/* Add subtle animation to setup cards */
.setup-column .card {
  transition: transform 0.5s cubic-bezier(0.19, 1, 0.22, 1), 
              box-shadow 0.5s cubic-bezier(0.19, 1, 0.22, 1), 
              border-color 0.5s cubic-bezier(0.19, 1, 0.22, 1);
}

.setup-column .card:hover {
  transform: translateY(-5px) scale(1.01);
  box-shadow: 0 12px 24px rgba(0, 0, 0, 0.12);
  border-color: rgba(var(--primary-rgb), 0.4);
  transition: transform 0.4s cubic-bezier(0.165, 0.84, 0.44, 1), 
              box-shadow 0.4s cubic-bezier(0.165, 0.84, 0.44, 1), 
              border-color 0.4s cubic-bezier(0.165, 0.84, 0.44, 1);
}

/* Add subtle border animation */
.card::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  border-radius: var(--radius);
  border: 2px solid transparent;
  background: linear-gradient(135deg, rgba(var(--primary-rgb), 0.5), transparent) border-box;
  -webkit-mask: linear-gradient(#fff 0 0) padding-box, linear-gradient(#fff 0 0);
  -webkit-mask-composite: destination-out;
  mask-composite: exclude;
  opacity: 0;
  transition: opacity 0.4s ease;
  z-index: -1 !important;
  pointer-events: none !important;
}

.card:hover::after {
  opacity: 0.7;
}

h2, h3 {
  margin-bottom: 16px;
  font-weight: 600;
  letter-spacing: -0.025em;
}

h2 {
  font-size: 1.5rem;
  color: var(--text);
}

h3 {
  font-size: 1.25rem;
  color: var(--text);
}

/* Enhance text fields with animations */
textarea {
  width: 100%;
  max-width: 100%;
  height: 120px;
  margin-bottom: 20px;
  padding: 15px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-size: 1rem;
  background: var(--card-bg);
  color: var(--text);
  resize: vertical;
  transition: border-color 0.5s cubic-bezier(0.19, 1, 0.22, 1), 
              box-shadow 0.5s cubic-bezier(0.19, 1, 0.22, 1), 
              transform 0.5s cubic-bezier(0.19, 1, 0.22, 1);
}

textarea:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(var(--primary-rgb), 0.1);
  transform: translateY(-2px);
  transition: border-color 0.4s cubic-bezier(0.165, 0.84, 0.44, 1), 
              box-shadow 0.4s cubic-bezier(0.165, 0.84, 0.44, 1), 
              transform 0.4s cubic-bezier(0.165, 0.84, 0.44, 1);
}

/* Add hover effect to textarea */
textarea:hover {
  border-color: rgba(var(--primary-rgb), 0.3);
}

/* Style for all text inputs */
input[type="text"] {
  width: 100%;
  padding: 12px 16px;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: var(--card-bg);
  color: var(--text);
  font-size: 1rem;
  transition: border-color 0.5s cubic-bezier(0.19, 1, 0.22, 1), 
              box-shadow 0.5s cubic-bezier(0.19, 1, 0.22, 1), 
              transform 0.5s cubic-bezier(0.19, 1, 0.22, 1);
}

input[type="text"]:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(var(--primary-rgb), 0.1);
  transform: translateY(-2px);
}

input[type="text"]:hover {
  border-color: rgba(var(--primary-rgb), 0.3);
}

.category-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 24px;
}

.category-list span {
  display: inline-block;
  padding: 8px 16px;
  background: var(--button-secondary-bg);
  border-radius: 9999px;
  font-size: 0.9rem;
  color: var(--text-secondary);
}

.category-list .current {
  background: var(--primary);
  color: white;
  font-weight: 500;
}

/* Interactive elements without animations */
button {
  padding: 12px 24px;
  border: none;
  border-radius: var(--radius);
  background: var(--primary);
  color: white;
  font-size: 1rem;
  font-weight: 500;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

button:hover {
  background: var(--primary-hover);
}

button:disabled {
  background: var(--button-secondary-bg);
  color: var(--text-secondary);
  cursor: not-allowed;
}

button.danger {
  background: var(--danger);
}

button.danger:hover {
  background: var(--danger-hover);
}

button.secondary {
  background: var(--button-secondary-bg);
  color: var(--text);
}

button.secondary:hover {
  background: var(--button-secondary-hover);
}

button.primary-action {
  background: var(--primary);
  font-weight: 600;
  padding: 14px 28px;
}

button.icon-button {
  padding: 10px;
  min-width: 44px;
  font-size: 1rem;
}

button.icon-button:hover {
  transform: scale(1.05);
}

/* Button click effect */
button::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 5px;
  height: 5px;
  background: rgba(255, 255, 255, 0.5);
  opacity: 0;
  border-radius: 100%;
  transform: scale(1, 1) translate(-50%, -50%);
  transform-origin: 50% 50%;
}

button:active::after {
  animation: ripple 0.4s ease-out;
}

@keyframes ripple {
  0% {
    transform: scale(0, 0);
    opacity: 0.5;
  }
  100% {
    transform: scale(20, 20);
    opacity: 0;
  }
}

/* Remove card animation */
.card {
  animation: none;
}

input[type="number"] {
  padding: 12px 16px;
  margin: 10px 0;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  width: 120px;
  font-size: 1rem;
  background: var(--card-bg);
  color: var(--text);
}

input[type="number"]:focus {
  outline: none;
  border-color: var(--primary);
}

.card.scores {
  overflow-x: auto;
}

.card.scores table {
  width: 100%;
  border-collapse: collapse;
  table-layout: fixed;
  margin-top: 10px;
}

.card.scores th,
.card.scores td {
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
  word-wrap: break-word;
  white-space: normal;
  overflow-wrap: anywhere;
  text-align: left;
}

.card.scores th {
  background: var(--button-secondary-bg);
  color: var(--text);
  font-weight: 500;
}

.card.scores tr:last-child td {
  border-bottom: none;
}

.timer {
  font-size: 5rem;
  font-weight: 700;
  color: var(--text);
  margin: 20px 0;
  text-align: center;
  letter-spacing: -0.025em;
  transition: color 0.5s ease !important;
  opacity: 1;
  visibility: visible;
}

.timer.inactive,
.word-counter.inactive {
  color: var(--text-secondary);
  opacity: 0.6;
}

.timer.safe {
  color: #22c55e;
}

.timer.warning {
  color: #eab308;
}

.timer.danger {
  color: #ef4444;
  animation: timerPulse 0.8s ease-in-out infinite !important;
}

@keyframes timerPulse {
  0% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.1);
  }
  100% {
    transform: scale(1);
  }
}

.timer span,
.word-counter span {
  display: block;
  font-size: 0.4em;
  font-weight: normal;
  color: var(--text-secondary);
  margin-top: 4px;
  animation: none !important;
  transform: none !important;
}

.word-counter {
  font-size: 5rem;
  font-weight: 700;
  color: var(--text);
  margin: 20px 0;
  text-align: center;
  letter-spacing: -0.025em;
  opacity: 1;
  visibility: visible;
}

p,
label {
  margin: 10px 0;
  font-size: 1rem;
  color: var(--text-secondary);
  line-height: 1.6;
}

label {
  display: flex;
  align-items: center;
  margin-bottom: 8px;
  cursor: pointer;
}

input[type="checkbox"] {
  margin-right: 8px;
  width: 18px;
  height: 18px;
  accent-color: var(--primary);
}

/* Language switcher styling */
#language-switcher {
  position: fixed;
  top: 20px;
  right: 20px;
  z-index: 1000;
  display: flex;
  gap: 10px;
  background: var(--card-bg);
  padding: 8px;
  border-radius: 9999px;
  box-shadow: var(--shadow);
}

#language-switcher button {
  background: none;
  border: none;
  font-size: 1.5em;
  cursor: pointer;
  padding: 5px;
  border-radius: 50%;
}

#language-switcher button.active {
  background: var(--button-secondary-bg);
}

#language-switcher button:hover {
  background: var(--button-secondary-bg);
  transform: scale(1.1);
}

/* Responsive adjustments */
@media (max-width: 768px) {
  .layout {
    grid-template-columns: 1fr;
  }
  
  .card {
    padding: 20px;
  }
  
  .timer, .word-counter {
    font-size: 2rem;
  }
}

/* Checkbox grid for category selection */
.checkbox-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 10px;
  margin-bottom: 20px;
}

/* Current category display */
.current-category {
  display: none;
}

/* Remove bid-specific styles since we're using performance styles for both phases */
.bid-info,
.bid-stat,
.bid-label,
.bid-value {
  display: none;
}

/* Update bid controls to match performance styling */
.bid-controls {
  display: flex;
  flex-direction: column;
  gap: 16px;
  margin-top: 20px;
  margin-bottom: auto;
}

.bid-controls input[type="number"] {
  width: 100%;
  padding: 16px;
  font-size: 1.2rem;
  text-align: center;
}

/* Performance card styling - now used for both phases */
.performance-card {
  max-width: 800px;
  margin: 0 auto;
  min-height: 500px;
  display: flex;
  flex-direction: column;
}

/* Category container styling */
.category-container {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: 16px 0;
  justify-content: center;
}

/* Enhance category items with animations */
.category-item {
  padding: 8px 16px;
  border-radius: 9999px;
  font-weight: 600;
  font-size: 1rem;
  margin: 0 8px 8px 0;
  display: inline-block;
  transition: all 0.5s cubic-bezier(0.19, 1, 0.22, 1);
  cursor: default;
  border: 1px solid transparent;
}

.category-item:hover {
  transform: translateY(-2px);
  box-shadow: 0 5px 10px rgba(0, 0, 0, 0.05);
  transition: all 0.4s cubic-bezier(0.165, 0.84, 0.44, 1);
}

.category-item.current {
  background: var(--primary);
  color: white;
  position: relative;
  overflow: hidden;
}

.category-item.current:hover {
  transform: translateY(-3px) scale(1.05);
  box-shadow: 0 8px 15px rgba(var(--primary-rgb), 0.15);
}

.category-item.inactive {
  background: var(--button-secondary-bg);
  color: var(--text-secondary);
  opacity: 0.7;
}

.category-item.inactive:hover {
  opacity: 0.9;
  transform: translateY(-1px);
}

/* Fix shimmer effect to not block interactions */
.category-item.current::after {
  content: '';
  position: absolute;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background: linear-gradient(
    to right,
    rgba(255, 255, 255, 0) 0%,
    rgba(255, 255, 255, 0.3) 50%,
    rgba(255, 255, 255, 0) 100%
  );
  transform: rotate(30deg);
  animation: shimmer 3s infinite;
  pointer-events: none !important;
  z-index: -1 !important;
}

@keyframes shimmer {
  0% {
    transform: translateX(-100%) rotate(30deg);
  }
  100% {
    transform: translateX(100%) rotate(30deg);
  }
}

/* Performance info styles with animations */
.performance-info {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  margin: 24px 0;
  padding: 20px;
  background: var(--button-secondary-bg);
  border-radius: var(--radius);
  transition: transform 0.5s cubic-bezier(0.19, 1, 0.22, 1), 
              box-shadow 0.5s cubic-bezier(0.19, 1, 0.22, 1);
}

.card:hover .performance-info {
  transform: translateY(2px);
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.05);
  transition: transform 0.4s cubic-bezier(0.165, 0.84, 0.44, 1), 
              box-shadow 0.4s cubic-bezier(0.165, 0.84, 0.44, 1);
}

.performance-stat {
  display: flex;
  flex-direction: column;
  gap: 8px;
  text-align: center;
  transition: transform 0.3s ease;
}

.card:hover .performance-stat {
  transform: translateY(-2px);
}

.performance-label {
  font-size: 0.9rem;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.performance-value {
  font-size: 2rem;
  font-weight: 700;
  color: var(--text);
  line-height: 1.2;
  transition: color 0.5s cubic-bezier(0.19, 1, 0.22, 1), 
              transform 0.5s cubic-bezier(0.19, 1, 0.22, 1);
}

.card:hover .performance-value {
  color: var(--primary);
  transform: scale(1.05);
  transition: color 0.4s cubic-bezier(0.165, 0.84, 0.44, 1), 
              transform 0.4s cubic-bezier(0.165, 0.84, 0.44, 1);
}

/* Enhance buttons within cards */
.card button {
  transition: transform 0.5s cubic-bezier(0.19, 1, 0.22, 1), 
              background 0.5s cubic-bezier(0.19, 1, 0.22, 1), 
              box-shadow 0.5s cubic-bezier(0.19, 1, 0.22, 1);
}

.card button:hover {
  transform: translateY(-2px);
  box-shadow: 0 5px 15px rgba(var(--primary-rgb), 0.2);
  transition: transform 0.4s cubic-bezier(0.165, 0.84, 0.44, 1), 
              background 0.4s cubic-bezier(0.165, 0.84, 0.44, 1), 
              box-shadow 0.4s cubic-bezier(0.165, 0.84, 0.44, 1);
}

.card button.primary-action:hover {
  transform: translateY(-3px);
  box-shadow: 0 8px 20px rgba(var(--primary-rgb), 0.3);
}

/* Add staggered animation for card content when page loads */
.card > * {
  animation: none;
  opacity: 1 !important;
}

.card > *:nth-child(1), 
.card > *:nth-child(2), 
.card > *:nth-child(3), 
.card > *:nth-child(4), 
.card > *:nth-child(5) {
  animation-delay: 0s;
}

/* Button variations */
.button-group {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  justify-content: center;
  margin-top: auto;
  padding-top: 20px;
}

/* Game over / results screen */
.result-card {
  text-align: center;
}

.winner-section {
  display: flex;
  flex-direction: column;
  align-items: center;
  margin: 30px 0;
}

.winner-trophy {
  font-size: 4rem;
  margin-bottom: 16px;
  filter: drop-shadow(0 0 10px rgba(255, 215, 0, 0.5));
}

.winner-name {
  font-size: 2rem;
  font-weight: 700;
  margin-bottom: 8px;
  color: var(--text);
}

.winner-score {
  font-size: 1.25rem;
  color: var(--text-secondary);
}

/* Responsive adjustments for smaller screens */
@media (max-width: 576px) {
  .bid-info,
  .performance-info {
    grid-template-columns: 1fr;
    gap: 16px;
  }
  
  .checkbox-grid {
    grid-template-columns: 1fr 1fr;
  }
}

/* Winner popup */
.winner-popup {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background: var(--card-bg);
  border: none;
  border-radius: var(--radius);
  padding: 30px 40px;
  text-align: center;
  z-index: 2000;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
  animation: popIn 0.3s ease forwards !important;
  max-width: 90%;
  width: 400px;
  backdrop-filter: blur(10px);
  border-top: 4px solid var(--primary);
}

.winner-popup.hide {
  animation: popOut 0.3s ease forwards !important;
}

.winner-popup h3 {
  color: var(--text);
  margin-bottom: 15px;
  font-size: 1.5rem;
  font-weight: 700;
}

.winner-popup .category {
  color: var(--primary);
  font-weight: 500;
  margin-bottom: 20px;
  font-size: 1.1rem;
  padding: 5px 15px;
  background: rgba(var(--primary-rgb), 0.1);
  border-radius: 20px;
  display: inline-block;
}

.winner-popup .score {
  font-size: 1.2rem;
  font-weight: 500;
  color: var(--text);
  margin-bottom: 25px;
  line-height: 1.6;
}

.winner-popup .score .highlight {
  font-weight: 700;
  color: var(--primary);
}

.winner-popup .next-round-btn {
  background: var(--primary);
  color: white;
  border: none;
  border-radius: var(--radius);
  padding: 12px 24px;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease !important;
  margin-top: 10px;
  width: 100%;
}

.winner-popup .next-round-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 5px 15px rgba(var(--primary-rgb), 0.3);
}

.winner-popup .result-icon {
  font-size: 2.5rem;
  margin-bottom: 15px;
}

.winner-popup .win-icon {
  color: #22c55e;
}

.winner-popup .lose-icon {
  color: var(--danger);
}

/* Score change indicator */
.score-change {
  position: absolute;
  right: 15px;
  font-weight: 700;
  animation: fadeUp 0.8s ease forwards !important;
  z-index: 10;
  padding: 3px 8px;
  border-radius: 10px;
  opacity: 0;
}

.score-change.positive {
  color: #22c55e;
  background: rgba(34, 197, 94, 0.1);
}

.score-change.negative {
  color: var(--danger);
  background: rgba(239, 68, 68, 0.1);
}

.score-change.neutral {
  color: var(--text-secondary);
}

/* Score row animation */
.score-row {
  position: relative;
  transition: all 0.4s ease !important;
  transform-origin: center left;
  will-change: transform, opacity, background-color;
}

.score-row:hover {
  background-color: rgba(var(--primary-rgb), 0.05);
}

/* Animations */
@keyframes popIn {
  0% {
    opacity: 0;
    transform: translate(-50%, -40%) scale(0.95);
  }
  70% {
    transform: translate(-50%, -50%) scale(1.03);
  }
  100% {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1);
  }
}

@keyframes popOut {
  0% {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1);
  }
  100% {
    opacity: 0;
    transform: translate(-50%, -60%) scale(0.95);
  }
}

@keyframes fadeUp {
  0% {
    opacity: 0;
    transform: translateY(10px);
  }
  20% {
    opacity: 1;
  }
  80% {
    opacity: 1;
    transform: translateY(-5px);
  }
  100% {
    opacity: 0;
    transform: translateY(-10px);
  }
}

/* Update scores table styles */
.card.scores table {
  position: relative;
  border-collapse: separate;
  border-spacing: 0;
}

.card.scores tr {
  transition: all 0.4s cubic-bezier(0.2, 0.8, 0.2, 1) !important;
  cursor: default;
}

.card.scores td {
  transition: all 0.3s ease !important;
  position: relative;
}

/* Setup screen styles */
.setup-container {
  display: flex;
  gap: 30px;
  margin: 20px auto;
  width: 100%;
  max-width: 100%;
  padding: 0 10px;
}

.setup-column {
  flex: 1;
  min-width: 0;
}

.setup-column .card {
  width: 100%;
  max-width: 100%;
  margin: 0;
  height: 100%;
  padding: 30px;
}

.player-name-fields {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-bottom: 25px;
  width: 100%;
}

.player-field {
  position: relative;
  width: 100%;
}

.player-input {
  width: 100%;
  padding: 12px 16px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--card-bg);
  color: var(--text);
  font-size: 1rem;
  transition: border-color 0.5s cubic-bezier(0.19, 1, 0.22, 1), 
              box-shadow 0.5s cubic-bezier(0.19, 1, 0.22, 1), 
              transform 0.5s cubic-bezier(0.19, 1, 0.22, 1);
  opacity: 1 !important;
  visibility: visible !important;
}

.player-input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(var(--primary-rgb), 0.2);
  outline: none;
  transform: translateY(-2px);
}

.player-input:hover {
  border-color: rgba(var(--primary-rgb), 0.3);
}

.category-selection {
  display: flex;
  flex-direction: column;
  gap: 15px;
  width: 100%;
}

.checkbox-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 12px;
  margin: 15px 0;
  width: 100%;
}

.randomize-section {
  margin-top: 10px;
  padding-top: 15px;
  border-top: 1px solid var(--border);
  width: 100%;
}

.randomize-controls {
  display: flex;
  align-items: center;
  gap: 15px;
  margin-top: 10px;
  flex-wrap: wrap;
}

.randomize-input {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.randomize-input input {
  width: 70px;
  padding: 8px;
  border-radius: 6px;
  border: 1px solid var(--border);
  background: var(--card-bg);
  color: var(--text);
}

.start-game-container {
  display: flex;
  justify-content: center;
  margin-top: 30px;
  width: 100%;
}

.start-game-container button {
  min-width: 200px;
  font-size: 1.1rem;
}

/* Responsive adjustments for setup screen */
@media (max-width: 768px) {
  .setup-container {
    flex-direction: column;
  }
}

/* Add card content animation keyframes */
@keyframes cardContentFadeIn {
  0% {
    opacity: 0.5;
    transform: translateY(10px);
  }
  100% {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Add card glow animation */
@keyframes subtlePulse {
  0% {
    box-shadow: 0 5px 15px rgba(var(--primary-rgb), 0.05);
  }
  50% {
    box-shadow: 0 8px 20px rgba(var(--primary-rgb), 0.15);
  }
  100% {
    box-shadow: 0 5px 15px rgba(var(--primary-rgb), 0.05);
  }
}

/* Add subtle entrance animation for cards when they appear */
@keyframes cardEntrance {
  0% {
    opacity: 0.7;
    transform: translateY(25px);
  }
  50% {
    opacity: 0.9;
  }
  100% {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Stagger card animations based on their position */
.layout > div:nth-child(1) .card { animation-delay: 0.1s; }
.layout > div:nth-child(2) .card { animation-delay: 0.2s; }
.layout > div:nth-child(3) .card { animation-delay: 0.3s; }

/* Enhance result card with special effects */
.card.result-card {
  transition: transform 0.6s cubic-bezier(0.19, 1, 0.22, 1), 
              box-shadow 0.6s cubic-bezier(0.19, 1, 0.22, 1), 
              border-color 0.6s cubic-bezier(0.19, 1, 0.22, 1);
}

.card.result-card:hover {
  transform: translateY(-7px) scale(1.03);
  box-shadow: 0 20px 40px rgba(var(--primary-rgb), 0.2);
  border-color: rgba(var(--primary-rgb), 0.5);
  transition: transform 0.5s cubic-bezier(0.165, 0.84, 0.44, 1), 
              box-shadow 0.5s cubic-bezier(0.165, 0.84, 0.44, 1), 
              border-color 0.5s cubic-bezier(0.165, 0.84, 0.44, 1);
}

.card.result-card .winner-trophy {
  transition: transform 0.6s cubic-bezier(0.19, 1, 0.22, 1);
}

.card.result-card:hover .winner-trophy {
  transform: scale(1.2) rotate(10deg);
  transition: transform 0.5s cubic-bezier(0.165, 0.84, 0.44, 1);
}

/* Ensure text is visible in all states */
.card h2, 
.card h3, 
.card p, 
.card span, 
.card label, 
.card input, 
.card textarea {
  opacity: 1 !important;
  visibility: visible !important;
}

/* Global rule to ensure all text is visible */
body, h1, h2, h3, h4, h5, h6, p, span, div, label, input, textarea, button, a {
  opacity: 1 !important;
  visibility: visible !important;
  /* Ensure elements are clickable */
  pointer-events: auto !important;
}

/* Fix card pseudo-elements that might be blocking interactions */
.card::before, .card::after {
  pointer-events: none !important; /* Ensure pseudo-elements don't block interactions */
  z-index: -1 !important; /* Keep them behind content */
}

/* Ensure inputs and buttons are clickable */
input, textarea, button, select, .category-item, .checkbox-grid label {
  position: relative;
  z-index: 10 !important; /* Higher z-index to ensure they're clickable */
  pointer-events: auto !important;
  cursor: pointer;
}

/* Fix the shimmer effect to not block interactions */
.category-item.current::after {
  pointer-events: none !important;
}

/* Fix any potential issues with card hover effects */
.card:hover {
  transform: translateY(-5px);
  box-shadow: 0 10px 20px rgba(0, 0, 0, 0.1);
  border-color: rgba(var(--primary-rgb), 0.3);
  /* Ensure hover doesn't break interactions */
  pointer-events: auto;
}

/* Ensure card content is clickable */
.card > * {
  position: relative;
  z-index: 2; /* Higher than card pseudo-elements */
  pointer-events: auto !important;
}

/* Ensure form elements are interactive */
input, textarea, button, select {
  cursor: pointer;
  user-select: auto !important;
  -webkit-user-select: auto !important;
}

input[type="text"], input[type="number"], textarea {
  cursor: text !important;
}

/* Fix checkbox interactions */
.checkbox-grid label {
  cursor: pointer;
  user-select: none;
}

.checkbox-grid input[type="checkbox"] {
  cursor: pointer;
  pointer-events: auto !important;
  position: relative;
  z-index: 10;
}

/* Fix text blurring issues on Chrome (Windows 11) for interactive elements */
.card, .card * {
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  transform: translateZ(0);
}

.category-item, .category-item * {
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  transform: translateZ(0);
}

/* Apply font smoothing to form elements */
button, input, textarea, select {
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  transform: translateZ(0);
}

/* Accordion styles for category selection */
.category-accordion {
  border-radius: 12px;
  background: var(--card-bg);
  box-shadow: 0 2px 8px rgba(0,0,0,0.04);
  margin-bottom: 18px;
}
.accordion-group + .accordion-group {
  border-top: 1px solid var(--border);
}
.accordion-toggle {
  width: 100%;
  text-align: left;
  background: none;
  border: none;
  outline: none;
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--primary);
  padding: 16px 18px;
  cursor: pointer;
  transition: background 0.15s;
  border-radius: 0;
  position: relative;
  display: flex;
  align-items: center;
}
.accordion-toggle[aria-expanded="true"] {
  background: var(--button-secondary-bg);
  color: var(--primary-dark, #2563eb);
}
.accordion-toggle:after {
  content: '\25BC';
  font-size: 1rem;
  margin-left: auto;
  transition: transform 0.2s;
  color: var(--primary);
}
.accordion-toggle[aria-expanded="true"]:after {
  transform: rotate(-180deg);
}
.accordion-panel {
  padding: 10px 18px 18px 18px;
  background: none;
  animation: fadeInAccordion 0.2s;
}
@keyframes fadeInAccordion {
  from { opacity: 0; transform: translateY(-8px); }
  to { opacity: 1; transform: none; }
}
.checkbox-grid {
  margin-bottom: 0;
}

/* Avatar selection styles */
.avatar-select {
  display: flex;
  gap: 6px;
  margin-top: 6px;
  flex-wrap: wrap;
}
.avatar-btn {
  background: var(--card-bg);
  border: 1.5px solid var(--border);
  border-radius: 50%;
  width: 36px;
  height: 36px;
  font-size: 1.3rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: border-color 0.18s, box-shadow 0.18s, background 0.18s;
  outline: none;
  box-shadow: 0 1px 4px rgba(0,0,0,0.04);
}
.avatar-btn.selected, .avatar-btn:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 2px var(--primary), 0 1px 4px rgba(0,0,0,0.08);
  background: var(--button-secondary-bg);
}
.avatar-btn:hover {
  border-color: var(--primary-dark, #2563eb);
}

.avatar-dropdown {
  border: 1.5px solid var(--border);
  border-radius: 50%;
  background: var(--card-bg);
  color: var(--text);
  width: 44px;
  height: 44px;
  font-size: 1.3rem;
  text-align: center;
  cursor: pointer;
  outline: none;
  box-shadow: 0 1px 4px rgba(0,0,0,0.04);
  padding: 0 6px;
  appearance: none;
  -webkit-appearance: none;
  display: flex;
  align-items: center;
  justify-content: center;
}
.avatar-dropdown:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 2px var(--primary), 0 1px 4px rgba(0,0,0,0.08);
  background: var(--button-secondary-bg);
}

.team-dropdown {
  border: 1.5px solid var(--border);
  border-radius: 6px;
  background: var(--card-bg);
  color: var(--text);
  width: 90px;
  height: 36px;
  font-size: 1rem;
  text-align: left;
  cursor: pointer;
  outline: none;
  box-shadow: 0 1px 4px rgba(0,0,0,0.04);
  padding: 0 8px;
  appearance: none;
  -webkit-appearance: none;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-left: 2px;
}
.team-dropdown:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 2px var(--primary), 0 1px 4px rgba(0,0,0,0.08);
  background: var(--button-secondary-bg);
}
  