:root {
    --primary-pink: #ffafbd;
    --dark-pink: #ff4b2b;
    --bg-color: #fff0f3;
}

body {
    margin: 0;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: var(--bg-color);
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    overflow-x: hidden;
}

.container {
    text-align: center;
    padding: 20px;
    max-width: 600px;
    width: 100%;
}

.hidden {
    display: none !important;
}

/* Common Elements */
img {
    max-width: 300px;
    border-radius: 15px;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
    margin-bottom: 20px;
}

button {
    padding: 12px 25px;
    font-size: 18px;
    border: none;
    border-radius: 25px;
    cursor: pointer;
    transition: all 0.3s ease;
    margin: 10px;
}

.btn-yes {
    background-color: #4CAF50;
    color: white;
}

.btn-no {
    background-color: #f44336;
    color: white;
    position: relative;
}

.btn-next {
    background-color: var(--dark-pink);
    color: white;
}

/* Screen 1 */
#screen1 .btn-container {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 150px;
}

/* Screen 2 - Gallery */
.gallery-container {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 20px;
    margin-bottom: 30px;
}

.card {
    width: 150px;
    height: 200px;
    perspective: 1000px;
    cursor: pointer;
    position: relative;
}

.card-inner {
    position: relative;
    width: 100%;
    height: 100%;
    transition: transform 0.6s;
    transform-style: preserve-3d;
}

.card.is-flipped .card-inner {
    transform: rotateY(180deg);
}

.card-front,
.card-back {
    position: absolute;
    width: 100%;
    height: 100%;
    backface-visibility: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 10px;
    padding: 10px;
    box-sizing: border-box;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
    overflow: hidden;
}

.card-front img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    margin: 0;
    border-radius: 0;
    box-shadow: none;
}

.card-back {
    background-color: white;
    color: var(--dark-pink);
    transform: rotateY(180deg);
    font-size: 14px;
    font-weight: bold;
    flex-direction: column;
    gap: 8px;
}

/* Zoom button trên card */
.zoom-btn {
    position: absolute;
    bottom: 8px;
    right: 8px;
    width: 32px;
    height: 32px;
    padding: 0;
    margin: 0;
    font-size: 16px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(4px);
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 8px rgba(0,0,0,0.2);
    transition: transform 0.2s ease, background 0.2s ease;
    z-index: 10;
    line-height: 1;
}

.zoom-btn:hover {
    transform: scale(1.2);
    background: white;
}

.zoom-btn--back {
    /* Ở card-back thì không cần absolute vì flex-column */
    position: static;
    width: 28px;
    height: 28px;
    font-size: 14px;
}

/* Zoom Overlay */
.zoom-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2000;
    transition: background 0.3s ease;
    cursor: pointer;
}

.zoom-overlay.zoom-overlay--visible {
    background: rgba(0, 0, 0, 0.75);
}

.zoom-content {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    cursor: default;

    /* Animation */
    transform: scale(0.6);
    opacity: 0;
    transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1), opacity 0.3s ease;
}

.zoom-overlay--visible .zoom-content {
    transform: scale(1);
    opacity: 1;
}

#zoom-img {
    max-width: min(80vw, 420px);
    max-height: 70vh;
    width: auto;
    height: auto;
    border-radius: 16px;
    object-fit: contain;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
    margin: 0;
}

#zoom-caption {
    color: white;
    font-size: 15px;
    font-weight: 600;
    text-align: center;
    max-width: min(80vw, 380px);
    margin: 0;
    text-shadow: 0 1px 4px rgba(0,0,0,0.5);
    line-height: 1.4;
}

.zoom-close {
    position: absolute;
    top: -14px;
    right: -14px;
    width: 36px;
    height: 36px;
    padding: 0;
    margin: 0;
    font-size: 16px;
    border-radius: 50%;
    background: white;
    color: #333;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 10px rgba(0,0,0,0.3);
    transition: transform 0.2s ease;
    z-index: 10;
    line-height: 1;
}

.zoom-close:hover {
    transform: scale(1.15) rotate(90deg);
}

/* Popup */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

.modal-content {
    background: white;
    padding: 20px;
    border-radius: 15px;
    position: relative;
    text-align: center;
}