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

body {
    background-color: #000000;
    color: #00ff00;
    font-family: 'Courier New', Courier, monospace;
    font-size: 16px;
    line-height: 1.6;
    overflow-x: hidden;
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 20px;
}

/* Video Intro Styles */
.video-intro {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: #000000;
    z-index: 5000;
    display: flex;
    justify-content: center;
    align-items: center;
    opacity: 1;
    transition: opacity 1s ease-out;
}

.video-intro.fade-out {
    opacity: 0;
    pointer-events: none;
}

.video-intro.hidden {
    display: none;
}

.intro-video {
    max-width: 100%;
    max-height: 100%;
    width: auto;
    height: auto;
    object-fit: contain;
}

/* Typing animation styles */
.output[data-text],
.sub-item[data-text] {
    opacity: 0;
}

.output.typing,
.sub-item.typing {
    opacity: 1;
}

.section[data-typing] {
    opacity: 0;
}

.section.typing-active {
    opacity: 1;
}

.screen {
    max-width: 900px;
    width: 100%;
    padding: 30px;
    border: 2px solid #00ff00;
    box-shadow: 0 0 20px rgba(0, 255, 0, 0.3);
    background-color: #000000;
    position: relative;
}

.header {
    text-align: center;
    margin-bottom: 40px;
    padding-bottom: 20px;
    border-bottom: 1px solid #00ff00;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 10px;
}

.header h1 {
    font-size: 2.5em;
    letter-spacing: 0.2em;
    text-shadow: 0 0 10px rgba(0, 255, 0, 0.5);
    font-weight: normal;
}

.content {
    margin-bottom: 30px;
}

.section {
    margin-bottom: 30px;
}

.prompt {
    color: #00ff00;
    font-weight: bold;
    margin-bottom: 10px;
    text-transform: uppercase;
}

.output {
    color: #00ff00;
    margin-left: 20px;
    margin-bottom: 8px;
}

.sub-item {
    color: #00cc00;
    margin-left: 40px;
    margin-bottom: 8px;
    font-size: 0.9em;
}

.service-list {
    margin-top: 10px;
}

.link {
    color: #00ff00;
    text-decoration: none;
    transition: all 0.3s ease;
}

.link:hover {
    color: #ffffff;
    text-shadow: 0 0 10px rgba(0, 255, 0, 0.8);
}

.footer {
    margin-top: 60px;
    padding-top: 20px;
    border-top: 1px solid #00ff00;
}

.command-instruction {
    margin-bottom: 15px;
}

.instruction-text {
    color: #00ff00;
    font-family: 'Courier New', Courier, monospace;
    font-size: 14px;
    font-weight: bold;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    margin-bottom: 8px;
    text-shadow: 0 0 5px rgba(0, 255, 0, 0.3);
}

.help-hint {
    color: #00cc00;
    font-family: 'Courier New', Courier, monospace;
    font-size: 12px;
    opacity: 0.7;
    margin-top: 5px;
}

.help-command {
    color: #00ff00;
    font-weight: bold;
    text-decoration: underline;
    cursor: pointer;
    transition: all 0.3s ease;
    animation: subtle-pulse 2s ease-in-out infinite;
}

.help-command:hover {
    color: #ffffff;
    text-shadow: 0 0 8px rgba(0, 255, 0, 0.8);
    animation: none;
}

@keyframes subtle-pulse {
    0%, 100% {
        opacity: 0.8;
    }
    50% {
        opacity: 1;
    }
}

.command-line {
    display: flex;
    align-items: center;
    gap: 8px;
}

.command-input {
    background: transparent;
    border: none;
    color: #00ff00;
    font-family: 'Courier New', Courier, monospace;
    font-size: 16px;
    outline: none;
    flex: 1;
    caret-color: #00ff00;
}

.command-input:focus + .cursor-blink {
    opacity: 0;
}

.cursor-blink {
    display: inline-block;
}

/* Blinking animation for cursor effect */
@keyframes blink {
    0%, 50% {
        opacity: 1;
    }
    51%, 100% {
        opacity: 0;
    }
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

.blink {
    animation: blink 1s infinite;
    display: inline-block;
}

/* Responsive design */
@media (max-width: 768px) {
    body {
        font-size: 14px;
        padding: 10px;
    }
    
    .screen {
        padding: 20px;
    }
    
    .header h1 {
        font-size: 1.8em;
    }
    
    .output, .sub-item {
        margin-left: 10px;
    }
    
    .sub-item {
        margin-left: 20px;
    }
    
    .modal-content {
        padding: 20px;
        max-width: 95%;
    }
    
    .modal-header h2 {
        font-size: 1.4em;
    }
    
    .command-input {
        font-size: 14px;
    }
}

/* Modal Styles */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.8);
    z-index: 2000;
    justify-content: center;
    align-items: center;
    padding: 20px;
}

.modal.active {
    display: flex;
}

.modal-content {
    background-color: #000000;
    border: 2px solid #00ff00;
    box-shadow: 0 0 30px rgba(0, 255, 0, 0.5);
    max-width: 700px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    padding: 30px;
    position: relative;
}

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

.modal-header h2 {
    color: #00ff00;
    font-size: 1.8em;
    letter-spacing: 0.1em;
    font-weight: normal;
    text-shadow: 0 0 10px rgba(0, 255, 0, 0.5);
}

.close-btn {
    background: transparent;
    border: none;
    color: #00ff00;
    font-size: 2em;
    cursor: pointer;
    line-height: 1;
    padding: 0;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

.close-btn:hover {
    color: #ffffff;
    text-shadow: 0 0 10px rgba(0, 255, 0, 0.8);
    transform: scale(1.2);
}

.modal-body {
    color: #00ff00;
}

.modal-body .output {
    margin-left: 0;
    margin-bottom: 15px;
}

.feature-list {
    margin-left: 20px;
    margin-bottom: 15px;
    list-style: none;
}

.feature-list li {
    margin-bottom: 8px;
    color: #00cc00;
    position: relative;
    padding-left: 20px;
}

.feature-list li::before {
    content: '>';
    position: absolute;
    left: 0;
    color: #00ff00;
}

.help-commands-list {
    margin-top: 10px;
}

.help-commands-list .output {
    margin-bottom: 12px;
    line-height: 1.8;
}

.command-name {
    color: #ffffff;
    font-weight: bold;
    text-transform: uppercase;
}

/* Game Selection Styles */
.game-selection-list {
    display: flex;
    flex-direction: column;
    gap: 15px;
    margin-top: 20px;
}

.game-option {
    background-color: #000000;
    border: 2px solid #00ff00;
    color: #00ff00;
    font-family: 'Courier New', Courier, monospace;
    padding: 20px;
    cursor: pointer;
    text-align: left;
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.game-option:hover {
    background-color: #001100;
    border-color: #ffffff;
    box-shadow: 0 0 15px rgba(0, 255, 0, 0.5);
    transform: translateX(5px);
}

.game-number {
    color: #00ff00;
    font-weight: bold;
    font-size: 14px;
}

.game-name {
    color: #ffffff;
    font-weight: bold;
    font-size: 18px;
    text-transform: uppercase;
    letter-spacing: 0.1em;
}

.game-desc {
    color: #00cc00;
    font-size: 12px;
    opacity: 0.8;
}

/* Shared Game Container Styles */
.game-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: #000000;
    z-index: 3000;
    display: none;
    justify-content: center;
    align-items: center;
    padding: 20px;
}

.game-container.active {
    display: flex;
}

.game-wrapper {
    background-color: #000000;
    border: 2px solid #00ff00;
    box-shadow: 0 0 30px rgba(0, 255, 0, 0.5);
    max-width: 900px;
    width: 100%;
    padding: 30px;
    display: flex;
    flex-direction: column;
    align-items: center;
    position: relative;
}

.game-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 2px solid #00ff00;
}

.game-header h2 {
    color: #00ff00;
    font-size: 2em;
    letter-spacing: 0.1em;
    font-weight: normal;
    text-shadow: 0 0 10px rgba(0, 255, 0, 0.5);
    font-family: 'Courier New', Courier, monospace;
}

.game-info {
    color: #00ff00;
    font-family: 'Courier New', Courier, monospace;
    text-align: center;
    margin-bottom: 20px;
    width: 100%;
}

.game-info p {
    margin-bottom: 10px;
    font-size: 14px;
}

.game-canvas {
    border: 2px solid #00ff00;
    box-shadow: 0 0 30px rgba(0, 255, 0, 0.5);
    background-color: #000000;
    outline: none;
    width: 100%;
    display: block;
    max-width: 900px;
}

.game-canvas:focus {
    box-shadow: 0 0 40px rgba(0, 255, 0, 0.8);
}

/* Mobile Controls */
.mobile-controls-container {
    display: none;
    width: 100%;
    max-width: 900px;
    margin-top: 20px;
    padding: 15px;
    gap: 10px;
}

.control-row {
    display: flex;
    justify-content: center;
    gap: 15px;
    margin-bottom: 10px;
}

.control-btn {
    background-color: #000000;
    border: 2px solid #00ff00;
    color: #00ff00;
    font-family: 'Courier New', Courier, monospace;
    font-size: 24px;
    font-weight: bold;
    width: 80px;
    height: 80px;
    cursor: pointer;
    user-select: none;
    touch-action: manipulation;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.control-btn:active,
.control-btn.active {
    background-color: #00ff00;
    color: #000000;
    box-shadow: 0 0 20px rgba(0, 255, 0, 0.8);
    transform: scale(0.95);
}

.control-btn-shoot {
    width: 120px;
    font-size: 18px;
    text-transform: uppercase;
}

.desktop-controls {
    display: block;
}

.mobile-controls {
    display: none;
}

/* Mobile Responsive */
@media (max-width: 768px) {
    .desktop-controls {
        display: none;
    }
    
    .mobile-controls {
        display: block;
    }
    
    .mobile-controls-container {
        display: flex;
        flex-direction: column;
    }
    
    .command-input {
        font-size: 16px; /* Prevents zoom on iOS */
        padding: 12px;
    }
    
    .command-line {
        gap: 5px;
    }
    
    .game-canvas {
        max-width: 100%;
        height: auto;
    }
    
    .modal-content {
        max-height: 90vh;
        overflow-y: auto;
    }
    
    .game-option {
        padding: 15px;
        font-size: 14px;
    }
    
    .game-name {
        font-size: 16px;
    }
    
    .form-input,
    .form-textarea {
        font-size: 16px; /* Prevents iOS zoom */
    }
}

/* Form Styles */
.dos-form {
    width: 100%;
}

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

.form-label {
    display: block;
    color: #00ff00;
    font-weight: bold;
    margin-bottom: 8px;
    font-family: 'Courier New', Courier, monospace;
}

.form-input,
.form-textarea {
    width: 100%;
    background-color: #000000;
    border: 1px solid #00ff00;
    color: #00ff00;
    font-family: 'Courier New', Courier, monospace;
    font-size: 16px;
    padding: 10px;
    outline: none;
    transition: all 0.3s ease;
}

.form-input:focus,
.form-textarea:focus {
    border-color: #ffffff;
    box-shadow: 0 0 10px rgba(0, 255, 0, 0.5);
    background-color: #001100;
}

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

.form-actions {
    display: flex;
    gap: 15px;
    margin-top: 25px;
}

.form-submit,
.form-cancel {
    background-color: #000000;
    border: 2px solid #00ff00;
    color: #00ff00;
    font-family: 'Courier New', Courier, monospace;
    font-size: 16px;
    padding: 10px 25px;
    cursor: pointer;
    text-transform: uppercase;
    transition: all 0.3s ease;
    outline: none;
}

.form-submit:hover {
    background-color: #00ff00;
    color: #000000;
    box-shadow: 0 0 15px rgba(0, 255, 0, 0.8);
}

.form-cancel:hover {
    border-color: #ff0000;
    color: #ff0000;
    box-shadow: 0 0 15px rgba(255, 0, 0, 0.5);
}

.form-submit:active,
.form-cancel:active {
    transform: scale(0.95);
}

/* Serpent Game Styles */
.serpent-game-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: #000000;
    z-index: 3000;
    display: none;
    justify-content: center;
    align-items: center;
    padding: 20px;
}

.serpent-game-container.active {
    display: flex;
}

.serpent-game-wrapper {
    background-color: #000000;
    border: 2px solid #00ff00;
    box-shadow: 0 0 30px rgba(0, 255, 0, 0.5);
    max-width: 900px;
    width: 100%;
    padding: 30px;
    display: flex;
    flex-direction: column;
    align-items: center;
    position: relative;
}

.serpent-game-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 2px solid #00ff00;
}

.serpent-game-header h2 {
    color: #00ff00;
    font-size: 2em;
    letter-spacing: 0.1em;
    font-weight: normal;
    text-shadow: 0 0 10px rgba(0, 255, 0, 0.5);
    font-family: 'Courier New', Courier, monospace;
}

.serpent-game-info {
    color: #00ff00;
    font-family: 'Courier New', Courier, monospace;
    text-align: center;
    margin-bottom: 20px;
    width: 100%;
}

.serpent-game-info p {
    margin-bottom: 10px;
    font-size: 14px;
}

#serpentScore {
    color: #ffffff;
    font-weight: bold;
    font-size: 1.2em;
}

.serpent-canvas {
    border: 2px solid #00ff00;
    box-shadow: 0 0 30px rgba(0, 255, 0, 0.5);
    background-color: #000000;
    outline: none;
    width: 100%;
    display: block;
}

.serpent-canvas:focus {
    box-shadow: 0 0 40px rgba(0, 255, 0, 0.8);
}

/* Responsive adjustments for forms and game */
@media (max-width: 768px) {
    .form-input,
    .form-textarea {
        font-size: 14px;
        padding: 8px;
    }

    .form-submit,
    .form-cancel {
        font-size: 14px;
        padding: 8px 20px;
    }

    .serpent-game-header h2 {
        font-size: 1.5em;
    }

    .serpent-canvas {
        max-width: 100%;
        height: auto;
    }
}

/* Subtle scanline effect */
body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: repeating-linear-gradient(
        0deg,
        rgba(0, 255, 0, 0.03),
        rgba(0, 255, 0, 0.03) 1px,
        transparent 1px,
        transparent 2px
    );
    pointer-events: none;
    z-index: 1000;
}
