body {
    font-family: 'Press Start 2P', cursive;
    /* A retro-style font, will need to be imported */
    color: #fff;
    background-color: #1a1a1a;
    background-image: url('../assets/background.jpeg');
    background-size: cover;
    background-repeat: no-repeat;
    background-attachment: fixed;
    margin: 0;
    padding: 20px;
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
}

.container {
    width: 100%;
    max-width: 800px;
    padding: 20px;
    border: 4px solid #fff;
    box-shadow: 0 0 15px #fff;
    background-color: #000;
}

header {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
}

header h1 {
    text-align: center;
    font-size: 2.5em;
    margin-bottom: 40px;
    margin-top: 40px;
    /* Make space for controls on mobile if needed, or just spacing */
    text-transform: uppercase;
    letter-spacing: 4px;
    line-height: 1.2;
}

.header-controls {
    position: absolute;
    top: 0;
    right: 0;
    display: flex;
    gap: 10px;
}

.header-controls .btn {
    background-color: #000;
    color: #0f0;
    border: 2px solid #0f0;
    padding: 8px 12px;
    font-family: 'Press Start 2P', cursive;
    font-size: 0.7em;
    cursor: pointer;
    transition: all 0.3s ease;
    text-transform: uppercase;
    box-shadow: 0 0 5px rgba(0, 255, 0, 0.3);
}

.header-controls .btn:hover {
    background-color: #0f0;
    color: #000;
    box-shadow: 0 0 15px rgba(0, 255, 0, 0.8);
    transform: translateY(-2px);
}

.header-controls .btn:active {
    transform: translateY(0);
}

#mission-selection h2 {
    text-align: center;
    font-size: 1.8em;
    margin-bottom: 20px;
}

#mission-list {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.mission-button {
    width: 100%;
    padding: 15px;
    font-size: 1.2em;
    font-family: inherit;
    background-color: #333;
    color: #fff;
    border: 2px solid #fff;
    cursor: pointer;
    transition: background-color 0.3s, color 0.3s;
}

.mission-button:hover {
    background-color: #fff;
    color: #000;
}

.hidden {
    display: none;
}

#dynamic-form {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

#nirdy-container {
    position: fixed;
    bottom: 20px;
    right: 20px;
    width: 150px;
    height: 150px;
    z-index: 1000;
}

#confirmation-section {
    text-align: center;
}

#confirmation-section h2 {
    font-size: 2em;
    color: #0f0;
    margin-bottom: 20px;
}

/* ============================================================================
   FORM STYLING
   ============================================================================ */

.form-container {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.form-group label {
    font-size: 0.8em;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: #0f0;
}

.form-group .required {
    color: #f00;
}

.form-group input,
.form-group textarea,
.form-group select {
    background-color: #222;
    color: #0f0;
    border: 2px solid #0f0;
    padding: 10px;
    font-family: 'Courier New', monospace;
    font-size: 0.9em;
    box-sizing: border-box;
}

.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
    outline: none;
    background-color: #111;
    border-color: #fff;
    box-shadow: 0 0 10px #0f0;
}

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

.form-group input::placeholder,
.form-group textarea::placeholder {
    color: #0f0;
    opacity: 0.5;
}

.help-text {
    font-size: 0.7em;
    color: #888;
    font-family: 'Courier New', monospace;
}

.form-actions {
    display: flex;
    gap: 10px;
    justify-content: center;
    margin-top: 20px;
}

.btn {
    padding: 15px 30px;
    font-size: 1em;
    font-family: 'Press Start 2P', cursive;
    border: 2px solid #fff;
    cursor: pointer;
    text-transform: uppercase;
    transition: all 0.3s;
}

.btn-submit {
    background-color: #0f0;
    color: #000;
}

.btn-submit:hover {
    background-color: #00f;
    color: #fff;
    border-color: #00f;
    box-shadow: 0 0 10px #00f;
}

.btn-cancel {
    background-color: #333;
    color: #fff;
}

.btn-cancel:hover {
    background-color: #f00;
    color: #fff;
    border-color: #f00;
    box-shadow: 0 0 10px #f00;
}

.btn-primary {
    background-color: #0f0;
    color: #000;
}

.btn-primary:hover {
    background-color: #00f;
    color: #fff;
    border-color: #00f;
    box-shadow: 0 0 10px #00f;
}

/* Highlight class for important numbers */
.highlight {
    color: #00f;
    font-weight: bold;
}

/* Code style for Agent IDs */
code {
    background-color: #111;
    color: #0f0;
    padding: 5px 10px;
    border: 1px solid #0f0;
    display: inline-block;
    font-family: 'Courier New', monospace;
}

/* Responsive form styling */
@media (max-width: 768px) {

    .form-group input,
    .form-group textarea,
    .form-group select {
        font-size: 1em;
    }

    .btn {
        font-size: 0.8em;
        padding: 12px 20px;
    }

    .form-actions {
        flex-direction: column;
    }
}

/* Status bar and badges in main stylesheet (fallback if animations.js not loaded) */
#status-bar {
    display: flex;
    gap: 16px;
    align-items: center;
    justify-content: center;
    margin: 16px 0;
}

#xp-display {
    color: #0f0;
    border: 2px solid #0f0;
    padding: 8px 12px;
    background: #000;
}

#badges-container {
    display: flex;
    gap: 8px;
    align-items: center;
}

.badge {
    background: #111;
    color: #0f0;
    border: 2px solid #0f0;
    padding: 6px 10px;
    border-radius: 6px;
    font-size: 12px;
    display: flex;
    gap: 6px;
    align-items: center;
}

.badge-placeholder {
    color: #888;
    font-size: 12px;
}

/* ============================================================================
   STAT BARS
   ============================================================================ */
.stats-grid {
    display: flex;
    flex-direction: column;
    gap: 15px;
    margin: 20px 0;
    background: #000;
    padding: 15px;
    border: 2px solid #fff;
}

.stat-row {
    display: flex;
    align-items: center;
    gap: 15px;
}

.stat-icon {
    font-size: 24px;
    width: 30px;
    text-align: center;
    filter: drop-shadow(0 0 5px rgba(255, 255, 255, 0.5));
}

.stat-bar-container {
    flex-grow: 1;
    height: 24px;
    background-color: #222;
    border: 2px solid #555;
    position: relative;
    overflow: hidden;
}

.stat-bar {
    height: 100%;
    width: 0%;
    /* Will be set by JS */
    transition: width 1.5s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
}

/* Scanline effect for bars */
.stat-bar::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(to bottom,
            rgba(255, 255, 255, 0.2) 0%,
            transparent 50%,
            rgba(0, 0, 0, 0.2) 100%);
}

/* Specific Colors */
.stat-responsibility .stat-bar {
    background-color: #ff4d4d;
    box-shadow: 0 0 10px #ff4d4d;
}

/* Red - Heart */

.stat-durability .stat-bar {
    background-color: #00e5ff;
    box-shadow: 0 0 10px #00e5ff;
}

/* Cyan - Speed/Lightning */

.stat-inclusion .stat-bar {
    background-color: #ffd700;
    box-shadow: 0 0 10px #ffd700;
}

/* Gold - Star */

.stat-value {
    margin-left: 10px;
    color: #fff;
    font-family: 'Courier New', monospace;
    font-weight: bold;
    min-width: 30px;
    text-align: right;
}

/* ============================================================================
   ACHIEVEMENT ANIMATIONS
   ============================================================================ */
@keyframes slideInRight {
    from {
        transform: translateX(400px);
        opacity: 0;
    }

    to {
        transform: translateX(0);
        opacity: 1;
    }
}

@keyframes slideOutRight {
    from {
        transform: translateX(0);
        opacity: 1;
    }

    to {
        transform: translateX(400px);
        opacity: 0;
    }
}

@keyframes pulse {

    0%,
    100% {
        transform: scale(1);
    }

    50% {
        transform: scale(1.05);
    }
}

.achievement-popup {
    animation: slideInRight 0.5s ease-out;
}

/* ============================================================================
   MODAL DIALOG
   ============================================================================ */
.modal {
    display: none;
    position: fixed;
    z-index: 10001;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0, 0, 0, 0.9);
    animation: fadeIn 0.3s;
}

.modal.show {
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-content {
    background-color: #0a0a0a;
    background-image:
        linear-gradient(rgba(18, 16, 16, 0) 50%, rgba(0, 0, 0, 0.25) 50%),
        linear-gradient(90deg, rgba(255, 0, 0, 0.06), rgba(0, 255, 0, 0.02), rgba(0, 0, 255, 0.06));
    background-size: 100% 2px, 3px 100%;
    border: 2px solid #0f0;
    padding: 30px;
    border-radius: 4px;
    max-width: 650px;
    width: 90%;
    position: relative;
    box-shadow: 0 0 20px rgba(0, 255, 0, 0.4), inset 0 0 20px rgba(0, 255, 0, 0.1);
    animation: slideDown 0.5s ease-out;
    font-family: 'Courier New', monospace;
}

.modal-content h2 {
    text-transform: uppercase;
    letter-spacing: 2px;
    border-bottom: 1px solid #0f0;
    padding-bottom: 15px;
    text-shadow: 0 0 5px #0f0;
}

.modal-content ul li {
    margin-bottom: 8px;
    padding-left: 20px;
    position: relative;
}

.modal-content ul li::before {
    content: '>';
    position: absolute;
    left: 0;
    color: #0f0;
    font-weight: bold;
}

.modal-hint-box {
    background: #000;
    border: 1px dashed #ffd700;
    padding: 15px;
    margin-top: 20px;
    position: relative;
}

.modal-hint-box::before {
    content: 'SECRET_DATA';
    position: absolute;
    top: -10px;
    left: 10px;
    background: #000;
    padding: 0 5px;
    color: #ffd700;
    font-size: 0.8em;
}

.modal-close {
    color: #0f0;
    float: right;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
    line-height: 20px;
    transition: all 0.3s;
    text-shadow: 0 0 5px #0f0;
}

.modal-close:hover,
.modal-close:focus {
    color: #fff;
    text-shadow: 0 0 10px #fff;
    transform: scale(1.1);
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

@keyframes slideDown {
    from {
        transform: translateY(-100px);
        opacity: 0;
    }

    to {
        transform: translateY(0);
        opacity: 1;
    }
}