.crossword-container {
  max-width: 100%;
  margin: 0 auto;
  padding: 10px;
}

.crossword-title {
  text-align: center;
  color: #0a53a6;
  margin-bottom: 25px;
  font-size: 1.5rem;
  font-weight: bold;
}

.crossword-main {
  display: flex;
  gap: 20px;
  justify-content: center;
  align-items: stretch;
  flex-wrap: wrap;
}

.crossword-grid {
  display: flex;
  flex-direction: column;
  gap: 6px;
  align-items: flex-start;
}

.crossword-row {
  display: flex;
  align-items: center;
  gap: 20px;
  justify-content: flex-start;
}

.row-number {
  width: 24px;
  font-weight: bold;
  color: #0a53a6;
  text-align: right;
  font-size: 0.9rem;
  flex-shrink: 0;
}

.cells-wrapper {
  display: flex;
  align-items: center;
  gap: 2px;
}

.spacer {
  width: 40px;
  height: 40px;
  flex-shrink: 0;
}

.cells-container {
  display: flex;
  gap: 2px;
}

.crossword-cell {
  width: 40px;
  height: 40px;
  border: none;
  text-align: center;
  font-size: 1.2rem;
  font-weight: bold;
  text-transform: uppercase;
  color: white;
  border-radius: 6px;
  transition: all 0.3s ease;
  outline: none;
  flex-shrink: 0;
  box-sizing: border-box;
  text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.4);
}

.crossword-cell::placeholder {
  color: rgba(255, 255, 255, 0.4);
}

.crossword-cell:focus {
  box-shadow: 0 0 15px rgba(255, 255, 255, 0.7);
  transform: scale(1.1);
}

.crossword-cell.color-0 {
  background: linear-gradient(145deg, #45b8e8 0%, #2a9fd4 50%, #1e88c7 100%);
  box-shadow: 0 3px 6px rgba(0, 0, 0, 0.25), inset 0 1px 0 rgba(255, 255, 255, 0.2);
}

.crossword-cell.color-1 {
  background: linear-gradient(145deg, #0078a8 0%, #005577 50%, #003d5c 100%);
  box-shadow: 0 3px 6px rgba(0, 0, 0, 0.25), inset 0 1px 0 rgba(255, 255, 255, 0.15);
}

.crossword-cell.key-cell {
  box-shadow: 0 0 0 3px #ffd700, 0 0 15px rgba(255, 215, 0, 0.5), 0 4px 8px rgba(0, 0, 0, 0.3);
  transform: scale(1.05);
}

.crossword-cell.key-cell.color-0 {
  background: linear-gradient(145deg, #5cc8f5 0%, #3ab0e8 50%, #28a0d8 100%);
}

.crossword-cell.key-cell.color-1 {
  background: linear-gradient(145deg, #0090c0 0%, #006890 50%, #004d70 100%);
}

.crossword-cell.correct {
  background: linear-gradient(145deg, #5cd85c 0%, #4CAF50 50%, #3d9140 100%) !important;
  box-shadow: 0 0 0 2px #2e7d32, 0 4px 8px rgba(0, 0, 0, 0.3) !important;
  animation: correctPulse 0.5s ease;
}

.crossword-cell.caravana-complete-0 {
  background: linear-gradient(145deg, #45b8e8 0%, #2a9fd4 50%, #1e88c7 100%) !important;
  box-shadow: 0 0 0 3px #ffd700, 0 0 20px rgba(255, 215, 0, 0.6) !important;
}

.crossword-cell.caravana-complete-1 {
  background: linear-gradient(145deg, #0078a8 0%, #005577 50%, #003d5c 100%) !important;
  box-shadow: 0 0 0 3px #ffd700, 0 0 20px rgba(255, 215, 0, 0.6) !important;
}

@keyframes correctPulse {
  0% { transform: scale(1); }
  50% { transform: scale(1.15); }
  100% { transform: scale(1); }
}

@keyframes caravanaWave {
  0% { transform: scale(1) rotate(0deg); }
  25% { transform: scale(1.2) rotate(-3deg); }
  50% { transform: scale(1.25) rotate(0deg); }
  75% { transform: scale(1.2) rotate(3deg); }
  100% { transform: scale(1) rotate(0deg); }
}

.crossword-cell.caravana-animate {
  animation: caravanaWave 0.6s ease;
}

.hints-panel {
  display: flex;
  flex-direction: column;
  padding: 15px 20px;
  background: rgba(255, 255, 255, 0.85);
  border-radius: 12px;
  min-width: 280px;
  max-width: 320px;
  border: 1px solid rgba(0, 0, 0, 0.1);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.hints-panel h4 {
  color: #0a53a6;
  margin: 0 0 10px 0;
  font-size: 1.1rem;
  text-align: center;
  font-weight: bold;
}

.hint-item {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  padding: 6px 0;
  border-bottom: 1px solid rgba(0, 0, 0, 0.08);
  flex: 1;
}

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

.hint-number {
  color: #0a53a6;
  font-weight: bold;
  min-width: 24px;
}

.hint-text {
  color: #333;
  font-size: 0.85rem;
  line-height: 1.4;
}

.success-message {
  text-align: center;
  font-size: 1.8rem;
  font-weight: bold;
  color: #0a53a6;
  margin-top: 30px;
  opacity: 0;
  transform: translateY(20px) scale(0.9);
  transition: all 0.6s ease;
}

.success-message.show {
  opacity: 1;
  transform: translateY(0) scale(1);
}

.success-message .secret-word {
  display: block;
  font-size: 3rem;
  margin-top: 15px;
  background: linear-gradient(135deg, #3190bf 0%, #00314a 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  animation: revealPulse 1s ease infinite alternate;
}

@keyframes revealPulse {
  0% { transform: scale(1); }
  100% { transform: scale(1.05); }
}

/* Mobile styles */
@media (max-width: 900px) {
  .crossword-main {
    flex-direction: column;
    align-items: center;
    gap: 20px;
  }
  
  .hints-panel {
    max-width: 500px;
    width: 100%;
  }
}

@media (max-width: 600px) {
  .crossword-cell {
    width: 32px;
    height: 32px;
    font-size: 1rem;
  }
  
  .spacer {
    width: 32px;
    height: 32px;
  }
  
  .cells-container {
    gap: 2px;
  }
  
  .cells-wrapper {
    gap: 2px;
  }
  
  .crossword-row {
    gap: 4px;
  }
  
  .row-number {
    width: 20px;
    font-size: 0.8rem;
  }
  
  .crossword-title {
    font-size: 1.2rem;
  }
  
  .success-message {
    font-size: 1.4rem;
  }
  
  .success-message .secret-word {
    font-size: 2.2rem;
  }
  
  .hints-panel {
    padding: 12px 15px;
  }
  
  .hint-text {
    font-size: 0.8rem;
  }
  
  .hint-item {
    padding: 5px 0;
  }
}

@media (max-width: 450px) {
  .crossword-cell {
    width: 26px;
    height: 26px;
    font-size: 0.85rem;
  }
  
  .spacer {
    width: 26px;
    height: 26px;
  }
  
  .row-number {
    width: 18px;
    font-size: 0.7rem;
  }
  
  .crossword-grid {
    gap: 4px;
  }
  
  .success-message {
    font-size: 1.2rem;
  }
  
  .success-message .secret-word {
    font-size: 1.8rem;
  }
}

@media (max-width: 380px) {
  .crossword-cell {
    width: 22px;
    height: 22px;
    font-size: 0.75rem;
  }
  
  .spacer {
    width: 22px;
    height: 22px;
  }
  
  .row-number {
    width: 16px;
    font-size: 0.65rem;
  }
  
  .crossword-row {
    gap: 2px;
  }
  
  .cells-container {
    gap: 1px;
  }
  
  .cells-wrapper {
    gap: 1px;
  }
}

.hints-mobile {
  display: none;
}
