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

body {
    background-color: #050505;
    color: #ffffff;
    font-family: monospace;
    display: flex;
    justify-content: center;
    min-height: 100vh;
    padding: 20px;
}

.app-container {
    max-width: 1000px;
    width: 100%;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

header h1 {
    color: #fff;
    text-align: center;
    text-transform: uppercase;
    letter-spacing: 2px;
    text-shadow: 0 0 15px rgba(255, 255, 255, 0.4);
}

.controls {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    justify-content: center;
    background: #111111;
    padding: 20px;
    border-radius: 8px;
    border: 1px solid #333333;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.5);
}

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

button,
input,
select {
    background: #222222;
    color: #ffffff;
    border: 1px solid #444444;
    padding: 8px 12px;
    border-radius: 4px;
    font-family: inherit;
    cursor: pointer;
    transition: background-color 0.2s, border-color 0.2s;
    outline: none;
}

button:hover {
    background: #333333;
    border-color: #888888;
}

button:active {
    background: #111111;
}

input[type="number"] {
    width: 65px;
    text-align: center;
}

.matrix-wrapper {
    display: flex;
    justify-content: center;
    overflow: auto;
    padding: 30px;
    background: #0a0a0a;
    border-radius: 12px;
    border: 1px solid #222222;
    box-shadow: inset 0 0 30px rgba(0, 0, 0, 0.9);
}

.matrix {
    display: grid;
    gap: 6px;
    padding: 10px;
}

.led {
    width: 22px;
    height: 22px;
    background-color: #161616;
    border-radius: 50%;
    cursor: crosshair;
    transition: background-color 0.05s, box-shadow 0.05s;
    border: 1px solid #000000;
}

.led.active {
    background-color: #ffffff;
    box-shadow: 0 0 5px #ffffff, 0 0 10px #ffffff, 0 0 20px rgba(255, 255, 255, 0.6);
    border-color: #ffffff;
}

.anim-pulse .led.active {
    animation: pulse 1.2s infinite alternate ease-in-out;
}

.anim-flash .led.active {
    animation: flash 0.6s infinite alternate step-end;
}

@keyframes pulse {
    0% {
        opacity: 0.3;
        transform: scale(0.9);
    }

    100% {
        opacity: 1;
        transform: scale(1.1);
    }
}

@keyframes flash {

    0%,
    49% {
        opacity: 1;
        box-shadow: 0 0 5px #fff, 0 0 10px #fff;
    }

    50%,
    100% {
        opacity: 0.1;
        box-shadow: none;
    }
}

@media (max-width: 768px) {
    .led {
        width: 16px;
        height: 16px;
        gap: 4px;
    }
}

@media (max-width: 480px) {
    .led {
        width: 12px;
        height: 12px;
        gap: 3px;
    }

    .controls {
        flex-direction: column;
        align-items: center;
    }
}