/* ========================================== */
/* МОДАЛКА "ОБ ОСТРОВЕ" (ДНЕВНИК ВЫЖИВШЕГО)  */
/* ========================================== */

.island-modal {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(10, 12, 8, 0.92);
    backdrop-filter: blur(6px) sepia(30%);
    z-index: 99999;
    justify-content: center;
    align-items: center;
    padding: 20px;
}
.island-modal.active { display: flex; }

.island-book {
    width: 95%;
    max-width: 1200px;
    height: 92vh;
    position: relative;
    display: flex;
    flex-direction: column;
    
    background:
        url('https://forumstatic.ru/files/001b/82/e8/65991.png') right bottom no-repeat,
        linear-gradient(to right, #ebebeb66, #c1b6a694, #ebebeb66),
        #817f7f url('http://forumstatic.ru/files/001b/6f/15/95870.png');
    background-size: auto, auto, cover;
    
    border: 4px solid #3b2b1e;
    border-radius: 4px;
    box-shadow: 0 20px 60px rgba(0,0,0,1), inset 0 0 80px rgba(0,0,0,0.5);
    padding: 25px 25px 25px 70px;
    color: #2b1f14;
    font-family: 'Cormorant Infant', serif;
    overflow: hidden;
}

/* Шумовой слой */
.island-book::after {
    content: '';
    position: absolute;
    inset: 0;
    pointer-events: none;
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='0.08'/%3E%3C/svg%3E");
    mix-blend-mode: multiply;
    opacity: 0.4;
    z-index: 1;
    border-radius: 2px;
}

/* Пружинки слева */
.island-book::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 50px;
    background: url('https://forumstatic.ru/files/001b/82/e8/54489.png') repeat-y left top;
    background-size: contain;
    z-index: 5;
    pointer-events: none;
    filter: drop-shadow(2px 0 3px rgba(0,0,0,0.5));
}

.island-close {
    position: absolute;
    top: 15px;
    right: 20px;
    background: none;
    border: none;
    color: #8b4513;
    font-size: 26px;
    cursor: pointer;
    font-family: 'Oswald', sans-serif;
    z-index: 10;
    transition: 0.2s;
    line-height: 1;
}
.island-close:hover { color: #c49a45; transform: scale(1.2) rotate(90deg); }

/* Вкладки-закладки */
.island-tabs {
    display: flex;
    gap: 4px;
    flex-wrap: wrap;
    margin-bottom: 15px;
    position: relative;
    z-index: 10;
    flex-shrink: 0;
}

.island-tab {
    background: #c1b6a6;
    border: 1px solid #6b5d4a;
    border-bottom: none;
    color: #3b2b1e;
    padding: 8px 14px;
    font-family: 'Oswald', sans-serif;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 1px;
    cursor: pointer;
    transition: all 0.2s;
    border-radius: 4px 10px 0 0;
    position: relative;
    top: 2px;
    display: flex;
    align-items: center;
    gap: 6px;
    box-shadow: inset 0 0 10px rgba(0,0,0,0.1);
}
.island-tab:hover {
    background: #d8cdb8;
    transform: translateY(-1px);
}
.island-tab.active {
    background: #ebebeb;
    color: #1a1e16;
    top: 0;
    padding-bottom: 10px;
    border-top: 2px solid #8b4513;
    font-weight: bold;
    box-shadow: 0 -3px 10px rgba(0,0,0,0.2);
}
.island-tab i { font-size: 12px; }

/* Контент */
.island-content {
    flex: 1;
    position: relative;
    z-index: 2;
    overflow: hidden;
}

.island-page {
    display: none;
    height: 100%;
    overflow-y: auto;
    padding: 15px 25px;
    font-family: 'Cormorant Infant', serif;
    font-size: 15px;
    line-height: 1.7;
    color: #2b1f14;
    background: rgba(235, 235, 235, 0.5);
    border: 1px solid rgba(107, 93, 74, 0.5);
    border-radius: 2px;
    box-shadow: inset 0 0 30px rgba(107, 93, 74, 0.25);
}
.island-page.active { display: block; }

.island-page h2 {
    font-family: 'Forum', serif;
    font-size: 22px;
    color: #5a3a1e;
    text-transform: uppercase;
    letter-spacing: 2px;
    margin-top: 0;
    padding-bottom: 8px;
    border-bottom: 2px dashed #6b5d4a;
    text-shadow: 1px 1px 0 rgba(255,255,255,0.5);
}

.island-page p { margin: 0 0 12px; text-align: justify; }

.island-page img {
    max-width: 100%;
    height: auto;
    border-radius: 2px;
    box-shadow: 0 4px 10px rgba(0,0,0,0.3);
}

.island-page hr {
    border: none;
    height: 1px;
    background: linear-gradient(90deg, transparent, #6b5d4a, transparent);
    margin: 20px 0;
}

.island-page table {
    width: 100%;
    border-collapse: collapse;
    background: rgba(235, 235, 235, 0.5);
    border: 1px solid #6b5d4a;
}
.island-page table td {
    padding: 8px;
    text-align: center;
    border: 1px solid rgba(107, 93, 74, 0.3);
}

.island-empty {
    text-align: center;
    padding: 60px 20px;
    font-family: 'Cormorant Infant', serif;
    font-style: italic;
    font-size: 18px;
    color: #6b5d4a;
}

/* Анимация перелистывания */
@keyframes pageFlip {
    0% { opacity: 0; transform: rotateY(-12deg) translateX(-30px); }
    100% { opacity: 1; transform: rotateY(0) translateX(0); }
}

/* Скроллбар */
.island-page::-webkit-scrollbar { width: 8px; }
.island-page::-webkit-scrollbar-track { background: rgba(107, 93, 74, 0.2); border-radius: 4px; }
.island-page::-webkit-scrollbar-thumb { background: #6b5d4a; border-radius: 4px; }
.island-page::-webkit-scrollbar-thumb:hover { background: #8b4513; }

/* Кнопка «Об острове» в шапке поста */
.island-btn-wrapper {
    margin: 0 !important;
    padding: 0 !important;
    margin-top: 5px !important;
    width: 100%;
}
.island-btn {
    background: rgba(196, 154, 69, 0.15) !important;
    border: 1px solid #c49a45 !important;
    color: #c49a45 !important;
    padding: 6px 12px !important;
    font-family: 'Oswald', sans-serif !important;
    font-size: 11px !important;
    text-transform: uppercase !important;
    letter-spacing: 1px !important;
    border-radius: 2px !important;
    cursor: pointer !important;
    transition: 0.2s !important;
    width: 100% !important;
}
.island-btn:hover {
    background: #c49a45 !important;
    color: #000 !important;
}

/* Мобильная адаптация */
@media (max-width: 768px) {
    .island-book { padding: 15px 15px 15px 45px; }
    .island-book::before { width: 32px; }
    .island-tab { font-size: 9px; padding: 6px 8px; }
    .island-tab span { display: none; }
    .island-tab i { font-size: 14px; }
    .island-page { font-size: 13px; padding: 8px 12px; }
}