/* ============================================================================
   MUD GAME TERMINAL STYLES
   Retro terminal aesthetic matching the site theme
   ============================================================================ */

.mud-game-section {
    border-top: 1px solid #00ff41;
    padding-top: 1rem;
    margin-top: 2rem;
    margin-bottom: 2rem;
}

.mud-terminal {
    background: rgba(0, 0, 0, 0.95);
    border: 2px solid #00ff41;
    box-shadow: 0 0 20px rgba(0, 255, 65, 0.3);
    margin-top: 1rem;
    display: flex;
    flex-direction: column;
    height: 600px;
    position: relative;
    overflow: hidden;
    font-family: 'JetBrains Mono', 'Courier New', monospace;
}

.mud-terminal-header {
    background: rgba(0, 255, 65, 0.1);
    border-bottom: 1px solid #00ff41;
    padding: 0.8rem 1rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-shrink: 0;
}

.mud-title {
    color: #00ff41;
    font-weight: 700;
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.mud-status {
    color: #ff0080;
    font-size: 0.8rem;
    font-weight: 700;
    text-transform: uppercase;
    padding: 0.2rem 0.5rem;
    border: 1px solid #ff0080;
    animation: statusPulse 2s infinite;
}

@keyframes statusPulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.6; }
}

.mud-terminal-screen {
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
    padding: 1rem;
    background: rgba(0, 0, 0, 0.98);
    color: #00ff41;
    font-size: 0.9rem;
    line-height: 1.5;
    scroll-behavior: smooth;
}

.mud-terminal-screen::-webkit-scrollbar {
    width: 8px;
}

.mud-terminal-screen::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.5);
}

.mud-terminal-screen::-webkit-scrollbar-thumb {
    background: #00ff41;
    border-radius: 4px;
}

.mud-terminal-screen::-webkit-scrollbar-thumb:hover {
    background: #00ff66;
}

.mud-output-content {
    white-space: pre-wrap;
    word-wrap: break-word;
    font-family: 'Courier New', 'Courier', monospace;
    font-variant-ligatures: none;
    font-feature-settings: normal;
}

.mud-output-line {
    margin-bottom: 0.5rem;
    animation: fadeIn 0.2s ease-in;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(-5px); }
    to { opacity: 1; transform: translateY(0); }
}

.mud-command-echo {
    color: #00ffff;
    font-weight: 700;
    display: block;
    margin-bottom: 0.5rem;
}

/* Output type styling */
.mud-output-command {
    color: #00ffff;
}

.mud-output-error {
    color: #ff3366;
    font-weight: 700;
}

.mud-output-success {
    color: #00ff88;
    font-weight: 700;
}

.mud-output-info {
    color: #00ff41;
}

.mud-output-combat {
    color: #ff9900;
    font-weight: 700;
}

.mud-output-dialogue {
    color: #ffff66;
    font-style: italic;
}

.mud-output-help {
    color: #00ffff;
}

.mud-output-look {
    color: #00ff41;
}

/* Special text styling */
.location-name {
    color: #ff0080;
    font-weight: 700;
    font-size: 1.1rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    display: block;
    text-shadow: 0 0 10px #ff0080;
}

.exits {
    color: #00ffff;
    font-weight: 700;
    display: block;
    margin-top: 0.5rem;
}

.npcs {
    color: #ffff66;
    display: block;
    margin-top: 0.3rem;
}

.items {
    color: #ff9900;
    display: block;
    margin-top: 0.3rem;
}

.danger {
    color: #ff0000;
    font-weight: 700;
    font-size: 1.1rem;
    text-shadow: 0 0 10px #ff0000;
    animation: dangerBlink 1s infinite;
    display: block;
    margin: 1rem 0;
}

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

.victory {
    color: #00ff00;
    font-weight: 700;
    font-size: 1.1rem;
    text-shadow: 0 0 10px #00ff00;
    display: block;
    margin: 0.5rem 0;
}

.death {
    color: #ff0000;
    font-weight: 700;
    font-size: 1.3rem;
    text-shadow: 0 0 20px #ff0000;
    animation: deathShake 0.5s;
    display: block;
    margin: 1rem 0;
}

@keyframes deathShake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-10px); }
    75% { transform: translateX(10px); }
}

.levelup {
    color: #ffff00;
    font-weight: 700;
    font-size: 1.1rem;
    text-shadow: 0 0 15px #ffff00;
    animation: levelupGlow 0.5s;
    display: block;
    margin: 0.5rem 0;
}

@keyframes levelupGlow {
    0%, 100% { text-shadow: 0 0 15px #ffff00; }
    50% { text-shadow: 0 0 30px #ffff00; }
}

.inventory-header,
.stats-header,
.help-header,
.map-header,
.shop-header,
.quests-header,
.quest-board-header {
    color: #ff0080;
    font-weight: 700;
    font-size: 1rem;
    text-transform: uppercase;
    letter-spacing: 2px;
    display: block;
    margin-bottom: 0.5rem;
}

.gold {
    color: #ffcc00;
    font-weight: 700;
}

.help-commands {
    color: #00ff41;
    line-height: 1.8;
    font-family: 'Courier New', 'Courier', monospace;
    white-space: pre;
    font-variant-ligatures: none;
    font-feature-settings: normal;
}

.map-ascii {
    color: #00ffff;
    font-family: 'Courier New', 'Courier', monospace;
    font-size: 0.85rem;
    display: block;
    white-space: pre;
    overflow-x: auto;
    text-align: left;
    margin: 1rem 0;
    line-height: 1.2;
    letter-spacing: 0;
    font-variant-ligatures: none;
    font-feature-settings: normal;
}

.intro {
    color: #00ff41;
    font-weight: 700;
    text-shadow: 0 0 10px #00ff41;
    display: block;
    text-align: center;
}

.reset {
    color: #ff9900;
    font-weight: 700;
    display: block;
}

.tab-completion {
    color: #888;
    font-style: italic;
    display: block;
}

/* Terminal input */
.mud-terminal-input {
    border-top: 1px solid #00ff41;
    padding: 1rem;
    background: rgba(0, 0, 0, 0.95);
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-shrink: 0;
}

.mud-prompt {
    color: #ff0080;
    font-weight: 700;
    font-size: 1.2rem;
    flex-shrink: 0;
}

.mud-input {
    flex: 1;
    background: transparent;
    border: none;
    color: #00ff41;
    font-family: 'JetBrains Mono', 'Courier New', monospace;
    font-size: 1rem;
    outline: none;
    caret-color: #00ff41;
}

.mud-input::placeholder {
    color: rgba(0, 255, 65, 0.4);
}

.mud-input:focus {
    outline: none;
}

/* Mobile responsiveness */
@media (max-width: 768px) {
    .mud-terminal {
        height: 500px;
    }

    .mud-terminal-screen {
        font-size: 0.8rem;
        padding: 0.75rem;
    }

    .mud-title {
        font-size: 0.8rem;
    }

    .mud-status {
        font-size: 0.7rem;
    }

    .mud-input {
        font-size: 0.9rem;
    }

    .location-name {
        font-size: 1rem;
    }

    .mud-terminal-input {
        padding: 0.75rem;
    }
}

@media (max-width: 480px) {
    .mud-terminal {
        height: 400px;
    }

    .mud-terminal-screen {
        font-size: 0.75rem;
        padding: 0.5rem;
    }

    .mud-input {
        font-size: 0.85rem;
    }
}

/* Mobile landscape optimization */
@media (max-height: 500px) and (orientation: landscape) {
    .mud-terminal {
        height: 90vh;
        max-height: none;
    }

    .mud-terminal-header {
        padding: 0.4rem 0.75rem;
    }

    .mud-title {
        font-size: 0.75rem;
    }

    .mud-status {
        font-size: 0.65rem;
        padding: 0.1rem 0.3rem;
    }

    .mud-terminal-screen {
        font-size: 0.7rem;
        padding: 0.5rem;
        line-height: 1.3;
    }

    .mud-terminal-input {
        padding: 0.4rem 0.75rem;
    }

    .mud-input {
        font-size: 0.75rem;
    }

    .mud-prompt {
        font-size: 1rem;
    }

    .location-name {
        font-size: 0.9rem;
    }

    .map-ascii {
        font-size: 0.65rem;
        line-height: 1.1;
    }

    .help-commands {
        font-size: 0.7rem;
        line-height: 1.5;
    }
}

/* Tablet landscape */
@media (min-width: 768px) and (max-width: 1024px) and (orientation: landscape) {
    .mud-terminal {
        height: 80vh;
    }

    .mud-terminal-screen {
        font-size: 0.85rem;
    }
}

/* Better ASCII table alignment */
.stats-header,
.inventory-header,
.help-header,
.map-header {
    font-family: 'Courier New', 'Courier', monospace;
    white-space: pre;
    font-variant-ligatures: none;
}

/* Scrollable ASCII for small screens */
@media (max-width: 768px) {
    .map-ascii {
        overflow-x: scroll;
        -webkit-overflow-scrolling: touch;
    }

    .help-commands {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }
}

/* Cursor blink effect */
@keyframes cursorBlink {
    0%, 100% { opacity: 1; }
    50% { opacity: 0; }
}

.mud-input:focus::after {
    content: '█';
    animation: cursorBlink 1s infinite;
    margin-left: 2px;
}

/* Glitch effect for title (optional) */
@keyframes glitch {
    0% { transform: translate(0); }
    20% { transform: translate(-2px, 2px); }
    40% { transform: translate(-2px, -2px); }
    60% { transform: translate(2px, 2px); }
    80% { transform: translate(2px, -2px); }
    100% { transform: translate(0); }
}

.mud-title:hover {
    animation: glitch 0.3s;
}

/* Scanline effect */
.mud-terminal::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: repeating-linear-gradient(
        0deg,
        transparent,
        transparent 2px,
        rgba(0, 255, 65, 0.02) 2px,
        rgba(0, 255, 65, 0.02) 4px
    );
    pointer-events: none;
    z-index: 10;
}

/* Screen glow effect */
.mud-terminal::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: radial-gradient(
        ellipse at center,
        rgba(0, 255, 65, 0.05) 0%,
        transparent 70%
    );
    pointer-events: none;
    z-index: 9;
}
