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

body {
    font-family: 'Courier New', monospace;
    background: #0a0a0a;
    color: #00ff00;
    height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    overflow: hidden;
}

#game-container {
    width: 90%;
    max-width: 900px;
    height: 90vh;
    background: #1a1a1a;
    border: 2px solid #00ff00;
    border-radius: 8px;
    display: flex;
    flex-direction: column;
    box-shadow: 0 0 20px rgba(0, 255, 0, 0.3);
}

#title-bar {
    background: #0d0d0d;
    padding: 15px;
    border-bottom: 2px solid #00ff00;
}

#title-bar h1 {
    text-align: center;
    color: #00ff00;
    font-size: 24px;
    margin-bottom: 10px;
    text-shadow: 0 0 10px rgba(0, 255, 0, 0.5);
}

#status-bar {
    display: flex;
    justify-content: space-around;
    font-size: 14px;
    color: #00cc00;
}

#status-bar span {
    padding: 5px 10px;
    background: rgba(0, 255, 0, 0.1);
    border: 1px solid rgba(0, 255, 0, 0.3);
    border-radius: 4px;
}

#output-container {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
    background: #0f0f0f;
}

#output {
    white-space: pre-wrap;
    word-wrap: break-word;
    line-height: 1.6;
}

/* Import theme colors */
/* Base message types */
.msg-default { color: #00ff00; }
.msg-command { color: #888888; font-style: italic; }
.msg-error { color: #ff4444; }
.msg-success { color: #44ff44; }
.msg-info { color: #4488ff; }
.msg-warning { color: #ff8844; }

/* NPC & Dialogue */
.msg-npc-name { 
    color: #ff44ff; 
    font-weight: bold;
    text-shadow: 0 0 5px rgba(255, 68, 255, 0.25);
}
.msg-dialogue { 
    color: #ffaaff; 
    font-style: italic;
}
.msg-player-dialogue { 
    color: #aaffaa; 
    font-style: italic;
}
.msg-narrator { 
    color: #888888; 
    font-style: italic;
}

/* Locations */
.msg-location { 
    color: #44ffff; 
    font-weight: bold;
    text-shadow: 0 0 5px rgba(68, 255, 255, 0.25);
}
.msg-direction { color: #88ccff; }
.msg-description { color: #bbbbbb; }

/* Combat */
.msg-combat { color: #ff8844; }
.msg-damage { 
    color: #ff4444; 
    font-weight: bold;
}
.msg-heal { 
    color: #44ff44; 
    font-weight: bold;
}
.msg-critical { 
    color: #ffff44; 
    font-weight: bold;
    text-shadow: 0 0 10px #ffff44;
    animation: pulse 0.5s ease-in-out;
}
.msg-miss { 
    color: #888888; 
    opacity: 0.8;
}
.msg-enemy { 
    color: #ff6666; 
    font-weight: bold;
}

/* Items */
.msg-item { 
    color: #ffff44; 
    font-weight: bold;
}
.msg-legendary { 
    color: #ff44ff; 
    font-weight: bold;
    text-shadow: 0 0 10px #ff44ff;
    animation: shimmer 2s infinite;
}
.msg-rare { 
    color: #4444ff; 
    font-weight: bold;
    text-shadow: 0 0 5px rgba(68, 68, 255, 0.25);
}
.msg-common { color: #aaaaaa; }
.msg-gold { 
    color: #ffdd44; 
    font-weight: bold;
    text-shadow: 0 0 3px rgba(255, 221, 68, 0.25);
}

/* Stats */
.msg-stat-positive { color: #44ff44; }
.msg-stat-negative { color: #ff4444; }
.msg-stat-neutral { color: #ffff44; }
.msg-xp { color: #bb44ff; }
.msg-level { 
    color: #44ffff; 
    font-weight: bold;
}
.msg-level-up { 
    color: #ffff44; 
    font-weight: bold;
    font-size: 1.1em;
    text-shadow: 0 0 10px #ffff44;
    animation: levelUp 1s ease-in-out;
}

/* Actions & Options */
.msg-action { 
    color: #ffaa44; 
    font-weight: bold;
}
.msg-option { 
    color: #44aaff; 
    cursor: pointer;
    text-decoration: underline;
}
.msg-option:hover {
    color: #00ff00;
    text-shadow: 0 0 5px #00ff00;
}
.msg-disabled { 
    color: #666666; 
    opacity: 0.5;
    text-decoration: line-through;
}

/* Magic & Effects */
.msg-magic { 
    color: #ff44ff; 
    text-shadow: 0 0 5px rgba(255, 68, 255, 0.25);
}
.msg-poison { color: #44ff44; }
.msg-fire { 
    color: #ff6644; 
    text-shadow: 0 0 5px rgba(255, 102, 68, 0.25);
}
.msg-ice { 
    color: #44ddff; 
    text-shadow: 0 0 5px rgba(68, 221, 255, 0.25);
}
.msg-holy { 
    color: #ffffaa; 
    text-shadow: 0 0 10px rgba(255, 255, 170, 0.25);
}
.msg-dark { 
    color: #aa44ff; 
    text-shadow: 0 0 5px rgba(170, 68, 255, 0.25);
}

/* Inline spans for mixed colors */
.npc-name { color: #ff44ff; font-weight: bold; }
.item-name { color: #ffff44; }
.gold-amount { color: #ffdd44; }
.damage-amount { color: #ff4444; }
.heal-amount { color: #44ff44; }
.location-name { color: #44ffff; }
.action-text { color: #ffaa44; }
.option-text { color: #44aaff; }

/* Animations */
@keyframes shimmer {
    0% { opacity: 0.8; }
    50% { opacity: 1; }
    100% { opacity: 0.8; }
}

@keyframes levelUp {
    0% { transform: scale(1); }
    50% { transform: scale(1.2); }
    100% { transform: scale(1); }
}

#input-container {
    display: flex;
    align-items: center;
    padding: 15px;
    background: #0d0d0d;
    border-top: 2px solid #00ff00;
    gap: 10px;
}

.prompt {
    color: #00ff00;
    margin-right: 5px;
    font-weight: bold;
    font-size: 18px;
    flex-shrink: 0;
}

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

#command-input::placeholder {
    color: rgba(0, 255, 0, 0.3);
}

#help-btn {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: rgba(0, 255, 0, 0.1);
    border: 2px solid #00ff00;
    color: #00ff00;
    font-size: 20px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}

#help-btn:hover {
    background: rgba(0, 255, 0, 0.2);
    box-shadow: 0 0 10px rgba(0, 255, 0, 0.5);
    transform: scale(1.1);
}

#help-btn:active {
    transform: scale(0.95);
}

::-webkit-scrollbar {
    width: 10px;
}

::-webkit-scrollbar-track {
    background: #0a0a0a;
}

::-webkit-scrollbar-thumb {
    background: #00ff00;
    border-radius: 5px;
}

::-webkit-scrollbar-thumb:hover {
    background: #00cc00;
}

.ascii-art {
    color: #00ff00;
    font-size: 12px;
    line-height: 1.2;
}

.stat-change {
    animation: pulse 0.5s ease-in-out;
}

@keyframes pulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.1); }
    100% { transform: scale(1); }
}

.typewriter {
    overflow: hidden;
    white-space: pre-wrap;
    animation: typing 0.5s steps(40, end);
}

/* Modal Styles */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.8);
    animation: fadeIn 0.3s;
}

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

.modal-content {
    background: #1a1a1a;
    border: 2px solid #00ff00;
    border-radius: 8px;
    width: 90%;
    max-width: 700px;
    max-height: 80vh;
    display: flex;
    flex-direction: column;
    box-shadow: 0 0 30px rgba(0, 255, 0, 0.5);
    animation: slideIn 0.3s;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px;
    background: #0d0d0d;
    border-bottom: 2px solid #00ff00;
}

.modal-header h2 {
    color: #00ff00;
    margin: 0;
    text-shadow: 0 0 10px rgba(0, 255, 0, 0.5);
}

.close {
    color: #00ff00;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s;
}

.close:hover,
.close:focus {
    color: #44ff44;
    transform: scale(1.2);
}

.modal-body {
    padding: 20px;
    overflow-y: auto;
    flex: 1;
}

.command-section {
    margin-bottom: 25px;
}

.command-section h3 {
    color: #00ff00;
    border-bottom: 1px solid rgba(0, 255, 0, 0.3);
    padding-bottom: 10px;
    margin-bottom: 15px;
}

.command-list {
    padding-left: 10px;
}

.command {
    margin-bottom: 8px;
    color: #00cc00;
    line-height: 1.6;
}

.command .cmd {
    color: #00ff00;
    font-weight: bold;
    background: rgba(0, 255, 0, 0.1);
    padding: 2px 6px;
    border-radius: 3px;
    font-family: 'Courier New', monospace;
}

.modal-body::-webkit-scrollbar {
    width: 10px;
}

.modal-body::-webkit-scrollbar-track {
    background: #0a0a0a;
}

.modal-body::-webkit-scrollbar-thumb {
    background: #00ff00;
    border-radius: 5px;
}

.modal-body::-webkit-scrollbar-thumb:hover {
    background: #00cc00;
}

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

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