:root {
    --game-height: 80vh;
    --tile-fall-duration: 2s; /* Time it takes for a tile to fall */
}

body {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    margin: 0;
    background-color: #282c34;
    font-family: Arial, sans-serif;
}

#game-container {
    position: relative;
    width: 300px;
    height: var(--game-height);
    border: 5px solid #61dafb;
    background-color: #383c44;
    overflow: hidden; /* Important: keeps tiles within the boundary */
}

#target-line {
    position: absolute;
    bottom: 50px; /* Position above the very bottom */
    left: 0;
    width: 100%;
    height: 10px;
    background-color: #ff4500; /* Bright color for the target */
    z-index: 10;
}

#tile-area {
    position: relative;
    height: 100%;
}

/* * Tile Styling 
 */
.tile {
    position: absolute;
    top: 0; /* Start position at the top */
    width: 50px;
    height: 50px;
    background-color: #00ffaa;
    border: 2px solid #000;
    cursor: pointer;
    box-sizing: border-box;
    /* Initial state: start animation only when the class is added */
    transition: background-color 0.1s;
}

/* * CSS Keyframe Animation for Falling
 */
@keyframes fall {
    from {
        transform: translateY(0); /* Start at the top */
    }
    to {
        transform: translateY(calc(var(--game-height) - 50px)); /* End just above the bottom */
    }
}

.falling {
    animation: fall var(--tile-fall-duration) linear forwards;
}

/*
 * Status and Button Styling
 */
#status-display {
    position: absolute;
    top: 10px;
    left: 10px;
    color: white;
    z-index: 20;
}

#start-button {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    padding: 10px 20px;
    font-size: 1.2em;
    cursor: pointer;
    z-index: 30;
}