@import url('https://fonts.googleapis.com/css2?family=Pixelify+Sans:wght@400;500;600;700&display=swap');

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Pixelify Sans', cursive;
    background-color: #1a1a2e;
    color: #eee;
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    overflow: hidden;
}

.game-wrapper {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 20px;
    padding: 20px;
    width: 100%;
}

/* Game title */
.game-title {
    font-size: 22px;
    color: #ffffff;
    text-align: center;
    margin-bottom: 10px;
}

/* Controls above map */
.controls {
    display: flex;
    gap: 20px;
    align-items: center;
    flex-wrap: wrap;
    justify-content: center;
}

.control-group {
    display: flex;
    align-items: center;
    gap: 10px;
}

.control-group label {
    font-size: 18px;
}


input[type="text"],
select {
    font-family: 'Pixelify Sans', cursive;
    font-size: 16px;
    padding: 8px;
    background-color: #0f3460;
    color: #eee;
    border: 2px solid #16213e;
    outline: none;
}

input[type="text"]:focus,
select:focus {
    border-color: #0ea5e9;
}

button {
    font-family: 'Pixelify Sans', cursive;
    font-size: 18px;
    padding: 10px 20px;
    background-color: #0ea5e9;
    color: #fff;
    border: 2px solid #0284c7;
    cursor: pointer;
    text-transform: uppercase;
    transition: background-color 0.2s;
}

button:hover {
    background-color: #0284c7;
}

button:active {
    transform: scale(0.95);
}

/* Map container */
.map-container {
    position: relative;
    border: 4px solid #0ea5e9;
    background-color: #16213e;
    box-shadow: 0 0 20px rgba(14, 165, 233, 0.3);
    transition: width 0.5s ease, height 0.5s ease;
    width: 400px;
    height: 400px;
}

/* Instructions overlay */
.instructions {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    text-align: center;
    z-index: 10;
    background-color: rgba(22, 33, 62, 0.95);
    padding: 30px;
}

.instructions h2 {
    font-size: 22px;
    margin-bottom: 20px;
    color: #0ea5e9;
}

.instructions p {
    font-size: 16px;
    margin: 10px 0;
    line-height: 1.6;
    color: #eee;
}

.instructions.hidden {
    display: none;
}

/* Game canvas */
#gameCanvas {
    display: block;
    width: 100%;
    height: 100%;
    image-rendering: pixelated;
    image-rendering: crisp-edges;
}

/* Game over overlay */
.game-over {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background-color: rgba(22, 33, 62, 0.98);
    padding: 30px;
    border: 4px solid #0ea5e9;
    text-align: center;
    z-index: 20;
    max-width: 500px;
    display: none;
}

.game-over.show {
    display: block;
}

.game-over h2 {
    font-size: 24px;
    margin-bottom: 20px;
    color: #ef4444;
}

.game-over h3 {
    font-size: 20px;
    margin: 20px 0 10px;
    color: #0ea5e9;
}

.final-score {
    font-size: 18px;
    margin-bottom: 20px;
}

.leaderboard {
    margin: 20px 0;
}

.leaderboard table {
    width: 100%;
    border-collapse: collapse;
    font-size: 16px;
    margin: 10px 0;
}

.leaderboard th,
.leaderboard td {
    padding: 8px;
    border: 1px solid #0ea5e9;
    text-align: left;
}

.leaderboard th {
    background-color: #0f3460;
    color: #0ea5e9;
}

.leaderboard td {
    background-color: #16213e;
}

.leaderboard tr:nth-child(even) td {
    background-color: #1a1a2e;
}

/* Game info display */
.game-info {
    display: none;
    gap: 20px;
    font-size: 18px;
}

.game-info.show {
    display: flex;
}

.info-item {
    display: flex;
    gap: 5px;
}

/* Responsive adjustments */
@media (max-width: 600px) {
    .controls {
        flex-direction: column;
        gap: 10px;
    }
    
    .map-container {
        width: 350px;
        height: 350px;
    }
}

