.streak-panel {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 9999;
    display: none;
    pointer-events: none;
}

.streak-panel.active {
    display: block;
    pointer-events: all;
}

.streak-panel.closing {
    pointer-events: none;
}

.streak-panel-overlay {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.streak-panel.active .streak-panel-overlay {
    opacity: 1;
    animation: overlayFadeIn 0.3s ease-out;
}

.streak-panel.closing .streak-panel-overlay {
    opacity: 0;
    animation: overlayFadeOut 0.3s ease-out;
}

@keyframes overlayFadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

@keyframes overlayFadeOut {
    from {
        opacity: 1;
    }
    to {
        opacity: 0;
    }
}

.streak-panel-content {
    position: absolute;
    top: 60px;
    right: 20px;
    width: 340px;
    max-width: calc(100vw - 40px);
    background: #1a1d21;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 16px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
    transform: translateY(-30px) scale(0.9);
    opacity: 0;
    transition: all 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.streak-panel.active .streak-panel-content {
    transform: translateY(0) scale(1);
    opacity: 1;
    animation: panelSlideDown 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.streak-panel.closing .streak-panel-content {
    transform: translateY(-30px) scale(0.9);
    opacity: 0;
    animation: panelSlideUp 0.3s ease-out;
}

@keyframes panelSlideDown {
    0% {
        transform: translateY(-30px) scale(0.9) rotateX(-10deg);
        opacity: 0;
    }
    60% {
        transform: translateY(5px) scale(1.02) rotateX(2deg);
    }
    100% {
        transform: translateY(0) scale(1) rotateX(0deg);
        opacity: 1;
    }
}

@keyframes panelSlideUp {
    0% {
        transform: translateY(0) scale(1) rotateX(0deg);
        opacity: 1;
    }
    100% {
        transform: translateY(-30px) scale(0.9) rotateX(-10deg);
        opacity: 0;
    }
}

.streak-panel-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.streak-panel-header h3 {
    font-size: 16px;
    font-weight: 700;
    color: #fff;
    margin: 0;
}

.streak-panel-close {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    color: rgba(255, 255, 255, 0.6);
    cursor: pointer;
    transition: all 0.2s ease;
}

.streak-panel-close:hover {
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
    transform: rotate(90deg);
}

.streak-panel-close:active {
    transform: rotate(90deg) scale(0.9);
}

.streak-panel-close svg {
    width: 18px;
    height: 18px;
    transition: transform 0.2s ease;
}

.streak-panel-body {
    padding: 24px 20px;
}

.streak-status {
    text-align: center;
    padding: 8px 16px;
    border-radius: 8px;
    margin-bottom: 16px;
}

.streak-status.alive {
    background: linear-gradient(135deg, rgba(251, 191, 36, 0.2), rgba(239, 68, 68, 0.15));
    border: 1px solid rgba(251, 191, 36, 0.4);
}

.streak-status.grace {
    background: linear-gradient(135deg, rgba(156, 163, 175, 0.2), rgba(107, 114, 128, 0.15));
    border: 1px solid rgba(156, 163, 175, 0.4);
}

.streak-status.dead {
    background: rgba(107, 114, 128, 0.15);
    border: 1px solid rgba(107, 114, 128, 0.3);
}

.status-text {
    font-size: 12px;
    font-weight: 900;
    letter-spacing: 1px;
}

.streak-status.alive .status-text {
    background: linear-gradient(135deg, #fbbf24, #f59e0b, #ef4444);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    animation: statusPulse 2s ease-in-out infinite;
}

.streak-status.grace .status-text {
    color: #9ca3af;
    animation: statusPulse 2s ease-in-out infinite;
}

.streak-status.dead .status-text {
    color: #6b7280;
}

@keyframes statusPulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.7; }
}

.streak-display {
    text-align: center;
    margin-bottom: 24px;
}

.streak-fire {
    width: 100px;
    height: 100px;
    margin: 0 auto 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
}

.streak-fire .fire-icon {
    width: 100px;
    height: 100px;
    object-fit: contain;
}

.streak-fire .fire-icon.active {
    filter: drop-shadow(0 0 20px rgba(251, 191, 36, 0.8)) 
            drop-shadow(0 0 40px rgba(239, 68, 68, 0.6))
            drop-shadow(0 0 60px rgba(245, 158, 11, 0.4));
    animation: intenseFireGlow 1.5s ease-in-out infinite alternate,
               fireFlicker 0.3s ease-in-out infinite,
               fireSway 3s ease-in-out infinite;
}

@keyframes intenseFireGlow {
    0% { 
        filter: drop-shadow(0 0 15px rgba(251, 191, 36, 0.7)) 
                drop-shadow(0 0 30px rgba(239, 68, 68, 0.5))
                drop-shadow(0 0 45px rgba(245, 158, 11, 0.3));
        transform: scale(1);
    }
    100% { 
        filter: drop-shadow(0 0 25px rgba(251, 191, 36, 1)) 
                drop-shadow(0 0 50px rgba(239, 68, 68, 0.8))
                drop-shadow(0 0 75px rgba(245, 158, 11, 0.6));
        transform: scale(1.05);
    }
}

@keyframes fireFlicker {
    0%, 100% { opacity: 1; }
    25% { opacity: 0.95; }
    50% { opacity: 1; }
    75% { opacity: 0.97; }
}

@keyframes fireSway {
    0%, 100% { transform: translateX(0) rotate(0deg); }
    25% { transform: translateX(-2px) rotate(-1deg); }
    50% { transform: translateX(0) rotate(0deg); }
    75% { transform: translateX(2px) rotate(1deg); }
}

.streak-fire .fire-icon.dead {
    filter: grayscale(100%) brightness(0.4);
    opacity: 0.5;
}

.streak-number {
    font-size: 48px;
    font-weight: 900;
    color: #fbbf24;
    line-height: 1;
    margin-bottom: 8px;
}

.streak-label {
    font-size: 14px;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.5);
}

.streak-start-hint {
    font-size: 12px;
    color: rgba(251, 191, 36, 0.7);
    margin: 12px 0 0;
    padding: 8px 12px;
    background: rgba(251, 191, 36, 0.1);
    border-radius: 8px;
}

.streak-stats {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    margin-bottom: 20px;
}

.streak-stat {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 12px;
    padding: 12px;
    text-align: center;
}

.stat-label {
    display: block;
    font-size: 11px;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.5);
    text-transform: uppercase;
    margin-bottom: 6px;
}

.stat-value {
    display: block;
    font-size: 18px;
    font-weight: 800;
    color: #fff;
}

.streak-restore {
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid rgba(239, 68, 68, 0.2);
    border-radius: 12px;
    padding: 16px;
    text-align: center;
}

.restore-message {
    font-size: 13px;
    color: rgba(255, 255, 255, 0.8);
    margin: 0 0 12px;
}

.restore-message.no-restores {
    margin: 0;
    color: rgba(255, 255, 255, 0.5);
}

.restore-streak-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    background: rgba(251, 191, 36, 0.15);
    border: 1px solid rgba(251, 191, 36, 0.3);
    border-radius: 10px;
    color: #fbbf24;
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s ease;
}

.restore-streak-btn svg {
    width: 16px;
    height: 16px;
}

.restore-streak-btn:hover {
    background: rgba(251, 191, 36, 0.25);
    border-color: rgba(251, 191, 36, 0.5);
    transform: translateY(-2px);
}

.streak-tip {
    display: flex;
    align-items: center;
    gap: 12px;
    background: rgba(59, 130, 246, 0.1);
    border: 1px solid rgba(59, 130, 246, 0.2);
    border-radius: 12px;
    padding: 12px;
}

.streak-tip svg {
    width: 20px;
    height: 20px;
    color: #3b82f6;
    flex-shrink: 0;
}

.streak-tip p {
    font-size: 13px;
    color: rgba(255, 255, 255, 0.7);
    margin: 0;
}

.streak-login-prompt {
    text-align: center;
    padding: 20px 0;
}

.streak-login-prompt svg {
    width: 64px;
    height: 64px;
    color: rgba(251, 191, 36, 0.3);
    margin-bottom: 16px;
}

.streak-login-prompt p {
    font-size: 14px;
    color: rgba(255, 255, 255, 0.6);
    margin: 0 0 16px;
}

.streak-signin-btn {
    padding: 10px 24px;
    background: rgba(251, 191, 36, 0.15);
    border: 1px solid rgba(251, 191, 36, 0.3);
    border-radius: 10px;
    color: #fbbf24;
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s ease;
}

.streak-signin-btn:hover {
    background: rgba(251, 191, 36, 0.25);
    border-color: rgba(251, 191, 36, 0.5);
}

@media (max-width: 768px) {
    .streak-panel-content {
        top: 56px;
        right: 10px;
        width: 320px;
    }
}

@media (min-width: 769px) {
    body.sidebar-visible .streak-panel-content {
        right: auto;
        left: 90px;
        top: 50%;
        transform: translateY(-50%) translateX(-40px) scale(0.9);
    }
    
    body.sidebar-visible .streak-panel.active .streak-panel-content {
        transform: translateY(-50%) translateX(0) scale(1);
        animation: panelSlideRight 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
    }
    
    body.sidebar-visible .streak-panel.closing .streak-panel-content {
        transform: translateY(-50%) translateX(-40px) scale(0.9);
        animation: panelSlideLeft 0.3s ease-out;
    }
}

@keyframes panelSlideRight {
    0% {
        transform: translateY(-50%) translateX(-40px) scale(0.9) rotateY(-10deg);
        opacity: 0;
    }
    60% {
        transform: translateY(-50%) translateX(5px) scale(1.02) rotateY(2deg);
    }
    100% {
        transform: translateY(-50%) translateX(0) scale(1) rotateY(0deg);
        opacity: 1;
    }
}

@keyframes panelSlideLeft {
    0% {
        transform: translateY(-50%) translateX(0) scale(1) rotateY(0deg);
        opacity: 1;
    }
    100% {
        transform: translateY(-50%) translateX(-40px) scale(0.9) rotateY(-10deg);
        opacity: 0;
    }
}
