/* ============================================================
   BÁNH SINH NHẬT SINGAPORE – style.css
   ============================================================ */

/* ---------- Reset & Base ---------- */
*,
*::before,
*::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

:root {
    --pink: #801316;
    --pink-dark: #801316;
    --orange: #FF8C42;
    --cream: #fff8f4;
    --bg: #fff8f4;
    --white: #ffffff;
    --text: #2d2d2d;
    --muted: #6b6b6b;
    --radius: 18px;
    --shadow: 0 8px 32px rgba(255, 107, 157, .15);
    --font-display: 'Playfair Display', serif;
    --font-body: 'Nunito', sans-serif;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-body);
    background: var(--bg);
    color: var(--text);
    overflow-x: hidden;
}

.container {
    max-width: 960px;
    margin: 0 auto;
    padding: 0 20px;
    font-family: UTM Copperplate;
}

.hidden {
    display: none !important;
}

/* ---------- HERO ---------- */
.hero {
    position: relative;
    min-height: 92vh;
    background: linear-gradient(135deg, #F7ECC5 0%, #F7ECC5 55%, #F7ECC5 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    overflow: hidden;
    padding: 80px 20px 120px;
}

.hero-content {
    position: relative;
    z-index: 2;
}

.hero-eyebrow {
    font-family: UTM Copperplate;
    font-weight: 700;
    font-size: 1rem;
    letter-spacing: .15em;
    color: #801316;
    text-transform: uppercase;
    margin-bottom: 18px;
}

.hero-title {
    font-family: UTM Copperplate;
    font-size: clamp(3rem, 8vw, 2rem);
    font-weight: 900;
    color: #801316;
    line-height: 1.08;
    margin-bottom: 22px;
    text-shadow: 0 4px 20px rgba(0, 0, 0, .18);
}

.hero-title em {
    font-style: italic;
    display: block;
    font-size: 1.15em;
}

.hero-sub {
    font-size: 1.5rem;
    font-family: UTM Copperplate;
    color: #801316;
    font-weight: 600;
    margin-bottom: 40px;
    max-width: 500px;
    margin-left: auto;
    margin-right: auto;
}

.btn-hero {
    font-family: UTM Copperplate;
    display: inline-block;
    background: var(--white);
    color: #801316;
    font-family: var(--font-body);
    font-weight: 800;
    font-size: 2rem;
    padding: 16px 44px;
    border-radius: 50px;
    text-decoration: none;
    box-shadow: 0 8px 30px rgba(0, 0, 0, .15);
    transition: transform .2s, box-shadow .2s;
    margin-top: 5px;
}

.btn-hero:hover {
    transform: translateY(-3px);
    box-shadow: 0 14px 40px rgba(0, 0, 0, .2);
}

/* Floating emojis */
.hero-floats {
    position: absolute;
    inset: 0;
    pointer-events: none;
    z-index: 1;
}

.float-item {
    position: absolute;
    font-size: 0.1rem;
    opacity: .55;
    animation: floatUp 6s ease-in-out infinite;
}

.f1 {
    top: 10%;
    left: 8%;
    animation-delay: 0s;
    font-size: 0.1rem;
}

.f2 {
    top: 20%;
    right: 6%;
    animation-delay: 1s;
    font-size: 0.1rem;
}

.f3 {
    top: 60%;
    left: 4%;
    animation-delay: 2s;
    font-size: 0.rem;
}

.f4 {
    top: 70%;
    right: 8%;
    animation-delay: .5s;
    font-size: 0.1em;
}

.f5 {
    top: 35%;
    left: 14%;
    animation-delay: 1.5s;
    font-size: 0.1rem;
}

.f6 {
    top: 45%;
    right: 14%;
    animation-delay: 2.5s;
    font-size: 0.1rem;
}

.f7 {
    top: 80%;
    left: 20%;
    animation-delay: 3s;
    font-size: 0.1rem;
}

.f8 {
    top: 15%;
    left: 40%;
    animation-delay: 3.5s;
    font-size: 1.6rem;
}

.f9 {
    top: 161px;
    left: 1809px;
    animation-delay: 3.5s;
    font-size: 1.6rem;
}

.f10 {
    top: 902px;
    left: 1077px;
    animation-delay: 3.5s;
    font-size: 1.6rem;
}

.f11 {
    top: 639px;
    left: 1683px;
    animation-delay: 3.5s;
    font-size: 1.6rem;
}

.f12 {
    top: 641px;
    left: 576px;
    animation-delay: 3.5s;
    font-size: 1.6rem;
}

.f13 {
    top: 102px;
    left: 1482px;
    animation-delay: 3.5s;
    font-size: 1.6rem;
}

.f14 {
    top: 99px;
    left: 1124px;
    animation-delay: 3.5s;
    font-size: 1.6rem;
}

.f15 {
    top: 945px;
    left: 1589px;
    animation-delay: 3.5s;
    font-size: 1.6rem;
}

@keyframes floatUp {

    0%,
    100% {
        transform: translateY(0) rotate(-5deg);
    }

    50% {
        transform: translateY(-22px) rotate(5deg);
    }
}

.hero-wave {
    position: absolute;
    bottom: -1px;
    left: 0;
    right: 0;
    height: 80px;
}

.hero-wave svg {
    width: 100%;
    height: 100%;
}

/* ---------- SHARED SECTION STYLES ---------- */
section {
    padding: 80px 0;
}

.section-title {
    font-family: UTM Copperplate;
    font-size: clamp(1.8rem, 4vw, 4rem);
    font-weight: 700;
    text-align: center;
    color: #801316;
    margin-bottom: 50px;
    position: relative;
}

.section-title::after {
    content: '';
    display: block;
    width: 60px;
    height: 4px;
    background: #801316;
    border-radius: 4px;
    margin: 14px auto 0;
}

.section-titles-new {
    font-family: UTM Copperplate;
    font-size: clamp(1.5rem, 3vw, 2rem);
    font-weight: 700;
    text-align: center;
    color: var(--text);
    margin-bottom: 50px;
    position: relative;
}

/* ---------- THỂ LỆ ---------- */
.rules {
    background: var(--white);
}

.rules-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 24px;
}

.rule-card {
    background: #f7ecc5;
    border-radius: var(--radius);
    padding: 36px 28px;
    text-align: center;
    border: 2px solid transparent;
    transition: border-color .25s, transform .25s, box-shadow .25s;
}

.rule-card:hover {
    border-color: #801316;
    transform: translateY(-5px);
    box-shadow: var(--shadow);
}

.rule-icon {
    font-size: 2.6rem;
    margin-bottom: 16px;
}

.rule-card h3 {
    font-family: UTM Copperplate;
    font-size: 1.5rem;
    margin-bottom: 10px;
    color: #801316;
}

.rule-card p {
    color: var(--muted);
    font-size: 1.42rem;
    line-height: 1.6;
    font-family: UTM Copperplate;
}

/* ---------- GIẢI THƯỞNG ---------- */
.prizes {
    background: #f7ecc5;
}

.prizes-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(145px, 1fr));
    gap: 20px;
}

.prize-card {
    background: var(--white);
    border-radius: var(--radius);
    padding: 28px 16px 20px;
    text-align: center;
    border-top: 5px solid var(--accent);
    box-shadow: 0 4px 18px rgba(0, 0, 0, .07);
    transition: transform .25s, box-shadow .25s;
}

.prize-card:hover {
    transform: translateY(-6px);
    box-shadow: 0 12px 30px rgba(0, 0, 0, .12);
}

.prize-icon {
    font-size: 2rem;
    margin-bottom: 10px;
}

.prize-name {
    font-weight: 700;
    font-size: 2rem;
    color: var(--text);
    margin-bottom: 8px;
    font-family: UTM Copperplate;
}

.prize-rate {
    font-family: var(--font-display);
    font-size: 1.6rem;
    font-weight: 700;
    color: var(--accent);
}

/* ---------- XÁC THỰC ---------- */
.verify {
    background: var(--white);
}

.verify-card {
    max-width: 520px;
    margin: 0 auto;
    background: #f7ecc5;
    border-radius: 24px;
    padding: 48px 40px;
    box-shadow: 0 10px 50px rgba(255, 107, 157, .12);
}

.verify-header {
    text-align: center;
    margin-bottom: 34px;
}

.verify-badge {
    display: inline-block;
    background: #801316;
    color: var(--white);
    font-weight: 800;
    font-size: 1.9rem;
    letter-spacing: .1em;
    text-transform: uppercase;
    padding: 5px 16px;
    border-radius: 30px;
    margin-bottom: 12px;
    font-family: UTM Copperplate;
}

.verify-header h2 {
    font-family: var(--font-display);
    font-size: 2rem;
    color: var(--text);
    margin-bottom: 8px;
    font-family: UTM Copperplate;
}

.verify-header p {
    color: var(--muted);
    font-size: 1rem;
    font-family: UTM Copperplate;
}

.field-group {
    margin-bottom: 20px;
    font-family: UTM Copperplate;
}

.field-group label {
    display: block;
    font-weight: 700;
    font-size: 1.4rem;
    color: var(--text);
    margin-bottom: 8px;
    text-align: center;
}

.field-group input {
    width: 100%;
    padding: 14px 18px;
    border: 2px solid #e8d8df;
    border-radius: 12px;
    font-family: var(--font-body);
    font-size: 1rem;
    background: var(--white);
    color: var(--text);
    transition: border-color .2s, box-shadow .2s;
    outline: none;
}

.field-group input:focus {
    border-color: #801316;
    box-shadow: 0 0 0 4px #801316;
}

.field-group input::placeholder {
    color: #bbb;
}

.verify-msg {
    min-height: 24px;
    font-weight: 700;
    font-size: .92rem;
    text-align: center;
    border-radius: 10px;
    padding: 0;
    margin-bottom: 0;
    transition: all .3s;
}

.verify-msg.error {
    color: #801316;
    background: #ffe8f2;
    padding: 10px;
    margin-bottom: 14px;
}

.verify-msg.success {
    color: #00b894;
    background: #e6fff8;
    padding: 10px;
    margin-bottom: 14px;
}

.btn-verify {
    width: 100%;
    margin-top: 10px;
    background: linear-gradient(135deg, #801316);
    color: var(--white);
    border: none;
    border-radius: 50px;
    padding: 17px;
    font-family: UTM Copperplate;
    font-size: 1.5rem;
    font-weight: 800;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: opacity .2s, transform .2s, box-shadow .2s;
    box-shadow: 0 6px 24px #801316;
}

.btn-verify:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 10px 32px #801316;
}

.btn-verify:disabled {
    opacity: .65;
    cursor: not-allowed;
}

.btn-loader {
    width: 20px;
    height: 20px;
    border: 3px solid rgba(255, 255, 255, .4);
    border-top-color: var(--white);
    border-radius: 50%;
    animation: spin .7s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* ---------- VÒNG QUAY ---------- */
.spin-section {
    background: var(--cream);
}

.spin-wrapper {
    text-align: center;
    max-width: 480px;
    margin: 0 auto;
}

.spin-header {
    margin-bottom: 36px;
}

.spin-header h2 {
    font-family: var(--font-display);
    font-size: 2rem;
    margin: 10px 0 6px;
}

.spin-header p {
    color: var(--muted);
    font-size: 0.8rem;
    font-family: UTM Copperplate;
}

.wheel-area {
    position: relative;
    display: inline-block;
}

.wheel-pointer {
    position: absolute;
    top: -10px;
    left: 50%;
    transform: translateX(-50%);
    font-size: 2rem;
    color: #801316;
    z-index: 5;
    filter: drop-shadow(0 2px 6px rgba(0, 0, 0, .2));
}

#wheelCanvas {
    border-radius: 50%;
    box-shadow: 0 12px 48px #801316, 0 0 0 8px #f7ecc5, 0 0 0 12px #801316;
    max-width: 90vw;
    max-height: 90vw;
}

.btn-spin {
    margin-top: 36px;
    background: linear-gradient(135deg, #801316);
    color: var(--white);
    border: none;
    border-radius: 50px;
    padding: 17px 52px;
    font-family: UTM Copperplate;
    font-size: 1.1rem;
    font-weight: 800;
    cursor: pointer;
    box-shadow: 0 8px 28px #801316;
    transition: transform .2s, box-shadow .2s, opacity .2s;
}

.btn-spin:hover:not(:disabled) {
    transform: translateY(-3px);
    box-shadow: 0 14px 36px #801316;
}

.btn-spin:disabled {
    opacity: .6;
    cursor: not-allowed;
}

/* ---------- POPUP ---------- */
.overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, .55);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    padding: 20px;
    backdrop-filter: blur(4px);
}

.popup {
    background: var(--white);
    border-radius: 28px;
    padding: 52px 44px 44px;
    text-align: center;
    max-width: 400px;
    width: 100%;
    box-shadow: 0 24px 80px rgba(0, 0, 0, .22);
    animation: popIn .4s cubic-bezier(.34, 1.56, .64, 1) both;
}

@keyframes popIn {
    from {
        transform: scale(.7);
        opacity: 0;
    }

    to {
        transform: scale(1);
        opacity: 1;
    }
}

.popup-emoji {
    font-size: 3rem;
    margin-bottom: 16px;
}

.popup h2 {
    font-family: var(--font-display);
    font-size: 1.5rem;
    color: var(--text);
    margin-bottom: 14px;
    font-family: UTM Copperplate;
}

.popup-prize {
    font-family: var(--font-display);
    font-size: 1rem;
    font-weight: 700;
    color: #801316;
    margin-bottom: 10px;
    font-family: UTM Copperplate;
}

.popup-msg {
    color: var(--muted);
    font-size: .95rem;
    font-family: UTM Copperplate;
    margin-bottom: 28px;
}

.btn-close {
    background: linear-gradient(135deg, #801316);
    color: var(--white);
    border: none;
    border-radius: 50px;
    padding: 13px 44px;
    font-family: UTM Copperplate;
    font-size: 1rem;
    font-weight: 800;
    cursor: pointer;
    transition: transform .2s;
}

.btn-close:hover {
    transform: translateY(-2px);
}

/* ---------- CONFETTI ---------- */
#confettiCanvas {
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 999;
}

/* ---------- FOOTER ---------- */
.footer {
    background: #f7ecc5;
    color: rgba(255, 255, 255, .75);
    text-align: center;
    padding: 40px 20px;
    font-size: .9rem;
    line-height: 2;
    font-family: UTM Copperplate;
}

.footer strong {
    color: #801316;
    font-size: 1rem;
    font-family: UTM Copperplate;
}

.footer-note {
    color: black;
    font-size: 0.5rem;
}

/* ---------- RESPONSIVE ---------- */
@media (max-width: 600px) {
    .verify-card {
        padding: 36px 24px;
    }

    .prizes-grid {
        grid-template-columns: repeat(1, 1fr);
    }

    .btn-spin {
        padding: 15px 36px;
    }

    .popup {
        padding: 40px 24px 36px;
    }
}