:root {
    --primary-grad: linear-gradient(135deg, #fff5f5 0%, #ffe4e1 100%);
    --accent: #f39c12;
    --prizes-color: #f31266;
    --prizes-hover: #d11058;
    --text: #4a4a4a;
    --white: #ffffff;
    --sold: #ececec;
    --shadow: 0 15px 35px rgba(0,0,0,0.06);
}

body { font-family: 'Poppins', sans-serif; background: #ffffff; margin: 0; color: var(--text); line-height: 1.6; -webkit-tap-highlight-color: transparent; }
.container { max-width: 1100px; margin: 0 auto; padding: 0 15px; }

/* HEADER GENTILE */
.hero-slim {
    background-color: #fff5f5;
    background-image: linear-gradient(135deg, rgba(255,182,193,0.1) 25%, transparent 25%), linear-gradient(225deg, rgba(255,182,193,0.1) 25%, transparent 25%), linear-gradient(45deg, rgba(255,182,193,0.1) 25%, transparent 25%), linear-gradient(315deg, rgba(255,182,193,0.1) 25%, transparent 25%), var(--primary-grad);
    background-position: 30px 0, 30px 0, 0 0, 0 0; background-size: 60px 60px;
    padding: 11px 0 70px 0; text-align: center; position: relative; overflow: hidden;
}
.hero-slim h1 { font-family: 'Montserrat', sans-serif; font-size: 2.2rem; margin: 0; font-weight: 800; color: #d63031; text-transform: uppercase; letter-spacing: 1.5px; }
.hero-slim p { margin-top: 10px; font-weight: 500; color: #b33939; opacity: 0.8; }
.wave-divider { position: absolute; bottom: -1px; left: 0; width: 100%; overflow: hidden; line-height: 0; }
.wave-divider svg { width: calc(100% + 1.3px); height: 80px; }
.wave-divider .shape-fill { fill: #ffffff; }

/* STORIES CARDS */
.stories { display: grid; grid-template-columns: 1fr 1fr; gap: 30px; margin-top: -65px; position: relative; z-index: 5; }
.card { background: var(--white); border-radius: 25px; overflow: hidden; box-shadow: var(--shadow); border: 1px solid rgba(0,0,0,0.03); display: flex; flex-direction: column; transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275); }
.card:hover { transform: translateY(-15px); box-shadow: 0 25px 50px rgba(0,0,0,0.1); }
.card-img-container { position: relative; height: 340px; flex-shrink: 0; overflow: hidden; }
.card img { width: 100%; height: 100%; object-fit: cover; transition: transform 0.6s ease; }
.card:hover img { transform: scale(1.08); }
.tag { position: absolute; bottom: 20px; right: 20px; padding: 7px 18px; border-radius: 50px; color: white; font-weight: 700; z-index: 2; }
.tag-blue { background: #0984e3; } .tag-red { background: #d63031; }
.card-content { padding: 30px; flex-grow: 1; display: flex; flex-direction: column; }
.card-content h2 { margin: 0 0 12px 0; font-family: 'Montserrat', sans-serif; font-size: 1.5rem; color: #2d3436; }
.card-content p { margin: 0; font-size: 0.95rem; color: #636e72; text-align: justify; flex-grow: 1; }
.btn-share-fb { display: inline-block; background-color: #1877F2; color: white; padding: 12px 24px; border-radius: 50px; text-decoration: none; font-weight: 600; font-size: 0.9rem; margin-top: 20px; text-align: center; transition: all 0.3s ease; }
.btn-share-fb:hover { background-color: #145dbf; transform: scale(1.05); transform: translateY(-2px); box-shadow: 0 5px 15px rgba(24, 119, 242, 0.3); }

/* LOTTERY BOX */
.lottery-box { background: #fff; margin: 80px 0; padding: 50px 20px; border-radius: 35px; box-shadow: 0 20px 60px rgba(0,0,0,0.05); text-align: center; }
.lottery-actions { display: flex; justify-content: center; align-items: center; gap: 20px; margin-bottom: 25px; flex-wrap: wrap; }
.price-bubble { background: #fff9eb; color: #d35400; padding: 12px 30px; border-radius: 50px; border: 1px solid #fde6b3; font-weight: 700; }
.btn-prizes { background: var(--prizes-color); color: white; border: none; padding: 12px 30px; border-radius: 50px; font-weight: 600; cursor: pointer; transition: all 0.3s ease; box-shadow: 0 8px 20px rgba(243, 18, 102, 0.25); }
.btn-prizes:hover { background: var(--prizes-hover); transform: translateY(-3px) scale(1.05); }

/* LEGENDA & TICKETS LEFT */
.legend { margin-bottom: 20px; display: flex; justify-content: center; gap: 25px; font-size: 0.95rem; font-weight: 600; }
.leg-item { display: flex; align-items: center; gap: 10px; }
.dot { width: 16px; height: 16px; border-radius: 5px; display: inline-block; }
.dot.free { border: 1px solid #ddd; background: #fff; }
.dot.sold { background: var(--sold); }
.dot.selected { background: var(--accent); }

.tickets-left { 
    margin-bottom: 10px; 
    font-size: 1.1rem; 
    color: #2d3436; 
    background: #f8f9fa; 
    display: inline-block; 
    padding: 10px 25px; 
    border-radius: 50px;
    border: 1px dashed #ced4da;
}
.tickets-left strong { color: #d63031; font-weight: 800; }

/* NUOVA RIGA ULTIMI ACQUISTI */
.last-buyer-info {
    margin-bottom: 30px;
    font-size: 0.9rem;
    color: #636e72;
    font-weight: 600;
    text-transform: uppercase;
}
.last-buyer-info .highlight {
    color: #d63031;
    font-weight: 800;
}

/* GRID */
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(50px, 1fr)); gap: 12px; max-width: 750px; margin: 0 auto; }
.num { aspect-ratio: 1; display: flex; align-items: center; justify-content: center; background: #fff; border: 1px solid #eee; border-radius: 10px; cursor: pointer; font-weight: 700; font-size: 1.2rem; position: relative; transition: all 0.25s ease; outline: none; }
.num:hover:not(.sold), .num:focus:not(.sold) { border-color: var(--accent); color: var(--accent); transform: translateY(-5px); z-index: 10; }
.num.selected { background: var(--accent); color: white; border-color: var(--accent); }
.num.sold { background: var(--sold); color: #b2bec3; cursor: help; border: none; text-decoration: line-through; }

/* TOOLTIP */
.tooltip { visibility: hidden; width: 160px; background-color: #2d3436; color: #fff; text-align: center; border-radius: 8px; padding: 10px; position: absolute; z-index: 100; bottom: 130%; left: 50%; transform: translateX(-50%); opacity: 0; transition: 0.3s; font-size: 0.8rem; pointer-events: none; }
.has-tooltip:hover .tooltip, .has-tooltip:focus .tooltip, .has-tooltip:active .tooltip { visibility: visible; opacity: 1; transform: translateX(-50%) translateY(-5px); }

/* MODAL PREMI */
.modal-overlay { position: fixed; top: 0; left: 0; width: 100%; height: 100%; background: rgba(0,0,0,0.6); backdrop-filter: blur(12px); z-index: 1000; display: flex; align-items: center; justify-content: center; padding: 20px; }
.modal-content { background: white; width: 100%; max-width: 1100px; max-height: 92vh; border-radius: 35px; overflow-y: auto; padding: 45px; position: relative; box-shadow: 0 30px 100px rgba(0,0,0,0.1); }
.modal-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 30px; border-bottom: 2px solid #f8f9fa; padding-bottom: 15px; }
.btn-close { background: transparent; border: none; font-size: 2rem; color: #999; cursor: pointer; transition: all 0.3s ease; padding: 10px; display: flex; align-items: center; justify-content: center; }
.btn-close:hover { color: var(--prizes-color); transform: rotate(90deg) scale(1.2); }
.prizes-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(245px, 1fr)); gap: 25px; }
.prize-card { background: #fff; border: 1px solid #f1f1f1; border-radius: 25px; padding: 20px; text-align: center; transition: 0.3s; display: flex; flex-direction: column; }
.prize-photos { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-bottom: 15px; }
.photo-box { height: 140px; background: #fafafa; border-radius: 15px; display: flex; align-items: center; justify-content: center; overflow: hidden; }
.photo-box img { max-width: 95%; max-height: 95%; object-fit: contain; }

/* CHECKOUT */
.checkout { background: #fffdf5; border-radius: 20px; padding: 30px; margin: 40px auto 0 auto; max-width: 450px; border: 1px solid #f9ebbe; text-align: center; }
.input-group { margin-bottom: 20px; text-align: left; }
.input-group label { display: block; font-weight: 600; margin-bottom: 8px; font-size: 0.9rem; }
.input-group input { width: 100%; padding: 12px; border: 2px solid #ddd; border-radius: 12px; font-size: 1rem; box-sizing: border-box; font-family: inherit; }
.total { font-size: 1.5rem; color: var(--accent); display: block; margin-top: 10px; font-weight: bold; }
.footer { padding: 40px 0; text-align: center; opacity: 0.6; }

/* CONDIVIDI GLOBALE */
.btn-share-global {
    position: fixed; bottom: 30px; right: 30px; z-index: 999;
    background-color: #1877F2; color: white;
    padding: 15px 25px; border-radius: 50px;
    text-decoration: none; display: flex; align-items: center; gap: 10px;
    box-shadow: 0 10px 30px rgba(24, 119, 242, 0.4);
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}
.btn-share-global:hover { transform: scale(1.1) translateY(-5px); background-color: #145dbf; }
.share-text { font-weight: 600; font-size: 1rem; }

@media (max-width: 768px) { 
    .stories { grid-template-columns: 1fr; } 
    .card-img-container { height: 280px; } 
    .hero-slim h1 { font-size: 1.6rem; }
    .btn-share-global { bottom: 20px; right: 20px; padding: 12px 15px; }
    .share-text { display: none; }
}