* {
    box-sizing: border-box;
}

html, body {
    margin: 0;
    padding: 0;
    font-family: Arial, Helvetica, sans-serif;
    background: #e7f4ff;
    color: #1c2a33;
}

body {
    min-height: 100vh;
}

/* sivun leveys */

.page {
    width: 100%;
    max-width: 1000px;
    margin: auto;
    padding: 15px;
}

/* otsikko */

.header {
    text-align: center;
    margin-bottom: 15px;
}

.header h1 {
    margin: 0;
}

/* paneelit */

.panel {
    background: white;
    border-radius: 10px;
    padding: 15px;
    margin-bottom: 15px;
}

/* aloitusruutu */

#startScreen {
    display: none;
}

#startScreen.active {
    display: block;
}

/* input */

input {
    padding: 10px;
    font-size: 16px;
    width: 220px;
}

/* napit */

button {
    padding: 10px 18px;
    font-size: 16px;
    border-radius: 6px;
    border: none;
    background: #1d7cff;
    color: white;
    cursor: pointer;
}

button:hover {
    background: #0e66e0;
}

/* pelialue */

.game-wrap {
    position: relative;
}

/* HUD */

.hud {
    display: flex;
    justify-content: space-between;
    margin-bottom: 6px;
    font-weight: bold;
}

/* canvas */

canvas {
    width: 100%;
    background: linear-gradient(#8fd0f5 60%, #d8c59d 60%);
    border-radius: 10px;
    display: block;
}

/* GAME OVER overlay */

.overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;

    background: rgba(0,0,0,0.45);

    display: flex;
    justify-content: center;
    align-items: center;

    border-radius: 10px;
}

/* PIILOTUS */

.overlay.hidden {
    display: none;
}

/* overlay box */

.overlay-box {
    background: white;
    padding: 25px;
    border-radius: 10px;
    text-align: center;
    min-width: 220px;
}

.overlay-box h2 {
    margin-top: 0;
}

/* TOP-lista */

#leaderboard table {
    width: 100%;
    border-collapse: collapse;
}

#leaderboard th,
#leaderboard td {
    padding: 6px;
    border-bottom: 1px solid #ddd;
}

/* mobiili */

@media (max-width:600px){

    .hud{
        font-size:14px;
    }

    input{
        width:100%;
    }

}
