:root {
  --green: #1a8f4c;
  --green-dark: #0f6a37;
  --bg: #f4f6f5;
  --text: #1a1a1a;
  --card-bg: #ffffff;
  --border: #e0e4e2;
}

* { box-sizing: border-box; }

html {
  overflow-x: hidden;
}

body {
  margin: 0;
  overflow-x: hidden;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.5;
}

.navbar {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 8px 16px;
  padding: 16px 32px;
  background: var(--green);
  color: white;
}

.navbar .logo {
  color: white;
  font-weight: 700;
  font-size: 1.2rem;
  text-decoration: none;
}

.nav-links {
  flex: 0 1 auto;
}

.nav-links a {
  display: inline-block;
  color: white;
  text-decoration: none;
  opacity: 0.9;
  margin-right: 18px;
}

.nav-links a:last-child {
  margin-right: 0;
}

.nav-links a:hover {
  opacity: 1;
  text-decoration: underline;
}

.container {
  max-width: 900px;
  margin: 0 auto;
  padding: 32px 20px;
}

.hero {
  text-align: center;
  padding: 48px 20px;
}

.hero h1 {
  font-size: 2rem;
  margin-bottom: 8px;
}

.hero p {
  color: #555;
}

@media (max-width: 600px) {
  .navbar {
    padding: 14px 20px;
  }

  .container {
    padding: 24px 16px;
  }

  .hero {
    padding: 32px 12px;
  }

  .hero h1 {
    font-size: 1.5rem;
  }

  .nav-links {
    flex-basis: 100%;
  }

  .nav-links a {
    margin-right: 14px;
    font-size: 0.92rem;
  }
}

.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 16px;
  margin-top: 24px;
}

.card {
  display: block;
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 20px;
  text-align: center;
  text-decoration: none;
  color: inherit;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.card:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

.card-logo {
  height: 64px;
  width: auto;
  max-width: 90px;
  object-fit: contain;
  margin-bottom: 12px;
}

.card-title {
  font-weight: 600;
}

.page-intro {
  color: #555;
  margin-top: -8px;
  line-height: 1.6;
}

.back-link {
  display: inline-block;
  color: var(--green);
  text-decoration: none;
  margin-bottom: 16px;
  font-weight: 500;
}

.back-link:hover {
  text-decoration: underline;
}

.team-detail {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 40px;
  text-align: center;
}

.team-detail-logo {
  height: 120px;
  width: auto;
  max-width: 170px;
  object-fit: contain;
  margin-bottom: 16px;
}

.team-detail h1 {
  margin-bottom: 20px;
}

.team-history {
  text-align: left;
  max-width: 640px;
  margin: 0 auto;
  color: #333;
}

.section-title {
  margin-top: 40px;
  margin-bottom: 16px;
  font-size: 1.3rem;
}

.player-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 20px;
}

.player-card {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: 12px;
  overflow: hidden;
  text-align: center;
}

.player-photo {
  width: 100%;
  aspect-ratio: 4 / 5;
  object-fit: cover;
  object-position: center 15%;
  display: block;
  background: #eee;
}

.player-name {
  padding: 10px;
  font-weight: 600;
  font-size: 0.95rem;
}

.stadium-figure {
  margin: 0;
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: 16px;
  overflow: hidden;
}

.stadium-photo {
  width: 100%;
  max-height: 400px;
  object-fit: cover;
  display: block;
}

.stadium-figure figcaption {
  padding: 14px 20px;
  font-weight: 600;
  color: #333;
}

.footer {
  text-align: center;
  padding: 24px;
  color: #888;
  font-size: 0.9rem;
}

.tournament-card {
  cursor: default;
  padding: 28px 20px;
}

.tournament-card .card-logo {
  height: 110px;
  max-width: 130px;
}

.tournament-placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 64px;
  font-size: 2.2rem;
  margin: 0 auto 12px;
}

.tournament-note {
  margin-top: 6px;
  font-size: 0.85rem;
  color: #777;
}

.stat-card {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 24px;
}

.stat-card-name {
  margin: 0 0 16px;
  color: var(--green-dark);
}

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

.stat-table tr:not(:last-child) td {
  border-bottom: 1px solid var(--border);
}

.stat-table td {
  padding: 8px 0;
}

.stat-table td:last-child {
  text-align: right;
  font-weight: 700;
}

.trophy-heading {
  margin: 0 0 8px;
  font-size: 1rem;
  color: #555;
}

.no-trophies {
  color: #999;
  font-size: 0.9rem;
  margin: 0;
}

.trophy-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.trophy-list li {
  padding: 8px 0;
  border-bottom: 1px solid var(--border);
  font-size: 0.9rem;
}

.trophy-list li:last-child {
  border-bottom: none;
}

.trophy-date {
  display: block;
  color: #999;
  font-size: 0.8rem;
  margin-top: 2px;
}

.stats-header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px;
}

.switch-link {
  color: #888;
  font-size: 0.85rem;
  text-decoration: none;
}

.switch-link:hover {
  text-decoration: underline;
}

.my-stats-layout {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
}

@media (max-width: 640px) {
  .my-stats-layout {
    grid-template-columns: 1fr;
  }
}

.favorite-club {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 20px;
}

.favorite-club-logo {
  height: 48px;
  width: 48px;
  object-fit: contain;
}

.placeholder-badge {
  display: flex;
  align-items: center;
  justify-content: center;
  background: #eee;
  border-radius: 50%;
  color: #aaa;
  font-weight: 700;
  font-size: 1.3rem;
}

.club-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.club-list li {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 0;
  border-bottom: 1px solid var(--border);
}

.club-list li:last-child {
  border-bottom: none;
}

.club-list-logo {
  height: 28px;
  width: 28px;
  object-fit: contain;
}

.club-list-name {
  flex: 1;
  font-weight: 500;
}

.club-list-count {
  color: #888;
  font-size: 0.85rem;
}

.whoami-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 16px;
}

.whoami-avatar {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 64px;
  width: 64px;
  margin: 0 auto 12px;
  border-radius: 50%;
  background: var(--green);
  color: white;
  font-size: 1.6rem;
  font-weight: 700;
}

.tournament-header {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 24px;
}

.tournament-header-logo {
  height: 56px;
  width: 56px;
  object-fit: contain;
}

.tournament-description {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 20px 24px;
  margin-bottom: 28px;
  color: #333;
  white-space: pre-line;
  line-height: 1.6;
}

.edition-card {
  cursor: default;
  padding: 28px 20px;
}

.edition-icon {
  font-size: 2.2rem;
  margin-bottom: 10px;
}

.edition-locked {
  opacity: 0.6;
}

.edition-lock {
  margin-top: 10px;
  font-size: 0.85rem;
  color: #888;
}

.edition-note {
  margin-top: 10px;
  font-size: 0.85rem;
  color: #888;
}

.nav-cards {
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
}

.nav-card {
  padding: 24px 16px;
}

.nav-card-icon {
  font-size: 2.2rem;
  margin-bottom: 10px;
}

.nav-card-desc {
  margin-top: 6px;
  font-size: 0.85rem;
  color: #777;
}

.favorite-mini-card {
  cursor: default;
}

.hero-banner-card {
  padding: 0;
  overflow: hidden;
  cursor: default;
}

.favorites-grid {
  grid-template-columns: repeat(3, 1fr) 1.6fr;
}

@media (max-width: 720px) {
  .favorites-grid {
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  }
}

.hero-banner-card img {
  width: 100%;
  height: 100%;
  min-height: 140px;
  object-fit: cover;
  display: block;
}

.groups-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 20px;
}

.group-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
}

.group-table th {
  text-align: left;
  font-size: 0.78rem;
  color: #999;
  font-weight: 600;
  padding-bottom: 6px;
  border-bottom: 1px solid var(--border);
}

.group-table th:not(:first-child),
.group-table td:not(:first-child) {
  text-align: center;
  width: 26px;
}

.group-table td {
  padding: 7px 0;
  border-bottom: 1px solid var(--border);
}

.group-table tr:last-child td {
  border-bottom: none;
}

.group-table a {
  color: inherit;
  text-decoration: none;
}

.group-table a:hover {
  text-decoration: underline;
}

.group-row-human td:first-child {
  font-weight: 700;
}

.group-player-tag {
  display: inline-block;
  margin-left: 6px;
  background: var(--green);
  color: white;
  border-radius: 6px;
  padding: 1px 7px;
  font-size: 0.72rem;
  font-weight: 600;
  vertical-align: middle;
}

.commentary-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.commentary-item {
  display: flex;
  gap: 14px;
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-left: 4px solid var(--green);
  border-radius: 8px;
  padding: 14px 18px;
}

.commentary-avatar {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
}

.commentary-speaker {
  font-weight: 700;
  color: var(--green-dark);
  margin-bottom: 4px;
  font-size: 0.9rem;
}

.commentary-text {
  color: #333;
  line-height: 1.6;
}
