/* --- gamestyle.css --- */
body {
    display: flex;
    flex-direction: column;
    align-items: center;
    /* justify-content will be 'center' for loading, then switched by .loaded class */
    justify-content: center; /* Center loading screen vertically */
    min-height: 100vh;
    margin: 0;
    font-family: Arial, sans-serif;
    overflow-x: hidden;
    overflow-y: auto;
    padding: 20px; /* This padding is applied to the body */
    box-sizing: border-box;
    background-image: url('tacopino-bkg.png');
    background-repeat: repeat;
    background-color: white;
}

/* Class to reset body alignment after loading for game content */
body.loaded {
    justify-content: flex-start; /* Aligns game content to the top */
}

/* Loading Screen Styles */
#loading-screen {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: 100%; /* Takes width of padded body */
    /* height: 100%; If you want it to attempt to fill viewport with body padding,
                      but position:fixed below is better for true full screen */
    text-align: center;
    /* For a true full-screen overlay that ignores body padding: */
    /* position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background-color: rgba(255, 255, 255, 0.98); /* Or your page bg opaque */
    /* z-index: 9999;
    padding: 20px; /* Re-apply padding inside if needed */
    /* box-sizing: border-box; */
}

#loading-text {
    font-size: clamp(1.5rem, 5vw, 2.5rem);
    color: #333;
    margin-bottom: 20px;
    font-weight: bold;
}

#progress-bar-container {
    width: 80%;
    max-width: 400px;
    height: 30px;
    background-color: #e0e0e0;
    border: 1px solid #999;
    border-radius: 5px;
    margin-bottom: 10px;
    box-shadow: inset 0 1px 3px rgba(0,0,0,0.1);
}

#progress-bar {
    width: 0%;
    height: 100%;
    background-color: #4CAF50;
    border-radius: 4px;
    transition: width 0.2s ease-out;
}

#loading-percentage {
    font-size: clamp(1rem, 3vw, 1.5rem);
    color: #333;
    font-weight: bold;
}

/* Game Content Styles */
h1 {
    margin-top: 0; /* Body padding handles space above */
    margin-bottom: 15px;
    font-size: clamp(1.8rem, 6vw, 3rem);
    text-align: center;
    flex-shrink: 0;
    font-weight: 900;
}

h1 .headline-world {
    color: blue;
}

h1 .headline-taco-pino {
    color: red;
}

#game-info {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-around;
    align-items: center;
    width: 90%;
    max-width: 500px;
    margin-bottom: 20px;
    /* ADDED/MODIFIED: margin-left and margin-right auto for centering */
    margin-left: auto;
    margin-right: auto;
    gap: 10px;
    flex-shrink: 0;
}

#score-container,
#timer-container {
    font-size: clamp(1rem, 4vw, 1.6rem);
    padding: 5px 10px;
    background-color: #e0e0e0;
    border-radius: 5px;
    box-shadow: 1px 1px 3px rgba(0,0,0,0.1);
}

#gameCanvas {
    border: 2px solid #333;
    display: block;
    touch-action: none;
    box-shadow: 0 4px 8px rgba(0,0,0,0.2);
    max-width: 100%;
    /* Center the canvas if its max-width is less than container */
    margin-left: auto;
    margin-right: auto;
}

#bottom-controls {
    display: flex;
    justify-content: center; /* Centers buttons INSIDE this div */
    gap: 20px;
    margin-top: 20px;
    width: 90%;
    max-width: 500px;
    /* ADDED/MODIFIED: margin-left and margin-right auto for centering */
    margin-left: auto;
    margin-right: auto;
    flex-shrink: 0;
}

#bottom-controls button {
    padding: 10px 15px;
    font-size: clamp(0.9rem, 3.5vw, 1.2rem);
    border: 1px solid #555;
    border-radius: 5px;
    background-color: #e0e0e0;
    color: #333;
    cursor: pointer;
    box-shadow: 1px 1px 3px rgba(0,0,0,0.1);
    transition: background-color 0.2s ease-out;
}

#bottom-controls button:hover {
    background-color: #d0d0d0;
}

#bottom-controls button:active {
    background-color: #c0c0c0;
    box-shadow: inset 1px 1px 2px rgba(0,0,0,0.2);
}