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

body {
    font-family: 'Arial', sans-serif;
    background: linear-gradient(135deg, #1e3c72 0%, #2a5298 100%);
    color: white;
    overflow: hidden;
    height: 100vh;
}

#controls {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    background: rgba(0, 0, 0, 0.8);
    padding: 15px 20px;
    backdrop-filter: blur(10px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    display: flex;
    align-items: center;
    gap: 20px;
    flex-wrap: wrap;
}

#controls h1 {
    font-size: 1.5em;
    color: #64b5f6;
    margin-right: 20px;
}

.control-group {
    display: flex;
    align-items: center;
    gap: 8px;
}

.control-group label {
    font-size: 0.9em;
    color: #e3f2fd;
}

select, input[type="range"], button {
    padding: 5px 10px;
    border: none;
    border-radius: 4px;
    background: rgba(255, 255, 255, 0.1);
    color: white;
    font-size: 0.9em;
}

select:focus, button:focus {
    outline: 2px solid #64b5f6;
}

button {
    cursor: pointer;
    transition: background 0.2s;
}

button:hover {
    background: rgba(255, 255, 255, 0.2);
}

#matrixMode {
    background: linear-gradient(45deg, #00ff00, #008000);
    color: black;
    font-weight: bold;
    transition: all 0.3s ease;
}

#matrixMode:hover {
    background: linear-gradient(45deg, #00ff41, #00cc00);
    box-shadow: 0 0 15px rgba(0, 255, 0, 0.5);
}

input[type="range"] {
    width: 100px;
}

#characterCountValue {
    color: #64b5f6;
    font-weight: bold;
    min-width: 40px;
    text-align: center;
}

#stats {
    margin-left: auto;
    font-size: 0.9em;
    color: #b3e5fc;
}

#characterCanvas {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    cursor: crosshair;
}

#tooltip {
    position: fixed;
    background: rgba(0, 0, 0, 0.9);
    color: white;
    padding: 8px 12px;
    border-radius: 6px;
    font-size: 0.9em;
    pointer-events: none;
    z-index: 1001;
    opacity: 0;
    transition: opacity 0.2s;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

#tooltip.show {
    opacity: 1;
}

@media (max-width: 768px) {
    #controls {
        flex-direction: column;
        align-items: stretch;
        gap: 10px;
    }
    
    #controls h1 {
        margin-right: 0;
        text-align: center;
    }
    
    .control-group {
        justify-content: space-between;
    }
}