/* Reset and Basic Styles */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    -webkit-tap-highlight-color: transparent; /* Prevent tap highlight */
}

body {
    background-color: #1e1e1e;
    color: #ffffff;
    font-family: 'Roboto', sans-serif;
    overflow-x: hidden; /* Prevent horizontal scrolling */
    -ms-touch-action: manipulation; /* Disable double-tap zoom for IE */
    touch-action: manipulation; /* Disable double-tap zoom */
}

h1 {
    font-size: 3em;
    margin-top: 20px;
    color: #28a745;
}

p {
    margin: 10px 0;
}

a {
    color: #00d1b2;
    text-decoration: none;
}

#game-container {
    margin: 0 auto;
    max-width: 1200px;
}

#mobile-message {
    display: none; /* Hidden by default */
    margin: 10px;
    font-size: 1em;
    color: #ffcc00;
}

#side-selection {
    margin-bottom: 20px;
}

#game-area {
    width: 100%;
    margin: 0 auto;
}

#canvas-container {
    position: relative;
    margin: 0 auto;
    width: 100%;
}

#game-canvas {
    border: 2px solid #28a745;
    background-color: #2e2e2e;
    width: 100%;
    height: auto;
    max-width: 400px; /* Set a maximum width for desktop */
}

#mobile-overlay {
    display: none; /* Hidden on desktop */
    position: absolute;
    top: 10px;
    left: 10px;
    color: #ffffff;
    text-shadow: 1px 1px 2px #000;
}

#mobile-overlay img {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: 2px solid #28a745;
}

#mobile-overlay p {
    font-size: 0.9em;
    margin: 5px 0;
}

#mobile-overlay #score-board-mobile {
    font-size: 1em;
    margin-top: 10px;
    color: #28a745;
}

#user-side-display {
    margin-top: 10px;
}

#user-side-display p {
    margin: 5px 0;
}

#controls-container {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    margin-top: 20px;
    width: 100%;
}

#controls-container .btn {
    flex: 1 1 auto;
    max-width: 80px;
}

#info-panel {
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 100%;
    margin-top: 20px;
}

#current-politician, #next-piece {
    margin: 10px 0;
    text-align: center;
    background-color: #2e2e2e;
    padding: 15px;
    border-radius: 10px;
    width: 100%;
}

#current-politician h5, #next-piece h5 {
    margin-bottom: 10px;
    color: #28a745;
}

#current-politician img, #next-politician-image {
    width: 80px;
    height: 80px;
    object-fit: cover;
    border-radius: 50%;
    border: 2px solid #28a745;
    margin-bottom: 10px;
}

#next-canvas {
    border: 1px solid #28a745;
    background-color: #1e1e1e;
    margin-bottom: 10px;
}

#score-board {
    margin-top: 20px;
    font-size: 1.5em;
    color: #28a745;
}

#announcement {
    margin-top: 20px;
    font-size: 1.2em;
    height: auto;
    color: #ffcc00;
    display: none;
}

#pause-button {
    margin-top: 20px;
    padding: 10px 20px;
}

#statistics {
    margin-top: 20px;
    text-align: left;
    background-color: #2e2e2e;
    padding: 15px;
    border-radius: 10px;
    width: 100%;
}

#statistics h5 {
    margin-bottom: 10px;
    color: #28a745;
    text-align: center;
}

#statistics p {
    margin: 5px 0;
    font-size: 0.9em;
}

#leaderboard {
    margin-top: 40px;
    color: #28a745;
}

#leaderboard h2 {
    margin-bottom: 20px;
}

#leaderboard-list {
    list-style-type: decimal;
    padding-left: 20px;
    text-align: left;
    display: inline-block;
    max-width: 300px;
}

#leaderboard-list li {
    margin: 5px 0;
    font-size: 1.2em;
}

/* Modal Styles */
.modal-content {
    background-color: #2e2e2e;
}

.modal-header, .modal-footer {
    border: none;
}

.modal-title {
    color: #28a745;
}

.btn-success {
    background-color: #28a745;
    border-color: #28a745;
}

.btn-success:hover {
    background-color: #218838;
    border-color: #1e7e34;
}

.alert-info {
    background-color: #17a2b8;
    color: #fff;
}

.alert-warning {
    background-color: #ffc107;
    color: #212529;
}

.card {
    background-color: #343a40;
}

.card-title {
    color: #28a745;
}

.btn-primary {
    background-color: #007bff;
    border-color: #007bff;
}

.btn-danger {
    background-color: #dc3545;
    border-color: #dc3545;
}

/* Responsive Design */
@media only screen and (max-width: 768px) {
    #game-area {
        flex-direction: column;
        align-items: center;
    }

    #info-panel {
        margin-top: 20px;
    }

    #controls-container {
        display: flex; /* Show controls on mobile */
    }

    #mobile-overlay {
        display: block; /* Show mobile overlay */
    }

    #mobile-message {
        display: block; /* Show mobile message */
    }

    #game-canvas {
        height: 60vh; /* Adjust height for visibility */
        max-width: 100%; /* Full width on mobile */
    }

    #user-side-display {
        font-size: 0.9em;
    }

    #score-board {
        font-size: 1.2em;
    }

    #announcement {
        font-size: 1em;
        margin: 10px;
    }

    #controls-container .btn {
        max-width: 60px;
        margin: 5px;
    }
}

/* Ensure canvas fits within the screen */
#canvas-container,
#game-canvas {
    max-height: calc(100vh - 200px); /* Adjusted to leave space for other elements */
}

/* Scrollbar Styling */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: #2e2e2e;
}

::-webkit-scrollbar-thumb {
    background: #00d1b2;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: #00a997;
}
