html {
    background-color: #0f0f23;
}

body {
    font-family: 'Courier New', monospace;
    background: linear-gradient(135deg, #0f0f23, #1a1a2e);
    color: #00ff41;
    margin: 0;
    padding: 20px;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    flex: 1;
}

header {
    text-align: center;
    border: 2px solid #00ff41;
    padding: 20px;
    margin-bottom: 30px;
    background: rgba(0, 255, 65, 0.1);
}

header h1 {
    margin: 0;
    font-size: 2em;
    text-shadow: 0 0 10px #00ff41;
}

header h2 {
    margin: 10px 0 0 0;
    font-size: 1.2em;
    color: #ffff00;
    text-shadow: 0 0 5px #ffff00;
}

.progress-container {
    margin-top: 20px;
    padding: 20px;
    border: 2px solid #00ff41;
    background: rgba(0, 255, 65, 0.1);
    border-radius: 5px;
}

.progress-bar-container {
    width: 100%;
    height: 20px;
    background: rgba(0, 0, 0, 0.5);
    border: 2px solid #00ff41;
    border-radius: 10px;
    overflow: hidden;
    margin-bottom: 10px;
}

.progress-bar {
    height: 100%;
    background: linear-gradient(90deg, #00ff41, #ffff00);
    width: 0%;
    transition: width 0.3s ease;
    border-radius: 8px;
}

.progress-text {
    text-align: center;
    color: #00ff41;
    font-family: 'Courier New', monospace;
    font-size: 14px;
    margin-bottom: 10px;
}

.debug-info {
    border-top: 1px solid rgba(0, 255, 65, 0.3);
    padding-top: 15px;
    margin-top: 15px;
}

.debug-info div {
    color: #ffff00;
    font-family: 'Courier New', monospace;
    font-size: 12px;
    margin-bottom: 5px;
}

.solution-stats {
    font-family: 'Courier New', monospace;
    color: #00ff41;
}

.solution-stats h4 {
    color: #ffff00;
    margin-bottom: 10px;
    text-shadow: 0 0 5px #ffff00;
}

.solution-stats div {
    margin-bottom: 5px;
    font-size: 14px;
}

header {
    position: relative;
}

.setup-section {
    display: flex;
    gap: 30px;
    margin-bottom: 30px;
    flex-wrap: wrap;
}

.grid-setup, .hex-mapping {
    flex: 1;
    min-width: 300px;
    border: 1px solid #00ff41;
    padding: 20px;
    background: rgba(0, 0, 0, 0.3);
}

.grid-setup h3, .hex-mapping h3 {
    margin-top: 0;
    color: #ffff00;
    text-shadow: 0 0 5px #ffff00;
}

.mapping-instructions {
    font-size: 0.9em;
    margin-bottom: 15px;
    color: #ffff00;
}

.grid-setup label {
    display: block;
    margin: 15px 0 10px 0;
}

.button-group {
    display: flex;
    gap: 5px;
    flex-wrap: wrap;
    margin-bottom: 10px;
}

.option-btn {
    padding: 8px 12px;
    background: rgba(0, 255, 65, 0.1);
    color: #00ff41;
    border: 2px solid #00ff41;
    cursor: pointer;
    font-family: 'Courier New', monospace;
    font-size: 12px;
    transition: all 0.3s;
    min-width: 40px;
}

.option-btn:hover {
    background: rgba(0, 255, 65, 0.2);
    box-shadow: 0 0 5px #00ff41;
}

.option-btn.active {
    background: #00ff41;
    color: #000;
    font-weight: bold;
}

.generate-btn {
    width: 100%;
    padding: 12px;
    margin-top: 15px;
    background: #00ff41;
    color: #000;
    border: none;
    cursor: pointer;
    font-family: 'Courier New', monospace;
    font-weight: bold;
    transition: all 0.3s;
}

.generate-btn:hover {
    background: #ffff00;
    box-shadow: 0 0 10px #ffff00;
}

.hex-codes {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 5px;
    margin-bottom: 15px;
}

.hex-button {
    padding: 8px;
    background: rgba(0, 255, 65, 0.1);
    border: 2px solid #00ff41;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s;
    user-select: none;
}

.hex-button:hover {
    background: #00ff41;
    color: #000;
    box-shadow: 0 0 10px #00ff41;
}

.hex-button:active {
    transform: scale(0.95);
}

.clear-btn {
    width: 100%;
    padding: 10px;
    background: #ff6b6b;
    color: #fff;
    border: none;
    cursor: pointer;
    font-family: 'Courier New', monospace;
    font-weight: bold;
    transition: all 0.3s;
}

.clear-btn:hover {
    background: #ff5252;
    box-shadow: 0 0 10px #ff5252;
}

.grid-container {
    margin-bottom: 30px;
    text-align: center;
}

.grid-wrapper {
    display: flex;
    justify-content: center;
    margin: 20px 0;
}

.grid-with-labels {
    display: inline-block;
    background: rgba(0, 0, 0, 0.5);
    border: 2px solid #00ff41;
    padding: 20px;
}

.solution-grid-container {
    display: inline-block;
    background: rgba(0, 0, 0, 0.5);
    border: 2px solid #00ff41;
    padding: 20px;
}

.solution-grid-section {
    text-align: center;
    margin-bottom: 30px;
}

.grid {
    display: inline-grid;
    gap: 2px;
}

.grid-cell {
    width: 50px;
    height: 50px;
    background: #000;
    border: 2px solid #00ff41;
    color: #00ff41;
    text-align: center;
    font-size: 12px;
    font-family: 'Courier New', monospace;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s;
    user-select: none;
    position: relative;
    padding: 2px;
}

.grid-cell:hover {
    border-color: #ffff00;
    box-shadow: 0 0 5px #ffff00;
}

.grid-cell.filled {
    background: rgba(0, 255, 65, 0.2);
    font-weight: bold;
}

.hex-code {
    font-size: 11px;
    line-height: 1;
    margin-bottom: 2px;
}

.step-number {
    font-size: 10px;
    font-weight: bold;
    color: #000;
    background: rgba(255, 255, 0, 0.8);
    border-radius: 50%;
    width: 16px;
    height: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-top: 2px;
}

.daemon-setup {
    border: 1px solid #00ff41;
    padding: 20px;
    background: rgba(0, 0, 0, 0.3);
    margin-bottom: 30px;
}

.daemon-setup h3, .daemon-setup h4 {
    margin-top: 0;
    color: #ffff00;
    text-shadow: 0 0 5px #ffff00;
}

.daemon-size-selection {
    margin-bottom: 20px;
    padding-bottom: 20px;
    border-bottom: 1px solid rgba(0, 255, 65, 0.3);
}

.daemon-size-selection label {
    display: block;
    margin: 0 0 10px 0;
}

.daemon-container {
    border: 1px solid rgba(0, 255, 65, 0.5);
    padding: 15px;
    margin-bottom: 15px;
    background: rgba(0, 0, 0, 0.2);
    border-radius: 5px;
}

.daemon-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}

.daemon-title {
    color: #ffff00;
    font-weight: bold;
    margin: 0;
}

.daemon-clear-btn {
    padding: 5px 10px;
    background: #ff6b6b;
    color: #fff;
    border: none;
    cursor: pointer;
    font-family: 'Courier New', monospace;
    font-size: 10px;
    border-radius: 3px;
    transition: all 0.3s;
}

.daemon-clear-btn:hover {
    background: #ff5252;
    box-shadow: 0 0 5px #ff5252;
}

.daemon-sequence {
    display: flex;
    gap: 5px;
    flex-wrap: wrap;
}

.daemon-hex-input {
    width: 60px;
    height: 40px;
    background: #000;
    border: 2px solid #00ff41;
    color: #00ff41;
    text-align: center;
    font-family: 'Courier New', monospace;
    font-size: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s;
    user-select: none;
}

.daemon-hex-input:hover {
    border-color: #ffff00;
    box-shadow: 0 0 5px #ffff00;
}

.daemon-hex-input.filled {
    background: rgba(0, 255, 65, 0.2);
    font-weight: bold;
}

.daemon-hex-input.selected {
    border-color: #ffff00;
    background: rgba(255, 255, 0, 0.1);
    box-shadow: 0 0 10px #ffff00;
}

.daemon-hex-input.empty::after {
    content: '--';
    color: rgba(0, 255, 65, 0.5);
}

.solve-btn {
    width: 100%;
    padding: 15px;
    background: #ff6b00 !important;
    color: #fff;
    border: none;
    cursor: pointer;
    font-family: 'Courier New', monospace;
    font-weight: bold;
    font-size: 16px;
    transition: all 0.3s;
    margin-top: 20px;
}

.solve-btn:hover:not(:disabled) {
    background: #ff9500 !important;
    box-shadow: 0 0 10px #ff9500 !important;
}

.solve-btn:disabled {
    opacity: 0.7;
    cursor: not-allowed;
}

.solution {
    border: 2px solid #00ff41;
    padding: 20px;
    background: rgba(0, 255, 65, 0.1);
    margin-bottom: 30px;
}

.solution h3 {
    margin-top: 0;
    color: #ffff00;
    text-shadow: 0 0 5px #ffff00;
}

.solution-path {
    margin-bottom: 20px;
    font-family: 'Courier New', monospace;
}

.solution-step {
    padding: 5px 0;
    border-bottom: 1px solid rgba(0, 255, 65, 0.3);
}

.daemon-status {
    margin-top: 20px;
    margin-bottom: 20px;
}

.daemon-status h4 {
    color: #ffff00 !important;
    text-shadow: 0 0 5px #ffff00 !important;
}

.unlocked-daemon {
    color: #00ff41;
}

.locked-daemon {
    color: #ff6b6b;
}

.reset-btn {
    width: 100%;
    padding: 15px;
    background: #6b73ff;
    color: white;
    border: none;
    cursor: pointer;
    font-family: 'Courier New', monospace;
    font-size: 16px;
    font-weight: bold;
    transition: all 0.3s;
}

.reset-btn:hover {
    background: #8b93ff;
    box-shadow: 0 0 15px #6b73ff;
}

.footer {
    background: transparent;
    border-top: 2px solid #00ff41;
    padding: 20px 0;
    margin-top: 50px;
    text-align: center;
    position: relative;
    bottom: 0;
    width: 100%;
}

.footer-content {
    font-family: 'Courier New', monospace;
    color: #00ff41;
    font-size: 14px;
}

.footer-content a {
    color: #ffff00;
    text-decoration: none;
    font-weight: bold;
    transition: all 0.3s ease;
    text-shadow: 0 0 5px #ffff00;
}

.footer-content a:hover {
    color: #00ff41;
    text-shadow: 0 0 10px #00ff41;
    text-decoration: underline;
}

.grid-cell.display-solution-path {
    background: #00ff41 !important;
    color: #000 !important;
    font-weight: bold;
    border: 2px solid #ffff00 !important;
    box-shadow: 0 0 10px #00ff41 !important;
    margin: 0 !important;
}

.pagination-controls {
    margin-top: 15px;
    padding-top: 15px;
    border-top: 1px solid rgba(0, 255, 65, 0.3);
    text-align: center;
}

.pagination-btn {
    padding: 5px 10px;
    border: none;
    cursor: pointer;
    font-family: 'Courier New', monospace;
    font-size: 10px;
    border-radius: 3px;
    transition: all 0.3s;
    margin: 0 5px;
}

.pagination-btn:enabled {
    background: #00ff41;
    color: #000;
}

.pagination-btn:disabled {
    background: #666;
    color: #999;
    cursor: not-allowed;
}

.pagination-btn:enabled:hover {
    background: #ffff00;
    box-shadow: 0 0 5px #ffff00;
}

.pagination-info {
    color: #ffff00;
    font-family: 'Courier New', monospace;
    font-size: 12px;
    margin: 0 10px;
}

.alternatives-header {
    display: flex;
    align-items: center;
    gap: 10px;
}

.alternatives-toggle-btn {
    padding: 5px 10px;
    background: #00ff41;
    color: #000;
    border: none;
    cursor: pointer;
    font-family: 'Courier New', monospace;
    font-size: 12px;
    font-weight: bold;
    border-radius: 3px;
    transition: all 0.3s;
}

.alternatives-toggle-btn:hover {
    background: #ffff00;
}

.current-indicator {
    color: #ffff00 !important;
    text-shadow: 0 0 5px #ffff00 !important;
    font-weight: bold !important;
}

@media (max-width: 768px) {
    .setup-section {
        flex-direction: column;
    }
    
    .hex-codes {
        grid-template-columns: repeat(2, 1fr);
    }

    .button-group {
        justify-content: center;
    }
    
    .daemon-sequence {
        justify-content: center;
    }
    
    .daemon-hex-input {
        width: 50px;
        height: 35px;
        font-size: 10px;
    }
    
    .debug-toggle {
        position: static;
        text-align: center;
        margin-top: 10px;
    }
    
    .debug-toggle label {
        justify-content: center;
    }

    .footer {
        padding: 15px 0;
        margin-top: 30px;
    }
    
    .footer-content {
        font-size: 12px;
        padding: 0 10px;
    }
}