/* BrainRot - Main Stylesheet */

*,
*::before,
*::after {
  box-sizing: border-box;
}

:root {
  /* Brand Base */
  --brand-blue: #326A94;
  --brand-orange: #C85A28;
  --brand-background: #121721; /* True night dark, not black */
  --brand-surface: #1A1F2B;     /* Slightly lighter than background */
  --brand-surface-alt: #222735; /* Slightly lifted for cards */

  /* Typography */
  --text-primary: #E6EEF3;        /* Gentle, not pure white */
  --text-secondary: #A0A7B2;      /* Muted gray-blue */
  --text-faded: #6A7280;          /* Subtle hint for disabled/low-priority */
  --text-inverse: #121721;

  /* Teams */
  --team1-primary: var(--brand-blue);
  --team2-primary: var(--brand-orange);

  --team1-bg: rgba(50, 106, 148, 0.15);
  --team2-bg: rgba(200, 90, 40, 0.15);
  --team1-faded: #507CA8;
  --team2-faded: #D26930;

  /* Accents */
  --accent-info: #4DB7C0;   /* Soft teal for energy/info */
  --accent-success: #5DBB63; /* Green for confirmation */
  --accent-warning: #FFC857; /* Friendly amber for alerts */
  --accent-danger: #D84747;  /* Flat red for danger */

  /* Buttons */
  --button-bg: var(--accent-info);
  --button-hover: #3BA5AD;
  --button-text: #121721;

  /* Borders */
  --border-subtle: rgba(255,255,255,0.1);
  --border-strong: rgba(255,255,255,0.2);

  /* Overlays */
  --overlay-dark: rgba(0, 0, 0, 0.5);
  --overlay-light: rgba(255, 255, 255, 0.05);
}

/* Base Styles */
body {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, 'Open Sans', sans-serif;
  background-color: var(--brand-blue);
  /* Remove background-image and blend-mode from body, handled by ::before */
  /* background-image: url('/images/BG-01.svg'); */
  /* background-blend-mode: multiply; */
  background-repeat: no-repeat;
  background-size: cover;
  color: var(--text-primary);
  line-height: 1.5;
  margin: 0;
  padding: 0;
}

/* Container */
.container {
  min-height: 100%;
  display: flex;
  flex-direction: column;
  width: 100%;
  max-width: 1800px;
  margin: 0 auto;
  padding: 0 1rem;
}
main.container {
  flex: 1 0 auto;
}

/* Header */
header {
  /* background-color: var(--dark-surface); */
  padding: 0.2rem 0;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

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

.logo {
  font-size: 5rem;
  font-weight: 700;
  color: var(--text-primary);
  text-decoration: none;
}

.nav-links {
  display: flex;
  gap: 1.5rem;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.5rem 1rem;
  font-weight: 500;
  border-radius: 1.5rem;
  transition: all 0.2s ease;
  cursor: pointer;
  text-decoration: none;
}

.btn-primary {
  background-color: var(--button-bg);
  color: var(--button-text);
  border: none;
}

.btn-primary:hover {
  background-color: var(--button-hover);
}

.btn-danger {
  background-color: var(--accent-danger);
  color: var(--text-inverse);
  border: none;
}

.btn-outline {
  background-color: transparent;
  color: var(--text-primary);
  border: 1px solid var(--border-strong);
}

.btn-outline:hover {
  border-color: var(--team1-primary);
  color: var(--team1-primary);
}

/* Game Cards */
.game-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 1.5rem;
  padding: 2rem 0;
}

.game-card {
  background-color: var(--brand-surface-alt);
  border-radius: 0.5rem;
  overflow: hidden;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.game-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 10px 15px rgba(0, 0, 0, 0.2);
}

.game-thumbnail {
  width: 100%;
  height: 180px;
  object-fit: cover;
}

.game-info {
  padding: 1.25rem;
}

.game-title {
  font-size: 1.25rem;
  font-weight: 600;
  margin: 0 0 0.5rem 0;
}

.game-description {
  color: var(--text-secondary);
  margin-bottom: 1rem;
  font-size: 0.875rem;
}

.game-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.player-count {
  font-size: 1.2rem;
  color: var(--text-secondary);
}

/* Player Filter */
.player-filter {
  margin: 1.5rem auto;
  max-width: 400px;
  text-align: center;
}

.player-filter-title {
  font-size: 0.8rem;
  font-weight: 600;
  margin-bottom: 0.5rem;
  line-height: 1;
}

.player-filter-compact {
  background-color: var(--brand-surface);
  padding: 0.75rem 1.25rem;
  border-radius: 1.5rem;
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}

.player-filter-dot {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background-color: var(--text-secondary); /* Assuming dots should use secondary text color */
  margin-bottom: 0.5rem;
  transition: all 0.2s ease;
}

.player-filter-dot.active {
  background-color: var(--team1-primary);
}

.player-filter-track {
  width: 300px;
  position: relative;
  margin-bottom: 0.5rem;
}

.player-filter-track input[type="range"] {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 4px;
  background: rgba(255, 255, 255, 0.2);
  border-radius: 2px;
  outline: none;
}

.player-filter-track input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--team1-primary);
  cursor: pointer;
  border: 2px solid var(--brand-surface);
  box-shadow: 0 0 0 2px var(--team1-primary);
}

.player-filter-track input[type="range"]::-moz-range-thumb {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--team1-primary);
  cursor: pointer;
  border: 2px solid var(--brand-surface);
  box-shadow: 0 0 0 2px var(--team1-primary);
}

.player-filter-labels {
  display: flex;
  justify-content: space-between;
  width: 100%;
  font-size: 0.75rem;
  color: var(--text-secondary);
}

.player-filter-labels span {
  cursor: pointer;
  transition: color 0.2s ease;
}

.player-filter-labels span.active {
  color: var(--text-primary);
  font-weight: 500;
}

/* Footer */
footer {
  background-color: var(--brand-surface);
  padding: 1.5rem 0;
  margin-top: auto;
  flex-shrink: 0;
  width: 100%;
}

.footer-content {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.footer-text {
  color: var(--text-secondary);
  font-size: 0.875rem;
}

/* Error page styles */
.error-container {
  padding: 2rem;
  background-color: var(--brand-surface);
  border-radius: 0.5rem;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
  margin: 2rem auto;
  max-width: 800px;
}

.error-title {
  font-size: 2rem;
  color: var(--accent-danger);
  margin-bottom: 1rem;
}

.error-message {
  font-size: 1.25rem;
  margin-bottom: 2rem;
}

.error-details {
  background-color: var(--overlay-dark);
  padding: 1rem;
  border-radius: 0.25rem;
  font-family: monospace;
  white-space: pre-wrap;
  overflow-x: auto;
}

/* About page styles */
.about-container {
  max-width: 800px;
  margin: 0 auto;
  padding: 2rem 0;
}

.about-title {
  text-align: center;
  font-size: 3rem;
  margin-bottom: 2rem;
}

.about-section {
  margin-bottom: 3rem;
}

.about-section h2 {
  font-size: 1.75rem;
  margin-bottom: 1rem;
  color: var(--team1-primary);
}

.about-section p, 
.about-section li {
  line-height: 1.6;
  margin-bottom: 1rem;
}

.about-section ul, 
.about-section ol {
  padding-left: 1.5rem;
  margin-bottom: 1rem;
}

.about-section li {
  margin-bottom: 0.5rem;
}

.about-section:last-child {
  text-align: center;
}

.about-section:last-child .btn {
  margin-top: 1rem;
}

/* Responsive styles */
@media (max-width: 768px) {
  .container {
    padding: 0 1rem;
  }
  
  .game-grid {
    grid-template-columns: 1fr;
  }
  
  .header-content {
    flex-direction: column;
    gap: 1rem;
    padding: 0.2rem 0;
  }
  
  .nav-links {
    width: 100%;
    justify-content: center; /* Center buttons */
    flex-wrap: wrap; /* Allow wrapping */
    gap: 0.5rem; /* Add gap for wrapped buttons */
  }
  .nav-links .btn {
      flex-shrink: 1; /* Allow buttons to shrink if needed */
  }
}

@media (max-width: 480px) {
  .btn {
    padding: 0.5rem 1rem;
    font-size: 0.875rem;
  }
  
  .player-filter-options {
    font-size: 0.75rem;
  }
}


/* Utilities */
.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border-width: 0;
}

/* SVG overlay for body background */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -10;
  pointer-events: none;
  background-image: url('/images/BG-01.svg');
  background-repeat: no-repeat;
  background-size: cover;
  opacity: 0.02;
  mix-blend-mode: normal;
}
body::after {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -5;
  pointer-events: none;
  background: radial-gradient(ellipse at center, rgba(14, 23, 29, 0) 0%, rgba(14, 23, 29, 0.3) 60%, rgba(14, 23, 29, 0.737) 100%);
  opacity: 0.5;
  mix-blend-mode: normal;
}
body {
  position: relative;
  z-index: 1;
}

