/* 128-bit Retro Styling */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    background: linear-gradient(45deg, #0a0a0a, #1a1a2e, #16213e);
    font-family: 'Courier New', monospace;
    overflow: hidden;
    color: #00ff00;
}

#gameContainer {
    position: relative;
    width: 100vw;
    height: 100vh;
}

#gameCanvas {
    display: block;
    width: 100%;
    height: 100%;
    background: #000;
    image-rendering: pixelated;
    image-rendering: -moz-crisp-edges;
    image-rendering: crisp-edges;
}

#ui {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 100;
}


/* Custom cursor when modal is open */
body.modal-open {
    cursor: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24"><path fill="%2300ff00" d="M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm-2 15l-5-5 1.41-1.41L10 14.17l7.59-7.59L19 8l-9 9z" filter="drop-shadow(0 0 3px %2300ff00)"/></svg>'), auto;
}

body.modal-open canvas {
    cursor: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24"><path fill="%2300ff00" d="M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm-2 15l-5-5 1.41-1.41L10 14.17l7.59-7.59L19 8l-9 9z" filter="drop-shadow(0 0 3px %2300ff00)"/></svg>'), auto;
}

body.modal-open .modal {
    cursor: default;
}

/* pulse animation removed */






/* Retro scanline effect */
#gameCanvas::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(transparent 50%, rgba(0, 255, 0, 0.03) 50%);
    background-size: 100% 4px;
    pointer-events: none;
    z-index: 1;
}

/* Glitch effect for 128-bit aesthetic */
@keyframes glitch {
    0% { transform: translate(0); }
    20% { transform: translate(-2px, 2px); }
    40% { transform: translate(-2px, -2px); }
    60% { transform: translate(2px, 2px); }
    80% { transform: translate(2px, -2px); }
    100% { transform: translate(0); }
}

.glitch {
    animation: glitch 0.3s infinite;
}

/* Modal Styles */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(5px);
}

.modal-content {
    background: linear-gradient(135deg, #0a0a0a, #1a1a2e);
    margin: 5% auto;
    padding: 0;
    border: 2px solid #00ff00;
    border-radius: 10px;
    width: 80%;
    max-width: 600px;
    max-height: 80vh;
    overflow-y: auto;
    box-shadow: 0 0 20px rgba(0, 255, 0, 0.3);
}

.modal-header {
    background: rgba(0, 255, 0, 0.1);
    padding: 20px;
    border-bottom: 1px solid #00ff00;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-header h2 {
    color: #00ff00;
    margin: 0;
    text-shadow: 0 0 10px #00ff00;
    font-family: 'Courier New', monospace;
}

.close {
    color: #00ff00;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
    transition: color 0.3s;
}

.close:hover {
    color: #ff0000;
}

.modal-body {
    padding: 20px;
}

.settings-section {
    margin-bottom: 30px;
    padding-bottom: 20px;
    border-bottom: 1px solid rgba(0, 255, 0, 0.3);
}

.settings-section:last-child {
    border-bottom: none;
}

.settings-section h3 {
    color: #00ff00;
    margin-bottom: 15px;
    text-shadow: 0 0 5px #00ff00;
    font-family: 'Courier New', monospace;
}

.control-buttons, .maze-buttons, .language-buttons {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 10px;
    margin-bottom: 15px;
}

.control-btn, .maze-btn, .language-btn {
    background: rgba(0, 255, 0, 0.1);
    border: 2px solid #00ff00;
    color: #00ff00;
    padding: 10px 15px;
    border-radius: 5px;
    cursor: pointer;
    font-family: 'Courier New', monospace;
    font-size: 12px;
    transition: all 0.3s;
    text-shadow: 0 0 5px #00ff00;
}

.control-btn:hover, .maze-btn:hover, .language-btn:hover {
    background: rgba(0, 255, 0, 0.2);
    box-shadow: 0 0 10px rgba(0, 255, 0, 0.5);
}

.control-btn.active, .maze-btn.active, .language-btn.active {
    background: rgba(0, 255, 0, 0.3);
    box-shadow: 0 0 15px rgba(0, 255, 0, 0.7);
}

.maze-description {
    background: rgba(0, 0, 0, 0.5);
    padding: 10px;
    border-radius: 5px;
    border: 1px solid rgba(0, 255, 0, 0.3);
}

.maze-description p {
    color: #00ff00;
    margin: 0;
    font-size: 12px;
    opacity: 0.8;
}

.info-grid {
    display: grid;
    gap: 10px;
}

.info-item {
    display: flex;
    justify-content: space-between;
    padding: 8px;
    background: rgba(0, 0, 0, 0.3);
    border-radius: 3px;
    border: 1px solid rgba(0, 255, 0, 0.2);
}

.info-label {
    color: #00ff00;
    font-weight: bold;
    opacity: 0.8;
}

.info-item span:last-child {
    color: #00ff00;
    font-family: 'Courier New', monospace;
}

/* Mode buttons */
.mode-buttons {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    margin-bottom: 15px;
}

.mode-btn {
    background: rgba(0, 255, 0, 0.1);
    border: 2px solid #00ff00;
    color: #00ff00;
    padding: 12px 20px;
    border-radius: 5px;
    cursor: pointer;
    font-family: 'Courier New', monospace;
    font-size: 14px;
    transition: all 0.3s;
    text-shadow: 0 0 5px #00ff00;
}

.mode-btn:hover {
    background: rgba(0, 255, 0, 0.2);
    box-shadow: 0 0 10px rgba(0, 255, 0, 0.5);
}

.mode-btn.active {
    background: rgba(0, 255, 0, 0.3);
    box-shadow: 0 0 15px rgba(0, 255, 0, 0.7);
}

/* Toolbox modal - matches settings modal design */
#toolbox-modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(5px);
}

#toolbox-modal .modal-content {
    background: linear-gradient(135deg, #0a0a0a, #1a1a2e);
    margin: 5% auto;
    padding: 0;
    border: 2px solid #00ff00;
    border-radius: 10px;
    width: 80%;
    max-width: 600px;
    max-height: 80vh;
    overflow-y: auto;
    box-shadow: 0 0 20px rgba(0, 255, 0, 0.3);
}

#toolbox-modal .modal-header {
    background: rgba(0, 255, 0, 0.1);
    padding: 20px;
    border-bottom: 1px solid #00ff00;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

#toolbox-modal .modal-header h2 {
    color: #00ff00;
    margin: 0;
    text-shadow: 0 0 10px #00ff00;
    font-family: 'Courier New', monospace;
}

#toolbox-modal .close-toolbox {
    color: #00ff00;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
    transition: color 0.3s;
}

#toolbox-modal .close-toolbox:hover {
    color: #ff0000;
}

#toolbox-modal .modal-body {
    padding: 20px;
}

.toolbox-section {
    margin-bottom: 30px;
    padding-bottom: 20px;
    border-bottom: 1px solid rgba(0, 255, 0, 0.3);
}

.toolbox-section:last-child {
    border-bottom: none;
}

.toolbox-section h3 {
    color: #00ff00;
    margin-bottom: 15px;
    text-shadow: 0 0 5px #00ff00;
    font-family: 'Courier New', monospace;
}

.tool-buttons {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
    margin-bottom: 15px;
}

.tool-btn {
    background: rgba(0, 255, 0, 0.1);
    border: 2px solid #00ff00;
    color: #00ff00;
    padding: 10px 15px;
    border-radius: 5px;
    cursor: pointer;
    font-family: 'Courier New', monospace;
    font-size: 12px;
    transition: all 0.3s;
    text-shadow: 0 0 5px #00ff00;
}

.tool-btn:hover {
    background: rgba(0, 255, 0, 0.2);
    box-shadow: 0 0 10px rgba(0, 255, 0, 0.5);
}

.tool-btn.active {
    background: rgba(0, 255, 0, 0.3);
    box-shadow: 0 0 15px rgba(0, 255, 0, 0.7);
}

.toolbox-info {
    background: rgba(0, 0, 0, 0.5);
    padding: 10px;
    border-radius: 5px;
    border: 1px solid rgba(0, 255, 0, 0.3);
}

.toolbox-info p {
    color: #00ff00;
    margin: 0;
    font-size: 12px;
    opacity: 0.8;
}
