* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    color: #fff;
    padding: 1rem;
}

.game-container {
    width: 100%;
    max-width: 800px;
    position: relative;
}

header {
    text-align: center;
    margin-bottom: 2rem;
}

header h1 {
    font-size: 2.5rem;
    margin-bottom: 0.5rem;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.3);
}

header p {
    font-size: 1.1rem;
    opacity: 0.9;
}

.overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.9);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    animation: fadeIn 0.3s ease-in;
}

.overlay.hidden {
    display: none;
}

.overlay-content {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    padding: 2rem;
    border-radius: 1rem;
    max-width: 600px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 10px 40px rgba(0,0,0,0.5);
}

.overlay-content h2 {
    font-size: 2rem;
    margin-bottom: 1rem;
    text-align: center;
}

.overlay-content p {
    font-size: 1.1rem;
    margin-bottom: 1.5rem;
    text-align: center;
}

.difficulty-select {
    margin: 2rem 0;
}

.difficulty-select h3 {
    text-align: center;
    margin-bottom: 1rem;
}

.difficulty-btn {
    display: block;
    width: 100%;
    padding: 1rem;
    margin: 0.5rem 0;
    background: rgba(255, 255, 255, 0.1);
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 0.5rem;
    color: #fff;
    font-size: 1.1rem;
    cursor: pointer;
    transition: all 0.3s ease;
}

.difficulty-btn:hover {
    background: rgba(255, 255, 255, 0.2);
    border-color: rgba(255, 255, 255, 0.5);
    transform: translateY(-2px);
}

.instructions {
    background: rgba(0, 0, 0, 0.2);
    padding: 1.5rem;
    border-radius: 0.5rem;
    margin-top: 2rem;
}

.instructions h3 {
    margin-bottom: 1rem;
}

.instructions ul {
    list-style: none;
    padding-left: 0;
}

.instructions li {
    margin: 0.5rem 0;
    padding-left: 1.5rem;
    position: relative;
}

.stats {
    margin: 2rem 0;
}

.stat {
    display: flex;
    justify-content: space-between;
    margin: 1rem 0;
    padding: 0.5rem 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.2);
}

.stat-label {
    font-weight: bold;
}

.stat-value {
    font-size: 1.2rem;
}

.btn {
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: 0.5rem;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.3s ease;
    display: inline-block;
    text-decoration: none;
    text-align: center;
}

.btn-primary {
    background: #48bb78;
    color: #fff;
}

.btn-primary:hover {
    background: #38a169;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(72, 187, 120, 0.4);
}

.btn-secondary {
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
    border: 2px solid rgba(255, 255, 255, 0.3);
    margin-left: 1rem;
}

.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.2);
}

.btn-hint {
    background: #f6ad55;
    color: #000;
    width: 100%;
}

.btn-hint:hover {
    background: #ed8936;
    transform: translateY(-2px);
}

.btn-hint:disabled {
    background: #4a5568;
    color: #718096;
    cursor: not-allowed;
    transform: none;
}

#gameUI {
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    padding: 2rem;
    border-radius: 1rem;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
}

#gameUI.hidden {
    display: none;
}

.game-stats {
    display: flex;
    justify-content: space-around;
    gap: 1rem;
    margin-bottom: 2rem;
    flex-wrap: wrap;
}

.stat-box {
    background: rgba(0, 0, 0, 0.2);
    padding: 1rem;
    border-radius: 0.5rem;
    text-align: center;
    flex: 1;
    min-width: 120px;
}

.stat-box .label {
    display: block;
    font-size: 0.9rem;
    opacity: 0.8;
    margin-bottom: 0.5rem;
}

.stat-box span:last-child {
    font-size: 1.5rem;
    font-weight: bold;
}

.hints-container {
    background: rgba(0, 0, 0, 0.2);
    padding: 1.5rem;
    border-radius: 0.5rem;
    margin-bottom: 2rem;
}

.hints-container h3 {
    margin-bottom: 1rem;
}

#hintsList {
    min-height: 60px;
    margin-bottom: 1rem;
}

.hint-item {
    background: rgba(255, 255, 255, 0.1);
    padding: 0.75rem;
    border-radius: 0.5rem;
    margin: 0.5rem 0;
    border-left: 4px solid #f6ad55;
}

.input-container {
    display: flex;
    gap: 1rem;
    margin-bottom: 2rem;
}

#passwordInput {
    flex: 1;
    padding: 1rem;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 0.5rem;
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
    font-size: 1.2rem;
    text-align: center;
    letter-spacing: 0.5rem;
    text-transform: uppercase;
}

#passwordInput::placeholder {
    color: rgba(255, 255, 255, 0.5);
    letter-spacing: normal;
}

#passwordInput:focus {
    outline: none;
    border-color: #48bb78;
    background: rgba(255, 255, 255, 0.15);
}

.attempts-history {
    background: rgba(0, 0, 0, 0.2);
    padding: 1.5rem;
    border-radius: 0.5rem;
}

.attempts-history h3 {
    margin-bottom: 1rem;
}

#attemptsContainer {
    max-height: 300px;
    overflow-y: auto;
}

.attempt-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem;
    margin: 0.5rem 0;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 0.5rem;
}

.attempt-number {
    font-weight: bold;
    margin-right: 1rem;
}

.attempt-guess {
    display: flex;
    gap: 0.5rem;
    flex: 1;
    justify-content: center;
}

.char-box {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 0.25rem;
    font-weight: bold;
    font-size: 1.2rem;
    border: 2px solid rgba(255, 255, 255, 0.3);
}

.char-correct {
    background: #48bb78;
    border-color: #48bb78;
    animation: pop 0.3s ease;
}

.char-present {
    background: #f6ad55;
    border-color: #f6ad55;
    animation: pop 0.3s ease;
}

.char-absent {
    background: #4a5568;
    border-color: #4a5568;
}

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

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

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

    .overlay-content {
        padding: 1.5rem;
    }

    #gameUI {
        padding: 1rem;
    }

    .input-container {
        flex-direction: column;
    }

    .game-stats {
        flex-direction: column;
    }

    .btn-secondary {
        margin-left: 0;
        margin-top: 0.5rem;
        display: block;
    }
}

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

    .char-box {
        width: 30px;
        height: 30px;
        font-size: 1rem;
    }

    #passwordInput {
        letter-spacing: 0.3rem;
        font-size: 1rem;
    }
}
