/**
 * Dragon Lord Styles
 * Modern, clean UI design
 */

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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    background: #1a1a1a;
    color: #e0e0e0;
    height: 100vh;
    margin: 0;
    padding: 0;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

/* Login Screen */
#login-screen {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    background: linear-gradient(135deg, #1a1a1a 0%, #2d2d2d 100%);
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 1000;
    pointer-events: auto;
}

#login-screen * {
    pointer-events: auto;
}

.login-container {
    background: #2d2d2d;
    padding: 3rem;
    border-radius: 8px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.5);
    max-width: 900px;
    width: 90%;
    display: flex;
    gap: 3rem;
    align-items: flex-start;
}

.login-logo-section {
    flex: 0 0 300px;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.login-logo {
    max-width: 100%;
    width: 100%;
    height: auto;
    margin-bottom: 1.5rem;
    display: block;
    /* Make black background transparent to blend with dark theme */
    background: transparent;
    border-radius: 8px;
    /* Remove black background and blend with dark container */
    mix-blend-mode: lighten;
}

.login-description {
    color: #b0b0b0;
    font-size: 0.85rem;
    margin-top: 1.5rem;
    text-align: center;
    line-height: 1.4;
}

.btn-create-account {
    background: #0066cc;
    color: #fff;
    border: none;
    padding: 0.75rem 1.5rem;
    border-radius: 4px;
    cursor: pointer;
    font-size: 1rem;
    transition: background 0.2s;
    width: 100%;
    pointer-events: auto !important;
    position: relative;
    z-index: 10;
}

.btn-create-account:hover {
    background: #0052a3;
}

.login-form-section {
    flex: 1;
    min-width: 0;
    text-align: center;
}

/* Responsive: stack logo and form on smaller screens */
@media (max-width: 768px) {
    .login-container {
        flex-direction: column;
        gap: 2rem;
    }
    
    .login-logo-section {
        flex: 0 0 auto;
    }
    
    .login-logo {
        max-width: 250px;
    }
}

.login-section {
    margin-bottom: 1.5rem;
}

.login-section h3 {
    color: #b0b0b0;
    font-size: 0.9rem;
    margin-bottom: 1rem;
    text-align: center;
}

.login-divider {
    text-align: center;
    margin: 1.5rem 0;
    position: relative;
}

.login-divider::before,
.login-divider::after {
    content: '';
    position: absolute;
    top: 50%;
    width: 40%;
    height: 1px;
    background: #404040;
}

.login-divider::before {
    left: 0;
}

.login-divider::after {
    right: 0;
}

.login-divider span {
    color: #666;
    background: #2d2d2d;
    padding: 0 1rem;
    position: relative;
}

.login-buttons {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.form-group {
    margin-bottom: 1rem;
}

.form-group input {
    width: 100%;
    padding: 0.75rem;
    background: #1a1a1a;
    border: 1px solid #404040;
    border-radius: 4px;
    color: #e0e0e0;
    font-size: 1rem;
}

.form-group input:focus {
    outline: none;
    border-color: #00ff00;
}

.form-group input::placeholder {
    color: #666;
}

.btn {
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: 4px;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.2s;
    font-weight: 500;
}

.btn-primary {
    padding: 0.75rem 1.5rem;
    background: linear-gradient(135deg, #2a2a2a 0%, #1a1a1a 100%);
    border: 2px solid #404040;
    border-radius: 8px;
    color: #e0e0e0;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.3), inset 0 1px 0 rgba(255, 255, 255, 0.1);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    position: relative;
    overflow: hidden;
}

.btn-primary::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.1), transparent);
    transition: left 0.5s;
}

.btn-primary:hover::before {
    left: 100%;
}

.btn-primary:hover {
    background: linear-gradient(135deg, #3a3a3a 0%, #2a2a2a 100%);
    border-color: #ff4444;
    color: #ff8888;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(255, 68, 68, 0.3), 0 2px 4px rgba(0, 0, 0, 0.4), inset 0 1px 0 rgba(255, 255, 255, 0.2);
}

.btn-primary:active {
    transform: translateY(0);
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.3), inset 0 2px 4px rgba(0, 0, 0, 0.4);
}

.btn-google {
    background: #4285f4;
    color: #fff;
}

.btn-google:hover {
    background: #357ae8;
}

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

.btn-github:hover {
    background: #444;
}

/* Game Screen */
#game-screen {
    display: none;
    flex-direction: column;
    height: 100vh;
    overflow: hidden;
}

/* Header */
.game-header {
    background: #2d2d2d;
    padding: 1rem 2rem;
    border-bottom: 1px solid #404040;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
}

.game-header.hide-buttons .header-commands {
    display: none;
}

.game-title {
    flex-shrink: 0;
    display: flex;
    align-items: center;
}

.game-header-logo {
    max-height: 40px;
    height: auto;
    width: auto;
    display: block;
    /* Make black background transparent to blend with dark header */
    background: transparent;
    /* Remove black background and blend with dark container */
    mix-blend-mode: lighten;
}

.header-commands {
    display: flex;
    gap: 0.75rem;
    align-items: center;
    flex: 1;
    justify-content: center;
    flex-wrap: wrap;
}

.header-cmd-btn {
    padding: 0.75rem 1.5rem;
    background: linear-gradient(135deg, #2a2a2a 0%, #1a1a1a 100%);
    border: 2px solid #404040;
    border-radius: 8px;
    color: #e0e0e0;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.3), inset 0 1px 0 rgba(255, 255, 255, 0.1);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    min-width: 100px;
    position: relative;
    overflow: hidden;
}

.header-cmd-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.1), transparent);
    transition: left 0.5s;
}

.header-cmd-btn:hover::before {
    left: 100%;
}

.header-cmd-btn:hover {
    background: linear-gradient(135deg, #3a3a3a 0%, #2a2a2a 100%);
    border-color: #00ff00;
    color: #00ff00;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 255, 0, 0.3), 0 2px 4px rgba(0, 0, 0, 0.4), inset 0 1px 0 rgba(255, 255, 255, 0.2);
}

.header-cmd-btn:active {
    transform: translateY(0);
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.3), inset 0 2px 4px rgba(0, 0, 0, 0.4);
}

.header-admin-btn {
    background: linear-gradient(135deg, #3a1a1a 0%, #2a1a1a 100%);
    border-color: #ff4444;
    color: #ff8888;
}

.header-admin-btn:hover {
    background: linear-gradient(135deg, #4a1a1a 0%, #3a1a1a 100%);
    border-color: #ff6666;
    color: #ffaaaa;
    box-shadow: 0 4px 8px rgba(255, 68, 68, 0.3), 0 2px 4px rgba(0, 0, 0, 0.4), inset 0 1px 0 rgba(255, 255, 255, 0.2);
}

.header-actions {
    display: flex;
    gap: 1rem;
    align-items: center;
    flex-shrink: 0;
}

.header-location-box {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    background: rgba(0, 170, 255, 0.15);
    border: 1px solid rgba(0, 170, 255, 0.3);
    border-radius: 6px;
    font-size: 0.9rem;
}

.header-location-label {
    color: #b0b0b0;
    font-weight: 500;
}

.header-location-value {
    color: #00aaff;
    font-weight: 600;
    text-transform: capitalize;
}

.header-bag-btn {
    background: rgba(0, 170, 255, 0.15);
    border: 1px solid rgba(0, 170, 255, 0.3);
    border-radius: 6px;
    padding: 0.5rem 0.75rem;
    font-size: 1.2rem;
    cursor: pointer;
    transition: all 0.2s ease;
    color: #00aaff;
    position: relative;
}

.header-bag-btn:hover {
    background: rgba(0, 170, 255, 0.25);
    border-color: rgba(0, 170, 255, 0.5);
    transform: scale(1.05);
}

.header-bag-btn.bag-full {
    background: rgba(255, 68, 68, 0.2);
    border-color: rgba(255, 68, 68, 0.5);
    color: #ff4444;
    animation: bag-full-pulse 2s ease-in-out infinite;
}

.header-bag-btn.bag-full:hover {
    background: rgba(255, 68, 68, 0.3);
    border-color: rgba(255, 68, 68, 0.7);
}

/* Tooltip for full bag */
.header-bag-btn[data-tooltip]:hover::after {
    content: attr(data-tooltip);
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%) translateY(0.5rem);
    background: rgba(20, 20, 20, 0.98);
    border: 2px solid #ff4444;
    border-radius: 6px;
    padding: 0.5rem 0.75rem;
    font-size: 0.85rem;
    color: #ff8888;
    white-space: nowrap;
    z-index: 1000;
    pointer-events: none;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.5);
}

.header-bag-btn[data-tooltip]:hover::before {
    content: '';
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%) translateY(-0.25rem);
    border: 6px solid transparent;
    border-bottom-color: #ff4444;
    z-index: 1001;
    pointer-events: none;
}

@keyframes bag-full-pulse {
    0%, 100% {
        box-shadow: 0 0 0 0 rgba(255, 68, 68, 0.4);
    }
    50% {
        box-shadow: 0 0 0 4px rgba(255, 68, 68, 0);
    }
}

/* Quest button flashing for completable quests */
.header-cmd-btn.quest-completable {
    background: linear-gradient(135deg, #2a4a1a 0%, #1a3a1a 100%);
    border-color: #00ff00;
    color: #00ff88;
    animation: quest-completable-pulse 2s ease-in-out infinite;
    box-shadow: 0 2px 4px rgba(0, 255, 0, 0.3), 0 0 8px rgba(0, 255, 0, 0.2);
}

.header-cmd-btn.quest-completable:hover {
    background: linear-gradient(135deg, #3a5a2a 0%, #2a4a2a 100%);
    border-color: #00ffaa;
    color: #00ffaa;
    box-shadow: 0 4px 8px rgba(0, 255, 0, 0.4), 0 0 12px rgba(0, 255, 0, 0.3);
}

@keyframes quest-completable-pulse {
    0%, 100% {
        box-shadow: 0 2px 4px rgba(0, 255, 0, 0.3), 0 0 8px rgba(0, 255, 0, 0.2);
    }
    50% {
        box-shadow: 0 2px 4px rgba(0, 255, 0, 0.5), 0 0 16px rgba(0, 255, 0, 0.4), 0 0 24px rgba(0, 255, 0, 0.2);
    }
}

/* Quest Tabs */
.quest-tab {
    position: relative;
}

.quest-tab:hover {
    background: rgba(0, 255, 136, 0.1) !important;
    color: #00ffaa !important;
}

.quest-tab.active {
    color: #00ff88 !important;
    border-bottom-color: #00ff88 !important;
    background: rgba(0, 255, 136, 0.05) !important;
}

.quest-list {
    scrollbar-width: thin;
    scrollbar-color: rgba(0, 170, 255, 0.5) transparent;
}

.quest-list::-webkit-scrollbar {
    width: 8px;
}

.quest-list::-webkit-scrollbar-track {
    background: transparent;
}

.quest-list::-webkit-scrollbar-thumb {
    background: rgba(0, 170, 255, 0.5);
    border-radius: 4px;
}

.quest-list::-webkit-scrollbar-thumb:hover {
    background: rgba(0, 170, 255, 0.7);
}

/* Toast Notifications */
.toast-container {
    position: fixed;
    top: 1rem;
    right: 1rem;
    z-index: 10000;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    pointer-events: none;
}

.toast {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1rem;
    background: rgba(15, 15, 15, 1);
    border: 2px solid #404040;
    border-radius: 6px;
    color: #fff;
    font-size: 0.9rem;
    min-width: 250px;
    max-width: 400px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.8), 0 0 0 1px rgba(255, 255, 255, 0.1);
    opacity: 0;
    transform: translateX(100%);
    transition: all 0.3s ease;
    pointer-events: auto;
    backdrop-filter: blur(10px);
}

.toast.show {
    opacity: 1;
    transform: translateX(0);
}

.toast-icon {
    font-size: 1.2rem;
    flex-shrink: 0;
}

.toast-message {
    flex: 1;
    line-height: 1.4;
}

.toast-info {
    border-color: #00aaff;
    background: rgba(15, 15, 15, 1);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.8), 0 0 0 1px rgba(0, 170, 255, 0.3), 0 0 15px rgba(0, 170, 255, 0.2);
}

.toast-success {
    border-color: #00ff00;
    background: rgba(15, 15, 15, 1);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.8), 0 0 0 1px rgba(0, 255, 0, 0.3), 0 0 15px rgba(0, 255, 0, 0.2);
}

.toast-warning {
    border-color: #ffc800;
    background: rgba(15, 15, 15, 1);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.8), 0 0 0 1px rgba(255, 200, 0, 0.4), 0 0 15px rgba(255, 200, 0, 0.3);
}

.toast-error {
    border-color: #ff4444;
    background: rgba(15, 15, 15, 1);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.8), 0 0 0 1px rgba(255, 68, 68, 0.4), 0 0 15px rgba(255, 68, 68, 0.3);
}

.inventory-info {
    margin-bottom: 1rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid #404040;
}

.inventory-list {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 0.75rem;
    padding: 1rem 0;
}

.inventory-slot {
    position: relative;
    aspect-ratio: 1;
    background: rgba(255, 255, 255, 0.05);
    border: 2px solid #404040;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
    overflow: hidden;
}

.inventory-slot:hover {
    background: rgba(255, 255, 255, 0.1);
    transform: scale(1.05);
    z-index: 10;
}

.inventory-slot.empty {
    border-style: dashed;
    border-color: #404040;
    cursor: default;
}

.inventory-slot.empty:hover {
    transform: none;
    background: rgba(255, 255, 255, 0.05);
}

.inventory-slot.equipped {
    border-color: #00ff00;
    border-width: 3px;
    box-shadow: 0 0 10px rgba(0, 255, 0, 0.5);
}

.inventory-slot.equipped::before {
    content: '✓';
    position: absolute;
    top: 0.25rem;
    left: 0.25rem;
    background: rgba(0, 255, 0, 0.8);
    color: #000;
    width: 1.2rem;
    height: 1.2rem;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.8rem;
    font-weight: bold;
    z-index: 5;
}

.inventory-slot-equipped {
    position: absolute;
    top: 0.25rem;
    left: 0.25rem;
    background: rgba(0, 255, 0, 0.9);
    color: #000;
    width: 1.3rem;
    height: 1.3rem;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.85rem;
    font-weight: bold;
    z-index: 6;
    border: 2px solid rgba(0, 200, 0, 1);
    box-shadow: 0 0 8px rgba(0, 255, 0, 0.6);
}

.inventory-slot-icon {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0.5rem;
    position: relative;
}

.inventory-slot-icon img {
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.5));
}

/* SVG Gradient Effect - Blue to Purple for all game icons */
.game-icon,
.player-avatar-icon,
.inventory-slot-icon img,
.combat-figure img {
    /* Blue to purple gradient effect using multiple drop-shadows */
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.5))
            drop-shadow(0 0 6px rgba(100, 150, 255, 0.6))
            drop-shadow(0 0 10px rgba(150, 100, 255, 0.4))
            drop-shadow(0 0 14px rgba(200, 100, 255, 0.3));
}

/* Player avatar in sidebar - small and compact */
.player-avatar-icon {
    width: 32px;
    height: 32px;
    border-radius: 4px;
    border: 1px solid rgba(100, 150, 255, 0.3);
    background: rgba(100, 150, 255, 0.1);
    padding: 2px;
    object-fit: contain;
    flex-shrink: 0;
}

/* Avatar grid icons in settings modal - gradient color effect */
.avatar-grid-icon {
    /* Change white SVG to blue-purple gradient using filters */
    filter: 
        brightness(0) saturate(100%) invert(60%) sepia(100%) saturate(200%) hue-rotate(200deg) brightness(1.2)
        drop-shadow(0 2px 4px rgba(0, 0, 0, 0.5))
        drop-shadow(0 0 6px rgba(100, 150, 255, 0.6))
        drop-shadow(0 0 10px rgba(150, 100, 255, 0.4))
        drop-shadow(0 0 14px rgba(200, 100, 255, 0.3));
    transition: filter 0.3s ease;
}

.avatar-item:hover .avatar-grid-icon {
    /* Enhanced gradient on hover */
    filter: 
        brightness(0) saturate(100%) invert(60%) sepia(100%) saturate(200%) hue-rotate(200deg) brightness(1.4)
        drop-shadow(0 2px 4px rgba(0, 0, 0, 0.5))
        drop-shadow(0 0 8px rgba(100, 150, 255, 0.8))
        drop-shadow(0 0 12px rgba(150, 100, 255, 0.6))
        drop-shadow(0 0 18px rgba(200, 100, 255, 0.5));
}

.avatar-item[style*="border-color: rgb(0, 170, 255)"] .avatar-grid-icon,
.avatar-item[style*="border-color: #00aaff"] .avatar-grid-icon {
    /* Selected avatar - more vibrant gradient */
    filter: 
        brightness(0) saturate(100%) invert(60%) sepia(100%) saturate(250%) hue-rotate(200deg) brightness(1.5)
        drop-shadow(0 2px 4px rgba(0, 0, 0, 0.5))
        drop-shadow(0 0 10px rgba(0, 170, 255, 0.8))
        drop-shadow(0 0 15px rgba(100, 150, 255, 0.7))
        drop-shadow(0 0 20px rgba(150, 100, 255, 0.5));
}

/* Avatar preview - larger version with enhanced gradient */
#avatar-preview.avatar-grid-icon {
    filter: 
        brightness(0) saturate(100%) invert(60%) sepia(100%) saturate(200%) hue-rotate(200deg) brightness(1.3)
        drop-shadow(0 2px 4px rgba(0, 0, 0, 0.5))
        drop-shadow(0 0 8px rgba(100, 150, 255, 0.7))
        drop-shadow(0 0 12px rgba(150, 100, 255, 0.5))
        drop-shadow(0 0 18px rgba(200, 100, 255, 0.4));
}

/* Settings Tabs */
.settings-tabs {
    display: flex;
    border-bottom: 2px solid #404040;
    background: #1a1a1a;
    padding: 0;
    margin: 0;
}

.settings-tab {
    flex: 1;
    padding: 1rem 1.5rem;
    background: transparent;
    border: none;
    border-bottom: 3px solid transparent;
    color: #808080;
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    text-align: center;
}

.settings-tab:hover {
    background: rgba(255, 255, 255, 0.05);
    color: #b0b0b0;
}

.settings-tab.active {
    color: #00aaff;
    border-bottom-color: #00aaff;
    background: rgba(0, 170, 255, 0.1);
}

.settings-tab-content {
    position: relative;
}

.settings-tab-panel {
    display: none;
}

.settings-tab-panel.active {
    display: block;
}

/* Blacksmith Modal Styles */
#blacksmith-header-icon {
    width: 48px;
    height: 48px;
    filter: 
        drop-shadow(0 0 8px rgba(255, 200, 0, 0.6))
        drop-shadow(0 0 4px rgba(255, 150, 0, 0.4));
    animation: blacksmith-icon-glow 2s ease-in-out infinite alternate;
}

@keyframes blacksmith-icon-glow {
    0% {
        filter: 
            drop-shadow(0 0 6px rgba(255, 200, 0, 0.5))
            drop-shadow(0 0 3px rgba(255, 150, 0, 0.3));
    }
    100% {
        filter: 
            drop-shadow(0 0 12px rgba(255, 220, 0, 0.8))
            drop-shadow(0 0 6px rgba(255, 180, 0, 0.6));
    }
}

#potion-shop-header-icon {
    width: 48px;
    height: 48px;
    filter: 
        drop-shadow(0 0 8px rgba(138, 43, 226, 0.6))
        drop-shadow(0 0 4px rgba(186, 85, 211, 0.4));
    animation: potion-shop-icon-glow 2s ease-in-out infinite alternate;
}

@keyframes potion-shop-icon-glow {
    0% {
        filter: 
            drop-shadow(0 0 6px rgba(138, 43, 226, 0.5))
            drop-shadow(0 0 3px rgba(186, 85, 211, 0.3));
    }
    100% {
        filter: 
            drop-shadow(0 0 12px rgba(148, 0, 211, 0.8))
            drop-shadow(0 0 6px rgba(186, 85, 211, 0.6));
    }
}

.blacksmith-tabs {
    display: flex;
    gap: 0.5rem;
    border-bottom: 2px solid #404040;
    background: #1a1a1a;
    padding: 0;
    margin: 0;
}

.blacksmith-tab {
    padding: 0.75rem 1.5rem;
    background: transparent;
    border: none;
    border-bottom: 2px solid transparent;
    color: #b0b0b0;
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
}

.blacksmith-tab:hover {
    background: rgba(255, 255, 255, 0.05);
    color: #e0e0e0;
}

.blacksmith-tab.active {
    color: #00ff00;
    border-bottom-color: #00ff00;
}

.blacksmith-tab-content {
    padding: 1rem;
    overflow-y: auto;
    max-height: calc(90vh - 200px);
}

.blacksmith-buy-tab {
    padding: 0.5rem 1rem;
    background: transparent;
    border: none;
    border-bottom: 2px solid transparent;
    color: #b0b0b0;
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.2s ease;
}

.blacksmith-buy-tab:hover {
    color: #e0e0e0;
}

.blacksmith-buy-tab.active {
    color: #00ff00;
    border-bottom-color: #00ff00;
}

.blacksmith-items-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 1rem;
    max-height: 50vh;
    overflow-y: auto;
    padding: 0.5rem 0;
}

.blacksmith-item-card {
    background: #2a2a2a;
    border: 2px solid #404040;
    border-radius: 8px;
    padding: 1rem;
    display: flex;
    flex-direction: column;
    transition: all 0.2s ease;
}

.blacksmith-item-card:hover {
    border-color: #00ff00;
    box-shadow: 0 0 10px rgba(0, 255, 0, 0.3);
    transform: translateY(-2px);
}

.blacksmith-item-card .btn {
    margin-top: 0.5rem;
}

/* Equipped items grid in settings */
.equipped-items-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1rem;
    margin-top: 1rem;
}

.equipped-slot {
    position: relative;
    aspect-ratio: 1;
    background: rgba(255, 255, 255, 0.05);
    border: 2px solid #404040;
    border-radius: 8px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 0.5rem;
    cursor: pointer;
    transition: all 0.2s ease;
    min-height: 120px;
}

.equipped-slot:hover:not([style*="cursor: default"]) {
    background: rgba(255, 255, 255, 0.1);
    transform: scale(1.05);
}

.equipped-slot[style*="border-color: rgb(0, 255, 0)"] {
    box-shadow: 0 0 10px rgba(0, 255, 0, 0.5);
}

.inventory-slot-icon img[src=""],
.inventory-slot-icon img:not([src]) {
    display: none !important;
}

.inventory-slot-icon .icon-fallback {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.inventory-slot-category {
    position: absolute;
    top: 0.25rem;
    right: 0.25rem;
    font-size: 0.7rem;
    font-weight: 700;
    padding: 0.15rem 0.3rem;
    border-radius: 4px;
    background: rgba(0, 0, 0, 0.6);
}

.inventory-slot-category.common {
    color: #b0b0b0;
}

.inventory-slot-category.legacy {
    color: #ffc800;
}

.inventory-slot-category.epic {
    color: #da70d6;
}

.inventory-slot-magic {
    position: absolute;
    bottom: 0.25rem;
    left: 0.25rem;
    font-size: 1rem;
    filter: drop-shadow(0 0 3px rgba(255, 200, 0, 0.8));
}

.inventory-slot-quantity {
    position: absolute;
    bottom: 0.25rem;
    right: 0.25rem;
    background: rgba(0, 170, 255, 0.9);
    color: #fff;
    font-size: 0.75rem;
    font-weight: 700;
    padding: 0.2rem 0.4rem;
    border-radius: 10px;
    min-width: 1.5rem;
    text-align: center;
    line-height: 1;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.5);
    filter: drop-shadow(0 0 3px rgba(0, 170, 255, 0.8));
}

/* Magic item effects */
.inventory-slot.has-magic {
    position: relative;
}

.inventory-slot.has-magic::before {
    content: '';
    position: absolute;
    top: -2px;
    left: -2px;
    right: -2px;
    bottom: -2px;
    border-radius: 8px;
    background: linear-gradient(45deg, 
        rgba(255, 200, 0, 0.4),
        rgba(0, 170, 255, 0.4),
        rgba(255, 200, 0, 0.4),
        rgba(0, 170, 255, 0.4));
    background-size: 400% 400%;
    animation: magic-glow 3s ease infinite;
    z-index: -1;
    opacity: 0.6;
}

.inventory-slot.has-magic::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    border-radius: 8px;
    box-shadow: 
        0 0 10px rgba(255, 200, 0, 0.5),
        0 0 20px rgba(0, 170, 255, 0.3),
        inset 0 0 10px rgba(255, 200, 0, 0.2);
    animation: magic-pulse 2s ease-in-out infinite;
    pointer-events: none;
    z-index: 1;
}

.inventory-slot.has-magic .inventory-slot-icon img {
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.5)) 
            drop-shadow(0 0 8px rgba(255, 200, 0, 0.6))
            drop-shadow(0 0 12px rgba(0, 170, 255, 0.4));
    animation: magic-icon-glow 2s ease-in-out infinite;
}

@keyframes magic-glow {
    0% {
        background-position: 0% 50%;
    }
    50% {
        background-position: 100% 50%;
    }
    100% {
        background-position: 0% 50%;
    }
}

@keyframes magic-pulse {
    0%, 100% {
        opacity: 0.6;
        box-shadow: 
            0 0 10px rgba(255, 200, 0, 0.5),
            0 0 20px rgba(0, 170, 255, 0.3),
            inset 0 0 10px rgba(255, 200, 0, 0.2);
    }
    50% {
        opacity: 1;
        box-shadow: 
            0 0 15px rgba(255, 200, 0, 0.8),
            0 0 30px rgba(0, 170, 255, 0.5),
            inset 0 0 15px rgba(255, 200, 0, 0.4);
    }
}

@keyframes magic-icon-glow {
    0%, 100% {
        filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.5)) 
                drop-shadow(0 0 8px rgba(255, 200, 0, 0.6))
                drop-shadow(0 0 12px rgba(150, 100, 255, 0.6))
                drop-shadow(0 0 16px rgba(200, 100, 255, 0.4));
    }
    50% {
        filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.5)) 
                drop-shadow(0 0 12px rgba(255, 200, 0, 0.9))
                drop-shadow(0 0 18px rgba(150, 100, 255, 0.8))
                drop-shadow(0 0 24px rgba(200, 100, 255, 0.6));
    }
}

.inventory-slot.has-magic:hover::after {
    box-shadow: 
        0 0 20px rgba(255, 200, 0, 0.8),
        0 0 40px rgba(0, 170, 255, 0.5),
        inset 0 0 20px rgba(255, 200, 0, 0.4);
}

/* Fairy item rainbow glitter effects */
.inventory-slot.has-fairy {
    position: relative;
    overflow: visible;
}

.inventory-slot.has-fairy::before {
    content: '';
    position: absolute;
    top: -3px;
    left: -3px;
    right: -3px;
    bottom: -3px;
    border-radius: 8px;
    background: linear-gradient(45deg,
        rgba(255, 0, 150, 0.6),
        rgba(255, 100, 0, 0.6),
        rgba(255, 255, 0, 0.6),
        rgba(0, 255, 100, 0.6),
        rgba(0, 150, 255, 0.6),
        rgba(150, 0, 255, 0.6),
        rgba(255, 0, 150, 0.6));
    background-size: 400% 400%;
    animation: rainbow-glitter 2s linear infinite;
    z-index: -1;
    opacity: 0.8;
}

.inventory-slot.has-fairy::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    border-radius: 8px;
    box-shadow: 
        0 0 15px rgba(255, 0, 150, 0.6),
        0 0 25px rgba(255, 100, 0, 0.5),
        0 0 35px rgba(255, 255, 0, 0.4),
        0 0 45px rgba(0, 255, 100, 0.3),
        0 0 55px rgba(0, 150, 255, 0.2),
        inset 0 0 15px rgba(150, 0, 255, 0.3);
    animation: rainbow-pulse 1.5s ease-in-out infinite;
    pointer-events: none;
    z-index: 1;
}

.inventory-slot.has-fairy .inventory-slot-icon img {
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.5))
            drop-shadow(0 0 10px rgba(255, 0, 150, 0.8))
            drop-shadow(0 0 15px rgba(255, 100, 0, 0.6))
            drop-shadow(0 0 20px rgba(255, 255, 0, 0.5))
            drop-shadow(0 0 25px rgba(0, 255, 100, 0.4))
            drop-shadow(0 0 30px rgba(0, 150, 255, 0.3));
    animation: rainbow-icon-glow 2s ease-in-out infinite;
}

/* Sparkle particles effect */
.inventory-slot.has-fairy {
    background-image: 
        radial-gradient(circle at 20% 30%, rgba(255, 255, 255, 0.8) 1px, transparent 1px),
        radial-gradient(circle at 80% 70%, rgba(255, 255, 255, 0.8) 1px, transparent 1px),
        radial-gradient(circle at 50% 50%, rgba(255, 255, 255, 0.6) 1px, transparent 1px);
    background-size: 100% 100%, 100% 100%, 100% 100%;
    background-position: 0% 0%, 100% 100%, 50% 50%;
    animation: sparkle-move 3s ease-in-out infinite;
}

@keyframes rainbow-glitter {
    0% {
        background-position: 0% 50%;
        filter: hue-rotate(0deg);
    }
    25% {
        background-position: 100% 50%;
        filter: hue-rotate(90deg);
    }
    50% {
        background-position: 200% 50%;
        filter: hue-rotate(180deg);
    }
    75% {
        background-position: 300% 50%;
        filter: hue-rotate(270deg);
    }
    100% {
        background-position: 400% 50%;
        filter: hue-rotate(360deg);
    }
}

@keyframes rainbow-pulse {
    0%, 100% {
        opacity: 0.7;
        box-shadow: 
            0 0 15px rgba(255, 0, 150, 0.6),
            0 0 25px rgba(255, 100, 0, 0.5),
            0 0 35px rgba(255, 255, 0, 0.4),
            0 0 45px rgba(0, 255, 100, 0.3),
            0 0 55px rgba(0, 150, 255, 0.2),
            inset 0 0 15px rgba(150, 0, 255, 0.3);
    }
    50% {
        opacity: 1;
        box-shadow: 
            0 0 20px rgba(255, 0, 150, 0.9),
            0 0 35px rgba(255, 100, 0, 0.7),
            0 0 50px rgba(255, 255, 0, 0.6),
            0 0 65px rgba(0, 255, 100, 0.5),
            0 0 80px rgba(0, 150, 255, 0.4),
            inset 0 0 20px rgba(150, 0, 255, 0.5);
    }
}

@keyframes rainbow-icon-glow {
    0%, 100% {
        filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.5))
                drop-shadow(0 0 10px rgba(255, 0, 150, 0.8))
                drop-shadow(0 0 15px rgba(255, 100, 0, 0.6))
                drop-shadow(0 0 20px rgba(255, 255, 0, 0.5))
                drop-shadow(0 0 25px rgba(0, 255, 100, 0.4))
                drop-shadow(0 0 30px rgba(0, 150, 255, 0.3));
    }
    33% {
        filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.5))
                drop-shadow(0 0 15px rgba(255, 100, 0, 0.9))
                drop-shadow(0 0 20px rgba(255, 255, 0, 0.7))
                drop-shadow(0 0 25px rgba(0, 255, 100, 0.6))
                drop-shadow(0 0 30px rgba(0, 150, 255, 0.5))
                drop-shadow(0 0 35px rgba(150, 0, 255, 0.4));
    }
    66% {
        filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.5))
                drop-shadow(0 0 15px rgba(0, 255, 100, 0.9))
                drop-shadow(0 0 20px rgba(0, 150, 255, 0.7))
                drop-shadow(0 0 25px rgba(150, 0, 255, 0.6))
                drop-shadow(0 0 30px rgba(255, 0, 150, 0.5))
                drop-shadow(0 0 35px rgba(255, 100, 0, 0.4));
    }
}

@keyframes sparkle-move {
    0%, 100% {
        background-position: 0% 0%, 100% 100%, 50% 50%;
        opacity: 0.6;
    }
    50% {
        background-position: 100% 100%, 0% 0%, 50% 50%;
        opacity: 1;
    }
}

.inventory-slot.has-fairy:hover::after {
    box-shadow: 
        0 0 25px rgba(255, 0, 150, 1),
        0 0 40px rgba(255, 100, 0, 0.8),
        0 0 55px rgba(255, 255, 0, 0.7),
        0 0 70px rgba(0, 255, 100, 0.6),
        0 0 85px rgba(0, 150, 255, 0.5),
        inset 0 0 25px rgba(150, 0, 255, 0.6);
}

/* Inventory tooltips removed - click items to see details in the item panel instead */

.tooltip-category {
    display: inline-block;
    padding: 0.2rem 0.5rem;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 600;
    margin-top: 0.25rem;
}

.tooltip-category.common {
    background: rgba(150, 150, 150, 0.3);
    color: #b0b0b0;
}

.tooltip-category.legacy {
    background: rgba(255, 200, 0, 0.3);
    color: #ffc800;
}

.tooltip-category.epic {
    background: rgba(138, 43, 226, 0.3);
    color: #da70d6;
}

/* Main Content */
.game-content {
    display: flex;
    flex: 1;
    gap: 1rem;
    padding: 1rem;
    min-height: 0; /* Allow flexbox to shrink */
    overflow: hidden;
}

/* Terminal Section (wraps tabs and content) */
.terminal-section {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-height: 0;
    overflow: hidden;
}

/* Terminal Tabs */
.terminal-tabs {
    display: flex;
    flex-direction: row;
    gap: 0.5rem;
    padding: 0.5rem 1rem 0 1rem;
    border-bottom: 2px solid #404040;
    background: #1a1a1a;
    margin: 0;
    flex-shrink: 0;
}

.terminal-tab {
    position: relative;
    padding: 0.75rem 1.5rem;
    background: #2d2d2d;
    border: 1px solid #404040;
    border-radius: 4px 4px 0 0;
    color: #b0b0b0;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 0.9rem;
    font-family: inherit;
    margin: 0;
}

.terminal-tab:hover {
    background: #353535;
    color: #fff;
}

.terminal-tab.active {
    background: #2d2d2d;
    border-bottom-color: #2d2d2d;
    color: #00ff00;
    border-color: #00ff00;
    border-bottom: 2px solid #2d2d2d;
    margin-bottom: -2px;
}

.terminal-tab.has-unread {
    background: rgba(138, 43, 226, 0.2);
    border: 1px solid rgba(138, 43, 226, 0.5);
    animation: chatPulse 2s ease-in-out infinite;
}

.terminal-tab.has-unread.active {
    background: #2d2d2d;
    border-bottom: 2px solid #00ff00;
    border-color: #00ff00;
    animation: none;
}

.chat-unread-badge {
    position: absolute;
    top: -8px;
    right: -8px;
    background: #ff4444;
    color: #fff;
    border-radius: 50%;
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.7rem;
    font-weight: bold;
    border: 2px solid #1a1a1a;
    box-shadow: 0 0 8px rgba(255, 68, 68, 0.6);
    min-width: 20px;
    padding: 0 4px;
    box-sizing: border-box;
    z-index: 10;
}

.chat-unread-badge:not(:empty) {
    border-radius: 10px;
    width: auto;
    min-width: 20px;
    height: 20px;
}

@keyframes chatPulse {
    0%, 100% {
        box-shadow: 0 0 0 0 rgba(138, 43, 226, 0.7);
    }
    50% {
        box-shadow: 0 0 0 4px rgba(138, 43, 226, 0);
    }
}

/* Messages System Styles */
.messages-unread-badge {
    position: absolute;
    top: -8px;
    right: -8px;
    background: #ff4444;
    color: #fff;
    border-radius: 50%;
    width: 20px;
    height: 20px;
    display: none;
    align-items: center;
    justify-content: center;
    font-size: 0.7rem;
    font-weight: bold;
    border: 2px solid #1a1a1a;
    box-shadow: 0 0 8px rgba(255, 68, 68, 0.6);
    min-width: 20px;
    padding: 0 4px;
    box-sizing: border-box;
    z-index: 10;
}

.messages-unread-badge:not(:empty) {
    border-radius: 10px;
    width: auto;
    min-width: 20px;
    height: 20px;
}

@keyframes pulse {
    0%, 100% {
        box-shadow: 0 0 15px rgba(0, 170, 255, 0.8), 0 0 30px rgba(0, 170, 255, 0.4);
    }
    50% {
        box-shadow: 0 0 25px rgba(0, 170, 255, 1), 0 0 50px rgba(0, 170, 255, 0.6);
    }
}

.messages-folder-tab {
    transition: all 0.2s ease;
}

.messages-folder-tab:hover {
    background: #353535 !important;
}

.messages-folder-tab.active {
    border-bottom-color: #00ff00 !important;
    color: #00ff00 !important;
}

.messages-folder-count {
    background: rgba(0, 170, 255, 0.3);
    padding: 0.15rem 0.5rem;
    border-radius: 4px;
    font-size: 0.85rem;
    margin-left: 0.5rem;
}

.message-item {
    transition: all 0.2s ease;
}

.message-item:hover {
    background: #2a2a2a !important;
    border-color: #00aaff !important;
}

/* Arena Tab Styles */
#arena-players-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.arena-player-card {
    background: #1a1a1a;
    border: 2px solid #404040;
    border-radius: 8px;
    padding: 1rem;
    transition: all 0.2s ease;
}

.arena-player-card:hover {
    border-color: #00aaff;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 170, 255, 0.2);
}

.terminal-tab-content {
    display: none;
    flex: 1;
    min-height: 0;
    overflow: hidden;
}

.terminal-tab-content.active {
    display: flex;
    flex-direction: column;
}

/* Terminal Area */
.terminal-container {
    flex: 1;
    background: #000;
    border-radius: 4px;
    padding: 1rem;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
    display: flex;
    flex-direction: column;
    min-height: 0; /* Allow flexbox to control size */
    overflow: hidden;
    position: relative;
}

.terminal-wrapper {
    flex: 1;
    display: flex;
    position: relative;
    min-height: 0;
    background-image: url('../maps/map1.png');
    background-size: 100% 100%;
    background-position: center;
    background-repeat: no-repeat;
}

#terminal-canvas {
    display: block;
    border: 1px solid #333;
    border-radius: 4px;
    flex: 1;
    width: 100%;
    min-height: 0;
}

/* Modern Terminal Output Overlay - Primary Display */
.terminal-output {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    padding: 1.5rem;
    font-family: 'Courier New', 'Consolas', 'Monaco', monospace;
    font-size: 16px;
    line-height: 1.8;
    color: #00ff00;
    background: rgba(0, 0, 0, 0.75); /* Semi-transparent black overlay for text readability */
    overflow-y: auto;
    overflow-x: hidden;
    pointer-events: auto;
    z-index: 6;
    border: 1px solid #333;
    border-radius: 4px;
    box-shadow: inset 0 0 20px rgba(0, 255, 0, 0.1);
    display: block !important;
}

/* Hide canvas when using HTML terminal */
.terminal-wrapper.using-html #terminal-canvas {
    display: none !important;
    visibility: hidden !important;
    opacity: 0 !important;
}

.terminal-output::-webkit-scrollbar {
    width: 12px;
}

.terminal-output::-webkit-scrollbar-track {
    background: #1a1a1a;
    border-radius: 6px;
}

.terminal-output::-webkit-scrollbar-thumb {
    background: #4a4a4a;
    border-radius: 6px;
    border: 1px solid #333;
}

.terminal-output::-webkit-scrollbar-thumb:hover {
    background: #5a5a5a;
}

.terminal-output .terminal-line {
    margin: 0;
    padding: 0.1rem 0;
    white-space: pre-wrap;
    word-wrap: break-word;
    animation: fadeIn 0.2s ease-in;
    min-height: 1.2em;
    line-height: 1.4;
    display: block;
    clear: both;
}

/* Center welcome title text only */
.terminal-output .terminal-line.welcome-title {
    text-align: center;
}

/* Grouped lines (like logo, help sections) have minimal spacing */
.terminal-output .terminal-line.grouped {
    padding: 0.05rem 0;
    min-height: 1.1em;
    line-height: 1.3;
}

/* Spacing between sections */
.terminal-output .terminal-line.section-break {
    padding: 0.5rem 0;
    min-height: 1.5em;
}

/* Ensure proper spacing for all terminal content */
.terminal-output > * {
    margin: 0;
    padding: 0.1rem 0;
    display: block;
}

/* Ensure pill buttons have proper spacing within terminal lines */
.terminal-output .terminal-line .terminal-pill {
    margin: 0.25rem 0.5rem;
    vertical-align: middle;
}

/* Welcome SVG logo animation inside terminal output */
.terminal-output .terminal-line.dragon-animation {
    padding: 0.5rem 0;
    display: flex;
    justify-content: center;
    align-items: center;
    text-align: center;
}

.dragon-animation .dragon-logo {
    width: 260px;
    max-width: 60vw;
    filter: drop-shadow(0 0 12px rgba(0, 255, 255, 0.7));
    animation: dragon-logo-pulse 1.2s ease-in-out infinite alternate;
    display: block;
    margin: 0 auto;
}

@keyframes dragon-logo-pulse {
    0% {
        transform: scale(1);
        filter: drop-shadow(0 0 6px rgba(0, 255, 255, 0.4));
    }
    50% {
        transform: scale(1.03);
        filter: drop-shadow(0 0 14px rgba(0, 255, 180, 0.9));
    }
    100% {
        transform: scale(1.06);
        filter: drop-shadow(0 0 20px rgba(0, 180, 255, 1));
    }
}

/* Town SVG art in location menu */
.terminal-output .terminal-line.town-art {
    padding: 0.5rem 0 0.75rem 0;
    text-align: center;
}

.town-logo {
    width: 380px;
    max-width: 90vw;
    display: block;
    margin: 0 auto;
    /* Color-tint the black SVG using CSS filters, with a subtle outer glow */
    filter:
        invert(84%)
        sepia(63%)
        saturate(449%)
        hue-rotate(80deg)
        brightness(1.1)
        contrast(1.1)
        drop-shadow(0 0 6px rgba(0, 255, 180, 0.6));
    animation: town-logo-glow 1.5s ease-in-out infinite alternate;
}

@keyframes town-logo-glow {
    0% {
        transform: translateY(0);
        filter:
            invert(84%)
            sepia(63%)
            saturate(449%)
            hue-rotate(80deg)
            brightness(1.05)
            contrast(1.05)
            drop-shadow(0 0 4px rgba(0, 255, 180, 0.4));
    }
    50% {
        transform: translateY(-1px);
        filter:
            invert(88%)
            sepia(72%)
            saturate(550%)
            hue-rotate(80deg)
            brightness(1.2)
            contrast(1.15)
            drop-shadow(0 0 10px rgba(0, 220, 255, 0.8));
    }
    100% {
        transform: translateY(-2px);
        filter:
            invert(90%)
            sepia(80%)
            saturate(650%)
            hue-rotate(80deg)
            brightness(1.25)
            contrast(1.2)
            drop-shadow(0 0 14px rgba(0, 180, 255, 0.9));
    }
}

/* Forest SVG art in Dark Forest location */
.terminal-output .terminal-line.forest-art {
    padding: 0.5rem 0 0.75rem 0;
    text-align: center;
}

.forest-logo {
    width: 380px;
    max-width: 90vw;
    display: block;
    margin: 0 auto;
    filter:
        invert(88%)
        sepia(72%)
        saturate(550%)
        hue-rotate(140deg)
        brightness(1.2)
        contrast(1.15)
        drop-shadow(0 0 8px rgba(0, 255, 120, 0.7));
    animation: forest-logo-glow 1.6s ease-in-out infinite alternate;
}

@keyframes forest-logo-glow {
    0% {
        transform: translateY(0);
        filter:
            invert(84%)
            sepia(63%)
            saturate(449%)
            hue-rotate(140deg)
            brightness(1.05)
            contrast(1.05)
            drop-shadow(0 0 4px rgba(0, 255, 120, 0.5));
    }
    50% {
        transform: translateY(-1px);
        filter:
            invert(90%)
            sepia(80%)
            saturate(650%)
            hue-rotate(140deg)
            brightness(1.25)
            contrast(1.18)
            drop-shadow(0 0 12px rgba(120, 255, 200, 0.9));
    }
    100% {
        transform: translateY(-2px);
        filter:
            invert(92%)
            sepia(85%)
            saturate(700%)
            hue-rotate(140deg)
            brightness(1.3)
            contrast(1.2)
            drop-shadow(0 0 18px rgba(80, 255, 180, 1));
    }
}

/* Dungeon / ruins SVG art in Ancient Dungeon location */
.terminal-output .terminal-line.dungeon-art {
    padding: 0.5rem 0 0.75rem 0;
    text-align: center;
}

.dungeon-logo {
    width: 380px;
    max-width: 90vw;
    display: block;
    margin: 0 auto;
    filter:
        invert(86%)
        sepia(70%)
        saturate(600%)
        hue-rotate(320deg)
        brightness(1.15)
        contrast(1.15)
        drop-shadow(0 0 8px rgba(255, 120, 80, 0.7));
    animation: dungeon-logo-glow 1.6s ease-in-out infinite alternate;
}

@keyframes dungeon-logo-glow {
    0% {
        transform: translateY(0);
        filter:
            invert(82%)
            sepia(60%)
            saturate(500%)
            hue-rotate(320deg)
            brightness(1.05)
            contrast(1.05)
            drop-shadow(0 0 4px rgba(255, 120, 80, 0.5));
    }
    50% {
        transform: translateY(-1px);
        filter:
            invert(90%)
            sepia(80%)
            saturate(700%)
            hue-rotate(320deg)
            brightness(1.25)
            contrast(1.18)
            drop-shadow(0 0 12px rgba(255, 180, 120, 0.9));
    }
    100% {
        transform: translateY(-2px);
        filter:
            invert(92%)
            sepia(85%)
            saturate(750%)
            hue-rotate(320deg)
            brightness(1.3)
            contrast(1.2)
            drop-shadow(0 0 18px rgba(255, 140, 90, 1));
    }
}

/* Card-style location header */
.terminal-output .terminal-line.location-header-card {
    padding: 0;
    margin: 0.75rem 0;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
    border: 2px solid;
    background: linear-gradient(135deg, #1a1a1a 0%, #2a2a2a 100%);
}

.location-header-content {
    display: flex;
    align-items: center;
    gap: 1.5rem;
    padding: 1.25rem;
    min-height: 140px;
}

.location-header-svg {
    flex: 0 0 35%;
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 0;
}

.location-header-svg img {
    width: 100%;
    max-width: 200px;
    height: auto;
    display: block;
}

.location-header-text {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 0.75rem;
    min-width: 0;
}

.location-header-name {
    font-size: 1.4em;
    font-weight: 700;
    letter-spacing: 2px;
    text-transform: uppercase;
    line-height: 1.2;
}

.location-header-description {
    font-size: 0.95em;
    color: #d0d0d0;
    line-height: 1.5;
    opacity: 0.9;
}

/* Theme colors for location cards */
.location-header-card.location-theme-town {
    border-color: #00b8d4;
    background: linear-gradient(135deg, #0a1a2a 0%, #1a2a3a 50%, #0a1a2a 100%);
    box-shadow: 0 4px 16px rgba(0, 184, 212, 0.3), 0 0 20px rgba(0, 184, 212, 0.1);
}

.location-header-card.location-theme-town .location-header-name {
    color: #66d9ff;
    text-shadow: 0 0 10px rgba(102, 217, 255, 0.5);
}

.location-header-card.location-theme-town .location-header-svg .town-logo {
    filter:
        invert(84%)
        sepia(63%)
        saturate(449%)
        hue-rotate(80deg)
        brightness(1.1)
        contrast(1.1)
        drop-shadow(0 0 8px rgba(0, 255, 180, 0.6));
}

.location-header-card.location-theme-forest {
    border-color: #00c853;
    background: linear-gradient(135deg, #0a1a0a 0%, #1a2a1a 50%, #0a1a0a 100%);
    box-shadow: 0 4px 16px rgba(0, 200, 83, 0.3), 0 0 20px rgba(0, 200, 83, 0.1);
}

.location-header-card.location-theme-forest .location-header-name {
    color: #66ff99;
    text-shadow: 0 0 10px rgba(102, 255, 153, 0.5);
}

.location-header-card.location-theme-forest .location-header-svg .forest-logo {
    filter:
        invert(84%)
        sepia(63%)
        saturate(449%)
        hue-rotate(140deg)
        brightness(1.05)
        contrast(1.05)
        drop-shadow(0 0 8px rgba(0, 255, 120, 0.6));
}

.location-header-card.location-theme-dungeon {
    border-color: #ff6b35;
    background: linear-gradient(135deg, #2a1a0a 0%, #3a2a1a 50%, #2a1a0a 100%);
    box-shadow: 0 4px 16px rgba(255, 107, 53, 0.3), 0 0 20px rgba(255, 107, 53, 0.1);
}

.location-header-card.location-theme-dungeon .location-header-name {
    color: #ffaa66;
    text-shadow: 0 0 10px rgba(255, 170, 102, 0.5);
}

.location-header-card.location-theme-dungeon .location-header-svg .dungeon-logo {
    filter:
        invert(86%)
        sepia(70%)
        saturate(600%)
        hue-rotate(320deg)
        brightness(1.15)
        contrast(1.15)
        drop-shadow(0 0 8px rgba(255, 120, 80, 0.7));
}

/* Responsive: stack on mobile */
@media (max-width: 768px) {
    .location-header-content {
        flex-direction: column;
        gap: 1rem;
        padding: 1rem;
        min-height: auto;
    }

    .location-header-svg {
        flex: 0 0 auto;
        width: 100%;
        max-width: 250px;
    }

    .location-header-svg img {
        max-width: 100%;
    }

    .location-header-text {
        text-align: center;
    }

    .location-header-name {
        font-size: 1.2em;
    }

    .location-header-description {
        font-size: 0.9em;
    }
}

/* Pill button styling for terminal badges/tags */
.terminal-pill {
    display: inline-block;
    padding: 0.4rem 1rem;
    margin: 0.25rem 0.5rem;
    background: #4a4a4a;
    color: #fff;
    border-radius: 20px;
    font-size: 0.9em;
    font-weight: 600;
    transition: all 0.2s ease;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

/* Pill-style banner with slanted ends */
.terminal-banner {
    display: block;
    width: 100%;
    padding: 0.75rem 2rem;
    margin: 0.5rem 0;
    background: linear-gradient(135deg, #2a2a2a 0%, #1a1a1a 100%);
    color: #e0e0e0;
    font-size: 1.1em;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 2px;
    text-align: center;
    position: relative;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.4);
    border: 2px solid #404040;
    box-sizing: border-box;
    overflow: hidden;
}

.terminal-banner::before {
    content: '';
    position: absolute;
    left: -10px;
    top: 0;
    width: 30px;
    height: 100%;
    background: linear-gradient(135deg, #2a2a2a 0%, #1a1a1a 100%);
    border-left: 2px solid #404040;
    transform: skewX(-15deg);
    transform-origin: top left;
    z-index: 0;
}

.terminal-banner::after {
    content: '';
    position: absolute;
    right: -10px;
    top: 0;
    width: 30px;
    height: 100%;
    background: linear-gradient(135deg, #2a2a2a 0%, #1a1a1a 100%);
    border-right: 2px solid #404040;
    transform: skewX(15deg);
    transform-origin: top right;
    z-index: 0;
}

.terminal-banner span {
    position: relative;
    z-index: 1;
}

/* Banner color variants */
.terminal-banner.blue {
    background: linear-gradient(135deg, #1a2a3a 0%, #0a1a2a 100%);
    border-color: #0066aa;
    color: #66aaff;
}

.terminal-banner.blue::before,
.terminal-banner.blue::after {
    background: linear-gradient(135deg, #1a2a3a 0%, #0a1a2a 100%);
    border-color: #0066aa;
}

.terminal-banner.gold {
    background: linear-gradient(135deg, #3a2a1a 0%, #2a1a0a 100%);
    border-color: #ffaa00;
    color: #ffd700;
}

.terminal-banner.gold::before,
.terminal-banner.gold::after {
    background: linear-gradient(135deg, #3a2a1a 0%, #2a1a0a 100%);
    border-color: #ffaa00;
}

.terminal-pill:hover {
    background: #5a5a5a;
    transform: translateY(-1px);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

.terminal-pill.success {
    background: linear-gradient(135deg, #00ff00, #00aa00);
    color: #000;
}

.terminal-pill.victory {
    background: linear-gradient(135deg, #ffd700, #ffaa00, #ff8800);
    color: #000;
    font-weight: 700;
    position: relative;
    animation: victoryPulse 0.6s ease-out;
}

@keyframes victoryPulse {
    0% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.15);
    }
    100% {
        transform: scale(1);
    }
}

.terminal-pill.warning {
    background: linear-gradient(135deg, #ffaa00, #ff6600);
    color: #000;
}

.terminal-pill.danger {
    background: linear-gradient(135deg, #ff0000, #aa0000);
    color: #fff;
}

.terminal-pill.info {
    background: linear-gradient(135deg, #0088ff, #0066aa);
    color: #fff;
}

/* Confetti animation container */
.terminal-pill.victory::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    pointer-events: none;
    z-index: 10;
}

.terminal-pill.victory.confetti-active {
    animation: victoryPulse 0.6s ease-out, confettiExplode 0.8s ease-out;
}

@keyframes confettiExplode {
    0% {
        box-shadow: 0 0 0 0 rgba(255, 215, 0, 0);
    }
    50% {
        box-shadow: 
            0 -20px 0 -5px rgba(255, 215, 0, 0.8),
            20px -10px 0 -5px rgba(255, 0, 0, 0.8),
            -20px -10px 0 -5px rgba(0, 255, 0, 0.8),
            10px 10px 0 -5px rgba(255, 165, 0, 0.8),
            -10px 10px 0 -5px rgba(255, 0, 255, 0.8),
            0 20px 0 -5px rgba(0, 0, 255, 0.8);
    }
    100% {
        box-shadow: 0 0 0 0 rgba(255, 215, 0, 0);
    }
}

/* Gradient text effects (3-color fade) */
.terminal-gradient-1 {
    background: linear-gradient(90deg, #00ff00, #00ffff, #0088ff);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    font-weight: bold;
}

.terminal-gradient-2 {
    background: linear-gradient(90deg, #ff00ff, #ff0088, #ff0000);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    font-weight: bold;
}

.terminal-gradient-3 {
    background: linear-gradient(90deg, #ffff00, #ffaa00, #ff6600, #ff3300);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    font-weight: bold;
    font-size: 1.1em;
}

.terminal-gradient-4 {
    background: linear-gradient(90deg, #00ff00, #88ff00, #ffff00);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    font-weight: bold;
}

/* Animated gradient text */
.terminal-gradient-animated {
    background: linear-gradient(90deg, #00ff00, #00ffff, #0088ff, #00ff00);
    background-size: 200% 100%;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    font-weight: bold;
    animation: gradientShift 3s ease infinite;
}

@keyframes gradientShift {
    0% {
        background-position: 0% 50%;
    }
    50% {
        background-position: 100% 50%;
    }
    100% {
        background-position: 0% 50%;
    }
}

/* Glow effects for important text */
.terminal-glow {
    text-shadow: 0 0 10px currentColor, 0 0 20px currentColor, 0 0 30px currentColor;
}

.terminal-glow-green {
    color: #00ff00;
    text-shadow: 0 0 10px #00ff00, 0 0 20px #00ff00;
}

.terminal-glow-yellow {
    color: #ffff00;
    text-shadow: 0 0 10px #ffff00, 0 0 20px #ffff00;
}

.terminal-glow-red {
    color: #ff0000;
    text-shadow: 0 0 10px #ff0000, 0 0 20px #ff0000;
}

.terminal-glow-cyan {
    color: #00ffff;
    text-shadow: 0 0 10px #00ffff, 0 0 20px #00ffff;
}

/* Highlight boxes for important messages */
.terminal-highlight {
    display: inline-block;
    padding: 0.5rem 1rem;
    margin: 0.5rem 0;
    background: rgba(0, 255, 0, 0.1);
    border: 1px solid #00ff00;
    border-radius: 4px;
    border-left: 4px solid #00ff00;
}

.terminal-highlight.warning {
    background: rgba(255, 170, 0, 0.1);
    border-color: #ffaa00;
    border-left-color: #ffaa00;
}

.terminal-highlight.error {
    background: rgba(255, 0, 0, 0.1);
    border-color: #ff0000;
    border-left-color: #ff0000;
}

.terminal-highlight.info {
    background: rgba(0, 136, 255, 0.1);
    border-color: #0088ff;
    border-left-color: #0088ff;
}

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

.terminal-output .ansi-green {
    color: #00ff00;
}

.terminal-output .ansi-yellow {
    color: #ffff00;
}

.terminal-output .ansi-red {
    color: #ff0000;
}

.terminal-output .ansi-cyan {
    color: #00ffff;
}

.terminal-output .ansi-blue {
    color: #0088ff;
}

.terminal-output .ansi-magenta {
    color: #ff00ff;
}

.terminal-output .ansi-white {
    color: #ffffff;
}

.terminal-output .ansi-bold {
    font-weight: bold;
}

.terminal-output .ansi-dim {
    opacity: 0.6;
}

/* Combat Modal */
.combat-modal {
    z-index: 10002; /* Above story quest modal (10000) and welcome dialog (10001) */
}

.combat-modal-content {
    background: rgba(0, 0, 0, 0.95);
    border: 2px solid #00ff00;
    box-shadow: 0 0 20px rgba(0, 255, 0, 0.5);
    display: flex;
    flex-direction: column;
    padding: 0;
    overflow: hidden;
    font-family: 'Courier New', monospace;
    color: #00ff00;
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
}

/* Yellow during active combat */
.combat-modal-content.combat-active {
    border: 2px solid #ffaa00;
    box-shadow: 0 0 20px rgba(255, 170, 0, 0.5);
    color: #ffaa00;
}

/* Red when defeated */
.combat-modal-content.combat-defeated {
    border: 2px solid #ff0000;
    box-shadow: 0 0 20px rgba(255, 0, 0, 0.5);
    color: #ff0000;
}

.combat-modal.active {
    animation: combatFadeIn 0.3s ease-in;
}

.combat-display {
    display: flex;
    flex-direction: column;
    height: 100%;
    overflow: hidden;
}

@keyframes combatFadeIn {
    from {
        opacity: 0;
        transform: scale(0.95);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

.combat-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    text-align: center;
    margin-bottom: 0;
    padding: 1rem;
    border-bottom: 2px solid #00ff00;
    background: rgba(0, 255, 0, 0.05);
    gap: 1rem;
    flex-shrink: 0;
    transition: border-color 0.3s ease, background 0.3s ease;
}

.combat-modal-content.combat-active .combat-header {
    border-bottom: 2px solid #ffaa00;
    background: rgba(255, 170, 0, 0.05);
}

.combat-modal-content.combat-defeated .combat-header {
    border-bottom: 2px solid #ff0000;
    background: rgba(255, 0, 0, 0.05);
}

.combat-title-section {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
}

.combat-header-equipment {
    min-width: 120px;
    justify-content: center;
}

.combat-header.flash {
    animation: combatFlash 0.6s ease-in-out;
}

@keyframes combatFlash {
    0%, 100% {
        border-color: #ff00ff;
        background: rgba(255, 0, 255, 0.1);
    }
    50% {
        border-color: #ff0000;
        background: rgba(255, 0, 0, 0.2);
    }
}

.combat-title {
    font-size: 1.5rem;
    font-weight: bold;
    color: #ff00ff;
    margin-bottom: 0.5rem;
    text-transform: uppercase;
    letter-spacing: 2px;
}

.combat-subtitle {
    font-size: 1rem;
    color: #ffff00;
}

.combat-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 1rem;
    min-height: 0;
    max-height: 100%;
    overflow: hidden;
}

.combat-turn {
    text-align: center;
    font-size: 1.2rem;
    color: #00ffff;
    padding: 0.5rem;
    border-bottom: 1px solid #333;
    font-weight: bold;
}

.combat-arena {
    min-height: 200px;
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid #333;
    border-radius: 4px;
    position: relative;
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    padding: 2rem;
    overflow: hidden;
    gap: 2rem;
}

.combat-figure {
    font-size: 2rem;
    position: relative;
    width: 150px;
    height: 150px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.3s ease;
    z-index: 1;
    flex-shrink: 0;
}

.combat-figure img {
    /* Override with blue-purple gradient for combat figures */
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.5))
            drop-shadow(0 0 6px rgba(100, 150, 255, 0.6))
            drop-shadow(0 0 10px rgba(150, 100, 255, 0.4))
            drop-shadow(0 0 14px rgba(200, 100, 255, 0.3));
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.player-figure {
    color: #00ff00;
}

.player-figure img {
    filter: drop-shadow(0 0 10px #00ff00);
}

.monster-figure {
    color: #ff0000;
}

.monster-figure img {
    filter: drop-shadow(0 0 10px #ff0000);
}

/* Attack animations */
.player-figure.attacking {
    animation: playerAttack 0.6s ease-in-out;
}

.monster-figure.attacking {
    animation: monsterAttack 0.6s ease-in-out;
}

@keyframes playerAttack {
    0% {
        transform: translateX(0) scale(1);
    }
    50% {
        transform: translateX(150px) scale(1.2);
    }
    100% {
        transform: translateX(0) scale(1);
    }
}

@keyframes monsterAttack {
    0% {
        transform: translateX(0) scale(1);
    }
    50% {
        transform: translateX(-150px) scale(1.2);
    }
    100% {
        transform: translateX(0) scale(1);
    }
}

/* Critical hit animation */
.player-figure.critical {
    animation: playerCritical 0.8s ease-in-out;
}

.monster-figure.critical {
    animation: monsterCritical 0.8s ease-in-out;
}

@keyframes playerCritical {
    0%, 100% {
        transform: translateX(0) scale(1) rotate(0deg);
    }
    25% {
        transform: translateX(100px) scale(1.3) rotate(-10deg);
    }
    50% {
        transform: translateX(150px) scale(1.4) rotate(10deg);
    }
    75% {
        transform: translateX(100px) scale(1.3) rotate(-10deg);
    }
}

@keyframes monsterCritical {
    0%, 100% {
        transform: translateX(0) scale(1) rotate(0deg);
    }
    25% {
        transform: translateX(-100px) scale(1.3) rotate(10deg);
    }
    50% {
        transform: translateX(-150px) scale(1.4) rotate(-10deg);
    }
    75% {
        transform: translateX(-100px) scale(1.3) rotate(10deg);
    }
}

/* Hit effect */
.combat-arena::before {
    content: '';
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    width: 0;
    height: 0;
    background: radial-gradient(circle, rgba(255,255,0,0.8) 0%, transparent 70%);
    border-radius: 50%;
    opacity: 0;
    transition: all 0.3s ease;
    pointer-events: none;
    z-index: 0;
}

.combat-arena.hit::before {
    width: 200px;
    height: 200px;
    opacity: 1;
    animation: hitFlash 0.4s ease-out;
}

@keyframes hitFlash {
    0% {
        width: 0;
        height: 0;
        opacity: 1;
    }
    100% {
        width: 200px;
        height: 200px;
        opacity: 0;
    }
}

.combat-stats {
    display: flex;
    gap: 1rem;
    margin: 1rem 0;
    padding: 1rem;
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid #333;
    border-radius: 4px;
}

.combat-stats-panel {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.combat-stats-title {
    font-weight: bold;
    font-size: 0.9rem;
    color: #00aaff;
    text-align: center;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid #333;
    margin-bottom: 0.5rem;
}

.player-stats-panel .combat-stats-title {
    color: #00ff00;
}

.monster-stats-panel .combat-stats-title {
    color: #ff4444;
}

.combat-stats-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.5rem;
    font-size: 0.85rem;
}

.combat-stat-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.25rem 0.5rem;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 3px;
}

.combat-stat-label {
    color: #b0b0b0;
    font-weight: 500;
}

.combat-stat-value {
    color: #fff;
    font-weight: bold;
    font-family: 'Courier New', monospace;
}

.player-stats-panel .combat-stat-value {
    color: #00ff00;
}

.monster-stats-panel .combat-stat-value {
    color: #ff8888;
}

.combat-main-content {
    display: flex;
    gap: 1rem;
    flex: 1;
    min-height: 0;
    overflow: hidden;
}

.combat-left-panel {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 1rem;
    min-width: 0;
}

.combat-right-panel {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-width: 0;
    min-height: 0;
    max-height: 100%;
    overflow: hidden;
}

.combat-health-bars {
    display: flex;
    flex-direction: row;
    gap: 1rem;
    align-items: flex-start;
}

.combat-health-bars .combat-health {
    flex: 1;
    min-width: 0;
}

.combat-figure-wrapper {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    flex: 1;
}

.combat-health-above {
    width: 100%;
    max-width: 200px;
    min-width: 150px;
    background: rgba(0, 0, 0, 0.5);
    border: 1px solid #404040;
    border-radius: 4px;
    padding: 0.5rem;
    margin-bottom: 0.5rem;
}

.combat-health-above strong {
    display: block;
    font-size: 0.85rem;
    margin-bottom: 0.25rem;
    color: #b0b0b0;
}

.combat-health-above .health-bar-container {
    margin-bottom: 0.25rem;
}

.combat-health-above .health-text {
    font-size: 0.8rem;
    text-align: center;
    color: #b0b0b0;
}

.combat-health-above {
    background: rgba(0, 0, 0, 0.5);
    border: 1px solid #404040;
    border-radius: 4px;
    padding: 0.5rem;
    margin-bottom: 0.5rem;
}

.combat-health-above strong {
    display: block;
    font-size: 0.85rem;
    margin-bottom: 0.25rem;
    color: #b0b0b0;
}

.combat-health-above .health-bar-container {
    margin-bottom: 0.25rem;
}

.combat-health-above .health-text {
    font-size: 0.8rem;
    text-align: center;
    color: #b0b0b0;
}

.combat-log-box {
    display: flex;
    flex-direction: column;
    height: 100%;
    max-height: 100%;
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid #333;
    border-radius: 4px;
    padding: 1rem;
    overflow: hidden;
    min-height: 0;
}

.combat-log-title {
    font-weight: bold;
    font-size: 0.9rem;
    color: #00aaff;
    text-align: center;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid #333;
    margin-bottom: 0.5rem;
    flex-shrink: 0;
}

.combat-messages {
    flex: 1 1 0;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    overflow-y: auto;
    overflow-x: hidden;
    min-height: 0;
    max-height: 100%;
}

.combat-message.monster-quote {
    color: #ff8888;
    background: rgba(255, 68, 68, 0.1);
    font-style: italic;
    padding: 0.5rem;
    border-left: 3px solid #ff4444;
    border-radius: 3px;
}

.combat-modal-content .combat-footer {
    flex-shrink: 0;
    padding: 1rem;
    border-top: 2px solid #00ff00;
    background: rgba(0, 255, 0, 0.05);
    display: flex;
    justify-content: center;
    align-items: center;
    transition: border-color 0.3s ease, background 0.3s ease;
}

.combat-modal-content.combat-active .combat-footer {
    border-top: 2px solid #ffaa00;
    background: rgba(255, 170, 0, 0.05);
}

.combat-modal-content.combat-defeated .combat-footer {
    border-top: 2px solid #ff0000;
    background: rgba(255, 0, 0, 0.05);
}

.combat-footer {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 1rem;
    background: rgba(0, 0, 0, 0.5);
    border-top: 1px solid #333;
    margin-top: 1rem;
}

.combat-close-btn {
    padding: 0.5rem 1.5rem;
    background: rgba(0, 170, 255, 0.3);
    border: 1px solid #00aaff;
    color: #00aaff;
    border-radius: 4px;
    cursor: pointer;
    font-weight: bold;
    transition: all 0.2s ease;
}

.combat-close-btn:hover {
    background: rgba(0, 170, 255, 0.5);
    transform: translateY(-1px);
}

.combat-message {
    padding: 0.5rem;
    border-radius: 4px;
    min-height: 2rem;
    display: flex;
    align-items: center;
}

.combat-message.player-attack {
    color: #00ff00;
    background: rgba(0, 255, 0, 0.1);
}

.combat-message.player-attack.critical {
    color: #ffff00;
    background: rgba(255, 255, 0, 0.2);
    animation: criticalFlash 0.5s ease-in-out;
}

@keyframes criticalFlash {
    0%, 100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.05);
    }
}

.combat-message.monster-attack {
    color: #ff0000;
    background: rgba(255, 0, 0, 0.1);
}

.combat-message.monster-attack.critical {
    color: #ff6600;
    background: rgba(255, 102, 0, 0.2);
    animation: criticalFlash 0.5s ease-in-out;
}

.combat-health {
    padding: 0.5rem;
    border-radius: 4px;
    min-height: 2rem;
}

.combat-health.monster {
    color: #ffaa00;
}

.combat-health.player {
    color: #00ff00;
}

.health-bar-container {
    margin-top: 0.5rem;
    height: 20px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    overflow: hidden;
    border: 1px solid #333;
}

.health-bar {
    height: 100%;
    transition: width 0.3s ease-out;
    border-radius: 10px;
}

.health-bar.monster {
    background: linear-gradient(90deg, #ff6600, #ffaa00);
}

.health-bar.player {
    background: linear-gradient(90deg, #00ff00, #00aa00);
}

.health-bar.exp-bar {
    background: linear-gradient(90deg, #00aaff, #0066ff);
}

.health-text {
    margin-top: 0.25rem;
    font-size: 0.9rem;
}

.terminal-scrollbar {
    width: 12px;
    margin-left: 4px;
    display: none; /* Hidden by default, shown when there's scrollable content */
}

.terminal-scrollbar-track {
    width: 100%;
    height: 100%;
    background: #1a1a1a;
    border-radius: 6px;
    position: relative;
    border: 1px solid #333;
}

.terminal-scrollbar-thumb {
    position: absolute;
    width: 100%;
    background: #4a4a4a;
    border-radius: 6px;
    cursor: pointer;
    transition: background 0.2s;
    min-height: 20px;
}

.terminal-scrollbar-thumb:hover {
    background: #5a5a5a;
}

.terminal-scrollbar-thumb:active {
    background: #6a6a6a;
}

/* Modal Styles */
.modal {
    display: none;
    position: fixed;
    z-index: 2000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(4px);
    align-items: center;
    justify-content: center;
}

.modal.active,
.modal[style*="display: flex"],
.modal[style*="display:flex"] {
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    pointer-events: auto !important;
}

/* Ensure hidden modals don't block clicks */
.modal:not(.active) {
    display: none !important;
    pointer-events: none !important;
    visibility: hidden !important;
}

/* Ensure modal content is centered and clickable */
.modal-content {
    background: #2d2d2d;
    border: 2px solid #404040;
    border-radius: 8px;
    width: 90%;
    max-width: 700px;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.5);
    margin: auto; /* Center the content */
    overflow: hidden; /* Prevent modal itself from scrolling - body handles scrolling */
    pointer-events: auto;
    position: relative;
    z-index: 1;
}

/* Quest form modal needs explicit height for scrolling to work */
#quest-form-modal .modal-content {
    max-width: 800px !important; /* Override default max-width for quest form */
    max-height: 90vh !important;
    height: 90vh !important; /* Explicit height forces flex children to respect constraints */
}

/* Edit player modal should appear above admin modal */
#edit-player-modal {
    z-index: 3000;
}

/* Item, monster, and quest form modals should appear above admin modal */
#item-form-modal,
#monster-form-modal,
#player-item-add-modal,
#quest-form-modal {
    z-index: 3000;
}

.inventory-modal-content {
    max-width: 700px;
    width: 90%;
}

.inventory-modal-body {
    display: flex;
    flex-direction: row;
    gap: 1rem;
    padding: 1.5rem;
    overflow: hidden;
    position: relative;
}

.inventory-main {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.inventory-item-panel {
    width: 350px;
    background: #1a1a1a;
    border: 2px solid #404040;
    border-radius: 8px;
    display: flex;
    flex-direction: column;
    position: absolute;
    right: 0;
    top: 0;
    bottom: 0;
    transform: translateX(100%);
    transition: transform 0.3s ease;
    max-height: calc(80vh - 120px);
    opacity: 0;
    pointer-events: none;
    z-index: 10;
}

.inventory-item-panel.active {
    transform: translateX(0);
    opacity: 1;
    pointer-events: auto;
}

.inventory-item-panel-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem;
    border-bottom: 1px solid #404040;
}

.inventory-item-panel-header h3 {
    margin: 0;
    color: #fff;
    font-size: 1.2rem;
}

.item-panel-close {
    background: none;
    border: none;
    color: #b0b0b0;
    font-size: 1.5rem;
    cursor: pointer;
    padding: 0;
    width: 2rem;
    height: 2rem;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: color 0.2s ease;
}

.item-panel-close:hover {
    color: #fff;
}

.inventory-item-panel-content {
    padding: 1.5rem;
    overflow-y: auto;
    flex: 1;
}

.item-panel-icon {
    width: 120px;
    height: 120px;
    margin: 0 auto 1.5rem;
    background: rgba(255, 255, 255, 0.05);
    border: 2px solid #404040;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    position: relative;
}

.item-panel-icon img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    filter: drop-shadow(0 2px 8px rgba(0, 0, 0, 0.5));
}

.item-panel-icon img[src=""],
.item-panel-icon img:not([src]) {
    display: none !important;
}

.item-panel-icon .icon-fallback {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.item-panel-details {
    margin-bottom: 1.5rem;
}

.item-detail-row {
    margin-bottom: 0.75rem;
    padding-bottom: 0.75rem;
    border-bottom: 1px solid #404040;
}

.item-detail-row:last-child {
    border-bottom: none;
    margin-bottom: 0;
    padding-bottom: 0;
}

.item-detail-label {
    color: #b0b0b0;
    font-size: 0.9rem;
    margin-bottom: 0.25rem;
}

.item-detail-value {
    color: #fff;
    font-size: 1rem;
    font-weight: 500;
}

.item-panel-actions {
    display: flex;
    gap: 0.5rem;
    margin-top: auto;
    padding-top: 1rem;
    flex-wrap: wrap;
}

.item-panel-actions .btn {
    flex: 1;
    min-width: 80px;
    padding: 0.75rem;
    font-size: 0.9rem;
    font-weight: 600;
    border: 2px solid;
    border-radius: 6px;
    transition: all 0.2s ease;
    cursor: pointer;
}

.item-panel-actions .btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.4);
}

.item-panel-actions .btn:active {
    transform: translateY(0);
}

/* Equip button - brighter blue */
.item-panel-actions #item-equip-btn {
    background: rgba(0, 170, 255, 0.4) !important;
    border-color: rgba(0, 170, 255, 0.8) !important;
    color: #88ccff !important;
}

.item-panel-actions #item-equip-btn:hover {
    background: rgba(0, 170, 255, 0.6) !important;
    border-color: #00aaff !important;
    color: #ffffff !important;
    box-shadow: 0 4px 12px rgba(0, 170, 255, 0.4) !important;
}

/* Drop button - brighter red */
.item-panel-actions .btn-danger,
.item-panel-actions #item-drop-btn {
    background: rgba(255, 68, 68, 0.4) !important;
    border-color: rgba(255, 68, 68, 0.8) !important;
    color: #ffaaaa !important;
}

.item-panel-actions .btn-danger:hover,
.item-panel-actions #item-drop-btn:hover {
    background: rgba(255, 68, 68, 0.6) !important;
    border-color: #ff4444 !important;
    color: #ffffff !important;
    box-shadow: 0 4px 12px rgba(255, 68, 68, 0.4) !important;
}

/* Use button - brighter green */
.item-panel-actions #item-use-btn {
    background: rgba(0, 255, 0, 0.4) !important;
    border-color: rgba(0, 255, 0, 0.8) !important;
    color: #88ff88 !important;
}

.item-panel-actions #item-use-btn:hover {
    background: rgba(0, 255, 0, 0.6) !important;
    border-color: #00ff00 !important;
    color: #ffffff !important;
    box-shadow: 0 4px 12px rgba(0, 255, 0, 0.4) !important;
}

/* Sell button - brighter gold */
.item-panel-actions #item-sell-btn {
    background: rgba(255, 200, 0, 0.4) !important;
    border-color: rgba(255, 200, 0, 0.8) !important;
    color: #ffdd88 !important;
}

.item-panel-actions #item-sell-btn:hover {
    background: rgba(255, 200, 0, 0.6) !important;
    border-color: #ffc800 !important;
    color: #ffffff !important;
    box-shadow: 0 4px 12px rgba(255, 200, 0, 0.4) !important;
}

.modal-header {
    padding: 1.5rem;
    border-bottom: 1px solid #404040;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-shrink: 0; /* Prevent header from shrinking */
}

/* Ensure quest form modal header doesn't shrink */
#quest-form-modal .modal-header {
    flex-shrink: 0;
}

.modal-header h2 {
    color: #00ff00;
    margin: 0;
    font-size: 1.5rem;
}

.modal-close {
    background: none;
    border: none;
    color: #b0b0b0;
    font-size: 2rem;
    cursor: pointer;
    padding: 0;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
    transition: all 0.2s;
    pointer-events: auto;
    z-index: 1;
    position: relative;
}

.modal-close:hover {
    background: #404040;
    color: #fff;
}

.modal-body {
    padding: 1.5rem;
    overflow-y: auto;
    overflow-x: hidden;
    flex: 1; /* Take up remaining space */
}

/* Ensure quest form modal body scrolls properly */
#quest-form-modal .modal-body {
    overflow-y: auto !important;
    overflow-x: hidden !important;
    flex: 1 1 0 !important; /* Take remaining space, allow shrinking */
    min-height: 0 !important; /* Critical for flex scrolling - allows flex item to shrink below content size */
    max-height: 100% !important; /* Don't exceed parent height */
    -webkit-overflow-scrolling: touch; /* Smooth scrolling on iOS */
    scrollbar-width: thin !important; /* Firefox - force scrollbar */
    scrollbar-color: #404040 #1a1a1a !important; /* Firefox scrollbar colors */
    position: relative; /* Ensure scrollbar positioning */
}

/* Webkit scrollbar styling for quest form modal - always visible */
#quest-form-modal .modal-body::-webkit-scrollbar {
    width: 12px !important; /* Make scrollbar more visible */
    -webkit-appearance: none;
}

#quest-form-modal .modal-body::-webkit-scrollbar-track {
    background: #1a1a1a !important;
    border-radius: 6px;
}

#quest-form-modal .modal-body::-webkit-scrollbar-thumb {
    background: #606060 !important; /* Lighter color for visibility */
    border-radius: 6px;
    border: 2px solid #1a1a1a;
}

#quest-form-modal .modal-body::-webkit-scrollbar-thumb:hover {
    background: #707070 !important;
}

.modal-body .loading {
    text-align: center;
    color: #b0b0b0;
    padding: 2rem;
}

.modal-footer {
    padding: 1rem;
    border-top: 1px solid #404040;
    display: flex;
    justify-content: flex-end;
    gap: 0.5rem;
    flex-shrink: 0; /* Prevent footer from shrinking */
}

/* Ensure quest form modal footer doesn't shrink */
#quest-form-modal .modal-footer {
    flex-shrink: 0 !important;
}

/* Ensure quest form modal form element doesn't interfere with flex layout */
#quest-form-modal form {
    display: flex !important;
    flex-direction: column !important;
    flex: 1 1 0 !important;
    min-height: 0 !important;
    overflow: hidden !important;
}

/* Skills Modal Styles */
.skill-points-info {
    margin-bottom: 1.5rem;
    padding: 1rem;
    background: #1a1a1a;
    border-radius: 6px;
    border: 1px solid #404040;
}

.skill-points-info p {
    margin: 0.5rem 0;
    color: #e0e0e0;
}

.skill-points-info strong {
    color: #00ff00;
    font-size: 1.2em;
}

.skill-hint {
    color: #b0b0b0;
    font-size: 0.9em;
    font-style: italic;
}

.skills-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.skill-item {
    background: #1a1a1a;
    border: 1px solid #404040;
    border-radius: 6px;
    padding: 1rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.skill-info {
    flex: 1;
}

.skill-name {
    font-weight: 700;
    color: #00ff00;
    font-size: 1.1em;
    margin-bottom: 0.25rem;
}

.skill-description {
    color: #b0b0b0;
    font-size: 0.9em;
    margin-bottom: 0.5rem;
}

.skill-value {
    color: #e0e0e0;
    font-size: 1.1em;
}

.skill-controls {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.skill-btn {
    background: #2a2a2a;
    border: 2px solid #404040;
    color: #e0e0e0;
    padding: 0.5rem 1rem;
    border-radius: 4px;
    cursor: pointer;
    font-size: 1em;
    transition: all 0.2s ease;
    min-width: 40px;
}

.skill-btn:hover:not(:disabled) {
    background: #3a3a3a;
    border-color: #00ff00;
    color: #00ff00;
}

.skill-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.skill-input {
    background: #1a1a1a;
    border: 2px solid #404040;
    color: #e0e0e0;
    padding: 0.5rem;
    border-radius: 4px;
    width: 60px;
    text-align: center;
    font-size: 1em;
}

.skill-input:focus {
    outline: none;
    border-color: #00ff00;
}

/* Quest List Styles */
.quest-item {
    background: #1a1a1a;
    border: 1px solid #404040;
    border-radius: 6px;
    padding: 1rem;
    margin-bottom: 1rem;
    transition: all 0.2s;
}

.quest-item:hover {
    border-color: #00ff00;
    box-shadow: 0 2px 8px rgba(0, 255, 0, 0.2);
}

.quest-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 0.5rem;
}

.quest-name {
    color: #00ff00;
    font-size: 1.1rem;
    font-weight: bold;
    margin: 0;
}

.quest-status {
    padding: 0.25rem 0.75rem;
    border-radius: 4px;
    font-size: 0.85rem;
    font-weight: bold;
    text-transform: uppercase;
}

.quest-status.available {
    background: #1a3a1a;
    color: #00ff00;
}

.quest-status.in_progress {
    background: #3a3a1a;
    color: #ffff00;
}

.quest-status.completed {
    background: #1a3a1a;
    color: #00ff00;
}

.quest-status.locked {
    background: #3a1a1a;
    color: #ff4444;
}

.quest-description {
    color: #b0b0b0;
    margin: 0.5rem 0;
    line-height: 1.5;
}

.quest-requirements {
    margin: 0.75rem 0;
    padding: 0.5rem;
    background: #0a0a0a;
    border-radius: 4px;
    font-size: 0.9rem;
}

.quest-requirements-title {
    color: #00ff00;
    font-weight: bold;
    margin-bottom: 0.25rem;
}

.quest-requirements-list {
    color: #b0b0b0;
    margin: 0;
    padding-left: 1.25rem;
}

.quest-rewards {
    margin: 0.75rem 0;
    padding: 0.5rem;
    background: #1a1a2a;
    border-radius: 4px;
    font-size: 0.9rem;
}

.quest-rewards-title {
    color: #00ffff;
    font-weight: bold;
    margin-bottom: 0.25rem;
}

.quest-rewards-list {
    color: #b0b0b0;
    margin: 0;
    padding-left: 1.25rem;
}

.quest-progress {
    margin: 0.75rem 0;
    padding: 0.5rem;
    background: #1a1a1a;
    border-radius: 4px;
    font-size: 0.9rem;
    color: #ffff00;
}

.quest-actions {
    margin-top: 1rem;
    display: flex;
    gap: 0.5rem;
}

.quest-btn {
    padding: 0.5rem 1rem;
    border: none;
    border-radius: 4px;
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.2s;
    font-weight: 500;
}

.quest-btn-accept {
    background: #00ff00;
    color: #000;
}

.quest-btn-accept:hover {
    background: #00cc00;
    transform: translateY(-1px);
}

.quest-btn-accept:disabled {
    background: #4a4a4a;
    color: #666;
    cursor: not-allowed;
    transform: none;
}

.quest-btn-view {
    background: #4a4a4a;
    color: #fff;
}

.quest-btn-view:hover {
    background: #5a5a5a;
}

.terminal-input-container {
    display: flex;
    align-items: center;
    padding: 0.5rem;
    background: #1a1a1a;
    border-top: 1px solid #333;
    border-radius: 0 0 4px 4px;
    margin-top: 0.5rem;
}

.terminal-prompt {
    color: #00ff00;
    font-family: 'Courier New', monospace;
    font-size: 14px;
    margin-right: 0.5rem;
    user-select: none;
}

.terminal-input {
    flex: 1;
    background: transparent;
    border: none;
    color: #00ff00;
    font-family: 'Courier New', monospace;
    font-size: 14px;
    outline: none;
    padding: 0.25rem;
}

.terminal-input::placeholder {
    color: #666;
}

/* Sidebar */
.game-sidebar {
    width: 300px;
    min-width: 300px;
    display: flex;
    flex-direction: column;
    gap: 1rem;
    overflow-y: auto;
    overflow-x: hidden;
}

.sidebar-panel {
    background: #2d2d2d;
    border-radius: 4px;
    padding: 1rem;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
}

.sidebar-panel h3 {
    color: #00ff00;
    margin-bottom: 1rem;
    font-size: 1.1rem;
    border-bottom: 1px solid #404040;
    padding-bottom: 0.5rem;
}

/* Player Stats */
.player-stats {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.stat-item {
    display: flex;
    justify-content: space-between;
    padding: 0.5rem 0;
    border-bottom: 1px solid #404040;
}

.stat-item:last-child {
    border-bottom: none;
}

.stat-label {
    color: #b0b0b0;
}

.stat-value {
    color: #fff;
    font-weight: 500;
}

/* Actions */
.action-buttons {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.action-btn {
    padding: 0.75rem;
    background: #4a4a4a;
    color: #fff;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.2s;
    font-size: 0.9rem;
}

.action-btn:hover:not(:disabled) {
    background: #5a5a5a;
    transform: translateY(-1px);
}

.action-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Locations */
.location-buttons {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.location-btn {
    padding: 0.75rem 1.5rem;
    background: linear-gradient(135deg, #2a2a2a 0%, #1a1a1a 100%);
    border: 2px solid #404040;
    border-radius: 8px;
    color: #e0e0e0;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.3), inset 0 1px 0 rgba(255, 255, 255, 0.1);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    text-align: center;
    width: 100%;
    position: relative;
    overflow: hidden;
}

.location-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.1), transparent);
    transition: left 0.5s;
}

.location-btn:hover::before {
    left: 100%;
}

.location-btn:hover:not(:disabled) {
    background: linear-gradient(135deg, #3a3a3a 0%, #2a2a2a 100%);
    border-color: #00ff00;
    color: #00ff00;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 255, 0, 0.3), 0 2px 4px rgba(0, 0, 0, 0.4), inset 0 1px 0 rgba(255, 255, 255, 0.2);
}

.location-btn:active:not(:disabled) {
    transform: translateY(0);
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.3), inset 0 2px 4px rgba(0, 0, 0, 0.4);
}

.location-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}

.location-btn.active {
    background: linear-gradient(135deg, #00ff00 0%, #00cc00 100%);
    border-color: #00ff00;
    color: #000;
    font-weight: bold;
    box-shadow: 0 4px 8px rgba(0, 255, 0, 0.4), 0 2px 4px rgba(0, 0, 0, 0.4), inset 0 1px 0 rgba(255, 255, 255, 0.3);
}

/* Stats Grid */
.stats-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.5rem;
    margin-top: 0.5rem;
}

.stat-box {
    background: #1a1a1a;
    padding: 0.5rem;
    border-radius: 4px;
    text-align: center;
}

.stat-box-label {
    color: #b0b0b0;
    font-size: 0.8rem;
    margin-bottom: 0.25rem;
}

.stat-box-value {
    color: #00ff00;
    font-size: 1.2rem;
    font-weight: bold;
}

/* Settings Tabs */
.settings-tabs {
    display: flex;
    border-bottom: 2px solid #404040;
    background: #1a1a1a;
    padding: 0;
    margin: 0;
}

.settings-tab {
    flex: 1;
    padding: 1rem 1.5rem;
    background: transparent;
    border: none;
    border-bottom: 3px solid transparent;
    color: #808080;
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    text-align: center;
}

.settings-tab:hover {
    background: rgba(255, 255, 255, 0.05);
    color: #b0b0b0;
}

.settings-tab.active {
    color: #00aaff;
    border-bottom-color: #00aaff;
    background: rgba(0, 170, 255, 0.1);
}

.settings-tab-content {
    position: relative;
}

.settings-tab-panel {
    display: none;
}

.settings-tab-panel.active {
    display: block;
}

/* Responsive */
/* Admin Panel Styles */
.admin-tabs {
    display: flex;
    gap: 0.5rem;
    padding: 0.5rem 1rem 0 1rem;
    border-bottom: 2px solid #404040;
    background: #1a1a1a;
    margin: 0;
}

.admin-tab {
    padding: 0.75rem 1.5rem;
    background: #2d2d2d;
    border: 1px solid #404040;
    border-radius: 4px 4px 0 0;
    color: #b0b0b0;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 0.9rem;
}

.admin-tab:hover {
    background: #353535;
    color: #fff;
}

.admin-tab.active {
    background: #2d2d2d;
    border-bottom-color: #2d2d2d;
    color: #00ff00;
    border-color: #00ff00;
    border-bottom: 2px solid #2d2d2d;
    margin-bottom: -2px;
}

.admin-tab-content {
    display: none;
}

.admin-tab-content.active {
    display: block;
}

/* Player Edit Modal Tabs - Match admin tab styling */
.admin-tab-btn {
    padding: 0.75rem 1.5rem;
    background: #2d2d2d;
    border: 1px solid #404040;
    border-radius: 4px 4px 0 0;
    color: #b0b0b0;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 0.9rem;
    font-family: inherit;
    margin: 0;
}

.admin-tab-btn:hover {
    background: #353535;
    color: #fff;
}

.admin-tab-btn.active {
    background: #2d2d2d;
    border-bottom-color: #2d2d2d;
    color: #00ff00;
    border-color: #00ff00;
    border-bottom: 2px solid #2d2d2d;
    margin-bottom: -2px;
}

.player-edit-tab-content {
    display: none;
    padding: 1rem 0;
}

.player-edit-tab-content.active {
    display: block;
}

.admin-table-container {
    background: #1a1a1a;
    border: 1px solid #404040;
    border-radius: 4px;
    overflow-x: auto;
}

.admin-table {
    width: 100%;
    border-collapse: collapse;
}

.admin-table th,
.admin-table td {
    padding: 0.75rem;
    text-align: left;
    border-bottom: 1px solid #404040;
}

.admin-table th {
    background: #252525;
    color: #00ff00;
    font-weight: 600;
    position: sticky;
    top: 0;
    z-index: 10;
}

.admin-table tr:hover {
    background: #252525;
}

.admin-table td {
    color: #b0b0b0;
}

.admin-actions {
    display: flex;
    gap: 0.5rem;
}

.admin-btn-small {
    padding: 0.25rem 0.5rem;
    font-size: 0.8rem;
    border-radius: 4px;
    cursor: pointer;
    border: 1px solid;
    transition: all 0.2s ease;
}

.admin-btn-edit {
    background: rgba(0, 170, 255, 0.2);
    border-color: rgba(0, 170, 255, 0.4);
    color: #88ccff;
}

.admin-btn-edit:hover {
    background: rgba(0, 170, 255, 0.3);
    border-color: rgba(0, 170, 255, 0.6);
}

.admin-btn-delete {
    background: rgba(255, 68, 68, 0.2);
    border-color: rgba(255, 68, 68, 0.4);
    color: #ff8888;
}

.admin-btn-delete:hover {
    background: rgba(255, 68, 68, 0.3);
    border-color: rgba(255, 68, 68, 0.6);
}

.admin-btn-block {
    background: rgba(255, 200, 0, 0.2);
    border-color: rgba(255, 200, 0, 0.4);
    color: #ffcc88;
}

.admin-btn-block:hover {
    background: rgba(255, 200, 0, 0.3);
    border-color: rgba(255, 200, 0, 0.6);
}

.admin-btn-unblock {
    background: rgba(0, 255, 0, 0.2);
    border-color: rgba(0, 255, 0, 0.4);
    color: #88ff88;
}

.admin-btn-unblock:hover {
    background: rgba(0, 255, 0, 0.3);
    border-color: rgba(0, 255, 0, 0.6);
}

.admin-btn-blacksmith-yes {
    background: rgba(255, 200, 0, 0.3);
    border-color: rgba(255, 200, 0, 0.6);
    color: #ffcc88;
}

.admin-btn-blacksmith-yes:hover {
    background: rgba(255, 200, 0, 0.4);
    border-color: rgba(255, 200, 0, 0.8);
    color: #ffdd99;
}

.admin-btn-blacksmith-no {
    background: rgba(100, 100, 100, 0.3);
    border-color: rgba(100, 100, 100, 0.6);
    color: #b0b0b0;
}

.admin-btn-blacksmith-no:hover {
    background: rgba(100, 100, 100, 0.4);
    border-color: rgba(100, 100, 100, 0.8);
    color: #d0d0d0;
}

.admin-btn-potion-shop-yes {
    background: rgba(138, 43, 226, 0.3);
    border-color: rgba(138, 43, 226, 0.6);
    color: #dda0dd;
}

.admin-btn-potion-shop-yes:hover {
    background: rgba(138, 43, 226, 0.4);
    border-color: rgba(138, 43, 226, 0.8);
    color: #e6b3e6;
}

.admin-btn-potion-shop-no {
    background: rgba(100, 100, 100, 0.3);
    border-color: rgba(100, 100, 100, 0.6);
    color: #b0b0b0;
}

.admin-btn-potion-shop-no:hover {
    background: rgba(100, 100, 100, 0.4);
    border-color: rgba(100, 100, 100, 0.8);
    color: #d0d0d0;
}

.admin-btn-monster-yes {
    background: rgba(255, 100, 100, 0.3);
    border-color: rgba(255, 100, 100, 0.6);
    color: #ff8888;
}

.admin-btn-monster-yes:hover {
    background: rgba(255, 100, 100, 0.4);
    border-color: rgba(255, 100, 100, 0.8);
    color: #ffaaaa;
}

.admin-btn-monster-no {
    background: rgba(100, 100, 100, 0.3);
    border-color: rgba(100, 100, 100, 0.6);
    color: #b0b0b0;
}

.admin-btn-monster-no:hover {
    background: rgba(100, 100, 100, 0.4);
    border-color: rgba(100, 100, 100, 0.8);
    color: #d0d0d0;
}

.admin-settings-section {
    margin-bottom: 2rem;
    padding: 1rem;
    background: #1a1a1a;
    border: 1px solid #404040;
    border-radius: 4px;
}

.admin-settings-section h4 {
    color: #00ff00;
    margin-top: 0;
    margin-bottom: 1rem;
}

.admin-input,
.admin-textarea {
    width: 100%;
    padding: 0.5rem;
    background: #2d2d2d;
    border: 1px solid #404040;
    border-radius: 4px;
    color: #fff;
    font-family: inherit;
    margin-top: 0.5rem;
    margin-bottom: 0.5rem;
}

.admin-textarea {
    resize: vertical;
    min-height: 80px;
}

.admin-input:focus,
.admin-textarea:focus {
    outline: none;
    border-color: #00ff00;
}

.admin-form-group {
    margin-bottom: 1rem;
}

.admin-form-group label {
    display: block;
    color: #b0b0b0;
    margin-bottom: 0.25rem;
    font-size: 0.9rem;
}

.admin-player-details {
    background: #1a1a1a;
    border: 1px solid #404040;
    border-radius: 4px;
    padding: 1rem;
    margin-top: 1rem;
}

.admin-player-details h4 {
    color: #00ff00;
    margin-top: 0;
}

.admin-player-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 0.5rem;
    margin-top: 0.5rem;
}

.admin-player-stat {
    background: #252525;
    padding: 0.5rem;
    border-radius: 4px;
    font-size: 0.9rem;
}

.admin-player-stat-label {
    color: #b0b0b0;
    font-size: 0.8rem;
}

.admin-player-stat-value {
    color: #fff;
    font-weight: 600;
}

.admin-inventory-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 0.5rem;
    margin-top: 0.5rem;
}

.admin-inventory-item {
    background: #252525;
    padding: 0.5rem;
    border-radius: 4px;
    border: 1px solid #404040;
    font-size: 0.85rem;
}

/* Password Strength Indicator */
.password-strength-container {
    margin-top: 0.5rem;
}

.password-strength-bar {
    width: 100%;
    height: 6px;
    background: #2d2d2d;
    border-radius: 3px;
    overflow: hidden;
    margin-bottom: 0.5rem;
}

.password-strength-fill {
    height: 100%;
    width: 0%;
    transition: width 0.3s ease, background-color 0.3s ease;
    border-radius: 3px;
}

.password-strength-fill.weak {
    width: 25%;
    background: #ff4444;
}

.password-strength-fill.fair {
    width: 50%;
    background: #ffaa00;
}

.password-strength-fill.good {
    width: 75%;
    background: #00aaff;
}

.password-strength-fill.strong {
    width: 100%;
    background: #00ff00;
}

.password-strength-text {
    font-size: 0.85rem;
    margin-bottom: 0.25rem;
}

.password-strength-text.weak {
    color: #ff4444;
}

.password-strength-text.fair {
    color: #ffaa00;
}

.password-strength-text.good {
    color: #00aaff;
}

.password-strength-text.strong {
    color: #00ff00;
}

.password-requirements {
    font-size: 0.75rem;
    color: #888;
    margin-top: 0.25rem;
}

.password-requirements .requirement {
    display: flex;
    align-items: center;
    gap: 0.25rem;
    margin-bottom: 0.15rem;
}

.password-requirements .requirement.met {
    color: #00ff00;
}

.password-requirements .requirement.unmet {
    color: #888;
}

.password-requirements .requirement::before {
    content: '○';
    font-size: 0.6rem;
}

.password-requirements .requirement.met::before {
    content: '✓';
    color: #00ff00;
}

.password-match-message {
    font-size: 0.85rem;
    margin-top: 0.25rem;
}

.password-match-message.match {
    color: #00ff00;
}

.password-match-message.no-match {
    color: #ff4444;
}

/* Sell Quantity Modal Styles */
#sell-quantity-slider {
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    height: 8px;
    background: #404040;
    border-radius: 4px;
    outline: none;
    transition: background 0.3s;
}

#sell-quantity-slider:hover {
    background: #505050;
}

#sell-quantity-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 20px;
    height: 20px;
    background: #00aaff;
    border-radius: 50%;
    cursor: pointer;
    border: 2px solid #1a1a1a;
    transition: all 0.2s;
}

#sell-quantity-slider::-webkit-slider-thumb:hover {
    background: #00ccff;
    transform: scale(1.1);
}

#sell-quantity-slider::-moz-range-thumb {
    appearance: none;
    -moz-appearance: none;
    width: 20px;
    height: 20px;
    background: #00aaff;
    border-radius: 50%;
    cursor: pointer;
    border: 2px solid #1a1a1a;
    transition: all 0.2s;
}

#sell-quantity-slider::-moz-range-thumb:hover {
    background: #00ccff;
    transform: scale(1.1);
}

#sell-quantity-input {
    appearance: textfield;
    -moz-appearance: textfield;
}

#sell-quantity-input::-webkit-outer-spin-button,
#sell-quantity-input::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

@media (max-width: 768px) {
    .game-content {
        flex-direction: column;
    }
    
    .game-sidebar {
        width: 100%;
    }
    
    .game-header {
        flex-direction: column;
        gap: 1rem;
    }
    
    .admin-tabs {
        flex-wrap: wrap;
    }
    
    .admin-table-container {
        overflow-x: scroll;
    }
}

/* Welcome Dialog should appear above story quest modal when needed */
#welcome-dialog {
    z-index: 10001 !important;
}

/* Rankings Styles */
.rankings-container {
    flex: 1;
    display: flex;
    flex-direction: column;
    background: #1a1a1a;
    border-radius: 4px;
    padding: 1rem;
    min-height: 0;
    overflow: hidden;
}

.rankings-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid #404040;
}

.rankings-header h3 {
    color: #00ff00;
    margin: 0;
}

.rankings-list {
    flex: 1;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.ranking-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem;
    background: #2d2d2d;
    border: 1px solid #404040;
    border-radius: 4px;
    transition: background 0.2s;
}

.ranking-item:hover {
    background: #353535;
}

.ranking-rank {
    font-size: 1.2rem;
    font-weight: bold;
    color: #b0b0b0;
    min-width: 3rem;
    text-align: center;
}

.ranking-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: #1a1a1a;
    border: 1px solid #404040;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    overflow: hidden;
}

.ranking-avatar-img {
    width: 32px;
    height: 32px;
    object-fit: contain;
}

.ranking-info {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.ranking-header {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: 0.5rem;
}

.ranking-header-main {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.ranking-username {
    font-weight: bold;
    color: #00ff00;
    font-size: 1.1rem;
}

.rankings-header-actions {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.rankings-search-input {
    background: #1a1a1a;
    border: 1px solid #404040;
    border-radius: 4px;
    padding: 0.4rem 0.6rem;
    color: #e0e0e0;
    min-width: 200px;
}

.rankings-search-input::placeholder {
    color: #777;
}

.ranking-badge {
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    font-size: 0.85rem;
    font-weight: bold;
}

.ranking-badge-1st {
    background: #ffd700;
    color: #000;
}

.ranking-badge-2nd {
    background: #c0c0c0;
    color: #000;
}

.ranking-badge-3rd {
    background: #cd7f32;
    color: #fff;
}

.ranking-stats {
    color: #b0b0b0;
    font-size: 0.9rem;
    display: flex;
    gap: 0.5rem;
    align-items: center;
}

.online-indicator {
    color: #00ff00;
    font-size: 0.8rem;
    margin-left: 0.25rem;
}

.offline-indicator {
    color: #666;
    font-size: 0.8rem;
    margin-left: 0.25rem;
}

.btn-small {
    padding: 0.5rem 1rem;
    font-size: 0.9rem;
}

/* Chat Styles */
.chat-container {
    flex: 1;
    display: flex;
    flex-direction: column;
    background: #1a1a1a;
    border-radius: 4px;
    padding: 1rem;
    min-height: 0;
    overflow: hidden;
}

.chat-messages {
    flex: 1;
    overflow-y: auto;
    background: #000;
    border: 1px solid #404040;
    border-radius: 4px;
    padding: 1rem;
    margin-bottom: 1rem;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    min-height: 0;
}

.chat-message {
    padding: 0.75rem;
    background: #2d2d2d;
    border-radius: 4px;
    border-left: 3px solid #00ff00;
}

/* Admin messages: purple edge */
.chat-message.chat-message-admin {
    border-left-color: #b84dff;
}

/* Top 1-3 ranked players: yellow/gold edge (when not admin) */
.chat-message.chat-message-top {
    border-left-color: #ffc800;
}

.chat-message-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.5rem;
    font-size: 0.85rem;
}

.chat-message-user {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.chat-avatar {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: #1a1a1a;
    border: 1px solid #404040;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    overflow: hidden;
}

.chat-avatar-img {
    width: 22px;
    height: 22px;
    object-fit: contain;
}

.chat-message-username {
    font-weight: bold;
    color: #00ff00;
}

.chat-badge {
    display: inline-flex;
    align-items: center;
    padding: 0.1rem 0.4rem;
    border-radius: 999px;
    font-size: 0.7rem;
    font-weight: 600;
    margin-left: 0.3rem;
}

.chat-badge-admin {
    background: rgba(184, 77, 255, 0.2);
    border: 1px solid rgba(184, 77, 255, 0.7);
    color: #e0b3ff;
}

.chat-badge-rank {
    background: rgba(255, 200, 0, 0.15);
    border: 1px solid rgba(255, 200, 0, 0.6);
    color: #ffd54f;
}

.chat-badge-rank-1 {
    background: rgba(255, 215, 0, 0.2);
}

.chat-badge-rank-2 {
    background: rgba(192, 192, 192, 0.2);
}

.chat-badge-rank-3 {
    background: rgba(205, 127, 50, 0.2);
}

.chat-message-time {
    color: #888;
    font-size: 0.8rem;
}

.chat-message-text {
    color: #e0e0e0;
    line-height: 1.5;
    word-wrap: break-word;
    white-space: pre-wrap;
}

.chat-link {
    color: #00aaff;
    text-decoration: underline;
    cursor: pointer;
}

.chat-link:hover {
    color: #00ccff;
}

.chat-online-indicator {
    margin-left: 0.5rem;
    font-size: 0.7rem;
}

.chat-input-container {
    display: flex;
    gap: 0.5rem;
}

.chat-input {
    flex: 1;
    padding: 0.75rem;
    background: #2d2d2d;
    border: 1px solid #404040;
    border-radius: 4px;
    color: #e0e0e0;
    font-size: 1rem;
    font-family: inherit;
}

.chat-input:focus {
    outline: none;
    border-color: #00ff00;
}

.chat-input:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* View Player Modal Styles */
.view-player-header {
    display: flex;
    gap: 1rem;
    align-items: center;
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid #404040;
}

.view-player-avatar img {
    border-radius: 4px;
    border: 2px solid #404040;
}

.view-player-basic h3 {
    color: #00ff00;
    margin: 0 0 0.5rem 0;
}

.view-player-status {
    display: flex;
    gap: 0.5rem;
    align-items: center;
    color: #b0b0b0;
    font-size: 0.9rem;
    margin-bottom: 0.25rem;
}

.view-player-location {
    color: #888;
    font-size: 0.85rem;
}

.view-player-stats {
    margin-bottom: 1.5rem;
}

.view-player-stats h4 {
    color: #00ff00;
    margin: 0 0 0.75rem 0;
    font-size: 1rem;
}

.view-player-stats-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 0.75rem;
}

.view-player-stat {
    display: flex;
    justify-content: space-between;
    padding: 0.5rem;
    background: #2d2d2d;
    border-radius: 4px;
}

.stat-label {
    color: #b0b0b0;
}

.stat-value {
    color: #00ff00;
    font-weight: bold;
}

.view-player-bio {
    margin-bottom: 1.5rem;
}

.view-player-bio h4 {
    color: #00ff00;
    margin: 0 0 0.75rem 0;
    font-size: 1rem;
}

.view-player-bio p {
    color: #e0e0e0;
    line-height: 1.6;
    white-space: pre-wrap;
    padding: 0.75rem;
    background: #2d2d2d;
    border-radius: 4px;
}

.view-player-equipped h4 {
    color: #00ff00;
    margin: 0 0 0.75rem 0;
    font-size: 1rem;
}

.view-player-items-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 0.75rem;
}

.view-player-item {
    padding: 0.75rem;
    background: #2d2d2d;
    border: 1px solid #404040;
    border-radius: 4px;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
}

.view-player-item-icon {
    width: 64px;
    height: 64px;
    margin-bottom: 0.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid #404040;
    border-radius: 4px;
    padding: 0.5rem;
}

.view-player-item-icon img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.view-player-item-name {
    font-weight: bold;
    color: #00ff00;
    margin-bottom: 0.25rem;
}

.view-player-item-type {
    color: #b0b0b0;
    font-size: 0.85rem;
    margin-bottom: 0.5rem;
}

.view-player-item-stat {
    color: #e0e0e0;
    font-size: 0.85rem;
    margin-top: 0.25rem;
}

/* Story Quest Modal Styles */
.story-quest-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.85);
    z-index: 10000;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(4px);
}

.story-quest-modal.active {
    display: flex;
}

.story-quest-content {
    background: #1a1a1a;
    border: 2px solid #404040;
    border-radius: 12px;
    width: 90%;
    max-width: 900px;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.8);
    overflow: hidden;
}

.story-quest-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 1.5rem;
    border-bottom: 1px solid #404040;
    background: #2d2d2d;
}

.story-quest-progress {
    color: #b0b0b0;
    font-size: 0.9rem;
    font-weight: 500;
}

.story-quest-controls {
    display: flex;
    gap: 0.5rem;
}

.story-quest-btn-icon {
    background: transparent;
    border: 1px solid #404040;
    border-radius: 4px;
    color: #b0b0b0;
    padding: 0.5rem;
    cursor: pointer;
    font-size: 1.2rem;
    transition: all 0.2s;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.story-quest-btn-icon:hover {
    background: #404040;
    color: #fff;
    border-color: #00aaff;
}

.story-quest-btn-icon.active {
    background: #00aaff;
    border-color: #00aaff;
    color: #fff;
}

.story-quest-body {
    display: flex;
    flex: 1;
    overflow: hidden;
    min-height: 0;
}

.story-quest-portrait-container {
    flex: 0 0 200px;
    padding: 2rem 1.5rem;
    display: flex;
    align-items: flex-start;
    justify-content: center;
    background: #151515;
    border-right: 1px solid #404040;
}

.story-quest-portrait {
    width: 150px;
    height: 150px;
    border-radius: 8px;
    background: #2d2d2d;
    border: 2px solid #404040;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.story-quest-portrait img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.5));
}

.story-quest-text-container {
    flex: 1;
    display: flex;
    flex-direction: column;
    padding: 2rem;
    overflow-y: auto;
    min-height: 0;
}

.chat-empty {
    color: #808080;
    text-align: center;
    padding: 1rem;
    font-size: 0.95rem;
}

.story-quest-text {
    color: #fff;
    font-size: 1.1rem;
    line-height: 1.8;
    margin-bottom: 2rem;
    min-height: 100px;
    font-style: italic;
    position: relative;
}

.story-quest-text.typewriter {
    white-space: pre-wrap;
    word-wrap: break-word;
}

.story-quest-text.typewriter::after {
    content: '|';
    animation: blink 1s infinite;
    color: #00aaff;
    margin-left: 2px;
}

.story-quest-text.typewriter.complete::after {
    display: none;
}

@keyframes blink {
    0%, 50% { opacity: 1; }
    51%, 100% { opacity: 0; }
}

.story-quest-choices {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    margin-top: auto;
}

.story-quest-choice {
    padding: 1rem 1.5rem;
    background: #2d2d2d;
    border: 2px solid #404040;
    border-radius: 8px;
    color: #fff;
    cursor: pointer;
    text-align: left;
    font-size: 1rem;
    transition: all 0.3s;
    position: relative;
    overflow: hidden;
}

.story-quest-choice::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    height: 100%;
    width: 0;
    background: rgba(0, 170, 255, 0.2);
    transition: width 0.3s;
}

.story-quest-choice:hover {
    border-color: #00aaff;
    background: #353535;
    transform: translateX(5px);
}

.story-quest-choice:hover::before {
    width: 100%;
}

.story-quest-choice:active {
    transform: translateX(2px);
}

.story-quest-footer {
    padding: 1rem 1.5rem;
    border-top: 1px solid #404040;
    background: #2d2d2d;
    display: flex;
    justify-content: flex-end;
}

/* Animation Classes */
.fade-in {
    animation: fadeIn 0.3s ease-in;
}

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

.fade-out {
    animation: fadeOut 0.3s ease-out;
}

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

.slide-in-left {
    animation: slideInLeft 0.4s ease-out;
}

@keyframes slideInLeft {
    from {
        transform: translateX(-100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

.slide-in-right {
    animation: slideInRight 0.4s ease-out;
}

@keyframes slideInRight {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

.slide-out-left {
    animation: slideOutLeft 0.4s ease-out;
}

@keyframes slideOutLeft {
    from {
        transform: translateX(0);
        opacity: 1;
    }
    to {
        transform: translateX(-100%);
        opacity: 0;
    }
}

.slide-out-right {
    animation: slideOutRight 0.4s ease-out;
}

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

/* Responsive adjustments for story quest modal */
@media (max-width: 768px) {
    .story-quest-body {
        flex-direction: column;
    }
    
    .story-quest-portrait-container {
        flex: 0 0 auto;
        border-right: none;
        border-bottom: 1px solid #404040;
        padding: 1rem;
    }
    
    .story-quest-portrait {
        width: 100px;
        height: 100px;
    }
    
    .story-quest-text-container {
        padding: 1.5rem;
    }
    
    .story-quest-text {
        font-size: 1rem;
    }
}

/* General Store Modal Styles */
.store-item-section {
    transition: all 0.2s ease;
}

.store-item-section:hover {
    border-color: #00aaff !important;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 170, 255, 0.2);
}

.store-item-section button:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.store-item-section button:not(:disabled):hover {
    transform: scale(1.05);
    box-shadow: 0 0 10px rgba(0, 170, 255, 0.5);
}

/* Message compose recipient input alignment */
#message-compose-to {
    text-align: left !important;
}

#message-compose-to::placeholder {
    text-align: left !important;
}

