/* ------------------------------
   Global
------------------------------ */
html, body {
    margin: 0;
    padding: 0;
    overflow: hidden;
    background: #222;
    font-family: Arial, sans-serif;
}

/* ------------------------------
   Canvas
------------------------------ */
#game_canvas {
    display: block;
    width: 100vw;
    height: 100vh;
    background-color: #00cc00;
}

/* ------------------------------
   Start Button
------------------------------ */
#start_btn {
    position: absolute;
    z-index: 10;
    bottom: 200px;
    left: 50%;
    width: 20%;
    transform: translateX(-50%);
    padding: 12px 24px;
    font-size: 18px;
    cursor: pointer;
    border-radius: 8px;
    border: none;
    background: #28a745;
    color: #fff;
    box-shadow: 0 3px 10px rgba(0,0,0,0.3);
    display: inline-flex;
    justify-content: center;
    align-items: center;
    
}

/* ------------------------------
   Game Over Backdrop
------------------------------ */
.gameover-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.65);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 20;
    padding: 20px;
}

/* ------------------------------
   Game Over Modal
------------------------------ */
.gameover-modal {
     position: relative;
    background: #fff;
    width: 100%;
    max-width: 380px;
    padding: 22px 20px;
    border-radius: 14px;
    box-shadow: 0 6px 20px rgba(0,0,0,0.35);
    text-align: center;
    animation: popup 0.25s ease-out;
}

@keyframes popup {
    from { transform: scale(0.85); opacity: 0; }
    to   { transform: scale(1); opacity: 1; }
}

.gameover-modal h2 {
    margin: 0 0 12px;
    font-size: 24px;
}

.gameover-modal p {
    margin: 6px 0 18px;
    font-size: 16px;
}

/* ------------------------------
   Form Inputs
------------------------------ */
.form-group {
    text-align: left;
    margin-bottom: 14px;
}

.form-group label {
    display: block;
    font-size: 14px;
    margin-bottom: 6px;
}

.form-group input {
    width: 100%;
    padding: 12px 10px;
    font-size: 16px;
    border-radius: 8px;
    border: 1px solid #ccc;
    box-sizing: border-box;
}

/* ------------------------------
   Buttons
------------------------------ */
.buttons {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-top: 18px;
}

.btn-primary,
.btn-secondary {
    width: 100%;
    padding: 12px 0;
    font-size: 17px;
    border-radius: 8px;
    border: none;
    cursor: pointer;
}

.btn-primary {
    background: #28a745;
    color: #fff;
}

.btn-secondary {
    background: #007bff;
    color: #fff;
}

.close-btn {
    position: absolute;
    top: 8px;
    right: 10px;
    background: transparent;
    border: none;
    font-size: 28px;
    cursor: pointer;
    color: #555;
    z-index: 9999;
}

.close-btn:hover {
    color: #000;
}

.tutorial-controls {
    position: absolute;
    bottom: 40px;
    left: 50%;
    transform: translateX(-50%);
    display: grid;
    grid-template-areas:
        ". up ."
        "left down right";
    gap: 10px;
    z-index: 9999;
}

.arrow {
    width: 55px;
    height: 55px;
    background: rgba(0,0,0,0.4);
    color: white;
    display: flex;
    justify-content: center;
    align-items: center;
    border-radius: 12px;
    font-size: 28px;
    transition: 0.15s;
}

.arrow.active {
    transform: scale(0.85);
    background: #4CAF50;
}

.up    { grid-area: up; }
.down  { grid-area: down; }
.left  { grid-area: left; }
.right { grid-area: right; }


/* ------------------------------
   Mobile Optimization
------------------------------ */
@media (max-width: 480px) {
    #start_btn {
        font-size: 16px;
        padding: 10px 20px;
    }

    .gameover-modal {
        padding: 18px 16px;
        border-radius: 12px;
    }

    .gameover-modal h2 {
        font-size: 20px;
    }

    .gameover-modal p {
        font-size: 15px;
    }

    .form-group input {
        padding: 10px;
        font-size: 15px;
    }

    .btn-primary,
    .btn-secondary {
        padding: 10px 0;
        font-size: 16px;
    }
}
