/* Hide radio inputs */
.btn-check {
    display: none;
}

/* Base button styles - consolidated selector */
label.btn[for*="btnradi"] {
    width: 32px;
    height: 32px;
    border-radius: 50% !important;
    border: 2px solid #555 !important;
    background: #2a2a2a !important;
    color: #666 !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    transition: transform 0.2s ease, border-color 0.2s ease, opacity 0.2s ease !important;
    position: relative !important;
    opacity: 0.6 !important;
    margin: 0 3px !important;
    text-decoration: none !important;
    font-size: 20px !important;
    font-family: system-ui, -apple-system, sans-serif !important;
    will-change: transform, opacity;
}

/* Team box specific sizing */
.team-box label.btn[for*="btnradi"] {
    width: 50px;
    height: 50px;
    font-size: 24px !important;
    margin: 0 4px !important;
}

/* Emoji content using data attributes approach for better performance */
label.btn[for*="btnradio"][for$="1"]::before,
label.btn[for*="btnradiBpp1"]::before,
label.btn[for*="btnradiApp1"]::before {
    content: "😞";
}

label.btn[for*="btnradio"][for$="2"]::before,
label.btn[for*="btnradiBpp2"]::before,
label.btn[for*="btnradiApp2"]::before {
    content: "😐";
}

label.btn[for*="btnradio"][for$="3"]::before,
label.btn[for*="btnradiBpp3"]::before,
label.btn[for*="btnradiApp3"]::before {
    content: "😊";
}

label.btn[for*="btnradio"][for$="4"]::before {
    content: "⭐";
}

/* Hide FontAwesome icons */
label.btn[for*="btnradio"] .fa-face-frown,
label.btn[for*="btnradio"] .fa-meh,
label.btn[for*="btnradio"] .fa-smile,
label.btn[for*="btnradio"] .fa-star {
    display: none;
}

/* Base gradient backgrounds - using CSS custom properties for better performance */
:root {
    --gradient-red: linear-gradient(135deg, #dc2626, #b91c1c);
    --gradient-yellow: linear-gradient(135deg, #f59e0b, #d97706);
    --gradient-green: linear-gradient(135deg, #10b981, #059669);
    --gradient-red-active: linear-gradient(135deg, #f87171, #ef4444);
    --gradient-yellow-active: linear-gradient(135deg, #fde047, #facc15);
    --gradient-green-active: linear-gradient(135deg, #4ade80, #22c55e);
}

/* Negative/frown buttons */
label.btn[for*="btnradio"][for$="1"],
label.btn[for*="btnradiBpp1"],
label.btn[for*="btnradiApp1"] {
    background: var(--gradient-red) !important;
}

/* Neutral/meh buttons */
label.btn[for*="btnradio"][for$="2"],
label.btn[for*="btnradiBpp2"],
label.btn[for*="btnradiApp2"] {
    background: var(--gradient-yellow) !important;
}

/* Positive/smile buttons */
label.btn[for*="btnradio"][for$="3"],
label.btn[for*="btnradiBpp3"],
label.btn[for*="btnradiApp3"] {
    background: var(--gradient-green) !important;
}

/* Hover effects - simplified */
label.btn[for*="btnradi"]:hover {
    transform: scale(1.15) !important;
    border-color: rgba(255, 255, 255, 0.4) !important;
    opacity: 1 !important;
}

/* Active/Checked states - consolidated */
.btn-check:checked + label.btn[for*="btnradi"] {
    transform: scale(1.3) !important;
    border-width: 4px !important;
    border-color: #ffffff !important;
    filter: brightness(1.5) saturate(1.3) !important;
    opacity: 1 !important;
    z-index: 10 !important;
    position: relative !important;
}

/* Light theme override */
[data-bs-theme="light"] .btn-check:checked + label.btn[for*="btnradi"] {
    border-color: #000000 !important;
}

/* Active state colors with optimized box shadows */
.btn-check:checked + label.btn[for*="btnradio"][for$="1"],
.btn-check:checked + label.btn[for*="btnradiBpp1"],
.btn-check:checked + label.btn[for*="btnradiApp1"] {
    background: var(--gradient-red-active) !important;
    box-shadow: 0 0 30px rgba(239, 68, 68, 0.8) !important;
    color: #fff !important;
}

.btn-check:checked + label.btn[for*="btnradio"][for$="2"],
.btn-check:checked + label.btn[for*="btnradiBpp2"],
.btn-check:checked + label.btn[for*="btnradiApp2"] {
    background: var(--gradient-yellow-active) !important;
    box-shadow: 0 0 30px rgba(250, 204, 21, 0.8) !important;
    color: #000 !important;
}

.btn-check:checked + label.btn[for*="btnradio"][for$="3"],
.btn-check:checked + label.btn[for*="btnradiBpp3"],
.btn-check:checked + label.btn[for*="btnradiApp3"] {
    background: var(--gradient-green-active) !important;
    box-shadow: 0 0 30px rgba(34, 197, 94, 0.8) !important;
    color: #fff !important;
}

.btn-check:checked + label.btn[for*="btnradio"][for$="4"] {
    box-shadow: 0 0 30px rgba(251, 191, 36, 0.8) !important;
    color: #fff !important;
}

/* Focus states for accessibility */
.btn-check:focus + label.btn[for*="btnradi"] {
    outline: 2px solid #60a5fa !important;
    outline-offset: 2px !important;
}

/* Mobile responsiveness with performance considerations */
@media (max-width: 640px) {
    label.btn[for*="btnradi"] {
        font-size: 18px !important;
    }
    
    .team-box label.btn[for*="btnradi"] {
        width: 45px !important;
        height: 45px !important;
        font-size: 22px !important;
    }
    
    .btn-check:checked + label.btn[for*="btnradi"] {
        transform: scale(1.25) !important;
    }
}

/* Preload emoji fonts for better performance */
@font-face {
    font-family: 'emoji-preload';
    src: local('Apple Color Emoji'), local('Segoe UI Emoji'), local('Noto Color Emoji');
    font-display: swap;
}

/* Force hardware acceleration for smoother animations */
label.btn[for*="btnradi"] {
    transform: translateZ(0);
    backface-visibility: hidden;
}

/* here */
.fa-face-frown {
  color: #dc3545;
}

.fa-meh {
  color: #ffc107;
}

.fa-smile {
  color: #28a745;
}

  .event-card {
      border: 1px solid #ddd;
      padding: 12px;
      margin-bottom: 10px;
      border-radius: 8px;
      display: flex;
      align-items: center;
      width: 100%;
      max-width: 500px;
      background: transparent;
  }
  .event-time {
      font-weight: bold;
      margin-right: 10px;
      font-size: 1.1em;
      white-space: nowrap;
  }
  .event-container {
      display: flex;
      width: 100%;
  }

  .home-event {
      justify-content: flex-start;

  }
  .away-event {
      justify-content: flex-end;

  }

  .home-event .event-detail {
  flex-grow: 1;
  text-align: center;
  background: linear-gradient(145deg, rgba(255, 255, 255, 0.08), rgba(255, 255, 255, 0.01));
  backdrop-filter: blur(4px);
  box-shadow: 0 2px 10px rgba(0,0,0,0.2);
  border-radius: 15px;
  }

  .light-theme .home-event .event-detail{
  background: linear-gradient(145deg, rgba(215, 215, 215, 0.486), rgba(255, 255, 255, 0.01));
  backdrop-filter: blur(4px);
  box-shadow: 0 2px 10px rgba(0,0,0,0.2);
  border-radius: 15px;
  }

  .events-list {
      max-height: 400px;
      overflow-y: auto;
      padding: 10px;
  }
  .team-logo {
    width: 40px;
    height: 40px;
    margin-right: 15px;
  }

  .home-team {
    border-left: 4px solid #3498db;
  }
  .away-team {
    border-right: 4px solid #e74c3c;
  }

  .event-detail .team-name {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 100%;
    font-size: 2rem;
  }

  .equal-sign {
    font-size: 2rem;
  }

  .prediction-percent {
    font-size: 2rem;
  }

  @media (max-width: 1200px) {
    .event-detail .team-name {
      font-size: 1.75rem;
    }
    .equal-sign, .prediction-percent {
      font-size: 1.75rem;
    }
  }

  @media (max-width: 992px) {
    .event-detail .team-name {
      font-size: 1.5rem;
    }
    .equal-sign, .prediction-percent {
      font-size: 1.5rem;
    }
  }

  @media (max-width: 768px) {
    .event-detail .team-name {
      font-size: 1.25rem;
    }
    .equal-sign, .prediction-percent {
      font-size: 1.25rem;
    }
  }

  @media (max-width: 576px) {
    .event-detail .team-name {
      white-space: normal;
      word-wrap: break-word;
      font-size: 1rem;
    }
    .equal-sign, .prediction-percent {
      font-size: 1rem;
    }
  }

:root {
  --line-color: #9b999ef5;
  --shadow-color: rgba(0, 0, 0, 0.556);
}

.shadow-line {
  width: 100%;
  height: 2px;
  background-color: var(--line-color);
  box-shadow: 0  3px 7px var(--shadow-color);
  margin-top: 10px;
}

.shadow-line2 {
  width: 100%;
  height: 1px;
  background-color: var(--line-color);
  box-shadow: 0  3px 7px var(--shadow-color);
  margin-top: 10px;
}

.light-theme .bar-container {
    background-color: transparent;
}

.dark-theme .bar-container {
    background-color: transparent;
}

.light-theme .bar-green {
    background-color: #4CAF50;
}

.dark-theme .bar-green {
    background-color: #006400;
}

.light-theme .bar-red {
    background-color: #F44336;
}

.dark-theme .bar-red {
    background-color: #8B0000;
}

.star-label {
color: #6c757d;
}

.btn-check:checked + .star-label {
color: #FFD700 !important;
}
  .min-width-60 {
    min-width: 60px;
  }
  .min-width-100 {
    min-width: 100px;
  }
  .min-width-200 {
    min-width: 200px;
  }

      @media screen and (max-width: 992px) {
          .goallist {
              font-size: 0.9rem;
          }
      }

      @media screen and (max-width: 768px) {
          .goallist {
              font-size: 0.8rem;
          }
      }

      @media screen and (max-width: 576px) {
          .goallist {
              font-size: 0.7rem;
          }
      }

    .team-box2 {
  border: 1px solid #0c0202;
  border-radius: 12px;
  background: linear-gradient(145deg, rgba(255, 255, 255, 0.08), rgba(255, 255, 255, 0.01));
  backdrop-filter: blur(4px);
  box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.team-box {
  border: 1px solid #0c0202;
  border-radius: 12px;
  padding: 12px;
  margin: 5px 0;
  background: linear-gradient(145deg, rgba(255, 255, 255, 0.04), rgba(255, 255, 255, 0.01));
  backdrop-filter: blur(4px);
  box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.team-box label {
  display: inline-block;
  max-width: 100%;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  text-align: center;
}

.light-theme .team-box {
  border: 1px solid #0c0202;
  border-radius: 12px;
  padding: 12px;
  margin: 5px 0;
  background: linear-gradient(145deg, rgba(215, 215, 215, 0.486), rgba(255, 255, 255, 0.01));
  backdrop-filter: blur(4px);
  box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.team-box h6 {
  margin-bottom: 4px;
  font-weight: bold;
}

@media screen and (max-width: 576px) {
  .team-box {
    padding: 8px;
  }
}

.stats-table {
       width: 100%;
       border-collapse: collapse;
       max-width: 100%;
   }

   .stat-row {
       display: flex;
       align-items: center;
       justify-content: center;
       margin: 8px 0;
       padding: 4px;
       width: 100%;
   }

   .stat-type {
       width: 140px;
       text-align: center;
       font-weight: bold;
       margin: 0 1px;
   }
   .team-stat {
       display: flex;
       align-items: center;
       justify-content: center;
       width: 45%;
       padding: 0 5px;
   }
   .bar-container {
       width: 85%;
       height: 22px;
       display: flex;
       position: relative;
       background-color: var(--bs-body-bg, #f0f0f0);
       border-radius: 8px;
       border: 2px solid rgba(0,0,0,0.2);
       box-shadow: inset 0 0 5px rgba(0,0,0,0.1);
       margin: 0 auto;
   }
   .dark .bar-container {
       background-color: rgba(255,255,255,0.15);
       border: 2px solid rgba(255,255,255,0.25);
   }
   .bar {
       height: 100%;
       color: white;
       line-height: 16px;
       font-size: 0.9em;
       position: relative;
       z-index: 1;
       border-radius: 6px;
       display: flex;
       align-items: center;
       box-shadow: 0 0 8px rgba(0, 0, 0, 0.3);
   }

   .bar-green {
       background-color: #4CAF50;
       box-shadow: 2px 0 4px rgba(0, 0, 0, 0.3);
   }
   .bar-red {
       background-color: #F44336;
       box-shadow: -2px 0 4px rgba(0, 0, 0, 0.3);
   }
   .team1-value, .team2-value {
       width: 50px;
       text-align: center;
       font-weight: bold;
       position: relative;
   }

   .team1-bar .team1-value {
       margin-right: 5px;
       position: absolute;
       right: 5px;
   }
   .team2-bar .team2-value {
       margin-left: 5px;
       position: absolute;
       left: 5px;
   }

   @media screen and (max-width: 992px) {
  .responsive-text {
    font-size: 1.1rem;
  }
}

@media screen and (max-width: 768px) {
  .responsive-text {
    font-size: 0.99rem;
  }
}

@media screen and (max-width: 576px) {
  .responsive-text {
    font-size: 0.99rem;
  }
  .fa-sm {
    font-size: 0.99rem;
  }
}

body, html {
      overflow-x: hidden;
    }

.player-card {
        border-radius: 15px;
        padding: 3px 3px;
        margin: 3px 0;

        box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
        transition: background-color 0.2s ease;
      }

.player-row-dark {
  background-color: transparent;
}

.player-row-light {
  background-color: rgba(255, 255, 255, 0.01);
}

.light-theme .player-row-dark {
  background-color: transparent;
}

.light-theme .player-row-light {
  background-color: rgba(0, 0, 0, 0.001);
}

.field-container {
    position: relative;
    width: 100%;
    max-width: 600px;
    margin: auto;
    padding-top: 75%; /* Adjusted for half field ratio */
    background: linear-gradient(to bottom, #0b6623 0%, #228B22 50%, #2ca02c 100%);
    border-left: 6px solid white;
    border-right: 6px solid white;
    border-top: 6px solid white;
    border-bottom: none;
    border-radius: 16px 16px 0 0;
    box-shadow: 0 0 20px rgba(0, 0, 0, 0.3);
    overflow: hidden;
  }

  /* Grain effect overlay */
  .field-container::after {
    content: "";
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 6px;
    background: white;
    z-index: 2;
  }

  .field-container::before {
    content: "";
    position: absolute;
    top: 0; left: 0;
    width: 100%; height: 100%;
    background-image:
      repeating-linear-gradient(
        to bottom,
        rgba(255, 255, 255, 0.05) 0,
        rgba(255, 255, 255, 0.05) 6%,
        transparent 6%,
        transparent 12%
      ),
      url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='https://www.w3.org/2000/svg'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.65' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noise)' opacity='0.1'/%3E%3C/svg%3E");
    pointer-events: none;
    z-index: 1;
  }

  .penalty-box {
    position: absolute;
    top: 0;
    left: 50%;
    width: 40%;
    height: 20%;
    border-left: 3px solid white;
    border-right: 3px solid white;
    border-bottom: 3px solid white;
    transform: translateX(-50%);
    box-sizing: border-box;
    z-index: 2;
  }

  .penalty-boxs {
    position: absolute;
    top: 0;
    left: 50%;
    width: 15%;
    height: 7%;
    border-left: 3px solid white;
    border-right: 3px solid white;
    border-bottom: 3px solid white;
    transform: translateX(-50%);
    box-sizing: border-box;
    z-index: 2;
  }

  .half-circle {
    position: absolute;
    bottom: -15%;
    left: 50%;
    width: 30%;
    height: 30%;
    border: 3px solid white;
    border-bottom: none;
    border-radius: 50% 50% 0 0;
    background: transparent;
    transform: translateX(-50%);
    z-index: 3;
  }

  .center-dot {
    position: absolute;
    bottom: 0;
    left: 50%;
    width: 8px;
    height: 8px;
    background: white;
    border-radius: 50%;
    transform: translate(-50%, 50%);
    z-index: 4;
  }

  .player {
    position: absolute;
    transform: translate(-50%, -50%);
    display: flex;
    flex-direction: column;
    align-items: center;
    z-index: 5;
    transition: all 0.3s ease;
  }

  /* Player Stats Styles */
  .player-stats {
    display: flex;
    justify-content: center;
    gap: 4px;
    margin-bottom: 2px;
  }

  .player-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    height: 16px;
    border-radius: 2px;
    padding: 0 1px;
    font-size: 0.65em;
    box-shadow: 0 1px 1px rgba(0, 0, 0, 0.2);
    transform: rotate(-3deg);
    transition: transform 0.2s ease;
  }

  .player-icon:hover {
    transform: rotate(0deg) scale(1.1);
  }

  .yellow-card {
    background: rgba(0, 0, 0, 0.3);
    border: 0.5px solid rgba(255, 255, 0, 0.5);
    padding: 0 1px;
  }

  .yellow-card i {
    color: #FFFF00;
    text-shadow: 0 0 1px rgba(0, 0, 0, 0.3);
  }

  .red-card {
    background: rgba(0, 0, 0, 0.3);
    border: 0.5px solid rgba(255, 0, 0, 0.5);
    padding: 0 1px;
  }

  .red-card i {
    color: #FF3333;
    text-shadow: 0 0 1px rgba(0, 0, 0, 0.3);
  }

  .assist {
    background: rgba(30, 144, 255, 0.8);
    color: white;
    padding: 0 4px;
    font-size: 0.65em;
    transform: rotate(2deg);
  }

  .goal {
    background: rgba(218, 165, 32, 0.85);
    color: white;
    padding: 0 4px;
    font-size: 0.65em;
    transform: rotate(2deg);
    border: 0.5px solid rgba(255, 255, 255, 0.3);
  }

  .stat-count {
    font-size: 0.8em;
    margin-right: 2px;
    font-weight: bold;
  }

  /* Media queries for responsive design */
  @media screen and (max-width: 768px) {
    .field-container {
      max-width: 100%;
    }

    /* Scale down player name bubbles on small screens */
    .player-name {
      padding: 4px 8px;
      font-size: clamp(0.6rem, 2vw, 0.8rem);
    }

    .player-stats {
      transform: scale(0.9);
    }
  }

  /* Prevent overlapping on very small screens */
  @media screen and (max-width: 480px) {
    /* This will make player names stack if needed */
    .player {
      z-index: auto;
    }

    /* Dynamically assign z-index based on position from top */
    {% for name, coord in player_coords1.items %}
    .player:nth-child({{ forloop.counter|add:3 }}) {
      z-index: {{ 100|add:coord.y|floatformat:0 }};
    }
    {% endfor %}
  }

.player {
  position: absolute;
  transform: translate(-50%, -50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  z-index: 5;
}

.player-name {
  font-weight: bold;
  padding: 6px 10px;
  border-radius: 12px;
  background: rgba(0, 0, 0, 0.6);
  color: rgb(110, 226, 226);
  border: 1px solid rgba(255, 255, 255, 0.4);
  text-shadow: 0 0 3px black;
  white-space: nowrap;
  font-size: clamp(0.7rem, 2.5vw, 0.9rem);
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

.player-stats {
  display: flex;
  justify-content: center;
  gap: 4px;
  height: 16px; /* Fixed height to prevent shifting */
  margin-bottom: 2px;
  min-height: 16px; /* Ensures consistent height even when empty */
}

.player-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 16px;
  border-radius: 2px;
  padding: 0 1px;
  font-size: 0.65em;
  box-shadow: 0 1px 1px rgba(0, 0, 0, 0.2);
  transform: rotate(-3deg);
  transition: transform 0.2s ease;
}

.player-icon:hover {
  transform: rotate(0deg) scale(1.1);
}

.yellow-card {
  background: rgba(0, 0, 0, 0.3);
  border: 0.5px solid rgba(255, 255, 0, 0.5);
  padding: 0 1px;
}

.yellow-card i {
  color: #FFFF00;
  text-shadow: 0 0 1px rgba(0, 0, 0, 0.3);
}

.red-card {
  background: rgba(0, 0, 0, 0.3);
  border: 0.5px solid rgba(255, 0, 0, 0.5);
  padding: 0 1px;
}

.red-card i {
  color: #FF3333;
  text-shadow: 0 0 1px rgba(0, 0, 0, 0.3);
}

.assist {
  background: rgba(30, 144, 255, 0.8);
  color: black;
  padding: 0 2px;
  font-size: 0.65em;
  transform: rotate(2deg);
}

.goal {
  background: rgba(218, 165, 32, 0.85);
  color: black;
  padding: 0 2px;
  font-size: 0.65em;
  transform: rotate(2deg);
  border: 0.5px solid rgba(255, 255, 255, 0.3);
}

.stat-count {
  font-size: 0.8em;
  margin-right: 2px;
  font-weight: bold;
}

/* Media query adjustments */
@media screen and (max-width: 768px) {
  .player-name {
    padding: 4px 8px;
    font-size: clamp(0.6rem, 2vw, 0.8rem);
  }

  .player-stats {
    height: 14px;
    min-height: 14px;
  }

  .player-icon {
    height: 12px;
    font-size: 0.6em;
  }
}

  .substitution {
    background: black;
    color: white;
    padding: 0 2px;
    font-size: 0.65em;
    transform: rotate(-2deg);
    border: 0.5px solid rgba(255, 255, 255, 0.3);
  }

  .substitution i {
    font-size: 0.8em;
  }

#fireworks-container {
            position: fixed;
            top: 0;
            left: 0;
            width: 100%;
            height: 100vh;
            pointer-events: none;
            z-index: 9999;
        }

        .firework {
            position: absolute;
            pointer-events: none;
        }

        .particle {
            position: absolute;
            width: 4px;
            height: 4px;
            border-radius: 50%;
            pointer-events: none;
        }

        .launch-trail {
            position: absolute;
            width: 2px;
            background: linear-gradient(to top, transparent, #aaaaaa75);
            pointer-events: none;
        }
