@import url('https://fonts.googleapis.com/css2?family=JetBrains+Mono:wght@400;600;700&display=swap');

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

body {
    font-family: 'JetBrains Mono', monospace;
    background: linear-gradient(135deg, #0a0a0a 0%, #1a1a1a 100%);
    color: #ffffff;
    min-height: 100vh;
    overflow-x: auto;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

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

header h1 {
    font-size: 2.5rem;
    font-weight: 700;
    color: #ff6666;
    text-shadow: 0 0 20px rgba(255, 102, 102, 0.5);
    margin-bottom: 10px;
}

header p {
    color: #cccccc;
    font-size: 1.1rem;
}

.display-container {
    position: relative;
    background: linear-gradient(145deg, #2a2a2a, #1a1a1a);
    border: 3px solid #444;
    border-radius: 15px;
    padding: 30px;
    margin-bottom: 30px;
    box-shadow: 
        0 10px 30px rgba(0, 0, 0, 0.5),
        inset 0 1px 3px rgba(255, 255, 255, 0.1);
    text-align: center;
}

#ledCanvas {
    background: #000000;
    border: 2px solid #333;
    border-radius: 8px;
    box-shadow: 
        inset 0 0 50px rgba(0, 0, 0, 0.8),
        0 0 20px rgba(255, 0, 0, 0.1);
    cursor: crosshair;
}

.power-indicator {
    position: absolute;
    top: 15px;
    right: 20px;
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.9rem;
    color: #ccc;
}

.power-indicator span:first-child {
    font-size: 1.2rem;
    color: #ff0000;
    animation: pulse 2s ease-in-out infinite;
}

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

.control-panel {
    background: linear-gradient(145deg, #2a2a2a, #1e1e1e);
    border: 2px solid #444;
    border-radius: 12px;
    padding: 25px;
    box-shadow: 
        0 8px 25px rgba(0, 0, 0, 0.4),
        inset 0 1px 2px rgba(255, 255, 255, 0.1);
}

.section {
    margin-bottom: 25px;
    padding: 20px;
    background: linear-gradient(145deg, #1e1e1e, #2a2a2a);
    border: 1px solid #333;
    border-radius: 8px;
    box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.3);
}

.section h3 {
    color: #ff9966;
    margin-bottom: 15px;
    font-size: 1.1rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.controls-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
}

.control-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.control-group label {
    color: #cccccc;
    font-size: 0.9rem;
    font-weight: 600;
}

#messageInput {
    width: 100%;
    min-height: 80px;
    background: #0a0a0a;
    border: 2px solid #333;
    border-radius: 6px;
    padding: 12px;
    color: #ffffff;
    font-family: 'JetBrains Mono', monospace;
    font-size: 1rem;
    resize: vertical;
    transition: border-color 0.3s ease;
}

#messageInput:focus {
    outline: none;
    border-color: #ff6666;
    box-shadow: 0 0 10px rgba(255, 102, 102, 0.3);
}

.char-counter {
    text-align: right;
    color: #888;
    font-size: 0.8rem;
    margin-top: 5px;
}

select, input[type="range"] {
    background: #0a0a0a;
    border: 2px solid #333;
    border-radius: 4px;
    padding: 8px;
    color: #ffffff;
    font-family: 'JetBrains Mono', monospace;
    transition: border-color 0.3s ease;
}

select:focus, input[type="range"]:focus {
    outline: none;
    border-color: #ff6666;
}

input[type="range"] {
    -webkit-appearance: none;
    height: 6px;
    background: #333;
    border-radius: 3px;
    padding: 0;
}

input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 18px;
    height: 18px;
    background: #ff6666;
    border-radius: 50%;
    cursor: pointer;
    transition: background 0.3s ease;
}

input[type="range"]::-webkit-slider-thumb:hover {
    background: #ff9999;
}

.pattern-buttons, .effect-buttons {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 10px;
}

.pattern-buttons button, .effect-buttons button {
    background: linear-gradient(145deg, #333, #222);
    border: 1px solid #444;
    border-radius: 6px;
    padding: 10px 15px;
    color: #ffffff;
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.85rem;
    cursor: pointer;
    transition: all 0.3s ease;
    white-space: nowrap;
}

.pattern-buttons button:hover, .effect-buttons button:hover {
    background: linear-gradient(145deg, #444, #333);
    border-color: #ff6666;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(255, 102, 102, 0.2);
}

.power-modes {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.radio-label {
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    padding: 8px;
    border-radius: 4px;
    transition: background 0.3s ease;
}

.radio-label:hover {
    background: rgba(255, 102, 102, 0.1);
}

.radio-label input[type="radio"] {
    accent-color: #ff6666;
}

.power-consumption {
    margin-top: 15px;
    padding: 10px;
    background: #1a1a1a;
    border: 1px solid #333;
    border-radius: 4px;
    font-size: 0.9rem;
}

.warning {
    color: #ff4444;
    font-weight: bold;
    animation: blink 1s ease-in-out infinite;
}

.warning.hidden {
    display: none;
}

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

footer {
    text-align: center;
    margin-top: 40px;
    padding: 20px;
    color: #888;
    font-size: 0.9rem;
    border-top: 1px solid #333;
}

footer a {
    color: #ff6666;
    text-decoration: none;
    transition: color 0.3s ease;
}

footer a:hover {
    color: #ff9999;
}

/* Responsive design */
@media (max-width: 768px) {
    .container {
        padding: 15px;
    }
    
    header h1 {
        font-size: 2rem;
    }
    
    .display-container {
        padding: 20px;
    }
    
    #ledCanvas {
        max-width: 100%;
        height: auto;
    }
    
    .controls-grid {
        grid-template-columns: 1fr;
    }
    
    .pattern-buttons, .effect-buttons {
        grid-template-columns: repeat(auto-fit, minmax(100px, 1fr));
    }
}

@media (max-width: 480px) {
    header h1 {
        font-size: 1.8rem;
    }
    
    .section {
        padding: 15px;
    }
    
    .pattern-buttons button, .effect-buttons button {
        font-size: 0.8rem;
        padding: 8px 12px;
    }
}

/* Add some retro scanlines effect */
.display-container::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: repeating-linear-gradient(
        0deg,
        transparent,
        transparent 2px,
        rgba(255, 255, 255, 0.02) 2px,
        rgba(255, 255, 255, 0.02) 4px
    );
    pointer-events: none;
    border-radius: 15px;
}

/* Add noise texture */
body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: 
        radial-gradient(circle at 1px 1px, rgba(255,255,255,0.05) 1px, transparent 0);
    background-size: 20px 20px;
    pointer-events: none;
    z-index: -1;
}