/* Extracted styles from index.html */
/* Make the page full-height, center the wheel, and prevent scrolling */
html,
body {
    height: 100%;
    /* allow vertical scrolling but prevent horizontal overflow */
    overflow-x: hidden;
    overflow-y: auto;
}

body {
    margin: 0;
    /* Keep the page background white so extra horizontal space is blank on desktop */
    background: #ffffff;
    font-family: system-ui, -apple-system, 'Segoe UI', Roboto, 'Helvetica Neue', Arial;
    position: relative;
}

/* App wrapper: emulate mobile viewport centered on desktop */
#app {
    width: min(420px, 100%);
    max-width: 420px;
    min-height: 100vh;
    margin: 0 auto; /* center horizontally */
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    background: #ffffff;
    position: relative;
}

/* Hero/banner image shown above the wheel */
#heroImage {
    width: 100%;
    height: auto;
    display: block;
    object-fit: contain;
}

/* Optional subtle shadow to help distinguish content column from page edges */
#app.mobile-frame {
    box-shadow: 0 0 0 rgba(0,0,0,0);
}

/* Overlay tối nhẹ để vòng quay nổi bật */
body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.1);
    z-index: -1;
}

/* Wheel container: constrain to app width so it never overflows */
#wheel .container{
    width: 100%;            /* fill the app column */
    aspect-ratio: 1 / 1;    /* keep square */
    display: flex;
    align-items: center;
    justify-content: center;
    user-select: none;
    -webkit-user-select: none;
    touch-action: manipulation;
    position: relative;
}

/* Make the wheel image fill the container while preserving aspect ratio */
#wheel img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    display: block;
    transform-origin: 50% 50%;
    cursor: pointer;
    will-change: transform;
}

/* Use Artboard 1.png as the wheel background; keep it centered and contained */
#wheel {
    background-image: url('images/bg.png');
    background-repeat: no-repeat;
    background-position: center center;
    /* fill the entire wheel area with the background */
    background-size: 100% 100%;
}

/* Make the wheel image inset so the background/frame is visible */
#wheel #wheelImage {
    width: 70%;
    height: 70%;
}

/* Result badge */
#result {
    position: absolute;
    bottom: -28px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0, 0, 0, 0.7);
    color: #fff;
    padding: 8px 12px;
    border-radius: 999px;
    font-weight: 600;
    font-size: 12px;
    pointer-events: none;
    opacity: 0.95;
}

/* Disclaimer text under the wheel */
#disclaimer {
    text-align: center;
    font-size: 14px;
    color: #fff;
    padding: 16px 12px;
    margin: 0 12px;
    font-style: italic;
}

/* Footer section */
.footer {
    width: 100%;
    margin: 32px 0 16px 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
}

.footer-img {
    width: 90%;
    max-width: 90%;
    height: auto;
    display: block;
}
.footer-logo{
    width: 50%;
    max-width: 60%;
    height: auto;
    display: block;
    align-self: flex-start;
    margin-left: 20px;
}

/* Social icons section */
.social-icons {
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: center;
    gap: 16px;
    padding: 16px 0;
}

.social-icon {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.2s ease;
}

.social-icon:hover {
    transform: scale(1.1);
}

.social-icon svg {
    width: 100%;
    height: 100%;
}

/* Copyright section */
.copyright {
    width: 100%;
    text-align: center;
    padding: 16px 0;
    background: linear-gradient(90deg, #4aa044 0%, #17629e 100%);
    color: white;
    font-size: 12px;
    margin-top: auto;
}

/* Pointer background - nền trắng cho mũi tên */
#pointerImage2 {
    left: 49.9%;
    top: 50.5%;
    position: absolute;
    transform: translate(-50%, -50%);
    width: 20%;
    height: 20%;
    background: white;
    border-radius: 50%;
    pointer-events: none;
    z-index: 1;
    transition: all 0.2s ease;
    /* Nằm dưới pointerImage nhưng trên wheel */
}
.container {
    margin: 50px 0 20px 0;
}
/* Pointer image at top center */
#pointerTop {
    position: absolute;
    top: -185px;
    left: 50%;
    transform: translateX(-50%);
    width: 8% !important;
    height: auto;
    pointer-events: none;
    z-index: 3;
}

/* Pointer image centered over the wheel */
#pointerImage {
    max-width: 35% !important;
    left: 50%;
    top: 50.1%;
    position: absolute;
    transform: translate(-50%, -50%);
    width: 14% !important;
    /* adjust size as needed */
    height: auto;
    pointer-events: none;
    /* allow clicks to pass to wheel */
    z-index: 2;
    transition: all 0.2s ease;
}

/* Hover effect for wheel */
#wheel:hover #pointerImage {
    transform: translate(-50%, -50%) scale(1.05);
    filter: brightness(1.1);
}

#wheel:hover #pointerImage2 {
    transform: translate(-50%, -50%) scale(1.05);
}

#wheel:hover {
    cursor: pointer;
}

/* Click animation for pointer */
#pointerImage.clicked {
    animation: pointerClick 0.3s ease-out;
}

#pointerImage2.clicked {
    animation: pointerClick 0.3s ease-out;
}

@keyframes pointerClick {
    0% { 
        transform: translate(-50%, -50%) scale(1);
    }
    50% { 
        transform: translate(-50%, -50%) scale(0.9);
        filter: brightness(1.2);
    }
    100% { 
        transform: translate(-50%, -50%) scale(1);
        filter: brightness(1);
    }
}



/* SVG overlay that draws sector dividing lines */
#sectorsOverlay {
    position: absolute;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
    /* above wheel image but below pointerImage */
    pointer-events: none;
}

/* Result Popup */
#resultPopup {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    animation: fadeIn 0.3s ease-out;
}

#resultPopup.show {
    display: flex;
}

.popup-content {
    background-image: url('images/f.png');
    background-size: 100% 100%;
    background-position: center;
    background-repeat: no-repeat;
    padding: 40px;
    border-radius: 20px;
    text-align: center;
    color: white;
    max-width: 500px;
    width: 90%;
    animation: slideUp 0.4s ease-out;
    margin: 20px;
}

/* Mobile responsive styles */
@media (max-width: 768px) {
    .popup-content {
        padding: 20px;
        margin: 10px;
        width: calc(100% - 20px);
        max-width: none;
        border-radius: 15px;
    }
    
    .popup-title {
        font-size: 18px !important;
        margin-bottom: 15px;
    }
    
    .popup-result {
        font-size: 22px;
        margin-bottom: 20px;
    }
    
    .popup-angle {
        font-size: 14px;
        margin-bottom: 20px;
    }
    
    .popup-btn {
        padding: 10px 20px;
        font-size: 14px;
    }
}

@media (max-width: 480px) {
    .popup-content {
        padding: 15px;
        margin: 5px;
        width: calc(100% - 10px);
        border-radius: 12px;
    }
    
    .popup-title {
        font-size: 18px;
        margin-bottom: 12px;
    }
    
    .popup-result {
        font-size: 20px;
        margin-bottom: 15px;
    }
    
    .popup-angle {
        font-size: 13px;
        margin-bottom: 15px;
    }
    
    .popup-btn {
        padding: 8px 16px;
        font-size: 13px;
    }
}

.popup-title {
    font-size: 20px;
    font-weight: 600;
    margin-bottom: 15px;
    color: white;
}

.popup-result {
    font-size: 40px;
    font-weight: bold;
    margin-bottom: 15px;
    line-height: 1.3;
    background: linear-gradient(135deg, #e4cea3 0%, #fff3dc 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    text-shadow: 2px 2px 8px rgba(0, 0, 0, 0.2);
    letter-spacing: 0.5px;
}

.popup-subtitle {
    font-size: 16px;
    margin-bottom: 25px;
    color: white;
}

.popup-form {
    display: flex;
    flex-direction: column;
    gap: 15px;
    margin-bottom: 20px;
}

.popup-input {
    padding: 12px 16px;
    border: none;
    border-radius: 8px;
    font-size: 15px;
    background: rgba(255, 255, 255, 0.95);
    color: #333;
    outline: none;
    transition: all 0.3s ease;
}

.popup-input:focus {
    background: white;
    box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.3);
}

.popup-input::placeholder {
    color: #999;
}

.popup-note {
    font-size: 13px;
    color: rgba(255, 255, 255, 0.9);
    line-height: 1.5;
    margin-top: 15px;
}

.popup-buttons {
    display: flex;
    gap: 15px;
    justify-content: center;
}

.popup-btn {
    padding: 14px 32px;
    border: none;
    border-radius: 25px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    width: 100%;
}

.popup-btn-primary {
    background: white;
    color: #17629e;
}

.popup-btn-primary:hover {
    background: #f0f0f0;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.popup-btn-secondary {
    background: rgba(255, 255, 255, 0.2);
    color: white;
    border: 2px solid rgba(255, 255, 255, 0.3);
}

.popup-btn-secondary:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: translateY(-2px);
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes slideUp {
    from { 
        opacity: 0;
        transform: translateY(30px);
    }
    to { 
        opacity: 1;
        transform: translateY(0);
    }
}

/* Respect users who prefer reduced motion */
@media (prefers-reduced-motion: reduce) {
    #wheel img {
        transition: none !important;
    }
    #resultPopup, .popup-content {
        animation: none !important;
    }
}
