* {
    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;
    padding: 20px;
}

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

header {
    text-align: center;
    color: white;
    margin-bottom: 30px;
}

h1 {
    font-size: 3em;
    margin-bottom: 10px;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.3);
}

.subtitle {
    font-size: 1.2em;
    opacity: 0.9;
}

.game-area {
    background: white;
    border-radius: 20px;
    padding: 40px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    margin-bottom: 20px;
}

.stats {
    display: flex;
    justify-content: space-around;
    margin-bottom: 30px;
    padding-bottom: 20px;
    border-bottom: 2px solid #f0f0f0;
}

.stat-item {
    text-align: center;
}

.stat-label {
    display: block;
    font-size: 0.9em;
    color: #666;
    margin-bottom: 5px;
}

.stat-value {
    display: block;
    font-size: 2em;
    font-weight: bold;
    color: #667eea;
}

.challenge-card {
    text-align: center;
    margin-bottom: 30px;
}

.instruction {
    font-size: 1.2em;
    color: #666;
    margin-bottom: 20px;
}

.target-key {
    font-size: 6em;
    font-weight: bold;
    color: #667eea;
    margin: 20px 0;
    font-family: 'Courier New', monospace;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.1);
}

.hint {
    min-height: 30px;
    font-size: 1.1em;
    color: #ff9800;
    font-weight: 500;
    margin-top: 10px;
}

.tries {
    min-height: 20px;
    font-size: 0.9em;
    color: #999;
    margin-top: 5px;
}

.input-area {
    margin-bottom: 20px;
}

.key-input {
    width: 100%;
    padding: 20px;
    font-size: 2em;
    text-align: center;
    border: 3px solid #e0e0e0;
    border-radius: 10px;
    outline: none;
    transition: all 0.3s;
    font-family: 'Courier New', monospace;
}

.key-input:focus {
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.feedback {
    min-height: 40px;
    text-align: center;
    font-size: 1.2em;
    font-weight: bold;
    transition: all 0.3s;
}

.feedback.correct {
    color: #4caf50;
    animation: pulse 0.5s;
}

.feedback.incorrect {
    color: #f44336;
    animation: shake 0.5s;
}

.controls {
    display: flex;
    flex-direction: column;
    gap: 15px;
    align-items: center;
}

.filter-option {
    background: white;
    padding: 15px 25px;
    border-radius: 10px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
}

.checkbox-label {
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    font-size: 1em;
    color: #333;
    user-select: none;
}

.checkbox-label input[type="checkbox"] {
    width: 20px;
    height: 20px;
    cursor: pointer;
    accent-color: #667eea;
}

.checkbox-label span {
    font-weight: 500;
}

.button-group {
    display: flex;
    gap: 10px;
    justify-content: center;
}

.btn {
    padding: 15px 30px;
    font-size: 1em;
    border: none;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.3s;
    font-weight: 600;
}

.btn-primary {
    background: #667eea;
    color: white;
}

.btn-primary:hover {
    background: #5568d3;
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(102, 126, 234, 0.4);
}

.btn-secondary {
    background: white;
    color: #667eea;
    border: 2px solid #667eea;
}

.btn-secondary:hover {
    background: #667eea;
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(102, 126, 234, 0.4);
}

.lookup-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    z-index: 1000;
    justify-content: center;
    align-items: center;
}

.lookup-modal.show {
    display: flex;
}

.lookup-content {
    background: white;
    border-radius: 20px;
    width: 90%;
    max-width: 600px;
    max-height: 80vh;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.lookup-header {
    padding: 20px;
    border-bottom: 2px solid #f0f0f0;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.lookup-header h2 {
    color: #667eea;
}

.close-btn {
    background: none;
    border: none;
    font-size: 2em;
    cursor: pointer;
    color: #999;
    transition: color 0.3s;
}

.close-btn:hover {
    color: #667eea;
}

.lookup-body {
    padding: 20px;
    overflow-y: auto;
}

.key-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 15px;
}

.key-item {
    background: #f8f9fa;
    padding: 15px;
    border-radius: 10px;
    text-align: center;
    border: 2px solid #e0e0e0;
    transition: all 0.3s;
}

.key-item:hover {
    border-color: #667eea;
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
}

.key-char {
    font-size: 2em;
    font-weight: bold;
    color: #667eea;
    font-family: 'Courier New', monospace;
    margin-bottom: 5px;
}

.key-name {
    font-size: 0.9em;
    color: #666;
    margin-bottom: 5px;
}

.key-combo {
    font-size: 0.75em;
    color: #999;
    font-family: 'Courier New', monospace;
    margin-top: 5px;
}

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

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-10px); }
    75% { transform: translateX(10px); }
}

@media (max-width: 600px) {
    h1 {
        font-size: 2em;
    }

    .game-area {
        padding: 20px;
    }

    .target-key {
        font-size: 4em;
    }

    .key-grid {
        grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    }
}
