.rotate-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(254, 254, 254, 0.6);  /* White background with slight transparency */
  display: flex;
  flex-direction: column;
  justify-content: center;  /* Keep the video centered */
  align-items: center;
  z-index: 25;  /* Bring the overlay on top of the video */
}

#rotateTitle {
  position: absolute;
  font-family: 'SansSerifBldFLF', sans-serif; 
  bottom: 80%;  /* Adjust as needed */
  left: 50%;
  transform: translateX(-50%);
  text-align: center;
  color: black;
  font-size: 2em; /* Make it larger */
}

#lottieContainer {
  width: 100%;
  height: 100%;
}


#rotateText {
  font-family: 'SansSerifFLF', sans-serif; 
  position: absolute;
  bottom: 70%;  /* Adjust as needed */
  left: 50%;
  transform: translateX(-50%);
  text-align: center;
  color: black;
  font-size: 1.5em; /* Make it larger */
}



.rotate-overlay video {
  position: absolute;  /* Absolute positioning */
  top: 50%;  /* Center vertically */
  left: 50%;  /* Center horizontally */
  transform: translate(-50%, -50%);  /* Necessary for exact centering */
  max-width: 90%;
  clip-path: inset(10px 0 0 0);  /* Crop 10px from the top */
}


@media only screen and (orientation: portrait) {
  /* Settings panel should be narrower on mobile portrait */
  .settings-panel {
    width: 100%;
    right: -100%;
  }
  
  .settings-panel.active {
    right: 0;
  }
}

#installButton {
  font-family: 'SansSerifFLF', sans-serif;
  display: none; /* Hidden by default */
  position: fixed; /* Fixed position */
  z-index: 1000; /* Make it stay on top */
  right: 20px; /* Position from the right */
  background-color: #008CBA; /* Blue background */
  color: white; /* White text */
  border: none; /* No border */
  padding: 12px 24px; /* Some padding */
  font-size: 16px; /* Text size */
  cursor: pointer; /* Pointer/hand icon */
  border-radius: 12px; /* Rounded corners */
}

#installButton:hover {
  background-color: #005b8a; /* Darken background on hover */
}



@media only screen and (orientation: landscape) {
body {
  display: flex;
  justify-content: center;
  align-items: center;
  height: 100vh;
  margin: 0;
  background-color: #eee;
  overflow: hidden;  /* Disable scrolling */
  touch-action: manipulation;
}
}


#soccerField {
  width: 100vw;  /* Full viewport width */
  height: calc(100vw * 0.625);
  position: relative;
  background-color: #b8db80;
}

.row {
  position: absolute;
  width: 100%;
  border-top: 2px solid white;
}

.row1, .row5 {
  height: calc(25%);  /* 30% of parent height */
  background-color: #c1e091;
}

.row2, .row4 {
  height: calc(10%);  /* 10% of parent height */
  background-color: #a8ce6e;
}

.row3 {
  height: calc(50%);  /* 50% of parent height */
}

#centerLine {
  position: absolute;
  width: 2px;
  height: 100%;
  background-color: white;
  left: 50%;
}

#centerCircle {
  position: absolute;
  width: 17%;
  height: 28%;
  border: 2px solid white;
  border-radius: 50%;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
}
/* Add this to your existing styles.css file */

.verticalLine {
  position: absolute;
  width: 2px;
  height: 100%;
  background-color: white;
}

.row1 {
  top: 0;
}

.row2 {
  top: 25%;
}

.row3 {
  top: 35%;
}

.row4 {
  top: 65%;
}

.row5 {
  top: 75%;
}

.goalLine, .box {
  background-color: black;
  /* right: 100%;  Commenting this out */
  right: auto; /* New */
}


.goalLine {
  height: 1px;
  width: 100%;
}

.box {
  border: 1px solid black;
}

.dShape {
  border-top: 2px solid black;
  border-radius: 50% 50% 0 0;
}
.goalLine, .box, .dShape {
  z-index: 1;
}


.player, .ball, .opposingPlayer {
    position: absolute;
    cursor: grab;
    height: 5vmin; /* Use vmin to make sure the aspect ratio stays the same */
    width: 5vmin;  /* Use vmin to make sure the aspect ratio stays the same */
    border-radius: 50%;
}

.player {
    background-color: #5252ff;
    /* Added a slight blue tint to the box shadow instead of pure white */
    box-shadow: 0 0 0 25px rgba(82, 82, 255, 0.05); 
    z-index: 10;
}

.opposingPlayer {
    background-color: #eaa72a;
    /* Added a slight yellow tint to the box shadow instead of pure white */
    box-shadow: 0 0 0 25px rgba(234, 167, 42, 0.20);
    z-index: 10;
}



.player-arrow {
    position: absolute;
    width: 0;
    height: 0;
    /* Adjust these values for size and shape */
    border-left: 1.2vmin solid transparent;
    border-right: 1.2vmin solid transparent;
    border-bottom: 3.9vmin solid rgba(255, 255, 255, 0.3);
    top: 26%;
    left: 26%;
    transform: translate(-1%, -1%) rotate(-180deg);  /* rotate as needed */
  transition: transform 0.1s ease-in-out; /* smooth transition */
  /* set initial transform origin to center of player */
  transform-origin: center center;
   pointer-events: none; /* This will prevent the triangle from receiving input events */
  }

.opposingPlayer-arrow {
  position: absolute;
  width: 0;
  height: 0;
  top: 26%;
  left: 26%;
  /* Adjust these values for size and shape */
    border-left: 1.2vmin solid transparent;
    border-right: 1.2vmin solid transparent;
    border-bottom: 3.9vmin solid rgba(0, 0, 0, 0.2); /* Different arrow color for opposing player */
    transform: translate(-1%, -1%) rotate(-180deg);  /* rotate as needed */
  transition: transform 0.1s ease-in-out; /* smooth transition */
  /* set initial transform origin to center of player */
  transform-origin: center center;
   pointer-events: none; /* This will prevent the triangle from receiving input events */
  z-index: 1; 
}


#fieldLogo {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-165%, -165%);
  scale: 0.3;
  filter: grayscale(100%);
  mix-blend-mode: color-burn; /* or another blend mode that you find suitable */
  opacity: 0.03; /* set to make it more like a watermark */
  z-index: 1; /* Make sure it's below the players but above the field background */
}


.player::before,
.opposingPlayer::before{
  content: "";
  position: absolute;
  top: -26px; /* Adjust as needed */
  left: -26px; /* Adjust as needed */
  right: -26px; /* Adjust as needed */
  bottom: -26px; /* Adjust as needed */
  z-index: -1;
  border-radius: 50%; /* Make it a circle */
}


.ball {
    z-index: 25;
    font-size: 48px;
    text-align: center;
    line-height: 48px; /* This should match the font size */
    width: 48px;
    height: 48px;
    opacity: 0.99;
    /* Add other styles if needed */
}


.ball::before {
  content: "";
  position: absolute;
  top: -5px; 
  left: -2px; 
  right: -2px;
  bottom: -0px;
  z-index: 1; /* Place it above the ball */
  border-radius: 50%; 
  background: hsl(var(--dynamic-hue, 0), 100%, 50%); /* Use the dynamic hue inside hsl() */
  opacity: 0.1; /* Make it transparent */
}



#lines {
    position: absolute;
    top: 0;
    left: 0;
    z-index: 2;
}  
  /* Positioning and style for the buttons */
button {
  position: absolute;
  z-index: 20; /* Higher than the soccer field elements */
  background: rgba(255, 255, 255, 0.8);
  border: none;
  padding: 8px;
  cursor: pointer;
  top: 10px;
}

/* Update toggle lines button positioning */
#toggleLines {
  right: 60px;
  top: 10px;
}



/* Disable text selection */
.noselect {
  -webkit-touch-callout: none;  /* iOS Safari */
    -webkit-user-select: none;  /* Safari */
     -khtml-user-select: none;  /* Konqueror HTML */
       -moz-user-select: none;  /* Firefox */
        -ms-user-select: none;  /* Internet Explorer/Edge */
            user-select: none;  /* Non-prefixed version, currently
                                  supported by Chrome, Edge, Opera and Firefox */
}

#removePlayer {
  background-color: #fafafa; /* Initial color */
  transition: background-color 0.1s; /* Optional: For smoother color transition */
  cursor: pointer;
}

.player-id, .opposingPlayer-id {
  position: absolute;
  top: 50%;
  left: 50%;
  font-size: 10px; /* Adjust as needed */
  transform: translate(-50%, -50%);
  z-index: 2;
  pointer-events: none;  
}

.player-id {
  color: whitesmoke; /* Color for blue team */
}

.opposingPlayer-id {
  color: black; /* Color for yellow team */
}

.goal-post {
  position: absolute;
  background-color: black;
  width: 5px;
  height: 10px;  /* This can be changed to use the calculated height based on fieldHeight */
  z-index: 1;
}

.left-goal-post-top, .left-goal-post-bottom {
  left: 0px;  /* Positioned at the left edge of the screen */
}

.right-goal-post-top, .right-goal-post-bottom {
  right: 0px;  /* Positioned at the right edge of the screen */
}

.left-goal-post-top, .right-goal-post-top {
  top: calc(50vh - 8vh);  /* Positioned a little above the vertical center of the screen */
}

.left-goal-post-bottom, .right-goal-post-bottom {
  bottom: calc(50vh - 8vh);  /* Positioned a little below the vertical center of the screen */
}

.slider-description {
  display: block;
  margin-top: 5px;
  font-size: 11px;
  color: #666;
  font-style: italic;
}

/* Settings panel styles */
.settings-panel {
  position: fixed;
  right: -350px;
  top: 0;
  width: 350px;
  height: 100vh;
  background-color: rgba(255, 255, 255, 0.95);
  box-shadow: -2px 0 10px rgba(0, 0, 0, 0.3);
  transition: right 0.3s ease;
  z-index: 100;
  overflow-y: auto;
  font-family: 'SansSerifFLF', sans-serif;
}

.settings-panel.active {
  right: 0;
}

.settings-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 20px;
  border-bottom: 1px solid #ddd;
  background-color: rgba(248, 248, 248, 0.9);
}

.settings-header h3 {
  margin: 0;
  font-size: 20px;
  color: #333;
}

.close-button {
  background: none;
  border: none;
  font-size: 24px;
  cursor: pointer;
  color: #666;
  padding: 0;
  width: 30px;
  height: 30px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: color 0.2s;
}

.close-button:hover {
  color: #000;
}

.settings-content {
  padding: 20px;
}

.setting-item {
  margin-bottom: 20px;
}

.setting-item label {
  display: block;
  margin-bottom: 5px;
  color: #333;
  font-size: 14px;
  cursor: pointer;
}

.setting-item input[type="checkbox"] {
  margin-right: 8px;
  cursor: pointer;
}

.setting-item input[type="range"] {
  width: 100%;
  margin-top: 5px;
  cursor: pointer;
}

.settings-separator {
  height: 1px;
  background-color: #ddd;
  margin: 25px 0;
}

.settings-content h4 {
  margin-top: 0;
  margin-bottom: 20px;
  color: #333;
  font-size: 16px;
}

#settingsButton {
  position: absolute;
  right: 10px;
  top: 10px;
  background: rgba(255, 255, 255, 0.8);
  border: none;
  padding: 8px;
  cursor: pointer;
  font-size: 20px;
  z-index: 20;
}

/* Button group styling for settings panel */
.button-group {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.settings-button {
  background: rgba(255, 255, 255, 0.9);
  border: 1px solid #ddd;
  padding: 10px 15px;
  cursor: pointer;
  border-radius: 5px;
  font-family: 'SansSerifFLF', sans-serif;
  font-size: 14px;
  transition: background-color 0.2s, border-color 0.2s;
  position: relative;
  z-index: auto;
}

.settings-button:hover {
  background: rgba(240, 240, 240, 0.9);
  border-color: #bbb;
}

.settings-button.remove-button {
  background-color: #fafafa;
  transition: background-color 0.1s;
}

/* Mobile-specific optimizations */
@media only screen and (max-width: 768px) {
  /* Smaller buttons on mobile */
  button {
    padding: 6px;
    font-size: 14px;
  }
  
  #settingsButton {
    font-size: 16px;
    padding: 6px;
  }
  
  /* Optimize player and ball sizes for mobile */
  .player, .opposingPlayer {
    height: 4vmin;
    width: 4vmin;
  }
  
  .ball {
    font-size: 32px;
    width: 32px;
    height: 32px;
    line-height: 32px;
  }
  
  /* Reduce shadow sizes on mobile for performance */
  .player {
    box-shadow: 0 0 0 15px rgba(82, 82, 255, 0.05);
  }
  
  .opposingPlayer {
    box-shadow: 0 0 0 15px rgba(234, 167, 42, 0.20);
  }
  
  /* Smaller arrows on mobile */
  .player-arrow, .opposingPlayer-arrow {
    border-left: 0.8vmin solid transparent;
    border-right: 0.8vmin solid transparent;
    border-bottom: 2.6vmin solid rgba(255, 255, 255, 0.3);
  }
  
  /* Optimize settings panel for mobile */
  .settings-content {
    padding: 15px;
  }
  
  .setting-item {
    margin-bottom: 15px;
  }
  
  .settings-button {
    padding: 8px 12px;
    font-size: 13px;
  }
  
  /* Smaller text for better fit */
  .player-id, .opposingPlayer-id {
    font-size: 8px;
  }
  
  /* Optimize sliders for mobile */
  .setting-item input[type="range"] {
    height: 30px;
  }
  
  .slider-description {
    font-size: 10px;
  }
}

/* Settings panel sliders */
.config-slider {
  width: 100%;
  margin-top: 5px;
}

/* Settings panel select dropdown */
.config-select {
  width: 100%;
  padding: 5px;
  margin-top: 5px;
  border: 1px solid #ddd;
  border-radius: 4px;
  background-color: white;
  font-size: 14px;
}

.slider-description {
  display: block;
  font-size: 12px;
  color: #666;
  margin-top: 5px;
  font-style: italic;
}




