/* =========================================
   СТИЛІ ДЛЯ ГЕНЕРАТОРА ЛАБІРИНТІВ
   ========================================= */

.maze-container {
    position: relative;
    width: 100%;
    height: 230mm; 
    display: flex;
    justify-content: center;
    align-items: center;
    margin-top: 5mm;
    box-sizing: border-box;
}

/* Саме полотно лабіринту */
#maze-canvas {
    width: 100%;
    height: 100%;
    object-fit: contain; 
}

/* Маркери старту і фінішу */
.maze-marker {
    position: absolute;
    font-family: 'Comic Neue', cursive, sans-serif;
    font-size: 14pt;
    font-weight: 700;
    color: #1e293b;
    background: rgba(255, 255, 255, 0.9);
    padding: 2px 8px;
    border-radius: 12px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.marker-start {
    top: -4mm;
    left: 20px;
}

.marker-end {
    bottom: -4mm;
    right: 20px;
}

/* Налаштування аркуша А4 для лабіринту */
.a4-page {
    padding: 15mm;
    position: relative;
    box-sizing: border-box;
    width: 210mm;
    height: 297mm;
    max-height: 297mm;
    background: white;
    box-shadow: 0 10px 30px rgba(0,0,0,0.08);
    overflow: hidden;
}

/* =========================================
   АДАПТИВНІСТЬ ДЛЯ МОБІЛЬНИХ ПРИСТРОЇВ
   ========================================= */
.preview-section {
    width: 100%;
    overflow-x: auto; 
    -webkit-overflow-scrolling: touch;
    padding-bottom: 20px;
    background-color: #f1f5f9;
    display: flex;
    justify-content: center;
}

@media (max-width: 1024px) {
    .preview-section {
        justify-content: flex-start; /* Для скролу на смартфонах/планшетах */
        padding: 15px;
    }
}

/* =========================================
   ЗАХИСТ ЕКСПОРТУ ВІД ПОРОЖНІХ СТОРІНОК
   ========================================= */
@media print {
    @page { 
        size: A4 portrait; 
        margin: 0 !important; 
    }
    html, body { 
        margin: 0 !important; 
        padding: 0 !important; 
        height: 297mm !important;
        max-height: 297mm !important;
        overflow: hidden !important; 
        background: #fff !important; 
        -webkit-print-color-adjust: exact; 
        print-color-adjust: exact; 
    }
    .app-header, .controls-section, .seo-text-block, .ad-placeholder, .back-link { 
        display: none !important; 
    }
    .main-layout, .preview-section { 
        display: block !important; 
        padding: 0 !important; 
        margin: 0 !important; 
        overflow: visible !important; 
        background: #fff !important; 
    }
    .a4-page {
        margin: 0 !important;
        box-shadow: none !important;
        page-break-after: avoid !important; 
        page-break-inside: avoid !important;
    }
}