/* Tanya Desert's Protection: simple sand shield ring */
.vfx-sand-shield-ring{
    position:absolute;
    left:50%;
    top:50%;
    width:130%;
    height:130%;
    transform:translate(-50%,-50%);
    border:3px solid rgba(210,180,70,0.55);
    border-radius:50%;
    box-shadow:0 0 18px 6px rgba(210,180,70,0.35) inset, 0 0 14px rgba(120,90,20,0.35);
    animation:sandShieldPulse 0.9s ease-out forwards;
    pointer-events:none;
}

@keyframes sandShieldPulse{
    0%{opacity:0; transform:translate(-50%,-50%) scale(0.9);} 
    25%{opacity:1;}
    100%{opacity:0.2; transform:translate(-50%,-50%) scale(1.05);} 
}
/* CSS Variables for Quest Panel */
:root {
    --primary: #6366f1;
    --primary-light: #8b5cf6;
    --primary-dark: #4f46e5;
    --bg-card: #1f2937;
    --bg-hover: #374151;
    --border-light: #4b5563;
    --neutral-400: #9ca3af;
    --neutral-700: #374151;
    --radius-sm: 8px;
    --easy: #10b981;
    --legendary: #f59e0b;
}

/* Quest Panel Styles */
.quest-panel {
    position: fixed;
    top: 120px;
    right: 20px;
    width: 320px;
    max-height: calc(100vh - 140px);
    background: linear-gradient(135deg, #1a1c2a, #23253a);
    border-radius: 10px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3);
    z-index: 1000;
    backdrop-filter: blur(10px);
    overflow: hidden;
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.quest-panel.hidden {
    opacity: 0 !important;
    transform: translateX(350px) !important;
    pointer-events: none !important;
    visibility: hidden !important;
}

/* Force show state */
.quest-panel:not(.hidden) {
    opacity: 1;
    transform: translateX(0);
    pointer-events: auto;
    visibility: visible;
}

.quest-header {
    background: linear-gradient(135deg, #5463ff, #ff6b6b);
    padding: 20px;
    color: white;
    text-align: center;
    position: relative;
    overflow: hidden;
}

.quest-header::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.1), transparent);
    animation: questHeaderShine 3s infinite;
}

@keyframes questHeaderShine {
    0% { left: -100%; }
    100% { left: 100%; }
}

.quest-header h2 {
    margin: 0 0 5px 0;
    font-size: 1.4rem;
    font-weight: 700;
}

.quest-header p {
    margin: 0;
    font-size: 0.9rem;
    opacity: 0.9;
}

.quest-close-btn {
    position: absolute;
    top: 15px;
    right: 15px;
    background: rgba(255, 255, 255, 0.1);
    border: none;
    color: white;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.quest-close-btn:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: rotate(90deg);
}

.quest-content {
    max-height: calc(100vh - 240px);
    overflow-y: auto;
    padding: 0;
}

.quest-content::-webkit-scrollbar {
    width: 6px;
}

.quest-content::-webkit-scrollbar-track {
    background: var(--bg-hover);
}

.quest-content::-webkit-scrollbar-thumb {
    background: var(--primary);
    border-radius: 3px;
}

.quest-content::-webkit-scrollbar-thumb:hover {
    background: var(--primary-light);
}

.quest-loading {
    padding: 40px 20px;
    text-align: center;
    color: var(--neutral-400);
}

.quest-loading .loader {
    width: 30px;
    height: 30px;
    border: 3px solid var(--neutral-700);
    border-top: 3px solid var(--primary);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 15px;
}

.quest-empty {
    padding: 40px 20px;
    text-align: center;
    color: var(--neutral-400);
}

.quest-empty p {
    margin: 0;
    font-size: 0.95rem;
}

.quest-list {
    padding: 10px;
}

.quest-item {
    background: var(--bg-card);
    border-radius: var(--radius-sm);
    padding: 15px;
    margin-bottom: 10px;
    border: 1px solid var(--border-light);
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.quest-item:hover {
    background: var(--bg-hover);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.quest-item.completed {
    background: linear-gradient(135deg, rgba(74, 222, 128, 0.1), rgba(34, 197, 94, 0.1));
    border-color: var(--easy);
}

.quest-item.completed::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 4px;
    height: 100%;
    background: var(--easy);
}

.quest-item.can-claim {
    background: linear-gradient(135deg, rgba(255, 189, 0, 0.1), rgba(255, 140, 0, 0.1));
    border-color: var(--legendary);
    animation: questClaimPulse 2s ease-in-out infinite;
}

@keyframes questClaimPulse {
    0%, 100% { box-shadow: 0 0 10px rgba(255, 189, 0, 0.2); }
    50% { box-shadow: 0 0 20px rgba(255, 189, 0, 0.4); }
}

.quest-header-info {
    display: flex;
    align-items: center;
    margin-bottom: 10px;
}

.quest-icon {
    font-size: 1.5rem;
    margin-right: 10px;
    width: 35px;
    height: 35px;
    background: var(--bg-hover);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--border-light);
}

.quest-info {
    flex: 1;
}

.quest-title {
    font-size: 1rem;
    font-weight: 600;
    color: var(--neutral-100);
    margin: 0 0 3px 0;
}

.quest-character {
    font-size: 0.8rem;
    color: var(--primary-light);
    font-weight: 500;
}

.quest-description {
    font-size: 0.85rem;
    color: var(--neutral-300);
    margin: 8px 0 12px 0;
    line-height: 1.4;
}

.quest-progress-container {
    margin-bottom: 10px;
}

.quest-progress-bar {
    background: var(--neutral-700);
    border-radius: 10px;
    height: 8px;
    overflow: hidden;
    position: relative;
}

.quest-progress-fill {
    background: linear-gradient(90deg, var(--primary), var(--primary-light));
    height: 100%;
    border-radius: 10px;
    transition: width 0.5s ease;
    position: relative;
    overflow: hidden;
}

.quest-progress-fill::after {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.2), transparent);
}

.quest-progress-text {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 5px;
}

.quest-progress-numbers {
    font-size: 0.8rem;
    color: var(--neutral-400);
    font-weight: 500;
}

.quest-progress-percentage {
    font-size: 0.8rem;
    color: var(--primary-light);
    font-weight: 600;
}

.quest-rewards {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-top: 10px;
}

.quest-reward {
    background: var(--bg-hover);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-sm);
    padding: 4px 8px;
    font-size: 0.75rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 4px;
}

.quest-reward.xp {
    color: var(--easy);
    border-color: var(--easy);
}

.quest-reward.talent-points {
    color: var(--epic);
    border-color: var(--epic);
}

.quest-reward.character-choice {
    color: var(--legendary);
    border-color: var(--legendary);
}

.quest-claim-section {
    margin-top: 10px;
    text-align: center;
}

.quest-claim-button {
    background: linear-gradient(135deg, var(--legendary), #ff8c00);
    border: none;
    border-radius: var(--radius-sm);
    color: white;
    font-size: 0.8rem;
    font-weight: 600;
    padding: 8px 16px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-family: 'Montserrat', sans-serif;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.quest-claim-button:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(255, 189, 0, 0.3);
    background: linear-gradient(135deg, #ff8c00, var(--legendary));
}

.quest-toggle {
    position: fixed;
    bottom: 20px;
    right: 20px;
    width: 50px;
    height: 50px;
    background: linear-gradient(135deg, #5463ff, #ff6b6b);
    border: none;
    border-radius: 50%;
    color: white;
    font-size: 1.5rem;
    cursor: pointer;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.2);
    transition: all 0.3s ease;
    z-index: 999;
    display: flex;
    align-items: center;
    justify-content: center;
}

.quest-toggle:hover {
    transform: translateY(-2px) scale(1.05);
    box-shadow: 0 8px 25px rgba(84, 99, 255, 0.3);
}

.quest-toggle:active {
    transform: translateY(0) scale(1);
}

/* Mobile responsiveness */
@media (max-width: 768px) {
    .quest-panel {
        width: calc(100vw - 40px);
        right: 20px;
        left: 20px;
        top: 100px;
    }
    
    .quest-toggle {
        bottom: 80px;
        right: 20px;
    }
}

@media (max-width: 480px) {
    .quest-panel {
        width: calc(100vw - 20px);
        right: 10px;
        left: 10px;
        top: 80px;
    }
    
    .quest-item {
        padding: 12px;
    }
    
    .quest-title {
        font-size: 0.9rem;
    }
    
    .quest-description {
        font-size: 0.8rem;
    }
}

/* Difficulty Category Styles */
.difficulty-category-header {
    margin: 40px 0 25px 0;
    position: relative;
    overflow: hidden;
}

.difficulty-category-header:first-child {
    margin-top: 0;
}

.category-title {
    display: flex;
    align-items: center;
    gap: 15px;
    font-size: 1.6rem;
    font-weight: 700;
    color: var(--neutral-100);
    margin: 0 0 10px 0;
    font-family: 'Orbitron', sans-serif;
    text-transform: uppercase;
    letter-spacing: 1px;
    position: relative;
}

.category-icon {
    width: 45px;
    height: 45px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    font-weight: 800;
    color: white;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
    position: relative;
    overflow: hidden;
}

.category-icon::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.2), transparent);
    animation: iconShine 3s infinite;
}

@keyframes iconShine {
    0% { left: -100%; }
    100% { left: 100%; }
}

.category-description {
    font-size: 0.95rem;
    color: var(--neutral-400);
    margin: 0 0 20px 0;
    font-style: italic;
    padding-left: 60px;
}

.category-divider {
    width: 100%;
    height: 2px;
    background: linear-gradient(90deg, transparent, var(--border-light), transparent);
    margin-top: 15px;
}

.category-stories-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 20px;
    margin-bottom: 50px;
    padding: 0 10px;
}

.category-stories-grid .story-container {
    min-height: 160px;
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    border-radius: 12px;
    overflow: hidden;
    position: relative;
}

.category-stories-grid .story-container::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: var(--border-light);
    transition: all 0.3s ease;
}

.category-stories-grid .story-container:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.2);
}

/* Difficulty-specific styling */
.difficulty-category-header.novice .category-icon {
    background: linear-gradient(135deg, #10b981, #059669);
}

.difficulty-category-header.novice .category-icon::after {
    content: 'I';
}

.difficulty-category-header.novice .category-title {
    color: #10b981;
}

.difficulty-category-header.novice + .category-stories-grid .story-container::before {
    background: linear-gradient(90deg, #10b981, #059669);
}

.difficulty-category-header.heroic .category-icon {
    background: linear-gradient(135deg, #f59e0b, #d97706);
}

.difficulty-category-header.heroic .category-icon::after {
    content: 'II';
}

.difficulty-category-header.heroic .category-title {
    color: #f59e0b;
}

.difficulty-category-header.heroic + .category-stories-grid .story-container::before {
    background: linear-gradient(90deg, #f59e0b, #d97706);
}

.difficulty-category-header.legendary .category-icon {
    background: linear-gradient(135deg, #8b5cf6, #7c3aed);
}

.difficulty-category-header.legendary .category-icon::after {
    content: 'III';
}

.difficulty-category-header.legendary .category-title {
    color: #8b5cf6;
}

.difficulty-category-header.legendary + .category-stories-grid .story-container::before {
    background: linear-gradient(90deg, #8b5cf6, #7c3aed);
}

.difficulty-category-header.master .category-icon {
    background: linear-gradient(135deg, #ef4444, #dc2626);
}

.difficulty-category-header.master .category-icon::after {
    content: 'IV';
}

.difficulty-category-header.master .category-title {
    color: #ef4444;
}

.difficulty-category-header.master + .category-stories-grid .story-container::before {
    background: linear-gradient(90deg, #ef4444, #dc2626);
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .category-stories-grid {
        grid-template-columns: 1fr;
        gap: 15px;
        padding: 0 5px;
    }
    
    .category-title {
        font-size: 1.4rem;
        gap: 12px;
    }
    
    .category-icon {
        width: 35px;
        height: 35px;
        font-size: 1rem;
    }
    
    .category-description {
        padding-left: 47px;
        font-size: 0.9rem;
    }
}

@media (max-width: 480px) {
    .difficulty-category-header {
        margin: 30px 0 20px 0;
    }
    
    .category-title {
        font-size: 1.2rem;
        gap: 10px;
    }
    
    .category-icon {
        width: 30px;
        height: 30px;
        font-size: 0.9rem;
    }
    
    .category-description {
        padding-left: 40px;
        font-size: 0.85rem;
    }
    
    .category-stories-grid {
        margin-bottom: 35px;
    }
}

/* Patch 0.2 Changelog Styling */
.change-highlight {
    color: var(--legendary);
    font-weight: 700;
    background: linear-gradient(135deg, rgba(255, 189, 0, 0.15), rgba(255, 140, 0, 0.1));
    padding: 2px 4px;
    border-radius: 3px;
    border: 1px solid rgba(255, 189, 0, 0.3);
}

.gameplay-section,
.new-character-section {
    margin-top: 2rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--border-light);
}

.gameplay-section h3,
.new-character-section h3 {
    color: var(--primary-light);
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    gap: 8px;
}

.improvement-item {
    background: var(--bg-card);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-md);
    padding: 1.5rem;
    margin-bottom: 1rem;
}

.improvement-item h4 {
    color: var(--neutral-100);
    font-size: 1.1rem;
    margin-bottom: 0.5rem;
    display: flex;
    align-items: center;
    gap: 6px;
}

.character-changes.julia,
.character-changes.multiple,
.character-changes.ibuki {
    border-left: 3px solid var(--primary);
}

.character-changes.julia .character-name {
    background: linear-gradient(135deg, rgba(76, 175, 80, 0.15), rgba(139, 195, 74, 0.1));
}

.character-changes.multiple .character-name {
    background: linear-gradient(135deg, rgba(156, 39, 176, 0.15), rgba(103, 58, 183, 0.1));
}

.character-changes.ibuki .character-name {
    background: linear-gradient(135deg, rgba(96, 125, 139, 0.15), rgba(69, 90, 100, 0.1));
}