:root {
    --bg-color: #0f172a;
    --surface-color: #1e293b;
    --primary-color: #a855f7;
    --primary-hover: #9333ea;
    --highlight-color: #c084fc;
    --text-main: #f8fafc;
    --text-muted: #94a3b8;
    --success-color: #10b981;
    --error-color: #ef4444;
    --border-radius: 12px;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: 'Outfit', sans-serif;
    background-color: var(--bg-color);
    color: var(--text-main);
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    padding: 2rem;
}

.container {
    background: var(--surface-color);
    padding: 2rem;
    border-radius: var(--border-radius);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.4);
    max-width: 650px;
    width: 100%;
}

header {
    text-align: center;
    margin-bottom: 0.25rem;
}

h1 {
    font-size: 2rem;
    font-weight: 800;
    color: white;
    margin-bottom: 0.25rem;
}

p {
    color: var(--text-muted);
    font-size: 1.1rem;
}

.word-row {
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 0.75rem;
    padding: 0.5rem;
    background: rgba(255, 255, 255, 0.03);
    border-radius: 8px;
    transition: transform 0.2s;
}

.word-row:hover {
    transform: translateX(4px);
    background: rgba(255, 255, 255, 0.05);
}

.scrambled {
    font-size: 1rem;
    font-weight: 600;
    letter-spacing: 2px;
    width: 120px;
    text-align: right;
    margin-right: 1.5rem;
    color: #cbd5e1;
}

.inputs {
    display: flex;
    gap: 0.5rem;
}

.letter-input,
.mystery-letter-input {
    width: 38px;
    height: 44px;
    font-size: 1.25rem;
    font-weight: 800;
    text-align: center;
    text-transform: uppercase;
    background: #0f172a;
    border: 2px solid #334155;
    border-radius: 8px;
    color: var(--text-main);
    transition: all 0.2s;
    outline: none;
    font-family: 'Outfit', sans-serif;
}

.letter-input:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.2);
    transform: translateY(-2px);
}

.letter-input:read-only:not(.highlighted) {
    background: rgba(255, 255, 255, 0.05);
    color: #94a3b8;
    cursor: not-allowed;
    border-color: #334155;
}

.letter-input:read-only.highlighted {
    color: #94a3b8;
    cursor: not-allowed;
}

.highlighted {
    border-color: var(--highlight-color);
    background: rgba(192, 132, 252, 0.1);
    box-shadow: 0 0 10px rgba(192, 132, 252, 0.2);
}

.letter-input.highlighted:focus {
    border-color: var(--highlight-color);
    box-shadow: 0 0 0 3px rgba(192, 132, 252, 0.3);
}

.status-icon {
    width: 24px;
    height: 24px;
    margin-left: 0.75rem;
    display: flex;
    align-items: center;
    justify-content: center;
}

.status-icon.correct::before {
    content: '✓';
    color: var(--success-color);
    font-size: 1.25rem;
    font-weight: bold;
}

.status-icon.incorrect::before {
    content: '✗';
    color: var(--error-color);
    font-size: 1.25rem;
    font-weight: bold;
}

.mystery-word-section {
    padding-top: .5rem;
    border-top: 1px solid #334155;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.mystery-word-section h2 {
    font-size: 1.25rem;
    margin-bottom: 0.5rem;
    color: var(--highlight-color);
}

.mystery-inputs {
    display: flex;
    gap: 0.5rem;
    justify-content: center;
    align-items: center;
}

.mystery-letter-input {
    background: rgba(192, 132, 252, 0.15);
    border-color: var(--highlight-color);
    cursor: default;
}

.primary-btn {
    display: block;
    width: 100%;
    max-width: 250px;
    margin: 2rem auto 0;
    padding: 0.75rem 1.5rem;
    font-size: 1.1rem;
    font-weight: 600;
    color: white;
    background-color: var(--primary-color);
    border: none;
    border-radius: var(--border-radius);
    cursor: pointer;
    transition: all 0.3s;
    font-family: 'Outfit', sans-serif;
}

.primary-btn:hover {
    background-color: var(--primary-hover);
    transform: translateY(-2px);
    box-shadow: 0 10px 20px rgba(168, 85, 247, 0.3);
}

.primary-btn:active {
    transform: translateY(0);
}

#success-message {
    margin-top: 2rem;
    text-align: center;
    padding: 1rem;
    background: rgba(16, 185, 129, 0.1);
    border: 1px solid var(--success-color);
    border-radius: 8px;
    color: var(--success-color);
    font-size: 1.25rem;
    font-weight: 600;
    animation: fadeIn 0.5s ease;
}

#game-over-message {
    margin-top: 2rem;
    text-align: center;
    padding: 1rem;
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid var(--error-color);
    border-radius: 8px;
    color: var(--error-color);
    font-size: 1.25rem;
    font-weight: 600;
    animation: fadeIn 0.5s ease;
}

.attempts-container {
    text-align: center;
    margin-top: -1.5rem;
    font-size: 1.1rem;
    color: var(--text-muted);
}

#attempts-count {
    font-weight: 800;
    color: var(--error-color);
    font-size: 1.25rem;
}

.hidden {
    display: none !important;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@media (max-width: 768px) {
    body {
        padding: 0.25rem;
    }

    .container {
        padding: 0.5rem;
    }

    h1 {
        font-size: 1.5rem;
    }

    p {
        font-size: 0.95rem;
    }

    .word-row {
        flex-direction: column;
        align-items: center;
        padding: 0.3rem 0.1rem 0rem 0.1rem;
    }

    .scrambled {
        text-align: center;
        margin-right: 0;
        margin-bottom: 0.5rem;
        width: 100%;
        font-size: 0.9rem;
    }

    .inputs {
        justify-content: center;
        flex-wrap: wrap;
        gap: 0.35rem;
    }

    .mystery-inputs {
        flex-wrap: wrap;
        gap: 0.35rem;
    }

    .letter-input,
    .mystery-letter-input {
        width: 26px;
        height: 34px;
        font-size: 1rem;
    }

    .status-icon {
        margin-left: 0;
        margin-top: 0.5rem;
        width: 20px;
        height: 20px;
    }

    .primary-btn {
        padding: 0.6rem 1.2rem;
        font-size: 1rem;
    }
}