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

body {
    font-family: 'Courier New', monospace;
    background: #1a1a1a;
    color: #00ff00;
    min-height: 100vh;
    overflow: hidden;
}

.screen {
    width: 100%;
    height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
}

.hidden {
    display: none;
}

/* Login/Register Screen */
#loginScreen {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

#loginScreen .container {
    background: white;
    border-radius: 16px;
    padding: 40px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    text-align: center;
    min-width: 400px;
}

#loginScreen h1 {
    color: #667eea;
    margin-bottom: 30px;
    font-size: 2.5em;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

.auth-tabs {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
    justify-content: center;
}

.auth-tab {
    background: #f0f0f0;
    border: none;
    padding: 10px 20px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 1em;
    transition: background 0.2s;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

.auth-tab.active {
    background: #667eea;
    color: white;
}

.auth-tab:hover {
    background: #ddd;
}

.auth-tab.active:hover {
    background: #5568d3;
}

.auth-form {
    display: none;
    flex-direction: column;
    gap: 15px;
}

.auth-form.active {
    display: flex;
}

.auth-form input {
    padding: 12px;
    border: 2px solid #ddd;
    border-radius: 8px;
    font-size: 1em;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    transition: border-color 0.2s;
}

.auth-form input:focus {
    outline: none;
    border-color: #667eea;
}

.auth-btn {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    padding: 12px 24px;
    font-size: 1.1em;
    border-radius: 8px;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
    font-weight: bold;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

.auth-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(102, 126, 234, 0.4);
}

.error-message {
    color: #d32f2f;
    font-size: 0.9em;
    margin-top: 5px;
    min-height: 20px;
}

.account-info {
    margin-bottom: 20px;
    padding: 15px;
    background: #f5f5f5;
    border-radius: 8px;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

.account-info p {
    margin: 5px 0;
    color: #333;
}

.account-info .warning {
    color: #ff9800;
    font-weight: bold;
}

.logout-btn {
    margin-top: 20px;
    background: #f44336;
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 1em;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    transition: background 0.2s;
}

.logout-btn:hover {
    background: #d32f2f;
}

.god-badge {
    background: #ff9800;
    color: white;
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 0.7em;
    margin-left: 5px;
}

.noob-badge {
    background: #2196f3;
    color: white;
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 0.7em;
    margin-left: 5px;
}

/* Character Selection Screen */
#characterSelection {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.create-character-form {
    text-align: left;
    padding: 20px;
    background: #f9f9f9;
    border-radius: 8px;
    margin-top: 20px;
}

.create-character-form h2 {
    color: #667eea;
    margin-bottom: 10px;
    font-size: 1.5em;
}

#characterSelection .container {
    background: white;
    border-radius: 16px;
    padding: 40px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    text-align: center;
    min-width: 500px;
}

#characterSelection h1 {
    color: #667eea;
    margin-bottom: 30px;
    font-size: 2.5em;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

/* Player Selection Screen (legacy - keeping for compatibility) */
#playerSelection {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

#playerSelection .container {
    background: white;
    border-radius: 16px;
    padding: 40px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    text-align: center;
}

#playerSelection h1 {
    color: #667eea;
    margin-bottom: 40px;
    font-size: 2.5em;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

.player-options {
    display: flex;
    gap: 20px;
    justify-content: center;
    flex-wrap: wrap;
}

.player-btn {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    padding: 20px 40px;
    font-size: 1.5em;
    border-radius: 12px;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
    font-weight: bold;
    min-width: 200px;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

.player-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 25px rgba(102, 126, 234, 0.4);
}

/* Game View Layout */
.game-layout {
    display: flex;
    width: 100%;
    height: 100vh;
}

/* Terminal Container (Left 2/3) */
.terminal-container {
    width: 66.666%;
    height: 100vh;
    background: #000;
    border-right: 2px solid #00ff00;
    display: flex;
    flex-direction: column;
}

.terminal {
    flex: 1;
    display: flex;
    flex-direction: column;
    padding: 20px;
    overflow: hidden;
    position: relative;
}

.terminal-content {
    flex: 1;
    overflow-y: auto;
    font-size: 14px;
    line-height: 1.6;
    color: #00ff00;
    font-family: 'Courier New', monospace;
    padding-bottom: 10px;
}

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

.terminal-content::-webkit-scrollbar-track {
    background: #000;
}

.terminal-content::-webkit-scrollbar-thumb {
    background: #00ff00;
    border-radius: 4px;
}

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

.terminal-separator {
    color: #333;
    margin: 10px 0;
    font-family: 'Courier New', monospace;
}

.room-name {
    color: #ffff00;
    font-weight: bold;
    font-size: 16px;
    margin-bottom: 10px;
    text-transform: uppercase;
}

.room-description {
    color: #00ff00;
    margin-bottom: 15px;
    white-space: pre-wrap;
}

.players-section {
    margin-top: 15px;
    color: #00ffff;
}

.players-line {
    display: inline;
}

.players-section-title {
    color: #ffff00;
    font-weight: bold;
}

.player-item {
    color: #00ffff;
}

/* Player movement messages (entry/departure) */
.player-movement-message {
    color: #888888;
    margin: 5px 0;
    font-style: italic;
}

.player-movement-message .player-name-highlight {
    color: #00ffff;
    font-style: normal;
    font-weight: bold;
}

/* Resonated message styling (world broadcast) */
.resonated-message {
    color: #ff00ff;
    margin: 8px 0;
    font-weight: bold;
    font-size: 15px;
    text-shadow: 0 0 5px rgba(255, 0, 255, 0.5);
}

.resonated-message .resonated-player {
    color: #ffff00;
    font-weight: bold;
    text-transform: uppercase;
}

.resonated-message .resonated-text {
    color: #ff00ff;
    font-style: italic;
}

/* System message styling (world-wide announcements) */
.system-message {
    color: #ff8800;
    margin: 8px 0;
    font-weight: bold;
    font-size: 14px;
    text-shadow: 0 0 3px rgba(255, 136, 0, 0.5);
    font-style: italic;
}

/* Talked message styling (room chat) */
.talked-message {
    color: #00ff00;
    margin: 5px 0;
}

.talked-message .talked-player {
    color: #ffff00;
    font-weight: bold;
}

.talked-message .talked-text {
    color: #00ff00;
}

/* Telepath message styling (private messages) */
.telepath-message {
    color: #ff00ff;
    margin: 5px 0;
    font-style: italic;
}

.telepath-message .telepath-label {
    color: #ff00ff;
    font-weight: bold;
}

.telepath-message .telepath-player {
    color: #ffff00;
    font-weight: bold;
    font-style: normal;
}

.telepath-message .telepath-text {
    color: #ff00ff;
    font-style: italic;
}

/* Lore Keeper message styling (narrative NPC speech) */
.lorekeeper-message {
    margin: 8px 0;
    padding: 8px 12px;
    background: rgba(0, 50, 50, 0.4);
    border-left: 3px solid #00ffff;
    font-size: 14px;
    line-height: 1.5;
    position: relative;
    min-width: 200px;
    min-height: 50px;
    overflow: auto; /* Allow scrolling if content exceeds box size */
    resize: none; /* Disable default browser resize */
    display: inline-block; /* Allow width/height to be set */
    max-width: 100%; /* Don't exceed container width */
}

/* Resize handle for Lore Keeper messages */
.lorekeeper-resize-handle {
    position: absolute;
    bottom: 0;
    right: 0;
    width: 20px;
    height: 20px;
    background: rgba(0, 255, 255, 0.3);
    border-top: 1px solid #00ffff;
    border-left: 1px solid #00ffff;
    cursor: nwse-resize;
    z-index: 100;
    user-select: none;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    pointer-events: auto;
    touch-action: none;
}

.lorekeeper-message.resizing {
    user-select: none;
    -webkit-user-select: none;
}

.lorekeeper-resize-handle:hover {
    background: rgba(0, 255, 255, 0.5);
}

.lorekeeper-resize-handle::after {
    content: '';
    position: absolute;
    bottom: 2px;
    right: 2px;
    width: 0;
    height: 0;
    border-style: solid;
    border-width: 0 0 8px 8px;
    border-color: transparent transparent #00ffff transparent;
}

.lorekeeper-message .lorekeeper-name {
    font-weight: bold;
    text-transform: uppercase;
    letter-spacing: 1px;
}

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

.lorekeeper-message.lorekeeper-success {
    background: rgba(0, 100, 0, 0.4);
    border-left-color: #00ff00;
}

.lorekeeper-message.lorekeeper-success .lorekeeper-text {
    color: #00ff00;
    text-shadow: 0 0 5px rgba(0, 255, 0, 0.5);
}

.lorekeeper-message.lorekeeper-success .lorekeeper-resize-handle {
    background: rgba(0, 255, 0, 0.3);
    border-top-color: #00ff00;
    border-left-color: #00ff00;
}

.lorekeeper-message.lorekeeper-success .lorekeeper-resize-handle:hover {
    background: rgba(0, 255, 0, 0.5);
}

.lorekeeper-message.lorekeeper-success .lorekeeper-resize-handle::after {
    border-color: transparent transparent #00ff00 transparent;
}

.lorekeeper-message.lorekeeper-failure {
    background: rgba(100, 0, 0, 0.3);
    border-left-color: #ff6666;
}

.lorekeeper-message.lorekeeper-failure .lorekeeper-text {
    color: #ff6666;
}

.lorekeeper-message.lorekeeper-failure .lorekeeper-resize-handle {
    background: rgba(255, 102, 102, 0.3);
    border-top-color: #ff6666;
    border-left-color: #ff6666;
}

.lorekeeper-message.lorekeeper-failure .lorekeeper-resize-handle:hover {
    background: rgba(255, 102, 102, 0.5);
}

.lorekeeper-message.lorekeeper-failure .lorekeeper-resize-handle::after {
    border-color: transparent transparent #ff6666 transparent;
}

/* Lore Keeper glowing text for <keywords> (purple color) */
.lorekeeper-glow {
    font-weight: bold;
    text-shadow: 
        0 0 5px currentColor,
        0 0 10px currentColor,
        0 0 15px currentColor,
        0 0 20px currentColor;
    animation: lorekeeper-pulse 2s ease-in-out infinite;
}

/* Lore Keeper glowing text for [text] (preserves original color) */
.lorekeeper-glow-preserve {
    font-weight: bold;
    text-shadow: 
        0 0 5px currentColor,
        0 0 10px currentColor,
        0 0 15px currentColor,
        0 0 20px currentColor;
    animation: lorekeeper-pulse 2s ease-in-out infinite;
    /* Color is inherited from parent, not overridden */
}

@keyframes lorekeeper-pulse {
    0%, 100% {
        text-shadow: 
            0 0 5px currentColor,
            0 0 10px currentColor,
            0 0 15px currentColor;
        opacity: 1;
    }
    50% {
        text-shadow: 
            0 0 10px currentColor,
            0 0 20px currentColor,
            0 0 30px currentColor,
            0 0 40px currentColor;
        opacity: 0.9;
    }
}

/* Communication Widget Styles */
#widget-comms {
    background: #0a0a0a;
    border: 2px solid #00ff00;
    color: #00ff00;
    font-family: 'Courier New', monospace;
    display: flex;
    flex-direction: column;
    height: 100%;
}

#widget-comms .widget-content {
    display: flex;
    flex-direction: column;
    flex: 1;
    min-height: 0;
}

#widget-comms .widget-header {
    background: #1a1a1a;
    border-bottom: 2px solid #00ff00;
    color: #ffff00;
    font-weight: bold;
    padding: 8px;
    text-align: center;
    text-transform: uppercase;
}

.comm-mode-selector {
    display: flex;
    gap: 4px;
    padding: 8px;
    border-bottom: 1px solid #333;
}

.comm-mode-btn {
    flex: 1;
    background: #0a0a0a;
    border: 1px solid #00ff00;
    color: #00ff00;
    font-family: 'Courier New', monospace;
    font-size: 11px;
    padding: 6px 8px;
    cursor: pointer;
    text-transform: uppercase;
    transition: all 0.2s;
}

.comm-mode-btn:hover {
    background: #1a1a1a;
    border-color: #ffff00;
}

.comm-mode-btn.active {
    background: #00ff00;
    color: #000;
    font-weight: bold;
    border-color: #00ff00;
}

.comm-chat-scroll {
    flex: 1;
    overflow-y: auto;
    padding: 8px;
    min-height: 150px;
    max-height: 300px;
}

.comm-chat-scroll::-webkit-scrollbar {
    width: 6px;
}

.comm-chat-scroll::-webkit-scrollbar-track {
    background: #000;
}

.comm-chat-scroll::-webkit-scrollbar-thumb {
    background: #00ff00;
    border-radius: 3px;
}

.comm-chat-content {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.comm-empty {
    color: #666;
    font-style: italic;
    text-align: center;
    padding: 20px;
}

.comm-message {
    font-size: 11px;
    line-height: 1.4;
    word-wrap: break-word;
}

.comm-message-talk {
    color: #00ff00;
}

.comm-message-resonate {
    color: #ff00ff;
}

.comm-message-telepath {
    color: #ff00ff;
    font-style: italic;
}

.comm-message .comm-player {
    color: #ffff00;
    font-weight: bold;
}

.comm-message .comm-text {
    color: inherit;
}

/* Lore Keeper styling in comms widget */
.comm-message.comm-lorekeeper {
    padding: 4px 6px;
    margin: 4px 0;
    background: rgba(0, 50, 50, 0.4);
    border-left: 2px solid #00ffff;
    border-radius: 2px;
}

.comm-message.comm-lorekeeper-success {
    background: rgba(0, 100, 0, 0.4);
    border-left-color: #00ff00;
}

.comm-message.comm-lorekeeper-failure {
    background: rgba(100, 0, 0, 0.3);
    border-left-color: #ff6666;
}

/* Glow effect works in widget too via .lorekeeper-glow class */

.comm-input-container {
    display: flex;
    gap: 4px;
    padding: 8px;
    border-top: 1px solid #333;
    margin-top: auto;
    flex-shrink: 0;
}

.comm-input {
    flex: 1;
    background: #0a0a0a;
    border: 1px solid #00ff00;
    color: #00ff00;
    font-family: 'Courier New', monospace;
    font-size: 11px;
    padding: 6px 8px;
    outline: none;
}

.comm-input:focus {
    border-color: #ffff00;
}

.comm-send-btn {
    background: #0a0a0a;
    border: 1px solid #00ff00;
    color: #00ff00;
    font-family: 'Courier New', monospace;
    font-size: 11px;
    padding: 6px 12px;
    cursor: pointer;
    text-transform: uppercase;
    font-weight: bold;
    transition: all 0.2s;
}

.comm-send-btn:hover {
    background: #00ff00;
    color: #000;
}

/* NPC Section Styling */
.npcs-section {
    margin-top: 15px;
    color: #00ffff;
}

.npcs-line {
    display: inline;
}

.npcs-section-title {
    color: #ffff00;
    font-weight: bold;
    margin-bottom: 8px;
}

.npc-container {
    margin-bottom: 10px;
}

.npc-item {
    color: #00ffff;
    display: block;
    margin-bottom: 4px;
}

/* Room items (on the ground) styles */
.items-section {
    margin-top: 15px;
    color: #ffcc00;
}

.items-line {
    display: inline;
}

.items-section-title {
    color: #ffff00;
    font-weight: bold;
}

.item-item {
    color: #ffcc00;
}

/* Exits section */
.exits-section {
    margin-top: 10px;
    color: #888;
}

.exits-section-title {
    color: #666;
    font-weight: bold;
}

/* Inventory table styles */
.inventory-display {
    margin: 15px 0;
}

.inventory-title {
    color: #00ffff;
    font-weight: bold;
    font-size: 14px;
    margin-bottom: 8px;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.inventory-table {
    border-collapse: collapse;
    width: auto;
    min-width: 200px;
    font-family: 'Courier New', monospace;
    font-size: 13px;
}

.inventory-table th,
.inventory-table td {
    padding: 6px 16px;
    text-align: left;
    border: 1px solid #006600;
}

.inventory-table th {
    background: #003300;
    color: #00ff00;
    font-weight: bold;
    text-transform: uppercase;
    font-size: 11px;
    letter-spacing: 1px;
}

.inventory-table td {
    background: #001a00;
    color: #00ff00;
}

.inventory-table td:last-child {
    text-align: center;
    color: #ffff00;
}

.inventory-table tbody tr:hover {
    background: #002200;
}

.inventory-table tbody tr:hover td {
    background: #002200;
}

/* Help command styles */
.help-section {
    margin-top: 15px;
    margin-bottom: 10px;
}

.help-title {
    color: #ffff00;
    font-weight: bold;
    margin-bottom: 10px;
}

.help-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 10px;
    font-size: 13px;
}

.help-table-header {
    color: #ffff00;
    font-weight: bold;
    text-align: left;
    padding: 8px 12px;
    border-bottom: 2px solid #00ff00;
    background: rgba(0, 255, 0, 0.1);
}

/* Who command table styling */
.who-list {
    margin: 10px 0;
}

.who-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 10px;
    font-size: 13px;
    font-family: 'Courier New', monospace;
}

.who-table thead {
    background: rgba(0, 255, 0, 0.15);
}

.who-table th {
    color: #ffff00;
    font-weight: bold;
    text-align: left;
    padding: 8px 12px;
    border-bottom: 2px solid #00ff00;
    border-right: 1px solid rgba(0, 255, 0, 0.3);
}

.who-table th:last-child {
    border-right: none;
}

.who-table td {
    color: #00ff00;
    padding: 6px 12px;
    border-bottom: 1px solid rgba(0, 255, 0, 0.2);
    border-right: 1px solid rgba(0, 255, 0, 0.1);
}

.who-table td:last-child {
    border-right: none;
}

.who-table tbody tr:hover {
    background: rgba(0, 255, 0, 0.05);
}

.who-table tbody tr:last-child td {
    border-bottom: none;
}

.help-category {
    color: #00ffff;
    font-weight: bold;
    padding: 8px 12px;
    background: rgba(0, 255, 255, 0.1);
    border-top: 1px solid #00ffff;
    border-bottom: 1px solid #00ffff;
}

.help-command-row {
    border-bottom: 1px solid rgba(0, 255, 0, 0.2);
}

.help-command-row:hover {
    background: rgba(0, 255, 0, 0.05);
}

.help-cmd-name-cell {
    padding: 6px 12px;
    color: #00ff00;
    width: 30%;
    vertical-align: top;
}

.help-cmd-desc-cell {
    padding: 6px 12px;
    color: #00ff00;
    width: 70%;
    vertical-align: top;
}

.help-cmd-name {
    color: #ffffff;
    font-weight: bold;
}

/* Item Editor Styles */
#itemEditor .map-editor-container {
    width: 98%;
    height: 98%;
}

#itemEditor .map-editor-content {
    gap: 15px;
}

.item-editor-list-container {
    flex: 0 0 300px;
    background: #111;
    border: 1px solid #00ff00;
    padding: 15px;
    overflow-y: auto;
    max-height: calc(100vh - 140px);
}

.item-list-title {
    color: #ffff00;
    margin: 0 0 10px 0;
    font-size: 14px;
    border-bottom: 1px solid #333;
    padding-bottom: 5px;
}

.item-list {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.item-list-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 10px;
    background: #1a1a1a;
    border: 1px solid #333;
    cursor: pointer;
    transition: all 0.2s;
}

.item-list-item:hover {
    background: #222;
    border-color: #00ff00;
}

.item-list-item.selected {
    background: #002200;
    border-color: #00ff00;
}

.item-list-name {
    color: #00ff00;
    font-weight: bold;
}

.item-list-type {
    color: #666;
    font-size: 11px;
    text-transform: uppercase;
}

.item-editor-hint {
    color: #666;
    font-style: italic;
}

.item-editor-form {
    padding: 15px;
    max-width: 100%;
}

.item-editor-form .item-form-group {
    margin-bottom: 15px;
}

.item-editor-form .item-form-group label {
    display: block;
    margin-bottom: 5px;
    color: #00ffff;
    font-size: 12px;
    font-weight: bold;
}

.item-editor-form .item-form-input,
.item-editor-form .item-form-select,
.item-editor-form .item-form-textarea {
    width: 100%;
    max-width: 800px;
    background: #0a0a0a;
    border: 1px solid #00ff00;
    color: #00ff00;
    font-family: 'Courier New', monospace;
    padding: 10px;
    font-size: 13px;
}

.item-editor-form .item-form-textarea {
    min-height: 120px;
    resize: vertical;
}

.item-editor-form .item-form-actions {
    margin-top: 30px;
    padding-top: 20px;
    border-top: 2px solid #00ff00;
}

.item-editor-form .item-form-textarea {
    min-height: 100px;
    resize: vertical;
}

.item-editor-form .item-form-actions {
    margin-top: 25px;
    padding-top: 15px;
    border-top: 2px solid #00ff00;
}

.item-form-title {
    color: #ffff00;
    margin: 0 0 15px 0;
    font-size: 16px;
    border-bottom: 1px solid #333;
    padding-bottom: 8px;
}

.item-form-group {
    margin-bottom: 15px;
}

.item-form-group.inline {
    display: inline-block;
    width: 48%;
    margin-right: 2%;
    vertical-align: top;
}

.item-form-group label {
    display: block;
    color: #00ffff;
    margin-bottom: 8px;
    font-size: 13px;
    font-weight: bold;
}

.item-form-input,
.item-form-select,
.item-form-textarea {
    width: 100%;
    max-width: 700px;
    background: #0a0a0a;
    border: 1px solid #00ff00;
    color: #00ff00;
    font-family: 'Courier New', monospace;
    padding: 8px 10px;
    font-size: 13px;
}

.item-form-textarea {
    min-height: 120px;
    resize: vertical;
}

.item-form-input.small {
    width: 100px;
    max-width: 100px;
}

.item-form-actions {
    margin-top: 30px;
    padding-top: 20px;
    border-top: 2px solid #00ff00;
}

/* Player Editor Compact Layout */
.player-editor-form {
    padding: 10px;
}

.player-editor-title {
    color: #00ff00;
    font-size: 16px;
    margin: 0 0 15px 0;
    padding-bottom: 10px;
    border-bottom: 1px solid #333;
}

.player-section-label {
    color: #ffff00;
    font-size: 11px;
    text-transform: uppercase;
    margin: 10px 0 5px 0;
    letter-spacing: 1px;
}

.player-row {
    display: flex;
    gap: 10px;
    margin-bottom: 8px;
}

.player-field {
    flex: 1;
    min-width: 0;
}

.player-field label {
    display: block;
    color: #00ffff;
    font-size: 10px;
    margin-bottom: 2px;
}

.player-field input {
    width: 100%;
    padding: 4px 6px;
    background: #0a0a0a;
    border: 1px solid #333;
    color: #00ff00;
    font-family: 'Courier New', monospace;
    font-size: 12px;
    box-sizing: border-box;
}

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

.player-field input.readonly-field {
    background: #1a1a1a;
    color: #ffcc00;
    cursor: not-allowed;
    border-color: #444;
}

.player-flags-row {
    margin-top: 15px;
    padding-top: 10px;
    border-top: 1px solid #333;
    align-items: center;
    justify-content: space-between;
}

.player-checkbox {
    display: flex;
    align-items: center;
    gap: 8px;
    color: #00ffff;
    font-size: 12px;
    cursor: pointer;
}

.player-checkbox input[type="checkbox"] {
    width: 16px;
    height: 16px;
    cursor: pointer;
}

.player-save-btn {
    padding: 8px 20px;
    background: #003300;
    border: 1px solid #00ff00;
    color: #00ff00;
    font-family: 'Courier New', monospace;
    cursor: pointer;
}

.player-save-btn:hover {
    background: #004400;
}

/* Player Editor Two-Column Layout */
.player-columns {
    display: flex;
    gap: 20px;
    flex-wrap: wrap;
}

.player-stats-column {
    flex: 1;
    min-width: 400px;
}

.player-inventory-column {
    flex: 0 0 280px;
    background: #0a0a0a;
    border: 1px solid #333;
    padding: 10px;
    border-radius: 4px;
    max-height: 400px;
    display: flex;
    flex-direction: column;
}

.encumbrance-display {
    font-size: 12px;
    margin-left: 8px;
}

.inventory-add-row {
    display: flex;
    gap: 5px;
    margin-bottom: 10px;
    align-items: center;
}

.inventory-select {
    flex: 1;
    padding: 4px;
    background: #111;
    border: 1px solid #333;
    color: #00ff00;
    font-family: 'Courier New', monospace;
    font-size: 11px;
}

.inventory-qty {
    width: 50px;
    padding: 4px;
    background: #111;
    border: 1px solid #333;
    color: #00ff00;
    font-family: 'Courier New', monospace;
    font-size: 11px;
    text-align: center;
}

.inventory-add-btn {
    padding: 4px 12px;
    font-size: 11px;
}

.inventory-list {
    flex: 1;
    overflow-y: auto;
    border: 1px solid #222;
    background: #050505;
    padding: 5px;
    min-height: 100px;
}

.inventory-empty {
    color: #666;
    font-size: 11px;
    text-align: center;
    padding: 20px;
}

.inventory-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 6px 8px;
    margin-bottom: 4px;
    background: #111;
    border: 1px solid #222;
    border-radius: 2px;
}

.inventory-item:hover {
    border-color: #00ff00;
}

.inventory-item-name {
    color: #00ff00;
    font-size: 11px;
    flex: 1;
}

.item-enc {
    color: #888;
    font-size: 10px;
}

.inventory-item-qty {
    color: #ffff00;
    font-size: 11px;
    margin-right: 10px;
}

.item-enc-total {
    color: #ff6600;
    font-size: 10px;
}

.inventory-remove-btn {
    background: #440000;
    border: 1px solid #880000;
    color: #ff6666;
    width: 20px;
    height: 20px;
    cursor: pointer;
    font-size: 14px;
    line-height: 1;
    padding: 0;
}

.inventory-remove-btn:hover {
    background: #660000;
    border-color: #ff0000;
}

.item-form-input,
.item-form-select,
.item-form-textarea {
    width: 100%;
    background: #1a1a1a;
    border: 1px solid #333;
    color: #00ff00;
    padding: 8px;
    font-family: 'Courier New', monospace;
    font-size: 12px;
    box-sizing: border-box;
}

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

.item-form-textarea {
    resize: vertical;
    min-height: 100px;
}

.item-form-actions {
    margin-top: 20px;
    text-align: center;
}

.item-save-btn {
    padding: 12px 40px;
    font-size: 14px;
    min-width: 150px;
    white-space: nowrap;
}

.npc-placement-section {
    margin-top: 12px;
    border-top: 1px solid #333;
    padding-top: 8px;
    font-size: 11px;
}

.npc-placement-section h4 {
    color: #ffff00;
    font-size: 0.8em;
    margin-bottom: 6px;
    text-transform: uppercase;
}

.npc-placement-controls {
    display: flex;
    gap: 6px;
    align-items: center;
    margin-bottom: 6px;
}

.npc-placement-controls select,
.npc-placement-controls input,
.npc-placement-controls button {
    font-family: 'Courier New', monospace;
    font-size: 11px;
}

.npc-placement-controls select,
.npc-placement-controls input {
    flex: 1;
    padding: 4px;
    background: #0a0a0a;
    border: 1px solid #00ff00;
    color: #00ff00;
}

.npc-placement-controls button {
    background: #0a0a0a;
    border: 2px solid #00ff00;
    color: #00ff00;
    padding: 4px 10px;
    cursor: pointer;
    text-transform: uppercase;
}

.npc-placement-controls button:hover {
    background: #1a3a1a;
}

.npc-placement-list {
    max-height: 220px;
    overflow-y: auto;
    border: 1px solid #00ff00;
    padding: 8px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.npc-placement-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 12px;
    border: 1px solid #333;
    background: #0a0a0a;
    gap: 12px;
}

.npc-placement-item span {
    flex: 1;
    font-size: 11px;
    color: #00ff00;
}

.npc-placement-remove {
    width: 160px;
    height: 30px;
    background: #0a0a0a;
    border: 2px solid #ff0000;
    color: #ff0000;
    font-size: 11px;
    padding: 4px 16px;
    cursor: pointer;
    font-weight: bold;
    text-transform: uppercase;
    font-family: 'Courier New', monospace;
    white-space: nowrap;
    flex-shrink: 0;
}

.npc-placement-remove:hover {
    background: #3a0a0a;
    box-shadow: 0 0 10px rgba(255, 0, 0, 0.5);
}

.error-message {
    color: #ff0000;
    margin-top: 10px;
}

.info-message {
    color: #ffff00;
    margin-top: 10px;
}

/* Room status bar - dynamic display of room items */
.room-status-bar {
    background: #0a1a0a;
    border: 1px solid #333;
    border-radius: 4px;
    padding: 8px 12px;
    margin: 8px 0;
    font-family: 'Courier New', monospace;
    font-size: 12px;
}

.room-status-label {
    color: #666;
    margin-right: 8px;
}

.room-items-display {
    color: #ffcc00;
}

.room-items-display .item-count {
    color: #ff9900;
}

.command-line {
    display: flex;
    align-items: center;
    padding: 10px 0;
    border-top: 1px solid #00ff00;
    margin-top: 10px;
}

.prompt {
    color: #00ff00;
    margin-right: 10px;
    font-weight: bold;
}

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

.command-input::placeholder {
    color: #006600;
}

/* God Mode Button Bar */
.god-mode-bar {
    display: flex;
    gap: 10px;
    padding: 10px;
    border-bottom: 1px solid #00ff00;
    background: #0a0a0a;
    justify-content: center;
}

.god-mode-bar.hidden {
    display: none;
}

.god-mode-btn {
    background: #0a0a0a;
    border: 2px solid #00ff00;
    color: #00ff00;
    font-family: 'Courier New', monospace;
    font-size: 12px;
    font-weight: bold;
    padding: 8px 16px;
    cursor: pointer;
    transition: all 0.2s;
    text-transform: uppercase;
}

.god-mode-btn:hover:not(:disabled) {
    background: #1a3a1a;
    box-shadow: 0 0 10px rgba(0, 255, 0, 0.5);
}

.god-mode-btn:disabled {
    border-color: #333;
    color: #666;
    cursor: not-allowed;
    opacity: 0.5;
}

/* Right Panel Container (Right 1/3) */
.right-panel {
    width: 33.333%;
    height: 100vh;
    background: #0a0a0a;
    display: flex;
    flex-direction: column;
    box-sizing: border-box;
    overflow: hidden;
}

/* Widget Toggle Bar */
.widget-toggle-bar {
    display: flex;
    gap: 8px;
    padding: 8px;
    background: #111;
    border-bottom: 1px solid #333;
    justify-content: center;
}

.widget-icon {
    width: 36px;
    height: 36px;
    border: 2px solid #333;
    border-radius: 6px;
    background: #0a0a0a;
    color: #444;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.widget-icon:hover {
    border-color: #666;
    color: #888;
}

.widget-icon.active {
    border-color: #00ff00;
    color: #00ff00;
    background: #0a2a0a;
    box-shadow: 0 0 8px rgba(0, 255, 0, 0.3);
}

.widget-icon svg {
    width: 20px;
    height: 20px;
}

/* Widget Grid (2x2) */
.widget-grid {
    flex: 1;
    display: grid;
    grid-template-columns: 1fr 1fr;
    grid-template-rows: 1fr 1fr;
    gap: 5px;
    padding: 5px;
    overflow: hidden;
}

.widget-slot {
    position: relative;
    overflow: hidden;
    transition: border-color 0.2s, background-color 0.2s;
}

.widget-slot.widget-drag-over {
    border: 2px dashed #ffff00;
    background: rgba(255, 255, 0, 0.1);
}

.widget {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: #1a1a1a;
    border: 2px solid #00ff00;
    border-radius: 8px;
    display: flex;
    flex-direction: column;
    box-shadow: 0 0 10px rgba(0, 255, 0, 0.3);
    overflow: hidden;
}

.widget[draggable="true"] {
    cursor: move;
    user-select: none;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.widget[draggable="true"]:hover {
    border-color: #ffff00;
    box-shadow: 0 0 10px rgba(255, 255, 0, 0.5);
}

.widget[draggable="true"]:active {
    cursor: grabbing;
}

.widget.hidden {
    display: none;
}

.widget.widget-empty {
    border-color: #333;
    box-shadow: none;
}

.widget.widget-empty .widget-header {
    color: #333;
}

.widget-header {
    color: #00ff00;
    text-align: center;
    padding: 8px;
    font-size: 0.85em;
    text-transform: uppercase;
    font-family: 'Courier New', monospace;
    pointer-events: none;
    user-select: none;
    font-weight: bold;
    border-bottom: 1px solid #333;
    flex-shrink: 0;
}

.widget-content {
    flex: 1;
    padding: 8px;
    overflow-y: auto;
    overflow-x: hidden;
}

/* Stats Widget Styles */
#widget-stats .widget-content {
    font-family: 'Courier New', monospace;
    font-size: 10px;
    color: #00ff00;
}

.stats-section {
    margin-bottom: 12px;
}

.stats-section-title {
    color: #ffff00;
    font-weight: bold;
    margin-bottom: 5px;
    font-size: 0.85em;
    text-transform: uppercase;
}

.stat-item {
    display: flex;
    justify-content: space-between;
    margin: 3px 0;
    color: #00ff00;
    font-size: 0.8em;
}

.stat-label {
    color: #00ffff;
}

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

.hp-bar, .mana-bar {
    width: 100%;
    height: 8px;
    background: #0a0a0a;
    border: 1px solid #333;
    border-radius: 2px;
    margin-top: 2px;
    overflow: hidden;
}

.hp-fill {
    height: 100%;
    background: #ff0000;
    transition: width 0.3s;
}

.mana-fill {
    height: 100%;
    background: #0000ff;
    transition: width 0.3s;
}

/* Encumbrance Bar */
.encumbrance-bar {
    width: 100%;
    height: 8px;
    background: #0a0a0a;
    border: 1px solid #333;
    border-radius: 2px;
    margin-top: 2px;
    overflow: hidden;
}

.encumbrance-fill {
    height: 100%;
    transition: width 0.3s, background-color 0.3s;
}

.encumbrance-level {
    font-size: 0.8em;
    font-weight: bold;
}

.encumbrance-section {
    border-top: 1px solid #333;
    padding-top: 8px;
    margin-top: 8px;
}

/* Compass Widget Styles */
.compass-coordinates {
    color: #00ff00;
    text-align: center;
    margin-top: 10px;
    font-size: 0.75em;
    font-family: 'Courier New', monospace;
    padding-top: 8px;
    border-top: 1px solid #333;
}

.compass-grid {
    display: grid;
    grid-template-columns: repeat(3, 32px) 32px;
    grid-template-rows: repeat(3, 32px);
    gap: 4px;
    justify-content: center;
    align-items: center;
}

.compass-btn {
    background: #0a0a0a;
    border: 2px solid #333;
    color: #666;
    font-family: 'Courier New', monospace;
    font-size: 8px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.2s;
    border-radius: 3px;
    height: 32px;
    width: 32px;
    text-transform: uppercase;
    padding: 0;
}

.compass-btn:hover:not(:disabled) {
    border-color: #00ff00;
    color: #00ff00;
    background: #1a3a1a;
    box-shadow: 0 0 10px rgba(0, 255, 0, 0.5);
}

.compass-btn.available {
    border-color: #00ff00;
    color: #00ff00;
    background: #0a2a0a;
}

.compass-btn.unavailable {
    border-color: #222;
    color: #333;
    background: #0a0a0a;
    opacity: 0.4;
    cursor: not-allowed;
}

.compass-btn:disabled.unavailable {
    opacity: 0.4;
}

.compass-center {
    display: flex;
    align-items: center;
    justify-content: center;
    color: #00ff00;
    font-size: 12px;
    font-weight: bold;
}

.compass-btn.vertical {
    height: 32px;
    width: 32px;
}

/* Map Widget Styles */
#widget-map .widget-content {
    padding: 4px;
}

.map-viewport {
    width: 100%;
    height: 100%;
    background: #0a0a0a;
    border: 1px solid #333;
    border-radius: 4px;
    overflow: hidden;
    position: relative;
}

#mapCanvas {
    width: 100%;
    height: 100%;
    display: block;
}

/* NPC Widget Styles */
#widget-npc {
    border-color: #ff8800;
    box-shadow: 0 0 10px rgba(255, 136, 0, 0.4);
}

#widget-npc .widget-header {
    color: #ff8800;
    border-bottom-color: #663300;
}

.npc-widget-name {
    color: #ffcc00;
    font-size: 14px;
    font-weight: bold;
    text-align: center;
    margin-bottom: 8px;
    font-family: 'Courier New', monospace;
}

.npc-widget-status {
    color: #ff8800;
    font-size: 11px;
    text-align: center;
    margin-bottom: 10px;
    font-family: 'Courier New', monospace;
    text-transform: uppercase;
}

.npc-widget-progress-container {
    width: 100%;
    height: 12px;
    background: #1a1a1a;
    border: 1px solid #444;
    border-radius: 4px;
    overflow: hidden;
}

.npc-widget-progress-bar {
    height: 100%;
    transition: width 0.3s ease, background 0.3s ease;
}

.npc-widget-progress-bar.harvesting {
    background: linear-gradient(90deg, #00ff00, #00cc00);
    box-shadow: 0 0 8px #00ff00 inset;
}

.npc-widget-progress-bar.cooldown {
    background: linear-gradient(90deg, #ff6600, #ff9900);
    box-shadow: 0 0 8px #ff6600 inset;
}

.npc-widget-timing {
    margin-top: 10px;
    padding-top: 8px;
    border-top: 1px solid #333;
    font-family: 'Courier New', monospace;
    font-size: 10px;
}

.timing-row {
    display: flex;
    justify-content: space-between;
    margin: 2px 0;
}

.timing-label {
    color: #888;
}

.timing-row span:last-child {
    color: #ff8800;
    font-weight: bold;
}

/* Factory Widget Styles */
#widget-factory {
    background: #0a0a0a;
    border: 2px solid #ff8800;
    color: #00ff00;
    font-family: 'Courier New', monospace;
}

#widget-factory .widget-header {
    background: #1a1a1a;
    border-bottom: 2px solid #ff8800;
    color: #ffff00;
    font-weight: bold;
    padding: 8px;
    text-align: center;
    text-transform: uppercase;
}

/* God Mode Widget */
#widget-godmode {
    border-color: #ffcc00;
}

#widget-godmode .godmode-header {
    background: linear-gradient(135deg, #1a1a0a 0%, #2a2a0a 100%);
    border-bottom: 2px solid #ffcc00;
    color: #ffcc00;
    font-weight: bold;
    padding: 8px;
    text-align: center;
    text-transform: uppercase;
    letter-spacing: 2px;
    text-shadow: 0 0 10px rgba(255, 204, 0, 0.5);
}

.godmode-content {
    padding: 8px !important;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.godmode-section {
    background: rgba(255, 204, 0, 0.05);
    border: 1px solid rgba(255, 204, 0, 0.2);
    border-radius: 4px;
    padding: 8px;
}

.godmode-section-title {
    color: #ffcc00;
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 8px;
    opacity: 0.8;
}

.godmode-editor-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 6px;
}

.godmode-editor-btn {
    display: flex;
    align-items: center;
    gap: 6px;
    background: #0a0a0a;
    border: 1px solid #ffcc00;
    color: #ffcc00;
    font-family: 'Courier New', monospace;
    font-size: 10px;
    padding: 6px 8px;
    cursor: pointer;
    transition: all 0.2s;
    text-transform: uppercase;
}

.godmode-editor-btn:hover {
    background: rgba(255, 204, 0, 0.15);
    box-shadow: 0 0 8px rgba(255, 204, 0, 0.3);
}

.godmode-editor-btn:active {
    background: rgba(255, 204, 0, 0.25);
}

.godmode-editor-btn svg {
    flex-shrink: 0;
}

.godmode-server-section {
    margin-top: 4px;
}

.godmode-server-info {
    color: #888;
    font-size: 9px;
    margin-bottom: 6px;
    text-align: center;
}

.godmode-restart-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    width: 100%;
    background: #1a0a0a;
    border: 1px solid #ff6666;
    color: #ff6666;
    font-family: 'Courier New', monospace;
    font-size: 10px;
    padding: 8px;
    cursor: pointer;
    transition: all 0.2s;
    text-transform: uppercase;
}

.godmode-restart-btn:hover {
    background: rgba(255, 102, 102, 0.15);
    box-shadow: 0 0 8px rgba(255, 102, 102, 0.3);
    border-color: #ff0000;
    color: #ff0000;
}

.godmode-restart-btn:active {
    background: rgba(255, 102, 102, 0.25);
}

.factory-slot-container {
    display: flex;
    flex-direction: column;
    gap: 12px;
    padding: 8px;
}

.factory-slot {
    border: 2px dashed #00ff00;
    border-radius: 4px;
    padding: 8px;
    min-height: 60px;
    display: flex;
    flex-direction: column;
    gap: 4px;
    transition: border-color 0.2s;
}

.factory-slot.drag-over {
    border-color: #ffff00;
    border-style: solid;
    background: rgba(255, 255, 0, 0.1);
}

.factory-slot-label {
    font-size: 0.75em;
    color: #888;
    text-transform: uppercase;
    margin-bottom: 4px;
}

.factory-slot-content {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #888;
    font-size: 0.9em;
    min-height: 40px;
}

.factory-slot-content.filled {
    color: #00ff00;
    font-weight: bold;
}

.factory-slot-text {
    border-style: solid;
}

.factory-text-input {
    background: #0a0a0a;
    border: 1px solid #00ff00;
    color: #00ff00;
    font-family: 'Courier New', monospace;
    font-size: 0.9em;
    padding: 4px 8px;
    width: 100%;
    box-sizing: border-box;
}

.factory-text-input:focus {
    outline: none;
    border-color: #ffff00;
}

/* Warehouse Widget Styles */
#widget-warehouse {
    border: 2px solid #00ff00;
    background: rgba(0, 0, 0, 0.9);
    padding: 8px;
    min-width: 250px;
    max-width: 300px;
}

#widget-warehouse .widget-header {
    color: #ffff00;
    font-weight: bold;
    text-align: center;
    margin-bottom: 8px;
    padding-bottom: 4px;
    border-bottom: 1px solid #00ff00;
    font-size: 0.9em;
}

.warehouse-info-note {
    color: #00ffff;
    font-size: 0.85em;
    font-style: italic;
    margin-bottom: 8px;
    padding: 4px;
    background: rgba(0, 255, 255, 0.1);
    border-left: 2px solid #00ffff;
}

.warehouse-capacity {
    margin-bottom: 8px;
    padding: 4px;
    border: 1px solid #00ff00;
}

.warehouse-capacity-row {
    display: flex;
    justify-content: space-between;
    margin: 2px 0;
    font-size: 0.85em;
}

.warehouse-capacity-label {
    color: #00ffff;
}

.warehouse-capacity-row span:last-child {
    color: #00ff00;
}

.warehouse-deeds {
    margin-bottom: 8px;
    padding: 4px;
    border: 1px solid #00ff00;
}

.warehouse-deeds-label {
    color: #ffff00;
    font-weight: bold;
    font-size: 0.85em;
    margin-bottom: 4px;
}

#warehouse-deeds-list {
    font-size: 0.8em;
    color: #00ff00;
    max-height: 60px;
    overflow-y: auto;
}

#warehouse-deeds-list div {
    padding: 2px 0;
}

.warehouse-items {
    margin-bottom: 8px;
    padding: 4px;
    border: 1px solid #00ff00;
    max-height: 150px;
    overflow-y: auto;
}

.warehouse-items-label {
    color: #ffff00;
    font-weight: bold;
    font-size: 0.85em;
    margin-bottom: 4px;
}

#warehouse-items-list {
    font-size: 0.8em;
    color: #00ff00;
}

#warehouse-items-list div {
    padding: 2px 0;
    display: flex;
    justify-content: space-between;
}

.warehouse-actions {
    margin-top: 8px;
}

.warehouse-action-row {
    display: flex;
    gap: 4px;
    margin-bottom: 4px;
    width: 100%;
}

.warehouse-action-row input[placeholder="Item name"] {
    flex: 2;
    background: rgba(0, 0, 0, 0.8);
    border: 1px solid #00ff00;
    color: #00ff00;
    font-family: 'Courier New', monospace;
    font-size: 0.85em;
    padding: 4px;
    box-sizing: border-box;
    min-width: 0;
}

.warehouse-action-row input[placeholder="Qty"] {
    width: 50px;
    flex-shrink: 0;
    background: rgba(0, 0, 0, 0.8);
    border: 1px solid #00ff00;
    color: #00ff00;
    font-family: 'Courier New', monospace;
    font-size: 0.85em;
    padding: 4px;
    box-sizing: border-box;
    text-align: center;
}

.warehouse-action-row input:focus {
    outline: none;
    border-color: #ffff00;
}

.warehouse-action-row button {
    background: rgba(0, 255, 0, 0.2);
    border: 1px solid #00ff00;
    color: #00ff00;
    font-family: 'Courier New', monospace;
    font-size: 0.85em;
    padding: 4px 8px;
    cursor: pointer;
}

.warehouse-action-row button:hover {
    background: rgba(0, 255, 0, 0.3);
    border-color: #ffff00;
    color: #ffff00;
}

.warehouse-action-row button:active {
    background: rgba(0, 255, 0, 0.4);
}

/* Inventory draggable row styles */
.inventory-table tbody tr[draggable="true"] {
    cursor: grab;
    user-select: none;
}

.inventory-table tbody tr[draggable="true"]:active {
    cursor: grabbing;
}

.inventory-table tbody tr[draggable="true"]:hover {
    background: rgba(0, 255, 0, 0.1);
}

/* Map Editor Overlay */
.map-editor-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.95);
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
}

.map-editor-overlay.hidden {
    display: none;
}

.map-editor-container {
    width: 95%;
    height: 95%;
    background: #0a0a0a;
    border: 3px solid #00ff00;
    border-radius: 8px;
    display: flex;
    flex-direction: column;
    padding: 10px;
}

.map-editor-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px;
    border-bottom: 2px solid #00ff00;
    margin-bottom: 10px;
}

.map-editor-header h2 {
    color: #00ff00;
    font-family: 'Courier New', monospace;
    text-transform: uppercase;
    margin: 0;
}

.close-editor-btn {
    background: #0a0a0a;
    border: 2px solid #ff0000;
    color: #ff0000;
    font-family: 'Courier New', monospace;
    padding: 8px 16px;
    cursor: pointer;
    font-weight: bold;
}

.close-editor-btn:hover {
    background: #3a0a0a;
    box-shadow: 0 0 10px rgba(255, 0, 0, 0.5);
}

.map-editor-toolbar {
    display: flex;
    gap: 10px;
    padding: 10px;
    border-bottom: 1px solid #333;
    margin-bottom: 10px;
}

.map-selector, .editor-btn {
    background: #0a0a0a;
    border: 2px solid #00ff00;
    color: #00ff00;
    font-family: 'Courier New', monospace;
    padding: 8px 16px;
    font-size: 12px;
}

.map-selector {
    flex: 1;
    max-width: 300px;
}

.editor-btn {
    cursor: pointer;
    font-weight: bold;
    text-transform: uppercase;
}

.editor-btn:hover {
    background: #1a3a1a;
    box-shadow: 0 0 10px rgba(0, 255, 0, 0.5);
}

.map-editor-content {
    flex: 1;
    display: flex;
    gap: 10px;
    overflow: hidden;
}

.map-editor-grid-container {
    flex: 0.65;
    background: #000;
    border: 2px solid #00ff00;
    border-radius: 4px;
    overflow: hidden;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
}

#npcListContainer {
    align-items: flex-start;
    justify-content: flex-start;
    padding: 10px;
}

.npc-list {
    width: 100%;
    height: 100%;
    overflow-y: auto;
    font-size: 11px;
    color: #00ff00;
}

.npc-list-item {
    padding: 4px 6px;
    border-bottom: 1px solid #333;
    cursor: pointer;
}

.npc-list-item:hover {
    background: #1a3a1a;
}

.npc-list-item.selected {
    background: #004400;
}

/* NPC Editor detail mode: hide list, expand form */
#npcEditor.npc-detail-mode #npcEditorSidePanel {
    width: 100%;
    max-width: 100%;
}

/* NPC Editor: Fixed header, scrollable form */
#npcEditor .map-editor-header {
    position: sticky;
    top: 0;
    z-index: 10;
    background: #1a1a1a;
    border-bottom: 2px solid #00ff00;
}

#npcEditor .map-editor-toolbar {
    position: sticky;
    top: 60px; /* Adjust based on header height */
    z-index: 9;
    background: #1a1a1a;
    border-bottom: 1px solid #00ff00;
    padding: 8px;
}

#npcEditor #npcSidePanelContent {
    display: flex;
    flex-direction: column;
    height: 100%;
    overflow: hidden;
}

.npc-editor-scrollable {
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
    padding: 10px;
    max-height: calc(100vh - 140px);
}

.npc-editor-title {
    font-size: 0.9em;
    margin-bottom: 12px;
    color: #ffff00;
}

.npc-editor-form {
    display: flex;
    flex-direction: column;
    gap: 12px;
    font-size: 11px;
}

.npc-row {
    display: flex;
    gap: 12px;
    align-items: flex-start;
}

.npc-field-group {
    display: flex;
    flex-direction: column;
    flex: 1;
}

.npc-field-name {
    flex: 0 0 70%;
}

.npc-field-color {
    flex: 0 0 30%;
}

.npc-field-quarter {
    flex: 0 0 calc(25% - 6px);
}

.npc-field-third {
    flex: 0 0 calc(33.33% - 6px);
}

.npc-field-half {
    flex: 0 0 calc(50% - 6px);
}

.npc-field-full {
    flex: 1 1 100%;
}

.npc-editor-form label {
    margin-bottom: 4px;
    font-size: 11px;
    color: #00ffff;
    font-weight: normal;
}

.npc-json-label {
    font-size: 8px;
    color: #888;
    font-weight: normal;
}

.npc-editor-form input,
.npc-editor-form select {
    height: 30px;
    font-size: 11px;
    padding: 4px 6px;
    background: #0a0a0a;
    border: 1px solid #00ff00;
    color: #00ff00;
    font-family: 'Courier New', monospace;
}

.npc-editor-form textarea {
    min-height: 80px;
    font-size: 10px;
    padding: 4px 6px;
    background: #0a0a0a;
    border: 1px solid #00ff00;
    color: #00ff00;
    font-family: 'Courier New', monospace;
    resize: vertical !important;
    max-height: 500px !important;
    box-sizing: border-box;
    overflow: auto !important;
    display: block !important;
}

.npc-json-textarea {
    width: 100%;
    min-height: 80px;
    height: 80px;
    resize: vertical !important;
    box-sizing: border-box;
}

.npc-textarea {
    width: 100%;
    min-height: 60px;
    height: 60px;
    resize: vertical !important;
    box-sizing: border-box;
}

.npc-save-row {
    display: flex;
    justify-content: center;
    margin-top: 20px;
}

.npc-save-row button#saveNpcBtn {
    width: 160px;
    background: #0a0a0a;
    border: 2px solid #00ff00;
    color: #00ff00;
    font-family: 'Courier New', monospace;
    padding: 8px 16px;
    cursor: pointer;
    font-weight: bold;
    text-transform: uppercase;
}

.npc-editor-form button#saveNpcBtn:hover {
    background: #1a3a1a;
    box-shadow: 0 0 10px rgba(0, 255, 0, 0.5);
}

/* Glow Codex Puzzle Section Styles */
.glow-codex-section {
    margin-top: 15px;
    padding: 15px;
    border: 2px solid #ff00ff;
    border-radius: 4px;
    background: rgba(80, 0, 80, 0.3);
}

.glow-codex-section .npc-section-title {
    font-size: 12px;
    font-weight: bold;
    color: #ff00ff;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 15px;
    padding-bottom: 8px;
    border-bottom: 1px solid #ff00ff;
}

.glow-codex-section label {
    color: #ff00ff;
}

.glow-codex-section input,
.glow-codex-section select,
.glow-codex-section textarea {
    border-color: #ff00ff;
}

.glow-codex-section input:focus,
.glow-codex-section select:focus,
.glow-codex-section textarea:focus {
    border-color: #ff00ff;
    box-shadow: 0 0 5px rgba(255, 0, 255, 0.5);
}

.npc-template-btn {
    background: #0a0a0a;
    border: 2px solid #ff00ff;
    color: #ff00ff;
    font-family: 'Courier New', monospace;
    padding: 8px 16px;
    cursor: pointer;
    font-weight: bold;
    font-size: 11px;
    text-transform: uppercase;
    width: 100%;
    margin-top: 10px;
}

.npc-template-btn:hover {
    background: rgba(255, 0, 255, 0.1);
    box-shadow: 0 0 10px rgba(255, 0, 255, 0.5);
}

/* Lore Keeper Section Styles */
.lorekeeper-section {
    margin-top: 15px;
    padding: 15px;
    border: 2px solid #00ffff;
    border-radius: 4px;
    background: rgba(0, 50, 80, 0.3);
}

.lorekeeper-section .npc-section-title {
    font-size: 12px;
    font-weight: bold;
    color: #00ffff;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 15px;
    padding-bottom: 8px;
    border-bottom: 1px solid #00ffff;
}

.lorekeeper-section .npc-row {
    margin-bottom: 12px;
}

.lorekeeper-section label {
    color: #00ffff;
}

.lorekeeper-section input,
.lorekeeper-section select,
.lorekeeper-section textarea {
    border-color: #00ffff;
}

.lorekeeper-section input:focus,
.lorekeeper-section select:focus,
.lorekeeper-section textarea:focus {
    border-color: #00ffff;
    box-shadow: 0 0 5px rgba(0, 255, 255, 0.5);
}

.npc-placement-section {
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid #00ff00;
}

.npc-placement-section h4 {
    font-size: 0.9em;
    color: #ffff00;
    margin-bottom: 12px;
}

.npc-placement-controls-horizontal {
    display: flex;
    gap: 12px;
    align-items: center;
    margin-bottom: 15px;
}

.npc-placement-controls-horizontal #npcPlacementMapSelect,
.npc-placement-controls-horizontal #npcPlacementRoomSelect {
    flex: 1;
    height: 30px;
    font-size: 11px;
    padding: 4px 6px;
    background: #0a0a0a;
    border: 1px solid #00ff00;
    color: #00ff00;
    font-family: 'Courier New', monospace;
}

.npc-placement-controls-horizontal #npcPlacementMapSelect:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.npc-placement-controls-horizontal .npc-small-btn {
    width: 160px;
    height: 30px;
    background: #0a0a0a;
    border: 2px solid #00ff00;
    color: #00ff00;
    font-family: 'Courier New', monospace;
    padding: 4px 16px;
    cursor: pointer;
    font-weight: bold;
    text-transform: uppercase;
    white-space: nowrap;
}

.npc-placement-controls-horizontal .npc-small-btn:hover {
    background: #1a3a1a;
    box-shadow: 0 0 10px rgba(0, 255, 0, 0.5);
}

/* Color preview square next to color dropdown */
.npc-color-wrapper {
    display: flex;
    align-items: center;
    gap: 4px;
}

.npc-color-preview {
    width: 10px;
    height: 10px;
    border: 1px solid #00ff00;
    background: #00ff00;
}

.map-editor-canvas {
    display: block;
    cursor: crosshair;
    width: 100%;
    height: 100%;
}

.map-editor-side-panel {
    flex: 0.35;
    min-width: 360px;
    background: #1a1a1a;
    border: 2px solid #00ff00;
    border-radius: 4px;
    padding: 15px;
    overflow-y: auto;
    overflow-x: hidden;
    color: #00ff00;
    font-family: 'Courier New', monospace;
    display: flex;
    flex-direction: column;
}

/* Item Editor: Make side panel use remaining space */
#itemEditor .map-editor-side-panel {
    flex: 1;
    min-width: 500px;
    max-width: none;
    width: auto;
    overflow-y: auto;
}

.map-editor-side-panel h3 {
    color: #ffff00;
    margin-bottom: 10px;
    text-transform: uppercase;
    font-size: 0.9em;
}

#sidePanelContent {
    display: flex;
    flex-direction: column;
    flex: 1;
    overflow: hidden;
}

/* NPC Editor: allow scrolling so full NPC sheet (including Save button) is visible */
#npcEditor .map-editor-side-panel {
    overflow: visible;
    display: flex;
    flex-direction: column;
}

#npcEditor #npcSidePanelContent {
    height: 100%;
    display: flex;
    flex-direction: column;
    overflow: visible;
}

.map-editor-side-panel label {
    display: block;
    color: #00ffff;
    margin-top: 8px;
    margin-bottom: 5px;
    font-size: 11px;
}

.map-editor-side-panel input,
.map-editor-side-panel textarea,
.map-editor-side-panel select {
    width: 100%;
    background: #0a0a0a;
    border: 1px solid #00ff00;
    color: #00ff00;
    font-family: 'Courier New', monospace;
    padding: 5px;
    font-size: 12px;
}

.map-editor-side-panel textarea {
    min-height: 60px;
    max-height: none; /* Allow full resize */
    resize: vertical;
}

.map-editor-side-panel button {
    background: #0a0a0a;
    border: 2px solid #00ff00;
    color: #00ff00;
    font-family: 'Courier New', monospace;
    padding: 8px 16px;
    margin-top: 10px;
    cursor: pointer;
    font-weight: bold;
    font-size:11px;
    text-transform: uppercase;
}

.map-editor-side-panel button:hover {
    background: #1a3a1a;
    box-shadow: 0 0 10px rgba(0, 255, 0, 0.5);
}

/* Dialog Overlay */
.dialog-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    z-index: 2000;
    display: flex;
    align-items: center;
    justify-content: center;
}

.dialog-overlay.hidden {
    display: none;
}

.dialog {
    background: #1a1a1a;
    border: 3px solid #00ff00;
    border-radius: 8px;
    padding: 20px;
    min-width: 400px;
    color: #00ff00;
    font-family: 'Courier New', monospace;
}

.dialog h3 {
    color: #ffff00;
    margin-bottom: 15px;
    text-transform: uppercase;
}

.dialog-content {
    margin-bottom: 15px;
}

.dialog-content label {
    display: block;
    color: #00ffff;
    margin-bottom: 5px;
    font-size: 12px;
}

.dialog-input, .dialog-textarea {
    width: 100%;
    background: #0a0a0a;
    border: 1px solid #00ff00;
    color: #00ff00;
    font-family: 'Courier New', monospace;
    padding: 8px;
    margin-bottom: 10px;
    font-size: 12px;
}

.dialog-textarea {
    min-height: 100px;
    resize: vertical;
}

.dialog-buttons {
    display: flex;
    gap: 10px;
    justify-content: flex-end;
}

.dialog-btn {
    background: #0a0a0a;
    border: 2px solid #00ff00;
    color: #00ff00;
    font-family: 'Courier New', monospace;
    padding: 8px 16px;
    cursor: pointer;
    font-weight: bold;
    text-transform: uppercase;
}

.dialog-btn:hover {
    background: #1a3a1a;
    box-shadow: 0 0 10px rgba(0, 255, 0, 0.5);
}

/* Responsive adjustments */
@media (max-width: 1024px) {
    .game-layout {
        flex-direction: column;
    }
    
    .terminal-container {
        width: 100%;
        height: 50vh;
    }
    
    .right-panel {
        width: 100%;
        height: 50vh;
    }
}

/* Jump Widget (God Mode) */
.jump-widget-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.85);
    z-index: 9000;
    display: flex;
    align-items: center;
    justify-content: center;
}

.jump-widget-overlay.hidden {
    display: none;
}

.jump-widget-container {
    background: #0a0a0a;
    border: 2px solid #00ff00;
    width: 600px;
    max-width: 90vw;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    box-shadow: 0 0 30px rgba(0, 255, 0, 0.3);
}

.jump-widget-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 15px;
    border-bottom: 1px solid #333;
    background: #111;
}

.jump-widget-header h3 {
    color: #00ff00;
    font-size: 16px;
    margin: 0;
}

.jump-widget-close {
    background: none;
    border: 1px solid #ff0000;
    color: #ff0000;
    font-size: 20px;
    width: 28px;
    height: 28px;
    cursor: pointer;
    line-height: 1;
}

.jump-widget-close:hover {
    background: #330000;
}

.jump-widget-toolbar {
    padding: 10px 15px;
    border-bottom: 1px solid #333;
    background: #0d0d0d;
}

.jump-map-selector {
    width: 100%;
    padding: 8px;
    background: #111;
    border: 1px solid #333;
    color: #00ff00;
    font-family: 'Courier New', monospace;
    font-size: 14px;
}

.jump-map-selector:focus {
    outline: none;
    border-color: #00ff00;
}

.jump-widget-content {
    flex: 1;
    padding: 15px;
    overflow: auto;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 400px;
}

#jumpMapCanvas {
    background: #050505;
    border: 1px solid #222;
    cursor: crosshair;
}

.jump-widget-info {
    padding: 10px 15px;
    border-top: 1px solid #333;
    background: #0d0d0d;
    color: #888;
    font-size: 12px;
    text-align: center;
}

.jump-widget-info .room-name {
    color: #00ffff;
}

.jump-widget-info .room-coords {
    color: #ffff00;
}

/* Merchant List Styles */
.merchant-list-section {
    margin: 10px 0;
    padding: 10px;
    border: 1px solid #006600;
    background: rgba(0, 50, 0, 0.3);
}

.merchant-list-header {
    color: #ffff00;
    font-weight: bold;
    margin-bottom: 10px;
    font-size: 1.1em;
}

.merchant-list-table {
    width: 50%;
    border-collapse: collapse;
    font-family: 'Courier New', monospace;
}

.merchant-list-table th {
    color: #00ffff;
    text-align: left;
    padding: 4px 8px;
    border-bottom: 1px solid #006600;
}

.merchant-list-table th:nth-child(2) {
    text-align: center;
    width: 60px;
}

.merchant-list-table th:nth-child(3) {
    text-align: right;
    width: 80px;
}

.merchant-list-table td {
    color: #00ff00;
    padding: 4px 8px;
    border-bottom: 1px solid #003300;
}

.merchant-list-table tr.out-of-stock td {
    color: #666666;
}

.merchant-list-table .merchant-qty {
    text-align: center;
    width: 60px;
}

.merchant-list-table .merchant-price {
    text-align: right;
    width: 80px;
    color: #ffcc00;
}
