/* Credits Screen - Cyberpunk Theme */
#credits {
    display: none; /* Hidden by default */
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 50;
}

/* Animated background with cyberpunk grid */
.credits-bg {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, #1a0030 0%, #0a0015 100%);
    overflow: hidden;
}

/* Grid lines overlay */
.credits-bg::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: 
        repeating-linear-gradient(
            0deg,
            transparent,
            transparent 39px,
            rgba(0, 255, 255, 0.15) 39px,
            rgba(0, 255, 255, 0.15) 40px
        ),
        repeating-linear-gradient(
            90deg,
            transparent,
            transparent 39px,
            rgba(0, 255, 255, 0.15) 39px,
            rgba(0, 255, 255, 0.15) 40px
        );
    background-size: 100% 100%;
    pointer-events: none;
    animation: gridScroll 8s linear infinite;
}

@keyframes gridScroll {
    0% { background-position: 0 0; }
    100% { background-position: 40px 40px; }
}

/* Scanlines effect */
.credits-bg::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: repeating-linear-gradient(
        0deg,
        rgba(0, 255, 255, 0.02) 0px,
        rgba(0, 255, 255, 0.02) 2px,
        transparent 2px,
        transparent 4px
    );
    pointer-events: none;
}

/* Particles canvas */
#credits-particles {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
}

/* Credits content container */
.credits-content {
    position: relative;
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding-top: calc(60px * var(--ui-scale));
}

/* Title with neon glow and glitch effect */
.credits-title {
    position: relative;
    margin: 0;
    margin-bottom: calc(30px * var(--ui-scale));
}

.credits-title .title-main {
    display: block;
    font-family: monospace;
    font-size: calc(48px * var(--ui-scale));
    font-weight: bold;
    color: #00ffff;
    text-shadow: 
        0 0 10px #00ffff,
        0 0 20px #00ffff,
        0 0 30px #00ffff;
    animation: neonPulse 2s ease-in-out infinite;
}

.credits-title .title-glitch {
    position: absolute;
    top: -2px;
    left: 3px;
    font-family: monospace;
    font-size: calc(48px * var(--ui-scale));
    font-weight: bold;
    color: #ff0099;
    opacity: 0.3;
    pointer-events: none;
}

@keyframes neonPulse {
    0%, 100% { 
        text-shadow: 
            0 0 10px #00ffff,
            0 0 20px #00ffff,
            0 0 30px #00ffff;
    }
    50% { 
        text-shadow: 
            0 0 20px #00ffff,
            0 0 30px #00ffff,
            0 0 40px #00ffff,
            0 0 50px #00ffff;
    }
}

/* Scrollable credits container */
.credits-scroll {
    width: calc(600px * var(--ui-scale));
    max-height: calc(420px * var(--ui-scale));
    overflow-y: auto;
    padding: calc(30px * var(--ui-scale));
    background: rgba(10, 0, 32, 0.8);
    border: calc(3px * var(--ui-scale)) solid #00ffff;
    border-radius: calc(12px * var(--ui-scale));
    box-shadow: 
        0 0 calc(20px * var(--ui-scale)) rgba(0, 255, 255, 0.3),
        inset 0 0 calc(30px * var(--ui-scale)) rgba(0, 255, 255, 0.05);
}

/* Credits sections */
.credits-section {
    margin-bottom: calc(40px * var(--ui-scale));
    padding-bottom: calc(20px * var(--ui-scale));
    border-bottom: calc(1px * var(--ui-scale)) solid rgba(0, 255, 255, 0.2);
}

.credits-section:last-child {
    border-bottom: none;
}

.credits-category {
    font-family: monospace;
    font-size: calc(20px * var(--ui-scale));
    font-weight: bold;
    color: #00ffff;
    margin: 0;
    margin-bottom: calc(15px * var(--ui-scale));
    text-shadow: 0 0 calc(10px * var(--ui-scale)) #00ffff;
    text-transform: uppercase;
    letter-spacing: calc(2px * var(--ui-scale));
}

.credits-text {
    font-family: monospace;
    font-size: calc(16px * var(--ui-scale));
    color: #ffffff;
    margin: calc(8px * var(--ui-scale)) 0;
    line-height: 1.6;
    padding-left: calc(20px * var(--ui-scale));
}

.credits-subtext {
    font-family: monospace;
    font-size: calc(14px * var(--ui-scale));
    color: rgba(255, 255, 255, 0.6);
    margin: calc(5px * var(--ui-scale)) 0;
    padding-left: calc(20px * var(--ui-scale));
    font-style: italic;
}

/* Footer text section */
.credits-footer-text {
    margin-top: calc(30px * var(--ui-scale));
    padding-top: calc(20px * var(--ui-scale));
    border-top: calc(2px * var(--ui-scale)) solid rgba(255, 0, 255, 0.3);
    text-align: center;
}

.credits-footer-text p {
    font-family: monospace;
    font-size: calc(14px * var(--ui-scale));
    color: #ff00ff;
    margin: calc(8px * var(--ui-scale)) 0;
    text-shadow: 0 0 calc(8px * var(--ui-scale)) #ff00ff;
}

/* Back Button */
.credits-back-btn {
    margin-top: calc(30px * var(--ui-scale));
    width: calc(200px * var(--ui-scale));
    height: calc(50px * var(--ui-scale));
    font-family: monospace;
    font-size: calc(18px * var(--ui-scale));
    font-weight: bold;
    color: #ff00ff;
    background: rgba(10, 0, 32, 0.8);
    border: calc(3px * var(--ui-scale)) solid #ff00ff;
    border-radius: calc(8px * var(--ui-scale));
    cursor: pointer;
    transition: all 0.3s ease;
    text-shadow: 0 0 calc(5px * var(--ui-scale)) #ff00ff;
    box-shadow: 
        0 0 calc(10px * var(--ui-scale)) rgba(255, 0, 255, 0.3),
        inset 0 0 calc(20px * var(--ui-scale)) rgba(255, 0, 255, 0.1);
}

.credits-back-btn:hover {
    background: rgba(255, 0, 255, 0.2);
    transform: scale(1.05);
    box-shadow: 
        0 0 calc(20px * var(--ui-scale)) rgba(255, 0, 255, 0.5),
        inset 0 0 calc(30px * var(--ui-scale)) rgba(255, 0, 255, 0.2);
}

.credits-back-btn:active {
    transform: scale(0.98);
}

/* Animations for credits text */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(calc(20px * var(--ui-scale)));
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.credits-section {
    opacity: 0; /* DODAJ TO - ukryje sekcje przed animacją */
    animation: fadeInUp 0.6s ease-out forwards;
}

.credits-section:nth-child(1) { animation-delay: 0.1s; }
.credits-section:nth-child(2) { animation-delay: 0.2s; }
.credits-section:nth-child(3) { animation-delay: 0.3s; }
.credits-section:nth-child(4) { animation-delay: 0.4s; }
.credits-section:nth-child(5) { animation-delay: 0.5s; }