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

body {
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  min-height: 100vh;
  padding: 20px;
  color: #333;
}

.container {
  max-width: 900px;
  margin: 0 auto;
  background: white;
  border-radius: 20px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
  overflow: hidden;
}

header {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  padding: 30px;
  text-align: center;
}

header h1 {
  font-size: 2.5rem;
  margin-bottom: 15px;
  text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.2);
}

.score-info {
  display: flex;
  gap: 20px;
  font-size: 1rem;
  font-weight: bold;
  color: #667eea;
  align-items: center;
}

main {
  padding: 40px;
}

.timer-section {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 15px;
  margin-bottom: 20px;
  flex-wrap: wrap;
}

.timer-label {
  font-size: 1.2rem;
  font-weight: bold;
  color: #667eea;
}

.timer {
  font-size: 3rem;
  font-weight: bold;
  color: #764ba2;
  background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

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

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

.letters-container {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
  margin-bottom: 5px;
  min-height: 80px;
}

.letter-tile {
  width: 60px;
  height: 60px;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  font-size: 2rem;
  font-weight: bold;
  border: none;
  border-radius: 10px;
  cursor: pointer;
  transition: all 0.3s ease;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.letter-tile:hover:not(.used) {
  transform: translateY(-5px);
  box-shadow: 0 8px 12px rgba(0, 0, 0, 0.2);
}

.letter-tile.used {
  background: #e0e0e0;
  color: #999;
  cursor: not-allowed;
  opacity: 0.5;
}

.word-building {
  text-align: center;
  margin-bottom: 0;
  min-height: 60px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.current-word {
  font-size: 2.5rem;
  font-weight: bold;
  color: #667eea;
  letter-spacing: 5px;
  min-height: 50px;
}

.definition-section {
  background: #f8f9fa;
  padding: 15px 25px;
  border-radius: 15px;
  margin-bottom: 10px;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 15px;
}

.definition-item {
  font-size: 1.1rem;
  line-height: 1.6;
}

.definition-item:nth-child(3) {
  grid-column: 1 / -1;
}

.definition-item strong {
  color: #764ba2;
}

.game-result {
  text-align: center;
  margin-bottom: 10px;
  font-size: 1.5rem;
  font-weight: bold;
  min-height: 40px;
}

.game-result.success {
  color: #28a745;
  animation: celebrate 0.5s ease;
}

.game-result.failure {
  color: #dc3545;
}

@keyframes celebrate {
  0%, 100% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.2);
  }
}

.actions {
  display: flex;
  justify-content: center;
  gap: 20px;
  margin-bottom: 20px;
}

.final-actions {
  text-align: center;
}

.btn {
  padding: 15px 30px;
  font-size: 1.1rem;
  font-weight: bold;
  border: none;
  border-radius: 10px;
  cursor: pointer;
  transition: all 0.3s ease;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 12px rgba(0, 0, 0, 0.2);
}

.btn-primary {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
}

.btn-secondary {
  background: #6c757d;
  color: white;
}

.btn-success {
  background: linear-gradient(135deg, #56ab2f 0%, #a8e063 100%);
  color: white;
}

.modal {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.7);
  z-index: 1000;
  align-items: center;
  justify-content: center;
}

.modal.active {
  display: flex;
}

.modal-content {
  background: white;
  padding: 40px;
  border-radius: 20px;
  max-width: 500px;
  width: 90%;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
}

.modal-content h2 {
  margin-bottom: 20px;
  color: #667eea;
  text-align: center;
}

.modal-content input {
  width: 100%;
  padding: 15px;
  font-size: 1.1rem;
  border: 2px solid #e0e0e0;
  border-radius: 10px;
  margin-bottom: 20px;
  transition: border 0.3s ease;
}

.modal-content input:focus {
  outline: none;
  border-color: #667eea;
}

.modal-actions {
  text-align: center;
}

.leaderboard {
  overflow-x: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
  margin-bottom: 20px;
}

th, td {
  padding: 15px;
  text-align: left;
  border-bottom: 1px solid #e0e0e0;
}

th {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  font-weight: bold;
}

tr:hover {
  background: #f8f9fa;
}

.loading {
  text-align: center;
  color: #999;
}

.summary-filters {
  text-align: center;
  margin-bottom: 30px;
}

.summary-filters p {
  font-size: 1.2rem;
  margin-bottom: 15px;
  color: #667eea;
  font-weight: bold;
}

.filter-buttons {
  display: flex;
  justify-content: center;
  gap: 15px;
  flex-wrap: wrap;
}

.filter-buttons .btn {
  opacity: 0.7;
}

.filter-buttons .btn.active {
  opacity: 1;
}

.summary-stats {
  background: #f8f9fa;
  padding: 20px;
  border-radius: 15px;
  margin-bottom: 30px;
  text-align: center;
}

.summary-stats p {
  font-size: 1.2rem;
  margin-bottom: 10px;
}

.words-list {
  margin-bottom: 30px;
}

.word-item {
  background: white;
  border: 2px solid #e0e0e0;
  border-radius: 10px;
  padding: 20px;
  margin-bottom: 15px;
  transition: all 0.3s ease;
}

.word-item:hover {
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

.word-item.guessed {
  border-color: #28a745;
  background: #f0fff4;
}

.word-item.not-guessed {
  border-color: #dc3545;
  background: #fff5f5;
}

.word-item h3 {
  color: #667eea;
  margin-bottom: 10px;
  font-size: 1.5rem;
}

.word-item .status {
  display: inline-block;
  padding: 5px 15px;
  border-radius: 20px;
  font-weight: bold;
  font-size: 0.9rem;
  margin-bottom: 10px;
}

.word-item .status.guessed {
  background: #28a745;
  color: white;
}

.word-item .status.not-guessed {
  background: #dc3545;
  color: white;
}

.word-item .time {
  color: #999;
  font-size: 0.9rem;
  margin-bottom: 10px;
}

.word-item .definition {
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid #e0e0e0;
}

.word-item .definition p {
  margin-bottom: 8px;
  line-height: 1.5;
}

.export-section {
  text-align: center;
}

@media (max-width: 768px) {
  header h1 {
    font-size: 2rem;
  }

  .score-info {
    flex-direction: column;
    gap: 10px;
  }

  .letter-tile {
    width: 50px;
    height: 50px;
    font-size: 1.5rem;
  }

  .current-word {
    font-size: 2rem;
  }

  .actions {
    flex-direction: column;
  }

  .btn {
    width: 100%;
  }
}
