/* Reset and base styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: var(--font-mono);
    background: linear-gradient(135deg, #1e1b4b 0%, #312e81 50%, #1e40af 100%);
    color: #f1f5f9;
    min-height: 100vh;
    line-height: 1.6;
}

.container {
    max-width: 800px;
    margin: 0 auto;
    padding: 20px;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* Header */
header {
    text-align: center;
    margin-bottom: 2rem;
    padding: 2rem 0;
}

header h1 {
    font-size: 3rem;
    font-weight: 600;
    color: #60a5fa;
    text-shadow: 0 0 20px rgba(96, 165, 250, 0.4);
    margin-bottom: 0.5rem;
}

.subtitle {
    font-size: 1.2rem;
    color: #cbd5e1;
    font-weight: 300;
}

/* Game Info */
.game-info {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(96, 165, 250, 0.3);
    border-radius: 12px;
    padding: 1rem 1.5rem;
    margin-bottom: 2rem;
    backdrop-filter: blur(10px);
}

.game-info .label {
    color: #cbd5e1;
    margin-right: 0.5rem;
}

.attempts,
.word-length {
    font-size: 1.1rem;
    font-weight: 500;
}

#attempts-count {
    color: #60a5fa;
}

#word-length {
    color: #c084fc;
}

/* Word Display */
.word-display {
    text-align: center;
    margin-bottom: 2rem;
}

.input-controls {
    display: flex;
    justify-content: center;
    gap: 1rem;
    margin-top: 1rem;
}

.input-controls button {
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: 8px;
    font-family: var(--font-mono);
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
}

#submit-guess {
    background: linear-gradient(135deg, #3b82f6 0%, #8b5cf6 100%);
    color: white;
}

#submit-guess:hover:not(:disabled) {
    background: linear-gradient(135deg, #2563eb 0%, #7c3aed 100%);
    transform: translateY(-2px);
}

#submit-guess:disabled {
    background: #6b7280;
    cursor: not-allowed;
    transform: none;
}

#clear-input {
    background: rgba(255, 255, 255, 0.1);
    color: #a8a8b3;
    border: 1px solid #374151;
}

#clear-input:hover:not(:disabled) {
    background: rgba(255, 255, 255, 0.2);
    border-color: #6b7280;
}

#clear-input:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    background: rgba(255, 255, 255, 0.05);
    border-color: #374151;
}

.input-feedback {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 0.5rem;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.name-hint {
    color: #cbd5e1;
    font-size: 0.9rem;
    font-style: italic;
    transition: all 0.3s ease;
    margin: 0;
}

.character-counter {
    color: #6b7280;
    font-size: 0.8rem;
    font-weight: 500;
}

.character-counter.warning {
    color: #fbbf24;
}

.character-counter.error {
    color: #f87171;
}

.character-counter.success {
    color: #10b981;
}

.name-hint.success {
    color: #10b981;
    font-weight: 500;
}

.name-hint.warning {
    color: #fbbf24;
    font-weight: 500;
}

.name-hint.error {
    color: #f87171;
    font-weight: 500;
}

#word-blanks {
    display: block;
    min-height: 4rem;
    padding: 1rem;
    border: 2px solid #475569;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.08);
    color: #f1f5f9;
    font-family: var(--font-mono);
    font-size: 2rem;
    font-weight: 600;
    text-align: center;
    line-height: 2rem;
    letter-spacing: 0.2em;
    outline: none;
    cursor: text;
    transition: all 0.3s ease;
    text-transform: uppercase;
    white-space: nowrap;
    overflow: hidden;
}

#word-blanks:focus {
    border-color: #60a5fa;
    box-shadow: 0 0 0 3px rgba(96, 165, 250, 0.2);
    background: rgba(96, 165, 250, 0.08);
}

#word-blanks.correct-length {
    border-color: #10b981;
    box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.2);
    background: rgba(16, 185, 129, 0.08);
}

#word-blanks.correct-length:focus {
    border-color: #10b981;
    box-shadow:
        0 0 0 3px rgba(16, 185, 129, 0.3),
        0 0 20px rgba(16, 185, 129, 0.1);
    background: rgba(16, 185, 129, 0.12);
}

#word-blanks:empty::before {
    content: "Click here to start typing...";
    color: #6b7280;
    font-style: italic;
    font-size: 1.2rem;
    font-weight: 400;
    letter-spacing: normal;
    text-transform: none;
}

#word-blanks[contenteditable="false"] {
    cursor: not-allowed !important;
    opacity: 0.6;
    background: rgba(255, 255, 255, 0.02);
    user-select: none;
}

#word-blanks[contenteditable="false"]:empty::before {
    content: "Game Over - Input Disabled";
    color: #64748b;
}

#word-blanks[contenteditable="false"]:focus {
    border-color: #475569;
    box-shadow: none;
    background: rgba(255, 255, 255, 0.02);
}

/* Letter blank styles are now handled by the main input styling */

@keyframes revealLetter {
    0% {
        transform: scale(0.8);
        opacity: 0;
    }
    50% {
        transform: scale(1.1);
    }
    100% {
        transform: scale(1);
        opacity: 1;
    }
}

/* Hints Section */
.hints-section {
    margin-bottom: 2rem;
}

.hints-section h3 {
    color: #60a5fa;
    margin-bottom: 1rem;
    font-size: 1.3rem;
}

#hints-container {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.hint {
    display: flex;
    align-items: center;
    padding: 1rem;
    border-radius: 8px;
    transition: all 0.3s ease;
}

.hint.locked {
    background: rgba(107, 114, 128, 0.1);
    border: 1px solid #374151;
}

.hint.unlocked {
    background: rgba(96, 165, 250, 0.12);
    border: 1px solid rgba(96, 165, 250, 0.3);
    animation: unlockHint 0.5s ease;
}

@keyframes unlockHint {
    0% {
        transform: translateX(-10px);
        opacity: 0;
    }
    100% {
        transform: translateX(0);
        opacity: 1;
    }
}

.hint-number {
    background: linear-gradient(135deg, #3b82f6 0%, #8b5cf6 100%);
    color: white;
    width: 2rem;
    height: 2rem;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    margin-right: 1rem;
    font-size: 0.9rem;
}

.hint.locked .hint-number {
    background: #6b7280;
}

.hint-text {
    flex: 1;
    font-weight: 400;
}

.hint.locked .hint-text {
    color: #6b7280;
    font-style: italic;
}

/* Input Section */
.input-section {
    margin-bottom: 2rem;
}

/* Previous Guesses */
.previous-guesses h4 {
    color: #a8a8b3;
    margin-bottom: 0.75rem;
    font-size: 1.1rem;
}

#guesses-list {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.guess-item {
    padding: 0.5rem 1rem;
    background: rgba(248, 113, 113, 0.12);
    border: 1px solid rgba(248, 113, 113, 0.3);
    border-radius: 6px;
    color: #fca5a5;
    font-size: 0.9rem;
}

.guess-item.correct {
    background: rgba(16, 185, 129, 0.15);
    border-color: rgba(16, 185, 129, 0.4);
    color: #6ee7b7;
}

/* Game Result */
.game-result {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    backdrop-filter: blur(5px);
}

.result-content {
    background: linear-gradient(135deg, #1e1b4b 0%, #312e81 100%);
    border: 2px solid #60a5fa;
    border-radius: 16px;
    padding: 2rem;
    text-align: center;
    max-width: 400px;
    width: 90%;
    animation: resultAppear 0.5s ease;
}

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

#result-title {
    font-size: 2rem;
    margin-bottom: 1rem;
}

#result-title.win {
    color: #10b981;
}

#result-title.lose {
    color: #f87171;
}

.result-word {
    font-size: 1.2rem;
    margin: 1.5rem 0;
    padding: 1rem;
    background: rgba(16, 185, 129, 0.15);
    border-radius: 8px;
}

#result-word-display {
    color: #10b981;
    font-weight: 600;
}

#play-again {
    padding: 1rem 2rem;
    background: linear-gradient(135deg, #3b82f6 0%, #8b5cf6 100%);
    color: white;
    border: none;
    border-radius: 8px;
    font-family: var(--font-mono);
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-top: 1rem;
}

#play-again:hover {
    background: linear-gradient(135deg, #2563eb 0%, #7c3aed 100%);
}

/* Footer */
footer {
    margin-top: auto;
    padding-top: 2rem;
}

.game-rules {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(96, 165, 250, 0.2);
    border-radius: 12px;
    padding: 1.5rem;
}

.game-rules h4 {
    color: #60a5fa;
    margin-bottom: 1rem;
    font-size: 1.1rem;
}

.game-rules ul {
    list-style: none;
    color: #cbd5e1;
}

.game-rules li {
    margin-bottom: 0.5rem;
    padding-left: 1.5rem;
    position: relative;
}

.game-rules li::before {
    content: "⚽";
    color: #60a5fa;
    position: absolute;
    left: 0;
    font-weight: bold;
}

/* Responsive Design */
@media (max-width: 768px) {
    .container {
        padding: 1rem;
    }

    header h1 {
        font-size: 2rem;
    }

    .game-info {
        flex-direction: column;
        gap: 1rem;
        text-align: center;
    }

    #word-blanks {
        font-size: 1.5rem;
        min-height: 3rem;
        padding: 0.75rem;
    }

    .input-feedback {
        flex-direction: column;
        align-items: center;
        text-align: center;
    }

    .input-controls {
        flex-direction: column;
        align-items: center;
    }

    .input-controls button {
        width: 100%;
        max-width: 200px;
    }

    .result-content {
        margin: 1rem;
        padding: 1.5rem;
    }
}

@media (max-width: 480px) {
    header h1 {
        font-size: 1.5rem;
    }

    #word-blanks {
        font-size: 1.2rem;
        min-height: 2.5rem;
        padding: 0.5rem;
        letter-spacing: 0.1em;
    }

    .hint {
        padding: 0.75rem;
    }

    .hint-number {
        width: 1.5rem;
        height: 1.5rem;
        font-size: 0.8rem;
    }
}
