body {
  padding-top: 60px; /* adjust to header height */
}

.page-title {
  font-size: clamp(1.2em, 4vw, 1.5em);
  font-weight: bold;
  font-style: italic;
  color: white;
  text-align: left;
  margin-left: 8px;
  width: fit-content;
  position: relative;
  white-space: nowrap;
}

.site-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.05rem 1rem;
  background: #0a071c;
  flex-wrap: wrap;
  gap: 0.5rem;

  position: fixed;
  top: 0;
  left: 0;
  right: 0; /* respect the scrollbar */
  box-sizing: border-box; /* ensure padding stays inside */
  z-index: 2000;
}

.header-left {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.header-left a {
  text-decoration: none;
}

.tournament-title {
  font-size: clamp(2em, 5vw, 4em);
  font-weight: bold;
  font-style: italic;
  text-transform: uppercase;
  color: white;
  text-align: center;
  letter-spacing: 3px;
  margin-top: 60px;
  margin-left: auto;
  margin-right: auto;
  width: fit-content;
  position: relative;
}

.tournament-info {
  color: #ddd;
  padding: 15px;
  margin: 20px auto;
  width: 90%;
  max-width: 500px;
  text-align: center;
  font-size: 1.2em;
  line-height: 1.6;
  font-family: "Poppins", sans-serif;
  letter-spacing: 0.5px;
  display: none;
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  z-index: 1000;
  background-color: #8918e4;
  border-radius: 4px;
  box-sizing: border-box;
}

.special-note:hover ~ .tournament-info {
  display: flex;
  animation: fadeIn 0.1s ease-in-out;
}

@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

.tournament-details {
  background: linear-gradient(#c00093, #8918e4);
  color: white;
  padding: 24px 15px;
  border-radius: 4px;
  margin: 16px auto;
  width: 90%;
  max-width: 500px;
  text-align: center;
  font-size: 1.2em;
  line-height: 1.6;
  font-family: "Poppins", sans-serif;
  letter-spacing: 0.5px;
  position: relative;
  box-sizing: border-box;
}

.tournament-details strong {
  color: white;
  font-weight: bold;
}

#matchesContainer {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 55px;
}

#tournamentEntrants {
  display: flex;
  flex-direction: column;
  width: 100%;
  max-width: 530px;
  box-sizing: border-box;
}

.match {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.match-players {
  display: flex;
  flex-direction: row;
  gap: 24px;
  align-items: stretch;
  justify-content: center;
  position: relative;
  background: linear-gradient(#3a3a3a, #272727);
  border-radius: 8px;
  padding: 24px;
  text-align: center;
  box-sizing: border-box;
  width: min(80vw, 1000px);
  margin-inline: auto;
}

.vs-divider {
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
}

.vs-divider img {
  width: 20px;
  object-fit: contain;
  display: block;
  position: relative;
  z-index: 1;
}

.placeholder-match .vs-divider img {
  opacity: 0.6;
}

.vs-divider::before {
  content: "";
  position: absolute;
  top: 0;
  bottom: 0;
  left: 50%;
  width: 1px;
  transform: translateX(-50%);
  background: rgb(26, 26, 26);
  z-index: 0;
}

.vs-divider::after {
  content: "";
  position: absolute;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: rgb(26, 26, 26);
  z-index: 0;
}

.players-container {
  display: flex;
  justify-content: space-around;
  align-items: center;
  gap: 15px;
  flex-wrap: wrap;
}

.player-section {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  flex: 1 1 0;
  min-width: 0;
  width: 100%;
  box-sizing: border-box;
}

.player-section iframe {
  width: 100%;
  height: auto;
  aspect-ratio: 16/9;
  box-sizing: border-box;
  border: none;
}

.vote-info {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  margin-top: 0.25rem;
  font-weight: bold;
  font-size: 1.1em;
}

.vote-result {
  font-weight: bold;
  font-size: 1.1em;
  color: white;
  border-radius: 8px;
  font-family: "Poppins", sans-serif;
  letter-spacing: 0.5px;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.vote-button {
  display: flex;
  justify-content: center;
  align-items: center;
  background: linear-gradient(#c00093, #8918e4);
  color: white;
  width: 80px;
  height: 80px;
  font-weight: bold;
  border-radius: 50%;
  border: none;
  font-size: 1.2em;
  transition: transform 0.2s, background-color 0.3s;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.3);
}

.vote-button--signin {
  width: 80px;
  height: 80px;
  font-size: 0.9em;
  padding: 0 6px;
}

.vote-button:hover {
  box-shadow: 0 6px 12px rgba(0, 0, 0, 0.4);
  transform: translateY(-3px) scale(1.05);
}

.vote-button:active {
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.5);
  transform: translateY(1px);
}

.vote-number {
  font-size: 2em;
  font-weight: bold;
  margin-bottom: 6px;
}

.vote-text {
  font-size: 0.6em;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.vs-circle {
  display: flex;
  justify-content: center;
  align-items: center;
  width: 80px;
  height: 80px;
  background-color: black;
  color: white;
  font-family: "Brush Script MT", cursive;
  font-size: 48px;
  font-weight: bold;
  border-radius: 50%;
  text-transform: uppercase;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.3);
  user-select: none;
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  z-index: 2;
}

.voted-for {
  display: inline-flex;
  justify-content: center;
  align-items: center;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: linear-gradient(#c00093, #8918e4);
  position: relative;
  margin-left: 8px;
}

.voted-for::before {
  content: "✔";
  color: white;
  font-size: 12px;
  font-weight: bold;
  line-height: 1;
}

iframe {
  border-radius: 4px;
}

.fancy-button {
  color: white;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.3);
  padding: 10px;
  border-radius: 4px;
  border: none;
  background-color: #8918e4;
}

#authSection {
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: flex-end;
  gap: 12px;
  margin: 0;
}

.custom-checkbox {
  display: flex;
  align-items: center;
  gap: 8px;
  font-family: "Poppins", sans-serif;
  cursor: pointer;
  font-size: 12px;
}

.custom-checkbox input {
  display: none;
}

.checkmark {
  width: 18px;
  height: 18px;
  border: 1px solid #555;
  border-radius: 4px;
  display: inline-block;
  position: relative;
  background: #eee;
}

.custom-checkbox input:checked + .checkmark::before {
  content: "✔";
  font-size: 12px;
  color: white;
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
}

.custom-checkbox input:checked + .checkmark {
  background: linear-gradient(#c00093, #8918e4);
  border: none;
}

.version-info {
  font-size: 8px;
  line-height: 10px;
  color: rgb(134, 134, 134);
  display: inline-flex;
}

.loading-spinner {
  border: 4px solid rgba(0, 0, 0, 0.1);
  border-left-color: #8918e4;
  border-radius: 50%;
  width: 20px;
  height: 20px;
  animation: spin 1s linear infinite;
  margin: 0 auto;
}

.expiration-date,
.other-entrants {
  font-size: 2em;
  font-weight: bold;
  font-style: italic;
  text-transform: uppercase;
  color: white;
  text-align: center;
  letter-spacing: 3px;
}

.other-entrants {
  margin-top: 63px;
  margin-bottom: 24px;
}

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

.links {
  margin-left: auto;
  font-size: 14px;
  font-weight: bold;
  display: flex;
  gap: 1rem;
}

.links a {
  text-decoration: none;
}

.menu-toggle {
  display: none;
  font-size: 1.5rem;
  background: none;
  border: none;
  cursor: pointer;
}

.nav-menu {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  /* margin-left: auto; */
}

.header-spacer {
  flex: 1;
}

/* --- Mobile styles --- */
@media (max-width: 768px) {
  .nav-menu {
    display: none;
    flex-direction: column;
    align-items: center;
    width: 100%;
    margin-left: 0;
    gap: 1rem;
  }

  .nav-menu.is-open {
    display: flex;
  }

  .menu-toggle {
    display: block;
  }

  .links {
    flex-direction: column;
    align-items: center;
    gap: 0.75rem;
    width: 100%;
  }

  .links a {
    display: block;
    width: auto;
    padding: 0.5rem 0;
    text-align: center;
  }

  #authSection {
    flex-direction: column;
    align-items: center;
    width: 100%;
    gap: 0.75rem;
    margin-bottom: 16px;
  }

  .tournament-info,
  .tournament-details {
    width: calc(100% - 24px); /* full width minus left+right margins */
    max-width: none;
    margin: 0 auto; /* center horizontally */
    box-sizing: border-box;
  }

  #matchesContainer {
    align-items: stretch; /* allow children to fill */
    width: 100%;
    padding-inline: 12px; /* gutters */
    box-sizing: border-box;
    gap: 8px;
  }

  .match {
    width: 100%;
  }

  #tournamentEntrants,
  .match-players {
    width: 100%;
    max-width: none;
    gap: 12px;
    flex-direction: column;
    padding: 16px;
  }

  .vs-divider {
    width: 100%;
    flex: none;
    padding: 12px 0;
  }

  .vs-divider img {
    width: 16px;
    height: 16px;
    margin: 0 auto;
  }

  .vs-divider::before {
    top: 50%;
    bottom: auto;
    left: 0;
    width: 100%;
    height: 1px;
    transform: translateY(-50%);
  }

  .vs-divider::after {
    width: 30px;
    height: 30px;
  }

  .vote-button {
    width: 70px;
    height: 70px;
    font-size: 0.9em;
  }

  .vote-button--signin {
    width: 56px;
    height: 56px;
    font-size: 0.7em;
    padding: 0 4px;
  }

  .vote-info {
    width: 100%;
    height: auto; /* ⬅️ let it grow naturally */
    align-items: center;
    justify-content: center;
  }

  .expiration-date {
    font-size: 0.8em;
    margin-top: 10px;
  }

  .tournament-title {
    display: none;
  }

  .share-label {
    display: none;
  }
}

.admin-button {
  display: block;
  margin: 24px auto 0;
  min-width: 180px;
  text-align: center;
}

.admin-button[disabled] {
  opacity: 0.6;
  cursor: not-allowed;
}
