/* Retro styling */
:root {
    --primary-color: #00ff00;
    --background-color: #000000;
    --text-color: #33ff33;
    --key-color: #1a1a1a;
    --key-active: #00ff00;
    --key-border: #33ff33;
    --error-color: #ff3333;
}

@font-face {
    font-family: 'VT323';
    src: url('https://fonts.googleapis.com/css2?family=VT323&display=swap');
}

body {
    background-color: var(--background-color);
    color: var(--text-color);
    font-family: 'VT323', monospace;
    margin: 0;
    padding: 20px;
    line-height: 1.6;
    text-shadow: 0 0 5px var(--text-color);
}

.container {
    max-width: 1000px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: 7fr 3fr;
    gap: 20px;
}

.retro-title {
    text-align: center;
    font-size: 3em;
    margin-bottom: 20px;
    animation: glitch 1s infinite;
    grid-column: 1 / -1;
}

.retro-subtitle {
    font-size: 1.5em;
    margin: 0;
    padding: 10px;
    text-align: center;
    border-bottom: 2px solid var(--text-color);
}

.score-container {
    display: flex;
    justify-content: space-around;
    margin-bottom: 20px;
    font-size: 1.5em;
    grid-column: 1 / -1;
}

.game-area {
    border: 2px solid var(--text-color);
    padding: 20px;
    margin-bottom: 20px;
    box-shadow: 0 0 10px var(--text-color);
    grid-column: 1 / 2;
}

.text-display {
    font-size: 1.2em;
    margin-bottom: 20px;
    min-height: 100px;
    white-space: pre-wrap;
}

.text-display .correct {
    color: var(--primary-color);
    background-color: rgba(0, 255, 0, 0.1);
}

.text-display .current {
    border-bottom: 2px solid var(--primary-color);
    animation: blink 1s infinite;
}

.text-display .error {
    color: var(--error-color);
    background-color: rgba(255, 0, 0, 0.1);
}

.user-input {
    background-color: transparent;
    border: 1px solid var(--text-color);
    color: var(--text-color);
    padding: 10px;
    font-size: 1.2em;
    outline: none;
    min-height: 50px;
}

.reactions-area {
    grid-column: 2 / 3;
    grid-row: 3 / 5;
    border: 2px solid var(--text-color);
    box-shadow: 0 0 10px var(--text-color);
    max-height: 400px;
    overflow-y: auto;
}

.reactions-container {
    padding: 10px;
}

.reaction-message {
    margin: 5px 0;
    padding: 8px;
    border: 1px solid var(--text-color);
    animation: fadeIn 0.3s ease-in;
}

.keyboard {
    display: grid;
    grid-template-rows: repeat(4, 1fr);
    gap: 5px;
    margin-top: 20px;
    grid-column: 1 / 2;
}

.keyboard-row {
    display: flex;
    justify-content: center;
    gap: 5px;
}

.key {
    background-color: var(--key-color);
    border: 1px solid var(--key-border);
    color: var(--text-color);
    padding: 10px;
    min-width: 30px;
    text-align: center;
    border-radius: 4px;
    cursor: default;
    transition: all 0.1s;
}

.key.active {
    background-color: var(--key-active);
    color: var(--background-color);
    transform: scale(0.95);
    box-shadow: 0 0 10px var(--key-active);
}

@keyframes glitch {
    0% { text-shadow: 2px 0 0 red, -2px 0 0 blue; }
    25% { text-shadow: -2px 0 0 red, 2px 0 0 blue; }
    50% { text-shadow: 2px 0 0 red, -2px 0 0 blue; }
    75% { text-shadow: -2px 0 0 red, 2px 0 0 blue; }
    100% { text-shadow: 2px 0 0 red, -2px 0 0 blue; }
}

@keyframes blink {
    0%, 100% { opacity: 1; }
    50% { opacity: 0; }
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

/* CRT effect */
.container::before {
    content: "";
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: repeating-linear-gradient(
        0deg,
        rgba(0, 0, 0, 0.15),
        rgba(0, 0, 0, 0.15) 1px,
        transparent 1px,
        transparent 2px
    );
    pointer-events: none;
    z-index: 1001;
}