/* ==========================================
   ОСНОВНЫЕ СТИЛИ
   ========================================== */

:root {
    --primary-bg: #0a0a0a;
    --secondary-bg: #1a1a1a;
    --accent-red: #c41e3a;
    --accent-gold: #d4af37;
    --text-primary: #f0f0f0;
    --text-secondary: #b0b0b0;
    --border-color: #333;
    --success-green: #2ecc71;
    --error-red: #e74c3c;
    --shadow: 0 4px 20px rgba(196, 30, 58, 0.3);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Roboto Mono', 'Courier Prime', monospace;
    background-color: var(--primary-bg);
    color: var(--text-primary);
    line-height: 1.6;
    min-height: 100vh;
    background-image:
        repeating-linear-gradient(
            0deg,
            transparent,
            transparent 2px,
            rgba(255, 255, 255, 0.03) 2px,
            rgba(255, 255, 255, 0.03) 4px
        );
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

/* ==========================================
   HEADER
   ========================================== */

.header {
    text-align: center;
    padding: 40px 20px 20px 20px;
    margin-bottom: 40px;
    position: relative;
}

.header::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 100vw;
    height: 2px;
    background: var(--accent-red);
}

.crime-tape {
    background: repeating-linear-gradient(
        45deg,
        #ffeb3b,
        #ffeb3b 10px,
        #000 10px,
        #000 20px
    );
    color: white;
    padding: 12px;
    font-weight: bold;
    font-size: 1.53rem;
    letter-spacing: 3px;
    margin-bottom: 20px;
    animation: tape-pulse 2s ease-in-out infinite;
    position: relative;
    z-index: 10;
    width: 100vw;
    margin-left: calc(-50vw + 50%);
    text-shadow:
        -1px -1px 0 #000,
        1px -1px 0 #000,
        -1px 1px 0 #000,
        1px 1px 0 #000,
        0 0 10px rgba(0, 0, 0, 0.8);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.5);
}

@keyframes tape-pulse {
    0%, 100% {
        opacity: 1;
        transform: scaleY(1);
    }
    50% {
        opacity: 0.95;
        transform: scaleY(0.98);
    }
}

@keyframes float {
    0%, 100% {
        transform: translateY(0px);
    }
    50% {
        transform: translateY(-10px);
    }
}

@keyframes glow {
    0%, 100% {
        box-shadow: 0 0 5px rgba(196, 30, 58, 0.3);
    }
    50% {
        box-shadow: 0 0 20px rgba(196, 30, 58, 0.6), 0 0 30px rgba(196, 30, 58, 0.4);
    }
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    10%, 30%, 50%, 70%, 90% { transform: translateX(-2px); }
    20%, 40%, 60%, 80% { transform: translateX(2px); }
}

.title {
    font-size: 1.8rem;
    color: var(--accent-red);
    margin: 20px auto 16px auto;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.8);
    font-weight: 700;
    animation: glow 3s ease-in-out infinite;
    border: 2px solid var(--accent-red);
    padding: 20px;
    border-radius: 10px;
    background: rgba(196, 30, 58, 0.05);
    display: block;
    box-shadow: 0 0 20px rgba(196, 30, 58, 0.5);
    width: 900px;
    max-width: 95%;
    min-height: 80px;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
}

.title-icon {
    font-size: 2rem;
    vertical-align: middle;
    display: inline-block;
}

.subtitle {
    font-size: 1.2rem;
    color: var(--text-secondary);
    letter-spacing: 2px;
}

/* ==========================================
   NAVIGATION
   ========================================== */

.main-nav {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin-bottom: 40px;
}

.nav-card {
    background: var(--secondary-bg);
    border: 2px solid var(--border-color);
    border-radius: 10px;
    padding: 30px 20px;
    text-align: center;
    text-decoration: none;
    color: var(--text-primary);
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
    animation: card-appear 0.6s ease-out backwards;
}

@keyframes card-appear {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.nav-card:nth-child(1) { animation-delay: 0.1s; }
.nav-card:nth-child(2) { animation-delay: 0.2s; }
.nav-card:nth-child(3) { animation-delay: 0.3s; }
.nav-card:nth-child(4) { animation-delay: 0.4s; }

.nav-card:nth-child(1) .nav-icon { animation-delay: 0s; }
.nav-card:nth-child(2) .nav-icon { animation-delay: 0.5s; }
.nav-card:nth-child(3) .nav-icon { animation-delay: 1s; }
.nav-card:nth-child(4) .nav-icon { animation-delay: 1.5s; }

.nav-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(196, 30, 58, 0.2), transparent);
    transition: left 0.5s ease;
}

.nav-card:hover::before {
    left: 100%;
}

.nav-card:hover {
    border-color: var(--accent-red);
    box-shadow: var(--shadow);
    transform: translateY(-5px);
}

.nav-icon {
    font-size: 3rem;
    margin-bottom: 15px;
    display: inline-block;
}

@keyframes icon-bounce {
    0%, 100% {
        transform: translateY(0) scale(1);
    }
    50% {
        transform: translateY(-8px) scale(1.05);
    }
}

.nav-card h2 {
    font-size: 1.5rem;
    margin-bottom: 10px;
    color: var(--accent-gold);
}

.nav-card p {
    color: var(--text-secondary);
    font-size: 0.9rem;
}

/* ==========================================
   BACK BUTTON
   ========================================== */

.back-button {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    background: var(--secondary-bg);
    color: var(--text-primary);
    border: 2px solid var(--border-color);
    padding: 12px 24px;
    text-decoration: none;
    border-radius: 5px;
    margin-bottom: 30px;
    transition: all 0.3s ease;
    font-weight: 500;
}

.back-button:hover {
    border-color: var(--accent-red);
    background: var(--accent-red);
    color: white;
    transform: translateX(-5px);
}

/* ==========================================
   CONTENT SECTIONS
   ========================================== */

.content-section {
    background: var(--secondary-bg);
    border: 2px solid var(--border-color);
    border-radius: 10px;
    padding: 30px;
    margin-bottom: 30px;
}

.section-title {
    font-size: 2rem;
    color: var(--accent-red);
    margin-bottom: 20px;
    border-bottom: 2px solid var(--accent-gold);
    padding-bottom: 10px;
    animation: slide-in-left 0.6s ease-out;
}

@keyframes slide-in-left {
    from {
        opacity: 0;
        transform: translateX(-50px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* ==========================================
   LOCATIONS
   ========================================== */

.locations-grid {
    display: grid;
    gap: 15px;
}

.location-category {
    margin-bottom: 30px;
}

.category-title {
    font-size: 1.5rem;
    color: var(--accent-gold);
    margin-bottom: 20px;
    padding: 15px;
    background: rgba(212, 175, 55, 0.1);
    border-left: 4px solid var(--accent-gold);
    animation: fade-slide-up 0.5s ease-out;
}

@keyframes fade-slide-up {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.location-btn {
    width: 100%;
    background: var(--secondary-bg);
    border: 2px solid var(--border-color);
    color: var(--text-primary);
    padding: 20px;
    text-align: left;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 1.1rem;
    font-family: inherit;
    display: flex;
    align-items: center;
    gap: 15px;
}

.location-btn:hover {
    border-color: var(--accent-red);
    background: rgba(196, 30, 58, 0.1);
    transform: translateX(10px);
}

.location-icon {
    font-size: 1.5rem;
    min-width: 30px;
    display: inline-block;
}

@keyframes icon-glow {
    0%, 100% {
        opacity: 1;
        filter: brightness(1);
    }
    50% {
        opacity: 0.8;
        filter: brightness(1.3);
    }
}

.location-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.95);
    z-index: 1000;
    overflow-y: auto;
    padding: 20px;
}

.modal-content {
    max-width: 800px;
    margin: 50px auto;
    background: var(--secondary-bg);
    border: 3px solid var(--accent-red);
    border-radius: 15px;
    padding: 40px;
    position: relative;
    animation: slideIn 0.4s ease;
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(-30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.close-modal {
    position: absolute;
    top: 20px;
    right: 20px;
    font-size: 2rem;
    background: none;
    border: none;
    color: var(--accent-red);
    cursor: pointer;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.3s ease;
}

.close-modal:hover {
    background: var(--accent-red);
    color: white;
    transform: rotate(90deg);
}

.modal-title {
    font-size: 2rem;
    color: var(--accent-gold);
    margin-bottom: 25px;
}

.modal-text {
    font-size: 1.1rem;
    line-height: 1.8;
    color: var(--text-primary);
    margin-bottom: 20px;
}

.envelope-instruction {
    background: rgba(196, 30, 58, 0.2);
    border-left: 4px solid var(--accent-red);
    padding: 15px;
    margin: 20px 0;
    font-weight: bold;
    color: var(--accent-gold);
}

/* ==========================================
   AUDIO PLAYER
   ========================================== */

.audio-player {
    background: var(--primary-bg);
    border: 2px solid var(--accent-gold);
    border-radius: 10px;
    padding: 20px;
    margin: 25px 0;
}

.audio-title {
    color: var(--accent-gold);
    margin-bottom: 15px;
    font-size: 1.1rem;
}

audio {
    width: 100%;
    outline: none;
}

audio::-webkit-media-controls-panel {
    background-color: var(--secondary-bg);
}

audio::-webkit-media-controls-play-button,
audio::-webkit-media-controls-mute-button {
    background-color: var(--accent-red);
    border-radius: 50%;
}

.audio-error {
    margin-top: 12px;
    padding: 10px 12px;
    background: rgba(196, 30, 58, 0.15);
    border-left: 4px solid var(--accent-red);
    color: var(--accent-gold);
    font-weight: 600;
}

/* ==========================================
   HINTS
   ========================================== */

.hints-list {
    display: grid;
    gap: 15px;
}

.hint-btn {
    width: 100%;
    background: var(--secondary-bg);
    border: 2px solid var(--border-color);
    color: var(--text-primary);
    padding: 20px;
    text-align: left;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 1.1rem;
    font-family: inherit;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.hint-btn:hover {
    border-color: var(--accent-gold);
    background: rgba(212, 175, 55, 0.1);
}

.hint-arrow {
    transition: transform 0.3s ease;
}

.hint-content {
    display: none;
    background: rgba(212, 175, 55, 0.1);
    border-left: 4px solid var(--accent-gold);
    padding: 20px;
    margin-top: 10px;
    border-radius: 0 0 8px 8px;
    animation: fadeIn 0.3s ease;
}

.hint-content.active {
    display: block;
}

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

/* ==========================================
   QUIZ
   ========================================== */

.quiz-question {
    background: var(--secondary-bg);
    border: 2px solid var(--border-color);
    border-radius: 10px;
    padding: 25px;
    margin-bottom: 25px;
}

.question-text {
    font-size: 1.2rem;
    color: var(--accent-gold);
    margin-bottom: 20px;
    font-weight: 500;
}

.options-list {
    display: grid;
    gap: 10px;
}

.option-btn {
    width: 100%;
    background: var(--primary-bg);
    border: 2px solid var(--border-color);
    color: var(--text-primary);
    padding: 15px 20px;
    text-align: left;
    border-radius: 5px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 1rem;
    font-family: inherit;
}

.option-btn:hover:not(.correct):not(.incorrect) {
    border-color: var(--accent-gold);
    background: rgba(212, 175, 55, 0.1);
}

.option-btn.correct {
    background: var(--success-green);
    color: white;
    border-color: var(--success-green);
    font-weight: bold;
}

.option-btn.incorrect {
    background: var(--error-red);
    color: white;
    border-color: var(--error-red);
    opacity: 0.6;
}

.option-btn:disabled {
    cursor: not-allowed;
}

.final-envelope {
    display: none;
    background: linear-gradient(135deg, var(--accent-red), var(--accent-gold));
    border-radius: 15px;
    padding: 40px 30px;
    text-align: center;
    margin-top: 40px;
    animation: slideIn 0.5s ease, glow-pulse 2s ease-in-out infinite;
    box-shadow: 0 10px 40px rgba(196, 30, 58, 0.4);
    width: 100%;
    max-width: 100%;
}

@keyframes glow-pulse {
    0%, 100% {
        box-shadow: 0 10px 40px rgba(196, 30, 58, 0.4);
    }
    50% {
        box-shadow: 0 15px 60px rgba(196, 30, 58, 0.7);
    }
}

.final-envelope.visible {
    display: block;
}

.final-envelope h3 {
    font-size: 1.8rem;
    margin-bottom: 15px;
    color: white;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.5);
    word-wrap: break-word;
}

.final-envelope p {
    font-size: 1rem;
    line-height: 1.6;
    margin-bottom: 20px;
}

.final-envelope-btn {
    background: white;
    color: var(--accent-red);
    border: none;
    padding: 15px 40px;
    font-size: 1.2rem;
    font-weight: bold;
    border-radius: 5px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-family: inherit;
    animation: btn-pulse 1.5s ease-in-out infinite;
}

@keyframes btn-pulse {
    0%, 100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.05);
    }
}

.final-envelope-btn:hover {
    transform: scale(1.1);
    box-shadow: 0 5px 20px rgba(255, 255, 255, 0.3);
}

/* ==========================================
   INSTRUCTIONS
   ========================================== */

.instructions-content {
    line-height: 1.8;
}

.instructions-content h3 {
    color: var(--accent-gold);
    margin-top: 30px;
    margin-bottom: 15px;
    font-size: 1.5rem;
}

.instructions-content ul {
    list-style: none;
    padding-left: 0;
}

.instructions-content li {
    padding: 8px 0;
    padding-left: 25px;
    position: relative;
}

.instructions-content li::before {
    content: '▸';
    position: absolute;
    left: 0;
    color: var(--accent-red);
}

.envelope-section {
    background: rgba(196, 30, 58, 0.1);
    border-left: 4px solid var(--accent-red);
    padding: 20px;
    margin: 20px 0;
}

.envelope-section h4 {
    color: var(--accent-gold);
    margin-bottom: 10px;
}

/* ==========================================
   FOOTER
   ========================================== */

.footer {
    text-align: center;
    padding: 30px 20px;
    color: var(--text-secondary);
    border-top: 2px solid var(--border-color);
    margin-top: 50px;
    font-size: 0.9rem;
}

.footer p {
    margin-bottom: 10px;
}

.footer-link {
    display: inline-block;
    color: #6ecbff;
    text-decoration: none;
    font-weight: 500;
    transition: color 0.2s ease, text-shadow 0.2s ease;
}

.footer-link:hover,
.footer-link:focus {
    color: #a8e2ff;
    text-decoration: underline;
    text-shadow: 0 0 8px rgba(110, 203, 255, 0.35);
}

/* ==========================================
   GAME SELECTION
   ========================================== */

.game-selection-nav {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    gap: 30px;
    max-width: 900px;
    margin: 0 auto 40px auto;
}

.game-card {
    padding: 50px 30px;
}

.game-card .nav-icon {
    font-size: 4rem;
}

.game-card h2 {
    font-size: 1.8rem;
    margin-bottom: 15px;
}

.game-card p {
    font-size: 1rem;
    line-height: 1.6;
}

.game-card.disabled {
    opacity: 0.7;
    pointer-events: none;
}

/* ==========================================
   PHOTO GALLERY
   ========================================== */

.photo-gallery {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 20px;
}

.photo-item {
    position: relative;
    overflow: hidden;
    border-radius: 8px;
    border: 2px solid var(--border-color);
    cursor: pointer;
    transition: all 0.3s ease;
    aspect-ratio: 1;
}

.photo-item:hover {
    border-color: var(--accent-gold);
    transform: scale(1.05);
    box-shadow: 0 5px 20px rgba(212, 175, 55, 0.3);
}

.photo-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.photo-modal-content {
    max-width: 90vw;
    max-height: 90vh;
    padding: 20px;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.modal-photo {
    max-width: 100%;
    max-height: 70vh;
    object-fit: contain;
    border-radius: 8px;
}

.photo-navigation {
    display: flex;
    gap: 20px;
    margin-top: 20px;
}

.photo-nav-btn {
    background: var(--secondary-bg);
    color: var(--text-primary);
    border: 2px solid var(--accent-gold);
    padding: 12px 24px;
    border-radius: 5px;
    cursor: pointer;
    font-family: inherit;
    font-size: 1rem;
    transition: all 0.3s ease;
}

.photo-nav-btn:hover {
    background: var(--accent-gold);
    color: var(--primary-bg);
}

.photo-nav-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* ==========================================
   ACCUSATIONS
   ========================================== */

.accusations-container {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 30px;
}

.suspects-list {
    display: grid;
    gap: 15px;
}

.suspect-btn {
    width: 100%;
    background: var(--secondary-bg);
    border: 2px solid var(--border-color);
    color: var(--text-primary);
    padding: 20px;
    text-align: left;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 1.1rem;
    font-family: inherit;
}

.suspect-btn:hover {
    border-color: var(--accent-red);
    background: rgba(196, 30, 58, 0.1);
}

.suspect-btn.active {
    border-color: var(--accent-gold);
    background: rgba(212, 175, 55, 0.15);
}

.result-panel {
    background: var(--primary-bg);
    border: 2px solid var(--border-color);
    border-radius: 8px;
    padding: 30px;
    min-height: 200px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.result-content {
    display: none;
    animation: fadeIn 0.5s ease;
}

.result-content.active {
    display: block;
}

.result-content h3 {
    color: var(--accent-gold);
    font-size: 1.5rem;
    margin-bottom: 20px;
}

.result-content p {
    font-size: 1.1rem;
    line-height: 1.8;
    color: var(--text-primary);
}

.result-content.correct {
    color: var(--success-green);
}

.result-content.correct h3 {
    color: var(--success-green);
}

.result-placeholder {
    color: var(--text-secondary);
    font-style: italic;
    text-align: center;
}

/* ==========================================
   RESPONSIVE
   ========================================== */

@media (max-width: 768px) {
    .title {
        font-size: 1.8rem;
    }

    .title-icon {
        font-size: 1.5rem;
    }

    .main-nav {
        grid-template-columns: 1fr;
    }

    .game-selection-nav {
        grid-template-columns: 1fr;
        gap: 20px;
    }

    .game-card {
        padding: 40px 25px;
    }

    .game-card .nav-icon {
        font-size: 3.5rem;
    }

    .game-card h2 {
        font-size: 1.5rem;
    }

    .final-envelope {
        padding: 20px 15px;
        margin-top: 30px;
    }

    .final-envelope h3 {
        font-size: 1.4rem;
        margin-bottom: 12px;
    }

    .final-envelope p {
        font-size: 0.9rem;
    }

    .final-envelope-btn {
        padding: 12px 30px;
        font-size: 1rem;
    }

    .modal-content {
        padding: 25px;
        margin: 20px auto;
    }

    .modal-title {
        font-size: 1.5rem;
    }

    .container {
        padding: 10px;
    }

    .content-section {
        padding: 20px;
    }

    .photo-gallery {
        grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
        gap: 15px;
    }

    .accusations-container {
        grid-template-columns: 1fr;
    }

    .result-panel {
        min-height: 150px;
        padding: 20px;
    }
}

@media (max-width: 480px) {
    .title {
        font-size: 1.5rem;
        line-height: 1.3;
    }

    .crime-tape {
        font-size: 1.02rem;
        letter-spacing: 2px;
        padding: 10px;
    }

    .nav-card {
        padding: 20px 15px;
    }

    .nav-icon {
        font-size: 2.5rem;
    }

    .game-card {
        padding: 30px 20px;
    }

    .game-card .nav-icon {
        font-size: 3rem;
    }

    .game-card h2 {
        font-size: 1.3rem;
    }

    .game-card p {
        font-size: 0.9rem;
    }

    .modal-content {
        padding: 20px;
    }

    .final-envelope {
        padding: 15px 10px;
    }

    .final-envelope h3 {
        font-size: 1.2rem;
        line-height: 1.4;
    }

    .final-envelope-btn {
        padding: 10px 20px;
        font-size: 0.9rem;
        width: 100%;
    }

    .photo-gallery {
        grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
        gap: 10px;
    }

    .photo-navigation {
        flex-direction: column;
        gap: 10px;
        width: 100%;
    }

    .photo-nav-btn {
        width: 100%;
        padding: 10px 20px;
        font-size: 0.9rem;
    }

    .suspect-btn {
        padding: 15px;
        font-size: 1rem;
    }
}
