﻿/* =============================================================================
   FINAL WEEK BANNER
   ============================================================================= */

/* XP Tracker */
    );
    background-size: 200% 100%;
    animation: bannerShimmer 3s ease-in-out infinite;
    z-index: 10;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 12px 12px 0 0;
    box-shadow: 0 2px 10px rgba(196, 30, 58, 0.4);
    border-bottom: 1px solid rgba(255, 215, 0, 0.3);
}

.final-week-content {
    display: flex;
    align-items: center;
    gap: 8px;
    animation: bannerGlow 2s ease-in-out infinite;
}

.final-week-text {
    font-size: 0.85rem;
    font-weight: 900;
    letter-spacing: 3px;
    text-transform: uppercase;
    background: linear-gradient(90deg, #ffd700, #fff, #ffd700);
    background-size: 200% auto;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    animation: textShimmer 2s linear infinite;
    text-shadow: none;
}

.final-week-luck {
    font-size: 0.75rem;
    font-weight: 700;
    color: #fff;
    text-shadow: 0 0 10px rgba(255, 255, 255, 0.5);
    animation: luckPulse 1.5s ease-in-out infinite;
}

.final-week-divider {
    color: rgba(255, 215, 0, 0.6);
    font-weight: 300;
}

.final-week-star {
    color: #ffd700;
    font-size: 0.7rem;
    animation: starTwinkle 1s ease-in-out infinite;
    text-shadow: 0 0 8px #ffd700;
}

.final-week-star:last-child {
    animation-delay: 0.5s;
}

/* =============================================================================
   FINAL WEEK BANNER ANIMATIONS
   ============================================================================= */

@keyframes bannerShimmer {
    0%, 100% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
}

@keyframes textShimmer {
    0% { background-position: -200% center; }
    100% { background-position: 200% center; }
}

@keyframes bannerGlow {
    0%, 100% { filter: brightness(1); }
    50% { filter: brightness(1.1); }
}

@keyframes luckPulse {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.9; transform: scale(1.02); }
}

@keyframes starTwinkle {
    0%, 100% { opacity: 1; transform: scale(1) rotate(0deg); }
    50% { opacity: 0.6; transform: scale(0.8) rotate(180deg); }
}

/* =============================================
   RS3 NEWS & EVENTS CARD
   ============================================= */
#news-events-card {
    overflow: hidden;
}

#news-events-card .card-title {
    display: flex;
    align-items: center;
    gap: 10px;
}

#news-events-card .card-title {
    display: flex;
    align-items: center;
    gap: 10px;
}

#news-events-card .card-title svg {
    color: var(--accent);
}

#news-events-card .card-content {
    display: flex;
    flex-direction: column;
    flex: 1;
    min-height: 0;
    overflow: hidden;
}

/* =============================================================================
   NEWS VIEW ALL LINK
   ============================================================================= */

/* View All Link in Title */
.news-view-all {
    margin-left: auto;
    font-size: 0.65rem;
    color: var(--accent);
    text-decoration: none;
    font-weight: 600;
    transition: all 0.2s;
}

.news-view-all:hover {
    color: #ffb74d;
    text-decoration: underline;
}

/* =============================================================================
   NEWS GRID
   ============================================================================= */

/* News Grid */
.news-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    grid-template-rows: repeat(2, 1fr);
    gap: 12px;
    flex: 1;
    min-height: 220px;
    padding: 4px;
    align-items: center;
    justify-items: center;
}

.news-grid-loading {
    grid-column: 1 / -1;
    grid-row: 1 / -1;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #666;
    font-size: 0.85rem;
}

/* =============================================================================
   NEWS CARDS
   ============================================================================= */

/* Individual News Card */
.news-card {
    position: relative;
    border-radius: 10px;
    overflow: hidden;
    background: #1a1a1a;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    aspect-ratio: 16 / 10;
    width: 100%;
    height: 100%;
    max-width: 100%;
    max-height: 100%;
}

.news-card:hover {
    transform: scale(1.02);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.4);
    z-index: 1;
}

.news-card:hover .news-card-image {
    transform: scale(1.08);
}

.news-card-image {
    width: 100%;
    height: 100%;
    object-fit: contain;
    transition: transform 0.3s;
}

.news-card-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 30px 10px 8px;
    background: linear-gradient(to top, rgba(0,0,0,0.95) 0%, rgba(0,0,0,0.7) 60%, transparent 100%);
}

.news-card-category {
    display: inline-block;
    background: var(--accent);
    color: #000;
    font-size: 0.5rem;
    font-weight: 700;
    text-transform: uppercase;
    padding: 2px 5px;
    border-radius: 3px;
    margin-bottom: 4px;
}

.news-card-title {
    font-size: 0.7rem;
    font-weight: 600;
    color: #fff;
    line-height: 1.25;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.news-card-date {
    font-size: 0.55rem;
    color: rgba(255,255,255,0.5);
    margin-top: 3px;
}

.news-grid-error {
    grid-column: 1 / -1;
    grid-row: 1 / -1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: #888;
    font-size: 0.8rem;
}

.news-grid-error a {
    color: var(--accent);
    text-decoration: none;
}

.news-grid-error a:hover {
    text-decoration: underline;
}

/* Responsive: 1 column on very small cards */
@media (max-width: 400px) {
    .news-grid {
        grid-template-columns: 1fr;
    }
}

/* =============================================================================
   LEGACY EVENT STYLES
   ============================================================================= */

/* Legacy Santa card styles - keep for compatibility */
.event-ending-countdown {
    background: linear-gradient(90deg, #ffd700, #ff6b6b, #ffd700);
    background-size: 200% auto;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    animation: eventEndShimmer 2s linear infinite;
    font-weight: 700;
}

@keyframes eventEndShimmer {
    0% { background-position: -200% center; }
    100% { background-position: 200% center; }
}

/* =============================================================================
   CHASE ITEMS SECTION
   ============================================================================= */

.chase-items-section { width: 100%; margin-top: auto !important; border-top: 1px solid #333; padding-top: 8px; }
.chase-header { font-size: 0.7rem; color: #888; text-transform: uppercase; font-weight: 700; margin-bottom: 6px; text-align: center; letter-spacing: 1px; }
.chase-grid { display: flex; justify-content: center; flex-wrap: wrap; gap: 8px; }
.chase-item { width: 38px; height: 38px; background: rgba(255,255,255,0.05); border: 1px solid #333; border-radius: 8px; display: flex; align-items: center; justify-content: center; transition: 0.2s; position: relative; text-decoration: none; }
.chase-item:hover { background: rgba(255,255,255,0.1); border-color: var(--gold); transform: translateY(-3px); box-shadow: 0 5px 15px rgba(255,215,0,0.2); }
.chase-item img { max-width: 80%; max-height: 80%; object-fit: contain; filter: drop-shadow(0 2px 4px rgba(0,0,0,0.5)); }

img[src*="Araxxor"]:not(.pvm-boss-tile-img):not(.pvm-drop-img) { animation: poisonFloat 3s ease-in-out infinite!important; opacity: 1!important; }
@keyframes poisonFloat { 0%, 100% { transform: translateY(0); filter: drop-shadow(0 0 5px rgba(76,175,80,0.6)); } 50% { transform: translateY(-6px); filter: drop-shadow(0 0 25px #0f0) hue-rotate(20deg) brightness(1.2); } }

/* =============================================================================
   SUGGESTION INPUT CARD
   ============================================================================= */

.suggestion-input-card { background: var(--bg-card); border: 1px solid var(--border-color); border-radius: 12px; padding: 20px; margin: 10px auto 20px; max-width: 800px; width: 100%; }
.input-header { margin-bottom: 15px; border-bottom: 1px solid #222; padding-bottom: 10px; }
.input-header h3 { margin: 0; color: #fff; font-size: 1.2rem; }
.input-header .sub-text { font-size: 0.85rem; color: #888; }
.suggestion-textarea { width: 100%; background: rgba(0,0,0,0.3); border: 1px solid #333; color: #fff; border-radius: 12px; padding: 12px 16px; min-height: 80px; font-family: inherit; font-size: 0.95rem; margin-bottom: 10px; transition: 0.3s; resize: none; }
.suggestion-textarea:focus { border-color: var(--accent); background: rgba(0,0,0,0.5); outline: none; box-shadow: 0 0 0 3px rgba(255,152,0,0.1); }
.form-actions { display: flex; justify-content: flex-end; align-items: center; gap: 15px; }
.auth-warning { color: #ff6b6b; font-size: 0.85rem; font-weight: 600; }
.action-btn { background: var(--accent); color: #000; border: none; padding: 8px 20px; border-radius: 6px; font-weight: 700; cursor: pointer; transition: 0.2s; }
.action-btn:hover:not(:disabled) { background: #ffb74d; transform: translateY(-1px); }
.action-btn:disabled { opacity: 0.5; cursor: not-allowed; background: #555; color: #aaa; }

/* =============================================================================
   SUGGESTIONS FEED
   ============================================================================= */

.suggestions-feed { display: flex; flex-direction: column; gap: 12px; width: 100%; flex: 1; overflow-y: auto; padding: 12px 8px; scroll-behavior: auto; min-height: 0; overflow-anchor: auto; }
/* Force instant scroll when this class is added */
.scroll-instant, html.scroll-instant, body.scroll-instant, .suggestions-feed.scroll-instant, .chat-messages-v2.scroll-instant, #chat-messages.scroll-instant { scroll-behavior: auto !important; }
/* Prevent scroll anchoring interference - target direct children and nested elements specifically */
.suggestions-feed > .suggestion-card { overflow-anchor: none; }
.suggestions-feed > .suggestion-card:last-child { overflow-anchor: auto; }

/* =============================================================================
   SUGGESTION CARDS
   ============================================================================= */

.suggestion-card { background: var(--bg-card); border: 1px solid var(--border-color); border-radius: 12px; padding: 20px; animation: fadeInUp 0.4s ease-out; }

/* Prevent animations during navigation (but allow interaction) */
body.navigating-to-post .suggestion-card { animation: none; }
.card-header { display: flex; align-items: center; gap: 12px; margin-bottom: 15px; }
.avatar-main { width: 45px; height: 45px; border-radius: 50%; border: 2px solid var(--border-color); background: #000; object-fit: cover; }
.avatar-preview-img { width: 60px; height: 60px; border-radius: 50%; background: #000; object-fit: cover; }
.header-info { display: flex; flex-direction: column; }
.user-name-large { font-weight: 700; color: #fff; font-size: 1rem; }
.time-stamp { font-size: 0.75rem; color: #666; }
.card-body { color: #ddd; line-height: 1.5; margin-bottom: 15px; font-size: 0.95rem; white-space: pre-wrap; }
.card-actions { border-top: 1px solid #222; padding-top: 10px; margin-bottom: 15px; }
.text-btn { background: none; border: none; color: #888; font-weight: 600; cursor: pointer; display: flex; align-items: center; gap: 6px; font-size: 0.85rem; padding: 5px 10px; border-radius: 4px; transition: 0.2s; }
.text-btn:hover { background: rgba(255,255,255,0.05); color: var(--accent); }
.replies-container { margin-left: 20px; padding-left: 15px; border-left: 2px solid #222; display: flex; flex-direction: column; gap: 12px; overflow: visible; }

/* =============================================================================
   COLLAPSIBLE REPLIES SYSTEM
   ============================================================================= */

/* Collapsible Replies System */
.replies-section { margin-top: 10px; }
.replies-toggle { display: flex; align-items: center; gap: 8px; background: rgba(255,255,255,0.03); border: 1px solid rgba(255,255,255,0.08); border-radius: 6px; padding: 8px 12px; color: #aaa; font-size: 0.8rem; cursor: pointer; transition: all 0.2s; width: 100%; text-align: left; }
.replies-toggle:hover { background: rgba(255,255,255,0.06); color: #fff; border-color: rgba(255,255,255,0.15); }
.replies-toggle svg { flex-shrink: 0; transition: transform 0.2s; }
.replies-toggle .reply-preview { color: #666; font-size: 0.75rem; margin-left: auto; max-width: 50%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.replies-content { margin-top: 8px; margin-left: 10px; padding-left: 12px; border-left: 2px solid rgba(255,152,0,0.2); }
.replies-collapsed .replies-content { display: none; }

/* =============================================================================
   REPLY ITEMS
   ============================================================================= */

.reply-item { display: flex; gap: 10px; background: #111; padding: 10px; border-radius: 8px; border: 1px solid #222; }
.avatar-small { width: 32px; height: 32px; min-width: 32px; max-width: 32px; min-height: 32px; max-height: 32px; flex-shrink: 0; border-radius: 50%; background: #000; object-fit: cover; }
.reply-content { flex: 1; }
.reply-meta { display: flex; justify-content: space-between; margin-bottom: 4px; font-size: 0.8rem; }
.user-name { font-weight: 700; color: var(--blue); }
.reply-text { color: #ccc; font-size: 0.9rem; line-height: 1.4; }
.reply-input-box { margin-top: 15px; display: flex; gap: 10px; animation: fadeInUp 0.2s; }
.reply-input-box input { flex: 1; background: #111; border: 1px solid #333; padding: 8px 12px; border-radius: 6px; color: #fff; outline: none; }
.reply-input-box input:focus { border-color: var(--accent); }
.reply-input-box button { background: var(--blue); color: #000; border: none; padding: 0 15px; border-radius: 6px; font-weight: 700; cursor: pointer; }
.reply-input-box button:hover { background: #81d4fa; }

/* =============================================================================
   RESPONSIVE - TABLET (max-width: 1024px)
   ============================================================================= */

@media (max-width: 1024px) {
    html, body { height: auto; overflow-y: auto; }
    body { display: block; }
    body.community-page { height: auto; overflow: auto; }
    header { position: sticky; top: 0; padding: 10px 15px; gap: 10px; flex-wrap: wrap; }
    .header-left { flex: 1 1 auto; min-width: 0; justify-content: flex-start; order: 1; gap: 10px; }
    .brand-wrapper { flex-shrink: 1; min-width: 0; }
    .scrolling-title { font-size: 0.9rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
    .header-nav { order: 2; flex-shrink: 0; }
    .header-right { flex: 0 1 auto; min-width: 0; justify-content: flex-end; padding: 0; gap: 10px; order: 3; flex-wrap: nowrap; }
    .wiki-search-container { max-width: 160px; }
    .header-clock-group { flex-direction: row; gap: 10px; align-items: center; width: auto; justify-content: center; }
    .header-time-val { font-size: 1rem; text-align: left; width: auto; }
    .dashboard { display: flex; flex-direction: column; height: auto; padding: 10px; flex: initial; }
    .card { min-height: auto; margin-bottom: 15px; }
    .tasks-container { height: auto; overflow: visible; padding: 10px; margin-bottom: 40px; flex: initial; }
    .task-card { height: 600px; }
    .tracker-container { height: auto; overflow: visible; display: block; padding: 10px; }
    .tracker-controls { flex-direction: column; align-items: stretch; }
    .tracker-controls.dual-search { padding: 15px; gap: 15px; }
    .search-section { max-width: none; }
    .search-divider { display: none; }
    .mode-toggle { justify-content: center; width: 100%; }
    .search-box-large { width: 100%; max-width: none; }
    .tracker-split-layout:not([style*="display: none"]) { display: flex; flex-direction: column; gap: 20px; }
    /* Reorder on mobile: Skills Grid → Tracked Goals → Adventure Log */
    #player-results { order: 1; border: 1px solid var(--accent); }
    .right-sidebar { order: 2; }
    .sidebar-panel:not(.right-sidebar) { order: 3; }
    .sidebar-panel, .results-section { height: auto; max-height: 500px; overflow-y: auto; }
    .results-section { max-height: none; }
    .profile-header { padding: 15px; }
    #p-name { font-size: 1.4rem; word-break: break-all; }
    .stats-row { justify-content: flex-start; }
    .sidebar-tab-btn { padding: 12px; font-size: 0.9rem; }
    .skills-grid { gap: 8px; padding: 12px; }
    .skill-card-detailed { min-height: 85px; padding: 10px; }
    .skill-card-top { margin-bottom: 2px; }
    .skill-progress-track { height: 4px; margin-bottom: 3px; }
    .skill-lvl { font-size: 1.1rem; }
    .skill-icon-lg { width: 22px; height: 22px; }
    .clan-name-title { font-size: 2rem; letter-spacing: 2px; }
    .clan-stats-pills { gap: 10px; }
    .stat-pill-box { padding: 8px 16px; flex: 1 1 40%; justify-content: center; }
    .clan-table-wrapper { margin-top: 10px; }
    .flash-header-bar { display: none; }
    .modal-content { width: 90%; margin: 20px; }
}

/* =============================================================================
   RESPONSIVE - MEDIUM SCREENS (max-width: 768px)
   ============================================================================= */

/* Medium screens - stack header vertically */
@media (max-width: 768px) {
    header { flex-direction: column; align-items: stretch; padding: 10px; gap: 8px; }
    .header-left { width: 100%; justify-content: center; order: 1; }
    .header-nav { width: 100%; order: 2; justify-content: center; }
    .header-right { width: 100%; justify-content: center; order: 3; flex-wrap: wrap; }
    .wiki-search-container { max-width: 200px; }
    .header-clock-group { display: none; }
    .header-divider { display: none; }
}

/* =============================================================================
   RESPONSIVE - SMALL SCREENS (max-width: 580px)
   ============================================================================= */

/* Small screens - compact everything */
@media (max-width: 580px) {
    header { padding: 8px; gap: 6px; }
    .header-left { gap: 8px; }
    .brand-wrapper { gap: 6px; }
    .header-logo { height: 28px; }
    .scrolling-title { font-size: 0.8rem; }
    .nav-item { padding: 5px 10px; font-size: 0.75rem; }
    .wiki-search-container { max-width: 150px; padding: 2px 8px; }
    #wiki-search-input { font-size: 0.8rem; padding: 4px; }
    .menu-btn svg { width: 20px; height: 20px; }
    .notification-btn svg { width: 18px; height: 18px; }
    .user-count-badge { font-size: 0.7rem; padding: 3px 8px; }
    .login-btn { padding: 5px 10px; font-size: 0.75rem; }
}

/* =============================================================================
   XP PAGE BODY LAYOUT
   ============================================================================= */

/* XP PAGE: Disable page scrolling, use container scrolling instead */
body.xp-page { 
    height: 100vh; 
    overflow: hidden;
}
body.xp-page .tracker-container { 
    flex: 1; 
    display: flex; 
    flex-direction: column; 
    min-height: 0;
    overflow: hidden;
}
body.xp-page .tracker-controls { flex-shrink: 0; }
body.xp-page #tracker-split-layout { flex: 1; min-height: 0; overflow: hidden; }

/* =============================================================================
   CLAN PAGE LAYOUT
   ============================================================================= */

/* CLAN PAGE: Lock containers to viewport height, no page scrolling */
body.xp-page #clan-results[style*="display: block"],
body.xp-page #clan-results[style*="display:block"] { 
    height: calc(100vh - 60px) !important;
    max-height: calc(100vh - 60px) !important;
    overflow: hidden !important;
    display: flex !important;
    flex-direction: column !important;
}
body.xp-page #clan-results[style*="display: block"] .clan-header-banner-wrap,
body.xp-page #clan-results[style*="display:block"] .clan-header-banner-wrap {
    width: 100%;
    box-sizing: border-box;
    flex-shrink: 0;
}
body.xp-page #clan-results[style*="display: block"] .clan-compact-header,
body.xp-page #clan-results[style*="display:block"] .clan-compact-header {
    flex-shrink: 0;
}
body.xp-page #clan-results[style*="display: block"] .clan-ticker-slim,
body.xp-page #clan-results[style*="display:block"] .clan-ticker-slim {
    flex-shrink: 0;
}
body.xp-page #clan-results[style*="display: block"] .clan-main-grid,
body.xp-page #clan-results[style*="display:block"] .clan-main-grid {
    width: 100%;
    box-sizing: border-box;
    flex: 1 !important;
    min-height: 0 !important;
    overflow: hidden !important;
    display: grid;
    grid-template-columns: 300px 1fr;
}
body.xp-page #clan-results[style*="display: block"] .clan-left-col,
body.xp-page #clan-results[style*="display:block"] .clan-left-col {
    overflow-y: auto;
    min-height: 0;
}
body.xp-page #clan-results[style*="display: block"] .clan-right-col,
body.xp-page #clan-results[style*="display:block"] .clan-right-col {
    display: flex !important;
    flex-direction: column !important;
    min-height: 0 !important;
    overflow: hidden !important;
}
body.xp-page #clan-results[style*="display: block"] .table-panel,
body.xp-page #clan-results[style*="display:block"] .table-panel {
    flex: 1 !important;
    min-height: 0 !important;
    overflow: hidden !important;
    display: flex !important;
    flex-direction: column !important;
}
body.xp-page #clan-results[style*="display: block"] .table-panel .panel-head,
body.xp-page #clan-results[style*="display:block"] .table-panel .panel-head {
    flex-shrink: 0;
}
body.xp-page #clan-results[style*="display: block"] .activity-legend,
body.xp-page #clan-results[style*="display:block"] .activity-legend {
    flex-shrink: 0;
}
body.xp-page #clan-results[style*="display: block"] .table-config-bar,
body.xp-page #clan-results[style*="display:block"] .table-config-bar {
    flex-shrink: 0;
}
body.xp-page #clan-results[style*="display: block"] .clan-table-wrap,
body.xp-page #clan-results[style*="display:block"] .clan-table-wrap {
    flex: 1 !important;
    min-height: 0 !important;
    overflow-y: auto !important;
    overflow-x: auto !important;
}

/* =============================================================================
   PLAYER PROFILE PANEL LAYOUT
   ============================================================================= */

/* PLAYER PROFILE: Make each panel scrollable within fixed height containers */
body.xp-page #tracker-split-layout {
    flex: 1;
    min-height: 0;
    overflow: hidden;
    display: grid;
}
body.xp-page .results-section,
body.xp-page .sidebar-panel { 
    height: 100%; 
    min-height: 0;
    max-height: 100%;
    overflow: hidden; 
    display: flex; 
    flex-direction: column; 
}

/* =============================================================================
   XP PAGE SKILLS GRID
   ============================================================================= */

body.xp-page .skills-grid { 
    flex: 1; 
    overflow-y: auto;
    min-height: 0;
    display: flex !important;
    flex-wrap: wrap !important;
    gap: 10px;
    padding: 12px;
    justify-content: center;
    align-content: flex-start;
}
body.xp-page .skills-grid .skill-card-detailed {
    width: 110px;
    min-width: 110px;
    max-width: 110px;
    flex: 0 0 110px;
}

/* =============================================================================
   XP PAGE SKILLS GRID - RESPONSIVE
   ============================================================================= */

/* Responsive skill card sizing for XP page */
@media (max-width: 1100px) {
    body.xp-page .skills-grid .skill-card-detailed {
        width: 100px;
        min-width: 100px;
        max-width: 100px;
        flex: 0 0 100px;
    }
}
@media (max-width: 800px) {
    body.xp-page .skills-grid .skill-card-detailed {
        width: 90px;
        min-width: 90px;
        max-width: 90px;
        flex: 0 0 90px;
    }
    body.xp-page .skills-grid {
        gap: 8px;
        padding: 8px;
    }
}
@media (max-width: 500px) {
    body.xp-page .skills-grid .skill-card-detailed {
        width: 80px;
        min-width: 80px;
        max-width: 80px;
        flex: 0 0 80px;
    }
    body.xp-page .skills-grid {
        gap: 6px;
        padding: 6px;
    }
}

/* =============================================================================
   XP PAGE SIDEBAR CONTENT
   ============================================================================= */

body.xp-page .sidebar-content { 
    overflow-y: auto; 
    flex: 1;
    min-height: 0;
    padding: 15px 0 15px 15px; /* No padding on right for scrollbar */
}
body.xp-page .log-list {
    overflow-y: auto;
    flex: 1;
    min-height: 0;
    padding-right: 10px; /* Padding inside the list content */
    margin-right: 5px; /* Small gap for scrollbar track */
}

/* =============================================================================
   XP PAGE CUSTOM SCROLLBAR
   ============================================================================= */

/* Custom scrollbar for adventure log - flush against edge */
body.xp-page .sidebar-panel:not(.right-sidebar) .sidebar-content::-webkit-scrollbar {
    width: 8px;
}
body.xp-page .sidebar-panel:not(.right-sidebar) .sidebar-content::-webkit-scrollbar-track {
    background: rgba(0,0,0,0.2);
    border-radius: 0;
}
body.xp-page .sidebar-panel:not(.right-sidebar) .sidebar-content::-webkit-scrollbar-thumb {
    background: rgba(255,255,255,0.15);
    border-radius: 4px;
}
body.xp-page .sidebar-panel:not(.right-sidebar) .sidebar-content::-webkit-scrollbar-thumb:hover {
    background: rgba(255,255,255,0.25);
}

/* =============================================================================
   XP PAGE RIGHT SIDEBAR
   ============================================================================= */

body.xp-page .right-sidebar {
    height: 100%;
    max-height: 100%;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    min-height: 0;
}
body.xp-page .right-sidebar .panel-header {
    flex-shrink: 0;
}
body.xp-page .right-sidebar .sidebar-tabs {
    flex-shrink: 0;
}
body.xp-page .right-sidebar .sidebar-content {
    flex: 1;
    overflow-y: auto;
    min-height: 0;
}

/* ============================================
   COMMUNITY HUB - COMPLETE OVERHAUL
   ============================================ */

/* =============================================================================
   COMMUNITY HUB - MAIN LAYOUT
   ============================================================================= */

/* Main Layout - 3 Column */
.community-hub {
    display: flex;
    flex: 1;
    width: 100%;
    max-width: 1800px;
    margin: 0 auto;
    gap: 20px;
    padding: 20px;
    min-height: 0;
    min-width: 320px;
    overflow: hidden;
    justify-content: center;
}

/* =============================================================================
   COMMUNITY HUB - LEFT SIDEBAR
   ============================================================================= */

/* Left Sidebar - Online Users & Stats */
.community-sidebar-left {
    width: 280px;
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    gap: 16px;
    overflow-y: auto;
    height: 100%;
}

/* =============================================================================
   COMMUNITY HUB - RIGHT SIDEBAR
   ============================================================================= */

/* Right Sidebar - Categories & Activity */
.community-sidebar-right {
    width: 280px;
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    gap: 16px;
    overflow-y: auto;
    height: 100%;
}

/* Hide categories section when on chat tab */
.community-sidebar-right .categories-section.hidden {
    display: none;
}

/* =============================================================================
   COMMUNITY HUB - SHARED SIDEBAR STYLES
   ============================================================================= */

/* Sidebar (shared styles) */
.community-sidebar {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.sidebar-section {
    background: linear-gradient(145deg, rgba(30,30,30,0.95), rgba(18,18,18,0.98));
    border: 1px solid rgba(255,255,255,0.06);
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 8px 32px rgba(0,0,0,0.4);
}

.community-sidebar-left .sidebar-section:first-child {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-height: 0;
}

.sidebar-header {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 16px 18px;
    background: rgba(0,0,0,0.3);
    border-bottom: 1px solid rgba(255,255,255,0.05);
    font-size: 0.8rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: #888;
}

.sidebar-header svg {
    color: var(--accent);
}

/* =============================================================================
   COMMUNITY HUB - ONLINE COUNT
   ============================================================================= */

.online-count {
    margin-left: auto;
    background: rgba(76,175,80,0.15);
    color: #4caf50;
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 0.7rem;
    font-weight: 800;
    display: flex;
    align-items: center;
    gap: 2px;
}

.online-count .count-active {
    color: #4caf50;
}

.online-count .count-separator {
    color: #666;
    margin: 0 1px;
}

.online-count .count-idle {
    color: #ff9800;
}

/* =============================================================================
   COMMUNITY HUB - ONLINE USERS LIST
   ============================================================================= */

.online-users-list {
    padding: 12px;
    flex: 1;
    overflow-y: auto;
    min-height: 0;
}

/* Online users category headers for sidebar */
.online-users-list .online-list-category-header {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 10px;
    font-size: 0.7rem;
    font-weight: 700;
    color: #888;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-top: 8px;
}

.online-users-list .online-list-category-header:first-child {
    margin-top: 0;
}

.online-users-list .online-list-category-header .category-icon {
    font-size: 0.85rem;
}

.online-users-list .online-list-category-header .category-count {
    margin-left: auto;
    background: rgba(255, 255, 255, 0.1);
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 0.65rem;
}

/* =============================================================================
   COMMUNITY HUB - ONLINE USER ITEMS
   ============================================================================= */

.online-user-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 6px 10px;
    border-radius: 8px;
    transition: background 0.15s ease;
    cursor: pointer;
}

.online-user-item:hover {
    background: rgba(255,255,255,0.04);
}

/* Avatar wrapper — holds avatar + status dot overlay */
.online-user-item > .profile-link-btn:first-child {
    position: relative;
    flex-shrink: 0;
    width: 36px;
    height: 36px;
    padding: 0;
    margin: 0;
    line-height: 0;
    overflow: visible !important; /* allow party hat + status dot */
}

/* Phat wrapper inside sidebar — match avatar sizing */
.online-user-item .avatar-phat-wrap {
    width: 36px;
    height: 36px;
}

.online-user-avatar {
    width: 36px;
    height: 36px;
    min-width: 36px;
    min-height: 36px;
    border-radius: 50%;
    background: #111;
    border: 2px solid #333;
    object-fit: cover;
}

/* Name button — truncates long names so layout stays clean */
.online-user-item > .profile-link-btn.online-user-name {
    overflow: hidden !important;
}

.online-user-name {
    font-size: 0.82rem;
    font-weight: 600;
    color: #ddd;
    flex: 1;
    min-width: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Hide the supporter badge text in the sidebar — the party hat + card border
   already communicate the tier. Keeps the name row compact. */
.online-user-item .supporter-badge {
    display: none;
}

/* =============================================================================
   COMMUNITY HUB - USER STATUS INDICATORS (on-avatar dot, Discord-style)
   ============================================================================= */

.online-user-status {
    /* Position on the avatar: bottom-right corner */
    position: absolute;
    bottom: -1px;
    right: -1px;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    border: 2.5px solid #1a1a1a; /* matches sidebar background */
    flex-shrink: 0;
    transition: all 0.3s ease;
    z-index: 3;
    pointer-events: none;
}

.online-user-status.active {
    background: #43b581 !important;
    box-shadow: none !important;
}

.online-user-status.currently-active {
    background: #43b581 !important;
    box-shadow: 0 0 6px rgba(67,181,129,0.5) !important;
    animation: none;
}

.online-user-status.away {
    background: #faa61a !important;
    box-shadow: none !important;
}

.online-user-status.idle {
    background: #f44336 !important;
    box-shadow: 0 0 4px rgba(244, 67, 54, 0.4) !important;
}

.online-user-item.is-currently-active .online-user-name {
    color: #eee;
}

.online-user-item.is-away {
    opacity: 0.85;
}

.online-user-item.is-away .online-user-name {
    color: #bbb;
}

.online-user-item.is-idle {
    opacity: 0.65;
}

.online-user-item.is-idle .online-user-name {
    color: #888;
}

/* =============================================================================
   COMMUNITY HUB - SIDEBAR PLACEHOLDER & STATS
   ============================================================================= */

.sidebar-placeholder {
    color: #555;
    font-size: 0.85rem;
    text-align: center;
    padding: 20px;
}

.quick-stats {
    padding: 12px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.stat-item {
    display: flex;
    flex-direction: column;
    gap: 2px;
    padding: 8px 10px;
    background: rgba(0,0,0,0.3);
    border-radius: 8px;
    border: 1px solid rgba(255,255,255,0.03);
    position: relative;
}

.stat-item .stat-icon {
    position: absolute;
    top: 8px;
    right: 10px;
    opacity: 0.4;
    stroke: var(--accent);
}

.stat-item:hover .stat-icon {
    opacity: 0.7;
}

.stat-item .stat-value {
    font-size: 1rem;
    font-weight: 800;
    color: var(--accent);
}

.stat-item .stat-label {
    font-size: 0.65rem;
    color: #666;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

/* =============================================================================
   COMMUNITY HUB - MAIN CONTENT AREA
   ============================================================================= */

/* Main Content Area */
.community-main {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-width: 280px;
    min-height: 200px;
    background: linear-gradient(145deg, rgba(22,22,22,0.98), rgba(12,12,12,0.99));
    border: 1px solid rgba(255,255,255,0.06);
    border-radius: 20px;
    overflow: hidden;
    box-shadow: 0 12px 48px rgba(0,0,0,0.5);
}

/* =============================================================================
   COMMUNITY HUB - TAB NAVIGATION
   ============================================================================= */

/* Tab Navigation */
.community-tabs {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 16px 24px;
    background: rgba(0,0,0,0.4);
    border-bottom: 1px solid rgba(255,255,255,0.05);
}

.community-tab {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 20px;
    background: transparent;
    border: 1px solid transparent;
    border-radius: 12px;
    color: #888;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
}

.community-tab svg {
    transition: 0.2s;
}

.community-tab:hover {
    background: rgba(255,255,255,0.03);
    color: #bbb;
}

.community-tab.active {
    background: linear-gradient(135deg, rgba(255,152,0,0.12), rgba(255,152,0,0.06));
    border-color: rgba(255,152,0,0.25);
    color: var(--accent);
    box-shadow: 0 4px 20px rgba(255,152,0,0.1);
}

.community-tab.active svg {
    color: var(--accent);
}

.tab-badge {
    background: var(--urgent-red);
    color: #fff;
    font-size: 0.65rem;
    font-weight: 800;
    padding: 2px 6px;
    border-radius: 10px;
    min-width: 18px;
    text-align: center;
}

.tab-actions {
    margin-left: auto;
    display: flex;
    align-items: center;
    gap: 12px;
}

/* =============================================================================
   COMMUNITY HUB - SEARCH BOX
   ============================================================================= */

.search-box {
    display: flex;
    align-items: center;
    gap: 8px;
    background: rgba(0,0,0,0.4);
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: 10px;
    padding: 8px 14px;
    transition: 0.2s;
}

.search-box:focus-within {
    border-color: var(--accent);
    background: rgba(0,0,0,0.6);
}

.search-box svg {
    color: #555;
    flex-shrink: 0;
}

.search-box input {
    background: transparent;
    border: none;
    color: #fff;
    font-size: 0.85rem;
    outline: none;
    width: 150px;
}

.search-box input::placeholder {
    color: #555;
}

/* =============================================================================
   COMMUNITY HUB - PANELS
   ============================================================================= */

/* Panels */
.community-panel {
    display: none;
    flex: 1;
    flex-direction: column;
    min-height: 0;
    overflow: hidden;
    contain: layout style;
}

.community-panel.active {
    display: flex;
}

/* =============================================================================
   CHAT CONTAINER
   ============================================================================= */

/* Chat Container */
.chat-container {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-height: 0;
    contain: layout style;
}

.chat-messages-container {
    flex: 1;
    overflow-y: auto;
    padding: 24px;
    display: flex;
    flex-direction: column;
    gap: 16px;
    scroll-behavior: smooth;
    background: radial-gradient(ellipse at 30% 0%, rgba(40,40,40,0.4) 0%, transparent 70%),
                radial-gradient(ellipse at 70% 100%, rgba(255,152,0,0.03) 0%, transparent 50%),
                linear-gradient(180deg, #0f0f0f, #0a0a0a);
    contain: layout style;
    will-change: scroll-position;
}

/* =============================================================================
   CHAT WELCOME
   ============================================================================= */

.chat-welcome {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 60px 20px;
    text-align: center;
    color: #444;
}

.chat-welcome .welcome-icon {
    margin-bottom: 20px;
    opacity: 0.3;
}

.chat-welcome h3 {
    font-size: 1.2rem;
    font-weight: 700;
    color: #555;
    margin-bottom: 8px;
}

.chat-welcome p {
    font-size: 0.9rem;
    color: #444;
}

/* =============================================================================
   CHAT MESSAGES
   ============================================================================= */

/* Chat Messages */
.chat-msg {
    display: flex;
    gap: 12px;
    max-width: 80%;
    animation: messageSlideIn 0.3s ease;
}

@keyframes messageSlideIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

.chat-msg-me {
    align-self: flex-end;
    flex-direction: row-reverse;
}

.chat-avatar {
    flex-shrink: 0;
}

/* =============================================================================
   CHAT BUBBLE
   ============================================================================= */

.chat-bubble {
    background: linear-gradient(145deg, rgba(40,40,40,0.9), rgba(25,25,25,0.95));
    border: 1px solid rgba(255,255,255,0.06);
    padding: 14px 18px;
    border-radius: 18px;
    border-top-left-radius: 4px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.3);
    position: relative;
    transition: transform 0.2s, box-shadow 0.2s;
    min-width: 180px;
}

.chat-bubble:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 25px rgba(0,0,0,0.4);
}

.chat-msg-me .chat-bubble {
    background: linear-gradient(145deg, rgba(42,74,106,0.9), rgba(30,55,80,0.95));
    border-color: rgba(79,195,247,0.15);
    border-top-left-radius: 18px;
    border-top-right-radius: 4px;
}

.clickable-quote {
    cursor: pointer;
}

.clickable-quote:hover {
    background: linear-gradient(145deg, rgba(50,50,50,0.9), rgba(35,35,35,0.95));
}

/* =============================================================================
   CHAT META & TEXT
   ============================================================================= */

.chat-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
    gap: 12px;
}

.chat-user {
    font-weight: 800;
    font-size: 0.8rem;
    letter-spacing: 0.5px;
    text-transform: uppercase;
}

.chat-timestamp {
    font-size: 0.65rem;
    color: rgba(255,255,255,0.35);
    font-weight: 600;
}

.chat-text {
    font-size: 0.95rem;
    line-height: 1.5;
    color: #eee;
    word-wrap: break-word;
}

/* =============================================================================
   CHAT QUOTE & REPLY
   ============================================================================= */

.chat-quote-container {
    margin: 8px 0;
}

.chat-quote {
    background: rgba(0,0,0,0.4);
    border-left: 3px solid var(--accent);
    padding: 10px 14px;
    font-size: 0.85rem;
    color: #999;
    font-style: italic;
    border-radius: 0 8px 8px 0;
    margin-bottom: 8px;
}

.chat-reply-text {
    font-size: 0.95rem;
    color: #eee;
}

.chat-mention {
    color: var(--accent);
    font-weight: 700;
    background: rgba(255,152,0,0.1);
    padding: 1px 4px;
    border-radius: 4px;
}

/* =============================================================================
   CHAT REPLY PREVIEW BAR
   ============================================================================= */

/* Chat Reply Preview Bar */
.chat-reply-preview {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 20px;
    background: linear-gradient(135deg, rgba(245,194,17,0.1), rgba(255,152,0,0.08));
    border-left: 3px solid var(--accent);
    border-bottom: 1px solid rgba(255,255,255,0.05);
    animation: slideDown 0.2s ease;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.reply-preview-content {
    display: flex;
    align-items: center;
    gap: 8px;
    flex: 1;
    min-width: 0;
    overflow: hidden;
}

.reply-preview-content svg {
    color: var(--accent);
    flex-shrink: 0;
}

.reply-to-label {
    color: #888;
    font-size: 0.75rem;
    flex-shrink: 0;
}

.reply-to-username {
    color: var(--accent);
    font-size: 0.8rem;
    font-weight: 600;
    flex-shrink: 0;
}

.reply-to-text {
    color: #aaa;
    font-size: 0.75rem;
    font-style: italic;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    flex: 1;
    min-width: 0;
}

.reply-cancel-btn {
    background: transparent;
    border: none;
    color: #666;
    cursor: pointer;
    padding: 4px;
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.15s ease;
    flex-shrink: 0;
}

.reply-cancel-btn:hover {
    background: rgba(255,255,255,0.1);
    color: #f44336;
}

/* =============================================================================
   CHAT INPUT AREA
   ============================================================================= */

/* Chat Input Area */
.chat-input-area {
    padding: 20px 24px;
    border-top: 1px solid rgba(255,255,255,0.05);
    background: linear-gradient(180deg, rgba(18,18,18,0.98), rgba(10,10,10,0.99));
    display: flex;
    gap: 12px;
    align-items: center;
    position: relative;
}

.chat-overlay {
    position: absolute;
    inset: 0;
    background: rgba(10,10,10,0.85);
    backdrop-filter: blur(8px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 5;
}

.chat-overlay span {
    background: rgba(30,30,30,0.9);
    padding: 10px 20px;
    border-radius: 25px;
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--accent);
    border: 1px solid rgba(255,152,0,0.2);
}

/* =============================================================================
   EMOJI PICKER
   ============================================================================= */

.emoji-picker-trigger {
    background: rgba(255,255,255,0.05);
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: 10px;
    padding: 10px;
    cursor: pointer;
    transition: 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #888;
}

.emoji-picker-trigger:hover {
    background: rgba(255,152,0,0.1);
    border-color: rgba(255,152,0,0.2);
    color: var(--accent);
}

.emoji-picker {
    position: absolute;
    bottom: calc(100% + 10px);
    left: 24px;
    background: #1a1a1a;
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 16px;
    padding: 16px;
    box-shadow: 0 12px 40px rgba(0,0,0,0.6);
    z-index: 100;
    animation: pickerFadeIn 0.2s ease;
}

@keyframes pickerFadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

.emoji-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 8px;
}

.emoji-grid span {
    font-size: 1.4rem;
    padding: 8px;
    cursor: pointer;
    border-radius: 8px;
    transition: 0.15s;
    text-align: center;
}

.emoji-grid span:hover {
    background: rgba(255,255,255,0.1);
    transform: scale(1.2);
}

/* ===========================================
   REIMAGINED GLOBAL CHAT V2 STYLES
   =========================================== */

/* =============================================================================
   CHAT V2 - CSS VARIABLES
   ============================================================================= */

:root {
    --chat-bubble-me: linear-gradient(135deg, #2d5a87 0%, #1e3d5c 100%);
    --chat-bubble-other: linear-gradient(135deg, #2a2a2a 0%, #1f1f1f 100%);
    --chat-accent: #f5c211;
}

/* =============================================================================
   CHAT V2 - CONTAINER
   ============================================================================= */

/* Chat Container V2 */
.chat-container-v2 {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-height: 200px;
    background: linear-gradient(180deg, #0a0a0a 0%, #0f0f0f 100%);
    border-radius: 16px;
    overflow: hidden;
    position: relative;
    contain: layout style;
}

/* =============================================================================
   CHAT V2 - HEADER
   ============================================================================= */

/* Chat Header V2 */
.chat-header-v2 {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 24px;
    background: linear-gradient(180deg, rgba(25,25,25,0.98) 0%, rgba(18,18,18,0.95) 100%);
    border-bottom: 1px solid rgba(255,255,255,0.06);
    backdrop-filter: blur(10px);
    position: sticky;
    top: 0;
    z-index: 10;
}

.chat-header-left {
    display: flex;
    align-items: center;
    gap: 14px;
}

/* ===========================================
   XP TRACKER PROFILE HEADER - CLEAN LAYOUT
   =========================================== */

/* =============================================================================
   XP TRACKER - PROFILE HEADER LAYOUT
   ============================================================================= */

/* Ensure player-results is positioned */
#player-results {
    position: relative;
    overflow: hidden;
}

/* XP Tracker specific profile header - centered layout */
#player-results .profile-header {
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: center;
    padding: 20px 25px;
    gap: 20px;
    min-height: auto;
    width: 100%;
    box-sizing: border-box;
    position: relative;
}

/* Avatar and name in row - centered */
#player-results .profile-identity {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 20px;
    justify-content: center;
    flex-wrap: nowrap;
    position: relative;
    z-index: 2;
}

/* Large avatar for XP tracker */
#player-results .p-avatar {
    width: 100px;
    height: 100px;
    border-radius: 50%;
    border: 3px solid var(--accent);
    object-fit: cover;
    flex-shrink: 0;
    box-shadow: 0 4px 20px rgba(102, 126, 234, 0.3);
}

/* Name and details column - centered */
#player-results .profile-details-col {
    display: flex;
    flex-direction: column;
    gap: 8px;
    align-items: center;
    justify-content: center;
    text-align: center;
    min-width: 0;
}

/* Larger player name */
#player-results #p-name {
    font-size: 1.8rem;
    font-weight: 700;
    line-height: 1.1;
    margin: 0;
    word-break: break-word;
    color: #fff;
}

/* Name row — name + verified badge inline */
#player-results .profile-name-row {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    flex-wrap: wrap;
}

/* Action buttons — pinned to top-right of profile card */
#player-results .profile-actions {
    position: absolute;
    top: 12px;
    right: 12px;
    display: flex;
    gap: 6px;
    z-index: 5;
}

.profile-action-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    border: 1px solid #333;
    background: rgba(255, 255, 255, 0.04);
    color: #666;
    cursor: pointer;
    transition: all 0.2s ease;
    padding: 0;
}

.profile-action-btn svg {
    width: 16px;
    height: 16px;
}

.profile-action-btn.fav-action:hover {
    background: rgba(76, 175, 80, 0.12);
    border-color: rgba(76, 175, 80, 0.4);
    color: #4caf50;
}

.profile-action-btn.fav-action.is-favorite {
    background: rgba(76, 175, 80, 0.15);
    border-color: #4caf50;
    color: #4caf50;
}

.profile-action-btn.fav-action.is-favorite svg {
    fill: #4caf50;
}

.profile-action-btn.claim-action {
    color: var(--accent);
    border-color: rgba(255, 152, 0, 0.3);
}

.profile-action-btn.claim-action:hover {
    background: rgba(255, 152, 0, 0.15);
    border-color: var(--accent);
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(255, 152, 0, 0.15);
}

/* Meta row - rank, clan, toggle - centered */
#player-results .profile-meta-row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    gap: 12px;
}

/* Stats row centered */
#player-results .stats-row {
    justify-content: center;
}

/* =============================================================================
   XP TRACKER - PROFILE HEADER RESPONSIVE
   ============================================================================= */

/* Responsive adjustments for XP tracker profile */
@media (max-width: 900px) {
    #player-results .profile-header {
        padding: 20px 15px;
    }
    
    #player-results .p-avatar {
        width: 85px;
        height: 85px;
    }
    
    #player-results #p-name {
        font-size: 1.5rem;
    }
    
    #player-results .profile-identity {
        gap: 15px;
    }
}

@media (max-width: 700px) {
    #player-results .profile-header {
        padding: 15px;
    }
    
    #player-results .profile-identity {
        flex-direction: row;
        gap: 12px;
        flex-wrap: nowrap;
    }
    
    #player-results .p-avatar {
        width: 65px;
        height: 65px;
        flex-shrink: 0;
    }
    
    #player-results .profile-details-col {
        align-items: center;
        text-align: center;
        min-width: 0;
        flex: 1;
    }
    
    #player-results #p-name {
        font-size: 1.2rem;
    }
    
    #player-results .profile-meta-row {
        flex-direction: column;
        align-items: center;
        gap: 6px;
    }
}

@media (max-width: 500px) {
    #player-results .profile-header {
        padding: 12px;
    }
    
    #player-results .profile-identity {
        flex-direction: row !important;
        gap: 10px;
        flex-wrap: nowrap;
    }
    
    #player-results .profile-details-col {
        align-items: center;
        text-align: center;
        min-width: 0;
        flex: 1;
    }
    
    #player-results .p-avatar {
        width: 50px;
        height: 50px;
        flex-shrink: 0;
    }
    
    #player-results #p-name {
        font-size: 1rem;
    }
    
    #player-results .rank-badge {
        font-size: 0.7rem;
        padding: 3px 8px;
    }
    
    #player-results .profile-actions {
        top: 8px;
        right: 8px;
    }
    
    #player-results .profile-action-btn {
        width: 28px;
        height: 28px;
    }
    
    #player-results .profile-action-btn svg {
        width: 14px;
        height: 14px;
    }

    #player-results .profile-name-row {
        gap: 5px;
    }
}

/* =============================================================================
   FAVORITE POPUP BUTTON
   ============================================================================= */

/* === FAVORITE POPUP BUTTON === */
.search-row-with-fav {
    display: flex;
    align-items: center;
    gap: 8px;
}

.fav-popup-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid #444;
    border-radius: 8px;
    color: #666;
    cursor: pointer;
    transition: all 0.2s ease;
    flex-shrink: 0;
}

.fav-popup-btn:hover {
    background: rgba(76, 175, 80, 0.1);
    border-color: #4caf50;
    color: #4caf50;
}

.fav-popup-btn.has-favorites {
    color: #4caf50;
    border-color: rgba(76, 175, 80, 0.4);
}

.fav-popup-btn svg {
    width: 16px;
    height: 16px;
}

/* =============================================================================
   FAVORITES POPUP
   ============================================================================= */

/* === FAVORITES POPUP === */
.favorites-popup {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: linear-gradient(135deg, #1e1e1e 0%, #141414 100%);
    border: 1px solid #333;
    border-radius: 16px;
    width: 90%;
    max-width: 400px;
    max-height: 70vh;
    z-index: 1000001;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.8);
    animation: popupSlideIn 0.2s ease-out;
    overflow: hidden;
    pointer-events: auto;
}

@keyframes popupSlideIn {
    from { opacity: 0; transform: translate(-50%, -50%) scale(0.95); }
    to { opacity: 1; transform: translate(-50%, -50%) scale(1); }
}

/* =============================================================================
   FAVORITES POPUP HEADER
   ============================================================================= */

.favorites-popup-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    background: rgba(0, 0, 0, 0.3);
    border-bottom: 1px solid #333;
}

.favorites-popup-header h3 {
    font-size: 1rem;
    font-weight: 600;
    color: #fff;
    margin: 0;
}

.favorites-popup-close {
    background: transparent;
    border: none;
    color: #666;
    cursor: pointer;
    padding: 4px;
    border-radius: 6px;
    transition: all 0.2s ease;
}

.favorites-popup-close:hover {
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
}

/* =============================================================================
   FAVORITES POPUP CONTENT
   ============================================================================= */

.favorites-popup-content {
    padding: 15px;
    max-height: calc(70vh - 60px);
    overflow-y: auto;
    pointer-events: auto;
}

.favorites-popup-empty {
    text-align: center;
    padding: 40px 20px;
    color: #666;
}

.favorites-popup-empty svg {
    width: 48px;
    height: 48px;
    margin-bottom: 12px;
    opacity: 0.3;
}

.favorites-popup-empty p {
    font-size: 0.9rem;
    margin: 0;
}

/* =============================================================================
   FAVORITE ITEMS
   ============================================================================= */

/* Favorite Item in Popup */
.favorite-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px;
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid #2a2a2a;
    border-radius: 10px;
    margin-bottom: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
    pointer-events: auto;
    position: relative;
    z-index: 1;
}

.favorite-item:hover {
    background: rgba(76, 175, 80, 0.08);
    border-color: rgba(76, 175, 80, 0.3);
}

.favorite-item:last-child {
    margin-bottom: 0;
}

.favorite-item-avatar {
    width: 40px;
    height: 40px;
    border-radius: 8px;
    object-fit: cover;
    background: #222;
}

.favorite-item-info {
    flex: 1;
    min-width: 0;
}

.favorite-item-name {
    font-size: 0.95rem;
    font-weight: 500;
    color: #fff;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.favorite-item-type {
    font-size: 0.75rem;
    color: #666;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.favorite-item-remove {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    background: transparent;
    border: none;
    border-radius: 6px;
    color: #555;
    cursor: pointer;
    transition: all 0.2s ease;
}

.favorite-item-remove:hover {
    background: rgba(255, 82, 82, 0.15);
    color: #ff5252;
}

/* =============================================================================
   FAVORITES POPUP BACKDROP
   ============================================================================= */

/* Popup backdrop */
.favorites-popup-backdrop {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.6);
    z-index: 1000000;
    animation: fadeIn 0.2s ease-out;
}

/* =============================================================================
   ADD TO FAVORITE BUTTON
   ============================================================================= */

/* Add to favorite button in player/clan results */
.add-favorite-btn {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    background: transparent;
    border: 1px solid rgba(76, 175, 80, 0.3);
    border-radius: 15px;
    padding: 4px 10px;
    color: #888;
    font-size: 0.75rem;
    cursor: pointer;
    transition: all 0.2s ease;
}

.add-favorite-btn:hover {
    background: rgba(76, 175, 80, 0.1);
    border-color: #4caf50;
    color: #4caf50;
}

.add-favorite-btn.is-favorite {
    background: rgba(76, 175, 80, 0.15);
    border-color: #4caf50;
    color: #4caf50;
}

.add-favorite-btn svg {
    width: 14px;
    height: 14px;
}

.add-favorite-btn.is-favorite svg {
    fill: #4caf50;
}

/* ===========================================
   XP TRACKER PAGE - DARKER THEME & COOL TONES
   =========================================== */

/* =============================================================================
   XP TRACKER - DARK THEME BASE
   ============================================================================= */

/* DARKER OVERALL THEME */
body.xp-page {
    background: #050505;
}

body.xp-page .results-section {
    background: #0a0a0a;
    border-color: #1a1a1a;
    overflow-x: hidden;
    overflow-y: auto;
}

body.xp-page .sidebar-panel {
    background: #0a0a0a;
    border-color: #1a1a1a;
}

body.xp-page .skill-card-detailed {
    background: #0f0f0f;
    border-color: #1f1f1f;
}

body.xp-page .skill-card-detailed:hover {
    background: #151515;
    border-color: #2a2a2a;
}

body.xp-page .highlight-card {
    background: #0f0f0f;
    border-color: #1f1f1f;
}

body.xp-page .panel-header {
    background: #080808;
    border-color: #1a1a1a;
}

body.xp-page .sidebar-tabs {
    background: #080808;
}

body.xp-page .sidebar-content {
    background: #0a0a0a;
}

body.xp-page .search-controls {
    background: #0a0a0a;
    border-color: #1a1a1a;
}

body.xp-page .search-box-styled {
    background: #0f0f0f;
}

body.xp-page .search-box-styled input {
    background: #0f0f0f;
}

/* =============================================================================
   XP TRACKER - CYAN ACCENT PROGRESS BARS
   ============================================================================= */

/* Override progress bar to use cyan instead of orange */
body.xp-page .skill-progress-fill {
    background: #00bcd4;
    box-shadow: 0 0 8px rgba(0, 188, 212, 0.3);
}

/* =============================================================================
   XP TRACKER - MAXED SKILLS STYLING
   ============================================================================= */

/* MAXED SKILLS - Change gold to cyan/teal */
body.xp-page .skill-card-detailed.maxed {
    border-color: #00838f;
    background: linear-gradient(135deg, #0a0a0a 0%, #0a1518 100%);
    box-shadow: 0 0 15px rgba(0, 188, 212, 0.1);
}

body.xp-page .skill-card-detailed.maxed:hover {
    border-color: #00bcd4;
    box-shadow: 0 0 20px rgba(0, 188, 212, 0.25);
}

body.xp-page .skill-card-detailed.maxed .skill-lvl {
    color: #00e5ff;
    text-shadow: 0 0 10px rgba(0, 229, 255, 0.4);
}

body.xp-page .skill-card-detailed.maxed .skill-progress-fill {
    background: #00bcd4;
    box-shadow: 0 0 10px rgba(0, 188, 212, 0.5);
}

/* =============================================================================
   XP TRACKER - VIRTUAL LEVELS & TOOLTIPS
   ============================================================================= */

/* Virtual levels (over 99) - use cyan instead of purple */
body.xp-page .skill-lvl.virtual {
    color: #00e5ff;
    text-shadow: 0 0 10px rgba(0, 229, 255, 0.3);
}

/* Tooltip skill name - use white instead of orange */
body.xp-page .skill-tooltip .st-name {
    color: #fff;
}

/* =============================================================================
   XP TRACKER - HIGHLIGHT CARDS
   ============================================================================= */

/* Highlight sub text - use softer cyan */
body.xp-page .highlight-sub {
    color: #00bcd4;
}

/* Highlight card label */
body.xp-page .highlight-label {
    color: #888;
}

body.xp-page .highlight-content {
    color: #fff;
}

/* =============================================================================
   XP TRACKER - RECORD XP GAINS SECTION
   ============================================================================= */

.record-xp-section {
    margin-top: 18px;
    padding: 0 2px;
}

.record-xp-header {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.85rem;
    font-weight: 700;
    color: #ffd700;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    margin-bottom: 12px;
    padding-bottom: 8px;
    border-bottom: 1px solid rgba(255, 215, 0, 0.15);
}

.record-xp-header svg {
    color: #ffd700;
    flex-shrink: 0;
}

.record-xp-cards {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
}

.record-card {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 14px;
    background: linear-gradient(135deg, #0f0f0f 0%, #141418 100%);
    border: 1px solid #1f1f1f;
    border-radius: 10px;
    transition: border-color 0.3s, box-shadow 0.3s, transform 0.2s;
    position: relative;
    overflow: hidden;
}

.record-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: linear-gradient(90deg, transparent, rgba(255, 215, 0, 0.3), transparent);
    opacity: 0;
    transition: opacity 0.3s;
}

.record-card:hover {
    border-color: #2a2a2a;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.3);
    transform: translateY(-1px);
}

.record-card:hover::before {
    opacity: 1;
}

.record-card-new {
    border-color: rgba(255, 215, 0, 0.3) !important;
    background: linear-gradient(135deg, #0f0f0f 0%, #1a1812 100%);
    box-shadow: 0 0 20px rgba(255, 215, 0, 0.08);
    animation: recordPulse 2s ease-in-out infinite;
}

.record-card-new::before {
    opacity: 1;
    background: linear-gradient(90deg, transparent, rgba(255, 215, 0, 0.5), transparent);
}

.record-card-empty {
    opacity: 0.5;
}

.record-card-icon {
    flex-shrink: 0;
    margin-top: 2px;
    opacity: 0.85;
}

.record-card-body {
    flex: 1;
    min-width: 0;
}

.record-card-label {
    font-size: 0.72rem;
    font-weight: 600;
    color: #888;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    margin-bottom: 4px;
    display: flex;
    align-items: center;
    gap: 6px;
}

.record-new-badge {
    display: inline-flex;
    align-items: center;
    padding: 1px 6px;
    font-size: 0.6rem;
    font-weight: 800;
    color: #ffd700;
    background: rgba(255, 215, 0, 0.12);
    border: 1px solid rgba(255, 215, 0, 0.25);
    border-radius: 4px;
    letter-spacing: 0.5px;
    animation: badgeGlow 1.5s ease-in-out infinite;
}

.record-card-value {
    font-size: 1.05rem;
    font-weight: 700;
    line-height: 1.2;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.record-card-date {
    font-size: 0.68rem;
    color: #555;
    margin-top: 3px;
}

@keyframes recordPulse {
    0%, 100% { box-shadow: 0 0 15px rgba(255, 215, 0, 0.06); }
    50% { box-shadow: 0 0 20px rgba(255, 215, 0, 0.12); }
}

@keyframes badgeGlow {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.7; }
}

/* Responsive: stack on smaller screens */
@media (max-width: 600px) {
    .record-xp-cards {
        grid-template-columns: 1fr;
    }
}

@media (min-width: 601px) and (max-width: 900px) {
    .record-xp-cards {
        grid-template-columns: repeat(3, 1fr);
    }
    .record-card-value {
        font-size: 0.9rem;
    }
}

/* =============================================================================
   XP TRACKER - AVATAR & PANEL ACCENTS
   ============================================================================= */

/* Avatar border - use softer purple/blue */
body.xp-page #player-results .p-avatar {
    border-color: #667eea;
    box-shadow: 0 4px 20px rgba(102, 126, 234, 0.25);
}

/* Panel header accent bar - use cyan */
body.xp-page .panel-header::before {
    background: #00bcd4;
}

/* =============================================================================
   XP TRACKER - LINKS & INTERACTIVE ELEMENTS
   ============================================================================= */

/* Quest and log retry links - use cyan */
body.xp-page .retry-available span,
body.xp-page .log-placeholder span[style*="color:var(--gold)"] {
    color: #00bcd4 !important;
}

/* Active tab indicator - use cyan */
body.xp-page .sidebar-tab-btn.active {
    border-color: #00bcd4;
    color: #00bcd4;
}

/* Rank toggle slider active state - use cyan */
body.xp-page .rank-slider::before {
    background: #00bcd4;
}

/* Chat mention styling */
body.xp-page .chat-mention {
    color: #00bcd4;
}

/* =============================================================================
   XP TRACKER - ACTION BUTTONS
   ============================================================================= */

/* Keep some accent for interactive elements like buttons */
body.xp-page .action-btn {
    background: #00bcd4;
    color: #000;
}

body.xp-page .action-btn:hover {
    background: #00e5ff;
}

/* =============================================================================
   QUEST GUIDE OVERLAY - In-app wiki quick guide viewer
   ============================================================================= */

.quest-guide-overlay {
    position: fixed;
    top: 10px;
    right: 10px;
    width: min(520px, calc(100vw - 20px));
    height: calc(100vh - 20px);
    min-width: 280px;
    min-height: 200px;
    z-index: 100002;
    display: none;
    flex-direction: column;
    pointer-events: none;
    /* No max-width/max-height — allow dragging off-screen and across monitors */
}

/* --- Floating restore button (shown when in-page overlay is hidden via Alt+Q) --- */
.qg-restore-float-btn {
    position: fixed;
    bottom: 24px;
    right: 24px;
    z-index: 100003;
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: linear-gradient(135deg, #1e1e1e, #141414);
    border: 2px solid rgba(0, 188, 212, 0.35);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.5), 0 0 12px rgba(0, 188, 212, 0.15);
    color: #00bcd4;
    font-size: 1.3rem;
    cursor: grab;
    display: none;
    align-items: center;
    justify-content: center;
    transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
    animation: qg-restore-pulse 2s ease-in-out infinite;
    touch-action: none;
    user-select: none;
}

.qg-restore-float-btn:hover {
    transform: scale(1.12);
    border-color: rgba(0, 188, 212, 0.6);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.6), 0 0 20px rgba(0, 188, 212, 0.3);
    background: linear-gradient(135deg, #252525, #1a1a1a);
}

@keyframes qg-restore-pulse {
    0%, 100% { box-shadow: 0 4px 16px rgba(0, 0, 0, 0.5), 0 0 12px rgba(0, 188, 212, 0.15); }
    50% { box-shadow: 0 4px 16px rgba(0, 0, 0, 0.5), 0 0 20px rgba(0, 188, 212, 0.3); }
}

/* --- Minimize button in quest guide header --- */
.qg-btn.qg-minimize {
    font-size: 1.1rem;
    line-height: 1;
}

.qg-btn.qg-minimize:hover {
    background: rgba(255, 193, 7, 0.2);
    color: #ffc107;
}

.quest-guide-panel {
    display: flex;
    flex-direction: column;
    width: 100%;
    height: 100%;
    background: linear-gradient(145deg, #1a1a1a 0%, #0d0d0d 100%);
    border: 1px solid rgba(0, 188, 212, 0.25);
    border-radius: 12px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.6), 0 0 15px rgba(0, 188, 212, 0.08);
    overflow: hidden;
    pointer-events: auto;
    transition: opacity 0.2s, box-shadow 0.3s;
    position: relative;
}

.quest-guide-panel:hover {
    box-shadow: 0 8px 36px rgba(0, 0, 0, 0.7), 0 0 20px rgba(0, 188, 212, 0.12);
}

/* --- Resize handles (on overlay, outside panel for border-radius clipping) --- */
.qg-resize-handle {
    position: absolute;
    z-index: 10;
    background: transparent;
    touch-action: none;
    pointer-events: auto;
}

/* Edge handles */
.qg-resize-top    { top: -5px;    left: 10px;  right: 10px; height: 10px; cursor: ns-resize; }
.qg-resize-bottom { bottom: -5px; left: 10px;  right: 10px; height: 10px; cursor: ns-resize; }
.qg-resize-left   { left: -5px;   top: 10px;   bottom: 10px; width: 10px; cursor: ew-resize; }
.qg-resize-right  { right: -5px;  top: 10px;   bottom: 10px; width: 10px; cursor: ew-resize; }

/* Corner handles */
.qg-resize-tl { top: -5px;    left: -5px;   width: 14px; height: 14px; cursor: nwse-resize; }
.qg-resize-tr { top: -5px;    right: -5px;  width: 14px; height: 14px; cursor: nesw-resize; }
.qg-resize-bl { bottom: -5px; left: -5px;   width: 14px; height: 14px; cursor: nesw-resize; }
.qg-resize-br { bottom: -5px; right: -5px;  width: 14px; height: 14px; cursor: nwse-resize; }

/* Visual indicator on left edge */
.qg-resize-left::after {
    content: '';
    position: absolute;
    left: 3px;
    top: 50%;
    transform: translateY(-50%);
    width: 4px;
    height: 40px;
    border-radius: 2px;
    background: rgba(0, 188, 212, 0.2);
    transition: background 0.2s, height 0.2s;
}
.qg-resize-left:hover::after { background: rgba(0, 188, 212, 0.6); height: 60px; }

/* Visual indicator on right edge */
.qg-resize-right::after {
    content: '';
    position: absolute;
    right: 3px;
    top: 50%;
    transform: translateY(-50%);
    width: 4px;
    height: 40px;
    border-radius: 2px;
    background: rgba(0, 188, 212, 0.2);
    transition: background 0.2s, height 0.2s;
}
.qg-resize-right:hover::after { background: rgba(0, 188, 212, 0.6); height: 60px; }

/* Corner indicators */
.qg-resize-br::after {
    content: '';
    position: absolute;
    right: 3px;
    bottom: 3px;
    width: 8px;
    height: 8px;
    border-right: 2px solid rgba(0, 188, 212, 0.25);
    border-bottom: 2px solid rgba(0, 188, 212, 0.25);
    transition: border-color 0.2s;
}
.qg-resize-br:hover::after { border-color: rgba(0, 188, 212, 0.7); }

.qg-resize-bl::after {
    content: '';
    position: absolute;
    left: 3px;
    bottom: 3px;
    width: 8px;
    height: 8px;
    border-left: 2px solid rgba(0, 188, 212, 0.25);
    border-bottom: 2px solid rgba(0, 188, 212, 0.25);
    transition: border-color 0.2s;
}
.qg-resize-bl:hover::after { border-color: rgba(0, 188, 212, 0.7); }

.quest-guide-panel.transparent {
    opacity: 0.4;
}

.quest-guide-panel.transparent:hover {
    opacity: 0.9;
}

/* --- Header (draggable) --- */
.quest-guide-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 16px;
    background: linear-gradient(135deg, #1e1e1e 0%, #141414 100%);
    border-bottom: 1px solid rgba(0, 188, 212, 0.2);
    border-radius: 12px 12px 0 0;
    cursor: move;
    user-select: none;
    touch-action: none;
    flex-shrink: 0;
}

/* Back button for quest navigation */
.qg-back {
    font-size: 1.1rem;
    margin-right: 4px;
}

.quest-guide-title {
    display: flex;
    align-items: center;
    gap: 10px;
    color: #00bcd4;
    font-weight: 700;
    font-size: 1rem;
    min-width: 0;
    overflow: hidden;
}

.quest-guide-title span {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.quest-guide-icon {
    width: 22px;
    height: 22px;
    flex-shrink: 0;
}

.quest-guide-controls {
    display: flex;
    gap: 6px;
    flex-shrink: 0;
    align-items: center;
    overflow: visible;
}

.qg-btn {
    width: 32px;
    height: 32px;
    min-width: 32px;
    min-height: 32px;
    border: 1px solid #333;
    border-radius: 6px;
    background: #222;
    color: #aaa;
    font-size: 1rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.15s;
    text-decoration: none;
    overflow: visible;
    padding: 0;
    line-height: 1;
}

.qg-btn:hover {
    background: #333;
    color: #fff;
    border-color: #555;
}

.qg-close {
    font-size: 1.3rem;
    color: #888;
    line-height: 1;
}

.qg-close:hover {
    color: #ff5252;
    border-color: #ff5252;
}

/* --- Step counter badge --- */
.qg-step-counter {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 0.72rem;
    font-weight: 700;
    padding: 2px 7px;
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.06);
    color: #888;
    white-space: nowrap;
    flex-shrink: 0;
    letter-spacing: 0.02em;
    transition: all 0.3s;
}

.qg-step-counter.qg-all-done {
    background: rgba(76, 175, 80, 0.15);
    color: #4caf50;
}

/* --- Next step jump button --- */
.qg-next-step {
    font-size: 0.9rem !important;
    color: #00bcd4 !important;
}

.qg-next-step:hover {
    background: rgba(0, 188, 212, 0.15) !important;
    border-color: rgba(0, 188, 212, 0.3) !important;
}

/* Step highlight flash (when scrolled to) */
@keyframes qg-step-flash {
    0% { box-shadow: 0 0 0 2px rgba(0, 188, 212, 0.5); }
    50% { box-shadow: 0 0 12px 3px rgba(0, 188, 212, 0.3); }
    100% { box-shadow: none; }
}

.quest-guide-body .lighttable.checklist > ul > li.qg-step-highlight {
    animation: qg-step-flash 1.2s ease-out;
}

/* --- Completion celebration overlay --- */
.qg-celebration {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    pointer-events: none;
    z-index: 100;
    opacity: 0;
    transition: opacity 0.4s;
}

.qg-celebration-active {
    opacity: 1;
}

.qg-celebration-fade {
    opacity: 0;
    transition: opacity 0.5s;
}

.qg-celebration-content {
    text-align: center;
    padding: 24px 36px;
    background: rgba(0, 0, 0, 0.8);
    border: 1px solid rgba(76, 175, 80, 0.4);
    border-radius: 16px;
    backdrop-filter: blur(4px);
    box-shadow: 0 0 30px rgba(76, 175, 80, 0.2);
}

.qg-celebration-icon {
    font-size: 2.5rem;
    margin-bottom: 8px;
    animation: qg-bounce 0.6s ease-out;
}

@keyframes qg-bounce {
    0% { transform: scale(0.3); opacity: 0; }
    50% { transform: scale(1.15); }
    100% { transform: scale(1); opacity: 1; }
}

.qg-celebration-text {
    font-size: 1.1rem;
    font-weight: 700;
    color: #4caf50;
    letter-spacing: 0.03em;
}

/* Progress bar completion pulse */
@keyframes qg-progress-pulse {
    0%, 100% { box-shadow: 0 0 6px rgba(76, 175, 80, 0.3); }
    50% { box-shadow: 0 0 16px rgba(76, 175, 80, 0.6); }
}

.qg-progress-fill.qg-progress-complete {
    background: linear-gradient(90deg, #2e7d32, #4caf50, #66bb6a) !important;
    animation: qg-progress-pulse 1s ease-in-out 3;
}

/* --- Body (scrollable content) --- */
.quest-guide-body {
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
    padding: 16px;
    font-size: 0.9rem;
    line-height: 1.6;
    color: #ccc;
    scroll-behavior: smooth;
}

.quest-guide-body::-webkit-scrollbar { width: 6px; }
.quest-guide-body::-webkit-scrollbar-track { background: rgba(0, 0, 0, 0.2); }
.quest-guide-body::-webkit-scrollbar-thumb { background: rgba(0, 188, 212, 0.2); border-radius: 3px; }
.quest-guide-body::-webkit-scrollbar-thumb:hover { background: rgba(0, 188, 212, 0.4); }

/* --- Loading & Error states --- */
.qg-loading, .qg-error {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 12px;
    padding: 60px 20px;
    color: #888;
    text-align: center;
    font-size: 0.95rem;
}

.qg-spinner {
    width: 28px;
    height: 28px;
    border: 3px solid #333;
    border-top: 3px solid #00bcd4;
    border-radius: 50%;
    animation: qg-spin 0.8s linear infinite;
}

@keyframes qg-spin {
    to { transform: rotate(360deg); }
}

/* --- Quest Details Table (Overview) --- */
.quest-guide-body .questdetails {
    width: 100%;
    border-collapse: collapse;
    margin: 8px 0 16px;
    font-size: 0.85rem;
    background: rgba(0, 0, 0, 0.3);
    border-radius: 8px;
    overflow: hidden;
    border: 1px solid #2a2a2a;
}

.quest-guide-body .questdetails th.questdetails-header {
    text-align: left;
    padding: 8px 12px;
    color: #00bcd4;
    font-weight: 600;
    white-space: nowrap;
    vertical-align: top;
    background: rgba(0, 188, 212, 0.05);
    border-bottom: 1px solid #222;
    width: 120px;
}

.quest-guide-body .questdetails td.questdetails-info {
    padding: 8px 12px;
    border-bottom: 1px solid #222;
    color: #ccc;
}

.quest-guide-body .questdetails .questreq {
    background: none;
}

.quest-guide-body .questdetails img {
    vertical-align: middle;
    max-height: 21px;
}

/* --- Requirement Checking: Met / Not Met / Unknown --- */
.qg-req-met {
    color: #4caf50 !important;
    position: relative;
}

.qg-req-met::before {
    content: '✓ ';
    font-weight: bold;
    font-size: 0.8em;
}

.qg-req-not-met {
    color: #f44336 !important;
    position: relative;
}

.qg-req-not-met::before {
    content: '✗ ';
    font-weight: bold;
    font-size: 0.8em;
}

.qg-req-unknown {
    color: #9e9e9e !important;
    opacity: 0.8;
}

/* Skill requirement specific styling */
.skillreq.qg-req-met {
    background: rgba(76, 175, 80, 0.1);
    border-radius: 4px;
    padding: 1px 4px;
}

.skillreq.qg-req-not-met {
    background: rgba(244, 67, 54, 0.1);
    border-radius: 4px;
    padding: 1px 4px;
}

/* Quest link styling in prereq tree */
.questreq a.qg-req-met {
    text-decoration: line-through;
    text-decoration-color: rgba(76, 175, 80, 0.5);
}

.questreq a.qg-req-not-met {
    text-decoration: none;
    font-weight: 600;
}

/* --- Requirements Summary Banner --- */
.qg-req-summary {
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.04), rgba(255, 255, 255, 0.02));
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 10px;
    padding: 14px 16px;
    margin-bottom: 14px;
}

.qg-req-summary.qg-req-all-met {
    background: rgba(76, 175, 80, 0.08);
    border-color: rgba(76, 175, 80, 0.25);
}

.qg-req-summary-header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 8px;
}

.qg-req-summary-icon {
    font-size: 1.1rem;
}

.qg-req-summary-title {
    flex: 1;
    font-weight: 600;
    font-size: 0.9rem;
    color: #e0e0e0;
}

.qg-req-summary-pct {
    font-weight: 700;
    font-size: 0.95rem;
    color: #00bcd4;
}

.qg-req-all-met .qg-req-summary-pct {
    color: #4caf50;
}

.qg-req-summary-bars {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.qg-req-bar-row {
    display: flex;
    align-items: center;
    gap: 8px;
}

.qg-req-bar-label {
    font-size: 0.78rem;
    color: #999;
    width: 45px;
    flex-shrink: 0;
}

.qg-req-bar {
    flex: 1;
    height: 6px;
    background: rgba(255, 255, 255, 0.06);
    border-radius: 3px;
    overflow: hidden;
}

.qg-req-bar-fill {
    height: 100%;
    border-radius: 3px;
    transition: width 0.4s ease;
}

.qg-req-bar-fill.met {
    background: linear-gradient(90deg, #4caf50, #66bb6a);
}

.qg-req-bar-fill.partial {
    background: linear-gradient(90deg, #f44336, #ff7043);
}

.qg-req-bar-count {
    font-size: 0.78rem;
    color: #aaa;
    width: 36px;
    text-align: right;
    flex-shrink: 0;
}

/* --- Section Headers --- */
.quest-guide-body .mw-heading h2,
.quest-guide-body .mw-heading h3 {
    color: #00bcd4;
    font-size: 1.05rem;
    font-weight: 700;
    margin: 22px 0 10px;
    padding: 8px 14px;
    background: linear-gradient(90deg, rgba(0, 188, 212, 0.1), rgba(0, 188, 212, 0.02));
    border-left: 3px solid #00bcd4;
    border-radius: 0 6px 6px 0;
    letter-spacing: 0.01em;
}

.quest-guide-body .mw-heading h3 {
    font-size: 0.95rem;
    color: #4dd0e1;
    border-left-color: #4dd0e1;
    margin-top: 14px;
    background: linear-gradient(90deg, rgba(77, 208, 225, 0.07), transparent);
}

/* --- "Needed/Recommended" boxes --- */
.quest-guide-body .seealso {
    background: linear-gradient(135deg, rgba(255, 152, 0, 0.08), rgba(255, 152, 0, 0.03));
    border: 1px solid rgba(255, 152, 0, 0.2);
    border-left: 3px solid rgba(255, 152, 0, 0.5);
    border-radius: 0 6px 6px 0;
    padding: 10px 14px;
    margin: 10px 0;
    font-size: 0.85rem;
    color: #ddd;
}

.quest-guide-body .seealso b {
    color: #ffb74d;
}

/* --- Checklist Steps --- */
.quest-guide-body .lighttable.checklist {
    background: none;
    padding: 0;
    margin: 6px 0 12px;
}

.quest-guide-body .lighttable.checklist > ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.quest-guide-body .lighttable.checklist > ul > li {
    position: relative;
    padding: 9px 12px 9px 36px;
    margin: 3px 0;
    background: rgba(255, 255, 255, 0.025);
    border-radius: 6px;
    border: 1px solid rgba(255, 255, 255, 0.04);
    transition: all 0.2s ease;
    cursor: pointer;
    line-height: 1.5;
}

.quest-guide-body .lighttable.checklist > ul > li:hover {
    background: rgba(0, 188, 212, 0.04);
    border-color: rgba(0, 188, 212, 0.15);
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.2);
}

.quest-guide-body .lighttable.checklist > ul > li.qg-checked {
    opacity: 0.4;
    text-decoration: line-through;
    text-decoration-color: rgba(0, 188, 212, 0.3);
    background: rgba(0, 188, 212, 0.02);
}

.quest-guide-body .lighttable.checklist > ul > li.qg-checked:hover {
    opacity: 0.65;
}

/* Step checkbox */
.qg-step-check {
    position: absolute;
    left: 10px;
    top: 10px;
    width: 16px;
    height: 16px;
    accent-color: #00bcd4;
    cursor: pointer;
    margin: 0;
    flex-shrink: 0;
}

/* Safety net: hide any orphaned checkboxes outside their proper parent */
.qg-full-reqs .qg-step-check,
.qg-req-section .qg-step-check,
.quest-guide-body > .qg-step-check {
    display: none !important;
}

/* Sub-steps */
.quest-guide-body .lighttable.checklist ul ul {
    margin: 4px 0 2px 4px;
    padding-left: 16px;
    list-style: disc;
}

.quest-guide-body .lighttable.checklist ul ul li {
    padding: 3px 0;
    font-size: 0.84rem;
    color: #9e9e9e;
    background: none;
    cursor: default;
    line-height: 1.5;
}

.quest-guide-body .lighttable.checklist ul ul li b,
.quest-guide-body .lighttable.checklist ul ul li strong {
    color: #e0e0e0;
}

/* --- Dialogue Box --- */
.qg-dialogue-box {
    background: linear-gradient(135deg, rgba(0, 0, 0, 0.5), rgba(0, 0, 0, 0.35));
    border: 1px solid rgba(0, 188, 212, 0.15);
    border-radius: 8px;
    padding: 8px 12px;
    margin: 6px 0 4px 20px;
    font-size: 0.82rem;
    display: inline-block;
    max-width: calc(100% - 24px);
}

.qg-dialogue-box table {
    border-collapse: collapse;
}

.qg-dialogue-box td {
    padding: 2px 8px 2px 0;
    vertical-align: top;
}

.qg-dialogue-box td:first-child {
    color: #00bcd4;
    font-weight: 700;
    white-space: nowrap;
    min-width: 24px;
    text-align: center;
}

.qg-dialogue-box td:last-child {
    color: #e0e0e0;
}

/* --- Chat options inline styling --- */
.quest-guide-body .chat-options {
    color: #888;
    font-size: 0.85em;
}

.quest-guide-body .chat-options-underline {
    color: #4dd0e1;
    cursor: help;
    border-bottom: 1px dotted #4dd0e1;
}

/* --- Links inside guide --- */
.quest-guide-body a {
    color: #4dd0e1;
    text-decoration: none;
}

.quest-guide-body a:hover {
    color: #80deea;
    text-decoration: underline;
}

/* --- Images inside guide --- */
.quest-guide-body img {
    max-width: 100%;
    height: auto;
}

.quest-guide-body figure {
    margin: 8px 0;
    text-align: center;
}

.quest-guide-body figcaption {
    font-size: 0.8rem;
    color: #888;
    margin-top: 4px;
}

/* --- Skill requirements --- */
.quest-guide-body .skillreq img {
    max-height: 18px;
    vertical-align: middle;
    margin: 0 2px;
}

/* --- Full Requirements Section --- */
.quest-guide-body .qg-full-reqs {
    margin: 14px 0 18px;
}

.quest-guide-body .qg-full-reqs-title {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 14px;
    background: linear-gradient(135deg, rgba(0,188,212,0.12), rgba(0,188,212,0.03));
    border: 1px solid rgba(0,188,212,0.2);
    border-radius: 10px 10px 0 0;
    font-weight: 700;
    font-size: 0.95rem;
    color: #00bcd4;
    letter-spacing: 0.02em;
}

.quest-guide-body .qg-full-reqs-title svg {
    flex-shrink: 0;
}

.quest-guide-body .qg-full-reqs-body {
    border: 1px solid #2a2a2a;
    border-top: none;
    border-radius: 0 0 10px 10px;
    background: rgba(0,0,0,0.2);
    padding: 0;
}

.quest-guide-body .qg-full-reqs-body .qg-req-section {
    padding: 10px 14px;
    border-bottom: 1px solid #222;
}

.quest-guide-body .qg-full-reqs-body .qg-req-section:last-child {
    border-bottom: none;
}

.quest-guide-body .qg-req-section-label {
    font-size: 0.78rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: #888;
    font-weight: 600;
    margin-bottom: 6px;
}

.quest-guide-body .qg-req-section ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.quest-guide-body .qg-req-section ul ul {
    padding-left: 18px;
    list-style: none;
    margin: 2px 0;
}

.quest-guide-body .qg-req-section > ul > li {
    padding: 4px 0;
    line-height: 1.5;
}

.quest-guide-body .qg-req-section ul ul li {
    padding: 2px 0;
    font-size: 0.85rem;
    color: #aaa;
}

.quest-guide-body .qg-quest-tree {
    list-style: none;
    padding: 0;
    margin: 0;
}

.quest-guide-body .qg-quest-tree ul {
    list-style: none;
    padding-left: 22px;
    margin: 2px 0;
    border-left: 2px solid rgba(0, 188, 212, 0.08);
}

.quest-guide-body .qg-quest-tree li {
    padding: 3px 0;
    line-height: 1.5;
}

.quest-guide-body .qg-quest-tree ul li {
    font-size: 0.88rem;
}

.quest-guide-body .qg-req-quest-link {
    color: #4dd0e1;
    cursor: pointer;
    text-decoration: none;
    border-bottom: 1px dashed rgba(77,208,225,0.3);
    transition: all 0.15s;
}

.quest-guide-body .qg-req-quest-link:hover {
    color: #80deea;
    border-bottom-color: rgba(128,222,234,0.5);
    text-shadow: 0 0 8px rgba(0,188,212,0.3);
}

.quest-guide-body .qg-req-quest-link.qg-req-met {
    color: #4caf50;
    text-decoration: line-through;
    text-decoration-color: rgba(76,175,80,0.5);
    border-bottom-color: rgba(76,175,80,0.2);
}

.quest-guide-body .qg-req-quest-link.qg-req-not-met {
    color: #f44336;
    font-weight: 600;
    border-bottom-color: rgba(244,67,54,0.3);
}

.quest-guide-body .qg-req-quest-link::after {
    content: ' ↗';
    font-size: 0.7em;
    opacity: 0.5;
}

.quest-guide-body .qg-req-quest-link:hover::after {
    opacity: 1;
}

/* --- Collapsible sections --- */
.quest-guide-body .mw-collapsible-content {
    display: none;
}

.quest-guide-body .mw-collapsible.qg-expanded > .mw-collapsible-content {
    display: block;
}

.quest-guide-body .qg-collapse-toggle {
    color: #4dd0e1;
    cursor: pointer;
    font-size: 0.85rem;
    user-select: none;
}

.quest-guide-body .qg-collapse-toggle:hover {
    color: #80deea;
}

/* --- Progress bar at top --- */
.qg-progress-bar {
    height: 3px;
    background: rgba(255, 255, 255, 0.04);
    flex-shrink: 0;
    position: relative;
    overflow: hidden;
}

.qg-progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #00838f, #00bcd4, #4dd0e1);
    transition: width 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    border-radius: 0 2px 2px 0;
    box-shadow: 0 0 6px rgba(0, 188, 212, 0.3);
}

/* --- Rewards list --- */
.quest-guide-body .mw-heading + ul {
    padding-left: 20px;
}

.quest-guide-body .mw-heading + ul li {
    padding: 3px 0;
    color: #ccc;
}

/* --- Map thumbs --- */
.quest-guide-body .mw-kartographer-container,
.quest-guide-body .advanced-map {
    display: none;
}

.quest-guide-body .thumb {
    float: none;
    display: block;
    margin: 8px auto;
    text-align: center;
}

.quest-guide-body .thumbinner {
    background: rgba(0, 0, 0, 0.35);
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 8px;
    padding: 8px;
    display: inline-block;
    transition: border-color 0.2s;
}

.quest-guide-body .thumbinner:hover {
    border-color: rgba(0, 188, 212, 0.15);
}

.quest-guide-body .thumbcaption {
    font-size: 0.78rem;
    color: #999;
    margin-top: 6px;
    line-height: 1.3;
}

/* --- Wiki Tables (puzzle solutions, etc.) --- */
.quest-guide-body .wikitable {
    width: 100%;
    border-collapse: collapse;
    margin: 10px 0;
    font-size: 0.84rem;
    background: rgba(0, 0, 0, 0.25);
    border: 1px solid #2a2a2a;
    border-radius: 6px;
    overflow: hidden;
}

.quest-guide-body .wikitable th {
    background: rgba(0, 188, 212, 0.06);
    color: #b0bec5;
    font-weight: 600;
    padding: 8px 10px;
    text-align: left;
    border-bottom: 1px solid #333;
    font-size: 0.82rem;
}

.quest-guide-body .wikitable td {
    padding: 6px 10px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.04);
    color: #ccc;
    vertical-align: top;
}

.quest-guide-body .wikitable tr:last-child td {
    border-bottom: none;
}

.quest-guide-body .wikitable tr:hover td {
    background: rgba(255, 255, 255, 0.02);
}

/* Color-coded table cells */
.quest-guide-body .table-bg-orange { color: #ffb74d; }
.quest-guide-body .table-bg-blue { color: #64b5f6; }
.quest-guide-body .table-bg-green { color: #81c784; }
.quest-guide-body .table-bg-red { color: #ef9a9a; }

/* --- Gallery Images --- */
.quest-guide-body .gallery {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    justify-content: center;
    list-style: none;
    padding: 0;
    margin: 12px 0;
}

.quest-guide-body .gallerybox {
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid #2a2a2a;
    border-radius: 8px;
    overflow: hidden;
    max-width: 50%;
    flex: 1;
    min-width: 140px;
}

.quest-guide-body .gallerybox .thumb {
    float: none;
    margin: 0;
    text-align: center;
    padding: 6px;
}

.quest-guide-body .gallerybox .thumb img {
    border-radius: 4px;
    max-width: 100%;
    height: auto;
}

.quest-guide-body .gallerytext {
    font-size: 0.78rem;
    color: #999;
    padding: 4px 8px 8px;
    text-align: center;
    line-height: 1.3;
}

/* --- Generic lists --- */
.quest-guide-body ul {
    padding-left: 20px;
    margin: 4px 0;
}

.quest-guide-body li {
    margin: 2px 0;
}

/* --- Non-checkable info items (Build, vessel souls, etc.) --- */
.quest-guide-body .qg-req-info-item {
    color: #42a5f5 !important;
    font-style: italic;
    list-style: none;
    padding: 3px 0;
}

.quest-guide-body .qg-req-info-item a {
    color: #64b5f6 !important;
}

.quest-guide-body .qg-req-info-item a:hover {
    color: #90caf9 !important;
}

/* --- Items Needed / Recommended Checklist --- */
.quest-guide-body .qg-items-checklist {
    list-style: none;
    padding-left: 0;
}

.quest-guide-body .qg-items-checklist li {
    padding: 4px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.04);
}

.quest-guide-body .qg-items-checklist li:last-child {
    border-bottom: none;
}

.quest-guide-body .qg-item-label {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    cursor: pointer;
    user-select: none;
}

.quest-guide-body .qg-item-check {
    accent-color: #4caf50;
    width: 16px;
    height: 16px;
    flex-shrink: 0;
    margin-top: 2px;
    cursor: pointer;
}

.quest-guide-body .qg-item-text {
    flex: 1;
    line-height: 1.4;
}

.quest-guide-body .qg-item-text img {
    vertical-align: middle;
    max-height: 18px;
}

.quest-guide-body .qg-item-checked .qg-item-text {
    text-decoration: line-through;
    opacity: 0.5;
    color: #4caf50;
}

/* --- Follows Events / Full Completion sections --- */
.quest-guide-body .qg-follows-section {
    border-left: 3px solid rgba(33, 150, 243, 0.4);
    padding-left: 12px !important;
}

.quest-guide-body .qg-follows-section .qg-req-section-label {
    color: #42a5f5 !important;
}

.quest-guide-body .qg-completion-section {
    border-left: 3px solid rgba(171, 71, 188, 0.4);
    padding-left: 12px !important;
}

.quest-guide-body .qg-completion-section .qg-req-section-label {
    color: #ab47bc !important;
}

/* --- Collapsible Quest Tree Toggle --- */
.quest-guide-body .qg-tree-collapsible {
    margin: 4px 0;
}

.quest-guide-body .qg-tree-toggle {
    background: rgba(0, 188, 212, 0.08);
    border: 1px solid rgba(0, 188, 212, 0.2);
    border-radius: 6px;
    color: #4dd0e1;
    cursor: pointer;
    font-size: 0.82rem;
    font-weight: 600;
    padding: 6px 12px;
    transition: all 0.2s;
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.quest-guide-body .qg-tree-toggle:hover {
    background: rgba(0, 188, 212, 0.15);
    border-color: rgba(0, 188, 212, 0.4);
    color: #80deea;
}

.quest-guide-body .qg-tree-toggle-open {
    background: rgba(0, 188, 212, 0.12);
    border-color: rgba(0, 188, 212, 0.3);
}

.quest-guide-body .qg-tree-content {
    margin-top: 8px;
    animation: qgTreeReveal 0.25s ease-out;
}

@keyframes qgTreeReveal {
    from { opacity: 0; transform: translateY(-4px); }
    to { opacity: 1; transform: translateY(0); }
}

/* --- Recommended section --- */
.quest-guide-body .qg-recommended-section {
    border-left: 3px solid rgba(255, 193, 7, 0.4);
    padding-left: 12px !important;
}

.quest-guide-body .qg-recommended-section .qg-req-section-label {
    color: #ffc107 !important;
}

/* --- Combat section --- */
.quest-guide-body .qg-combat-section {
    border-left: 3px solid rgba(244, 67, 54, 0.3);
    padding-left: 12px !important;
}

.quest-guide-body .qg-combat-section .qg-req-section-label {
    color: #ef5350 !important;
}

.quest-guide-body .qg-combat-body {
    color: #ccc;
    font-size: 0.88rem;
    line-height: 1.6;
}

.quest-guide-body .qg-combat-body ul {
    padding-left: 18px;
    margin: 4px 0;
}

.quest-guide-body .qg-combat-body li {
    padding: 2px 0;
}

.quest-guide-body .qg-combat-body a {
    color: #ef9a9a;
}

/* --- Quest Search --- */
.qg-search-container {
    padding: 8px 12px;
    position: relative;
}

.qg-search-input {
    width: 100%;
    padding: 8px 12px 8px 34px;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    color: #e0e0e0;
    font-size: 0.88rem;
    outline: none;
    transition: border-color 0.2s, background 0.2s;
}

.qg-search-input:focus {
    border-color: rgba(0, 188, 212, 0.5);
    background: rgba(255, 255, 255, 0.08);
}

.qg-search-input::placeholder {
    color: #666;
}

.qg-search-icon {
    position: absolute;
    left: 22px;
    top: 50%;
    transform: translateY(-50%);
    color: #666;
    font-size: 0.9rem;
    pointer-events: none;
}

.qg-search-results {
    max-height: 350px;
    overflow-y: auto;
    margin-top: 4px;
}

.qg-search-results::-webkit-scrollbar { width: 5px; }
.qg-search-results::-webkit-scrollbar-track { background: transparent; }
.qg-search-results::-webkit-scrollbar-thumb { background: rgba(0, 188, 212, 0.2); border-radius: 3px; }
.qg-search-results::-webkit-scrollbar-thumb:hover { background: rgba(0, 188, 212, 0.35); }

.qg-search-result-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 12px;
    cursor: pointer;
    border-radius: 6px;
    transition: background 0.15s;
    border: 1px solid transparent;
}

.qg-search-result-item:hover {
    background: rgba(0, 188, 212, 0.08);
    border-color: rgba(0, 188, 212, 0.15);
}

.qg-search-result-name {
    flex: 1;
    font-size: 0.88rem;
    color: #e0e0e0;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.qg-search-result-status {
    font-size: 0.75rem;
    padding: 2px 8px;
    border-radius: 4px;
    flex-shrink: 0;
    font-weight: 600;
}

.qg-search-result-status.completed {
    background: rgba(76, 175, 80, 0.15);
    color: #4caf50;
}

.qg-search-result-status.started {
    background: rgba(255, 193, 7, 0.15);
    color: #ffc107;
}

.qg-search-result-status.not-started {
    background: rgba(158, 158, 158, 0.15);
    color: #9e9e9e;
}

.qg-search-empty {
    text-align: center;
    color: #666;
    padding: 20px;
    font-size: 0.85rem;
}

/* --- Responsive --- */
@media (max-width: 768px) {
    .quest-guide-overlay {
        width: 100vw !important;
        height: 100vh !important;
        top: 0 !important;
        right: 0 !important;
        left: auto !important;
    }

    .qg-resize-handle {
        display: none !important;
    }

    .quest-guide-panel {
        border-radius: 0;
        border: none;
    }

    .quest-guide-header {
        padding: 10px 12px;
        border-radius: 0;
    }

    .quest-guide-body {
        padding: 12px;
    }
}

/* =============================================================================
   GIM LEADERBOARD STYLES
   ============================================================================= */

#gim-results {
    max-width: 1000px;
    margin: 0 auto;
    padding: 20px;
}

.gim-header {
    margin-bottom: 20px;
}

.gim-title-row {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 16px;
}

.gim-title {
    font-size: 1.4rem;
    color: #fff;
    margin: 0;
    font-weight: 700;
}

.gim-controls {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
    align-items: flex-end;
}

.gim-control-group {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

/* GIM Browse Button (sidebar) */
.gim-browse-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    padding: 8px 14px;
    background: linear-gradient(135deg, #1a1a2e, #16213e);
    border: 1px solid #333;
    border-radius: 8px;
    color: #c5a04e;
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}
.gim-browse-btn:hover {
    background: linear-gradient(135deg, #16213e, #1a3050);
    border-color: #c5a04e;
    color: #f0d77a;
}
.gim-browse-btn svg {
    flex-shrink: 0;
    stroke: currentColor;
}

.gim-control-group label {
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: #888;
    font-weight: 600;
}

.gim-btn-group {
    display: flex;
    gap: 0;
    border-radius: 8px;
    overflow: hidden;
    border: 1px solid #333;
}

.gim-ctrl-btn {
    background: #1a1a2e;
    color: #aaa;
    border: none;
    padding: 7px 14px;
    font-size: 0.82rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    gap: 5px;
    white-space: nowrap;
}

.gim-ctrl-btn:not(:last-child) {
    border-right: 1px solid #333;
}

.gim-ctrl-btn:hover {
    background: #252545;
    color: #ccc;
}

.gim-ctrl-btn.active {
    background: var(--accent, #4fc3f7);
    color: #000;
}

.gim-ctrl-btn.active img {
    filter: brightness(0);
}

.gim-filter-group {
    flex: 1;
    min-width: 160px;
}

.gim-filter-input {
    background: #1a1a2e;
    border: 1px solid #333;
    border-radius: 8px;
    color: #fff;
    padding: 7px 12px;
    font-size: 0.82rem;
    width: 100%;
    outline: none;
    transition: border-color 0.2s;
}

.gim-filter-input:focus {
    border-color: var(--accent, #4fc3f7);
}

.gim-filter-input::placeholder {
    color: #555;
}

/* Search status bar */
.gim-search-status {
    background: #1a1a2e;
    border: 1px solid #333;
    border-radius: 8px;
    padding: 10px 16px;
    margin-bottom: 16px;
    color: #aaa;
    font-size: 0.85rem;
    display: flex;
    align-items: center;
    gap: 8px;
}

.gim-search-status strong {
    color: var(--accent, #4fc3f7);
}

.gim-search-status a {
    color: var(--accent, #4fc3f7);
    text-decoration: none;
}

.gim-search-status a:hover {
    text-decoration: underline;
}

/* Table */
.gim-table-wrap {
    overflow-x: auto;
    border-radius: 10px;
    border: 1px solid #2a2a3e;
}

.gim-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.88rem;
}

.gim-table thead th {
    background: #12121e;
    color: #888;
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    padding: 10px 14px;
    text-align: left;
    font-weight: 600;
    border-bottom: 1px solid #2a2a3e;
    position: sticky;
    top: 0;
    z-index: 1;
}

.gim-th-rank {
    width: 60px;
    text-align: center !important;
}

.gim-th-xp,
.gim-th-level {
    text-align: right !important;
}

.gim-row {
    transition: background 0.15s;
    border-bottom: 1px solid #1e1e30;
}

.gim-row:hover {
    background: #1a1a30;
}

.gim-row td {
    padding: 10px 14px;
    color: #ccc;
}

.gim-rank {
    text-align: center;
    color: #666;
    font-weight: 600;
    font-variant-numeric: tabular-nums;
}

.gim-name {
    font-weight: 600;
    color: #fff !important;
    display: flex;
    align-items: center;
    gap: 8px;
}

.gim-name img {
    flex-shrink: 0;
}

.gim-founder {
    color: #999 !important;
}

/* Clickable / Expandable rows */
.gim-row-clickable {
    cursor: pointer;
    transition: background 0.15s;
}

.gim-row-clickable:hover {
    background: var(--bg-hover, rgba(255,255,255,0.05));
}

.gim-row-expanded {
    background: rgba(255,152,0,0.06) !important;
    border-bottom-color: transparent;
}

.gim-expand-cell {
    width: 36px;
    text-align: center;
    padding: 10px 6px !important;
}

.gim-th-expand {
    width: 36px;
}

.gim-chevron {
    color: var(--text-dim, #555);
    transition: transform 0.25s ease, color 0.2s;
}

.gim-row-clickable:hover .gim-chevron {
    color: var(--text-sub, #888);
}

.gim-row-expanded .gim-chevron {
    transform: rotate(180deg);
    color: var(--accent, #ff9800);
}

/* Detail row that expands below a group */
.gim-detail-row {
    animation: gimDetailSlideIn 0.25s ease-out;
}

.gim-detail-row td {
    padding: 0 !important;
    background: var(--bg-body, #0a0a0a);
    border-bottom: 2px solid var(--accent, #ff9800);
}

.gim-detail-collapsing {
    animation: gimDetailSlideOut 0.25s ease-in forwards;
}

@keyframes gimDetailSlideIn {
    from { opacity: 0; }
    to   { opacity: 1; }
}

@keyframes gimDetailSlideOut {
    from { opacity: 1; }
    to   { opacity: 0; }
}

.gim-detail-content {
    padding: 16px 20px;
}

.gim-detail-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 14px;
    flex-wrap: wrap;
}

.gim-detail-icon,
.gim-detail-icon img,
.gim-detail-icon svg {
    width: 22px;
    height: 22px;
    vertical-align: middle;
}

.gim-detail-title {
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--gold, #ffd700);
}

.gim-detail-meta {
    font-size: 0.8rem;
    color: var(--text-sub, #888);
    margin-left: auto;
}

.gim-members-section {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.gim-members-loading {
    display: flex;
    align-items: center;
    gap: 10px;
    color: var(--text-sub, #888);
    font-size: 0.85rem;
    padding: 12px 0;
}

.gim-member-spinner {
    width: 18px;
    height: 18px;
    border: 2px solid var(--border-color, #333);
    border-top-color: var(--accent, #ff9800);
    border-radius: 50%;
    animation: gimSpin 0.6s linear infinite;
    flex-shrink: 0;
}

/* Member card */
.gim-member-card {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 12px 14px;
    background: var(--bg-card, #161616);
    border-radius: var(--radius-md, 12px);
    border: 1px solid var(--border-color, #333);
    cursor: pointer;
    transition: background 0.2s, border-color 0.2s, transform 0.15s;
}

.gim-member-card:hover {
    background: var(--bg-dropdown, #1a1a1a);
    border-color: var(--accent, #ff9800);
    transform: translateX(3px);
}

.gim-member-avatar {
    flex-shrink: 0;
    width: 48px;
    height: 48px;
    border-radius: 50%;
    overflow: hidden;
    background: var(--bar-bg, #2a2a2a);
    border: 2px solid var(--border-color, #333);
}

.gim-member-card:hover .gim-member-avatar {
    border-color: var(--accent, #ff9800);
}

.gim-member-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.gim-member-info {
    flex: 1;
    min-width: 0;
}

.gim-member-name {
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--gold, #ffd700);
    margin-bottom: 3px;
}

.gim-member-stats {
    display: flex;
    flex-wrap: wrap;
    gap: 4px 12px;
    font-size: 0.78rem;
    color: var(--text-sub, #888);
}

.gim-member-stats span {
    white-space: nowrap;
}

.gim-member-stats strong {
    color: var(--text-main, #e0e0e0);
    font-weight: 600;
}

.gim-member-loading-text {
    color: var(--text-muted, #666);
    font-style: italic;
}

.gim-stat-private {
    color: var(--text-muted, #666);
    font-style: italic;
}

.gim-member-view-btn {
    flex-shrink: 0;
    color: var(--text-dim, #555);
    transition: color 0.2s, transform 0.2s;
}

.gim-member-card:hover .gim-member-view-btn {
    color: var(--accent, #ff9800);
    transform: translateX(3px);
}

.gim-member-not-found {
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--text-sub, #888);
    font-size: 0.85rem;
    padding: 12px 0;
}

.gim-member-not-found svg {
    color: var(--text-muted, #666);
    flex-shrink: 0;
}

.gim-xp,
.gim-level {
    text-align: right;
    font-variant-numeric: tabular-nums;
    font-weight: 500;
}

.gim-xp {
    color: #4fc3f7 !important;
}

.gim-level {
    color: #81c784 !important;
}

.gim-empty {
    text-align: center;
    padding: 40px 20px !important;
    color: #666;
    font-size: 0.9rem;
}

/* Pagination */
.gim-pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 16px;
    margin-top: 16px;
    padding: 12px;
}

.gim-page-btn {
    background: #1a1a2e;
    color: #ccc;
    border: 1px solid #333;
    border-radius: 8px;
    padding: 8px 18px;
    font-size: 0.82rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.gim-page-btn:hover:not(:disabled) {
    background: #252545;
    border-color: var(--accent, #4fc3f7);
    color: #fff;
}

.gim-page-btn:disabled {
    opacity: 0.35;
    cursor: not-allowed;
}

.gim-page-info {
    color: #888;
    font-size: 0.82rem;
    font-variant-numeric: tabular-nums;
}

/* Loading spinner for GIM */
.gim-loading-spinner {
    display: inline-block;
    width: 16px;
    height: 16px;
    border: 2px solid #333;
    border-top-color: var(--accent, #4fc3f7);
    border-radius: 50%;
    animation: gimSpin 0.6s linear infinite;
    vertical-align: middle;
}

@keyframes gimSpin {
    to { transform: rotate(360deg); }
}

/* GIM Responsive */
@media (max-width: 700px) {
    #gim-results {
        padding: 12px;
    }

    .gim-title {
        font-size: 1.1rem;
    }

    .gim-controls {
        flex-direction: column;
        gap: 10px;
    }

    .gim-ctrl-btn {
        padding: 6px 10px;
        font-size: 0.78rem;
    }

    .gim-table {
        font-size: 0.8rem;
    }

    .gim-table thead th,
    .gim-row td {
        padding: 8px 8px;
    }

    .gim-detail-meta {
        margin-left: 0;
        width: 100%;
    }

    .gim-member-card {
        gap: 10px;
    }

    .gim-member-avatar {
        width: 36px;
        height: 36px;
    }

    .gim-member-name {
        font-size: 0.85rem;
    }

    .gim-member-stats {
        gap: 3px 8px;
        font-size: 0.72rem;
    }

    .gim-member-view-btn {
        display: none;
    }

    .gim-detail-content {
        padding: 12px 10px;
    }

    .gim-pagination {
        gap: 10px;
    }

    .gim-page-btn {
        padding: 6px 12px;
    }
}

/* =============================================================================
   CUSTOM XP GOALS
   ============================================================================= */

.custom-goals-wrapper {
    flex-direction: column;
    gap: 10px;
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 12px;
    padding: 14px;
}

.custom-goals-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 6px;
    padding-bottom: 8px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.custom-goals-title {
    font-size: 0.8rem;
    font-weight: 700;
    color: #ccc;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.goal-add-btn {
    background: rgba(255, 152, 0, 0.15);
    color: #ff9800;
    border: 1px solid rgba(255, 152, 0, 0.3);
    border-radius: 6px;
    padding: 4px 12px;
    font-size: 0.7rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s;
    letter-spacing: 0.3px;
}

.goal-add-btn:hover {
    background: rgba(255, 152, 0, 0.25);
    border-color: rgba(255, 152, 0, 0.5);
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(255, 152, 0, 0.2);
}

.goal-card {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.07);
    border-radius: 10px;
    padding: 12px 14px;
    position: relative;
    transition: border-color 0.2s, background 0.2s;
}

.goal-card:hover {
    border-color: rgba(255, 255, 255, 0.12);
    background: rgba(255, 255, 255, 0.05);
}

.goal-card-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 6px;
}

.goal-card-skill {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.8rem;
    font-weight: 600;
    color: #e0e0e0;
}

.goal-card-skill img {
    width: 16px;
    height: 16px;
}

.goal-target-badge {
    font-size: 0.62rem;
    font-weight: 700;
    color: #fbbf24;
    background: rgba(251, 191, 36, 0.1);
    border: 1px solid rgba(251, 191, 36, 0.2);
    border-radius: 4px;
    padding: 1px 5px;
    white-space: nowrap;
}

.goal-card-delete {
    background: none;
    border: none;
    color: #888;
    cursor: pointer;
    font-size: 0.9rem;
    padding: 2px 6px;
    border-radius: 4px;
    transition: color 0.2s, background 0.2s;
}

.goal-card-delete:hover {
    color: #f44336;
    background: rgba(244, 67, 54, 0.1);
}

.goal-progress-track {
    width: 100%;
    height: 8px;
    background: rgba(255, 255, 255, 0.08);
    border-radius: 4px;
    overflow: hidden;
    margin: 6px 0;
}

.goal-progress-fill {
    height: 100%;
    border-radius: 4px;
    transition: width 0.5s ease;
    background: linear-gradient(90deg, #4caf50, #66bb6a);
}

.goal-progress-fill.behind {
    background: linear-gradient(90deg, #ff9800, #ffb74d);
}

.goal-progress-fill.far-behind {
    background: linear-gradient(90deg, #f44336, #ef5350);
}

.goal-progress-fill.ahead {
    background: linear-gradient(90deg, #00e5ff, #18ffff);
}

.goal-progress-fill.completed {
    background: linear-gradient(90deg, #bb86fc, #e0b0ff);
}

.goal-stats-row {
    display: flex;
    justify-content: space-between;
    font-size: 0.72rem;
    color: #999;
    margin-top: 2px;
}

.goal-daily-need {
    font-size: 0.72rem;
    color: #4fc3f7;
    margin-top: 4px;
    font-weight: 600;
}

.goal-daily-need.on-track {
    color: #4caf50;
}

.goal-daily-need.ahead {
    color: #00e5ff;
}

.goal-daily-need.behind {
    color: #ff9800;
}

.goal-daily-need.far-behind {
    color: #f44336;
}

.goal-daily-need.completed {
    color: #bb86fc;
}

.goal-card-completed {
    border-color: rgba(187, 134, 252, 0.3);
    background: rgba(187, 134, 252, 0.05);
}

.goal-chart-wrap {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 10px;
    padding: 10px;
    margin-top: 8px;
    position: relative;
}

.goal-chart-top-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 6px;
}

.goal-chart-title {
    font-size: 0.72rem;
    font-weight: 600;
    color: #aaa;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.goal-chart-close {
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: #aaa;
    cursor: pointer;
    font-size: 1rem;
    width: 24px;
    height: 24px;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
    transition: background 0.2s, color 0.2s;
}

.goal-chart-close:hover {
    background: rgba(244, 67, 54, 0.15);
    color: #f44336;
}

/* Goal card chart button — made more prominent */
.goal-chart-btn {
    background: rgba(79, 195, 247, 0.08);
    border: 1px solid rgba(79, 195, 247, 0.2);
    color: #4fc3f7;
    cursor: pointer;
    font-size: 0.7rem;
    padding: 3px 8px;
    border-radius: 6px;
    transition: background 0.2s, border-color 0.2s;
    display: flex;
    align-items: center;
    gap: 3px;
}

.goal-chart-btn:hover {
    background: rgba(79, 195, 247, 0.18);
    border-color: rgba(79, 195, 247, 0.4);
}

/* Records placement dropdown */
.records-placement-select {
    margin-left: auto;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: #888;
    font-size: 0.65rem;
    padding: 2px 6px;
    border-radius: 5px;
    cursor: pointer;
    outline: none;
    transition: border-color 0.2s;
}

.records-placement-select:hover,
.records-placement-select:focus {
    border-color: rgba(255, 215, 0, 0.3);
    color: #bbb;
}

.records-placement-select option {
    background: #1a1a1a;
    color: #ccc;
}

/* Records in sidebar — compact layout */
.record-xp-section.in-sidebar {
    margin-top: 0;
    padding: 10px 8px;
}

.record-xp-section.in-sidebar .record-xp-cards {
    grid-template-columns: 1fr;
    gap: 6px;
}

.record-xp-section.in-sidebar .record-card {
    padding: 10px;
}

.goal-empty-msg {
    text-align: center;
    color: #555;
    font-size: 0.75rem;
    padding: 16px 10px;
    font-style: normal;
    line-height: 1.4;
}

/* =============================================================================
   GOAL DRAG REORDER
   ============================================================================= */

.goal-drag-handle {
    cursor: grab;
    user-select: none;
    font-size: 1rem;
    color: #666;
    padding: 0 4px;
    line-height: 1;
    opacity: 0.5;
    transition: opacity 0.2s, color 0.2s;
}

.goal-drag-handle:hover {
    opacity: 1;
    color: #ff9800;
}

.goal-card.goal-dragging {
    opacity: 0.4;
    box-shadow: 0 0 20px rgba(255, 152, 0, 0.3);
}

.goal-drag-placeholder {
    border: 2px dashed rgba(255, 152, 0, 0.3);
    border-radius: 8px;
    margin-bottom: 8px;
    background: rgba(255, 152, 0, 0.05);
}

.goal-move-btn {
    background: none;
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: #888;
    font-size: 0.55rem;
    cursor: pointer;
    padding: 2px 5px;
    border-radius: 4px;
    line-height: 1;
    transition: all 0.2s;
}

.goal-move-btn:hover {
    color: #ff9800;
    border-color: rgba(255, 152, 0, 0.3);
    background: rgba(255, 152, 0, 0.1);
}

/* =============================================================================
   GOALS DIRECTORY MODAL
   ============================================================================= */

/* ---- Goals Directory Modal ---- */
.goals-dir-modal-content {
    max-width: 480px;
    width: 95vw;
    max-height: 80vh;
    display: flex;
    flex-direction: column;
}

.goals-dir-body {
    overflow-y: auto;
    flex: 1;
    padding: 16px !important;
}

.goals-dir-desc {
    color: #999;
    font-size: 0.8rem;
    margin-bottom: 12px;
    text-align: center;
}

.goals-dir-search {
    width: 100%;
    box-sizing: border-box;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 6px;
    padding: 8px 12px;
    color: #fff;
    font-size: 0.8rem;
    outline: none;
    transition: border-color 0.2s;
    margin-bottom: 12px;
}

.goals-dir-search:focus {
    border-color: rgba(255, 152, 0, 0.4);
}

.goals-dir-search::placeholder {
    color: #666;
}

.goals-dir-list {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.goals-dir-loading {
    text-align: center;
    color: #666;
    padding: 30px;
    font-size: 0.8rem;
}

.gdir-summary {
    text-align: center;
    color: #888;
    font-size: 0.72rem;
    padding-bottom: 8px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
    margin-bottom: 4px;
}

.gdir-player-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 14px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 6px;
    cursor: pointer;
    transition: background 0.2s, border-color 0.2s;
}

.gdir-player-row:hover {
    background: rgba(255, 152, 0, 0.08);
    border-color: rgba(255, 152, 0, 0.25);
}

.gdir-player-name {
    color: #ff9800;
    font-weight: 600;
    font-size: 0.85rem;
}

.gdir-player-count {
    color: #888;
    font-size: 0.72rem;
}

/* ---- Player Goals Popup ---- */
.gdir-popup-content {
    max-width: 520px;
    width: 95vw;
    max-height: 80vh;
    display: flex;
    flex-direction: column;
}

.gdir-popup-body {
    overflow-y: auto;
    flex: 1;
    padding: 16px !important;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.gdir-goal {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 6px;
    padding: 10px 12px;
}

.gdir-goal-head {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-bottom: 5px;
}

.gdir-skill-icon {
    width: 16px;
    height: 16px;
}

.gdir-skill-name {
    color: #ddd;
    font-size: 0.78rem;
    font-weight: 500;
}

.gdir-goal-status {
    margin-left: auto;
    font-size: 0.65rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.3px;
    color: #a5d6a7;
}

.gdir-goal-stats {
    display: flex;
    justify-content: space-between;
    font-size: 0.68rem;
    color: #888;
    margin-top: 4px;
}

/* Player Not Found / Private Profile error state */
.player-not-found-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 60px 24px;
    min-height: 300px;
    gap: 12px;
    grid-column: 1 / -1; /* Span full width in grid layouts */
}

.player-not-found-state h2 {
    font-size: 1.4rem;
    font-weight: 600;
    color: var(--text-primary, #eee);
    margin: 8px 0 0;
}

.player-not-found-state p {
    font-size: 0.95rem;
    color: var(--text-secondary, #999);
    line-height: 1.6;
    max-width: 420px;
}

.player-not-found-state p strong {
    color: var(--gold, #c8a24e);
}