/* Game UI Styles - Sheep Theme */
@import url('https://fonts.googleapis.com/css2?family=Fredoka:wght@400;600;700&display=swap');

  body{
      padding: 0;
      margin: 0;
  }
  ::-webkit-scrollbar {
    width: 10px;
    background: transparent;
    height: 7px;
  }
  
  /* Track */
  ::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.327);
    height: 7px;
    border-radius: 100px;
  }
  /* Handle */
  ::-webkit-scrollbar-thumb {
    background: #8ec3de;
    border-radius: 100px;
  }
  #full-area{
      width: 100%;
      height: 100vh;
      background: #000;
      position: absolute;
      overflow: hidden;
      user-select: none;
  }
        #game-area{
          position: absolute;
          width: 1180px;
          height: 720px;
          left:50%;
          top:50%;
          transform: translate(-50%,-50%) scale(1) !important;
        }

#gameContainer {
    width: 1280px;
    height: 720px;
    position: absolute;
    overflow: hidden;
    margin: 0 auto;
    left:50%;
    top:50%;
    transform: translate(-50%,-50%);
}

#renderCanvas {
    width: 100%;
    height: 100%;
    touch-action: none;
    display: block;
}


/* UI Containers */
.game-ui {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 2;
}

/* Game Title */
.game-title {
    position: absolute;
    top: 20px;
    left: 50%;
    transform: translateX(-50%);
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    pointer-events: auto;
    z-index: 20;
}

.game-logo {
    width: 200px;
    height: auto;
    margin-bottom: 5px;
}

.game-subtitle {
    font-size: 22px;
    font-weight: 600;
    color: #2c5f7a;
    text-shadow: none;
    margin-bottom: 8px;
    text-align: center;
}

/* Score Displays */
.score-container {
    position: absolute;
    top: 30px;
    left: 50%;
    transform: translateX(-50%);
    width: 420px;
    height: 90px;
    background: url('/media/games/sheep-squeeze/images/container.png') center center no-repeat;
    background-size: contain;
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    z-index: 5;
    pointer-events: none;
}

.score-container .ui-container {
    background: none;
    border: none;
    box-shadow: none;
    color: #fff;
    font-size: 26px;
    min-width: 0;
    padding: 10px 30px;
    text-align: center;
    font-weight: 700;
    pointer-events: auto;
}

.distance-display {
    position: static;
    font-size: 26px;
    font-weight: 700;
    color: #fff;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.3);
    padding: 10px 30px;
    min-width: 0;
    margin-top: 15px;
}

.pitch-display {
    position: static;
    font-size: 26px;
    padding: 10px 30px;
    min-width: 0;
}

/* Start Game Screen */
.start-screen {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    z-index: 30;
    pointer-events: auto;
}

.start-screen::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.65);
    z-index: 0;
}

.modal-image {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: url('/media/games/sheep-squeeze/images/modal.png') center center no-repeat;
    background-size: contain;
    width: 800px;
    height: 650px;
    z-index: 1;
    margin: auto;
    margin-top: 0px;
}

.start-container {
    background: none;
    border: none;
    box-shadow: none;
    padding: 40px 30px;
    width: 90%;
    margin-top: 260px;
    margin-left: 10px;
    max-width: 500px;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    z-index: 2;
}

.start-title {
    font-size: 48px;
    font-weight: 700;
    margin-bottom: 20px;
    color: #fff;
}

.start-instructions {
    font-size: 18px;
    font-weight: 600;
    letter-spacing: 1.4px;
    line-height: 1.6;
    margin-bottom: 5px;
    color: #fff;
    text-align: left;
}

.start-instructions p {
    margin-bottom: 10px;
    text-align: center;
    font-size: 22px;
    font-weight: 500;
    margin-top: 185px;

}

.instruction-row {
    display: flex;
    align-items: center;
    margin-bottom: 10px;
    background-color: rgba(75, 163, 91, 0);
    border-radius: 12px;
    padding: 0px;
    /* border-left: 4px solid #4BA35B; */
}

.instruction-icon {
    font-size: 36px;
    margin-right: 15px;
    background-color: white;
    width: 50px;
    height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    box-shadow: 0 2px 2px rgba(0,0,0,0.5);
    flex-shrink: 0;
}

.instruction-text {
    flex: 1;
    font-family: 'Fredoka', sans-serif;
    text-shadow: 1px 1px 2px rgba(0,0,0,0.5);
}

.instruction-text strong {
    color: #3C5A99;
}

.instruction-text .wider {
    letter-spacing: 3px;
    color: #E63946;
    font-weight: 700;
}

.instruction-text .taller {
    transform: scaleY(1.3);
    display: inline-block;
    color: #4BA35B;
    font-weight: 700;
}

.start-instructions ul {
    margin-left: 20px;
    margin-bottom: 15px;
}

.start-game-btn {
    background-color: #4BA35B;
    color: white;
    border: none;
    border-radius: 12px;
    padding: 8px 35px;
    font-size: 20px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    box-shadow: 0 6px 0 #2C7A3D;
    outline: none;
    letter-spacing: 0.5px;
    font-family: 'Fredoka', sans-serif;
}

.start-game-btn:hover {
    background-color: #5CB76C;
    transform: translateY(-2px);
    box-shadow: 0 8px 0 #2C7A3D;
}

.start-game-btn:active {
    transform: translateY(4px);
    box-shadow: 0 2px 0 #2C7A3D;
}

/* Game Over Modal */
.game-over-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.7);
    z-index: 25;
    pointer-events: auto;
    display: none;
    opacity: 0;
    transition: opacity 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

.game-over-overlay.active {
    opacity: 1;
}

.game-over-modal {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: none;
    z-index: 30;
    pointer-events: auto;
    opacity: 0;
    transform: scale(0.8);
    animation: none;
}

.game-over-modal.active {
    opacity: 1;
    animation: modalBounce 0.8s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
}

@keyframes modalBounce {
    0% {
        transform: scale(0.8);
        opacity: 0;
    }
    40% {
        transform: scale(1.05);
        opacity: 1;
    }
    60% {
        transform: scale(0.98);
    }
    80% {
        transform: scale(1.01);
    }
    100% {
        transform: scale(1);
        opacity: 1;
    }
}

.end-modal-image {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: url('/media/games/sheep-squeeze/images/modal.png') center center no-repeat;
    background-size: contain;
    width: 80vw;
    max-width: 800px;
    height: 50vw;
    max-height: 700px;
    margin: auto;
    padding: 60px 30px 40px 30px;
    box-sizing: border-box;
}

.game-over-title {
    font-size: 54px;
    font-weight: 700;
    margin-bottom: 30px;
    color: #E63946;
    text-shadow: 2px 2px 0px rgba(109, 24, 24, 0.767);
    letter-spacing: -1px;
    text-align: center;
    margin-top: 200px;
    margin-bottom: -5px;
        font-family: 'Fredoka', sans-serif;

}

.high-score {
    font-size: 32px;
    margin: 10px 0 20px;
    color: #FFD700;
    font-weight: 700;
    letter-spacing: 1px;
    background: none;
    padding: 0;
    width: auto;
    border-radius: 0;
    margin: 5px;
    text-align: center;
        font-family: 'Fredoka', sans-serif;
    text-shadow: 2px 2px 0px rgba(136, 128, 21, 0.767);
}

.game-over-score {
    font-size: 28px;
    font-weight: 600;
    color: #3C5A99;
    margin-bottom: 10px;
    text-align: center;
        font-family: 'Fredoka', sans-serif;
        text-shadow: 1px 1px 0px rgba(35, 92, 179, 0.767);


}

.play-again-btn, .share-btn {
    background-color: #4BA35B; 
    color: white;
    border: none;
    border-radius: 12px;
    padding: 8px 35px;
    font-size: 20px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    box-shadow: 0 6px 0 #2C7A3D; 
    outline: none;
    letter-spacing: 0.5px;
    font-family: 'Fredoka', sans-serif;
    margin: 10px 0 0 0;
    width: 80%;
    max-width: 350px;
    display: block;
}

.play-again-btn:hover, .share-btn:hover {
    background-color: #5CB76C;
    transform: translateY(-2px);
    box-shadow: 0 8px 0 #2C7A3D;
}

.play-again-btn:active, .share-btn:active {
    transform: translateY(4px);
    box-shadow: 0 2px 0 #2C7A3D;
}

/* Obstacle Hint */
.hint-container {
    position: absolute;
    top: 50%;
    opacity: 0.9;
    left: 50%;
    transform: translate(-50%, -50%);
    padding: 0;
    border-radius: 0;
    display: none;
    z-index: 1000;
    pointer-events: none;
    background: none !important;
    border: none !important;
}

.pitch-hint-image {
    width: 200px;
    height: auto;
    display: block;
    margin-top: -30vh; /* adjust this value */
}

/* Guidance Text */
.guidance-text {
    position: fixed;
    top: 25%;
    left: 50%;
    transform: translateX(-50%);
    font-size: clamp(40px, 8vw, 80px);
    font-weight: 900;
    font-family: 'Fredoka', sans-serif;
    color: #FFD700;
    text-shadow: 3px 3px 0px #CCAA00;
    z-index: 99999;
    pointer-events: none;
    display: none;
    animation: guidancePulse 0.6s ease-out;
    letter-spacing: 6px;
    white-space: nowrap;
    opacity: 1 !important;
    visibility: visible !important;
}

@keyframes guidancePulse {
    0% {
        opacity: 0;
        transform: translateX(-50%) scale(0.8);
    }
    50% {
        opacity: 1;
        transform: translateX(-50%) scale(1.1);
    }
    100% {
        opacity: 1;
        transform: translateX(-50%) scale(1);
    }
}

/* Remove old text-based hint styles */
.hint-highlight {
    color: #FFD700;
    font-weight: 700;
    text-shadow: 0 0 10px rgba(255, 215, 0, 0.5);
}

.new-high-score {
    font-size: 26px;
    font-weight: bold;
    color: #FFA500;
}

.start-high-score {
    font-size: 24px;
    margin: 10px 0;
    color: #FFD700;
    text-shadow: 1px 1px 31px rgba(0, 0, 0, 1);
    padding: 5px 15px;
    background-color: rgba(0, 0, 0, 0.3);
    border-radius: 10px;
    display: inline-block;
} 

.distance-container {
    position: absolute;
    top: 30px;
    left: 30px;
    width: 220px;
    height: 180px;
    font-size: 26px;
    background: url('/media/games/sheep-squeeze/images/container.png') center center no-repeat;
    background-size: contain;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 100;
    pointer-events: none;
    text-shadow: 1px 1px 3px rgba(0, 0, 0, 1);
    font-family: 'Fredoka', sans-serif;
}

.pitch-container {
    position: absolute;
    top: 30px;
    right: 30px;
    width: 220px;
    height: 180px;
    background: url('/media/games/sheep-squeeze/images/highscore.png') center center no-repeat;
    background-size: contain;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 100;
    pointer-events: none;
}

.speed-container {
    position: absolute;
    top: 30px;
    left: 50%;
    transform: translateX(-50%);
    width: 220px;
    height: 180px;
    background: url('/media/games/sheep-squeeze/images/container.png') center center no-repeat;
    background-size: contain;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 100;
    pointer-events: none;
    text-shadow: 1px 1px 3px rgba(0, 0, 0, 1);
    font-family: 'Fredoka', sans-serif;
}

.speed-container .ui-container {
    background: none !important;
    border: none !important;
    box-shadow: none !important;
    color: #fff !important;
    font-size: 26px !important;
    min-width: 0;
    padding: 0 20px;
    margin-top: 15px;
    text-align: center;
    font-weight: 700;
    pointer-events: auto;
    z-index: 101;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.3);
    font-family: 'Fredoka', sans-serif;
}

.pitch-container .ui-container {
    background: none !important;
    border: none !important;
    box-shadow: none !important;
    color: #fff !important;
    font-size: 26px !important;
    min-width: 0;
    padding: 0 20px;
    margin-top: 30px;
    text-align: center;
    font-weight: 700;
    pointer-events: auto;
    z-index: 101;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.3);
    font-family: 'Fredoka', sans-serif;
}

/* Hide distance and pitch containers when intro modal is visible */
#startScreen {
    display: flex;
}
#startScreen[style*="display: flex"] ~ .distance-container,
#startScreen[style*="display: flex"] ~ .pitch-container,
#startScreen[style*="display: flex"] ~ .speed-container {
    display: none !important;
}

/* Fallback: hide if .start-screen is visible (using .show class or display:flex) */
.start-screen[style*="display: flex"] ~ .distance-container,
.start-screen[style*="display: flex"] ~ .pitch-container,
.start-screen[style*="display: flex"] ~ .speed-container,
.start-screen[style*="display: block"] ~ .distance-container,
.start-screen[style*="display: block"] ~ .pitch-container,
.start-screen[style*="display: block"] ~ .speed-container {
    display: none !important;
}

.show-intro .distance-container,
.show-intro .pitch-container,
.show-intro .speed-container {
    display: none !important;
} 

#SOG-game-intro-video{
    margin-left: -50px !important;
}

 @media ( max-width : 600px ) {
    #gameContainer {
        width: 800px;
        height: 1180px;
        margin: 0;
        padding: 0;
        overflow: hidden;
    }
    
    .game-title {
        top: 18px;
        left: 50%;
        transform: translateX(-50%);
        width: 100vw;
        padding: 0;
        z-index: 1001;
        
    }
    .game-logo {
        width: 320px;
        margin-bottom: 2px;
        display: block;
    }
    .game-subtitle {
        font-size: 26px;
        color: #2c5f7a;
        text-shadow: none;
        margin-top: 235px;
        margin-bottom: 6px;
        display: block;
    }
    .distance-container, .pitch-container, .speed-container {
        width: 250px;
        height: 128px;
        top: 10px;
        font-size: 23px;
        background-size: 100% 100%;
        padding: 0;
        margin: 0;
        border-radius: 12px;
        align-items: center;
        justify-content: center;
    }
    .distance-container {
        left: 10px;
        right: auto;
    }
    .pitch-container {
        left: auto;
        right: 10px;
    }
    .speed-container {
        left: 50%;
        transform: translateX(-50%);
    }

    .distance-display, .pitch-container .ui-container, .speed-container .ui-container {
        font-size: 28px !important;
        padding: 5px 4px;
        margin: 0;
        min-width: 0;
        text-align: center;
    }
    #highScoreDisplay {
        margin-top:20px ;
        text-shadow: 1px 1px 3px rgba(0, 0, 0, 1);
    font-family: 'Fredoka', sans-serif;
    }
    .modal-image {
        width: 800px;
        height: 700px;
        background-size: 100% 100%;
        min-width: 0;
        min-height: 0;
        max-height: none;
        margin: 0 auto;
        padding: 0;
        border-radius: 18px;
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        position: relative;
        margin-top: 50px;
    }
    .start-container {
        margin-top: 0;
        padding: 0;
        /* max-width: 100vw; */
        width: 90%;
        display: flex;
        flex-direction: column;
        align-items: center;
    }
    .start-instructions {
        font-size: 12px;
        margin-bottom: 0;
        margin-top: 0;
        color: #fff;
        text-align: center;
        width: 80%;
    }
    .instruction-row {
        margin-bottom: 14px;
        gap: 8px;
        align-items: center;
        width: 115%;
        margin-left: -40px;
    }
    .instruction-icon {
        width: 46px;
        height: 46px;
        font-size: 25px;
        margin-right: 6px;
        background: #fff;
        color: #333;
    }
    .instruction-text {
        font-size: 20px;
        color: #fff;
        text-align: left;
        line-height: 1.3;
        background-color: #D7A260;
        border-radius: 5px;
        padding: 5px;

    }
    .instruction-text strong {
        color: #FFD700;
        font-weight: 700;
    }
    .instruction-text .wider {
        color: #E63946;
    }
    .instruction-text .taller {
        color: #4BA35B;
    }
    .start-game-btn, .play-again-btn, .share-btn {
        font-size: 30px;
        padding: 2px 0;
        width: 100%;
        max-width: 300px;
        margin: 12px 0 0 0;
        border-radius: 12px;
        box-shadow: 0 2px 0 #2C7A3D;
        background: #4BA35B;
        color: #fff;
        font-weight: 700;
        margin-top: 15px;
        letter-spacing: 1px;
    }
    .share-btn {
        margin-top:8px;
    }
    .game-over-modal {
        align-items: center;
        justify-content: center;
        padding-bottom: 0;
    }

    .game-over-modal .modal-image .game-over-title {
        margin-top: 220px;
    }
    .game-over-title {
        font-size: 38px;
        margin-top: 140px;
        margin-bottom: 8px;
        color: #FFD700;
        text-shadow: 0 2px 6px #0008;
    }
    .high-score, .game-over-score {
        font-size: 25px;
        margin: 4px 0;
        color: #fff;
        text-shadow: 0 2px 6px #0008;
    }
    .hint-container {
        scale: 0.7;
    }

    .score-container {
        display: none !important;
    }
}

/* Pause Modal Styles */
#pauseOverlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.85);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 10000;
    flex-direction: column;
    backdrop-filter: blur(5px);
}

.pause-content {
    background: linear-gradient(135deg, #87CEEB 0%, #98D8E8 50%, #B0E0E6 100%);
    padding: 50px 40px;
    border-radius: 25px;
    text-align: center;
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.4), inset 0 2px 0 rgba(255, 255, 255, 0.3);
    max-width: 450px;
    width: 90%;
    border: 3px solid #4BA35B;
    position: relative;
    overflow: hidden;
}

.sheep-decoration {
    position: absolute;
    top: -10px;
    right: -10px;
    font-size: 40px;
    opacity: 0.3;
    transform: rotate(15deg);
}

.pause-title {
    margin: 0 0 40px 0;
    color: #2C7A3D;
    font-family: 'Fredoka', sans-serif;
    font-size: 36px;
    font-weight: 700;
    text-shadow: 2px 2px 0px rgba(44, 122, 61, 0.3);
    letter-spacing: -1px;
}

.resume-button {
    background: linear-gradient(135deg, #4BA35B 0%, #5CB76C 100%);
    color: white;
    border: none;
    padding: 18px 35px;
    font-size: 20px;
    border-radius: 15px;
    cursor: pointer;
    font-family: 'Fredoka', sans-serif;
    font-weight: 700;
    transition: all 0.3s;
    box-shadow: 0 8px 0 #2C7A3D;
    letter-spacing: 0.5px;
    text-shadow: 1px 1px 0px rgba(0, 0, 0, 0.2);
}

.resume-button:hover {
    background: linear-gradient(135deg, #5CB76C 0%, #6BC77C 100%);
    transform: translateY(-2px);
    box-shadow: 0 10px 0 #2C7A3D;
}

.resume-button:active {
    transform: translateY(0);
    box-shadow: 0 8px 0 #2C7A3D;
}

/* ===== Pitch Bar (moved from JS buildPitchBarUI) ===== */
#sogPitchBar {
    position: absolute;
    left: 50%;
    bottom: calc(var(--pitchbar-bottom, 12px) + env(safe-area-inset-bottom));
    transform: translateX(-50%);
    z-index: 9999;
    display: flex;
    align-items: center;
    gap: clamp(8px, 2vw, 20px);
    background: rgba(0, 0, 0, 0.35);
    padding: clamp(8px, 1.4vh, 16px) clamp(12px, 3vw, 24px);
    border-radius: 16px;
    backdrop-filter: blur(3px);
    pointer-events: none;
}

#sogPitchBar .label {
    font: 700 clamp(12px, 2.6vw, 18px)/1.2 system-ui, -apple-system, Segoe UI, Roboto, Arial;
    color: #fff;
    letter-spacing: 0.6px;
    user-select: none;
    opacity: 0.95;
    white-space: nowrap;
}

#sogPitchBar .track {
    position: relative;
    width: clamp(180px, 70vw, 680px);
    height: clamp(28px, 6.2vw, 44px);
    background: rgba(255, 255, 255, 0.18);
    border-radius: 999px;
    overflow: visible;
}

#sogPitchBar .icon {
    position: absolute;
    top: 50%;
    width: clamp(28px, 6.5vw, 44px);
    height: clamp(28px, 6.5vw, 44px);
    line-height: 1;
    text-align: center;
    transform: translate(-50%, -50%);
    filter: drop-shadow(0 1px 1px rgba(0, 0, 0, 0.25));
}

#sogPitchBar .iconInner {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    background: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: clamp(16px, 5vw, 24px);
}

/* Snap positions */
#sogPitchBar .track.center .icon { left: 50%; transform: translate(-50%, -50%); }
#sogPitchBar .track.left .icon   { left: clamp(6px, 1.1vw, 10px); transform: translate(0, -50%); }
#sogPitchBar .track.right .icon  { left: calc(100% - clamp(6px, 1.1vw, 10px)); transform: translate(-100%, -50%); }

/* Small phones: hide labels to give the track space */
@media (max-width: 420px) {
    #sogPitchBar .label { display: none; }
    #sogPitchBar .track { width: clamp(220px, 82vw, 680px); }
}

/* ===== Guidance Text (moved from JS showGuidanceText inline styles) ===== */
.guidance-text-visible {
    position: fixed !important;
    top: 25% !important;
    left: 50% !important;
    transform: translateX(-50%) !important;
    font-size: clamp(40px, 8vw, 80px) !important;
    font-weight: 900 !important;
    font-family: 'Fredoka', sans-serif !important;
    color: #FFD700 !important;
    text-shadow: 3px 3px 0px #CCAA00 !important;
    z-index: 99999 !important;
    pointer-events: none !important;
    display: block !important;
    opacity: 1 !important;
    visibility: visible !important;
    letter-spacing: 6px !important;
    white-space: nowrap !important;
}