/* Reunion Word Game Styles */

:root {
  --primary-color: #5b8c5a;
  --secondary-color: #8fbc8f;
  --accent-color: #98d8c8;
  --background: #e8f5e9;
  --card-bg: #ffffff;
  --text-primary: #2d3748;
  --text-secondary: #718096;
  --border-color: #cbd5e0;

  /* Tile colors matching original */
  --tile-yellow: #f4d03f;
  --tile-beige: #e8dcc4;
  --tile-green: #9acd32;
  --tile-gray: #d4d4c4;
  --tile-shadow: rgba(0, 0, 0, 0.1);

  --success-color: #9acd32;
  --warning-color: #f4d03f;
  --selected-bg: #fff8dc;
  --selected-border: #f4d03f;
}

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

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  background: linear-gradient(to bottom, #e3f2fd 0%, #c8e6c9 50%, #a5d6a7 100%);
  background-attachment: fixed;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  color: var(--text-primary);
  position: relative;
}

/* Nature background overlay */
body::before {
  content: '';
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-image:
    url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100"><circle cx="50" cy="80" r="2" fill="%23ffffff" opacity="0.3"/></svg>');
  background-size: 50px 50px;
  opacity: 0.3;
  pointer-events: none;
  z-index: 0;
}

.game-wrapper {
  position: relative;
  z-index: 1;
  max-width: 1400px;
  margin: 0 auto;
  padding: 20px;
  width: 100%;
}

/* Header */
.game-header {
  text-align: center;
  margin-bottom: 30px;
  background: var(--card-bg);
  padding: 20px;
  border-radius: 16px;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.header-content {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 15px;
  margin-bottom: 10px;
}

.game-title {
  font-size: 2.5rem;
  font-weight: 800;
  color: var(--primary-color);
  text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.1);
}

.game-subtitle {
  color: var(--text-secondary);
  font-size: 1.1rem;
  margin-bottom: 15px;
}

/* Game Container */
.game-container {
  display: grid;
  grid-template-columns: 1fr;
  gap: 30px;
  margin-bottom: 30px;
  justify-content: center;
}

@media (min-width: 900px) {
  .game-container {
    /* Ajustado para centrar si no hay panel derecho */
    grid-template-columns: minmax(auto, 600px); 
    justify-content: center;
  }
}

/* Game Board */
.game-board {
  background: var(--card-bg);
  padding: 30px;
  border-radius: 16px;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

/* Moves Counter */
.moves-counter {
  text-align: center;
  margin-bottom: 20px;
  position: relative;
}

.moves-display {
  display: inline-block;
  text-align: center;
}

.moves-value {
  font-size: 3rem;
  font-weight: 900;
  color: var(--primary-color);
  line-height: 1;
  margin-bottom: 5px;
}

.moves-label {
  font-size: 1rem;
  font-weight: 700;
  color: var(--primary-color);
  letter-spacing: 2px;
}

.puzzle-info {
  text-align: center;
  margin-bottom: 20px;
  padding-bottom: 15px;
  border-bottom: 1px solid var(--border-color);
}

#puzzle-date {
  font-size: 0.95rem;
  color: var(--text-secondary);
  margin-bottom: 10px;
}

.seed-word-display {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  margin: 10px 0;
}

.seed-label {
  font-size: 0.9rem;
  color: var(--text-secondary);
  font-weight: 600;
}

#seed-word {
  font-size: 1.5rem;
  font-weight: 800;
  color: var(--primary-color);
  letter-spacing: 2px;
}

.puzzle-meta {
  display: flex;
  justify-content: center;
  gap: 20px;
  margin-top: 15px;
  font-size: 0.9rem;
  color: var(--text-secondary);
}

/* Letter Grid */
.letter-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 8px;
  margin: 25px 0;
  max-width: 450px;
  margin-left: auto;
  margin-right: auto;
  padding: 20px;
  background: rgba(255, 255, 255, 0.9);
  border-radius: 20px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
}

.letter-cell {
  aspect-ratio: 1;
  background: var(--tile-beige);
  border: none;
  border-radius: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.8rem;
  font-weight: 900;
  cursor: grab;
  transition: all 0.2s ease;
  user-select: none;
  box-shadow: 0 2px 4px var(--tile-shadow), inset 0 -2px 4px rgba(0, 0, 0, 0.1);
  color: #2d3748;
  text-transform: uppercase;
  position: relative;
}

.letter-cell[draggable="true"]:active {
  cursor: grabbing;
}

.letter-cell.dragging {
  opacity: 0.5;
  transform: scale(0.9);
  cursor: grabbing;
}

.letter-cell.drag-over {
  background: #fff8dc;
  transform: scale(1.05);
  box-shadow: 0 0 0 3px var(--tile-yellow), 0 6px 12px rgba(244, 208, 63, 0.4);
}

/* Color variations */
.letter-cell.color-yellow { background: var(--tile-yellow); }
.letter-cell.color-green { background: var(--tile-green); }
.letter-cell.color-beige { background: var(--tile-beige); }

.letter-cell:not(.empty):hover {
  transform: translateY(-4px) scale(1.05);
  box-shadow: 0 6px 12px var(--tile-shadow), inset 0 -2px 4px rgba(0, 0, 0, 0.1);
}

.letter-cell.empty {
  background: var(--tile-gray);
  opacity: 0.5;
  cursor: default;
  box-shadow: none;
}

.letter-cell.animal-cell {
  background: white;
  opacity: 1;
  font-size: 2.5rem;
  box-shadow: 0 2px 4px var(--tile-shadow), inset 0 -2px 4px rgba(0, 0, 0, 0.05);
  border: 2px solid rgba(0, 0, 0, 0.05);
  cursor: pointer;
  position: relative;
}

.letter-cell.animal-cell:hover {
  transform: translateY(-4px) scale(1.05);
  box-shadow: 0 6px 12px var(--tile-shadow), inset 0 -2px 4px rgba(0, 0, 0, 0.05);
}

.letter-cell.selected {
  background: #fff8dc;
  transform: translateY(-4px) scale(1.08);
  box-shadow: 0 8px 16px rgba(244, 208, 63, 0.4), 0 0 0 3px var(--tile-yellow);
  animation: pulse 0.6s ease-in-out infinite;
}

@keyframes pulse {
  0%, 100% { transform: translateY(-4px) scale(1.08); }
  50% { transform: translateY(-4px) scale(1.1); }
}

.letter-cell.correct {
  background: var(--tile-green);
  animation: correctTile 0.5s ease;
  cursor: not-allowed !important;
  opacity: 0.9;
  position: relative;
}

.letter-cell.correct::after {
  content: '🔒';
  position: absolute;
  bottom: 2px;
  right: 2px;
  font-size: 0.6rem;
  opacity: 0.6;
}

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

/* Controls */
.controls {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  justify-content: center;
  margin-top: 20px;
}

.btn {
  padding: 12px 24px;
  border: none;
  border-radius: 8px;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

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

.btn-primary:hover {
  background: var(--accent-color);
  transform: translateY(-2px);
  box-shadow: 0 4px 8px rgba(147, 51, 234, 0.3);
}

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

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

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

.btn-warning:hover {
  background: #d97706;
  transform: translateY(-2px);
}

#answer-words {
  display: none;
  margin-top: 20px;
  padding: 15px;
  background: #e8f5e9;
  border-radius: 10px;
  border-left: 4px solid var(--success-color);
  color: var(--text-primary);
  font-weight: 600;
  text-align: center;
}

/* Responsive */
@media (max-width: 768px) {
  .game-title { font-size: 2rem; }
  .letter-grid { gap: 6px; }
  .letter-cell { font-size: 1.2rem; }
  .game-board { padding: 20px; }
  .controls { flex-direction: column; }
  .btn { width: 100%; }
}

@media (max-width: 480px) {
  .game-wrapper { padding: 10px; }
  .game-title { font-size: 1.5rem; }
  .letter-grid { gap: 4px; }
  .letter-cell { font-size: 1rem; border-width: 2px; border-radius: 8px; }
}

/* --- NUEVOS ESTILOS PARA DAILY Y MODAL --- */

/* 1. Estilo para el número del Daily */
.daily-badge {
    text-align: center;
    font-size: 0.9rem;
    font-weight: 700;
    color: var(--primary-color);
    background-color: rgba(91, 140, 90, 0.1); /* Verde muy suave */
    padding: 4px 12px;
    border-radius: 20px;
    display: inline-block;
    margin-bottom: 8px;
    letter-spacing: 1px;
    text-transform: uppercase;
}

/* 2. Estilos para el Modal Bonito */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(5px);
    z-index: 1000;
    display: flex;
    justify-content: center;
    align-items: center;
    animation: fadeIn 0.3s ease;
}

.modal-content {
    background: white;
    padding: 30px;
    border-radius: 24px;
    width: 90%;
    max-width: 400px;
    text-align: center;
    box-shadow: 0 20px 50px rgba(0,0,0,0.2);
    position: relative;
    transform: translateY(0);
    animation: slideUp 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.close-modal {
    position: absolute;
    top: 15px;
    right: 20px;
    font-size: 28px;
    background: none;
    border: none;
    color: #aaa;
    cursor: pointer;
    transition: color 0.2s;
}

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

.modal-icon {
    font-size: 4rem;
    margin-bottom: 10px;
    display: block;
}

.modal-header h2 {
    color: var(--primary-color);
    font-size: 1.8rem;
    margin-bottom: 20px;
}

.modal-stats {
    display: flex;
    justify-content: center;
    gap: 15px;
    margin-bottom: 25px;
}

.stat-box {
    background: var(--background);
    padding: 15px;
    border-radius: 12px;
    min-width: 100px;
    border: 2px solid rgba(0,0,0,0.05);
}

.stat-label {
    display: block;
    font-size: 0.8rem;
    text-transform: uppercase;
    color: var(--text-secondary);
    margin-bottom: 5px;
}

.stat-number {
    display: block;
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--primary-color);
}

.modal-message {
    color: var(--text-secondary);
    margin-bottom: 25px;
    font-size: 1.1rem;
}

.modal-actions {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.share-btn { width: 100%; justify-content: center; }

@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes slideUp { 
    from { opacity: 0; transform: translateY(50px); } 
    to { opacity: 1; transform: translateY(0); } 
}