/* Typography */
body {
  font-family: 'Inter', system-ui, sans-serif;
  font-weight: 400;
  line-height: 1.6;
  background: linear-gradient(to bottom, #f3f7fb, #e8f0fe);
  margin: 0;
  padding: 20px;
  color: #333;
}

h1, h2 {
  font-weight: 600;
  margin: 0 0 8px;
}

h1 {
  font-size: 2.5rem;
  color: #1e40af;
}

h2 {
  font-size: 1.75rem;
  color: #1e293b;
  margin-bottom: 16px;
}

.subtitle, .hint {
  color: #64748b;
  font-size: 1rem;
  margin: 0;
}

.hint {
  font-style: italic;
  text-align: center;
  margin-top: 16px;
  padding-top: 12px;
  border-top: 1px solid #e2e8f0;
}

/* Layout */
.container {
  max-width: 900px;
  margin: 0 auto;
}

.header {
  text-align: center;
  margin-bottom: 24px;
  padding-bottom: 16px;
  border-bottom: 1px solid #e2e8f0;
}

.footer {
  text-align: center;
  margin-top: 32px;
  padding-top: 16px;
  border-top: 1px solid #e2e8f0;
  color: #64748b;
}

.card {
  background: #fff;
  padding: 24px;
  margin: 16px 0;
  border-radius: 12px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
  transition: box-shadow 0.2s ease;
}

.card:hover {
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.1);
}

.hidden {
  display: none;
}

.row {
  display: flex;
  gap: 12px;
  margin-top: 16px;
  align-items: center;
  justify-content: center;
}

.form-group {
  margin-bottom: 20px;
}

.label {
  display: block;
  font-weight: 500;
  margin-bottom: 6px;
  color: #374151;
  font-size: 0.95rem;
}

/* Game-Specific Layout */
.game-header {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 16px;
  margin-bottom: 24px;
  padding: 16px;
  background: #f8fafc;
  border-radius: 8px;
  border: 1px solid #e2e8f0;
}

.info-item {
  font-size: 0.95rem;
  color: #64748b;
}

.value {
  font-weight: 600;
  color: #1e40af;
}

.scramble-area {
  text-align: center;
  margin: 24px 0;
}

.scrambled {
  font-family: 'Space Mono', monospace;
  font-size: 3rem;
  font-weight: 700;
  background: linear-gradient(135deg, #111, #333);
  color: #fff;
  padding: 24px 32px;
  border-radius: 12px;
  letter-spacing: 2px;
  text-transform: uppercase;
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.2);
  transition: transform 0.2s ease;
}

.scrambled:hover {
  transform: scale(1.02);
}

.input-row {
  display: flex;
  gap: 12px;
  align-items: center;
  justify-content: center;
  margin: 24px 0;
}

.input-large {
  flex: 1;
  max-width: 300px;
}

/* Components */
.input, .select {
  width: 100%;
  padding: 12px 16px;
  border: 1px solid #d1d5db;
  border-radius: 8px;
  font-size: 1rem;
  font-family: inherit;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
  background: #fff;
}

.select {
  cursor: pointer;
  background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 20 20'%3e%3cpath stroke='%236b7280' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.5' d='m6 8 4 4 4-4'/%3e%3c/svg%3e");
  background-position: right 12px center;
  background-repeat: no-repeat;
  background-size: 16px;
  padding-right: 40px;
  appearance: none;
}

.input:focus, .select:focus {
  outline: none;
  border-color: #2563eb;
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.input::placeholder {
  color: #9ca3af;
}

.btn {
  padding: 12px 20px;
  border: none;
  border-radius: 8px;
  font-size: 1rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
  font-family: inherit;
  text-decoration: none;
  display: inline-block;
}

.btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.btn-primary {
  background: linear-gradient(135deg, #2563eb, #1d4ed8);
  color: #fff;
}

.btn-primary:hover:not(:disabled) {
  background: linear-gradient(135deg, #1d4ed8, #1e40af);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(37, 99, 235, 0.3);
}

.btn-secondary {
  background: linear-gradient(135deg, #6b7280, #4b5563);
  color: #fff;
}

.btn-secondary:hover:not(:disabled) {
  background: linear-gradient(135deg, #4b5563, #374151);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(107, 114, 128, 0.3);
}

.btn-outline {
  background: transparent;
  color: #2563eb;
  border: 1px solid #2563eb;
}

.btn-outline:hover {
  background: #2563eb;
  color: #fff;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(37, 99, 235, 0.3);
}

.button-group {
  justify-content: center;
}

.section-title {
  text-align: center;
  margin-bottom: 20px;
}

.leader-list {
  list-style-position: inside;
  padding-left: 20px;
  max-height: 300px;
  overflow-y: auto;
}

.leader-list li {
  padding: 8px 0;
  border-bottom: 1px solid #f1f5f9;
}

/* Responsive Design */
@media (max-width: 768px) {
  body {
    padding: 16px;
  }

  .row, .input-row {
    flex-direction: column;
    align-items: stretch;
  }

  .game-header {
    grid-template-columns: 1fr;
    gap: 12px;
  }

  .scrambled {
    font-size: 2rem;
    padding: 20px 24px;
  }

  h1 {
    font-size: 2rem;
  }
}

@keyframes shake {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-5px); }
  75% { transform: translateX(5px); }
}