* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

body {
    background: linear-gradient(135deg, #1a2a6c, #b21f1f, #fdbb2d);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 20px;
    color: #fff;
}

.container {
    width: 100%;
    max-width: 900px;
    background: rgba(0, 0, 0, 0.7);
    border-radius: 20px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
    overflow: hidden;
    backdrop-filter: blur(10px);
}

header {
    background: rgba(0, 0, 0, 0.8);
    padding: 20px;
    text-align: center;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

h1 {
    font-size: 2.5rem;
    margin-bottom: 10px;
    background: linear-gradient(to right, #fdbb2d, #b21f1f);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.subtitle {
    color: #aaa;
    font-size: 1rem;
}

.app-body {
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.text-area-container {
    position: relative;
}

.text-area {
    width: 100%;
    height: 150px;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 10px;
    padding: 15px;
    font-size: 1.2rem;
    color: white;
    resize: none;
    outline: none;
    transition: all 0.3s;
}

.text-area:focus {
    border-color: #fdbb2d;
    box-shadow: 0 0 10px rgba(253, 187, 45, 0.5);
}

.word-count {
    position: absolute;
    bottom: 10px;
    right: 15px;
    color: #aaa;
    font-size: 0.9rem;
}

.controls {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
}

.theme-selector, .keyboard-layout {
    display: flex;
    gap: 10px;
    align-items: center;
}

select, button {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 5px;
    padding: 8px 15px;
    color: white;
    outline: none;
    cursor: pointer;
    transition: all 0.3s;
}

select:hover, button:hover {
    background: rgba(255, 255, 255, 0.2);
}

select:focus, button:focus {
    border-color: #fdbb2d;
}

button {
    display: flex;
    align-items: center;
    gap: 5px;
}

.keyboard-container {
    background: rgba(0, 0, 0, 0.5);
    border-radius: 10px;
    padding: 15px;
    margin-top: 10px;
}

.keyboard {
    display: flex;
    flex-direction: column;
    gap: 8px;
    user-select: none;
}

.keyboard-row {
    display: flex;
    justify-content: center;
    gap: 8px;
}

.key {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 5px;
    padding: 15px 10px;
    min-width: 50px;
    text-align: center;
    cursor: pointer;
    transition: all 0.1s;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    position: relative;
}

.key:hover {
    background: rgba(255, 255, 255, 0.2);
}

.key:active, .key.active {
    background: rgba(253, 187, 45, 0.3);
    transform: scale(0.95);
}

.key-wide {
    min-width: 80px;
}

.key-extra-wide {
    min-width: 120px;
}

.key-space {
    min-width: 300px;
}

.key-symbol {
    font-size: 0.8rem;
    color: #fdbb2d;
    margin-top: 3px;
}

.key-function {
    font-size: 0.9rem;
    color: #b21f1f;
}

.key-caps.active {
    background: rgba(253, 187, 45, 0.5);
}

.key-shift.active {
    background: rgba(178, 31, 31, 0.5);
}

.key-ctrl.active, .key-alt.active {
    background: rgba(26, 42, 108, 0.5);
}

footer {
    text-align: center;
    padding: 15px;
    color: #aaa;
    font-size: 0.9rem;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

@media (max-width: 768px) {
    .key {
        padding: 10px 5px;
        min-width: 30px;
        font-size: 0.9rem;
    }
    
    .key-wide {
        min-width: 60px;
    }
    
    .key-extra-wide {
        min-width: 90px;
    }
    
    .key-space {
        min-width: 200px;
    }
    
    .controls {
        flex-direction: column;
        align-items: flex-start;
    }
}

@media (max-width: 480px) {
    h1 {
        font-size: 1.8rem;
    }
    
    .key {
        padding: 8px 3px;
        min-width: 25px;
        font-size: 0.8rem;
    }
    
    .key-wide {
        min-width: 50px;
    }
    
    .key-extra-wide {
        min-width: 70px;
    }
    
    .key-space {
        min-width: 150px;
    }
}