@import url('https://fonts.googleapis.com/css2?family=Fira+Code:wght@300;400;500;600&display=swap');

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

body {
    font-family: 'Fira Code', monospace;
    background: linear-gradient(135deg, #0a0a0a 0%, #1a1a1a 100%);
    color: #f0f0f0;
    overflow: hidden;
    height: 100vh;
    margin: 0;
    padding: 0;
}

.fullscreen-container {
    width: 100vw;
    height: 100vh;
    position: relative;
    overflow: hidden;
}

#gameCanvas {
    position: absolute;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: #000;
    z-index: 1;
}

.title-overlay {
    position: absolute;
    top: 20px;
    left: 0;
    right: 0;
    transform: none;
    width: 100%;
    display: flex;
    justify-content: center;
    z-index: 10;
    pointer-events: none;
}

/* ASCII logo tuning */
.ascii-art {
    text-align: center;
    display: flex;
    justify-content: center;
    align-items: center;
}

.ascii-art pre {
    display: inline-block;
    font-family: "Noto Sans Mono", Consolas, "Courier New", monospace;
    font-size: 10px;
    line-height: 10px; /* exact pixel grid to prevent cumulative rounding */
    letter-spacing: 0;
    font-kerning: none;
    font-variant-ligatures: none;
    text-rendering: geometricPrecision; /* prefer geometric fidelity over speed */
    -webkit-font-smoothing: none;
    -moz-osx-font-smoothing: auto;
    color: #f0f0f0;
    /* remove glow to avoid perceived misalignment */
    text-shadow: none;
    margin: 0;
    padding: 0;
}

/* Pre-rendered logo image */
.ascii-logo {
    image-rendering: pixelated;
    image-rendering: crisp-edges;
    display: none; /* hidden until it loads */
    max-width: 90vw;
    height: auto;
}

.title-overlay .ascii-wrapper {
    display: flex;
    justify-content: center;
    align-items: center;
}

.drone-status-box {
    position: fixed;
    bottom: 20px;
    left: 20px;
    width: 350px;
    background: rgba(0, 0, 0, 0.8);
    border: 1px solid #f0f0f0;
    border-radius: 8px;
    padding: 15px;
    box-shadow: 0 0 15px rgba(240, 240, 240, 0.2);
}

.status-header {
    font-size: 14px;
    font-weight: 600;
    color: #f0f0f0;
    margin-bottom: 10px;
    text-align: center;
    border-bottom: 1px solid #444;
    padding-bottom: 5px;
}

.status-line {
    display: flex;
    align-items: center;
    margin-bottom: 8px;
    font-size: 14px;
}

.prompt {
    color: #f0f0f0;
    margin-right: 10px;
    font-weight: 600;
}

.command {
    color: #f0f0f0;
    margin-right: 10px;
}

.status-ok {
    color: #00ff00;
    font-weight: 600;
}

.status-warning {
    color: #ffaa00;
    font-weight: 600;
    animation: pulse 2s infinite;
}

.status-error {
    color: #ff0000;
    font-weight: 600;
    animation: pulse 1s infinite;
}



.game-hud {
    position: absolute;
    top: 20px;
    right: 20px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding: 15px;
    background: rgba(0, 0, 0, 0.8);
    border: 1px solid #f0f0f0;
    border-radius: 8px;
    z-index: 10;
    min-width: 200px;
}

.hud-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 12px;
    margin-bottom: 5px;
}

.hud-label {
    color: #ccc;
    margin-right: 10px;
}

.access-denied {
    position: absolute;
    bottom: 20px;
    right: 20px;
    padding: 20px;
    background: rgba(20, 20, 20, 0.8);
    border: 1px solid #ff0000;
    border-radius: 8px;
    z-index: 10;
    max-width: 350px;
}

.typing-text {
    margin-bottom: 15px;
    font-size: 14px;
}

#typing-output {
    color: #ff0000;
    animation: typing 3s steps(60, end) infinite;
}

.contact-info {
    text-align: center;
    font-size: 12px;
    color: #666;
}

.email {
    color: #f0f0f0;
    text-decoration: underline;
}

/* Contact Form Styles */
.contact-form-container {
    margin-top: 20px;
}

.contact-form {
    background: rgba(0, 0, 0, 0.9);
    border: 1px solid #f0f0f0;
    border-radius: 8px;
    padding: 20px;
    margin-top: 15px;
}

.form-header {
    text-align: center;
    margin-bottom: 20px;
}

.form-header h3 {
    color: #f0f0f0;
    font-size: 16px;
    margin-bottom: 5px;
}

.form-header p {
    color: #666;
    font-size: 12px;
}

.form-group {
    margin-bottom: 15px;
}

.form-group label {
    display: block;
    color: #ccc;
    font-size: 12px;
    margin-bottom: 5px;
    font-weight: 600;
}

.form-group input,
.form-group textarea {
    width: 100%;
    padding: 8px 12px;
    background: rgba(0, 0, 0, 0.8);
    border: 1px solid #444;
    border-radius: 4px;
    color: #f0f0f0;
    font-family: 'Fira Code', monospace;
    font-size: 12px;
    transition: border-color 0.3s ease;
}

.form-group input:focus,
.form-group textarea:focus {
    outline: none;
    border-color: #00ff00;
    box-shadow: 0 0 5px rgba(0, 255, 0, 0.3);
}

.form-group textarea {
    resize: vertical;
    min-height: 60px;
}

.submit-btn {
    width: 100%;
    padding: 12px;
    background: linear-gradient(135deg, #00ff00 0%, #00cc00 100%);
    border: none;
    border-radius: 4px;
    color: #000;
    font-family: 'Fira Code', monospace;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    text-transform: uppercase;
}

.submit-btn:hover:not(:disabled) {
    background: linear-gradient(135deg, #00cc00 0%, #009900 100%);
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(0, 255, 0, 0.3);
}

.submit-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.status-message {
    margin-top: 15px;
    padding: 10px;
    border-radius: 4px;
    font-size: 12px;
    text-align: center;
}

.status-message.success {
    background: rgba(0, 255, 0, 0.1);
    border: 1px solid #00ff00;
    color: #00ff00;
}

.status-message.error {
    background: rgba(255, 0, 0, 0.1);
    border: 1px solid #ff0000;
    color: #ff0000;
}

/* Access Buttons */
.access-buttons {
    display: flex;
    gap: 10px;
    margin-top: 15px;
}

.login-btn {
    background: linear-gradient(135deg, #0088ff 0%, #0066cc 100%);
    border: none;
    border-radius: 4px;
    color: #fff;
    padding: 12px 24px;
    font-family: 'Fira Code', monospace;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    text-transform: uppercase;
    flex: 1;
}

.login-btn:hover {
    background: linear-gradient(135deg, #0066cc 0%, #004499 100%);
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(0, 136, 255, 0.3);
}

.request-access-btn {
    background: linear-gradient(135deg, #00ff00 0%, #00cc00 100%);
    border: none;
    border-radius: 4px;
    color: #000;
    padding: 12px 24px;
    font-family: 'Fira Code', monospace;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    text-transform: uppercase;
    flex: 1;
}

.request-access-btn:hover {
    background: linear-gradient(135deg, #00cc00 0%, #009900 100%);
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(0, 255, 0, 0.3);
}

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

/* Contact modal should appear above login modal */
#contactModal {
    z-index: 1100;
}

.modal-overlay.active {
    display: flex;
}

.modal-content {
    background: rgba(0, 0, 0, 0.95);
    border: 2px solid #f0f0f0;
    border-radius: 8px;
    width: 90%;
    max-width: 500px;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 0 30px rgba(240, 240, 240, 0.2);
    animation: modalSlideIn 0.3s ease-out;
}

@keyframes modalSlideIn {
    from {
        opacity: 0;
        transform: translateY(-50px) scale(0.9);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px;
    border-bottom: 1px solid #444;
}

.modal-header h3 {
    color: #f0f0f0;
    margin: 0;
    font-size: 18px;
}

.modal-close {
    background: none;
    border: none;
    color: #f0f0f0;
    font-size: 24px;
    cursor: pointer;
    padding: 0;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: color 0.3s ease;
}

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

.modal-body {
    padding: 20px;
}

/* Login Modal Tabs */
.login-tabs {
    display: flex;
    margin-bottom: 20px;
    border-bottom: 1px solid #444;
}

.tab-btn {
    background: none;
    border: none;
    color: #666;
    padding: 10px 20px;
    font-family: 'Fira Code', monospace;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: color 0.3s ease;
    text-transform: uppercase;
    border-bottom: 2px solid transparent;
}

.tab-btn.active {
    color: #00ff00;
    border-bottom-color: #00ff00;
}

.tab-btn:hover {
    color: #f0f0f0;
}

.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
}

.register-info {
    text-align: center;
    color: #666;
    margin-bottom: 20px;
    font-size: 14px;
}

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

@keyframes typing {
    0%, 50% { border-right: 2px solid transparent; }
    51%, 100% { border-right: 2px solid #ff0000; }
}

@keyframes flicker {
    0%, 98% { opacity: 1; }
    99%, 100% { opacity: 0.8; }
}

body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background:
        repeating-linear-gradient(
            0deg,
            transparent,
            transparent 2px,
            rgba(240, 240, 240, 0.02) 2px,
            rgba(240, 240, 240, 0.02) 4px
        );
    pointer-events: none;
    z-index: 1; /* keep scanlines behind content to avoid aliasing artifacts */
    animation: flicker 0.15s infinite linear;
}


@media (max-width: 768px) {
    .title-overlay {
        top: 10px;
        left: 10px;
        transform: none;
    }

    .ascii-art pre {
        font-size: 8px;
        line-height: 8px; /* keep integer grid on mobile too */
    }

    .game-hud {
        top: 10px;
        right: 10px;
        min-width: 150px;
    }

    .access-denied {
        bottom: 10px;
        right: 10px;
        max-width: 300px;
        font-size: 11px;
    }

    .drone-status-box {
        width: 250px;
        bottom: 10px;
        left: 10px;
        font-size: 11px;
    }
}