.flipbook-link { color: inherit; text-decoration: none; cursor: pointer; }
.flipbook-link:hover { color: #1f2a6b; }

.fb-modal {
    position: fixed; inset: 0;
    background: rgba(0, 0, 0, .96);
    display: none;
    z-index: 99999;
}
.fb-modal.open { display: block; }

.fb-box {
    position: relative;
    width: 100%; height: 100%;
    display: flex; flex-direction: column; align-items: center;
    padding: 10px 10px 12px;
}

.fb-close {
    position: absolute; top: 12px; right: 20px;
    background: #f7941d; color: #fff; border: 0;
    width: 42px; height: 42px; border-radius: 50%;
    font-size: 28px; line-height: 1; cursor: pointer; z-index: 30;
}

.fb-loader {
    position: absolute; top: 50%; left: 50%;
    transform: translate(-50%, -50%);
    color: #fff; font-size: 18px; text-align: center;
    padding: 0 20px; z-index: 6;
}

.fb-stage {
    flex: 1; width: 100%; min-height: 0;
    overflow: hidden; display: flex;
    align-items: center; justify-content: center;
}
.fb-stage > div { flex: none; }
.fb-shift { transition: transform .45s ease; flex: none; }

.fb-controls {
    margin-top: 10px;
    display: flex; flex-wrap: wrap; align-items: center; justify-content: center;
    gap: 12px; color: #fff;
}
.fb-controls button {
    background: #1f2a6b; color: #fff; border: 0;
    padding: 8px 18px; border-radius: 4px; cursor: pointer;
    text-transform: uppercase; font-size: 14px;
}
.fb-controls button:hover { background: #f7941d; }
.fb-controls .fb-end { background: #f7941d; }
.fb-controls .fb-end:hover { background: #d97c0a; }
.fb-sep { width: 1px; height: 24px; background: rgba(255, 255, 255, .4); }
.fb-hint { color: rgba(255, 255, 255, .6); font-size: 12px; margin-top: 6px; }
.fb-box.loading .fb-controls,
.fb-box.loading .fb-hint { visibility: hidden; }

/* book pages */
.fb-page { background: #fff; overflow: hidden; cursor: zoom-in; }
.fb-page img {
    width: 100%; height: 100%; display: block;
    user-select: none; -webkit-user-drag: none;
}

/* back cover (closing page) */
.fb-backcover {
    background: linear-gradient(135deg, #1f2a6b, #121a45);
    cursor: default;
}
.fb-backcover > div {
    width: 100%; height: 100%;
    display: flex; flex-direction: column;
    align-items: center; justify-content: center;
    gap: 10px; text-align: center; color: #fff;
}
.fb-backcover span { font-size: clamp(18px, 2.4vw, 34px); font-weight: 600; }
.fb-backcover small { font-size: clamp(11px, 1vw, 15px); color: #f7941d; letter-spacing: 1px; }

/* READ MODE */
.fb-reader {
    position: absolute; inset: 0;
    background: #111;
    display: none; flex-direction: column; align-items: center;
    padding: 10px 10px 12px;
    z-index: 20;
}
.fb-reader.open { display: flex; }
.fb-back {
    position: absolute; top: 12px; left: 20px; z-index: 25;
    background: #f7941d; color: #fff; border: 0;
    padding: 10px 18px; border-radius: 4px; cursor: pointer;
    text-transform: uppercase; font-size: 14px;
}
.fb-reader-scroll {
    flex: 1; width: 100%; min-height: 0;
    overflow: auto; display: flex;
    padding-top: 44px;
}
.fb-reader-scroll img {
    margin: auto; flex: none; display: block;
    background: #fff; cursor: zoom-in;
}
.fb-blank {
    background:
        radial-gradient(circle at 1px 1px, rgba(31, 42, 107, .10) 1.2px, transparent 0) 0 0 / 20px 20px,
        #fbf8f2;
    cursor: default;
}
.fb-reader-scroll.zoomed img { cursor: zoom-out; }