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

body {
    font-family: 'Courier New', monospace;
    background: #0a0a0a;
    color: #00ff00;
    overflow: hidden;
    height: 100vh;
}

body.light-mode {
    background: #f0f0f0;
    color: #000000;
}

.light-mode #app {
    background: #f0f0f0;
}

.light-mode h1 {
    color: #cc0000;
    text-shadow: 0 0 20px #cc0000;
}

.light-mode p {
    color: #000000;
}

.light-mode #mapCanvas,
.light-mode #buttonCanvas {
    border: 3px solid #000000;
    background: #ffffff;
    box-shadow: 0 0 20px #000000;
}

.light-mode .settings-btn {
    background: #ffffff;
    border: 2px solid #000000;
    color: #000000;
}

.light-mode .settings-btn:hover {
    background: #e0e0e0;
    box-shadow: 0 0 10px #000000;
}

.light-mode .settings-menu {
    background: #ffffff;
    border: 2px solid #000000;
}

.light-mode .settings-menu button {
    background: #e0e0e0;
    border: 1px solid #000000;
    color: #000000;
}

.light-mode .settings-menu button:hover {
    background: #d0d0d0;
    box-shadow: 0 0 5px #000000;
}

.light-mode .settings-divider {
    border-top-color: #000000;
}

.light-mode .settings-label {
    color: #000000;
}

.light-mode .settings-label input[type="checkbox"] {
    accent-color: #000000;
}

.light-mode .settings-label input[type="range"] {
    accent-color: #000000;
}

.light-mode .toolbar button {
    background: #ffffff;
    border: 2px solid #000000;
    color: #000000;
}

.light-mode .toolbar button:hover {
    background: #e0e0e0;
    box-shadow: 0 0 8px #000000;
}

.light-mode .controls input,
.light-mode .controls button {
    background: #e0e0e0;
    border: 2px solid #000000;
    color: #000000;
}

.light-mode .controls button:hover {
    background: #d0d0d0;
    box-shadow: 0 0 10px #000000;
}

.light-mode .camera-button {
    background: #cc0000;
    border: 2px solid #000000;
    color: #ffffff;
    box-shadow: 0 0 10px #cc0000;
}

.light-mode .camera-button:hover {
    background: #dd3333;
    box-shadow: 0 0 15px #cc0000;
}

.light-mode .camera-button.selected {
    border-color: #ffaa00;
    box-shadow: 0 0 15px #ffaa00;
}

.light-mode #miniMap {
    border: 2px solid #000000;
    background: #ffffff;
    box-shadow: 0 0 15px #000000;
}

.light-mode .mini-camera-button {
    background: #cc0000;
    border: 1px solid #000000;
    box-shadow: 0 0 5px #cc0000;
}

.light-mode .mini-camera-button:hover {
    background: #dd3333;
    box-shadow: 0 0 8px #cc0000;
}

.light-mode .mini-camera-button.active {
    background: #ffaa00;
    color: #000000;
    border-color: #ffaa00;
    box-shadow: 0 0 10px #ffaa00;
}

.light-mode .modal-content {
    background: #ffffff;
    border: 3px solid #000000;
}

.light-mode .modal-content h3 {
    color: #000000;
}

.light-mode .modal-content input[type="text"],
.light-mode .modal-content input[type="file"] {
    background: #e0e0e0;
    border: 2px solid #000000;
    color: #000000;
}

.light-mode .modal-content button {
    background: #e0e0e0;
    border: 2px solid #000000;
    color: #000000;
}

.light-mode .modal-content button:hover {
    background: #d0d0d0;
    box-shadow: 0 0 10px #000000;
}

.light-mode #imagePreview {
    border: 2px solid #000000;
}

.light-mode #cameraView {
    background: #ffffff;
}

.light-mode #cameraImage {
    background: #f5f5f5;
    color: #000000;
}

.light-mode #cameraImage img {
    border: 2px solid #000000;
}

.light-mode .instructions {
    background: rgba(255, 255, 255, 0.9);
    border: 2px solid #000000;
    color: #000000;
}

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

.screen {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: none;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.screen.active {
    display: flex;
}

.settings-btn {
    position: fixed;
    top: 20px;
    left: 20px;
    z-index: 1000;
    background: #1a1a1a;
    border: 2px solid #00ff00;
    color: #00ff00;
    padding: 10px;
    border-radius: 5px;
    cursor: pointer;
    font-size: 18px;
}

.settings-btn:hover {
    background: #2a2a2a;
    box-shadow: 0 0 10px #00ff00;
}

.settings-menu {
    position: fixed;
    top: 70px;
    left: 20px;
    z-index: 999;
    background: #1a1a1a;
    border: 2px solid #00ff00;
    border-radius: 5px;
    padding: 10px;
    min-width: 180px;
    max-width: 220px;
    max-height: 60vh;
    overflow-y: auto;
}

.settings-menu button {
    display: block;
    width: 100%;
    margin: 5px 0;
    padding: 8px;
    background: #2a2a2a;
    border: 1px solid #00ff00;
    color: #00ff00;
    cursor: pointer;
    border-radius: 3px;
}

.settings-menu button:hover {
    background: #3a3a3a;
    box-shadow: 0 0 5px #00ff00;
}

.settings-divider {
    border: none;
    border-top: 1px solid #00ff00;
    margin: 10px 0;
    opacity: 0.3;
}

.settings-section {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.settings-label {
    display: flex;
    align-items: center;
    justify-content: space-between;
    color: #00ff00;
    font-size: 12px;
    cursor: pointer;
    padding: 4px 0;
}

.settings-label input[type="checkbox"] {
    margin-right: 8px;
    accent-color: #00ff00;
}

.settings-label input[type="range"] {
    margin-left: 8px;
    width: 80px;
    accent-color: #00ff00;
}

.toolbar {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 998;
    display: flex;
    gap: 10px;
}

.toolbar button {
    background: #1a1a1a;
    border: 2px solid #00ff00;
    color: #00ff00;
    padding: 8px 12px;
    border-radius: 5px;
    cursor: pointer;
    font-size: 12px;
}

.toolbar button:hover {
    background: #2a2a2a;
    box-shadow: 0 0 8px #00ff00;
}

.hidden {
    display: none !important;
}

h1 {
    color: #ff0000;
    font-size: 3em;
    text-shadow: 0 0 20px #ff0000;
    margin-bottom: 20px;
    text-align: center;
}

p {
    color: #00ff00;
    margin-bottom: 20px;
    text-align: center;
}

#mapCanvas, #buttonCanvas {
    border: 3px solid #00ff00;
    background: #1a1a1a;
    box-shadow: 0 0 20px #00ff00;
    cursor: pointer;
}

#buttonCanvas {
    cursor: pointer;
}

.controls {
    margin-top: 20px;
    display: flex;
    gap: 15px;
    align-items: center;
}

.controls input, .controls button {
    background: #2a2a2a;
    border: 2px solid #00ff00;
    color: #00ff00;
    padding: 8px 12px;
    border-radius: 5px;
    cursor: pointer;
}

.controls button:hover {
    background: #3a3a3a;
    box-shadow: 0 0 10px #00ff00;
}

#mapContainer {
    position: relative;
}

#cameraButtons {
    position: absolute;
    top: 0;
    left: 0;
    width: 800px;
    height: 600px;
    pointer-events: none;
}

.camera-button {
    position: absolute;
    background: #ff0000;
    border: 2px solid #ffffff;
    color: #ffffff;
    padding: 5px 10px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 12px;
    font-weight: bold;
    pointer-events: all;
    min-width: 40px;
    min-height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    box-shadow: 0 0 10px #ff0000;
    transform: translate(-50%, -50%);
}

.camera-button:hover {
    background: #ff3333;
    box-shadow: 0 0 15px #ff0000;
}

.camera-button.selected {
    border-color: #ffff00;
    box-shadow: 0 0 15px #ffff00;
}

#miniMap {
    position: absolute;
    bottom: 80px;
    right: 20px;
    width: 200px;
    height: 150px;
    border: 2px solid #00ff00;
    background: #1a1a1a;
    z-index: 12;
    box-shadow: 0 0 15px #00ff00;
}

#miniMapCanvas {
    width: 100%;
    height: 100%;
    display: block;
}

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

.mini-camera-button {
    position: absolute;
    background: #ff0000;
    border: 1px solid #ffffff;
    color: #ffffff;
    padding: 2px 4px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 8px;
    font-weight: bold;
    pointer-events: all;
    min-width: 20px;
    min-height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    box-shadow: 0 0 5px #ff0000;
    transform: translate(-50%, -50%);
}

.mini-camera-button:hover {
    background: #ff3333;
    box-shadow: 0 0 8px #ff0000;
}

.mini-camera-button.active {
    background: #ffff00;
    color: #000000;
    border-color: #ffff00;
    box-shadow: 0 0 10px #ffff00;
}

.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1001;
}

.modal-content {
    background: #1a1a1a;
    border: 3px solid #00ff00;
    padding: 30px;
    border-radius: 10px;
    min-width: 300px;
    text-align: center;
}

.modal-content h3 {
    color: #00ff00;
    margin-bottom: 20px;
}

.modal-content input[type="text"], .modal-content input[type="file"] {
    width: 100%;
    padding: 10px;
    margin: 10px 0;
    background: #2a2a2a;
    border: 2px solid #00ff00;
    color: #00ff00;
    border-radius: 5px;
}

.modal-content button {
    margin: 10px 5px;
    padding: 10px 20px;
    background: #2a2a2a;
    border: 2px solid #00ff00;
    color: #00ff00;
    border-radius: 5px;
    cursor: pointer;
}

.modal-content button:hover {
    background: #3a3a3a;
    box-shadow: 0 0 10px #00ff00;
}

#imagePreview {
    margin: 15px 0;
    max-width: 200px;
    max-height: 200px;
    border: 2px solid #00ff00;
    display: none;
}

#imagePreview img {
    width: 100%;
    height: auto;
}

#cameraView {
    background: #000;
    position: relative;
}

#staticOverlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="100" height="100"><defs><pattern id="static" x="0" y="0" width="2" height="2" patternUnits="userSpaceOnUse"><rect x="0" y="0" width="1" height="1" fill="%23fff" opacity="0.1"/><rect x="1" y="1" width="1" height="1" fill="%23fff" opacity="0.1"/></pattern></defs><rect width="100" height="100" fill="url(%23static)"/></svg>');
    opacity: 0.3;
    animation: staticFlicker 0.1s infinite;
    pointer-events: none;
    z-index: 10;
}

@keyframes staticFlicker {
    0% { opacity: 0.1; }
    50% { opacity: 0.3; }
    100% { opacity: 0.1; }
}

#cameraImage {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #0a0a0a;
    color: #00ff00;
    font-size: 24px;
}

#cameraImage img {
    max-width: 90%;
    max-height: 90%;
    border: 2px solid #00ff00;
}

#backToMap {
    display: none;
}

#backToMap:hover {
    background: #2a2a2a;
    box-shadow: 0 0 10px #00ff00;
}

.instructions {
    position: absolute;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(26, 26, 26, 0.9);
    border: 2px solid #00ff00;
    padding: 10px 20px;
    border-radius: 5px;
    color: #00ff00;
}

/* Responsive Design for Mobile Devices */
@media (max-width: 768px) {
    h1 {
        font-size: 2em;
        margin-bottom: 15px;
    }
    
    p {
        font-size: 14px;
        margin-bottom: 15px;
    }
    
    #mapCanvas, #buttonCanvas {
        width: 90vw;
        height: 60vh;
        max-width: 600px;
        max-height: 450px;
    }
    
    .controls {
        flex-wrap: wrap;
        gap: 10px;
        justify-content: center;
    }
    
    .controls input, .controls button {
        padding: 10px 15px;
        font-size: 14px;
    }
    
    .settings-btn {
        padding: 8px;
        font-size: 16px;
    }
    
    .settings-menu {
        min-width: 150px;
        max-width: 180px;
        max-height: 50vh;
    }
    
    .settings-menu button {
        padding: 10px;
        font-size: 14px;
    }
    
    .toolbar {
        flex-wrap: wrap;
        gap: 5px;
        right: 10px;
        top: 10px;
    }
    
    .toolbar button {
        padding: 6px 10px;
        font-size: 11px;
    }
    
    .camera-button {
        min-width: 35px;
        min-height: 35px;
        font-size: 10px;
        padding: 3px 6px;
    }
    
    #miniMap {
        width: 150px;
        height: 112px;
        bottom: 60px;
        right: 10px;
    }
    
    .mini-camera-button {
        min-width: 16px;
        min-height: 16px;
        font-size: 7px;
        padding: 1px 3px;
    }
    
    .modal-content {
        min-width: 250px;
        padding: 20px;
        margin: 0 10px;
    }
    
    .modal-content input[type="text"], .modal-content input[type="file"] {
        font-size: 14px;
    }
    
    .instructions {
        bottom: 10px;
        padding: 8px 15px;
        font-size: 14px;
    }
    
    #cameraImage {
        font-size: 18px;
    }
    
    #cameraImage img {
        max-width: 95%;
        max-height: 95%;
    }
    
    #cameraButtons {
        width: 90vw;
        height: 60vh;
        max-width: 600px;
        max-height: 450px;
    }
    
    #miniMapButtons {
        width: 150px;
        height: 112px;
    }
}

@media (max-width: 480px) {
    h1 {
        font-size: 1.5em;
        margin-bottom: 10px;
    }
    
    #mapCanvas, #buttonCanvas {
        width: 95vw;
        height: 50vh;
        max-width: 400px;
        max-height: 300px;
    }
    
    .toolbar {
        flex-direction: column;
        align-items: flex-end;
        gap: 3px;
    }
    
    .toolbar button {
        padding: 5px 8px;
        font-size: 10px;
    }
    
    .camera-button {
        min-width: 30px;
        min-height: 30px;
        font-size: 9px;
        padding: 2px 4px;
    }
    
    #miniMap {
        width: 120px;
        height: 90px;
        bottom: 50px;
        right: 5px;
    }
    
    .mini-camera-button {
        min-width: 14px;
        min-height: 14px;
        font-size: 6px;
        padding: 1px 2px;
    }
    
    .modal-content {
        min-width: 200px;
        padding: 15px;
    }
    
    .controls {
        gap: 8px;
    }
    
    .controls input, .controls button {
        padding: 8px 12px;
        font-size: 12px;
    }
    
    .settings-btn {
        top: 10px;
        left: 10px;
        padding: 6px;
        font-size: 14px;
    }
    
    .settings-menu {
        top: 50px;
        left: 10px;
        min-width: 140px;
        max-width: 160px;
        max-height: 40vh;
    }
    
    #cameraImage {
        font-size: 16px;
    }
    
    #cameraButtons {
        width: 95vw;
        height: 50vh;
        max-width: 400px;
        max-height: 300px;
    }
    
    #miniMapButtons {
        width: 120px;
        height: 90px;
    }
}

/* Landscape orientation adjustments for mobile */
@media (max-height: 500px) and (orientation: landscape) {
    h1 {
        font-size: 1.2em;
        margin-bottom: 5px;
    }
    
    p {
        font-size: 12px;
        margin-bottom: 10px;
    }
    
    #mapCanvas, #buttonCanvas {
        height: 70vh;
        max-height: 350px;
    }
    
    .screen {
        padding: 10px;
    }
    
    .controls {
        margin-top: 10px;
    }
    
    #miniMap {
        bottom: 40px;
        right: 10px;
    }
    
    .instructions {
        bottom: 5px;
        padding: 5px 10px;
        font-size: 12px;
    }
    
    #cameraButtons {
        height: 70vh;
        max-height: 350px;
    }
}