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

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

.container {
  max-width: 1200px;
  margin: 0 auto;
  background: white;
  border-radius: 16px;
  padding: 30px;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
  position: relative;
}

.desc-btn {
  position: absolute;
  top: 12px;
  left: 12px;
  background: #059669;
  color: white;
  padding: 8px 16px;
  border-radius: 6px;
  font-size: 14px;
  font-weight: 600;
  text-decoration: none;
  transition: all 0.2s;
}

.desc-btn:hover {
  background: #047857;
  transform: translateY(-2px);
  box-shadow: 0 4px 8px rgba(5, 150, 105, 0.3);
}

.lang-switch {
  position: absolute;
  top: 12px;
  right: 12px;
  background: #2563eb;
  color: white;
  border: none;
  padding: 8px 16px;
  border-radius: 6px;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s;
  min-width: 48px;
}

.lang-switch:hover {
  background: #1d4ed8;
  transform: translateY(-2px);
  box-shadow: 0 4px 8px rgba(37, 99, 235, 0.3);
}

.discourse-back {
  position: absolute;
  top: 12px;
  right: 72px;
  width: 40px;
  height: 40px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: #059669;
  color: white;
  border-radius: 50%;
  text-decoration: none;
  transition: all 0.2s;
}

.discourse-back svg {
  width: 22px;
  height: 22px;
}

.discourse-back:hover {
  background: #047857;
  transform: translateY(-2px);
  box-shadow: 0 4px 8px rgba(5, 150, 105, 0.3);
}

h1 {
  color: #2563eb;
  text-align: center;
  margin-bottom: 20px;
  font-size: 32px;
}

h2 {
  color: #1f2937;
  font-size: 20px;
  margin-bottom: 15px;
}

.controls-section {
  text-align: center;
  margin: 30px 0;
  display: flex;
  justify-content: center;
  gap: 15px;
  flex-wrap: wrap;
  align-items: center;
}

.level-btn {
  background: #6b7280;
  color: white;
  border: none;
  padding: 10px 20px;
  border-radius: 6px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
}

.level-btn:hover {
  background: #4b5563;
  transform: translateY(-2px);
  box-shadow: 0 4px 8px rgba(107, 114, 128, 0.3);
}

.start-btn {
  background: #2563eb;
  color: white;
  border: none;
  padding: 15px 40px;
  border-radius: 8px;
  font-size: 18px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
}

.start-btn:hover {
  background: #1d4ed8;
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(37, 99, 235, 0.3);
}

.game-controls {
  text-align: center;
  margin-top: 20px;
}

.check-btn {
  background: #10b981;
  color: white;
  border: none;
  padding: 12px 30px;
  border-radius: 8px;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
}

.check-btn:hover {
  background: #059669;
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(16, 185, 129, 0.3);
}

.reference-section,
.game-section {
  margin-bottom: 30px;
}

.reference-table,
.game-table {
  display: grid;
  gap: 8px;
  padding: 20px;
  background: #f8fafc;
  border-radius: 8px;
  border: 2px solid #e2e8f0;
}

.reference-table {
  border-color: #10b981;
  background: #f0fdf4;
  overflow-x: auto;
}

.reference-table table {
  font-size: 14px;
}

.reference-table th {
  font-weight: 600;
  font-size: 14px;
}

.reference-table td {
  font-size: 13px;
}

.game-table {
  border-color: #2563eb;
  background: #eff6ff;
}

.table-cell {
  aspect-ratio: 1;
  border: 2px solid #cbd5e1;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: white;
  transition: all 0.2s;
  position: relative;
  overflow: hidden;
}

.game-cell {
  user-select: none;
  -webkit-user-select: none;
  transition: all 0.2s;
}

.game-cell:hover {
  background-color: #eff6ff !important;
  border-color: #2563eb !important;
}

.game-cell.drag-over {
  background-color: #d1fae5 !important;
  border-color: #10b981 !important;
  box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.3);
}

.game-cell.correct {
  background-color: #d1fae5 !important;
  border-color: #10b981 !important;
}

.game-cell.incorrect {
  background-color: #fee2e2 !important;
  border-color: #ef4444 !important;
}

.table-cell img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
}

.table-cell.empty {
  background: #f1f5f9;
  border-style: dashed;
  border-color: #94a3b8;
}

.table-cell.correct {
  border-color: #10b981;
  background: #d1fae5;
}

.table-cell.incorrect {
  border-color: #ef4444;
  background: #fee2e2;
}

.result-section {
  margin-top: 30px;
  text-align: center;
}

.result-message {
  padding: 20px;
  border-radius: 8px;
  margin-bottom: 20px;
  animation: slideIn 0.5s ease;
}

.result-message.success {
  background: linear-gradient(135deg, #10b981 0%, #059669 100%);
  color: white;
}

.result-message.error {
  background: #fef2f2;
  border: 2px solid #ef4444;
  color: #dc2626;
}

.result-message h2 {
  margin-bottom: 15px;
  font-size: 24px;
}

.result-message.success h2 {
  color: white;
}

.result-message p {
  font-size: 16px;
  margin: 8px 0;
}

.restart-btn {
  background: #ef4444;
  color: white;
  border: none;
  padding: 12px 30px;
  border-radius: 8px;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
}

.restart-btn:hover {
  background: #dc2626;
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(239, 68, 68, 0.3);
}

@keyframes slideIn {
  from {
    opacity: 0;
    transform: translateY(-20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.nav-section {
  display: flex;
  justify-content: center;
  margin-top: 30px;
  padding-top: 20px;
  border-top: 2px solid #e2e8f0;
}

.link-btn {
  background: #6b7280;
  color: white;
  border: none;
  padding: 15px 40px;
  border-radius: 8px;
  font-size: 18px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
  display: inline-block;
  text-decoration: none;
  text-align: center;
}

.link-btn:hover {
  background: #4b5563;
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(107, 114, 128, 0.3);
}

@media (max-width: 768px) {
  .container {
    padding: 20px;
  }
  
  h1 {
    font-size: 24px;
  }
  
  .start-btn,
  .check-btn,
  .restart-btn {
    width: 100%;
  }
  
  .link-btn {
    width: 100%;
  }
}
