@font-face {
  font-family: 'BitcountGrid';
  src: url('/assets/fonts/BitcountGridSingle-VariableFont_CRSV,ELSH,ELXP,slnt,wght.ttf') format('truetype');
  font-weight: 100 900;
  font-display: swap;
}

:root {
  --orange: #ea7216;
  --dark: #0e1621;
  --light: #ddd;
}

/* === Grundlayout === */
body {
  background: var(--dark);
  color: var(--light);
  font-family: 'BitcountGrid', sans-serif;
  margin: 0;
  letter-spacing: 0.3px;
}

/* === Turnierbanner === */
.tournament-banner {
  position: relative;
  width: 100%;
  height: 340px;
  overflow: hidden;
  border-radius: 12px;
  margin-bottom: 50px;
}

.tournament-banner img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: brightness(0.85);
}

.banner-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(14,22,33,1) 5%, rgba(14,22,33,0.15) 90%);
}

/* === Info im Banner === */
.banner-info {
  position: absolute;
  bottom: 40px;
  left: 60px;
  display: flex;
  align-items: center;
  gap: 35px;
  z-index: 2;
}

.host-avatar img {
  width: 130px;
  height: 130px;
  border-radius: 50%;
  border: 3px solid var(--orange);
  object-fit: cover;
  background: var(--dark);
}

.avatar-placeholder {
  width: 130px;
  height: 130px;
  border-radius: 50%;
  border: 3px solid var(--orange);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2.4rem;
  color: var(--orange);
}

/* === Textbereich === */
.banner-text {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 8px;
}

.banner-text h1 {
  margin: 0;
  font-size: 2.6rem;
  font-weight: 700;
  color: #f1f1f1;
  text-shadow: 2px 2px 8px rgba(0, 0, 0, 0.8);
  letter-spacing: 1px;
}

.banner-text .game {
  font-size: 1.3rem;
  color: rgba(240, 240, 240, 0.85);
  font-weight: 500;
}

.banner-text .prize {
  color: var(--orange);
  font-weight: 700;
  font-size: 1.2rem;
  margin-top: 4px;
}

.banner-text .created {
  color: var(--orange);
  font-weight: 600;
  font-size: 1rem;
  margin-top: 4px;
  text-shadow: none;
}

/* === Sektionen === */
.tournament-section {
  background: rgba(255,255,255,0.05);
  padding: 25px;
  border-radius: 14px;
  margin-bottom: 30px;
  box-shadow: inset 0 0 10px rgba(255,255,255,0.05);
}

.tournament-section h2 {
  color: var(--orange);
  font-size: 1.4rem;
  margin-bottom: 10px;
}

/* === Tabellen === */
.team-table {
  width: 100%;
  border-collapse: collapse;
  border-radius: 8px;
  overflow: hidden;
}

.team-table th {
  background: rgba(234,114,22,0.15);
  padding: 10px;
  text-align: left;
  color: var(--orange);
}

.team-table td {
  background: rgba(255,255,255,0.03);
  padding: 10px;
}

.team-table tr:nth-child(even) td {
  background: rgba(255,255,255,0.05);
}

.team-link {
  color: var(--light);
  text-decoration: none;
  font-weight: 600;
}

.team-link:hover {
  color: var(--orange);
  text-shadow: 0 0 6px rgba(234, 114, 22, 0.6);
}

.no-teams {
  opacity: 0.8;
}

/* === Buttons === */
.btn {
  display: inline-block;
  text-decoration: none;
  border: none;
  cursor: pointer;
  border-radius: 8px;
  font-weight: 700;
  font-family: 'BitcountGrid', sans-serif;
  padding: 10px 16px;
  margin-top: 12px;
  transition: all 0.3s ease;
}

.btn.orange {
  background: var(--orange);
  color: var(--dark);
}
.btn.orange:hover {
  background: #ff933b;
}

.btn.red {
  background: #7f1d1d;
  color: #fff;
}
.btn.red:hover {
  background: #991b1b;
}

.btn.green {
  background: #22c55e;
  color: #0b141d;
}
.btn.green:hover {
  background: #2ed46a;
}

/* === Team-Auswahl === */
.register-row {
  display: flex;
  gap: 10px;
  align-items: center;
}

.select {
  background: #1f2937;
  color: #fff;
  border: 1px solid #374151;
  border-radius: 8px;
  padding: 8px;
}

/* === MODAL === */
#teamModal {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.75);
  justify-content: center;
  align-items: center;
  z-index: 1000;
  backdrop-filter: blur(3px);
}

/* === Modal-Inhalt === */
.modal-content {
  background: #101826;
  border-radius: 14px;
  padding: 0 0 25px 0;
  width: 90%;
  max-width: 650px;
  color: #fff;
  box-shadow: 0 0 25px rgba(0, 0, 0, 0.45);
  animation: modalIn 0.25s ease;
  overflow: hidden;
}

@keyframes modalIn {
  from { opacity: 0; transform: translateY(30px) scale(0.97); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

/* === Banner im Modal === */
.team-banner-wrap {
  position: relative;
  width: 100%;
  height: 190px;
  overflow: hidden;
}

.team-banner-modal-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: brightness(0.9);
}

.team-logo-modal-img {
  position: absolute;
  bottom: -55px; /* etwas höher, damit es klar überlappt */
  left: 50%;
  transform: translateX(-50%);
  width: 115px;
  height: 115px;
  border-radius: 50%;
  border: 3px solid var(--orange);
  background: var(--dark);
  box-shadow: 0 0 25px rgba(234, 114, 22, 0.6);
  z-index: 999; /* 🔥 wichtig! über alles andere legen */
  pointer-events: none; /* verhindert versehentliche Klicks */
}

/* Stelle sicher, dass der Banner selbst keine höhere z-Ebene hat */
.team-banner-wrap {
  position: relative;
  z-index: 1;
}


/* === Titel === */
#modalTeamName {
  text-align: center;
  margin-top: 80px;
  font-size: 1.9rem;
  color: #fff;
  text-shadow: 0 0 10px rgba(234, 114, 22, 0.5);
  font-weight: 700;
  letter-spacing: 1px;
}

.modal-divider {
  width: 80%;
  margin: 18px auto;
  border: none;
  height: 1px;
  background: rgba(255,255,255,0.15);
}

/* === Mitglieder-Tabelle === */
#modalTeamMembers {
  width: 85%;
  margin: 0 auto;
  border-collapse: collapse;
  border-radius: 8px;
  overflow: hidden;
  font-size: 0.95rem;
}

#modalTeamMembers th {
  background: rgba(234,114,22,0.15);
  color: var(--orange);
  text-align: left;
  padding: 10px;
}

#modalTeamMembers td {
  padding: 10px;
  border-bottom: 1px solid rgba(255,255,255,0.08);
}

#modalTeamMembers tr:nth-child(even) td {
  background: rgba(255,255,255,0.03);
}

/* === Modal-Button === */
#modalClose {
  display: block;
  margin: 25px auto 0 auto;
  background: var(--orange);
  color: var(--dark);
  border: none;
  padding: 10px 22px;
  border-radius: 8px;
  cursor: pointer;
  font-weight: 700;
  transition: all 0.25s ease;
}

#modalClose:hover {
  transform: scale(1.05);
  box-shadow: 0 0 14px rgba(234, 114, 22, 0.6);
}

/* === Mini-Teamkarten (bei Angemeldeten) === */
.team-mini-card {
  position: relative;
  width: 230px;
  border-radius: 10px;
  overflow: hidden;
  background: rgba(255,255,255,0.05);
  box-shadow: 0 0 10px rgba(234,114,22,0.15);
  transition: all 0.25s ease;
}

.team-mini-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 0 20px rgba(234,114,22,0.25);
}

.team-mini-banner {
  position: relative;
  width: 100%;
  height: 100px;
  overflow: hidden;
}

.team-mini-banner .mini-banner {
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: brightness(0.9);
  transition: filter 0.3s ease;
}

.team-mini-card:hover .mini-banner {
  filter: brightness(1);
}

.team-mini-banner .mini-logo {
  position: absolute;
  bottom: -15px;
  left: 10px;
  width: 55px;
  height: 55px;
  border-radius: 50%;
  border: 2px solid var(--orange);
  background: var(--dark);
  object-fit: cover;
  box-shadow: 0 0 10px rgba(234,114,22,0.3);
}

.team-mini-card a {
  display: block;
  padding: 25px 10px 10px 10px;
  text-align: center;
  color: #fff;
  text-decoration: none;
  font-weight: 600;
  text-shadow: 0 0 10px rgba(234,114,22,0.5);
}

.team-mini-card a:hover {
  color: var(--orange);
}

/* === Responsive === */
@media (max-width: 800px) {
  .tournament-banner {
    height: 260px;
  }

  .banner-info {
    flex-direction: column;
    align-items: center;
    text-align: center;
    bottom: 25px;
    left: 0;
    width: 100%;
  }

  .host-avatar img {
    width: 100px;
    height: 100px;
  }

  .banner-text h1 {
    font-size: 2rem;
  }

  .banner-text .game {
    font-size: 1.1rem;
  }
}
