/* styles.css - Main stylesheet for Street Runner game */

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

body {
    overflow: hidden;
    font-family: Arial, sans-serif;
}

#game-container {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: #87CEEB;
}

#ui-container {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 10;
}

.game-screen {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: none;
}

/* Game UI layout */
#game-ui {
    box-sizing: border-box;
    padding: 10px !important;
}

/* Score container and pause button layout */
#score-container {
    display: flex;
    flex-wrap: nowrap;
    gap: 10px;
    background-color: rgba(0, 0, 0, 0.5);
    border-radius: 5px;
    padding: 10px;
    flex-grow: 1;
    margin-right: 10px;
}

#score-container > div {
    display: flex;
    min-width: 80px;
}

#pause-button {
    width: 40px;
    height: 40px;
    font-size: 1.5em;
    background-color: rgba(0, 0, 0, 0.5);
    color: white;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    pointer-events: auto;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 0;
    flex-shrink: 0;
}

/* Transparent Start Screen */
#start-screen {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    background-color: rgba(0, 0, 0, 0.5); /* Semi-transparent background */
    color: white;
    font-family: Arial, sans-serif;
    z-index: 100;
    pointer-events: auto;
}

.start-panel {
    background-color: rgba(0, 0, 0, 0.7);
    padding: 30px;
    border-radius: 15px;
    max-width: 500px;
    width: 80%;
    text-align: center;
    box-shadow: 0 0 20px rgba(0, 0, 0, 0.5);
}

#start-button {
    padding: 15px 30px;
    font-size: 1.5em;
    background-color: #4CAF50;
    color: white;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    transition: background-color 0.3s, transform 0.2s;
    margin-top: 20px;
}

#start-button:hover {
    background-color: #45a049;
    transform: scale(1.05);
}

#start-button:active {
    transform: scale(0.98);
}

.game-title {
    font-size: 3em;
    text-align: center;
    margin-bottom: 20px;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.5);
}

.game-description {
    font-size: 1.2em;
    text-align: center;
    margin-bottom: 20px;
}

.controls-info {
    text-align: center;
    margin-bottom: 20px;
    background-color: rgba(0, 0, 0, 0.5);
    padding: 15px;
    border-radius: 10px;
}

/* Control buttons styling */
.control-button {
    width: 70px;
    height: 70px;
    background-color: rgba(0, 0, 0, 0.4);
    color: white;
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 24px;
    user-select: none;
    touch-action: manipulation;
    pointer-events: auto;
}

.control-button:active {
    background-color: rgba(255, 255, 255, 0.8);
    color: black;
    transform: scale(0.95);
}

/* Settings button */
.settings-button {
    width: 40px !important;
    height: 40px !important;
    font-size: 18px !important;
    background-color: rgba(0, 0, 0, 0.6) !important;
    position: absolute;
    top: 10px;
    right: 10px;
    z-index: 1000;
    pointer-events: auto;
}

#tilt-toggle {
    background-color: #f44336;
}

#calibrate-button {
    background-color: #2196F3;
}

#tilt-permission-button {
    background-color: #4CAF50;
    display: none;
}

/* Vibe Jam link styling */
.vibe-jam-link {
    font-family: 'system-ui', sans-serif;
    position: fixed;
    bottom: -1px;
    right: -1px;
    padding: 7px;
    font-size: 14px;
    font-weight: bold;
    background: #fff;
    color: #000;
    text-decoration: none;
    border-top-left-radius: 12px;
    z-index: 10000;
    border: 1px solid #fff;
}

/* Mobile-specific adjustments */
@media (max-width: 768px) {
    #mobile-controls {
        display: flex;
    }
    
    .game-title {
        font-size: 2.2em;
    }
    
    .game-description, .controls-info {
        font-size: 0.9em;
    }
    
    #start-button {
        font-size: 1.2em;
        padding: 12px 24px;
    }
    
    .start-panel {
        width: 90%;
        padding: 20px;
    }
    
    #score-container {
        flex-wrap: wrap !important;
    }
    
    #score-container > div {
        min-width: calc(50% - 10px) !important;
        font-size: 0.9em !important;
    }
    
    #pause-button {
        width: 36px !important;
        height: 36px !important;
        font-size: 1.3em !important;
    }
    
    .vibe-jam-link {
        display: none !important;
    }
    
    /* Enhanced mobile-specific controls */
    .mobile-controls-info {
        display: block;
        margin-top: 10px;
        font-style: italic;
        font-size: 0.8em;
        color: #cccccc;
    }
}

/* Ensure the game UI stays at the top for landscape mode */
@media (max-height: 500px) and (orientation: landscape) {
    #game-ui {
        padding: 5px !important;
    }
    
    #score-container {
        padding: 5px !important;
    }
    
    #pause-button {
        width: 30px !important;
        height: 30px !important;
        font-size: 1.1em !important;
    }
    
    #mobile-controls {
        bottom: 5px !important;
    }
    
    .control-button {
        width: 50px !important;
        height: 50px !important;
    }
}

/* Animation for powerup notification */
@keyframes powerupPulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.2); }
    100% { transform: scale(1); }
}

#powerup-indicator {
    animation: powerupPulse 0.5s infinite;
}

/* Level up animation */
@keyframes levelUpFade {
    0% { opacity: 0; transform: translate(-50%, -50%) scale(0.5); }
    50% { opacity: 1; transform: translate(-50%, -50%) scale(1.2); }
    90% { opacity: 1; transform: translate(-50%, -50%) scale(1); }
    100% { opacity: 0; transform: translate(-50%, -50%) scale(1); }
}

.level-up-notification {
    animation: levelUpFade 2s forwards;
}

/* Toast notification for calibration */
.toast-notification {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background-color: rgba(0, 0, 0, 0.8);
    color: white;
    padding: 15px 20px;
    border-radius: 10px;
    font-family: Arial, sans-serif;
    font-size: 18px;
    z-index: 10000;
    animation: fadeInOut 2s forwards;
}

@keyframes fadeInOut {
    0% { opacity: 0; }
    20% { opacity: 1; }
    80% { opacity: 1; }
    100% { opacity: 0; }
}

/* Install button styling */
#install-button {
    position: fixed;
    bottom: 10px;
    left: 10px;
    padding: 10px 15px;
    background-color: #4CAF50;
    color: white;
    border: none;
    border-radius: 5px;
    z-index: 1000;
    cursor: pointer;
    font-size: 16px;
    font-weight: bold;
    box-shadow: 0 2px 5px rgba(0,0,0,0.3);
    display: none;
}

/* Portal Message Animation */
@keyframes portalMessage {
    0% { transform: translateX(-50%) translateY(0); }
    50% { transform: translateX(-50%) translateY(-5px); }
    100% { transform: translateX(-50%) translateY(0); }
}

/* Audio Controls Styling */
#start-audio-controls {
    display: flex;
    justify-content: center;
    gap: 10px;
    margin-bottom: 20px;
    margin-top: 15px;
}

.audio-toggle-button {
    padding: 10px 20px;
    font-size: 16px;
    color: white;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-weight: bold;
    transition: transform 0.1s, background-color 0.3s;
}

.audio-toggle-button:hover {
    transform: scale(1.05);
}

.audio-toggle-button:active {
    transform: scale(0.98);
}

/* Make sure pause screen controls aren't affected by any existing button styles */
#sound-toggle, #music-toggle {
    width: 100%;
    margin-bottom: 10px;
    font-size: 1.2em;
    padding: 15px 20px; 
    border-radius: 8px;
    cursor: pointer;
    display: block;
    text-align: center;
}

/* Mobile adjustments */
@media (max-width: 768px) {
    #start-audio-controls {
        flex-direction: column;
        align-items: center;
        gap: 8px;
    }
    
    .audio-toggle-button {
        padding: 8px 16px;
        font-size: 14px;
        min-width: 140px;
    }
    
    #sound-toggle, #music-toggle {
        padding: 12px 15px;
        font-size: 1.1em;
    }
}