/* ==========================================================================
   STORY LOG — Narrative panel
   ========================================================================== */

/* Floating Story Log Panel */
.story-log-toggle {
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 500;
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: linear-gradient(135deg, #1a1a2e, #16213e);
    color: #e0d5c1;
    border: 2px solid #c9a84c;
    font-size: 20px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 20px rgba(0,0,0,0.5);
    transition: all 0.3s;
}
.story-log-toggle:hover {
    background: linear-gradient(135deg, #2a2a4e, #26315e);
    border-color: #ffd700;
    transform: scale(1.1);
}
.story-log-toggle .unread-badge {
    position: absolute;
    top: -4px;
    right: -4px;
    background: #cc3333;
    color: white;
    border-radius: 50%;
    width: 18px;
    height: 18px;
    font-size: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
}

#story-log-panel {
    position: fixed;
    bottom: 80px;
    right: 20px;
    width: 380px;
    max-height: 420px;
    background: linear-gradient(180deg, rgba(20,18,30,0.97), rgba(10,8,16,0.97));
    border: 1px solid rgba(201,168,76,0.3);
    border-radius: 12px;
    z-index: 499;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    box-shadow: 0 8px 40px rgba(0,0,0,0.7);
    backdrop-filter: blur(8px);
    transition: all 0.35s cubic-bezier(0.4, 0, 0.2, 1);
    opacity: 1;
    transform: translateY(0);
}
#story-log-panel.collapsed {
    opacity: 0;
    transform: translateY(20px);
    pointer-events: none;
}

.story-log-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 14px;
    border-bottom: 1px solid rgba(201,168,76,0.2);
    background: rgba(0,0,0,0.3);
    cursor: pointer;
    user-select: none;
    flex-shrink: 0;
}
.story-log-header .header-left {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    font-weight: 600;
    color: #c9a84c;
    letter-spacing: 0.5px;
}
.story-log-header .header-left .material-symbols-outlined {
    font-size: 18px;
}

#story-log-entries {
    flex: 1;
    overflow-y: auto;
    padding: 8px 12px;
    min-height: 100px;
    max-height: 340px;
    scroll-behavior: smooth;
}
#story-log-entries::-webkit-scrollbar {
    width: 4px;
}
#story-log-entries::-webkit-scrollbar-track {
    background: transparent;
}
#story-log-entries::-webkit-scrollbar-thumb {
    background: rgba(201,168,76,0.3);
    border-radius: 2px;
}

.story-entry {
    display: flex;
    gap: 8px;
    padding: 6px 8px;
    margin-bottom: 4px;
    border-radius: 6px;
    font-size: 13px;
    line-height: 1.4;
    animation: storyFadeIn 0.3s ease-out;
    transition: background 0.2s;
}
.story-entry:hover {
    background: rgba(255,255,255,0.04);
}

@keyframes storyFadeIn {
    from { opacity: 0; transform: translateY(8px); }
    to { opacity: 1; transform: translateY(0); }
}

.story-entry .story-icon {
    flex-shrink: 0;
    font-size: 16px;
    width: 20px;
    text-align: center;
    margin-top: 1px;
}
.story-entry .story-text {
    color: #c8c0b0;
    flex: 1;
}
.story-entry .story-text strong {
    color: #e0d5c1;
}

/* Type-based styling */
.story-entry.important .story-text {
    color: #e8d48b;
}
.story-entry.important .story-icon {
    filter: brightness(1.2);
}

.story-entry.discovery .story-text {
    color: #7ec8e3;
}
.story-entry.discovery .story-icon {
    filter: brightness(1.2);
}

.story-entry.danger .story-text {
    color: #e87461;
}
.story-entry.danger .story-icon {
    filter: brightness(1.2);
}

.story-entry.combat .story-text {
    color: #e8a87c;
}

/* ==========================================================================
   BOSS INTRO OVERLAY
   ========================================================================== */
#boss-intro-overlay {
    position: fixed;
    top: 0; left: 0; width: 100%; height: 100%;
    z-index: 9000;
    display: flex;
    align-items: center;
    justify-content: center;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.6s ease;
    background: rgba(0,0,0,0.6);
}
#boss-intro-overlay.active {
    opacity: 1;
}

.boss-intro-content {
    text-align: center;
    padding: 40px 60px;
    background: linear-gradient(135deg, rgba(40,20,20,0.95), rgba(20,10,10,0.95));
    border: 2px solid #cc3333;
    border-radius: 16px;
    box-shadow: 0 0 60px rgba(200,0,0,0.3);
    max-width: 480px;
    animation: bossIntroPulse 0.6s ease-out;
}

@keyframes bossIntroPulse {
    from { transform: scale(0.7); opacity: 0; }
    to { transform: scale(1); opacity: 1; }
}

.boss-intro-skull {
    font-size: 64px;
    margin-bottom: 8px;
    animation: bossSkullFloat 1.5s ease-in-out infinite;
}
@keyframes bossSkullFloat {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-8px); }
}

.boss-intro-title {
    font-size: 14px;
    text-transform: uppercase;
    letter-spacing: 6px;
    color: #cc3333;
    margin-bottom: 8px;
    font-weight: 700;
}
.boss-intro-name {
    font-size: 28px;
    font-weight: 700;
    color: #ff4444;
    margin-bottom: 12px;
    text-shadow: 0 0 20px rgba(255,0,0,0.4);
}
.boss-intro-desc {
    font-size: 14px;
    color: #cc9999;
    margin-bottom: 16px;
    line-height: 1.5;
}
.boss-intro-prompt {
    font-size: 12px;
    color: #ff6666;
    letter-spacing: 2px;
    text-transform: uppercase;
    animation: bossFlash 1s ease-in-out infinite;
}
@keyframes bossFlash {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.4; }
}
