/* ===== PANELS ===== */
.panel {
    position: fixed;
    top: 20px;
    right: 78px;
    color: var(--text-main);
    background: var(--panel-bg);
    padding: 12px;
    border: 1px solid var(--accent-primary);
    backdrop-filter: blur(10px);
    width: 200px;
    max-height: calc(100vh - 40px);
    overflow-y: auto;
    transform-origin: right center;
    transform: scale(0.85);
    opacity: 0;
    pointer-events: none;
    transition: transform 0.25s ease, opacity 0.2s ease;
    box-shadow: var(--shadow-panel), var(--glow-soft);
}

.panel.open {
    transform: scale(1);
    opacity: 1;
    pointer-events: auto;
}

/* Scrollbar styling so long lists never overflow the panel box */
.panel::-webkit-scrollbar {
    width: 6px;
}

.panel::-webkit-scrollbar-track {
    background: transparent;
}

.panel::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.15);
    border-radius: 3px;
}

/* ===== PANEL ANCHORS (desktop) =====
   Each panel is fixed to the viewport near its own toggle button so
   its size/content can never push the sidebar buttons around.
   #panel-quest sits in #sidebar-top (near the top of the screen);
   #panel-inv and #panel-actions sit in #sidebar-bottom (anchored
   to the bottom of the screen, in button order: inv, actions). */
#panel-quest {
    border-right: 4px solid var(--accent-primary);
    top: 20px;
    bottom: auto;
}

#panel-inv {
    border-right: 4px solid var(--accent-secondary);
    top: auto;
    bottom: 234px;
}

#inv-anchor {
    position: relative;
}

/* ===== INVENTORY ITEMS ===== */
.item {
    font-size: 0.8em;
    margin: 5px 0;
    color: var(--accent-secondary);
    border-left: 2px solid var(--accent-secondary);
    padding-left: 5px;
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    transition: background 0.2s;
}

.item:hover {
    background: rgba(0, 242, 255, 0.1);
}

.item i,
.item svg {
    font-size: 1em;
    color: var(--accent-primary);
    flex-shrink: 0;
}

/* ===== ACTION BUTTONS (inside #panel-actions) =====
   Solid accent color on hover and when selected/active, instead of
   the translucent hover used for inventory items. */
#actions-list .item,
#actions-list .action-item,
#actions-list button {
    cursor: pointer;
    border-radius: 2px;
    transition: background 0.2s ease, color 0.2s ease;
}

#actions-list .item:hover,
#actions-list .action-item:hover,
#actions-list button:hover,
#actions-list .item.selected,
#actions-list .action-item.selected,
#actions-list .item.active,
#actions-list .action-item.active,
#actions-list button.selected,
#actions-list button.active {
    background: var(--accent-secondary);
    color: #000;
}

#actions-list .item:hover i,
#actions-list .item:hover svg,
#actions-list .item.selected i,
#actions-list .item.selected svg,
#actions-list .item.active i,
#actions-list .item.active svg {
    color: #000;
}

/* ===== QUEST LIST ===== */
.q-item {
    font-size: 0.8em;
    margin: 12px 0;
    border-bottom: 1px solid #111;
    padding-bottom: 5px;
    display: grid;
    grid-template-columns: auto 1fr;
    grid-template-rows: auto auto;
    gap: 4px 8px;
    align-items: start;
}

.q-item>i:first-child,
.q-item>svg:first-child {
    color: var(--text-main);
    font-size: 1.8em;
    grid-row: 1 / span 2;
    grid-column: 1;
    align-self: center;
}

.q-item>b {
    font-size: 1em;
    line-height: 1.2;
    grid-column: 2;
    grid-row: 1;
    margin: 0;
}

.q-item>small {
    font-size: 0.75em;
    opacity: 0.7;
    line-height: 1.3;
    grid-column: 2;
    grid-row: 2;
}

.q-done {
    color: var(--accent-success);
    text-decoration: line-through;
    opacity: 0.4;
}

.q-done>i:first-child,
.q-done>svg:first-child {
    color: var(--accent-success);
}

/* ===== LOADING SCREEN (moved from index.html) ===== */
#loading-screen {
    position: absolute;
    top: 0; left: 0;
    width: 100%; height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: #000;
    color: white;
    z-index: 1000;
    text-align: center;
}

.spinner {
    width: 50px;
    height: 50px;
    border: 5px solid #333;
    border-top: 5px solid var(--accent-secondary, #ffaa00);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-bottom: 20px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* ===== TYPEWRITER CURSOR ===== */
.typewriter-cursor::after {
    content: '█';
    animation: tw-blink 0.7s step-end infinite;
    opacity: 0.7;
    font-size: 0.75em;
    margin-left: 2px;
}

@keyframes tw-blink {
    0%, 100% { opacity: 0.7; }
    50% { opacity: 0; }
}

.typewriter-done::after {
    display: none;
}

.minimap-panel {
    position: absolute;
    top: 30px;
    left: 30px;
    width: 110px;
    height: 110px;
    background: rgba(11, 20, 26, 0.9);
    border: 2px solid var(--accent-primary);
    border-radius: 50%;
    overflow: hidden;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.6);
    z-index: 500;
}

.minimap-radar-line {
    position: absolute;
    width: 100%;
    height: 100%;
    top: 0;
    left: 0;
    background: conic-gradient(from 0deg, rgba(0, 168, 132, 0.15) 0deg, transparent 90deg);
    border-radius: 50%;
    transform-origin: center;
    animation: radar-sweep 2.5s linear infinite;
    pointer-events: none;
    z-index: 2;
}

@keyframes radar-sweep {
    to {
        transform: rotate(360deg);
    }
}

.minimap-grid-circle {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    border: 1px dashed rgba(0, 168, 132, 0.25);
    border-radius: 50%;
    pointer-events: none;
}

.minimap-blip {
    position: absolute;
    width: 6px;
    height: 6px;
    border-radius: 50%;
    pointer-events: none;
    z-index: 5;
}

.minimap-blip.player {
    background: var(--accent-success);
    width: 8px;
    height: 8px;
    margin-left: -4px;
    margin-top: -4px;
    z-index: 6;
    box-shadow: 0 0 6px var(--accent-success);
}

.minimap-blip.npc {
    background: var(--accent-secondary);
}

.minimap-blip.collectable {
    background: #ffdd00;
}

/* ===== FLOATING ACTION ICON (SVG support) ===== */
.floating-action-icon,
.action-floating-icon {
    position: absolute;
    pointer-events: none;
    z-index: 2000;
    color: var(--accent-secondary);
    filter: drop-shadow(0 0 8px var(--accent-secondary));
}