:root {
    --neon-green: #00ff41;
    --neon-orange: #f39c12;
    --neon-blue: #3498db;
    --neon-red: #e74c3c;
    --bg-darker: #050505;
    --bg-surface: rgba(20, 20, 20, 0.8);
    --border-color: rgba(0, 255, 65, 0.2);
    --glass-bg: rgba(255, 255, 255, 0.03);
    --font-main: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    --font-mono: 'JetBrains Mono', 'Fira Code', 'Courier New', monospace;
}

* {
    box-sizing: border-box;
    scrollbar-width: thin;
    scrollbar-color: var(--neon-green) var(--bg-darker);
}

body {
    background-color: var(--bg-darker);
    background-image:
        radial-gradient(circle at 50% 50%, rgba(0, 255, 65, 0.05) 0%, transparent 70%),
        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% 100%, 100% 2px, 3px 100%;
    color: #e0e0e0;
    font-family: var(--font-main);
    margin: 0;
    padding: clamp(10px, 2vw, 20px);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* Scrollbar Styles */
::-webkit-scrollbar {
    width: 4px;
}

::-webkit-scrollbar-track {
    background: var(--bg-darker);
}

::-webkit-scrollbar-thumb {
    background: var(--border-color);
    border-radius: 2px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--neon-green);
}

.tutorial-section {
    backdrop-filter: blur(10px);
    background: var(--glass-bg);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: clamp(15px, 2vw, 24px);
    margin-bottom: clamp(10px, 2vw, 24px);
    max-width: 900px;
    width: 100%;
    margin-left: auto;
    margin-right: auto;
    box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.37);
    flex-shrink: 0;
}

#mud-app-root {
    max-width: 1100px;
    width: 100%;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    gap: 15px;
    flex: 1;
    min-height: 0;
}

.mud-container {
    display: grid;
    grid-template-columns: 1fr minmax(240px, 300px);
    grid-template-rows: auto auto 1fr auto;
    gap: 0;
    border: 1px solid var(--border-color);
    border-radius: 16px;
    background: var(--bg-surface);
    backdrop-filter: blur(16px);
    overflow: hidden;
    flex: 1;
    min-height: 500px;
    box-shadow: 0 0 40px rgba(0, 255, 65, 0.05);
}

.mud-header {
    grid-column: 1 / -1;
    padding: clamp(10px, 1.5vw, 20px);
    background: linear-gradient(90deg, #111, #1a1a1a);
    border-bottom: 1px solid var(--border-color);
    text-align: center;
}

.mud-title-main {
    font-size: clamp(1.1rem, 2vw, 1.5rem);
    font-weight: 800;
    color: var(--neon-orange);
    text-transform: uppercase;
    letter-spacing: 4px;
    text-shadow: 0 0 10px rgba(243, 156, 18, 0.3);
}

.mud-title-sub {
    font-size: clamp(0.7rem, 1vw, 0.8rem);
    color: var(--neon-green);
    opacity: 0.8;
}

.mud-status-bar {
    grid-column: 1 / -1;
    display: flex;
    justify-content: space-around;
    padding: 10px;
    background: rgba(0, 0, 0, 0.4);
    border-bottom: 1px solid var(--border-color);
    flex-wrap: wrap;
}

.mud-status-item {
    display: flex;
    align-items: center;
    gap: 10px;
    font-family: var(--font-mono);
    font-size: clamp(0.75rem, 1vw, 0.9rem);
    padding: 5px;
}

.mud-val-container {
    width: clamp(80px, 10vw, 120px);
    height: 8px;
    background: #222;
    border-radius: 4px;
    overflow: hidden;
    position: relative;
}

.mud-progress {
    height: 100%;
    transition: width 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

.progress-hp {
    background: var(--neon-red);
    box-shadow: 0 0 10px var(--neon-red);
}

.progress-en {
    background: var(--neon-blue);
    box-shadow: 0 0 10px var(--neon-blue);
}

.mud-side-panel {
    grid-column: 2;
    grid-row: 3 / 5;
    background: rgba(0, 0, 0, 0.2);
    border-left: 1px solid var(--border-color);
    padding: 20px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.panel-title {
    font-size: 0.75rem;
    color: var(--neon-green);
    text-transform: uppercase;
    letter-spacing: 2px;
    margin-bottom: 10px;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 5px;
}

.log-entry {
    font-size: 0.8rem;
    color: #888;
    margin-bottom: 8px;
    font-family: var(--font-mono);
}

.mud-chat-box {
    grid-column: 1;
    height: 100%;
    overflow-y: auto;
    padding: clamp(15px, 2.5vw, 30px);
    display: flex;
    flex-direction: column;
    gap: 20px;
    background: radial-gradient(circle at bottom right, rgba(0, 255, 65, 0.02) 0%, transparent 60%);
}

.mud-msg {
    max-width: 90%;
    padding: clamp(12px, 1.5vw, 18px);
    border-radius: 8px;
    line-height: 1.6;
    font-size: clamp(0.85rem, 1vw, 0.95rem);
    position: relative;
    animation: fadeIn 0.3s ease-out;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

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

.mud-user {
    align-self: flex-end;
    background: rgba(0, 255, 65, 0.05);
    border: 1px solid var(--neon-green);
    color: var(--neon-green);
    border-bottom-right-radius: 0;
}

.mud-ai {
    align-self: flex-start;
    background: rgba(255, 255, 255, 0.03);
    border-left: 4px solid var(--neon-green);
    color: #eee;
    border-top-left-radius: 0;
}

.mud-input-area {
    grid-column: 1;
    padding: clamp(12px, 1.5vw, 20px);
    background: rgba(0, 0, 0, 0.4);
    display: flex;
    gap: clamp(10px, 1.5vw, 15px);
    border-top: 1px solid var(--border-color);
}

.mud-input-area input {
    flex: 1;
    background: #000;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: clamp(10px, 1vw, 14px) clamp(15px, 1.5vw, 20px);
    color: #fff;
    font-family: var(--font-mono);
    font-size: clamp(0.85rem, 1vw, 1rem);
    outline: none;
    transition: 0.3s;
}

.mud-input-area input:focus {
    border-color: var(--neon-green);
    box-shadow: 0 0 15px rgba(0, 255, 65, 0.1);
}

.mud-input-area button {
    background: var(--neon-green);
    color: #000;
    border: none;
    border-radius: 8px;
    padding: 0 clamp(20px, 3vw, 40px);
    font-weight: 900;
    text-transform: uppercase;
    letter-spacing: 1px;
    cursor: pointer;
    transition: 0.3s;
    font-size: clamp(0.75rem, 0.9vw, 1rem);
}

.mud-input-area button:hover {
    background: #00cc33;
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0, 255, 65, 0.3);
}

.mud-settings {
    padding: clamp(8px, 1vw, 15px) clamp(15px, 1.5vw, 20px);
    background: #111;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.mud-row {
    width: 100%;
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    align-items: center;
}

.mud-row input,
.mud-row select {
    background: #000;
    border: 1px solid #333;
    border-radius: 4px;
    padding: 8px 12px;
    color: #aaa;
    font-size: 0.8rem;
    flex: 1;
    min-width: 120px;
}

.mud-btn {
    border-radius: 6px;
    font-size: 0.75rem;
    padding: 8px 12px;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.mud-btn-save {
    background: #1a3a5a;
    color: #3498db;
}

.mud-btn-load {
    background: #3a1a5a;
    color: #8e44ad;
}

.mud-btn-clear {
    background: #5a1a1a;
    color: #e74c3c;
}

.mud-loading {
    color: var(--neon-green);
    font-family: var(--font-mono);
    font-size: 0.8rem;
    margin: 10px 0;
    text-align: center;
    letter-spacing: 2px;
}

/* Utilities */
.text-neon {
    color: var(--neon-green);
    text-shadow: 0 0 5px var(--neon-green);
}

.location-tag {
    font-family: var(--font-mono);
    border: 1px solid var(--border-color);
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 0.8rem;
}

/* Mobile Responsiveness */
@media (max-width: 768px) {
    :root {
        --mobile-padding: 15px;
    }

    body {
        padding: 5px;
        min-height: 100dvh;
        min-height: -webkit-fill-available;
    }

    .tutorial-section {
        padding: var(--mobile-padding);
        margin-bottom: 10px;
        width: 100%;
    }

    .tutorial-section>div[style*="grid-template-columns: 1fr 1fr"] {
        display: flex;
        flex-direction: column;
        gap: 10px;
        grid-template-columns: none !important;
    }

    #mud-app-root {
        gap: 10px;
    }

    .mud-container {
        display: flex;
        flex-direction: column;
        height: auto;
        min-height: calc(100dvh - 20px);
        min-height: calc(var(--vh, 1vh) * 100 - 20px);
        border-radius: 12px;
    }

    .mud-header {
        padding: 12px;
        flex-shrink: 0;
    }

    .mud-title-main {
        font-size: clamp(1rem, 5vw, 1.3rem);
        letter-spacing: 2px;
    }

    .mud-status-bar {
        flex-direction: column;
        gap: 6px;
        align-items: stretch;
        padding: 8px 15px;
        flex-shrink: 0;
    }

    .mud-status-item {
        width: 100%;
        justify-content: space-between;
        font-size: 0.8rem;
    }

    .mud-val-container {
        flex: 1;
        margin: 0 8px;
        max-width: 60%;
    }

    .mud-settings {
        padding: 8px;
        flex-shrink: 0;
    }

    .mud-row {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 8px;
    }

    .mud-row input[type="password"] {
        grid-column: 1 / -1;
    }

    .mud-chat-box {
        flex-grow: 1;
        padding: 15px;
        height: 40vh;
        min-height: 200px;
    }

    .mud-msg {
        max-width: 95%;
        font-size: 0.9rem;
        padding: 12px;
    }

    .mud-side-panel {
        flex-shrink: 0;
        border-left: none;
        border-top: 1px solid var(--border-color);
        padding: 12px;
        max-height: 150px;
        background: rgba(0, 0, 0, 0.3);
    }

    .mud-input-area {
        flex-shrink: 0;
        padding: 12px;
        flex-direction: row;
        gap: 10px;
    }

    .mud-input-area input {
        padding: 10px 15px;
        font-size: 0.9rem;
    }

    .mud-input-area button {
        padding: 0 15px;
        font-size: 0.8rem;
    }

    .mud-btn {
        padding: 6px 8px;
        font-size: 0.7rem;
    }
}