@import url('https://fonts.googleapis.com/css2?family=Manrope:wght@400;700&display=swap');

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Manrope', Arial, sans-serif;
    overflow: hidden;
    background-color: #000;
    width: 100vw;
    height: 100vh;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
}

#game-container {
    position: relative;
    width: 100vw;
    height: 100vh;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
}

.screen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    color: white;
    background-color: rgba(0, 0, 0, 0.25);
    z-index: 200;
}

.modal {
    background: rgba(30, 30, 30, 0.6);
    border-radius: 18px;
    box-shadow: 0 8px 32px rgba(0,0,0,0.3);
    padding: 2.5rem 3.5rem;
    min-width: 320px;
    min-height: 220px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    max-width: 90vw;
    max-height: 80vh;
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 400;
}

.hidden {
    display: none !important;
}

h1 {
    font-size: 4rem;
    margin-bottom: 2rem;
    color: #fff;
    text-shadow: 0 0 10px rgba(255, 255, 255, 0.5);
}

h2 {
    font-size: 3rem;
    margin-bottom: 1.5rem;
    color: #fff;
}

button {
    padding: 1rem 2rem;
    font-size: 1.2rem;
    background-color: #4CAF50;
    color: white;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    transition: background-color 0.3s;
}

button:hover {
    background-color: #45a049;
}

#hud {
    position: absolute;
    top: 20px;
    right: 20px;
    color: white;
    font-size: 1.2rem;
    z-index: 100;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 10px;
}

#coins-display {
    display: flex;
    align-items: center;
    gap: 5px;
    font-size: 1.2rem;
}

.coin-icon {
    width: 24px;
    height: 24px;
    background: gold;
    border-radius: 50%;
    position: relative;
    box-shadow: 0 0 5px gold;
}

.coin-icon::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 8px;
    height: 8px;
    background: #ffd700;
    border-radius: 50%;
}

#score, #high-score, #final-score, #final-high-score {
    margin: 10px 0;
    font-size: 1.5rem;
}

#pause-button {
    margin-top: 10px;
    background-color: #f44336;
}

#pause-button:hover {
    background-color: #da190b;
}

#exit-button {
    margin-top: 12px;
    background-color: #f44336;
    color: white;
    border: none;
    border-radius: 5px;
    padding: 1rem 2rem;
    font-size: 1.2rem;
    cursor: pointer;
    transition: background-color 0.3s;
}

#exit-button:hover {
    background-color: #da190b;
}

.screen, .modal, #hud, button, h1, h2, #score, #high-score, #final-score, #final-high-score {
    font-family: 'Manrope', Arial, sans-serif;
}

/* Path Preview Styles */
#path-preview {
    position: absolute;
    width: 100%;
    height: 100%;
    top: 0;
    left: 0;
    z-index: -1;
    overflow: hidden;
}

.path-line {
    position: absolute;
    width: 100%;
    height: 2px;
    background: rgba(255, 255, 255, 0.2);
    animation: movePath 2s linear infinite;
}

.path-line:nth-child(1) {
    top: 30%;
    animation-delay: 0s;
}

.path-line:nth-child(2) {
    top: 50%;
    animation-delay: 0.6s;
}

.path-line:nth-child(3) {
    top: 70%;
    animation-delay: 1.2s;
}

.obstacle-preview {
    position: absolute;
    width: 16px;
    height: 16px;
    background: rgba(255, 0, 0, 0.3);
    border-radius: 50%;
    animation: moveObstacle 4s linear infinite;
    left: 0;
    transform: scaleX(-1); /* Make animals face the sheep */
}

.obstacle-preview::before {
    content: '';
    position: absolute;
    top: -2px;
    left: -2px;
    right: -2px;
    bottom: -2px;
    border-radius: 50%;
    background: transparent;
    border: 2px solid rgba(255, 0, 0, 0.2);
}

.coin-preview {
    position: absolute;
    width: 12px;
    height: 12px;
    background: gold;
    border-radius: 50%;
    animation: moveObstacle 3s linear infinite;
    left: 0;
    box-shadow: 0 0 5px gold;
}

.coin-preview::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 4px;
    height: 4px;
    background: #ffd700;
    border-radius: 50%;
}

.obstacle-1 {
    top: 30%;
    animation-delay: 0s;
}

.obstacle-2 {
    top: 50%;
    animation-delay: 2s;
}

.obstacle-3 {
    top: 70%;
    animation-delay: 4s;
}

.coin-1 {
    top: 30%;
    animation-delay: 1s;
}

.coin-2 {
    top: 50%;
    animation-delay: 3s;
}

.coin-3 {
    top: 70%;
    animation-delay: 5s;
}

@keyframes movePath {
    0% {
        transform: translateX(100%);
    }
    100% {
        transform: translateX(-100%);
    }
}

@keyframes moveObstacle {
    0% {
        transform: translateX(100%);
        opacity: 0;
    }
    20% {
        opacity: 1;
    }
    80% {
        opacity: 1;
    }
    100% {
        transform: translateX(-100%);
        opacity: 0;
    }
}

/* Adjust start screen modal to be more transparent */
#start-screen.modal {
    background: rgba(30, 30, 30, 0.5);
    backdrop-filter: blur(5px);
}

/* Character Selection Styles */
#character-selection {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    z-index: 1000;
    padding: 20px;
}

.character-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 20px;
    max-width: 800px;
    margin: 20px auto;
}

.character-card {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    padding: 20px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.character-card:hover {
    transform: translateY(-5px);
    background: rgba(255, 255, 255, 0.2);
}

.character-card.selected {
    background: rgba(255, 255, 255, 0.3);
    box-shadow: 0 0 20px rgba(255, 255, 255, 0.3);
}

.character-card.selected::after {
    content: '✓';
    position: absolute;
    top: 10px;
    right: 10px;
    color: limegreen;
    font-size: 1.2rem;
    font-weight: bold;
}

.character-preview {
    width: 100px;
    height: 100px;
    border-radius: 50%;
    margin: 0 auto 10px;
    transition: all 0.3s ease;
    background-size: 200% 200%;
}

.character-name {
    font-size: 1.2rem;
    margin-bottom: 5px;
    color: white;
}

.character-price {
    font-size: 1rem;
    color: gold;
}

#total-coins {
    position: fixed;
    top: 20px;
    left: 20px;
    color: gold;
    font-size: 1.5rem;
    display: flex;
    align-items: center;
    gap: 5px;
    z-index: 100;
}

#total-coins .coin-icon {
    width: 32px;
    height: 32px;
}

#total-coins .coin-icon::after {
    width: 12px;
    height: 12px;
}

@keyframes rainbow {
    0% {
        background-position: 0% 50%;
    }
    50% {
        background-position: 100% 50%;
    }
    100% {
        background-position: 0% 50%;
    }
}

@keyframes neon {
    0% {
        filter: hue-rotate(0deg);
    }
    100% {
        filter: hue-rotate(360deg);
    }
}

@keyframes galaxy {
    0% {
        background-position: 0% 50%;
    }
    50% {
        background-position: 100% 50%;
    }
    100% {
        background-position: 0% 50%;
    }
}

#pause-modal {
    z-index: 400;
    background: rgba(30,30,30,0.7);
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
} 