/* 3D Game Styles */



/* ========== Custom Cursors ========== */
html,
body {
    width: 100%;
    height: 100%;
    overflow: hidden;
    background: #000;
    cursor: url('/3d/img/cursors/cursor-default.svg') 0 0, auto;
    font-size: 16px;
    letter-spacing: 0;
    font-family: "Noto Sans", monospace;
    font-family: "ibmplexmono", "Noto Sans", monospace;
    /* Disable pull-to-refresh in PWA mode */
    overscroll-behavior: none;
    -webkit-overflow-scrolling: touch;
    /* Prevent iOS text selection and callout on long-press */
    -webkit-touch-callout: none;
    -webkit-user-select: none;
    user-select: none;
    -webkit-tap-highlight-color: transparent;
}

button {
    font-family: "Noto Sans", monospace;
    font-family: "ibmplexmono", "Noto Sans", monospace;
}

/* 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;
    -webkit-user-select: text;
    user-select: text;
}

/* 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;
    touch-action: none;
    /* Prevent browser gestures like pull-to-refresh */
}

/* 2D starry background - disabled, using 3D starfield in Three.js scene instead */
#game-starry-background {
    display: none;
    /* Hidden - 3D starfield provides proper rotation with camera */
}

/* Game canvas uses directional cursors for character movement */
/* Note: Resolution and size controlled by Three.js setSize() */
#game-canvas {
    display: block;
    cursor: url('/3d/img/cursors/cursor-dir-n.svg') 16 4, crosshair;
    pointer-events: auto;
    position: absolute;
    top: 0;
    left: 0;
    z-index: 1;
    background: #000;
    /* Black - 3D starfield renders in scene */
}

/* 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: inherit;
    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;
    font-size: 16px;
}

#alpha-notice {
    position: absolute;
    top: 2px;
    left: 15px;
    right: 15px;
    color: #f1c40f;
}

#dev-notice-modal .dev-notice-socials {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 14px;
    margin-top: 4px;
}

#dev-notice-modal .dev-notice-socials a {
    display: flex;
    align-items: center;
    transition: color 0.2s;
}

#dev-notice-modal .dev-notice-socials a:hover {
    color: #fff;
}

#dev-notice-modal .dev-notice-socials svg {
    width: 24px;
    height: 24px;
}

#player-position-label {
    position: fixed;
    bottom: 42px;
    left: 12px;
    font-size: 14px;
    font-family: "Noto Sans", sans-serif;
    color: #a4caff;
    background: rgb(0 0 0 / 77%);
    border-radius: 8px;
    padding: 4px 10px;
    z-index: 100;
    pointer-events: none;
}

#fps-counter {
    position: absolute;
    top: 240px;
    left: 12px;
    background: rgba(0, 0, 0, 0.6);
    color: #f1c40f;
    padding: 8px 12px;
    border-radius: 4px;
    font-size: 12px;
    font-family: monospace;
    z-index: 10;
    min-width: 120px;
}

#fps-counter #fps-value {
    font-weight: bold;
    margin-bottom: 4px;
}

#fps-counter #perf-stats {
    display: flex;
    flex-direction: column;
    gap: 2px;
    font-size: 10px;
    color: inherit;
    border-top: 1px solid rgba(255, 255, 255, 0.2);
    padding-top: 4px;
    margin-top: 4px;
}

#fps-counter #perf-stats span {
    display: block;
}

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

/* Loading Screen */
#loading-screen {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: transparent;
    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: inherit;
    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: #a4caff;
}

/* 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: translate(-50%, -50%);
}

/* Guest/Spectator mode */
#player-name.guest {
    color: inherit;
    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;
}

/* #quick-access-bar {
    display: none;
} */

#action-bar-custom .action-slot,
#quick-access-bar .quick-btn {
    aspect-ratio: 1;
    width: 100%;
    box-sizing: border-box;
    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;
}

#action-bar-custom .action-slot,
#quick-access-bar .quick-btn {
    box-shadow: 1px 1px 0px rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(0, 0, 0, 0.16);
    border-bottom: none;
    border-radius: 8px;
    background: rgba(100, 169, 255, 0);
    background: rgba(0, 0, 0, 0.25);
}

#action-button:hover,
#btn-menu:hover,
.paperdoll-slot:hover,
#chat-input:hover,
#chat-send-btn:hover,
#action-bar-custom .action-slot:hover,
#quick-access-bar .quick-btn:hover,
#zone-name-display:hover,
#cave-name-display:hover {
    transform: translateY(1px) translateX(1px) rotate(1deg);
    background-color: rgb(59 133 255 / 25%);
    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 .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 .slot-key {
    font-size: 12px;
    top: 3px;
    right: 4px;
    /* color: #f0f0f0; */
}

#action-bar-custom .action-slot:hover .slot-key {
    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;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: filter 0.2s ease, transform 0.2s ease;
}

#quick-access-bar .quick-btn:hover .quick-icon {
    filter: brightness(1.3) drop-shadow(0 0 4px rgba(79, 145, 255, 0.6));
    transform: scale(1.1);
}

#action-bar-custom .action-slot .action-icon-img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    border-radius: 6px;
}

/* 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;
}

/* Circular sweep cooldown (iOS-style pie chart) */
#action-bar-custom .action-slot .cooldown-sweep {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    border-radius: 7px;
    pointer-events: none;
    z-index: 10;
    overflow: hidden;
    background: conic-gradient(from 0deg,
            rgba(0, 0, 0, 0.6) var(--cooldown-angle, 360deg),
            transparent var(--cooldown-angle, 360deg));
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Cooldown text (shows remaining seconds) */
#action-bar-custom .action-slot .cooldown-sweep .cooldown-text {
    font-size: 14px;
    font-weight: bold;
    color: #fff;
    text-shadow: 0 0 4px rgba(0, 0, 0, 0.8), 1px 1px 2px #000;
}

/* Responsive bottom bars: 6 on mobile, progressively more on wider screens */
/* quick-access-bar has btn-menu as 1st child (+1 offset vs action-bar) */
#action-bar-custom .action-slot:nth-child(n+7),
#quick-access-bar .quick-btn:nth-child(n+8) {
    display: none;
}

@media (min-width: 600px) {
    #action-bar-custom .action-slot:nth-child(n+7),
    #quick-access-bar .quick-btn:nth-child(n+8) {
        display: flex;
    }
    #action-bar-custom .action-slot:nth-child(n+9),
    #quick-access-bar .quick-btn:nth-child(n+10) {
        display: none;
    }
}

@media (min-width: 800px) {
    #action-bar-custom .action-slot:nth-child(n+9),
    #quick-access-bar .quick-btn:nth-child(n+10) {
        display: flex;
    }
    #action-bar-custom .action-slot:nth-child(n+11),
    #quick-access-bar .quick-btn:nth-child(n+12) {
        display: none;
    }
}

@media (min-width: 1100px) {
    #action-bar-custom .action-slot:nth-child(n+11),
    #quick-access-bar .quick-btn:nth-child(n+12) {
        display: flex;
    }
    #action-bar-custom .action-slot:nth-child(n+13),
    #quick-access-bar .quick-btn:nth-child(n+14) {
        display: none;
    }
}

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

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

#chat-input-wrap.chat-hidden {
    display: none !important;
}

#chat-input {
    flex: 1;
    padding: 10px 16px;
    margin: 0;
    font-size: 14px;
    outline: none;
    cursor: url(/3d/img/cursors/cursor-text.svg) 4 10, text;
    /* border: 1px solid rgba(0, 0, 0, 0.16); */
    background: rgba(0, 0, 0, 0.25);
    border: none;
    border-radius: 8px;
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s linear;
    position: relative;
    box-shadow: 1px 1px 0px 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-send-btn {
    padding: 10px 16px;
    /* border: 1px solid rgba(0, 0, 0, 0.16); */
    border-radius: 8px;
    background: rgba(0, 0, 0, 0.25);
    color: #a4caff;
    font-size: 14px;
    cursor: url('/3d/img/cursors/cursor-pointer.svg') 10 4, pointer;
    transition: all 0.2s linear;
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s linear;
    position: relative;
    box-shadow: 1px 1px 0px rgba(0, 0, 0, 0.3);
    height: 40px;
}

/* 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: translate(-50%, -100%);
    animation: chatBubbleFadeIn 0.3s ease-out;
    box-shadow: 1px 1px 0px 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;
}

.entity-nameplate,
.health-bar-container,

#chat-send-btn,
#chat-input,
#action-bar-custom .action-slot,
#quick-access-bar .quick-btn,
.glass-panel {
    background: rgba(100, 169, 255, 0.25);
    border: 1px solid rgba(79, 145, 255, 0.5);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);

    background: color(srgb 0 0 0 / 0.25);
    background: transparent;
    border: none;
    /* box-shadow:none; */
    box-shadow: 2px 2px 0 #0000004f, 1px 1px 0 #ffffff4f inset;
}

.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: translate(-50%, calc(-100% + 10px));
    }

    to {
        opacity: 1;
        transform: translate(-50%, -100%);
    }
}

@keyframes chatBubbleFadeOut {
    from {
        opacity: 1;
        transform: translate(-50%, -100%);
    }

    to {
        opacity: 0;
        transform: translate(-50%, calc(-100% - 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: translate(-50%, -100%);
    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: translate(-50%, calc(-100% + 20px)) scale(0.8);
    }

    15% {
        opacity: 1;
        transform: translate(-50%, -100%) scale(1);
    }

    70% {
        opacity: 1;
        transform: translate(-50%, calc(-100% - 40px)) scale(1);
    }

    100% {
        opacity: 0;
        transform: translate(-50%, calc(-100% - 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;
    }
}

/* Extraction Progress Bar */
.extraction-progress-container {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(20, 20, 30, 0.95);
    border: 2px solid rgba(74, 144, 217, 0.6);
    border-radius: 8px;
    padding: 16px 24px;
    min-width: 280px;
    z-index: 1100;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.5), 0 0 20px rgba(74, 144, 217, 0.2);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    animation: extractionFadeIn 0.2s ease-out;
}

.extraction-progress-container.complete {
    animation: extractionFadeOut 0.3s ease-out forwards;
}

@keyframes extractionFadeIn {
    from {
        opacity: 0;
        transform: translate(-50%, -50%) scale(0.9);
    }
    to {
        opacity: 1;
        transform: translate(-50%, -50%) scale(1);
    }
}

@keyframes extractionFadeOut {
    from {
        opacity: 1;
        transform: translate(-50%, -50%) scale(1);
    }
    to {
        opacity: 0;
        transform: translate(-50%, -50%) scale(0.9);
    }
}

.extraction-progress-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}

.extraction-title {
    color: #a4caff;
    font-size: 14px;
    font-weight: 600;
}

.extraction-skill {
    font-size: 12px;
    font-weight: 500;
}

.extraction-progress-bar-container {
    background: rgba(0, 0, 0, 0.4);
    border-radius: 4px;
    height: 12px;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.extraction-progress-bar {
    height: 100%;
    width: 0%;
    background: linear-gradient(90deg, #4a90d9, #67b8f7);
    border-radius: 3px;
    transition: width 0.1s linear;
    box-shadow: 0 0 8px rgba(74, 144, 217, 0.5);
}

.extraction-progress-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 8px;
}

.extraction-time {
    color: #9ca3af;
    font-size: 12px;
    font-family: monospace;
}

.extraction-chance {
    color: #4ade80;
    font-size: 11px;
}

/* Mobile adjustments for extraction progress */
@media (max-width: 480px) {
    .extraction-progress-container {
        min-width: 240px;
        padding: 12px 16px;
    }

    .extraction-title {
        font-size: 12px;
    }

    .extraction-skill {
        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;
    }
}

/* Joystick Action Button (bottom right) */
#joystick-container {
    position: fixed;
    right: 20px;
    border-radius: 50%;
    z-index: 100;
    touch-action: none;
    user-select: none;
    -webkit-tap-highlight-color: transparent;
    cursor: url('/3d/img/cursors/cursor-grab.svg') 16 16, grab;
    transition: transform 0.1s ease, box-shadow 0.1s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

/* #joystick-container:hover {

} */

#joystick-container.active {
    cursor: url('/3d/img/cursors/cursor-grabbing.svg') 16 16, grabbing;
    transform: scale(0.95);
        /* border-color: rgba(231, 76, 60, 0.6);
        box-shadow:
            0 2px 10px rgba(0, 0, 0, 0.4),
            inset 0 1px 0 rgba(255, 255, 255, 0.1),
            inset 0 2px 8px rgba(0, 0, 0, 0.4); */
}

#joystick-container #joystick-canvas {
    width: 80px;
    height: 80px;
    pointer-events: none;
}

/* Visual feedback when action executed */
#joystick-container.executed {
    border-color: rgba(46, 204, 113, 0.8);
}

/* Combat Joystick (bottom left) */
#combat-joystick-container {
    position: fixed;
    left: 20px;
    border-radius: 50%;
    border: none;
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 100;
    touch-action: none;
    user-select: none;
    -webkit-tap-highlight-color: transparent;
    cursor: url('/3d/img/cursors/cursor-grab.svg') 16 16, grab;
    transition: transform 0.1s ease, box-shadow 0.1s ease;
}

#combat-joystick-container.active {
    cursor: url('/3d/img/cursors/cursor-grabbing.svg') 16 16, grabbing;
    transform: scale(0.95);
}

#joystick-container,
#combat-joystick-container {
    border: 1px solid rgba(0, 0, 0, 0.16);
    background: rgba(100, 169, 255, 0);
    box-shadow: 1px 1px 0px rgba(0, 0, 0, 0.3);

    bottom: 100px;
    width: 80px;
    height: 80px;
}

.combat-joystick-labels {
    position: absolute;
    width: 140px;
    height: 140px;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    pointer-events: none;
}

.cj-label {
    position: absolute;
    font-size: 9px;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.8);
    text-shadow: 0 0 4px rgba(0, 0, 0, 0.9), 1px 1px 2px #000;
    white-space: nowrap;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.15s ease, filter 0.15s ease;
}

.cj-label svg {
    filter: drop-shadow(0 0 3px rgba(0, 0, 0, 0.8));
}

.cj-label-flash {
    animation: cjLabelFlash 0.4s ease-out;
}

@keyframes cjLabelFlash {
    0% { transform: translate(-50%, 0) scale(1.6); filter: brightness(2.5) drop-shadow(0 0 8px currentColor); }
    50% { transform: translate(-50%, 0) scale(1.2); filter: brightness(1.5) drop-shadow(0 0 4px currentColor); }
    100% { transform: translate(-50%, 0) scale(1); filter: brightness(1); }
}

.cj-label-e.cj-label-flash,
.cj-label-w.cj-label-flash {
    animation-name: cjLabelFlashY;
}

@keyframes cjLabelFlashY {
    0% { transform: translateY(-50%) scale(1.6); filter: brightness(2.5) drop-shadow(0 0 8px currentColor); }
    50% { transform: translateY(-50%) scale(1.2); filter: brightness(1.5) drop-shadow(0 0 4px currentColor); }
    100% { transform: translateY(-50%) scale(1); filter: brightness(1); }
}

.cj-label-n {
    top: 0;
    left: 50%;
    transform: translateX(-50%);
}

.cj-label-s {
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
}

.cj-label-e {
    right: 0;
    top: 50%;
    transform: translateY(-50%);
}

.cj-label-w {
    left: 0;
    top: 50%;
    transform: translateY(-50%);
}

#combat-joystick-container.phase-attack {
    filter: drop-shadow(0 0 6px rgba(52, 152, 219, 0.5));
}

#combat-joystick-container.phase-school {
    filter: drop-shadow(0 0 6px rgba(46, 204, 113, 0.5));
}

#combat-joystick-container.cj-locked {
    opacity: 0.5;
    pointer-events: none;
}

/* Combat Joystick Ball (CSS-based) */
.cj-ball {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    position: absolute;
    top: 50%;
    left: 50%;
    margin-top: -20px;
    margin-left: -20px;
    transition: transform 0.08s ease-out;
    pointer-events: none;
    box-shadow: inset -3px -3px 8px rgba(0, 0, 0, 0.3),
                inset 3px 3px 8px rgba(255, 255, 255, 0.15),
                0 2px 6px rgba(0, 0, 0, 0.4);
}

.cj-ball-blue {
    background: radial-gradient(circle at 35% 35%, #5dade2, #2980b9 60%, #1a5276);
}

.cj-ball-green {
    background: radial-gradient(circle at 35% 35%, #58d68d, #27ae60 60%, #1e8449);
}

.cj-ball-flash {
    background: radial-gradient(circle at 35% 35%, #f9e154, #f1c40f 60%, #d4ac0d);
}

/* Menu Panel */
.menu-panel {
    position: fixed;
    top: 100px;
    left: 20px;
    width: 240px;
    max-height: 80vh;
    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);
    overflow: hidden;
}

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

.menu-panel-body {
    padding: 10px;
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
    max-height: calc(80vh - 50px);
    overflow-y: auto;
}

.menu-panel .menu-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 12px 8px;
    background: rgba(79, 145, 255, 0.1);
    border: 1px solid rgba(79, 145, 255, 0.3);
    border-radius: 8px;
    color: #fff;
    cursor: url('/3d/img/cursors/cursor-pointer.svg') 10 4, pointer;
    transition: all 0.2s ease;

    
    box-shadow: 2px 2px 0 black, 1px 1px 0 #ffffff4f inset;
}

.menu-panel .menu-item:hover {
    background: rgba(79, 145, 255, 0.25);
    border-color: #4f91ff;
    transform: translateY(-2px);
}

.menu-panel .menu-item:active {
    transform: translateY(0);
    background: rgba(79, 145, 255, 0.35);
}

.menu-panel .menu-item-icon {
    width: 28px;
    height: 28px;
    object-fit: contain;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: filter 0.2s ease, transform 0.2s ease;
}

.menu-panel .menu-item:hover .menu-item-icon {
    filter: brightness(1.3) drop-shadow(0 0 4px rgba(79, 145, 255, 0.6));
    transform: scale(1.1);
}

.menu-panel .menu-item span:last-child {
    font-size: 11px;
    font-weight: 500;
    text-align: center;
}

/* Legacy fullscreen modal — hidden, replaced by glass panel */
#action-button-modal {
    display: none !important;
    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;
}

/* Action Settings Glass Panel */
.action-settings-panel {
    width: 340px;
    top: 100px;
    left: 200px;
}

.action-settings-panel .action-gesture-list {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

/* Gesture Mapping Rows */
.gesture-mapping {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 10px;
    background: rgba(0, 0, 0, 0.25);
    border: 1px solid rgba(79, 145, 255, 0.15);
    border-radius: 4px;
    gap: 8px;
}

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

.gesture-icon {
    font-size: 16px;
    width: 24px;
    text-align: center;
    color: rgba(164, 202, 255, 0.7);
}

.gesture-name {
    color: #a4caff;
    font-weight: 500;
    font-size: 12px;
}

.gesture-key {
    background: rgba(79, 145, 255, 0.15);
    color: rgba(164, 202, 255, 0.6);
    padding: 1px 5px;
    border-radius: 3px;
    font-size: 10px;
    font-family: monospace;
}

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

.gesture-action:hover {
    border-color: rgba(79, 145, 255, 0.5);
    background: rgba(79, 145, 255, 0.1);
}

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

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

.gesture-action .action-dropdown-arrow {
    color: rgba(164, 202, 255, 0.4);
    font-size: 8px;
}

/* SVG icons for action buttons */
.action-btn-svg {
    width: 16px;
    height: 16px;
    color: rgba(164, 202, 255, 0.7);
    vertical-align: middle;
}

.action-picker-item .action-btn-svg {
    width: 18px;
    height: 18px;
}

.action-picker-item:hover .action-btn-svg,
.gesture-action:hover .action-btn-svg {
    color: #a4caff;
}

/* Action Picker — inline dropdown inside the glass panel */
.action-picker-dropdown {
    background: rgba(0, 0, 0, 0.6);
    border: 1px solid rgba(79, 145, 255, 0.3);
    border-radius: 4px;
    padding: 4px;
    margin-bottom: 4px;
    max-height: 250px;
    overflow-y: auto;
}

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

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

.action-picker-item:hover {
    background: rgba(79, 145, 255, 0.15);
}

.action-picker-item.selected {
    border-color: rgba(79, 145, 255, 0.5);
    background: rgba(79, 145, 255, 0.1);
}

.action-picker-icon {
    font-size: 16px;
    width: 28px;
    text-align: center;
    margin-right: 8px;
}

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

.action-picker-name {
    color: #f0f0f0;
    font-weight: 500;
    font-size: 12px;
    display: block;
    margin-bottom: 1px;
}

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

/* 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;
    }
}

/* 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: '...';
    }
}

#dev-tools .dev-slider-group {
    background: rgba(0, 0, 0, 0.6);
    padding: 8px 12px;
    border-radius: 6px;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

#dev-tools .dev-slider-group label {
    color: #fff;
    font-size: 12px;
    display: flex;
    justify-content: space-between;
}

#dev-tools .dev-slider-group label span {
    color: #3498db;
    font-weight: bold;
}

#dev-tools .dev-slider-group input[type="range"] {
    width: 120px;
    height: 6px;
    -webkit-appearance: none;
    appearance: none;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 3px;
    outline: none;
}

#dev-tools .dev-slider-group input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 14px;
    height: 14px;
    background: #3498db;
    border-radius: 50%;
    cursor: pointer;
}

#dev-tools .dev-slider-group input[type="range"]::-moz-range-thumb {
    width: 14px;
    height: 14px;
    background: #3498db;
    border-radius: 50%;
    cursor: pointer;
    border: none;
}

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

/* Object Hover Label (small tooltip on mouse hover) */
.object-hover-label {
    position: fixed;
    bottom: 15px;
    right: 15px;
    font-size: 16px;
    z-index: 100;
    pointer-events: none;
    font-family: "Noto Sans", sans-serif;
    color: #a4caff;
    background: rgb(0 0 0 / 77%);
    border-radius: 8px;
    padding: 4px 10px;
}

/* 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;
}

/* ============================================
   SHARED BUTTON STYLES
   ============================================ */
.btn-confirm,
.btn-reject {
    padding: 5px 14px;
    border-radius: 4px;
    font-size: 12px;
    cursor: url('/3d/img/cursors/cursor-pointer.svg') 10 4, pointer;
    border: 1px solid transparent;
    transition: all 0.15s;
    flex-shrink: 0;
}
.btn-confirm {    background: rgb(0 0 0 / 44%);
    border-color: rgba(46, 204, 113, 0.4);
    color: #2ecc71;
}
.btn-confirm:hover:not(:disabled):not(.disabled) {
    background: rgba(46, 204, 113, 0.35);
    border-color: rgba(46, 204, 113, 0.6);
}
.btn-confirm:disabled,
.btn-confirm.disabled {
    opacity: 0.4;
    cursor: not-allowed;
}
.btn-reject {
    background: rgb(0 0 0 / 44%);
    border-color: rgba(231, 76, 60, 0.3);
    color: #e07065;
}
.btn-reject:hover:not(:disabled):not(.disabled) {
    background: rgba(231, 76, 60, 0.3);
    border-color: rgba(231, 76, 60, 0.5);
    color: #e74c3c;
}
.btn-reject:disabled,
.btn-reject.disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

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

.context-menu-header {
    padding: 8px 16px 4px;
    color: rgba(255, 255, 255, 0.5);
    font-size: 0.8em;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    margin-bottom: 2px;
}

.context-menu-item-danger {
    color: #ff6b6b;
}

.context-menu-item-danger:hover {
    background: rgba(231, 76, 60, 0.3);
}

/* 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-body {
    color: #f0f0f0;
    margin-bottom: 20px;
}

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

.object-info-list li {
    padding: 4px 8px;
    display: flex;
    justify-content: space-between;
}

.object-info-list li.yield-item span {
    gap: 12px;
}

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

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

/* Yield Item Styles */
.yield-item {
    padding: 6px 0;
    padding-left: 12px;
    display: flex;
    align-items: center;
    font-size: 14px;
    background: #0000006b;
    border-radius: 8px;
    padding-left: 12px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 6px;
    transition: all 0.25s ease-in-out;
}

.yield-item:hover {
    transform: translateY(22px) translateX(0px) rotate(0deg);
    background: rgba(0, 0, 0, 0.75);
}

.yield-item .extract-single-btn {
    margin-left: auto;
    margin-right: 8px;
    padding: 4px 10px;
    font-size: 11px;
    background: rgba(0, 255, 255, 0.2);
    border: 1px solid rgba(0, 255, 255, 0.4);
    color: #00ffff;
    border-radius: 4px;
    cursor: url('/3d/img/cursors/cursor-pointer.svg') 10 4, pointer;
    transition: all 0.2s ease;
    white-space: nowrap;
    flex-shrink: 0;
}

.yield-item .extract-single-btn:hover {
    background: rgba(0, 255, 255, 0.4);
    border-color: rgba(0, 255, 255, 0.7);
    transform: scale(1.05);
}

.yield-item .extract-single-btn:active {
    transform: scale(0.95);
}

.yield-thumbnail {
    width: 38px;
    height: 38px;
    object-fit: contain;
    flex-shrink: 0;
}

.commodity-cube {
    flex-shrink: 0;
}

/* Gear Inspect Modal Styles */
.gear-inspect-list {
    font-size: 14px;
}

.gear-inspect-list li {
    padding: 6px 0;
}

.gear-description {
    color: inherit;
    font-size: 13px;
    padding: 8px 0 !important;
    line-height: 1.4;
}

.gear-stats-header {
    margin-top: 8px !important;
    padding-top: 8px !important;
    border-top: 1px solid rgba(255, 255, 255, 0.2);
}

.gear-stat-item {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 4px 0 !important;
    border-bottom: none !important;
}

.gear-magic-school {
    margin-top: 8px !important;
    padding-top: 8px !important;
    border-top: 1px solid rgba(255, 255, 255, 0.2);
}

.gear-crafting-recipe {
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px solid rgba(255, 255, 255, 0.2);
    font-size: 13px;
    color: inherit;
}

.gear-recipe-section {
    color: #a4caff;
}

.gear-recipe-section strong {
    color: #a4caff;
    display: block;
    margin-bottom: 6px;
}

.recipe-skill {
    color: #ffd700;
    margin: 4px 0;
    font-size: 12px;
}

.recipe-materials {
    list-style: none;
    padding: 0;
    margin: 8px 0;
}

.recipe-materials li {
    padding: 3px 0;
    padding-left: 12px;
    font-size: 12px;
}

.recipe-time {
    color: #a4caff;
    font-size: 12px;
    margin-top: 6px;
}

/* 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: #a4caff;
    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 Panel - Full-size responsive panel */
.object-info-panel.plot-management-modal {
    width: 90vw !important;
    max-width: 500px !important;
    max-height: 85vh;
    display: flex;
    flex-direction: column;
    left: 50% !important;
    top: 50% !important;
    transform: translate(-50%, -50%) !important;
}

.object-info-panel.plot-management-modal .panel-body {
    flex: 1;
    overflow-y: auto;
    max-height: calc(85vh - 50px);
}

.object-info-panel.plot-management-modal .object-info-body {
    overflow-y: auto;
    max-height: calc(85vh - 150px);
    padding: 16px;
    margin-bottom: 0;
}

.object-info-panel.plot-management-modal .object-info-actions {
    flex-shrink: 0;
    padding: 12px 16px;
    border-top: 1px solid rgba(79, 145, 255, 0.2);
    background: rgba(0, 0, 0, 0.3);
}

/* Mobile responsive for plot management */
@media (max-width: 600px) {
    .object-info-panel.plot-management-modal {
        width: 95vw !important;
        max-width: none !important;
        max-height: 90vh;
        margin: 16px;
    }

    .object-info-panel.plot-management-modal .object-info-body {
        max-height: calc(90vh - 120px);
        padding: 12px;
    }

    .enhancement-item {
        flex-wrap: wrap;
    }

    .enhancement-item .btn {
        width: 100%;
        margin-top: 8px;
    }

    .buildable-item {
        flex-wrap: wrap;
    }

    .buildable-item .build-btn {
        width: 100%;
        margin-top: 8px;
    }

    .fence-style-list {
        gap: 6px;
    }

    .fence-style-option {
        padding: 6px 10px;
        font-size: 12px;
    }
}

/* Collapsible Sections */
.collapsible-section {
    margin-bottom: 8px;
}

.collapsible-header {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 12px;
    background: rgba(79, 145, 255, 0.1);
    border: 1px solid rgba(79, 145, 255, 0.2);
    border-radius: 6px;
    cursor: pointer;
    transition: background 0.2s;
}

.collapsible-header:hover {
    background: rgba(79, 145, 255, 0.15);
}

.collapsible-header h4 {
    flex: 1;
    margin: 0 !important;
    padding: 0 !important;
    border: none !important;
}

.collapsible-header .current-value {
    color: #7ab3ff;
    font-size: 13px;
}

.collapsible-header .collapse-icon {
    color: #666;
    font-size: 10px;
    transition: transform 0.2s;
}

.collapsible-content {
    padding: 12px 0 0 0;
}

/* Build Structures Panel - Separate draggable panel */
.build-structures-panel {
    position: fixed;
    width: 650px;
    height: 650px;
    max-height: 100%;
    background: rgba(10, 20, 40, 0.95);
    border: 1px solid rgba(79, 145, 255, 0.4);
    border-radius: 8px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.5);
    z-index: 1000;
    display: none;
    overflow-y: auto;
}

.build-structures-panel .panel-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 14px;
    background: rgba(79, 145, 255, 0.15);
    border-bottom: 1px solid rgba(79, 145, 255, 0.3);
    cursor: move;
}

.build-structures-panel .panel-title {
    font-weight: bold;
    color: #a4caff;
}

.build-structures-panel .panel-close-btn {
    background: none;
    border: none;
    color: #a4caff;
    font-size: 20px;
    cursor: pointer;
    padding: 0 4px;
}

.build-structures-panel .panel-close-btn:hover {
    color: #fff;
}

.build-structures-panel .panel-body {
    padding: 12px;
    /* overflow-y: auto; */
    max-height: 100%;
}

.build-structures-panel .buildables-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.build-structures-panel .buildable-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px;
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(79, 145, 255, 0.2);
    border-radius: 4px;
}

.build-structures-panel .buildable-info {
    flex: 1;
    min-width: 0;
}

.build-structures-panel .buildable-name {
    font-weight: bold;
    color: #a4caff;
    margin-bottom: 2px;
}

.build-structures-panel .buildable-desc {
    font-size: 11px;
    color: #a4caff;
    margin-bottom: 4px;
}

.build-structures-panel .buildable-cost {
    font-size: 11px;
    color: #7ab3ff;
}

.build-structures-panel .build-btn {
    flex-shrink: 0;
}

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

.plot-management h4 {
    margin: 0 0 12px 0;
    padding-top: 16px;
    border-top: 1px solid rgba(79, 145, 255, 0.15);
}

.plot-management h4:first-child {
    padding-top: 0;
    border-top: none;
}

.plot-management>p {
    margin: 0 0 12px 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: #a4caff;
    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;
}

/* Buildables List */
.buildables-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
    max-height: 100%;
    overflow-y: auto;
}

.buildable-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 10px;
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(139, 69, 19, 0.4);
    border-radius: 4px;
    transition: background 0.2s;
}

.buildable-item:hover {
    background: rgba(139, 69, 19, 0.2);
}

.buildable-icon {
    width: 32px;
    height: 32px;
    border-radius: 4px;
    flex-shrink: 0;
}

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

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

.buildable-cost {
    font-size: 11px;
    color: #f0c060;
}

.build-btn {
    flex-shrink: 0;
}

.build-btn:disabled {
    background: rgba(80, 80, 80, 0.3);
    border-color: rgba(100, 100, 100, 0.3);
    color: #666;
    cursor: not-allowed;
    opacity: 0.6;
}

.build-btn:disabled:hover {
    background: rgba(80, 80, 80, 0.3);
    transform: none;
}

.buildable-item.cannot-afford {
    opacity: 0.6;
}

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

.buildable-preview {
    width: 64px;
    height: 64px;
    flex-shrink: 0;
    border-radius: 4px;
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(255, 255, 255, 0.1);
    margin-right: 12px;
}

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

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

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

/* Material Selection Modal */
#material-selection-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2000;
}

.material-selection-modal {
    background: #1a1a2e;
    border: 1px solid rgba(79, 145, 255, 0.3);
    border-radius: 12px;
    width: 90%;
    max-width: 450px;
    max-height: 80vh;
    overflow: hidden;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.6);
}

.material-selection-modal .modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 20px;
    background: rgba(0, 0, 0, 0.3);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.material-selection-modal .modal-header h3 {
    margin: 0;
    color: #fff;
    font-size: 16px;
}

.material-selection-modal .modal-close {
    background: none;
    border: none;
    color: rgba(255, 255, 255, 0.7);
    font-size: 24px;
    line-height: 1;
    padding: 0;
    cursor: pointer;
}

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

.material-selection-modal .modal-body {
    padding: 16px;
    max-height: 50vh;
    overflow-y: auto;
}

.material-requirement {
    margin-bottom: 16px;
}

.material-req-header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 10px;
    padding-bottom: 8px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.req-label {
    color: rgba(255, 255, 255, 0.6);
    font-size: 12px;
}

.req-amount {
    color: #4f91ff;
    font-weight: 600;
    font-size: 14px;
}

.material-options {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.material-option {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px;
    background: rgba(255, 255, 255, 0.05);
    border: 2px solid transparent;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.material-option:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(79, 145, 255, 0.3);
}

.material-option.selected {
    background: rgba(79, 145, 255, 0.15);
    border-color: #4f91ff;
}

.material-option.insufficient {
    opacity: 0.5;
    cursor: not-allowed;
}

.material-option.insufficient:hover {
    background: rgba(255, 255, 255, 0.05);
    border-color: transparent;
}

.material-color-swatch {
    width: 40px;
    height: 40px;
    border-radius: 6px;
    border: 2px solid rgba(255, 255, 255, 0.2);
    flex-shrink: 0;
}

.material-info {
    display: flex;
    flex-direction: column;
    gap: 2px;
    flex-grow: 1;
}

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

.material-amount {
    color: rgba(255, 255, 255, 0.6);
    font-size: 12px;
}

.material-check {
    color: #2ecc71;
    font-size: 18px;
    font-weight: bold;
}

.material-insufficient {
    color: #e74c3c;
    font-size: 11px;
}

.no-materials {
    color: rgba(255, 255, 255, 0.5);
    text-align: center;
    padding: 20px;
    font-style: italic;
}

.material-selection-modal .modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    padding: 16px 20px;
    background: rgba(0, 0, 0, 0.3);
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.material-selection-modal .confirm-btn {
    background: linear-gradient(135deg, #4f91ff 0%, #2575fc 100%);
    border: none;
    color: #fff;
    padding: 10px 20px;
    border-radius: 6px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
}

.material-selection-modal .confirm-btn:disabled {
    background: rgba(79, 145, 255, 0.3);
    cursor: not-allowed;
    opacity: 0.6;
}

.material-selection-modal .confirm-btn:not(:disabled):hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(79, 145, 255, 0.4);
}

/* 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: #a4caff;
    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: #a4caff;
    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);
}

.game-notification.legendary {
    background: linear-gradient(135deg, rgba(255, 215, 0, 0.95), rgba(255, 165, 0, 0.95));
    border: 2px solid rgba(255, 215, 0, 1);
    color: #1a1a2e;
    font-weight: bold;
    text-shadow: 0 1px 2px rgba(255, 255, 255, 0.3);
    box-shadow: 0 0 20px rgba(255, 215, 0, 0.4), 0 0 40px rgba(255, 165, 0, 0.2);
    animation: notification-slide 0.3s ease, rare-glow 1.5s ease-in-out infinite alternate, notification-fade 0.5s ease 4.5s forwards;
}

@keyframes rare-glow {
    from { box-shadow: 0 0 20px rgba(255, 215, 0, 0.4), 0 0 40px rgba(255, 165, 0, 0.2); }
    to { box-shadow: 0 0 30px rgba(255, 215, 0, 0.6), 0 0 60px rgba(255, 165, 0, 0.3); }
}

.game-notification.epic-find {
    background: linear-gradient(135deg, rgba(138, 43, 226, 0.95), rgba(186, 85, 211, 0.95));
    border: 2px solid rgba(186, 85, 211, 1);
    color: #fff;
    font-weight: bold;
    font-size: 15px;
    text-shadow: 0 0 10px rgba(186, 85, 211, 0.5);
    box-shadow: 0 0 25px rgba(138, 43, 226, 0.5), 0 0 50px rgba(186, 85, 211, 0.3);
    animation: notification-slide 0.3s ease, epic-glow 1s ease-in-out infinite alternate, notification-fade 0.5s ease 5.5s forwards;
}

@keyframes epic-glow {
    from { box-shadow: 0 0 25px rgba(138, 43, 226, 0.5), 0 0 50px rgba(186, 85, 211, 0.3); }
    to { box-shadow: 0 0 40px rgba(138, 43, 226, 0.7), 0 0 80px rgba(186, 85, 211, 0.4); }
}

@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;
}

/* Target cursor for attackable creatures (red arrow) */
#game-canvas.cursor-target {
    cursor: url('/3d/img/cursors/cursor-target.svg') 4 4, pointer !important;
}

/* Extract cursor for sci-fi resource extraction */
#game-canvas.cursor-extract {
    cursor: url('/3d/img/cursors/cursor-extract.svg') 8 8, pointer !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: inherit;
    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;
}

/* ========== Glass Panel Shared Styles ========== */
.inventory-panel,
.paperdoll-panel,
.hotspots-panel,
.spellbook-panel,
.marketplace-panel,
.options-panel,
.object-info-panel,
.crafting-panel,
.emotes-panel,
#object-hover-label {
    border-radius: 8px;
    background: rgb(0 0 0 / 77%);
}

/* ========== Glass Panel Base Class ========== */
/* Base styling for all panels created by PanelManager */
.glass-panel {
    position: fixed;
    background: color(srgb 0 0 0 / 0.33);
    /* background: transparent; */
    border-radius: 8px;
    z-index: 500;
    overflow: hidden;
    display: none;
    box-shadow: 1px 1px 0px rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(0, 0, 0, 0.16);
    border: 8px solid rgb(0 0 0 / 50%);
    border-top: none;

    color: #f0f0f0;
}

/* Override display:none when visible class is added (works with inline styles too) */
.glass-panel.visible,
.glass-panel[style*="display: block"] {
    display: block !important;
}

.glass-panel .panel-header {
    background: rgb(0 0 0 / 50%);
    color: #f0f0f0;
}

.glass-panel .panel-body {
    padding: 12px;
    max-height: 70vh;
    overflow-y: auto;
}

.glass-panel .panel-toolbar {
    padding: 8px 12px;
    background: rgba(0, 0, 0, 0.2);
    border-bottom: 1px solid rgba(79, 145, 255, 0.2);
}

.glass-panel .panel-tabs {
    display: flex;
    gap: 4px;
}

.glass-panel .panel-tab {
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(79, 145, 255, 0.3);
    color: #a4caff;
    padding: 6px 12px;
    border-radius: 4px 4px 0 0;
    cursor: url('/3d/img/cursors/cursor-pointer.svg') 10 4, pointer;
    font-size: 12px;
    transition: all 0.2s;
}

.glass-panel .panel-tab:hover {
    background: rgba(79, 145, 255, 0.2);
}

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

.glass-panel .panel-tab-content {
    display: none;
}

.glass-panel .panel-tab-content.active {
    display: block;
}

.glass-panel .panel-title {
    color: #f0f0f0;
    font-weight: bold;
    font-family: "Noto Sans", sans-serif;
}

.panel-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 14px;
    background: rgba(0, 0, 0, 0.66);
    color: #f0f0f0;
    font-weight: bold;
    cursor: url('/3d/img/cursors/cursor-move.svg') 16 16, move;
    font-family: "Noto Sans", sans-serif;
    /* letter-spacing: 0.1px;
    border-radius: 5px 5px 0 0; */
}

.panel-title {
    display: flex;
    align-items: center;
    gap: 8px;
}

.panel-header-icon {
    width: 20px;
    height: 20px;
    object-fit: contain;
    pointer-events: none;
    transition: filter 0.2s ease, transform 0.2s ease;
}

.panel-header:hover .panel-header-icon {
    filter: brightness(1.2) drop-shadow(0 0 3px rgba(106, 252, 255, 0.5));
    transform: scale(1.1);
}

.panel-close-btn {
    background: transparent;
    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);
}

/* Larger touch target for close buttons on mobile */
@media (pointer: coarse),
(max-width: 768px) {
    .panel-close-btn {
        width: 44px;
        height: 44px;
        min-width: 44px;
        min-height: 44px;
        font-size: 24px;
    }
}

/* ========== Stats Panel ========== */
.stats-panel {
    position: fixed;
    top: 100px;
    left: 20px;
    width: 320px;
    min-width: 280px;
    max-width: 90vw;
    z-index: 500;
    overflow: hidden;
}

.stats-panel .stats-content {
    padding: 12px;
    max-height: 70vh;
    overflow-y: auto;
}

.stats-panel .stats-section {
    margin-bottom: 16px;
}

.stats-panel .stats-section-title {
    color: #a4caff;
    font-size: 12px;
    font-weight: bold;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 8px;
    padding-bottom: 4px;
    border-bottom: 1px solid rgba(79, 145, 255, 0.3);
}

.stats-panel .level-info {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}

.stats-panel .level-badge {
    background: linear-gradient(135deg, #4f91ff 0%, #2563eb 100%);
    padding: 4px 12px;
    border-radius: 4px;
    font-weight: bold;
    font-size: 14px;
}

.stats-panel .stat-points-badge {
    background: rgba(46, 204, 113, 0.3);
    border: 1px solid rgba(46, 204, 113, 0.5);
    padding: 4px 10px;
    border-radius: 4px;
    font-size: 12px;
    color: #2ecc71;
}

.stats-panel .xp-bar-container {
    background: rgba(0, 0, 0, 0.4);
    border-radius: 4px;
    height: 20px;
    position: relative;
    overflow: hidden;
    margin-bottom: 12px;
}

.stats-panel .xp-bar {
    height: 100%;
    background: linear-gradient(90deg, #4f91ff 0%, #9b59b6 100%);
    transition: width 0.3s ease;
}

.stats-panel .xp-bar-text {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 11px;
    color: #fff;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.8);
}

.stats-panel .stat-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 6px 8px;
    background: rgba(0, 0, 0, 0.2);
    border-radius: 4px;
    margin-bottom: 4px;
}

.stats-panel .stat-row:hover {
    background: rgba(79, 145, 255, 0.15);
}

.stats-panel .stat-name {
    color: #a4caff;
    font-size: 13px;
    display: flex;
    align-items: center;
    gap: 6px;
}

.stats-panel .stat-name .stat-icon {
    width: 16px;
    height: 16px;
    opacity: 0.7;
}

.stats-panel .stat-value {
    font-weight: bold;
    color: #fff;
    display: flex;
    align-items: center;
    gap: 8px;
}

.stats-panel .stat-value .base {
    color: #a4caff;
    font-size: 11px;
}

.stats-panel .stat-value .bonus {
    color: #2ecc71;
    font-size: 11px;
}

.stats-panel .allocate-btn {
    background: rgba(46, 204, 113, 0.3);
    border: 1px solid rgba(46, 204, 113, 0.5);
    color: #2ecc71;
    width: 22px;
    height: 22px;
    border-radius: 4px;
    font-size: 16px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.stats-panel .allocate-btn:hover {
    background: rgba(46, 204, 113, 0.5);
    transform: scale(1.1);
}

.stats-panel .allocate-btn:disabled {
    opacity: 0.3;
    cursor: not-allowed;
}

.stats-panel .derived-stat-row {
    display: flex;
    justify-content: space-between;
    padding: 4px 8px;
    font-size: 12px;
}

.stats-panel .derived-stat-row .label {
    color: #a4caff;
}

.stats-panel .derived-stat-row .value {
    color: #fff;
}

.stats-panel .derived-stat-row .value.highlight {
    color: #f39c12;
}

.stats-panel .affinity-row {
    display: flex;
    justify-content: space-between;
    padding: 3px 8px;
    font-size: 11px;
}

.stats-panel .affinity-row .name {
    display: flex;
    align-items: center;
    gap: 4px;
}

.stats-panel .affinity-row .color-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
}

.stats-panel .affinity-row .value {
    color: #2ecc71;
}

.stats-panel .reset-btn {
    width: 100%;
    padding: 8px;
    margin-top: 8px;
}

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

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

.inventory-slot {
    aspect-ratio: 1;
    min-width: 39px;
    max-width: 49px;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    transition: all 0.15s;
    overflow: hidden;
    box-shadow: 1px 1px 0px rgba(0, 0, 0, 0.3);
    box-shadow: 2px 2px 0 #0000004f, 1px 1px 0 #ffffff4f inset;
    border: 1px solid rgba(0, 0, 0, 0.16);
    border-radius: 8px;
    background: rgba(100, 169, 255, 0);
}

.inventory-slot:hover,
.paperdoll-slot:hover {
    transform: translateY(1px) translateX(1px) rotate(1deg);
    background-color: rgb(59 133 255 / 25%);
    border-color: #4f91ff;
}

.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);
}

/* Hide cursor during drag */
body.is-dragging,
body.is-dragging *,
body.is-dragging canvas {
    cursor: none !important;
}

/* Drag ghost that follows cursor */
.inventory-drag-ghost {
    position: fixed;
    z-index: 10000;
    pointer-events: none;
    background: rgba(20, 20, 35, 0.95);
    border: 2px solid rgba(100, 160, 255, 0.7);
    border-radius: 8px;
    padding: 4px;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.5), 0 0 20px rgba(100, 160, 255, 0.2);
    display: flex;
    align-items: center;
    justify-content: center;
    transform: translate(-50%, -50%);
}

/* When has thumbnail, show just the icon */
.inventory-drag-ghost.has-thumbnail {
    padding: 4px;
    background: rgba(20, 20, 35, 0.9);
}

.inventory-drag-ghost.has-thumbnail .drag-ghost-name {
    display: none;
}

/* When no thumbnail, show text */
.inventory-drag-ghost:not(.has-thumbnail) {
    padding: 8px 12px;
    font-size: 12px;
    color: #fff;
    white-space: nowrap;
}

.drag-ghost-thumbnail {
    width: 48px;
    height: 48px;
    object-fit: contain;
    border-radius: 6px;
    background: rgba(0, 0, 0, 0.3);
    display: block;
}

.drag-ghost-placeholder {
    width: 48px;
    height: 48px;
    border-radius: 6px;
    display: block;
    box-shadow: inset 0 2px 4px rgba(255, 255, 255, 0.2), inset 0 -2px 4px rgba(0, 0, 0, 0.3);
}

.drag-ghost-name {
    display: block;
    font-size: 12px;
    color: #fff;
}

/* Item hover tooltip */
.item-hover-tooltip {
    position: fixed;
    z-index: 10001;
    pointer-events: none;
    background: rgba(0, 0, 0, 0.75);
    border-radius: 8px;
    padding: 10px 12px;
    font-size: 12px;
    color: #a4caff;
    display: flex;
    align-items: flex-start;
    gap: 10px;
    max-width: 280px;
}

.item-hover-tooltip.has-thumbnail {
    padding: 8px;
}

.tooltip-thumbnail {
    width: 48px;
    height: 48px;
    object-fit: contain;
    border-radius: 6px;
    flex-shrink: 0;
}

.tooltip-content {
    display: flex;
    flex-direction: column;
    gap: 4px;
    min-width: 0;
}

.tooltip-name {
    font-weight: 600;
    font-size: 13px;
    color: #fff;
    line-height: 1.2;
}

.tooltip-quantity {
    font-size: 11px;
}

.tooltip-desc {
    font-size: 12px;
    color: #f0f0f0;
    line-height: 1.4;
    text-align: left;
}

.tooltip-stat {
    font-size: 11px;
    color: #b0b0b0;
    display: flex;
    align-items: center;
    gap: 4px;
}

.tooltip-stat .stat-icon {
    font-size: 10px;
}

.tooltip-type {
    font-size: 10px;
    color: #7a7a8a;
    text-transform: capitalize;
    margin-top: 2px;
}

/* Dragging state for paperdoll slots */
.paperdoll-slot.dragging {
    opacity: 0.5;
    cursor: url('/3d/img/cursors/cursor-grab.svg') 10 10, grabbing;
}

/* 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;
}

/* Unified thumbnail class for items and equipment slots */
.thumb-img,
.item-thumbnail,
.slot-thumbnail {
    width: 100%;
    height: 100%;
    border-radius: 6px;
    object-fit: cover;
    image-rendering: auto;
    display: block;
}

/* Palette-based gradient backgrounds (p0-p9 in filename) */
.thumb-bg-0 {
    background: linear-gradient(145deg, #2a2a4a 0%, #1a1a2e 50%, #252540 100%);
}

/* slate */
.thumb-bg-1 {
    background: linear-gradient(145deg, #4a2a2a 0%, #2e1a1a 50%, #402525 100%);
}

/* ember */
.thumb-bg-2 {
    background: linear-gradient(145deg, #2a4a2a 0%, #1a2e1a 50%, #254025 100%);
}

/* forest */
.thumb-bg-3 {
    background: linear-gradient(145deg, #2a3a4a 0%, #1a252e 50%, #253540 100%);
}

/* ocean */
.thumb-bg-4 {
    background: linear-gradient(145deg, #4a4a2a 0%, #2e2e1a 50%, #404025 100%);
}

/* sand */
.thumb-bg-5 {
    background: linear-gradient(145deg, #3a2a4a 0%, #251a2e 50%, #352540 100%);
}

/* violet */
.thumb-bg-6 {
    background: linear-gradient(145deg, #4a3a2a 0%, #2e251a 50%, #403525 100%);
}

/* copper */
.thumb-bg-7 {
    background: linear-gradient(145deg, #2a4a4a 0%, #1a2e2e 50%, #254040 100%);
}

/* teal */
.thumb-bg-8 {
    background: linear-gradient(145deg, #4a2a3a 0%, #2e1a25 50%, #402535 100%);
}

/* rose */
.thumb-bg-9 {
    background: linear-gradient(145deg, #1a1a1a 0%, #0a0a0a 50%, #151515 100%);
}

/* obsidian */

/* Loading spinner for GLB preview rendering */
.glb-preview-loading {
    position: relative;
    background: rgba(26, 26, 46, 0.8) !important;
}

.glb-preview-loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 16px;
    height: 16px;
    margin: -8px 0 0 -8px;
    border: 2px solid rgba(255, 255, 255, 0.2);
    border-top-color: #3498db;
    border-radius: 50%;
    animation: glb-spinner 0.6s linear infinite;
}

@keyframes glb-spinner {
    to {
        transform: rotate(360deg);
    }
}

/* Hide the image while loading */
.glb-preview-loading img {
    opacity: 0;
}

/* 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: inherit;
}

.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: inherit;
    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-filters {
    display: flex;
    gap: 8px;
    margin-bottom: 12px;
    position: sticky;
    top: 0;
    background: rgba(30, 30, 40, 0.95);
    padding: 8px 0;
    z-index: 1;
}

.crafting-search {
    flex: 1;
    padding: 8px 12px;
    background: rgba(0, 0, 0, 0.4);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 6px;
    color: #fff;
    font-size: 13px;
    outline: none;
    transition: border-color 0.2s, background 0.2s;
}

.crafting-search:focus {
    border-color: rgba(79, 145, 255, 0.5);
    background: rgba(0, 0, 0, 0.5);
}

.crafting-search::placeholder {
    color: rgba(255, 255, 255, 0.4);
}

.crafting-category-filter {
    padding: 8px 12px;
    background: rgba(0, 0, 0, 0.4);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 6px;
    color: #fff;
    font-size: 13px;
    cursor: pointer;
    outline: none;
    min-width: 140px;
    transition: border-color 0.2s, background 0.2s;
}

.crafting-category-filter:hover,
.crafting-category-filter:focus {
    border-color: rgba(79, 145, 255, 0.5);
    background: rgba(0, 0, 0, 0.5);
}

.crafting-category-filter option {
    background: #1e1e28;
    color: #fff;
}

.crafting-recipes-list {
    display: flex;
    flex-direction: column;
}

.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: #a4caff;
    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: #a4caff;
}

.craft-btn {
    padding: 6px 16px;
}

/* 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: #a4caff;
    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;
    font-size: 11px;
}

/* 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: #a4caff;
}

.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: 0px;
    right: 0px;
    font-size: 10px;
    color: #fff;
    background: rgba(0, 0, 0, 0.7);
    padding: 1px 4px;
    border-radius: 3px 0 0 0;
    font-weight: bold;
}

/* Magic Info Tab */
.magic-info-header {
    margin-bottom: 16px;
}

.magic-info-header h3 {
    margin: 0 0 8px 0;
    font-size: 14px;
    color: #fff;
}

.magic-info-header p {
    margin: 0;
    font-size: 11px;
    color: #a4caff;
    line-height: 1.4;
}

.magic-info-list {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.magic-info-card {
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 6px;
    padding: 8px;
    transition: all 0.2s;
}

.magic-info-card:hover {
    border-color: rgba(79, 145, 255, 0.4);
    background: rgba(79, 145, 255, 0.05);
}

.magic-info-card-header {
    display: flex;
    align-items: center;
    gap: 10px;
}

.magic-info-preview {
    width: 60px;
    height: 60px;
    border-radius: 4px;
    background: rgba(0, 0, 0, 0.4);
    flex-shrink: 0;
}

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

.magic-info-name {
    font-size: 13px;
    font-weight: bold;
    color: #fff;
    margin-bottom: 2px;
}

.magic-info-example {
    font-size: 11px;
    font-style: italic;
    opacity: 0.9;
}

.magic-info-cost {
    font-size: 11px;
    padding: 4px 10px;
    border-radius: 10px;
    font-weight: bold;
    flex-shrink: 0;
}

.magic-info-cost.base {
    background: rgba(46, 204, 113, 0.2);
    color: #2ecc71;
}

.magic-info-cost.increased {
    background: rgba(241, 196, 15, 0.2);
    color: #f1c40f;
}

.magic-info-cost.very-high {
    background: rgba(231, 76, 60, 0.2);
    color: #e74c3c;
}

/* ========== Elemental Affinities ========== */
.elemental-affinities-list {
    margin-bottom: 15px;
}

.affinities-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
}

.affinity-card {
    background: rgba(0, 0, 0, 0.3);
    border-radius: 6px;
    padding: 8px;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.affinity-card.has-affinity {
    border-color: rgba(255, 255, 255, 0.2);
}

.affinity-card.no-affinity {
    opacity: 0.5;
}

.affinity-header {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-bottom: 6px;
}

.affinity-icon {
    font-size: 14px;
    text-shadow: 0 0 4px currentColor;
}

.affinity-name {
    flex: 1;
    font-size: 11px;
    font-weight: 600;
    color: #fff;
}

.affinity-value {
    font-size: 12px;
    font-weight: bold;
    color: #a4caff;
}

.affinity-bar-container {
    height: 4px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 2px;
    overflow: hidden;
    margin-bottom: 6px;
}

.affinity-bar {
    height: 100%;
    border-radius: 2px;
    transition: width 0.3s ease;
}

.affinity-bonuses {
    font-size: 9px;
    color: inherit;
}

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

.bonus-label {
    color: #a4caff;
}

.bonus-values {
    display: flex;
    gap: 6px;
}

.bonus-values span {
    color: #2ecc71;
}

/* ========== Crafting Stats Info ========== */
.crafting-stats-info {
    padding: 4px;
}

.crafting-stats-info h3 {
    margin: 0 0 8px 0;
    font-size: 14px;
    color: #a4caff;
}

.crafting-stats-info h4 {
    margin: 0 0 8px 0;
    font-size: 12px;
    color: #fff;
}

.crafting-stats-info p {
    margin: 0 0 8px 0;
    font-size: 11px;
    color: inherit;
    line-height: 1.5;
}

.stats-info-section {
    background: rgba(0, 0, 0, 0.2);
    border-radius: 6px;
    padding: 12px;
    margin-bottom: 12px;
}

.stats-info-section.highlight {
    background: rgba(79, 145, 255, 0.15);
    border: 1px solid rgba(79, 145, 255, 0.3);
}

.stats-info-section.tip-section {
    background: rgba(46, 204, 113, 0.1);
    border: 1px solid rgba(46, 204, 113, 0.3);
}

.stats-info-grid {
    display: flex;
    gap: 12px;
}

.stats-info-stat {
    flex: 1;
    background: rgba(0, 0, 0, 0.3);
    padding: 10px;
    border-radius: 4px;
    text-align: center;
}

.stats-info-stat .stat-label {
    display: block;
    font-size: 10px;
    color: #a4caff;
    text-transform: uppercase;
    margin-bottom: 4px;
}

.stats-info-stat .stat-value {
    display: block;
    font-size: 20px;
    font-weight: bold;
    color: #fff;
}

.stats-info-bonus {
    display: flex;
    justify-content: space-between;
    padding: 6px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.stats-info-bonus:last-child {
    border-bottom: none;
}

.stats-info-bonus .bonus-label {
    color: #a4caff;
    font-size: 12px;
}

.stats-info-bonus .bonus-value {
    color: #2ecc71;
    font-weight: bold;
    font-size: 12px;
}

.quality-tiers {
    display: flex;
    flex-direction: column;
    gap: 4px;
    margin: 10px 0;
}

.quality-tier {
    display: flex;
    justify-content: space-between;
    padding: 6px 10px;
    border-radius: 4px;
    font-size: 11px;
}

.quality-tier span:first-child {
    font-weight: bold;
    min-width: 80px;
}

.quality-tier span:nth-child(2) {
    color: #a4caff;
    min-width: 50px;
    text-align: center;
}

.quality-tier span:last-child {
    min-width: 80px;
    text-align: right;
}

.quality-tier.poor {
    background: rgba(149, 165, 166, 0.2);
    color: #95a5a6;
}

.quality-tier.good {
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
}

.quality-tier.great {
    background: rgba(46, 204, 113, 0.2);
    color: #2ecc71;
}

.quality-tier.superb {
    background: rgba(52, 152, 219, 0.2);
    color: #3498db;
}

.quality-tier.masterwork {
    background: rgba(155, 89, 182, 0.2);
    color: #9b59b6;
}

.stats-info-list {
    margin: 8px 0;
    padding-left: 20px;
    font-size: 11px;
    color: inherit;
    line-height: 1.6;
}

.stats-info-list li {
    margin-bottom: 4px;
}

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

.stats-tip {
    background: rgba(241, 196, 15, 0.1);
    border-left: 3px solid #f1c40f;
    padding: 8px 10px;
    margin-top: 10px;
    font-size: 11px;
    color: #f1c40f;
}

.stats-tip strong {
    color: #fff;
}

/* Difficulty Info */
.difficulty-info {
    background: rgba(231, 76, 60, 0.1);
    border-radius: 4px;
    padding: 8px;
    margin: 8px 0;
}

.difficulty-row {
    display: flex;
    justify-content: space-between;
    padding: 4px 0;
    font-size: 11px;
}

.difficulty-row .penalty {
    color: #e74c3c;
    font-weight: bold;
}

/* Material Levels */
.material-levels {
    display: flex;
    flex-direction: column;
    gap: 4px;
    margin: 8px 0;
}

.mat-level-row {
    display: flex;
    padding: 6px 8px;
    background: rgba(0, 0, 0, 0.2);
    border-radius: 4px;
    font-size: 11px;
    align-items: center;
}

.mat-level-row span:first-child {
    min-width: 70px;
    font-weight: bold;
    color: #fff;
}

.mat-level-row .level {
    min-width: 45px;
    color: #f39c12;
    font-weight: bold;
}

.mat-level-row span:last-child {
    color: #a4caff;
    font-size: 10px;
}

/* ========== 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: #a4caff;
    text-align: center;
    padding: 20px;
    font-size: 13px;
}

.hotspot-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 10px;
    margin-bottom: 6px;
}

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

.hotspots-section-label {
    font-size: 11px;
    color: #a4caff;
    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: #a4caff;
    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 {
    top: 100px;
    left: 20px;
    width: 312px;
}

/* Visibility handled by .glass-panel.visible */

.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: "Noto Sans", 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: 12px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
}

/* Main layout: left slots | character | right slots */
.paperdoll-layout {
    display: flex;
    align-items: center;
    gap: 8px;
    width: 100%;
}

/* Side columns for slots */
.paperdoll-col {
    display: flex;
    flex-direction: column;
    gap: 8px;
    flex-shrink: 0;
}

/* Center character preview */
.paperdoll-center {
    flex: 1;
    display: flex;
    justify-content: center;
    align-items: center;
}

/* Character 3D canvas */
#paperdoll-canvas {
    width: 160px;
    height: 220px;
    border-radius: 8px;
    cursor: grab;
}

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

/* Bottom row for lower body slots */
.paperdoll-row-bottom {
    display: flex;
    justify-content: center;
    gap: 8px;
    width: 100%;
}

/* Equipment slot styling */
.paperdoll-slot {
    width: 44px;
    height: 44px;
    border: 1px solid rgba(0, 0, 0, 0.16);
    border-radius: 8px;
    background: rgba(100, 169, 255, 0);
    display: flex;
    position: relative;
    transition: all 0.2s linear;
    cursor: url(/3d/img/cursors/cursor-pointer.svg) 10 4, pointer;
    box-shadow: 1px 1px 0px rgba(0, 0, 0, 0.3);

    box-shadow: 1px 1px 0px rgba(0, 0, 0, 0.3);
    box-shadow: 2px 2px 0 #0000004f, 1px 1px 0 #ffffff4f inset;
    border: 1px solid rgba(0, 0, 0, 0.16);
    border-radius: 8px;
    background: rgba(100, 169, 255, 0);
}

.paperdoll-slot.filled {
    /* border-color: rgba(46, 204, 113, 0.5);
    background: rgba(46, 204, 113, 0.15);
    padding: 3px; */
    box-shadow: none;
    cursor: url('/3d/img/cursors/cursor-grab.svg') 10 10, grab;
}

.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-thumbnail styles now merged into unified .thumb-img class above */

/* 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: #a4caff;
}

.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;
}

/* ========== Paperdoll Tabs ========== */
.paperdoll-tabs {
    display: flex;
    gap: 4px;
}

.paperdoll-tab {
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(79, 145, 255, 0.3);
    padding: 6px 14px;
    font-size: 12px;
    font-family: "Noto Sans", sans-serif;
    cursor: url('/3d/img/cursors/cursor-pointer.svg') 10 4, pointer;
    border-radius: 4px 4px 0 0;
    transition: all 0.2s;
}

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

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

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

.paperdoll-tab-content.active {
    display: flex;
}

/* Stats tab body */
.paperdoll-stats-body {
    padding: 12px;
    flex-direction: column;
    gap: 12px;
    max-height: 380px;
    overflow-y: auto;
}

.paperdoll-stats-content {
    width: 100%;
    padding: 15px;
    box-sizing: border-box;
}

.paperdoll-stats-section {
    margin-bottom: 16px;
}

.paperdoll-stats-section h4 {
    font-size: 11px;
    text-transform: uppercase;
    margin: 0 0 8px 0;
    padding-bottom: 4px;
    font-family: "Noto Sans", sans-serif;
}

.paperdoll-stat-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 4px 0;
    font-size: 12px;
}

.paperdoll-stat-row .stat-name {
    color: #a4caff;
}

.paperdoll-stat-row .stat-value {
    color: #fff;
    display: flex;
    align-items: center;
    gap: 4px;
}

.paperdoll-stat-row .stat-value .base {
    color: #a4caff;
    font-size: 11px;
}

.paperdoll-stat-row .stat-value .bonus {
    color: #4ade80;
    font-size: 11px;
}

.paperdoll-stat-row .stat-value strong {
    color: #fff;
    font-weight: 600;
}

.paperdoll-stat-row .allocate-btn {
    background: rgba(79, 145, 255, 0.3);
    border: 1px solid rgba(79, 145, 255, 0.5);
    color: #fff;
    width: 18px;
    height: 18px;
    font-size: 12px;
    border-radius: 3px;
    cursor: url('/3d/img/cursors/cursor-pointer.svg') 10 4, pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    transition: all 0.2s;
}

.paperdoll-stat-row .allocate-btn:hover:not(:disabled) {
    background: rgba(79, 145, 255, 0.5);
}

.paperdoll-stat-row .allocate-btn:disabled {
    opacity: 0.3;
    cursor: url('/3d/img/cursors/cursor-not-allowed.svg') 16 16, not-allowed;
}

.paperdoll-stat-points {
    background: rgba(255, 193, 7, 0.15);
    border: 1px solid rgba(255, 193, 7, 0.4);
    border-radius: 4px;
    padding: 8px 12px;
    margin-bottom: 12px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.paperdoll-stat-points .label {
    color: #ffc107;
    font-size: 12px;
}

.paperdoll-stat-points .value {
    color: #fff;
    font-weight: bold;
    font-size: 14px;
}

.paperdoll-level-info {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 0;
    margin-bottom: 8px;
}

.paperdoll-level-info .level {
    font-size: 16px;
    font-weight: bold;
    color: #ffc107;
}

.paperdoll-level-info .xp {
    font-size: 11px;
}

.paperdoll-xp-bar {
    width: 100%;
    height: 6px;
    background: rgba(0, 0, 0, 0.4);
    border-radius: 3px;
    overflow: hidden;
    margin-bottom: 12px;
}

.paperdoll-xp-bar .fill {
    height: 100%;
    background: linear-gradient(90deg, #ffc107, #ffdb4d);
    border-radius: 3px;
    transition: width 0.3s;
}

.stats-loading {
    color: #a4caff;
    text-align: center;
    padding: 20px;
    font-size: 12px;
}

/* ========== Paperdoll Skills Tab ========== */
.paperdoll-skills-body {
    padding: 12px;
    flex-direction: column;
    gap: 12px;
    max-height: 380px;
    overflow-y: auto;
}

.paperdoll-skills-content {
    width: 100%;
    padding: 15px;
    box-sizing: border-box;
}

.paperdoll-skill-row {
    margin-bottom: 2px;
}

.paperdoll-skill-row .stat-name {
    display: flex;
    align-items: center;
    gap: 6px;
}

.skill-icon-small {
    width: 16px;
    height: 16px;
    filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.3));
}

.paperdoll-skill-progress {
    height: 4px;
    background: rgba(0, 0, 0, 0.4);
    border-radius: 2px;
    overflow: hidden;
    margin-bottom: 8px;
    margin-left: 22px;
}

.paperdoll-skill-progress-fill {
    height: 100%;
    border-radius: 2px;
    transition: width 0.3s;
}

/* ========== Clickable Stats ========== */
.stat-clickable {
    cursor: pointer;
    transition: color 0.2s, text-shadow 0.2s;
}

.stat-clickable:hover {
    text-shadow: 0 0 8px rgba(138, 180, 248, 0.5);
}

/* ========== Stat Description Modal ========== */
.stat-description-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 10001;
    display: flex;
    align-items: center;
    justify-content: center;
}

.stat-modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
}

.stat-modal-content {
    position: relative;
    background: linear-gradient(145deg, rgba(30, 35, 45, 0.98), rgba(20, 25, 35, 0.98));
    border: 1px solid rgba(138, 180, 248, 0.3);
    border-radius: 12px;
    width: 320px;
    max-width: 90vw;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5),
        0 0 20px rgba(138, 180, 248, 0.15);
    animation: statModalAppear 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes statModalAppear {
    from {
        opacity: 0;
        transform: scale(0.8) translateY(-20px);
    }

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

.stat-modal-header {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 16px 20px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.stat-modal-icon {
    font-size: 24px;
}

.stat-modal-header h3 {
    flex: 1;
    margin: 0;
    font-size: 18px;
    font-weight: 600;
    color: #fff;
    font-family: "Noto Sans", sans-serif;
}

.stat-modal-close {
    background: transparent;
    border: none;
    color: #a4caff;
    font-size: 24px;
    cursor: pointer;
    padding: 0;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 6px;
    transition: all 0.2s;
}

.stat-modal-close:hover {
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
}

.stat-modal-body {
    padding: 20px;
}

.stat-short-desc {
    margin: 0 0 12px 0;
    font-size: 14px;
    font-style: italic;
}

.stat-full-desc {
    margin: 0 0 16px 0;
    color: #a4caff;
    font-size: 13px;
    line-height: 1.6;
}

.stat-effects {
    background: rgba(0, 0, 0, 0.2);
    border-radius: 8px;
    padding: 12px 16px;
}

.stat-effects h4 {
    margin: 0 0 8px 0;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.stat-effects ul {
    margin: 0;
    padding: 0;
    list-style: none;
}

.stat-effects li {
    color: #9e9;
    font-size: 12px;
    padding: 4px 0;
    display: flex;
    align-items: center;
    gap: 8px;
}

.stat-effects li::before {
    content: 'â€¢';
}

/* ========== XP Notifications ========== */
.xp-notification {
    position: fixed;
    top: 30%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0.5);
    background: linear-gradient(135deg, rgba(255, 193, 7, 0.9), rgba(255, 152, 0, 0.9));
    color: #fff;
    padding: 12px 24px;
    border-radius: 8px;
    font-size: 18px;
    font-weight: bold;
    font-family: "Noto Sans", sans-serif;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.5);
    box-shadow: 0 4px 20px rgba(255, 193, 7, 0.4);
    z-index: 10000;
    opacity: 0;
    pointer-events: none;
    transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.xp-notification.show {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1);
}

/* Level Up Notification */
.level-up-notification {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: radial-gradient(ellipse at center, rgba(255, 215, 0, 0.2) 0%, transparent 70%);
    z-index: 10001;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.5s;
}

.level-up-notification.show {
    opacity: 1;
}

.level-up-content {
    text-align: center;
    transform: scale(0.5);
    transition: transform 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.level-up-notification.show .level-up-content {
    transform: scale(1);
}

.level-up-title {
    font-size: 48px;
    font-weight: bold;
    font-family: "Noto Sans", sans-serif;
    color: #ffd700;
    text-shadow:
        0 0 10px rgba(255, 215, 0, 0.8),
        0 0 20px rgba(255, 215, 0, 0.6),
        0 0 30px rgba(255, 215, 0, 0.4),
        0 2px 4px rgba(0, 0, 0, 0.5);
    animation: levelUpPulse 0.5s ease-out;
}

.level-up-level {
    font-size: 32px;
    font-weight: bold;
    font-family: "Noto Sans", sans-serif;
    color: #fff;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.5);
    margin-top: 10px;
}

.level-up-points {
    font-size: 18px;
    color: #4ade80;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.5);
    margin-top: 8px;
}

@keyframes levelUpPulse {
    0% {
        transform: scale(0.5);
        opacity: 0;
    }

    50% {
        transform: scale(1.2);
    }

    100% {
        transform: scale(1);
        opacity: 1;
    }
}

/* Zone Discovery Notification */
.zone-discovery-notification {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: radial-gradient(ellipse at center, rgba(46, 204, 113, 0.15) 0%, transparent 70%);
    z-index: 10001;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.5s;
}

.zone-discovery-notification.show {
    opacity: 1;
}

.zone-discovery-content {
    text-align: center;
    transform: scale(0.5);
    transition: transform 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.zone-discovery-notification.show .zone-discovery-content {
    transform: scale(1);
}

.zone-discovery-title {
    font-size: 36px;
    font-weight: bold;
    font-family: "Noto Sans", sans-serif;
    color: #2ecc71;
    text-shadow:
        0 0 10px rgba(46, 204, 113, 0.8),
        0 0 20px rgba(46, 204, 113, 0.6),
        0 0 30px rgba(46, 204, 113, 0.4),
        0 2px 4px rgba(0, 0, 0, 0.5);
    animation: zoneDiscoveryPulse 0.5s ease-out;
}

.zone-discovery-name {
    font-size: 42px;
    font-weight: bold;
    font-family: "Noto Sans", sans-serif;
    color: #fff;
    text-shadow:
        0 0 15px rgba(52, 152, 219, 0.8),
        0 0 25px rgba(52, 152, 219, 0.5),
        0 2px 4px rgba(0, 0, 0, 0.5);
    margin-top: 12px;
}

.zone-discovery-biome {
    font-size: 18px;
    color: #95a5a6;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.5);
    margin-top: 8px;
    text-transform: capitalize;
}

.zone-discovery-level {
    font-size: 16px;
    color: #f39c12;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.5);
    margin-top: 6px;
}

@keyframes zoneDiscoveryPulse {
    0% {
        transform: scale(0.5);
        opacity: 0;
    }

    50% {
        transform: scale(1.1);
    }

    100% {
        transform: scale(1);
        opacity: 1;
    }
}

/* Damage numbers (floating combat text) */
.damage-number {
    position: fixed;
    font-size: 18px;
    font-weight: bold;
    font-family: "Noto Sans", sans-serif;
    color: #ff4444;
    text-shadow:
        -1px -1px 0 #000,
        1px -1px 0 #000,
        -1px 1px 0 #000,
        1px 1px 0 #000,
        0 2px 4px rgba(0, 0, 0, 0.5);
    z-index: 9999;
    pointer-events: none;
    transform: translate(-50%, -50%);
    animation: damageFloat 1s ease-out forwards;
    white-space: nowrap;
}

.damage-number.crit {
    font-size: 28px;
    color: #ffd700;
    text-shadow:
        -1px -1px 0 #000,
        1px -1px 0 #000,
        -1px 1px 0 #000,
        1px 1px 0 #000,
        0 0 10px rgba(255, 215, 0, 0.9),
        0 0 20px rgba(255, 215, 0, 0.6),
        0 2px 4px rgba(0, 0, 0, 0.5);
    animation: critFloat 1.2s ease-out forwards;
}

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

    15% {
        transform: translate(-50%, -50%) translateY(-10px) scale(1.5);
    }

    30% {
        transform: translate(-50%, -50%) translateY(-20px) scale(1.2);
    }

    100% {
        opacity: 0;
        transform: translate(-50%, -50%) translateY(-80px) scale(0.9);
    }
}

.damage-number.heal {
    color: #4ade80;
    text-shadow:
        0 0 5px rgba(74, 222, 128, 0.6),
        0 1px 2px rgba(0, 0, 0, 0.8);
}

.damage-number.miss {
    font-size: 14px;
    color: #9ca3af;
    font-style: italic;
}

.damage-number.block {
    font-size: 14px;
    color: #60a5fa;
    text-shadow:
        0 0 4px rgba(96, 165, 250, 0.6),
        0 1px 2px rgba(0, 0, 0, 0.8);
}

.damage-number.absorb {
    font-size: 14px;
    color: #a78bfa;
    text-shadow:
        0 0 4px rgba(167, 139, 250, 0.6),
        0 1px 2px rgba(0, 0, 0, 0.8);
}

@keyframes damageFloat {
    0% {
        opacity: 1;
        transform: translate(-50%, -50%) translateY(0) scale(1);
    }

    50% {
        opacity: 1;
        transform: translate(-50%, -50%) translateY(-30px) scale(1.2);
    }

    100% {
        opacity: 0;
        transform: translate(-50%, -50%) translateY(-60px) scale(0.8);
    }
}

/* ========== 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: "Noto Sans", 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: #a4caff;
    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;
    cursor: url('/3d/img/cursors/cursor-pointer.svg') 10 4, pointer;
}

.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: #a4caff;
}

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

.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 {
    cursor: url('/3d/img/cursors/cursor-pointer.svg') 10 4, pointer;
}

.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;
    width: 340px;
    height: fit-content;
    max-height: 100%;
    overflow: auto;
}

.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: #a4caff;
    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 {
    overflow-y: auto;
}

.spellbook-list {
    padding: 8px;
}

.spellbook-empty {
    color: #a4caff;
    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(0, 0, 0, 0.5);
    border: none;
    border-radius: 8px;
    margin-bottom: 6px;
    transition: all 0.25s ease-in-out;
}

.spell-item:hover {
    transform: translateY(-2px) translateX(0px) rotate(0deg);
    background: rgba(0, 0, 0, 0.75);
}

.spell-item[draggable="true"] {
    cursor: url('/3d/img/cursors/cursor-grab.svg') 10 10, grab;
}

.spell-item[draggable="true"]:active {
    cursor: url('/3d/img/cursors/cursor-grab.svg') 10 10, 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;
    overflow: hidden;
}
.spell-icon img {
    display: block;
    filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.3));
}

.spell-thumbnail {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.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: inherit;
    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-damage svg, .spell-mana svg, .spell-cooldown svg,
.compose-preview-stats svg {
    vertical-align: -2px;
    display: inline-block;
}
.compose-preview-stats > span {
    display: inline-flex;
    align-items: center;
    gap: 3px;
}

.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);
}

/* ========== Spell Composition UI ========== */

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

.compose-section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 6px 8px;
    background: rgba(0, 0, 0, 0.3);
    border-radius: 4px;
    margin-bottom: 6px;
    font-size: 12px;
    color: #fff;
    font-weight: bold;
}

.compose-section-hint {
    font-weight: normal;
    color: #a4caff;
    font-size: 11px;
}

/* Form cards (large, 3 across) */
.compose-form-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 6px;
    margin-bottom: 4px;
}

.compose-form-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 8px 4px;
    background: rgba(0, 0, 0, 0.4);
    border: 2px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    cursor: url('/3d/img/cursors/cursor-pointer.svg') 10 4, pointer;
    transition: all 0.2s;
    text-align: center;
}

.compose-form-card:hover {
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(255, 255, 255, 0.3);
}

.compose-form-card.selected {
    border-color: #9b59b6;
    background: rgba(155, 89, 182, 0.15);
    box-shadow: 0 0 8px rgba(155, 89, 182, 0.3);
}

.compose-form-icon {
    margin-bottom: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
}
.compose-form-icon img {
    display: block;
    filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.4));
}

.compose-form-name {
    font-size: 11px;
    font-weight: bold;
    color: #fff;
}

.compose-form-stats {
    font-size: 10px;
    color: #a4caff;
    margin-top: 2px;
}

.compose-form-module {
    font-size: 8px;
    color: rgba(100, 200, 255, 0.8);
    background: rgba(100, 200, 255, 0.12);
    padding: 1px 4px;
    border-radius: 3px;
    margin-top: 2px;
    text-transform: capitalize;
}

.compose-form-card.locked {
    opacity: 0.35;
    cursor: url('/3d/img/cursors/cursor-default.svg') 4 4, default;
    position: relative;
}
.compose-form-card.locked:hover {
    background: rgba(0, 0, 0, 0.4);
    border-color: rgba(255, 255, 255, 0.1);
}
.compose-form-lock {
    position: absolute;
    top: 4px;
    right: 4px;
    font-size: 10px;
    opacity: 0.6;
}

/* School selection grid */
.compose-school-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 4px;
    margin-bottom: 4px;
}
.compose-school-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 6px 2px;
    background: rgba(0, 0, 0, 0.4);
    border: 2px solid rgba(255, 255, 255, 0.1);
    border-radius: 6px;
    cursor: url('/3d/img/cursors/cursor-pointer.svg') 10 4, pointer;
    transition: all 0.2s;
    text-align: center;
    gap: 2px;
}
.compose-school-card:hover {
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(255, 255, 255, 0.3);
}
.compose-school-card.selected {
    border-color: var(--school-color, #9b59b6);
    background: color-mix(in srgb, var(--school-color, #9b59b6) 15%, transparent);
    box-shadow: 0 0 8px color-mix(in srgb, var(--school-color, #9b59b6) 40%, transparent);
}
.compose-school-card.locked {
    opacity: 0.3;
    cursor: not-allowed;
    filter: grayscale(80%);
}
.compose-school-card.locked:hover {
    background: rgba(0, 0, 0, 0.4);
    border-color: rgba(255, 255, 255, 0.1);
}
.compose-school-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    flex-shrink: 0;
}
.compose-school-name {
    font-size: 10px;
    font-weight: bold;
    color: #fff;
    line-height: 1.1;
}
.compose-school-hint {
    font-size: 9px;
    color: #a4caff;
    line-height: 1.1;
}
.compose-section-placeholder {
    text-align: center;
    color: #666;
    font-size: 11px;
    padding: 12px 8px;
    font-style: italic;
}

/* Element grid (small icon tiles) */
.compose-element-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 4px;
    margin-bottom: 4px;
}

.compose-element-tile {
    aspect-ratio: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2px;
    border: 2px solid rgba(255, 255, 255, 0.15);
    border-radius: 6px;
    cursor: url('/3d/img/cursors/cursor-pointer.svg') 10 4, pointer;
    transition: all 0.2s;
    position: relative;
}
.compose-element-svg {
    display: block;
    filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.3));
    width: 100%;
    height: auto;
    padding: 5px;
    box-sizing: border-box;
}

.compose-element-tile:hover {
    transform: scale(1.1);
    z-index: 2;
}

.compose-element-tile.selected {
    box-shadow: 0 0 10px currentColor;
    transform: scale(1.05);
}

.compose-element-tile.locked {
    opacity: 0.3;
    cursor: not-allowed;
    filter: grayscale(100%);
}

.compose-element-tile.locked:hover {
    transform: none;
}

.compose-element-name {
    display: none;
    position: absolute;
    bottom: -18px;
    left: 50%;
    transform: translateX(-50%);
    font-size: 9px;
    color: #a4caff;
    white-space: nowrap;
    background: rgba(0, 0, 0, 0.8);
    padding: 1px 4px;
    border-radius: 3px;
    z-index: 10;
}

.compose-element-tile:hover .compose-element-name {
    display: block;
}

/* Mana investment slider (replaces Power Tier selector) */
.compose-mana-slider-group {
    background: rgba(0, 0, 0, 0.2);
    border-radius: 10px;
    padding: 12px 14px;
}

.compose-mana-slider-row {
    display: flex;
    align-items: center;
    gap: 10px;
}

.compose-mana-label {
    font-size: 14px;
    min-width: 20px;
}

.compose-mana-slider {
    flex: 1;
    height: 6px;
    -webkit-appearance: none;
    appearance: none;
    background: rgba(79, 145, 255, 0.15);
    border-radius: 3px;
    outline: none;
    cursor: url('/3d/img/cursors/cursor-pointer.svg') 10 4, pointer;
}

.compose-mana-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 16px;
    height: 16px;
    background: linear-gradient(135deg, #6afcff 0%, #4fa1ff 100%);
    border-radius: 50%;
    cursor: url('/3d/img/cursors/cursor-grab.svg') 10 10, grab;
    box-shadow: 0 2px 8px rgba(106, 252, 255, 0.4);
    transition: transform 0.2s, box-shadow 0.2s;
}

.compose-mana-slider::-webkit-slider-thumb:hover {
    transform: scale(1.15);
    box-shadow: 0 2px 12px rgba(106, 252, 255, 0.6);
}

.compose-mana-slider::-moz-range-thumb {
    width: 16px;
    height: 16px;
    background: linear-gradient(135deg, #6afcff 0%, #4fa1ff 100%);
    border-radius: 50%;
    cursor: url('/3d/img/cursors/cursor-grab.svg') 10 10, grab;
    border: none;
}

.compose-mana-value {
    font-weight: 600;
    color: #6afcff;
    font-size: 14px;
    min-width: 40px;
    text-align: right;
}

.compose-mana-hint {
    font-size: 11px;
    color: #a4caff;
    margin-top: 6px;
    line-height: 1.4;
}

/* Inline mana adjust slider for My Spells tab */
.spell-mana-adjust {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 4px 0;
    margin-top: 4px;
}

.spell-mana-adjust-slider {
    flex: 1;
    height: 4px;
    -webkit-appearance: none;
    appearance: none;
    background: rgba(79, 145, 255, 0.15);
    border-radius: 2px;
    outline: none;
    cursor: url('/3d/img/cursors/cursor-pointer.svg') 10 4, pointer;
}

.spell-mana-adjust-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 12px;
    height: 12px;
    background: linear-gradient(135deg, #6afcff 0%, #4fa1ff 100%);
    border-radius: 50%;
    cursor: url('/3d/img/cursors/cursor-grab.svg') 10 10, grab;
    box-shadow: 0 1px 4px rgba(106, 252, 255, 0.3);
}

.spell-mana-adjust-slider::-moz-range-thumb {
    width: 12px;
    height: 12px;
    background: linear-gradient(135deg, #6afcff 0%, #4fa1ff 100%);
    border-radius: 50%;
    border: none;
}

.spell-mana-adjust-value {
    font-size: 11px;
    color: #6afcff;
    font-weight: 600;
    min-width: 30px;
    text-align: right;
}

/* Preview panel */
.compose-preview {
    margin-top: 10px;
    padding: 10px;
    background: rgba(0, 0, 0, 0.5);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
}

.compose-preview-header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 8px;
}

.compose-preview-icon {
    width: 36px;
    height: 36px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px solid;
    flex-shrink: 0;
}
.compose-preview-icon img {
    display: block;
    filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.3));
}

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

.compose-preview-type {
    font-size: 11px;
    color: inherit;
}

.compose-preview-stats {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    font-size: 11px;
    margin-bottom: 6px;
}

.compose-preview-stats span {
    display: flex;
    align-items: center;
    gap: 3px;
}

.compose-color-preview {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 11px;
    color: #a4caff;
}

.compose-color-swatch {
    width: 20px;
    height: 14px;
    border-radius: 3px;
    display: inline-block;
}

.compose-preview-empty {
    color: #666;
    font-size: 12px;
    text-align: center;
    padding: 15px;
}
.compose-preview-partial {
    padding: 8px 0;
}
.compose-preview-partial .compose-preview-name {
    font-size: 14px;
    font-weight: bold;
    color: #ddd;
}
.compose-preview-partial .compose-preview-type {
    font-size: 11px;
    color: #a4caff;
    margin-bottom: 6px;
}

/* Name input + create button */
.compose-name-row {
    display: flex;
    gap: 6px;
    margin-top: 8px;
    align-items: center;
}

.compose-name-input {
    flex: 1;
    background: rgba(0, 0, 0, 0.5);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 4px;
    color: #fff;
    padding: 6px 8px;
    font-size: 12px;
    outline: none;
}

.compose-name-input:focus {
    border-color: #9b59b6;
}

.compose-create-btn {
    width: 100%;
    padding: 10px;
    margin-top: 8px;
    background: rgba(155, 89, 182, 0.4);
    color: #fff;
    border: 1px solid rgba(155, 89, 182, 0.6);
    border-radius: 6px;
    font-size: 13px;
    font-weight: bold;
    cursor: url('/3d/img/cursors/cursor-pointer.svg') 10 4, pointer;
    transition: all 0.2s;
}

.compose-create-btn:hover:not(:disabled) {
    background: rgba(155, 89, 182, 0.6);
}

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

/* Delete button on composed spell items */
.spell-delete-btn {
    padding: 4px 8px;
    background: rgba(231, 76, 60, 0.2);
    color: #e74c3c;
    border: none;
    border-radius: 4px;
    font-size: 10px;
    cursor: url('/3d/img/cursors/cursor-pointer.svg') 10 4, pointer;
    transition: all 0.2s;
    margin-left: 4px;
}

.spell-delete-btn:hover {
    background: rgba(231, 76, 60, 0.4);
}

.spell-actions {
    display: flex;
    gap: 4px;
    flex-shrink: 0;
}

/* ========== Magic Schools Panel ========== */
.magic-schools-panel {
    position: fixed;
    top: 100px;
    left: 320px;
    width: 320px;
    max-height: 500px;
    z-index: 500;
    overflow: hidden;
}

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

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

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

/* Magic Schools Grid Layout */
.magic-schools-grid {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.magic-schools-grid .row {
    display: grid;
    gap: 12px;
    grid-template-columns: 1fr 1fr;
}

/* Magic School Button */
.magic-school-btn {
    background: transparent;
    color: #a4caff;
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 4px;
    cursor: pointer;
    position: relative;
    padding: 10px 8px;
    font-size: 13px;
    font-family: inherit;
    transition: all 0.2s ease;
}

.magic-school-btn:hover:not([disabled]):not(.blocked) {
    border-color: rgba(255, 255, 255, 0.5);
}

.magic-school-btn.full-width {
    grid-column: 1 / 3;
}

.magic-school-btn.half-width {
    grid-column: span 1;
}

.magic-school-btn[disabled] {
    cursor: not-allowed;
    opacity: 0.7;
}

.magic-school-btn.blocked {
    opacity: 0.4;
    cursor: not-allowed;
}

/* Corner indicators for level */
.magic-school-btn .corner {
    position: absolute;
    width: 8px;
    height: 8px;
    transition: opacity 0.25s ease;
}

.magic-school-btn:hover:not(.blocked) .corner {
    opacity: 1 !important;
}

.magic-school-btn .corner.top-left {
    top: -4px;
    left: -4px;
    border-left: 2px solid;
    border-top: 2px solid;
    border-radius: 3px 0 0 0;
}

.magic-school-btn .corner.top-right {
    top: -4px;
    right: -4px;
    border-right: 2px solid;
    border-top: 2px solid;
    border-radius: 0 3px 0 0;
}

.magic-school-btn .corner.bottom-left {
    bottom: -4px;
    left: -4px;
    border-left: 2px solid;
    border-bottom: 2px solid;
    border-radius: 0 0 0 3px;
}

.magic-school-btn .corner.bottom-right {
    bottom: -4px;
    right: -4px;
    border-right: 2px solid;
    border-bottom: 2px solid;
    border-radius: 0 0 3px 0;
}

/* School-specific colors */
.magic-school-btn.plain .corner {
    border-color: #a4caff;
}

.magic-school-btn.plain.active,
.magic-school-btn.plain:hover:not([disabled]) {
    background-color: rgba(164, 202, 255, 0.15);
    color: #a4caff;
    border-color: #a4caff;
}

.magic-school-btn.earth .corner {
    border-color: #ffd182;
}

.magic-school-btn.earth.active,
.magic-school-btn.earth:hover:not([disabled]):not(.blocked) {
    background-color: #4d3100;
    color: #ffd182;
    border-color: #ffd182;
}

.magic-school-btn.air .corner {
    border-color: #c9edff;
}

.magic-school-btn.air.active,
.magic-school-btn.air:hover:not([disabled]):not(.blocked) {
    background-color: #2365a6;
    color: #c9edff;
    border-color: #c9edff;
}

.magic-school-btn.water .corner {
    border-color: #a4ecff;
}

.magic-school-btn.water.active,
.magic-school-btn.water:hover:not([disabled]):not(.blocked) {
    background-color: #143a46;
    color: #a4ecff;
    border-color: #a4ecff;
}

.magic-school-btn.fire .corner {
    border-color: #ffc29d;
}

.magic-school-btn.fire.active,
.magic-school-btn.fire:hover:not([disabled]):not(.blocked) {
    background-color: #590303;
    color: #ffc29d;
    border-color: #f69e6a;
}

.magic-school-btn.nature .corner {
    border-color: #90c941;
}

.magic-school-btn.nature.active,
.magic-school-btn.nature:hover:not([disabled]):not(.blocked) {
    background-color: #3a6300;
    color: #cdff86;
    border-color: #90c941;
}

.magic-school-btn.tech .corner {
    border-color: #cea4ff;
}

.magic-school-btn.tech.active,
.magic-school-btn.tech:hover:not([disabled]):not(.blocked) {
    background-color: #3b0081;
    color: #cea4ff;
    border-color: #cea4ff;
}

.magic-school-btn.life .corner {
    border-color: #91ffad;
}

.magic-school-btn.life.active,
.magic-school-btn.life:hover:not([disabled]):not(.blocked) {
    background-color: #005d18;
    color: #c6ffd4;
    border-color: #c6ffd4;
}

.magic-school-btn.death .corner {
    border-color: #a4caff;
}

.magic-school-btn.death.active,
.magic-school-btn.death:hover:not([disabled]):not(.blocked) {
    background-color: #2a2a2a;
    color: #a4caff;
    border-color: #a4caff;
}

.magic-school-btn.divine .corner {
    border-color: #fffb00;
}

.magic-school-btn.divine.active,
.magic-school-btn.divine:hover:not([disabled]):not(.blocked) {
    background-color: #363b00;
    color: #fffb00;
    border-color: #fffb00;
}

.magic-school-btn.infernal .corner {
    border-color: #f343ff;
}

.magic-school-btn.infernal.active,
.magic-school-btn.infernal:hover:not([disabled]):not(.blocked) {
    background-color: #240000;
    color: #f343ff;
    border-color: #f343ff;
}

.magic-school-btn.arcane .corner {
    border-color: #e779ff;
}

.magic-school-btn.arcane.active,
.magic-school-btn.arcane:hover:not([disabled]) {
    background-color: #520089;
    color: #e779ff;
    border-color: #e779ff;
}

/* Learned but inactive school styling */
.magic-school-btn.learned.inactive {
    opacity: 0.5;
    border-style: dashed;
}

.magic-school-btn.learned.inactive:hover {
    opacity: 0.8;
}

/* Show corners even when inactive but learned */
.magic-school-btn.learned.inactive .corner {
    opacity: 0.5 !important;
}

/* Magic Schools Footer */
.magic-schools-footer {
    padding: 10px 15px;
    border-top: 1px dashed rgba(255, 255, 255, 0.1);
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 12px;
    color: #a4caff;
}

.magic-schools-footer strong {
    color: #f1c40f;
}

.magic-schools-footer .hint {
    font-size: 10px;
    opacity: 0.7;
}

/* Flow System */
.magic-school-btn .flow-badge {
    position: absolute;
    bottom: 2px;
    right: 4px;
    font-size: 9px;
    color: rgba(255, 255, 255, 0.7);
    font-weight: bold;
    pointer-events: none;
}

.flow-respec-btn {
    background: rgba(231, 76, 60, 0.2);
    border: 1px solid rgba(231, 76, 60, 0.3);
    color: #e74c3c;
    padding: 4px 10px;
    border-radius: 4px;
    font-size: 11px;
    cursor: pointer;
    transition: all 0.15s;
}

.flow-respec-btn:hover:not(:disabled) {
    background: rgba(231, 76, 60, 0.4);
}

.flow-respec-btn:disabled {
    opacity: 0.3;
    cursor: default;
}

/* Magic School Tooltip */
.magic-school-tooltip {
    position: fixed;
    z-index: 10001;
    pointer-events: none;
    background: rgba(20, 20, 35, 0.95);
    border: 1px solid rgba(52, 152, 219, 0.5);
    border-radius: 8px;
    padding: 10px 14px;
    min-width: 180px;
    max-width: 280px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.5);
    display: none;
}

.magic-school-tooltip-header {
    font-weight: 600;
    font-size: 14px;
    color: #fff;
    margin-bottom: 6px;
    padding-bottom: 6px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.15);
}

/* School-specific header colors */
.magic-school-tooltip-header.plain { color: #a4caff; border-bottom-color: rgba(164, 202, 255, 0.3); }
.magic-school-tooltip-header.earth { color: #ffd182; border-bottom-color: rgba(255, 209, 130, 0.3); }
.magic-school-tooltip-header.air { color: #c9edff; border-bottom-color: rgba(201, 237, 255, 0.3); }
.magic-school-tooltip-header.water { color: #a4ecff; border-bottom-color: rgba(164, 236, 255, 0.3); }
.magic-school-tooltip-header.fire { color: #ffc29d; border-bottom-color: rgba(255, 194, 157, 0.3); }
.magic-school-tooltip-header.nature { color: #cdff86; border-bottom-color: rgba(205, 255, 134, 0.3); }
.magic-school-tooltip-header.tech { color: #cea4ff; border-bottom-color: rgba(206, 164, 255, 0.3); }
.magic-school-tooltip-header.life { color: #c6ffd4; border-bottom-color: rgba(198, 255, 212, 0.3); }
.magic-school-tooltip-header.death { color: #a4caff; border-bottom-color: rgba(204, 204, 204, 0.3); }
.magic-school-tooltip-header.divine { color: #fffb00; border-bottom-color: rgba(255, 251, 0, 0.3); }
.magic-school-tooltip-header.infernal { color: #f343ff; border-bottom-color: rgba(243, 67, 255, 0.3); }
.magic-school-tooltip-header.arcane { color: #e779ff; border-bottom-color: rgba(231, 121, 255, 0.3); }

.magic-school-tooltip-status {
    font-size: 12px;
    color: #b0b0b0;
    margin-bottom: 4px;
}

.magic-school-tooltip-action {
    font-size: 11px;
    margin-top: 6px;
    padding: 4px 8px;
    background: rgba(52, 152, 219, 0.15);
    border-radius: 4px;
    border-left: 2px solid rgba(52, 152, 219, 0.5);
}

.magic-school-tooltip-hint {
    font-size: 10px;
    color: #7a7a8a;
    margin-top: 6px;
    font-style: italic;
}

/* 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: #a4caff;
    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;
}

/* Minimap 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: inherit;
    font-family: monospace;
}

/* ========== World Map Modal ========== */
.world-map-panel {
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 560px;
    max-width: 90vw;
    border-radius: 12px;
}

/* Visibility handled by .glass-panel.visible */
.world-map-panel.visible {
    display: block !important;
}

.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: #a4caff;
}

.map-toggle-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;
    cursor: pointer;
    font-size: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-left: 8px;
    transition: all 0.15s ease;
}

.map-toggle-btn svg {
    width: 16px;
    height: 16px;
    flex-shrink: 0;
}

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

.map-toggle-btn.active {
    background: rgba(46, 204, 113, 0.4);
    border-color: rgba(46, 204, 113, 0.7);
    box-shadow: 0 0 8px rgba(46, 204, 113, 0.3);
}

.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: url('/3d/img/cursors/cursor-grab.svg') 16 16, grab;
    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%);
}

.map-hover-info {
    position: absolute;
    bottom: 20px;
    right: 20px;
    background: rgba(0, 0, 0, 0.85);
    color: #fff;
    padding: 8px 12px;
    border-radius: 6px;
    font-size: 11px;
    pointer-events: none;
    display: none;
    z-index: 10;
    border: 1px solid rgba(79, 145, 255, 0.4);
    min-width: 100px;
    text-align: right;
}

.map-hover-info .hover-coords {
    font-family: monospace;
    color: inherit;
    font-size: 10px;
    margin-bottom: 2px;
}

.map-hover-info .hover-biome {
    font-weight: 600;
    font-size: 12px;
    color: #a4caff;
}

.map-hover-info .hover-zone {
    color: #a4caff;
    font-size: 13px;
    font-weight: 500;
    margin-top: 4px;
    font-family: "Noto Sans", sans-serif;
}

/* Map Context Menu */
.map-context-menu {
    background: rgba(20, 30, 50, 0.97);
    border: 1px solid rgba(79, 145, 255, 0.5);
    border-radius: 8px;
    padding: 6px 0;
    min-width: 150px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.6);
    animation: contextMenuFadeIn 0.15s ease-out;
}

@keyframes contextMenuFadeIn {
    from {
        opacity: 0;
        transform: scale(0.95);
    }

    to {
        opacity: 1;
        transform: scale(1);
    }
}

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

.context-menu-item:hover {
    background: rgba(79, 145, 255, 0.2);
    color: #fff;
}

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

.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: inherit;
}

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

.world-map-info {
    background: rgba(0, 0, 0, 0.3);
    padding: 8px 15px;
}

.map-zone-name {
    font-size: 14px;
    font-weight: bold;
    color: #3498db;
    text-align: center;
    margin-bottom: 4px;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.5);
}

.map-zone-name:empty {
    display: none;
}

.world-map-coords {
    display: flex;
    justify-content: space-between;
    align-items: center;
    text-align: center;
    font-size: 12px;
    color: #a4caff;
    font-family: monospace;
}

.map-chunk-level {
    color: #f39c12;
    font-weight: bold;
}

.map-chunk-level:empty {
    display: none;
}

/* ========== Options Panel ========== */
.options-panel {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 360px;
    max-width: 90vw;
    pointer-events: auto;
    background: linear-gradient(135deg, rgba(20, 24, 40, 0.98) 0%, rgba(16, 24, 48, 0.98) 100%);
    border: 1px solid rgba(79, 145, 255, 0.25);
    border-radius: 16px;
    z-index: 600;
    display: none;
    box-shadow: 0 12px 48px rgba(0, 0, 0, 0.7), 0 0 1px rgba(79, 145, 255, 0.3);
    overflow: hidden;
    overflow-y: auto;
    max-height: 93%;
}

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

.options-panel .panel-body {
    padding: 0;
}

.options-body-content {
    padding: 20px;
}

.option-section-title {
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    color: #6afcff;
    font-weight: 600;
    margin-bottom: 16px;
    padding-bottom: 8px;
    border-bottom: 1px solid rgba(106, 252, 255, 0.15);
}

.option-section-title:not(:first-child) {
    margin-top: 24px;
}

.option-group {
    margin-bottom: 14px;
}

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

/* Slider option rows */
.option-group.option-slider {
    background: rgba(0, 0, 0, 0.2);
    border-radius: 10px;
    padding: 12px 14px;
    margin-bottom: 10px;
}

.option-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}

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

.option-value {
    font-weight: 600;
    color: #6afcff;
    font-size: 13px;
    min-width: 50px;
    text-align: right;
}

.option-hint {
    font-size: 11px;
    color: #666;
    margin-top: 8px;
    line-height: 1.4;
}

.option-checkbox .option-hint {
    margin-left: 34px;
    margin-top: 4px;
}

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

.options-body-content input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 16px;
    height: 16px;
    background: linear-gradient(135deg, #6afcff 0%, #4fa1ff 100%);
    border-radius: 50%;
    cursor: url('/3d/img/cursors/cursor-grab.svg') 10 10, grab;
    box-shadow: 0 2px 8px rgba(106, 252, 255, 0.4);
    transition: transform 0.2s, box-shadow 0.2s;
}

.options-body-content input[type="range"]::-webkit-slider-thumb:hover {
    transform: scale(1.15);
    box-shadow: 0 2px 12px rgba(106, 252, 255, 0.6);
}

.options-body-content input[type="range"]::-moz-range-thumb {
    width: 16px;
    height: 16px;
    background: linear-gradient(135deg, #6afcff 0%, #4fa1ff 100%);
    border-radius: 50%;
    cursor: url('/3d/img/cursors/cursor-grab.svg') 10 10, grab;
    border: none;
}

/* Lighting mode slider - 3 position slider with labels */
#lighting-mode-slider {
    margin: 8px 0 4px 0;
}

.option-group.option-slider label {
    display: flex;
    justify-content: space-between;
    align-items: center;
    color: #c8d4e8;
    font-size: 14px;
}

.option-group.option-slider label span {
    color: #6afcff;
    font-weight: 600;
}

/* Custom checkbox styling */
.options-body-content .checkbox {
    display: flex;
    align-items: center;
    cursor: url('/3d/img/cursors/cursor-pointer.svg') 10 4, pointer;
    position: relative;
    padding-left: 34px;
    min-height: 24px;
    user-select: none;
}

.options-body-content .checkbox input[type="checkbox"] {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
    pointer-events: none;
}

.options-body-content .checkbox .checkmark {
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 22px;
    height: 22px;
    background: rgba(79, 145, 255, 0.12);
    border: 1px solid rgba(79, 145, 255, 0.35);
    border-radius: 50%;
    transition: all 0.2s ease;
}

.options-body-content .checkbox:hover .checkmark {
    background: rgba(79, 145, 255, 0.25);
    border-color: rgba(79, 145, 255, 0.6);
}

.options-body-content .checkbox input[type="checkbox"]:checked+.checkmark {
    background: rgba(79, 145, 255, 0.2);
    border-color: rgba(106, 252, 255, 0.6);
}

.options-body-content .checkbox input[type="checkbox"]:checked+.checkmark::before {
    content: "";
    position: absolute;
    left: 5px;
    top: 5px;
    right: 5px;
    bottom: 5px;
    border-radius: 50%;
    background: #6afcff;
    box-shadow: 0 0 8px rgba(106, 252, 255, 0.8);
}

.options-body-content .checkbox .checkbox-text {
    font-size: 13px;
    color: #a4caff;
    font-weight: 500;
    transition: color 0.2s;
}

.options-body-content .checkbox:hover .checkbox-text {
    color: #fff;
}

.options-body-content .checkbox input[type="checkbox"]:checked~.checkbox-text {
    color: #fff;
}

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

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

/* ========== Hotkeys Panel ========== */
.hotkeys-panel {
    width: 360px;
    max-width: 90vw;
}

.hotkeys-panel .panel-body {
    padding: 0;
    max-height: 70vh;
    overflow-y: auto;
}

.hotkeys-list {
    padding: 12px 16px;
}

.hotkeys-section {
    margin-bottom: 12px;
    background: #00000040;
    border-radius: 8px;
    padding: 10px;
}

.hotkeys-section:last-child {
    margin-bottom: 0;
}

.hotkeys-section h4 {
    margin: 0 0 8px 0;
    padding-bottom: 6px;
    font-size: 13px;
    font-weight: 600;
    color: #bb86fc;
    border-bottom: 1px solid rgba(187, 134, 252, 0.25);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.hotkey-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 7px 10px;
    margin-bottom: 4px;
    border-bottom: none;
}

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

.hotkey-key {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 28px;
    height: 26px;
    padding: 0 8px;
    background: rgba(52, 152, 219, 0.2);
    border: 1px solid rgba(52, 152, 219, 0.4);
    border-radius: 4px;
    font-family: 'Consolas', 'Monaco', monospace;
    font-size: 12px;
    font-weight: 600;
    color: #3498db;
}

.hotkey-desc {
    color: rgba(255, 255, 255, 0.85);
    font-size: 13px;
}

/* Chat Command Examples */
.command-example {
    font-family: 'Consolas', 'Monaco', monospace;
    font-size: 12px;
    color: #2ecc71;
    background: #00000050;
    border-left: 3px solid rgba(46, 204, 113, 0.5);
    padding: 7px 10px;
    margin-bottom: 4px;
    border-radius: 4px;
}

.command-example:last-child {
    margin-bottom: 0;
}

/* Chat Commands Panel */
.chat-commands-panel .hotkey-key {
    min-width: auto;
    white-space: nowrap;
    font-size: 11px;
}

.chat-commands-panel .hotkey-desc {
    flex-shrink: 1;
    text-align: right;
}

/* ========== Minimap ========== */

/* ========== 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-radius: 6px;
    padding: 24px;
    max-width: 340px;
    width: 100%;
    position: relative;
    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: #a4caff;
    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: '';
}

.pwa-modal p {
    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;
    cursor: url('/3d/img/cursors/cursor-pointer.svg') 10 4, pointer;
    position: relative;
    padding-left: 34px;
    min-height: 24px;
    user-select: none;
    margin-bottom: 16px;
    font-size: 12px;
    color: #a4caff;
}

.pwa-dont-show input[type="checkbox"] {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
    pointer-events: none;
}

.pwa-dont-show .checkmark {
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 22px;
    height: 22px;
    background: rgba(79, 145, 255, 0.12);
    border: 1px solid rgba(79, 145, 255, 0.35);
    border-radius: 50%;
    transition: all 0.2s ease;
}

.pwa-dont-show:hover .checkmark {
    background: rgba(79, 145, 255, 0.25);
    border-color: rgba(79, 145, 255, 0.6);
}

.pwa-dont-show input[type="checkbox"]:checked+.checkmark {
    background: rgba(79, 145, 255, 0.2);
    border-color: rgba(106, 252, 255, 0.6);
}

.pwa-dont-show input[type="checkbox"]:checked+.checkmark::before {
    content: "";
    position: absolute;
    left: 5px;
    top: 5px;
    right: 5px;
    bottom: 5px;
    border-radius: 50%;
    background: #6afcff;
    box-shadow: 0 0 8px rgba(106, 252, 255, 0.8);
}

.pwa-dont-show:hover {
    color: #fff;
}

.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 panel (shown when visiting @username) */
.spectator-info-panel {
    position: fixed !important;
    top: 60px;
    right: 12px;
    width: 280px;
    z-index: 600;
    display: block;
}

.spectator-info-panel.hidden {
    display: none !important;
}

.spectator-info-body {
    text-align: center;
}

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

.spectator-target-name {
    font-size: 18px;
    font-weight: bold;
    color: #6afcff;
}

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

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

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

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

.spectator-target-status .status-text {
    color: inherit;
}

.spectator-info-text {
    color: #a4caff;
    font-size: 13px;
    margin-bottom: 12px;
}

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

/* 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: #a4caff;
    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: #a4caff;
    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 (used in paperdoll tab) ==================== */
.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;
    cursor: url('/3d/img/cursors/cursor-pointer.svg') 10 4, pointer;
}

.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 {
    width: 20px;
    height: 20px;
    margin-right: 8px;
    filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.3));
    vertical-align: middle;
}

/* 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 {
    width: 16px;
    height: 16px;
    vertical-align: middle;
}

.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;
    pointer-events: none;
    margin: 0 auto;
    width: fit-content;
}

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

/* Full-width XP Bar in bottom UI */
#player-xp-bar {
    width: 100%;
    height: 8px;
    /* background: rgba(0, 0, 0, 0.5); */
    border-radius: 4px;
    /* box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.4); */
}

#player-xp-bar .xp-bar-fill {
    height: 100%;
    background: linear-gradient(to right, #ffc107, #ffdb4d);
    border-radius: 4px;
    transition: width 0.3s ease;
}

#player-xp-bar .xp-bar-text {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 9px;
    font-weight: bold;
    color: #fff;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.8);
    white-space: nowrap;
    pointer-events: none;
}

/* ========== 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);
    }
}

/* Emotes Panel */
.emotes-panel {
    position: fixed;
    top: 100px;
    left: 250px;
    width: 280px;
    max-height: 400px;
    z-index: 500;
    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);
    overflow: hidden;
}

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

.emotes-tab {
    flex: 1;
    padding: 10px 12px;
    background: transparent;
    border: none;
    color: rgba(164, 202, 255, 0.6);
    font-size: 13px;
    cursor: url('/3d/img/cursors/cursor-pointer.svg') 10 4, pointer;
    transition: all 0.2s;
}

.emotes-tab:hover {
    background: rgba(79, 145, 255, 0.1);
    color: #a4caff;
}

.emotes-tab.active {
    background: rgba(79, 145, 255, 0.15);
    color: #a4caff;
    border-bottom: 2px solid #4f91ff;
}

.emotes-content {
    padding: 12px;
    max-height: 320px;
    overflow-y: auto;
}

.emotes-list {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.emote-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(79, 145, 255, 0.2);
    border-radius: 4px;
    cursor: url('/3d/img/cursors/cursor-pointer.svg') 10 4, pointer;
    transition: all 0.2s;
}

.emote-item:hover {
    border-color: rgba(79, 145, 255, 0.5);
    background: rgba(79, 145, 255, 0.1);
    transform: translateX(2px);
}

.emote-item.dragging {
    opacity: 0.5;
    border-color: #4f91ff;
}

.emote-icon {
    min-width: 24px;
    text-align: center;
    display: flex;
    align-items: center;
    justify-content: center;
}

.emote-svg-icon {
    width: 20px;
    height: 20px;
    color: rgba(164, 202, 255, 0.7);
}

.emote-item:hover .emote-svg-icon {
    color: #a4caff;
}

.emote-name {
    color: #a4caff;
    font-size: 13px;
    text-transform: capitalize;
}

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

/* Emote action slot styling */
.action-slot.emote-action {
    border-color: rgba(155, 89, 182, 0.5);
}

.action-slot.emote-action:hover {
    border-color: rgba(155, 89, 182, 0.8);
    box-shadow: 0 0 8px rgba(155, 89, 182, 0.3);
}

/* ========== Debug Panel ========== */
.debug-panel .debug-options-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.debug-option {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 12px;
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(79, 145, 255, 0.2);
    border-radius: 4px;
    cursor: url('/3d/img/cursors/cursor-pointer.svg') 10 4, pointer;
    transition: all 0.2s;
}

.debug-option:hover {
    border-color: rgba(79, 145, 255, 0.5);
    background: rgba(79, 145, 255, 0.1);
}

.debug-option-info {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

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

.debug-option-desc {
    color: rgba(164, 202, 255, 0.6);
    font-size: 11px;
}

.debug-option-toggle {
    padding: 4px 10px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: bold;
    background: rgba(255, 100, 100, 0.2);
    color: #ff6b6b;
    border: 1px solid rgba(255, 100, 100, 0.3);
}

.debug-option-toggle.on {
    background: rgba(100, 255, 100, 0.2);
    color: #6bff6b;
    border-color: rgba(100, 255, 100, 0.3);
}

/* ========== Guest Auth Buttons ========== */
#guest-auth-buttons {
    position: fixed;
    top: 24px;
    left: 12px;
    display: flex;
    gap: 8px;
    z-index: 100;
}

#guest-auth-buttons .auth-btn {
    padding: 10px 20px;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 600;
    text-decoration: none;
    transition: all 0.2s ease;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

#guest-auth-buttons .login-btn {
    background: rgba(59, 130, 246, 0.9);
    color: white;
}

#guest-auth-buttons .login-btn:hover {
    background: rgba(59, 130, 246, 1);
    transform: translateY(-1px);
}

#guest-auth-buttons .register-btn {
    background: rgba(34, 197, 94, 0.9);
    color: white;
}

#guest-auth-buttons .register-btn:hover {
    background: rgba(34, 197, 94, 1);
    transform: translateY(-1px);
}

/* ========== Health Bar HUD ========== */
#health-hud {
    position: fixed;
    top: 24px;
    left: 12px;
    right: 12px;
    /* display: flex; */
    gap: 8px;
    z-index: 100;
    pointer-events: none;
    /* max-width: 100%; */
    display: grid;
    grid-template-columns: 1fr 1fr;
    width: fit-content;
}

.health-bar-container {
    flex-direction: row;
    gap: 8px;
    padding: 6px 8px;
    border: 1px solid rgba(0, 0, 0, 0.16);
    border-radius: 8px;
    background: rgba(100, 169, 255, 0);
    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 0px rgba(0, 0, 0, 0.3);
    max-width: 100%;
    overflow: hidden;
}

.portrait-container {
    width: 58px;
    height: 58px;
    flex-shrink: 0;
    border-radius: 4px;
    overflow: hidden;
    margin: -10px 6px -10px -10px;
    position: relative;
}

.portrait-level {
    position: absolute;
    bottom: 2px;
    right: 2px;
    background: #ffc107;
    color: #000000;
    text-shadow: none;
    font-size: 11px;
    font-weight: bold;
    min-width: 18px;
    height: 18px;
    line-height: 18px;
    text-align: center;
    border-radius: 9px;
}

.health-bar-container.target .portrait-level {
    background: linear-gradient(135deg, #ff6b6b, #ee5a5a);
    color: #fff;
}

.health-bar-container.target .portrait-container {
    border-color: rgba(255, 100, 100, 0.3);
}

.portrait-canvas {
    width: 100%;
    height: 100%;
    display: block;
}

.health-info {
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 3px;
    flex: 1;
    min-width: 0;
}

.health-bar-container.target {
    border-color: rgba(255, 100, 100, 0.4);
    background-color: rgba(255, 100, 100, 0.25);
    opacity: 0;
    transform: translateX(-10px);
    transition: opacity 0.2s, transform 0.2s, border-color 0.3s, background-color 0.3s;
}

.health-bar-container.target.visible {
    opacity: 1;
    transform: translateX(0);
}

/* Friendly target — green tint */
.health-bar-container.target.target-friendly {
    border-color: rgba(46, 204, 113, 0.4);
    background-color: rgba(46, 204, 113, 0.2);
}

.health-bar-container.target.target-friendly .portrait-level {
    background: linear-gradient(135deg, #2ecc71, #27ae60);
}

.health-bar-container.target.target-friendly .portrait-container {
    border-color: rgba(46, 204, 113, 0.3);
}

/* Hostile target — red tint (explicit, overrides default) */
.health-bar-container.target.target-hostile {
    border-color: rgba(255, 100, 100, 0.4);
    background-color: rgba(255, 100, 100, 0.25);
}

.health-bar-container.target.target-hostile .portrait-level {
    background: linear-gradient(135deg, #ff6b6b, #ee5a5a);
}

.health-bar-container.target.target-hostile .portrait-container {
    border-color: rgba(255, 100, 100, 0.3);
}

.health-bar-label {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 11px;
    color: #a4caff;
    font-weight: bold;
    gap: 12px;
}

.health-bar-label .name {
    max-width: 100px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.health-bar-label .value {
    font-family: monospace;
    color: #7fca7f;
}

.health-bar-track {
    height: 10px;
    background: rgba(0, 0, 0, 0.5);
    border-radius: 5px;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.health-bar-fill {
    height: 100%;
    background: linear-gradient(to bottom, #4ade80, #22c55e);
    border-radius: 4px;
    transition: width 0.3s ease;
    box-shadow: 0 0 6px rgba(74, 222, 128, 0.3);
}

/* Mana Bar in HUD */
.mana-bar-track {
    height: 6px;
    background: rgba(0, 0, 0, 0.5);
    border-radius: 3px;
    overflow: hidden;
    margin-top: 2px;
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.mana-bar-fill {
    height: 100%;
    background: linear-gradient(to bottom, #60a5fa, #3b82f6);
    border-radius: 2px;
    transition: width 0.3s ease;
    box-shadow: 0 0 6px rgba(96, 165, 250, 0.3);
}

.mana-bar-fill.low {
    background: linear-gradient(to bottom, #93c5fd, #60a5fa);
}

.mana-bar-fill.critical {
    background: linear-gradient(to bottom, #c4b5fd, #a78bfa);
    animation: mana-pulse 2s ease-in-out infinite;
}

@keyframes mana-pulse {

    0%,
    100% {
        opacity: 1;
    }

    50% {
        opacity: 0.6;
    }
}

/* ========== Cast Bar ========== */
#cast-bar-container {
    position: fixed;
    left: 50%;
    bottom: 35%;
    transform: translateX(-50%);
    z-index: 200;
    pointer-events: none;

    display: none;
}

#cast-bar-container.hidden {
    display: none;
}

.cast-bar-content {
    background: rgba(0, 0, 0, 0.85);
    border: 1px solid rgba(138, 180, 248, 0.4);
    border-radius: 8px;
    padding: 8px 16px;
    min-width: 200px;
    text-align: center;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.5),
        0 0 15px rgba(138, 180, 248, 0.2);
    backdrop-filter: blur(8px);
}

.cast-bar-spell-name {
    display: block;
    color: #fff;
    font-size: 12px;
    font-weight: 600;
    margin-bottom: 6px;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.5);
}

.cast-bar-track {
    height: 12px;
    background: rgba(0, 0, 0, 0.6);
    border-radius: 6px;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.cast-bar-fill {
    height: 100%;
    width: 0%;
    background: linear-gradient(to right, #60a5fa, #3b82f6, #8b5cf6);
    border-radius: 5px;
    transition: width 0.05s linear;
    box-shadow: 0 0 10px rgba(96, 165, 250, 0.5);
    position: relative;
}

.cast-bar-fill::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 50%;
    background: linear-gradient(to bottom, rgba(255, 255, 255, 0.3), transparent);
    border-radius: 5px 5px 0 0;
}

.cast-bar-time {
    display: block;
    color: #a4caff;
    font-size: 10px;
    font-family: monospace;
    margin-top: 4px;
}

/* Cast bar interrupt animation */
.cast-bar-content.interrupted {
    animation: castInterrupt 0.3s ease-out;
}

@keyframes castInterrupt {
    0% {
        transform: scale(1);
    }

    50% {
        transform: scale(1.05);
        border-color: #ef4444;
    }

    100% {
        transform: scale(1);
        opacity: 0;
    }
}

/* ========== Spell Casting Progress ========== */
.spell-progress {
    position: fixed;
    left: 50%;
    bottom: 35%;
    transform: translateX(-50%);
    z-index: 200;
    pointer-events: none;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
}

.spell-progress.hidden {
    display: none;
}

/* Icon row */
.sp-icons {
    display: flex;
    align-items: center;
    gap: 0;
}

/* Individual icon slot */
.sp-slot {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 3px;
    opacity: 1;
    transition: opacity 0.2s ease;
}

.sp-slot.pending {
    opacity: 0.3;
}

.sp-slot.active {
    opacity: 1;
}

/* Icon circle */
.sp-icon-circle {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.8);
    border: 2px solid rgba(255, 255, 255, 0.15);
    display: flex;
    align-items: center;
    justify-content: center;
    color: rgba(255, 255, 255, 0.3);
    font-size: 14px;
    font-weight: 600;
    backdrop-filter: blur(6px);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.4);
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
}

.sp-slot.active .sp-icon-circle {
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.5),
                0 0 8px currentColor;
}

/* Pop-in animation on activation */
.sp-slot.sp-pop .sp-icon-circle {
    animation: spPopIn 0.35s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
}

@keyframes spPopIn {
    0% { transform: scale(0.3); opacity: 0; }
    100% { transform: scale(1); opacity: 1; }
}

/* Connector line between icons */
.sp-connector {
    width: 16px;
    height: 2px;
    background: rgba(255, 255, 255, 0.12);
    margin: 0 2px;
    margin-bottom: 16px; /* align with circles, not labels */
    border-radius: 1px;
    transition: background 0.3s ease;
}

/* Light up connectors when adjacent slots are active */
.sp-slot.active + .sp-connector {
    background: rgba(255, 255, 255, 0.35);
}

.sp-slot.active + .sp-connector + .sp-slot.active ~ .sp-connector,
.sp-connector:has(+ .sp-slot.active) {
    background: rgba(255, 255, 255, 0.35);
}

/* Icon label */
.sp-label {
    font-size: 9px;
    color: #aaa;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-weight: 500;
    white-space: nowrap;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.8);
}

/* Spell name below icons */
.sp-spell-name {
    font-size: 13px;
    font-weight: 700;
    color: #fff;
    text-shadow: 0 1px 4px rgba(0, 0, 0, 0.8),
                 0 0 10px currentColor;
    letter-spacing: 1px;
    text-transform: uppercase;
    opacity: 0;
    transform: translateY(-4px);
    transition: opacity 0.2s ease, transform 0.2s ease;
}

.sp-spell-name.sp-name-pop {
    animation: spNamePop 0.4s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
}

@keyframes spNamePop {
    0% { opacity: 0; transform: translateY(4px) scale(0.8); }
    60% { opacity: 1; transform: translateY(-2px) scale(1.05); }
    100% { opacity: 1; transform: translateY(0) scale(1); }
}

/* Complete state — glow pulse on all icons */
.spell-progress.sp-complete .sp-icon-circle {
    animation: spCompletePulse 0.5s ease-out;
}

@keyframes spCompletePulse {
    0% { box-shadow: 0 2px 12px rgba(0,0,0,0.5), 0 0 8px currentColor; }
    50% { box-shadow: 0 2px 12px rgba(0,0,0,0.5), 0 0 20px currentColor, 0 0 35px currentColor; }
    100% { box-shadow: 0 2px 12px rgba(0,0,0,0.5), 0 0 8px currentColor; }
}

/* Fade out */
.spell-progress.sp-fade-out {
    animation: spFadeOut 0.4s ease-out forwards;
}

@keyframes spFadeOut {
    0% { opacity: 1; transform: translateX(-50%) translateY(0); }
    100% { opacity: 0; transform: translateX(-50%) translateY(-8px); }
}

/* Shake on interrupt */
.spell-progress.sp-shake {
    animation: spShake 0.3s ease-out;
}

@keyframes spShake {
    0% { transform: translateX(-50%) translateX(0); }
    20% { transform: translateX(-50%) translateX(-6px); }
    40% { transform: translateX(-50%) translateX(5px); }
    60% { transform: translateX(-50%) translateX(-3px); }
    80% { transform: translateX(-50%) translateX(2px); }
    100% { transform: translateX(-50%) translateX(0); }
}

/* XP Bar in HUD */
.xp-bar-track {
    height: 4px;
    background: rgba(0, 0, 0, 0.5);
    border-radius: 2px;
    overflow: hidden;
    margin-top: 2px;
}

.xp-bar-fill {
    height: 100%;
    background: linear-gradient(to right, #ffc107, #ffdb4d);
    border-radius: 2px;
    transition: width 0.5s ease;
    box-shadow: 0 0 4px rgba(255, 193, 7, 0.4);
}

/* Hide target XP bar by default, show only for pets */
.xp-bar-track.target-xp {
    display: none;
}

.health-bar-container.target.has-xp .xp-bar-track.target-xp {
    display: block;
}

.health-bar-fill.low {
    background: linear-gradient(to bottom, #fbbf24, #f59e0b);
    box-shadow: 0 0 6px rgba(251, 191, 36, 0.3);
}

.health-bar-fill.critical {
    background: linear-gradient(to bottom, #f87171, #ef4444);
    box-shadow: 0 0 6px rgba(248, 113, 113, 0.3);
    animation: health-pulse 1s ease-in-out infinite;
}

@keyframes health-pulse {

    0%,
    100% {
        opacity: 1;
    }

    50% {
        opacity: 0.7;
    }
}

/* Dead creature health bar */
.health-bar-fill.dead {
    background: linear-gradient(to bottom, #6b7280, #4b5563);
    box-shadow: none;
}

/* Target loot button */
.target-loot-btn {
    position: absolute;
    bottom: -32px;
    left: 50%;
    transform: translateX(-50%);
    background: linear-gradient(135deg, #fbbf24, #f59e0b);
    border: 1px solid rgba(251, 191, 36, 0.5);
    border-radius: 6px;
    padding: 6px 16px;
    color: #1a1a2e;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    white-space: nowrap;
}

.target-loot-btn:hover {
    background: linear-gradient(135deg, #fcd34d, #fbbf24);
    transform: translateX(-50%) scale(1.05);
    box-shadow: 0 4px 12px rgba(251, 191, 36, 0.4);
}

.target-loot-btn:active {
    transform: translateX(-50%) scale(0.98);
}

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

/* ========== Bottom UI Collapsed Indicator ========== */
#bottom-ui-collapsed {
    display: none;
    position: fixed;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0, 0, 0, 0.7);
    border: 1px solid rgba(79, 145, 255, 0.3);
    border-bottom: none;
    border-radius: 12px 12px 0 0;
    padding: 12px 28px;
    color: rgba(164, 202, 255, 0.8);
    font-size: 14px;
    z-index: 200;
    pointer-events: auto;
    touch-action: auto;
    flex-direction: column;
    align-items: center;
    gap: 2px;
    backdrop-filter: blur(4px);
    cursor: pointer;
    -webkit-tap-highlight-color: rgba(79, 145, 255, 0.3);
}

#bottom-ui-collapsed:hover {
    background: rgba(0, 0, 0, 0.85);
    border-color: rgba(79, 145, 255, 0.5);
}

#bottom-ui-collapsed .arrow-up {
    font-size: 14px;
    line-height: 1;
}

#bottom-ui-collapsed .collapse-text {
    font-size: 10px;
    opacity: 0.7;
}

/* Bottom UI transition for hiding */
#bottom-game-ui {
    transition: transform 0.3s ease, opacity 0.3s ease;
}

#bottom-game-ui.hiding {
    transform: translateY(100%);
    opacity: 0;
    pointer-events: none;
}

#bottom-game-ui.hiding>* {
    pointer-events: none;
}

/* Show collapsed indicator when UI is hidden */
#bottom-ui-collapsed.visible {
    display: flex;
}

/* ========== MAGIC SCHOOL CRAFTING SELECTION MODAL ========== */

.magic-school-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.85);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    backdrop-filter: blur(4px);
}

.magic-school-modal-content {
    background: linear-gradient(145deg, rgba(20, 25, 35, 0.98), rgba(10, 15, 25, 0.98));
    border: 1px solid rgba(79, 145, 255, 0.3);
    border-radius: 12px;
    padding: 20px;
    max-width: 600px;
    width: 90%;
    max-height: 80vh;
    overflow-y: auto;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5), inset 0 1px 0 rgba(255, 255, 255, 0.05);
}

.magic-school-modal-header {
    text-align: center;
    margin-bottom: 20px;
}

.magic-school-modal-header h3 {
    margin: 0 0 8px 0;
    color: #a4caff;
    font-size: 18px;
    font-weight: 600;
}

.magic-school-modal-subtitle {
    color: rgba(164, 202, 255, 0.7);
    font-size: 13px;
}

.magic-school-modal-subtitle strong {
    color: #a4caff;
}

.magic-school-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 10px;
    margin-bottom: 20px;
}

.magic-school-select-btn {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 12px;
    background: rgba(30, 35, 50, 0.8);
    border: 1px solid rgba(100, 100, 100, 0.3);
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
    color: #a4caff;
}

.magic-school-select-btn:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.magic-school-select-btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

.magic-school-select-btn.cannot-afford {
    background: rgba(50, 30, 30, 0.5);
    border-color: rgba(100, 50, 50, 0.3);
}

/* Color preview swatches */
.magic-school-color-preview {
    display: flex;
    gap: 4px;
    margin-bottom: 8px;
}

.magic-school-color-preview .color-swatch {
    width: 24px;
    height: 24px;
    border-radius: 4px;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.magic-school-color-preview .color-swatch.main {
    width: 32px;
    height: 32px;
}

.magic-school-select-info {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
}

.magic-school-select-name {
    font-size: 12px;
    font-weight: 500;
}

.magic-school-select-cost {
    font-size: 10px;
    opacity: 0.7;
}

.magic-school-select-cost.increased {
    color: #ff9966;
    opacity: 1;
}

.magic-school-select-cost.very-high {
    color: #ff4444;
    opacity: 1;
    font-weight: 600;
}

.magic-school-name-preview {
    font-size: 9px;
    opacity: 0.6;
    font-style: italic;
    max-width: 140px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* Magic school button corners (like existing magic-school-btn) */
.magic-school-select-btn .corner {
    position: absolute;
    width: 6px;
    height: 6px;
    border: 1px solid transparent;
}

.magic-school-select-btn .corner.top-left {
    top: 2px;
    left: 2px;
    border-top-color: inherit;
    border-left-color: inherit;
}

.magic-school-select-btn .corner.top-right {
    top: 2px;
    right: 2px;
    border-top-color: inherit;
    border-right-color: inherit;
}

.magic-school-select-btn .corner.bottom-left {
    bottom: 2px;
    left: 2px;
    border-bottom-color: inherit;
    border-left-color: inherit;
}

.magic-school-select-btn .corner.bottom-right {
    bottom: 2px;
    right: 2px;
    border-bottom-color: inherit;
    border-right-color: inherit;
}

/* Magic school specific colors for selection buttons */
.magic-school-select-btn.plain .corner {
    border-color: #a4caff;
}

.magic-school-select-btn.plain:hover:not(:disabled) {
    background-color: rgba(164, 202, 255, 0.15);
    color: #a4caff;
    border-color: #a4caff;
}

.magic-school-select-btn.earth .corner {
    border-color: #ffd182;
}

.magic-school-select-btn.earth:hover:not(:disabled) {
    background-color: #4d3100;
    color: #ffd182;
    border-color: #ffd182;
}

.magic-school-select-btn.air .corner {
    border-color: #c9edff;
}

.magic-school-select-btn.air:hover:not(:disabled) {
    background-color: #2365a6;
    color: #c9edff;
    border-color: #c9edff;
}

.magic-school-select-btn.water .corner {
    border-color: #a4ecff;
}

.magic-school-select-btn.water:hover:not(:disabled) {
    background-color: #143a46;
    color: #a4ecff;
    border-color: #a4ecff;
}

.magic-school-select-btn.fire .corner {
    border-color: #ffc29d;
}

.magic-school-select-btn.fire:hover:not(:disabled) {
    background-color: #590303;
    color: #ffc29d;
    border-color: #f69e6a;
}

.magic-school-select-btn.nature .corner {
    border-color: #90c941;
}

.magic-school-select-btn.nature:hover:not(:disabled) {
    background-color: #3a6300;
    color: #cdff86;
    border-color: #90c941;
}

.magic-school-select-btn.tech .corner {
    border-color: #cea4ff;
}

.magic-school-select-btn.tech:hover:not(:disabled) {
    background-color: #3b0081;
    color: #cea4ff;
    border-color: #cea4ff;
}

.magic-school-select-btn.life .corner {
    border-color: #91ffad;
}

.magic-school-select-btn.life:hover:not(:disabled) {
    background-color: #005d18;
    color: #c6ffd4;
    border-color: #c6ffd4;
}

.magic-school-select-btn.death .corner {
    border-color: #a4caff;
}

.magic-school-select-btn.death:hover:not(:disabled) {
    background-color: #2a2a2a;
    color: #a4caff;
    border-color: #a4caff;
}

.magic-school-select-btn.divine .corner {
    border-color: #fffb00;
}

.magic-school-select-btn.divine:hover:not(:disabled) {
    background-color: #363b00;
    color: #fffb00;
    border-color: #fffb00;
}

.magic-school-select-btn.infernal .corner {
    border-color: #f343ff;
}

.magic-school-select-btn.infernal:hover:not(:disabled) {
    background-color: #240000;
    color: #f343ff;
    border-color: #f343ff;
}

.magic-school-select-btn.arcane .corner {
    border-color: #e779ff;
}

.magic-school-select-btn.arcane:hover:not(:disabled) {
    background-color: #520089;
    color: #e779ff;
    border-color: #e779ff;
}

.magic-school-modal-footer {
    display: flex;
    justify-content: center;
}

.magic-school-cancel-btn {
    padding: 8px 24px;
    background: rgba(80, 80, 80, 0.5);
    border: 1px solid rgba(100, 100, 100, 0.4);
    border-radius: 6px;
    color: inherit;
    cursor: pointer;
    font-size: 13px;
    transition: all 0.2s ease;
}

.magic-school-cancel-btn:hover {
    background: rgba(100, 100, 100, 0.6);
    color: #a4caff;
}

/* ========== Trade Modal Styles ========== */

.trade-modal {
    min-width: 280px;
    max-width: 350px;
}

.trade-offer-info {
    text-align: center;
    padding: 10px 0;
}

.trade-offer-info p {
    margin: 8px 0;
    color: #ddd;
    font-size: 14px;
}

.trade-item {
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(79, 145, 255, 0.3);
    border-radius: 6px;
    padding: 12px 16px;
    margin: 12px 0;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.trade-item-qty {
    color: #f1c40f;
    font-weight: bold;
    font-size: 15px;
}

.trade-item-name {
    color: #fff;
    font-size: 15px;
}

.trade-expiry {
    color: #e74c3c;
    font-size: 12px;
    opacity: 0.8;
}

.trade-pending {
    color: #f39c12;
    font-size: 12px;
    animation: pulse 1.5s infinite;
}

@keyframes pulse {

    0%,
    100% {
        opacity: 0.6;
    }

    50% {
        opacity: 1;
    }
}

.trade-actions {
    display: flex;
    gap: 10px;
    justify-content: center;
    padding-top: 10px;
}

.trade-actions .btn {
    padding: 8px 20px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 6px;
    color: #fff;
    cursor: pointer;
    font-size: 13px;
    transition: all 0.2s ease;
}

.trade-actions .btn:hover {
    filter: brightness(1.2);
}


/* ============================================
   Zone Name Display & Modal
   ============================================ */

/* Zone name display above chat */
#zone-name-display {
    display: block;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
    align-self: flex-start;
    max-width: fit-content;
    cursor: url('/3d/img/cursors/cursor-pointer.svg') 10 4, pointer;
}

#zone-name-display.hidden {
    display: none;
}

#zone-name-display .zone-icon {
    font-size: 18px;
    line-height: 1;
}

#zone-name-display .zone-name-text {
    color: #a4caff;
    font-family: "Noto Sans", cursive;
    font-size: 15px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 200px;
}

/* Zone fade-in animation */
@keyframes zoneFadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

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

#zone-name-display.zone-entering {
    animation: zoneFadeIn 0.4s ease-out;
}

/* Zone Info Panel (draggable, no overlay) */
.zone-info-panel {
    position: fixed;
    top: 100px;
    left: 50%;
    transform: translateX(-50%);
    width: 340px;
    min-width: 300px;
    max-width: 90vw;
    z-index: 500;
    overflow: hidden;
    background: rgba(10, 20, 40, 0.95);
    border: 1px solid rgba(79, 145, 255, 0.4);
    border-radius: 8px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.5);
}

.zone-info-panel .zone-info-content {
    max-height: 70vh;
    overflow-y: auto;
}

.zone-info-header {
    padding: 12px 16px;
    text-align: center;
}

.zone-info-header h2 {
    margin: 0 0 4px 0;
    color: #fff;
    font-family: "Noto Sans", cursive;
    font-size: 18px;
    font-weight: 500;
}

.zone-tagline {
    font-size: 14px;
    font-style: italic;
    opacity: 0.9;
}

.zone-info-body {
    padding: 12px 16px 16px;
    overflow-y: auto;
}

.zone-info-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.zone-info-row:last-of-type {
    border-bottom: none;
}

.zone-info-label {
    color: #7a8b9e;
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.zone-info-value {
    color: #a4caff;
    font-size: 14px;
    font-weight: 500;
}

.zone-info-section {
    margin-top: 16px;
    padding-top: 16px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.zone-info-section h4 {
    margin: 0 0 10px 0;
    color: #a4caff;
    font-size: 14px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.zone-info-section p {
    margin: 0;
    color: #c0c0c0;
    font-size: 14px;
    line-height: 1.6;
}

/* Zone traits tags */
.zone-traits-list {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.zone-trait-tag {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 5px 12px;
    background: rgba(79, 145, 255, 0.15);
    border: 1px solid rgba(79, 145, 255, 0.3);
    border-radius: 20px;
    font-size: 12px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
}

.zone-trait-tag:hover {
    filter: brightness(1.3);
    transform: scale(1.05);
}

.zone-trait-tag.trait-danger {
    background: rgba(231, 76, 60, 0.15);
    border-color: rgba(231, 76, 60, 0.3);
    color: #e57373;
}

.zone-trait-tag.trait-magical {
    background: rgba(155, 89, 182, 0.15);
    border-color: rgba(155, 89, 182, 0.3);
    color: #ce93d8;
}

.zone-trait-tag.trait-nature {
    background: rgba(46, 204, 113, 0.15);
    border-color: rgba(46, 204, 113, 0.3);
    color: #81c784;
}

.zone-trait-tag.trait-ancient {
    background: rgba(241, 196, 15, 0.15);
    border-color: rgba(241, 196, 15, 0.3);
    color: #ffd54f;
}

/* Zone effects list */
.zone-effects-list {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.zone-effect-item {
    display: flex;
    flex-direction: column;
    gap: 2px;
    padding: 8px 10px;
    background: rgba(0, 0, 0, 0.2);
    border-radius: 6px;
}

.zone-effect-item .effect-main {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    font-weight: 500;
}

.zone-effect-item .effect-icon {
    font-size: 14px;
}

.zone-effect-item .effect-desc {
    font-size: 11px;
    color: #a4caff;
    padding-left: 22px;
    line-height: 1.3;
}

.zone-effect-item.effect-positive {
    color: #81c784;
}

.zone-effect-item.effect-negative {
    color: #e57373;
}

.zone-effect-item.effect-neutral {
    color: #90caf9;
}

/* Trait Info Popup */
.trait-info-popup {
    background: rgba(30, 35, 45, 0.98);
    border: 1px solid rgba(79, 145, 255, 0.3);
    border-radius: 10px;
    padding: 12px 14px;
    max-width: 280px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.5);
    animation: traitPopupFadeIn 0.2s ease-out;
}

@keyframes traitPopupFadeIn {
    from {
        opacity: 0;
        transform: translateY(-5px);
    }

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

.trait-popup-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}

.trait-popup-name {
    font-size: 14px;
    font-weight: 600;
    padding: 4px 10px;
    border-radius: 12px;
    background: rgba(79, 145, 255, 0.15);
}

.trait-popup-name.trait-danger {
    background: rgba(231, 76, 60, 0.15);
    color: #e57373;
}

.trait-popup-name.trait-magical {
    background: rgba(155, 89, 182, 0.15);
    color: #ce93d8;
}

.trait-popup-name.trait-nature {
    background: rgba(46, 204, 113, 0.15);
    color: #81c784;
}

.trait-popup-name.trait-ancient {
    background: rgba(241, 196, 15, 0.15);
    color: #ffd54f;
}

.trait-popup-close {
    background: transparent;
    border: none;
    color: #a4caff;
    font-size: 20px;
    cursor: pointer;
    padding: 0 4px;
    line-height: 1;
    transition: color 0.2s;
}

.trait-popup-close:hover {
    color: #fff;
}

.trait-popup-desc {
    font-size: 12px;
    line-height: 1.5;
    color: #c0c8d0;
}

/* Mobile adjustments */
@media (max-width: 600px) {
    #zone-name-display {
        padding: 6px 12px;
        margin-bottom: 6px;
    }

    #zone-name-display .zone-name-text {
        font-size: 13px;
        max-width: 150px;
    }

    .zone-info-content {
        max-width: 95%;
        max-height: 85vh;
    }

    .zone-info-header {
        padding: 18px 16px 12px;
    }

    .zone-info-header h2 {
        font-size: 20px;
    }

    .zone-info-body {
        padding: 12px 16px 20px;
    }
}

/* ========== Ask AI Panel ========== */
.ask-ai-panel {
    position: fixed;
    top: 100px;
    right: 20px;
    z-index: 100;
}

.ask-ai-panel .panel-body {
    display: flex;
    flex-direction: column;
    height: 400px;
    padding: 0;
}

.ask-ai-messages {
    flex: 1;
    overflow-y: auto;
    padding: 12px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.ask-ai-message {
    max-width: 85%;
    padding: 10px 14px;
    border-radius: 12px;
    font-size: 13px;
    line-height: 1.5;
    word-wrap: break-word;
}

.ask-ai-user {
    align-self: flex-end;
    background: linear-gradient(135deg, rgba(52, 152, 219, 0.4) 0%, rgba(41, 128, 185, 0.5) 100%);
    border: 1px solid rgba(52, 152, 219, 0.5);
    color: #e8f4fc;
    border-bottom-right-radius: 4px;
}

.ask-ai-assistant {
    align-self: flex-start;
    background: linear-gradient(135deg, rgba(46, 204, 113, 0.25) 0%, rgba(39, 174, 96, 0.35) 100%);
    border: 1px solid rgba(46, 204, 113, 0.4);
    color: #e8fcf0;
    border-bottom-left-radius: 4px;
}

.ask-ai-assistant strong {
    color: #7dcea0;
}

.ask-ai-assistant em {
    color: #a9dfbf;
}

.ask-ai-loading {
    align-self: flex-start;
    background: rgba(100, 100, 100, 0.3);
    border: 1px solid rgba(150, 150, 150, 0.3);
    color: inherit;
    padding: 10px 20px;
}

.loading-dots span {
    animation: loadingDot 1.4s infinite;
    animation-fill-mode: both;
    font-size: 20px;
    line-height: 1;
}

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

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

@keyframes loadingDot {

    0%,
    80%,
    100% {
        opacity: 0.3;
    }

    40% {
        opacity: 1;
    }
}

.ask-ai-input-area {
    display: flex;
    gap: 8px;
    padding: 12px;
    border-top: 1px solid rgba(79, 145, 255, 0.2);
    background: rgba(0, 0, 0, 0.2);
}

.ask-ai-input {
    flex: 1;
    background: rgba(0, 0, 0, 0.4);
    border: 1px solid rgba(79, 145, 255, 0.3);
    border-radius: 8px;
    padding: 10px 14px;
    color: #f0f0f0;
    font-size: 13px;
    outline: none;
    transition: border-color 0.2s;
}

.ask-ai-input:focus {
    border-color: rgba(79, 145, 255, 0.6);
}

.ask-ai-input::placeholder {
    color: #a4caff;
}

.ask-ai-send-btn {
    background: linear-gradient(135deg, rgba(52, 152, 219, 0.5) 0%, rgba(41, 128, 185, 0.6) 100%);
    border: 1px solid rgba(52, 152, 219, 0.5);
    border-radius: 8px;
    color: #fff;
    font-size: 16px;
    width: 44px;
    cursor: url('/3d/img/cursors/cursor-pointer.svg') 10 4, pointer;
    transition: all 0.2s;
}

.ask-ai-send-btn:hover {
    background: linear-gradient(135deg, rgba(52, 152, 219, 0.7) 0%, rgba(41, 128, 185, 0.8) 100%);
    border-color: rgba(52, 152, 219, 0.8);
}

.ask-ai-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 12px;
    border-top: 1px solid rgba(79, 145, 255, 0.15);
    background: rgba(0, 0, 0, 0.15);
}

.ask-ai-clear-btn {
    background: rgba(231, 76, 60, 0.2);
    border: 1px solid rgba(231, 76, 60, 0.3);
    border-radius: 6px;
    color: #e74c3c;
    font-size: 11px;
    padding: 5px 10px;
    cursor: url('/3d/img/cursors/cursor-pointer.svg') 10 4, pointer;
    transition: all 0.2s;
}

.ask-ai-clear-btn:hover {
    background: rgba(231, 76, 60, 0.3);
    border-color: rgba(231, 76, 60, 0.5);
}

.ask-ai-hint {
    font-size: 10px;
    color: #666;
    font-style: italic;
}

/* Mobile adjustments */
@media (max-width: 600px) {
    .ask-ai-panel {
        left: 10px;
        right: 10px;
        top: auto;
        bottom: 60px;
        width: auto !important;
    }

    .ask-ai-panel .panel-body {
        height: 350px;
    }

    .ask-ai-message {
        max-width: 90%;
        font-size: 12px;
    }
}

/* ========== Level Tier System ========== */

/* Tier color definitions */
:root {
    --tier-novice: #95a5a6;
    --tier-novice-elite: #3498db;
    --tier-novice-boss: #9b59b6;
    --tier-apprentice: #27ae60;
    --tier-apprentice-elite: #2980b9;
    --tier-apprentice-boss: #8e44ad;
    --tier-journeyman: #f39c12;
    --tier-journeyman-elite: #d35400;
    --tier-journeyman-boss: #c0392b;
    --tier-expert: #e74c3c;
    --tier-expert-elite: #9b59b6;
    --tier-expert-boss: #8e44ad;
    --tier-master: #9b59b6;
    --tier-master-elite: #f1c40f;
    --tier-master-boss: #e74c3c;
    --tier-grandmaster: #f1c40f;
    --tier-grandmaster-elite: #e74c3c;
    --tier-grandmaster-boss: #c0392b;
}

/* Tier badges for creature nameplates */
.tier-badge {
    display: inline-block;
    padding: 2px 6px;
    border-radius: 3px;
    font-size: 9px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-left: 4px;
}

.tier-badge.tier-novice {
    background: var(--tier-novice);
    color: #fff;
}

.tier-badge.tier-apprentice {
    background: var(--tier-apprentice);
    color: #fff;
}

.tier-badge.tier-journeyman {
    background: var(--tier-journeyman);
    color: #fff;
}

.tier-badge.tier-expert {
    background: var(--tier-expert);
    color: #fff;
}

.tier-badge.tier-master {
    background: var(--tier-master);
    color: #fff;
}

.tier-badge.tier-grandmaster {
    background: var(--tier-grandmaster);
    color: #1a1a2e;
}

/* Creature power badges */
.power-badge {
    display: inline-block;
    padding: 2px 5px;
    border-radius: 3px;
    font-size: 8px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.3px;
    margin-left: 4px;
}

.power-badge.power-elite {
    background: linear-gradient(135deg, #3498db, #2980b9);
    color: #fff;
    box-shadow: 0 0 6px rgba(52, 152, 219, 0.4);
}

.power-badge.power-boss {
    background: linear-gradient(135deg, #9b59b6, #8e44ad);
    color: #fff;
    box-shadow: 0 0 8px rgba(155, 89, 182, 0.5);
    animation: boss-pulse 2s ease-in-out infinite;
}

.power-badge.power-legendary {
    background: linear-gradient(135deg, #f1c40f, #e74c3c);
    color: #fff;
    box-shadow: 0 0 12px rgba(241, 196, 15, 0.6);
    animation: legendary-glow 1.5s ease-in-out infinite;
}

@keyframes boss-pulse {

    0%,
    100% {
        box-shadow: 0 0 8px rgba(155, 89, 182, 0.5);
    }

    50% {
        box-shadow: 0 0 16px rgba(155, 89, 182, 0.8);
    }
}

@keyframes legendary-glow {

    0%,
    100% {
        box-shadow: 0 0 12px rgba(241, 196, 15, 0.6);
        transform: scale(1);
    }

    50% {
        box-shadow: 0 0 20px rgba(231, 76, 60, 0.8);
        transform: scale(1.02);
    }
}

/* Health bar colors by tier */
.health-bar-fill.tier-novice {
    background: linear-gradient(to bottom, #bdc3c7, #95a5a6);
}

.health-bar-fill.tier-apprentice {
    background: linear-gradient(to bottom, #2ecc71, #27ae60);
}

.health-bar-fill.tier-journeyman {
    background: linear-gradient(to bottom, #f1c40f, #f39c12);
}

.health-bar-fill.tier-expert {
    background: linear-gradient(to bottom, #e74c3c, #c0392b);
}

.health-bar-fill.tier-master {
    background: linear-gradient(to bottom, #9b59b6, #8e44ad);
}

.health-bar-fill.tier-grandmaster {
    background: linear-gradient(to bottom, #f1c40f, #e67e22);
}

/* Creature nameplate color variations by tier */
.health-bar-label.tier-novice .name {
    color: var(--tier-novice);
}

.health-bar-label.tier-apprentice .name {
    color: var(--tier-apprentice);
}

.health-bar-label.tier-journeyman .name {
    color: var(--tier-journeyman);
}

.health-bar-label.tier-expert .name {
    color: var(--tier-expert);
}

.health-bar-label.tier-master .name {
    color: var(--tier-master);
}

.health-bar-label.tier-grandmaster .name {
    color: var(--tier-grandmaster);
}

/* Elite+ creatures get special nameplate styling */
.health-bar-label.power-elite .name {
    text-shadow: 0 0 8px rgba(52, 152, 219, 0.6);
}

.health-bar-label.power-boss .name {
    text-shadow: 0 0 10px rgba(155, 89, 182, 0.7);
    animation: boss-name-pulse 2s ease-in-out infinite;
}

.health-bar-label.power-legendary .name {
    text-shadow: 0 0 12px rgba(241, 196, 15, 0.8);
    animation: legendary-name-glow 1.5s ease-in-out infinite;
}

@keyframes boss-name-pulse {

    0%,
    100% {
        text-shadow: 0 0 10px rgba(155, 89, 182, 0.7);
    }

    50% {
        text-shadow: 0 0 20px rgba(155, 89, 182, 1);
    }
}

@keyframes legendary-name-glow {

    0%,
    100% {
        text-shadow: 0 0 12px rgba(241, 196, 15, 0.8);
    }

    50% {
        text-shadow: 0 0 25px rgba(231, 76, 60, 1);
    }
}

/* Tier milestone notification */
.tier-milestone-notification {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0.8);
    background: rgba(0, 0, 0, 0.9);
    border: 2px solid;
    border-radius: 12px;
    padding: 24px 48px;
    text-align: center;
    z-index: 9999;
    opacity: 0;
    pointer-events: none;
    animation: tier-milestone-appear 3s ease-out forwards;
}

.tier-milestone-notification.tier-apprentice {
    border-color: var(--tier-apprentice);
}

.tier-milestone-notification.tier-journeyman {
    border-color: var(--tier-journeyman);
}

.tier-milestone-notification.tier-expert {
    border-color: var(--tier-expert);
}

.tier-milestone-notification.tier-master {
    border-color: var(--tier-master);
}

.tier-milestone-notification.tier-grandmaster {
    border-color: var(--tier-grandmaster);
}

.tier-milestone-notification .tier-title {
    font-size: 28px;
    font-weight: 700;
    margin-bottom: 8px;
    text-transform: uppercase;
    letter-spacing: 2px;
}

.tier-milestone-notification .tier-subtitle {
    font-size: 14px;
    color: #a4caff;
    opacity: 0.8;
}

@keyframes tier-milestone-appear {
    0% {
        opacity: 0;
        transform: translate(-50%, -50%) scale(0.8);
    }

    15% {
        opacity: 1;
        transform: translate(-50%, -50%) scale(1.1);
    }

    25% {
        transform: translate(-50%, -50%) scale(1);
    }

    75% {
        opacity: 1;
        transform: translate(-50%, -50%) scale(1);
    }

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

/* Glow effect for high-tier Elite+ creatures */
.creature-glow {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    border-radius: 50%;
    pointer-events: none;
    animation: creature-glow-pulse 2s ease-in-out infinite;
}

.creature-glow.glow-purple {
    box-shadow: 0 0 30px 15px rgba(155, 89, 182, 0.4);
}

.creature-glow.glow-gold {
    box-shadow: 0 0 35px 18px rgba(241, 196, 15, 0.5);
}

.creature-glow.glow-red {
    box-shadow: 0 0 40px 20px rgba(231, 76, 60, 0.6);
}

@keyframes creature-glow-pulse {

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

    50% {
        opacity: 1;
        transform: translate(-50%, -50%) scale(1.15);
    }
}

/* ========== ACHIEVEMENTS PANEL ========== */

.achievements-panel {
    position: fixed;
    top: 100px;
    left: 50%;
    transform: translateX(-50%);
    width: 500px;
    min-height: 400px;
    max-height: 80vh;
    display: flex;
    flex-direction: column;
}

.achievements-summary {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-left: auto;
    margin-right: 12px;
    font-weight: 600;
    color: #f1c40f;
}

.achievement-points-icon {
    font-size: 16px;
}

.achievements-header-stats {
    display: flex;
    justify-content: space-around;
    padding: 12px;
    background: rgba(0, 0, 0, 0.3);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    flex-shrink: 0;
}

.achievement-stat {
    text-align: center;
}

.achievement-stat .stat-value {
    display: block;
    font-size: 20px;
    font-weight: 700;
    color: #a4caff;
}

.achievement-stat .stat-label {
    font-size: 11px;
    color: rgba(255, 255, 255, 0.6);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.achievements-categories {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    padding: 8px;
    background: rgba(0, 0, 0, 0.2);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    flex-shrink: 0;
}

.achievement-category-tab {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 6px 10px;
    background: #00000040;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 4px;
    color: rgba(255, 255, 255, 0.7);
    font-size: 12px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.achievement-category-tab:hover {
    background: #00000065;
    color: #fff;
}

.achievement-category-tab.active {
    background: rgba(52, 152, 219, 0.3);
    border-color: #3498db;
    color: #fff;
}

.achievement-category-tab .category-icon {
    width: 16px;
    height: 16px;
    flex-shrink: 0;
}

.achievement-category-tab .category-count {
    font-size: 10px;
    opacity: 0.7;
}

.achievements-list {
    flex: 1;
    overflow-y: auto;
    padding: 8px;
}

.achievement-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px;
    background: #00000050;
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 8px;
    margin-bottom: 8px;
    transition: all 0.2s ease;
}

.achievement-item:hover {
    background: #00000065;
    border-color: rgba(255, 255, 255, 0.18);
}

.achievement-item.locked {
    opacity: 0.6;
}

.achievement-item.locked .achievement-icon {
    filter: grayscale(100%);
}

.achievement-item.unlocked {
    border-color: rgba(46, 204, 113, 0.3);
}

.achievement-icon {
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.3);
    border: 2px solid;
    border-radius: 8px;
    flex-shrink: 0;
    position: relative;
}

.achievement-icon-svg {
    width: 32px;
    height: 32px;
}

.server-first-badge {
    position: absolute;
    top: -6px;
    right: -6px;
    background: linear-gradient(135deg, #f39c12, #e74c3c);
    color: #fff;
    font-size: 8px;
    font-weight: 700;
    padding: 2px 4px;
    border-radius: 4px;
    text-transform: uppercase;
}

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

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

.achievement-description {
    font-size: 12px;
    color: rgba(255, 255, 255, 0.6);
    line-height: 1.3;
}

.achievement-progress {
    margin-top: 6px;
    height: 6px;
    background: rgba(0, 0, 0, 0.3);
    border-radius: 3px;
    position: relative;
    overflow: hidden;
}

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

.achievement-progress-text {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 8px;
    color: #fff;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.8);
}

.achievement-unlocked-date {
    font-size: 10px;
    color: rgba(46, 204, 113, 0.8);
    margin-top: 4px;
}

.server-first-info {
    font-size: 10px;
    color: #f39c12;
    margin-top: 4px;
}

.achievement-points {
    text-align: center;
    flex-shrink: 0;
    padding: 4px 8px;
    background: rgba(0, 0, 0, 0.2);
    border-radius: 4px;
}

.achievement-points .points-value {
    display: block;
    font-size: 18px;
    font-weight: 700;
    color: #f1c40f;
}

.achievement-points .points-label {
    font-size: 9px;
    color: rgba(255, 255, 255, 0.5);
    text-transform: uppercase;
}

.no-achievements {
    text-align: center;
    padding: 40px;
    color: rgba(255, 255, 255, 0.5);
}

/* ========== ACHIEVEMENT UNLOCK NOTIFICATION ========== */

.achievement-unlock-notification {
    position: fixed;
    top: 80px;
    right: 20px;
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px 20px;
    background: linear-gradient(135deg, rgba(0, 0, 0, 0.95), rgba(26, 26, 46, 0.95));
    border: 2px solid #f1c40f;
    border-radius: 12px;
    box-shadow: 0 0 30px rgba(241, 196, 15, 0.3), 0 8px 32px rgba(0, 0, 0, 0.5);
    z-index: 10000;
    transform: translateX(120%);
    opacity: 0;
    transition: all 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

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

.achievement-unlock-icon {
    width: 56px;
    height: 56px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(241, 196, 15, 0.15);
    border: 2px solid #f1c40f;
    border-radius: 8px;
    animation: achievement-icon-bounce 0.5s ease-out 0.3s;
}

.achievement-unlock-svg {
    width: 36px;
    height: 36px;
}

@keyframes achievement-icon-bounce {

    0%,
    100% {
        transform: scale(1);
    }

    50% {
        transform: scale(1.2);
    }
}

.achievement-unlock-content {
    min-width: 180px;
}

.achievement-unlock-title {
    font-size: 11px;
    color: #f1c40f;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    font-weight: 600;
    margin-bottom: 4px;
}

.achievement-unlock-name {
    font-size: 16px;
    font-weight: 700;
    color: #fff;
    margin-bottom: 2px;
}

.achievement-unlock-points {
    font-size: 12px;
    color: rgba(241, 196, 15, 0.9);
}

.achievement-unlock-server-first {
    margin-top: 4px;
    font-size: 10px;
    font-weight: 700;
    color: #e74c3c;
    text-transform: uppercase;
    letter-spacing: 1px;
    animation: server-first-pulse 0.5s ease-in-out infinite alternate;
}

@keyframes server-first-pulse {
    0% {
        opacity: 0.7;
    }

    100% {
        opacity: 1;
    }
}

/* ========== Floating Nameplates (Creatures & Players) ========== */
.entity-nameplate {
    position: absolute;
    left: 0;
    top: 0;
    will-change: transform;
    min-width: 80px;
    max-width: 160px;
    border-radius: 4px;
    padding: 3px 6px 4px;
    font-size: 11px;
    pointer-events: auto;
    cursor: url(/3d/img/cursors/cursor-aim.svg) 16 16, crosshair;
    z-index: 50;
    text-align: center;
    box-shadow: 1px 1px 0px rgba(0, 0, 0, 0.3);
}

.entity-nameplate:hover {
    border-color: rgba(255, 255, 255, 0.6);
    box-shadow: 0 2px 12px rgba(100, 150, 255, 0.4);
}

.entity-nameplate.targeted {
    border-color: rgba(255, 200, 50, 0.8);
    box-shadow: 0 0 12px rgba(255, 200, 50, 0.5);
}

.entity-nameplate.creature-nameplate {
    border-color: rgba(255, 100, 100, 0.4);
}

.entity-nameplate.player-nameplate {
    border-color: rgba(100, 200, 255, 0.5);
}

.entity-nameplate.local-player-nameplate {
    border-color: rgba(100, 255, 150, 0.5);
    pointer-events: none;
    cursor: default;
}

.entity-nameplate.object-nameplate {
    border-color: rgba(255, 200, 50, 0.5);
    pointer-events: none !important;
    cursor: default;
    min-width: 60px;
    max-width: 140px;
    text-align: center;
}

/* Nameplate name row */
.nameplate-name-row {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 4px;
    margin-bottom: 2px;
    line-height: 1.2;
}

.nameplate-level {
    font-size: 9px;
    color: #f1c40f;
    font-weight: 600;
    background: rgba(241, 196, 15, 0.15);
    padding: 1px 4px;
    border-radius: 3px;
    flex-shrink: 0;
}

/* Hostile creatures - red level badge */
.nameplate-level.hostile {
    color: #e74c3c;
    background: rgba(231, 76, 60, 0.2);
}

/* Friendly entities - green level badge */
.nameplate-level.friendly {
    color: #2ecc71;
    background: rgba(46, 204, 113, 0.2);
}

.nameplate-name {
    font-weight: 600;
    color: #e8e8e8;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* Tier-based name colors */
.nameplate-name.tier-novice {
    color: #bdc3c7;
}

.nameplate-name.tier-apprentice {
    color: #2ecc71;
}

.nameplate-name.tier-journeyman {
    color: #f1c40f;
}

.nameplate-name.tier-expert {
    color: #e74c3c;
}

.nameplate-name.tier-master {
    color: #9b59b6;
}

.nameplate-name.tier-grandmaster {
    color: #f39c12;
}

/* Power badges */
.nameplate-power-badge {
    font-size: 8px;
    padding: 1px 3px;
    border-radius: 2px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    flex-shrink: 0;
}

.nameplate-power-badge.power-elite {
    background: rgba(52, 152, 219, 0.3);
    color: #3498db;
    border: 1px solid rgba(52, 152, 219, 0.5);
}

.nameplate-power-badge.power-boss {
    background: rgba(155, 89, 182, 0.3);
    color: #9b59b6;
    border: 1px solid rgba(155, 89, 182, 0.5);
    animation: boss-pulse 1.5s ease-in-out infinite;
}

.nameplate-power-badge.power-legendary {
    background: linear-gradient(135deg, rgba(241, 196, 15, 0.3), rgba(230, 126, 34, 0.3));
    color: #f1c40f;
    border: 1px solid rgba(241, 196, 15, 0.6);
    animation: legendary-glow 2s ease-in-out infinite;
}

@keyframes boss-pulse {

    0%,
    100% {
        opacity: 0.9;
    }

    50% {
        opacity: 1;
        box-shadow: 0 0 4px rgba(155, 89, 182, 0.5);
    }
}

@keyframes legendary-glow {

    0%,
    100% {
        opacity: 0.9;
        box-shadow: 0 0 4px rgba(241, 196, 15, 0.3);
    }

    50% {
        opacity: 1;
        box-shadow: 0 0 8px rgba(241, 196, 15, 0.6);
    }
}

/* Health bar */
.nameplate-health {
    height: 6px;
    background: rgba(0, 0, 0, 0.6);
    border-radius: 3px;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.nameplate-health-fill {
    height: 100%;
    border-radius: 2px;
    transition: width 0.2s ease;
    background: linear-gradient(to bottom, #4ade80, #22c55e);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.2);
}

/* Health states */
.nameplate-health-fill.health-high {
    background: linear-gradient(to bottom, #4ade80, #22c55e);
}

.nameplate-health-fill.health-medium {
    background: linear-gradient(to bottom, #fbbf24, #f59e0b);
}

.nameplate-health-fill.health-low {
    background: linear-gradient(to bottom, #fb923c, #ea580c);
}

.nameplate-health-fill.health-critical {
    background: linear-gradient(to bottom, #f87171, #dc2626);
    animation: health-critical-pulse 0.5s ease-in-out infinite alternate;
}

@keyframes health-critical-pulse {
    0% {
        opacity: 0.8;
    }

    100% {
        opacity: 1;
    }
}

/* Tier-based health bar colors for creatures */
.nameplate-health-fill.tier-novice {
    background: linear-gradient(to bottom, #bdc3c7, #95a5a6);
}

.nameplate-health-fill.tier-apprentice {
    background: linear-gradient(to bottom, #2ecc71, #27ae60);
}

.nameplate-health-fill.tier-journeyman {
    background: linear-gradient(to bottom, #f1c40f, #f39c12);
}

.nameplate-health-fill.tier-expert {
    background: linear-gradient(to bottom, #e74c3c, #c0392b);
}

.nameplate-health-fill.tier-master {
    background: linear-gradient(to bottom, #9b59b6, #8e44ad);
}

.nameplate-health-fill.tier-grandmaster {
    background: linear-gradient(to bottom, #f1c40f, #e67e22);
}

/* Dead creature nameplate */
.entity-nameplate.dead {
    opacity: 0.5;
    filter: grayscale(0.5);
}

.entity-nameplate.dead .nameplate-health-fill {
    width: 0 !important;
    background: #555;
}


.paperdoll-stat-row {
    padding: 6px 12px;
    margin: 0 0 6px 0;
}

.paperdoll-stat-row,
.yield-item,
.hotspot-item,
.crafting-recipe-card,
.spell-item,
.skill-item {
    font-size: 14px;
    background: #0000006b;
    border-radius: 8px;
}

.paperdoll-stat-row:hover,
.yield-item:hover,
.hotspot-item:hover,
.crafting-recipe-card:hover,
.spell-item:hover,
.skill-item:hover {
    transform: translateY(-2px) translateX(0px) rotate(0deg);
    background: #00000075;
}

.yield-item:hover,
.hotspot-item:hover,
.crafting-recipe-card:hover,
.spell-item:hover,
.skill-item:hover {
    transform: translateY(-2px) translateX(0px) rotate(0deg);
    background: rgba(0, 0, 0, 0.75);
}

@media all and (max-width: 600px) {
    #health-hud {
        top: 48px;
    }

    #joystick-container,
    #combat-joystick-container,
    #action-button {
        bottom: 190px;
    }
}

/* .menu-panel .menu-item,
.panel-clickable {} */

.menu-panel .menu-item,
.yield-item,
.hotspot-item,
.crafting-recipe-card,
.spell-item,
.skill-item,
.hotkey-row,
.panel-item {
    font-size: 14px;
    background: #00000050;
    border-radius: 8px;
}

.yield-item:hover,
.hotspot-item:hover,
.crafting-recipe-card:hover,
.spell-item:hover,
.skill-item:hover,
.panel-item:hover {
    transform: translateY(-2px) translateX(0px) rotate(0deg);
    background: #00000075;
}

.hotkey-row:hover {
    background: #00000075;
}

/* ========== FURNACE MODAL ========== */
#furnace-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

.furnace-modal-content {
    background: linear-gradient(135deg, #2a2a3e 0%, #1a1a2e 100%);
    border-radius: 16px;
    width: 90%;
    max-width: 500px;
    max-height: 80vh;
    overflow-y: auto;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5), 0 0 20px rgba(255, 100, 0, 0.2);
    border: 1px solid rgba(255, 100, 0, 0.3);
}

.furnace-modal-content .modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 20px;
    border-bottom: 1px solid rgba(255, 100, 0, 0.3);
    background: rgba(255, 100, 0, 0.1);
}

.furnace-modal-content .modal-header h2 {
    margin: 0;
    color: #ff6600;
    font-size: 20px;
}

.furnace-modal-content .modal-close {
    background: none;
    border: none;
    color: #fff;
    font-size: 28px;
    cursor: pointer;
    opacity: 0.7;
    transition: opacity 0.2s;
}

.furnace-modal-content .modal-close:hover {
    opacity: 1;
}

.furnace-modal-content .modal-body {
    padding: 16px;
}

.furnace-active {
    margin-bottom: 20px;
    padding: 12px;
    background: rgba(255, 100, 0, 0.1);
    border-radius: 10px;
    border: 1px solid rgba(255, 100, 0, 0.3);
}

.furnace-active h3 {
    margin: 0 0 12px 0;
    color: #ff6600;
    font-size: 16px;
}

.furnace-process {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px;
    background: rgba(0, 0, 0, 0.3);
    border-radius: 8px;
    margin-bottom: 8px;
}

.process-info {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

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

.process-output {
    color: #88ff88;
    font-size: 13px;
}

.process-timer {
    color: #ffaa00;
    font-family: monospace;
    font-size: 16px;
    padding: 6px 12px;
    background: rgba(255, 170, 0, 0.2);
    border-radius: 6px;
}

.furnace-info {
    display: flex;
    justify-content: space-between;
    padding: 10px;
    background: rgba(0, 0, 0, 0.3);
    border-radius: 8px;
    margin-bottom: 15px;
    font-size: 12px;
    color: inherit;
}

.furnace-ores h3 {
    margin: 0 0 12px 0;
    color: #a4caff;
    font-size: 16px;
}

.no-ores {
    color: #a4caff;
    text-align: center;
    padding: 20px;
}

.furnace-ore {
    padding: 12px;
    background: rgba(0, 0, 0, 0.3);
    border-radius: 10px;
    margin-bottom: 10px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    transition: border-color 0.2s;
}

.furnace-ore.can-smelt {
    border-color: rgba(100, 255, 100, 0.3);
}

.furnace-ore.cannot-smelt {
    opacity: 0.7;
}

.ore-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}

.ore-name {
    font-weight: 600;
    font-size: 15px;
}

.ore-amount {
    color: inherit;
    font-size: 13px;
}

.ore-controls {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.smelt-slider {
    width: 100%;
    height: 8px;
    border-radius: 4px;
    background: rgba(255, 255, 255, 0.1);
    outline: none;
    -webkit-appearance: none;
}

.smelt-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: #ff6600;
    cursor: pointer;
    border: 2px solid #fff;
}

.smelt-slider::-moz-range-thumb {
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: #ff6600;
    cursor: pointer;
    border: 2px solid #fff;
}

.smelt-preview {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
}

.smelt-input {
    color: #ff8866;
}

.smelt-arrow {
    color: #a4caff;
}

.smelt-output {
    color: #88ff88;
}

.smelt-fuel {
    font-size: 12px;
    color: #a4caff;
}

.ore-disabled {
    color: #a4caff;
    font-size: 13px;
    text-align: center;
    padding: 10px;
}

.smelt-btn, .claim-btn {
    padding: 8px 16px;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 500;
    transition: all 0.2s;
}

.smelt-btn {
    background: linear-gradient(135deg, #ff6600 0%, #cc5500 100%);
    color: #fff;
    width: 100%;
}

.smelt-btn:hover:not(:disabled) {
    background: linear-gradient(135deg, #ff7722 0%, #dd6611 100%);
    transform: translateY(-1px);
}

.smelt-btn:disabled {
    background: #444;
    color: #a4caff;
    cursor: not-allowed;
}

/* ========== Wiki Panel ========== */
.wiki-panel {
    width: 420px;
    max-width: 95vw;
}

.wiki-panel .panel-body {
    max-height: 70vh;
    overflow-y: auto;
    padding: 0;
}

/* Wiki Navigation Bar */
.wiki-nav-bar {
    display: flex;
    gap: 8px;
    padding: 12px;
    background: rgba(0, 0, 0, 0.3);
    border-bottom: 1px solid rgba(79, 145, 255, 0.2);
    position: sticky;
    top: 0;
    z-index: 10;
}

/* Wiki Category Dropdown */
.wiki-category-dropdown {
    position: relative;
    flex: 1;
}

.wiki-category-dropdown .wiki-dropdown-toggle {
    width: 100%;
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 14px;
    padding-right: 32px;
    background: rgba(0, 20, 40, 0.8);
    border: 1px solid rgba(79, 145, 255, 0.4);
    border-radius: 6px;
    color: #fff;
    font-size: 14px;
    cursor: url('/3d/img/cursors/cursor-pointer.svg') 10 4, pointer;
    text-align: left;
    transition: all 0.2s;
}

.wiki-category-dropdown .wiki-dropdown-toggle:hover {
    border-color: rgba(79, 145, 255, 0.6);
    background-color: rgba(0, 30, 60, 0.9);
}

.wiki-category-dropdown .wiki-dropdown-arrow {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    pointer-events: none;
    border: 5px solid transparent;
    border-top: 6px solid #4f91ff;
    transition: transform 0.2s;
}

.wiki-category-dropdown.open .wiki-dropdown-arrow {
    transform: translateY(-50%) rotate(180deg);
}

.wiki-category-dropdown .wiki-dropdown-menu {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    margin-top: 4px;
    background: rgba(5, 15, 30, 0.98);
    border: 1px solid rgba(79, 145, 255, 0.4);
    border-radius: 6px;
    display: none;
    z-index: 100;
    max-height: 250px;
    overflow-y: auto;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.5);
}

.wiki-category-dropdown.open .wiki-dropdown-menu {
    display: block;
}

.wiki-category-dropdown .wiki-dropdown-option {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 14px;
    color: #a4caff;
    cursor: url('/3d/img/cursors/cursor-pointer.svg') 10 4, pointer;
    transition: all 0.15s;
}

.wiki-category-dropdown .wiki-dropdown-option:hover {
    background: rgba(79, 145, 255, 0.2);
    color: #fff;
}

.wiki-category-dropdown .wiki-dropdown-option.selected {
    background: rgba(79, 145, 255, 0.3);
    color: #fff;
}

.wiki-category-dropdown .wiki-dropdown-option:first-child {
    border-radius: 5px 5px 0 0;
}

.wiki-category-dropdown .wiki-dropdown-option:last-child {
    border-radius: 0 0 5px 5px;
}

/* Category icon styling */
.wiki-cat-icon {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
}

/* Wiki Page Content Container */
.wiki-page-content {
    padding: 12px;
}

/* Mobile-friendly styles */
@media (max-width: 500px) {
    .wiki-panel {
        width: 100%;
        max-width: 100vw;
        left: 0 !important;
        right: 0 !important;
    }

    .wiki-panel .panel-body {
        max-height: calc(100vh - 120px);
    }

    .wiki-nav-bar {
        padding: 8px;
    }

    .wiki-category-dropdown .wiki-dropdown-toggle {
        font-size: 13px;
        padding: 8px 12px;
        padding-right: 28px;
    }

    .wiki-cat-icon {
        width: 18px;
        height: 18px;
    }

    .wiki-page-content {
        padding: 8px;
    }

    .wiki-content {
        padding: 12px;
    }

    .wiki-page-nav {
        flex-wrap: wrap;
        gap: 6px;
    }

    .wiki-dropdown {
        flex: 1;
        min-width: 120px;
    }

    .wiki-dropdown-toggle {
        font-size: 12px;
        padding: 6px 10px;
    }
}

.wiki-content {
    padding: 16px;
    background: #00000061;
    margin-top: 0;
    border-radius: 6px;
}

.wiki-content h3 {
    margin: 0 0 12px 0;
    color: #fff;
    font-size: 18px;
    font-weight: 600;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    padding-bottom: 8px;
}

.wiki-content h4 {
    margin: 16px 0 8px 0;
    color: #26edef;
    font-size: 16px;
}

.wiki-content p {
    margin: 0 0 12px 0;
    color: #a4caff;
}

.wiki-content ul {
    margin: 0;
    padding-left: 0;
}

.wiki-content li {
    margin-bottom: 6px;
    color: #a4caff;
}

.wiki-content li strong {
    color: #fff;
}

.wiki-formula {
    background: #00000050;
    border-radius: 4px;
    padding: 10px 14px;
    margin: 8px 0 12px 0;
    font-family: monospace;
    font-size: 13px;
    text-align: center;
}

.wiki-table {
    width: 100%;
    border-collapse: collapse;
    margin: 8px 0 12px 0;
    font-size: 12px;
}

.wiki-table th,
.wiki-table td {
    padding: 6px 10px;
    text-align: center;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.wiki-table th {
    background: rgba(255, 255, 255, 0.05);
    color: #fff;
    font-weight: 600;
}

.wiki-table td {
    color: #a4caff;
}

.wiki-table tr:nth-child(even) td {
    background: rgba(255, 255, 255, 0.02);
}

.wiki-content ul li {
    list-style-type: none;
    background: #00000050;
    border-radius: 4px;
    padding: 10px 14px;
    margin: 8px 0 12px 0;
    text-align: left;
}

.wiki-note {
    font-size: 11px;
    color: #b0b0b0;
    font-style: italic;
    margin-top: 8px;
}

/* Wiki Navigation */
/* Reusable dark backdrop for readability on glass panels */
.dark-backdrop {
    background: #00000061;
    border-radius: 4px;
}

.wiki-page-nav {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
}

.wiki-nav-btn {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: #fff;
    width: 28px;
    height: 28px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.wiki-nav-btn:hover:not(:disabled) {
    background: rgba(255, 255, 255, 0.2);
}

.wiki-nav-btn:disabled {
    opacity: 0.3;
    cursor: not-allowed;
}

/* Custom Dropdown (replaces native select) */
.wiki-dropdown {
    flex: 1;
    position: relative;
    min-width: 0;
}

.wiki-dropdown-toggle {
    width: 100%;
    background: rgba(0, 0, 0, 0.4);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: #fff;
    padding: 6px 28px 6px 10px;
    border-radius: 4px;
    font-size: 12px;
    cursor: pointer;
    text-align: left;
    display: flex;
    align-items: center;
    gap: 6px;
    transition: all 0.2s;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.wiki-dropdown-toggle:hover {
    background: rgba(0, 0, 0, 0.5);
    border-color: rgba(255, 255, 255, 0.3);
}

.wiki-dropdown-toggle:focus {
    outline: none;
    border-color: rgba(138, 180, 248, 0.5);
}

.wiki-dropdown.open .wiki-dropdown-toggle {
    border-color: rgba(138, 180, 248, 0.5);
    border-bottom-left-radius: 0;
    border-bottom-right-radius: 0;
}

.wiki-dropdown-arrow {
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
    width: 0;
    height: 0;
    border-left: 4px solid transparent;
    border-right: 4px solid transparent;
    border-top: 5px solid rgba(255, 255, 255, 0.6);
    transition: transform 0.2s;
    pointer-events: none;
}

.wiki-dropdown.open .wiki-dropdown-arrow {
    transform: translateY(-50%) rotate(180deg);
}

.wiki-dropdown-menu {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: #000000bd;
    border-radius: 0 0 4px 4px;
    max-height: 200px;
    overflow-y: auto;
    z-index: 1000;
    display: none;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
}

.wiki-dropdown.open .wiki-dropdown-menu {
    display: block;
}

.wiki-dropdown-option {
    padding: 8px 10px;
    font-size: 12px;
    color: #a4caff;
    cursor: pointer;
    transition: background 0.15s;
    display: flex;
    align-items: center;
    gap: 6px;
}

.wiki-dropdown-option:hover {
    background: rgba(138, 180, 248, 0.15);
    color: #fff;
}

.wiki-dropdown-option.selected {
    background: rgba(138, 180, 248, 0.25);
}

.wiki-dropdown-option:first-child {
    border-radius: 0;
}

.wiki-dropdown-option:last-child {
    border-radius: 0 0 4px 4px;
}

/* Scrollbar for dropdown */
.wiki-dropdown-menu::-webkit-scrollbar {
    width: 6px;
}

.wiki-dropdown-menu::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.2);
}

.wiki-dropdown-menu::-webkit-scrollbar-thumb {
    background: rgba(138, 180, 248, 0.4);
    border-radius: 3px;
}

.wiki-dropdown-menu::-webkit-scrollbar-thumb:hover {
    background: rgba(138, 180, 248, 0.6);
}

/* Hidden native select (for accessibility fallback) */
.wiki-page-select {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
    pointer-events: none;
}

/* Wiki Links */
.wiki-link {
    text-decoration: none;
    cursor: pointer;
    transition: color 0.2s;
}

.wiki-link:hover {
    color: #aecbfa;
    text-decoration: underline;
}

/* Wiki Skill Type Badge */
.wiki-skill-type {
    display: inline-block;
    background: rgba(74, 144, 217, 0.2);
    border: 1px solid rgba(74, 144, 217, 0.4);
    font-size: 11px;
    padding: 2px 8px;
    border-radius: 10px;
    margin-bottom: 12px;
}

/* Clickable Skills in Paperdoll */
.paperdoll-skill-clickable {
    cursor: pointer;
    transition: background 0.2s, transform 0.1s;
    border-radius: 4px;
    padding: 4px 6px !important;
    margin: 0 -6px;
}

.paperdoll-skill-clickable:hover {
    background: rgba(138, 180, 248, 0.15);
}

.paperdoll-skill-clickable:active {
    transform: scale(0.98);
}

.paperdoll-skill-clickable .stat-name {
}

.paperdoll-skill-clickable:hover .stat-name {
    color: #aecbfa;
}

/* Clickable Yield Names in Object Info */
.yield-name-link {
    cursor: url('/3d/img/cursors/cursor-pointer.svg') 10 4, pointer;
    transition: color 0.2s, text-shadow 0.2s;
}

.yield-name-link:hover {
    color: #aecbfa;
    text-shadow: 0 0 8px rgba(138, 180, 248, 0.5);
    text-decoration: underline;
}

/* Wiki Commodity Pages */
.wiki-commodity-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 16px;
    padding-bottom: 12px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.wiki-commodity-swatch {
    width: 48px;
    height: 48px;
    border-radius: 8px;
    border: 2px solid rgba(255, 255, 255, 0.2);
    box-shadow: inset -3px -3px 6px rgba(0, 0, 0, 0.3),
                inset 3px 3px 6px rgba(255, 255, 255, 0.1),
                0 2px 8px rgba(0, 0, 0, 0.3);
    flex-shrink: 0;
}

.wiki-commodity-preview {
    width: 48px;
    height: 48px;
    border-radius: 8px;
    border: 2px solid rgba(255, 255, 255, 0.2);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
    flex-shrink: 0;
    object-fit: contain;
    background: rgba(0, 0, 0, 0.3);
}

.wiki-commodity-title h3 {
    margin: 0 0 4px 0;
    font-size: 18px;
}

.wiki-commodity-quality {
    font-size: 12px;
    opacity: 0.8;
}

.wiki-commodity-desc {
    color: #a4caff;
    margin-bottom: 16px;
    line-height: 1.5;
}

.wiki-info-row {
    display: flex;
    gap: 8px;
    margin-bottom: 8px;
    font-size: 13px;
}

.wiki-info-label {
    color: #b0b0b0;
}

.wiki-commodity-list {
    list-style: none;
    padding: 0;
    margin: 8px 0 16px 0;
}

.wiki-commodity-list li {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

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

.wiki-commodity-mini-swatch {
    width: 16px;
    height: 16px;
    border-radius: 3px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    flex-shrink: 0;
}

/* Wiki Stat Pages */
.wiki-content h3 .stat-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    margin-right: 8px;
    vertical-align: middle;
}

.wiki-content h3 .stat-icon img {
    width: 24px;
    height: 24px;
}

.wiki-stat-tagline {
    color: #b0b0b0;
    font-style: italic;
    margin-top: -8px;
    margin-bottom: 16px;
}

.wiki-stats-table td:first-child {
    font-weight: bold;
}

.wiki-stats-table a.wiki-link {
    font-weight: bold;
}

/* Wiki Level Badge */
.wiki-level-badge {
    background: linear-gradient(135deg, #3a6ea5 0%, #2c5282 100%);
    color: #fff;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: bold;
}

/* Wiki Material Specs Table */
.wiki-specs-table {
    margin: 8px 0 16px 0;
}

.wiki-specs-table .wiki-spec-key {
    color: #b0b0b0;
    font-weight: normal;
    width: 40%;
}

.wiki-specs-table .wiki-spec-value {
    color: #a4caff;
    font-weight: bold;
}

/* Wiki Source & Recipe Lists */
.wiki-source-list,
.wiki-recipe-list,
.wiki-ingredient-list {
    list-style: none;
    padding: 0;
    margin: 6px 0 12px 0;
}

.wiki-source-list li,
.wiki-recipe-list li,
.wiki-ingredient-list li {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 4px 8px;
    margin: 2px 0;
    border-radius: 4px;
    font-size: 13px;
    flex-wrap: wrap;
}

.wiki-source-list li:hover,
.wiki-recipe-list li:hover,
.wiki-ingredient-list li:hover {
    background: rgba(255, 255, 255, 0.05);
}

.wiki-source-link,
.wiki-recipe-link {
    display: flex;
    align-items: center;
    gap: 6px;
}

.wiki-source-cat-icon {
    font-size: 14px;
    width: 20px;
    text-align: center;
}

.wiki-recipe-dot {
    display: inline-block;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    flex-shrink: 0;
}

.wiki-recipe-group {
    margin-bottom: 8px;
}

.wiki-recipe-group h5 {
    color: #b0b0b0;
    font-size: 12px;
    margin: 8px 0 4px 0;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.wiki-weight {
    color: #a4caff;
    font-size: 11px;
    margin-left: 4px;
}

.wiki-modular-badge,
.wiki-primary-badge,
.wiki-optional-badge,
.wiki-color-role-badge {
    font-size: 10px;
    padding: 1px 5px;
    border-radius: 3px;
    font-weight: bold;
    text-transform: uppercase;
}

.wiki-modular-badge {
    background: rgba(74, 144, 217, 0.2);
    color: #4a90d9;
}

.wiki-primary-badge {
    background: rgba(255, 215, 0, 0.2);
    color: #ffd700;
}

.wiki-optional-badge {
    background: rgba(136, 136, 136, 0.2);
    color: inherit;
}

.wiki-color-role-badge {
    background: rgba(136, 136, 136, 0.15);
    color: #999;
}

.wiki-school-badge {
    font-size: 11px;
    font-weight: bold;
    margin-left: 4px;
}

.wiki-dish-badge {
    font-size: 10px;
    color: #999;
    text-transform: capitalize;
    margin-left: 4px;
}

.wiki-recipe-header {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    margin-bottom: 12px;
}

.wiki-recipe-header h3 {
    margin: 0 0 4px 0;
}

.wiki-recipe-system-badge {
    display: inline-block;
    color: #fff;
    font-size: 10px;
    font-weight: bold;
    padding: 2px 8px;
    border-radius: 3px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-right: 6px;
}

.wiki-source-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 12px;
}

.wiki-source-icon-lg {
    font-size: 32px;
}

.wiki-source-header h3 {
    margin: 0 0 2px 0;
}

.wiki-source-category {
    color: #a4caff;
    font-size: 12px;
    text-transform: capitalize;
}

.wiki-yield-percent {
    color: #a4caff;
    font-size: 11px;
}

.wiki-part-name {
    color: #666;
    font-size: 11px;
    font-style: italic;
}

/* Wiki Biome Spawn List */
.wiki-biome-list {
    list-style: none;
    padding: 0;
    margin: 6px 0 12px 0;
}

.wiki-biome-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 4px 8px;
    margin: 2px 0;
    border-radius: 4px;
    font-size: 13px;
}

.wiki-biome-item:hover {
    background: rgba(255, 255, 255, 0.05);
}

.wiki-biome-swatch {
    display: inline-block;
    width: 12px;
    height: 12px;
    border-radius: 3px;
    flex-shrink: 0;
}

.wiki-biome-name {
    min-width: 100px;
    color: #d0d0d0;
}

a.wiki-biome-name {
    text-decoration: none;
    color: #7cb8e8;
}

a.wiki-biome-name:hover {
    text-decoration: underline;
    color: #a0d0ff;
}

.wiki-biome-bar-container {
    flex: 1;
    height: 6px;
    background: rgba(255, 255, 255, 0.08);
    border-radius: 3px;
    overflow: hidden;
    min-width: 40px;
}

.wiki-biome-bar {
    display: block;
    height: 100%;
    border-radius: 3px;
    min-width: 2px;
    opacity: 0.8;
}

.wiki-biome-percent {
    color: inherit;
    font-size: 11px;
    min-width: 36px;
    text-align: right;
}

/* Wiki Biome Page */
.wiki-biome-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 12px;
}

.wiki-biome-palette {
    display: flex;
    gap: 2px;
    border-radius: 4px;
    overflow: hidden;
}

.wiki-biome-palette-swatch {
    display: block;
    width: 18px;
    height: 36px;
}

.wiki-biome-desc {
    color: #b0b0b0;
    font-style: italic;
    margin: 0 0 12px 0;
}

.wiki-biome-env {
    margin: 4px 0 12px 0;
    font-size: 12px;
}

.wiki-biome-env-row {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 2px 0;
    color: #b0b0b0;
}

.wiki-biome-env-label {
    min-width: 50px;
    color: #a4caff;
    font-size: 11px;
    text-transform: uppercase;
}

.wiki-biome-spawn-list {
    list-style: none;
    padding: 0;
    margin: 6px 0 12px 0;
}

.wiki-biome-spawn-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 4px 8px;
    margin: 2px 0;
    border-radius: 4px;
    font-size: 13px;
}

.wiki-biome-spawn-item:hover {
    background: rgba(255, 255, 255, 0.05);
}

/* Wiki Creature Source */
.wiki-creature-level {
    font-size: 10px;
    color: inherit;
    margin-left: 4px;
}

.wiki-drop-chance {
    font-size: 11px;
    color: #e8a64c;
    font-weight: bold;
    margin-left: auto;
}

.wiki-source-subheading {
    color: #b0b0b0;
    font-size: 12px;
    margin: 10px 0 4px 0;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Wiki Loot Table */
.wiki-loot-list {
    list-style: none;
    padding: 0;
    margin: 6px 0 12px 0;
}

.wiki-loot-list li {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 4px 8px;
    margin: 2px 0;
    border-radius: 4px;
    font-size: 13px;
}

.wiki-loot-list li:hover {
    background: rgba(255, 255, 255, 0.05);
}

.wiki-loot-qty {
    color: inherit;
    font-size: 11px;
    margin-left: auto;
}

/* ========== Wiki Creature Pages ========== */
.wiki-traits {
    display: flex;
    flex-direction: column;
    gap: 4px;
    margin-top: 6px;
}
.wiki-trait-row {
    display: flex;
    align-items: center;
    gap: 8px;
}
.wiki-trait-label {
    width: 90px;
    font-size: 11px;
    color: #a4caff;
    flex-shrink: 0;
}
.wiki-trait-bar-bg {
    flex: 1;
    height: 8px;
    background: rgba(255,255,255,0.1);
    border-radius: 4px;
    overflow: hidden;
}
.wiki-trait-bar-fill {
    display: block;
    height: 100%;
    background: linear-gradient(90deg, #3498db, #2ecc71);
    border-radius: 4px;
    transition: width 0.3s;
}
.wiki-trait-value {
    width: 20px;
    text-align: right;
    font-size: 11px;
    color: inherit;
}
.wiki-creature-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 6px;
    margin-top: 8px;
}
.wiki-creature-card {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 6px 8px;
    background: rgba(255,255,255,0.05);
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 4px;
    text-decoration: none;
    color: #ddd;
    font-size: 11px;
    transition: background 0.15s;
}
.wiki-creature-card:hover {
    background: rgba(255,255,255,0.12);
    border-color: rgba(255,255,255,0.2);
}
.wiki-creature-card-icon {
    font-size: 16px;
    flex-shrink: 0;
}
.wiki-creature-card-name {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* ========== Alchemy Panel ========== */
.alchemy-panel {
    position: fixed;
    top: 100px;
    left: 50%;
    transform: translateX(-50%);
    width: 420px;
    max-width: 95vw;
    max-height: 85vh;
    z-index: 600;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    background: rgba(20, 15, 30, 0.95);
    border: 1px solid rgba(153, 50, 204, 0.4);
    border-radius: 8px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.5), 0 0 30px rgba(153, 50, 204, 0.2);
}

.alchemy-panel .panel-header {
    background: linear-gradient(135deg, rgba(153, 50, 204, 0.3), rgba(75, 0, 130, 0.3));
    border-bottom: 1px solid rgba(153, 50, 204, 0.3);
}

.alchemy-title {
    display: flex;
    align-items: center;
    gap: 8px;
}

.alchemy-tabs {
    display: flex;
    gap: 4px;
    padding: 8px 12px;
    border-bottom: 1px solid rgba(153, 50, 204, 0.2);
    background: rgba(0, 0, 0, 0.2);
}

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

.alchemy-tab:hover {
    background: rgba(153, 50, 204, 0.2);
    border-color: rgba(153, 50, 204, 0.4);
}

.alchemy-tab.active {
    background: rgba(153, 50, 204, 0.3);
    border-color: rgba(153, 50, 204, 0.6);
    color: #fff;
}

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

.alchemy-brew-container {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.alchemy-section {
    background: rgba(0, 0, 0, 0.2);
    border-radius: 6px;
    padding: 10px;
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.alchemy-section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}

.section-title {
    font-size: 12px;
    font-weight: 600;
    color: #d4a5ff;
}

.section-hint {
    font-size: 10px;
    color: #a4caff;
}

.alchemy-ingredient-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    gap: 6px;
    max-height: 120px;
    overflow-y: auto;
}

.alchemy-ingredient {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 8px;
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.2s;
}

.alchemy-ingredient:hover {
    border-color: rgba(153, 50, 204, 0.5);
    background: rgba(153, 50, 204, 0.1);
}

.alchemy-ingredient.selected {
    border-color: rgba(153, 50, 204, 0.8);
    background: rgba(153, 50, 204, 0.2);
    box-shadow: 0 0 8px rgba(153, 50, 204, 0.3);
}

.alchemy-ingredient.insufficient {
    opacity: 0.4;
    cursor: not-allowed;
}

.ing-color {
    width: 24px;
    height: 24px;
    border-radius: 4px;
    flex-shrink: 0;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.ing-info {
    flex: 1;
    min-width: 0;
    overflow: hidden;
}

.ing-name {
    font-size: 11px;
    font-weight: 600;
    color: #fff;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.ing-weight {
    font-size: 9px;
    margin-top: 2px;
}

.ing-weight.has-enough {
    color: #2ecc71;
}

.ing-weight.need-more {
    color: #e74c3c;
}

.ing-school {
    font-size: 9px;
    margin-top: 1px;
}

.ing-tier {
    font-size: 9px;
    padding: 2px 5px;
    background: rgba(241, 196, 15, 0.3);
    border-radius: 3px;
    color: #f1c40f;
    font-weight: bold;
}

.ing-effect {
    font-size: 8px;
    padding: 2px 4px;
    background: rgba(52, 152, 219, 0.3);
    border-radius: 3px;
    color: #3498db;
}

.alchemy-empty {
    text-align: center;
    padding: 15px;
    font-size: 12px;
}

/* Recipe Selection */
.recipe-hint {
    text-align: center;
    padding: 10px;
    font-size: 11px;
    font-style: italic;
}

.recipe-selection-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 6px;
    max-height: 140px;
    overflow-y: auto;
}

.recipe-option {
    padding: 8px;
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.2s;
}

.recipe-option:hover {
    border-color: var(--school-color, rgba(153, 50, 204, 0.5));
    background: rgba(153, 50, 204, 0.1);
}

.recipe-option.selected {
    border-color: var(--school-color, rgba(153, 50, 204, 0.8));
    background: rgba(153, 50, 204, 0.2);
    box-shadow: 0 0 8px rgba(153, 50, 204, 0.3);
}

.recipe-option-header {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-bottom: 4px;
}

.recipe-option-name {
    font-size: 11px;
    font-weight: 600;
    color: #fff;
}

.primary-badge {
    font-size: 8px;
    padding: 1px 4px;
    background: rgba(46, 204, 113, 0.3);
    border-radius: 3px;
    color: #2ecc71;
}

.recipe-option-effect {
    font-size: 10px;
    color: inherit;
}

.recipe-option-duration {
    font-size: 9px;
    color: #a4caff;
}

.recipe-option-school {
    font-size: 9px;
    margin-top: 2px;
}

/* Brew Summary */
.alchemy-brew-summary {
    background: linear-gradient(135deg, rgba(153, 50, 204, 0.15), rgba(75, 0, 130, 0.15));
    border: 1px solid rgba(153, 50, 204, 0.3);
    border-radius: 8px;
    padding: 12px;
}

.brew-preview {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 10px;
}

.brew-preview-icon {
    font-size: 28px;
    width: 50px;
    height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.4);
    border-radius: 8px;
    border: 1px solid rgba(153, 50, 204, 0.4);
}

.brew-preview-info {
    flex: 1;
}

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

.brew-preview-tier {
    font-size: 11px;
    color: #d4a5ff;
}

.brew-bonuses {
    display: flex;
    flex-direction: column;
    gap: 4px;
    margin-bottom: 12px;
    padding: 8px;
    background: rgba(0, 0, 0, 0.2);
    border-radius: 4px;
}

.brew-bonus {
    font-size: 11px;
    padding: 2px 0;
}

.brew-bonus.positive {
    color: #2ecc71;
}

.brew-bonus.negative {
    color: #e74c3c;
}

.brew-bonus.special {
    color: #3498db;
}

.brew-bonus.neutral {
    color: #a4caff;
}

.brew-btn {
    width: 100%;
    padding: 10px 20px;
    background: linear-gradient(135deg, rgba(153, 50, 204, 0.4), rgba(75, 0, 130, 0.4));
    border: 1px solid rgba(153, 50, 204, 0.6);
    border-radius: 6px;
    color: #fff;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.brew-btn:hover:not(:disabled) {
    background: linear-gradient(135deg, rgba(153, 50, 204, 0.6), rgba(75, 0, 130, 0.6));
    border-color: rgba(153, 50, 204, 0.8);
    box-shadow: 0 0 15px rgba(153, 50, 204, 0.4);
}

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

/* Active Processes */
.active-processes-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.active-process-card {
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 6px;
    padding: 10px;
}

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

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

.process-info {
    flex: 1;
}

.process-name {
    font-size: 13px;
    font-weight: 600;
    color: #fff;
}

.process-details {
    font-size: 10px;
    color: inherit;
    display: flex;
    gap: 8px;
}

.process-quantity {
    color: #f1c40f;
}

.process-quality {
    color: #2ecc71;
}

.process-time {
    font-size: 12px;
    color: #d4a5ff;
    font-weight: 600;
}

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

.process-progress-fill {
    height: 100%;
    border-radius: 2px;
    transition: width 0.3s;
}

.process-progress-fill.complete {
    animation: pulse-glow 1s infinite;
}

@keyframes pulse-glow {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.6; }
}

.process-ingredients {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
}

.proc-ing {
    font-size: 9px;
    padding: 2px 6px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 3px;
    color: #a4caff;
}

/* Recipes List Tab */
.alchemy-filters {
    display: flex;
    gap: 8px;
    margin-bottom: 12px;
    position: sticky;
    top: 0;
    background: rgba(20, 15, 30, 0.95);
    padding: 8px 0;
    z-index: 1;
}

.alchemy-search {
    flex: 1;
    padding: 8px 12px;
    background: rgba(0, 0, 0, 0.4);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 6px;
    color: #fff;
    font-size: 12px;
    outline: none;
}

.alchemy-search:focus {
    border-color: rgba(153, 50, 204, 0.5);
}

.alchemy-search::placeholder {
    color: rgba(255, 255, 255, 0.4);
}

.alchemy-school-filter {
    padding: 8px 12px;
    background: rgba(0, 0, 0, 0.4);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 6px;
    color: #fff;
    font-size: 12px;
    cursor: pointer;
    min-width: 120px;
}

.alchemy-school-filter option {
    background: #1e1e28;
}

.alchemy-recipes-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.recipe-school-group {
    margin-bottom: 8px;
}

.recipe-school-header {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    font-weight: 600;
    margin-bottom: 8px;
    padding-bottom: 4px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.school-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
}

.recipe-school-list {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

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

.recipe-card:hover {
    border-color: rgba(153, 50, 204, 0.4);
    background: rgba(153, 50, 204, 0.05);
}

.recipe-card.locked {
    opacity: 0.5;
}

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

.recipe-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;
}

.recipe-card-info {
    flex: 1;
}

.recipe-card-name {
    font-size: 13px;
    font-weight: 600;
    color: #fff;
}

.recipe-card-effect {
    font-size: 11px;
    color: #2ecc71;
}

.recipe-card-desc {
    font-size: 10px;
    color: #a4caff;
    margin-bottom: 6px;
    line-height: 1.4;
}

.recipe-card-bases {
    font-size: 10px;
    color: inherit;
    margin-bottom: 4px;
}

.bases-label {
    color: #666;
}

.recipe-card-reqs {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.recipe-card-reqs .req {
    font-size: 9px;
    padding: 2px 6px;
    border-radius: 3px;
}

.recipe-card-reqs .req.met {
    background: rgba(46, 204, 113, 0.2);
    color: #2ecc71;
}

.recipe-card-reqs .req.unmet {
    background: rgba(231, 76, 60, 0.2);
    color: #e74c3c;
}

/* Container Selection */
.container-item {
    position: relative;
}

.container-item .ing-capacity {
    font-size: 9px;
    color: #3498db;
    margin-top: 1px;
}

.container-bonus {
    position: absolute;
    top: 4px;
    right: 4px;
    font-size: 9px;
    padding: 2px 5px;
    background: rgba(46, 204, 113, 0.3);
    border-radius: 3px;
    color: #2ecc71;
    font-weight: bold;
}

.container-qty {
    font-size: 10px;
    color: #a4caff;
    margin-left: auto;
}

/* Filled Potions List */
.filled-potions-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.filled-potion-card {
    display: flex;
    gap: 12px;
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    padding: 12px;
    transition: all 0.2s;
}

.filled-potion-card:hover {
    border-color: rgba(153, 50, 204, 0.4);
    background: rgba(153, 50, 204, 0.05);
}

.potion-visual {
    flex-shrink: 0;
}

.potion-bottle {
    width: 40px;
    height: 60px;
    background: rgba(135, 206, 235, 0.2);
    border: 2px solid rgba(135, 206, 235, 0.4);
    border-radius: 4px 4px 8px 8px;
    position: relative;
    overflow: hidden;
}

.potion-bottle::before {
    content: '';
    position: absolute;
    top: -6px;
    left: 50%;
    transform: translateX(-50%);
    width: 16px;
    height: 8px;
    background: rgba(100, 100, 100, 0.8);
    border-radius: 2px 2px 0 0;
}

.potion-liquid {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    transition: height 0.3s;
    border-radius: 0 0 6px 6px;
}

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

.potion-name {
    font-size: 13px;
    font-weight: 600;
    color: #fff;
    margin-bottom: 2px;
}

.potion-container {
    font-size: 10px;
    color: #a4caff;
    margin-bottom: 4px;
}

.potion-details {
    display: flex;
    gap: 10px;
    font-size: 11px;
    margin-bottom: 4px;
}

.potion-amount {
    color: #3498db;
}

.potion-quality {
    color: #2ecc71;
}

.potion-effect {
    font-size: 10px;
}

.potion-actions {
    display: flex;
    flex-direction: column;
    gap: 4px;
    flex-shrink: 0;
}

.sip-btn, .drink-btn {
    padding: 6px 12px;
    border-radius: 4px;
    font-size: 11px;
    cursor: pointer;
    transition: all 0.2s;
    border: 1px solid;
}

.sip-btn {
    background: rgba(52, 152, 219, 0.3);
    border-color: rgba(52, 152, 219, 0.5);
    color: #3498db;
}

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

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

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

/* ===========================================
   Music Player - 3D Game Overrides
   =========================================== */

.music-player-wrap {
    position: fixed;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    z-index: 500;
    margin: 0 auto;
}

.music-player-wrap.hidden {
    display: none !important;
}

.music-player {
    border-radius: 8px 8px 0 0;
    background: rgba(20, 30, 60, 0.92);
    backdrop-filter: blur(10px);
}

.music-track-list {
    margin-top: 0;
    border-top: none;
    border-radius: 0;
    background: rgba(20, 30, 60, 0.95);
    backdrop-filter: blur(10px);
}


/* ========== Capacitor Native App Support ========== */

.capacitor-app {
    --safe-area-top: env(safe-area-inset-top, 0px);
    --safe-area-right: env(safe-area-inset-right, 0px);
    --safe-area-bottom: env(safe-area-inset-bottom, 0px);
    --safe-area-left: env(safe-area-inset-left, 0px);
}

/* Push top UI below notch / status bar */
.capacitor-app #health-hud,
.capacitor-app #guest-auth-buttons {
    padding-top: var(--safe-area-top);
}

/* Push bottom UI above home indicator / gesture bar */
.capacitor-app #bottom-game-ui {
    padding-bottom: var(--safe-area-bottom);
}

/* Smooth keyboard avoidance for chat input */
.capacitor-app #chat-input-wrap {
    transition: padding-bottom 0.2s ease-out;
}

/* Prevent text selection except in inputs */
.capacitor-app {
    -webkit-user-select: none;
    user-select: none;
    -webkit-touch-callout: none;
}

.capacitor-app input,
.capacitor-app textarea {
    -webkit-user-select: text;
    user-select: text;
}

/* Offline network banner */
#cap-network-banner {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    display: none;
}

/* =============================================
   WEATHER INDICATOR
   ============================================= */
#weather-indicator {
    position: fixed;
    bottom: 12px;
    left: 12px;
    background: rgba(0, 0, 0, 0.45);
    color: #eee;
    font-size: 12px;
    padding: 4px 10px;
    border-radius: 6px;
    pointer-events: none;
    z-index: 200;
    font-family: inherit;
    letter-spacing: 0.03em;
    display: none;
}

/* =============================================
   PLANT STATUS PANEL
   ============================================= */
.plant-status-panel {
    min-width: 220px;
    max-width: 280px;
}

.plant-status-panel .panel-body {
    padding: 8px 12px;
}

.plant-status-badge {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 600;
    margin-bottom: 8px;
    letter-spacing: 0.02em;
}

.plant-status-badge.ready {
    background: rgba(68, 170, 68, 0.25);
    color: #66dd66;
    border: 1px solid rgba(68, 170, 68, 0.4);
}

.plant-status-badge.growing {
    background: rgba(68, 136, 255, 0.2);
    color: #88bbff;
    border: 1px solid rgba(68, 136, 255, 0.3);
}

.plant-status-badge.withered {
    background: rgba(204, 68, 68, 0.2);
    color: #ff8888;
    border: 1px solid rgba(204, 68, 68, 0.3);
}

.plant-stat-row {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-bottom: 5px;
    font-size: 11px;
}

.plant-stat-label {
    width: 60px;
    color: inherit;
    flex-shrink: 0;
}

.plant-stat-bar-wrap {
    flex: 1;
    height: 8px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 4px;
    overflow: hidden;
}

.plant-stat-bar {
    height: 100%;
    border-radius: 4px;
    transition: width 0.3s ease;
}

.plant-stat-value {
    width: 32px;
    text-align: right;
    color: #a4caff;
    flex-shrink: 0;
}

.plant-action-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    margin-top: 8px;
    padding-top: 8px;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.plant-action-btn {
    flex: 1 1 auto;
    min-width: 60px;
    padding: 4px 8px;
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 4px;
    background: rgba(255, 255, 255, 0.08);
    color: #a4caff;
    font-size: 11px;
    cursor: pointer;
    text-align: center;
    transition: background 0.15s;
}

.plant-action-btn:hover {
    background: rgba(255, 255, 255, 0.15);
    color: #fff;
}

.plant-action-btn.plant-harvest-btn {
    background: rgba(68, 170, 68, 0.2);
    border-color: rgba(68, 170, 68, 0.4);
    color: #66dd66;
}

.plant-action-btn.plant-harvest-btn:hover {
    background: rgba(68, 170, 68, 0.35);
}

/* Context menu plant-specific styling */
.context-menu-item.plant-harvest-btn {
    color: #66dd66;
}

.context-menu-item.plant-remove-btn {
    color: #ff6666;
}

.context-menu-header {
    padding: 4px 12px;
    font-size: 12px;
    font-weight: 600;
    color: inherit;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    pointer-events: none;
}

/* =============================================
   Gene Lab — DNA Modification System
   ============================================= */

#gene-lab-modal {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 420px;
    max-width: 95vw;
    max-height: 80vh;
    background: rgba(15, 20, 30, 0.95);
    border: 1px solid rgba(0, 255, 127, 0.3);
    border-radius: 12px;
    padding: 0;
    z-index: 9000;
    box-shadow: 0 0 30px rgba(0, 255, 127, 0.15), inset 0 0 20px rgba(0, 0, 0, 0.3);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.gene-lab-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 16px;
    border-bottom: 1px solid rgba(0, 255, 127, 0.15);
}

.gene-lab-header h3 {
    margin: 0;
    font-size: 15px;
    color: #00FF7F;
    font-weight: 600;
}

.gene-lab-close {
    background: none;
    border: none;
    color: #a4caff;
    font-size: 20px;
    cursor: pointer;
    padding: 0 4px;
    line-height: 1;
}
.gene-lab-close:hover { color: #fff; }

.gene-lab-tabs {
    display: flex;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.gene-lab-tab {
    flex: 1;
    padding: 10px 8px;
    background: none;
    border: none;
    border-bottom: 2px solid transparent;
    color: #a4caff;
    font-size: 12px;
    cursor: pointer;
    transition: all 0.2s;
}
.gene-lab-tab:hover { color: #a4caff; }
.gene-lab-tab.active {
    color: #00FF7F;
    border-bottom-color: #00FF7F;
}

.gene-lab-content {
    padding: 14px;
    overflow-y: auto;
    max-height: 55vh;
}

.gene-lab-subtitle {
    font-size: 12px;
    color: inherit;
    margin-bottom: 8px;
}

.gene-lab-empty {
    text-align: center;
    color: #666;
    font-size: 12px;
    padding: 30px 10px;
}

.gene-lab-loading {
    text-align: center;
    color: #00FF7F;
    padding: 30px;
    font-size: 12px;
}

.gene-lab-btn {
    padding: 6px 14px;
    border: 1px solid rgba(0, 255, 127, 0.4);
    border-radius: 6px;
    background: rgba(0, 255, 127, 0.1);
    color: #00FF7F;
    font-size: 11px;
    cursor: pointer;
    transition: all 0.2s;
}
.gene-lab-btn:hover {
    background: rgba(0, 255, 127, 0.25);
}
.gene-lab-btn:disabled {
    opacity: 0.4;
    cursor: default;
}

.gene-lab-btn-claim {
    background: rgba(0, 255, 127, 0.2);
    border-color: #00FF7F;
    margin-top: 10px;
}

.gene-lab-select {
    width: 100%;
    padding: 6px 8px;
    background: rgba(0, 0, 0, 0.4);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 6px;
    color: #ddd;
    font-size: 12px;
    margin-bottom: 10px;
}

/* Gene sample list */
.gene-sample-list {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.gene-sample-card {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 10px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 8px;
}

.gene-sample-icon {
    font-size: 18px;
    font-weight: bold;
    width: 28px;
    text-align: center;
}

.gene-sample-info { flex: 1; }
.gene-sample-name {
    font-size: 12px;
    color: #ddd;
}
.gene-sample-source {
    font-size: 10px;
    color: #a4caff;
}

/* Active process */
.gene-process-active {
    text-align: center;
    padding: 20px 10px;
}
.gene-process-label {
    font-size: 13px;
    color: #ddd;
    margin-bottom: 10px;
}
.gene-process-timer {
    font-size: 22px;
    font-weight: bold;
    color: #00FF7F;
    margin-bottom: 6px;
}

/* Splice controls */
.splice-controls {
    display: flex;
    flex-direction: column;
    gap: 4px;
}
.splice-section {
    margin-bottom: 4px;
}
.splice-info {
    display: flex;
    gap: 16px;
    justify-content: center;
    padding: 8px 0;
}
.splice-rate { font-size: 12px; color: inherit; }
.splice-rate-val { color: #00FF7F; font-weight: bold; }
.splice-rate-mut { color: #FF69B4; font-weight: bold; }

.gene-lab-btn-splice {
    width: 100%;
    padding: 10px;
    font-size: 13px;
}

/* Discovery grid */
.discovery-progress {
    text-align: center;
    font-size: 13px;
    color: #00FF7F;
    margin-bottom: 12px;
}

.discovery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(110px, 1fr));
    gap: 8px;
}

.discovery-card {
    padding: 10px 8px;
    border-radius: 8px;
    text-align: center;
    border: 1px solid rgba(255, 255, 255, 0.08);
    transition: all 0.2s;
}
.discovery-card.discovered {
    background: rgba(0, 255, 127, 0.06);
    border-color: rgba(0, 255, 127, 0.2);
}
.discovery-card.unknown {
    background: rgba(0, 0, 0, 0.3);
    opacity: 0.5;
}
.discovery-card.unknown .discovery-desc { display: none; }

.discovery-icon {
    font-size: 18px;
    font-weight: bold;
    width: 36px;
    height: 36px;
    line-height: 36px;
    margin: 0 auto 6px;
    border-radius: 50%;
    border: 2px solid;
    background: rgba(0, 0, 0, 0.3);
}

.discovery-name {
    font-size: 11px;
    font-weight: 600;
    color: #ddd;
    margin-bottom: 2px;
}

.discovery-category {
    font-size: 9px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.discovery-desc {
    font-size: 9px;
    color: #a4caff;
    margin-top: 4px;
    line-height: 1.3;
}

/* Trait badges (for seed tooltips) */
.trait-badge {
    display: inline-block;
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 9px;
    font-weight: 600;
    margin: 1px 2px;
}
.trait-badge-growth { background: rgba(124, 252, 0, 0.15); color: #7CFC00; border: 1px solid rgba(124, 252, 0, 0.3); }
.trait-badge-resistance { background: rgba(30, 144, 255, 0.15); color: #1E90FF; border: 1px solid rgba(30, 144, 255, 0.3); }
.trait-badge-yield { background: rgba(255, 215, 0, 0.15); color: #FFD700; border: 1px solid rgba(255, 215, 0, 0.3); }
.trait-badge-special { background: rgba(255, 105, 180, 0.15); color: #FF69B4; border: 1px solid rgba(255, 105, 180, 0.3); }

/* Extract Gene context menu item */
.context-menu-item.plant-gene-btn {
    color: #00FF7F;
}

/* Zone Info — Weather Section */
.zone-weather-section {
    padding: 10px 16px;
    border-bottom: 1px solid rgba(79, 145, 255, 0.15);
}
.zone-weather-display {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 15px;
}
.zone-weather-icon {
    font-size: 22px;
    line-height: 1;
}
.zone-weather-label {
    font-weight: 500;
    color: #eee;
}
.zone-weather-temp {
    margin-left: auto;
    color: rgba(255, 255, 255, 0.7);
    font-size: 14px;
}

/* ========== Auto Combat Button ========== */
.auto-combat-btn {
    display: block;
    margin-top: 4px;
    padding: 3px 10px;
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    color: rgba(255, 255, 255, 0.7);
    background: rgba(0, 0, 0, 0.5);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.15s ease;
    user-select: none;
}
.auto-combat-btn:hover {
    color: #fff;
    background: rgba(60, 60, 60, 0.7);
    border-color: rgba(255, 255, 255, 0.3);
}
.auto-combat-btn.active {
    color: #fff;
    background: rgba(180, 40, 40, 0.7);
    border-color: rgba(255, 80, 80, 0.6);
    box-shadow: 0 0 6px rgba(255, 60, 60, 0.3);
}
.auto-combat-btn.active:hover {
    background: rgba(200, 50, 50, 0.8);
}

/* =============================================
   DNA Quality Tier Colors
   ============================================= */
.dna-quality-common { color: #9d9d9d; }
.dna-quality-uncommon { color: #1eff00; }
.dna-quality-rare { color: #0070dd; }
.dna-quality-epic { color: #a335ee; }
.dna-quality-legendary { color: #ff8000; }

.dna-sample-tooltip {
    min-width: 200px;
}
.dna-sample-tooltip .dna-header {
    font-size: 13px;
    font-weight: bold;
    margin-bottom: 4px;
}
.dna-sample-tooltip .dna-source {
    font-size: 11px;
    color: inherit;
    margin-bottom: 6px;
}
.dna-sample-tooltip .dna-traits {
    display: flex;
    flex-direction: column;
    gap: 2px;
}
.dna-sample-tooltip .dna-trait {
    display: flex;
    justify-content: space-between;
    font-size: 11px;
}
.dna-sample-tooltip .dna-trait-name {
    color: #a4caff;
    text-transform: capitalize;
}
.dna-sample-tooltip .dna-trait-bar {
    width: 60px;
    height: 8px;
    background: rgba(0, 0, 0, 0.4);
    border-radius: 4px;
    overflow: hidden;
    margin-left: 8px;
    align-self: center;
}
.dna-sample-tooltip .dna-trait-fill {
    height: 100%;
    border-radius: 4px;
    transition: width 0.3s;
}
.dna-sample-tooltip .dna-category {
    font-size: 11px;
    color: #88ccbb;
    margin-top: 6px;
    text-transform: capitalize;
}

/* ─── Growth Chamber Modal ─── */
#growth-chamber-modal {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 380px;
    max-height: 80vh;
    overflow-y: auto;
    z-index: 10000;
    padding: 0;
    border-radius: 12px;
    border: 1px solid rgba(100, 200, 255, 0.3);
    background: rgba(10, 15, 30, 0.95);
    backdrop-filter: blur(10px);
    box-shadow: 0 0 30px rgba(0, 150, 255, 0.15);
}
.gc-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 14px 18px;
    border-bottom: 1px solid rgba(100, 200, 255, 0.15);
    background: rgba(20, 40, 80, 0.4);
}
.gc-header h3 {
    margin: 0;
    font-size: 16px;
    color: #88ddff;
    letter-spacing: 1px;
}
.gc-close {
    background: none;
    border: none;
    color: #88aacc;
    font-size: 22px;
    cursor: pointer;
    padding: 0 4px;
    line-height: 1;
}
.gc-close:hover { color: #ff6666; }
.gc-content { padding: 16px; }

/* Active process */
.gc-active-process { text-align: center; }
.gc-growing-label {
    font-size: 11px;
    text-transform: uppercase;
    color: #88aacc;
    letter-spacing: 2px;
    margin-bottom: 6px;
}
.gc-plant-name {
    font-size: 20px;
    font-weight: bold;
    margin-bottom: 4px;
}
.gc-source {
    font-size: 12px;
    color: #99aabb;
    margin-bottom: 14px;
}
.gc-progress-bar {
    height: 8px;
    background: rgba(255, 255, 255, 0.08);
    border-radius: 4px;
    overflow: hidden;
    margin-bottom: 8px;
}
.gc-progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #00cc88, #00ffaa);
    border-radius: 4px;
    transition: width 1s linear;
}
.gc-timer {
    font-size: 14px;
    color: #aabbcc;
    margin-bottom: 12px;
}
.gc-ready {
    color: #00ff88;
    font-weight: bold;
    animation: gc-pulse 1.5s ease-in-out infinite;
}
@keyframes gc-pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

/* Buttons */
.gc-btn {
    padding: 8px 20px;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 13px;
    font-weight: bold;
    transition: all 0.2s;
}
.gc-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}
.gc-btn-claim {
    background: linear-gradient(135deg, #00cc88, #00aa66);
    color: #fff;
}
.gc-btn-claim:hover:not(:disabled) {
    background: linear-gradient(135deg, #00ddaa, #00cc88);
    box-shadow: 0 0 12px rgba(0, 200, 100, 0.4);
}
.gc-btn-plant {
    background: linear-gradient(135deg, #3366cc, #2255aa);
    color: #fff;
    padding: 6px 14px;
    font-size: 12px;
}
.gc-btn-plant:hover:not(:disabled) {
    background: linear-gradient(135deg, #4477dd, #3366cc);
    box-shadow: 0 0 10px rgba(50, 100, 200, 0.4);
}

/* Empty state */
.gc-empty {
    text-align: center;
    padding: 24px 0;
}
.gc-empty-icon { font-size: 40px; margin-bottom: 10px; }
.gc-empty-text { font-size: 14px; color: #aabbcc; margin-bottom: 6px; }
.gc-empty-hint { font-size: 11px; color: #667788; line-height: 1.5; }

/* DNA sample list */
.gc-subtitle {
    font-size: 12px;
    color: #88aacc;
    margin-bottom: 10px;
    text-transform: uppercase;
    letter-spacing: 1px;
}
.gc-sample-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
    max-height: 350px;
    overflow-y: auto;
}
.gc-sample-card {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(100, 200, 255, 0.1);
    border-radius: 8px;
    transition: border-color 0.2s;
}
.gc-sample-card:hover {
    border-color: rgba(100, 200, 255, 0.3);
    background: rgba(255, 255, 255, 0.06);
}
.gc-sample-icon { font-size: 22px; flex-shrink: 0; }
.gc-sample-info { flex: 1; min-width: 0; }
.gc-sample-name {
    font-size: 13px;
    color: #ddeeff;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.gc-sample-meta {
    display: flex;
    gap: 8px;
    font-size: 11px;
    margin-top: 2px;
}
.gc-sample-tier { font-weight: bold; }
.gc-sample-cat { color: #778899; text-transform: capitalize; }

/* Genome traits display */
.gc-genome-section {
    margin-top: 16px;
    padding-top: 12px;
    border-top: 1px solid rgba(100, 200, 255, 0.1);
}
.gc-genome-title {
    font-size: 11px;
    color: #88aacc;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 8px;
    text-align: left;
}
.gc-trait-row {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-bottom: 4px;
    font-size: 11px;
}
.gc-trait-name {
    width: 100px;
    color: #99aabb;
    text-align: right;
    flex-shrink: 0;
}
.gc-trait-bar {
    flex: 1;
    height: 6px;
    background: rgba(255, 255, 255, 0.06);
    border-radius: 3px;
    overflow: hidden;
}
.gc-trait-fill {
    height: 100%;
    border-radius: 3px;
    transition: width 0.3s;
}
.gc-trait-val {
    width: 32px;
    color: #778899;
    text-align: right;
    flex-shrink: 0;
}

/* ─── DNA Score in Analyze Panel ─── */
.dna-score-row {
    margin-top: 8px !important;
    border-top: 1px solid rgba(100, 200, 255, 0.1);
    padding-top: 8px !important;
}
.dna-score-loading { color: #556677; font-style: italic; }
.dna-score-value {
    font-weight: bold;
    font-size: 15px;
    cursor: pointer;
    padding: 2px 8px;
    border-radius: 4px;
    background: rgba(255, 255, 255, 0.05);
    transition: all 0.2s;
}
.dna-score-value:hover {
    background: rgba(255, 255, 255, 0.12);
    text-shadow: 0 0 8px currentColor;
}

/* ─── Genome Detail Panel ─── */
#genome-detail-panel {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 320px;
    max-height: 80vh;
    overflow-y: auto;
    z-index: 10001;
    padding: 0;
    border-radius: 12px;
    border: 1px solid rgba(100, 200, 255, 0.3);
    background: rgba(10, 15, 30, 0.95);
    backdrop-filter: blur(10px);
    box-shadow: 0 0 30px rgba(0, 150, 255, 0.15);
}
.gdp-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 16px;
    border-bottom: 1px solid rgba(100, 200, 255, 0.15);
    background: rgba(20, 40, 80, 0.4);
}
.gdp-header h3 { margin: 0; font-size: 14px; color: #88ddff; letter-spacing: 1px; }
.gdp-close {
    background: none; border: none; color: #88aacc; font-size: 20px;
    cursor: pointer; padding: 0 4px; line-height: 1;
}
.gdp-close:hover { color: #ff6666; }
.gdp-content { padding: 16px; text-align: center; }
.gdp-score-section { margin-bottom: 8px; }
.gdp-score { font-size: 42px; font-weight: bold; line-height: 1.1; }
.gdp-tier { font-size: 13px; text-transform: uppercase; letter-spacing: 2px; }
.gdp-source { font-size: 14px; color: #ddeeff; margin-bottom: 4px; }
.gdp-category { font-size: 12px; color: #778899; text-transform: capitalize; margin-bottom: 12px; }
.gdp-sample-btn { margin-top: 14px; width: 100%; }

/* ========== Vendor Shop Panel ========== */
.vendor-shop-panel {
    min-width: 320px;
}

.vendor-tokens {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 13px;
    color: #f1c40f;
    margin-left: auto;
}

.vendor-shop-items {
    padding: 8px;
    max-height: 450px;
    overflow-y: auto;
}

.vendor-loading,
.vendor-empty {
    text-align: center;
    padding: 30px 10px;
    color: #778899;
    font-size: 13px;
}

.vendor-category {
    margin-bottom: 12px;
}

.vendor-category-header {
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    color: #2ecc71;
    padding: 4px 0;
    margin-bottom: 6px;
    border-bottom: 1px solid rgba(46, 204, 113, 0.2);
    letter-spacing: 0.5px;
}

.vendor-items-grid {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.vendor-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 8px;
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 6px;
    transition: all 0.15s;
    cursor: url('/3d/img/cursors/cursor-pointer.svg') 10 4, pointer;
}

.vendor-item:hover {
    background: rgba(46, 204, 113, 0.08);
    border-color: rgba(46, 204, 113, 0.3);
}

.vendor-item.vendor-cant-afford {
    opacity: 0.5;
}

.vendor-item-preview {
    width: 40px;
    height: 40px;
    flex-shrink: 0;
    background: rgba(0, 0, 0, 0.4);
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
}

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

.vendor-item-name {
    font-size: 12px;
    color: #a4caff;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.vendor-item-price {
    font-size: 11px;
    color: #f1c40f;
    display: flex;
    align-items: center;
    gap: 3px;
    margin-top: 2px;
}

.token-icon-small {
    font-size: 12px;
}

.vendor-item-description {
    color: #b0bec5;
    font-size: 13px;
    line-height: 1.5;
    margin: 0 0 10px 0;
}

.vendor-buy-btn {
    font-size: 11px;
}

/* ============================================
   CONFIRM MODAL (shared game-wide)
   ============================================ */
.game-confirm-panel {
    position: fixed;
    z-index: 10000;
    min-width: 280px;
    max-width: 380px;
}
.game-confirm-message {
    font-size: 13px;
    color: #a4caff;
    line-height: 1.5;
    margin-bottom: 18px;
}
.game-confirm-message strong {
    color: #fff;
}
.game-confirm-buttons {
    display: flex;
    gap: 10px;
    justify-content: flex-end;
}
.game-confirm-buttons .btn-confirm,
.game-confirm-buttons .btn-reject {
    padding: 6px 18px;
}

/* ============================================
   STORE PANEL (Premium Purchases)
   ============================================ */
.store-panel {
    max-height: 520px;
}

.store-listings {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    padding: 8px;
    max-height: 400px;
    overflow-y: auto;
}

.store-loading,
.store-empty {
    grid-column: 1 / -1;
    text-align: center;
    padding: 32px 16px;
    color: rgba(255, 255, 255, 0.5);
    font-size: 13px;
}

.store-item {
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    padding: 12px;
    text-align: center;
    transition: border-color 0.2s;
    cursor: url('/3d/img/cursors/cursor-pointer.svg') 10 4, pointer;
}

.store-item:hover {
    border-color: rgba(255, 215, 0, 0.4);
}

.store-item.featured {
    border-color: rgba(255, 215, 0, 0.25);
    background: rgba(255, 215, 0, 0.03);
}

.store-item-preview {
    width: 48px;
    height: 48px;
    margin: 0 auto 8px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.store-item-preview img {
    max-width: 100%;
    max-height: 100%;
    image-rendering: pixelated;
}

.store-item-icon {
    font-size: 28px;
    line-height: 48px;
}

.store-item-name {
    font-weight: bold;
    font-size: 12px;
    color: #fff;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.store-item-desc {
    font-size: 10px;
    color: rgba(255, 255, 255, 0.5);
    margin: 2px 0;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.store-item-qty {
    font-size: 11px;
    color: rgba(255, 255, 255, 0.6);
}

.store-item-price {
    font-size: 14px;
    font-weight: bold;
    color: #4CAF50;
    margin: 6px 0;
}

.store-buy-btn {
    font-size: 11px;
}

/* ========== Creature Speech System ========== */

/* Creature speech bubbles — green tint for friendly NPCs */
.chat-bubble.creature-speech {
    background: rgba(100, 210, 130, 0.25);
    border: 1px solid rgba(80, 190, 110, 0.5);
    box-shadow: 1px 1px 0px rgba(0, 0, 0, 0.3), 0 0 15px rgba(80, 190, 110, 0.15);
    max-width: 220px;
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
}

.chat-bubble.creature-speech::after {
    border-color: rgba(100, 210, 130, 0.25) transparent transparent transparent;
}

.chat-bubble.creature-speech::before {
    border-color: rgba(80, 190, 110, 0.5) transparent transparent transparent;
}

/* Tier 1-2: minimal speech, smaller bubbles, italic */
.chat-bubble.creature-speech.tier-1,
.chat-bubble.creature-speech.tier-2 {
    max-width: 130px;
    font-style: italic;
    font-size: 12px;
    padding: 6px 10px;
    color: rgba(255, 255, 255, 0.8);
}

/* Tier 3: normal */
.chat-bubble.creature-speech.tier-3 {
    max-width: 180px;
}

/* Tier 4: slightly larger */
.chat-bubble.creature-speech.tier-4 {
    max-width: 240px;
}

/* Tier 5: eloquent, golden border accent */
.chat-bubble.creature-speech.tier-5 {
    max-width: 280px;
    border-color: rgba(255, 200, 100, 0.5);
    box-shadow: 1px 1px 0px rgba(0, 0, 0, 0.3), 0 0 20px rgba(255, 200, 100, 0.15);
}

.chat-bubble.creature-speech.tier-5::after {
    border-color: rgba(100, 210, 130, 0.25) transparent transparent transparent;
}

.chat-bubble.creature-speech.tier-5::before {
    border-color: rgba(255, 200, 100, 0.5) transparent transparent transparent;
}

/* Thinking animation for loading state */
.chat-bubble.creature-speech.thinking {
    animation: chatBubbleFadeIn 0.3s ease-out, creatureThinking 1.2s ease-in-out infinite;
}

@keyframes creatureThinking {
    0%, 100% { opacity: 0.5; }
    50% { opacity: 1; }
}

/* Fade out animation */
.chat-bubble.creature-speech.fading {
    animation: chatBubbleFadeOut 0.3s ease-in forwards;
}

/* Talk button in target health container */
.creature-talk-btn {
    position: absolute;
    bottom: -32px;
    right: 0;
    background: linear-gradient(135deg, #4dd0e1, #26c6da);
    border: 1px solid rgba(77, 208, 225, 0.5);
    border-radius: 6px;
    padding: 6px 14px;
    color: #1a1a2e;
    font-size: 11px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    white-space: nowrap;
}

.creature-talk-btn:hover:not([disabled]) {
    background: linear-gradient(135deg, #80deea, #4dd0e1);
    transform: scale(1.05);
    box-shadow: 0 4px 12px rgba(77, 208, 225, 0.4);
}

.creature-talk-btn:active:not([disabled]) {
    transform: scale(0.98);
}

.creature-talk-btn[disabled] {
    opacity: 0.6;
    cursor: default;
    background: linear-gradient(135deg, #546e7a, #455a64);
    border-color: rgba(84, 110, 122, 0.5);
    color: #90a4ae;
}

/* ========== QUEST SYSTEM ========== */

/* Quest Dialog Panel (glass-panel based, draggable) */
.quest-dialog-panel {
    width: 380px;
    max-width: 90vw;
    z-index: 600;
}
.quest-dialog-panel .panel-header-title {
    color: #FFD700;
}
.quest-dialog-panel .panel-body {
    padding: 14px;
    max-height: 60vh;
    overflow-y: auto;
}
.quest-dialog-title {
    color: #FFD700;
    font-size: 18px;
    margin: 0 0 8px 0;
    font-weight: 600;
}
.quest-dialog-description {
    color: #b0bec5;
    font-size: 13px;
    line-height: 1.5;
    margin: 0 0 16px 0;
}

.quest-dialog-objectives h4,
.quest-dialog-rewards h4 {
    color: #90a4ae;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin: 0 0 8px 0;
}

.quest-dialog-objectives ul {
    list-style: none;
    padding: 0;
    margin: 0 0 16px 0;
}
.quest-dialog-objectives li {
    color: #cfd8dc;
    font-size: 13px;
    padding: 4px 0;
    padding-left: 18px;
    position: relative;
}
.quest-dialog-objectives li::before {
    content: '⬜';
    position: absolute;
    left: 0;
    font-size: 10px;
}

/* Quest rewards display */
.quest-reward-list {
    display: flex;
    gap: 16px;
    margin-bottom: 12px;
}
.quest-reward-item {
    display: flex;
    align-items: center;
    gap: 6px;
    color: #a4caff;
    font-size: 14px;
    font-weight: 500;
}
.quest-reward-icon {
    font-size: 16px;
}

/* Difficulty badge */
.quest-difficulty-badge {
    display: inline-block;
    padding: 2px 10px;
    border-radius: 10px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}
.quest-diff-easy {
    background: rgba(76, 175, 80, 0.2);
    color: #81c784;
    border: 1px solid rgba(76, 175, 80, 0.3);
}
.quest-diff-medium {
    background: rgba(255, 152, 0, 0.2);
    color: #ffb74d;
    border: 1px solid rgba(255, 152, 0, 0.3);
}
.quest-diff-hard {
    background: rgba(244, 67, 54, 0.2);
    color: #ef5350;
    border: 1px solid rgba(244, 67, 54, 0.3);
}

/* Dialog footer buttons */
.quest-dialog-footer {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    padding-top: 12px;
    margin-top: 12px;
    border-top: 1px solid rgba(255, 255, 255, 0.06);
}
.quest-dialog-footer .btn-confirm,
.quest-dialog-footer .btn-reject {
    padding: 8px 20px;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 600;
}

/* Quest Notifications */
.quest-notification {
    position: fixed;
    top: 80px;
    right: -400px;
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 20px;
    border-radius: 10px;
    z-index: 10001;
    transition: right 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    min-width: 280px;
    max-width: 400px;
    pointer-events: none;
}
.quest-notification.show {
    right: 20px;
}
.quest-notification-icon {
    font-size: 24px;
    flex-shrink: 0;
}
.quest-notification-content {
    flex: 1;
}
.quest-notification-title {
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 2px;
}
.quest-notification-name {
    font-size: 14px;
    font-weight: 600;
    color: #fff;
}
.quest-notification-rewards {
    font-size: 12px;
    margin-top: 4px;
}

.quest-notification-accepted {
    background: linear-gradient(135deg, rgba(30, 40, 60, 0.95), rgba(25, 35, 50, 0.95));
    border: 1px solid rgba(255, 215, 0, 0.3);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.5);
}
.quest-notification-accepted .quest-notification-title { color: #FFD700; }

.quest-notification-objective {
    background: linear-gradient(135deg, rgba(30, 50, 40, 0.95), rgba(25, 40, 35, 0.95));
    border: 1px solid rgba(76, 175, 80, 0.3);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.5);
}
.quest-notification-objective .quest-notification-title { color: #81c784; }

.quest-notification-complete {
    background: linear-gradient(135deg, rgba(50, 40, 20, 0.95), rgba(40, 30, 15, 0.95));
    border: 1px solid rgba(255, 215, 0, 0.5);
    box-shadow: 0 4px 20px rgba(255, 215, 0, 0.15), 0 4px 20px rgba(0, 0, 0, 0.5);
}
.quest-notification-complete .quest-notification-title { color: #FFD700; }
.quest-notification-complete .quest-notification-rewards { color: #81c784; }

/* Quest Journal Panel */
.quests-panel .panel-body {
    padding: 0;
}
.quests-tab-content {
    padding: 12px;
}
.quests-empty {
    color: #78909c;
    text-align: center;
    padding: 30px 20px;
    font-size: 13px;
}
.quests-loading {
    color: #78909c;
    text-align: center;
    padding: 30px;
}

.quests-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}
.quest-item {
    background: #00000050;
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 8px;
    padding: 12px;
    transition: border-color 0.2s;
}
.quest-item:hover {
    border-color: rgba(255, 255, 255, 0.18);
    background: #00000065;
}
.quest-complete-ready {
    border-color: rgba(255, 215, 0, 0.3);
    background: rgba(255, 215, 0, 0.06);
}
.quest-item-completed {
    opacity: 0.7;
}

.quest-item-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 6px;
}
.quest-item-name {
    color: #a4caff;
    font-weight: 600;
    font-size: 14px;
}
.quest-item-desc {
    color: #90a4ae;
    font-size: 12px;
    margin: 0 0 10px 0;
    line-height: 1.4;
}

.quest-item-objectives {
    margin-bottom: 10px;
}
.quest-objective {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 4px 0;
    font-size: 12px;
    color: #b0bec5;
}
.quest-objective.complete {
    color: #81c784;
    text-decoration: line-through;
    opacity: 0.7;
}
.quest-objective-check {
    font-size: 10px;
    flex-shrink: 0;
}
.quest-objective-text {
    flex: 1;
}
.quest-objective-progress {
    color: #78909c;
    font-size: 11px;
    font-weight: 500;
}

.quest-item-rewards {
    display: flex;
    gap: 12px;
    margin-bottom: 8px;
}
.quest-reward-xp {
    color: #81c784;
    font-size: 12px;
}
.quest-reward-tokens {
    color: #FFD700;
    font-size: 12px;
}

.quest-item-actions {
    display: flex;
    justify-content: flex-end;
}
.quest-status-ready {
    color: #FFD700;
    font-size: 12px;
    font-style: italic;
}
.quest-abandon-btn {
    padding: 3px 10px;
    font-size: 11px;
}

.quest-completed-date {
    color: #607d8b;
    font-size: 11px;
    margin-top: 6px;
}

/* ========== END QUEST SYSTEM ========== */

/* ========== SPECTATOR CTA PANEL ========== */
.spectator-cta-panel {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 150;
    background: linear-gradient(135deg, rgba(20, 30, 60, 0.95), rgba(30, 50, 80, 0.95));
    border-top: 2px solid rgba(106, 252, 255, 0.4);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    padding: 16px 20px;
    animation: slideUpCTA 0.5s ease-out;
}
.spectator-cta-panel.hidden { display: none; }

.spectator-cta-content {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 20px;
    max-width: 900px;
    margin: 0 auto;
    position: relative;
}
.spectator-cta-text {
    flex: 1;
}
.spectator-cta-text h3 {
    margin: 0 0 4px;
    color: #6afcff;
    font-size: 16px;
    font-weight: 600;
}
.spectator-cta-text p {
    margin: 0;
    color: #c0d8f0;
    font-size: 13px;
    line-height: 1.4;
}

.spectator-cta-actions {
    display: flex;
    gap: 10px;
    flex-shrink: 0;
    align-items: center;
}

.spectator-cta-btn {
    padding: 10px 24px;
    border: none;
    border-radius: 6px;
    font-weight: 600;
    cursor: pointer;
    font-size: 14px;
    transition: transform 0.15s, box-shadow 0.15s;
    text-decoration: none;
    display: inline-block;
    white-space: nowrap;
}
.spectator-cta-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}
.spectator-cta-btn:active {
    transform: translateY(0);
}
.spectator-cta-btn:not(.secondary) {
    background: #6afcff;
    color: #0a1628;
}
.spectator-cta-btn:not(.secondary):hover {
    background: #8bfdff;
}
.spectator-cta-btn.secondary {
    background: transparent;
    border: 1px solid rgba(106, 252, 255, 0.4);
    color: #6afcff;
    font-size: 12px;
    padding: 8px 16px;
}
.spectator-cta-btn.secondary:hover {
    background: rgba(106, 252, 255, 0.1);
}
.spectator-cta-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

.spectator-cta-dismiss {
    position: absolute;
    top: -8px;
    right: -8px;
    background: none;
    border: none;
    color: #6a7a8a;
    font-size: 20px;
    cursor: pointer;
    padding: 4px 8px;
    line-height: 1;
    transition: color 0.15s;
}
.spectator-cta-dismiss:hover {
    color: #fff;
}

.spectator-cta-status {
    color: #c0d8f0;
    font-size: 13px;
}

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

@media (max-width: 600px) {
    .spectator-cta-content {
        flex-direction: column;
        text-align: center;
    }
    .spectator-cta-actions {
        width: 100%;
        justify-content: center;
    }
    .spectator-cta-btn {
        flex: 1;
        min-width: 0;
    }
    .spectator-cta-text h3 { font-size: 14px; }
    .spectator-cta-text p { font-size: 12px; }
}

/* Referral Item Selection Modal */
.referral-item-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 200;
    background: rgba(0, 0, 0, 0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    animation: fadeIn 0.2s ease-out;
}
.referral-item-modal-content {
    background: #1a1a2e;
    border: 1px solid rgba(106, 252, 255, 0.3);
    border-radius: 8px;
    width: 90%;
    max-width: 600px;
    max-height: 80vh;
    display: flex;
    flex-direction: column;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5);
}
.referral-item-modal-body {
    padding: 16px;
    overflow-y: auto;
    flex: 1;
}
.referral-item-subtitle {
    color: #c0d8f0;
    font-size: 13px;
    margin: 0 0 16px;
}
.referral-item-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 12px;
}
.referral-item-card {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 6px;
    padding: 14px;
    transition: border-color 0.15s;
}
.referral-item-card:hover {
    border-color: rgba(106, 252, 255, 0.4);
}
.referral-item-name {
    font-size: 14px;
    font-weight: 600;
    color: #fff;
    margin-bottom: 4px;
}
.referral-item-desc {
    font-size: 11px;
    color: #a4caff;
    margin-bottom: 8px;
    line-height: 1.4;
}
.referral-item-price {
    font-size: 12px;
    color: #2ecc71;
    margin-bottom: 10px;
}
.referral-item-claim-btn {
    width: 100%;
    padding: 8px;
    background: #6afcff;
    color: #0a1628;
    border: none;
    border-radius: 4px;
    font-weight: 600;
    font-size: 13px;
    cursor: pointer;
    transition: background 0.15s;
}
.referral-item-claim-btn:hover {
    background: #8bfdff;
}
.referral-item-claim-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}
/* ========== END SPECTATOR CTA PANEL ========== */

/* ========== Chat Log Panel ========== */

.chat-log-panel .panel-body {
    padding: 0;
}

.chat-log-entries {
    display: flex;
    flex-direction: column;
    gap: 1px;
    padding: 6px;
    overflow-y: auto;
    max-height: 100%;
    font-size: 13px;
}

.chat-log-row {
    display: flex;
    gap: 6px;
    padding: 4px 8px;
    line-height: 1.4;
    align-items: baseline;
}

.chat-log-row:hover {
    background: rgba(255, 255, 255, 0.08);
}

.chat-log-time {
    color: rgba(255, 255, 255, 0.3);
    font-size: 11px;
    flex-shrink: 0;
    min-width: 42px;
}

.chat-log-name {
    font-weight: 600;
    flex-shrink: 0;
    white-space: nowrap;
}

.chat-log-player .chat-log-name {
    color: rgba(100, 169, 255, 0.9);
}

.chat-log-creature .chat-log-name {
    color: rgba(100, 210, 130, 0.9);
}

.chat-log-text {
    color: rgba(255, 255, 255, 0.85);
    word-break: break-word;
}

.chat-log-empty {
    text-align: center;
    color: rgba(255, 255, 255, 0.3);
    padding: 20px;
    font-style: italic;
}

/* ========== Action Bar Tooltip ========== */
.action-bar-tooltip {
    position: fixed;
    z-index: 10000;
    pointer-events: none;
    transform: translate(-50%, -100%);
    background: rgba(10, 10, 20, 0.92);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 6px;
    padding: 6px 10px;
    text-align: center;
    white-space: nowrap;
    opacity: 0;
    transition: opacity 0.15s ease;
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.5);
}

.action-bar-tooltip.visible {
    opacity: 1;
}

.action-bar-tooltip .abt-name {
    font-size: 12px;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.95);
}

.action-bar-tooltip .abt-key {
    font-size: 10px;
    color: rgba(255, 255, 255, 0.4);
    margin-left: 6px;
    background: rgba(255, 255, 255, 0.08);
    padding: 1px 5px;
    border-radius: 3px;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.action-bar-tooltip .abt-sub {
    font-size: 10px;
    color: rgba(180, 200, 255, 0.7);
    margin-top: 2px;
}

/* ===== Creature Size Labels (nameplate) ===== */
.nameplate-size {
    font-size: 9px;
    font-weight: 600;
    opacity: 0.8;
    margin-left: 3px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.nameplate-size.tiny {
    color: #85c1e9;
}

.nameplate-size.small {
    color: #5dade2;
}

.nameplate-size.large {
    color: #e67e22;
}

.nameplate-size.massive {
    color: #e74c3c;
    text-shadow: 0 0 4px rgba(231, 76, 60, 0.4);
}

/* ========== Unified Magic Panel ========== */

.magic-panel {
    width: 420px;
    max-height: 80vh;
    overflow: hidden;
}

.magic-panel .panel-body {
    overflow-y: auto;
    max-height: calc(80vh - 50px);
    padding: 0;
    background: #0a0a14;
}

/* Flow Summary Bar */
.magic-flow-summary {
    padding: 10px 14px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    font-size: 13px;
    color: #a4caff;
    position: sticky;
    top: 0;
    background: rgba(8, 8, 18, 0.95);
    z-index: 2;
    gap: 10px;
}

.magic-flow-summary strong {
    color: #f1c40f;
}

.magic-flow-bar {
    flex: 1;
    height: 6px;
    background: rgba(255, 255, 255, 0.08);
    border-radius: 3px;
    overflow: hidden;
    min-width: 60px;
}

.magic-flow-bar-fill {
    height: 100%;
    background: linear-gradient(90deg, #f1c40f, #e67e22);
    border-radius: 3px;
    transition: width 0.3s ease;
}

.magic-flow-respec-btn {
    background: rgba(231, 76, 60, 0.15);
    border: 1px solid rgba(231, 76, 60, 0.3);
    color: #e74c3c;
    padding: 4px 10px;
    border-radius: 4px;
    font-size: 11px;
    cursor: pointer;
    transition: all 0.15s;
    white-space: nowrap;
}

.magic-flow-respec-btn:hover:not(:disabled) {
    background: rgba(231, 76, 60, 0.3);
}

.magic-flow-respec-btn:disabled {
    opacity: 0.3;
    cursor: default;
}

/* Accordion Rows */
.magic-accordion-row {
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.magic-accordion-header {
    display: flex;
    align-items: center;
    padding: 10px 14px;
    cursor: pointer;
    transition: background 0.15s;
    user-select: none;
    gap: 10px;
    min-height: 44px;
    background: linear-gradient(90deg, color-mix(in srgb, var(--school-color, #888) 12%, #0a0a14), #0e0e1a);
}

.magic-accordion-header:hover:not(.blocked) {
    background: linear-gradient(90deg, color-mix(in srgb, var(--school-color, #888) 20%, #0a0a14), #141420);
}

.magic-accordion-header.expanded {
    background: linear-gradient(90deg, color-mix(in srgb, var(--school-color, #888) 22%, #0a0a14), #121220);
    border-bottom: 1px solid color-mix(in srgb, var(--school-color, #888) 30%, transparent);
}

.magic-accordion-header.blocked {
    opacity: 0.35;
    cursor: not-allowed;
}

.magic-accordion-header.inactive:not(.blocked) {
    opacity: 0.55;
}

/* School color dot */
.magic-school-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    flex-shrink: 0;
    box-shadow: 0 0 6px var(--school-color, rgba(255, 255, 255, 0.15)),
                0 0 12px color-mix(in srgb, var(--school-color, transparent) 40%, transparent);
}

.magic-school-label {
    font-size: 14px;
    font-weight: 600;
    color: #ddd;
    flex: 1;
    min-width: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.magic-accordion-header.active .magic-school-label {
    color: color-mix(in srgb, var(--school-color, #fff) 60%, #fff);
}

.magic-accordion-header.blocked .magic-school-label {
    color: #666;
}

/* Flow controls (+/- buttons) */
.magic-flow-controls {
    display: flex;
    align-items: center;
    gap: 2px;
    flex-shrink: 0;
}

.magic-flow-btn {
    width: 26px;
    height: 26px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    background: rgba(255, 255, 255, 0.06);
    color: #bbb;
    border-radius: 4px;
    font-size: 16px;
    font-weight: bold;
    line-height: 1;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    transition: all 0.15s;
    -webkit-tap-highlight-color: transparent;
}

.magic-flow-btn:hover:not(:disabled) {
    background: color-mix(in srgb, var(--school-color, #fff) 25%, rgba(255,255,255,0.1));
    color: #fff;
    border-color: color-mix(in srgb, var(--school-color, #fff) 50%, rgba(255,255,255,0.2));
}

.magic-flow-btn:active:not(:disabled) {
    transform: scale(0.9);
}

.magic-flow-btn:disabled {
    opacity: 0.2;
    cursor: default;
}

.magic-flow-info {
    font-size: 13px;
    color: #bbb;
    min-width: 30px;
    text-align: center;
}

.magic-flow-info strong {
    color: #f1c40f;
    font-size: 14px;
}

.magic-power-label {
    font-size: 11px;
    color: #999;
    min-width: 32px;
    text-align: center;
}

.magic-slot-count {
    font-size: 11px;
    color: #999;
    min-width: 50px;
    text-align: right;
    white-space: nowrap;
}

.magic-slot-count.has-slots {
    color: #2ecc71;
    font-weight: 600;
}

/* Expand arrow */
.magic-expand-arrow {
    font-size: 10px;
    color: #777;
    transition: transform 0.2s;
    flex-shrink: 0;
    width: 14px;
    text-align: center;
}

.magic-accordion-header.expanded .magic-expand-arrow {
    transform: rotate(90deg);
}

/* Accordion Body */
.magic-accordion-body {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease-out;
    background: rgba(0, 0, 0, 0.35);
    border-left: 3px solid color-mix(in srgb, var(--school-color, #888) 40%, transparent);
}

.magic-accordion-body.open {
    max-height: 800px;
    overflow-y: auto;
}

.magic-accordion-content {
    padding: 12px 14px 16px;
}

/* Spell Slots Grid */
.magic-spell-slots {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    margin-bottom: 12px;
}

.magic-spell-slot {
    width: 60px;
    height: 60px;
    border: 2px solid rgba(255, 255, 255, 0.15);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    cursor: pointer;
    transition: all 0.15s;
    background: rgba(0, 0, 0, 0.25);
}

.magic-spell-slot:hover {
    border-color: rgba(255, 255, 255, 0.25);
    background: rgba(0, 0, 0, 0.35);
}

.magic-spell-slot.filled {
    border-color: color-mix(in srgb, var(--school-color, #9b59b6) 60%, transparent);
    background: color-mix(in srgb, var(--school-color, #9b59b6) 8%, rgba(0,0,0,0.3));
}

.magic-spell-slot.filled:hover {
    border-color: var(--school-color, rgba(155, 89, 182, 0.7));
    background: color-mix(in srgb, var(--school-color, #9b59b6) 15%, rgba(0,0,0,0.3));
}

.magic-spell-slot.empty {
    border-style: dashed;
    opacity: 0.6;
    font-size: 22px;
    color: #666;
}

.magic-spell-slot.empty:hover {
    opacity: 0.9;
    color: inherit;
}

.magic-spell-slot .slot-remove-btn {
    position: absolute;
    top: -6px;
    right: -6px;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: rgba(231, 76, 60, 0.85);
    color: white;
    font-size: 10px;
    line-height: 16px;
    text-align: center;
    cursor: pointer;
    display: none;
    border: none;
    padding: 0;
    z-index: 1;
}

.magic-spell-slot:hover .slot-remove-btn {
    display: block;
}

.magic-spell-slot .slot-spell-name {
    position: absolute;
    bottom: -16px;
    left: 50%;
    transform: translateX(-50%);
    font-size: 9px;
    color: inherit;
    white-space: nowrap;
    max-width: 75px;
    overflow: hidden;
    text-overflow: ellipsis;
    pointer-events: none;
}

/* Combined Spell Icon */
.combined-spell-icon {
    width: 44px;
    height: 44px;
    border-radius: 6px;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.combined-spell-icon .element-icon {
    width: 28px;
    height: 28px;
    z-index: 1;
    filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.5));
}

.combined-spell-icon .form-badge {
    position: absolute;
    bottom: 2px;
    right: 2px;
    width: 16px;
    height: 16px;
    z-index: 2;
    opacity: 0.8;
    filter: drop-shadow(0 0 1px rgba(0, 0, 0, 0.8));
}

/* Compose Section inside accordion */
.magic-compose-section {
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    padding-top: 12px;
    margin-top: 10px;
}

.magic-compose-label {
    font-size: 11px;
    color: inherit;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 8px;
    font-weight: 600;
}

.magic-compose-elements {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    margin-bottom: 12px;
}

.magic-compose-elements .compose-element-tile {
    width: 52px;
    height: 52px;
    aspect-ratio: 1;
}

.magic-compose-forms {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    margin-bottom: 12px;
}

.magic-compose-forms .compose-form-card {
    flex: 1;
    min-width: 85px;
    padding: 8px 6px;
}

.magic-slots-label {
    font-size: 11px;
    color: inherit;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 8px;
    font-weight: 600;
}

.magic-slots-full-hint {
    color: #999;
    font-size: 12px;
    text-align: center;
    padding: 8px 0;
    font-style: italic;
}

/* Two side-by-side compose pickers */
.magic-compose-pickers {
    display: flex;
    gap: 12px;
    margin-bottom: 12px;
}

.magic-compose-picker {
    flex: 1;
    min-width: 0;
}

.magic-compose-picker-label {
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 6px;
    font-weight: 600;
}

.compose-form-fixed {
    border: 1px solid #555;
    border-radius: 6px;
    padding: 10px;
    text-align: center;
    background: rgba(255,255,255,0.03);
}

.compose-form-fixed-name {
    display: block;
    font-size: 13px;
    font-weight: 600;
    margin-top: 4px;
    color: #ddd;
}

.compose-form-fixed-stats {
    font-size: 10px;
    color: #888;
    margin-top: 4px;
}

.magic-compose-forces {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.compose-force-tile {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 10px;
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 5px;
    cursor: pointer;
    transition: background 0.15s, border-color 0.15s;
    background: rgba(255,255,255,0.03);
}

.compose-force-tile:hover {
    background: rgba(255,255,255,0.08);
}

.compose-force-tile.selected {
    background: rgba(230, 126, 34, 0.15);
    border-color: #e67e22;
}

.compose-force-icon {
    font-size: 14px;
    width: 20px;
    text-align: center;
}

.compose-force-name {
    font-size: 12px;
    color: #ccc;
}

/* Draggable spells from slots */
.magic-spell-slot[draggable="true"] {
    cursor: grab;
}

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

.magic-spell-slot.dragging {
    opacity: 0.4;
    transform: scale(0.9);
}

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

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

/* Mobile Magic Panel */
@media (max-width: 768px) {
    .magic-panel {
        width: 100vw !important;
        left: 0 !important;
        max-height: 75vh;
    }

    .magic-accordion-header {
        padding: 12px 16px;
        min-height: 48px;
    }

    .magic-school-label {
        font-size: 15px;
    }

    .magic-flow-btn {
        width: 36px;
        height: 36px;
        font-size: 20px;
    }

    .magic-flow-info {
        font-size: 14px;
    }

    .magic-spell-slot {
        width: 64px;
        height: 64px;
    }

    .magic-compose-pickers {
        flex-direction: column;
        gap: 8px;
    }

    .magic-compose-forces {
        flex-direction: row;
        flex-wrap: wrap;
    }

    .compose-force-tile {
        padding: 8px 12px;
    }

    .magic-compose-label {
        font-size: 12px;
    }

    .magic-slot-count {
        font-size: 12px;
    }
}

/* =============================================
   FARMING POTION PICKER
   ============================================= */
.plant-potion-btn {
    background: linear-gradient(135deg, #6a0dad, #9b30ff) !important;
    color: #fff !important;
}
.plant-potion-btn:hover {
    background: linear-gradient(135deg, #7b1fa2, #ab47bc) !important;
}

.potion-picker-overlay {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,0.6);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
}

.potion-picker-modal {
    background: rgba(20,20,30,0.95);
    border: 1px solid rgba(255,255,255,0.15);
    border-radius: 12px;
    padding: 16px;
    min-width: 220px;
    max-width: 320px;
    backdrop-filter: blur(10px);
}

.potion-picker-title {
    font-size: 14px;
    font-weight: 600;
    color: #ddd;
    text-align: center;
    margin-bottom: 12px;
    padding-bottom: 8px;
    border-bottom: 1px solid rgba(255,255,255,0.1);
}

.potion-picker-list {
    display: flex;
    flex-direction: column;
    gap: 6px;
    max-height: 240px;
    overflow-y: auto;
}

.potion-picker-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: rgba(255,255,255,0.06);
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 8px;
    padding: 10px 12px;
    cursor: pointer;
    transition: background 0.15s, border-color 0.15s;
    color: #ddd;
    font-size: 13px;
}
.potion-picker-item:hover {
    background: rgba(106,13,173,0.3);
    border-color: rgba(155,48,255,0.5);
}

.potion-picker-name {
    flex: 1;
}

.potion-picker-qty {
    color: inherit;
    font-size: 12px;
    margin-left: 8px;
}

.potion-picker-cancel {
    display: block;
    width: 100%;
    margin-top: 10px;
    padding: 8px;
    background: rgba(255,255,255,0.06);
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 8px;
    color: inherit;
    font-size: 12px;
    cursor: pointer;
    transition: background 0.15s;
}
.potion-picker-cancel:hover {
    background: rgba(255,255,255,0.12);
}

/* ═══════════════════════════════════════════════════════════════════
   COMPANION SYSTEM
   ═══════════════════════════════════════════════════════════════════ */

/* Companion Panel (below health HUD) */
/* ── Companion Bar (below player health bar) ──────────────────── */
.companion-bar-panel {
    grid-column: 1;
    margin-top: -2px;
    padding: 3px 8px 4px;
    background: rgba(0, 0, 0, 0.55);
    border: 1px solid rgba(46, 204, 113, 0.25);
    border-top: none;
    border-radius: 0 0 6px 6px;
    pointer-events: auto;
    animation: companionBarSlideIn 0.3s ease-out;
}

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

.companion-bar-row {
    display: flex;
    align-items: center;
    gap: 4px;
    margin-bottom: 2px;
}

.companion-bar-icon {
    font-size: 10px;
    line-height: 1;
    opacity: 0.8;
}

.companion-bar-name {
    color: #2ecc71;
    font-size: 10px;
    font-weight: 600;
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.companion-bar-value {
    color: rgba(255, 255, 255, 0.6);
    font-size: 9px;
    white-space: nowrap;
}

.companion-bar-dismiss {
    background: none;
    border: none;
    color: rgba(255, 255, 255, 0.3);
    font-size: 12px;
    line-height: 1;
    width: 14px;
    height: 14px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    transition: color 0.2s;
    pointer-events: auto;
}

.companion-bar-dismiss:hover {
    color: #e74c3c;
}

.companion-bar-track {
    height: 4px;
    background: rgba(255, 255, 255, 0.08);
    border-radius: 2px;
    overflow: hidden;
}

.companion-bar-fill {
    height: 100%;
    background: #2ecc71;
    border-radius: 2px;
    transition: width 0.3s ease, background-color 0.3s ease;
}

.companion-gage-container {
    margin-top: 2px;
    display: flex;
    flex-direction: column;
    gap: 1px;
}

.companion-gage-container .gage-bar-track {
    height: 3px;
}

/* Companion Nameplate (for other players' companions) */
.companion-nameplate .nameplate-name-row {
    justify-content: center;
}

.companion-name-text {
    color: #2ecc71 !important;
    font-size: 10px;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.8);
}

/* ── Companion Acquired Flash ─────────────────────────────────── */
.companion-acquired-notification {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: radial-gradient(ellipse at center, rgba(46, 204, 113, 0.2) 0%, transparent 70%);
    z-index: 10001;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.5s;
}

.companion-acquired-notification.show {
    opacity: 1;
}

.companion-acquired-content {
    text-align: center;
    transform: scale(0.5);
    transition: transform 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.companion-acquired-notification.show .companion-acquired-content {
    transform: scale(1);
}

.companion-acquired-title {
    font-size: 42px;
    font-weight: bold;
    font-family: "Noto Sans", sans-serif;
    color: #2ecc71;
    text-shadow:
        0 0 10px rgba(46, 204, 113, 0.8),
        0 0 20px rgba(46, 204, 113, 0.6),
        0 0 30px rgba(46, 204, 113, 0.4),
        0 2px 4px rgba(0, 0, 0, 0.5);
    animation: companionAcquiredPulse 0.5s ease-out;
}

.companion-acquired-name {
    font-size: 28px;
    font-weight: bold;
    font-family: "Noto Sans", sans-serif;
    color: #fff;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.5);
    margin-top: 8px;
}

.companion-acquired-sub {
    font-size: 16px;
    color: rgba(46, 204, 113, 0.9);
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.5);
    margin-top: 4px;
}

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

/* Mobile responsive */
@media (max-width: 768px) {
    .companion-bar-panel {
        padding: 2px 6px 3px;
    }
    .companion-bar-name { font-size: 9px; }
    .companion-bar-value { font-size: 8px; }
    .companion-acquired-title { font-size: 32px; }
    .companion-acquired-name { font-size: 22px; }
}

/* ── Ambient Barks ─────────────────────────────────────────────── */
.chat-bubble.ambient-bark {
    font-size: 11px;
    max-width: 160px;
    opacity: 0.85;
    padding: 4px 8px;
    animation: ambientBarkFadeIn 0.4s ease-out;
}

@keyframes ambientBarkFadeIn {
    from { opacity: 0; transform: translateY(5px); }
    to   { opacity: 0.85; transform: translateY(0); }
}

/* ── Creature Thought Bubbles ──────────────────────────────────── */
.chat-bubble.creature-thought {
    font-size: 11px;
    max-width: 180px;
    opacity: 0.6;
    padding: 4px 10px;
    font-style: italic;
    background: rgba(100, 80, 140, 0.75);
    border: 1px solid rgba(160, 140, 200, 0.3);
    color: rgba(220, 210, 240, 0.9);
    animation: thoughtFadeIn 0.6s ease-out;
}

@keyframes thoughtFadeIn {
    from { opacity: 0; transform: translateY(8px) scale(0.9); }
    to   { opacity: 0.6; transform: translateY(0) scale(1); }
}

/* ── Player Gage Bars (Fuel/Coolant/Spark) ────────────────────── */
.gage-bars-container {
    margin-top: 3px;
    display: flex;
    flex-direction: column;
    gap: 2px;
}
.gage-bar-row {
    display: flex;
    align-items: center;
    gap: 3px;
}
.gage-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 10px;
    height: 10px;
    flex-shrink: 0;
    color: #4ade80;
    transition: color 0.5s ease;
}
.gage-icon svg {
    display: block;
}
.gage-bar-track {
    height: 4px;
    background: rgba(0,0,0,0.5);
    border-radius: 2px;
    overflow: hidden;
    border: 1px solid rgba(255,255,255,0.05);
    flex: 1;
}
.gage-bar-fill {
    height: 100%;
    border-radius: 1px;
    transition: width 0.5s ease, background 0.5s ease;
}
/* Default fill colors (overridden by JS tier color) */
.hunger-bar-fill { background: #4ade80; }
.thirst-bar-fill { background: #4ade80; }
.energy-bar-fill { background: #4ade80; }
.gage-bar-fill.critical { animation: gage-critical-pulse 2s ease-in-out infinite; }

@keyframes gage-critical-pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.4; }
}

/* ── Cooking Panel ────────────────────────────────────────────── */
.cooking-panel {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 420px;
    max-height: 80vh;
    z-index: 1200;
    display: flex;
    flex-direction: column;
}

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

.cooking-tab {
    padding: 8px 14px;
    background: none;
    border: none;
    color: #a4caff;
    font-size: 12px;
    cursor: pointer;
    border-bottom: 2px solid transparent;
    transition: all 0.2s;
}

.cooking-tab:hover { color: #a4caff; }

.cooking-tab.active {
    color: #D4A574;
    border-bottom-color: #D4A574;
}

.cooking-tab-content {
    display: none;
    overflow-y: auto;
    max-height: 60vh;
    padding: 12px;
}

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

/* Mode Toggle */
.cooking-mode-toggle {
    display: flex;
    gap: 4px;
    margin-bottom: 12px;
    background: rgba(0, 0, 0, 0.3);
    border-radius: 6px;
    padding: 3px;
}

.mode-btn {
    flex: 1;
    padding: 6px 0;
    background: none;
    border: none;
    color: #a4caff;
    font-size: 11px;
    cursor: pointer;
    border-radius: 4px;
    transition: all 0.2s;
}

.mode-btn:hover { color: #a4caff; }

.mode-btn.active {
    background: rgba(212, 165, 116, 0.3);
    color: #D4A574;
}

/* Cooking Sections */
.cooking-section {
    margin-bottom: 14px;
}

.cooking-section-header {
    font-size: 11px;
    color: inherit;
    margin-bottom: 6px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.cooking-hint {
    font-size: 10px;
    text-transform: none;
}

/* Recipe Selection Grid */
.cooking-recipe-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 6px;
}

.recipe-option {
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 6px;
    padding: 8px;
    cursor: pointer;
    transition: all 0.2s;
}

.recipe-option:hover {
    border-color: rgba(212, 165, 116, 0.4);
    background: rgba(212, 165, 116, 0.05);
}

.recipe-option.selected {
    border-color: rgba(212, 165, 116, 0.8);
    background: rgba(212, 165, 116, 0.15);
}

.recipe-option.locked {
    opacity: 0.4;
    pointer-events: none;
}

.recipe-option-name {
    font-size: 12px;
    font-weight: 600;
    color: #fff;
    margin-bottom: 2px;
}

.recipe-option-info {
    display: flex;
    justify-content: space-between;
    font-size: 10px;
}

.recipe-option-type {
    color: #a4caff;
    text-transform: capitalize;
}

.recipe-option-stat {
    color: #2ecc71;
}

.recipe-option-lock {
    font-size: 9px;
    color: #e74c3c;
    margin-top: 2px;
}

/* Cooking Summary */
.cooking-summary {
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(212, 165, 116, 0.3);
    border-radius: 8px;
    padding: 12px;
    margin-top: 10px;
}

.cooking-preview {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 8px;
}

.cooking-preview-icon {
    font-size: 22px;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(212, 165, 116, 0.2);
    border-radius: 6px;
    color: #D4A574;
}

.cooking-preview-name {
    font-size: 14px;
    font-weight: 600;
    color: #fff;
}

.cooking-preview-details {
    font-size: 11px;
    color: #2ecc71;
}

.cooking-inputs {
    margin-bottom: 8px;
}

.cooking-inputs-label {
    font-size: 10px;
    color: #a4caff;
    margin-bottom: 4px;
}

.cooking-input-item {
    display: inline-block;
    font-size: 10px;
    padding: 2px 6px;
    margin: 2px;
    border-radius: 3px;
    background: rgba(255, 255, 255, 0.1);
}

.cooking-input-item.has-enough { color: #2ecc71; }
.cooking-input-item.need-more { color: #e74c3c; }

/* Freeform Ingredients */
.cooking-ingredient-card {
    display: flex;
    align-items: center;
    gap: 8px;
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 6px;
    padding: 8px;
    cursor: pointer;
    transition: all 0.2s;
}

.cooking-ingredient-card:hover {
    border-color: rgba(212, 165, 116, 0.4);
}

.cooking-ingredient-card.in-pot {
    opacity: 0.4;
    pointer-events: none;
}

.ing-parent {
    font-size: 9px;
    color: #666;
}

/* Pot Area */
.cooking-pot-area {
    background: rgba(0, 0, 0, 0.4);
    border: 2px dashed rgba(212, 165, 116, 0.3);
    border-radius: 8px;
    padding: 10px;
    min-height: 60px;
}

.pot-empty {
    text-align: center;
    font-size: 11px;
    padding: 16px;
}

.pot-ingredient {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 4px 8px;
    background: rgba(212, 165, 116, 0.1);
    border-radius: 4px;
    margin-bottom: 4px;
}

.pot-ing-name {
    font-size: 11px;
    color: #ddd;
    flex: 1;
}

.pot-ing-weight {
    font-size: 10px;
    color: #a4caff;
}

.pot-remove-btn {
    background: none;
    border: none;
    color: #e74c3c;
    font-size: 14px;
    cursor: pointer;
    padding: 0 4px;
    line-height: 1;
}

.pot-remove-btn:hover { color: #ff6b6b; }

/* Experimental Badge */
.experimental-badge {
    display: inline-block;
    font-size: 9px;
    font-weight: 700;
    letter-spacing: 0.1em;
    padding: 3px 8px;
    border-radius: 3px;
    background: rgba(128, 128, 128, 0.3);
    border: 1px solid rgba(128, 128, 128, 0.5);
    color: inherit;
    margin-bottom: 8px;
}

.experimental-badge-small {
    font-size: 8px;
    font-weight: 700;
    padding: 1px 4px;
    border-radius: 2px;
    background: rgba(128, 128, 128, 0.3);
    color: #999;
    vertical-align: middle;
    margin-left: 4px;
}

/* Container Info */
.container-info {
    font-size: 10px;
    color: #3498db;
    margin-top: 2px;
}

/* ==================== Robot Paperdoll Layout ==================== */
.robot-paperdoll .paperdoll-col {
    gap: 6px;
}

.robot-paperdoll .paperdoll-slot::after {
    content: attr(title);
    position: absolute;
    bottom: -14px;
    left: 50%;
    transform: translateX(-50%);
    font-size: 8px;
    color: rgba(164, 202, 255, 0.5);
    white-space: nowrap;
    pointer-events: none;
}

/* ==================== Slot Dropdown ==================== */

.slot-dropdown {
    min-width: 180px;
    max-width: 240px;
    max-height: 320px;
    overflow-y: auto;
    padding: 4px 0;
    border-radius: 8px;
    border: 1px solid rgba(100, 160, 255, 0.3);
    background: rgba(10, 15, 30, 0.92);
    backdrop-filter: blur(12px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.6);
    animation: slotDropdownIn 0.15s ease-out;
}

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

.slot-dropdown-header {
    padding: 6px 12px;
    font-size: 11px;
    font-weight: 600;
    color: rgba(164, 202, 255, 0.7);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-bottom: 1px solid rgba(100, 160, 255, 0.15);
}

.slot-dropdown-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 12px;
    cursor: pointer;
    transition: background 0.12s;
    font-size: 12px;
    color: #c8d8f0;
}

.slot-dropdown-item:hover {
    background: rgba(100, 160, 255, 0.15);
}

.slot-dropdown-item.equipped {
    background: rgba(100, 160, 255, 0.08);
}

.slot-dropdown-item.unequip {
    color: rgba(255, 150, 100, 0.8);
}

.slot-dropdown-item.unequip:hover {
    background: rgba(255, 100, 50, 0.15);
}

.slot-dropdown-thumb {
    width: 28px;
    height: 28px;
    border-radius: 4px;
    object-fit: cover;
    flex-shrink: 0;
    border: 1px solid rgba(100, 160, 255, 0.2);
}

.slot-dropdown-icon {
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    font-size: 16px;
}

.slot-dropdown-name {
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.slot-dropdown-badge {
    font-size: 9px;
    padding: 2px 6px;
    border-radius: 4px;
    background: rgba(100, 160, 255, 0.2);
    color: rgba(164, 202, 255, 0.9);
    flex-shrink: 0;
}

.slot-dropdown-divider {
    height: 1px;
    margin: 4px 8px;
    background: rgba(100, 160, 255, 0.12);
}

.slot-dropdown-empty {
    padding: 8px 12px;
    font-size: 11px;
    color: rgba(164, 202, 255, 0.4);
    font-style: italic;
    text-align: center;
}

/* Rarity colors for dropdown items */
.slot-dropdown-item.rarity-uncommon { border-left: 2px solid #1EFF00; }
.slot-dropdown-item.rarity-rare { border-left: 2px solid #4ca7ff; }
.slot-dropdown-item.rarity-epic { border-left: 2px solid #A335EE; }
.slot-dropdown-item.rarity-legendary { border-left: 2px solid #FF8000; }
.slot-dropdown-item.rarity-common { border-left: 2px solid rgba(255,255,255,0.15); }

/* ============================================================
   Garden Editor Panel
   ============================================================ */

.garden-editor-panel {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 440px;
    max-width: 95vw;
    max-height: 90vh;
    overflow-y: auto;
    z-index: 10000;
    border-radius: 12px;
    border: 1px solid rgba(255,255,255,0.12);
    box-shadow: 0 8px 32px rgba(0,0,0,0.6);
}

.garden-editor-header {
    cursor: move;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 14px;
    border-bottom: 1px solid rgba(255,255,255,0.1);
}

.garden-editor-header .panel-title {
    font-size: 15px;
    font-weight: 600;
    color: #b5d4a0;
}

.garden-stats-bar {
    display: flex;
    gap: 16px;
    justify-content: center;
    padding: 8px 12px;
    border-bottom: 1px solid rgba(255,255,255,0.06);
    font-size: 12px;
    color: inherit;
}

.garden-stat strong {
    color: #ddd;
}

.garden-canvas-wrap {
    padding: 8px;
    display: flex;
    justify-content: center;
}

.garden-canvas {
    border-radius: 6px;
    cursor: crosshair;
    max-width: 100%;
    height: auto;
}

.garden-legend {
    display: flex;
    gap: 14px;
    justify-content: center;
    padding: 4px 12px 8px;
    font-size: 11px;
    color: #999;
}

.garden-legend-item {
    display: flex;
    align-items: center;
    gap: 4px;
}

.garden-dot {
    display: inline-block;
    width: 10px;
    height: 10px;
    border-radius: 50%;
}

.garden-batch-actions {
    display: flex;
    gap: 6px;
    padding: 8px 12px;
    border-top: 1px solid rgba(255,255,255,0.06);
    flex-wrap: wrap;
}

.garden-batch-actions .btn-action {
    flex: 1;
    min-width: 80px;
    padding: 6px 10px;
    font-size: 12px;
    border: 1px solid rgba(255,255,255,0.15);
    border-radius: 6px;
    background: rgba(255,255,255,0.06);
    color: #a4caff;
    cursor: pointer;
    transition: background 0.15s;
}

.garden-batch-actions .btn-action:hover {
    background: rgba(255,255,255,0.12);
    color: #fff;
}

.garden-btn-water-all:hover { border-color: #4488ff !important; }
.garden-btn-fertilize-all:hover { border-color: #44aa44 !important; }
.garden-btn-harvest-ready:hover { border-color: #FFD700 !important; }

.garden-detail-panel {
    padding: 10px 14px;
    border-top: 1px solid rgba(255,255,255,0.08);
}

.garden-detail-name {
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 6px;
}

.garden-detail-actions {
    display: flex;
    gap: 6px;
    margin-top: 8px;
    flex-wrap: wrap;
}

.garden-detail-actions .plant-action-btn {
    flex: 1;
    min-width: 60px;
}

.garden-remove-btn {
    background: rgba(139, 0, 0, 0.3) !important;
    border-color: rgba(139, 0, 0, 0.5) !important;
}

.garden-remove-btn:hover {
    background: rgba(180, 0, 0, 0.5) !important;
}

@media (max-width: 480px) {
    .garden-editor-panel {
        width: 100vw;
        max-width: 100vw;
        top: auto;
        bottom: 0;
        left: 0;
        transform: none;
        border-radius: 12px 12px 0 0;
        max-height: 80vh;
    }
    .garden-canvas-wrap {
        padding: 4px;
    }
}

/* ========== Grimoire Panel ========== */

.grimoire-content {
    overflow-y: auto;
    max-height: calc(80vh - 40px);
}

.grimoire-section {
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.grimoire-section-header {
    padding: 8px 14px;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: #a4caff;
    background: rgba(8, 8, 18, 0.9);
    position: sticky;
    top: 0;
    z-index: 2;
}

.grimoire-card-list {
    display: flex;
    flex-direction: column;
    gap: 1px;
}

.grimoire-card {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 14px;
    background: linear-gradient(90deg,
        color-mix(in srgb, var(--card-color, #888) 10%, #0a0a14),
        #0e0e1a);
    transition: background 0.15s;
}

.grimoire-card:hover {
    background: linear-gradient(90deg,
        color-mix(in srgb, var(--card-color, #888) 18%, #0a0a14),
        #0e0e1a);
}

.grimoire-card-icon {
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 6px;
    background: rgba(255, 255, 255, 0.05);
    flex-shrink: 0;
}

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

.grimoire-card-name {
    font-size: 13px;
    font-weight: 600;
    color: #ddd;
}

.grimoire-card-type {
    font-size: 10px;
    text-transform: uppercase;
    color: #777;
    letter-spacing: 0.5px;
}

.grimoire-card-stats {
    display: flex;
    gap: 8px;
    font-size: 11px;
    color: #999;
    margin-top: 2px;
    flex-wrap: wrap;
}

.grimoire-tag {
    background: rgba(255, 255, 255, 0.06);
    padding: 1px 6px;
    border-radius: 3px;
    font-size: 10px;
    color: #aaa;
}

.grimoire-key-badge {
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 4px;
    font-size: 12px;
    font-weight: 600;
    color: #bbb;
    background: rgba(255, 255, 255, 0.05);
    flex-shrink: 0;
}

/* Force Attunement */
.grimoire-force-list {
    display: flex;
    flex-direction: column;
    gap: 1px;
}

.grimoire-force-row {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 14px;
    cursor: pointer;
    background: rgba(0, 0, 0, 0.2);
    transition: background 0.15s, border-left 0.15s;
    border-left: 3px solid transparent;
}

.grimoire-force-row:hover {
    background: rgba(255, 255, 255, 0.05);
}

.grimoire-force-row.attuned {
    background: color-mix(in srgb, var(--force-color, #888) 12%, #0a0a14);
    border-left-color: var(--force-color, #888);
}

.grimoire-force-icon {
    width: 24px;
    text-align: center;
    flex-shrink: 0;
}

.grimoire-force-name {
    font-size: 13px;
    font-weight: 600;
    color: #ddd;
}

.grimoire-force-prefix {
    font-size: 11px;
    color: #777;
    font-style: italic;
}

.grimoire-attuned-badge {
    margin-left: auto;
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--force-color, #22c55e);
    opacity: 0;
    transition: opacity 0.15s;
}

.grimoire-force-row.attuned .grimoire-attuned-badge {
    opacity: 1;
}

/* Combo Grid */
.grimoire-combo-grid {
    width: 100%;
    border-collapse: collapse;
    font-size: 11px;
}

.grimoire-combo-grid th,
.grimoire-combo-grid td {
    padding: 6px 6px;
    text-align: center;
    border: 1px solid rgba(255, 255, 255, 0.06);
    white-space: nowrap;
}

.grimoire-combo-grid th {
    background: rgba(0, 0, 0, 0.3);
    font-weight: 600;
    color: #aaa;
    font-size: 10px;
}

.grimoire-combo-grid td:first-child {
    text-align: left;
    font-weight: 600;
    min-width: 80px;
}

.grimoire-combo-grid tr.attuned-row {
    background: rgba(255, 255, 255, 0.04);
}

.grimoire-combo-grid tr.attuned-row td {
    border-top: 1px solid rgba(164, 202, 255, 0.15);
    border-bottom: 1px solid rgba(164, 202, 255, 0.15);
}

.grimoire-combo-swatch {
    display: inline-block;
    width: 18px;
    height: 5px;
    border-radius: 2px;
    vertical-align: middle;
    margin-right: 3px;
}

/* Responsive */
@media (max-width: 768px) {
    .magic-panel {
        width: 100vw !important;
    }

    .grimoire-combo-grid {
        font-size: 9px;
    }

    .grimoire-combo-grid td,
    .grimoire-combo-grid th {
        padding: 4px 3px;
    }

    .grimoire-card-stats {
        font-size: 10px;
        gap: 4px;
    }
}

/* ============================================================
   Conjure Panel (wizard alchemy refocus)
   ============================================================ */
.conjure-panel .panel-content {
    display: flex;
    flex-direction: row;
    gap: 8px;
    padding: 8px;
    height: 100%;
    box-sizing: border-box;
    color: #e8e8e8;
}
.conjure-panel .conjure-recipes-list {
    flex: 0 0 45%;
    max-width: 260px;
    overflow-y: auto;
    padding-right: 6px;
    border-right: 1px solid rgba(255, 255, 255, 0.08);
}
.conjure-panel .conjure-recipe-detail {
    flex: 1 1 auto;
    overflow-y: auto;
    padding-left: 8px;
    min-width: 0;
}
.conjure-header {
    display: flex;
    justify-content: space-between;
    font-size: 11px;
    color: #bcd;
    padding: 4px 6px 8px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    margin-bottom: 6px;
}
.conjure-school-group {
    margin-bottom: 10px;
}
.conjure-school-header {
    font-size: 11px;
    color: #c7b8ff;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    padding: 4px 6px;
    border-bottom: 1px dashed rgba(199, 184, 255, 0.25);
    margin-bottom: 4px;
}
.conjure-recipe-row {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 5px 8px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 12px;
    transition: background 0.12s ease;
}
.conjure-recipe-row:hover {
    background: rgba(255, 255, 255, 0.06);
}
.conjure-recipe-row.selected {
    background: rgba(120, 160, 255, 0.18);
    outline: 1px solid rgba(120, 160, 255, 0.5);
}
.conjure-recipe-row.cannot-conjure {
    opacity: 0.45;
}
.conjure-recipe-row .conjure-recipe-icon {
    font-size: 14px;
    min-width: 18px;
    text-align: center;
}
.conjure-recipe-row .conjure-recipe-name {
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.conjure-recipe-row .conjure-recipe-mana {
    font-size: 10px;
    color: #6cf;
}
.conjure-detail-header {
    display: flex;
    align-items: center;
    gap: 10px;
    padding-bottom: 8px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    margin-bottom: 8px;
}
.conjure-detail-icon {
    font-size: 22px;
    min-width: 28px;
    text-align: center;
}
.conjure-detail-name {
    font-size: 14px;
    font-weight: 600;
}
.conjure-detail-school {
    font-size: 11px;
    color: #99a;
}
.conjure-detail-description {
    font-size: 11px;
    color: #bcd;
    margin-bottom: 10px;
    font-style: italic;
}
.conjure-detail-label {
    font-size: 11px;
    text-transform: uppercase;
    color: #9ab;
    margin-bottom: 4px;
}
.conjure-detail-inputs ul {
    list-style: none;
    padding: 0;
    margin: 0 0 10px 0;
}
.conjure-detail-inputs li {
    display: flex;
    justify-content: space-between;
    padding: 3px 4px;
    font-size: 12px;
    border-radius: 3px;
}
.conjure-detail-inputs li.input-missing {
    color: #f88;
}
.conjure-detail-inputs li.input-ok {
    color: #bea;
}
.conjure-detail-cost {
    font-size: 11px;
    color: #6cf;
    margin-bottom: 10px;
}
.conjure-btn {
    display: block;
    width: 100%;
    padding: 8px 12px;
    background: linear-gradient(180deg, #6b3ea5 0%, #4a2870 100%);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 4px;
    color: #fff;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.12s ease;
}
.conjure-btn:hover:not([disabled]) {
    background: linear-gradient(180deg, #7d4bb9 0%, #583080 100%);
}
.conjure-btn[disabled] {
    opacity: 0.4;
    cursor: not-allowed;
}
.conjure-status {
    margin-top: 6px;
    font-size: 11px;
    color: #bea;
    min-height: 14px;
}
.conjure-empty {
    padding: 12px;
    font-size: 12px;
    color: #889;
    font-style: italic;
    text-align: center;
}

/* ============================================
   Cave Name Display
   ============================================ */
#cave-name-display {
    display: block;
    padding: 6px 14px;
    border-radius: 8px;
    align-self: flex-start;
    max-width: fit-content;
    cursor: pointer;
    transition: all 0.2s ease;
    cursor: url('/3d/img/cursors/cursor-pointer.svg') 10 4, pointer;
}
#cave-name-display.hidden {
    display: none;
}
#cave-name-display .cave-name-text {
    color: #ffb86c;
    font-family: "Noto Sans", cursive;
    font-size: 14px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 200px;
}
#cave-name-display.cave-entering {
    animation: zoneFadeIn 0.4s ease-out;
}
@media (max-width: 600px) {
    #cave-name-display {
        padding: 4px 10px;
    }
    #cave-name-display .cave-name-text {
        font-size: 12px;
        max-width: 150px;
    }
}

/* ── Paperdoll Gages Tab ── */
.paperdoll-gages-content {
    width: 100%;
    padding: 15px;
    box-sizing: border-box;
}
.gage-card {
    background: rgba(255,255,255,0.04);
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: 6px;
    padding: 10px 12px;
    margin-bottom: 10px;
}
.gage-card:last-child {
    margin-bottom: 0;
}
.gage-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 6px;
}
.gage-card-name {
    font-size: 13px;
    font-weight: 600;
    color: #e0e0e0;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}
.gage-card-tier {
    font-size: 12px;
    font-weight: 500;
}
.gage-card-bar-track {
    width: 100%;
    height: 8px;
    background: rgba(255,255,255,0.08);
    border-radius: 4px;
    overflow: hidden;
    margin-bottom: 6px;
}
.gage-card-bar-fill {
    height: 100%;
    border-radius: 4px;
    transition: width 0.3s ease, background 0.3s ease;
}
.gage-card-details {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 11px;
}
.gage-card-value {
    color: #999;
}
.gage-card-effect {
    color: #ccc;
}
.gage-card-stat {
    font-size: 11px;
    color: #bbb;
    margin-top: 4px;
    padding-top: 4px;
    border-top: 1px solid rgba(255,255,255,0.06);
}
.gage-card-base {
    color: #666;
    margin-left: 4px;
}

/* Safety Net Overlay */
.safety-net-overlay {
    position: fixed;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1500;
    pointer-events: none;
    animation: safety-net-fadein 0.5s ease;
}
.safety-net-content {
    text-align: center;
    pointer-events: auto;
}
.safety-net-title {
    font-size: 28px;
    font-weight: 700;
    color: #fff;
    text-shadow: 0 2px 8px rgba(0,0,0,0.7);
    margin-bottom: 8px;
}
.safety-net-message {
    font-size: 15px;
    color: rgba(255,255,255,0.8);
    text-shadow: 0 1px 4px rgba(0,0,0,0.6);
    margin-bottom: 20px;
    line-height: 1.5;
}
.safety-net-fly-btn {
    padding: 12px 32px;
    font-size: 16px;
    font-weight: 600;
    color: #fff;
    background: rgba(46, 204, 113, 0.85);
    border: 2px solid rgba(46, 204, 113, 1);
    border-radius: 8px;
    cursor: pointer;
    transition: background 0.2s, transform 0.15s;
}
.safety-net-fly-btn:hover {
    background: rgba(46, 204, 113, 1);
    transform: scale(1.05);
}
@keyframes safety-net-fadein {
    from { opacity: 0; }
    to { opacity: 1; }
}