/* ============================================
   MODERN PUZZLE SYSTEM - НЕЗАВИСИМЫЕ СТИЛИ
   Полностью отдельная система от riddle-menu.css
   ============================================ */

/* Reset */
.puzzle-modern-wrapper * {
    box-sizing: border-box;
}

/* Overlay - полноэкранный фон */
.puzzle-modern-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: linear-gradient(135deg, rgba(10, 15, 25, 0.98) 0%, rgba(15, 25, 35, 0.98) 100%);
    backdrop-filter: blur(10px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    animation: puzzleModernFadeIn 0.3s ease;
}

/* Главный контейнер */
.puzzle-modern-container {
    width: 90%;
    max-width: 900px;
    max-height: 90vh;
    background: linear-gradient(135deg, rgba(20, 30, 50, 0.95) 0%, rgba(15, 25, 40, 0.95) 100%);
    border: 2px solid rgba(0, 255, 136, 0.4);
    border-radius: 20px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.6), 0 0 60px rgba(0, 255, 136, 0.1);
    overflow: hidden;
    position: relative;
    animation: puzzleModernSlideIn 0.4s ease;
}

.puzzle-modern-container::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: radial-gradient(circle at top right, rgba(0, 255, 136, 0.1) 0%, transparent 70%);
    pointer-events: none;
    z-index: 0;
}

/* Header */
.puzzle-modern-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 25px 30px;
    background: rgba(0, 0, 0, 0.3);
    border-bottom: 2px solid rgba(0, 255, 136, 0.3);
    position: relative;
    z-index: 1;
}

.puzzle-modern-header h1 {
    color: #00ff88;
    font-size: 28px;
    font-weight: 700;
    margin: 0;
    text-shadow: 0 0 20px rgba(0, 255, 136, 0.5);
    letter-spacing: 2px;
    text-transform: uppercase;
}

/* Close button */
.puzzle-modern-close {
    background: rgba(255, 107, 107, 0.2);
    border: 2px solid #ff6b6b;
    color: #ff6b6b;
    font-size: 24px;
    font-weight: 700;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.puzzle-modern-close:hover {
    background: rgba(255, 107, 107, 0.4);
    box-shadow: 0 0 20px rgba(255, 107, 107, 0.5);
    transform: scale(1.1);
}

/* Content area */
.puzzle-modern-content {
    padding: 30px;
    position: relative;
    z-index: 1;
    max-height: calc(90vh - 120px);
    overflow-y: auto;
}

/* Game area - куда загружаются пазлы */
.puzzle-modern-game-area {
    min-height: 200px;
    margin-bottom: 25px;
    position: relative;
}

.puzzle-modern-content-wrapper {
    width: 100%;
    position: relative;
}

/* Controls */
.puzzle-modern-controls {
    display: flex;
    gap: 15px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

/* Hint button */
.puzzle-modern-hint-btn {
    flex: 1;
    min-width: 200px;
    padding: 15px 25px;
    background: linear-gradient(135deg, rgba(243, 183, 1, 0.9) 0%, rgba(200, 160, 80, 0.95) 100%);
    border: 2px solid rgba(243, 183, 1, 0.8);
    border-radius: 12px;
    color: #2a2a2a;
    font-size: 16px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s ease;
    text-transform: uppercase;
    letter-spacing: 1px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    box-shadow: 0 4px 15px rgba(243, 183, 1, 0.3);
}

.puzzle-modern-hint-btn:hover {
    background: linear-gradient(135deg, rgba(243, 183, 1, 1) 0%, rgba(220, 180, 100, 1) 100%);
    box-shadow: 0 6px 20px rgba(243, 183, 1, 0.5);
    transform: translateY(-2px);
}

.puzzle-modern-hint-btn.hidden {
    display: none;
}

.puzzle-modern-hint-btn .hint-count {
    font-weight: 700;
    color: #1a1a1a;
}

/* Buy button */
.puzzle-modern-buy-btn {
    flex: 1;
    min-width: 200px;
    padding: 15px 25px;
    background: linear-gradient(135deg, #00cc70 0%, #00ff88 100%);
    border: 2px solid #00ff88;
    border-radius: 12px;
    color: white;
    font-size: 16px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s ease;
    text-transform: uppercase;
    letter-spacing: 1px;
    box-shadow: 0 4px 15px rgba(0, 255, 136, 0.3);
}

.puzzle-modern-buy-btn:hover {
    background: linear-gradient(135deg, #00ff88 0%, #00ffaa 100%);
    box-shadow: 0 6px 20px rgba(0, 255, 136, 0.5);
    transform: translateY(-2px);
}

.puzzle-modern-buy-btn.hidden {
    display: none;
}

/* Hint display */
.puzzle-modern-hint-display {
    background: rgba(243, 183, 1, 0.15);
    border: 2px solid rgba(243, 183, 1, 0.4);
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 20px;
    animation: puzzleModernHintSlide 0.3s ease;
}

.puzzle-modern-hint-display.hidden {
    display: none;
}

.puzzle-modern-hint-display .hint-content {
    color: rgba(243, 183, 1, 0.95);
    font-size: 16px;
    line-height: 1.6;
    text-align: center;
    font-weight: 500;
}

/* Shop */
.puzzle-modern-shop {
    background: rgba(0, 0, 0, 0.3);
    border: 2px solid rgba(0, 255, 136, 0.3);
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 20px;
    animation: puzzleModernHintSlide 0.3s ease;
}

.puzzle-modern-shop.hidden {
    display: none;
}

.puzzle-modern-discount {
    color: #00ff88;
    font-size: 20px;
    font-weight: 700;
    text-align: center;
    margin-bottom: 20px;
    text-shadow: 0 0 10px rgba(0, 255, 136, 0.5);
}

.puzzle-modern-shop-items {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
}

.puzzle-modern-shop-item {
    background: linear-gradient(135deg, rgba(0, 255, 136, 0.1) 0%, rgba(0, 200, 100, 0.1) 100%);
    border: 2px solid rgba(0, 255, 136, 0.3);
    border-radius: 12px;
    padding: 20px;
    cursor: pointer;
    transition: all 0.3s ease;
    text-align: center;
    position: relative;
}

.puzzle-modern-shop-item:hover {
    background: linear-gradient(135deg, rgba(0, 255, 136, 0.2) 0%, rgba(0, 200, 100, 0.2) 100%);
    border-color: #00ff88;
    box-shadow: 0 4px 15px rgba(0, 255, 136, 0.3);
    transform: translateY(-2px);
}

.puzzle-modern-shop-item img {
    width: 50px;
    height: 50px;
    margin-bottom: 10px;
}

.shop-item-amount {
    font-size: 32px;
    font-weight: 700;
    color: #00ff88;
    margin-bottom: 5px;
}

.shop-item-label {
    font-size: 14px;
    color: rgba(255, 255, 255, 0.7);
    margin-bottom: 10px;
}

.shop-item-price {
    font-size: 16px;
    font-weight: 700;
    color: #fff;
    background: rgba(0, 0, 0, 0.3);
    padding: 8px 12px;
    border-radius: 8px;
    display: inline-block;
}

/* Success animation */
.puzzle-modern-container.puzzle-success {
    animation: puzzleModernSuccess 1s ease;
}

/* Scrollbar */
.puzzle-modern-content::-webkit-scrollbar {
    width: 8px;
}

.puzzle-modern-content::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.3);
    border-radius: 4px;
}

.puzzle-modern-content::-webkit-scrollbar-thumb {
    background: rgba(0, 255, 136, 0.3);
    border-radius: 4px;
}

.puzzle-modern-content::-webkit-scrollbar-thumb:hover {
    background: rgba(0, 255, 136, 0.5);
}

/* ============================================
   СТИЛИ ДЛЯ ПАЗЛОВ/МИНИ-ИГР
   Независимые стили для контента пазлов
   ============================================ */

/* Общие стили для всех пазлов */
.puzzle-modern-content-wrapper h2,
.puzzle-modern-content-wrapper h3 {
    color: #00ff88;
    font-weight: 700;
    margin-bottom: 15px;
    text-shadow: 0 0 10px rgba(0, 255, 136, 0.3);
}

.puzzle-modern-content-wrapper p {
    color: rgba(255, 255, 255, 0.9);
    line-height: 1.6;
    margin-bottom: 15px;
}

/* Input fields */
.puzzle-modern-content-wrapper input[type="text"],
.puzzle-modern-content-wrapper input[type="number"] {
    background: rgba(255, 255, 255, 0.9);
    border: 2px solid rgba(0, 255, 136, 0.3);
    border-radius: 8px;
    padding: 12px 15px;
    color: #333;
    font-size: 16px;
    transition: all 0.3s ease;
    outline: none;
}

.puzzle-modern-content-wrapper input:focus {
    border-color: #00ff88;
    box-shadow: 0 0 15px rgba(0, 255, 136, 0.3);
    background: rgba(255, 255, 255, 1);
}

/* Buttons in puzzles */
.puzzle-modern-content-wrapper button,
.puzzle-modern-content-wrapper .btns > div {
    background: linear-gradient(135deg, #00cc70 0%, #00ff88 100%);
    border: none;
    border-radius: 8px;
    padding: 12px 20px;
    color: white;
    font-size: 16px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s ease;
    text-transform: uppercase;
    letter-spacing: 1px;
    box-shadow: 0 4px 15px rgba(0, 255, 136, 0.3);
}

.puzzle-modern-content-wrapper button:hover,
.puzzle-modern-content-wrapper .btns > div:hover {
    background: linear-gradient(135deg, #00ff88 0%, #00ffaa 100%);
    box-shadow: 0 6px 20px rgba(0, 255, 136, 0.5);
    transform: translateY(-2px);
}

/* Специфичные стили для разных пазлов */
.puzzle-modern-content-wrapper .screen-dna {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 20px;
}

.puzzle-modern-content-wrapper .molecule img {
    max-width: 100%;
    height: auto;
}

.puzzle-modern-content-wrapper .info {
    text-align: center;
}

.puzzle-modern-content-wrapper .btns {
    display: flex;
    gap: 10px;
    justify-content: center;
    flex-wrap: wrap;
}

/* ============================================
   ANIMATIONS
   ============================================ */

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

@keyframes puzzleModernSlideIn {
    from {
        opacity: 0;
        transform: translateY(-50px) scale(0.9);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

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

@keyframes puzzleModernSuccess {
    0% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.05);
        box-shadow: 0 0 30px rgba(0, 255, 136, 0.8);
    }
    100% {
        transform: scale(1);
        opacity: 0;
    }
}

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

@media (max-width: 768px) {
    .puzzle-modern-container {
        width: 95%;
        max-height: 95vh;
    }
    
    .puzzle-modern-header {
        padding: 20px;
    }
    
    .puzzle-modern-header h1 {
        font-size: 22px;
    }
    
    .puzzle-modern-close {
        width: 40px;
        height: 40px;
        font-size: 20px;
    }
    
    .puzzle-modern-content {
        padding: 20px;
    }
    
    .puzzle-modern-controls {
        flex-direction: column;
    }
    
    .puzzle-modern-hint-btn,
    .puzzle-modern-buy-btn {
        min-width: auto;
    }
    
    .puzzle-modern-shop-items {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 480px) {
    .puzzle-modern-header h1 {
        font-size: 18px;
    }
    
    .puzzle-modern-content {
        padding: 15px;
    }
    
    .puzzle-modern-hint-btn,
    .puzzle-modern-buy-btn {
        font-size: 14px;
        padding: 12px 20px;
    }
}

/* ============================================
   DARK MODE SUPPORT
   ============================================ */

@media (prefers-color-scheme: dark) {
    .puzzle-modern-overlay {
        background: linear-gradient(135deg, rgba(5, 10, 15, 0.98) 0%, rgba(10, 15, 25, 0.98) 100%);
    }
    
    .puzzle-modern-container {
        background: linear-gradient(135deg, rgba(15, 25, 40, 0.98) 0%, rgba(10, 20, 35, 0.98) 100%);
    }
}
