html {
    background-color: #000;
}

/* --- UPDATED: Both Konami and Clippy videos will now use this rule --- */
#nedry-overlay, #konami-video-overlay, #clippy-easter-egg-overlay { /* Added easter egg */
    position: fixed; top: 0; left: 0; width: 100%; height: 100%;
    background-color: rgba(0, 0, 0, 0.85); display: flex;
    justify-content: center; align-items: center; z-index: 1000;
}
/* --- DELETED: Removed the fullscreen override rule for Konami/Clippy --- */


body {
    background-color: #000; color: #00FF41; font-family: 'VT323', monospace;
    font-size: 1.2rem;
    margin: 0;
}

#app-container {
    display: flex;
    flex-direction: row;
    height: 100vh;
    padding: 15px;
    box-sizing: border-box;
    gap: 15px;
}

#terminal {
    flex: 1;
    height: 100%;
    padding: 15px;
    box-sizing: border-box;
    overflow-y: auto;
    word-wrap: break-word;
    background-color: #050505;
    border: 1px solid #00FF41;
    -ms-overflow-style: none;
    scrollbar-width: none;
    color: inherit;
}
#terminal::-webkit-scrollbar { display: none; }

#help-menu {
    flex-basis: 380px;
    flex-shrink: 0;
    height: 100%;
    padding: 15px;
    box-sizing: border-box;
    background-color: #050505;
    border: 1px solid #00FF41;
    overflow-y: auto;
    line-height: 1.3;
    -ms-overflow-style: none;
    scrollbar-width: none;
    position: relative;
    color: inherit;
}
#help-menu::-webkit-scrollbar { display: none; }

#help-menu h3, #help-menu h4 {
    text-align: center;
    border-bottom: 1px solid #00FF41;
    padding-bottom: 8px;
    margin-top: 0;
    margin-bottom: 8px;
    color: #8affab;
}
#help-menu h4 {
     border-top: 1px dashed #555;
     border-bottom: none;
     padding-top: 10px;
     margin-top: 15px;
     margin-bottom: 5px;
}
#help-menu dl { margin: 0; padding: 0; }
#help-menu dt {
    font-weight: bold;
    color: #8affab;
    margin-top: 8px;
    transition: color 0.5s ease-out;
}
#help-menu dd {
    margin-left: 15px;
    margin-bottom: 5px;
    transition: color 0.5s ease-out;
}
#help-menu p {
    margin-top: 5px;
    margin-bottom: 10px;
}

#clippy-commands-section, #edit-page-commands-section {
    padding: 0;
    margin: 10px 0;
    border-radius: 5px;
}

.ascii-padlock {
    color: #555;
    font-family: 'VT323', monospace;
    font-size: 0.9em;
    line-height: 1.1;
    text-align: center;
    margin: 15px 0;
    white-space: pre;
    opacity: 1;
    transition: opacity 0.4s ease-out; /* Fade-out transition */
}
.ascii-padlock.fade-out {
    opacity: 0;
}


#output { white-space: pre-wrap; }
.skills-container {
    border: 1px solid #00FF41; padding: 0.5em 2ch; margin-top: 1em; max-width: 50ch;
}
.skills-table {
    width: 100%; border-collapse: collapse; margin-top: -20px;
}
.skills-table td { padding: 0; white-space: pre; line-height: 1.2; }
.skills-table .category-row td {
    border-top: 1px solid #00FF41; text-align: center; padding-top: 0.5em; padding-bottom: 0.5em;
}
.skills-table tr:first-child.category-row td {
    border-top: none; padding-top: 0; padding-bottom: 0.5em;
}
.skills-table .skill-name { width: 50%; }
a { color: inherit; text-decoration: underline; }
a:hover { color: #8affab; }

.prompt { margin-right: 10px; }
#input-line {
    display: flex;
    align-items: baseline; /* Align text baselines */
}
#input-field {
    white-space: pre-wrap;
    outline: none;
    min-height: 1.2rem; /* Matches font-size/line-height */
    display: inline-block; /* Keep for min-height */
    padding: 0;
    margin: 0;
}
#input-field:empty::before { /* Placeholder for empty state */
    content: "\feff"; /* Zero-width non-breaking space - forces height */
}

#suggestion-field { color: #555; }
#cursor {
    display: inline-block; width: 1ch; height: 1.1rem; background-color: #00FF41;
    margin-left: 0; /* Align directly next to input-field */
    animation: blink 1s step-end infinite;
    /* --- FIX: Adjust vertical alignment --- */
    vertical-align: text-bottom; /* Try aligning to bottom of text */
}
#cursor.underline {
    background-color: transparent; border-bottom: 2px solid #00FF41;
    width: 1ch; margin-left: -1ch; transform: translateY(-3px);
    vertical-align: initial; /* Reset vertical align for underline */
}

.locked-subcommand { color: #FF4136; }

.clickable-command dt {
    cursor: pointer;
    border: 1px dashed transparent;
    padding: 0 4px;
    margin-left: -4px;
    border-radius: 3px;
    transition: border-color 0.2s ease-out, background-color 0.2s ease-out;
    display: inline-block;
}
.clickable-command dt:hover {
    border-color: #00FF41;
    background-color: rgba(0, 255, 65, 0.1);
}

/* --- Inline Confirmation Styles --- */
.confirmation-prompt-container {
    margin-top: 0.5em;
    display: block;
    margin-left: 0;
    padding-left: 0;
}
.confirmation-prompt-container span:first-child {
     margin-right: 5px;
}
.confirm-btn {
    display: inline-block;
    padding: 2px 8px;
    margin: 0 4px;
    border: 1px solid #555;
    background-color: #333;
    color: #AAA;
    cursor: pointer;
    text-decoration: none !important;
    transition: background-color 0.2s, color 0.2s, border-color 0.2s, box-shadow 0.2s;
    border-radius: 3px;
    font-size: 0.9em;
    line-height: 1.2;
    box-shadow: none;
}
.confirm-btn:hover {
    background-color: #555;
    color: #FFF;
    border-color: #888;
    box-shadow: 0 0 8px #00FF41;
}


.clippy {
    position: fixed !important;
    top: 50px !important;
    right: calc(20px + 380px + 20px + 50px) !important;
    left: auto !important;
    bottom: auto !important;
    z-index: 6000 !important;
    cursor: pointer;
    transition: opacity 0.3s ease, transform 0.3s ease;
    transform: scale(1);
    opacity: 1;
}
.clippy.hidden { opacity: 0; transform: scale(0.5); pointer-events: none; }

.clippy-balloon {
    position: fixed !important;
    top: 100px !important;
    right: calc(20px + 380px + 20px + 50px + 200px) !important;
    left: auto !important;
    bottom: auto !important;
    z-index: 6000 !important;
    max-width: 450px;
}

.hidden { display: none !important; }
#konami-overlay {
    position: fixed; top: 0; left: 0; width: 100%; height: 100%;
    background-color: rgba(0, 0, 0, 0.9); display: flex;
    justify-content: center; align-items: center; z-index: 2000;
}
#gamepad {
    width: 300px; height: 130px; background-color: #444; border-radius: 10px;
    border: 2px solid #222; display: flex; align-items: center;
    justify-content: space-around; padding: 0 20px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.5);
    position: relative;
}
.close-button {
    position: absolute; top: 5px; right: 10px; color: #aaa;
    font-size: 1.5em; cursor: pointer; transition: color 0.2s;
}
.close-button:hover { color: #00FF41; }
.d-pad { position: relative; width: 60px; height: 60px; }
.d-pad .arrow { position: absolute; background: #222; }
.d-pad .up, .d-pad .down { width: 20px; height: 20px; left: 20px; }
.d-pad .left, .d-pad .right { width: 20px; height: 20px; top: 20px; }
.d-pad .up { top: 0; }
.d-pad .down { bottom: 0; }
.d-pad .left { left: 0; }
.d-pad .right { right: 0; }
.d-pad .center-pad { position: absolute; width: 20px; height: 20px; top: 20px; left: 20px; background: #333; }
.action-buttons {
    display: flex; gap: 10px; position: absolute;
    bottom: 10px; left: 50%; transform: translateX(-50%);
}
.button-group { display: flex; flex-direction: column; align-items: center; }
.button-label { font-size: 0.7em; color: #aaa; margin-bottom: 2px; }
.button.select, .button.start { width: 30px; height: 15px; background: #222; border-radius: 10px; }
.face-buttons { display: flex; align-items: center; gap: 10px; }
.face-buttons .button { width: 40px; height: 40px; border-radius: 50%; color: white; display: flex; justify-content: center; align-items: center; font-weight: bold; border: 2px solid #222; }
.b-button { background-color: #d9534f; }
.a-button { background-color: #428bca; }
#gamepad .d-pad .arrow, #gamepad .action-buttons .button, #gamepad .face-buttons .button {
    cursor: pointer; transition: all 0.1s ease-in-out;
}
/* Gamepad Hover Glow */
#gamepad .d-pad .arrow:hover, #gamepad .action-buttons .button:hover, #gamepad .face-buttons .button:hover {
    box-shadow: 0 0 12px #00FF41;
}
#gamepad .d-pad .arrow:active, #gamepad .action-buttons .button:active, #gamepad .face-buttons .button:active {
    transform: scale(0.92); box-shadow: 0 0 5px #00FF41;
}

/* --- Modal Styles --- */
.modal {
    position: fixed;
    left: 0; top: 0; width: 100%; height: 100%;
    background-color: rgba(0, 0, 0, 0.8);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 5000;
    color: #00FF41;
    font-family: 'VT323', monospace;
}
#captcha-modal {
    z-index: 5500;
}
#email-modal {
    z-index: 5400;
}


.modal-content, .captcha-modal-content, .email-modal-content {
    background-color: #050505;
    padding: 20px 30px;
    border: 1px solid #00FF41;
    min-width: 300px;
    text-align: center;
    box-shadow: 0 0 20px rgba(0, 255, 65, 0.5);
}

.email-modal-content {
    min-width: 450px;
    text-align: left;
}


.modal-content h4, .captcha-modal-content h4, .email-modal-content h4 {
    margin-top: 0;
    border-bottom: 1px solid #00FF41;
    padding-bottom: 10px;
    color: #8affab;
    text-align: center;
    margin-bottom: 20px;
}

/* --- Redesigned Color Picker --- */
#color-options {
    display: grid;
    grid-template-columns: repeat(3, 1fr); /* Force 3 columns */
    gap: 15px;
    justify-content: center;
    margin: 20px 0;
    max-width: 300px;
    margin-left: auto;
    margin-right: auto;
}
.color-button {
    display: flex;
    flex-direction: column;
    align-items: center;
    border: 1px solid #555;
    background-color: transparent;
    padding: 5px;
    cursor: pointer;
    transition: transform 0.1s ease-out, box-shadow 0.2s;
    color: #AAA;
}
.color-swatch {
    width: 40px;
    height: 40px;
    border: 1px solid #333;
    margin-bottom: 5px;
}
.color-name {
    font-size: 0.9em;
    white-space: normal;
    text-align: center;
    max-width: 70px;
    line-height: 1.1;
}
.color-button:hover {
    transform: scale(1.05);
    box-shadow: 0 0 10px #00FF41;
    color: #00FF41;
    border-color: #00FF41;
}
#color-picker-cancel {
    background-color: #333;
    color: #AAA;
    border: 1px solid #555;
    padding: 8px 15px;
    cursor: pointer;
    margin-top: 10px;
    font-family: inherit;
    font-size: 1rem;
    transition: background-color 0.2s, color 0.2s, box-shadow 0.2s;
}
#color-picker-cancel:hover {
    background-color: #555;
    color: #FFF;
    box-shadow: 0 0 10px #00FF41;
}

/* --- Email Form Styles --- */
.email-form { }
.email-form label {
    display: block;
    margin-bottom: 12px;
    color: #8affab;
}
.email-form input[type="email"],
.email-form input[type="text"],
.email-form textarea,
.email-form select {
    display: block;
    width: 100%;
    background-color: #111;
    border: 1px solid #444;
    color: #00FF41;
    font-family: inherit;
    font-size: 1rem;
    padding: 6px 9px;
    margin-top: 4px;
    box-sizing: border-box;
}
.email-form select {
     appearance: none;
     background-image: url('data:image/svg+xml;charset=US-ASCII,%3Csvg%20xmlns%3D%22http%3A//www.w3.org/2000/svg%22%20width%3D%22292.4%22%20height%3D%22292.4%22%3E%3Cpath%20fill%3D%22%2300FF41%22%20d%3D%22M287%2069.4a17.6%2017.6%200%200%200-13-5.4H18.4c-5%200-9.3%201.8-12.9%205.4A17.6%2017.6%200%200%200%200%2082.2c0%205%201.8%209.3%205.4%2012.9l128%20127.9c3.6%203.6%207.8%205.4%2012.8%205.4s9.2-1.8%2012.8-5.4L287%2095c3.5-3.5%205.4-7.8%205.4-12.8%200-5-1.9-9.2-5.5-12.8z%22/%3E%3C/svg%3E');
     background-repeat: no-repeat;
     background-position: right .7em top 50%;
     background-size: .65em auto;
     padding-right: 2em;
     cursor: pointer;
}
.email-form .subject-other {
     margin-top: 8px;
}

.email-form textarea {
    min-height: 100px;
    resize: vertical;
}
/* Character Counter Style */
.char-counter {
    display: block;
    text-align: right;
    font-size: 0.8em;
    color: #888;
    margin-top: 2px;
}
/* Warning color for character counter */
.char-counter.warning {
    color: #FF4136; /* Red */
    font-weight: bold;
}


/* Modal Controls Layout */
.modal-controls {
    display: flex;
    justify-content: space-around;
    margin-top: 20px;
}

.email-form button { /* General button style for modal */
    background-color: #333;
    color: #AAA;
    border: 1px solid #555;
    padding: 8px 18px;
    cursor: pointer;
    font-family: inherit;
    font-size: 1rem;
    transition: background-color 0.2s, color 0.2s, box-shadow 0.2s;
    border-radius: 3px;
    box-shadow: none;
}
/* Add glow on hover for email buttons */
.email-form button:hover:not(:disabled) {
    background-color: #555;
    color: #FFF;
    box-shadow: 0 0 10px #00FF41;
}
.email-form button:disabled {
    background-color: #222;
    color: #555;
    border-color: #333;
    cursor: not-allowed;
    box-shadow: none;
}
#email-cancel-button {
    background-color: #442222;
    border-color: #663333;
}
#email-cancel-button:hover {
     background-color: #663333;
     border-color: #884444;
}

.form-status {
    margin-top: 15px;
    font-style: italic;
    text-align: center;
    min-height: 1.2em;
}
.form-status.success { color: #8affab; }
.form-status.error { color: #FF4136; }


/* --- CAPTCHA Styles --- */
.captcha-modal-content {
    max-width: 400px;
}

#captcha-prompt {
    margin-bottom: 15px;
    font-size: 1.1em;
}

#captcha-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
    margin-bottom: 20px;
}

.captcha-image-container {
    position: relative;
    border: 2px solid #555;
    cursor: pointer;
    transition: transform 0.1s ease-out, box-shadow 0.2s ease-out;
    overflow: hidden;
    aspect-ratio: 1 / 1;
    background-color: #000; /* Dark bg for letterboxing */
}
.captcha-image-container img {
    display: block;
    width: 100%;
    height: 100%;
    /* --- FIX: Change object-fit --- */
    object-fit: cover; /* Cover the area, may crop slightly */
}
.captcha-image-container:hover {
    box-shadow: 0 0 10px #00FF41;
    border-color: #00FF41;
}

.captcha-image-container.selected {
    transform: scale(0.95);
    border-color: #8affab;
    box-shadow: 0 0 15px #8affab;
}

.captcha-image-container.selected::after {
    content: '✔';
    position: absolute;
    bottom: 5px;
    right: 5px;
    font-size: 1.5em;
    color: #00FF41;
    background-color: rgba(0, 0, 0, 0.6);
    border-radius: 50%;
    padding: 0 4px;
    line-height: 1;
    text-shadow: 1px 1px 2px black;
}

/* Container for Status Messages */
#captcha-status-messages {
    min-height: 1.5em; /* Reserve space */
    margin-bottom: 15px; /* Space between status and buttons */
    text-align: center; /* Center status text */
}

#captcha-loading {
    font-style: italic;
    color: #AAA;
}
#captcha-result {
    font-weight: bold;
}
#captcha-result.success {
    color: #8affab;
}
#captcha-result.error {
    color: #FF4136;
}


/* Centered CAPTCHA Buttons */
#captcha-controls {
    display: flex;
    justify-content: center; /* Center buttons horizontally */
    align-items: center;
    gap: 20px; /* Space between buttons */
    margin-top: 10px; /* Adjusted from margin-bottom */
}

#captcha-verify, #captcha-cancel {
    background-color: #333;
    color: #AAA;
    border: 1px solid #555;
    padding: 8px 15px;
    cursor: pointer;
    font-family: inherit;
    font-size: 1rem;
    transition: background-color 0.2s, color 0.2s, box-shadow 0.2s; /* Add box-shadow */
    box-shadow: none; /* Default no shadow */
}
/* Glow on Hover for CAPTCHA buttons */
#captcha-verify:hover:not(:disabled), #captcha-cancel:hover {
    background-color: #555;
    color: #FFF;
    box-shadow: 0 0 10px #00FF41;
}
#captcha-verify:disabled {
    background-color: #222;
    color: #555;
    border-color: #333;
    cursor: not-allowed;
    box-shadow: none;
}

/* --- Hide Mobile Container on Desktop --- */
#mobile-app-container {
    display: none !important; /* Ensure it's hidden */
}

/* Make sure the desktop container is visible */
#app-container {
    display: flex; /* Or whatever its default display was */
    /* ... other desktop styles ... */
}

@keyframes blink {
    from, to { opacity: 1; }
    50% { opacity: 0; }
}