:root {
    /* Primary Background - Deep Space */
    --sw-space-black: #0a0a0f;
    --sw-void-black: #1a1a24;
    --sw-dark-matter: #252532;
    
    /* Secondary Backgrounds - Imperial Gray */
    --sw-death-star: #2d2d3a;
    --sw-star-destroyer: #3a3a4a;
    --sw-imperial-steel: #4a4a5a;
    
    /* Accent Colors - Lightsabers */
    --sw-sith-red: #ff0a0a;
    --sw-sith-crimson: #c41e3a;
    --sw-jedi-blue: #00d4ff;
    --sw-jedi-cyan: #4a9eff;
    --sw-jedi-green: #00ff88;
    --sw-mace-purple: #9d5fff;
    
    /* Hyperspace & Energy */
    --sw-hyperspace-blue: #1e3a8a;
    --sw-hyperspace-glow: #4a90e2;
    --sw-blaster-bolt: #ff6b35;
    --sw-energy-yellow: #ffd700;
    
    /* Empire & Order */
    --sw-empire-white: #e8e8e8;
    --sw-stormtrooper: #f5f5f5;
    --sw-imperial-red: #c92a2a;
    
    /* Rebellion & Resistance */
    --sw-rebel-orange: #ff6b00;
    --sw-resistance-gold: #d4a017;
    
    /* Dark Side - Shadows & Depths */
    --sw-dark-side: #1a0a0a;
    --sw-sith-shadow: #2d0a1a;
    --sw-vader-black: #0d0d0d;
    
    /* Light Side - Subtle Accents */
    --sw-force-glow: #a8dadc;
    --sw-light-side: #e0f7ff;
    
    /* Neutral Tones */
    --sw-tatooine-sand: #c4a777;
    --sw-beskar-silver: #8b9099;
    --sw-carbon-freeze: #4a5463;
    
    /* Text Colors */
    --sw-text-primary: #e8e8e8;
    --sw-text-secondary: #a8b2c0;
    --sw-text-muted: #6a7588;
    
    /* Legacy variable mappings */
    --primary-color: var(--sw-jedi-cyan);
    --primary-hover: var(--sw-jedi-blue);
    --secondary-color: var(--sw-mace-purple);
    --background: var(--sw-space-black);
    --surface: var(--sw-void-black);
    --surface-light: var(--sw-dark-matter);
    --text-primary: var(--sw-text-primary);
    --text-secondary: var(--sw-text-secondary);
    --border: var(--sw-carbon-freeze);
    --success: var(--sw-jedi-green);
    --warning: var(--sw-energy-yellow);
    --danger: var(--sw-sith-red);
    --user-message: var(--sw-jedi-cyan);
    --ai-message: var(--sw-mace-purple);
}

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

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: var(--background);
    color: var(--text-primary);
    height: 100vh;
    height: 100dvh; /* Use dynamic viewport height for mobile */
    overflow: hidden;
    position: fixed;
    width: 100%;
}
a {
    color: var(--sw-hyperspace-blue);
    text-decoration: underline;
}
.container {
    display: flex;
    flex-direction: column;
    height: 100vh;
    height: 100dvh; /* Use dynamic viewport height for mobile */
    overflow: hidden;
}

/* Header */
.header {
    background: var(--surface);
    border-bottom: 2px solid var(--border);
    padding: 1rem 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 1rem;
    position: relative;
}

.header-content h1 {
    font-size: 1.8rem;
    color: var(--primary-color);
}

.subtitle {
    color: var(--text-secondary);
    font-size: 0.9rem;
}

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

/* User Menu Dropdown */
.user-menu {
    position: relative;
    display: flex;
    align-items: center;
}

.user-menu-btn {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-weight: 600;
    color: var(--text-primary);
}

.user-menu-btn #usernameDisplay {
    color: var(--text-primary);
}

.dropdown-arrow {
    font-size: 0.7rem;
    transition: transform 0.2s;
}

.user-menu-btn:hover .dropdown-arrow {
    transform: translateY(2px);
}

.user-dropdown {
    position: absolute;
    top: 100%;
    right: 0;
    margin-top: 0.5rem;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    min-width: 200px;
    z-index: 1000;
}

.dropdown-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    width: 100%;
    padding: 0.75rem 1rem;
    background: transparent;
    border: none;
    color: var(--text-primary);
    text-align: left;
    cursor: pointer;
    transition: background 0.2s;
    font-size: 0.9rem;
}

.dropdown-item:first-child {
    border-radius: 8px 8px 0 0;
}

.dropdown-item:last-child {
    border-radius: 0 0 8px 8px;
}

.dropdown-item:hover {
    background: var(--surface-light);
}

.username-input input {
    padding: 0.5rem 1rem;
    background: var(--background);
    border: 1px solid var(--border);
    border-radius: 6px;
    color: var(--text-primary);
    font-size: 0.9rem;
    max-width: 200px;
}

.username-input input:focus {
    outline: none;
    border-color: var(--primary-color);
}

/* Buttons */
.btn {
    padding: 0.4rem 0.8rem;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.85rem;
    font-weight: 600;
    transition: all 0.2s;
}

.btn-primary {
    background: var(--primary-color);
    color: white;
}

.btn-primary:hover {
    background: var(--primary-hover);
}

.btn-secondary {
    background: var(--surface-light);
    color: var(--text-primary);
}

.btn-secondary:hover {
    background: var(--border);
}

.btn-block {
    width: 100%;
    margin-bottom: 0.5rem;
}

.btn-icon {
    background: transparent;
    border: none;
    cursor: pointer;
    font-size: 1rem;
    padding: 0.2rem;
}

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

/* Mobile Menu Button */
.mobile-menu-btn {
    display: none;
    padding: 0.5rem 0.75rem;
    font-size: 1.2rem;
    position: absolute;
    right: 1rem;
    top: 50%;
    transform: translateY(-50%);
}

/* Mobile Menu Section in Sidebar */
.mobile-menu-section {
    display: none;
    background: var(--background);
    margin: -1rem -1rem 0 -1rem;
    padding: 1rem;
    border-bottom: 2px solid var(--border);
}

.mobile-user-info {
    margin-bottom: 1rem;
    padding-bottom: 0.75rem;
    border-bottom: 1px solid var(--border);
}

.mobile-menu-actions {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

/* Sidebar Overlay */
.sidebar-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 99;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.sidebar-overlay.active {
    display: block;
    opacity: 1;
}

/* Main Content */
.main-content {
    display: flex;
    flex: 1;
    overflow: hidden;
}

/* Sidebar */
.sidebar {
    width: 400px;
    background: var(--surface);
    border-right: 1px solid var(--border);
    overflow-y: auto;
    padding: 1rem;
}

.sidebar-section {
    margin-bottom: 1.5rem;
    padding-bottom: 1.5rem;
    border-bottom: 1px solid var(--border);
}

.sidebar-section:last-child {
    border-bottom: none;
}

.sidebar-section h3 {
    font-size: 1rem;
    margin-bottom: 0.8rem;
    color: var(--primary-color);
}

.sidebar-section h4 {
    font-size: 0.85rem;
    margin-bottom: 0.5rem;
    color: var(--text-secondary);
    text-transform: uppercase;
}

.info-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.5rem 0;
    font-size: 0.9rem;
}

.info-item .label {
    color: var(--text-secondary);
}

.info-item .value {
    color: var(--text-primary);
    font-weight: 600;
    font-family: monospace;
}

.memory-section {
    margin-bottom: 1rem;
}

.memory-list {
    background: var(--background);
    padding: 0.8rem;
    border-radius: 6px;
    font-size: 0.85rem;
    min-height: 40px;
}

.memory-list em {
    color: var(--text-secondary);
}

.memory-list .tag {
    display: inline-block;
    background: var(--surface-light);
    padding: 0.2rem 0.6rem;
    border-radius: 12px;
    margin: 0.2rem;
    font-size: 0.8rem;
}

.saved-chats h4 {
    margin-top: 1rem;
}

#savedChatsItems {
    max-height: 200px;
    overflow-y: auto;
}

.saved-chat-item {
    background: var(--background);
    padding: 0.5rem;
    margin: 0.3rem 0;
    border-radius: 4px;
    font-size: 0.85rem;
    transition: background 0.2s;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.saved-chat-item:hover {
    background: var(--surface-light);
}

.delete-chat-btn {
    background: transparent;
    border: none;
    cursor: pointer;
    font-size: 1.1rem;
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    transition: all 0.2s;
    opacity: 0.6;
}

.delete-chat-btn:hover {
    background: rgba(220, 38, 38, 0.2);
    opacity: 1;
}

/* Saved chats list in Load Chat modal */
.saved-chats-list {
    max-height: 250px;
    overflow-y: auto;
    background: var(--background);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 0.75rem;
    min-height: 100px;
}

.saved-chats-list:empty::before {
    content: 'No saved chats';
    color: var(--text-secondary);
    font-size: 0.875rem;
    font-style: italic;
}

/* Chat Container */
.chat-container {
    flex: 1;
    display: flex;
    flex-direction: column;
    background: var(--background);
    position: relative;
}

/* Wallpaper background with overlay */
.chat-container.has-wallpaper {
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    background-attachment: fixed;
}

.chat-container.has-wallpaper::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(26, 26, 36, 0.88);
    pointer-events: none;
    z-index: 0;
}

.chat-container.has-wallpaper > * {
    position: relative;
    z-index: 1;
}

.chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 2rem;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.welcome-message {
    text-align: center;
    padding: 4rem 2rem;
    color: var(--text-secondary);
}

.welcome-message h2 {
    color: var(--primary-color);
    margin-bottom: 1rem;
}

.message {
    display: flex;
    gap: 1rem;
    animation: messageSlide 0.3s ease-out;
}

@keyframes messageSlide {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.message-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    flex-shrink: 0;
}

.message.user .message-avatar {
    background: var(--user-message);
}

.message.ai .message-avatar {
    background: var(--ai-message);
}

.message-content {
    flex: 1;
    max-width: 800px;
}

.message-header {
    display: flex;
    gap: 0.5rem;
    align-items: baseline;
    margin-bottom: 0.3rem;
}

.message-username {
    font-weight: 600;
    font-size: 0.9rem;
}

.message.user .message-username {
    color: var(--user-message);
}

.message.ai .message-username {
    color: var(--ai-message);
}

.message-timestamp {
    font-size: 0.75rem;
    color: var(--text-secondary);
}

.message-text {
    background: var(--surface);
    padding: 1rem;
    border-radius: 8px;
    white-space: pre-wrap;
}

/* Markdown styling in messages */
.message-text h1,
.message-text h2,
.message-text h3 {
    margin: 0.4em 0 0.2em 0;
}

.message-text h1 {
    font-size: 1.4em;
    border-bottom: 2px solid var(--border);
    padding-bottom: 0.2em;
}

.message-text h2 {
    font-size: 1.2em;
}

.message-text h3 {
    font-size: 1.1em;
}

.message-text p {
    margin: 0.3em 0;
}

.message-text ul,
.message-text ol {
    margin: 0.3em 0;
    padding-left: 1.5em;
}

.message-text li {
    margin: 0.2em 0;
}

.message-text code {
    background: var(--background);
    padding: 0.2em 0.4em;
    border-radius: 3px;
    font-family: 'Courier New', monospace;
    font-size: 0.9em;
}

.message-text pre {
    background: var(--background);
    padding: 1em;
    border-radius: 6px;
    overflow-x: auto;
    margin: 0.3em 0;
}

.message-text pre code {
    background: none;
    padding: 0;
}

.message-text blockquote {
    border-left: 3px solid var(--border);
    margin: 0.3em 0;
    padding-left: 1em;
    color: var(--text-secondary);
}

.message-text strong {
    font-weight: 600;
}

.message-text em {
    font-style: italic;
}

.message-text a {
    color: var(--primary-color);
    text-decoration: none;
}

.message-text a:hover {
    text-decoration: underline;
}

.message-text hr {
    border: none;
    border-top: 1px solid var(--border);
    margin: 0.5em 0;
}

.message.ai .message-text {
    border-left: 3px solid var(--ai-message);
}

.message.user .message-text {
    border-left: 3px solid var(--user-message);
}

/* Chat Input */
.chat-input-container {
    border-top: 1px solid var(--border);
    background: var(--surface);
    padding: 1rem 2rem;
}

.quick-actions {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1rem;
    flex-wrap: wrap;
}

.quick-action-btn {
    padding: 0.5rem 1rem;
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: 6px;
    color: var(--text-primary);
    font-size: 0.875rem;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.quick-action-btn:hover {
    background: var(--surface);
    border-color: var(--primary-color);
    transform: translateY(-1px);
}

.quick-action-btn:active {
    transform: translateY(0);
}

.quick-action-btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
    background: var(--background);
    border-color: var(--border);
}

.quick-action-btn:disabled:hover {
    transform: none;
    border-color: var(--border);
}

.start-adventure-btn {
    display: none;
    margin: 1rem auto;
    padding: 1rem 2rem;
    background: var(--sw-jedi-cyan);
    border: 2px solid var(--sw-jedi-cyan);
    border-radius: 8px;
    color: white;
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(74, 158, 255, 0.3);
    text-transform: uppercase;
    letter-spacing: 1px;
    animation: pulse-glow 2s infinite;
}

.start-adventure-btn:hover {
    background: var(--sw-jedi-blue);
    border-color: var(--sw-jedi-blue);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(74, 158, 255, 0.5);
}

.start-adventure-btn:active {
    transform: translateY(0);
}

.start-adventure-btn i {
    margin-right: 0.5rem;
}

@keyframes pulse-glow {
    0%, 100% {
        box-shadow: 0 4px 15px rgba(74, 158, 255, 0.3);
    }
    50% {
        box-shadow: 0 4px 25px rgba(74, 158, 255, 0.6);
    }
}

.typing-indicator {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 0;
    color: var(--text-secondary);
    font-size: 0.9rem;
}

.typing-indicator span {
    width: 8px;
    height: 8px;
    background: var(--primary-color);
    border-radius: 50%;
    display: inline-block;
    animation: typing 1.4s infinite;
}

.typing-indicator span:nth-child(2) {
    animation-delay: 0.2s;
}

.typing-indicator span:nth-child(3) {
    animation-delay: 0.4s;
}

@keyframes typing {
    0%, 60%, 100% {
        transform: translateY(0);
        opacity: 0.7;
    }
    30% {
        transform: translateY(-10px);
        opacity: 1;
    }
}

.input-wrapper {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    align-items: flex-end;
}

#messageInput {
    flex: 1;
    background: var(--background);
    border: 2px solid var(--border);
    border-radius: 8px;
    padding: 0.8rem;
    color: var(--text-primary);
    font-size: 0.95rem;
    resize: vertical;
    min-height: 60px;
    max-height: 200px;
    font-family: inherit;
}

#messageInput:focus {
    outline: none;
    border-color: var(--primary-color);
}

.btn-send {
    background: var(--primary-color);
    color: white;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.8rem 1.5rem;
    height: fit-content;
}

.btn-send:hover:not(:disabled) {
    background: var(--primary-hover);
}

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

.modal-content {
    background-color: var(--surface);
    margin: 5% auto;
    padding: 2rem;
    border: 1px solid var(--border);
    border-radius: 12px;
    width: 90%;
    max-width: 500px;
}

.modal-content h2 {
    margin-bottom: 1rem;
    color: var(--primary-color);
}

.modal-content input {
    width: 100%;
    padding: 0.8rem;
    margin: 1rem 0;
    background: var(--background);
    border: 1px solid var(--border);
    border-radius: 6px;
    color: var(--text-primary);
    font-size: 1rem;
}

.close {
    color: var(--text-secondary);
    float: right;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
}

.close:hover {
    color: var(--text-primary);
}

/* Recent Chats List */
.recent-chats-list {
    max-height: 250px;
    overflow-y: auto;
    background: var(--background);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 0.75rem;
}

.recent-chat-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.75rem;
    margin-bottom: 0.5rem;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s;
}

.recent-chat-item:hover {
    background: var(--surface-light);
    border-color: var(--primary-color);
    transform: translateX(4px);
}

.recent-chat-item:last-child {
    margin-bottom: 0;
}

.recent-chat-info {
    flex: 1;
    min-width: 0;
}

.recent-chat-name {
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 0.25rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.recent-chat-id {
    font-size: 0.75rem;
    color: var(--text-secondary);
    font-family: monospace;
}

.recent-chat-time {
    font-size: 0.75rem;
    color: var(--text-secondary);
    white-space: nowrap;
    margin-left: 0.5rem;
}

.delete-recent-chat {
    background: none;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    padding: 0.25rem 0.5rem;
    font-size: 1rem;
    margin-left: 0.5rem;
    opacity: 0;
    transition: all 0.2s;
}

.recent-chat-item:hover .delete-recent-chat {
    opacity: 1;
}

.delete-recent-chat:hover {
    color: var(--danger);
}

/* Form Group Styles */
.form-group {
    margin-bottom: 1.5rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    color: var(--text-secondary);
    font-weight: 500;
    font-size: 0.9rem;
}

.form-group input[type="password"] {
    width: 100%;
    padding: 0.8rem;
    background: var(--background);
    border: 1px solid var(--border);
    border-radius: 8px;
    color: var(--text-primary);
    font-size: 1rem;
    transition: border-color 0.2s ease;
}

.form-group input[type="password"]:focus {
    outline: none;
    border-color: var(--primary-color);
}

.error-message {
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid rgba(239, 68, 68, 0.3);
    color: #ef4444;
    padding: 0.75rem;
    border-radius: 6px;
    margin-bottom: 1rem;
    font-size: 0.9rem;
}

.success-message {
    background: rgba(16, 185, 129, 0.1);
    border: 1px solid rgba(16, 185, 129, 0.3);
    color: #10b981;
    padding: 0.75rem;
    border-radius: 6px;
    margin-bottom: 1rem;
    font-size: 0.9rem;
}

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

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

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

::-webkit-scrollbar-thumb:hover {
    background: var(--surface-light);
}

/* Responsive */
@media (max-width: 768px) {
    .mobile-menu-btn {
        display: inline-block !important;
    }
    
    .mobile-menu-section {
        display: block !important;
    }
    
    .header-actions {
        display: none !important;
    }
    
    .user-menu {
        display: none !important;
    }
    
    .sidebar {
        position: fixed;
        left: -100%;
        width: 85%;
        max-width: 350px;
        height: 100%;
        z-index: 100;
        transition: left 0.3s ease;
        box-shadow: 2px 0 10px rgba(0, 0, 0, 0.3);
    }
    
    .sidebar.open {
        left: 0;
    }
    
    .header {
        flex-direction: column;
        align-items: flex-start;
        padding: 1rem;
    }
    
    .header-content h1 {
        font-size: 1.4rem;
    }
    
    .header-actions {
        width: 100%;
        flex-wrap: wrap;
    }
    
    .header-actions .btn {
        font-size: 0.85rem;
        padding: 0.5rem 0.8rem;
    }
    
    .chat-messages {
        padding: 1rem;
    }
    
    .quick-actions {
        margin-top: 0.5rem;
        gap: 0.35rem;
        margin-bottom: 0.75rem;
    }
    
    .quick-action-btn {
        padding: 0.4rem 0.75rem;
        font-size: 0.8rem;
        gap: 0.35rem;
    }
    
    .message {
        flex-direction: column;
        gap: 0.5rem;
    }
    
    .message-avatar {
        width: 32px;
        height: 32px;
        font-size: 1rem;
    }
    
    .message-content {
        flex: 1;
        max-width: 100%;
        width: 100%;
    }
    
    .message-text {
        padding: 0.75rem;
    }
    
    .message-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.25rem;
    }
    
    .chat-input-container {
        flex-direction: column;
        padding: 0.75rem;
        gap: 0.5rem;
    }
    
    .input-wrapper {
        flex-direction: column;
        width: 100%;
    }
    
    #messageInput {
        width: 100%;
        min-height: 80px;
        font-size: 0.9rem;
    }
    
    .btn-send {
        width: 100%;
    }
    
    .file-preview {
        max-width: 100%;
        margin-right: 0;
        margin-bottom: 0.5rem;
    }
    
    .file-preview .file-name {
        max-width: 200px;
    }
    
    /* Soundboard adjustments */
    .soundboard-modal {
        width: 95%;
        max-height: 95vh;
        margin: 2.5% auto;
    }
    
    .audio-grid {
        grid-template-columns: 1fr;
    }
    
    .bgm-player-controls {
        flex-direction: column;
        align-items: stretch;
    }
    
    .volume-control {
        justify-content: space-between;
    }
    
    .volume-control input[type="range"] {
        width: 100px;
    }
    
    /* Modal adjustments */
    .modal-content {
        width: 95%;
        margin: 5% auto;
        padding: 1.5rem;
    }
    
    .modal-header h2 {
        font-size: 1.3rem;
    }
    
    .character-info-modal {
        width: 95%;
    }
    
    .char-stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    /* Sidebar sections */
    .sidebar-section {
        padding-bottom: 1rem;
        margin-bottom: 1rem;
    }
    
    .memory-list {
        font-size: 0.8rem;
    }
    
    /* Player chat */
    .player-chat-section {
        max-height: 250px;
    }
    
    .player-chat-messages {
        max-height: 150px;
        min-height: 100px;
    }
    
    /* Toast notifications */
    .toast-notification {
        right: 10px;
        top: 10px;
        max-width: calc(100vw - 40px);
    }
    
    /* Character name input */
    .character-name-input {
        width: 100%;
        margin-top: 0.5rem;
    }
    
    .character-name-input input {
        width: 100%;
    }
}

@media (max-width: 480px) {
    .header-content h1 {
        font-size: 1.2rem;
    }
    
    .subtitle {
        font-size: 0.8rem;
    }
    
    .btn {
        padding: 0.5rem 0.75rem;
        font-size: 0.8rem;
    }
    
    .chat-messages {
        padding: 0.75rem;
    }
    
    .message-content {
        max-width: 100%;
        width: 100%;
    }
    
    .message-text {
        padding: 0.6rem;
        font-size: 0.9rem;
    }
    
    .message-avatar {
        width: 28px;
        height: 28px;
        font-size: 0.9rem;
    }
    
    #messageInput {
        width: 100%;
        font-size: 0.85rem;
        min-height: 70px;
    }
    
    .sidebar {
        width: 90%;
        max-width: none;
    }
    
    .audio-section h3 {
        font-size: 1rem;
    }
    
    .audio-btn {
        padding: 0.6rem 0.8rem;
        font-size: 0.85rem;
    }
    
    .char-stats-grid {
        grid-template-columns: 1fr;
    }
    
    .modal-content {
        padding: 1rem;
    }
    
    .modal-header h2 {
        font-size: 1.1rem;
    }
    
    .volume-control input[type="range"] {
        width: 80px;
    }
    
    .info-item {
        font-size: 0.85rem;
    }
    
    .player-item {
        padding: 0.4rem;
        font-size: 0.85rem;
    }
    
    .you-badge {
        font-size: 0.65rem;
        padding: 0.1rem 0.3rem;
    }
}

/* Landscape mobile optimization */
@media (max-width: 900px) and (orientation: landscape) {
    .header {
        padding: 0.5rem 1rem;
    }
    
    .header-content h1 {
        font-size: 1.2rem;
    }
    
    .chat-messages {
        padding: 1rem;
    }
    
    .modal-content {
        max-height: 90vh;
        overflow-y: auto;
    }
    
    .soundboard-modal {
        max-height: 85vh;
    }
}

/* Tablet optimizations */
@media (min-width: 769px) and (max-width: 1024px) {
    .sidebar {
        width: 350px;
    }
    
    .header {
        padding: 1rem 1.5rem;
    }
    
    .audio-grid {
        grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    }
    
    .char-stats-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

/* Touch device optimizations */
@media (hover: none) and (pointer: coarse) {
    .btn {
        min-height: 44px;
        min-width: 44px;
    }
    
    .audio-btn {
        min-height: 48px;
    }
    
    .delete-chat-btn {
        min-width: 40px;
        min-height: 40px;
    }
    
    .remove-item-btn {
        min-width: 40px;
        min-height: 40px;
    }
    
    input[type="range"] {
        min-height: 32px;
    }
}

/* Toast Notification */
.toast-notification {
    position: fixed;
    top: 20px;
    right: 20px;
    background: var(--surface);
    color: var(--text-primary);
    padding: 1rem 1.5rem;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    border-left: 4px solid var(--primary-color);
    z-index: 2000;
    transform: translateX(400px);
    opacity: 0;
    transition: all 0.3s ease;
    max-width: 300px;
}

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

.toast-notification.error {
    border-left-color: #ef4444;
}

.toast-notification.success {
    border-left-color: #10b981;
}

.toast-notification.info {
    border-left-color: #3b82f6;
}

/* MOTD notification styles */
.motd-notification {
    position: fixed;
    top: 20px;
    right: 20px;
    background: var(--sw-void-black);
    color: var(--text-primary);
    padding: 1rem 1.5rem;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.5);
    border: 1px solid var(--sw-jedi-green);
    z-index: 10000;
    transform: translateX(450px);
    opacity: 0;
    transition: all 0.3s ease;
    max-width: 450px;
}

.motd-notification.show {
    transform: translateX(0);
    opacity: 1;
}

/* File upload styles */
.attach-file-btn {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 6px;
    color: var(--text-primary);
    padding: 0.5rem;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: 0.5rem;
}

.attach-file-btn:hover {
    background: var(--hover-bg);
    border-color: var(--primary-color);
    transform: translateY(-1px);
}

.attach-file-btn svg {
    display: block;
}

.file-preview {
    background: var(--surface-light);
    border: 1px solid var(--border);
    border-radius: 6px;
    padding: 0.5rem 0.75rem;
    margin-right: 0.5rem;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    font-size: 0.85rem;
    max-width: 600px;
}

.file-preview .files-list {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.file-preview .file-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
    padding: 0.25rem 0;
}

.file-preview .file-item.uploaded {
    opacity: 0.8;
}

.file-preview .file-item.uploaded .file-name {
    color: var(--success);
}

.file-preview .file-name {
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 400px;
}

.file-preview .remove-file-btn {
    background: transparent;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    padding: 0 0.25rem;
    font-size: 1rem;
    transition: color 0.2s ease;
    flex-shrink: 0;
}

.file-preview .remove-file-btn:hover {
    color: #ef4444;
}

.file-preview .clear-all-btn {
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    color: var(--text-secondary);
    cursor: pointer;
    padding: 0.25rem 0.5rem;
    font-size: 0.8rem;
    border-radius: 4px;
    transition: all 0.2s ease;
    margin-top: 0.25rem;
}

.file-preview .clear-all-btn:hover {
    background: var(--surface);
    color: #ef4444;
    border-color: #ef4444;
}

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

.player-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem;
    background: var(--surface-light);
    border-radius: 6px;
    border: 1px solid var(--border);
    transition: all 0.2s ease;
}

.player-item.current-user {
    background: rgba(99, 102, 241, 0.1);
    border-color: var(--primary-color);
}

.player-status {
    font-size: 0.6rem;
}

.player-name {
    flex: 1;
    font-weight: 500;
    color: var(--text-primary);
}

.you-badge {
    font-size: 0.7rem;
    padding: 0.15rem 0.4rem;
    background: var(--primary-color);
    color: white;
    border-radius: 4px;
    font-weight: 600;
}

.text-secondary {
    color: var(--text-secondary);
    font-size: 0.85rem;
}

/* Player Chat */
.player-chat-section {
    display: flex;
    flex-direction: column;
    max-height: 300px;
}

.player-chat-section h3 {
    transition: opacity 0.2s ease;
}

.player-chat-section h3:hover {
    opacity: 0.8;
}

#playerChatToggleIcon {
    font-size: 0.8em;
    color: var(--primary-color);
    transition: transform 0.2s ease;
}

.player-chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 0.5rem;
    background: var(--bg-secondary);
    border-radius: 6px;
    margin-bottom: 0.5rem;
    min-height: 150px;
    max-height: 200px;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.player-chat-message {
    padding: 0.5rem;
    background: var(--surface-light);
    border-radius: 6px;
    border-left: 2px solid var(--border);
    font-size: 0.85rem;
    animation: slideIn 0.2s ease-out;
}

.player-chat-message.own {
    background: rgba(99, 102, 241, 0.1);
    border-left-color: var(--primary-color);
}

.player-chat-message .username {
    font-weight: 600;
    color: var(--primary-color);
    margin-bottom: 0.2rem;
    font-size: 0.8rem;
}

.player-chat-message.own .username {
    color: var(--primary-color);
}

.player-chat-message .text {
    color: var(--text-primary);
    word-wrap: break-word;
}

.player-chat-input {
    display: flex;
    gap: 0.5rem;
    align-items: flex-end;
}

.player-chat-input textarea {
    flex: 1;
    padding: 0.5rem;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 6px;
    color: var(--text-primary);
    font-size: 0.85rem;
    font-family: inherit;
    resize: vertical;
    min-height: 2.5rem;
    line-height: 1.4;
}

.player-chat-input textarea:focus {
    outline: none;
    border-color: var(--primary-color);
}

.btn-send-small {
    padding: 0.5rem 0.75rem;
    background: var(--primary-color);
    color: white;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 1rem;
    transition: all 0.2s ease;
}

.btn-send-small:hover {
    background: var(--primary-hover);
    transform: translateY(-1px);
}

.btn-send-small:active {
    transform: translateY(0);
}

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

/* Soundboard Modal Styles */
.soundboard-modal {
    max-width: 800px;
    max-height: 90vh;
    margin: 2% auto;
    display: flex;
    flex-direction: column;
}

/* Change Password Modal Styles */
#changePasswordModal .modal-content {
    margin: 5% auto;
}

.audio-section {
    margin-bottom: 2rem;
    padding-bottom: 2rem;
    border-bottom: 1px solid var(--border);
}

.audio-section:last-child {
    border-bottom: none;
}

.audio-section h3 {
    font-size: 1.2rem;
    margin-bottom: 1rem;
    color: var(--primary-color);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.creator-badge {
    font-size: 0.75rem;
    background: rgba(139, 92, 246, 0.2);
    color: var(--secondary-color);
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    font-weight: normal;
}

.audio-list {
    background: var(--background);
    padding: 1rem;
    border-radius: 8px;
    margin-bottom: 1rem;
    min-height: 100px;
    max-height: 300px;
    overflow-y: auto;
}

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

.audio-item {
    margin-bottom: 0.5rem;
}

.audio-btn {
    width: 100%;
    padding: 0.75rem 1rem;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 6px;
    color: var(--text-primary);
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.2s ease;
    text-align: left;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.audio-btn:hover:not(:disabled) {
    background: var(--surface-light);
    border-color: var(--primary-color);
    transform: translateY(-2px);
}

.audio-btn:active:not(:disabled) {
    transform: translateY(0);
}

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

.bgm-controls,
.sfx-controls {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.bgm-player-controls {
    display: flex;
    gap: 1rem;
    align-items: center;
    flex-wrap: wrap;
}

.volume-control {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    background: var(--surface);
    padding: 0.5rem 1rem;
    border-radius: 6px;
}

.volume-control label {
    color: var(--text-secondary);
    font-size: 0.9rem;
}

.volume-control input[type="range"] {
    width: 150px;
    height: 6px;
    background: var(--background);
    border-radius: 3px;
    outline: none;
}

.volume-control input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 16px;
    height: 16px;
    background: var(--primary-color);
    border-radius: 50%;
    cursor: pointer;
}

.volume-control input[type="range"]::-moz-range-thumb {
    width: 16px;
    height: 16px;
    background: var(--primary-color);
    border-radius: 50%;
    cursor: pointer;
    border: none;
}

.volume-control span {
    color: var(--text-primary);
    font-size: 0.85rem;
    min-width: 40px;
}

.current-playing {
    background: var(--background);
    padding: 1rem;
    border-radius: 6px;
    color: var(--text-secondary);
    font-style: italic;
    text-align: center;
}

.current-playing:not(:empty) {
    color: var(--text-primary);
}

.text-secondary {
    color: var(--text-secondary);
}

/* Character Info Modal Styles */
.character-info-modal {
    max-width: 700px;
    max-height: 85vh;
    overflow-y: auto;
    margin: 5% auto;
}

.character-selector {
    margin-bottom: 1.5rem;
    padding: 1rem;
    background: var(--background);
    border-radius: 8px;
    border: 1px solid var(--border);
}

.character-selector label {
    display: block;
    margin-bottom: 0.5rem;
    color: var(--text-secondary);
    font-weight: 500;
}

.character-select {
    width: 100%;
    padding: 0.75rem;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 6px;
    color: var(--text-primary);
    font-size: 1rem;
    cursor: pointer;
}

.character-select:focus {
    outline: none;
    border-color: var(--primary-color);
}

.character-display-name {
    font-size: 1.5rem;
    color: var(--primary-color);
    margin-bottom: 1rem;
    text-align: center;
}

.character-info-content {
    margin-top: 1rem;
}

.char-section {
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--border);
}

.char-section:last-child {
    border-bottom: none;
}

.char-section h3 {
    font-size: 1.1rem;
    color: var(--primary-color);
    margin-bottom: 0.75rem;
}

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

.char-stat {
    background: var(--background);
    padding: 0.75rem;
    border-radius: 6px;
    text-align: center;
    border: 1px solid var(--border);
}

.char-stat-name {
    font-size: 0.85rem;
    color: var(--text-secondary);
    margin-bottom: 0.25rem;
}

.char-stat-value {
    font-size: 1.5rem;
    font-weight: bold;
    color: var(--primary-color);
}

.char-list {
    background: var(--background);
    padding: 0.75rem;
    border-radius: 6px;
    max-height: 200px;
    overflow-y: auto;
}

.char-list-item {
    padding: 0.5rem;
    margin: 0.25rem 0;
    background: var(--surface);
    border-radius: 4px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.char-list-item:hover {
    background: var(--surface-light);
}

.inventory-controls {
    margin-top: 0.75rem;
    display: flex;
    gap: 0.5rem;
}

.inventory-controls input {
    flex: 1;
    padding: 0.5rem;
    background: var(--background);
    border: 1px solid var(--border);
    border-radius: 6px;
    color: var(--text-primary);
}

.btn-sm {
    padding: 0.5rem 1rem;
    font-size: 0.875rem;
}

.remove-item-btn {
    background: none;
    border: none;
    color: #ef4444;
    cursor: pointer;
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    transition: background 0.2s;
}

.remove-item-btn:hover {
    background: rgba(239, 68, 68, 0.1);
}

/* Plot Points Modal */
.plot-points-list {
    max-height: 500px;
    overflow-y: auto;
}

.plot-point-item {
    background: var(--surface);
    padding: 1rem;
    margin: 0.75rem 0;
    border-radius: 8px;
    border-left: 3px solid var(--primary-color);
}

.plot-point-item:hover {
    background: var(--surface-light);
}

/* Memory Section Styles */
.memory-section {
    margin-bottom: 1rem;
}

.memory-section h4 {
    font-size: 0.9rem;
    color: var(--text-secondary);
    margin-bottom: 0.5rem;
}

.memory-value {
    background: var(--background);
    padding: 0.5rem;
    border-radius: 6px;
    font-size: 0.9rem;
    color: var(--text-primary);
}

.memory-list {
    background: var(--background);
    padding: 0.5rem;
    border-radius: 6px;
    font-size: 0.85rem;
}

.player-character-item {
    padding: 0.5rem;
    margin: 0.25rem 0;
    background: var(--surface);
    border-radius: 4px;
    cursor: pointer;
    transition: background 0.2s;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.player-character-item:hover {
    background: var(--surface-light);
}

.player-character-name {
    font-weight: 600;
    color: var(--primary-color);
}

.player-character-class {
    font-size: 0.8rem;
    color: var(--text-secondary);
}

/* Lightsaber Dividers */
.lightsaber-divider {
    height: 2px;
    margin: 2rem 0;
    border-radius: 2px;
}

.lightsaber-blue {
    background:  linear-gradient(90deg, transparent, var(--sw-jedi-blue), transparent);
    box-shadow: 0 0 10px var(--sw-jedi-blue);
}

.lightsaber-red {
    background: linear-gradient(90deg, transparent, var(--sw-sith-red), transparent);
    box-shadow: 0 0 10px var(--sw-sith-red);
}

.lightsaber-green {
    background: linear-gradient(90deg, transparent, var(--sw-jedi-green), transparent);
    box-shadow: 0 0 10px var(--sw-jedi-green);
}

.glow-blue {
    background-color: var(--sw-hyperspace-blue);
    box-shadow: 0 0 15px var(--sw-jedi-blue), 0 0 60px var(--sw-jedi-blue);
}

.glow-red {
    background-color: var(--sw-sith-shadow);
    box-shadow: 0 0 15px var(--sw-sith-red), 0 0 60px var(--sw-sith-red);
}

.glow-green {
    background-color: rgba(0, 255, 136, 0.1);
    box-shadow: 0 0 15px var(--sw-jedi-green), 0 0 60px var(--sw-jedi-green);
}

.glow-purple {
    background-color: rgba(157, 95, 255, 0.1);
    box-shadow: 0 0 15px var(--sw-mace-purple), 0 0 60px var(--sw-mace-purple);
}

/* About Modal Styles */
#aboutModal .modal-content {
    max-width: 700px;
}

.about-content {
    color: var(--sw-text-primary);
}

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

.about-section h3 {
    color: var(--sw-jedi-cyan);
    margin-bottom: 0.75rem;
    font-size: 1.25rem;
    border-bottom: 2px solid var(--sw-carbon-freeze);
    padding-bottom: 0.5rem;
}

.about-section p {
    color: var(--sw-text-secondary);
    line-height: 1.6;
    margin-bottom: 0.5rem;
}

.about-section ul {
    list-style: none;
    padding-left: 0;
    margin-top: 0.5rem;
}

.about-section li {
    color: var(--sw-text-secondary);
    line-height: 1.8;
    padding-left: 1.5rem;
    position: relative;
}

.about-section li:before {
    content: "▸";
    color: var(--sw-jedi-cyan);
    position: absolute;
    left: 0;
    font-weight: bold;
}

.about-section strong {
    color: var(--sw-jedi-cyan);
}

/* Manage Characters Modal Styles */
.manage-characters-modal {
    max-width: 800px;
    max-height: 80vh;
    overflow-y: auto;
}

.character-management-content {
    color: var(--sw-text-primary);
}

.character-list-section {
    margin-bottom: 2rem;
}

.character-list-section h3 {
    color: var(--sw-jedi-cyan);
    margin-bottom: 1rem;
    font-size: 1.25rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.character-count {
    font-size: 0.875rem;
    color: var(--sw-text-secondary);
    font-weight: normal;
}

.characters-list {
    background: var(--sw-dark-matter);
    border: 1px solid var(--sw-carbon-freeze);
    border-radius: 8px;
    padding: 1rem;
    min-height: 200px;
    max-height: 400px;
    overflow-y: auto;
}

.character-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem;
    margin-bottom: 0.75rem;
    background: var(--sw-space-black);
    border: 1px solid var(--sw-carbon-freeze);
    border-radius: 6px;
    transition: all 0.2s;
}

.character-item:hover {
    border-color: var(--sw-jedi-cyan);
    transform: translateX(4px);
}

.character-item:last-child {
    margin-bottom: 0;
}

.character-item-info {
    flex: 1;
    display: flex;
    align-items: center;
    gap: 1rem;
}

.character-item-icon {
    font-size: 2rem;
    color: var(--sw-jedi-cyan);
}

.character-item-details {
    flex: 1;
}

.character-item-name {
    font-weight: 600;
    color: var(--sw-text-primary);
    font-size: 1.1rem;
    margin-bottom: 0.25rem;
}

.character-item-filename {
    font-size: 0.8rem;
    color: var(--sw-text-secondary);
    font-family: monospace;
}

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

.character-item-actions button {
    padding: 0.5rem 1rem;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.875rem;
    transition: all 0.2s;
}

.btn-view {
    background: var(--sw-hyperspace-blue);
    color: white;
}

.btn-view:hover {
    background: var(--sw-jedi-blue);
}

.btn-delete {
    background: var(--sw-sith-red);
    color: white;
}

.btn-delete:hover {
    background: #ff0000;
}

.character-actions {
    display: flex;
    gap: 1rem;
    padding-top: 1rem;
    border-top: 1px solid var(--sw-carbon-freeze);
}

.character-actions button {
    flex: 1;
}

.empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 3rem 1rem;
    text-align: center;
    color: var(--sw-text-secondary);
}

.empty-state p {
    margin: 0;
    font-size: 0.95rem;
}

/* Character Selection Modal (for joining sessions) */
.session-characters-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    max-height: 400px;
    overflow-y: auto;
}

.session-character-option {
    display: flex;
    align-items: center;
    padding: 1rem;
    background: var(--sw-dark-matter);
    border: 2px solid var(--sw-carbon-freeze);
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s;
}

.session-character-option:hover {
    border-color: var(--sw-jedi-cyan);
    transform: translateX(4px);
    background: var(--sw-space-black);
}

.session-character-option.selected {
    border-color: var(--sw-jedi-cyan);
    background: var(--sw-hyperspace-blue);
}

/* MOTD Modal - Match login page styling */
#motdModal .modal-content {
    max-width: 500px;
    background: var(--sw-void-black);
    border: 1px solid var(--sw-jedi-green);
    border-radius: 15px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
    max-height: 80vh;
    display: flex;
    flex-direction: column;
    padding: 0;
}

#motdModal .modal-content h2 {
    color: var(--sw-jedi-green);
    margin: 0;
    font-size: 1.5rem;
    border-bottom: 1px solid var(--sw-carbon-freeze);
    padding: 1.5rem 2rem 0.75rem 2rem;
    flex-shrink: 0;
}

#motdModal .modal-content .close {
    position: absolute;
    right: 1.5rem;
    top: 1.5rem;
    font-size: 1.8rem;
    color: var(--sw-text-secondary);
    cursor: pointer;
    background: none;
    border: none;
    padding: 0;
    line-height: 1;
    z-index: 1;
}

#motdModal .modal-content .close:hover {
    color: var(--sw-sith-crimson);
}

#motdModalContent {
    color: var(--sw-text-secondary);
    font-size: 0.9rem;
    line-height: 1.6;
    padding: 0 2rem 2rem 2rem;
    overflow-y: auto;
    flex: 1;
}

#motdModalContent h1 {
    color: var(--sw-jedi-cyan);
    font-size: 1.3rem;
    margin-top: 0;
    margin-bottom: 0.75rem;
}

#motdModalContent h2 {
    color: var(--sw-jedi-cyan);
    font-size: 1.1rem;
    margin-top: 1.5rem;
    margin-bottom: 0.5rem;
}

#motdModalContent h3 {
    color: var(--sw-jedi-cyan);
    font-size: 1rem;
    margin-top: 1rem;
    margin-bottom: 0.5rem;
}

#motdModalContent p {
    margin-bottom: 0.75rem;
}

#motdModalContent ul, #motdModalContent ol {
    margin: 0.5rem 0;
    padding-left: 1.5rem;
}

#motdModalContent li {
    margin-bottom: 0.5rem;
}

#motdModalContent strong {
    color: var(--sw-empire-white);
}

#motdModalContent code {
    background: var(--sw-space-black);
    padding: 0.2rem 0.4rem;
    border-radius: 4px;
    font-family: 'Courier New', monospace;
    font-size: 0.85rem;
}

#motdModalContent pre {
    background: var(--sw-space-black);
    padding: 1rem;
    border-radius: 8px;
    overflow-x: auto;
    margin: 0.75rem 0;
}

#motdModalContent blockquote {
    border-left: 3px solid var(--sw-jedi-cyan);
    padding-left: 1rem;
    margin: 0.75rem 0;
    color: var(--sw-text-muted);
    font-style: italic;
}

#motdModalContent a {
    color: var(--sw-jedi-cyan);
    text-decoration: none;
}

#motdModalContent a:hover {
    text-decoration: underline;
}

.session-character-icon {
    font-size: 2rem;
    color: var(--sw-jedi-cyan);
    margin-right: 1rem;
}

.session-character-info {
    flex: 1;
}

.session-character-name {
    font-weight: 600;
    color: var(--sw-text-primary);
    font-size: 1.1rem;
    margin-bottom: 0.25rem;
}

.session-character-filename {
    font-size: 0.8rem;
    color: var(--sw-text-secondary);
    font-family: monospace;
}