body {
    display: flex;
    justify-content: center;
    align-items: center;
    position: fixed; /* Prevents mobile scroll bounces during rapid tapping */
    top: 0; left: 0; right: 0; bottom: 0;
    padding: 0;
    margin: 0;
    background: radial-gradient(circle at top right, #047857, var(--background));
    overflow: hidden;
}

.game-container {
    width: 100%;
    max-width: 500px;
    height: 100%;
    display: flex;
    flex-direction: column;
    position: relative;
    background: rgba(0,0,0,0.2);
}

.game-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem 1rem;
    position: absolute;
    top: 1rem; left: 1rem; right: 1rem;
    z-index: 10;
    border-radius: var(--radius-full);
}

.btn-back {
    padding: 0.5rem 1rem;
    font-size: 0.9rem;
    background: rgba(255,255,255,0.1);
    border: none;
}

.stats {
    display: flex;
    gap: 1.5rem;
    font-weight: 700;
}

.lives { color: white; }
.score-display { color: var(--accent); }

.play-area {
    flex-grow: 1;
    position: relative;
    display: flex;
    justify-content: center;
    border-left: 2px dashed rgba(255,255,255,0.05);
    border-right: 2px dashed rgba(255,255,255,0.05);
    margin: 0 1rem;
    overflow: hidden; /* hides blocks that spawn above viewport */
}

.message-area {
    position: absolute;
    top: 50%;
    text-align: center;
    width: 100%;
    font-size: 2.5rem;
    color: white;
    font-weight: 800;
    z-index: 5;
    pointer-events: none;
    transition: opacity 0.5s;
    text-shadow: 0 4px 10px rgba(0,0,0,0.5);
}

.falling-block {
    position: absolute;
    top: -100px;
    width: 80px;
    height: 80px;
    background: var(--surface-glass);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border: 3px solid rgba(255,255,255,0.8);
    border-radius: var(--radius-md);
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 3rem;
    font-family: var(--font-kr);
    font-weight: 900;
    color: white;
    box-shadow: 0 10px 30px rgba(0,0,0,0.5);
}

@keyframes fall {
    0% { transform: translateY(-50px); }
    100% { transform: translateY(calc(100vh - 120px)); }
}

.buckets {
    height: 160px;
    display: flex;
    padding: 1.5rem 1rem;
    gap: 1.5rem;
    background: linear-gradient(to top, rgba(0,0,0,0.9), transparent);
    z-index: 10;
}

.btn-bucket {
    flex: 1;
    border-radius: var(--radius-lg);
    border: 2px solid rgba(255,255,255,0.2);
    font-family: var(--font-ui);
    color: white;
    font-weight: 700;
    font-size: 1.25rem;
    cursor: pointer;
    box-shadow: 0 8px 30px rgba(0,0,0,0.3);
    transition: all 0.1s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    outline: none;
    -webkit-tap-highlight-color: transparent;
}

.btn-bucket span {
    font-size: 2.5rem;
    margin-bottom: 0.25rem;
}

.btn-bucket small {
    font-size: 1rem;
    opacity: 0.8;
}

.consonant-bucket {
    background: var(--consonant-bg);
}

.vowel-bucket {
    background: var(--vowel-bg);
}

.btn-bucket:active {
    transform: scale(0.95) translateY(5px);
    border-color: white;
}

.game-over {
    position: absolute;
    top: 50%; left: 50%; transform: translate(-50%, -50%);
    width: 85%;
    text-align: center;
    padding: 3rem;
    z-index: 100;
}

.game-over.hidden { display: none; }
.game-over h2 { color: var(--error); font-size: 2.5rem; margin-bottom: 1rem; }
.game-over p { font-size: 1.5rem; }

/* Feedback texts */
.msg-correct { color: var(--success); }
.msg-incorrect { color: var(--error); }
