/* On-screen keyboard styles */
.word-input-area {
    min-height: 60px;
    display: flex;
    align-items: center;
    justify-content: flex-start;
    margin-bottom: 1rem;
    gap: 1rem;
    width: 100%;
}

.current-word-display {
    font-size: 2rem;
    font-weight: 700;
    letter-spacing: 0.15em;
    text-transform: uppercase;
    color: #1e293b;
    min-height: 3rem;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0.5rem 1rem;
    border-radius: 0.5rem;
    background: #f8fafc;
    border: 2px solid #e2e8f0;
    min-width: 200px;
    flex: 1;
    width: 100%;
}

.current-word-display:empty::before {
    content: "Type a word...";
    color: #94a3b8;
    font-size: 1.25rem;
    font-weight: 400;
    letter-spacing: 0.02em;
    text-transform: none;
}

.current-word-display.empty-state-glow {
    border-color: #60a5fa;
    box-shadow: 0 0 15px rgba(96, 165, 250, 0.5);
    animation: input-glow 2s ease-in-out infinite;
}

@keyframes input-glow {
    0% {
        box-shadow: 0 0 5px rgba(96, 165, 250, 0.3);
        border-color: #93c5fd;
    }

    50% {
        box-shadow: 0 0 20px rgba(96, 165, 250, 0.6);
        border-color: #3b82f6;
    }

    100% {
        box-shadow: 0 0 5px rgba(96, 165, 250, 0.3);
        border-color: #93c5fd;
    }
}

.keyboard {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    width: 100%;
    margin: 0 auto;
    padding: 1rem 0;
}

.keyboard-row {
    display: flex;
    gap: 0.375rem;
    justify-content: stretch;
    width: 100%;
}

.key {
    flex: 1;
    min-width: 0;
    height: 58px;
    border-radius: 0.5rem;
    border: none;
    background: linear-gradient(to bottom, #f8fafc, #e2e8f0);
    box-shadow: 0 2px 0 #cbd5e1;
    color: #1e293b;
    font-size: 1.1rem;
    font-weight: 800;
    text-transform: uppercase;
    cursor: pointer;
    cursor: pointer;
    transition: transform 0.1s ease-out, background-color 0.1s;
    will-change: transform;
    user-select: none;
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
    position: relative;
    top: 0;
}

.key:hover {
    background: linear-gradient(to bottom, #ffffff, #f1f5f9);
    transform: translateY(-1px);
    box-shadow: 0 3px 0 #cbd5e1;
}

.key:active,
.key.active {
    background: #e2e8f0;
    transform: translateY(2px) scale(0.95);
    box-shadow: none;
}

.key:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

.key:disabled:hover {
    background: #e2e8f0;
    transform: none;
}

.key-wide {
    flex: 1.5;
    font-size: 0.85rem;
}

/* Responsive keyboard */
@media (max-width: 640px) {
    .key {
        min-width: 32px;
        height: 48px;
        font-size: 0.85rem;
    }

    .key-wide {
        min-width: 52px;
        font-size: 0.75rem;
    }

    .keyboard-row {
        gap: 0.25rem;
    }

    .current-word-display {
        font-size: 1.5rem;
        min-width: 150px;
    }

    .word-input-area {
        gap: 0.5rem;
    }
}

@media (max-width: 480px) {
    .key {
        min-width: 0;
        /* Allow keys to shrink to fit */
        height: 44px;
        font-size: 0.8rem;
        padding: 0;
        /* Remove padding to save space */
    }

    .key-wide {
        min-width: 40px;
    }

    .keyboard {
        padding: 0.25rem 0;
    }

    .keyboard-row {
        gap: 2px;
        /* Reduce gap */
    }
}

/* Flip mode controls in word input area */
.word-input-area .buy-clue-chip {
    cursor: pointer;
    border: none;
    transition: all 150ms ease;
}

.word-input-area .buy-clue-chip:hover {
    background: #a855f7;
    transform: translateY(-1px);
}

.word-input-area .buy-clue-chip:active {
    transform: translateY(0);
}

.word-input-area .buy-clue-chip:disabled {
    background: #e2e8f0;
    color: #94a3b8;
    cursor: not-allowed;
    opacity: 0.8;
}

.word-input-area .buy-clue-chip:disabled img {
    filter: grayscale(1);
    opacity: 0.6;
}

.word-input-area .flip-progress-points {
    flex-shrink: 0;
    margin-left: auto;
}