:root {
  --tournament-color: #0b2d69;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: #f5f7fb;
  font-family: Inter, sans-serif;
  color: #1f2937;
}

.app {
  max-width: 1200px;
  margin: 0 auto;
  padding: 24px;
}

/* Header */

.hero {
  background: var(--tournament-color);
  color: white;
  padding: 28px;
  border-radius: 16px;
  display: flex;
  gap: 18px;
  align-items: center;
  box-shadow:
    0 10px 30px rgba(0,0,0,.15);
}

.hero__icon {
  font-size: 48px;
}

.hero h1 {
  margin: 0;
  font-size: 32px;
}

.hero h2 {
  margin: 8px 0 0;
  font-weight: 400;
  opacity: .9;
}

/* Controls */

.toolbar {
  margin-top: 24px;
  display: flex;
  gap: 20px;
  align-items: flex-end;
}

.field-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-width: 250px;
}

.field-group label {
  font-weight: 600;
}

.action-group {
  margin-left: auto;
}

select {
  min-width: 250px;
  padding: 12px;
  border-radius: 10px;
  border: 1px solid #d1d5db;
  background: white;
  font-size: 15px;
}

#generateBtn {
  background: var(--tournament-color);
  color: white;
  border: 0;
  border-radius: 10px;
  padding: 14px 32px;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  min-width: 260px;
  height: 49px;
}

#generateBtn:disabled {
  opacity: .5;
  cursor: not-allowed;
}

#results {
  margin-top: 30px;
}

/* Empty State */

.empty-state {
  background: white;
  border-radius: 16px;
  padding: 60px 30px;
  text-align: center;
  box-shadow:
    0 2px 12px rgba(0,0,0,.08);
}

.empty-state__icon {
  font-size: 64px;
}

.empty-state h3 {
  margin-top: 20px;
  font-size: 24px;
}

.empty-state p {
  color: #6b7280;
}

/* Team Card */

.team-card {
  background: white;
  border-radius: 16px;
  padding: 24px;
  margin-bottom: 24px;
  box-shadow:
    0 2px 12px rgba(0,0,0,.08);
}

.team-card h2 {
  margin: 0;
}

.team-card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.team-country {
  font-size: 18px;
  font-weight: 600;
  color: #666;
}

.division-badge {
  display: inline-block;
  margin-top: 10px;
  padding: 6px 12px;
  border-radius: 999px;
  background: rgba(0,0,0,.06);
  color: var(--tournament-color);
  font-size: 13px;
  font-weight: 600;
}

/* Stats */

.stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
  margin: 24px 0;
}

.stat-card {
  background: white;
  border-radius: 14px;
  padding: 24px;
  text-align: center;
  box-shadow:
    0 2px 12px rgba(0,0,0,.08);
}

.stat-value {
  font-size: 40px;
  font-weight: 700;
}

.stat-label {
  color: #6b7280;
  margin-top: 6px;
}

/* Tables */

table {
  width: 100%;
  border-collapse: collapse;
  background: white;
  box-shadow:
    0 2px 12px rgba(0,0,0,.08);
  margin-bottom: 30px;
}

th {
  background: var(--tournament-color);
  color: white;
  padding: 14px;
  text-align: left;
}

td {
  padding: 14px;
  border-bottom: 1px solid #eee;
}

tr:last-child td {
  border-bottom: 0;
}

h3 {
  margin-top: 32px;
  margin-bottom: 12px;
}

/* Footer */

.footer-bar {
  margin-top: 40px;
  padding: 16px 20px;
  background: white;
  border-radius: 12px;

  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 20px;

  box-shadow:
    0 2px 12px rgba(0,0,0,.08);
}

.footer-text {
  font-size: 14px;
  color: #666;
}

.footer-text a {
  color: var(--tournament-color);
  font-weight: 600;
  text-decoration: none;
}

.footer-btn {
  display: inline-flex;
  align-items: center;
  padding: 10px 16px;
  border-radius: 8px;
  background: var(--tournament-color);
  color: white;
  text-decoration: none;
  font-size: 14px;
  font-weight: 600;
  white-space: nowrap;
}

.footer-btn:hover {
  opacity: .9;
}

/* Loading Spinner */

.spinner {
  width: 48px;
  height: 48px;
  margin: 0 auto 20px;
  border: 4px solid #e5e7eb;
  border-top-color: var(--tournament-color);
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

/* Mobile */

@media (max-width: 768px) {

  .hero {
    padding: 20px;
  }

  .hero__icon {
    font-size: 40px;
  }

  .hero h1 {
    font-size: 24px;
  }

  .hero h2 {
    font-size: 16px;
  }

  .toolbar {
    flex-direction: column;
    align-items: stretch;
    gap: 16px;
  }

  .field-group {
    width: 100%;
    min-width: 0;
  }

  .action-group {
    margin-left: 0;
  }

  select {
    width: 100%;
    min-width: 0;
  }

  #generateBtn {
    width: 100%;
    min-width: 0;
  }

  .stats {
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
  }

  .stat-card {
    padding: 16px 8px;
  }

  .stat-value {
    font-size: 28px;
  }

  .stat-label {
    font-size: 12px;
  }

  .footer-bar {
    flex-direction: column;
    text-align: center;
  }

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

  table {
    display: block;
    overflow-x: auto;
    white-space: nowrap;
  }
}
