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

body {
    margin: 0;
    overflow: hidden;
    background-color: #1a1a1a;
    font-family: 'Roboto', sans-serif;
    color: white;
    touch-action: none; /* Prevent mobile scrolling */
}

.screen {
    display: none;
    position: absolute;
    top: 0; left: 0; width: 100%; height: 100%;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    background: rgba(0,0,0,0.9);
    z-index: 10;
    text-align: center;
}

.screen.active { display: flex; }

h1 { font-family: 'Black Ops One', cursive; font-size: 3em; color: #ff4757; margin: 0; text-transform: uppercase; letter-spacing: 2px; }
h2 { color: #ffa502; margin-top: 0; }
p { color: #ccc; }

button {
    padding: 15px 30px;
    font-size: 1.2em;
    margin: 10px;
    border: none;
    border-radius: 50px;
    cursor: pointer;
    transition: transform 0.2s;
    font-weight: bold;
    text-transform: uppercase;
}
button:hover { transform: scale(1.05); }
button:active { transform: scale(0.95); }

.btn-green { background: #2ed573; color: #1e272e; }
.btn-yellow { background: #ffa502; color: #1e272e; }
.btn-red { background: #ff4757; color: white; }
.btn-demo { background: #535c68; color: white; border: 1px solid #7f8c8d; }

#stats {
    position: absolute;
    top: 20px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 15px;
    background: rgba(0,0,0,0.8);
    padding: 10px 20px;
    border-radius: 15px;
    border: 2px solid #555;
    z-index: 5;
    display: none; /* Hidden by default */
}

.stat-box { text-align: center; min-width: 80px; }
.stat-label { font-size: 0.8em; color: #aaa; text-transform: uppercase; }
.stat-value { font-size: 1.4em; font-weight: bold; color: #fff; font-family: 'Black Ops One', cursive; }

#progressBarContainer {
    position: absolute;
    bottom: 20px;
    left: 10%;
    width: 80%;
    height: 10px;
    background: #333;
    border-radius: 5px;
    overflow: hidden;
    z-index: 5;
    display: none;
}
#progressBarFill {
    height: 100%;
    width: 0%;
    background: linear-gradient(90deg, #ff4757, #2ed573);
    transition: width 0.2s;
}

.countdown { font-size: 8em; font-family: 'Black Ops One'; color: #2ed573; animation: pulse 1s infinite; }

@keyframes pulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.1); }
    100% { transform: scale(1); }
}

#gameCanvas {
    width: 100%;
    height: 100vh;
    display: block;
}

.status-msg { margin-top: 20px; padding: 10px; border-radius: 5px; }
.status-ok { background: rgba(46, 213, 115, 0.2); color: #2ed573; }
.status-err { background: rgba(255, 71, 87, 0.2); color: #ff4757; }

.leaderboard-card {
    background: rgba(255, 255, 255, 0.1);
    padding: 15px 20px;
    border-radius: 10px;
    max-height: 250px;
    overflow-y: auto;
    box-shadow: 0 0 10px rgba(0,0,0,0.5);
    margin: 0 auto;
    width: 260px;
}

.leaderboard-card ol {
    list-style: decimal inside;
    padding: 0;
    margin: 0;
    font-size: 1.1em;
}

.leaderboard-card li {
    padding: 5px 0;
    border-bottom: 1px solid rgba(255,255,255,0.2);
    color: #fff;
    font-weight: 500;
}

/* Highlight top 3 */
.leaderboard-card li:nth-child(1) { color: gold; font-weight: bold; }
.leaderboard-card li:nth-child(2) { color: silver; font-weight: bold; }
.leaderboard-card li:nth-child(3) { color: #cd7f32; font-weight: bold; }
