/* 3D Game Styles */

/* ========== Custom Cursors ========== */
html,
body {
    width: 100%;
    height: 100%;
    overflow: hidden;
    background: #1a1a2e;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    cursor: url('/3d/img/cursors/cursor-default.svg') 0 0, auto;
}

/* Pointer cursor for interactive elements */
body.game-3d a,
body.game-3d button,
body.game-3d label,
body.game-3d .modal-x-btn,
body.game-3d .close-btn,
body.game-3d [data-close],
body.game-3d .btn,
.game-3d #dev-tools button,
.game-3d .modal-header .modal-close,
body.game-3d [for] {
    cursor: url('/3d/img/cursors/cursor-pointer.svg') 10 4, pointer;
}

/* Text cursor for text inputs (including modals) */
body.game-3d input[type="text"],
body.game-3d input[type="password"],
body.game-3d input[type="email"],
body.game-3d input[type="number"],
body.game-3d input[type="search"],
body.game-3d input[type="url"],
body.game-3d input[type="tel"],
body.game-3d textarea,
body.game-3d [contenteditable="true"],
body.game-3d .modal input[type="text"],
body.game-3d .modal input[type="password"],
body.game-3d .modal input[type="email"],
body.game-3d .modal input[type="number"],
body.game-3d .modal input[type="search"],
body.game-3d .modal textarea,
body.game-3d .modal [contenteditable="true"] {
    cursor: url('/3d/img/cursors/cursor-text.svg') 16 16, text !important;
}

/* Move cursor for draggable elements (modals, panels) */
body.game-3d .draggable,
body.game-3d .modal-header,
body.game-3d .panel-header,
body.game-3d .drag-handle,
body.game-3d [data-draggable="true"] {
    cursor: url('/3d/img/cursors/cursor-move.svg') 16 16, move;
}

/* Harvest cursor for harvestable resources */
body.game-3d .harvestable,
body.game-3d [data-interactable="harvest"],
body.game-3d .resource-node {
    cursor: url('/3d/img/cursors/cursor-harvest.svg') 8 8, pointer;
}

/* Aim cursor for attackable enemies */
body.game-3d .attackable,
body.game-3d [data-interactable="attack"],
body.game-3d .enemy,
body.game-3d .hostile {
    cursor: url('/3d/img/cursors/cursor-aim.svg') 16 16, crosshair;
}

/* Grab cursor for pickable items */
body.game-3d .pickable,
body.game-3d [data-interactable="pickup"],
body.game-3d .loot,
body.game-3d .item-drop {
    cursor: url('/3d/img/cursors/cursor-grab.svg') 16 16, grab;
}

/* Teleport cursor for teleport spell targeting */
body.game-3d.teleport-mode,
body.game-3d.teleport-mode #game-canvas,
body.game-3d.teleport-mode #world-map-canvas,
body.game-3d.teleport-mode #minimap-canvas {
    cursor: url('/3d/img/cursors/cursor-teleport.svg') 16 16, crosshair !important;
}

#game-container {
    width: 100%;
    height: 100%;
    position: relative;
}

/* Game canvas uses directional cursors for character movement */
#game-canvas {
    width: 100%;
    height: 100%;
    display: block;
    cursor: url('/3d/img/cursors/cursor-dir-n.svg') 16 4, crosshair;
    pointer-events: auto;
    position: relative;
    z-index: 1;
    background: #87ceeb;
    /* Sky blue fallback - matches renderer clear color */
}

/* Directional cursor variants - controlled via data-cursor-dir attribute */
#game-canvas[data-cursor-dir="n"] {
    cursor: url('/3d/img/cursors/cursor-dir-n.svg') 16 2, crosshair;
}

#game-canvas[data-cursor-dir="ne"] {
    cursor: url('/3d/img/cursors/cursor-dir-ne.svg') 28 4, crosshair;
}

#game-canvas[data-cursor-dir="e"] {
    cursor: url('/3d/img/cursors/cursor-dir-e.svg') 30 16, crosshair;
}

#game-canvas[data-cursor-dir="se"] {
    cursor: url('/3d/img/cursors/cursor-dir-se.svg') 28 28, crosshair;
}

#game-canvas[data-cursor-dir="s"] {
    cursor: url('/3d/img/cursors/cursor-dir-s.svg') 16 30, crosshair;
}

#game-canvas[data-cursor-dir="sw"] {
    cursor: url('/3d/img/cursors/cursor-dir-sw.svg') 4 28, crosshair;
}

#game-canvas[data-cursor-dir="w"] {
    cursor: url('/3d/img/cursors/cursor-dir-w.svg') 2 16, crosshair;
}

#game-canvas[data-cursor-dir="nw"] {
    cursor: url('/3d/img/cursors/cursor-dir-nw.svg') 4 4, crosshair;
}

/* UI Overlay */
#ui-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    pointer-events: none;
    z-index: 10;
}

#ui-overlay>div {
    pointer-events: auto;
}

#player-info {
    position: absolute;
    top: 20px;
    left: 20px;
    background: rgba(0, 0, 0, 0.7);
    color: #fff;
    padding: 10px 15px;
    border-radius: 8px;
    font-size: 14px;
}

#player-name {
    font-weight: bold;
    color: #3498db;
}

#coordinates {
    position: absolute;
    bottom: 20px;
    left: 20px;
    background: rgba(0, 0, 0, 0.7);
    color: #aaa;
    padding: 8px 12px;
    border-radius: 6px;
    font-size: 12px;
    font-family: monospace;
}

#coordinates span {
    margin-right: 15px;
}

#online-count {
    position: absolute;
    top: 20px;
    right: 20px;
    background: rgba(0, 0, 0, 0.7);
    color: #2ecc71;
    padding: 10px 15px;
    border-radius: 8px;
    font-size: 14px;
}

#fps-counter {
    position: absolute;
    bottom: 60px;
    left: 20px;
    background: rgba(0, 0, 0, 0.7);
    color: #f1c40f;
    padding: 6px 10px;
    border-radius: 4px;
    font-size: 11px;
    font-family: monospace;
    z-index: 10;
}

#fps-counter.hidden {
    display: none;
}

/* Loading Screen */
#loading-screen {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: #000;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    z-index: 100;
    transition: opacity 0.5s ease;
}

#loading-screen #starryBackground {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
}

#loading-screen .loading-logo,
#loading-screen .loader,
#loading-screen p {
    position: relative;
    z-index: 1;
}

#loading-screen.hidden {
    opacity: 0;
    pointer-events: none;
}

#loading-screen .loading-logo {
    max-width: 200px;
    height: auto;
    margin-bottom: 30px;
}

#loading-screen p {
    color: #aaa;
    margin-top: 20px;
    font-size: 14px;
    min-width: 200px;
    text-align: center;
}

.loader {
    width: 50px;
    height: 50px;
    border: 4px solid rgba(255, 255, 255, 0.1);
    border-top-color: #3498db;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* Distance indicator (fixed bottom left) */
.distance-indicator {
    position: fixed;
    bottom: 60px;
    left: 20px;
    background: rgba(0, 0, 0, 0.75);
    color: #2ecc71;
    padding: 6px 12px;
    border-radius: 6px;
    font-size: 14px;
    font-family: monospace;
    font-weight: bold;
    pointer-events: none;
    z-index: 100;
    white-space: nowrap;
    border: 1px solid rgba(46, 204, 113, 0.3);
}

.distance-indicator::before {
    content: 'Dist: ';
    color: #888;
}

/* Click indicator */
.click-indicator {
    position: absolute;
    width: 20px;
    height: 20px;
    border: 2px solid #fff;
    border-radius: 50%;
    pointer-events: none;
    animation: click-pulse 0.5s ease-out forwards;
}

@keyframes click-pulse {
    0% {
        transform: translate(-50%, -50%) scale(0.5);
        opacity: 1;
    }

    100% {
        transform: translate(-50%, -50%) scale(2);
        opacity: 0;
    }
}

/* Player name labels */
.player-label {
    position: absolute;
    background: rgba(0, 0, 0, 0.7);
    color: #fff;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 12px;
    white-space: nowrap;
    pointer-events: none;
    transform: translateX(-50%);
}

/* Guest/Spectator mode */
#player-name.guest {
    color: #aaa;
    font-style: italic;
    display: block;
    margin-bottom: 10px;
}

#player-info #login-btn {
    padding: 6px 12px;
    font-size: 13px;
}

/* Custom Action Bar (above quick access bar) */
#action-bar-custom, #quick-access-bar {
    position: relative;
    display: grid;
    grid-auto-flow: column;
    grid-auto-columns: minmax(0, 50px);
    max-width: 100%;
    gap:6px;
}

#action-bar-custom .action-slot, #quick-access-bar .quick-btn {
    aspect-ratio: 1;
    width: 100%;
    box-sizing: border-box;
    border: 1px solid rgba(79, 145, 255, 0.42);
    border-radius: 8px;
    background: rgba(100, 169, 255, 0.17);
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    transition: all 0.2s linear;
    cursor: url('/3d/img/cursors/cursor-pointer.svg') 10 4, pointer;
    box-shadow: 1px 1px 3px rgba(0, 0, 0, 0.3);
}

#action-bar-custom .action-slot:hover, #quick-access-bar .quick-btn:hover {
    transform: translateY(1px) translateX(1px) rotate(1deg);
    background-color: rgb(59 133 255 / 52%);
    border-color: #4f91ff;
}

#action-bar-custom .action-slot.drag-over, #quick-access-bar .quick-btn.drag-over {
    border-color: #4f91ff;
    background: rgba(79, 145, 255, 0.4);
    transform: scale(1.05);
}

#action-bar-custom .action-slot.has-action, #quick-access-bar .quick-btn.has-action {
    border-color: rgba(79, 145, 255, 0.7);
    background: rgba(100, 169, 255, 0.3);
}

#action-bar-custom .action-slot .slot-key, #quick-access-bar .quick-btn .quick-icon {
    position: absolute;
    font-size: clamp(8px, 2vw, 10px);
    font-weight: bold;
    pointer-events: none;
}

#action-bar-custom .action-slot:hover .slot-key, #quick-access-bar .quick-btn:hover .quick-icon {
    color: rgba(255, 255, 255, 0.7);
}

#action-bar-custom .action-slot .action-icon, #quick-access-bar .quick-btn .quick-icon {
    width: 100%;
    height: 100%;
    object-fit: contain;
    pointer-events: none;
}

/* Cooldown overlay for action slots */
#action-bar-custom .action-slot .cooldown-overlay, #quick-access-bar .quick-btn .cooldown-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.6);
    border-radius: 7px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    color: #fff;
    pointer-events: none;
}

/* Mobile Edit Mode - iOS-style shake animation */
@keyframes mobile-shake {

    0%,
    100% {
        transform: rotate(-1.5deg);
    }

    50% {
        transform: rotate(1.5deg);
    }
}

@keyframes mobile-shake-slot {

    0%,
    100% {
        transform: rotate(-2deg) scale(1.02);
    }

    50% {
        transform: rotate(2deg) scale(1.02);
    }
}

.mobile-edit-mode .shake-item {
    animation: mobile-shake 0.15s ease-in-out infinite;
}

.mobile-edit-mode .shake-slot {
    animation: mobile-shake-slot 0.12s ease-in-out infinite;
    border-style: dashed !important;
    border-color: rgba(255, 255, 255, 0.6) !important;
    background: rgba(255, 255, 255, 0.1) !important;
}

.mobile-edit-mode .spell-slot.shake-slot {
    border-color: rgba(155, 89, 182, 0.8) !important;
    background: rgba(155, 89, 182, 0.2) !important;
}

.mobile-edit-mode .paperdoll-slot.shake-slot,
.mobile-edit-mode .paperdoll-hand-slot.shake-slot {
    border-color: rgba(52, 152, 219, 0.8) !important;
    background: rgba(52, 152, 219, 0.2) !important;
}

/* Mobile drag ghost */
.mobile-drag-ghost {
    position: fixed;
    z-index: 10000;
    pointer-events: none;
    opacity: 0.9;
    transform: translate(-50%, -50%) scale(1.1);
    filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.4));
    transition: transform 0.1s ease;
}

.mobile-drag-ghost.over-valid-target {
    transform: translate(-50%, -50%) scale(1.2);
    filter: drop-shadow(0 6px 12px rgba(155, 89, 182, 0.6));
}

/* Mobile edit mode overlay hint */
.mobile-edit-hint {
    position: fixed;
    bottom: 150px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0, 0, 0, 0.8);
    color: #fff;
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 12px;
    z-index: 1000;
    pointer-events: none;
    animation: fadeInOut 3s ease-in-out forwards;
}

@keyframes fadeInOut {
    0% {
        opacity: 0;
        transform: translateX(-50%) translateY(10px);
    }

    15% {
        opacity: 1;
        transform: translateX(-50%) translateY(0);
    }

    85% {
        opacity: 1;
        transform: translateX(-50%) translateY(0);
    }

    100% {
        opacity: 0;
        transform: translateX(-50%) translateY(-10px);
    }
}

/* ========== Chat System ========== */

/* Chat Input (above spell bar) */
#chat-input-wrap {
    display: flex;
    gap: 8px;
}

#chat-input {
    flex: 1;
    padding: 10px 16px;
    /* border: 1px solid rgba(79, 145, 255, 0.42); */
    /* background: rgba(17, 29, 51, 0.95); */
    /* color: #f0f0f0; */
    font-size: 14px;
    /* border-radius: 0; */
    outline: none;
    /* transition: all 0.2s linear; */
    cursor: url(/3d/img/cursors/cursor-text.svg) 4 10, text;
    border: 1px solid rgba(79, 145, 255, 0.42);
    /* border-radius: 0; */
    background: rgba(100, 169, 255, 0.17);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s linear;
    /* cursor: url(/3d/img/cursors/cursor-pointer.svg) 10 4, pointer; */
    position: relative;
    /* overflow: visible; */
    border-radius: 8px;
    box-shadow: 1px 1px 3px rgba(0, 0, 0, 0.3);
    letter-spacing: 1px;
    font-size: 17px;
    height: 40px;
}

#chat-input::placeholder {
    color: rgba(164, 202, 255, 0.5);
}

#chat-input:focus {
    border-color: #4f91ff;
}

#chat-input:hover {
    background-color: rgb(59 133 255 / 52%);
    border-color: #4f91ff;
}

#chat-send-btn {
    padding: 10px 16px;
    border: 1px solid rgba(79, 145, 255, 0.42);
    background: rgba(100, 169, 255, 0.17);
    color: #a4caff;
    font-size: 14px;
    font-weight: bold;
    border-radius: 0;
    cursor: url('/3d/img/cursors/cursor-pointer.svg') 10 4, pointer;
    transition: all 0.2s linear;
    border: 1px solid rgba(79, 145, 255, 0.42);
    /* border-radius: 0; */
    background: rgba(100, 169, 255, 0.17);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s linear;
    /* cursor: url(/3d/img/cursors/cursor-pointer.svg) 10 4, pointer; */
    position: relative;
    /* overflow: visible; */
    border-radius: 8px;
    box-shadow: 1px 1px 3px rgba(0, 0, 0, 0.3);
    height: 40px;
}

#chat-send-btn:hover {
    transform: translateY(1px) translateX(1px) rotate(1deg);
    background-color: rgb(59 133 255 / 52%);
    border-color: #4f91ff;
    color: #f0f0f0;
}

/* Chat Bubble (appears over players) */
.chat-bubble {
    position: absolute;
    max-width: 250px;
    padding: 10px 14px;
    background: rgba(100, 169, 255, 0.25);
    border: 1px solid rgba(79, 145, 255, 0.5);
    border-radius: 8px;
    color: #fff;
    font-size: 14px;
    line-height: 1.4;
    word-wrap: break-word;
    pointer-events: none;
    transform: translateX(-50%);
    animation: chatBubbleFadeIn 0.3s ease-out;
    box-shadow: 1px 1px 3px rgba(0, 0, 0, 0.3), 0 0 15px rgba(79, 145, 255, 0.15);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    letter-spacing: 0.5px;
}

.chat-bubble::after {
    content: '';
    position: absolute;
    bottom: -8px;
    left: 50%;
    transform: translateX(-50%);
    border-width: 8px 6px 0 6px;
    border-style: solid;
    border-color: rgba(100, 169, 255, 0.25) transparent transparent transparent;
}

.chat-bubble::before {
    content: '';
    position: absolute;
    bottom: -10px;
    left: 50%;
    transform: translateX(-50%);
    border-width: 10px 8px 0 8px;
    border-style: solid;
    border-color: rgba(79, 145, 255, 0.5) transparent transparent transparent;
}

.chat-bubble .chat-bubble-name {
    font-weight: bold;
    color: #a4caff;
    font-size: 11px;
    margin-bottom: 4px;
    display: block;
}

.chat-bubble .chat-bubble-text {
    display: block;
}

.chat-bubble.fade-out {
    animation: chatBubbleFadeOut 0.5s ease-in forwards;
}

@keyframes chatBubbleFadeIn {
    from {
        opacity: 0;
        transform: translateX(-50%) translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateX(-50%) translateY(0);
    }
}

@keyframes chatBubbleFadeOut {
    from {
        opacity: 1;
        transform: translateX(-50%) translateY(0);
    }

    to {
        opacity: 0;
        transform: translateX(-50%) translateY(-10px);
    }
}

/* Skill Gain Popup (green floating text above player) */
.skill-gain-popup {
    position: absolute;
    padding: 4px 10px;
    background: rgba(34, 197, 94, 0.2);
    border: 1px solid rgba(34, 197, 94, 0.5);
    border-radius: 4px;
    color: #4ade80;
    font-size: 14px;
    font-weight: bold;
    line-height: 1.2;
    pointer-events: none;
    transform: translateX(-50%);
    animation: skillGainFloat 2s ease-out forwards;
    box-shadow: 0 0 10px rgba(34, 197, 94, 0.3);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    text-shadow: 0 0 8px rgba(34, 197, 94, 0.5);
    white-space: nowrap;
    z-index: 1000;
}

.skill-gain-popup .skill-gain-amount {
    color: #86efac;
    font-size: 16px;
}

.skill-gain-popup .skill-gain-name {
    color: #bbf7d0;
    font-size: 12px;
    margin-left: 4px;
}

@keyframes skillGainFloat {
    0% {
        opacity: 0;
        transform: translateX(-50%) translateY(20px) scale(0.8);
    }
    15% {
        opacity: 1;
        transform: translateX(-50%) translateY(0) scale(1);
    }
    70% {
        opacity: 1;
        transform: translateX(-50%) translateY(-40px) scale(1);
    }
    100% {
        opacity: 0;
        transform: translateX(-50%) translateY(-60px) scale(0.9);
    }
}

/* Mobile adjustments for skill gain */
@media (max-width: 480px) {
    .skill-gain-popup {
        font-size: 12px;
        padding: 3px 8px;
    }

    .skill-gain-popup .skill-gain-amount {
        font-size: 14px;
    }

    .skill-gain-popup .skill-gain-name {
        font-size: 10px;
    }
}

/* Mobile chat adjustments */
@media (max-width: 480px) {
    #chat-input-wrap {
        bottom: 140px;
        width: calc(100vw - 20px);
    }

    #chat-input {
        font-size: 16px;
        /* Prevent zoom on iOS */
    }

    .chat-bubble {
        max-width: 180px;
        font-size: 12px;
    }
}

/* Action Button (bottom right) */
#action-button {
    position: fixed;
    bottom: 100px;
    right: 20px;
    width: 64px;
    height: 64px;
    border-radius: 50%;
    border: none;
    background: linear-gradient(135deg, #e74c3c 0%, #c0392b 100%);
    color: #fff;
    font-size: 24px;
    font-weight: bold;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 100;
    cursor: url('/3d/img/cursors/cursor-pointer.svg') 10 4, pointer;
    box-shadow: 0 4px 15px rgba(231, 76, 60, 0.4), 0 2px 8px rgba(0, 0, 0, 0.3);
    transition: all 0.2s ease;
    touch-action: manipulation;
    -webkit-tap-highlight-color: transparent;
    user-select: none;
}

#action-button:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 20px rgba(231, 76, 60, 0.5), 0 4px 12px rgba(0, 0, 0, 0.4);
}

#action-button:active {
    transform: scale(0.95);
    box-shadow: 0 2px 8px rgba(231, 76, 60, 0.3), 0 1px 4px rgba(0, 0, 0, 0.2);
}

#action-button .action-icon {
    width: 32px;
    height: 32px;
    pointer-events: none;
}

#action-button .action-key-hint {
    position: absolute;
    bottom: -8px;
    right: -8px;
    background: rgba(0, 0, 0, 0.8);
    color: #fff;
    font-size: 10px;
    font-weight: bold;
    padding: 2px 6px;
    border-radius: 4px;
    pointer-events: none;
}

/* Action Button Settings Trigger */
#action-button-settings {
    position: fixed;
    bottom: 170px;
    right: 28px;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    border: none;
    background: rgba(0, 0, 0, 0.6);
    color: #fff;
    font-size: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 100;
    cursor: url('/3d/img/cursors/cursor-pointer.svg') 10 4, pointer;
    transition: all 0.2s ease;
    opacity: 0.6;
}

#action-button-settings:hover {
    opacity: 1;
    transform: scale(1.1);
    background: rgba(52, 152, 219, 0.8);
}

/* Action Button Settings Modal */
#action-button-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    z-index: 1000;
    align-items: center;
    justify-content: center;
}

#action-button-modal.active {
    display: flex;
}

#action-button-modal .modal-content {
    background: #2a2a3e;
    border-radius: 16px;
    width: 90%;
    max-width: 400px;
    max-height: 80vh;
    overflow-y: auto;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
}

#action-button-modal .modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 20px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

#action-button-modal .modal-header h3 {
    margin: 0;
    color: #fff;
    font-size: 18px;
}

#action-button-modal .modal-close {
    background: none;
    border: none;
    color: #fff;
    font-size: 24px;
    cursor: url('/3d/img/cursors/cursor-pointer.svg') 10 4, pointer;
    opacity: 0.7;
    transition: opacity 0.2s;
}

#action-button-modal .modal-close:hover {
    opacity: 1;
}

#action-button-modal .modal-body {
    padding: 16px;
}

/* Gesture Mapping Rows */
.gesture-mapping {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px;
    margin-bottom: 8px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 10px;
    gap: 12px;
}

.gesture-info {
    display: flex;
    align-items: center;
    gap: 8px;
    min-width: 120px;
}

.gesture-icon {
    font-size: 20px;
    width: 28px;
    text-align: center;
}

.gesture-name {
    color: #fff;
    font-weight: 500;
    font-size: 14px;
}

.gesture-key {
    background: rgba(255, 255, 255, 0.1);
    color: rgba(255, 255, 255, 0.7);
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 10px;
    font-family: monospace;
}

.gesture-action {
    display: flex;
    align-items: center;
    gap: 8px;
    background: rgba(0, 0, 0, 0.3);
    padding: 8px 12px;
    border-radius: 8px;
    cursor: url('/3d/img/cursors/cursor-pointer.svg') 10 4, pointer;
    transition: all 0.2s ease;
    min-width: 140px;
}

.gesture-action:hover {
    background: rgba(52, 152, 219, 0.3);
}

.gesture-action .action-icon {
    font-size: 18px;
}

.gesture-action .action-name {
    color: #fff;
    font-size: 13px;
    flex: 1;
}

.gesture-action .action-dropdown {
    color: rgba(255, 255, 255, 0.5);
    font-size: 10px;
}

/* Gesture Indicator (shown during drag) */
#action-gesture-indicator {
    display: none;
    position: fixed;
    width: 100px;
    height: 100px;
    pointer-events: none;
    z-index: 1001;
}

#action-gesture-indicator.active {
    display: block;
}

#action-gesture-indicator .gesture-arrow {
    position: absolute;
    font-size: 24px;
    color: rgba(255, 255, 255, 0.3);
    transition: all 0.15s ease;
}

#action-gesture-indicator .gesture-arrow.highlighted {
    color: #3498db;
    transform: scale(1.4);
    text-shadow: 0 0 10px rgba(52, 152, 219, 0.8);
}

#action-gesture-indicator .gesture-up {
    top: 0;
    left: 50%;
    transform: translateX(-50%);
}

#action-gesture-indicator .gesture-down {
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
}

#action-gesture-indicator .gesture-left {
    left: 0;
    top: 50%;
    transform: translateY(-50%);
}

#action-gesture-indicator .gesture-right {
    right: 0;
    top: 50%;
    transform: translateY(-50%);
}

#action-gesture-indicator .gesture-up.highlighted {
    transform: translateX(-50%) scale(1.4);
}

#action-gesture-indicator .gesture-down.highlighted {
    transform: translateX(-50%) scale(1.4);
}

#action-gesture-indicator .gesture-left.highlighted {
    transform: translateY(-50%) scale(1.4);
}

#action-gesture-indicator .gesture-right.highlighted {
    transform: translateY(-50%) scale(1.4);
}

/* Action Button States */
#action-button.pressing {
    transform: scale(0.9);
    box-shadow: 0 2px 8px rgba(231, 76, 60, 0.3);
}

#action-button.executed {
    background: linear-gradient(135deg, #27ae60 0%, #1e8449 100%);
    box-shadow: 0 4px 15px rgba(39, 174, 96, 0.5);
}

/* Action Picker Overlay */
#action-picker-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    z-index: 1002;
    display: flex;
    align-items: center;
    justify-content: center;
}

.action-picker-content {
    background: #2a2a3e;
    border-radius: 16px;
    width: 90%;
    max-width: 350px;
    max-height: 70vh;
    overflow: hidden;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
}

.action-picker-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 14px 16px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    color: #fff;
    font-size: 14px;
    font-weight: 500;
}

.action-picker-close {
    background: none;
    border: none;
    color: #fff;
    font-size: 22px;
    cursor: url('/3d/img/cursors/cursor-pointer.svg') 10 4, pointer;
    opacity: 0.7;
    line-height: 1;
}

.action-picker-close:hover {
    opacity: 1;
}

.action-picker-list {
    max-height: calc(70vh - 60px);
    overflow-y: auto;
    padding: 8px;
}

.action-picker-item {
    display: flex;
    align-items: center;
    padding: 12px;
    margin-bottom: 4px;
    border-radius: 10px;
    cursor: url('/3d/img/cursors/cursor-pointer.svg') 10 4, pointer;
    transition: all 0.15s ease;
    border: 2px solid transparent;
}

.action-picker-item:hover {
    background: rgba(52, 152, 219, 0.2);
}

.action-picker-item.selected {
    border-color: #3498db;
    background: rgba(52, 152, 219, 0.15);
}

.action-picker-icon {
    font-size: 24px;
    width: 40px;
    text-align: center;
    margin-right: 12px;
}

.action-picker-info {
    flex: 1;
}

.action-picker-name {
    color: #fff;
    font-weight: 600;
    font-size: 14px;
    display: block;
    margin-bottom: 2px;
}

.action-picker-desc {
    color: rgba(255, 255, 255, 0.5);
    font-size: 12px;
}

/* Mobile responsive for action button */
@media (max-width: 480px) {
    #action-button {
        width: 56px;
        height: 56px;
        bottom: 150px;
        right: 15px;
    }

    #action-button .action-icon {
        width: 28px;
        height: 28px;
    }

    #action-button-settings {
        bottom: 155px;
        right: 22px;
        width: 24px;
        height: 24px;
        font-size: 12px;
    }
}

/* Dev Tools */
#dev-tools {
    position: absolute;
    top: 60px;
    right: 20px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    pointer-events: auto;
    z-index: 100;
}

#dev-tools button {
    background: rgba(52, 152, 219, 0.9);
    color: #fff;
    border: none;
    padding: 8px 14px;
    border-radius: 6px;
    font-size: 13px;
    cursor: pointer;
    transition: background 0.2s, transform 0.1s;
}

#dev-tools button:hover {
    background: rgba(52, 152, 219, 1);
    transform: scale(1.02);
}

#dev-tools button:active {
    transform: scale(0.98);
}

#dev-tools button.loading {
    opacity: 0.7;
    pointer-events: none;
}

#dev-tools button.loading::after {
    content: '...';
    animation: dots 1s infinite;
}

@keyframes dots {

    0%,
    20% {
        content: '.';
    }

    40% {
        content: '..';
    }

    60%,
    100% {
        content: '...';
    }
}

/* ========== Object Interaction UI ========== */

/* Object Hover Label (small tooltip on mouse hover) */
.object-hover-label {
    position: fixed;
    bottom: 20px;
    right: 20px;
    background: rgba(0, 0, 0, 0.85);
    color: #fff;
    padding: 6px 12px;
    border-radius: 6px;
    font-size: 13px;
    z-index: 100;
    pointer-events: none;
    border: 1px solid rgba(52, 152, 219, 0.5);
    display: flex;
    align-items: center;
    gap: 8px;
    max-width: 250px;
}

.object-hover-label .object-name {
    font-weight: bold;
    color: #3498db;
}

.object-hover-label .object-type {
    font-size: 10px;
    padding: 2px 6px;
    border-radius: 8px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.object-hover-label .object-type.resource {
    background: rgba(230, 126, 34, 0.3);
    color: #e67e22;
}

.object-hover-label .object-type.interactable {
    background: rgba(46, 204, 113, 0.3);
    color: #2ecc71;
}

/* Context Menu */
.game-context-menu {
    position: fixed;
    background: rgba(20, 20, 35, 0.95);
    border: 1px solid rgba(52, 152, 219, 0.5);
    border-radius: 8px;
    min-width: 180px;
    z-index: 1000;
    overflow: hidden;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.5);
}

.context-menu-item {
    padding: 10px 16px;
    color: #fff;
    cursor: url('/3d/img/cursors/cursor-pointer.svg') 10 4, pointer;
    display: flex;
    align-items: center;
    gap: 10px;
    transition: background 0.15s;
}

.context-menu-item:hover {
    background: rgba(52, 152, 219, 0.3);
}

.context-menu-item .context-icon {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
}

.btn-icon {
    width: 16px;
    height: 16px;
    vertical-align: middle;
    margin-right: 4px;
}

.context-menu-divider {
    height: 1px;
    background: rgba(255, 255, 255, 0.1);
    margin: 4px 0;
}

/* Object Info Panel (draggable like other panels) */
.object-info-panel {
    position: fixed;
    top: 100px;
    left: calc(50% - 160px);
    width: 320px;
    z-index: 600;
    overflow: hidden;
}

.object-info-panel .panel-body {
    padding: 16px;
}

/* Legacy object-info-modal styles (for other modals like tile-info, save-location) */
.object-info-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.7);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

.object-info-modal-content {
    background-color: #111d33;
    border: 1px solid rgba(79, 145, 255, 0.42);
    border-radius: 5px;
    padding: 0;
    min-width: 300px;
    max-width: 400px;
    position: relative;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5), 0 0 0 1px rgba(255, 255, 255, 0.1);
}

.object-info-modal-close {
    position: absolute;
    top: 2px;
    right: 2px;
    background: #000;
    border: 1px solid rgba(79, 145, 255, 0.42);
    color: #f0f0f0;
    font-size: 18px;
    cursor: url('/3d/img/cursors/cursor-pointer.svg') 10 4, pointer;
    transition: all 0.25s ease-in;
    width: 34px;
    height: 34px;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 300;
}

.object-info-modal-close:hover {
    transform: translateY(1px) translateX(1px) rotate(3deg) scale(1.2);
    background-color: rgb(59 133 255 / 52%);
    border-color: rgba(79, 145, 255, 1);
}

.object-info-preview {
    display: flex;
    justify-content: center;
    margin-bottom: 16px;
}

.object-preview-canvas {
    width: 120px;
    height: 120px;
    border-radius: 5px;
    background: #0d1117;
    border: 1px solid rgba(79, 145, 255, 0.42);
}

.object-info-title {
    color: #a4caff;
    margin: 0 0 16px 0;
    font-size: 20px;
    padding-right: 30px;
    text-align: center;
    font-family: "DynaPuff", sans-serif;
}

.object-info-body {
    color: #ccc;
    margin-bottom: 20px;
}

.object-info-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.object-info-list li {
    padding: 8px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.object-info-list li:last-child {
    border-bottom: none;
}

.object-info-list strong {
    color: #fff;
}

/* Tile Info Items Section */
.tile-items-section {
    margin-top: 16px;
    padding-top: 16px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.tile-items-section h4 {
    color: #a4caff;
    margin: 0 0 10px 0;
    font-size: 14px;
    font-weight: normal;
}

.tile-items-list {
    list-style: none;
    padding: 0;
    margin: 0;
    max-height: 150px;
    overflow-y: auto;
}

.tile-items-list li {
    padding: 6px 8px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 4px;
    margin-bottom: 4px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.tile-items-list li:last-child {
    margin-bottom: 0;
}

.tile-items-list .item-name {
    color: #fff;
}

.tile-items-list .item-type {
    color: #888;
    font-size: 12px;
}

.tile-items-empty {
    color: #666;
    font-style: italic;
    font-size: 13px;
}

.object-info-actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.object-action-btn {
    flex: 1;
    min-width: 120px;
    padding: 10px 16px;
    background: rgba(100, 169, 255, 0.17);
    border: 1px solid rgba(79, 145, 255, 0.42);
    color: #f0f0f0;
    border-radius: 0;
    cursor: url('/3d/img/cursors/cursor-pointer.svg') 10 4, pointer;
    font-size: 14px;
    transition: all 0.2s linear;
}

.object-action-btn:hover {
    transform: translateY(1px) translateX(1px) rotate(1deg);
    background-color: rgb(59 133 255 / 52%);
    border-color: #4f91ff;
}

.object-action-btn.equip-btn {
    background: rgba(46, 204, 113, 0.2);
    border-color: rgba(46, 204, 113, 0.5);
}

.object-action-btn.equip-btn:hover {
    background: rgba(46, 204, 113, 0.4);
    border-color: rgba(46, 204, 113, 0.8);
    transform: translateY(1px) translateX(1px) rotate(1deg);
}

/* Plot Management - Enhancement UI */
.plot-management {
    padding: 0;
}

.enhancement-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.enhancement-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px;
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(79, 145, 255, 0.25);
    border-radius: 4px;
}

.enhancement-icon {
    font-size: 24px;
    width: 40px;
    text-align: center;
}

.enhancement-info {
    flex: 1;
}

.enhancement-name {
    font-weight: bold;
    color: #fff;
    margin-bottom: 2px;
}

.enhancement-desc {
    font-size: 12px;
    color: #888;
    margin-bottom: 2px;
}

.enhancement-cost {
    font-size: 11px;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.cost-required {
    color: #f0c060;
}

.cost-available {
    font-size: 10px;
}

.cost-available.can-afford {
    color: #2ecc71;
}

.cost-available.cannot-afford {
    color: #e74c3c;
}

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

.current-enhancements {
    background: rgba(0, 0, 0, 0.2);
    border-radius: 4px;
    padding: 8px;
    max-height: 120px;
    overflow-y: auto;
}

.enhancement-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 6px 8px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 4px;
    margin-bottom: 4px;
}

.enhancement-row:last-child {
    margin-bottom: 0;
}

.enhancement-label {
    color: #fff;
    font-size: 13px;
}

.enhancement-pos {
    color: #666;
    font-size: 11px;
}

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

.btn-small {
    padding: 4px 10px;
    font-size: 12px;
}

.btn-danger {
    background: rgba(231, 76, 60, 0.3);
    border-color: rgba(231, 76, 60, 0.5);
}

.btn-danger:hover {
    background: rgba(231, 76, 60, 0.5);
}

/* Fence Style Selector */
.fence-style-selector {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 8px;
}

.fence-style-option {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 8px 12px;
    background: rgba(0, 0, 0, 0.3);
    border: 2px solid rgba(79, 145, 255, 0.25);
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s ease;
    min-width: 80px;
}

.fence-style-option:hover {
    background: rgba(79, 145, 255, 0.15);
    border-color: rgba(79, 145, 255, 0.5);
}

.fence-style-option.selected {
    background: rgba(79, 145, 255, 0.25);
    border-color: rgba(79, 145, 255, 0.8);
    box-shadow: 0 0 8px rgba(79, 145, 255, 0.3);
}

.fence-style-option.disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.fence-style-icon {
    font-size: 20px;
    margin-bottom: 4px;
}

.fence-style-name {
    font-size: 11px;
    color: #ccc;
    text-align: center;
}

.fence-style-option.selected .fence-style-name {
    color: #fff;
}

.fence-style-cost {
    font-size: 10px;
    color: #f0c060;
    margin-top: 2px;
}

.fence-style-cost.free {
    color: #2ecc71;
}

.fence-style-cost.cannot-afford {
    color: #e74c3c;
}

.wood-type-selector {
    margin-top: 10px;
    display: none;
}

.wood-type-selector.visible {
    display: block;
}

.wood-type-selector label {
    display: block;
    font-size: 12px;
    color: #888;
    margin-bottom: 4px;
}

.wood-type-selector select {
    width: 100%;
    padding: 6px 10px;
    background: rgba(0, 0, 0, 0.4);
    border: 1px solid rgba(79, 145, 255, 0.3);
    border-radius: 4px;
    color: #fff;
    font-size: 13px;
    cursor: pointer;
}

.wood-type-selector select:focus {
    outline: none;
    border-color: rgba(79, 145, 255, 0.6);
}

/* Panel/Modal Resize Handle */
.panel-resize-handle,
.modal-resize-handle {
    position: absolute;
    bottom: 0;
    right: 0;
    width: 24px;
    height: 24px;
    cursor: url('/3d/img/cursors/cursor-resize.svg') 16 16, nwse-resize;
    z-index: 10;
    background: transparent;
}

.panel-resize-handle::before,
.modal-resize-handle::before {
    content: '';
    position: absolute;
    bottom: 4px;
    right: 4px;
    width: 12px;
    height: 12px;
    border-right: 3px solid rgba(52, 152, 219, 0.6);
    border-bottom: 3px solid rgba(52, 152, 219, 0.6);
    border-radius: 0 0 3px 0;
}

.panel-resize-handle:hover::before,
.modal-resize-handle:hover::before {
    border-color: rgba(52, 152, 219, 1);
}

.panel-resize-handle:active::before,
.modal-resize-handle:active::before {
    border-color: rgba(46, 204, 113, 1);
}

/* Resizable panel adjustments */
.inventory-panel.resizable,
.hotspots-panel.resizable,
.spellbook-panel.resizable,
.magic-schools-panel.resizable,
.paperdoll-panel.resizable {
    overflow: hidden;
}

/* Resizable modal content adjustments */
.object-info-modal-content.resizable {
    overflow: hidden;
    min-width: 280px;
    min-height: 200px;
}

.object-info-modal-content.resizable .object-info-body {
    overflow-y: auto;
    max-height: calc(100% - 100px);
}

/* Game Notifications */
.game-notification {
    position: fixed;
    top: 80px;
    left: 50%;
    transform: translateX(-50%);
    padding: 12px 24px;
    border-radius: 8px;
    color: #fff;
    font-size: 14px;
    z-index: 2000;
    animation: notification-slide 0.3s ease, notification-fade 0.5s ease 2.5s forwards;
    pointer-events: none;
}

.game-notification.info {
    background: rgba(52, 152, 219, 0.9);
    border: 1px solid rgba(52, 152, 219, 1);
}

.game-notification.success {
    background: rgba(46, 204, 113, 0.9);
    border: 1px solid rgba(46, 204, 113, 1);
}

.game-notification.warning {
    background: rgba(241, 196, 15, 0.9);
    border: 1px solid rgba(241, 196, 15, 1);
    color: #1a1a2e;
}

.game-notification.error {
    background: rgba(231, 76, 60, 0.9);
    border: 1px solid rgba(231, 76, 60, 1);
}

@keyframes notification-slide {
    from {
        opacity: 0;
        transform: translateX(-50%) translateY(-20px);
    }

    to {
        opacity: 1;
        transform: translateX(-50%) translateY(0);
    }
}

@keyframes notification-fade {
    to {
        opacity: 0;
    }
}

/* Canvas cursor overrides for object hover */
#game-canvas.cursor-harvest {
    cursor: url('/3d/img/cursors/cursor-harvest.svg') 8 8, pointer !important;
}

#game-canvas.cursor-aim {
    cursor: url('/3d/img/cursors/cursor-aim.svg') 16 16, crosshair !important;
}

#game-canvas.cursor-grab {
    cursor: url('/3d/img/cursors/cursor-grab.svg') 16 16, grab !important;
}

/* Harvest mode indicator */
#game-canvas.harvest-mode {
    outline: 2px solid rgba(230, 126, 34, 0.5);
    outline-offset: -2px;
}

/* Form elements in modals */
.form-group {
    margin-bottom: 16px;
}

.form-group label {
    display: block;
    color: #aaa;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 6px;
}

.form-group input[type="text"] {
    width: 100%;
    padding: 10px 12px;
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(52, 152, 219, 0.3);
    border-radius: 6px;
    color: #fff;
    font-size: 14px;
    transition: border-color 0.2s;
}

.form-group input[type="text"]:focus {
    outline: none;
    border-color: rgba(52, 152, 219, 0.8);
}

.form-group input[type="text"]::placeholder {
    color: #666;
}

.location-coords {
    display: flex;
    gap: 20px;
    color: #fff;
    font-family: monospace;
    font-size: 14px;
    padding: 10px;
    background: rgba(0, 0, 0, 0.2);
    border-radius: 6px;
}

.cancel-btn {
    background: rgba(231, 76, 60, 0.3) !important;
    border-color: rgba(231, 76, 60, 0.5) !important;
}

.cancel-btn:hover {
    background: rgba(231, 76, 60, 0.5) !important;
}

/* ========== Glass Panel Shared Styles ========== */
.inventory-panel,
.paperdoll-panel,
.hotspots-panel,
.spellbook-panel,
.magic-schools-panel,
.marketplace-panel,
.options-panel,
.object-info-panel,
.crafting-panel,
#world-map-panel {
    border: 1px solid rgba(79, 145, 255, 0.42);
    background-color: #111d33;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5), 0 0 0 1px rgba(255, 255, 255, 0.1);
    border-radius: 5px;
}

.panel-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 14px;
    background: rgba(0, 0, 0, 0.3);
    border-bottom: 1px solid rgba(79, 145, 255, 0.42);
    border-radius: 5px 5px 0 0;
    color: #a4caff;
    font-weight: bold;
    cursor: url('/3d/img/cursors/cursor-move.svg') 16 16, move;
    font-family: "DynaPuff", sans-serif;
    letter-spacing: 0.1px;
}

.panel-close-btn {
    background: #000;
    border: 1px solid rgba(79, 145, 255, 0.42);
    color: #f0f0f0;
    width: 28px;
    height: 28px;
    font-size: 18px;
    line-height: 1;
    cursor: url('/3d/img/cursors/cursor-pointer.svg') 10 4, pointer;
    transition: all 0.25s ease-in;
    display: flex;
    align-items: center;
    justify-content: center;
}

.panel-close-btn:hover {
    transform: translateY(1px) translateX(1px) rotate(3deg) scale(1.1);
    background-color: rgb(59 133 255 / 52%);
    border-color: rgba(79, 145, 255, 1);
}

/* ========== Inventory Panel ========== */
.inventory-panel {
    position: fixed;
    top: 100px;
    right: 20px;
    width: 220px;
    min-width: 160px;
    max-width: 90vw;
    z-index: 500;
    overflow: hidden;
}

.inventory-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(36px, 1fr));
    gap: 4px;
    padding: 10px;
}

.inventory-slot {
    aspect-ratio: 1;
    min-width: 36px;
    max-width: 60px;
    background: rgba(0, 0, 0, 0.4);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    transition: all 0.15s;
    overflow: hidden;
}

.inventory-slot.empty:hover {
    border-color: rgba(255, 255, 255, 0.2);
}

.inventory-slot.filled {
    cursor: url('/3d/img/cursors/cursor-grab.svg') 10 10, grab;
}

.inventory-slot.filled:hover {
    border-color: rgba(52, 152, 219, 0.8);
    background: rgba(52, 152, 219, 0.2);
}

.inventory-slot.filled.equippable {
    border-color: rgba(46, 204, 113, 0.4);
}

.inventory-slot.filled.equippable:hover {
    border-color: rgba(46, 204, 113, 0.8);
    background: rgba(46, 204, 113, 0.2);
}

.inventory-slot.dragging {
    opacity: 0.5;
    cursor: url('/3d/img/cursors/cursor-grab.svg') 10 10, grabbing;
}

.inventory-slot.drop-target,
.inventory-slot.drag-over {
    background: rgba(52, 152, 219, 0.3) !important;
    border-color: rgba(52, 152, 219, 0.8) !important;
    box-shadow: 0 0 8px rgba(52, 152, 219, 0.5);
}

/* Drag ghost that follows cursor */
.inventory-drag-ghost {
    position: fixed;
    z-index: 10000;
    pointer-events: none;
    background: rgba(26, 26, 46, 0.95);
    border: 1px solid rgba(52, 152, 219, 0.8);
    border-radius: 6px;
    padding: 6px 10px;
    font-size: 12px;
    color: #fff;
    white-space: nowrap;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
}

.drag-ghost-name {
    display: block;
}

/* Drop target highlighting for paperdoll slots */
.paperdoll-slot.drop-target,
.paperdoll-hand-slot.drop-target,
.paperdoll-slot.drag-over,
.paperdoll-hand-slot.drag-over {
    background: rgba(46, 204, 113, 0.4) !important;
    border-color: rgba(46, 204, 113, 0.8) !important;
    animation: pulse-drop 0.5s infinite alternate;
}

@keyframes pulse-drop {
    from {
        box-shadow: 0 0 5px rgba(46, 204, 113, 0.5);
    }

    to {
        box-shadow: 0 0 15px rgba(46, 204, 113, 0.8);
    }
}

.item-icon {
    font-size: 14px;
    font-weight: bold;
    color: #fff;
    text-shadow: 1px 1px 1px rgba(0, 0, 0, 0.5);
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.item-preview {
    width: 100%;
    height: 100%;
    border-radius: 4px;
    image-rendering: pixelated;
}

/* Recipe selection */
.recipe-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.recipe-item {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 6px;
    padding: 10px;
    cursor: pointer;
    transition: all 0.2s;
}

.recipe-item:hover:not(.disabled) {
    background: rgba(52, 152, 219, 0.2);
    border-color: rgba(52, 152, 219, 0.5);
}

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

.recipe-name {
    font-weight: bold;
    color: #fff;
    margin-bottom: 4px;
}

.recipe-details {
    font-size: 12px;
    color: #aaa;
}

.recipe-warning {
    font-size: 11px;
    color: #e74c3c;
    margin-top: 4px;
}

/* ========== Crafting Panel ========== */
.crafting-panel {
    position: fixed;
    top: 150px;
    left: 50%;
    transform: translateX(-50%);
    width: 400px;
    max-width: 90vw;
    max-height: 80vh;
    z-index: 600;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.crafting-panel .panel-content {
    overflow-y: auto;
    padding: 12px;
    flex: 1;
}

.crafting-tabs {
    display: flex;
    gap: 4px;
    padding: 8px 12px;
    border-bottom: 1px solid rgba(79, 145, 255, 0.2);
    background: rgba(0, 0, 0, 0.2);
}

.crafting-tab {
    padding: 6px 12px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 4px;
    color: #aaa;
    font-size: 12px;
    cursor: pointer;
    transition: all 0.2s;
}

.crafting-tab:hover {
    background: rgba(79, 145, 255, 0.2);
    border-color: rgba(79, 145, 255, 0.4);
}

.crafting-tab.active {
    background: rgba(79, 145, 255, 0.3);
    border-color: rgba(79, 145, 255, 0.6);
    color: #fff;
}

.crafting-recipe-card {
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    padding: 12px;
    margin-bottom: 10px;
    transition: all 0.2s;
}

.crafting-recipe-card:hover {
    border-color: rgba(79, 145, 255, 0.4);
    background: rgba(79, 145, 255, 0.1);
}

.crafting-recipe-card.can-craft {
    border-color: rgba(46, 204, 113, 0.4);
}

.crafting-recipe-card.can-craft:hover {
    border-color: rgba(46, 204, 113, 0.6);
    background: rgba(46, 204, 113, 0.1);
}

.crafting-recipe-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 8px;
}

.crafting-recipe-icon {
    font-size: 24px;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.4);
    border-radius: 6px;
}

.crafting-recipe-title {
    flex: 1;
}

.crafting-recipe-name {
    font-weight: bold;
    color: #fff;
    font-size: 14px;
}

.crafting-recipe-category {
    font-size: 11px;
    color: #888;
    text-transform: capitalize;
}

.crafting-recipe-inputs {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: 8px;
}

.crafting-input-tag {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 4px 8px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 4px;
    font-size: 11px;
}

.crafting-input-tag.have-enough {
    border-color: rgba(46, 204, 113, 0.4);
    color: #2ecc71;
}

.crafting-input-tag.need-more {
    border-color: rgba(231, 76, 60, 0.4);
    color: #e74c3c;
}

.crafting-input-weight {
    font-weight: bold;
}

.crafting-recipe-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.crafting-time {
    font-size: 11px;
    color: #888;
}

.craft-btn {
    padding: 6px 16px;
    background: rgba(46, 204, 113, 0.3);
    border: 1px solid rgba(46, 204, 113, 0.5);
    border-radius: 4px;
    color: #2ecc71;
    font-size: 12px;
    cursor: pointer;
    transition: all 0.2s;
}

.craft-btn:hover:not(:disabled) {
    background: rgba(46, 204, 113, 0.5);
    border-color: rgba(46, 204, 113, 0.8);
}

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

/* Active crafting section */
.crafting-active-section {
    margin-bottom: 16px;
    padding-bottom: 12px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.crafting-active-title {
    font-size: 12px;
    color: #888;
    margin-bottom: 8px;
}

.crafting-progress-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px;
    background: rgba(0, 0, 0, 0.3);
    border-radius: 6px;
    margin-bottom: 6px;
}

.crafting-progress-icon {
    font-size: 18px;
}

.crafting-progress-info {
    flex: 1;
}

.crafting-progress-name {
    font-size: 13px;
    color: #fff;
}

.crafting-progress-bar {
    height: 4px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 2px;
    overflow: hidden;
    margin-top: 4px;
}

.crafting-progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #3498db, #2ecc71);
    border-radius: 2px;
    transition: width 0.3s;
}

.claim-btn {
    padding: 4px 12px;
    background: rgba(241, 196, 15, 0.3);
    border: 1px solid rgba(241, 196, 15, 0.5);
    border-radius: 4px;
    color: #f1c40f;
    font-size: 11px;
    cursor: pointer;
    transition: all 0.2s;
}

.claim-btn:hover {
    background: rgba(241, 196, 15, 0.5);
}

/* Crafted items list */
.crafted-item-card {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px;
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 6px;
    margin-bottom: 8px;
    cursor: pointer;
    transition: all 0.2s;
}

.crafted-item-card:hover {
    border-color: rgba(79, 145, 255, 0.4);
    background: rgba(79, 145, 255, 0.1);
}

.crafted-item-card.equipped {
    border-color: rgba(46, 204, 113, 0.4);
}

.crafted-item-icon {
    font-size: 20px;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.4);
    border-radius: 4px;
}

.crafted-item-info {
    flex: 1;
}

.crafted-item-name {
    font-size: 13px;
    color: #fff;
    font-weight: bold;
}

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

.crafted-item-stats {
    font-size: 11px;
    color: #3498db;
}

.equipped-badge {
    font-size: 10px;
    padding: 2px 6px;
    background: rgba(46, 204, 113, 0.3);
    border-radius: 3px;
    color: #2ecc71;
}

.item-count {
    position: absolute;
    bottom: 2px;
    right: 2px;
    font-size: 10px;
    color: #fff;
    background: rgba(0, 0, 0, 0.7);
    padding: 1px 4px;
    border-radius: 3px;
    font-weight: bold;
}

/* Weight display for commodities */
.item-count.item-weight {
    font-size: 8px;
    right: 1px;
    bottom: 1px;
    padding: 1px 3px;
}

/* ========== Hotspots Panel ========== */
.hotspots-panel {
    position: fixed;
    top: 100px;
    left: 20px;
    width: 280px;
    max-height: 400px;
    z-index: 500;
    overflow: hidden;
}

.hotspots-toolbar {
    padding: 8px;
    border-bottom: 1px solid rgba(79, 145, 255, 0.42);
}

.hotspot-add-btn {
    width: 100%;
    padding: 8px 12px;
    background: rgba(100, 169, 255, 0.17);
    border: 1px solid rgba(79, 145, 255, 0.42);
    color: #a4caff;
    border-radius: 0;
    font-size: 13px;
    font-weight: bold;
    cursor: url('/3d/img/cursors/cursor-pointer.svg') 10 4, pointer;
    transition: all 0.2s linear;
}

.hotspot-add-btn:hover {
    transform: translateY(1px) translateX(1px) rotate(1deg);
    background-color: rgb(59 133 255 / 52%);
    border-color: #4f91ff;
}

.hotspots-list {
    max-height: 300px;
    overflow-y: auto;
    padding: 8px;
}

.hotspots-empty {
    color: #888;
    text-align: center;
    padding: 20px;
    font-size: 13px;
}

.hotspot-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 10px;
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(79, 145, 255, 0.2);
    border-radius: 0;
    margin-bottom: 6px;
    transition: all 0.15s linear;
}

.hotspot-item:hover {
    background: rgba(100, 169, 255, 0.17);
    border-color: rgba(79, 145, 255, 0.42);
}

.hotspot-item.land-hotspot {
    background: rgba(231, 76, 60, 0.15);
    border: 1px solid rgba(231, 76, 60, 0.3);
}

.hotspot-item.land-hotspot:hover {
    background: rgba(231, 76, 60, 0.25);
}

.hotspot-item.land-hotspot .hotspot-name {
    color: #e74c3c;
}

.hotspots-section-label {
    font-size: 11px;
    color: #888;
    text-transform: uppercase;
    padding: 8px 4px 4px;
    letter-spacing: 1px;
}

.hotspot-info {
    display: flex;
    align-items: center;
    gap: 8px;
    flex: 1;
    min-width: 0;
}

.hotspot-icon {
    font-size: 16px;
}

.hotspot-name {
    color: #fff;
    font-size: 13px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.hotspot-coords {
    color: #888;
    font-size: 11px;
    font-family: monospace;
}

.hotspot-actions {
    display: flex;
    gap: 4px;
}

.hotspot-walk-btn,
.hotspot-land-walk-btn,
.hotspot-tp-btn,
.hotspot-land-tp-btn,
.hotspot-del-btn {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    font-size: 11px;
    font-weight: bold;
    color: #fff;
    padding: 4px 8px;
    cursor: url('/3d/img/cursors/cursor-pointer.svg') 10 4, pointer;
    transition: all 0.2s;
    border-radius: 4px;
}

.hotspot-walk-btn,
.hotspot-land-walk-btn {
    color: #3498db;
}

.hotspot-tp-btn,
.hotspot-land-tp-btn {
    color: #9b59b6;
}

.hotspot-del-btn {
    color: #e74c3c;
}

.hotspot-walk-btn:hover,
.hotspot-land-walk-btn:hover {
    background: rgba(52, 152, 219, 0.3);
    border-color: #3498db;
}

.hotspot-tp-btn:hover,
.hotspot-land-tp-btn:hover {
    background: rgba(155, 89, 182, 0.3);
    border-color: #9b59b6;
}

.hotspot-del-btn:hover {
    background: rgba(231, 76, 60, 0.3);
    border-color: #e74c3c;
}

/* Context menu header */
.context-menu-header {
    padding: 8px 16px;
    color: #3498db;
    font-weight: bold;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    font-size: 13px;
}

/* ========== Paperdoll / Character Panel ========== */
.paperdoll-panel {
    position: fixed;
    top: 100px;
    left: 20px;
    width: 220px;
    z-index: 100;
    display: none;
}

.paperdoll-panel.visible {
    display: block;
}

.paperdoll-header {
    padding: 12px 16px;
    background: rgba(0, 0, 0, 0.3);
    border-bottom: 1px solid rgba(79, 145, 255, 0.42);
    border-radius: 5px 5px 0 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.paperdoll-header h3 {
    margin: 0;
    font-size: 14px;
    color: #a4caff;
    font-family: "DynaPuff", sans-serif;
}

.paperdoll-close {
    background: #000;
    border: 1px solid rgba(79, 145, 255, 0.42);
    color: #f0f0f0;
    font-size: 18px;
    cursor: url('/3d/img/cursors/cursor-pointer.svg') 10 4, pointer;
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.25s ease-in;
}

.paperdoll-close:hover {
    transform: translateY(1px) translateX(1px) rotate(3deg) scale(1.1);
    background-color: rgb(59 133 255 / 52%);
    border-color: rgba(79, 145, 255, 1);
}

.paperdoll-body {
    padding: 16px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
}

/* Character 3D preview area */
.paperdoll-character {
    position: relative;
    width: 180px;
    height: 200px;
    display: flex;
    justify-content: center;
    align-items: center;
}

/* Character 3D canvas */
#paperdoll-canvas {
    width: 100px;
    height: 160px;
    background: rgba(0, 0, 0, 0.3);
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    cursor: grab;
}

#paperdoll-canvas:active {
    cursor: grabbing;
}

/* Equipment slots positioned around the character */
.paperdoll-slots {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
}

.paperdoll-slots .paperdoll-slot {
    pointer-events: auto;
}

.paperdoll-slot {
    width: 40px;
    height: 40px;
    background: rgba(0, 0, 0, 0.4);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 6px;
    position: absolute;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: url('/3d/img/cursors/cursor-pointer.svg') 10 4, pointer;
    transition: all 0.2s;
}

.paperdoll-slot:hover {
    border-color: rgba(52, 152, 219, 0.6);
    background: rgba(52, 152, 219, 0.1);
}

.paperdoll-slot.filled {
    border-color: rgba(46, 204, 113, 0.5);
    background: rgba(46, 204, 113, 0.1);
}

.paperdoll-slot.filled:hover {
    border-color: rgba(46, 204, 113, 0.8);
    background: rgba(46, 204, 113, 0.2);
}

.paperdoll-slot .slot-preview {
    width: 100%;
    height: 100%;
    border-radius: 4px;
    display: none;
}

.paperdoll-slot.filled .slot-preview {
    display: block;
}

.paperdoll-slot::before {
    content: '';
    position: absolute;
    inset: 0;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 4px;
    opacity: 0.5;
}

.paperdoll-slot.filled::before {
    display: none;
}

/* Slot positions - around 3D character (container: 180x200) */
.paperdoll-slot[data-slot="helmet"] {
    top: 5px;
    left: 50%;
    transform: translateX(-50%);
}

.paperdoll-slot[data-slot="chest"] {
    top: 55px;
    left: 50%;
    transform: translateX(-50%);
}

.paperdoll-slot[data-slot="off_hand"] {
    top: 75px;
    left: 5px;
}

.paperdoll-slot[data-slot="main_hand"] {
    top: 75px;
    right: 5px;
    left: auto;
}

.paperdoll-slot[data-slot="belt"] {
    top: 105px;
    left: 50%;
    transform: translateX(-50%);
}

.paperdoll-slot[data-slot="legs"] {
    top: 150px;
    left: 50%;
    transform: translateX(-50%);
}

.paperdoll-slot[data-slot="boots"] {
    bottom: 5px;
    left: 50%;
    transform: translateX(-50%);
}

/* Quick access button for paperdoll */
#btn-paperdoll {
    background: rgba(155, 89, 182, 0.3);
}

#btn-paperdoll:hover {
    background: rgba(155, 89, 182, 0.6);
}

/* Land claim preview */
.land-claim-preview {
    padding: 10px 0;
}

.land-claim-preview p {
    margin: 0 0 10px 0;
    color: #ccc;
}

.land-claim-preview strong {
    color: #fff;
}

/* Abandon button styling */
.object-action-btn.abandon-btn:hover {
    background: rgba(231, 76, 60, 0.5) !important;
}

/* Claim button styling */
.object-action-btn.claim-btn:hover {
    background: rgba(46, 204, 113, 0.5) !important;
}

/* ========== Marketplace Panel ========== */
.marketplace-panel {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 500px;
    max-width: 90vw;
    max-height: 80vh;
    z-index: 200;
    display: none;
    flex-direction: column;
}

.marketplace-panel.visible {
    display: flex;
}

.marketplace-header {
    padding: 12px 16px;
    background: rgba(0, 0, 0, 0.3);
    border-bottom: 1px solid rgba(79, 145, 255, 0.42);
    border-radius: 5px 5px 0 0;
    display: flex;
    align-items: center;
    gap: 12px;
}

.marketplace-header h3 {
    margin: 0;
    font-size: 16px;
    color: #a4caff;
    font-family: "DynaPuff", sans-serif;
    flex: 1;
}

.marketplace-tokens {
    display: flex;
    align-items: center;
    gap: 4px;
    background: rgba(241, 196, 15, 0.2);
    padding: 4px 10px;
    border: 1px solid rgba(241, 196, 15, 0.4);
    border-radius: 0;
    font-size: 14px;
    color: #f1c40f;
    font-weight: bold;
}

.marketplace-close {
    background: #000;
    border: 1px solid rgba(79, 145, 255, 0.42);
    color: #f0f0f0;
    font-size: 18px;
    cursor: url('/3d/img/cursors/cursor-pointer.svg') 10 4, pointer;
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.marketplace-close:hover {
    transform: translateY(1px) translateX(1px) rotate(3deg) scale(1.1);
    background-color: rgb(59 133 255 / 52%);
    border-color: rgba(79, 145, 255, 1);
}

.marketplace-tabs {
    display: flex;
    border-bottom: 1px solid rgba(79, 145, 255, 0.42);
}

.marketplace-tab {
    flex: 1;
    padding: 10px 16px;
    background: rgba(0, 0, 0, 0.2);
    border: none;
    border-right: 1px solid rgba(79, 145, 255, 0.2);
    color: #888;
    font-size: 13px;
    cursor: url('/3d/img/cursors/cursor-pointer.svg') 10 4, pointer;
    transition: all 0.2s linear;
    border-bottom: 2px solid transparent;
}

.marketplace-tab:last-child {
    border-right: none;
}

.marketplace-tab:hover {
    color: #f0f0f0;
    background: rgba(100, 169, 255, 0.17);
}

.marketplace-tab.active {
    color: #3498db;
    border-bottom-color: #3498db;
}

.marketplace-search {
    display: flex;
    gap: 8px;
    padding: 10px 12px;
    background: rgba(0, 0, 0, 0.2);
}

.marketplace-search input {
    flex: 1;
    padding: 8px 12px;
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 6px;
    color: #fff;
    font-size: 13px;
}

.marketplace-search input:focus {
    outline: none;
    border-color: rgba(52, 152, 219, 0.5);
}

.marketplace-search select {
    padding: 8px 12px;
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 6px;
    color: #fff;
    font-size: 13px;
    cursor: url('/3d/img/cursors/cursor-pointer.svg') 10 4, pointer;
}

.marketplace-body {
    flex: 1;
    overflow-y: auto;
    padding: 12px;
    max-height: 400px;
}

.marketplace-listings {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.marketplace-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 12px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 8px;
    transition: all 0.2s;
}

.marketplace-item:hover {
    background: rgba(52, 152, 219, 0.1);
    border-color: rgba(52, 152, 219, 0.3);
}

.marketplace-item-icon {
    width: 40px;
    height: 40px;
    background: rgba(0, 0, 0, 0.3);
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
}

.marketplace-item-info {
    flex: 1;
    min-width: 0;
}

.marketplace-item-name {
    font-size: 14px;
    color: #fff;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.marketplace-item-seller {
    font-size: 11px;
    color: #888;
}

.marketplace-item-quantity {
    font-size: 11px;
    color: #aaa;
}

.marketplace-item-price {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 14px;
    color: #f1c40f;
    font-weight: bold;
}

.marketplace-item-price.free {
    color: #2ecc71;
}

.marketplace-item-actions {
    display: flex;
    gap: 6px;
}

.marketplace-btn {
    padding: 6px 12px;
    border: none;
    border-radius: 4px;
    font-size: 12px;
    cursor: url('/3d/img/cursors/cursor-pointer.svg') 10 4, pointer;
    transition: all 0.2s;
}

.marketplace-btn.buy {
    background: rgba(46, 204, 113, 0.3);
    color: #2ecc71;
}

.marketplace-btn.buy:hover {
    background: rgba(46, 204, 113, 0.5);
}

.marketplace-btn.cancel {
    background: rgba(231, 76, 60, 0.3);
    color: #e74c3c;
}

.marketplace-btn.cancel:hover {
    background: rgba(231, 76, 60, 0.5);
}

.marketplace-empty {
    text-align: center;
    padding: 40px 20px;
    color: #666;
}

.marketplace-empty-icon {
    font-size: 48px;
    margin-bottom: 10px;
}

/* Marketplace quick access button */
#btn-marketplace {
    background: rgba(241, 196, 15, 0.3);
}

#btn-marketplace:hover {
    background: rgba(241, 196, 15, 0.6);
}

/* Sell modal styling */
.sell-modal-price {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 15px 0;
}

.sell-modal-price input {
    flex: 1;
    padding: 10px;
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 6px;
    color: #fff;
    font-size: 16px;
}

.sell-modal-price .token-label {
    color: #f1c40f;
    font-weight: bold;
}

/* ========== Spellbook Panel ========== */
.spellbook-panel {
    position: fixed;
    top: 100px;
    right: 300px;
    width: 340px;
    max-height: 500px;
    background: linear-gradient(135deg, rgba(26, 26, 46, 0.95) 0%, rgba(22, 33, 62, 0.95) 100%);
    border: 1px solid rgba(155, 89, 182, 0.5);
    border-radius: 10px;
    z-index: 500;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.5);
    overflow: hidden;
}

.spellbook-tabs {
    display: flex;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.spellbook-tab {
    flex: 1;
    padding: 10px 16px;
    background: none;
    border: none;
    color: #888;
    font-size: 13px;
    cursor: url('/3d/img/cursors/cursor-pointer.svg') 10 4, pointer;
    transition: all 0.2s;
    border-bottom: 2px solid transparent;
}

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

.spellbook-tab.active {
    color: #9b59b6;
    border-bottom-color: #9b59b6;
}

.spellbook-content {
    max-height: 400px;
    overflow-y: auto;
}

.spellbook-list {
    padding: 8px;
}

.spellbook-empty {
    color: #888;
    text-align: center;
    padding: 30px 20px;
    font-size: 13px;
}

/* Spell School Group */
.spell-school-group {
    margin-bottom: 12px;
}

.spell-school-header {
    padding: 6px 10px;
    background: rgba(0, 0, 0, 0.3);
    border-radius: 4px;
    margin-bottom: 6px;
    font-size: 12px;
    color: #fff;
    font-weight: bold;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-left: 3px solid #9b59b6;
}

/* Spell Item */
.spell-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 8px;
    margin-bottom: 6px;
    transition: all 0.2s;
}

.spell-item:hover {
    background: rgba(155, 89, 182, 0.1);
    border-color: rgba(155, 89, 182, 0.3);
}

.spell-item[draggable="true"] {
    cursor: grab;
}

.spell-item[draggable="true"]:active {
    cursor: grabbing;
}

.spell-item.dragging {
    opacity: 0.5;
    transform: scale(0.95);
}

.spell-icon {
    width: 40px;
    height: 40px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    border: 2px solid;
    flex-shrink: 0;
}

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

.spell-name {
    font-size: 14px;
    font-weight: bold;
    color: #fff;
    margin-bottom: 2px;
}

.spell-desc {
    font-size: 11px;
    color: #aaa;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-bottom: 4px;
}

.spell-stats {
    display: flex;
    gap: 10px;
    font-size: 11px;
}

.spell-mana {
    color: #3498db;
}

.spell-damage {
    color: #e74c3c;
}

.spell-cooldown {
    color: #f1c40f;
}

.spell-learn-btn,
.spell-cast-btn {
    padding: 6px 12px;
    border: none;
    border-radius: 4px;
    font-size: 11px;
    font-weight: bold;
    cursor: url('/3d/img/cursors/cursor-pointer.svg') 10 4, pointer;
    transition: all 0.2s;
    flex-shrink: 0;
}

.spell-learn-btn {
    background: rgba(46, 204, 113, 0.3);
    color: #2ecc71;
}

.spell-learn-btn:hover {
    background: rgba(46, 204, 113, 0.5);
}

.spell-cast-btn {
    background: rgba(155, 89, 182, 0.3);
    color: #9b59b6;
}

.spell-cast-btn:hover {
    background: rgba(155, 89, 182, 0.5);
}

/* Quick access button for spellbook */
#btn-spellbook {
    background: rgba(155, 89, 182, 0.3);
}

#btn-spellbook:hover {
    background: rgba(155, 89, 182, 0.6);
}

/* ========== Magic Schools Panel ========== */
.magic-schools-panel {
    position: fixed;
    top: 100px;
    left: 320px;
    width: 280px;
    max-height: 450px;
    background: linear-gradient(135deg, rgba(26, 26, 46, 0.95) 0%, rgba(22, 33, 62, 0.95) 100%);
    border: 1px solid rgba(52, 152, 219, 0.5);
    border-radius: 10px;
    z-index: 500;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.5);
    overflow: hidden;
}

.magic-schools-content {
    max-height: 400px;
    overflow-y: auto;
}

.magic-schools-list {
    padding: 10px;
}

.magic-schools-empty {
    color: #888;
    text-align: center;
    padding: 30px 20px;
    font-size: 13px;
}

/* Magic School Item */
.magic-school-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 8px;
    margin-bottom: 8px;
    transition: all 0.2s;
}

.magic-school-item:hover {
    background: rgba(52, 152, 219, 0.1);
    border-color: rgba(52, 152, 219, 0.3);
}

.school-icon {
    width: 44px;
    height: 44px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 22px;
    border: 2px solid;
    flex-shrink: 0;
}

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

.school-name {
    font-size: 14px;
    font-weight: bold;
    color: #fff;
    margin-bottom: 2px;
}

.school-level {
    font-size: 12px;
    color: #3498db;
    font-weight: bold;
    margin-bottom: 6px;
}

.school-progress {
    height: 6px;
    background: rgba(0, 0, 0, 0.4);
    border-radius: 3px;
    overflow: hidden;
    margin-bottom: 4px;
}

.school-progress-bar {
    height: 100%;
    border-radius: 3px;
    transition: width 0.3s ease;
}

.school-exp {
    font-size: 10px;
    color: #888;
}

/* Quick access button for magic schools */
#btn-magic-schools {
    background: rgba(52, 152, 219, 0.3);
}

#btn-magic-schools:hover {
    background: rgba(52, 152, 219, 0.6);
}

/* Quick access button for map */
#btn-map {
    background: rgba(46, 204, 113, 0.3);
}

#btn-map:hover {
    background: rgba(46, 204, 113, 0.6);
}

/* ========== Minimap ========== */
#minimap {
    position: fixed;
    top: 10px;
    left: 10px;
    width: 170px;
    background: linear-gradient(135deg, rgba(26, 26, 46, 0.9) 0%, rgba(22, 33, 62, 0.9) 100%);
    border: 1px solid rgba(52, 152, 219, 0.4);
    border-radius: 8px;
    z-index: 100;
    overflow: hidden;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
    display: block;
}

#minimap.hidden {
    display: none;
}

.minimap-header {
    padding: 6px 10px;
    background: rgba(0, 0, 0, 0.3);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: url('/3d/img/cursors/cursor-move.svg') 12 12, move;
}

.minimap-close {
    background: none;
    border: none;
    color: #888;
    font-size: 16px;
    cursor: url('/3d/img/cursors/cursor-pointer.svg') 10 4, pointer;
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    line-height: 1;
}

.minimap-close:hover {
    color: #fff;
}

.minimap-title {
    font-size: 12px;
    color: #fff;
    font-weight: bold;
}

.minimap-canvas-container {
    position: relative;
    width: 150px;
    height: 150px;
    margin: 10px auto;
    background: rgba(0, 0, 0, 0.3);
    border-radius: 4px;
}

#minimap-canvas {
    display: block;
    border-radius: 4px;
}

.minimap-axis {
    position: absolute;
    font-size: 8px;
    color: #666;
    font-weight: bold;
    pointer-events: none;
}

/* Isometric axis labels at corners */
.minimap-axis-tr {
    top: 2px;
    right: 2px;
    color: #e74c3c;
}

.minimap-axis-bl {
    bottom: 2px;
    left: 2px;
    color: #e74c3c;
}

.minimap-axis-tl {
    top: 2px;
    left: 2px;
    color: #3498db;
}

.minimap-axis-br {
    bottom: 2px;
    right: 2px;
    color: #3498db;
}

.minimap-coords {
    padding: 6px 10px;
    background: rgba(0, 0, 0, 0.2);
    display: flex;
    justify-content: space-between;
    font-size: 10px;
    color: #aaa;
    font-family: monospace;
}

/* ========== World Map Modal ========== */
.world-map-panel {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 560px;
    max-width: 90vw;
    background: linear-gradient(135deg, rgba(26, 26, 46, 0.98) 0%, rgba(22, 33, 62, 0.98) 100%);
    border: 1px solid rgba(52, 152, 219, 0.4);
    border-radius: 12px;
    z-index: 200;
    display: none;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.6);
    overflow: hidden;
}

.world-map-panel.visible {
    display: block;
}

.world-map-toolbar {
    display: flex;
    gap: 6px;
    padding: 8px 12px;
    background: rgba(0, 0, 0, 0.2);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    align-items: center;
}

.map-zoom-btn {
    width: 28px;
    height: 28px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    background: rgba(0, 0, 0, 0.3);
    color: #fff;
    border-radius: 4px;
    font-size: 16px;
    cursor: url('/3d/img/cursors/cursor-pointer.svg') 10 4, pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.map-zoom-btn:hover {
    background: rgba(52, 152, 219, 0.3);
    border-color: rgba(52, 152, 219, 0.5);
}

.map-zoom-level {
    margin-left: auto;
    font-size: 12px;
    color: #888;
}

.world-map-container {
    position: relative;
    padding: 15px;
    display: flex;
    justify-content: center;
    background: rgba(0, 0, 0, 0.2);
}

#world-map-canvas {
    background: rgba(0, 0, 0, 0.3);
    border-radius: 6px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    cursor: crosshair;
    pointer-events: auto;
}

.map-axis {
    position: absolute;
    font-size: 11px;
    color: #666;
    font-weight: bold;
    pointer-events: none;
}

.map-axis-y-pos {
    top: 5px;
    left: 50%;
    transform: translateX(-50%);
}

.map-axis-y-neg {
    bottom: 5px;
    left: 50%;
    transform: translateX(-50%);
}

.map-axis-x-pos {
    right: 5px;
    top: 50%;
    transform: translateY(-50%);
}

.map-axis-x-neg {
    left: 5px;
    top: 50%;
    transform: translateY(-50%);
}

.world-map-legend {
    display: flex;
    gap: 16px;
    padding: 10px 15px;
    justify-content: center;
    flex-wrap: wrap;
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 11px;
    color: #aaa;
}

.legend-color {
    width: 12px;
    height: 12px;
    border-radius: 3px;
}

.world-map-coords {
    padding: 8px 15px;
    background: rgba(0, 0, 0, 0.3);
    text-align: center;
    font-size: 12px;
    color: #888;
    font-family: monospace;
}

/* ========== Options Panel ========== */
.options-panel {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 340px;
    max-width: 90vw;
    background: linear-gradient(135deg, rgba(26, 26, 46, 0.98) 0%, rgba(22, 33, 62, 0.98) 100%);
    border: 1px solid rgba(155, 89, 182, 0.4);
    border-radius: 12px;
    z-index: 600;
    display: none;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.6);
    overflow: hidden;
}

.options-panel.visible {
    display: block;
}

.options-body {
    padding: 16px;
}

.option-group {
    margin-bottom: 16px;
    padding-bottom: 16px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.option-group:last-child {
    margin-bottom: 0;
    padding-bottom: 0;
    border-bottom: none;
}

.option-label {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 13px;
    color: #fff;
    margin-bottom: 8px;
    cursor: url('/3d/img/cursors/cursor-pointer.svg') 10 4, pointer;
}

.option-value {
    font-weight: bold;
    color: #3498db;
    min-width: 30px;
    text-align: right;
}

.option-hint {
    font-size: 11px;
    color: #888;
    margin-top: 6px;
}

.option-section {
    margin-bottom: 8px;
    padding-bottom: 8px;
}

.option-section-title {
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: #9b59b6;
    font-weight: bold;
}

/* Range slider styling */
.options-body input[type="range"] {
    width: 100%;
    height: 6px;
    -webkit-appearance: none;
    appearance: none;
    background: rgba(0, 0, 0, 0.4);
    border-radius: 3px;
    outline: none;
    cursor: url('/3d/img/cursors/cursor-pointer.svg') 10 4, pointer;
}

.options-body input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 18px;
    height: 18px;
    background: #3498db;
    border-radius: 50%;
    cursor: url('/3d/img/cursors/cursor-grab.svg') 10 10, grab;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.3);
    transition: transform 0.2s;
}

.options-body input[type="range"]::-webkit-slider-thumb:hover {
    transform: scale(1.1);
}

.options-body input[type="range"]::-moz-range-thumb {
    width: 18px;
    height: 18px;
    background: #3498db;
    border-radius: 50%;
    cursor: url('/3d/img/cursors/cursor-grab.svg') 10 10, grab;
    border: none;
}

/* Checkbox styling */
.options-body input[type="checkbox"] {
    width: 18px;
    height: 18px;
    accent-color: #3498db;
    cursor: url('/3d/img/cursors/cursor-pointer.svg') 10 4, pointer;
}

/* Quick access button for options */
#btn-options {
    background: rgba(155, 89, 182, 0.3);
}

#btn-options:hover {
    background: rgba(155, 89, 182, 0.6);
}

/* ========== Isometric Minimap ========== */
/* Canvas rendering handles the isometric transform internally */

/* ========== PWA Install Modal ========== */
.pwa-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.8);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 10000;
    padding: 20px;
    animation: pwa-fade-in 0.3s ease;
}

@keyframes pwa-fade-in {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

.pwa-modal-content {
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
    border: 1px solid rgba(52, 152, 219, 0.5);
    border-radius: 16px;
    padding: 24px;
    max-width: 340px;
    width: 100%;
    position: relative;
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.6);
    animation: pwa-slide-up 0.3s ease;
}

@keyframes pwa-slide-up {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

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

.pwa-modal-close {
    position: absolute;
    top: 12px;
    right: 12px;
    background: none;
    border: none;
    color: #888;
    font-size: 24px;
    cursor: url('/3d/img/cursors/cursor-pointer.svg') 10 4, pointer;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: color 0.2s;
}

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

.pwa-modal h3 {
    margin: 0 0 16px 0;
    color: #fff;
    font-size: 18px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.pwa-modal h3::before {
    content: '📲';
    font-size: 24px;
}

.pwa-modal p {
    color: #aaa;
    font-size: 14px;
    line-height: 1.5;
    margin: 0 0 16px 0;
}

.pwa-steps {
    background: rgba(0, 0, 0, 0.3);
    border-radius: 10px;
    padding: 16px;
    margin-bottom: 16px;
}

.pwa-step {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    margin-bottom: 12px;
    color: #fff;
    font-size: 13px;
    line-height: 1.4;
}

.pwa-step:last-child {
    margin-bottom: 0;
}

.pwa-step-number {
    width: 24px;
    height: 24px;
    min-width: 24px;
    background: rgba(52, 152, 219, 0.3);
    border: 1px solid rgba(52, 152, 219, 0.5);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: bold;
    color: #3498db;
}

.pwa-step-text {
    padding-top: 2px;
}

.pwa-step-text strong {
    color: #3498db;
}

.pwa-dont-show {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 12px;
    color: #888;
    margin-bottom: 16px;
    cursor: url('/3d/img/cursors/cursor-pointer.svg') 10 4, pointer;
}

.pwa-dont-show input[type="checkbox"] {
    width: 16px;
    height: 16px;
    accent-color: #3498db;
    cursor: url('/3d/img/cursors/cursor-pointer.svg') 10 4, pointer;
}

.pwa-modal-btn {
    width: 100%;
    padding: 12px 20px;
    background: rgba(52, 152, 219, 0.3);
    border: 1px solid rgba(52, 152, 219, 0.5);
    color: #fff;
    border-radius: 8px;
    font-size: 14px;
    font-weight: bold;
    cursor: url('/3d/img/cursors/cursor-pointer.svg') 10 4, pointer;
    transition: all 0.2s;
}

.pwa-modal-btn:hover {
    background: rgba(52, 152, 219, 0.5);
    border-color: rgba(52, 152, 219, 0.8);
}

/* Mobile specific adjustments */
@media (max-width: 400px) {
    .pwa-modal-content {
        padding: 20px;
        max-width: 100%;
    }

    .pwa-modal h3 {
        font-size: 16px;
    }

    .pwa-step {
        font-size: 12px;
    }
}

/* ========== SPECTATOR MODE STYLES ========== */

/* Spectator count display (shown to players being watched) */
.spectator-count {
    position: fixed;
    top: 50px;
    right: 15px;
    background: rgba(26, 26, 46, 0.9);
    border: 1px solid rgba(155, 89, 182, 0.5);
    border-radius: 20px;
    padding: 6px 14px;
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 14px;
    color: #fff;
    cursor: pointer;
    transition: all 0.2s;
    z-index: 100;
}

.spectator-count:hover {
    background: rgba(155, 89, 182, 0.3);
    border-color: rgba(155, 89, 182, 0.8);
}

.spectator-count .spectator-icon {
    font-size: 16px;
}

.spectator-count.hidden {
    display: none;
}

/* Spectator info modal (shown when visiting @username) */
.spectator-info-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.7);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

.spectator-info-modal.hidden {
    display: none;
}

.spectator-info-content {
    background: rgba(26, 26, 46, 0.98);
    border: 1px solid rgba(52, 152, 219, 0.5);
    border-radius: 12px;
    padding: 20px 30px;
    max-width: 350px;
    width: 90%;
    text-align: center;
    position: relative;
}

.spectator-info-close {
    position: absolute;
    top: 10px;
    right: 12px;
    background: none;
    border: none;
    color: #888;
    font-size: 24px;
    cursor: pointer;
    transition: color 0.2s;
}

.spectator-info-close:hover {
    color: #fff;
}

.spectator-info-content h3 {
    margin: 0 0 15px 0;
    color: #fff;
    font-size: 18px;
}

.spectator-target-info {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    margin-bottom: 15px;
}

.spectator-target-name {
    font-size: 20px;
    font-weight: bold;
    color: #3498db;
}

.spectator-target-status {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
}

.spectator-target-status .status-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: #888;
}

.spectator-target-status .status-dot.online {
    background: #2ecc71;
    box-shadow: 0 0 8px rgba(46, 204, 113, 0.6);
}

.spectator-target-status .status-dot.offline {
    background: #95a5a6;
}

.spectator-target-status .status-text {
    color: #aaa;
}

.spectator-info-text {
    color: #ccc;
    font-size: 14px;
    margin-bottom: 20px;
}

.spectator-info-actions {
    display: flex;
    gap: 10px;
    justify-content: center;
}

.spectator-btn {
    padding: 10px 20px;
    background: rgba(52, 152, 219, 0.3);
    border: 1px solid rgba(52, 152, 219, 0.5);
    color: #fff;
    border-radius: 8px;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.2s;
}

.spectator-btn:hover {
    background: rgba(52, 152, 219, 0.5);
    border-color: rgba(52, 152, 219, 0.8);
}

/* Spectator list modal */
.spectator-list-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.7);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

.spectator-list-modal.hidden {
    display: none;
}

.spectator-list-content {
    background: rgba(26, 26, 46, 0.98);
    border: 1px solid rgba(155, 89, 182, 0.5);
    border-radius: 12px;
    min-width: 280px;
    max-width: 350px;
    width: 90%;
}

.spectator-list-body {
    padding: 15px;
    max-height: 300px;
    overflow-y: auto;
}

.spectator-list-empty {
    color: #888;
    text-align: center;
    font-size: 14px;
    margin: 0;
}

.spectator-list {
    list-style: none;
    margin: 0;
    padding: 0;
}

.spectator-list li {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.spectator-list li:last-child {
    border-bottom: none;
}

.spectator-list .spectator-name {
    color: #fff;
    font-weight: 500;
}

.spectator-list .spectator-since {
    color: #888;
    font-size: 12px;
}

/* Spectator mode notice bar */
.spectator-mode-bar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    background: rgba(155, 89, 182, 0.9);
    color: #fff;
    padding: 8px 15px;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 15px;
    font-size: 14px;
    z-index: 500;
}

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

.spectator-mode-bar span {
    flex-grow: 1;
    text-align: center;
}

.spectator-mode-bar button {
    padding: 5px 12px;
    background: rgba(255, 255, 255, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.4);
    color: #fff;
    border-radius: 4px;
    font-size: 12px;
    cursor: pointer;
}

.spectator-mode-bar button:hover {
    background: rgba(255, 255, 255, 0.3);
}

/* Mobile adjustments for spectator UI */
@media (max-width: 600px) {
    .spectator-count {
        top: 10px;
        right: 10px;
        padding: 5px 10px;
        font-size: 12px;
    }

    .spectator-info-content {
        padding: 15px 20px;
    }

    .spectator-target-name {
        font-size: 18px;
    }
}

/* ==================== Dark Mode Overlay ==================== */
.dark-mode-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 5;
    /* Above canvas but below UI */
    opacity: 0;
    transition: opacity 0.5s ease;
    /* Warm orange/brown gradient overlay for evening atmosphere */
    background: linear-gradient(to bottom,
            rgba(40, 20, 5, 0.3) 0%,
            rgba(60, 30, 10, 0.25) 50%,
            rgba(30, 15, 5, 0.35) 100%);
    mix-blend-mode: multiply;
}

.dark-mode-overlay.active {
    opacity: 1;
}

/* ==================== Skills Panel ==================== */
.skills-panel {
    position: fixed;
    top: 100px;
    left: 250px;
    width: 280px;
    max-height: 400px;
    z-index: 100;
    display: none;
    background: rgba(5, 15, 30, 0.95);
    border: 1px solid rgba(79, 145, 255, 0.42);
    border-radius: 5px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.5);
}

.skills-panel.visible {
    display: block;
}

.skills-header {
    padding: 12px 16px;
    background: rgba(0, 0, 0, 0.3);
    border-bottom: 1px solid rgba(79, 145, 255, 0.42);
    border-radius: 5px 5px 0 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.skills-header h3 {
    margin: 0;
    font-size: 14px;
    color: #a4caff;
    font-family: "DynaPuff", sans-serif;
}

.skills-close {
    background: #000;
    border: 1px solid rgba(79, 145, 255, 0.42);
    color: #f0f0f0;
    font-size: 18px;
    cursor: url('/3d/img/cursors/cursor-pointer.svg') 10 4, pointer;
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.25s ease-in;
}

.skills-close:hover {
    transform: translateY(1px) translateX(1px) rotate(3deg) scale(1.1);
}

.skills-body {
    padding: 12px;
    max-height: 320px;
    overflow-y: auto;
}

.skills-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.skill-item {
    display: flex;
    flex-direction: column;
    padding: 10px 12px;
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(79, 145, 255, 0.2);
    border-radius: 4px;
    transition: all 0.2s;
}

.skill-item:hover {
    border-color: rgba(79, 145, 255, 0.5);
    background: rgba(0, 0, 0, 0.4);
}

.skill-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.skill-name {
    color: #a4caff;
    font-size: 13px;
    font-weight: 500;
}

.skill-level {
    color: #7cb3ff;
    font-size: 14px;
    font-weight: bold;
}

.skill-progress {
    margin-top: 6px;
    height: 4px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 2px;
    overflow: hidden;
}

.skill-progress-bar {
    height: 100%;
    background: linear-gradient(90deg, #4f91ff, #7cb3ff);
    transition: width 0.3s ease;
}

.skill-chance {
    font-size: 11px;
    color: rgba(255, 255, 255, 0.5);
}

.skill-info-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 4px;
}

.skill-tool-req {
    font-size: 10px;
    color: #FFA726;
    background: rgba(255, 167, 38, 0.15);
    padding: 2px 6px;
    border-radius: 3px;
}

.skill-icon {
    font-size: 18px;
    margin-right: 8px;
    filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.3));
}

/* Multi-skill penalty header */
.skills-penalty-header {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 12px;
    margin-bottom: 8px;
    background: rgba(255, 152, 0, 0.15);
    border: 1px solid rgba(255, 152, 0, 0.3);
    border-radius: 4px;
}

.skills-penalty-header .penalty-icon {
    font-size: 14px;
}

.skills-penalty-header .penalty-text {
    color: #FFA726;
    font-size: 12px;
    font-weight: 500;
}

.skills-penalty-header .penalty-detail {
    color: rgba(255, 167, 38, 0.7);
    font-size: 11px;
    margin-left: auto;
}

/* Base chance display (when penalty active) */
.skill-chance .base-chance {
    color: rgba(255, 255, 255, 0.35);
    font-size: 10px;
}

/* Draggable skill items */
.skill-item[draggable="true"] {
    cursor: grab;
    user-select: none;
}

.skill-item[draggable="true"]:active {
    cursor: grabbing;
}

.skill-item.dragging {
    opacity: 0.5;
    transform: scale(0.98);
}

.skills-empty {
    text-align: center;
    padding: 20px;
    color: rgba(255, 255, 255, 0.5);
    font-size: 13px;
}

/* Action bar skill slots */
.action-slot.skill-action {
    border-color: rgba(76, 175, 80, 0.5);
}

.action-slot.skill-action:hover {
    border-color: rgba(76, 175, 80, 0.8);
    box-shadow: 0 0 8px rgba(76, 175, 80, 0.4);
}

.action-slot.spell-action {
    border-color: rgba(156, 39, 176, 0.5);
}

.action-slot.spell-action:hover {
    border-color: rgba(156, 39, 176, 0.8);
    box-shadow: 0 0 8px rgba(156, 39, 176, 0.4);
}

#bottom-game-ui {
    display: flex;
    flex-direction: column;
    position: fixed;
    left: 0;
    right: 0;
    bottom: 12px;
    gap: 6px;
    padding: 0 12px;
    justify-content: center;
    align-items: center;
    z-index: 100;
}

/* ========== System Toast Animations ========== */
@keyframes toastFadeIn {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

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