html,body{height:100%;overflow:hidden}.flip-kiosk{width:100%;max-width:none;height:100vh;height:100dvh;padding:clamp(8px,1.3vh,18px) clamp(10px,2vw,30px);display:flex;flex-direction:column;gap:8px;overflow:hidden}.flip-header{flex:0 0 auto}.flip-header h1{margin:0;font-size:clamp(22px,3vw,40px)}.flip-stage{flex:1 1 auto;min-height:0;display:flex;align-items:center;justify-content:center;position:relative;overflow:hidden;background:linear-gradient(140deg,#07132f88,#115b9a55);border:2px solid #00dfff;box-shadow:0 0 22px #00aaff66}.flip-status{position:absolute;inset:0;display:flex;align-items:center;justify-content:center;text-align:center;padding:18px;color:#d9f5ff;font-size:clamp(15px,2vw,24px)}.flip-status[hidden]{display:none}.flip-root{width:100%;height:100%;display:flex;align-items:center;justify-content:center}.flip-root[hidden]{display:none}.flip-page{background:#fff;color:#222;box-shadow:inset 0 0 10px #7775;overflow:hidden}.flip-page canvas{display:block;width:100%;height:100%;object-fit:contain;background:#fff}.flip-footer{flex:0 0 auto;display:grid;grid-template-columns:auto minmax(0,1fr) auto;align-items:center;gap:clamp(6px,1vw,16px);padding-bottom:clamp(3px,.7vh,12px)}.flip-books{display:flex;gap:8px;align-items:center;justify-content:center;flex-wrap:wrap;max-height:clamp(52px,13vh,105px);overflow-y:auto}.flip-nav{display:flex;align-items:center;gap:8px}.flip-touch{min-height:clamp(45px,6.5vh,75px);padding:8px clamp(12px,1.5vw,25px);font-size:clamp(13px,1.2vw,20px);white-space:nowrap}.flip-touch:disabled{opacity:.4;cursor:not-allowed}.flip-touch.selected{border-color:#ffcc55;background:#195eaa}#flip-count{white-space:nowrap;font-size:clamp(12px,1.2vw,18px)}.flip-error{position:absolute;top:3px;left:10px;color:#ffb4b4}@media(max-width:950px){.flip-footer{grid-template-columns:auto 1fr;}.flip-books{justify-content:flex-start}.flip-nav{grid-column:1/-1;justify-content:center}.flip-touch{min-height:42px}}@media(max-height:650px){.flip-header h1{font-size:20px}.flip-touch{min-height:36px}.flip-kiosk{gap:4px}}@media(prefers-reduced-motion:reduce){.flip-root *{animation:none!important}}

/* Patch v2: bingkai ikut buku, navigasi di tengah bawah */
.flip-stage{border:0;box-shadow:none;background:transparent;padding:4px;}
.flip-root{flex:0 0 auto;width:auto;height:auto;max-width:100%;max-height:100%;border:2px solid #00dfff;box-shadow:0 0 22px #00aaff77;overflow:visible;}
.flip-footer{position:relative;display:flex;justify-content:center;align-items:center;min-height:clamp(48px,7vh,82px);}
.flip-back{position:absolute;left:0;bottom:0;}
.flip-nav{display:flex;align-items:center;justify-content:center;gap:clamp(8px,1.4vw,20px);}
@media(max-width:950px){.flip-footer{display:flex;justify-content:center;}.flip-nav{grid-column:auto;}.flip-back{left:0;}}
@media(max-width:550px){.flip-touch{padding:7px 9px;font-size:12px;}.flip-nav{gap:5px;}.flip-back{font-size:11px;}}
/* v7: book is centered in a fixed two-page footprint, with no surrounding neon frame. */
.flip-stage{overflow:hidden!important;background:transparent!important;border:0!important;box-shadow:none!important;padding:8px!important;}
.flip-root{position:relative!important;flex:0 0 auto!important;max-width:100%;max-height:100%;overflow:visible!important;border:0!important;box-shadow:none!important;background:transparent!important;}
.flip-page{background:#fff;overflow:hidden;box-shadow:none;backface-visibility:hidden;}
.flip-page canvas{display:block;width:100%;height:100%;object-fit:fill;}
.flip-footer{z-index:2;}

/* ==========================================
   FOI FLIPBOOK - NEON VIDEO THEME
   ========================================== */

/* Background sama seperti halaman VIDEO */
html, body {
    height: 100%;
    margin: 0;
    overflow: hidden;
}

body {
    background:
        url("../assets/background.png")
        center center / cover no-repeat fixed !important;
}

/* Susun atur utama */
.flip-kiosk {
    position: relative;
    width: 100%;
    max-width: none;
    height: 100vh;
    height: 100dvh;
    padding: 10px 2vw 12px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    overflow: hidden;
    background: transparent;
}

/* Tajuk atas */
.flip-header {
    flex: 0 0 auto;
    display: flex;
    align-items: center;
    justify-content: center;
    height: clamp(45px, 7vh, 75px);
}

.flip-header h1 {
    margin: 0;
    font-size: clamp(25px, 3vw, 42px);
    font-weight: 900;
    color: #fff;
    text-align: center;
    text-shadow:
        0 0 8px #00dfff,
        0 0 18px #009dff,
        0 0 30px #ff00e5;
}

/* Kawasan buku */
.flip-stage {
    flex: 1 1 auto;
    min-height: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden !important;
    padding: 4px !important;
    background: transparent !important;
    border: 0 !important;
    box-shadow: none !important;
}

/* Jangan ubah saiz yang dikawal oleh JS */
.flip-root {
    position: relative !important;
    flex: 0 0 auto !important;
    width: auto;
    height: auto;
    max-width: 100%;
    max-height: 100%;
    overflow: visible !important;
    background: transparent !important;
    border: 0 !important;
    box-shadow: none !important;
}

/* Kekalkan paparan buku */
.flip-page {
    background: #fff;
    color: #222;
    overflow: hidden;
    box-shadow: none;
    backface-visibility: hidden;
}

.flip-page canvas {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: fill;
}

/* Footer seperti VIDEO */
.flip-footer {
    position: relative;
    z-index: 5;
    flex: 0 0 auto;
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: clamp(52px, 8vh, 82px);
    padding: 0 0 8px;
    background: transparent;
}

/* BACK sebelah kiri */
.flip-back {
    position: absolute;
    left: 0;
    bottom: 8px;
}

/* PREV dan NEXT tengah bawah */
.flip-nav {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: clamp(10px, 1.4vw, 20px);
}

.flip-touch {
    min-height: 44px;
    white-space: nowrap;
    cursor: pointer;
}

.flip-touch:disabled {
    opacity: .4;
    cursor: not-allowed;
}

#flip-count {
    color: #fff;
    font-weight: 800;
    font-size: clamp(14px, 1.3vw, 20px);
    text-shadow: 0 0 8px #00dfff;
}

/* Responsif */
@media (max-width: 600px) {
    .flip-kiosk {
        padding: 8px 10px;
    }

    .flip-header {
        height: 45px;
    }

    .flip-footer {
        min-height: 95px;
        align-items: flex-start;
    }

    .flip-back {
        bottom: 0;
        left: 0;
    }

    .flip-nav {
        gap: 6px;
    }

    .flip-touch {
        min-height: 38px;
        padding: 7px 10px;
        font-size: 12px;
    }
}

/* TITLE FLIPBOOK PNG */
.flip-header {
    height: 78px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.flip-header h1 {
    margin: 0;
    padding: 0;
    line-height: 0;
}

.flip-header img {
    display: block;
    width: clamp(210px, 21vw, 320px);
    max-height: 75px;
    height: auto;
    object-fit: contain;
}

@media (max-width: 700px) {
    .flip-header {
        height: 65px;
    }

    .flip-header img {
        width: min(260px, 55vw);
    }
}
