/* styles/main.css */
:root {
    --bg-color: #f0f8ff;
    --key-bg: #ffffff;
    --key-text: #333;
    --highlight-color: #ffeb3b;
    --pop-color: #ff9800;
    --success-color: #4caf50;
    --font-main: sans-serif;
}

body {
    margin: 0;
    padding: 0;
    font-family: var(--font-main);
    background-color: var(--bg-color);
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    overflow: hidden; /* Prevent scrolling when pressing space/arrows */
}

#game-container {
    width: 90%;
    max-width: 1000px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 20px;
}

header {
    width: 100%;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
}

h1 {
    font-size: 2rem;
    color: #333;
    margin: 0;
}

#controls {
    display: flex;
    gap: 10px;
    align-items: center;
}

button {
    padding: 10px 20px;
    font-size: 1rem;
    cursor: pointer;
    border: none;
    border-radius: 5px;
    background-color: #2196f3;
    color: white;
    font-weight: bold;
    box-shadow: 0 4px 0 #1976d2;
    transition: transform 0.1s;
}

button:active {
    transform: translateY(4px);
    box-shadow: none;
}

#reset-btn {
    background-color: #f44336;
    box-shadow: 0 4px 0 #d32f2f;
}

#score-board {
    font-size: 1.5rem;
    font-weight: bold;
    color: #ff9800;
    margin-right: 15px;
}

#score-board.hidden {
    display: none;
}

#display-area {
    height: 150px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    position: relative;
    width: 100%;
}

#bubble {
    width: 100px;
    height: 100px;
    border-radius: 50%;
    background-color: var(--pop-color);
    color: white;
    font-size: 3rem;
    display: flex;
    justify-content: center;
    align-items: center;
    box-shadow: 0 4px 8px rgba(0,0,0,0.2);
    animation: popIn 0.2s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    transition: background-color 0.3s;
}

#bubble.success {
    background-color: var(--success-color);
    transform: scale(1.2);
}

#bubble.hidden {
    display: none;
}

#message {
    font-size: 1.5rem;
    color: #666;
    margin-top: 10px;
    text-align: center;
    min-height: 1.8em; /* Prevent layout jump */
}

#keyboard-container {
    background: #ddd;
    padding: 20px;
    border-radius: 10px;
    box-shadow: 0 4px 0 #bbb;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.keyboard-row {
    display: flex;
    justify-content: center;
    gap: 10px;
}

.key {
    background: var(--key-bg);
    color: var(--key-text);
    border: 2px solid #ccc;
    border-radius: 5px;
    min-width: 40px;
    height: 50px;
    display: flex;
    justify-content: center;
    align-items: center;
    font-weight: bold;
    font-size: 1.2rem;
    box-shadow: 0 4px 0 #bbb;
    cursor: default;
    user-select: none;
    transition: transform 0.1s, box-shadow 0.1s, background-color 0.1s;
    padding: 0 10px;
}

.key.active {
    transform: translateY(4px);
    box-shadow: 0 0 0 #bbb;
    background-color: var(--highlight-color);
    border-color: #ffd600;
}

/* Hint animation for the key they need to find */
.key.hint {
    animation: pulse 1.5s infinite;
    border-color: var(--pop-color);
    background-color: #fff3e0;
}

.key.wide { min-width: 60px; }
.key.space { min-width: 200px; }

@keyframes popIn {
    0% { transform: scale(0); opacity: 0; }
    100% { transform: scale(1); opacity: 1; }
}

@keyframes pulse {
    0% { box-shadow: 0 0 0 0 rgba(255, 152, 0, 0.7); }
    70% { box-shadow: 0 0 0 10px rgba(255, 152, 0, 0); }
    100% { box-shadow: 0 0 0 0 rgba(255, 152, 0, 0); }
}