/* Base styles */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
}

:root {
  --primary-red: #ff4747;
  --primary-dark: #0d0d0d;
  --accent-gold: #ffd700;
  --text-light: #ffffff;
  --text-gray: #cccccc;
  --bg-gradient: linear-gradient(135deg, #0d0d0d 0%, #1a0d0d 50%, #0d0d1a 100%);
  --card-bg: linear-gradient(145deg, rgba(255, 71, 71, 0.1), rgba(255, 255, 255, 0.05));
  --vh: 1vh;
}

body, html {
  height: 100%;
  overflow: hidden;
  font-family: 'Poppins', sans-serif;
  background: var(--bg-gradient);
  color: var(--text-light);
  scroll-behavior: smooth;
  -webkit-overflow-scrolling: touch;
  line-height: 1.6;
}

body {
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* Particles container */
#particles-js {
  position: fixed;
  width: 100%;
  height: 100%;
  top: 0;
  left: 0;
  z-index: -2;
  pointer-events: none;
}

/* Floating elements */
.floating-elements {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: -1;
  overflow: hidden;
}

.floating-cs-icon {
  position: absolute;
  font-size: 24px;
  opacity: 0.3;
  animation: float 6s ease-in-out infinite;
  text-shadow: 0 0 10px rgba(255, 71, 71, 0.5);
  user-select: none;
}

.floating-cs-icon:nth-child(1) { left: 10%; animation-delay: 0s; }
.floating-cs-icon:nth-child(2) { left: 30%; animation-delay: 2s; }
.floating-cs-icon:nth-child(3) { left: 50%; animation-delay: 4s; }
.floating-cs-icon:nth-child(4) { left: 70%; animation-delay: 6s; }
.floating-cs-icon:nth-child(5) { left: 20%; animation-delay: 1s; }
.floating-cs-icon:nth-child(6) { left: 40%; animation-delay: 3s; }
.floating-cs-icon:nth-child(7) { left: 60%; animation-delay: 5s; }
.floating-cs-icon:nth-child(8) { left: 80%; animation-delay: 7s; }

@keyframes float {
  0%, 100% { transform: translateY(0px) rotate(0deg) scale(1); }
  33% { transform: translateY(-20px) rotate(120deg) scale(1.1); }
  66% { transform: translateY(-10px) rotate(240deg) scale(0.9); }
}

/* Header styles */
header {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  background: rgba(0, 0, 0, 0.9);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 20px;
  z-index: 1000;
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 2px solid var(--primary-red);
  box-shadow: 0 4px 30px rgba(0, 0, 0, 0.5);
}

.header-left {
  display: flex;
  align-items: center;
  gap: 15px;
}

.team-logo {
  height: 50px;
  width: 50px;
  object-fit: cover;
  border-radius: 50%;
  border: 2px solid var(--primary-red);
  animation: logoGlow 3s ease-in-out infinite alternate;
  filter: drop-shadow(0 0 10px rgba(255, 71, 71, 0.5));
}

@keyframes logoGlow {
  0% { 
    box-shadow: 0 0 10px rgba(255, 71, 71, 0.5),
                inset 0 0 10px rgba(255, 71, 71, 0.1);
  }
  100% { 
    box-shadow: 0 0 25px rgba(255, 71, 71, 0.8),
                inset 0 0 15px rgba(255, 71, 71, 0.2);
    transform: rotate(5deg);
  }
}

h1 {
  font-size: 1.4rem;
  margin: 0;
  color: var(--primary-red);
  text-shadow: 0 0 15px rgba(255, 71, 71, 0.6);
  animation: textGlow 2.5s ease-in-out infinite alternate;
  line-height: 1.2;
  font-weight: 700;
  letter-spacing: 1px;
}

@keyframes textGlow {
  0% { text-shadow: 0 0 10px rgba(255, 71, 71, 0.5), 0 0 20px rgba(255, 71, 71, 0.3); }
  100% { text-shadow: 0 0 20px rgba(255, 71, 71, 0.8), 0 0 30px rgba(255, 71, 71, 0.5), 0 0 40px rgba(255, 71, 71, 0.3); }
}

/* Music control */
.music-control {
  display: flex;
  align-items: center;
}

.music-btn {
  background: rgba(255, 71, 71, 0.2);
  border: 2px solid var(--primary-red);
  color: var(--primary-red);
  width: 50px;
  height: 50px;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  font-size: 1.2rem;
}

.music-btn .fa-spinner {
  animation: spin 1s linear infinite;
}

@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

/* Main content - REMOVE SCROLL SNAP */
main {
  min-height: 100vh;
  height: auto;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding-top: 80px;
  padding-bottom: 100px;
  scroll-behavior: smooth;
  position: relative;
}

/* Team sections - FIXED SCROLL ISSUE */
.team {
  min-height: 100vh;
  height: auto;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  align-items: center;
  text-align: center;
  position: relative;
  padding: 40px 20px 60px;
}

.team-bg {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: 
    radial-gradient(circle at 20% 80%, rgba(255, 71, 71, 0.15) 0%, transparent 50%),
    radial-gradient(circle at 80% 20%, rgba(255, 71, 71, 0.1) 0%, transparent 50%),
    radial-gradient(circle at 40% 40%, rgba(255, 71, 71, 0.08) 0%, transparent 50%);
  z-index: -1;
  animation: bgPulse 8s ease-in-out infinite;
}

@keyframes bgPulse {
  0%, 100% { opacity: 0.3; }
  50% { opacity: 0.6; }
}

/* Team Title - FIXED VISIBILITY */
.team-title {
  font-size: 2.5rem;
  margin-bottom: 30px;
  color: #ff4747;
  text-transform: uppercase;
  letter-spacing: 3px;
  font-weight: 800;
  text-shadow: 
    0 0 10px rgba(255, 71, 71, 0.5),
    0 0 20px rgba(255, 71, 71, 0.3),
    2px 2px 4px rgba(0, 0, 0, 0.3);
  padding: 15px 25px;
  z-index: 10;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(15px);
  border-radius: 15px;
  border: 1px solid rgba(255, 71, 71, 0.3);
  width: 90%;
  max-width: 500px;
}

/* Players container */
.players {
  display: flex;
  justify-content: center;
  gap: 25px;
  flex-wrap: wrap;
  margin-top: 20px;
  max-width: 1300px;
  padding: 0 20px;
}

/* Player cards */
.player {
  background: var(--card-bg);
  padding: 20px 15px;
  border-radius: 15px;
  width: 200px;
  min-height: 280px;
  transition: all 0.3s ease;
  position: relative;
  overflow: hidden;
  backdrop-filter: blur(15px);
  -webkit-backdrop-filter: blur(15px);
  border: 1px solid rgba(255, 71, 71, 0.2);
  cursor: pointer;
  box-shadow: 
    0 8px 25px rgba(0, 0, 0, 0.3),
    inset 0 1px 0 rgba(255, 255, 255, 0.1);
}

.player-img-container {
  position: relative;
  width: 100%;
  border-radius: 12px;
  overflow: hidden;
  margin-bottom: 15px;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.3);
}

.player img {
  width: 100%;
  border-radius: 12px;
  height: 150px;
  object-fit: cover;
  filter: brightness(0.9) contrast(1.1);
  display: block;
}

.player-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(135deg, rgba(255, 71, 71, 0.92), rgba(13, 13, 13, 0.95));
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  opacity: 0;
  transition: all 0.3s ease;
  border-radius: 12px;
  padding: 15px;
  box-sizing: border-box;
}

.player:hover .player-overlay {
  opacity: 1;
}

.player-stats {
  text-align: center;
  width: 100%;
}

.player-stats p {
  margin: 6px 0;
  font-size: 0.85rem;
  color: var(--text-light);
  line-height: 1.3;
  text-shadow: 1px 1px 3px rgba(0, 0, 0, 0.8);
  font-weight: 500;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}

.player-stats i {
  font-size: 0.9rem;
  color: var(--accent-gold);
  width: 18px;
  text-align: center;
}

.stat-value {
  font-weight: 700;
  color: var(--accent-gold);
  font-size: 0.9rem;
  text-shadow: 1px 1px 3px rgba(0, 0, 0, 0.8);
}

.player h3 {
  margin: 12px 0 6px;
  font-size: 1.1rem;
  color: var(--text-light);
  line-height: 1.2;
}

.player h3 a {
  color: var(--text-light);
  text-decoration: none;
  font-size: 1.1rem;
  display: block;
  padding: 6px 0;
  min-height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  text-shadow: 1px 1px 3px rgba(0, 0, 0, 0.8);
}

.player p {
  margin: 0;
  color: var(--text-gray);
  font-size: 0.85rem;
  line-height: 1.2;
  text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.8);
}

.player-role {
  color: var(--primary-red) !important;
  font-weight: 700;
  text-shadow: 0 0 8px rgba(255, 71, 71, 0.5) !important;
}

/* Footer */
footer {
  position: fixed;
  bottom: 0;
  left: 0;
  width: 100%;
  font-size: 0.9rem;
  background: rgba(0, 0, 0, 0.95);
  padding: 15px 20px;
  backdrop-filter: blur(25px);
  -webkit-backdrop-filter: blur(25px);
  text-align: center;
  z-index: 1000;
  border-top: 1px solid rgba(255, 71, 71, 0.3);
  box-shadow: 0 -5px 30px rgba(0, 0, 0, 0.5);
}

footer p {
  margin: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  flex-wrap: wrap;
}

footer a {
  color: var(--primary-red);
  text-decoration: none;
  margin: 0 10px;
  padding: 8px 12px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 500;
}

/* ========== MOBILE OPTIMIZATIONS ========== */
@media (max-width: 768px) {
  /* Header adjustments */
  header {
    padding: 8px 15px;
    min-height: 60px;
  }
  
  h1 {
    font-size: 1rem;
    text-align: center;
    line-height: 1.1;
  }
  
  .team-logo {
    height: 40px;
    width: 40px;
  }
  
  .music-btn {
    width: 40px;
    height: 40px;
    font-size: 1rem;
  }
  
  /* Main content adjustments */
  main {
    padding-top: 60px;
    padding-bottom: 70px;
    overflow-y: auto;
    height: auto;
  }
  
  /* Team section - FIXED SCROLL */
  .team {
    min-height: 100vh;
    height: auto;
    padding: 30px 10px 50px;
    justify-content: flex-start;
  }
  
  /* Team Title - ALWAYS VISIBLE */
  .team-title {
    font-size: 1.4rem;
    margin-bottom: 20px;
    letter-spacing: 2px;
    padding: 12px 20px;
    width: 95%;
    background: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(20px);
    position: relative;
    top: 0;
  }
  
  /* Players container - COMPACT */
  .players {
    gap: 12px;
    margin-top: 15px;
    margin-bottom: 10px;
    padding: 0 5px;
    max-width: 100%;
  }
  
  /* Player cards - MOBILE SIZE */
  .player {
    width: calc(50% - 8px);
    min-height: 160px;
    padding: 10px 8px;
    border-radius: 10px;
  }
  
  .player-img-container {
    margin-bottom: 6px;
    border-radius: 8px;
  }
  
  .player img {
    height: 80px;
    border-radius: 8px;
  }
  
  .player-stats p {
    font-size: 0.7rem;
    margin: 3px 0;
    line-height: 1.1;
    gap: 4px;
  }
  
  .player-stats i {
    font-size: 0.65rem;
    width: 10px;
  }
  
  .stat-value {
    font-size: 0.7rem;
  }
  
  .player h3 {
    font-size: 0.8rem;
    margin: 6px 0 3px;
    line-height: 1.1;
  }
  
  .player h3 a {
    font-size: 0.75rem;
    min-height: 28px;
    padding: 3px 0;
  }
  
  .player p {
    font-size: 0.7rem;
  }
  
  /* Reduce floating elements */
  .floating-cs-icon {
    font-size: 14px;
  }
  
  /* Footer adjustments */
  footer {
    padding: 10px 15px;
    font-size: 0.75rem;
  }
  
  footer a {
    margin: 0 6px;
    padding: 6px 8px;
    font-size: 0.7rem;
  }
  
  footer i {
    margin-right: 3px;
    font-size: 0.7rem;
  }
}

/* Small phones (320px - 480px) */
@media (max-width: 480px) {
  .team-title {
    font-size: 1.2rem;
    margin-bottom: 15px;
    padding: 10px 15px;
  }
  
  .players {
    gap: 8px;
    margin-top: 10px;
  }
  
  .player {
    width: calc(50% - 6px);
    min-height: 150px;
    padding: 8px 6px;
  }
  
  .player img {
    height: 70px;
  }
  
  .player-stats p {
    font-size: 0.65rem;
    margin: 2px 0;
  }
  
  .player h3 {
    font-size: 0.75rem;
    margin: 4px 0 2px;
  }
  
  .player h3 a {
    font-size: 0.7rem;
    min-height: 25px;
  }
  
  .player p {
    font-size: 0.65rem;
  }
}

/* Extra small screens */
@media (max-width: 360px) {
  .player {
    width: calc(50% - 4px);
    min-height: 140px;
    padding: 6px 4px;
  }
  
  .player img {
    height: 65px;
  }
  
  .team-title {
    font-size: 1.1rem;
    padding: 8px 12px;
  }
}

/* Landscape orientation for mobile */
@media (max-height: 500px) and (orientation: landscape) {
  .team {
    padding: 20px 8px 30px;
    min-height: auto;
  }
  
  .team-title {
    font-size: 1.1rem;
    margin-bottom: 10px;
    padding: 8px 15px;
  }
  
  .players {
    margin-top: 8px;
    gap: 6px;
  }
  
  .player {
    width: calc(33.333% - 8px);
    min-height: 130px;
    padding: 6px 4px;
  }
  
  .player img {
    height: 60px;
  }
  
  main {
    padding-top: 60px;
    padding-bottom: 60px;
  }
}

/* Tablet adjustments */
@media (min-width: 769px) and (max-width: 1024px) {
  .players {
    gap: 20px;
  }
  
  .player {
    width: calc(33.333% - 20px);
    min-height: 260px;
  }
  
  .team-title {
    font-size: 2.2rem;
  }
}

/* Performance and accessibility */
@media (prefers-reduced-motion: reduce) {
  * {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* Focus styles for accessibility */
a:focus-visible,
button:focus-visible {
  outline: 2px solid var(--primary-red);
  outline-offset: 3px;
  border-radius: 5px;
}

/* iPhone Safe Areas */
@supports (padding: max(0px)) {
  header, footer {
    padding-left: max(20px, env(safe-area-inset-left));
    padding-right: max(20px, env(safe-area-inset-right));
  }
  
  header {
    padding-top: max(10px, env(safe-area-inset-top));
  }
  
  footer {
    padding-bottom: max(15px, env(safe-area-inset-bottom));
  }
}

/* Prevent text selection on player cards */
.player, .player *:not(h3 a) {
  -webkit-user-select: none;
  -moz-user-select: none;
  -ms-user-select: none;
  user-select: none;
  -webkit-touch-callout: none;
}

/* Allow text selection only on links */
.player h3 a {
  -webkit-user-select: text;
  -moz-user-select: text;
  -ms-user-select: text;
  user-select: text;
}