@import url('https://fonts.googleapis.com/css?family=Indie+Flower');
@import url('https://fonts.googleapis.com/css?family=Amatic+SC');

body {
    font-family: 'Indie Flower', cursive !important;
    background: #FFFBE9;
    margin: 0;
    padding: 0;
}

::selection {
    background: transparent;
}

h1, h2 {
    font-family: 'Amatic SC', cursive !important;
}

h1 {
    font-size: 27px;
    line-height: 1.2;
}

h2 {
    font-size: 19px;
    line-height: 1.2;
}

.color1 {
    color: #1bbc98;
    margin: 0;
}

.color2 {
    color: #c0392b;
    margin: 2px;
}

.card {
    color: #013243;
    position: absolute;
    top: 50%;
    left: 50%;
    width: 300px;
    height: 450px;
    background: #e0e1dc;
    transform-style: preserve-3d;
    transform: translate(-50%, -50%) perspective(2000px);
    box-shadow: inset 300px 0 50px rgba(0, 0, 0, 0.5), 20px 0 60px rgba(0, 0, 0, 0.5);
    transition: 1s;
}

.card:hover,
.card.open {
    transform: translate(-50%, -50%) perspective(2000px) rotateY(15deg) scale(1.2);
    box-shadow: inset 20px 0 50px rgba(0, 0, 0, 0.5), 0 10px 100px rgba(0, 0, 0, 0.5);
}

.card:before {
    content: '';
    position: absolute;
    top: -5px;
    left: 0;
    width: 100%;
    height: 5px;
    background: #BAC1ba;
    transform-origin: bottom;
    transform: skewX(-45deg);
}

.card:after {
    content: '';
    position: absolute;
    top: 0;
    right: -5px;
    width: 5px;
    height: 100%;
    background: #92a29c;
    transform-origin: left;
    transform: skewY(-45deg);
}

.card .imgBox {
    width: 100%;
    height: 100%;
    position: relative;
    transform-origin: left;
    transition: 0.7s;
}

.card .bark {
    position: absolute;
    background: #e0e1dc;
    width: 100%;
    height: 100%;
    opacity: 0;
    transition: 0.7s;
}

.card .imgBox img {
    width: 300px;
    height: 450px;
}

.card:hover .imgBox,
.card.open .imgBox {
    transform: rotateY(-135deg);
}

.card:hover .bark,
.card.open .bark {
    opacity: 1;
    transition: 0.6s;
    box-shadow: 300px 200px 100px rgba(0, 0, 0, 0.4) inset;
}

.card .details {
    position: absolute;
    top: 0;
    left: 0;
    box-sizing: border-box;
    padding: 10px;
    z-index: -1;
    margin-top: 10px;
    width: 100%;
    height: calc(100% - 10px);
    text-align: center;
    display: flex;
    flex-direction: column;
}
.card .details p {
    font-size: 18px;
    margin: 0;
}

.text-right {
    text-align: right;
    font-size: 9px;
}
.card .details p.text-right {
    font-size: 9px;
    margin-top: 12px;
}

/* ================= BUKU ================= */
.pages {
    position: relative;
    flex: 1;
    perspective: 900px;
}

.page {
    position: absolute;
    inset: 0;
    opacity: 0;
    pointer-events: none;
    transform-origin: left center;
    transform: rotateY(0deg);
    transition: transform 0.6s ease, opacity 0.5s ease;
}

.page.active {
    opacity: 1;
    pointer-events: auto;
}

.page.flipped {
    opacity: 0;
    transform: rotateY(-100deg);
}

.nav {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 6px 4px;
}

.nav-info {
    font-size: 12px;
    opacity: 0.7;
}

.nav-btn {
    font-family: 'Amatic SC', cursive;
    font-size: 26px;
    line-height: 1;
    width: 30px;
    height: 30px;
    border: none;
    border-radius: 50%;
    background: #1bbc98;
    color: #fff;
    cursor: pointer;
    transition: 0.2s;
}

.nav-btn:hover:not(:disabled) {
    transform: scale(1.12);
}

.nav-btn:disabled {
    background: #b9bfb9;
    cursor: default;
}

/* ================= KUE 3D ================= */
.cake {
    position: relative;
    width: 170px;
    height: 170px;
    margin: 18px auto 6px;
    cursor: pointer;
    animation: float 3.5s ease-in-out infinite;
    transform: rotateX(-8deg);
}

@keyframes float {
    0%, 100% { translate: 0 0; }
    50% { translate: 0 -5px; }
}

.plate {
    position: absolute;
    bottom: 0;
    left: 50%;
    width: 170px;
    height: 30px;
    margin-left: -85px;
    border-radius: 50%;
    background: radial-gradient(ellipse at center, #fdfdfd 55%, #cfd4d0 100%);
    box-shadow: 0 8px 10px rgba(0, 0, 0, 0.35);
}

.layer {
    position: absolute;
    left: 50%;
    border-radius: 0 0 50% 50% / 0 0 14px 14px;
}

.layer::before {           /* permukaan atas (elips) */
    content: '';
    position: absolute;
    top: -14px;
    left: 0;
    width: 100%;
    height: 28px;
    border-radius: 50%;
}

.layer::after {            /* tetesan krim */
    content: '';
    position: absolute;
    top: 8px;
    left: 0;
    width: 100%;
    height: 12px;
    background:
        radial-gradient(circle at 10% 0, #fff 6px, transparent 7px) 0 0 / 22px 12px repeat-x;
    opacity: 0.9;
}

.layer1 {
    width: 140px;
    height: 56px;
    bottom: 15px;
    margin-left: -70px;
    background: linear-gradient(90deg, #d9758c, #f4a6b7 35%, #f9c3cf 55%, #d9758c);
}
.layer1::before { background: #fbd3dc; }

.layer2 {
    width: 100px;
    height: 46px;
    bottom: 69px;
    margin-left: -50px;
    background: linear-gradient(90deg, #e3c777, #fff0b8 35%, #fff8d9 55%, #e3c777);
}
.layer2::before { background: #fffbe8; }

.candle {
    position: absolute;
    top: -44px;
    width: 6px;
    height: 30px;
    margin-left: -3px;
    border-radius: 2px;
    background: repeating-linear-gradient(180deg, #4fc3f7 0 5px, #fff 5px 10px);
    z-index: 2;
}

.flame {
    position: absolute;
    top: -14px;
    left: -2px;
    width: 10px;
    height: 15px;
    border-radius: 50% 50% 50% 50% / 60% 60% 40% 40%;
    background: radial-gradient(circle at 50% 70%, #fff6a8, #ffb300 70%, #ff6d00);
    box-shadow: 0 0 10px 4px rgba(255, 180, 0, 0.6);
    transform-origin: bottom center;
    animation: flicker 0.4s ease-in-out infinite alternate;
    transition: opacity 0.4s;
}

@keyframes flicker {
    from { transform: scale(1) rotate(-3deg); }
    to   { transform: scale(1.1, 0.92) rotate(3deg); }
}

.cake.blown .flame {
    opacity: 0;
}

.cake-page p {
    margin-top: 6px;
}
