/* ──────────────────────────────────────────
   Sentence Scramble — Styles
   ────────────────────────────────────────── */

body {
    display: flex;
    justify-content: center;
    align-items: center;
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    padding: 0;
    margin: 0;
    background: radial-gradient(circle at top right, #4c1d95 0%, #1e1b4b 60%, #0f172a 100%);
    overflow: hidden;
}

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

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

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

.stats {
    display: flex;
    font-weight: 700;
    font-size: 0.95rem;
    color: #fbbf24;
}

/* ── Prompt bar ── */
.prompt-bar {
    position: absolute;
    top: 4.5rem;
    left: 1.5rem; right: 1.5rem;
    z-index: 10;
    padding: 1rem 1.25rem;
    border-radius: var(--radius-md);
    text-align: center;
    background: rgba(30, 41, 59, 0.8);
    border: 1px solid rgba(255,255,255,0.15);
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.prompt-label {
    color: rgba(255,255,255,0.6);
    font-weight: 600;
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.prompt-en {
    color: white;
    font-size: 1.35rem;
    font-weight: 800;
}

/* ── Play area ── */
.play-area {
    flex-grow: 1;
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding-top: 11rem;
    padding-bottom: 2rem;
    width: 100%;
}

/* ── Answer Zone ── */
.answer-zone {
    width: 90%;
    min-height: 80px;
    padding: 1rem;
    border-bottom: 2px solid rgba(255,255,255,0.2);
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    justify-content: flex-start;
    align-content: flex-start;
    margin-bottom: 1.5rem;
}

/* ── Check Button ── */
.check-btn {
    width: 90%;
    font-size: 1.2rem;
    padding: 1rem;
    border-radius: var(--radius-full);
    margin-bottom: 2rem;
}

.check-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    background: var(--surface-glass);
    color: var(--text-muted);
}

/* ── Divider ── */
.divider {
    width: 100%;
    height: 1px;
    background: rgba(255,255,255,0.05);
    margin-bottom: 2rem;
}

/* ── Word Bank ── */
.word-bank {
    width: 90%;
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    justify-content: center;
}

/* ── Word Tile ── */
.word-tile {
    background: var(--surface-glass);
    border: 2px solid rgba(255,255,255,0.3);
    border-radius: var(--radius-md);
    padding: 0.6rem 1rem;
    font-size: 1.4rem;
    font-weight: 800;
    color: white;
    box-shadow: 0 4px 10px rgba(0,0,0,0.3);
    cursor: pointer;
    transition: all 0.15s ease;
    user-select: none;
    -webkit-tap-highlight-color: transparent;
    outline: none;
    font-family: var(--font-kr);
}

.word-tile:hover {
    border-color: #a855f7;
    background: rgba(168, 85, 247, 0.2);
    transform: translateY(-2px);
}

.word-tile:active {
    transform: scale(0.95);
}

.word-tile.in-answer {
    background: rgba(168, 85, 247, 0.8);
    border-color: white;
    box-shadow: 0 4px 15px rgba(168, 85, 247, 0.5);
}

.word-tile.hidden {
    opacity: 0;
    pointer-events: none;
}

/* ── Feedback Toast ── */
.feedback-toast {
    position: absolute;
    bottom: 2rem;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(16, 185, 129, 0.95);
    border: 1px solid rgba(255,255,255,0.2);
    border-radius: var(--radius-full);
    padding: 0.75rem 1.5rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-size: 1.1rem;
    font-weight: 700;
    color: white;
    box-shadow: 0 10px 25px rgba(0,0,0,0.4);
    z-index: 50;
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.feedback-toast.hidden {
    opacity: 0;
    transform: translate(-50%, 20px);
    pointer-events: none;
}

.feedback-toast.wrong {
    background: rgba(239, 68, 68, 0.95);
}

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

.game-over.hidden { display: none; }
.game-over h2 { color: #10b981; font-size: 2.25rem; margin-bottom: 0.75rem; }
.game-over p { font-size: 1.1rem; color: var(--text-muted); }
.completion-icon { font-size: 4rem; margin: 1rem 0; text-shadow: 0 4px 15px rgba(0,0,0,0.5); }

.mt-4 { margin-top: 1.5rem; }

/* ── Animations ── */
@keyframes shake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-5px); }
    75% { transform: translateX(5px); }
}

.animate-shake {
    animation: shake 0.4s ease;
}

/* ── Mobile tweaks ── */
@media (max-width: 500px) {
    .word-tile { font-size: 1.2rem; padding: 0.5rem 0.8rem; }
    .prompt-en { font-size: 1.15rem; }
    .answer-zone { min-height: 60px; padding: 0.75rem; }
}
