/* Base styles */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: Arial, sans-serif;
  /* Dark theme background and text colors */
  /* Switch the site background to pure black to better complement the logo */
  background-color: #000000;
  color: #d0d6f9;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

header {
  /* Dark header matching site theme */
  /* Match header with the black site background */
  background-color: #000000;
  color: #d0d6f9;
  box-shadow: 0 2px 4px rgba(0, 255, 240, 0.1);
}

.navbar {
  max-width: 1000px;
  margin: 0 auto;
  padding: 1rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
}

.logo {
  font-size: 1.5rem;
  font-weight: bold;
  /* Align logo image and text horizontally */
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

/* Logo image in nav */
.logo-img {
  height: 40px;
  width: 40px;
  object-fit: contain;
  /* Remove visible background by blending with dark site background */
  /* Darken blend removes light backgrounds on the logo */
  mix-blend-mode: darken;
  filter: brightness(1.5);
}

.nav-links {
  list-style: none;
  display: flex;
  gap: 1rem;
}

.nav-links a {
  /* Neon accent color for nav links */
  color: #00fff0;
  text-decoration: none;
  padding: 0.5rem;
}

.nav-links a:hover {
  /* Subtle glow effect on hover */
  background-color: rgba(0, 255, 240, 0.1);
  border-radius: 4px;
}

.auth-links {
  display: flex;
  gap: 0.5rem;
}

.auth-links a,
.auth-links button {
  /* Authentication links use neon accents */
  color: #00fff0;
  text-decoration: none;
  border: 1px solid #00fff0;
  padding: 0.25rem 0.75rem;
  border-radius: 3px;
  background-color: transparent;
  cursor: pointer;
  font-size: 0.9rem;
}

.auth-links a:hover,
.auth-links button:hover {
  /* Glow on hover for auth links */
  background-color: rgba(0, 255, 240, 0.1);
}

main.container {
  flex: 1;
  max-width: 1000px;
  margin: 2rem auto;
  padding: 0 1rem;
}

h1 {
  margin-bottom: 1rem;
  color: #00fff0;
}

h2 {
  margin: 1.5rem 0 0.75rem;
  color: #00a7ff;
}

/* === Rules page styling === */
/* Wrapper for rules page to constrain width and spacing */
.rules-page {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

/* Notice at the top of the rules page */
.rules-notice {
  background-color: #1a0a0a;
  border-left: 4px solid #ff4d4d;
  padding: 1rem;
  margin-bottom: 1rem;
  color: #ff4d4d;
  font-weight: bold;
  border-radius: 4px;
  box-shadow: 0 0 4px rgba(255, 77, 77, 0.4);
}

/* Card for each rules section */
.rule-card {
  background-color: #111111;
  border: 1px solid #00fff0;
  border-radius: 6px;
  padding: 1.25rem 1.5rem;
  box-shadow: 0 0 8px rgba(0, 255, 240, 0.15);
}

.rule-card h2 {
  margin-top: 0;
  margin-bottom: 0.75rem;
  color: #00a7ff;
}

/* Lists inside rules cards */
.rules-list {
  list-style-position: inside;
  margin-left: 0.25rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

/* Nested lists maintain indentation */
.rules-list ul {
  margin-left: 1.25rem;
  list-style-type: disc;
}

/* Critical text highlighting */
.critical {
  color: #ff6b6b;
  font-weight: bold;
}

/* Hero */
.hero {
  text-align: center;
  margin: 2rem 0 3rem;
}

/* Hero content wrapper to constrain width */
.hero-content {
  max-width: 800px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1rem;
}

/* Hero subtitle styling */
.hero-subtext {
  font-size: 1.1rem;
  line-height: 1.4;
  color: #b0b8d1;
  max-width: 600px;
  margin: 0 auto;
}

/* Hero buttons layout */
/* Hero buttons: stacked vertically and centred */
.hero-buttons {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.75rem; /* approximately 12px vertical spacing */
  margin-top: 1rem;
}

/* Ensure hero CTA buttons share the same width */
.hero-buttons .button,
.hero-buttons .secondary-button {
  width: 230px !important;
  text-align: center;
  margin: 0 auto;
  display: block;
}

/* Remove default margin-top from primary and secondary buttons within the hero
   so that spacing is controlled solely by the flex gap. Without this override
   the .button global margin-top would add extra space above the first CTA. */
.hero-buttons .button,
.hero-buttons .secondary-button {
  margin-top: 0 !important;
}

/* Secondary button for hero section */
.secondary-button {
  display: inline-block;
  color: #00fff0;
  border: 1px solid #00fff0;
  padding: 0.5rem 1rem;
  border-radius: 4px;
  text-decoration: none;
  box-shadow: 0 0 6px rgba(0, 255, 240, 0.3);
}
.secondary-button:hover {
  background-color: rgba(0, 255, 240, 0.1);
  filter: brightness(1.1);
}

/* Next tournament section */
.next-tournament {
  margin: 2rem 0;
  text-align: center;
}
.next-tournament-card {
  background-color: #111111;
  border: 1px solid #7f5af0;
  border-radius: 6px;
  padding: 1.5rem;
  max-width: 500px;
  margin: 0.5rem auto 0;
  box-shadow: 0 0 8px rgba(127, 90, 240, 0.3);
}
.next-tournament-card h3 {
  margin-bottom: 0.5rem;
  color: #00fff0;
}
.next-tournament-card p {
  margin-bottom: 0.5rem;
  color: #b0b8d1;
}
.next-tournament-card a {
  margin-top: 0.5rem;
}

/* Features section */
.features {
  margin: 2rem 0;
  text-align: center;
}
.features h2 {
  margin-bottom: 1rem;
  color: #00a7ff;
}
.feature-cards {
  display: grid;
  gap: 1rem;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  /* Center items horizontally so that when there are fewer cards per row (e.g., 3),
     the last card appears centered rather than left aligned. */
  justify-content: center;
}
.feature-card {
  background-color: #111111;
  border: 1px solid #00fff0;
  border-radius: 6px;
  padding: 1.5rem;
  /* Center the card content horizontally for a balanced look */
  text-align: center;
  box-shadow: 0 0 6px rgba(0, 255, 240, 0.1);
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  /* Ensure cards are consistently sized on desktop */
  min-height: 200px;
  /* Center children elements horizontally */
  align-items: center;
}

/* Responsive adjustments for feature cards on small screens */
@media (max-width: 600px) {
  .feature-card {
    /* Remove fixed minimum height on mobile so cards shrink to content */
    min-height: auto;
    /* Reduce padding for better fit on small screens */
    padding: 1rem;
  }
  .feature-cards {
    gap: 0.75rem;
  }
  .feature-card h3 {
    font-size: 1rem;
  }
  .feature-card p {
    font-size: 0.85rem;
  }
}
.feature-card h3 {
  color: #00fff0;
  margin-bottom: 0.5rem;
  font-size: 1.1rem;
  font-weight: 600;
}
.feature-card p {
  color: #b0b8d1;
  font-size: 0.9rem;
}

/* Social links section separate styling */
.social-links-section {
  /* Reduce vertical spacing for social links section */
  margin: 1.25rem 0;
  text-align: center;
}
.social-links-section h2 {
  margin-bottom: 1rem;
  color: #00a7ff;
}

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

.hero p {
  font-size: 1.1rem;
  line-height: 1.4;
}

/* Home page hero logo */
.hero-logo {
  width: 120px;
  height: auto;
  margin-bottom: 1rem;
  display: inline-block;
  mix-blend-mode: darken;
  filter: brightness(1.5);
}

/* Social links */
.social-links-section ul {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  /* Moderate gap between social link cards; not too spaced out */
  gap: 1rem;
}

.social-links-section a {
  /* Dark cards with neon borders for social links */
  /* Adjust social card background to match the black theme */
  background-color: #111111;
  padding: 0.5rem 1rem;
  border-radius: 4px;
  border: 1px solid #00fff0;
  color: #00fff0;
  text-decoration: none;
}

.social-links-section a:hover {
  /* Slightly brighten on hover */
  /* Slightly lighten social cards on hover */
  background-color: #222222;
  filter: brightness(1.1);
}

/* When the social links section is placed at the top of the page,
   reduce the top margin further to bring it closer to the header. */
.social-links-section.top {
  margin-top: 0.75rem;
}

/* Buttons */
.button {
  display: inline-block;
  /* Use a vibrant gradient and neon shadow for primary buttons */
  background-image: linear-gradient(90deg, #7f5af0, #5df2ff);
  color: #0a0f23;
  padding: 0.5rem 1rem;
  border-radius: 4px;
  text-decoration: none;
  margin-top: 1rem;
  box-shadow: 0 0 6px rgba(127, 90, 240, 0.6);
}

.button:hover {
  /* Intensify glow on hover */
  filter: brightness(1.1);
}

/* Admin dashboard navigation */
.admin-nav {
  display: flex;
  gap: 1rem;
  margin-bottom: 1.5rem;
  border-bottom: 1px solid #00fff0;
  padding-bottom: 0.5rem;
}

.admin-nav-item {
  background: none;
  border: none;
  color: #00fff0;
  cursor: pointer;
  font-size: 1rem;
  padding: 0.25rem 0.5rem;
  border-bottom: 2px solid transparent;
  transition: border-color 0.2s, color 0.2s;
}

.admin-nav-item:hover {
  color: #5df2ff;
}

.admin-nav-item.active {
  border-color: #7f5af0;
  color: #7f5af0;
}

/* Admin container adjustments */
.admin-container {
  /* Provide additional top margin for nav alignment */
  margin-top: 1rem;
}

/* Admin tabs */
.admin-tab {
  display: none;
}

.admin-tab.active {
  display: block;
}

/* Admin tables */
.admin-table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 1rem;
  color: #d0d6f9;
}

/* =================== Twitch Card Styles =================== */
/* Wrapper to maintain a 16:9 aspect ratio for the Twitch player */
.twitch-player {
  position: relative;
  padding-bottom: 56.25%;
  height: 0;
  overflow: hidden;
  width: 100%;
}
.twitch-player iframe {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  border: none;
}

.admin-table th,
.admin-table td {
  border: 1px solid #00fff0;
  padding: 0.5rem;
  text-align: left;
}

.admin-table th {
  background-color: #111111;
  color: #00fff0;
}

.admin-table tr:nth-child(even) {
  background-color: #0a0f23;
}

/* Tournament page navigation */
.tournament-nav {
  display: flex;
  gap: 1rem;
  margin-top: 1rem;
  margin-bottom: 1rem;
  border-bottom: 1px solid #00fff0;
  padding-bottom: 0.5rem;
}

.tournament-nav-item {
  background: none;
  border: none;
  color: #00fff0;
  cursor: pointer;
  font-size: 1rem;
  padding: 0.25rem 0.5rem;
  border-bottom: 2px solid transparent;
  transition: border-color 0.2s, color 0.2s;
}

.tournament-nav-item:hover {
  color: #5df2ff;
}

.tournament-nav-item.active {
  border-color: #7f5af0;
  color: #7f5af0;
}

/* Tournament tabs */
.tournament-tab {
  display: none;
}
.tournament-tab.active {
  display: block;
}

/* Team section separation on tournaments page */
.team-section {
  /* Provide margin and border to separate from tournaments */
  margin-bottom: 1.5rem;
  padding: 1rem;
  background-color: #111111;
  border: 1px solid #00fff0;
  border-radius: 4px;
}

/* Status badge for tournament cards */
.status-badge {
  display: inline-block;
  padding: 0.1rem 0.5rem;
  border-radius: 4px;
  font-size: 0.75rem;
  margin-bottom: 0.5rem;
  font-weight: bold;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
.badge-open {
  background-color: #004d40;
  color: #00ffcc;
}
.badge-full {
  background-color: #4e2709;
  color: #ffb74d;
}
.badge-started {
  background-color: #2e004d;
  color: #b39ddb;
}
.badge-completed {
  background-color: #333333;
  color: #bdbdbd;
}

/* Past champion card styling to resemble trophies */
.past-champion-card {
  background-color: #15120b;
  border: 1px solid #d4af37; /* golden border */
  box-shadow: 0 0 8px rgba(212, 175, 55, 0.4);
}
.past-champion-card h3 {
  color: #d4af37;
}
.past-champion-card p {
  color: #f1e1a6;
}

/* Tournament list */
.tournament-list {
  display: grid;
  gap: 1rem;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  margin-top: 1rem;
}

.tournament-card {
  /* Dark card with neon border and soft shadow */
  /* Tournament cards use a near‑black background instead of blue */
  background-color: #111111;
  border: 1px solid #00fff0;
  border-radius: 4px;
  padding: 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  color: #d0d6f9;
  box-shadow: 0 0 6px rgba(0, 255, 240, 0.1);
}

.tournament-card h3 {
  font-size: 1.2rem;
  margin-bottom: 0.25rem;
  color: #00fff0;
}

.tournament-card p {
  font-size: 0.9rem;
  color: #9fa8d1;
}

.tournament-card a {
  margin-top: auto;
}

/* Forms */
.auth-form,
#create-tournament-form {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  max-width: 400px;
}

.auth-form input,
#create-tournament-form input,
#create-tournament-form textarea {
  padding: 0.5rem;
  border: 1px solid #2f3459;
  border-radius: 4px;
  font-size: 1rem;
  /* Inputs have a black background to align with the new color scheme */
  background-color: #000000;
  color: #d0d6f9;
}

.auth-form button,
#create-tournament-form button {
  align-self: flex-start;
}

/* Admin list actions */
.admin-actions {
  display: flex;
  gap: 0.5rem;
  margin-top: 0.5rem;
}

.admin-actions button {
  padding: 0.25rem 0.5rem;
  border: none;
  border-radius: 3px;
  color: #0a0f23;
  cursor: pointer;
  font-size: 0.8rem;
  font-weight: bold;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.admin-actions .edit {
  background-image: linear-gradient(90deg, #7f5af0, #5df2ff);
  box-shadow: 0 0 6px rgba(127, 90, 240, 0.6);
}

.admin-actions .delete {
  background-image: linear-gradient(90deg, #ff3860, #ff9a8c);
  box-shadow: 0 0 6px rgba(255, 56, 96, 0.6);
}

.admin-actions .start {
  background-image: linear-gradient(90deg, #00ffc6, #00a7ff);
  box-shadow: 0 0 6px rgba(0, 255, 198, 0.6);
}

.admin-actions .edit:hover,
.admin-actions .delete:hover,
.admin-actions .start:hover {
  filter: brightness(1.1);
}

/*
 * Standalone delete button (used on tournament detail page)
 * Apply neon gradient styling similar to admin actions.
 */
button.delete {
  background-image: linear-gradient(90deg, #ff3860, #ff9a8c);
  color: #0a0f23;
  border: none;
  border-radius: 3px;
  padding: 0.25rem 0.5rem;
  font-size: 0.8rem;
  font-weight: bold;
  text-transform: uppercase;
  cursor: pointer;
  box-shadow: 0 0 6px rgba(255, 56, 96, 0.6);
}

button.delete:hover {
  filter: brightness(1.1);
}

/* Tournament details */
.tournament-detail {
  /* Use a near‑black background for tournament detail cards */
  background-color: #111111;
  padding: 1rem;
  border: 1px solid #00fff0;
  border-radius: 4px;
  color: #d0d6f9;
  box-shadow: 0 0 6px rgba(0, 255, 240, 0.1);
}

.tournament-detail h2 {
  margin-bottom: 0.5rem;
}

.teams-list {
  list-style: none;
  padding-left: 1rem;
  margin-bottom: 1rem;
}

.bracket {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
}

.round {
  flex: 1;
}

.match {
  /* Use the same near‑black background for individual match cards */
  background-color: #111111;
  border: 1px solid #00fff0;
  border-radius: 4px;
  padding: 0.5rem;
  margin-bottom: 0.5rem;
  color: #d0d6f9;
  box-shadow: 0 0 4px rgba(0, 255, 240, 0.1);
}

.match p {
  margin-bottom: 0.25rem;
  font-size: 0.9rem;
}

/* Admin score reporting controls inside matches */
.report-score {
  margin-top: 0.5rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.report-score select {
  padding: 0.4rem;
  border: 1px solid #2f3459;
  border-radius: 4px;
  /* Select boxes in score reporting use black background */
  background-color: #000000;
  color: #d0d6f9;
}

/* Team management section on tournaments page */
.team-section {
  margin-top: 2rem;
  padding: 1rem;
  /* Team section panels adopt the near‑black background */
  background-color: #111111;
  border: 1px solid #00fff0;
  border-radius: 4px;
  box-shadow: 0 0 6px rgba(0, 255, 240, 0.1);
  color: #d0d6f9;
}

.team-section h2,
.team-section h3 {
  color: #00a7ff;
  margin-bottom: 0.5rem;
}

.team-section ul {
  list-style: none;
  padding-left: 1rem;
  margin-bottom: 1rem;
}

.team-section ul li {
  margin-bottom: 0.25rem;
}

.team-section form {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  max-width: 400px;
}

.team-section input {
  padding: 0.5rem;
  border: 1px solid #2f3459;
  border-radius: 4px;
  font-size: 1rem;
  /* Inputs in the team section use black background */
  background-color: #000000;
  color: #d0d6f9;
}

.team-section button {
  align-self: flex-start;
  background-image: linear-gradient(90deg, #7f5af0, #5df2ff);
  color: #0a0f23;
  padding: 0.4rem 0.8rem;
  border-radius: 4px;
  border: none;
  cursor: pointer;
  box-shadow: 0 0 6px rgba(127, 90, 240, 0.6);
}

.team-section button:hover {
  filter: brightness(1.1);
}

/* Past winners section spacing */
#past-winners-section {
  margin-top: 2rem;
}

/* Footer */
footer {
  background-color: #0a0d2b;
  color: #d0d6f9;
  text-align: center;
  padding: 1rem 0;
  margin-top: auto;
  box-shadow: 0 -2px 4px rgba(0, 255, 240, 0.1);
}