body {
    font-family: 'Arial', sans-serif;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    min-height: 100vh;
    margin: 0;
    background-color: #f0f8ff;
    padding: 20px 10px;
    box-sizing: border-box;
}

h1 {
    color: #0056b3;
    margin-bottom: 10px;
}

.instructions {
    background-color: #fff;
    border-radius: 10px;
    padding: 15px;
    margin-bottom: 20px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    max-width: 400px;
    text-align: center;
}

.instructions h3 {
    color: #0056b3;
    margin: 0 0 10px 0;
    font-size: 18px;
}

.instructions p {
    margin: 8px 0;
    color: #333;
    line-height: 1.4;
    font-size: 14px;
}

#game-container {
    padding: 20px;
    background-color: #fff;
    border-radius: 10px;
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
    max-width: 640px;
    margin: 0 auto;
    width: 100%;
    box-sizing: border-box;
}

.game-grid {
    display: grid;
    gap: 10px;
    justify-content: center;
}

.grid-cell {
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: clamp(24px, 3vw, 40px);
    cursor: pointer;
    border-radius: 8px;
    background-color: #eaf5ff;
    transition: background-color 0.2s;
    user-select: none;
    aspect-ratio: 1;
    box-sizing: border-box;
    border: 2px solid #d4eaff;
    line-height: 1;
    overflow: hidden;
}

.grid-cell:hover {
    background-color: #d4eaff;
}

.message-area {
    font-size: 24px;
    font-weight: bold;
    height: 40px;
    margin-top: 20px;
    color: #0056b3;
}

#start-button, .back-button {
    margin-top: 15px;
    padding: 12px 25px;
    font-size: 18px;
    border-radius: 8px;
    border: 2px solid #0056b3;
    cursor: pointer;
    background-color: #fff;
    color: #0056b3;
    font-weight: bold;
    text-decoration: none;
    transition: background-color 0.3s, color 0.3s;
}

#start-button:hover, .back-button:hover {
    background-color: #0056b3;
    color: #fff;
}
