/* style.css */
.emoji-cell {
  width: 70px;
  height: 70px;
  font-size: 40px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid #ddd;
  transition: all 0.3s ease;
  border-radius: 12px;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
  background: rgba(255, 255, 255, 0.85);
  position: relative;
  overflow: hidden;
}

.emoji-cell.selected {
  background-color: rgba(252, 211, 77, 0.85);
  border: 2px solid #f59e0b;
  box-shadow: 0 0 15px rgba(245, 158, 11, 0.5);
  z-index: 2;
}

.emoji-cell.hint {
  animation: hint-pulse 1.5s infinite;
}

.emoji-cell.match-animation {
  animation: match 0.5s ease-out;
}

.emoji-cell.powerup:before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: radial-gradient(circle, rgba(255,255,255,0.8) 0%, rgba(255,255,255,0) 70%);
  animation: powerup-glow 2s infinite;
}

.emoji-cell.chain-match {
  animation: chain 0.7s ease-out;
}

@keyframes match {
  0% { transform: scale(1); }
  50% { transform: scale(1.3); opacity: 0.7; }
  100% { transform: scale(1); opacity: 1; }
}

@keyframes hint-pulse {
  0% { box-shadow: 0 0 0 0 rgba(96, 165, 250, 0.5); }
  70% { box-shadow: 0 0 0 10px rgba(96, 165, 250, 0); }
  100% { box-shadow: 0 0 0 0 rgba(96, 165, 250, 0); }
}

@keyframes powerup-glow {
  0% { opacity: 0.3; }
  50% { opacity: 0.7; }
  100% { opacity: 0.3; }
}

@keyframes chain {
  0% { transform: scale(1); background-color: rgba(52, 211, 153, 0.7); }
  50% { transform: scale(1.2); background-color: rgba(52, 211, 153, 0.9); }
  100% { transform: scale(1); background-color: rgba(255, 255, 255, 0.85); }
}

.score-flash {
  animation: score-flash 0.8s ease-out;
  position: absolute;
  pointer-events: none;
  color: #f59e0b;
  font-weight: bold;
  font-size: 1.2rem;
  z-index: 5;
}

@keyframes score-flash {
  0% { transform: translateY(0); opacity: 1; }
  100% { transform: translateY(-50px); opacity: 0; }
}

.explosion {
  position: absolute;
  pointer-events: none;
  background: radial-gradient(circle, rgba(255,224,141,0.8) 0%, rgba(255,179,0,0) 70%);
  border-radius: 50%;
  z-index: 4;
  animation: explosion 0.6s ease-out forwards;
}

@keyframes explosion {
  0% { transform: scale(0); opacity: 1; }
  100% { transform: scale(3); opacity: 0; }
}

.grid-container {
  position: relative;
}

.confetti {
  position: absolute;
  width: 10px;
  height: 10px;
  background-color: #f59e0b;
  opacity: 0.8;
  z-index: 3;
  animation: confetti-fall 4s ease-out forwards;
}

@keyframes confetti-fall {
  0% { transform: translateY(0) rotate(0deg); opacity: 1; }
  100% { transform: translateY(100vh) rotate(720deg); opacity: 0; }
}

.timer-warning {
  animation: timer-pulse 1s infinite;
}

@keyframes timer-pulse {
  0% { background-color: rgba(239, 68, 68, 0.7); }
  50% { background-color: rgba(239, 68, 68, 0.9); }
  100% { background-color: rgba(239, 68, 68, 0.7); }
}

.player-joined {
  animation: player-joined 1s ease-out;
}

@keyframes player-joined {
  0% { transform: translateY(-20px); opacity: 0; }
  100% { transform: translateY(0); opacity: 1; }
}

.player-left {
  animation: player-left 1s ease-out;
}

@keyframes player-left {
  0% { transform: translateX(0); opacity: 1; }
  100% { transform: translateX(20px); opacity: 0; }
}

/* Responsive Styles */
@media (max-width: 640px) {
  .emoji-cell {
    width: 50px;
    height: 50px;
    font-size: 28px;
  }
  
  .grid {
    grid-template-columns: repeat(6, 50px) !important;
    gap: 4px !important;
  }
  
  #timer {
    width: 80px !important;
    height: 80px !important;
    font-size: 2rem !important;
  }
}

@media (max-width: 480px) {
  .emoji-cell {
    width: 40px;
    height: 40px;
    font-size: 24px;
  }
  
  .grid {
    grid-template-columns: repeat(6, 40px) !important;
    gap: 3px !important;
  }
  
  .player-info, .player-count {
    padding: 4px 8px !important;
    font-size: 0.8rem !important;
  }
}

/* Dark Mode Support */
@media (prefers-color-scheme: dark) {
  .modal-content {
    background: #1F2937 !important;
    color: #F3F4F6 !important;
  }
  
  .leaderboard-container, .powerup-legend {
    background: rgba(31, 41, 55, 0.9) !important;
    color: #F3F4F6 !important;
  }
  
  .score-item {
    background: rgba(55, 65, 81, 0.7) !important;
    color: #F3F4F6 !important;
  }
  
  .score-item.self {
    background: rgba(30, 58, 138, 0.4) !important;
  }
  
  .score-item:hover {
    background: rgba(55, 65, 81, 1) !important;
  }
  
  h2, h3 {
    color: #93C5FD !important;
  }
}