:root {
    --coral: #ff6f61;
    --yellow: #ffd84d;
    --teal: #00b8b0;
    --mint: #b7f2d7;
    --pink: #ff9fc8;
    --ink: #2d2638;
    --muted: #756d82;
    --paper: #fffaf4;
    --white: #ffffff;
    --shadow: 0 22px 70px rgba(45, 38, 56, .16);
}

* {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    margin: 0;
    min-height: 100vh;
    font-family: Arial, Helvetica, sans-serif;
    color: var(--ink);
    background:
        radial-gradient(circle at 10% 10%, rgba(255, 216, 77, .45), transparent 26rem),
        radial-gradient(circle at 90% 12%, rgba(0, 184, 176, .25), transparent 28rem),
        linear-gradient(135deg, #fff7e8 0%, #f7fffb 48%, #fff1f6 100%);
}

a {
    color: inherit;
    text-decoration: none;
}

.party-bg {
    position: fixed;
    inset: 0;
    overflow: hidden;
    pointer-events: none;
    z-index: 0;
}

.party-bg span {
    position: absolute;
    width: 12px;
    height: 36px;
    border-radius: 999px;
    opacity: .34;
    animation: floatConfetti 11s linear infinite;
}

.party-bg span:nth-child(1) { left: 8%; background: var(--coral); animation-delay: -2s; }
.party-bg span:nth-child(2) { left: 28%; background: var(--yellow); animation-delay: -7s; }
.party-bg span:nth-child(3) { left: 52%; background: var(--teal); animation-delay: -4s; }
.party-bg span:nth-child(4) { left: 72%; background: var(--pink); animation-delay: -9s; }
.party-bg span:nth-child(5) { left: 91%; background: var(--mint); animation-delay: -5s; }

@keyframes floatConfetti {
    from { transform: translateY(-20vh) rotate(0deg); }
    to { transform: translateY(120vh) rotate(360deg); }
}

.topbar,
main {
    position: relative;
    z-index: 1;
}

.topbar {
    max-width: 1180px;
    margin: 0 auto;
    padding: 22px 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.brand {
    display: inline-flex;
    align-items: baseline;
    gap: 6px;
    font-size: 22px;
}

.brand strong {
    color: var(--coral);
}

.brand span {
    color: var(--teal);
    font-weight: 800;
}

.topbar nav {
    display: flex;
    gap: 10px;
}

.topbar nav a {
    padding: 10px 14px;
    border-radius: 999px;
    background: rgba(255, 255, 255, .66);
    font-weight: 700;
    color: var(--muted);
}

.hero,
.content-grid,
.draw-hero,
.tickets-board,
.stats-strip {
    max-width: 1180px;
    margin: 0 auto;
    padding-left: 24px;
    padding-right: 24px;
}

.hero {
    min-height: 620px;
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(320px, 500px);
    align-items: center;
    gap: 46px;
    padding-top: 34px;
    padding-bottom: 46px;
}

.eyebrow {
    margin: 0 0 12px;
    color: var(--teal);
    font-weight: 900;
    text-transform: uppercase;
    font-size: 13px;
    letter-spacing: 0;
}

h1,
h2,
p {
    margin-top: 0;
}

h1 {
    margin-bottom: 18px;
    font-size: clamp(42px, 7vw, 78px);
    line-height: .94;
}

h2 {
    font-size: 30px;
    line-height: 1.1;
}

.lead {
    max-width: 620px;
    color: var(--muted);
    font-size: 20px;
    line-height: 1.55;
}

.hero-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 14px;
    margin-top: 28px;
}

.btn {
    border: 0;
    border-radius: 16px;
    padding: 14px 20px;
    font-weight: 900;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 50px;
    transition: transform .2s ease, box-shadow .2s ease;
}

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

.btn.primary {
    color: var(--ink);
    background: linear-gradient(135deg, var(--yellow), #ffad3d 52%, var(--coral));
    box-shadow: 0 14px 34px rgba(255, 111, 97, .28);
}

.btn.ghost {
    background: var(--white);
    color: var(--teal);
    box-shadow: 0 12px 28px rgba(0, 184, 176, .13);
}

.btn.full {
    width: 100%;
}

.product-stage {
    position: relative;
    animation: popIn .75s ease both;
}

@keyframes popIn {
    from { opacity: 0; transform: translateY(20px) scale(.96); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}

.product-stage img {
    display: block;
    width: 100%;
    aspect-ratio: 1;
    object-fit: cover;
    border: 12px solid var(--white);
    border-radius: 34px;
    box-shadow: var(--shadow);
    transform: rotate(2deg);
}

.price-badge {
    position: absolute;
    right: -14px;
    bottom: 28px;
    padding: 16px 18px;
    background: var(--ink);
    color: var(--white);
    border-radius: 22px;
    box-shadow: var(--shadow);
    animation: wiggle 3s ease-in-out infinite;
}

.price-badge small,
.price-badge strong {
    display: block;
}

.price-badge strong {
    font-size: 27px;
}

@keyframes wiggle {
    0%, 100% { transform: rotate(-3deg); }
    50% { transform: rotate(3deg) translateY(-4px); }
}

.stats-strip {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
    margin-bottom: 34px;
}

.stats-strip div,
.story-panel,
.buy-panel,
.draw-hero,
.tickets-board {
    background: rgba(255, 255, 255, .82);
    border: 1px solid rgba(255, 255, 255, .9);
    box-shadow: 0 18px 48px rgba(45, 38, 56, .1);
    backdrop-filter: blur(12px);
}

.stats-strip div {
    padding: 22px;
    border-radius: 24px;
}

.stats-strip span {
    display: block;
    font-size: 34px;
    font-weight: 900;
}

.stats-strip small {
    color: var(--muted);
    font-weight: 700;
}

.content-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(320px, 430px);
    gap: 24px;
    align-items: start;
    padding-bottom: 70px;
}

.story-panel,
.buy-panel,
.draw-hero,
.tickets-board {
    border-radius: 28px;
    padding: 28px;
}

.story-panel p {
    color: var(--muted);
    line-height: 1.7;
}

.progress {
    margin-top: 28px;
}

.progress-info {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 10px;
    color: var(--muted);
}

.progress-track {
    height: 16px;
    border-radius: 999px;
    background: #f0ecf3;
    overflow: hidden;
}

.progress-track span {
    display: block;
    height: 100%;
    border-radius: inherit;
    background: linear-gradient(90deg, var(--teal), var(--mint), var(--yellow), var(--coral));
}

.buy-panel h2 {
    margin-bottom: 8px;
}

.buy-panel > p {
    color: var(--muted);
}

.purchase-form {
    display: grid;
    gap: 14px;
}

label {
    display: grid;
    gap: 8px;
    color: var(--ink);
    font-weight: 800;
}

label span {
    color: var(--muted);
    font-weight: 600;
}

input,
textarea {
    width: 100%;
    border: 2px solid #ece4ee;
    border-radius: 16px;
    padding: 14px 15px;
    font: inherit;
    background: var(--white);
    color: var(--ink);
    outline: none;
}

input:focus,
textarea:focus {
    border-color: var(--teal);
    box-shadow: 0 0 0 4px rgba(0, 184, 176, .12);
}

.total-box {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px;
    border-radius: 18px;
    background: #fff6ca;
}

.total-box small {
    color: var(--muted);
    font-weight: 800;
}

.total-box strong {
    font-size: 24px;
}

.alert {
    border-radius: 16px;
    padding: 14px;
    margin: 14px 0;
    display: grid;
    gap: 6px;
    line-height: 1.45;
}

.alert.success {
    background: #eafff4;
    border: 1px solid #a9ebce;
}

.alert.error {
    background: #fff0f0;
    border: 1px solid #ffc8c8;
}

.draw-hero {
    margin-top: 34px;
    text-align: center;
}

.draw-hero h1 {
    font-size: clamp(40px, 6vw, 68px);
}

.draw-form {
    max-width: 360px;
    margin: 24px auto 0;
    display: grid;
    gap: 14px;
}

.winner-card {
    max-width: 520px;
    margin: 28px auto 0;
    padding: 26px;
    border-radius: 28px;
    background: linear-gradient(135deg, var(--yellow), var(--mint), var(--pink));
    box-shadow: var(--shadow);
}

.winner-card strong {
    display: block;
    margin: 8px 0;
    font-size: clamp(74px, 16vw, 132px);
    line-height: .9;
}

.winner-card span {
    font-weight: 900;
}

.reveal {
    animation: revealWinner .8s cubic-bezier(.17, .67, .29, 1.28) both;
}

@keyframes revealWinner {
    from { opacity: 0; transform: scale(.7) rotate(-4deg); }
    to { opacity: 1; transform: scale(1) rotate(0); }
}

.tickets-board {
    margin-top: 24px;
    margin-bottom: 70px;
}

.section-title {
    display: flex;
    justify-content: space-between;
    gap: 18px;
    align-items: center;
}

.section-title span {
    color: var(--muted);
    font-weight: 800;
}

.ticket-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    gap: 12px;
}

.ticket-chip {
    min-height: 82px;
    padding: 12px;
    border-radius: 18px;
    background: #f7fbff;
    border: 2px dashed rgba(0, 184, 176, .25);
}

.ticket-chip strong {
    display: block;
    font-size: 23px;
}

.ticket-chip small {
    display: block;
    color: var(--muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.ticket-chip.winner {
    background: #fff6ca;
    border-color: var(--coral);
    animation: pulseWinner 1.5s infinite;
}

@keyframes pulseWinner {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.04); }
}

.empty {
    color: var(--muted);
}

@media (max-width: 840px) {
    .topbar {
        align-items: flex-start;
        gap: 12px;
    }

    .hero,
    .content-grid {
        grid-template-columns: 1fr;
    }

    .hero {
        min-height: auto;
        padding-top: 20px;
    }

    .stats-strip {
        grid-template-columns: 1fr;
    }

    .product-stage {
        max-width: 520px;
        margin: 0 auto;
    }
}

@media (max-width: 560px) {
    .topbar {
        padding: 18px 16px;
        flex-direction: column;
    }

    .hero,
    .content-grid,
    .draw-hero,
    .tickets-board,
    .stats-strip {
        padding-left: 16px;
        padding-right: 16px;
    }

    .hero-actions {
        display: grid;
    }

    .story-panel,
    .buy-panel,
    .draw-hero,
    .tickets-board {
        padding: 20px;
        border-radius: 22px;
    }

    .price-badge {
        right: 10px;
        bottom: 16px;
    }
}

textarea {
    min-height: 130px;
    resize: vertical;
}

.admin-hero {
    max-width: 1180px;
    margin: 34px auto 24px;
    padding: 0 24px;
}

.admin-hero h1 {
    font-size: clamp(38px, 6vw, 64px);
}

.admin-hero p {
    max-width: 720px;
    color: var(--muted);
    font-size: 18px;
    line-height: 1.6;
}

.admin-grid {
    padding-bottom: 24px;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 14px;
}

.admin-help p {
    color: var(--muted);
    line-height: 1.65;
}

.admin-list {
    margin-top: 0;
}

.raffle-list {
    display: grid;
    gap: 12px;
}

.raffle-row {
    display: grid;
    grid-template-columns: 82px 1fr;
    gap: 14px;
    align-items: center;
    padding: 12px;
    border-radius: 18px;
    background: #fffaf4;
    border: 1px solid #f2e8d8;
}

.raffle-row img {
    width: 82px;
    height: 82px;
    object-fit: cover;
    border-radius: 16px;
}

.raffle-row strong,
.raffle-row span {
    display: block;
}

.raffle-row span {
    margin-top: 6px;
    color: var(--muted);
    font-weight: 700;
}

@media (max-width: 560px) {
    .form-row,
    .raffle-row {
        grid-template-columns: 1fr;
    }
}
.check-row {
    display: flex;
    grid-template-columns: none;
    align-items: center;
    gap: 10px;
    padding: 12px 14px;
    border-radius: 16px;
    background: #eafff4;
}

.check-row input {
    width: 18px;
    height: 18px;
}

.inline-action {
    display: flex;
    justify-content: flex-end;
}

.raffle-row {
    grid-template-columns: 82px 1fr auto;
}

@media (max-width: 560px) {
    .raffle-row {
        grid-template-columns: 1fr;
    }

    .inline-action {
        justify-content: stretch;
    }
}
.raffle-row {
    grid-template-columns: 1fr auto;
}

.raffle-row.selected {
    border-color: var(--teal);
    box-shadow: 0 12px 34px rgba(0, 184, 176, .14);
}

.raffle-main-link {
    display: grid;
    grid-template-columns: 82px 1fr;
    gap: 14px;
    align-items: center;
    min-width: 0;
}

.raffle-main-link small {
    display: block;
    margin-top: 6px;
    color: var(--muted);
    font-weight: 700;
}

.raffle-actions {
    display: flex;
    gap: 10px;
    align-items: center;
    justify-content: flex-end;
    flex-wrap: wrap;
}

.raffle-detail {
    margin-top: 0;
}

.compact-stats {
    padding: 0;
    margin: 20px 0 24px;
    max-width: none;
}

.buyers-title {
    margin-top: 8px;
}

.buyers-table-wrap {
    width: 100%;
    overflow-x: auto;
}

.buyers-table {
    width: 100%;
    min-width: 760px;
    border-collapse: collapse;
    background: var(--white);
    border-radius: 18px;
    overflow: hidden;
}

.buyers-table th,
.buyers-table td {
    padding: 13px 14px;
    text-align: left;
    border-bottom: 1px solid #f1e8f3;
    vertical-align: top;
}

.buyers-table th {
    background: #fff6ca;
    color: var(--ink);
    font-size: 13px;
    text-transform: uppercase;
}

.buyers-table small {
    color: var(--muted);
    font-weight: 700;
}

@media (max-width: 760px) {
    .raffle-row,
    .raffle-main-link {
        grid-template-columns: 1fr;
    }

    .raffle-actions,
    .inline-action {
        justify-content: stretch;
    }

    .raffle-actions .btn,
    .inline-action .btn {
        width: 100%;
    }
}