/* Сброс стилей */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* Основные стили - VHS/Retrowave aesthetic */
body {
    background: linear-gradient(135deg, #1a0033 0%, #0d001a 50%, #1a0033 100%);
    background-attachment: fixed;
    color: #00ffff;
    font-family: 'Courier New', Courier, monospace;
    line-height: 1.6;
    padding: 20px;
    position: relative;
    min-height: 100vh;
    user-select: none;
}

/* VHS Scanlines эффект */
.scanlines {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: repeating-linear-gradient(
        0deg,
        rgba(0, 0, 0, 0.15),
        rgba(0, 0, 0, 0.15) 1px,
        transparent 1px,
        transparent 2px
    );
    pointer-events: none;
    z-index: 1000;
}

/* VHS эффект мерцания */
.vhs-effect {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(255, 0, 255, 0.02);
    pointer-events: none;
    z-index: 999;
    animation: vhs-flicker 0.1s infinite;
}

@keyframes vhs-flicker {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.95; }
}

/* Контейнер */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 40px 20px;
    position: relative;
    z-index: 1;
}

/* Заголовок с глитч-эффектом */
.header {
    text-align: center;
    margin-bottom: 40px;
}

.glitch {
    font-size: 3em;
    font-weight: bold;
    text-transform: uppercase;
    position: relative;
    text-shadow: 
        0.05em 0 0 rgba(255, 0, 0, 0.75),
        -0.025em -0.05em 0 rgba(0, 255, 0, 0.75),
        0.025em 0.05em 0 rgba(0, 0, 255, 0.75);
    animation: glitch 500ms infinite;
    letter-spacing: 0.1em;
}

.glitch::before,
.glitch::after {
    content: attr(data-text);
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

.glitch::before {
    left: 2px;
    text-shadow: -2px 0 #ff00ff;
    clip: rect(24px, 550px, 90px, 0);
    animation: glitch-anim 3s infinite linear alternate-reverse;
}

.glitch::after {
    left: -2px;
    text-shadow: -2px 0 #00ffff;
    clip: rect(85px, 550px, 140px, 0);
    animation: glitch-anim 2.5s infinite linear alternate-reverse;
}

@keyframes glitch {
    0%, 100% { text-shadow: 0.05em 0 0 rgba(255, 0, 0, 0.75),
                            -0.025em -0.05em 0 rgba(0, 255, 0, 0.75),
                            0.025em 0.05em 0 rgba(0, 0, 255, 0.75); }
    25% { text-shadow: -0.05em -0.025em 0 rgba(255, 0, 0, 0.75),
                        0.025em 0.025em 0 rgba(0, 255, 0, 0.75),
                        -0.05em -0.05em 0 rgba(0, 0, 255, 0.75); }
    50% { text-shadow: 0.025em 0.05em 0 rgba(255, 0, 0, 0.75),
                        0.05em 0 0 rgba(0, 255, 0, 0.75),
                        0 -0.05em 0 rgba(0, 0, 255, 0.75); }
    75% { text-shadow: -0.025em 0 0 rgba(255, 0, 0, 0.75),
                        -0.025em -0.025em 0 rgba(0, 255, 0, 0.75),
                        -0.025em -0.05em 0 rgba(0, 0, 255, 0.75); }
}

@keyframes glitch-anim {
    0% { clip: rect(random(100) + px, 9999px, random(100) + px, 0); }
    5% { clip: rect(random(100) + px, 9999px, random(100) + px, 0); }
    10% { clip: rect(random(100) + px, 9999px, random(100) + px, 0); }
    15% { clip: rect(random(100) + px, 9999px, random(100) + px, 0); }
    20% { clip: rect(random(100) + px, 9999px, random(100) + px, 0); }
    100% { clip: rect(random(100) + px, 9999px, random(100) + px, 0); }
}

/* Описание */
.description {
    text-align: center;
    font-size: 1.3em;
    margin: 40px 0;
    line-height: 1.8;
    color: #ff00ff;
    text-shadow: 0 0 10px rgba(255, 0, 255, 0.5);
}

/* Счётчик дискет */
.counter {
    text-align: center;
    margin: 30px 0 50px 0;
    font-size: 1.5em;
    padding: 15px;
    background: rgba(0, 255, 255, 0.1);
    border: 2px solid #00ffff;
    box-shadow: 
        0 0 20px rgba(0, 255, 255, 0.3),
        inset 0 0 20px rgba(0, 255, 255, 0.1);
}

.found-count {
    color: #00ff00;
    font-size: 1.3em;
    text-shadow: 0 0 10px rgba(0, 255, 0, 0.7);
}

.total-count {
    color: #ff00ff;
}

/* Сетка с дискетами */
.diskety-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 25px;
    margin: 50px 0;
    padding: 20px;
}

/* Карточка дискеты */
.disketa-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-decoration: none;
    transition: transform 0.3s, box-shadow 0.3s;
    cursor: pointer;
}

.disketa-card.available:hover {
    transform: translateY(-10px) scale(1.05);
}

/* Иконка дискеты (CSS) */
.disketa-icon {
    width: 100px;
    height: 100px;
    background: linear-gradient(135deg, #00ffff 0%, #0099ff 100%);
    border: 3px solid #00ffff;
    border-radius: 8px;
    position: relative;
    box-shadow: 
        0 0 20px rgba(0, 255, 255, 0.5),
        inset 0 0 10px rgba(255, 255, 255, 0.2);
    transition: all 0.3s;
}

/* Детали дискеты */
.disketa-icon::before {
    content: '';
    position: absolute;
    top: 10px;
    left: 10px;
    right: 10px;
    height: 25px;
    background: rgba(0, 0, 0, 0.3);
    border-radius: 3px;
}

.disketa-icon::after {
    content: '';
    position: absolute;
    bottom: 15px;
    left: 50%;
    transform: translateX(-50%);
    width: 40px;
    height: 40px;
    background: rgba(0, 0, 0, 0.4);
    border-radius: 50%;
    border: 2px solid rgba(255, 255, 255, 0.3);
}

/* Эффект при наведении на доступную дискету */
.disketa-card.available:hover .disketa-icon {
    box-shadow: 
        0 0 40px rgba(0, 255, 255, 0.8),
        inset 0 0 20px rgba(255, 255, 255, 0.4);
    transform: rotate(5deg);
}

/* Недоступная дискета */
.disketa-card.unavailable {
    opacity: 0.4;
    cursor: not-allowed;
}

.disketa-icon.locked {
    background: linear-gradient(135deg, #666666 0%, #333333 100%);
    border-color: #666666;
    box-shadow: 0 0 10px rgba(102, 102, 102, 0.3);
}

/* Подпись под дискетой */
.disketa-label {
    margin-top: 15px;
    font-size: 0.9em;
    text-align: center;
    color: #00ffff;
    text-shadow: 0 0 5px rgba(0, 255, 255, 0.5);
    font-weight: bold;
}

.disketa-card.available:hover .disketa-label {
    color: #ffffff;
    text-shadow: 0 0 10px rgba(255, 255, 255, 0.8);
    animation: glitch 500ms infinite;
}

.soon {
    font-size: 0.8em;
    color: #ff00ff;
    font-style: italic;
}

/* Ссылки внизу */
.links {
    display: flex;
    justify-content: center;
    gap: 30px;
    margin: 60px 0 40px 0;
    flex-wrap: wrap;
}

.link-btn {
    padding: 15px 40px;
    font-size: 1.1em;
    color: #00ffff;
    background: transparent;
    border: 2px solid #00ffff;
    text-decoration: none;
    font-weight: normal;
    letter-spacing: 1px;
    border-radius: 0;
    box-shadow: none;
    transition: all 0.3s;
    position: relative;
    text-transform: uppercase;
}

.link-btn:hover {
    background: #00ffff;
    color: #000000;
    box-shadow: 0 0 20px rgba(0, 255, 255, 0.6);
    transform: translateY(-2px);
}

/* PDF просмотрщик на страницах дискет - ИСПРАВЛЕНО */
.pdf-container {
    margin: 40px auto;
    border: 3px solid #00ffff;
    box-shadow: 0 0 30px rgba(0, 255, 255, 0.4);
    background: #ffffff;
    padding: 5px;
    width: calc(100% - 10px);
    max-width: 1200px;
}

.pdf-canvas-wrapper {
    background: #ffffff;
    display: block;
    overflow-x: auto;
    overflow-y: visible;
    padding: 5px;
    width: 100%;
    text-align: center;
}

#pdf-canvas {
    display: inline-block;
    max-width: 100%;
    height: auto !important;
    vertical-align: middle;
}

.pdf-controls {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 20px;
    margin-top: 20px;
    padding: 15px;
    background: rgba(0, 0, 0, 0.8);
    flex-wrap: wrap;
}

.pdf-controls button {
    padding: 10px 20px;
    background: #00ffff;
    border: none;
    color: #000000;
    font-family: 'Courier New', monospace;
    font-size: 1em;
    cursor: pointer;
    transition: all 0.3s;
    font-weight: bold;
}

.pdf-controls button:hover:not(:disabled) {
    background: #00ff00;
    box-shadow: 0 0 10px rgba(0, 255, 255, 0.6);
}

.pdf-controls button:disabled {
    opacity: 0.3;
    cursor: not-allowed;
}

.pdf-page-info {
    color: #00ffff;
    font-size: 1em;
}

.pdf-fallback {
    text-align: center;
    padding: 30px;
    font-size: 1.1em;
    background: rgba(0, 255, 255, 0.1);
    color: #000;
}

.pdf-fallback a {
    color: #000;
    text-decoration: underline;
    font-weight: bold;
}

.pdf-fallback a:hover {
    color: #00ff00;
}

/* Навигация между дискетами */
.navigation {
    display: flex;
    justify-content: space-between;
    margin: 40px 0;
    gap: 20px;
}

.nav-btn {
    flex: 1;
    padding: 20px 30px;
    text-align: center;
    font-size: 1.2em;
    color: #000000;
    background: linear-gradient(135deg, #00ffff 0%, #0099ff 100%);
    text-decoration: none;
    font-weight: bold;
    border-radius: 5px;
    box-shadow: 0 0 15px rgba(0, 255, 255, 0.4);
    transition: all 0.3s;
}

.nav-btn:hover {
    transform: scale(1.05);
    box-shadow: 0 0 30px rgba(0, 255, 255, 0.7);
}

/* Адаптивность для мобильных */
@media (max-width: 768px) {
    .glitch {
        font-size: 1.8em;
    }
    
    .description {
        font-size: 1em;
    }
    
    .diskety-grid {
        grid-template-columns: repeat(auto-fit, minmax(100px, 1fr));
        gap: 15px;
    }
    
    .disketa-icon {
        width: 80px;
        height: 80px;
    }
    
    .counter {
        font-size: 1.2em;
    }
    
    .links {
        flex-direction: column;
        gap: 15px;
    }
    
    .link-btn {
        width: 100%;
    }
    
    .pdf-container {
        margin: 20px auto;
        padding: 3px;
        width: calc(100% - 6px);
    }
    
    .pdf-canvas-wrapper {
        padding: 3px;
    }
    
    body {
        padding: 10px;
    }
    
    .container {
        padding: 20px 10px;
    }
}

@media (max-width: 480px) {
    .diskety-grid {
        grid-template-columns: repeat(3, 1fr);
    }
    
    .disketa-icon {
        width: 70px;
        height: 70px;
    }
    
    .disketa-label {
        font-size: 0.75em;
    }
    
    .pdf-container {
        padding: 5px;
    }
}

/* Футер с авторами и возрастным цензом */
.footer {
    margin-top: 80px;
    padding: 30px 20px;
    border-top: 1px solid rgba(0, 255, 255, 0.3);
    text-align: center;
    font-size: 0.9em;
    color: rgba(0, 255, 255, 0.6);
}

.footer-info {
    margin-bottom: 15px;
}

.footer-credits {
    margin: 10px 0;
    line-height: 1.8;
}

.age-rating {
    margin-top: 20px;
    font-size: 1.1em;
    color: #ff00ff;
    font-weight: bold;
}
